Skip to main content

    Calculation method

    How MoonMath calculates entry / exit

    Entry & Exit Strategy ExplorerHow do different entry or exit rule sets behave?

    The formula

    Each tranche reprices the pool to its trigger along the same constant-product invariant, then executes the allocation as an AMM swap against those repriced reserves, reporting the shortfall of execution value against the value marked at the trigger price.

    What it reads

    • Whether the plan buys or sells, and the amount available
    • Observed pool reserves, the quote asset's price and the fee
    • The tranches: a trigger price and an allocation share for each

    What it assumes

    • The market reaches each trigger by repricing the pool along the same invariant, preserving what earlier tranches already moved
    • Only the modelled trades move the price: no external flow, arbitrage or liquidity change between steps
    • Templates are fixed rule sets; the dollar-cost-averaging legs deliberately use the observed spot rather than predicted future prices
    • Liquidity-aware plans cap each step at a small share of the token reserve

    What this does not establish

    • It does not establish that the triggers occur — they may never be reached
    • The paths shown cannot all execute: they are alternatives, not a sequence
    • Real liquidity, routing, arbitrage, extraction, transfer taxes and other traders can materially change execution
    • The templates are illustrations, not recommendations, rankings or forecasts

    Run it

    Compare rule-based entry and staged exit scenarios using observed token and AMM data. Strategies are educational templates, not recommendations or predictions.

    Open the Entry / Exit 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