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 — Architectural map of BTR pools (Adaptive Inventory Market Maker): components, contracts, pricing pipeline, invariants.
- Inventory management — Asset-liability accounting, the fixed coverage-driven inventory skew, the pool-level rate LPs settle at 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 — Reference for the Pool entry surface: swap, deposit, withdraw, donate, liability swap, anchor-tree routing, errors and gas.
- Feed oracle — EXTERNAL = any IOracle (recommended). INTERNAL = cash-collateral peg helper. NX Rates push API.
- Admin Contract — Reference for the Admin singleton: every governed pool operation with its payload, timelock tier, validation and events.
- 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: the adversaries, the trust table, and where each layer is specified.
- Access Control — Who may do what: principals, halt authority, timelock tiers, and owner-gated op classes.
- Deployer — Per-chain deploy order, CREATE3 addresses known before the ceremony, and the handover to the admin multisig.
- Admin — The owner multisig: ownership handover, the owner param lane, the beacon and UUPS upgrade paths, timelock mechanics and emergency levers.
- Risk Steward — 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.
- Guardian — The guardian key: what membership is, the levers it holds, the arguments that decide what a call does, and what it is the last line of defence against.
- Oracle Keeper — The mark-pushing role end to end: what the relay key is and is not, the k-of-n signer quorum and its ceremony, push guards, TTL and bands, the reference tier, plus the feed and wire reference the role depends on.
- Treasury — The fee sink: an untrusted plain address that claims protocol fees and nothing else.
- Guards — The transaction-time guard layer: per-asset halt flags, the halt mask, and the four per-asset risk thresholds.
- Flow Guards — Every transaction-time guard in one place: reentrancy, flash reserve, JIT cooldown, base parity halt and the mandatory feed-relative reference band.
- Guardian Routines — Operator runbook for the guardian key: what to check before and after a lever lands, and when to escalate to the owner.
- Observability — What BTR emits, which surface carries it, and the conditions that page an operator.
- Audits — Assurance model, audit methodology, published reports, bug bounty and responsible disclosure.
- Internal Audit 2026-09 — Public report of the BTR internal audit campaign, 2026-09-02 to 2026-09-16: scope, method, funnel, and every finding on the open-source components as severity-ordered bundles.
- 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: the backend quote, off-chain route ranking, the server-authored minOut, EIP-5792 batching, and one Pool.swap per leg.
- Liability swaps — Moving an LP claim between two legs of one pool: swapLiability, the pool rate it converts at, the Lemma B mark cap, and the routes that embed it
- Providing liquidity — Single-sided deposit into one pool leg, the per-leg bLP receipt and its liquidity index, the pool-level solvency rate C every mint and exit settles at, the anti-JIT cooldown, and what a same-asset or cross-asset exit pays
- Pool legs — What a listed asset is on a BTR pool, why every core has a base leg, what an LP holds against one leg, and how to read a leg's live state.
- Faucets — How a BTR testnet deployment hands out pool assets: mintable twins versus official issuer tokens, the registration gate, the one-claim-per-token-per-day cap, and what claim reverts on.
- 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 oracle integration: getFeed, isFeedFresh, feed ids, and the gating a naive read skips
- 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 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 why Pendle tokenization is not currently viable
- Wrapper Vaults — One token per underlying asset, backed by a pool of its competing wrappers: btrUSD, btrETH, btrNVDA. What the vault holds, how the share is priced, and what has to be true of the roster before one can exist
- Cookie Policy — Which cookies the BTR Interface sets, what browser storage holds, and how to manage both.
- Privacy Policy — What BTR collects when you use the Services, why, how long it is kept, and your rights over it.
- 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.