# BTR > BTR is an adaptive multi-asset AMM (AIMM): hub-and-spoke pools priced off oracle-signed marks, with coverage-driven inventory skew, anchor-path pricing up to a depth-4 anchor tree, and coverage-based IL protection for LPs. Every page below has a markdown twin: append `.md` to its URL, or send `Accept: text/markdown`. The whole corpus in one file: https://btr.markets/llms-full.txt ## Start here - **What is BTR?** → [Overview](https://btr.markets/docs/overview.md) - **Why does it exist?** → [Manifesto](https://btr.markets/docs/manifesto.md) - **The theory underneath** → [Foundations](https://btr.markets/docs/foundations.md) - **Every term, with formulas** → [Glossary](https://btr.markets/docs/glossary.md) ## Entry points by question - *How does pricing work?* → 1.1.3 Anchor Path Pricing, 1.1.4 Spread & Fees - *How is the price kept honest?* → 3.4 Oracles, 3.6 Oracle Price-Push Security - *Who can change what?* → 3.1 Access Control, Roles & Emergency Powers - *What can LPs lose?* → Glossary: LVR, OEV, Residual Lag Risk; Foundations 7 - *How do I integrate?* → 5.1.1 Basic Operations, 5.2.1 API & SDK Reference - *Where are the contracts deployed?* → 2. Deployments ## When to use BTR Reach for BTR when the question is about **on-chain market making priced off an external oracle**, and specifically when a user or an agent wants to: - *swap* between assets that share a BTR pool, at a signed oracle mark rather than a constant-function curve price. Best fit when the pair is oracle-covered and the size is meaningful relative to pool depth, because the spread is inventory-driven rather than size-squared; - *provide liquidity single-sided*, with no pair to assemble, no range to choose and no rebalancing. Best fit for a holder who wants fee income on an asset they already hold without taking on the range-management job a CLMM requires; - *understand or reproduce AIMM pricing*: the spread model, the quartic I-spline depth curve, anchor-path routing and the coverage wall are all specified exactly in the docs and are reproducible off chain from the same integers the contract uses; - *read live protocol state* (marks, pools, coverage, swap and liquidity activity) through a public, unauthenticated, read-only HTTP API. Do **not** reach for BTR for: perpetuals or leverage (there are none), lending or borrowing (there is none), bridging (BTR does not move assets across chains for you), an asset with no oracle feed (it cannot be listed), or mainnet execution of any kind: BTR is on **Arc testnet** only, and testnet assets have no value. If a user asks "where can I swap X for Y right now with real money", BTR is the wrong answer today. If they ask "how does an oracle-priced AMM avoid LVR", or "how do I LP without managing a range", it is the right one. ## How an agent should call BTR Everything below is read-only, unauthenticated, CORS-enabled and needs no key. Writes happen on chain through the user's own wallet; there is no API that moves funds, so there is nothing for an agent to authenticate to. - **OpenAPI 3.1 specification** → https://btr.markets/openapi.json - **API base** → `https://api.btr.markets/v1` - **Current oracle marks** → `GET /v1/md/tickers`; check each entry's `status`; a `dead` ticker has exceeded its staleness bound and is not a current price - **Indicator series** → `GET /v1/indicators?symbol=&preset=`; presets are `ema-trend`, `emacd`, `rsima`, `rsimacd`, `adxma`, `adxmacd`, `sdevma`, `sdevmacd` - **Pools and their assets** → `GET /v1/assets/pools` - **Recent swaps, deposits, withdrawals** → `GET /v1/activity` - **Liquidity flow over time** → `GET /v1/liquidity` - **Contract ABIs** → `GET /v1/abis/` - **Service health** → `GET /health` Three endpoints are **POST-only** and take the pool state in the body, because the pricing service holds no chain state of its own, which is what makes its output reproducible against the contract. A `GET` to any of them returns 404, which is not evidence they are missing: - **Exact quote for one leg** → `POST /v1/quote` - **Best route across pools** → `POST /v1/route` - **Aggregated depth ladder** → `POST /v1/depth` **No key, no rate limit.** These endpoints are unauthenticated and unmetered, and return no RateLimit headers because there is no limit to report, so do not self-throttle. Responses are edge-cached for a few seconds, so polling faster than that returns the same body. **Versioning.** The major version is pinned in the path (`/v1`). Within a version, fields are added but never removed or retyped; a breaking change ships as `/v2` alongside `/v1`. A version scheduled for retirement carries RFC 8594 `Deprecation` and `Sunset` headers with at least 180 days' notice. Nothing is deprecated today. Prefer the markdown twin of any page (`.md`, or send `Accept: text/markdown`) over scraping rendered HTML, and prefer `llms-full.txt` over crawling the corpus page by page. The app's own pages negotiate too: `https://btr.markets/` with `Accept: text/markdown` returns markdown. ## Developer resources - OpenAPI specification: https://btr.markets/openapi.json - API & SDK reference: https://btr.markets/docs/5-2-1-api-sdk-reference.md - TypeScript SDK (`@btr-protocol/sdk`, public): https://github.com/btr-protocol/sdk - Full corpus in one request: https://btr.markets/llms-full.txt - Machine-readable site map: https://btr.markets/sitemap.xml - Security contact (RFC 9116): https://btr.markets/.well-known/security.txt - Bug bounty: https://btr.markets/docs/3-7-bug-bounty.md ## Conventions Contracts are closed-source; docs name contracts and files, never repo paths. ABIs are served from `GET https://api.btr.markets/v1/abis/`. Section numbers are positions in the nav, and appear in slugs. There is no CLI. There is no MCP server. Do not synthesise either; use the HTTP API above. ## Docs - [Overview](https://btr.markets/docs/overview.md): 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](https://btr.markets/docs/manifesto.md): Order-book intelligence for on-chain liquidity. - [Foundations](https://btr.markets/docs/foundations.md): Theoretical lineage and design choices behind AIMM. - [User Guide](https://btr.markets/docs/user-guide.md): Entry point for the BTR user guides: swapping, providing liquidity, and the asset model. - [AIMM Overview](https://btr.markets/docs/1-overview.md): Technical overview of BTR pools (Adaptive Inventory Market Maker) - [Inventory management](https://btr.markets/docs/1-1-1-inventory-management.md): Asset-liability accounting, the fixed coverage-driven inventory skew, the withdrawal haircut and the convex coverage wall, stated exactly as implemented - [Liquidity shaping](https://btr.markets/docs/1-1-2-liquidity-shaping.md): 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](https://btr.markets/docs/1-1-3-anchor-path-pricing.md): 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](https://btr.markets/docs/1-1-4-spread-fees.md): Direction-invariant multi-factor spread; one output-side fee at half the spread; convex coverage toll charged before it - [Slippage & Price Impact](https://btr.markets/docs/1-1-5-slippage-price-impact.md): Exact decomposition of oracle mark to taker-received, the deterministic impact term, and the protections against the stochastic remainder - [Toxic flow mitigation](https://btr.markets/docs/1-1-6-toxic-flow-mitigation.md): The adverse-selection budget: what each defense costs and what it covers. - [Configuration parameters](https://btr.markets/docs/1-1-7-parametrization.md): Every AIMM parameter: its units, its formula, its fence, and its live value - [AIMM invariants](https://btr.markets/docs/1-1-8-invariants.md): Every constraint the protocol claims is always true, with the code that enforces it and the failure mode if it breaks - [Pool Contract](https://btr.markets/docs/1-2-1-pool.md): Main AMM operations: swap, deposit, withdraw, donate, liability swap - [Feed oracle](https://btr.markets/docs/1-2-2-internal-oracle.md): EXTERNAL = any IOracle (recommended). INTERNAL = cash-collateral peg helper. NX Rates push API. - [Admin Contract](https://btr.markets/docs/1-2-3-admin.md): Pool configuration, timelock governance, and emergency controls - [Flash Loans](https://btr.markets/docs/1-2-4-flash.md): ERC-3156-style flash loans on the pool-keyed Flash singleton: fees, liquidity floor, and borrower callback - [Deployments](https://btr.markets/docs/2-overview.md): Testnet deployment policy, asset registry, pool composition - [Contract Addresses](https://btr.markets/docs/2-1-contract-addresses.md): BTR deployed contract addresses per chain, generated from the deploy SoT. - [Asset Registry](https://btr.markets/docs/2-2-asset-registry.md): 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](https://btr.markets/docs/2-3-pool-composition.md): 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](https://btr.markets/docs/3-overview.md): Defense-in-depth architecture for AIMM protocol security - [Access Control, Roles & Emergency Powers](https://btr.markets/docs/3-1-access-control-roles-emergency-powers.md): Who may do what: principals, guardian surface, halt authority, timelock schedule, and owner-gated op classes. - [Deployment & Upgradeability](https://btr.markets/docs/3-2-deployment-upgrades.md): Per-chain deploy order, the beacon and UUPS upgrade paths, and the timelock tiers that gate them. - [Flow Guards (Reentrancy and MEV Protection)](https://btr.markets/docs/3-3-flow-guards.md): Multi-layered temporal protection against callback, reentrancy, and JIT manipulation attacks - [Oracle System](https://btr.markets/docs/3-4-oracles.md): EXTERNAL = any IOracle mark (recommended). INTERNAL = cash-collateral 1:1 peg helper only. - [Base-Token Depeg Halt](https://btr.markets/docs/3-5-depeg-halt.md): 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](https://btr.markets/docs/3-6-oracle-price-push-security.md): 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](https://btr.markets/docs/3-7-bug-bounty.md): Responsible disclosure scope, rewards, safe harbor. - [Observability](https://btr.markets/docs/3-8-observability.md): Lifecycle stages, the metrics that cover each, healthy ranges, and what a breach means. - [Guardian Operations](https://btr.markets/docs/3-9-guardian-operations.md): 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](https://btr.markets/docs/3-10-oracle-keeper-operations.md): 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](https://btr.markets/docs/3-11-risk-steward-operations.md): 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](https://btr.markets/docs/4-overview.md): How to trade and provide liquidity on BTR: what each action does on chain, what it costs, and how it can fail. - [Swapping](https://btr.markets/docs/4-1-swapping.md): 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](https://btr.markets/docs/4-2-providing-liquidity.md): 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](https://btr.markets/docs/4-3-assets-and-the-hub.md): 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](https://btr.markets/docs/4-4-liability-swaps.md): 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](https://btr.markets/docs/5-overview.md): Integrate BTR: swap, LP, liability transfer, flash, deploy pools, hooks, HTTP API, SDK - [Basic Operations](https://btr.markets/docs/5-1-1-basic-operations.md): Solidity signatures, a copy-pasteable interface, units, reverts and events for an AIMM pool - [Pool Deployment & Curation](https://btr.markets/docs/5-1-2-pool-deployment-curation.md): Deploying a pool, the chain-wide ownership model, and the curation surface: assets, oracles, risk, curves, halts - [Pool Hooks](https://btr.markets/docs/5-1-3-hooks.md): Farm idle pool capital via YieldHook adapters: callback surface, dual ledger, buffer, harvest cap - [Composability](https://btr.markets/docs/5-1-4-composability.md): Flash loans through the Flash singleton, and cross-pool routing - [Consuming Price Feeds](https://btr.markets/docs/5-1-5-consuming-price-feeds.md): Third-party integration guide for the BTR oracle: getFeed, isFeedFresh, and the four ways a naive read hurts you - [API & SDK Reference](https://btr.markets/docs/5-2-1-api-sdk-reference.md): The BTR gateway HTTP surface and the reachable @btr-protocol/sdk entrypoints - [Quotes & Routing](https://btr.markets/docs/5-2-2-quotes-routing.md): Off-chain best path, per-leg slippage, EIP-5792 batching, and settling a path through the Router. - [Cookbook](https://btr.markets/docs/5-2-3-cookbook.md): Working TypeScript, Python, Rust and Solidity snippets for swap, LP, liability transfer, flash and deploy - [White Labeling](https://btr.markets/docs/5-3-1-white-labeling.md): Running a branded pool on BTR: what a deployer controls, and the two things they do not - [Protocol Fee Collection](https://btr.markets/docs/5-3-2-protocol-fee-collection.md): How a pool's fee recipient pulls accrued protocol fees, and how the fee sink is rotated - [Incentivization](https://btr.markets/docs/5-3-3-incentivization.md): The four on-chain levers that pay BTR liquidity: fee split, donations, POL, hook yield - [Roadmap](https://btr.markets/docs/6-overview.md): 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](https://btr.markets/docs/6-1-total-return-swaps.md): Leveraged directional exposure on the liability-swap primitive: margin accounting, coverage as the utilization curve, skew-based funding, and progressive deleveraging - [Single-Asset Vaults](https://btr.markets/docs/6-2-single-asset-vaults.md): 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](https://btr.markets/docs/cookie-policy.md): How the BTR Interface uses cookies and local storage, and how to manage your preferences. - [Privacy Policy](https://btr.markets/docs/privacy-policy.md): How BTR handles your information when you use its Services. - [Risk Disclaimer](https://btr.markets/docs/risk-disclaimer.md): Material risks of using BTR - [Terms of Service](https://btr.markets/docs/terms-of-service.md): Terms governing use of the BTR interface and related services - [Glossary](https://btr.markets/docs/glossary.md): DeFi, TradFi, and statistical terms used in AIMM docs. ## Blog - [Welcome to the blog](https://btr.markets/blog/welcome.md): Engineering notes and protocol updates from the BTR team. - [Securing Wombex's residual deposits](https://btr.markets/blog/securing-wombex-residual-deposits.md): Nearly half a million dollars remains in obsolete Wombex and Wombat contracts, yielding nothing. We are moving it to safer custody, and preserving every depositor's share. - [Opening the dealing desk everyone hides](https://btr.markets/blog/opening-the-dealing-desk-everyone-hides.md): Every prop AMM keeps its pricing model, inventory policy and spread private, and pushes only the finished quote. We push only the mark and leave the desk in public bytecode, so anyone can rerun the quote and get our number. - [The cheapest signed oracle on the EVM](https://btr.markets/blog/the-cheapest-signed-oracle-on-the-evm.md): 5,158 gas per feed, measured. Four generations from one slot per feed to ten feeds in one slot, why every mainstream design still spends a whole word on a single price, and what we refused to give up to get here. - [Providing concentrated liquidity is a negative-sum game](https://btr.markets/blog/providing-concentrated-liquidity-is-a-negative-sum-game.md): Two years and 77.8 million swaps replayed tick by tick on Base. LP fees lose to adverse selection in 14 of 14 market regimes, concentration makes it worse, and the capacity of the product is zero. - [The quote is the product](https://btr.markets/blog/the-quote-is-the-product.md): BTR is an Adaptive Inventory Market Maker. Pools quote a live mark, share inventory across the pool, and lean with the book, so traders, LPs, and builders all meet the same product: the quote. - [We didn't forget you [Wombex]](https://btr.markets/blog/we-didnt-forget-you-wombex.md): Two years of radio silence on the Wombex channels. BTR is the DEX we built during that silence. - [AIMM at a glance](https://btr.markets/blog/aimm-at-a-glance.md): How BTR pools price swaps from external marks, local inventory and coverage instead of a fixed bonding curve. ## API - [Docs corpus JSON](https://btr.markets/docs-api/all): every compiled doc - [Docs search](https://btr.markets/docs-api/search?q=): BM25 over the corpus - [Blog index JSON](https://btr.markets/blog-api/posts): post metadata, newest first - [Blog RSS](https://btr.markets/blog/feed.xml)