Skip to main content

    Calculation method

    How MoonMath calculates liquidity stress

    Liquidity Removal Stress TestWhat happens if liquidity is pulled?

    The formula

    The pool is reconstructed as an even split of reported liquidity, then the same sale is simulated twice — once at full depth and once with reserves scaled down by the removal percentage — and the difference in proceeds is reported.

    What it reads

    • Reported pool liquidity and the token price, from which reserves are reconstructed
    • The number of tokens to sell
    • The share of liquidity to remove
    • The pool fee percentage

    What it assumes

    • Reserves are not observed: the pool is reconstructed as an even split of reported liquidity at the reported price
    • Liquidity removal is proportional on both sides
    • The removal and the sale are sequential with nothing else happening in between
    • Only the seller trades

    What this does not establish

    • Removing liquidity does not move the spot price here — proportional scaling cancels, by construction
    • Its price impact is a pool spot-price move, a different quantity from the execution-versus-spot impact the swap tool reports
    • It does not model who would remove liquidity, when, or whether they would
    • It uses one reconstructed pool and so says nothing about routing across a token's real venues

    Run it

    Stress-test how the same token sale executes after part of a constant-product pool's balanced liquidity is removed. Lower depth increases price impact even when spot price initially remains unchanged.

    Open the Liquidity Stress calculator

    How the market itself works

    This page describes MoonMath's arithmetic. The mechanics section describes the market: how an order book forms a price, why order-book depth is not the same thing as pool liquidity, and what a public book does and does not let you observe.

    Read the market mechanics