Exercise
Options buyers can exercise their right during the window of expiration.

The event of exercising an option requires the following initial information: 1. Amount To Exercise 2. Owner
After the information was supplied, the exercise function will perform the following activities:
This function can only be called duringexerciseWindowperiod, depending on the exercise type.
For European: after trade window and before expiration. For American: anytime before expiration.

This balance should reflect the new current strikeReserves, considering the interest that accrued in the meanwhile. We are calling balanceOf()from ERC20 strike asset to check option contract strike asset balance.

This step calculates how many strike assets the user will receive in a put option after it requested the exercise.
StrikeToSend=ExerciseAmountStrikePriceStrikeToSend=ExerciseAmount\cdot StrikePrice

This step calculates the amount a user should receive in underlying assets after the exercise was requested in the case of a call option.
UnderlyingToReceive=ExerciseAmountUnderlyingToReceive=ExerciseAmount

Using the current
StrikeReservesStrikeReserves
(accrued with interest from the last period), we'll deduct the amount
StrikeToSendStrikeToSend
used while minting this option.

Using the current
UnderlyingReservesUnderlyingReserves
(accrued with interest from the last period), we'll add the amount of underlying to transfer used while minting this option. Also, now with the expiration, one can either receive tokens or send tokens. In the case of a put option, this balance should increase if the options were exercised. That means an option buyer chose to exercise options.
UnderlyingReservesi=UnderlyingReservesn+UnderlyingToReceiveUnderlyingReserves_i=UnderlyingReserves_n+UnderlyingToReceive

Burn exercised options.
Burn=ExerciseAmountBurn = ExerciseAmount
Note that exercise functions do not impact the
TotalSharesTotalShares
or any
OwnerSharesOwnerShares
.
Exercise options ✅
Copy link
On this page
Exercise
1) Consult Current
2) Calculate
3) Calculate
4) Updates
4.1) Update
4.2) Update
5) Burn options