Trading
In all structures below,
rollover_hints_list
can be left emptybuy
method expresses collateral and minimal derivative amounts in minimal units. redeemable
boolean parameter determines whether or not to update all of user's derivative positions in the pool and withdraw all settlment proceeds to wallet, if any (this will be done automatically for the derivative being traded).seth send $POOL "buy(uint256,uint256,uint8,uint256,bool,tuple[])" $COLLATERAL_AMOUNT $DERIVATIVE_INDEX $SIDE $MIN_DERIVATIVE_AMOUNT $REDEEMABLE $ROLLOVER_HINTS_LIST
sell
method expresses derivative and collateral amounts in minimal units. redeemable
boolean parameter determines whether or not to update all of user's derivative positions in the pool and withdraw all settlment proceeds to wallet, if any (this will be done automatically for the derivative being traded). seth send $POOL "sell(uint256,uint256,uint8,uint256,bool,tuple[])" $COLLATERAL_AMOUNT $DERIVATIVE_INDEX $SIDE $MIN_DERIVATIVE_AMOUNT $REDEEMABLE $ROLLOVER_HINTS_LIST
seth send $POOL_PORTFOLIO "transferFrom(address,address,uint256)" $FROM_ADDRESS $TO_ADDRESS $PORTFOLIO_NFT_ID
All derivative positions associated with a trader's portoflio NFT can be transferred to another NFT by the standard ERC721 method
transferFrom
. The transferred portfolio is merged with any existing portfolio of the destination NFT, and the origin NFT will be burnt.seth send $POOL_PORTFOLIO "transferFrom(address,address,uint256)" $FROM_ADDRESS $TO_ADDRESS $PORTFOLIO_NFT_ID
moveDerivative
method is used to transfer part of a derivative position to another account. Derivative amount is expressed in minimal units.seth send $POOL "moveDerivative(address,uint256,uint256,uint8,tuple[])" $RECEPIENT_ADDRESS $DERIVATIVE_AMOUNT $DERIVATIVE_INDEX $SIDE $ROLLOVER_HINTS_LIST
Last modified 11mo ago