DerpDex.com
  • ðŸĪŠDerpDEX Overview
    • ðŸĪ”Vision, Why & Gap
  • 🔗Official Links
  • 🚀Roadmap & Launch Plan
  • 🧑‍ðŸĪâ€ðŸ§‘Derp DAO
  • Tokenomics
    • ðŸĪ‘DERP
    • 🔐xDERP
      • Vesting
      • Conversion
      • Earnings sharing
    • ðŸ§ŪToken Distribution
      • Release schedule
      • DERP reserved wallets
    • 🎊Airdrops!
  • Protocol
    • ⚒ïļAMM
      • 😍Concentrated Liquidity (CLAMM)
      • ðŸĪĐv2: DMM
    • 🔄Swap
      • Smart Routing
    • ðŸ’đLiquidity Provider
      • Concentrated Liquidity
    • ðŸŒąFees
      • Stablecoins
      • Other cryptocurrencies
    • 🌉Bridge
    • ðŸĪAggregator
    • 🛠ïļInscription Bridge
  • CAMPAIGN
    • 🎆Genesis Launch
  • Getting Started
    • Getting Started
    • Bridge
      • zkSync Era
      • Base
      • opBNB
      • DERP Token Bridge
    • Add Liquidity
    • Withdraw Liquidity
    • Swap
    • Inscription Bridge
  • CONTRACTS
    • Contracts
    • Contract Addresses
    • ðŸ›ĄïļAudits
  • Products
    • Genesis Pools
      • How it works?
      • Rewards
      • Genesis campaign
      • Terminology
    • Zap-to-Earn
    • Launchpad
    • 🧑‍ðŸŒūYield Farming
      • Yield Booster
      • How to Farm?
      • FAQ
    • ⭐Staking
      • How to Stake or Redeem?
  • Resources
    • ❓FAQ
    • ðŸĪPartnership
    • ðŸĪ“Meme-token launch
    • 📗zkSync Gas Fee Guide
    • 🌉DERP Bridge via OTC
Powered by GitBook
On this page
  • v2: DMM*
  • Gen 2: Concentrated liquidity ++
  • Volatility adjusted fees
  1. Protocol
  2. AMM

v2: DMM

Concentrated Liquidity ++ with volatility adjusted fees.

PreviousConcentrated Liquidity (CLAMM)NextSwap

Last updated 1 year ago

v2: DMM*

*in development*

Derp Market Maker (DMM) with volatility-adjusted fees. DerpDEX CLAMM with concentrated liquidity introduces a flexible and efficient way that can significantly improve capital efficiency and help LPs customize with range orders.

While CLAMM concentrated liquidity gives LPs granular control over what price ranges their capital is allocated to, it introduces potentially bigger impermanent loss should there be any large one-way price action.

Gen 2: Concentrated liquidity ++

This is where DMM, given its significant outperformance over CPAMM in protecting P&L for LPs, can be perfectly combined with CLAMM. In detail look, the HMM combination with CLAMM can be easily adopted only with changes made to the swapping process within each active tick interval.

Same as CPMM, the available liquidity for both tokens within each interval can be easily calculated withand. This can be compared to remaining input token balance (positive or negative) to see if we need to cross the next tick. Within each price interval [ P0P_0P0​(starting tick price), P1P_1P1​ (ending tick price)], the output token amount (positive or negative) can be calculated with DMM.

if P1P_1P1​ is NOT between P0P_0P0​ and PiP_iPi​ (oracle price): ​

  • If input token is X,

  • If input token is Y,

Volatility adjusted fees

LPs providing liquidity in an AMM pool experience a volatility drag on their position i.e. they have volatility exposure. When markets are moving a lot, LP profits are eroded away by higher impermanent loss.

Sophisticated LPs that dynamically rebalance their token inventories bleed more money doing these rebalancings in volatile markets. Conversely, AMMs accumulate profits in calm markets when there is trading activity around a stable price.

Constant fee fails to reflect these market dynamics. This means LPs will be more inclined to take away liquidity from AMMs in volatile markets thus exacerbating market moves. In stable times, traders will be less inclined to pay the high fees on DEXes. This is the exact opposite of the desired dynamic!

Volatility sensitive pricing is needed for incentivising LPs to keep funds during volatile times and traders to continue using DEXes in stable times. LPs should earn higher fees in turbulent times and lower fees in calmer markets. This would lead to a fairer and a more robust trading ecosystem.

We present the heuristic for pricing AMM fee below.

Assuming an LP provides liquidity in a 2-asset constant product market making pool composed of tokens X and Y.

​​Square root price process is given by:​​

The above can also be modelled by explicitly calculating the delta-hedging p&l of an LP that constantly hedges its delta to stay hedged in numeraire. This negative gamma pnl experienced by LPs between 2 periods is given by:

Considering a single day time frame, the expected value of LP loss equates to

We want the expected fee earned from AMM to exceed that of the LP loss.

So:

We define velocity as a measure of ADV / TVL. i.e. what multiple of the TVL does the AMM trade daily on average. This gives us the below heuristic for setting min AMM fee.

if P1P_1P1​ is between P0P_0P0​​ and PiP_iPi​(oracle price):​

Treating Y as numeraire, we have marginal price P0​=Y0/X0​P_0​=Y_0/X_0​P0​​=Y0​/X0​​ and Xt​Yt​=k=L2X_t​Y_t​=k=L^2Xt​​Yt​​=k=L2

XtX_tXt​​ and YtY_tYt​​ denote the LP token balances and L is a constant denoting liquidity supplied by the LP. Value of LP assets in the pool ( WtW_tWt​​ ) are given by

The value of LP assets follow a square root price process.Assuming geometric brownian motion for price PPP ,we have:​

dP=ΞPdt+σPdzdP = \mu Pdt + \sigma PdzdP=ΞPdt+σPdz

This means LPs experience a volatility drag =

Where W0W_0W0​ is the initial value of the LP deposit and denotes the annualized volatility of log returns.

Here ADV represents the average daily volume, TVL is the total value locked in the pool and Îą\alphaÎą is the fee rate.

⚒ïļ
ðŸĪĐ