How to Execute a Trade
Mint Impermanent Gain
Burn Impermanent Gain
Last updated
Last updated
struct MintParams {
uint256 tokenId; // 0 to open a new position, ID of the position to increase an existing position
address dvpAddr; // Address of the DVP
uint256 notionalUp; // Notional of the position, for Bull Impermanent Gain
uint256 notionalDown; // Notional of the position, for Bear Impermanent Gain
/* NOTE: it is possible to mint positions with both notionalUp and notionalDown > 0, however only symmetrical positions are accepted (called in the frontend and the docs "Impermanent Gain Smile").
It is not possible to mint asymmetrical Impermanent Gain positions */
uint256 strike; // Current strike of the DVP. It can be retrieved by calling dvp.currentStrike();
address recipient; // Trader address
uint256 expectedPremium; // Expected premium to be paid to mint the position. It can be calculated calling dvp.premium(currentStrike, notionalUp, notionalDown); which also returns an estimation of the fees to mint
uint256 maxSlippage; // Maximum slippage of the premium accepted (1e18 = 100%, 0.1e18 = 10%, β¦)
uint256 nftAccessTokenId; // 0 if disabled, ID of the NFT that allows recipient to trade if enabled
}struct SellParams {
uint256 tokenId; // ID of the position to be sold
uint256 notionalUp; // Notional of the position, for Bull Impermanent Gain
uint256 notionalDown; // Notional of the position, for Bear Impermanent Gain
/* NOTE: it is possible to burn all or a just a part of a position. For Smile Impermanent Gain (aka positions with both notionalUp and notionalDown) it is possible to burn only symmetrical amount of notionalUp and notionalDown */
uint256 expectedMarketValue; // Epxected payoff received when burning the position. It can be calculated by calling dvp.payoff(expiryEpochOfThePosition, currentStrikeOfThePosition, notionalUp, notionalDown); which also returns an estimation of the fees to burn
uint256 maxSlippage; // Maximum slippage of the payoff accepted (1e18 = 100%, 0.1e18 = 10% β¦)
}