How to Execute a Trade
Impermanent Gain positions can be minted or burnt through DVPs. For details on DVPs, please refers to the specific section:
For security reason, it is not possible to interact directly with DVPs, but instead users have to go through the Position Manager.
To retrive position manager address you can use the functionsetDvpPositionManager
Mint Impermanent Gain
To buy (mint) an Impermanent Gain position, you have to pass the compiled struct to the PositionManager.mint(struct params) function:
notionalUp, notionalDown, strike and expectedPremium have the same decimals as the base token. For instance, if the base token is USDC, all the above-mentioned quantities have 6 decimals. Therefore to buy $ 10 000 of notional of Bull Impermament Gain, one has to input notionalUp = 10 000 * 10^6. Similarly, the expectedPremium for such amount of notional would be calculated as dvp.premium(strike, 10 000 * 10^6, 0).
Burn Impermanent Gain
To sell or close (burn) post expiry an Impermanent Gain position, you have to pass the compiled struct to the PositionManager.burn(struct params) function:
Last updated