Option Contract
Option Contract
Interface
Events
event BuyOption(uint256 orderNo, uint256[3] inData, address buyer)
**Users buy options **
order_no
order_no
inData[0]
position
inData[1]
buy amount
inData[2]
fee
buyer
buyer address
SellOption(uint256 orderNo, uint256[3] outData, address seller)
Users sell options
order_no
order_no
outData[0]
position
outData[1]
sell amount
outData[2]
fee
seller
seller address
UserExercise(uint256 orderNo,uint256[3] outData,bool isKnockout,address user)
Users exercise or knockout liquidation
order_no
order_no
outData[0]
position
outData[1]
user profit
outData[2]
fee
isKnockout
Exercise or knockout liquidation at maturity
user
user address
MakerKnockOut(uint256[] orderNoArr)
The order of Market maker liquidation
orderNoArr
The list of liquidation
MakerExercise(uint256[] orderNoArr)
The order of market maker exercise at expiration
orderNoArr
The list of 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 **
order_no
uint256
order_no
indexNo
uint256
index no
poolId
uint8
pool id
payToken
address
pay token
startPrice
uint256
Start price,is also strike price
exerciseTime
uint256
option exercise time
isCall
bool
is call option
balance
uint256
The balance of option contract
margin
uint256
Margin of market maker
makerIncome
uint256
Income of market maker
price
uint256
Price of open positions
status
uint8
0:Opened position, 1: Exercised,2:Knockouted
node
8.Exercise Price
mapping(uint256 => mapping(uint256 => uint256)) public exercisePrice
index_no
uint256
index_no
exerciseTime
uint256
option exercise time
index_price
uint256
index price at exercise time
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