# Tenor API > Quotes and ready-to-sign payloads for lending and borrowing on Tenor, at a fixed or a variable rate. Tenor never signs, sends or holds a key: your wallet signs and sends every payload. Base URL: https://tenor-api.tenor.finance (staging: https://tenor-api-staging.tenor.finance). - [OpenAPI 3.1 document](https://tenor-api.tenor.finance/v1/openapi.json): every operation, schema and error - [API reference](https://tenor-api.tenor.finance/v1/docs): interactive reference with a request client Lend and borrow on Tenor, at a fixed or a variable rate, using your non-custodial wallet of choice. Tenor never signs, sends or holds a key. 1. **Find a market.** `GET /v1/markets` returns every market with its open maturities. 2. **Quote.** `POST /v1/quotes` gives the rate for a size right now. 3. **Prepare.** `POST /v1/lend/prepare`, or the prepare of any other action, returns the transactions to sign, already simulated and checked. 4. **Sign and send** the transactions from your wallet. 5. **Track.** `GET /v1/transactions/{tx_hash}` reports when the transaction is included in a block and what it filled. No API key is needed. A key raises the rate limits. ## Conventions | Convention | Rule | Example | | --- | --- | --- | | Amounts | Integer strings in the token's smallest unit, never rounded | `"1000000"` = 1 USDC | | Rates | Annual rate (APR) as a decimal string, in fields ending in `_rate` | `"0.052"` = 5.2% | | Times | Unix seconds. A field ending in `_at` is a moment, and one ending in `_s` is a duration. `meta.generated_at` is the only ISO 8601 timestamp | `matures_at`, `time_to_maturity_s` | | Chains | `chain_id` on every chain-scoped request: in the query on GET, in the body on POST | `chain_id=8453` | | IDs | Opaque strings, unique within a chain | `maturity_id` | | Addresses | Accepted in any case, returned checksummed | `0x833589fCD6…` | | Paging | Offers, positions and fills are paged with `cursor` and `limit` (default 50, max 200). `meta.next_cursor` is `null` on the last page. Catalog lists (chains, tokens, markets, maturities, curves, balances) are short and aren't paged | `limit=50` | | Options | Opt-in flags start with `include_` | `include_onchain=true` | | Client IDs | A `client_id` passed on a prepare is echoed back and logged | | | Compatibility | Fields, enum values and error codes are only ever added. Ignore unknown fields, and handle unknown values | | ## Glossary | Term | Meaning | | --- | --- | | market | A loan token and the collateral tokens borrowers can post for it. A market groups every maturity of the pair and its variable rate | | maturity | One fixed term of a market, at fixed rates, ending at `matures_at` | | variable rate | A market's floating rate, with no term. Lent and borrowed under `/v1/variable/*`, by `market_id` | | deprecated | A market or maturity that Tenor is phasing out. Tenor no longer lists it and its liquidity runs off, but it still trades | | best rate / mid rate | The best lend or borrow rate available now, and the midpoint between the two | | term structure | The best rates on every maturity of a market, side by side | | market depth | The open offers on a maturity, grouped by rate | | liquidity | The amount that can be lent or borrowed at the current rates | | settlement fee / continuous fee | A fee taken from each fill, and a fee that accrues on a lend until maturity | | principal | The amount that changes hands now | | amount at maturity | The amount owed, or paid back, at maturity | | quote | The rate for a size right now. A quote is a preview and commits to nothing | | offer | A firm commitment to lend or borrow at a rate, open until it fills, expires or is cancelled | | ladder | Several offers posted together at stepped rates or sizes | | staircase | Offers posted together in back-to-back time windows, so that together they hold one rate as maturity nears. Listed as one entry | | group / OCO | Offers that share their fills. Cancelling a group cancels all of its offers. With `oco` (one cancels the other), a ladder shares one group, so a fill on one offer reduces the others | | idle capital | The capital behind a lend offer, earning the variable rate until a taker fills the offer | | lending vault | The contract that holds a market's variable lends, idle capital included (`onchain.lending_vault` in `GET /v1/markets`) | | deposit on fill | A borrow offer whose collateral stays in the wallet until the offer fills | | passive quoting curve | A maker's lend and exit rates by time to maturity, quoted on every maturity of a market | | exit rate | The rate at which a curve resells the maker's fixed lends (`resell_rate`) | | position | A fixed or variable lend or borrow held by a wallet | | LLTV / LTV | The loan-to-value at which a borrow can be liquidated, and the borrow's current loan-to-value | | liquidation price | The collateral price at which a borrow becomes liquidatable | | cost basis / P&L | The cost of opening a position, and its profit or loss since | | Action | Description | | --- | --- | | lend / borrow | Open or add to a fixed-rate position on a maturity | | repay | Pay back a borrow, early by taking offers or in full | | resell | Exit a lend before maturity by reselling it to another lender | | redeem | Collect a lend from what borrowers have repaid, usually at maturity | | take | Accept one specific offer | | manage | Add or withdraw collateral, or set auto-renewal, without changing the debt | | renew | Roll a position into a later maturity of the same market | | migrate | Move a variable borrow to a fixed rate | | post / cancel | Post offers, or cancel them | | clear | Stop a curve from quoting | ## Authentication - Every route works without an API key, except `GET /v1/access`. Without a key, rate limits are per IP address. - With a key in the `X-Api-Key` header, rate limits are per key, and higher. - A key carries scopes: `read` for readiness and `trade` to prepare payloads. A key sent to a route must carry the scope the route states. - Keys starting with `tnr_sk_test_` are test keys. They work like live keys, but every prepare is a dry run. - An invalid key is rejected on every route, never ignored. - `GET /v1/access` checks a key. A revoked key stops working within 30 seconds. - Keep keys on your servers. Never ship a key to a browser or an app. ## Payloads Every `POST …/prepare` returns a payload for one wallet: the transactions to sign, a one-line `summary`, and a `preview` of their effects. Declare how the wallet signs in `wallet_kind`, and the payload is built for that wallet. If the wallet's code doesn't match, the payload carries a `WALLET_KIND_MISMATCH` warning. A smart account isn't deployed until its first operation, so `smart_account` is never flagged. | `wallet_kind` | Send | Signing window | | --- | --- | --- | | `eoa` | Each of `steps` in order, waiting for each receipt; or `requires`, then `transaction` | 5 min | | `delegated_eoa` (EIP-7702) | `calls` in one `wallet_sendCalls`, or as an `eoa` | 5 min | | `safe` | `safe_tx` as one Safe transaction (MultiSendCallOnly, delegate call) | 30 min | | `smart_account` | `calls` in one user operation | 30 min | - **Checks.** Each payload is simulated as returned, from the wallet, at the latest block, and then checked: approvals match the size (except a curve's setup, which approves the vault's shares in full to the curve's callback, for every curve on that vault), the rate and the deadline are bounded onchain, and every call goes to Tenor's contracts. If a check fails, the prepare returns an error and no calldata. - **Validity.** `limit_rate` and the deadline are enforced onchain. A payload included in a block after `validity.until_at` reverts, so it never fills at a worse rate. If you can't sign before `until_at` minus `validity.recommended_margin_s`, prepare again. - **Approvals.** `requires` lists the approvals and the one-time authorization the wallet still needs, as of the prepare. Wait until each payload is included in a block before you prepare the next one. - **Fresh quotes.** Each prepare quotes again and never reuses an earlier quote. `preview` is the result of the simulation: the size, the rate with fees, the offers filled and the wallet's balance changes. - **No quote.** A payload that fills no offers (a redeem, a direct repay, a manage, a variable action) has no `quote` and no `limit_rate`. Its `bounds` and `validity.until_at` are `null`. - **Dry run.** `dry_run: true` runs the same quote, simulation and checks, with the wallet funded in the simulation. It works for a wallet that holds nothing yet. The response has `status: preview_only`, the full `preview` and `requires`, and nothing to send. Test keys always dry run. - **Sanctions.** Wallets on the OFAC sanctions list get `403 WALLET_BLOCKED`. The key that prepares doesn't matter. - **Debugging.** `include_onchain: true` adds `onchain`: the payload's calls decoded by their ABIs, nested bundles included, with the result of each call in the simulation and the events it emitted. `onchain` follows the contracts' ABIs and changes with them, so the compatibility rule in Conventions doesn't cover it. ## Responses - A success is `{ "data": …, "meta": { "request_id", "generated_at", … } }`. - An error is `{ "error": { "code", "category", "treatment", "message", "details", "request_id" } }`. - Branch on `code`. For an unknown code, act on `treatment`: `fix_request`, `refetch_state`, `fund_account` or `retry`. - A payload can carry `warnings`, which never block it. Show the `message` of an unknown warning. - Every response carries `X-Request-Id`. Send your own (up to 128 of `A-Z a-z 0-9 . _ : -`) to match our logs with yours. ## Rate limits Each route counts against one of four budgets, so a burst of quotes can't block a prepare, and neither can block a cancel. With a key, budgets are per key. Without one, they are per IP address. | Budget | Routes | With a key | Without | | --- | --- | --- | --- | | `read` | Reads | 1200 / 60 s | 25 / 1 s, 150 / 10 s, 1000 / 60 s | | `compute` | Quotes and takeable offers | 120 / 60 s | 30 / 60 s | | `prepare` | Prepares, simulations and readiness | 120 / 60 s | 15 / 60 s | | `cancel` | Cancels and curve clears | 600 / 60 s | 30 / 60 s | - Treat limits as approximate: each server counts on its own, and requests are spread across servers. - Every response carries `X-RateLimit-Policy`, `X-RateLimit-Limit`, `X-RateLimit-Remaining` and `X-RateLimit-Reset`. - Past a limit, requests get `429 RATE_LIMITED`, with `Retry-After` in seconds. Wait that long before retrying. - After 30 failed key checks in a minute, an IP address gets `429` on every request that sends a key. ## Caching - Slow-changing reads (catalog, market state, market depth) send `Cache-Control` with a `max-age`, and an `ETag`. Revalidate with `If-None-Match`: an unchanged response is a `304` with no body. - Quotes, payloads and anything about one wallet are `no-store`. Don't cache them. - A transaction is `no-store` until it is final and indexed. After that, it may be cached for a minute. - `meta.generated_at` is when the data was read, which can be up to `max-age` ago. ## Live data Market depth and quotes stream over a WebSocket at `wss://router.tenor.finance/socket` (Phoenix Channels), on the `orderbook:{maturity_id}` and `quotes:{maturity_id}` topics, updated every block. Use the stream to know when to quote again. Prepare through this API, which checks every payload before you sign it. ## Catalog Chains, tokens, markets and maturities served by the API. The catalog carries no rates: rates come from quotes and market depth. - `GET /v1/chains` lists the chains served, with `capabilities` (the features the API supports there) and `status`. Treat an unknown capability as off. While a chain is `degraded`, prepares fail with a `retry` treatment and reads keep working. - `GET /v1/markets` returns each market with its open maturities, so one call is enough to start. - `listing` tells two kinds of market apart. `listed` markets are curated by Tenor, on a regular maturity cadence. `otc` markets are any other market whose tokens are all whitelisted, whose oracles scale by its tokens' decimals, and that has no enter or liquidator gate. Lists return `listed` markets unless you pass `listing=otc` or `listing=all`. Curves, renews, migrations and auto-renewal only target `listed` markets. - **Tenor doesn't review OTC markets.** Passing the checks above doesn't make one safe. Read its `collaterals[].oracle` and `lltv` before you lend or borrow on it. - An ID that exists onchain but isn't served gets `422 MARKET_NOT_SUPPORTED`. Positions on maturities or markets that are no longer served can still be closed, unless the market uses a blocked token. - Deprecated markets and maturities still trade while Tenor phases them out. Lists hide them unless you pass `include_deprecated=true`. A prepare that adds exposure to one carries a `MARKET_DEPRECATED` warning. - `GET /v1/chains`: List chains. Lists the chains this API serves, with the features supported on each (`capabilities`) and each chain's current state (`status`). Every request about a chain takes its `chain_id`. - `GET /v1/markets`: List markets. Lists the chain's markets, each with its collateral tokens, its variable rate and its maturities open for new lends and borrows. Deprecated markets are listed only with `include_deprecated`. - `GET /v1/markets/{market_id}`: Get a market. Returns one market. A deprecated market is returned too, with its `status`. - `GET /v1/markets/{market_id}/maturities`: List a market's maturities. Lists the market's maturities open for new lends and borrows, earliest first. Deprecated maturities are listed only with `include_deprecated`. - `GET /v1/maturities/{maturity_id}`: Get a maturity. Returns one maturity. Deprecated and matured maturities are returned too, with their `status`. Use this endpoint to look up the maturity of a position or an offer. - `GET /v1/tokens`: List tokens. Lists every token the chain's markets lend or accept as collateral, sorted by symbol. ## Market depth The open offers on each maturity, before fees. Every caller sees the same depth, refreshed once a block. - `GET /v1/maturities/{maturity_id}/depth` groups the open offers into rate levels. Lenders post `lend_offers`, which you borrow from, and you lend into `borrow_offers`. Depth rates are the makers' rates, before fees: quote a size to get its rate. - `GET /v1/maturities/{maturity_id}/takeable-offers` lists the offers that can be taken right now, with live amounts, for `POST /v1/take/prepare`. - `GET /v1/markets/{market_id}/term-structure` lines up the best rates of every open maturity next to the market's variable rates. - A maturity with withdrawable liquidity carries a 0% lend offer (`syn:withdrawable:`, `kind: withdrawable`). It is real liquidity, so it can make the depth look crossed: `best_borrow_rate` is `0` and `spread` negative. - `GET /v1/markets/{market_id}/term-structure`: Get a market's term structure. Returns the best lend and borrow rates on every open maturity of a market, with the liquidity on each, next to the market's variable rates. Fixed rates are the best rates of each maturity's market depth, before fees, as `GET /v1/maturities/{maturity_id}/depth` returns them. `POST /v1/quotes/term-structure` quotes a size with fees. Refreshed once a block. - `GET /v1/maturities/{maturity_id}/depth`: Get a maturity's market depth. Returns the open offers on one maturity, grouped into rate levels, with the best rate on each side. Rates are the makers' rates, before fees. `POST /v1/quotes` gives the rate for a size with fees. Offers reserved for one taker and offers above 30% are left out. Refreshed once a block, and `meta.block_number` is the block the offers were read at. - `GET /v1/maturities/{maturity_id}/takeable-offers`: List takeable offers. Lists the offers on one side of a maturity that can be taken right now, best rate first, up to 50. Tenor quotes each offer, so the amounts are live and each `offer_id` goes straight to `POST /v1/take/prepare`. Pass `wallet` to list the offers that wallet can take. Unlike market depth, the list includes offers above 30%. When a side has more than 50 offers, the list holds the 50 that fill the most. A matured maturity lists none. ## Quotes The rate for a size right now, with fees included. A quote is a preview and commits to nothing: each prepare quotes again and enforces its own limit rate onchain. - `POST /v1/quotes` quotes one maturity. `POST /v1/quotes/term-structure` quotes the same size on every maturity of a market. - Size a quote by `principal` (the amount that changes hands now) or by `amount_at_maturity`. The quote returns both. - Pass the `wallet_kind` that will sign, so the quote fills like its prepare. - When nothing can fill the size, the quote fails with a `422` and never returns a 0% rate. Set `allow_partial` to quote the part the open offers can fill. - `POST /v1/quotes`: Get a quote. Quotes a size on one maturity right now, across the open offers, with fees included. A quote is a preview and commits to nothing: each prepare quotes again and enforces its own limit rate onchain. `meta.block_number` is the block the offers were read at. - `POST /v1/quotes/term-structure`: Get quotes across maturities. Quotes the same size on every maturity of a market in one call, with fees included. The result is the term structure at that size. A maturity that can't be quoted gets an `error`, and the others are still quoted. The call costs one `compute` request per maturity quoted, up to 12. ## Fixed rate Lend, borrow and exit on a maturity at a fixed rate. **Lend and borrow.** Size by `principal` (the amount lent or received now) or by `amount_at_maturity` (the amount paid back or owed). A lend with `post_rest` fills the open offers at `limit_rate` or better and posts the rest as a lend offer, in the same payload. When no offer meets the limit, the payload only posts. A borrow can deposit collateral in the same payload with `deposit_collateral`. **One side per maturity.** A wallet can't lend and borrow on the same maturity (`422 OPPOSITE_POSITION`). Resell or repay first. **Exits.** Repay, resell and redeem close a position on its `maturity_id`. Leave `size` out to close the whole position. A wallet without the position gets `404 POSITION_NOT_FOUND`, which names the action that fits the position it holds. - **Repay** pays a borrow back early by taking offers, or in full with `direct: true`. After maturity, every repay is direct. - **Resell** exits a lend before maturity. **Redeem** collects it from what borrowers have repaid, usually after maturity. **Take** accepts one offer by `offer_id`, with no fallback. `quote.action` says whether the take lends or borrows. **Manage** moves collateral without changing the debt. **Renew** rolls a whole position into a later maturity of the same market, and **migrate** moves a variable borrow to a fixed rate. Both work now (`mode: spot`) or through an offer (`mode: limit`). **Auto-renewal.** `renewal` on a borrow or a manage renews the market's borrows before they mature, and falls back to the variable rate when no renewal fills. **Previews.** `preview.position_before` and `preview.position_after` show the position before and after the payload. A payload that leaves the position above 95% of its borrow capacity gets a `HEALTH_THRESHOLD` warning. Health never blocks a payload. - `POST /v1/borrow/prepare`: Prepare a borrow. Borrows at a fixed rate on one maturity. `deposit_collateral` deposits collateral in the same payload, and `renewal` sets the market's auto-renewal. No API key needed. A key sent must carry the `trade` scope. - `POST /v1/lend/prepare`: Prepare a lend. Lends at a fixed rate on one maturity. With `post_rest`, the part the open offers can't fill at `limit_rate` is posted as one lend offer at that rate, in the same payload. No API key needed. A key sent must carry the `trade` scope. - `POST /v1/manage/prepare`: Prepare a collateral or auto-renewal change. Deposits or withdraws collateral on one maturity, sets the market's auto-renewal, or both. The debt doesn't change. Pass at most one of `deposit_collateral` and `withdraw_collateral`. To borrow more or repay part of a borrow, use `/v1/borrow/prepare` (with `deposit_collateral`) or `/v1/repay/prepare` (with `withdraw_collateral`). No API key needed. A key sent must carry the `trade` scope. - `POST /v1/migrate/prepare`: Prepare a migration to a fixed rate. Moves the wallet's whole variable borrow on `market_id` to a fixed rate on `target_maturity_id`, with its collateral. `preview.source` is the variable borrow the payload closes, and the rest of `preview` is the fixed borrow. In `spot` mode, the payload repays the variable borrow in full, moves the collateral and borrows on the maturity, bounded onchain by `limit_rate` and `deadline_at`. Any amount the repay didn't use comes off the new debt. In `limit` mode, the payload posts an offer at `limit_rate` until `expires_at` (`offers`), sized above the debt to cover the interest that accrues until then. Each fill moves its share of the borrow. No API key needed. A key sent must carry the `trade` scope. - `POST /v1/redeem/prepare`: Prepare a redeem. Redeems a lend one for one, from the amount borrowers have repaid into the maturity. Repaid funds are usually there after maturity, or earlier when borrowers repay early. When only part of the lend is redeemable, the payload redeems that part, and a `PARTIAL_REDEEM` warning gives the amount left. No API key needed. A key sent must carry the `trade` scope. - `POST /v1/renew/prepare`: Prepare a renewal. Rolls the wallet's whole position on `maturity_id` into `target_maturity_id`, a later maturity of the same market. A borrow moves its debt and collateral, and a lend its amount at maturity. Tenor reads the side onchain. In `spot` mode, the payload renews now, bounded onchain on the target by `limit_rate` and `deadline_at`. A borrow first repays its debt early by taking offers, for less than the amount owed where offers allow (`preview.source.bought_back`), and repays the rest in full. A lend renews from the amount borrowers have repaid into its maturity, so usually after the maturity. In `limit` mode, the payload posts an offer at `limit_rate` until `expires_at` (`offers`). Each fill rolls its share of the position. `preview.source` is the position the payload closes, and the rest of `preview` is the target. To renew automatically, set `renewal` on `/v1/borrow/prepare` or `/v1/manage/prepare`. No API key needed. A key sent must carry the `trade` scope. - `POST /v1/repay/prepare`: Prepare a repay. Repays a borrow on one maturity. Before maturity, the payload repays early by taking offers, bounded onchain by `limit_rate` and `deadline_at`. With `direct`, or after maturity, the payload pays the full amount owed at maturity, with no quote, `limit_rate` or deadline. `withdraw_collateral` takes collateral back in the same payload, after the repay. No API key needed. A key sent must carry the `trade` scope. - `POST /v1/resell/prepare`: Prepare a resell. Exits a lend before maturity by reselling it into the open lend offers. After maturity, redeem the lend instead. No API key needed. A key sent must carry the `trade` scope. - `POST /v1/take/prepare`: Prepare a take. Takes one offer, given by its `offer_id`, and fills against that offer alone. Taking a lend offer borrows, with `deposit_collateral` in the same payload or against collateral already posted. Taking a borrow offer lends. Sizing and limits work as for a borrow or a lend. The quote and the payload use only that offer, with no fallback to other offers. A wallet can't take its own offer, or the side opposite a position it holds on that maturity. `409 OFFER_STATE_CHANGED` means the wallet can't take the offer for its whole signing window: the offer was filled or cancelled, is reserved for another taker, or expires too soon. No API key needed. A key sent must carry the `trade` scope. ## Variable rate Lend or borrow a market's loan token at its floating rate, with no term. These actions mirror the fixed ones, but take a `market_id` instead of a maturity. A market's variable rate is `variable` in `GET /v1/markets`. - **Lend** deposits into the market's lending vault. The deposit earns the variable rate and funds the wallet's idle-capital offers and passive quoting curve on the market. **Withdraw** takes it back, up to the part variable borrowers haven't borrowed. - **Borrow**, **repay** and **manage** work like their fixed counterparts, against the market's `variable.collateral_token`. - A withdrawal that leaves the wallet's idle-capital offers or curves short gets an `IDLE_CAPITAL_SHORTFALL` or `CURVE_UNFUNDED` warning. - `preview.variable_lend` and `preview.variable_borrow` show the position before and after the payload. - `POST /v1/variable/borrow/prepare`: Prepare a variable borrow. Borrows `size.principal` at the market's variable rate, against collateral already posted or against `deposit_collateral`, deposited first in the same payload. The first variable borrow also needs a one-time authorization, listed in `requires`. A size the variable rate can't lend right now gets `422 INSUFFICIENT_LIQUIDITY`. A size the collateral can't carry gets `422 INSUFFICIENT_COLLATERAL`, with `details.max_principal`. No API key needed. A key sent must carry the `trade` scope. - `POST /v1/variable/lend/prepare`: Prepare a variable lend. Deposits `size.principal` into the market's lending vault at the variable rate. The deposit earns the variable rate until withdrawn, and funds the wallet's idle-capital offers and passive quoting curve on the market. No API key needed. A key sent must carry the `trade` scope. - `POST /v1/variable/manage/prepare`: Prepare a variable collateral change. Deposits or withdraws collateral for the wallet's variable borrow, without changing the debt. Pass exactly one of `deposit_collateral` and `withdraw_collateral`. To borrow more or repay part of the debt, use `/v1/variable/borrow/prepare` or `/v1/variable/repay/prepare`. No API key needed. A key sent must carry the `trade` scope. - `POST /v1/variable/repay/prepare`: Prepare a variable repay. Repays `size.principal` of the wallet's variable borrow, or the whole borrow when `size` is left out. A full repay approves a little more than the debt, for the interest that accrues until the payload is included in a block, and returns the unused part. `withdraw_collateral` takes collateral back after the repay. Leave out both `size` and the withdrawal's `amount` to close the borrow. No API key needed. A key sent must carry the `trade` scope. - `POST /v1/variable/withdraw/prepare`: Prepare a variable withdrawal. Withdraws `size.principal` from the wallet's variable lend, or the whole lend when `size` is left out. The vault can only pay out the part variable borrowers haven't borrowed. When that falls short, `422 INSUFFICIENT_LIQUIDITY` gives the amount available now. A withdrawal can leave the wallet's idle-capital offers short (`IDLE_CAPITAL_SHORTFALL`). They then fill only up to the remaining amount, unless `cancel_idle_offers` cancels them first. No API key needed. A key sent must carry the `trade` scope. ## Transactions Simulate calls right before the wallet sends them, and track transactions after they are sent. **Simulate.** `POST /v1/simulate` runs calls held before signing, or edited by a Safe or custodian, through the checks that don't need the original request. The response is always a 200, with a `status` of `ok`, `reverts` or `unsafe`. Calls to contracts outside Tenor's are simulated, but Tenor doesn't check what they do: check for a `FOREIGN_CALL` warning as well as `status`. **Track.** Poll `GET /v1/transactions/{tx_hash}` until `status` is `confirmed` or `reverted`, which are final, and `indexed` is `true`. The transaction's fills, position changes and offer changes come from Tenor's records. Rarely, Tenor records an event after `indexed` is `true`, so reconcile fills from `/fills` (see Accounts). - `POST /v1/simulate`: Simulate calls before signing. Simulates and checks calls right before the wallet signs them: a prepare's `calls` held for a while, or calls a Safe or custodian edited. The calls run in order, from the wallet, at the latest block. The response is always a 200, and `status` is `ok`, `reverts` or `unsafe`. Calls to contracts outside Tenor's are marked `foreign` and named in a `FOREIGN_CALL` warning. Foreign calls leave `status` at `ok`, so check for the warning too. At least one call must go to one of Tenor's contracts: any `GET /v1/chains` lists but `morpho_blue` and `permit2`. `meta.block_number` is the simulated block. No API key needed. - `GET /v1/transactions/{tx_hash}`: Track a transaction. Returns a transaction's status and effects. `status` comes from the chain, and the fills, position changes and offer changes for every wallet the transaction touched come from Tenor's records. Any transaction on the chain can be read, sent through Tenor or not. A hash the chain doesn't know yet returns `not_found`, not an error. Poll until `status` is `confirmed` or `reverted`, which are final, and `indexed` is `true`. From then on, the response can be cached for a minute. ## Accounts Positions, fills and balances of a wallet on one chain. - **Positions** lists fixed and variable lends and borrows. Amounts, collateral and health are read onchain. Cost basis and P&L come from Tenor's records of the wallet's fills. Positions in markets the catalog no longer lists are still returned. - **Fills** lists every fill the wallet took part in, as maker or taker. Tenor can record a fill late, below a cursor you already hold. To read new fills, poll with `from_block` from a few blocks before the last fill you saw, and drop the `fill_id`s you already have. - **Balances** lists the wallet's non-zero balances, read onchain, of the tokens of every market the API serves, listed and OTC, and of any token its offers reserve. `reserved` is the part its open offers can still take, and `available` the part it can move without leaving them short. Amounts inside Tenor are positions, not balances. - `GET /v1/accounts/{wallet}/balances`: List a wallet's token balances. Lists the wallet's non-zero balances, read onchain at `meta.block_number`, of the tokens of every market the API serves, `listed` and `otc`, deprecated ones included, and of any token its open offers reserve. A token it holds none of, and that nothing reserves, is left out. `reserved` is the part the wallet's open offers can still take when filled, and `available` is the part the wallet can spend without leaving those offers short. Amounts inside Tenor (lends, borrows, collateral, variable lends) are positions, and aren't listed here. - `GET /v1/accounts/{wallet}/fills`: List a wallet's fills. Lists every fill the wallet took part in on one chain, as maker or taker. Sorted oldest first, in block order. Page with `cursor`. To read new fills, poll with `from_block` a few blocks before the last fill already seen, and drop the `fill_id`s already held. - `GET /v1/accounts/{wallet}/positions`: List a wallet's positions. Lists the wallet's fixed lends and borrows, variable lends and variable borrows on one chain. Variable positions are listed first, then fixed positions by maturity, earliest first. Amounts, collateral and health are read onchain at `meta.block_number`. Cost basis and P&L come from Tenor's records of the wallet's fills. Only open positions are listed, unless `include_closed` or `status` asks for closed ones. - `GET /v1/accounts/{wallet}/positions/{position_id}`: Get a position. Reads one of the wallet's positions by `position_id`, closed positions included. ## Offers Post firm offers, read them back with their live status, keep them fillable, and cancel them. **Post.** `POST /v1/offers/post/prepare` posts one offer, or a ladder of offers at stepped rates or sizes, on one maturity or several. Each offer holds its `rate` onchain until it expires or its maturity, whichever comes first. With `oco: true`, the offers share one fill limit. - Pass groups to `replace_groups` to cancel old offers in the same payload as the new ones. `cancels` in the response lists what they end. Groups aren't checked against Tenor's records, since one posted a moment ago may not be in them yet: a group with none of the wallet's live offers ends nothing, and gets a `NOTHING_TO_REPLACE` warning. - A post can't cross the wallet's own open offers on the other side of a maturity (`422 SELF_CROSS`). An offer that holds a fixed discount instead of a rate is compared at its rate closest to the post's, since that rate climbs as maturity nears. - A lend post prepares even when the wallet holds less than its offers can pull, on top of what its other open offers reserve, with an `OFFER_UNFUNDED` warning. Takers fill only the amount the wallet holds when they take. - A borrow post prepares even when the collateral on a maturity can't back what its offers there can borrow, with a `COLLATERAL_SHORTFALL` warning. A fill past what the collateral carries fails: deposit collateral first, or post with `deposit_on_fill`. **Idle capital.** `idle_capital: true` on a lend post keeps the budget lent at the variable rate until a taker fills, and pays each fill from that variable lend. All the maturities of one post must share a lending vault. A fill the variable lend can't pay out at that moment fails, and Tenor's quote engine skips the offer until it can. The post tops the variable lend up to the budget from the wallet, which must hold the difference (`422 INSUFFICIENT_BALANCE`); a dry run funds it in the simulation instead. **Deposit on fill.** `collateral.deposit_on_fill: true` on a borrow post leaves the collateral in the wallet until each offer fills, so a borrow ladder needs nothing up front. If the wallet holds less than the collateral, the payload carries a `COLLATERAL_UNFUNDED` warning. **Read.** `GET /v1/offers?maker=` lists a wallet's offers with their live status. A staircase is listed as one entry. Offers on maturities the API doesn't serve are listed too, with `served: false`, since a cancel ends them. `GET /v1/offers/{offer_id}` reads one offer, including `syn:` offers quoted from a passive quoting curve. A new offer can read `invalid` (`RATIFIER_UNAUTHORIZED`) for about 20 s after its transaction is indexed, until Tenor's quote engine reads the wallet's authorization. **Readiness.** An open offer fills later, with no prepare, and silently stops filling when the wallet falls short. `GET /v1/accounts/{wallet}/readiness` checks the authorizations, allowances and balances the wallet's offers need, and returns the transactions that fix what is `missing`. Prepares carry their own approvals, so a post doesn't need readiness first. Check again after moving funds or approving elsewhere. **Cancel.** `POST /v1/offers/cancel/prepare` cancels by `offer_ids`, `groups`, `maturity_id`, `market_id` or `all`. IDs aren't checked against the catalog: one with none of the wallet's live offers, an unknown one included, gets `422 NOTHING_TO_CANCEL`. Cancelling every live offer of a group ends the whole group. Cancelling only some revokes the Merkle root they were signed under, which can end more offers (`CANCELS_MORE`). A large cancel can take several payloads (`MORE_TO_CANCEL`). Cancels keep working while quoting is down. - `GET /v1/accounts/{wallet}/readiness`: Check a wallet's readiness. Checks that takers can fill the wallet's open offers, read onchain at `meta.block_number`: the authorizations the offers rely on, and the allowances and balances that cover the amount they can pull. An open offer fills later with no prepare, and silently stops filling when the wallet falls short. Gaps a transaction can fix are listed in `missing`, built for `wallet_kind` and simulated from the wallet. `missing` is empty once those transactions are included in a block. Gaps that only funding fixes are in `shortfalls`. Prepares carry their own approvals, so a lend, a borrow or a post doesn't need readiness first. No API key needed. A key sent must carry the `read` scope. - `GET /v1/offers`: List a maker's offers. Lists a wallet's offers on one chain, with their live status. Sorted by maturity, earliest first. A staircase is one entry, at the maker's rate, and its `offer_id` is the window that is live now. Offers quoted from curves aren't listed. Offers on maturities the API doesn't serve are listed with `served: false`, since a cancel by `all`, `market_id` or `maturity_id` ends them too. - `POST /v1/offers/cancel/prepare`: Prepare to cancel offers. Cancels the wallet's offers. Pass exactly one of `offer_ids`, `groups`, `maturity_id`, `market_id`, or `all: true` for every offer on the chain. Cancels count against the `cancel` budget, apart from quotes and prepares. When every live offer of a group is cancelled, the whole group ends, and none of its offers can be taken again. Cancelling only some of a group's offers, such as one offer of an `oco` group, revokes the Merkle root they were signed under. Any other offer signed under that root ends too: `cancels.offer_ids` lists it, and a `CANCELS_MORE` warning names it. One payload ends at most 256 groups and roots. Past that, a `MORE_TO_CANCEL` warning gives the number left, to cancel once this payload is included in a block. No API key needed. A key sent must carry the `trade` scope. - `POST /v1/offers/post/prepare`: Prepare to post offers. Posts firm offers for the wallet: one offer, or a ladder of up to 20 at stepped rates and sizes, on one maturity or several. Each offer holds its `rate` onchain for its whole window. No tokens move until a taker fills an offer, except `collateral` deposited with a borrow post. A lend post approves the protocol for the most its offers can pull. The post still prepares when the wallet holds less, counting what its other open offers reserve, with an `OFFER_UNFUNDED` warning. A borrow post whose collateral can't back its offers prepares with a `COLLATERAL_SHORTFALL` warning. A post can't cross the wallet's own open offers on the other side of a maturity (`422 SELF_CROSS`). Tenor checks against its records, about a block behind the chain. No API key needed. A key sent must carry the `trade` scope. - `GET /v1/offers/{offer_id}`: Get an offer. Reads one offer with its live status, for a check before a take or a cancel. A staircase window is returned on its own, at its own rate, and `staircase` describes the staircase it belongs to. Offers quoted from curves (`syn:` IDs) can be read here too, and so can an offer on a maturity the API doesn't serve (`served: false`). An offer that filled, was cancelled or expired returns a 404 shortly after. ## Passive quoting A passive quoting curve is one set of rates that quotes every maturity of a market, with no transaction per quote. - A curve has 2 to 8 points of `{ time_to_maturity_s, lend_rate, resell_rate }`. The curve lends a vault's idle capital into each maturity at `lend_rate`, and resells the wallet's fixed lends at the exit rate, `resell_rate`, returning the capital to the vault. - Tenor's quote engine turns the curve into offers and updates their rates about every block. A new curve, or one with new rates, starts quoting within a minute. - `POST /v1/curves/set/prepare` sets a curve. The first set writes the curve's setup and funds its vault (`enable`). After that, a set that keeps the first and last points is one call (`reprice`). - One vault can back curves on every market with the same loan token, so one deposit funds them all. - Rates are stored per second, rounded in the maker's favour by under 3.2e-11 a year, and read back as set. The live offers sit on the market's tick grid, up to one tick step in the maker's favour, so a take rate can differ a little from `GET /v1/curves/preview`. - Every set is written, even one identical to the stored curve. - Curves renew on the last-Friday-of-month cadence. The API takes no cadence, and every set that writes the setup writes that cadence again. - `POST /v1/curves/clear/prepare` stops a curve from quoting and keeps its setup. `GET /v1/curves/preview` shows a curve's quotes on every maturity now. - `GET /v1/curves`: List a maker's curves. Lists a wallet's curves, one per market, with their points, status and readiness, read onchain at `meta.block_number`. A curve set a moment ago is listed once Tenor has recorded its setup, about a block after the payload is included in a block. Cleared curves are listed only with `include_cleared`, with the points they last held. - `POST /v1/curves/clear/prepare`: Prepare to clear a curve. Clears the wallet's curve on a market in one call, so the curve stops quoting at the next refresh. The setup stays, so the next `POST /v1/curves/set/prepare` with the same window is one call. `disable: true` also removes the lend and exit setup. The allowance and the idle capital are left as they are. A clear that would change nothing gets `404 CURVE_NOT_FOUND`: the wallet has no curve quoting on the market, or with `disable`, no curve or setup either. An OTC market clears like any other, since its curve may date from before it was delisted. Clears count against the `cancel` budget, apart from quotes and prepares. No API key needed. A key sent must carry the `trade` scope. - `GET /v1/curves/preview`: Preview a curve's quotes. Shows a wallet's curve on one market and its quotes now on every maturity not yet matured. Rates are computed onchain at `meta.block_number`, before fees. `available` reflects Tenor's last refresh, a block or two behind. A maturity the curve doesn't quote gives a `reason`. A new curve, or one with new rates, starts quoting within a minute. - `POST /v1/curves/set/prepare`: Prepare to set a curve. Sets the wallet's passive quoting curve on a market. The curve's `points` quote every maturity of the market, with no transaction per quote. When the setup is in place and the first and last points don't move, the payload is one call that only updates the rates (`curve.mode: reprice`). A set identical to the stored curve is still written. Otherwise (`enable`), the payload also writes the curve's setup: the authorizations, the lend and exit setup, and an approval of all the vault's shares to the curve's callback. Every curve on the vault shares that approval, the one approval the API makes for more than the payload moves. `fund` deposits idle capital into the curve's vault in the same payload. The setup always writes the last-Friday-of-month renewal cadence. The API takes no cadence, and every `enable` writes that cadence again. Without idle capital, the curve quotes nothing, and the payload carries a `CURVE_UNFUNDED` warning. No API key needed. A key sent must carry the `trade` scope. ## Access Check an API key: the organization it belongs to, its scopes and its rate limits. Authentication, in the introduction, explains keys. - `GET /v1/access`: Check an API key. Returns the organization the key belongs to, the key's scopes, whether it is a live or a test key, when it expires and its rate limits. Call this endpoint first to check a new key. Needs an API key. ## Service Liveness, health checks and the API contract. - `GET /health`: Check dependencies. Reports the status of each dependency. `degraded` means some features may fail. The endpoint returns a 503 only when the database is down. - `GET /live`: Check liveness. Answers as long as the process serves requests. Checks nothing else. - `GET /v1/llms.txt`: Get the API summary for LLMs. Returns the API's conventions, each endpoint group's guide with one line per operation, and the error catalog, as Markdown (llmstxt.org). Also served at `/llms.txt`. - `GET /v1/openapi.json`: Get the OpenAPI document. Returns the OpenAPI 3.1 document, the source of truth for this API. Generate clients and tools from this document. ## Errors | Code | HTTP | Category | Treatment | Meaning | | --- | --- | --- | --- | --- | | `INVALID_PARAMS` | 400 | validation | fix_request | A parameter or the body failed validation. `details.issues` lists each problem. | | `UNSUPPORTED_CHAIN` | 400 | validation | fix_request | `chain_id` is unknown or not enabled on this API. | | `MARKET_MISMATCH` | 400 | validation | fix_request | The maturity doesn't belong to the given market. | | `INVALID_BOUNDS` | 400 | validation | fix_request | The limit rate and the size bounds contradict each other. | | `DEADLINE_INVALID` | 400 | validation | fix_request | The deadline is in the past, too soon, or beyond the wallet type's signing window. | | `OFFER_MARKET_MISMATCH` | 400 | validation | fix_request | The offer belongs to another maturity. | | `OFFER_SIDE_MISMATCH` | 400 | validation | fix_request | The offer is on the wrong side for this action. | | `OFFER_MAKER_MISMATCH` | 400 | validation | fix_request | The offer's maker isn't the wallet in the request. | | `INVALID_OFFER_INPUT` | 400 | validation | fix_request | Some offer fields are invalid. `details.issues` names them. | | `INVALID_MIXED_ROUTE` | 400 | validation | fix_request | The route mixes offers that can't be filled together. | | `RATE_ABOVE_MAX` | 400 | validation | fix_request | The rate is above the highest this request accepts: 30% for an offer, 100% for `limit_rate`. A curve rate above 30% gets `CURVE_INVALID`. | | `STAIRCASE_INVALID` | 400 | validation | fix_request | A limit renew or migration can't post its staircase. Either its window holds no step at this rate, or holding the rate until `expires_at` needs more than 256 offers, the most the API posts in one staircase. `details.max_expires_at` is the latest `expires_at` that fits. Posts hold one rate onchain and never get this code; staircases posted elsewhere can have more offers (`staircase.legs`). | | `CURVE_INVALID` | 400 | validation | fix_request | The curve points are invalid. There must be two to eight, in ascending order, the first at least an hour from maturity, every exit rate (`resell_rate`) below its lend rate, and no lend rate above 30%. | | `PAYLOAD_TOO_LARGE` | 413 | validation | fix_request | The request body is larger than 64 KiB. | | `HTTPS_REQUIRED` | 400 | validation | fix_request | The request used plain HTTP. Send it over HTTPS. | | `UNAUTHENTICATED` | 401 | auth | fix_request | The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`. | | `FORBIDDEN_SCOPE` | 403 | auth | fix_request | The API key lacks a scope this route needs. | | `TEST_KEY_NOT_ALLOWED` | 403 | auth | fix_request | This route needs a live key. | | `WALLET_BLOCKED` | 403 | auth | fix_request | The wallet is on a sanctions list that Tenor screens against, so no payload is prepared for it. | | `COUNTERPARTY_BLOCKED` | 422 | state | fix_request | The fill would use offers from a wallet on a sanctions list that Tenor screens against, so no payload is prepared. `details.offer_ids` lists those offers. Try another size or maturity, or take a specific offer. | | `REQUEST_BLOCKED` | 403 | auth | fix_request | The firewall blocked the request, based on its IP address or country. Contact Tenor if this is unexpected. | | `ROUTE_NOT_FOUND` | 404 | not_found | fix_request | No route matches the method and path. | | `MARKET_NOT_FOUND` | 404 | not_found | fix_request | No market with this ID on this chain. | | `MATURITY_NOT_FOUND` | 404 | not_found | fix_request | No maturity with this ID on this chain. | | `OFFER_NOT_FOUND` | 404 | not_found | fix_request | No offer with this ID on this chain. | | `POSITION_NOT_FOUND` | 404 | not_found | fix_request | No position with this ID on this chain. On a prepare, the wallet holds no position on the side the action needs on this maturity (`details.side`). On a migration or a variable action, the wallet holds no variable position on the market (`details.rate_type: variable`). | | `CURVE_NOT_FOUND` | 404 | not_found | fix_request | The wallet has no curve on this market. Set one with `POST /v1/curves/set/prepare`. On a clear, there is nothing to clear. | | `OFFER_STATE_CHANGED` | 409 | state | refetch_state | The offer can no longer be taken, and `details.reason` gives the cause. Read the open offers again. | | `NOTHING_TO_CANCEL` | 422 | state | refetch_state | None of the selected offers is live any more: they have filled, expired or been cancelled. Refetch the wallet's offers. A `maturity_id`, `market_id` or `offer_ids` with none of the wallet's live offers, an unknown one included, gets this code too. | | `MARKET_DEPRECATED` | 422 | state | fix_request | No longer raised: an action on a deprecated market or maturity succeeds, with a `MARKET_DEPRECATED` warning on its payload. | | `MARKET_NOT_SUPPORTED` | 422 | state | fix_request | The market or maturity exists onchain, but this API doesn't serve it. The API serves the markets Tenor lists, and OTC markets that pass its token, oracle and gate checks. Setting a curve, a renew, a migration or auto-renewal on an OTC market gets this code too. On a variable action or a migration, the market has no variable rate, or no lending vault to lend at the variable rate. | | `MATURITY_MATURED` | 422 | state | fix_request | The maturity is past `matures_at` and accepts no new lends or borrows. Lenders redeem, and borrowers repay. | | `DRY_RUN_UNAVAILABLE` | 422 | state | fix_request | This dry run can't run: the chain doesn't support dry runs, or a token balance can't be funded in the simulation. With a live key, prepare without `dry_run`. | | `IDLE_CAPITAL_UNAVAILABLE` | 422 | state | fix_request | The market has no lending vault for idle capital to earn the variable rate in. Post or lend without `idle_capital`. | | `VAULT_NOT_SUPPORTED` | 422 | state | fix_request | The vault can't back a curve on this market. Either Tenor doesn't list the vault for the market's loan token, or the wallet's curve on the market already uses another vault (`details.in_use`). Name the lending vault of a market with the same loan token, or first clear the wallet's curve on the market with `disable: true`. On a clear, name the vault the curve uses, or leave `vault` out. | | `NO_OFFERS` | 422 | liquidity | refetch_state | There are no open offers on that side. | | `NO_VALID_OFFERS` | 422 | liquidity | refetch_state | No offer on that side can be filled right now. | | `INSUFFICIENT_LIQUIDITY` | 422 | liquidity | refetch_state | There isn't enough liquidity to fill the full size. | | `LIMIT_RATE_NOT_MET` | 422 | liquidity | refetch_state | No fill is possible within the limit rate. | | `SLIPPAGE_EXCEEDED` | 422 | liquidity | refetch_state | The fill would fall outside the request's limit rate or size bounds. | | `INSUFFICIENT_BALANCE` | 422 | account | fund_account | The wallet doesn't hold the tokens this action needs. | | `INSUFFICIENT_COLLATERAL` | 422 | account | fund_account | The borrow, or the target of a renewal or migration, would go past its LLTV. `details.max_amount_at_maturity` is the amount its collateral covers, and `details.amount_at_maturity` the amount it would owe. A variable borrow gives `details.max_principal` instead. Deposit more collateral or borrow less. | | `POSITION_UNHEALTHY` | 422 | account | fix_request | The action would leave the position liquidatable. Withdraw at most `details.max_amount`. | | `SELF_CROSS` | 422 | account | fix_request | The action would fill the wallet's own offers, or post an offer that crosses them: a lend at or below one of its borrow rates on the maturity, or the reverse. | | `OPPOSITE_POSITION` | 422 | account | fix_request | The wallet holds the opposite side on this maturity, or on the target of a renewal or migration, and this action would have to close it first. `details.side` and `details.amount_at_maturity` describe that position. Resell the lend or repay the borrow, then retry. | | `EXCEEDS_POSITION` | 422 | account | fix_request | The size, or the collateral to withdraw, is more than the position holds (`details.amount_at_maturity` or `details.posted`). Ask for less, or leave the size out to close the whole position. | | `SIMULATION_FAILED` | 422 | simulation | refetch_state | The payload reverts in the simulation. `details.revert` has the decoded reason and `details.step` the step that failed. | | `INVARIANT_VIOLATION` | 422 | simulation | fix_request | The payload failed a safety check, so no calldata is returned. | | `RATE_LIMITED` | 429 | rate_limit | retry | Too many requests. Wait the number of seconds in `Retry-After`, then retry. | | `ROUTER_UNAVAILABLE` | 503 | upstream | retry | Tenor's quote engine is unavailable. Retry shortly. | | `ROUTER_BUSY` | 503 | upstream | retry | Tenor's quote engine is at capacity. Retry shortly. | | `RPC_UNAVAILABLE` | 503 | upstream | retry | The chain's RPC is unavailable or degraded. Retry shortly. | | `INTERNAL` | 500 | internal | retry | Something failed on Tenor's side, and the failure has been reported. Retry. | ## Warnings Warnings never block a payload. New codes are added over time: show the `message` of an unknown warning. | Code | Meaning | | --- | --- | | `SHORT_VALIDITY` | The payload is valid for only a few seconds. Sign and send the payload right away, or prepare again. | | `PARTIAL_FILL` | Reserved. Not returned yet. | | `SIBLING_FALLBACKS_PRESENT` | The route includes fallback offers, taken only if an earlier offer is gone, and never past `limit_rate`. | | `TICK_SNAPPED` | Reserved. Not returned yet. | | `HEALTH_THRESHOLD` | The payload leaves the position above 95% of its borrow capacity, and worse off than before. The warning doesn't block the payload. | | `TEST_KEY_DRY_RUN` | The request used a test key, so every prepare is a dry run and nothing in the response can be sent. | | `CURVE_POLICY_PAUSED` | Tenor has halted curve quoting. The curve is set, but it quotes nothing until quoting resumes. | | `FOREIGN_CALL` | A call goes to a contract outside Tenor's. The call was simulated, but Tenor doesn't check what it does. `details` names the address and the tokens the call sends from the wallet. | | `WALLET_KIND_MISMATCH` | The wallet's code doesn't match the declared `wallet_kind`. The payload is still built for the declared kind. `smart_account` is never flagged, since a smart account has no code until its first operation. | | `PARTIAL_REDEEM` | Only part of the lend is redeemable now. The rest becomes redeemable as borrowers repay. | | `OFFER_UNFUNDED` | The wallet holds less than its lend offers can pull, on top of what its other open offers reserve (`details.reserved`), so takers can fill only the wallet's balance when they take. | | `CANCELS_MORE` | Revoking a Merkle root also ends other offers signed under the root. `details.offer_ids` lists them. | | `MORE_TO_CANCEL` | There is more to cancel than one payload holds. Prepare again once this payload is included in a block. | | `COLLATERAL_UNFUNDED` | The wallet holds less collateral than its deposit-on-fill offers can pull, on top of what its other open offers reserve (`details.reserved`), so a fill beyond the wallet's balance fails. | | `COLLATERAL_SHORTFALL` | The collateral on a maturity (`details.maturity_id`) can't back what the borrow offers there can borrow: `details.max_debt` owed at maturity against `details.capacity`. A fill past the capacity fails. Deposit collateral first, or post with `deposit_on_fill`. | | `NOTHING_TO_REPLACE` | A group in `replace_groups` has none of the wallet's live offers in Tenor's records (`details.groups`), so replacing it ends nothing. A group posted a moment ago may not be in them yet. | | `MAX_LTV_ADJUSTED` | `max_ltv` can't apply as given on this maturity. `details` gives the LTV a fill may reach instead. | | `CURVE_UNFUNDED` | The vault that funds the curve holds none of the wallet's shares, so the curve quotes nothing until the vault is funded. | | `RENEWAL_AWAITS_LIQUIDITY` | A lend's renewal offer fills only up to the amount borrowers have repaid into the maturity it renews from. | | `IDLE_CAPITAL_SHORTFALL` | The withdrawal leaves less than the wallet's idle-capital offers can fill, so those offers fill only up to the remaining amount. | | `MARKET_DEPRECATED` | The payload adds exposure to a maturity Tenor is phasing out (`details.maturity_id`, `details.deprecated_at`). The payload still fills, but Tenor no longer lists the maturity, and its liquidity runs off. |