BTR Docs
- Overview — BTR is a decentralised exchange running an oracle-priced, multi-asset AMM: single-sided liquidity, depth and spread that follow the pool's own inventory.
- Manifesto — Order-book intelligence for on-chain liquidity.
- Foundations — Theoretical lineage and design choices behind AIMM.
- User Guide — Entry point for the BTR user guides: swapping, providing liquidity, and the asset model.
- AIMM Overview — Technical overview of BTR pools (Adaptive Inventory Market Maker)
- Inventory management — Asset-liability accounting, the fixed coverage-driven inventory skew, the withdrawal haircut and the convex coverage wall, stated exactly as implemented
- Liquidity shaping — The clamped quartic I-spline depth curve: exact storage, evaluation, integration, dispersion scaling and traversal, with the shipped central-normal plateau in closed form
- Anchor path pricing — Multi-anchor tree, MAX_DEPTH = 4: every asset anchors to one correlated parent, not necessarily the base. A swap is the unique tree path between its endpoints, priced and settled once inside a single swap call.
- AIMM spread and fee model — Direction-invariant multi-factor spread; one output-side fee at half the spread; convex coverage toll charged before it
- Slippage & Price Impact — Exact decomposition of oracle mark to taker-received, the deterministic impact term, and the protections against the stochastic remainder
- Toxic flow mitigation — The adverse-selection budget: what each defense costs and what it covers.
- Configuration parameters — Every AIMM parameter: its units, its formula, its fence, and its live value
- AIMM invariants — Every constraint the protocol claims is always true, with the code that enforces it and the failure mode if it breaks
- Pool Contract — Main AMM operations: swap, deposit, withdraw, donate, liability swap
- Feed oracle — EXTERNAL = any IOracle (recommended). INTERNAL = cash-collateral peg helper. NX Rates push API.
- Admin Contract — Pool configuration, timelock governance, and emergency controls
- Flash Loans — ERC-3156-style flash loans on the pool-keyed Flash singleton: fees, liquidity floor, and borrower callback
- Deployments — Testnet deployment policy, asset registry, pool composition
- Contract Addresses — BTR deployed contract addresses per chain, generated from the deploy SoT.
- Asset Registry — Every listed pool leg: token address, decimals, the feed its mark is signed under, and the ERC-20 quirks an integrator has to handle.
- Pool Composition — Why a deployment is cut into several cores, which assets sit in each, and how wrapper variants collapse onto a shared mark feed
- Security Overview — Defense-in-depth architecture for AIMM protocol security
- Access Control, Roles & Emergency Powers — Who may do what: principals, guardian surface, halt authority, timelock schedule, and owner-gated op classes.
- Deployment & Upgradeability — Per-chain deploy order, the beacon and UUPS upgrade paths, and the timelock tiers that gate them.
- Flow Guards (Reentrancy and MEV Protection) — Multi-layered temporal protection against callback, reentrancy, and JIT manipulation attacks
- Oracle System — EXTERNAL = any IOracle mark (recommended). INTERNAL = cash-collateral 1:1 peg helper only.
- Base-Token Depeg Halt — Circuit breakers on the numéraire and on every spoke: the base parity halt and the mandatory feed-relative reference band.
- Oracle Price-Push Security — End-to-end trust chain for BTR marks: NX Rates provenance, on-chain k-of-n quorum, signer whitelisting ceremony, per-push guards, and why oracle-manipulation classes are bounded
- Bug Bounty — Responsible disclosure scope, rewards, safe harbor.
- Observability — Lifecycle stages, the metrics that cover each, healthy ranges, and what a breach means.
- Guardian Operations — Operator runbook for the guardian key: the levers, their arguments, what to check before and after, and when to escalate to the owner.
- Oracle Keeper Operations — Operator runbook for the mark-pushing relay: what the key can and cannot do, the startup gates, the revert taxonomy, and the checks before and after a deploy.
- Risk Steward Operations — Operator runbook for the bounded risk key: the one entrypoint, the exact clamp rules, what fails closed, and what to verify before and after a retune.
- User Guides — How to trade and provide liquidity on BTR: what each action does on chain, what it costs, and how it can fail.
- Swapping — From the /swap form to the chain: two quote engines, off-chain route ranking, minOut re-floored against the pool, EIP-5792 batching, and one Pool.swap per leg.
- Providing liquidity — Single-sided deposit into one pool leg, the per-leg bLP receipt and its liquidity index, the anti-JIT cooldown, and what a same-asset or cross-asset exit costs
- Assets and the hub — What a listed asset is on a BTR pool, why every core has a base/hub leg, how native Circle tokens differ from the faucet twins, and how the testnet faucet hands out tokens
- Liability swaps — Moving an LP claim between two legs of one pool: swapLiability, its two haircuts, the Lemma B mark cap, and the routes that embed it
- Developer Guides — Integrate BTR: swap, LP, liability transfer, flash, deploy pools, hooks, HTTP API, SDK
- Basic Operations — Solidity signatures, a copy-pasteable interface, units, reverts and events for an AIMM pool
- Pool Deployment & Curation — Deploying a pool, the chain-wide ownership model, and the curation surface: assets, oracles, risk, curves, halts
- Pool Hooks — Farm idle pool capital via YieldHook adapters: callback surface, dual ledger, buffer, harvest cap
- Composability — Flash loans through the Flash singleton, and cross-pool routing
- Consuming Price Feeds — Third-party integration guide for the BTR oracle: getFeed, isFeedFresh, and the four ways a naive read hurts you
- API & SDK Reference — The BTR gateway HTTP surface and the reachable @btr-protocol/sdk entrypoints
- Quotes & Routing — Off-chain best path, per-leg slippage, EIP-5792 batching, and settling a path through the Router.
- Cookbook — Working TypeScript, Python, Rust and Solidity snippets for swap, LP, liability transfer, flash and deploy
- White Labeling — Running a branded pool on BTR: what a deployer controls, and the two things they do not
- Protocol Fee Collection — How a pool's fee recipient pulls accrued protocol fees, and how the fee sink is rotated
- Incentivization — The four on-chain levers that pay BTR liquidity: fee split, donations, POL, hook yield
- Roadmap — Designs that are specified against the deployed contracts but not yet built. What each one adds, what it reuses, and what still has to be proven.
- Total Return Swaps — Leveraged directional exposure on the liability-swap primitive: margin accounting, coverage as the utilization curve, skew-based funding, and progressive deleveraging
- Single-Asset Vaults — One vault per asset allocating across every pool that lists it, built as a Morpho Vaults V2 adapter; the allocation signal, the circularity rule, and an honest assessment of Pendle tokenization
- Cookie Policy — How the BTR Interface uses cookies and local storage, and how to manage your preferences.
- Privacy Policy — How BTR handles your information when you use its Services.
- Risk Disclaimer — Material risks of using BTR
- Terms of Service — Terms governing use of the BTR interface and related services
- Glossary — DeFi, TradFi, and statistical terms used in AIMM docs.