Variables
Variables used for the AMM protocol math formulations.
General Variables
A given instant
Factors that refers to a user () balance.
Time of the event of a user's original deposit.
State Variables
To perform the events, the contract stores, calculates, and manage the following variables:
User Balance of a token A or B in a given moment. When adding liquidity for the first time, the will be equal to .
Last period's guessed Implied Volatility by the contract based on the latest trade activity in the AMM.
Implied Volatility that was guessed by the OptionAMM after the current trade ended and impacted the pool position. This factor will be stored and used only in the next event, which in that case will have become the . The is guessed and should guarantee the condition:
Pool total Balance of a particular token:
Pool's total balance of token A in a given instant .
Pool's total balance of token B in a given instant .
Pool's factor that is not amortized.
Pool's deamortized balance of token A in a given instant .
Pool's deamortized balance of token B in a given instant .
Dynamic Variables
Variables controlled by the users.
Variables that will be input by the user in addLiquidity
or removeLiquidity
User Input
User input for liquidity provision:
Total amount of A a user deposited originally.
Total amount of B a user deposited originally.
Is the proportion of token a user wants to withdraw from each token. 1 would be 100% withdrawal.
is the proportion the user wants to withdraw from the original deposit of token A
is the proportion the user wants to withdraw from the original deposit of token B
Contract Variables
Find below the variables used by the AMM for calculations.
Token A price in units of Token B calculated by the AMM in a given instant .
The AMM's price function to price the token A (options) in units of token B.
The underlying asset's spot price is supplied from an external source of data (currently by Chainlink).
Pool's opening value factor.
How many token A the user can withdraw for each token A deposited
How many token B the user can withdraw for each token B deposited
How many token A the user can withdraw for each token B deposited
How much token B the user can withdraw for each token A deposited
Trade formulas
Variables used by the AMM for calculations during a trade:
Trade amount of token A to be transferred or received in a trade event.
Trade amount of token B to be transferred or received in a trade event.
Is the variable that contains the maximum that could be traded based on the current pool situation and option price for the token A.
Is the variable that contains the maximum that could be traded based on the current pool situation and option price for the token B.
Product constant.
Glossary Comparison
Find below the variables matching with the contract names.
Documentation / Whitepaper
Code
File
UserDepositSnapshot.tokenABalance
AMM.sol
UserDepositSnapshot.tokenBBalance
AMM.sol
UserDepositSnapshot.fImp
AMM.sol
ABPrice
AMM.sol
_getABPrice()
AMM.sol
PriceProperties.currentSigma
OptionAMMPool.sol
newIV
OptionAMMPool.sol
exactAmountAIn / exactAmountAOut / amountAIn / amountAOut
AMM.sol
exactAmountBIn / exactAmountBOut / amountBIn / amountBOut
AMM.sol
totalTokenA / totalTokenB
AMM.sol
deamortizedTokenABalance / deamortizedTokenBBalance
AMM.sol
fImpOpening
AMM.sol
percentA / percentB
AMM.sol
Mult.AA
AMM.sol
Mult.BB
AMM.sol
Mult.BA
AMM.sol
Mult.AB
AMM.sol
Last updated