Terra Classic Delta-Neutral Strategy (Retired)
Last updated
Last updated
This guide is intended for developers who wish to interact with Aperture contracts directly on Avalanche. Regular users are advised to use the official Aperture web app.
Please consult the page for contract addresses on various networks.
To open a position on Aperture, interact with the Aperture Manager contract on Terra with the ExecuteMsg variant CreatePosition
:
strategy
Strategy
Specifies the strategy to use.
data
Binary
Binary representing parameters taken by the specificed strategy.
assets
Vector of assets to deposit into the position.
The delta-neutral strategy requires a set of parameters of the following JSON format:
target_min_collateral_ratio
and target_max_collateral_ratio
specify the target collateral ratio range with the following requirements:
target_min_collateral_ratio
must exceed the minimum required collateral ratio for the mAsset by at least the safety margin amount. The safety margin value is configurable by the Delta-neutral Manager contract, currently set at 0.3
. For example, if the minimum collateral ratio required for mAAPL is 1.5
, then target_min_collateral_ratio
must be at least 1.8
.
Currently the target CR range must be 0.4
wide, i.e. the equality target_min_collateral_ratio + 0.4 = target_max_collateral_ratio
must hold.
The parameter JSON should be encoded in base-64 and passed as the data
field of the CreatePosition
enum variant when opening a position.
To get a list of position ids held by a Terra address, query the Aperture Manager contract with the following request:
Note that all position ids are returned, including active and closed positions.
You may query the Delta-neutral Manager contract for detailed position information with the following request:
To open a position on Aperture, interact with the Aperture Manager contract on Terra with the ExecuteMsg variant CreatePosition
:
position_id
Uint128
Specifies the id of the position to close. The caller must be the position holder.
action
Action
Should specify the ClosePosition
Action variant with the desired recipient (could be the position holder address or any other address).
assets
Must be an empty vector since no deposits are needed for the close-position action.
Vec<>
Note that the chain_id
value for Terra is 3
. Aperture uses the same chain_id values as .
Sample position-open tx:
Note that you may specify multiple position ids in the positions
array. However, most Terra nodes set a low query gas limit so you may receive an out-of-gas error if more than one position id is requested. It is recommended to use for batch query use cases.
Vec<>
Sample position-close tx: