LogoLogo
Start hereWhy Flype?Less divergence LossIMMath
  • Vaults
    • UNI-V3 Vaults
    • Strategies
    • Strategy manager
    • Security audit
    • Deployment Addresses
  • Liquidity Exchange
    • Flype Liquidity Exchange
    • Flype-between
    • Flype-in
    • Flype-out
    • Pools
    • Multiple Yields
    • Advantages
  • IMM
    • Background
    • Pools & Oracle Market Price
    • Execution of Trades
    • Three Possible States in IMM
    • The Math Behind IMM
      • IMM Notation
      • IMM Functions
      • IMM Balancing Indicator
      • IMM - Arbitrage Trades
      • Transaction fee
      • Adding Liquidity
      • Removing Liquidity
      • IMM Advantages
      • Simulations and performances
  • Resources
    • FAQ
    • Roadmap
    • References
    • Official Links
Powered by GitBook
On this page
  • LP token Shortage (q=0.5)
  • Equilibrium State (q=1.0)
  • ETH Shortage (q=2.0)

Was this helpful?

  1. IMM
  2. The Math Behind IMM

Simulations and performances

PreviousIMM AdvantagesNextFAQ

Last updated 3 years ago

Was this helpful?

Figures 1, 2, and 3 below display IMM price functions in comparison with common AMM price functions simulated with three states:

  1. LP tokens shortage (q=0.5)

  2. Equilibrium (q=1.0)

  3. ETH shortage (q=2.0)

The relative effective price Pb/ rXY for a buy trade and Ps / rXY for a sell trade is shown as a function of the relative trade amount.

For the IMM graphs, we have used equations (6), (7), and (12) with the following parameters:

  • b = 0.2

  • a = 1.0

When q = 1.0 (equilibrium state), the IMM and common AMM price functions are equal.

When q =0.5 and q = 2 (the pool state is far from equilibrium) the IMM price function is significantly closer to the market price, thereby minimizing the price gap in comparison with common AMMs (for relative trade amounts < than 10% of total pool amount that should be the usual case).

When a trade amount is significantly high in relation to the pool total value, the IMM pricing mechanism will discourage these trades to minimize divergence loss.

LP token Shortage (q=0.5)

The graph below displays IMM price functions in comparison with a common AMM. At this state, Q<1.

Effective price is a function of the relative trade amount for: q = 0.5 and IMM parameters set to b = 0.2, a = 1.0.

Figure 1 - Effective Price vs Trade Amount for q=0.5

Equilibrium State (q=1.0)

The graph below displays the IMM price functions in comparison with a common AMM. At this state, Q=1.0.

Figure 2 - Effective Price vs Trade Amount X, for q=1.0

ETH Shortage (q=2.0)

The graph below displays IMM price functions in comparison with a common AMM. At this state, Q>1.

Figure 3 - Effective Price vs Trade Amount X, for q=2.0

Effective price is a function of the relative trade amount for: q = 1.0 and IMM parameters set to b = 0.2, a = 1.0.

Effective price is a function of the relative trade amount for: q = 2.0 and IMM parameters set to b = 0.2, a = 1.0.