Functions
The functions and variables that are possible within the options AMM.
Main Functions
The following properties have to be defined to create a new pool:
TokenA
In the case of the optionAMM tokenA will always be the option token.
TokenB
In the case of the optionAMM tokenA will always be the stable token.
The initial sigma of the pool
Once a pool was created, the following can happen in a given instant :
{ }
In a nutshell, the events can be translated to:
Add Liquidity () Users can provide one side or both sides of assets as liquidity to a pool to earn fees.
Re-add Liquidity ()
Users who had provided liquidity before can add liquidity again with no impact on their previous added funds.
Trade () Users can buy or sell assets to the pool paying a fee.
Remove Liquidity () Users that previously added funds to the pool can withdraw liquidity.
A price has to be calculated for the option within the pool for a trade to happen.
The pricing formula below simplifies the actual pricing model and explains how the AMM updates the option premium on a particular instant. For more details, see Pricing.
, the opening price (price when the event starts to happen), is defined as a function . This function uses an external vector of (currently leveraging Chainlink with their spot price update feed) and an internal vector (Implied Volatility) in our implementation of Black Scholes.
The price is defined as the quantity of token B needs to buy one token A at a given time .
Considering and the amounts of token A and token B, respectively that will be sent or received by the contract in the case of trade.
Consider the number of tokens sent (or received by the pool) during a trade as the product a function. The function considers the price and the impact the trade has on the pool. The positive sign, in this context, means the pool is receiving tokens.
The function can be found in more detail in the Trade section. For simplicity, here we'll only state its properties as follows:
if
The price calculated by the AMM will impact the pool, and after the trade, it will save the new IV of that moment. This factor will be used in the next trade as input () to the next trade pricing formula. The new IV ()will be guessed by the contract and should guarantee the following:
Check Trade function to understand the steps of how information is updated.
Now that you know the functions let's learn about them in more detail.
Last updated