Option Contract
Option Contract
Interface
Events
event BuyOption(uint256 orderNo, uint256[3] inData, address buyer)
**Users buy options **
SellOption(uint256 orderNo, uint256[3] outData, address seller)
Users sell options
UserExercise(uint256 orderNo,uint256[3] outData,bool isKnockout,address user)
Users exercise or knockout liquidation
MakerKnockOut(uint256[] orderNoArr)
The order of Market maker liquidation
MakerExercise(uint256[] orderNoArr)
The order of market maker exercise at expiration
Methods(Read Contract)
1.KnockOut Rebake
uint256 public knockOutRebake
After knockout, users can get the percentage of rebake for the purchase price, rate=knockOutRebake/10000*100%
2.Base PoolsInfo
Get the knockout scale and exercise cycle for the specified poolId
uint256[2][16] public basePoolsInfo;
node
3. Pay Token
IERC20 public immutable payToken;
**Address of payment token ** node
4. Pay Token Decimals
uint256 public immutable payTokenDecimals
the accuracy of token,e.g., usdt is 1e6
5. Sign Data Public
address public signDataPublic
The sign address when users buy and sell options
6. Sign Valid Time
uint256 public signValidTime
** The maximum validity period for a signature **
5. fee receiver
address public feeReceiver
**Developers' address to receive platform fees **
6. Sell Price Rate
uint256 public sellPriceRate
When you sell an option, multiply ratio on the basis of the quantitative price model, the initial ratio is 70%,ratio=sellPriceRate/10000*100%
7.Orders
**View options details **
node
8.Exercise Price
mapping(uint256 => mapping(uint256 => uint256)) public exercisePrice
9. User Rate
uint256[5] public userRate
User buy and sell options rate
node
userRate[0]:Open put position rate userRate[1]:Option call position rate userRate[2]:Close put positon rate userRate[3]:Close call position rate userRate[4]:Exercise rate
Methods(Write Contract)
1. Buy Option
Buy options Please refer to Reference
2. Sell Option
Sell option
Please refer to Reference
3. UserExercise
User exercise
4. User Knockout
User Knockout
Last updated