Terra Classic Delta-Neutral Strategy (Retired)
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 Deployed Contracts page for contract addresses on various networks.
Open Position
To open a position on Aperture, interact with the Aperture Manager contract on Terra with the ExecuteMsg variant CreatePosition
:
Delta-neutral Strategy (Terra)
Strategy JSON:
Note that the chain_id
value for Terra is 3
. Aperture uses the same chain_id values as Wormhole.
Parameter (data) format:
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 at0.3
. For example, if the minimum collateral ratio required for mAAPL is1.5
, thentarget_min_collateral_ratio
must be at least1.8
.Currently the target CR range must be
0.4
wide, i.e. the equalitytarget_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.
Sample position-open tx: https://terrasco.pe/mainnet/tx/A87F26A7A6137C87E968B02AC20CCB2F1FE2313D42349FAD3F330D3A50CA1AC8
Query Position Ids
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.
Query Position Information
You may query the Delta-neutral Manager contract for detailed position information with the following request:
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 Terra Hive for batch query use cases.
Close Position
To open a position on Aperture, interact with the Aperture Manager contract on Terra with the ExecuteMsg variant CreatePosition
:
Sample position-close tx: https://terrasco.pe/mainnet/tx/5F437BD5AC9DD6B038D8C1A5B2AEAF4928BE817F5BFE4A82530E5B914354E763
Last updated