Pods Options
app.pods.financeGithubBlogDiscord
  • Getting Started
  • Understand Options
    • What are options?
    • How do options work?
    • Pricing Options
  • The Protocol
    • Overview
    • Safety Measures
    • Ecosystem Participants
    • Use Cases
  • Options
    • Overview
    • Options Instrument
      • Variables
      • Functions
        • Mint
        • Unmint
        • Withdraw
        • Exercise
    • Smart Contracts
      • OptionFactory
      • PodPut
      • WPodPut
      • PodCall
      • WPodCall
    • Applied Use Cases
    • Understanding Returns
  • Options AMM
    • Overview
    • Options AMM
      • Variables
      • Components
      • Functions
        • Add Liquidity
        • Re-add Liquidity
        • Trade
        • Remove Liquidity
      • Pricing
      • Find The Next IV
      • Fees
      • Scenarios
        • LP Simulations
    • Smart Contracts
      • OptionAMMPool
      • OptionAMMFactory
      • OptionPoolRegistry
    • Applied Math
  • Developers
    • System Overview
    • Deployed Contracts
    • Dev Environment
  • Interfacing with Pods
    • Brand Assets
  • Code Integration Guides
    • Integrating with Pods (video)
    • How To Create Your Own Option
    • How To Create Your Own Pool
    • How To Trade (Buy/Sell)
    • How To Exercise
    • How To Remove Liquidity
  • User Guides
    • Videos
  • Security
    • Audits
  • APPENDIX
    • FAQ
    • Glossary of Terms
  • Additional Resources
  • app.pods.finance
  • Github
  • Blog
  • Discord
  • Twitter
  • Pods v0 Docs
Powered by GitBook
On this page
  • General Variables
  • State Variables
  • Dynamic Variables
  • User Input
  • Contract Variables
  • Trade formulas
  • Glossary Comparison

Was this helpful?

  1. Options AMM
  2. Options AMM

Variables

Variables used for the AMM protocol math formulations.

PreviousOptions AMMNextComponents

Last updated 4 years ago

Was this helpful?

General Variables

iii A given instant

uuu Factors that refers to a user (uuu) balance.

dududu 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:

UBuUB_uUBu​ User Balance of a token A or B in a given moment. When adding liquidity for the first time, the UBuUB_uUBu​ will be equal toAduA_{du}Adu​ .

IVi−1IV_{i-1}IVi−1​ Last period's guessed Implied Volatility by the contract based on the latest trade activity in the AMM.

IViIV_iIVi​ 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 IVi−1IV_{i-1}IVi−1​ . The IViIV_iIVi​is guessed and should guarantee the condition:

fp(IVi,MarketDatai)=−BiAi\displaystyle f_p(IV_i,MarketData_i)=\frac{-B_i}{A_i}fp​(IVi​,MarketDatai​)=Ai​−Bi​​

TBiTB_iTBi​ Pool total Balance of a particular token:

  • TBAiTB_{A_i}TBAi​​ Pool's total balance of token A in a given instant iii .

  • TBBiTB_{B_i}TBBi​​ Pool's total balance of token B in a given instantiii .

DBiDB_iDBi​ Pool's factor that is not amortized.

  • DBAiDB_{A_i}DBAi​​ Pool's deamortized balance of token A in a given instant iii .

  • DBBiDB_{B_i}DBBi​​ Pool's deamortized balance of token B in a given instantiii .

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:

Contract Variables

Find below the variables used by the AMM for calculations.

Trade formulas

Variables used by the AMM for calculations during a trade:

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

​ AduA_{du}Adu​ ​ Total amount of A a user deposited originally.

​​ BduB_{du}Bdu​ ​ Total amount of B a user deposited originally.

rrr Is the proportion of token a user wants to withdraw from each token. 1 would be 100% withdrawal.

rAr_ArA​ is the proportion the user wants to withdraw from the original deposit of token A

rBr_BrB​ is the proportion the user wants to withdraw from the original deposit of token B

PiP_iPi​ Token A price in units of Token B calculated by the AMM in a given instant iii .

fpf_pfp​ The AMM's price function to price the token A (options) in units of token B.

MarketDataiMarketData_iMarketDatai​ The underlying asset's spot price is supplied from an external source of data (currently by Chainlink).

FviFv_iFvi​ Pool's opening value factor.

mAAmAAmAA How many token A the user can withdraw for each token A deposited

mBBmBBmBB How many token B the user can withdraw for each token B deposited

mBAmBAmBA How many token A the user can withdraw for each token B deposited

mABmABmAB How much token B the user can withdraw for each token A deposited

AiA_iAi​ Trade amount of token A to be transferred or received in a trade event.

BiB_iBi​ Trade amount of token B to be transferred or received in a trade event.

poolAmountApoolAmountApoolAmountA Is the variable that contains the maximum that could be traded based on the current pool situation and option price for the token A.

poolAmountBpoolAmountBpoolAmountB Is the variable that contains the maximum that could be traded based on the current pool situation and option price for the token B.

kkk Product constant.

UBAUB_AUBA​
UBBUB_BUBB​
FvduFv_{du}Fvdu​
PiP_iPi​
fpf_pfp​
IVi−1IV_{i-1}IVi−1​
IViIV_iIVi​
AiA_iAi​
BiB_iBi​
TBiTB_iTBi​
DBiDB_iDBi​
FviFv_iFvi​
rrr
mAAmAAmAA
mBBmBBmBB
mBAmBAmBA
mABmABmAB