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

Was this helpful?

  1. Options AMM
  2. Options AMM

Functions

The functions and variables that are possible within the options AMM.

PreviousComponentsNextAdd Liquidity

Last updated 3 years ago

Was this helpful?

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.

  • IV0IV_0IV0​

    • The initial sigma of the pool

Once a pool was created, the following can happen in a given instant iii:

EiE_i Ei​∈∈ ∈ {A,RA,T,R{A, RA, T, R}A,RA,T,R }

In a nutshell, the events can be translated to:

  • Add Liquidity (AAA) Users can provide one side or both sides of assets as liquidity to a pool to earn fees.

  • Re-add Liquidity (RARARA)

    Users who had provided liquidity before can add liquidity again with no impact on their previous added funds.

  • Trade (TTT) Users can buy or sell assets to the pool paying a fee.

  • Remove Liquidity (RRR) 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.

Now that you know the functions let's learn about them in more detail.

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 .

PiP_iPi​, the opening price (price when the event starts to happen), is defined as a function fpf_pfp​. This function uses an external vector of MarketDataMarketDataMarketData (currently leveraging Chainlink with their spot price update feed) and an internal vector IVIVIV(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 iii .

Pi=fp(IVi−1,MarketDatai)P_i=f_p(IV_{i-1},MarketData_i)Pi​=fp​(IVi−1​,MarketDatai​)

Considering AiA_i Ai​ and BiB_iBi​ 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 gig_igi​function. The gig_igi​ 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.

Bi=gi(Ai)B_i=g_i(A_i)Bi​=gi​(Ai​)

The gig_igi​ function can be found in more detail in the Trade section. For simplicity, here we'll only state its properties as follows:

B=gi(Ai)≥−Pi⋅AiB_=g_i(A_i)≥-P_i\cdot A_iB=​gi​(Ai​)≥−Pi​⋅Ai​

gi(x)≤gi(y)g_i (x)≤g_i (y) gi​(x)≤gi​(y) if x>y x>yx>y

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 (IVi−1IV_{i-1}IVi−1​) to the next trade pricing formula. The new IV (IViIV_iIVi​)will be guessed by the contract and should guarantee the following:

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

Check function to understand the steps of how information is updated.

Pricing
Trade