AIMM at a glance

Constant-product pools price from a fixed curve and let the trade move the price. BTR pools do the opposite: an external reference price anchors the quote, and the pool’s own state decides how far trading can push it.

The three inputs

  • Mark - the external reference price. NX Rates keepers sign marks off-chain and push them on-chain (the oracle page lets you verify one end-to-end). Past its TTL a feed fails closed: reads revert StaleData and the asset freezes rather than quote off a stale anchor (depeg halt). Same-asset withdrawals are not feed-gated, so a dead keeper cannot trap you in the asset you deposited.
  • Inventory - what the pool actually holds per asset. When inventory drifts from target allocation, the mid skews and spreads widen so flow that restores balance gets the better side.
  • Coverage - reserves divided by liabilities on a leg. 100% means the pool holds exactly what LPs are owed; coverage shortfalls feed straight into pricing, which is how BTR does impermanent-loss protection without a separate insurance fund.

What the quote is made of

Not weighted heuristics: three additive terms in one spread, each charged for a different risk:

S=ifmin,i+σpνp100·BPSvol+izσiτiBPSstale+(iui)·BBPSconf

termcharges fordriven by
volatilityhow fast the asset movespath sigma σp, endpoint vega νp
stalenesshow old the mark isage past grace τi, per leg
confidencehow sure the feed iseach leg’s reported 1σ interval ui

The two constants are fixed, not dials: z=472 scales the staleness term, and B/BPS is the pbps-to-bps conversion on the confidence term.

Two details matter more than the algebra. Staleness is summed per leg, not coupled across the path: one keeper feeds several spokes, so an outage stales them together, and charging one aggregate age would under-charge two equally stale legs by 29%. And a path inherits every leg’s confidence, not the worst one, so a quiet leg beside a noisy one still pays its own.

Full derivation, integer arithmetic and clamps in spread & fees.

Why not just x·y=k

A fixed curve pays arbitrageurs out of LP pockets every time the market moves (LVR). Anchoring to a keeper mark means the pool re-prices before arbitrage arrives, so the spread compensates flow that takes real inventory risk instead of subsidizing flow that takes none.

designprices fromre-prices whenwho pays the move
constant productits own reservessomeone tradesthe LP
concentrated rangea range set by handsomeone trades, inside the rangethe LP
AIMMa signed external markthe mark moves, same blockwhoever takes the stale side

Per-asset oracle modes

  • EXTERNAL (recommended) - any IOracle mark: NX Rates push, Chainlink adapter, Uniswap/vault reader, custom on-chain discovery.
  • INTERNAL - cash-collateral 1.0 peg helper only. Mix allowed; prefer EXTERNAL.

Routing

One pool holds many assets. Each anchors to a correlated parent, not necessarily the base, and a swap prices along the unique tree path between its two endpoints via their lowest common ancestor. Depth is capped at 4, so a path spans at most 9 nodes and 8 legs.

WBTC base

WETH

USDC

stETH

weETH

USDT

DAI

USDe

sUSDe

Two assets sharing a parent trade through that parent: stETH to weETH is two legs via WETH, never touching the base. Everything settles inside the one pool, so there is no cross-pool hop and no aggregator leg. Each leg still charges its own fee floor, so a two-leg path pays both.

Next

Spread & fees carries the formal parameter surface; inventory management shows how drift maps to quote skew.