V-AMM · Solana · v1.2.0

An AMM that breathes with the market.

A volatility-adaptive StableSwap on Solana. The curve shape and fees respond to on-chain price action in real time — no oracles, no governance, no keeper keys. Two permissionless cranks drive the brain.

amp
auto
A_max → 1 by σ
fee
5→100
bps by σ
crank
2
vol, curve
The brain in action
§ 01

Three mechanisms, one brain.

  1. 01

    StableSwap curve

    Newton-Raphson solver for the D invariant. Amplification A starts at Amax and ramps toward a target driven by realized volatility. Tight in calm markets, protective when things get rough.

  2. 02

    EWMA volatility engine

    Exponentively weighted moving average of price jumps. λ=0.95 on a 15-minute ring buffer, plus a 1-hour window. σ is annualized to feed fee and A targets.

  3. 03

    Dynamic fee schedule

    Piecewise smoothstep from 5 to 100 bps based on σ. EMA smoothed (α=0.9) and rate-limited to 10 bps per slot. No jumps, no arb windows.

§ 02

The invariant.

StableSwap blends constant-sum and constant-product via a single parameter A. The D invariant stays constant across swaps. Volatility tightens the curve and raises fees; calm relaxes both.

4A(x + y) + D  =  4AD + D³ / (4xy)

A(σ)           =  A_max · exp(−k·σ)
                        ≈  A_max · (1 − k·σ/100)

fee(σ)         =  5 bps                       if σ ≤ 15%
                =  5 + 25·S((σ−15%)/60%) bps  if 15% < σ < 75%
                =  30 + 70·S((σ−75%)/45%) bps if 75% ≤ σ < 120%
                =  100 bps                     if σ ≥ 120%

σ(returns)    =  √(EWMA) · √(SECONDS_PER_YEAR / BUCKET_SECONDS)

EWMA_t        =  λ · EWMA_{t-1}  +  (1−λ) · return_t²   with λ = 0.95

A_ramp        =  linear interp over 9000 slots (~1h)
                  when |target − A| / A > 10%