Trading Fees
Link to code: https://github.com/IVX-FI/ivx-diem/blob/759836ea5fed1951d9ee88514e84c1d4e092411f/src/options/IVXDiemToken.sol#L268
Fees Due to Vega (Scenarios)
When buying an option, the trader is decreasing the AMM's net vega exposure
When selling an option, the trader is increasing the AMM's net vega exposure
We want to force traders who move the AMM net exposure further away from 0 to pay more in fees
Example 1

In this case, in Scenario 1 we force the AMM to take more risk than in Scenario 2, so Scenario 1 pays more in fees
Example 2

In this case, in Scenario 2 we force the AMM to take more risk than in Scenario 1, so Scenario 2 pays more in fees
What are the vega fees?
First, we need to know if the trade is forcing the AMM to take more risk, so we calculate a vega factor vf:

What are the fees? Well it depends on whether the trade is forcing the AMM into more risk or not (this is covered by vf), but also whether the trade is a long or a short, since we don't want to allow fees to turn into rebates
Example 1

Example 2

Fees Due to Delta (Scenarios)
Delta is a bit different to vega, since the delta of an option can be positive or negative
For example, buying an option can be a positive or a negative delta trade, depending on whether the option is a call or a put option
First, we need to know if the trade is forcing the AMM to take more risk, so we calculate a delta factor Δf:

Example (Buying a Put)
If a trader buys a put, he forces the AMM to sell a put
A put has a negative delta, so if I sell a put, my position is positive delta
Let's say a put option has Δ=−0.5, this is a number of units of Ethereum or dollars (You must answer this question, we need to decide, since our fees should be based on dollars)
So the AMM needs to increase its delta by −Δ=0.5.
Scenario 1 (AMM is Long Delta)

Scenario 2 (AMM is Short Delta)

Example (Buying a Call)
If a trader buys a call, he forces the AMM to sell a call
A call has a positive delta, so if I buy a call, my position is positive delta
AMM just sold a call, so if the option has Δ=0.5, then the AMM's delta needs to decrease by −0.5.
Scenario 1 (AMM is Long Delta)
Scenario 1 (AMM is Short Delta)
Last updated