Position Open

When a position-open transaction is initiated, Aperture's delta-neutral manager contract instantiates a new position contract to hold funds for this new position. For the specified investment size, Aperture delta-neutral contract's algorithm determines the most capital efficient way to split up the input UST amount into two parts:

  1. Collateral amount: amount of UST to be deposited to Anchor, and the resulting aUST to be used as collateral to open a short mAsset position and start short-farming;

  2. Long amount: amount of UST to be swapped for mAsset of an amount equal to the short amount.

Notice that the UST proceeds from the short sale is locked for two weeks as dictated by Mirror protocol's lock_period parameter (reference). During this lock period, the longed mAsset will sit idly in the instantiated position contract and won't be participating in long-farming; after the UST proceeds are unlocked, mAsset in the long position will then be paired with the unlocked UST to form Terraswap LP token and start getting long farm reward. As a result, performance of Aperture delta-neutral positions will be lower during the first two weeks as only short farm reward and Anchor yield are in force during this initial lock period.

Let's go through a real-world example of a position-open transaction:

The user initiates a delta-neutral position with the following parameters:

  • Investment size: 100,000.00 UST.

  • mAsset: mARKK (ARK Innovation ETF).

  • Target collateral ratio: 300%.

First, Aperture's delta-neutral manager contract instantiates a position contract to hold funds in service of this new position.

Next, the on-chain algorithm determines that, given the current state of the mARKK-UST Terraswap pool and the current mARKK oracle price, the best way to split up the funds is to:

  1. Allocate 74,258.166274 UST to be posted as collateral;

  2. Swap the remaining 25,741.833726 UST for the long-position mARKK at the end.

Once the allocation is determined, the contract takes the following series of actions to open the short position and start getting short-farm reward:

  1. Deposit 74,258.166274 UST to Anchor and get back 62,604.383842 aUST;

  2. Ask the Mirror Mint contract to mint mARKK with 62,604.383842 aUST as collateral, and a collateral ratio of 300%, resulting in 353.458832 mARKK minted (and shorted);

  3. Since we opened an mARKK short position, the Mirror Mint contract automatically swaps the minted 353.458832 mARKK for UST via Terraswap, resulting in 25,583.500150 UST in short proceeds;

  4. (Keep in mind that the short proceeds will be locked for two weeks, so these funds are not available to the position contract at this time);

At this time, the short position is complete and short farm reward in MIR starts to accumulate.

Finally, the delta-neutral position contract swaps 25,741.833726 UST for mARKK; the amount of mARKK returned by Terraswap should be exactly the same as the shorted amount. That's exactly what happens in the example transaction.

Last updated