{"openapi":"3.1.0","info":{"title":"Tenor API","version":"1","summary":"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.","description":"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.\n\n1. **Find a market.** `GET /v1/markets` returns every market with its open maturities.\n2. **Quote.** `POST /v1/quotes` gives the rate for a size right now.\n3. **Prepare.** `POST /v1/lend/prepare`, or the prepare of any other action, returns the transactions to sign, already simulated and checked.\n4. **Sign and send** the transactions from your wallet.\n5. **Track.** `GET /v1/transactions/{tx_hash}` reports when the transaction is included in a block and what it filled.\n\nNo API key is needed. A key raises the rate limits.\n\n## Conventions\n\n| Convention | Rule | Example |\n| --- | --- | --- |\n| Amounts | Integer strings in the token's smallest unit, never rounded | `\"1000000\"` = 1 USDC |\n| Rates | Annual rate (APR) as a decimal string, in fields ending in `_rate` | `\"0.052\"` = 5.2% |\n| 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` |\n| Chains | `chain_id` on every chain-scoped request: in the query on GET, in the body on POST | `chain_id=8453` |\n| IDs | Opaque strings, unique within a chain | `maturity_id` |\n| Addresses | Accepted in any case, returned checksummed | `0x833589fCD6…` |\n| 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` |\n| Options | Opt-in flags start with `include_` | `include_onchain=true` |\n| Client IDs | A `client_id` passed on a prepare is echoed back and logged | |\n| Compatibility | Fields, enum values and error codes are only ever added. Ignore unknown fields, and handle unknown values | |\n\n## Glossary\n\n| Term | Meaning |\n| --- | --- |\n| 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 |\n| maturity | One fixed term of a market, at fixed rates, ending at `matures_at` |\n| variable rate | A market's floating rate, with no term. Lent and borrowed under `/v1/variable/*`, by `market_id` |\n| deprecated | A market or maturity that Tenor is phasing out. Tenor no longer lists it and its liquidity runs off, but it still trades |\n| best rate / mid rate | The best lend or borrow rate available now, and the midpoint between the two |\n| term structure | The best rates on every maturity of a market, side by side |\n| market depth | The open offers on a maturity, grouped by rate |\n| liquidity | The amount that can be lent or borrowed at the current rates |\n| settlement fee / continuous fee | A fee taken from each fill, and a fee that accrues on a lend until maturity |\n| principal | The amount that changes hands now |\n| amount at maturity | The amount owed, or paid back, at maturity |\n| quote | The rate for a size right now. A quote is a preview and commits to nothing |\n| offer | A firm commitment to lend or borrow at a rate, open until it fills, expires or is cancelled |\n| ladder | Several offers posted together at stepped rates or sizes |\n| staircase | Offers posted together in back-to-back time windows, so that together they hold one rate as maturity nears. Listed as one entry |\n| 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 |\n| idle capital | The capital behind a lend offer, earning the variable rate until a taker fills the offer |\n| lending vault | The contract that holds a market's variable lends, idle capital included (`onchain.lending_vault` in `GET /v1/markets`) |\n| deposit on fill | A borrow offer whose collateral stays in the wallet until the offer fills |\n| passive quoting curve | A maker's lend and exit rates by time to maturity, quoted on every maturity of a market |\n| exit rate | The rate at which a curve resells the maker's fixed lends (`resell_rate`) |\n| position | A fixed or variable lend or borrow held by a wallet |\n| LLTV / LTV | The loan-to-value at which a borrow can be liquidated, and the borrow's current loan-to-value |\n| liquidation price | The collateral price at which a borrow becomes liquidatable |\n| cost basis / P&L | The cost of opening a position, and its profit or loss since |\n\n| Action | Description |\n| --- | --- |\n| lend / borrow | Open or add to a fixed-rate position on a maturity |\n| repay | Pay back a borrow, early by taking offers or in full |\n| resell | Exit a lend before maturity by reselling it to another lender |\n| redeem | Collect a lend from what borrowers have repaid, usually at maturity |\n| take | Accept one specific offer |\n| manage | Add or withdraw collateral, or set auto-renewal, without changing the debt |\n| renew | Roll a position into a later maturity of the same market |\n| migrate | Move a variable borrow to a fixed rate |\n| post / cancel | Post offers, or cancel them |\n| clear | Stop a curve from quoting |\n\n## Authentication\n\n- Every route works without an API key, except `GET /v1/access`. Without a key, rate limits are per IP address.\n- With a key in the `X-Api-Key` header, rate limits are per key, and higher.\n- 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.\n- Keys starting with `tnr_sk_test_` are test keys. They work like live keys, but every prepare is a dry run.\n- An invalid key is rejected on every route, never ignored.\n- `GET /v1/access` checks a key. A revoked key stops working within 30 seconds.\n- Keep keys on your servers. Never ship a key to a browser or an app.\n\n## Payloads\n\nEvery `POST …/prepare` returns a payload for one wallet: the transactions to sign, a one-line `summary`, and a `preview` of their effects.\n\nDeclare 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.\n\n| `wallet_kind` | Send | Signing window |\n| --- | --- | --- |\n| `eoa` | Each of `steps` in order, waiting for each receipt; or `requires`, then `transaction` | 5 min |\n| `delegated_eoa` (EIP-7702) | `calls` in one `wallet_sendCalls`, or as an `eoa` | 5 min |\n| `safe` | `safe_tx` as one Safe transaction (MultiSendCallOnly, delegate call) | 30 min |\n| `smart_account` | `calls` in one user operation | 30 min |\n\n- **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.\n- **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.\n- **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.\n- **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.\n- **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`.\n- **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.\n- **Sanctions.** Wallets on the OFAC sanctions list get `403 WALLET_BLOCKED`. The key that prepares doesn't matter.\n- **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.\n\n## Responses\n\n- A success is `{ \"data\": …, \"meta\": { \"request_id\", \"generated_at\", … } }`.\n- An error is `{ \"error\": { \"code\", \"category\", \"treatment\", \"message\", \"details\", \"request_id\" } }`.\n- Branch on `code`. For an unknown code, act on `treatment`: `fix_request`, `refetch_state`, `fund_account` or `retry`.\n- A payload can carry `warnings`, which never block it. Show the `message` of an unknown warning.\n- 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.\n\n## Rate limits\n\nEach 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.\n\n| Budget | Routes | With a key | Without |\n| --- | --- | --- | --- |\n| `read` | Reads | 1200 / 60 s | 25 / 1 s, 150 / 10 s, 1000 / 60 s |\n| `compute` | Quotes and takeable offers | 120 / 60 s | 30 / 60 s |\n| `prepare` | Prepares, simulations and readiness | 120 / 60 s | 15 / 60 s |\n| `cancel` | Cancels and curve clears | 600 / 60 s | 30 / 60 s |\n\n- Treat limits as approximate: each server counts on its own, and requests are spread across servers.\n- Every response carries `X-RateLimit-Policy`, `X-RateLimit-Limit`, `X-RateLimit-Remaining` and `X-RateLimit-Reset`.\n- Past a limit, requests get `429 RATE_LIMITED`, with `Retry-After` in seconds. Wait that long before retrying.\n- After 30 failed key checks in a minute, an IP address gets `429` on every request that sends a key.\n\n## Caching\n\n- 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.\n- Quotes, payloads and anything about one wallet are `no-store`. Don't cache them.\n- A transaction is `no-store` until it is final and indexed. After that, it may be cached for a minute.\n- `meta.generated_at` is when the data was read, which can be up to `max-age` ago.\n\n## Live data\n\nMarket 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.\n"},"servers":[{"url":"https://tenor-api.tenor.finance","description":"Production"},{"url":"https://tenor-api-staging.tenor.finance","description":"Staging"}],"tags":[{"name":"Catalog","description":"Chains, tokens, markets and maturities served by the API. The catalog carries no rates: rates come from quotes and market depth.\n\n- `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.\n- `GET /v1/markets` returns each market with its open maturities, so one call is enough to start.\n- `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.\n- **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.\n- 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.\n- 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."},{"name":"Market depth","description":"The open offers on each maturity, before fees. Every caller sees the same depth, refreshed once a block.\n\n- `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.\n- `GET /v1/maturities/{maturity_id}/takeable-offers` lists the offers that can be taken right now, with live amounts, for `POST /v1/take/prepare`.\n- `GET /v1/markets/{market_id}/term-structure` lines up the best rates of every open maturity next to the market's variable rates.\n- A maturity with withdrawable liquidity carries a 0% lend offer (`syn:withdrawable:<maturity_id>`, `kind: withdrawable`). It is real liquidity, so it can make the depth look crossed: `best_borrow_rate` is `0` and `spread` negative."},{"name":"Quotes","description":"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.\n\n- `POST /v1/quotes` quotes one maturity. `POST /v1/quotes/term-structure` quotes the same size on every maturity of a market.\n- Size a quote by `principal` (the amount that changes hands now) or by `amount_at_maturity`. The quote returns both.\n- Pass the `wallet_kind` that will sign, so the quote fills like its prepare.\n- 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."},{"name":"Fixed rate","description":"Lend, borrow and exit on a maturity at a fixed rate.\n\n**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`.\n\n**One side per maturity.** A wallet can't lend and borrow on the same maturity (`422 OPPOSITE_POSITION`). Resell or repay first.\n\n**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.\n- **Repay** pays a borrow back early by taking offers, or in full with `direct: true`. After maturity, every repay is direct.\n- **Resell** exits a lend before maturity. **Redeem** collects it from what borrowers have repaid, usually after maturity.\n\n**Take** accepts one offer by `offer_id`, with no fallback. `quote.action` says whether the take lends or borrows.\n\n**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`).\n\n**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.\n\n**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."},{"name":"Variable rate","description":"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`.\n\n- **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.\n- **Borrow**, **repay** and **manage** work like their fixed counterparts, against the market's `variable.collateral_token`.\n- A withdrawal that leaves the wallet's idle-capital offers or curves short gets an `IDLE_CAPITAL_SHORTFALL` or `CURVE_UNFUNDED` warning.\n- `preview.variable_lend` and `preview.variable_borrow` show the position before and after the payload."},{"name":"Transactions","description":"Simulate calls right before the wallet sends them, and track transactions after they are sent.\n\n**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`.\n\n**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)."},{"name":"Accounts","description":"Positions, fills and balances of a wallet on one chain.\n\n- **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.\n- **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.\n- **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."},{"name":"Offers","description":"Post firm offers, read them back with their live status, keep them fillable, and cancel them.\n\n**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.\n- 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.\n- 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.\n- 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.\n- 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`.\n\n**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.\n\n**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.\n\n**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.\n\n**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.\n\n**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."},{"name":"Passive quoting","description":"A passive quoting curve is one set of rates that quotes every maturity of a market, with no transaction per quote.\n\n- 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.\n- 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.\n- `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`).\n- One vault can back curves on every market with the same loan token, so one deposit funds them all.\n- 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`.\n- Every set is written, even one identical to the stored curve.\n- 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.\n- `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."},{"name":"Access","description":"Check an API key: the organization it belongs to, its scopes and its rate limits. Authentication, in the introduction, explains keys."},{"name":"Service","description":"Liveness, health checks and the API contract."}],"x-tagGroups":[{"name":"Market data","tags":["Catalog","Market depth","Quotes"]},{"name":"Lend & borrow","tags":["Fixed rate","Variable rate","Transactions","Accounts"]},{"name":"Offers & quoting","tags":["Offers","Passive quoting"]},{"name":"Platform","tags":["Access","Service"]}],"paths":{"/health":{"get":{"operationId":"getHealth","summary":"Check dependencies","description":"Reports the status of each dependency. `degraded` means some features may fail. The endpoint returns a 503 only when the database is down.","tags":["Service"],"security":[{},{"ApiKey":[]}],"responses":{"200":{"description":"Check dependencies.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Policy":{"$ref":"#/components/headers/X-RateLimit-Policy"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Health"}}}},"401":{"description":"`UNAUTHENTICATED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"UNAUTHENTICATED":{"summary":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","value":{"error":{"code":"UNAUTHENTICATED","category":"auth","treatment":"fix_request","message":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"429":{"description":"`RATE_LIMITED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"RATE_LIMITED":{"summary":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","value":{"error":{"code":"RATE_LIMITED","category":"rate_limit","treatment":"retry","message":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"500":{"description":"`INTERNAL`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INTERNAL":{"summary":"Something failed on Tenor's side, and the failure has been reported. Retry.","value":{"error":{"code":"INTERNAL","category":"internal","treatment":"retry","message":"Something failed on Tenor's side, and the failure has been reported. Retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"503":{"description":"The database is down","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Policy":{"$ref":"#/components/headers/X-RateLimit-Policy"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Health"}}}}},"x-rate-limit-class":"read"}},"/live":{"get":{"operationId":"getLive","summary":"Check liveness","description":"Answers as long as the process serves requests. Checks nothing else.","tags":["Service"],"security":[{},{"ApiKey":[]}],"responses":{"200":{"description":"Check liveness.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Live"}}}},"401":{"description":"`UNAUTHENTICATED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"UNAUTHENTICATED":{"summary":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","value":{"error":{"code":"UNAUTHENTICATED","category":"auth","treatment":"fix_request","message":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"500":{"description":"`INTERNAL`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INTERNAL":{"summary":"Something failed on Tenor's side, and the failure has been reported. Retry.","value":{"error":{"code":"INTERNAL","category":"internal","treatment":"retry","message":"Something failed on Tenor's side, and the failure has been reported. Retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}}}}},"/v1/access":{"get":{"operationId":"getAccess","summary":"Check an API key","description":"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.\n\nNeeds an API key.","tags":["Access"],"security":[{"ApiKey":[]}],"responses":{"200":{"description":"Check an API key.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Policy":{"$ref":"#/components/headers/X-RateLimit-Policy"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Access"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}},"required":["data","meta"]}}}},"401":{"description":"`UNAUTHENTICATED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"UNAUTHENTICATED":{"summary":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","value":{"error":{"code":"UNAUTHENTICATED","category":"auth","treatment":"fix_request","message":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"429":{"description":"`RATE_LIMITED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"RATE_LIMITED":{"summary":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","value":{"error":{"code":"RATE_LIMITED","category":"rate_limit","treatment":"retry","message":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"500":{"description":"`INTERNAL`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INTERNAL":{"summary":"Something failed on Tenor's side, and the failure has been reported. Retry.","value":{"error":{"code":"INTERNAL","category":"internal","treatment":"retry","message":"Something failed on Tenor's side, and the failure has been reported. Retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}}},"x-rate-limit-class":"read"}},"/v1/accounts/{wallet}/balances":{"get":{"operationId":"listBalances","summary":"List a wallet's token balances","description":"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.","tags":["Accounts"],"security":[{},{"ApiKey":[]}],"parameters":[{"name":"wallet","in":"path","required":true,"description":"The wallet (case-insensitive).","schema":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$"},"example":"0x7A1f00000000000000000000000000000000C0de"},{"name":"chain_id","in":"query","required":true,"description":"The EVM chain ID. `GET /v1/chains` lists the chains served.","schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"example":8453}],"responses":{"200":{"description":"List a wallet's token balances.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Policy":{"$ref":"#/components/headers/X-RateLimit-Policy"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Balance"},"description":"The wallet's non-zero balances of the served markets' tokens, `listed` and `otc`, and of any token its offers reserve, sorted by symbol."},"meta":{"$ref":"#/components/schemas/ResponseMeta"}},"required":["data","meta"]}}}},"400":{"description":"`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INVALID_PARAMS":{"summary":"A parameter or the body failed validation. `details.issues` lists each problem.","value":{"error":{"code":"INVALID_PARAMS","category":"validation","treatment":"fix_request","message":"A parameter or the body failed validation. `details.issues` lists each problem.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"UNSUPPORTED_CHAIN":{"summary":"`chain_id` is unknown or not enabled on this API.","value":{"error":{"code":"UNSUPPORTED_CHAIN","category":"validation","treatment":"fix_request","message":"`chain_id` is unknown or not enabled on this API.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"401":{"description":"`UNAUTHENTICATED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"UNAUTHENTICATED":{"summary":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","value":{"error":{"code":"UNAUTHENTICATED","category":"auth","treatment":"fix_request","message":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"429":{"description":"`RATE_LIMITED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"RATE_LIMITED":{"summary":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","value":{"error":{"code":"RATE_LIMITED","category":"rate_limit","treatment":"retry","message":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"500":{"description":"`INTERNAL`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INTERNAL":{"summary":"Something failed on Tenor's side, and the failure has been reported. Retry.","value":{"error":{"code":"INTERNAL","category":"internal","treatment":"retry","message":"Something failed on Tenor's side, and the failure has been reported. Retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"503":{"description":"`RPC_UNAVAILABLE`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"RPC_UNAVAILABLE":{"summary":"The chain's RPC is unavailable or degraded. Retry shortly.","value":{"error":{"code":"RPC_UNAVAILABLE","category":"upstream","treatment":"retry","message":"The chain's RPC is unavailable or degraded. Retry shortly.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}}},"x-rate-limit-class":"read"}},"/v1/accounts/{wallet}/fills":{"get":{"operationId":"listFills","summary":"List a wallet's fills","description":"Lists every fill the wallet took part in on one chain, as maker or taker. Sorted oldest first, in block order. Page with `cursor`.\n\nTo read new fills, poll with `from_block` a few blocks before the last fill already seen, and drop the `fill_id`s already held.","tags":["Accounts"],"security":[{},{"ApiKey":[]}],"parameters":[{"name":"wallet","in":"path","required":true,"description":"The wallet (case-insensitive).","schema":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$"},"example":"0x7A1f00000000000000000000000000000000C0de"},{"name":"chain_id","in":"query","required":true,"description":"The EVM chain ID. `GET /v1/chains` lists the chains served.","schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"example":8453},{"name":"maturity_id","in":"query","required":false,"description":"Only fills on this maturity.","schema":{"type":"string","pattern":"^0x[0-9a-fA-F]{64}$"},"example":"0x9c1e7f4a0b2d3e5f6a7b8c9d0e1f2a3b4c5d6e7f8091a2b3c4d5e6f708192a3b"},{"name":"side","in":"query","required":false,"description":"Only fills where the wallet lent, or only fills where it borrowed.","schema":{"type":"string","enum":["lend","borrow"]}},{"name":"from_block","in":"query","required":false,"description":"Start at this block, inclusive, instead of the beginning. To read fills recorded late, poll from a few blocks before the last fill already seen, and drop the `fill_id`s already held. Can't be combined with `cursor`.","schema":{"type":"integer","minimum":0,"maximum":9007199254740991},"example":52872600},{"name":"cursor","in":"query","required":false,"description":"The previous page's `meta.next_cursor`, to get the next page. Leave `cursor` out for the first page.","schema":{"type":"string","minLength":1,"maxLength":512},"example":"eyJtIjoxNzk1MTkwNDAwLCJrIjoiMHg5YyJ9"},{"name":"limit","in":"query","required":false,"description":"The most items per page, up to 200.","schema":{"default":50,"type":"integer","minimum":1,"maximum":200},"example":50}],"responses":{"200":{"description":"List a wallet's fills.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Policy":{"$ref":"#/components/headers/X-RateLimit-Policy"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Fill"}},"meta":{"$ref":"#/components/schemas/ResponseMeta"}},"required":["data","meta"]}}}},"400":{"description":"`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INVALID_PARAMS":{"summary":"A parameter or the body failed validation. `details.issues` lists each problem.","value":{"error":{"code":"INVALID_PARAMS","category":"validation","treatment":"fix_request","message":"A parameter or the body failed validation. `details.issues` lists each problem.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"UNSUPPORTED_CHAIN":{"summary":"`chain_id` is unknown or not enabled on this API.","value":{"error":{"code":"UNSUPPORTED_CHAIN","category":"validation","treatment":"fix_request","message":"`chain_id` is unknown or not enabled on this API.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"401":{"description":"`UNAUTHENTICATED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"UNAUTHENTICATED":{"summary":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","value":{"error":{"code":"UNAUTHENTICATED","category":"auth","treatment":"fix_request","message":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"429":{"description":"`RATE_LIMITED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"RATE_LIMITED":{"summary":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","value":{"error":{"code":"RATE_LIMITED","category":"rate_limit","treatment":"retry","message":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"500":{"description":"`INTERNAL`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INTERNAL":{"summary":"Something failed on Tenor's side, and the failure has been reported. Retry.","value":{"error":{"code":"INTERNAL","category":"internal","treatment":"retry","message":"Something failed on Tenor's side, and the failure has been reported. Retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}}},"x-rate-limit-class":"read"}},"/v1/accounts/{wallet}/positions":{"get":{"operationId":"listPositions","summary":"List a wallet's positions","description":"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.\n\nAmounts, 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.","tags":["Accounts"],"security":[{},{"ApiKey":[]}],"parameters":[{"name":"wallet","in":"path","required":true,"description":"The wallet (case-insensitive).","schema":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$"},"example":"0x7A1f00000000000000000000000000000000C0de"},{"name":"chain_id","in":"query","required":true,"description":"The EVM chain ID. `GET /v1/chains` lists the chains served.","schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"example":8453},{"name":"rate_type","in":"query","required":false,"description":"Only fixed positions (on a maturity), or only variable positions.","schema":{"type":"string","enum":["fixed","variable"]}},{"name":"side","in":"query","required":false,"description":"Only lend positions, or only borrow positions.","schema":{"type":"string","enum":["lend","borrow"]}},{"name":"status","in":"query","required":false,"description":"Only positions in this status. Left out, the list holds the positions still open: `open`, `matured`, `redeemable` and `repaid`.","schema":{"type":"string","enum":["open","matured","redeemable","repaid","closed","liquidated"]}},{"name":"include_closed","in":"query","required":false,"description":"Also list `closed` and `liquidated` positions when no `status` is given.","schema":{"default":"false","type":"string","enum":["true","false"]}},{"name":"market_id","in":"query","required":false,"description":"Only positions in this market. A variable position matches any market its variable rate serves.","schema":{"type":"string","pattern":"^0x[0-9a-fA-F]{64}$"},"example":"0x3f81019286c6aa6265e5823a23c4f08e0f41c953236bad782c7739eb9ee6db11"},{"name":"structure","in":"query","required":false,"description":"Only positions in markets of this structure. A variable position matches when any market its variable rate serves does.","schema":{"type":"string","enum":["plain","loan_token","yield"]}},{"name":"maturity_id","in":"query","required":false,"description":"Only the position on this maturity.","schema":{"type":"string","pattern":"^0x[0-9a-fA-F]{64}$"},"example":"0x9c1e7f4a0b2d3e5f6a7b8c9d0e1f2a3b4c5d6e7f8091a2b3c4d5e6f708192a3b"},{"name":"cursor","in":"query","required":false,"description":"The previous page's `meta.next_cursor`, to get the next page. Leave `cursor` out for the first page.","schema":{"type":"string","minLength":1,"maxLength":512},"example":"eyJtIjoxNzk1MTkwNDAwLCJrIjoiMHg5YyJ9"},{"name":"limit","in":"query","required":false,"description":"The most items per page, up to 200.","schema":{"default":50,"type":"integer","minimum":1,"maximum":200},"example":50}],"responses":{"200":{"description":"List a wallet's positions.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Policy":{"$ref":"#/components/headers/X-RateLimit-Policy"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Position"}},"meta":{"$ref":"#/components/schemas/ResponseMeta"}},"required":["data","meta"]}}}},"400":{"description":"`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INVALID_PARAMS":{"summary":"A parameter or the body failed validation. `details.issues` lists each problem.","value":{"error":{"code":"INVALID_PARAMS","category":"validation","treatment":"fix_request","message":"A parameter or the body failed validation. `details.issues` lists each problem.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"UNSUPPORTED_CHAIN":{"summary":"`chain_id` is unknown or not enabled on this API.","value":{"error":{"code":"UNSUPPORTED_CHAIN","category":"validation","treatment":"fix_request","message":"`chain_id` is unknown or not enabled on this API.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"401":{"description":"`UNAUTHENTICATED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"UNAUTHENTICATED":{"summary":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","value":{"error":{"code":"UNAUTHENTICATED","category":"auth","treatment":"fix_request","message":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"429":{"description":"`RATE_LIMITED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"RATE_LIMITED":{"summary":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","value":{"error":{"code":"RATE_LIMITED","category":"rate_limit","treatment":"retry","message":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"500":{"description":"`INTERNAL`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INTERNAL":{"summary":"Something failed on Tenor's side, and the failure has been reported. Retry.","value":{"error":{"code":"INTERNAL","category":"internal","treatment":"retry","message":"Something failed on Tenor's side, and the failure has been reported. Retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"503":{"description":"`RPC_UNAVAILABLE`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"RPC_UNAVAILABLE":{"summary":"The chain's RPC is unavailable or degraded. Retry shortly.","value":{"error":{"code":"RPC_UNAVAILABLE","category":"upstream","treatment":"retry","message":"The chain's RPC is unavailable or degraded. Retry shortly.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}}},"x-rate-limit-class":"read"}},"/v1/accounts/{wallet}/positions/{position_id}":{"get":{"operationId":"getPosition","summary":"Get a position","description":"Reads one of the wallet's positions by `position_id`, closed positions included.","tags":["Accounts"],"security":[{},{"ApiKey":[]}],"parameters":[{"name":"wallet","in":"path","required":true,"description":"The wallet (case-insensitive).","schema":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$"},"example":"0x7A1f00000000000000000000000000000000C0de"},{"name":"position_id","in":"path","required":true,"description":"A `position_id` from `GET /v1/accounts/{wallet}/positions`, with or without a `0x` prefix.","schema":{"type":"string","pattern":"^(0x)?[0-9a-fA-F]{64}$"},"example":"6b5e6644b322a1f0c2e19a4d07c6f3e1b9d84a2e5c7f0b3d6a9e2c4f8b1d7a05"},{"name":"chain_id","in":"query","required":true,"description":"The EVM chain ID. `GET /v1/chains` lists the chains served.","schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"example":8453}],"responses":{"200":{"description":"Get a position.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Policy":{"$ref":"#/components/headers/X-RateLimit-Policy"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Position"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}},"required":["data","meta"]}}}},"400":{"description":"`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INVALID_PARAMS":{"summary":"A parameter or the body failed validation. `details.issues` lists each problem.","value":{"error":{"code":"INVALID_PARAMS","category":"validation","treatment":"fix_request","message":"A parameter or the body failed validation. `details.issues` lists each problem.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"UNSUPPORTED_CHAIN":{"summary":"`chain_id` is unknown or not enabled on this API.","value":{"error":{"code":"UNSUPPORTED_CHAIN","category":"validation","treatment":"fix_request","message":"`chain_id` is unknown or not enabled on this API.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"401":{"description":"`UNAUTHENTICATED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"UNAUTHENTICATED":{"summary":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","value":{"error":{"code":"UNAUTHENTICATED","category":"auth","treatment":"fix_request","message":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"404":{"description":"`POSITION_NOT_FOUND`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"POSITION_NOT_FOUND":{"summary":"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`).","value":{"error":{"code":"POSITION_NOT_FOUND","category":"not_found","treatment":"fix_request","message":"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`).","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"429":{"description":"`RATE_LIMITED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"RATE_LIMITED":{"summary":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","value":{"error":{"code":"RATE_LIMITED","category":"rate_limit","treatment":"retry","message":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"500":{"description":"`INTERNAL`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INTERNAL":{"summary":"Something failed on Tenor's side, and the failure has been reported. Retry.","value":{"error":{"code":"INTERNAL","category":"internal","treatment":"retry","message":"Something failed on Tenor's side, and the failure has been reported. Retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"503":{"description":"`RPC_UNAVAILABLE`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"RPC_UNAVAILABLE":{"summary":"The chain's RPC is unavailable or degraded. Retry shortly.","value":{"error":{"code":"RPC_UNAVAILABLE","category":"upstream","treatment":"retry","message":"The chain's RPC is unavailable or degraded. Retry shortly.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}}},"x-rate-limit-class":"read"}},"/v1/accounts/{wallet}/readiness":{"get":{"operationId":"getReadiness","summary":"Check a wallet's readiness","description":"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.\n\nGaps 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.\n\nNo API key needed. A key sent must carry the `read` scope.","tags":["Offers"],"security":[{},{"ApiKey":[]}],"parameters":[{"name":"wallet","in":"path","required":true,"description":"The wallet (case-insensitive).","schema":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$"},"example":"0x7A1f00000000000000000000000000000000C0de"},{"name":"chain_id","in":"query","required":true,"description":"The EVM chain ID. `GET /v1/chains` lists the chains served.","schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"example":8453},{"name":"wallet_kind","in":"query","required":true,"description":"How the wallet signs, which sets the shape of the transactions in `missing`. A value that doesn't match the wallet's code gets a `WALLET_KIND_MISMATCH` warning.","schema":{"type":"string","enum":["eoa","delegated_eoa","safe","smart_account"]}}],"responses":{"200":{"description":"Check a wallet's readiness.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Policy":{"$ref":"#/components/headers/X-RateLimit-Policy"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Readiness"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}},"required":["data","meta"]}}}},"400":{"description":"`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INVALID_PARAMS":{"summary":"A parameter or the body failed validation. `details.issues` lists each problem.","value":{"error":{"code":"INVALID_PARAMS","category":"validation","treatment":"fix_request","message":"A parameter or the body failed validation. `details.issues` lists each problem.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"UNSUPPORTED_CHAIN":{"summary":"`chain_id` is unknown or not enabled on this API.","value":{"error":{"code":"UNSUPPORTED_CHAIN","category":"validation","treatment":"fix_request","message":"`chain_id` is unknown or not enabled on this API.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"401":{"description":"`UNAUTHENTICATED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"UNAUTHENTICATED":{"summary":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","value":{"error":{"code":"UNAUTHENTICATED","category":"auth","treatment":"fix_request","message":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"403":{"description":"`FORBIDDEN_SCOPE`, `WALLET_BLOCKED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"FORBIDDEN_SCOPE":{"summary":"The API key lacks a scope this route needs.","value":{"error":{"code":"FORBIDDEN_SCOPE","category":"auth","treatment":"fix_request","message":"The API key lacks a scope this route needs.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"WALLET_BLOCKED":{"summary":"The wallet is on a sanctions list that Tenor screens against, so no payload is prepared for it.","value":{"error":{"code":"WALLET_BLOCKED","category":"auth","treatment":"fix_request","message":"The wallet is on a sanctions list that Tenor screens against, so no payload is prepared for it.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"422":{"description":"`SIMULATION_FAILED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"SIMULATION_FAILED":{"summary":"The payload reverts in the simulation. `details.revert` has the decoded reason and `details.step` the step that failed.","value":{"error":{"code":"SIMULATION_FAILED","category":"simulation","treatment":"refetch_state","message":"The payload reverts in the simulation. `details.revert` has the decoded reason and `details.step` the step that failed.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"429":{"description":"`RATE_LIMITED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"RATE_LIMITED":{"summary":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","value":{"error":{"code":"RATE_LIMITED","category":"rate_limit","treatment":"retry","message":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"500":{"description":"`INTERNAL`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INTERNAL":{"summary":"Something failed on Tenor's side, and the failure has been reported. Retry.","value":{"error":{"code":"INTERNAL","category":"internal","treatment":"retry","message":"Something failed on Tenor's side, and the failure has been reported. Retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"503":{"description":"`RPC_UNAVAILABLE`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"RPC_UNAVAILABLE":{"summary":"The chain's RPC is unavailable or degraded. Retry shortly.","value":{"error":{"code":"RPC_UNAVAILABLE","category":"upstream","treatment":"retry","message":"The chain's RPC is unavailable or degraded. Retry shortly.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}}},"x-rate-limit-class":"prepare"}},"/v1/borrow/prepare":{"post":{"operationId":"prepareBorrow","summary":"Prepare a borrow","description":"Borrows at a fixed rate on one maturity. `deposit_collateral` deposits collateral in the same payload, and `renewal` sets the market's auto-renewal.\n\nNo API key needed. A key sent must carry the `trade` scope.","tags":["Fixed rate"],"security":[{},{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BorrowPrepareRequest"}}}},"responses":{"200":{"description":"Prepare a borrow.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Policy":{"$ref":"#/components/headers/X-RateLimit-Policy"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Prepared"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}},"required":["data","meta"]}}}},"400":{"description":"`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `MARKET_MISMATCH`, `RATE_ABOVE_MAX`, `INVALID_BOUNDS`, `DEADLINE_INVALID`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INVALID_PARAMS":{"summary":"A parameter or the body failed validation. `details.issues` lists each problem.","value":{"error":{"code":"INVALID_PARAMS","category":"validation","treatment":"fix_request","message":"A parameter or the body failed validation. `details.issues` lists each problem.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"UNSUPPORTED_CHAIN":{"summary":"`chain_id` is unknown or not enabled on this API.","value":{"error":{"code":"UNSUPPORTED_CHAIN","category":"validation","treatment":"fix_request","message":"`chain_id` is unknown or not enabled on this API.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"MARKET_MISMATCH":{"summary":"The maturity doesn't belong to the given market.","value":{"error":{"code":"MARKET_MISMATCH","category":"validation","treatment":"fix_request","message":"The maturity doesn't belong to the given market.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"RATE_ABOVE_MAX":{"summary":"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`.","value":{"error":{"code":"RATE_ABOVE_MAX","category":"validation","treatment":"fix_request","message":"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`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"INVALID_BOUNDS":{"summary":"The limit rate and the size bounds contradict each other.","value":{"error":{"code":"INVALID_BOUNDS","category":"validation","treatment":"fix_request","message":"The limit rate and the size bounds contradict each other.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"DEADLINE_INVALID":{"summary":"The deadline is in the past, too soon, or beyond the wallet type's signing window.","value":{"error":{"code":"DEADLINE_INVALID","category":"validation","treatment":"fix_request","message":"The deadline is in the past, too soon, or beyond the wallet type's signing window.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"401":{"description":"`UNAUTHENTICATED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"UNAUTHENTICATED":{"summary":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","value":{"error":{"code":"UNAUTHENTICATED","category":"auth","treatment":"fix_request","message":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"403":{"description":"`FORBIDDEN_SCOPE`, `WALLET_BLOCKED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"FORBIDDEN_SCOPE":{"summary":"The API key lacks a scope this route needs.","value":{"error":{"code":"FORBIDDEN_SCOPE","category":"auth","treatment":"fix_request","message":"The API key lacks a scope this route needs.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"WALLET_BLOCKED":{"summary":"The wallet is on a sanctions list that Tenor screens against, so no payload is prepared for it.","value":{"error":{"code":"WALLET_BLOCKED","category":"auth","treatment":"fix_request","message":"The wallet is on a sanctions list that Tenor screens against, so no payload is prepared for it.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"404":{"description":"`MATURITY_NOT_FOUND`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"MATURITY_NOT_FOUND":{"summary":"No maturity with this ID on this chain.","value":{"error":{"code":"MATURITY_NOT_FOUND","category":"not_found","treatment":"fix_request","message":"No maturity with this ID on this chain.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"413":{"description":"`PAYLOAD_TOO_LARGE`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"PAYLOAD_TOO_LARGE":{"summary":"The request body is larger than 64 KiB.","value":{"error":{"code":"PAYLOAD_TOO_LARGE","category":"validation","treatment":"fix_request","message":"The request body is larger than 64 KiB.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"422":{"description":"`COUNTERPARTY_BLOCKED`, `MARKET_NOT_SUPPORTED`, `MATURITY_MATURED`, `DRY_RUN_UNAVAILABLE`, `NO_OFFERS`, `NO_VALID_OFFERS`, `INSUFFICIENT_LIQUIDITY`, `LIMIT_RATE_NOT_MET`, `INSUFFICIENT_BALANCE`, `SIMULATION_FAILED`, `SLIPPAGE_EXCEEDED`, `SELF_CROSS`, `OPPOSITE_POSITION`, `INVARIANT_VIOLATION`, `INSUFFICIENT_COLLATERAL`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"COUNTERPARTY_BLOCKED":{"summary":"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.","value":{"error":{"code":"COUNTERPARTY_BLOCKED","category":"state","treatment":"fix_request","message":"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_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"MARKET_NOT_SUPPORTED":{"summary":"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.","value":{"error":{"code":"MARKET_NOT_SUPPORTED","category":"state","treatment":"fix_request","message":"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.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"MATURITY_MATURED":{"summary":"The maturity is past `matures_at` and accepts no new lends or borrows. Lenders redeem, and borrowers repay.","value":{"error":{"code":"MATURITY_MATURED","category":"state","treatment":"fix_request","message":"The maturity is past `matures_at` and accepts no new lends or borrows. Lenders redeem, and borrowers repay.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"DRY_RUN_UNAVAILABLE":{"summary":"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`.","value":{"error":{"code":"DRY_RUN_UNAVAILABLE","category":"state","treatment":"fix_request","message":"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`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"NO_OFFERS":{"summary":"There are no open offers on that side.","value":{"error":{"code":"NO_OFFERS","category":"liquidity","treatment":"refetch_state","message":"There are no open offers on that side.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"NO_VALID_OFFERS":{"summary":"No offer on that side can be filled right now.","value":{"error":{"code":"NO_VALID_OFFERS","category":"liquidity","treatment":"refetch_state","message":"No offer on that side can be filled right now.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"INSUFFICIENT_LIQUIDITY":{"summary":"There isn't enough liquidity to fill the full size.","value":{"error":{"code":"INSUFFICIENT_LIQUIDITY","category":"liquidity","treatment":"refetch_state","message":"There isn't enough liquidity to fill the full size.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"LIMIT_RATE_NOT_MET":{"summary":"No fill is possible within the limit rate.","value":{"error":{"code":"LIMIT_RATE_NOT_MET","category":"liquidity","treatment":"refetch_state","message":"No fill is possible within the limit rate.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"INSUFFICIENT_BALANCE":{"summary":"The wallet doesn't hold the tokens this action needs.","value":{"error":{"code":"INSUFFICIENT_BALANCE","category":"account","treatment":"fund_account","message":"The wallet doesn't hold the tokens this action needs.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"SIMULATION_FAILED":{"summary":"The payload reverts in the simulation. `details.revert` has the decoded reason and `details.step` the step that failed.","value":{"error":{"code":"SIMULATION_FAILED","category":"simulation","treatment":"refetch_state","message":"The payload reverts in the simulation. `details.revert` has the decoded reason and `details.step` the step that failed.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"SLIPPAGE_EXCEEDED":{"summary":"The fill would fall outside the request's limit rate or size bounds.","value":{"error":{"code":"SLIPPAGE_EXCEEDED","category":"liquidity","treatment":"refetch_state","message":"The fill would fall outside the request's limit rate or size bounds.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"SELF_CROSS":{"summary":"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.","value":{"error":{"code":"SELF_CROSS","category":"account","treatment":"fix_request","message":"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.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"OPPOSITE_POSITION":{"summary":"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.","value":{"error":{"code":"OPPOSITE_POSITION","category":"account","treatment":"fix_request","message":"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.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"INVARIANT_VIOLATION":{"summary":"The payload failed a safety check, so no calldata is returned.","value":{"error":{"code":"INVARIANT_VIOLATION","category":"simulation","treatment":"fix_request","message":"The payload failed a safety check, so no calldata is returned.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"INSUFFICIENT_COLLATERAL":{"summary":"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.","value":{"error":{"code":"INSUFFICIENT_COLLATERAL","category":"account","treatment":"fund_account","message":"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.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"429":{"description":"`RATE_LIMITED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"RATE_LIMITED":{"summary":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","value":{"error":{"code":"RATE_LIMITED","category":"rate_limit","treatment":"retry","message":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"500":{"description":"`INTERNAL`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INTERNAL":{"summary":"Something failed on Tenor's side, and the failure has been reported. Retry.","value":{"error":{"code":"INTERNAL","category":"internal","treatment":"retry","message":"Something failed on Tenor's side, and the failure has been reported. Retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"503":{"description":"`ROUTER_UNAVAILABLE`, `ROUTER_BUSY`, `RPC_UNAVAILABLE`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"ROUTER_UNAVAILABLE":{"summary":"Tenor's quote engine is unavailable. Retry shortly.","value":{"error":{"code":"ROUTER_UNAVAILABLE","category":"upstream","treatment":"retry","message":"Tenor's quote engine is unavailable. Retry shortly.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"ROUTER_BUSY":{"summary":"Tenor's quote engine is at capacity. Retry shortly.","value":{"error":{"code":"ROUTER_BUSY","category":"upstream","treatment":"retry","message":"Tenor's quote engine is at capacity. Retry shortly.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"RPC_UNAVAILABLE":{"summary":"The chain's RPC is unavailable or degraded. Retry shortly.","value":{"error":{"code":"RPC_UNAVAILABLE","category":"upstream","treatment":"retry","message":"The chain's RPC is unavailable or degraded. Retry shortly.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}}},"x-rate-limit-class":"prepare"}},"/v1/chains":{"get":{"operationId":"listChains","summary":"List chains","description":"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`.","tags":["Catalog"],"security":[{},{"ApiKey":[]}],"responses":{"200":{"description":"List chains.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Policy":{"$ref":"#/components/headers/X-RateLimit-Policy"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"Cache-Control":{"description":"How long the response may be reused.","schema":{"type":"string","examples":["public, max-age=10, stale-while-revalidate=10"]}},"ETag":{"description":"The response's tag. Send it in `If-None-Match` to get a 304 while the body hasn't changed.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Chain"}},"meta":{"$ref":"#/components/schemas/ResponseMeta"}},"required":["data","meta"]}}}},"304":{"description":"Not modified. The `ETag` sent in `If-None-Match` still matches, so the cached copy is current.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"401":{"description":"`UNAUTHENTICATED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"UNAUTHENTICATED":{"summary":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","value":{"error":{"code":"UNAUTHENTICATED","category":"auth","treatment":"fix_request","message":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"429":{"description":"`RATE_LIMITED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"RATE_LIMITED":{"summary":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","value":{"error":{"code":"RATE_LIMITED","category":"rate_limit","treatment":"retry","message":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"500":{"description":"`INTERNAL`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INTERNAL":{"summary":"Something failed on Tenor's side, and the failure has been reported. Retry.","value":{"error":{"code":"INTERNAL","category":"internal","treatment":"retry","message":"Something failed on Tenor's side, and the failure has been reported. Retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}}},"x-rate-limit-class":"read"}},"/v1/curves":{"get":{"operationId":"listCurves","summary":"List a maker's curves","description":"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.","tags":["Passive quoting"],"security":[{},{"ApiKey":[]}],"parameters":[{"name":"chain_id","in":"query","required":true,"description":"The EVM chain ID. `GET /v1/chains` lists the chains served.","schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"example":8453},{"name":"maker","in":"query","required":true,"description":"The wallet whose curves to list (case-insensitive).","schema":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$"},"example":"0x7A1f00000000000000000000000000000000C0de"},{"name":"market_id","in":"query","required":false,"description":"Only the curve on this market.","schema":{"type":"string","pattern":"^0x[0-9a-fA-F]{64}$"},"example":"0x3f81019286c6aa6265e5823a23c4f08e0f41c953236bad782c7739eb9ee6db11"},{"name":"include_cleared","in":"query","required":false,"description":"Also list cleared curves, with the points they last held.","schema":{"default":"false","type":"string","enum":["true","false"]}}],"responses":{"200":{"description":"List a maker's curves.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Policy":{"$ref":"#/components/headers/X-RateLimit-Policy"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Curve"},"description":"One curve per market, ordered by market."},"meta":{"$ref":"#/components/schemas/ResponseMeta"}},"required":["data","meta"]}}}},"400":{"description":"`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INVALID_PARAMS":{"summary":"A parameter or the body failed validation. `details.issues` lists each problem.","value":{"error":{"code":"INVALID_PARAMS","category":"validation","treatment":"fix_request","message":"A parameter or the body failed validation. `details.issues` lists each problem.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"UNSUPPORTED_CHAIN":{"summary":"`chain_id` is unknown or not enabled on this API.","value":{"error":{"code":"UNSUPPORTED_CHAIN","category":"validation","treatment":"fix_request","message":"`chain_id` is unknown or not enabled on this API.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"401":{"description":"`UNAUTHENTICATED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"UNAUTHENTICATED":{"summary":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","value":{"error":{"code":"UNAUTHENTICATED","category":"auth","treatment":"fix_request","message":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"404":{"description":"`MARKET_NOT_FOUND`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"MARKET_NOT_FOUND":{"summary":"No market with this ID on this chain.","value":{"error":{"code":"MARKET_NOT_FOUND","category":"not_found","treatment":"fix_request","message":"No market with this ID on this chain.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"422":{"description":"`MARKET_NOT_SUPPORTED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"MARKET_NOT_SUPPORTED":{"summary":"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.","value":{"error":{"code":"MARKET_NOT_SUPPORTED","category":"state","treatment":"fix_request","message":"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.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"429":{"description":"`RATE_LIMITED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"RATE_LIMITED":{"summary":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","value":{"error":{"code":"RATE_LIMITED","category":"rate_limit","treatment":"retry","message":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"500":{"description":"`INTERNAL`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INTERNAL":{"summary":"Something failed on Tenor's side, and the failure has been reported. Retry.","value":{"error":{"code":"INTERNAL","category":"internal","treatment":"retry","message":"Something failed on Tenor's side, and the failure has been reported. Retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"503":{"description":"`RPC_UNAVAILABLE`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"RPC_UNAVAILABLE":{"summary":"The chain's RPC is unavailable or degraded. Retry shortly.","value":{"error":{"code":"RPC_UNAVAILABLE","category":"upstream","treatment":"retry","message":"The chain's RPC is unavailable or degraded. Retry shortly.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}}},"x-rate-limit-class":"read"}},"/v1/curves/clear/prepare":{"post":{"operationId":"prepareClearCurve","summary":"Prepare to clear a curve","description":"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.\n\nThe 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.\n\nNo API key needed. A key sent must carry the `trade` scope.","tags":["Passive quoting"],"security":[{},{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClearCurveRequest"}}}},"responses":{"200":{"description":"Prepare to clear a curve.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Policy":{"$ref":"#/components/headers/X-RateLimit-Policy"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PreparedCurveClear"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}},"required":["data","meta"]}}}},"400":{"description":"`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INVALID_PARAMS":{"summary":"A parameter or the body failed validation. `details.issues` lists each problem.","value":{"error":{"code":"INVALID_PARAMS","category":"validation","treatment":"fix_request","message":"A parameter or the body failed validation. `details.issues` lists each problem.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"UNSUPPORTED_CHAIN":{"summary":"`chain_id` is unknown or not enabled on this API.","value":{"error":{"code":"UNSUPPORTED_CHAIN","category":"validation","treatment":"fix_request","message":"`chain_id` is unknown or not enabled on this API.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"401":{"description":"`UNAUTHENTICATED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"UNAUTHENTICATED":{"summary":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","value":{"error":{"code":"UNAUTHENTICATED","category":"auth","treatment":"fix_request","message":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"403":{"description":"`FORBIDDEN_SCOPE`, `WALLET_BLOCKED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"FORBIDDEN_SCOPE":{"summary":"The API key lacks a scope this route needs.","value":{"error":{"code":"FORBIDDEN_SCOPE","category":"auth","treatment":"fix_request","message":"The API key lacks a scope this route needs.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"WALLET_BLOCKED":{"summary":"The wallet is on a sanctions list that Tenor screens against, so no payload is prepared for it.","value":{"error":{"code":"WALLET_BLOCKED","category":"auth","treatment":"fix_request","message":"The wallet is on a sanctions list that Tenor screens against, so no payload is prepared for it.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"404":{"description":"`MARKET_NOT_FOUND`, `CURVE_NOT_FOUND`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"MARKET_NOT_FOUND":{"summary":"No market with this ID on this chain.","value":{"error":{"code":"MARKET_NOT_FOUND","category":"not_found","treatment":"fix_request","message":"No market with this ID on this chain.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"CURVE_NOT_FOUND":{"summary":"The wallet has no curve on this market. Set one with `POST /v1/curves/set/prepare`. On a clear, there is nothing to clear.","value":{"error":{"code":"CURVE_NOT_FOUND","category":"not_found","treatment":"fix_request","message":"The wallet has no curve on this market. Set one with `POST /v1/curves/set/prepare`. On a clear, there is nothing to clear.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"413":{"description":"`PAYLOAD_TOO_LARGE`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"PAYLOAD_TOO_LARGE":{"summary":"The request body is larger than 64 KiB.","value":{"error":{"code":"PAYLOAD_TOO_LARGE","category":"validation","treatment":"fix_request","message":"The request body is larger than 64 KiB.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"422":{"description":"`MARKET_NOT_SUPPORTED`, `IDLE_CAPITAL_UNAVAILABLE`, `VAULT_NOT_SUPPORTED`, `DRY_RUN_UNAVAILABLE`, `SIMULATION_FAILED`, `INVARIANT_VIOLATION`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"MARKET_NOT_SUPPORTED":{"summary":"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.","value":{"error":{"code":"MARKET_NOT_SUPPORTED","category":"state","treatment":"fix_request","message":"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.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"IDLE_CAPITAL_UNAVAILABLE":{"summary":"The market has no lending vault for idle capital to earn the variable rate in. Post or lend without `idle_capital`.","value":{"error":{"code":"IDLE_CAPITAL_UNAVAILABLE","category":"state","treatment":"fix_request","message":"The market has no lending vault for idle capital to earn the variable rate in. Post or lend without `idle_capital`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"VAULT_NOT_SUPPORTED":{"summary":"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.","value":{"error":{"code":"VAULT_NOT_SUPPORTED","category":"state","treatment":"fix_request","message":"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.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"DRY_RUN_UNAVAILABLE":{"summary":"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`.","value":{"error":{"code":"DRY_RUN_UNAVAILABLE","category":"state","treatment":"fix_request","message":"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`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"SIMULATION_FAILED":{"summary":"The payload reverts in the simulation. `details.revert` has the decoded reason and `details.step` the step that failed.","value":{"error":{"code":"SIMULATION_FAILED","category":"simulation","treatment":"refetch_state","message":"The payload reverts in the simulation. `details.revert` has the decoded reason and `details.step` the step that failed.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"INVARIANT_VIOLATION":{"summary":"The payload failed a safety check, so no calldata is returned.","value":{"error":{"code":"INVARIANT_VIOLATION","category":"simulation","treatment":"fix_request","message":"The payload failed a safety check, so no calldata is returned.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"429":{"description":"`RATE_LIMITED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"RATE_LIMITED":{"summary":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","value":{"error":{"code":"RATE_LIMITED","category":"rate_limit","treatment":"retry","message":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"500":{"description":"`INTERNAL`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INTERNAL":{"summary":"Something failed on Tenor's side, and the failure has been reported. Retry.","value":{"error":{"code":"INTERNAL","category":"internal","treatment":"retry","message":"Something failed on Tenor's side, and the failure has been reported. Retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"503":{"description":"`RPC_UNAVAILABLE`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"RPC_UNAVAILABLE":{"summary":"The chain's RPC is unavailable or degraded. Retry shortly.","value":{"error":{"code":"RPC_UNAVAILABLE","category":"upstream","treatment":"retry","message":"The chain's RPC is unavailable or degraded. Retry shortly.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}}},"x-rate-limit-class":"cancel"}},"/v1/curves/preview":{"get":{"operationId":"previewCurve","summary":"Preview a curve's quotes","description":"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.\n\nA maturity the curve doesn't quote gives a `reason`. A new curve, or one with new rates, starts quoting within a minute.","tags":["Passive quoting"],"security":[{},{"ApiKey":[]}],"parameters":[{"name":"chain_id","in":"query","required":true,"description":"The EVM chain ID. `GET /v1/chains` lists the chains served.","schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"example":8453},{"name":"maker","in":"query","required":true,"description":"The wallet whose curve to preview (case-insensitive).","schema":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$"},"example":"0x7A1f00000000000000000000000000000000C0de"},{"name":"market_id","in":"query","required":true,"description":"The market the curve is on.","schema":{"type":"string","pattern":"^0x[0-9a-fA-F]{64}$"},"example":"0x3f81019286c6aa6265e5823a23c4f08e0f41c953236bad782c7739eb9ee6db11"}],"responses":{"200":{"description":"Preview a curve's quotes.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Policy":{"$ref":"#/components/headers/X-RateLimit-Policy"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CurvePreview"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}},"required":["data","meta"]}}}},"400":{"description":"`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INVALID_PARAMS":{"summary":"A parameter or the body failed validation. `details.issues` lists each problem.","value":{"error":{"code":"INVALID_PARAMS","category":"validation","treatment":"fix_request","message":"A parameter or the body failed validation. `details.issues` lists each problem.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"UNSUPPORTED_CHAIN":{"summary":"`chain_id` is unknown or not enabled on this API.","value":{"error":{"code":"UNSUPPORTED_CHAIN","category":"validation","treatment":"fix_request","message":"`chain_id` is unknown or not enabled on this API.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"401":{"description":"`UNAUTHENTICATED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"UNAUTHENTICATED":{"summary":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","value":{"error":{"code":"UNAUTHENTICATED","category":"auth","treatment":"fix_request","message":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"404":{"description":"`MARKET_NOT_FOUND`, `CURVE_NOT_FOUND`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"MARKET_NOT_FOUND":{"summary":"No market with this ID on this chain.","value":{"error":{"code":"MARKET_NOT_FOUND","category":"not_found","treatment":"fix_request","message":"No market with this ID on this chain.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"CURVE_NOT_FOUND":{"summary":"The wallet has no curve on this market. Set one with `POST /v1/curves/set/prepare`. On a clear, there is nothing to clear.","value":{"error":{"code":"CURVE_NOT_FOUND","category":"not_found","treatment":"fix_request","message":"The wallet has no curve on this market. Set one with `POST /v1/curves/set/prepare`. On a clear, there is nothing to clear.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"422":{"description":"`MARKET_NOT_SUPPORTED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"MARKET_NOT_SUPPORTED":{"summary":"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.","value":{"error":{"code":"MARKET_NOT_SUPPORTED","category":"state","treatment":"fix_request","message":"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.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"429":{"description":"`RATE_LIMITED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"RATE_LIMITED":{"summary":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","value":{"error":{"code":"RATE_LIMITED","category":"rate_limit","treatment":"retry","message":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"500":{"description":"`INTERNAL`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INTERNAL":{"summary":"Something failed on Tenor's side, and the failure has been reported. Retry.","value":{"error":{"code":"INTERNAL","category":"internal","treatment":"retry","message":"Something failed on Tenor's side, and the failure has been reported. Retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"503":{"description":"`RPC_UNAVAILABLE`, `ROUTER_UNAVAILABLE`, `ROUTER_BUSY`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"RPC_UNAVAILABLE":{"summary":"The chain's RPC is unavailable or degraded. Retry shortly.","value":{"error":{"code":"RPC_UNAVAILABLE","category":"upstream","treatment":"retry","message":"The chain's RPC is unavailable or degraded. Retry shortly.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"ROUTER_UNAVAILABLE":{"summary":"Tenor's quote engine is unavailable. Retry shortly.","value":{"error":{"code":"ROUTER_UNAVAILABLE","category":"upstream","treatment":"retry","message":"Tenor's quote engine is unavailable. Retry shortly.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"ROUTER_BUSY":{"summary":"Tenor's quote engine is at capacity. Retry shortly.","value":{"error":{"code":"ROUTER_BUSY","category":"upstream","treatment":"retry","message":"Tenor's quote engine is at capacity. Retry shortly.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}}},"x-rate-limit-class":"read"}},"/v1/curves/set/prepare":{"post":{"operationId":"prepareCurve","summary":"Prepare to set a curve","description":"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.\n\nOtherwise (`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.\n\nNo API key needed. A key sent must carry the `trade` scope.","tags":["Passive quoting"],"security":[{},{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetCurveRequest"}}}},"responses":{"200":{"description":"Prepare to set a curve.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Policy":{"$ref":"#/components/headers/X-RateLimit-Policy"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PreparedCurve"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}},"required":["data","meta"]}}}},"400":{"description":"`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `CURVE_INVALID`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INVALID_PARAMS":{"summary":"A parameter or the body failed validation. `details.issues` lists each problem.","value":{"error":{"code":"INVALID_PARAMS","category":"validation","treatment":"fix_request","message":"A parameter or the body failed validation. `details.issues` lists each problem.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"UNSUPPORTED_CHAIN":{"summary":"`chain_id` is unknown or not enabled on this API.","value":{"error":{"code":"UNSUPPORTED_CHAIN","category":"validation","treatment":"fix_request","message":"`chain_id` is unknown or not enabled on this API.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"CURVE_INVALID":{"summary":"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%.","value":{"error":{"code":"CURVE_INVALID","category":"validation","treatment":"fix_request","message":"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%.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"401":{"description":"`UNAUTHENTICATED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"UNAUTHENTICATED":{"summary":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","value":{"error":{"code":"UNAUTHENTICATED","category":"auth","treatment":"fix_request","message":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"403":{"description":"`FORBIDDEN_SCOPE`, `WALLET_BLOCKED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"FORBIDDEN_SCOPE":{"summary":"The API key lacks a scope this route needs.","value":{"error":{"code":"FORBIDDEN_SCOPE","category":"auth","treatment":"fix_request","message":"The API key lacks a scope this route needs.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"WALLET_BLOCKED":{"summary":"The wallet is on a sanctions list that Tenor screens against, so no payload is prepared for it.","value":{"error":{"code":"WALLET_BLOCKED","category":"auth","treatment":"fix_request","message":"The wallet is on a sanctions list that Tenor screens against, so no payload is prepared for it.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"404":{"description":"`MARKET_NOT_FOUND`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"MARKET_NOT_FOUND":{"summary":"No market with this ID on this chain.","value":{"error":{"code":"MARKET_NOT_FOUND","category":"not_found","treatment":"fix_request","message":"No market with this ID on this chain.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"413":{"description":"`PAYLOAD_TOO_LARGE`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"PAYLOAD_TOO_LARGE":{"summary":"The request body is larger than 64 KiB.","value":{"error":{"code":"PAYLOAD_TOO_LARGE","category":"validation","treatment":"fix_request","message":"The request body is larger than 64 KiB.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"422":{"description":"`MARKET_NOT_SUPPORTED`, `IDLE_CAPITAL_UNAVAILABLE`, `VAULT_NOT_SUPPORTED`, `DRY_RUN_UNAVAILABLE`, `INSUFFICIENT_BALANCE`, `SIMULATION_FAILED`, `INVARIANT_VIOLATION`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"MARKET_NOT_SUPPORTED":{"summary":"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.","value":{"error":{"code":"MARKET_NOT_SUPPORTED","category":"state","treatment":"fix_request","message":"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.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"IDLE_CAPITAL_UNAVAILABLE":{"summary":"The market has no lending vault for idle capital to earn the variable rate in. Post or lend without `idle_capital`.","value":{"error":{"code":"IDLE_CAPITAL_UNAVAILABLE","category":"state","treatment":"fix_request","message":"The market has no lending vault for idle capital to earn the variable rate in. Post or lend without `idle_capital`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"VAULT_NOT_SUPPORTED":{"summary":"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.","value":{"error":{"code":"VAULT_NOT_SUPPORTED","category":"state","treatment":"fix_request","message":"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.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"DRY_RUN_UNAVAILABLE":{"summary":"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`.","value":{"error":{"code":"DRY_RUN_UNAVAILABLE","category":"state","treatment":"fix_request","message":"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`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"INSUFFICIENT_BALANCE":{"summary":"The wallet doesn't hold the tokens this action needs.","value":{"error":{"code":"INSUFFICIENT_BALANCE","category":"account","treatment":"fund_account","message":"The wallet doesn't hold the tokens this action needs.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"SIMULATION_FAILED":{"summary":"The payload reverts in the simulation. `details.revert` has the decoded reason and `details.step` the step that failed.","value":{"error":{"code":"SIMULATION_FAILED","category":"simulation","treatment":"refetch_state","message":"The payload reverts in the simulation. `details.revert` has the decoded reason and `details.step` the step that failed.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"INVARIANT_VIOLATION":{"summary":"The payload failed a safety check, so no calldata is returned.","value":{"error":{"code":"INVARIANT_VIOLATION","category":"simulation","treatment":"fix_request","message":"The payload failed a safety check, so no calldata is returned.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"429":{"description":"`RATE_LIMITED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"RATE_LIMITED":{"summary":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","value":{"error":{"code":"RATE_LIMITED","category":"rate_limit","treatment":"retry","message":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"500":{"description":"`INTERNAL`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INTERNAL":{"summary":"Something failed on Tenor's side, and the failure has been reported. Retry.","value":{"error":{"code":"INTERNAL","category":"internal","treatment":"retry","message":"Something failed on Tenor's side, and the failure has been reported. Retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"503":{"description":"`RPC_UNAVAILABLE`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"RPC_UNAVAILABLE":{"summary":"The chain's RPC is unavailable or degraded. Retry shortly.","value":{"error":{"code":"RPC_UNAVAILABLE","category":"upstream","treatment":"retry","message":"The chain's RPC is unavailable or degraded. Retry shortly.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}}},"x-rate-limit-class":"prepare"}},"/v1/lend/prepare":{"post":{"operationId":"prepareLend","summary":"Prepare a lend","description":"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.\n\nNo API key needed. A key sent must carry the `trade` scope.","tags":["Fixed rate"],"security":[{},{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LendPrepareRequest"}}}},"responses":{"200":{"description":"Prepare a lend.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Policy":{"$ref":"#/components/headers/X-RateLimit-Policy"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PreparedLend"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}},"required":["data","meta"]}}}},"400":{"description":"`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `MARKET_MISMATCH`, `RATE_ABOVE_MAX`, `INVALID_BOUNDS`, `DEADLINE_INVALID`, `INVALID_OFFER_INPUT`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INVALID_PARAMS":{"summary":"A parameter or the body failed validation. `details.issues` lists each problem.","value":{"error":{"code":"INVALID_PARAMS","category":"validation","treatment":"fix_request","message":"A parameter or the body failed validation. `details.issues` lists each problem.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"UNSUPPORTED_CHAIN":{"summary":"`chain_id` is unknown or not enabled on this API.","value":{"error":{"code":"UNSUPPORTED_CHAIN","category":"validation","treatment":"fix_request","message":"`chain_id` is unknown or not enabled on this API.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"MARKET_MISMATCH":{"summary":"The maturity doesn't belong to the given market.","value":{"error":{"code":"MARKET_MISMATCH","category":"validation","treatment":"fix_request","message":"The maturity doesn't belong to the given market.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"RATE_ABOVE_MAX":{"summary":"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`.","value":{"error":{"code":"RATE_ABOVE_MAX","category":"validation","treatment":"fix_request","message":"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`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"INVALID_BOUNDS":{"summary":"The limit rate and the size bounds contradict each other.","value":{"error":{"code":"INVALID_BOUNDS","category":"validation","treatment":"fix_request","message":"The limit rate and the size bounds contradict each other.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"DEADLINE_INVALID":{"summary":"The deadline is in the past, too soon, or beyond the wallet type's signing window.","value":{"error":{"code":"DEADLINE_INVALID","category":"validation","treatment":"fix_request","message":"The deadline is in the past, too soon, or beyond the wallet type's signing window.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"INVALID_OFFER_INPUT":{"summary":"Some offer fields are invalid. `details.issues` names them.","value":{"error":{"code":"INVALID_OFFER_INPUT","category":"validation","treatment":"fix_request","message":"Some offer fields are invalid. `details.issues` names them.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"401":{"description":"`UNAUTHENTICATED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"UNAUTHENTICATED":{"summary":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","value":{"error":{"code":"UNAUTHENTICATED","category":"auth","treatment":"fix_request","message":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"403":{"description":"`FORBIDDEN_SCOPE`, `WALLET_BLOCKED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"FORBIDDEN_SCOPE":{"summary":"The API key lacks a scope this route needs.","value":{"error":{"code":"FORBIDDEN_SCOPE","category":"auth","treatment":"fix_request","message":"The API key lacks a scope this route needs.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"WALLET_BLOCKED":{"summary":"The wallet is on a sanctions list that Tenor screens against, so no payload is prepared for it.","value":{"error":{"code":"WALLET_BLOCKED","category":"auth","treatment":"fix_request","message":"The wallet is on a sanctions list that Tenor screens against, so no payload is prepared for it.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"404":{"description":"`MATURITY_NOT_FOUND`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"MATURITY_NOT_FOUND":{"summary":"No maturity with this ID on this chain.","value":{"error":{"code":"MATURITY_NOT_FOUND","category":"not_found","treatment":"fix_request","message":"No maturity with this ID on this chain.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"413":{"description":"`PAYLOAD_TOO_LARGE`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"PAYLOAD_TOO_LARGE":{"summary":"The request body is larger than 64 KiB.","value":{"error":{"code":"PAYLOAD_TOO_LARGE","category":"validation","treatment":"fix_request","message":"The request body is larger than 64 KiB.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"422":{"description":"`COUNTERPARTY_BLOCKED`, `MARKET_NOT_SUPPORTED`, `MATURITY_MATURED`, `DRY_RUN_UNAVAILABLE`, `NO_OFFERS`, `NO_VALID_OFFERS`, `INSUFFICIENT_LIQUIDITY`, `LIMIT_RATE_NOT_MET`, `INSUFFICIENT_BALANCE`, `SIMULATION_FAILED`, `SLIPPAGE_EXCEEDED`, `SELF_CROSS`, `OPPOSITE_POSITION`, `INVARIANT_VIOLATION`, `IDLE_CAPITAL_UNAVAILABLE`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"COUNTERPARTY_BLOCKED":{"summary":"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.","value":{"error":{"code":"COUNTERPARTY_BLOCKED","category":"state","treatment":"fix_request","message":"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_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"MARKET_NOT_SUPPORTED":{"summary":"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.","value":{"error":{"code":"MARKET_NOT_SUPPORTED","category":"state","treatment":"fix_request","message":"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.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"MATURITY_MATURED":{"summary":"The maturity is past `matures_at` and accepts no new lends or borrows. Lenders redeem, and borrowers repay.","value":{"error":{"code":"MATURITY_MATURED","category":"state","treatment":"fix_request","message":"The maturity is past `matures_at` and accepts no new lends or borrows. Lenders redeem, and borrowers repay.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"DRY_RUN_UNAVAILABLE":{"summary":"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`.","value":{"error":{"code":"DRY_RUN_UNAVAILABLE","category":"state","treatment":"fix_request","message":"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`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"NO_OFFERS":{"summary":"There are no open offers on that side.","value":{"error":{"code":"NO_OFFERS","category":"liquidity","treatment":"refetch_state","message":"There are no open offers on that side.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"NO_VALID_OFFERS":{"summary":"No offer on that side can be filled right now.","value":{"error":{"code":"NO_VALID_OFFERS","category":"liquidity","treatment":"refetch_state","message":"No offer on that side can be filled right now.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"INSUFFICIENT_LIQUIDITY":{"summary":"There isn't enough liquidity to fill the full size.","value":{"error":{"code":"INSUFFICIENT_LIQUIDITY","category":"liquidity","treatment":"refetch_state","message":"There isn't enough liquidity to fill the full size.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"LIMIT_RATE_NOT_MET":{"summary":"No fill is possible within the limit rate.","value":{"error":{"code":"LIMIT_RATE_NOT_MET","category":"liquidity","treatment":"refetch_state","message":"No fill is possible within the limit rate.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"INSUFFICIENT_BALANCE":{"summary":"The wallet doesn't hold the tokens this action needs.","value":{"error":{"code":"INSUFFICIENT_BALANCE","category":"account","treatment":"fund_account","message":"The wallet doesn't hold the tokens this action needs.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"SIMULATION_FAILED":{"summary":"The payload reverts in the simulation. `details.revert` has the decoded reason and `details.step` the step that failed.","value":{"error":{"code":"SIMULATION_FAILED","category":"simulation","treatment":"refetch_state","message":"The payload reverts in the simulation. `details.revert` has the decoded reason and `details.step` the step that failed.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"SLIPPAGE_EXCEEDED":{"summary":"The fill would fall outside the request's limit rate or size bounds.","value":{"error":{"code":"SLIPPAGE_EXCEEDED","category":"liquidity","treatment":"refetch_state","message":"The fill would fall outside the request's limit rate or size bounds.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"SELF_CROSS":{"summary":"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.","value":{"error":{"code":"SELF_CROSS","category":"account","treatment":"fix_request","message":"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.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"OPPOSITE_POSITION":{"summary":"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.","value":{"error":{"code":"OPPOSITE_POSITION","category":"account","treatment":"fix_request","message":"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.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"INVARIANT_VIOLATION":{"summary":"The payload failed a safety check, so no calldata is returned.","value":{"error":{"code":"INVARIANT_VIOLATION","category":"simulation","treatment":"fix_request","message":"The payload failed a safety check, so no calldata is returned.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"IDLE_CAPITAL_UNAVAILABLE":{"summary":"The market has no lending vault for idle capital to earn the variable rate in. Post or lend without `idle_capital`.","value":{"error":{"code":"IDLE_CAPITAL_UNAVAILABLE","category":"state","treatment":"fix_request","message":"The market has no lending vault for idle capital to earn the variable rate in. Post or lend without `idle_capital`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"429":{"description":"`RATE_LIMITED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"RATE_LIMITED":{"summary":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","value":{"error":{"code":"RATE_LIMITED","category":"rate_limit","treatment":"retry","message":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"500":{"description":"`INTERNAL`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INTERNAL":{"summary":"Something failed on Tenor's side, and the failure has been reported. Retry.","value":{"error":{"code":"INTERNAL","category":"internal","treatment":"retry","message":"Something failed on Tenor's side, and the failure has been reported. Retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"503":{"description":"`ROUTER_UNAVAILABLE`, `ROUTER_BUSY`, `RPC_UNAVAILABLE`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"ROUTER_UNAVAILABLE":{"summary":"Tenor's quote engine is unavailable. Retry shortly.","value":{"error":{"code":"ROUTER_UNAVAILABLE","category":"upstream","treatment":"retry","message":"Tenor's quote engine is unavailable. Retry shortly.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"ROUTER_BUSY":{"summary":"Tenor's quote engine is at capacity. Retry shortly.","value":{"error":{"code":"ROUTER_BUSY","category":"upstream","treatment":"retry","message":"Tenor's quote engine is at capacity. Retry shortly.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"RPC_UNAVAILABLE":{"summary":"The chain's RPC is unavailable or degraded. Retry shortly.","value":{"error":{"code":"RPC_UNAVAILABLE","category":"upstream","treatment":"retry","message":"The chain's RPC is unavailable or degraded. Retry shortly.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}}},"x-rate-limit-class":"prepare"}},"/v1/llms.txt":{"get":{"operationId":"getLlmsTxt","summary":"Get the API summary for LLMs","description":"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`.","tags":["Service"],"security":[{},{"ApiKey":[]}],"responses":{"200":{"description":"Get the API summary for LLMs.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Policy":{"$ref":"#/components/headers/X-RateLimit-Policy"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"text/plain":{"schema":{"type":"string"}}}},"401":{"description":"`UNAUTHENTICATED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"UNAUTHENTICATED":{"summary":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","value":{"error":{"code":"UNAUTHENTICATED","category":"auth","treatment":"fix_request","message":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"429":{"description":"`RATE_LIMITED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"RATE_LIMITED":{"summary":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","value":{"error":{"code":"RATE_LIMITED","category":"rate_limit","treatment":"retry","message":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"500":{"description":"`INTERNAL`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INTERNAL":{"summary":"Something failed on Tenor's side, and the failure has been reported. Retry.","value":{"error":{"code":"INTERNAL","category":"internal","treatment":"retry","message":"Something failed on Tenor's side, and the failure has been reported. Retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}}},"x-rate-limit-class":"read"}},"/v1/manage/prepare":{"post":{"operationId":"prepareManage","summary":"Prepare a collateral or auto-renewal change","description":"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`.\n\nTo borrow more or repay part of a borrow, use `/v1/borrow/prepare` (with `deposit_collateral`) or `/v1/repay/prepare` (with `withdraw_collateral`).\n\nNo API key needed. A key sent must carry the `trade` scope.","tags":["Fixed rate"],"security":[{},{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ManagePrepareRequest"}}}},"responses":{"200":{"description":"Prepare a collateral or auto-renewal change.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Policy":{"$ref":"#/components/headers/X-RateLimit-Policy"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Prepared"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}},"required":["data","meta"]}}}},"400":{"description":"`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `MARKET_MISMATCH`, `INVALID_BOUNDS`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INVALID_PARAMS":{"summary":"A parameter or the body failed validation. `details.issues` lists each problem.","value":{"error":{"code":"INVALID_PARAMS","category":"validation","treatment":"fix_request","message":"A parameter or the body failed validation. `details.issues` lists each problem.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"UNSUPPORTED_CHAIN":{"summary":"`chain_id` is unknown or not enabled on this API.","value":{"error":{"code":"UNSUPPORTED_CHAIN","category":"validation","treatment":"fix_request","message":"`chain_id` is unknown or not enabled on this API.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"MARKET_MISMATCH":{"summary":"The maturity doesn't belong to the given market.","value":{"error":{"code":"MARKET_MISMATCH","category":"validation","treatment":"fix_request","message":"The maturity doesn't belong to the given market.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"INVALID_BOUNDS":{"summary":"The limit rate and the size bounds contradict each other.","value":{"error":{"code":"INVALID_BOUNDS","category":"validation","treatment":"fix_request","message":"The limit rate and the size bounds contradict each other.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"401":{"description":"`UNAUTHENTICATED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"UNAUTHENTICATED":{"summary":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","value":{"error":{"code":"UNAUTHENTICATED","category":"auth","treatment":"fix_request","message":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"403":{"description":"`FORBIDDEN_SCOPE`, `WALLET_BLOCKED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"FORBIDDEN_SCOPE":{"summary":"The API key lacks a scope this route needs.","value":{"error":{"code":"FORBIDDEN_SCOPE","category":"auth","treatment":"fix_request","message":"The API key lacks a scope this route needs.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"WALLET_BLOCKED":{"summary":"The wallet is on a sanctions list that Tenor screens against, so no payload is prepared for it.","value":{"error":{"code":"WALLET_BLOCKED","category":"auth","treatment":"fix_request","message":"The wallet is on a sanctions list that Tenor screens against, so no payload is prepared for it.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"404":{"description":"`MATURITY_NOT_FOUND`, `POSITION_NOT_FOUND`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"MATURITY_NOT_FOUND":{"summary":"No maturity with this ID on this chain.","value":{"error":{"code":"MATURITY_NOT_FOUND","category":"not_found","treatment":"fix_request","message":"No maturity with this ID on this chain.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"POSITION_NOT_FOUND":{"summary":"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`).","value":{"error":{"code":"POSITION_NOT_FOUND","category":"not_found","treatment":"fix_request","message":"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`).","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"413":{"description":"`PAYLOAD_TOO_LARGE`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"PAYLOAD_TOO_LARGE":{"summary":"The request body is larger than 64 KiB.","value":{"error":{"code":"PAYLOAD_TOO_LARGE","category":"validation","treatment":"fix_request","message":"The request body is larger than 64 KiB.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"422":{"description":"`MARKET_NOT_SUPPORTED`, `DRY_RUN_UNAVAILABLE`, `INSUFFICIENT_BALANCE`, `OPPOSITE_POSITION`, `EXCEEDS_POSITION`, `POSITION_UNHEALTHY`, `SIMULATION_FAILED`, `INVARIANT_VIOLATION`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"MARKET_NOT_SUPPORTED":{"summary":"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.","value":{"error":{"code":"MARKET_NOT_SUPPORTED","category":"state","treatment":"fix_request","message":"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.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"DRY_RUN_UNAVAILABLE":{"summary":"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`.","value":{"error":{"code":"DRY_RUN_UNAVAILABLE","category":"state","treatment":"fix_request","message":"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`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"INSUFFICIENT_BALANCE":{"summary":"The wallet doesn't hold the tokens this action needs.","value":{"error":{"code":"INSUFFICIENT_BALANCE","category":"account","treatment":"fund_account","message":"The wallet doesn't hold the tokens this action needs.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"OPPOSITE_POSITION":{"summary":"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.","value":{"error":{"code":"OPPOSITE_POSITION","category":"account","treatment":"fix_request","message":"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.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"EXCEEDS_POSITION":{"summary":"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.","value":{"error":{"code":"EXCEEDS_POSITION","category":"account","treatment":"fix_request","message":"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.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"POSITION_UNHEALTHY":{"summary":"The action would leave the position liquidatable. Withdraw at most `details.max_amount`.","value":{"error":{"code":"POSITION_UNHEALTHY","category":"account","treatment":"fix_request","message":"The action would leave the position liquidatable. Withdraw at most `details.max_amount`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"SIMULATION_FAILED":{"summary":"The payload reverts in the simulation. `details.revert` has the decoded reason and `details.step` the step that failed.","value":{"error":{"code":"SIMULATION_FAILED","category":"simulation","treatment":"refetch_state","message":"The payload reverts in the simulation. `details.revert` has the decoded reason and `details.step` the step that failed.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"INVARIANT_VIOLATION":{"summary":"The payload failed a safety check, so no calldata is returned.","value":{"error":{"code":"INVARIANT_VIOLATION","category":"simulation","treatment":"fix_request","message":"The payload failed a safety check, so no calldata is returned.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"429":{"description":"`RATE_LIMITED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"RATE_LIMITED":{"summary":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","value":{"error":{"code":"RATE_LIMITED","category":"rate_limit","treatment":"retry","message":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"500":{"description":"`INTERNAL`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INTERNAL":{"summary":"Something failed on Tenor's side, and the failure has been reported. Retry.","value":{"error":{"code":"INTERNAL","category":"internal","treatment":"retry","message":"Something failed on Tenor's side, and the failure has been reported. Retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"503":{"description":"`RPC_UNAVAILABLE`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"RPC_UNAVAILABLE":{"summary":"The chain's RPC is unavailable or degraded. Retry shortly.","value":{"error":{"code":"RPC_UNAVAILABLE","category":"upstream","treatment":"retry","message":"The chain's RPC is unavailable or degraded. Retry shortly.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}}},"x-rate-limit-class":"prepare"}},"/v1/markets":{"get":{"operationId":"listMarkets","summary":"List markets","description":"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`.","tags":["Catalog"],"security":[{},{"ApiKey":[]}],"parameters":[{"name":"chain_id","in":"query","required":true,"description":"The EVM chain ID. `GET /v1/chains` lists the chains served.","schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"example":8453},{"name":"loan_token","in":"query","required":false,"description":"Only markets lending this token.","schema":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$"},"example":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},{"name":"collateral","in":"query","required":false,"description":"Only markets accepting this token as collateral.","schema":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$"},"example":"0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf"},{"name":"structure","in":"query","required":false,"description":"Only markets of this structure (see `Market.structure`).","schema":{"type":"string","enum":["plain","loan_token","yield"]}},{"name":"listing","in":"query","required":false,"description":"The markets to list: `listed` (the default), `otc`, or `all`. A lookup by ID finds a market or maturity of either listing.","schema":{"default":"listed","type":"string","enum":["listed","otc","all"]},"example":"listed"},{"name":"include_deprecated","in":"query","required":false,"description":"Also list deprecated markets and maturities.","schema":{"default":"false","type":"string","enum":["true","false"]}}],"responses":{"200":{"description":"List markets.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Policy":{"$ref":"#/components/headers/X-RateLimit-Policy"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"Cache-Control":{"description":"How long the response may be reused.","schema":{"type":"string","examples":["public, max-age=10, stale-while-revalidate=10"]}},"ETag":{"description":"The response's tag. Send it in `If-None-Match` to get a 304 while the body hasn't changed.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Market"}},"meta":{"$ref":"#/components/schemas/ResponseMeta"}},"required":["data","meta"]}}}},"304":{"description":"Not modified. The `ETag` sent in `If-None-Match` still matches, so the cached copy is current.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"400":{"description":"`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INVALID_PARAMS":{"summary":"A parameter or the body failed validation. `details.issues` lists each problem.","value":{"error":{"code":"INVALID_PARAMS","category":"validation","treatment":"fix_request","message":"A parameter or the body failed validation. `details.issues` lists each problem.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"UNSUPPORTED_CHAIN":{"summary":"`chain_id` is unknown or not enabled on this API.","value":{"error":{"code":"UNSUPPORTED_CHAIN","category":"validation","treatment":"fix_request","message":"`chain_id` is unknown or not enabled on this API.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"401":{"description":"`UNAUTHENTICATED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"UNAUTHENTICATED":{"summary":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","value":{"error":{"code":"UNAUTHENTICATED","category":"auth","treatment":"fix_request","message":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"429":{"description":"`RATE_LIMITED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"RATE_LIMITED":{"summary":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","value":{"error":{"code":"RATE_LIMITED","category":"rate_limit","treatment":"retry","message":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"500":{"description":"`INTERNAL`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INTERNAL":{"summary":"Something failed on Tenor's side, and the failure has been reported. Retry.","value":{"error":{"code":"INTERNAL","category":"internal","treatment":"retry","message":"Something failed on Tenor's side, and the failure has been reported. Retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}}},"x-rate-limit-class":"read"}},"/v1/markets/{market_id}":{"get":{"operationId":"getMarket","summary":"Get a market","description":"Returns one market. A deprecated market is returned too, with its `status`.","tags":["Catalog"],"security":[{},{"ApiKey":[]}],"parameters":[{"name":"market_id","in":"path","required":true,"description":"The market's ID, from `GET /v1/markets`.","schema":{"type":"string","pattern":"^0x[0-9a-fA-F]{64}$"},"example":"0x3f81019286c6aa6265e5823a23c4f08e0f41c953236bad782c7739eb9ee6db11"},{"name":"chain_id","in":"query","required":true,"description":"The EVM chain ID. `GET /v1/chains` lists the chains served.","schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"example":8453},{"name":"include_deprecated","in":"query","required":false,"description":"Also list the market's deprecated maturities.","schema":{"default":"false","type":"string","enum":["true","false"]}}],"responses":{"200":{"description":"Get a market.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Policy":{"$ref":"#/components/headers/X-RateLimit-Policy"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"Cache-Control":{"description":"How long the response may be reused.","schema":{"type":"string","examples":["public, max-age=10, stale-while-revalidate=10"]}},"ETag":{"description":"The response's tag. Send it in `If-None-Match` to get a 304 while the body hasn't changed.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Market"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}},"required":["data","meta"]}}}},"304":{"description":"Not modified. The `ETag` sent in `If-None-Match` still matches, so the cached copy is current.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"400":{"description":"`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INVALID_PARAMS":{"summary":"A parameter or the body failed validation. `details.issues` lists each problem.","value":{"error":{"code":"INVALID_PARAMS","category":"validation","treatment":"fix_request","message":"A parameter or the body failed validation. `details.issues` lists each problem.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"UNSUPPORTED_CHAIN":{"summary":"`chain_id` is unknown or not enabled on this API.","value":{"error":{"code":"UNSUPPORTED_CHAIN","category":"validation","treatment":"fix_request","message":"`chain_id` is unknown or not enabled on this API.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"401":{"description":"`UNAUTHENTICATED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"UNAUTHENTICATED":{"summary":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","value":{"error":{"code":"UNAUTHENTICATED","category":"auth","treatment":"fix_request","message":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"404":{"description":"`MARKET_NOT_FOUND`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"MARKET_NOT_FOUND":{"summary":"No market with this ID on this chain.","value":{"error":{"code":"MARKET_NOT_FOUND","category":"not_found","treatment":"fix_request","message":"No market with this ID on this chain.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"422":{"description":"`MARKET_NOT_SUPPORTED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"MARKET_NOT_SUPPORTED":{"summary":"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.","value":{"error":{"code":"MARKET_NOT_SUPPORTED","category":"state","treatment":"fix_request","message":"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.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"429":{"description":"`RATE_LIMITED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"RATE_LIMITED":{"summary":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","value":{"error":{"code":"RATE_LIMITED","category":"rate_limit","treatment":"retry","message":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"500":{"description":"`INTERNAL`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INTERNAL":{"summary":"Something failed on Tenor's side, and the failure has been reported. Retry.","value":{"error":{"code":"INTERNAL","category":"internal","treatment":"retry","message":"Something failed on Tenor's side, and the failure has been reported. Retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}}},"x-rate-limit-class":"read"}},"/v1/markets/{market_id}/maturities":{"get":{"operationId":"listMarketMaturities","summary":"List a market's maturities","description":"Lists the market's maturities open for new lends and borrows, earliest first. Deprecated maturities are listed only with `include_deprecated`.","tags":["Catalog"],"security":[{},{"ApiKey":[]}],"parameters":[{"name":"market_id","in":"path","required":true,"description":"The market's ID, from `GET /v1/markets`.","schema":{"type":"string","pattern":"^0x[0-9a-fA-F]{64}$"},"example":"0x3f81019286c6aa6265e5823a23c4f08e0f41c953236bad782c7739eb9ee6db11"},{"name":"chain_id","in":"query","required":true,"description":"The EVM chain ID. `GET /v1/chains` lists the chains served.","schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"example":8453},{"name":"include_deprecated","in":"query","required":false,"description":"Also list the market's deprecated maturities.","schema":{"default":"false","type":"string","enum":["true","false"]}}],"responses":{"200":{"description":"List a market's maturities.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Policy":{"$ref":"#/components/headers/X-RateLimit-Policy"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"Cache-Control":{"description":"How long the response may be reused.","schema":{"type":"string","examples":["public, max-age=10, stale-while-revalidate=10"]}},"ETag":{"description":"The response's tag. Send it in `If-None-Match` to get a 304 while the body hasn't changed.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Maturity"}},"meta":{"$ref":"#/components/schemas/ResponseMeta"}},"required":["data","meta"]}}}},"304":{"description":"Not modified. The `ETag` sent in `If-None-Match` still matches, so the cached copy is current.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"400":{"description":"`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INVALID_PARAMS":{"summary":"A parameter or the body failed validation. `details.issues` lists each problem.","value":{"error":{"code":"INVALID_PARAMS","category":"validation","treatment":"fix_request","message":"A parameter or the body failed validation. `details.issues` lists each problem.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"UNSUPPORTED_CHAIN":{"summary":"`chain_id` is unknown or not enabled on this API.","value":{"error":{"code":"UNSUPPORTED_CHAIN","category":"validation","treatment":"fix_request","message":"`chain_id` is unknown or not enabled on this API.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"401":{"description":"`UNAUTHENTICATED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"UNAUTHENTICATED":{"summary":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","value":{"error":{"code":"UNAUTHENTICATED","category":"auth","treatment":"fix_request","message":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"404":{"description":"`MARKET_NOT_FOUND`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"MARKET_NOT_FOUND":{"summary":"No market with this ID on this chain.","value":{"error":{"code":"MARKET_NOT_FOUND","category":"not_found","treatment":"fix_request","message":"No market with this ID on this chain.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"422":{"description":"`MARKET_NOT_SUPPORTED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"MARKET_NOT_SUPPORTED":{"summary":"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.","value":{"error":{"code":"MARKET_NOT_SUPPORTED","category":"state","treatment":"fix_request","message":"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.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"429":{"description":"`RATE_LIMITED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"RATE_LIMITED":{"summary":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","value":{"error":{"code":"RATE_LIMITED","category":"rate_limit","treatment":"retry","message":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"500":{"description":"`INTERNAL`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INTERNAL":{"summary":"Something failed on Tenor's side, and the failure has been reported. Retry.","value":{"error":{"code":"INTERNAL","category":"internal","treatment":"retry","message":"Something failed on Tenor's side, and the failure has been reported. Retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}}},"x-rate-limit-class":"read"}},"/v1/markets/{market_id}/term-structure":{"get":{"operationId":"getTermStructure","summary":"Get a market's term structure","description":"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.","tags":["Market depth"],"security":[{},{"ApiKey":[]}],"parameters":[{"name":"market_id","in":"path","required":true,"description":"The market's ID, from `GET /v1/markets`.","schema":{"type":"string","pattern":"^0x[0-9a-fA-F]{64}$"},"example":"0x3f81019286c6aa6265e5823a23c4f08e0f41c953236bad782c7739eb9ee6db11"},{"name":"chain_id","in":"query","required":true,"description":"The EVM chain ID. `GET /v1/chains` lists the chains served.","schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"example":8453},{"name":"include_deprecated","in":"query","required":false,"description":"Also list the market's deprecated maturities.","schema":{"default":"false","type":"string","enum":["true","false"]}}],"responses":{"200":{"description":"Get a market's term structure.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Policy":{"$ref":"#/components/headers/X-RateLimit-Policy"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"Cache-Control":{"description":"How long the response may be reused.","schema":{"type":"string","examples":["public, max-age=2"]}},"ETag":{"description":"The response's tag. Send it in `If-None-Match` to get a 304 while the body hasn't changed.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MarketTermStructure"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}},"required":["data","meta"]}}}},"304":{"description":"Not modified. The `ETag` sent in `If-None-Match` still matches, so the cached copy is current.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"400":{"description":"`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INVALID_PARAMS":{"summary":"A parameter or the body failed validation. `details.issues` lists each problem.","value":{"error":{"code":"INVALID_PARAMS","category":"validation","treatment":"fix_request","message":"A parameter or the body failed validation. `details.issues` lists each problem.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"UNSUPPORTED_CHAIN":{"summary":"`chain_id` is unknown or not enabled on this API.","value":{"error":{"code":"UNSUPPORTED_CHAIN","category":"validation","treatment":"fix_request","message":"`chain_id` is unknown or not enabled on this API.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"401":{"description":"`UNAUTHENTICATED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"UNAUTHENTICATED":{"summary":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","value":{"error":{"code":"UNAUTHENTICATED","category":"auth","treatment":"fix_request","message":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"404":{"description":"`MARKET_NOT_FOUND`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"MARKET_NOT_FOUND":{"summary":"No market with this ID on this chain.","value":{"error":{"code":"MARKET_NOT_FOUND","category":"not_found","treatment":"fix_request","message":"No market with this ID on this chain.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"422":{"description":"`MARKET_NOT_SUPPORTED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"MARKET_NOT_SUPPORTED":{"summary":"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.","value":{"error":{"code":"MARKET_NOT_SUPPORTED","category":"state","treatment":"fix_request","message":"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.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"429":{"description":"`RATE_LIMITED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"RATE_LIMITED":{"summary":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","value":{"error":{"code":"RATE_LIMITED","category":"rate_limit","treatment":"retry","message":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"500":{"description":"`INTERNAL`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INTERNAL":{"summary":"Something failed on Tenor's side, and the failure has been reported. Retry.","value":{"error":{"code":"INTERNAL","category":"internal","treatment":"retry","message":"Something failed on Tenor's side, and the failure has been reported. Retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"503":{"description":"`ROUTER_UNAVAILABLE`, `ROUTER_BUSY`, `RPC_UNAVAILABLE`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"ROUTER_UNAVAILABLE":{"summary":"Tenor's quote engine is unavailable. Retry shortly.","value":{"error":{"code":"ROUTER_UNAVAILABLE","category":"upstream","treatment":"retry","message":"Tenor's quote engine is unavailable. Retry shortly.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"ROUTER_BUSY":{"summary":"Tenor's quote engine is at capacity. Retry shortly.","value":{"error":{"code":"ROUTER_BUSY","category":"upstream","treatment":"retry","message":"Tenor's quote engine is at capacity. Retry shortly.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"RPC_UNAVAILABLE":{"summary":"The chain's RPC is unavailable or degraded. Retry shortly.","value":{"error":{"code":"RPC_UNAVAILABLE","category":"upstream","treatment":"retry","message":"The chain's RPC is unavailable or degraded. Retry shortly.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}}},"x-rate-limit-class":"read"}},"/v1/maturities/{maturity_id}":{"get":{"operationId":"getMaturity","summary":"Get a maturity","description":"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.","tags":["Catalog"],"security":[{},{"ApiKey":[]}],"parameters":[{"name":"maturity_id","in":"path","required":true,"description":"The maturity's ID, from `GET /v1/markets`.","schema":{"type":"string","pattern":"^0x[0-9a-fA-F]{64}$"},"example":"0x9c1e7f4a0b2d3e5f6a7b8c9d0e1f2a3b4c5d6e7f8091a2b3c4d5e6f708192a3b"},{"name":"chain_id","in":"query","required":true,"description":"The EVM chain ID. `GET /v1/chains` lists the chains served.","schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"example":8453}],"responses":{"200":{"description":"Get a maturity.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Policy":{"$ref":"#/components/headers/X-RateLimit-Policy"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"Cache-Control":{"description":"How long the response may be reused.","schema":{"type":"string","examples":["public, max-age=10, stale-while-revalidate=10"]}},"ETag":{"description":"The response's tag. Send it in `If-None-Match` to get a 304 while the body hasn't changed.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Maturity"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}},"required":["data","meta"]}}}},"304":{"description":"Not modified. The `ETag` sent in `If-None-Match` still matches, so the cached copy is current.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"400":{"description":"`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INVALID_PARAMS":{"summary":"A parameter or the body failed validation. `details.issues` lists each problem.","value":{"error":{"code":"INVALID_PARAMS","category":"validation","treatment":"fix_request","message":"A parameter or the body failed validation. `details.issues` lists each problem.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"UNSUPPORTED_CHAIN":{"summary":"`chain_id` is unknown or not enabled on this API.","value":{"error":{"code":"UNSUPPORTED_CHAIN","category":"validation","treatment":"fix_request","message":"`chain_id` is unknown or not enabled on this API.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"401":{"description":"`UNAUTHENTICATED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"UNAUTHENTICATED":{"summary":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","value":{"error":{"code":"UNAUTHENTICATED","category":"auth","treatment":"fix_request","message":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"404":{"description":"`MATURITY_NOT_FOUND`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"MATURITY_NOT_FOUND":{"summary":"No maturity with this ID on this chain.","value":{"error":{"code":"MATURITY_NOT_FOUND","category":"not_found","treatment":"fix_request","message":"No maturity with this ID on this chain.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"422":{"description":"`MARKET_NOT_SUPPORTED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"MARKET_NOT_SUPPORTED":{"summary":"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.","value":{"error":{"code":"MARKET_NOT_SUPPORTED","category":"state","treatment":"fix_request","message":"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.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"429":{"description":"`RATE_LIMITED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"RATE_LIMITED":{"summary":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","value":{"error":{"code":"RATE_LIMITED","category":"rate_limit","treatment":"retry","message":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"500":{"description":"`INTERNAL`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INTERNAL":{"summary":"Something failed on Tenor's side, and the failure has been reported. Retry.","value":{"error":{"code":"INTERNAL","category":"internal","treatment":"retry","message":"Something failed on Tenor's side, and the failure has been reported. Retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}}},"x-rate-limit-class":"read"}},"/v1/maturities/{maturity_id}/depth":{"get":{"operationId":"getMarketDepth","summary":"Get a maturity's market depth","description":"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.","tags":["Market depth"],"security":[{},{"ApiKey":[]}],"parameters":[{"name":"maturity_id","in":"path","required":true,"description":"The maturity's ID, from `GET /v1/markets`.","schema":{"type":"string","pattern":"^0x[0-9a-fA-F]{64}$"},"example":"0x9c1e7f4a0b2d3e5f6a7b8c9d0e1f2a3b4c5d6e7f8091a2b3c4d5e6f708192a3b"},{"name":"chain_id","in":"query","required":true,"description":"The EVM chain ID. `GET /v1/chains` lists the chains served.","schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"example":8453},{"name":"bucket_bps","in":"query","required":false,"description":"The width of each level, in basis points of rate. `25` groups offers into 0.25% steps.","schema":{"default":"25","type":"string","enum":["5","10","25","100"]}}],"responses":{"200":{"description":"Get a maturity's market depth.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Policy":{"$ref":"#/components/headers/X-RateLimit-Policy"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"Cache-Control":{"description":"How long the response may be reused.","schema":{"type":"string","examples":["public, max-age=2"]}},"ETag":{"description":"The response's tag. Send it in `If-None-Match` to get a 304 while the body hasn't changed.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MarketDepth"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}},"required":["data","meta"]}}}},"304":{"description":"Not modified. The `ETag` sent in `If-None-Match` still matches, so the cached copy is current.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"400":{"description":"`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INVALID_PARAMS":{"summary":"A parameter or the body failed validation. `details.issues` lists each problem.","value":{"error":{"code":"INVALID_PARAMS","category":"validation","treatment":"fix_request","message":"A parameter or the body failed validation. `details.issues` lists each problem.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"UNSUPPORTED_CHAIN":{"summary":"`chain_id` is unknown or not enabled on this API.","value":{"error":{"code":"UNSUPPORTED_CHAIN","category":"validation","treatment":"fix_request","message":"`chain_id` is unknown or not enabled on this API.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"401":{"description":"`UNAUTHENTICATED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"UNAUTHENTICATED":{"summary":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","value":{"error":{"code":"UNAUTHENTICATED","category":"auth","treatment":"fix_request","message":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"404":{"description":"`MATURITY_NOT_FOUND`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"MATURITY_NOT_FOUND":{"summary":"No maturity with this ID on this chain.","value":{"error":{"code":"MATURITY_NOT_FOUND","category":"not_found","treatment":"fix_request","message":"No maturity with this ID on this chain.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"422":{"description":"`MARKET_NOT_SUPPORTED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"MARKET_NOT_SUPPORTED":{"summary":"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.","value":{"error":{"code":"MARKET_NOT_SUPPORTED","category":"state","treatment":"fix_request","message":"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.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"429":{"description":"`RATE_LIMITED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"RATE_LIMITED":{"summary":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","value":{"error":{"code":"RATE_LIMITED","category":"rate_limit","treatment":"retry","message":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"500":{"description":"`INTERNAL`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INTERNAL":{"summary":"Something failed on Tenor's side, and the failure has been reported. Retry.","value":{"error":{"code":"INTERNAL","category":"internal","treatment":"retry","message":"Something failed on Tenor's side, and the failure has been reported. Retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"503":{"description":"`ROUTER_UNAVAILABLE`, `ROUTER_BUSY`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"ROUTER_UNAVAILABLE":{"summary":"Tenor's quote engine is unavailable. Retry shortly.","value":{"error":{"code":"ROUTER_UNAVAILABLE","category":"upstream","treatment":"retry","message":"Tenor's quote engine is unavailable. Retry shortly.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"ROUTER_BUSY":{"summary":"Tenor's quote engine is at capacity. Retry shortly.","value":{"error":{"code":"ROUTER_BUSY","category":"upstream","treatment":"retry","message":"Tenor's quote engine is at capacity. Retry shortly.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}}},"x-rate-limit-class":"read"}},"/v1/maturities/{maturity_id}/takeable-offers":{"get":{"operationId":"listTakeableOffers","summary":"List takeable offers","description":"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.","tags":["Market depth"],"security":[{},{"ApiKey":[]}],"parameters":[{"name":"maturity_id","in":"path","required":true,"description":"The maturity's ID, from `GET /v1/markets`.","schema":{"type":"string","pattern":"^0x[0-9a-fA-F]{64}$"},"example":"0x9c1e7f4a0b2d3e5f6a7b8c9d0e1f2a3b4c5d6e7f8091a2b3c4d5e6f708192a3b"},{"name":"chain_id","in":"query","required":true,"description":"The EVM chain ID. `GET /v1/chains` lists the chains served.","schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"example":8453},{"name":"side","in":"query","required":true,"description":"The side to list. A caller borrows from `lend` offers and lends into `borrow` offers.","schema":{"type":"string","enum":["lend","borrow"]}},{"name":"wallet","in":"query","required":false,"description":"The wallet that would take the offers, as passed to the take prepare. The wallet's own offers are left out, and offers reserved for it are included.","schema":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$"},"example":"0x7A1f00000000000000000000000000000000C0de"},{"name":"wallet_kind","in":"query","required":false,"description":"How the wallet will sign. Only offers that stay takeable for the wallet's signing window are listed, as in its take prepare.","schema":{"type":"string","enum":["eoa","delegated_eoa","safe","smart_account"]}},{"name":"limit","in":"query","required":false,"description":"The number of offers to list, best rate first, up to 50.","schema":{"default":50,"type":"integer","minimum":1,"maximum":50},"example":50}],"responses":{"200":{"description":"List takeable offers.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Policy":{"$ref":"#/components/headers/X-RateLimit-Policy"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/TakeableOffers"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}},"required":["data","meta"]}}}},"400":{"description":"`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INVALID_PARAMS":{"summary":"A parameter or the body failed validation. `details.issues` lists each problem.","value":{"error":{"code":"INVALID_PARAMS","category":"validation","treatment":"fix_request","message":"A parameter or the body failed validation. `details.issues` lists each problem.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"UNSUPPORTED_CHAIN":{"summary":"`chain_id` is unknown or not enabled on this API.","value":{"error":{"code":"UNSUPPORTED_CHAIN","category":"validation","treatment":"fix_request","message":"`chain_id` is unknown or not enabled on this API.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"401":{"description":"`UNAUTHENTICATED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"UNAUTHENTICATED":{"summary":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","value":{"error":{"code":"UNAUTHENTICATED","category":"auth","treatment":"fix_request","message":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"404":{"description":"`MARKET_NOT_FOUND`, `MATURITY_NOT_FOUND`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"MARKET_NOT_FOUND":{"summary":"No market with this ID on this chain.","value":{"error":{"code":"MARKET_NOT_FOUND","category":"not_found","treatment":"fix_request","message":"No market with this ID on this chain.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"MATURITY_NOT_FOUND":{"summary":"No maturity with this ID on this chain.","value":{"error":{"code":"MATURITY_NOT_FOUND","category":"not_found","treatment":"fix_request","message":"No maturity with this ID on this chain.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"422":{"description":"`MARKET_NOT_SUPPORTED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"MARKET_NOT_SUPPORTED":{"summary":"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.","value":{"error":{"code":"MARKET_NOT_SUPPORTED","category":"state","treatment":"fix_request","message":"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.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"429":{"description":"`RATE_LIMITED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"RATE_LIMITED":{"summary":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","value":{"error":{"code":"RATE_LIMITED","category":"rate_limit","treatment":"retry","message":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"500":{"description":"`INTERNAL`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INTERNAL":{"summary":"Something failed on Tenor's side, and the failure has been reported. Retry.","value":{"error":{"code":"INTERNAL","category":"internal","treatment":"retry","message":"Something failed on Tenor's side, and the failure has been reported. Retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"503":{"description":"`ROUTER_UNAVAILABLE`, `ROUTER_BUSY`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"ROUTER_UNAVAILABLE":{"summary":"Tenor's quote engine is unavailable. Retry shortly.","value":{"error":{"code":"ROUTER_UNAVAILABLE","category":"upstream","treatment":"retry","message":"Tenor's quote engine is unavailable. Retry shortly.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"ROUTER_BUSY":{"summary":"Tenor's quote engine is at capacity. Retry shortly.","value":{"error":{"code":"ROUTER_BUSY","category":"upstream","treatment":"retry","message":"Tenor's quote engine is at capacity. Retry shortly.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}}},"x-rate-limit-class":"compute"}},"/v1/migrate/prepare":{"post":{"operationId":"prepareMigrate","summary":"Prepare a migration to a fixed rate","description":"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.\n\nIn `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.\n\nNo API key needed. A key sent must carry the `trade` scope.","tags":["Fixed rate"],"security":[{},{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MigratePrepareRequest"}}}},"responses":{"200":{"description":"Prepare a migration to a fixed rate.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Policy":{"$ref":"#/components/headers/X-RateLimit-Policy"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PreparedPositionMove"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}},"required":["data","meta"]}}}},"400":{"description":"`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `MARKET_MISMATCH`, `RATE_ABOVE_MAX`, `INVALID_BOUNDS`, `DEADLINE_INVALID`, `INVALID_OFFER_INPUT`, `STAIRCASE_INVALID`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INVALID_PARAMS":{"summary":"A parameter or the body failed validation. `details.issues` lists each problem.","value":{"error":{"code":"INVALID_PARAMS","category":"validation","treatment":"fix_request","message":"A parameter or the body failed validation. `details.issues` lists each problem.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"UNSUPPORTED_CHAIN":{"summary":"`chain_id` is unknown or not enabled on this API.","value":{"error":{"code":"UNSUPPORTED_CHAIN","category":"validation","treatment":"fix_request","message":"`chain_id` is unknown or not enabled on this API.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"MARKET_MISMATCH":{"summary":"The maturity doesn't belong to the given market.","value":{"error":{"code":"MARKET_MISMATCH","category":"validation","treatment":"fix_request","message":"The maturity doesn't belong to the given market.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"RATE_ABOVE_MAX":{"summary":"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`.","value":{"error":{"code":"RATE_ABOVE_MAX","category":"validation","treatment":"fix_request","message":"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`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"INVALID_BOUNDS":{"summary":"The limit rate and the size bounds contradict each other.","value":{"error":{"code":"INVALID_BOUNDS","category":"validation","treatment":"fix_request","message":"The limit rate and the size bounds contradict each other.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"DEADLINE_INVALID":{"summary":"The deadline is in the past, too soon, or beyond the wallet type's signing window.","value":{"error":{"code":"DEADLINE_INVALID","category":"validation","treatment":"fix_request","message":"The deadline is in the past, too soon, or beyond the wallet type's signing window.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"INVALID_OFFER_INPUT":{"summary":"Some offer fields are invalid. `details.issues` names them.","value":{"error":{"code":"INVALID_OFFER_INPUT","category":"validation","treatment":"fix_request","message":"Some offer fields are invalid. `details.issues` names them.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"STAIRCASE_INVALID":{"summary":"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`).","value":{"error":{"code":"STAIRCASE_INVALID","category":"validation","treatment":"fix_request","message":"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`).","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"401":{"description":"`UNAUTHENTICATED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"UNAUTHENTICATED":{"summary":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","value":{"error":{"code":"UNAUTHENTICATED","category":"auth","treatment":"fix_request","message":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"403":{"description":"`FORBIDDEN_SCOPE`, `WALLET_BLOCKED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"FORBIDDEN_SCOPE":{"summary":"The API key lacks a scope this route needs.","value":{"error":{"code":"FORBIDDEN_SCOPE","category":"auth","treatment":"fix_request","message":"The API key lacks a scope this route needs.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"WALLET_BLOCKED":{"summary":"The wallet is on a sanctions list that Tenor screens against, so no payload is prepared for it.","value":{"error":{"code":"WALLET_BLOCKED","category":"auth","treatment":"fix_request","message":"The wallet is on a sanctions list that Tenor screens against, so no payload is prepared for it.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"404":{"description":"`MATURITY_NOT_FOUND`, `POSITION_NOT_FOUND`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"MATURITY_NOT_FOUND":{"summary":"No maturity with this ID on this chain.","value":{"error":{"code":"MATURITY_NOT_FOUND","category":"not_found","treatment":"fix_request","message":"No maturity with this ID on this chain.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"POSITION_NOT_FOUND":{"summary":"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`).","value":{"error":{"code":"POSITION_NOT_FOUND","category":"not_found","treatment":"fix_request","message":"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`).","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"413":{"description":"`PAYLOAD_TOO_LARGE`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"PAYLOAD_TOO_LARGE":{"summary":"The request body is larger than 64 KiB.","value":{"error":{"code":"PAYLOAD_TOO_LARGE","category":"validation","treatment":"fix_request","message":"The request body is larger than 64 KiB.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"422":{"description":"`COUNTERPARTY_BLOCKED`, `MARKET_NOT_SUPPORTED`, `MATURITY_MATURED`, `DRY_RUN_UNAVAILABLE`, `NO_OFFERS`, `NO_VALID_OFFERS`, `INSUFFICIENT_LIQUIDITY`, `LIMIT_RATE_NOT_MET`, `SIMULATION_FAILED`, `SLIPPAGE_EXCEEDED`, `SELF_CROSS`, `OPPOSITE_POSITION`, `INVARIANT_VIOLATION`, `INSUFFICIENT_COLLATERAL`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"COUNTERPARTY_BLOCKED":{"summary":"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.","value":{"error":{"code":"COUNTERPARTY_BLOCKED","category":"state","treatment":"fix_request","message":"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_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"MARKET_NOT_SUPPORTED":{"summary":"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.","value":{"error":{"code":"MARKET_NOT_SUPPORTED","category":"state","treatment":"fix_request","message":"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.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"MATURITY_MATURED":{"summary":"The maturity is past `matures_at` and accepts no new lends or borrows. Lenders redeem, and borrowers repay.","value":{"error":{"code":"MATURITY_MATURED","category":"state","treatment":"fix_request","message":"The maturity is past `matures_at` and accepts no new lends or borrows. Lenders redeem, and borrowers repay.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"DRY_RUN_UNAVAILABLE":{"summary":"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`.","value":{"error":{"code":"DRY_RUN_UNAVAILABLE","category":"state","treatment":"fix_request","message":"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`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"NO_OFFERS":{"summary":"There are no open offers on that side.","value":{"error":{"code":"NO_OFFERS","category":"liquidity","treatment":"refetch_state","message":"There are no open offers on that side.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"NO_VALID_OFFERS":{"summary":"No offer on that side can be filled right now.","value":{"error":{"code":"NO_VALID_OFFERS","category":"liquidity","treatment":"refetch_state","message":"No offer on that side can be filled right now.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"INSUFFICIENT_LIQUIDITY":{"summary":"There isn't enough liquidity to fill the full size.","value":{"error":{"code":"INSUFFICIENT_LIQUIDITY","category":"liquidity","treatment":"refetch_state","message":"There isn't enough liquidity to fill the full size.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"LIMIT_RATE_NOT_MET":{"summary":"No fill is possible within the limit rate.","value":{"error":{"code":"LIMIT_RATE_NOT_MET","category":"liquidity","treatment":"refetch_state","message":"No fill is possible within the limit rate.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"SIMULATION_FAILED":{"summary":"The payload reverts in the simulation. `details.revert` has the decoded reason and `details.step` the step that failed.","value":{"error":{"code":"SIMULATION_FAILED","category":"simulation","treatment":"refetch_state","message":"The payload reverts in the simulation. `details.revert` has the decoded reason and `details.step` the step that failed.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"SLIPPAGE_EXCEEDED":{"summary":"The fill would fall outside the request's limit rate or size bounds.","value":{"error":{"code":"SLIPPAGE_EXCEEDED","category":"liquidity","treatment":"refetch_state","message":"The fill would fall outside the request's limit rate or size bounds.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"SELF_CROSS":{"summary":"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.","value":{"error":{"code":"SELF_CROSS","category":"account","treatment":"fix_request","message":"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.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"OPPOSITE_POSITION":{"summary":"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.","value":{"error":{"code":"OPPOSITE_POSITION","category":"account","treatment":"fix_request","message":"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.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"INVARIANT_VIOLATION":{"summary":"The payload failed a safety check, so no calldata is returned.","value":{"error":{"code":"INVARIANT_VIOLATION","category":"simulation","treatment":"fix_request","message":"The payload failed a safety check, so no calldata is returned.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"INSUFFICIENT_COLLATERAL":{"summary":"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.","value":{"error":{"code":"INSUFFICIENT_COLLATERAL","category":"account","treatment":"fund_account","message":"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.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"429":{"description":"`RATE_LIMITED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"RATE_LIMITED":{"summary":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","value":{"error":{"code":"RATE_LIMITED","category":"rate_limit","treatment":"retry","message":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"500":{"description":"`INTERNAL`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INTERNAL":{"summary":"Something failed on Tenor's side, and the failure has been reported. Retry.","value":{"error":{"code":"INTERNAL","category":"internal","treatment":"retry","message":"Something failed on Tenor's side, and the failure has been reported. Retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"503":{"description":"`ROUTER_UNAVAILABLE`, `ROUTER_BUSY`, `RPC_UNAVAILABLE`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"ROUTER_UNAVAILABLE":{"summary":"Tenor's quote engine is unavailable. Retry shortly.","value":{"error":{"code":"ROUTER_UNAVAILABLE","category":"upstream","treatment":"retry","message":"Tenor's quote engine is unavailable. Retry shortly.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"ROUTER_BUSY":{"summary":"Tenor's quote engine is at capacity. Retry shortly.","value":{"error":{"code":"ROUTER_BUSY","category":"upstream","treatment":"retry","message":"Tenor's quote engine is at capacity. Retry shortly.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"RPC_UNAVAILABLE":{"summary":"The chain's RPC is unavailable or degraded. Retry shortly.","value":{"error":{"code":"RPC_UNAVAILABLE","category":"upstream","treatment":"retry","message":"The chain's RPC is unavailable or degraded. Retry shortly.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}}},"x-rate-limit-class":"prepare"}},"/v1/offers":{"get":{"operationId":"listOffers","summary":"List a maker's offers","description":"Lists a wallet's offers on one chain, with their live status. Sorted by maturity, earliest first.\n\nA 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.","tags":["Offers"],"security":[{},{"ApiKey":[]}],"parameters":[{"name":"chain_id","in":"query","required":true,"description":"The EVM chain ID. `GET /v1/chains` lists the chains served.","schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"example":8453},{"name":"maker","in":"query","required":true,"description":"The wallet whose offers to list (case-insensitive).","schema":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$"},"example":"0x7A1f00000000000000000000000000000000C0de"},{"name":"maturity_id","in":"query","required":false,"description":"Only offers on this maturity.","schema":{"type":"string","pattern":"^0x[0-9a-fA-F]{64}$"},"example":"0x9c1e7f4a0b2d3e5f6a7b8c9d0e1f2a3b4c5d6e7f8091a2b3c4d5e6f708192a3b"},{"name":"side","in":"query","required":false,"description":"Only `lend` offers (the maker lends) or `borrow` offers (the maker borrows).","schema":{"type":"string","enum":["lend","borrow"]}},{"name":"status","in":"query","required":false,"description":"Only offers in this status. Tenor's records drop a `filled` or `cancelled` offer a few minutes after it ends, so these match only until then. Past fills are in `GET /v1/accounts/{wallet}/fills`. A page can come back short when filtered; page until `next_cursor` is `null`.","schema":{"type":"string","enum":["open","partially_filled","scheduled","invalid","filled","cancelled"]}},{"name":"cursor","in":"query","required":false,"description":"The previous page's `meta.next_cursor`, to get the next page. Leave `cursor` out for the first page.","schema":{"type":"string","minLength":1,"maxLength":512},"example":"eyJtIjoxNzk1MTkwNDAwLCJrIjoiMHg5YyJ9"},{"name":"limit","in":"query","required":false,"description":"The most items per page, up to 200.","schema":{"default":50,"type":"integer","minimum":1,"maximum":200},"example":50}],"responses":{"200":{"description":"List a maker's offers.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Policy":{"$ref":"#/components/headers/X-RateLimit-Policy"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Offer"},"description":"Earliest maturity first. A staircase is one entry, at the rate the maker set."},"meta":{"$ref":"#/components/schemas/ResponseMeta"}},"required":["data","meta"]}}}},"400":{"description":"`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INVALID_PARAMS":{"summary":"A parameter or the body failed validation. `details.issues` lists each problem.","value":{"error":{"code":"INVALID_PARAMS","category":"validation","treatment":"fix_request","message":"A parameter or the body failed validation. `details.issues` lists each problem.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"UNSUPPORTED_CHAIN":{"summary":"`chain_id` is unknown or not enabled on this API.","value":{"error":{"code":"UNSUPPORTED_CHAIN","category":"validation","treatment":"fix_request","message":"`chain_id` is unknown or not enabled on this API.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"401":{"description":"`UNAUTHENTICATED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"UNAUTHENTICATED":{"summary":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","value":{"error":{"code":"UNAUTHENTICATED","category":"auth","treatment":"fix_request","message":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"429":{"description":"`RATE_LIMITED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"RATE_LIMITED":{"summary":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","value":{"error":{"code":"RATE_LIMITED","category":"rate_limit","treatment":"retry","message":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"500":{"description":"`INTERNAL`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INTERNAL":{"summary":"Something failed on Tenor's side, and the failure has been reported. Retry.","value":{"error":{"code":"INTERNAL","category":"internal","treatment":"retry","message":"Something failed on Tenor's side, and the failure has been reported. Retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"503":{"description":"`ROUTER_UNAVAILABLE`, `ROUTER_BUSY`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"ROUTER_UNAVAILABLE":{"summary":"Tenor's quote engine is unavailable. Retry shortly.","value":{"error":{"code":"ROUTER_UNAVAILABLE","category":"upstream","treatment":"retry","message":"Tenor's quote engine is unavailable. Retry shortly.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"ROUTER_BUSY":{"summary":"Tenor's quote engine is at capacity. Retry shortly.","value":{"error":{"code":"ROUTER_BUSY","category":"upstream","treatment":"retry","message":"Tenor's quote engine is at capacity. Retry shortly.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}}},"x-rate-limit-class":"read"}},"/v1/offers/cancel/prepare":{"post":{"operationId":"prepareCancelOffers","summary":"Prepare to cancel offers","description":"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.\n\nWhen 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.\n\nNo API key needed. A key sent must carry the `trade` scope.","tags":["Offers"],"security":[{},{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelOffersRequest"}}}},"responses":{"200":{"description":"Prepare to cancel offers.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Policy":{"$ref":"#/components/headers/X-RateLimit-Policy"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PreparedCancel"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}},"required":["data","meta"]}}}},"400":{"description":"`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `OFFER_MAKER_MISMATCH`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INVALID_PARAMS":{"summary":"A parameter or the body failed validation. `details.issues` lists each problem.","value":{"error":{"code":"INVALID_PARAMS","category":"validation","treatment":"fix_request","message":"A parameter or the body failed validation. `details.issues` lists each problem.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"UNSUPPORTED_CHAIN":{"summary":"`chain_id` is unknown or not enabled on this API.","value":{"error":{"code":"UNSUPPORTED_CHAIN","category":"validation","treatment":"fix_request","message":"`chain_id` is unknown or not enabled on this API.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"OFFER_MAKER_MISMATCH":{"summary":"The offer's maker isn't the wallet in the request.","value":{"error":{"code":"OFFER_MAKER_MISMATCH","category":"validation","treatment":"fix_request","message":"The offer's maker isn't the wallet in the request.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"401":{"description":"`UNAUTHENTICATED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"UNAUTHENTICATED":{"summary":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","value":{"error":{"code":"UNAUTHENTICATED","category":"auth","treatment":"fix_request","message":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"403":{"description":"`FORBIDDEN_SCOPE`, `WALLET_BLOCKED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"FORBIDDEN_SCOPE":{"summary":"The API key lacks a scope this route needs.","value":{"error":{"code":"FORBIDDEN_SCOPE","category":"auth","treatment":"fix_request","message":"The API key lacks a scope this route needs.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"WALLET_BLOCKED":{"summary":"The wallet is on a sanctions list that Tenor screens against, so no payload is prepared for it.","value":{"error":{"code":"WALLET_BLOCKED","category":"auth","treatment":"fix_request","message":"The wallet is on a sanctions list that Tenor screens against, so no payload is prepared for it.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"409":{"description":"`OFFER_STATE_CHANGED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"OFFER_STATE_CHANGED":{"summary":"The offer can no longer be taken, and `details.reason` gives the cause. Read the open offers again.","value":{"error":{"code":"OFFER_STATE_CHANGED","category":"state","treatment":"refetch_state","message":"The offer can no longer be taken, and `details.reason` gives the cause. Read the open offers again.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"413":{"description":"`PAYLOAD_TOO_LARGE`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"PAYLOAD_TOO_LARGE":{"summary":"The request body is larger than 64 KiB.","value":{"error":{"code":"PAYLOAD_TOO_LARGE","category":"validation","treatment":"fix_request","message":"The request body is larger than 64 KiB.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"422":{"description":"`NOTHING_TO_CANCEL`, `DRY_RUN_UNAVAILABLE`, `SIMULATION_FAILED`, `INVARIANT_VIOLATION`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"NOTHING_TO_CANCEL":{"summary":"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.","value":{"error":{"code":"NOTHING_TO_CANCEL","category":"state","treatment":"refetch_state","message":"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.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"DRY_RUN_UNAVAILABLE":{"summary":"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`.","value":{"error":{"code":"DRY_RUN_UNAVAILABLE","category":"state","treatment":"fix_request","message":"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`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"SIMULATION_FAILED":{"summary":"The payload reverts in the simulation. `details.revert` has the decoded reason and `details.step` the step that failed.","value":{"error":{"code":"SIMULATION_FAILED","category":"simulation","treatment":"refetch_state","message":"The payload reverts in the simulation. `details.revert` has the decoded reason and `details.step` the step that failed.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"INVARIANT_VIOLATION":{"summary":"The payload failed a safety check, so no calldata is returned.","value":{"error":{"code":"INVARIANT_VIOLATION","category":"simulation","treatment":"fix_request","message":"The payload failed a safety check, so no calldata is returned.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"429":{"description":"`RATE_LIMITED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"RATE_LIMITED":{"summary":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","value":{"error":{"code":"RATE_LIMITED","category":"rate_limit","treatment":"retry","message":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"500":{"description":"`INTERNAL`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INTERNAL":{"summary":"Something failed on Tenor's side, and the failure has been reported. Retry.","value":{"error":{"code":"INTERNAL","category":"internal","treatment":"retry","message":"Something failed on Tenor's side, and the failure has been reported. Retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"503":{"description":"`RPC_UNAVAILABLE`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"RPC_UNAVAILABLE":{"summary":"The chain's RPC is unavailable or degraded. Retry shortly.","value":{"error":{"code":"RPC_UNAVAILABLE","category":"upstream","treatment":"retry","message":"The chain's RPC is unavailable or degraded. Retry shortly.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}}},"x-rate-limit-class":"cancel"}},"/v1/offers/post/prepare":{"post":{"operationId":"prepareOffers","summary":"Prepare to post offers","description":"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.\n\nA 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.\n\nNo API key needed. A key sent must carry the `trade` scope.","tags":["Offers"],"security":[{},{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostOffersRequest"}}}},"responses":{"200":{"description":"Prepare to post offers.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Policy":{"$ref":"#/components/headers/X-RateLimit-Policy"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PreparedPost"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}},"required":["data","meta"]}}}},"400":{"description":"`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `INVALID_OFFER_INPUT`, `RATE_ABOVE_MAX`, `MARKET_MISMATCH`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INVALID_PARAMS":{"summary":"A parameter or the body failed validation. `details.issues` lists each problem.","value":{"error":{"code":"INVALID_PARAMS","category":"validation","treatment":"fix_request","message":"A parameter or the body failed validation. `details.issues` lists each problem.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"UNSUPPORTED_CHAIN":{"summary":"`chain_id` is unknown or not enabled on this API.","value":{"error":{"code":"UNSUPPORTED_CHAIN","category":"validation","treatment":"fix_request","message":"`chain_id` is unknown or not enabled on this API.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"INVALID_OFFER_INPUT":{"summary":"Some offer fields are invalid. `details.issues` names them.","value":{"error":{"code":"INVALID_OFFER_INPUT","category":"validation","treatment":"fix_request","message":"Some offer fields are invalid. `details.issues` names them.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"RATE_ABOVE_MAX":{"summary":"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`.","value":{"error":{"code":"RATE_ABOVE_MAX","category":"validation","treatment":"fix_request","message":"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`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"MARKET_MISMATCH":{"summary":"The maturity doesn't belong to the given market.","value":{"error":{"code":"MARKET_MISMATCH","category":"validation","treatment":"fix_request","message":"The maturity doesn't belong to the given market.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"401":{"description":"`UNAUTHENTICATED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"UNAUTHENTICATED":{"summary":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","value":{"error":{"code":"UNAUTHENTICATED","category":"auth","treatment":"fix_request","message":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"403":{"description":"`FORBIDDEN_SCOPE`, `WALLET_BLOCKED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"FORBIDDEN_SCOPE":{"summary":"The API key lacks a scope this route needs.","value":{"error":{"code":"FORBIDDEN_SCOPE","category":"auth","treatment":"fix_request","message":"The API key lacks a scope this route needs.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"WALLET_BLOCKED":{"summary":"The wallet is on a sanctions list that Tenor screens against, so no payload is prepared for it.","value":{"error":{"code":"WALLET_BLOCKED","category":"auth","treatment":"fix_request","message":"The wallet is on a sanctions list that Tenor screens against, so no payload is prepared for it.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"404":{"description":"`MATURITY_NOT_FOUND`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"MATURITY_NOT_FOUND":{"summary":"No maturity with this ID on this chain.","value":{"error":{"code":"MATURITY_NOT_FOUND","category":"not_found","treatment":"fix_request","message":"No maturity with this ID on this chain.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"413":{"description":"`PAYLOAD_TOO_LARGE`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"PAYLOAD_TOO_LARGE":{"summary":"The request body is larger than 64 KiB.","value":{"error":{"code":"PAYLOAD_TOO_LARGE","category":"validation","treatment":"fix_request","message":"The request body is larger than 64 KiB.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"422":{"description":"`MARKET_NOT_SUPPORTED`, `MATURITY_MATURED`, `DRY_RUN_UNAVAILABLE`, `IDLE_CAPITAL_UNAVAILABLE`, `SELF_CROSS`, `INSUFFICIENT_BALANCE`, `SIMULATION_FAILED`, `INVARIANT_VIOLATION`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"MARKET_NOT_SUPPORTED":{"summary":"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.","value":{"error":{"code":"MARKET_NOT_SUPPORTED","category":"state","treatment":"fix_request","message":"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.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"MATURITY_MATURED":{"summary":"The maturity is past `matures_at` and accepts no new lends or borrows. Lenders redeem, and borrowers repay.","value":{"error":{"code":"MATURITY_MATURED","category":"state","treatment":"fix_request","message":"The maturity is past `matures_at` and accepts no new lends or borrows. Lenders redeem, and borrowers repay.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"DRY_RUN_UNAVAILABLE":{"summary":"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`.","value":{"error":{"code":"DRY_RUN_UNAVAILABLE","category":"state","treatment":"fix_request","message":"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`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"IDLE_CAPITAL_UNAVAILABLE":{"summary":"The market has no lending vault for idle capital to earn the variable rate in. Post or lend without `idle_capital`.","value":{"error":{"code":"IDLE_CAPITAL_UNAVAILABLE","category":"state","treatment":"fix_request","message":"The market has no lending vault for idle capital to earn the variable rate in. Post or lend without `idle_capital`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"SELF_CROSS":{"summary":"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.","value":{"error":{"code":"SELF_CROSS","category":"account","treatment":"fix_request","message":"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.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"INSUFFICIENT_BALANCE":{"summary":"The wallet doesn't hold the tokens this action needs.","value":{"error":{"code":"INSUFFICIENT_BALANCE","category":"account","treatment":"fund_account","message":"The wallet doesn't hold the tokens this action needs.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"SIMULATION_FAILED":{"summary":"The payload reverts in the simulation. `details.revert` has the decoded reason and `details.step` the step that failed.","value":{"error":{"code":"SIMULATION_FAILED","category":"simulation","treatment":"refetch_state","message":"The payload reverts in the simulation. `details.revert` has the decoded reason and `details.step` the step that failed.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"INVARIANT_VIOLATION":{"summary":"The payload failed a safety check, so no calldata is returned.","value":{"error":{"code":"INVARIANT_VIOLATION","category":"simulation","treatment":"fix_request","message":"The payload failed a safety check, so no calldata is returned.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"429":{"description":"`RATE_LIMITED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"RATE_LIMITED":{"summary":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","value":{"error":{"code":"RATE_LIMITED","category":"rate_limit","treatment":"retry","message":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"500":{"description":"`INTERNAL`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INTERNAL":{"summary":"Something failed on Tenor's side, and the failure has been reported. Retry.","value":{"error":{"code":"INTERNAL","category":"internal","treatment":"retry","message":"Something failed on Tenor's side, and the failure has been reported. Retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"503":{"description":"`RPC_UNAVAILABLE`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"RPC_UNAVAILABLE":{"summary":"The chain's RPC is unavailable or degraded. Retry shortly.","value":{"error":{"code":"RPC_UNAVAILABLE","category":"upstream","treatment":"retry","message":"The chain's RPC is unavailable or degraded. Retry shortly.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}}},"x-rate-limit-class":"prepare"}},"/v1/offers/{offer_id}":{"get":{"operationId":"getOffer","summary":"Get an offer","description":"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`).\n\nAn offer that filled, was cancelled or expired returns a 404 shortly after.","tags":["Offers"],"security":[{},{"ApiKey":[]}],"parameters":[{"name":"offer_id","in":"path","required":true,"description":"An `offer_id` from `GET /v1/offers`, the takeable offers list or a quote's `route`.","schema":{"type":"string","minLength":1,"maxLength":256},"example":"0f0e5c4e-6a8b-4a61-9a43-1c2d3e4f5a6b"},{"name":"chain_id","in":"query","required":true,"description":"The EVM chain ID. `GET /v1/chains` lists the chains served.","schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"example":8453}],"responses":{"200":{"description":"Get an offer.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Policy":{"$ref":"#/components/headers/X-RateLimit-Policy"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Offer"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}},"required":["data","meta"]}}}},"400":{"description":"`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INVALID_PARAMS":{"summary":"A parameter or the body failed validation. `details.issues` lists each problem.","value":{"error":{"code":"INVALID_PARAMS","category":"validation","treatment":"fix_request","message":"A parameter or the body failed validation. `details.issues` lists each problem.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"UNSUPPORTED_CHAIN":{"summary":"`chain_id` is unknown or not enabled on this API.","value":{"error":{"code":"UNSUPPORTED_CHAIN","category":"validation","treatment":"fix_request","message":"`chain_id` is unknown or not enabled on this API.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"401":{"description":"`UNAUTHENTICATED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"UNAUTHENTICATED":{"summary":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","value":{"error":{"code":"UNAUTHENTICATED","category":"auth","treatment":"fix_request","message":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"404":{"description":"`OFFER_NOT_FOUND`, `MATURITY_NOT_FOUND`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"OFFER_NOT_FOUND":{"summary":"No offer with this ID on this chain.","value":{"error":{"code":"OFFER_NOT_FOUND","category":"not_found","treatment":"fix_request","message":"No offer with this ID on this chain.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"MATURITY_NOT_FOUND":{"summary":"No maturity with this ID on this chain.","value":{"error":{"code":"MATURITY_NOT_FOUND","category":"not_found","treatment":"fix_request","message":"No maturity with this ID on this chain.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"422":{"description":"`MARKET_NOT_SUPPORTED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"MARKET_NOT_SUPPORTED":{"summary":"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.","value":{"error":{"code":"MARKET_NOT_SUPPORTED","category":"state","treatment":"fix_request","message":"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.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"429":{"description":"`RATE_LIMITED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"RATE_LIMITED":{"summary":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","value":{"error":{"code":"RATE_LIMITED","category":"rate_limit","treatment":"retry","message":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"500":{"description":"`INTERNAL`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INTERNAL":{"summary":"Something failed on Tenor's side, and the failure has been reported. Retry.","value":{"error":{"code":"INTERNAL","category":"internal","treatment":"retry","message":"Something failed on Tenor's side, and the failure has been reported. Retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"503":{"description":"`ROUTER_UNAVAILABLE`, `ROUTER_BUSY`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"ROUTER_UNAVAILABLE":{"summary":"Tenor's quote engine is unavailable. Retry shortly.","value":{"error":{"code":"ROUTER_UNAVAILABLE","category":"upstream","treatment":"retry","message":"Tenor's quote engine is unavailable. Retry shortly.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"ROUTER_BUSY":{"summary":"Tenor's quote engine is at capacity. Retry shortly.","value":{"error":{"code":"ROUTER_BUSY","category":"upstream","treatment":"retry","message":"Tenor's quote engine is at capacity. Retry shortly.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}}},"x-rate-limit-class":"read"}},"/v1/openapi.json":{"get":{"operationId":"getOpenApi","summary":"Get the OpenAPI document","description":"Returns the OpenAPI 3.1 document, the source of truth for this API. Generate clients and tools from this document.","tags":["Service"],"security":[{},{"ApiKey":[]}],"responses":{"200":{"description":"Get the OpenAPI document.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Policy":{"$ref":"#/components/headers/X-RateLimit-Policy"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiDocument"}}}},"401":{"description":"`UNAUTHENTICATED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"UNAUTHENTICATED":{"summary":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","value":{"error":{"code":"UNAUTHENTICATED","category":"auth","treatment":"fix_request","message":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"429":{"description":"`RATE_LIMITED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"RATE_LIMITED":{"summary":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","value":{"error":{"code":"RATE_LIMITED","category":"rate_limit","treatment":"retry","message":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"500":{"description":"`INTERNAL`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INTERNAL":{"summary":"Something failed on Tenor's side, and the failure has been reported. Retry.","value":{"error":{"code":"INTERNAL","category":"internal","treatment":"retry","message":"Something failed on Tenor's side, and the failure has been reported. Retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}}},"x-rate-limit-class":"read"}},"/v1/quotes":{"post":{"operationId":"getQuote","summary":"Get a quote","description":"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.","tags":["Quotes"],"security":[{},{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuoteRequest"}}}},"responses":{"200":{"description":"Get a quote.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Policy":{"$ref":"#/components/headers/X-RateLimit-Policy"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Quote"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}},"required":["data","meta"]}}}},"400":{"description":"`INVALID_PARAMS`, `RATE_ABOVE_MAX`, `UNSUPPORTED_CHAIN`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INVALID_PARAMS":{"summary":"A parameter or the body failed validation. `details.issues` lists each problem.","value":{"error":{"code":"INVALID_PARAMS","category":"validation","treatment":"fix_request","message":"A parameter or the body failed validation. `details.issues` lists each problem.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"RATE_ABOVE_MAX":{"summary":"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`.","value":{"error":{"code":"RATE_ABOVE_MAX","category":"validation","treatment":"fix_request","message":"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`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"UNSUPPORTED_CHAIN":{"summary":"`chain_id` is unknown or not enabled on this API.","value":{"error":{"code":"UNSUPPORTED_CHAIN","category":"validation","treatment":"fix_request","message":"`chain_id` is unknown or not enabled on this API.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"401":{"description":"`UNAUTHENTICATED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"UNAUTHENTICATED":{"summary":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","value":{"error":{"code":"UNAUTHENTICATED","category":"auth","treatment":"fix_request","message":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"404":{"description":"`MATURITY_NOT_FOUND`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"MATURITY_NOT_FOUND":{"summary":"No maturity with this ID on this chain.","value":{"error":{"code":"MATURITY_NOT_FOUND","category":"not_found","treatment":"fix_request","message":"No maturity with this ID on this chain.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"413":{"description":"`PAYLOAD_TOO_LARGE`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"PAYLOAD_TOO_LARGE":{"summary":"The request body is larger than 64 KiB.","value":{"error":{"code":"PAYLOAD_TOO_LARGE","category":"validation","treatment":"fix_request","message":"The request body is larger than 64 KiB.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"422":{"description":"`MARKET_NOT_SUPPORTED`, `MATURITY_MATURED`, `NO_OFFERS`, `NO_VALID_OFFERS`, `INSUFFICIENT_LIQUIDITY`, `LIMIT_RATE_NOT_MET`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"MARKET_NOT_SUPPORTED":{"summary":"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.","value":{"error":{"code":"MARKET_NOT_SUPPORTED","category":"state","treatment":"fix_request","message":"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.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"MATURITY_MATURED":{"summary":"The maturity is past `matures_at` and accepts no new lends or borrows. Lenders redeem, and borrowers repay.","value":{"error":{"code":"MATURITY_MATURED","category":"state","treatment":"fix_request","message":"The maturity is past `matures_at` and accepts no new lends or borrows. Lenders redeem, and borrowers repay.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"NO_OFFERS":{"summary":"There are no open offers on that side.","value":{"error":{"code":"NO_OFFERS","category":"liquidity","treatment":"refetch_state","message":"There are no open offers on that side.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"NO_VALID_OFFERS":{"summary":"No offer on that side can be filled right now.","value":{"error":{"code":"NO_VALID_OFFERS","category":"liquidity","treatment":"refetch_state","message":"No offer on that side can be filled right now.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"INSUFFICIENT_LIQUIDITY":{"summary":"There isn't enough liquidity to fill the full size.","value":{"error":{"code":"INSUFFICIENT_LIQUIDITY","category":"liquidity","treatment":"refetch_state","message":"There isn't enough liquidity to fill the full size.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"LIMIT_RATE_NOT_MET":{"summary":"No fill is possible within the limit rate.","value":{"error":{"code":"LIMIT_RATE_NOT_MET","category":"liquidity","treatment":"refetch_state","message":"No fill is possible within the limit rate.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"429":{"description":"`RATE_LIMITED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"RATE_LIMITED":{"summary":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","value":{"error":{"code":"RATE_LIMITED","category":"rate_limit","treatment":"retry","message":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"500":{"description":"`INTERNAL`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INTERNAL":{"summary":"Something failed on Tenor's side, and the failure has been reported. Retry.","value":{"error":{"code":"INTERNAL","category":"internal","treatment":"retry","message":"Something failed on Tenor's side, and the failure has been reported. Retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"503":{"description":"`ROUTER_UNAVAILABLE`, `ROUTER_BUSY`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"ROUTER_UNAVAILABLE":{"summary":"Tenor's quote engine is unavailable. Retry shortly.","value":{"error":{"code":"ROUTER_UNAVAILABLE","category":"upstream","treatment":"retry","message":"Tenor's quote engine is unavailable. Retry shortly.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"ROUTER_BUSY":{"summary":"Tenor's quote engine is at capacity. Retry shortly.","value":{"error":{"code":"ROUTER_BUSY","category":"upstream","treatment":"retry","message":"Tenor's quote engine is at capacity. Retry shortly.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}}},"x-rate-limit-class":"compute"}},"/v1/quotes/term-structure":{"post":{"operationId":"getQuoteTermStructure","summary":"Get quotes across maturities","description":"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.","tags":["Quotes"],"security":[{},{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TermStructureQuoteRequest"}}}},"responses":{"200":{"description":"Get quotes across maturities.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Policy":{"$ref":"#/components/headers/X-RateLimit-Policy"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/TermStructureQuote"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}},"required":["data","meta"]}}}},"400":{"description":"`INVALID_PARAMS`, `RATE_ABOVE_MAX`, `UNSUPPORTED_CHAIN`, `MARKET_MISMATCH`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INVALID_PARAMS":{"summary":"A parameter or the body failed validation. `details.issues` lists each problem.","value":{"error":{"code":"INVALID_PARAMS","category":"validation","treatment":"fix_request","message":"A parameter or the body failed validation. `details.issues` lists each problem.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"RATE_ABOVE_MAX":{"summary":"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`.","value":{"error":{"code":"RATE_ABOVE_MAX","category":"validation","treatment":"fix_request","message":"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`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"UNSUPPORTED_CHAIN":{"summary":"`chain_id` is unknown or not enabled on this API.","value":{"error":{"code":"UNSUPPORTED_CHAIN","category":"validation","treatment":"fix_request","message":"`chain_id` is unknown or not enabled on this API.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"MARKET_MISMATCH":{"summary":"The maturity doesn't belong to the given market.","value":{"error":{"code":"MARKET_MISMATCH","category":"validation","treatment":"fix_request","message":"The maturity doesn't belong to the given market.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"401":{"description":"`UNAUTHENTICATED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"UNAUTHENTICATED":{"summary":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","value":{"error":{"code":"UNAUTHENTICATED","category":"auth","treatment":"fix_request","message":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"404":{"description":"`MARKET_NOT_FOUND`, `MATURITY_NOT_FOUND`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"MARKET_NOT_FOUND":{"summary":"No market with this ID on this chain.","value":{"error":{"code":"MARKET_NOT_FOUND","category":"not_found","treatment":"fix_request","message":"No market with this ID on this chain.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"MATURITY_NOT_FOUND":{"summary":"No maturity with this ID on this chain.","value":{"error":{"code":"MATURITY_NOT_FOUND","category":"not_found","treatment":"fix_request","message":"No maturity with this ID on this chain.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"413":{"description":"`PAYLOAD_TOO_LARGE`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"PAYLOAD_TOO_LARGE":{"summary":"The request body is larger than 64 KiB.","value":{"error":{"code":"PAYLOAD_TOO_LARGE","category":"validation","treatment":"fix_request","message":"The request body is larger than 64 KiB.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"422":{"description":"`MARKET_NOT_SUPPORTED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"MARKET_NOT_SUPPORTED":{"summary":"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.","value":{"error":{"code":"MARKET_NOT_SUPPORTED","category":"state","treatment":"fix_request","message":"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.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"429":{"description":"`RATE_LIMITED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"RATE_LIMITED":{"summary":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","value":{"error":{"code":"RATE_LIMITED","category":"rate_limit","treatment":"retry","message":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"500":{"description":"`INTERNAL`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INTERNAL":{"summary":"Something failed on Tenor's side, and the failure has been reported. Retry.","value":{"error":{"code":"INTERNAL","category":"internal","treatment":"retry","message":"Something failed on Tenor's side, and the failure has been reported. Retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"503":{"description":"`ROUTER_UNAVAILABLE`, `ROUTER_BUSY`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"ROUTER_UNAVAILABLE":{"summary":"Tenor's quote engine is unavailable. Retry shortly.","value":{"error":{"code":"ROUTER_UNAVAILABLE","category":"upstream","treatment":"retry","message":"Tenor's quote engine is unavailable. Retry shortly.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"ROUTER_BUSY":{"summary":"Tenor's quote engine is at capacity. Retry shortly.","value":{"error":{"code":"ROUTER_BUSY","category":"upstream","treatment":"retry","message":"Tenor's quote engine is at capacity. Retry shortly.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}}},"x-rate-limit-class":"compute"}},"/v1/redeem/prepare":{"post":{"operationId":"prepareRedeem","summary":"Prepare a redeem","description":"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.\n\nNo API key needed. A key sent must carry the `trade` scope.","tags":["Fixed rate"],"security":[{},{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RedeemPrepareRequest"}}}},"responses":{"200":{"description":"Prepare a redeem.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Policy":{"$ref":"#/components/headers/X-RateLimit-Policy"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Prepared"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}},"required":["data","meta"]}}}},"400":{"description":"`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `MARKET_MISMATCH`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INVALID_PARAMS":{"summary":"A parameter or the body failed validation. `details.issues` lists each problem.","value":{"error":{"code":"INVALID_PARAMS","category":"validation","treatment":"fix_request","message":"A parameter or the body failed validation. `details.issues` lists each problem.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"UNSUPPORTED_CHAIN":{"summary":"`chain_id` is unknown or not enabled on this API.","value":{"error":{"code":"UNSUPPORTED_CHAIN","category":"validation","treatment":"fix_request","message":"`chain_id` is unknown or not enabled on this API.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"MARKET_MISMATCH":{"summary":"The maturity doesn't belong to the given market.","value":{"error":{"code":"MARKET_MISMATCH","category":"validation","treatment":"fix_request","message":"The maturity doesn't belong to the given market.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"401":{"description":"`UNAUTHENTICATED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"UNAUTHENTICATED":{"summary":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","value":{"error":{"code":"UNAUTHENTICATED","category":"auth","treatment":"fix_request","message":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"403":{"description":"`FORBIDDEN_SCOPE`, `WALLET_BLOCKED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"FORBIDDEN_SCOPE":{"summary":"The API key lacks a scope this route needs.","value":{"error":{"code":"FORBIDDEN_SCOPE","category":"auth","treatment":"fix_request","message":"The API key lacks a scope this route needs.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"WALLET_BLOCKED":{"summary":"The wallet is on a sanctions list that Tenor screens against, so no payload is prepared for it.","value":{"error":{"code":"WALLET_BLOCKED","category":"auth","treatment":"fix_request","message":"The wallet is on a sanctions list that Tenor screens against, so no payload is prepared for it.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"404":{"description":"`MATURITY_NOT_FOUND`, `POSITION_NOT_FOUND`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"MATURITY_NOT_FOUND":{"summary":"No maturity with this ID on this chain.","value":{"error":{"code":"MATURITY_NOT_FOUND","category":"not_found","treatment":"fix_request","message":"No maturity with this ID on this chain.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"POSITION_NOT_FOUND":{"summary":"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`).","value":{"error":{"code":"POSITION_NOT_FOUND","category":"not_found","treatment":"fix_request","message":"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`).","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"413":{"description":"`PAYLOAD_TOO_LARGE`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"PAYLOAD_TOO_LARGE":{"summary":"The request body is larger than 64 KiB.","value":{"error":{"code":"PAYLOAD_TOO_LARGE","category":"validation","treatment":"fix_request","message":"The request body is larger than 64 KiB.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"422":{"description":"`MARKET_NOT_SUPPORTED`, `DRY_RUN_UNAVAILABLE`, `EXCEEDS_POSITION`, `INSUFFICIENT_LIQUIDITY`, `SIMULATION_FAILED`, `INVARIANT_VIOLATION`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"MARKET_NOT_SUPPORTED":{"summary":"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.","value":{"error":{"code":"MARKET_NOT_SUPPORTED","category":"state","treatment":"fix_request","message":"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.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"DRY_RUN_UNAVAILABLE":{"summary":"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`.","value":{"error":{"code":"DRY_RUN_UNAVAILABLE","category":"state","treatment":"fix_request","message":"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`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"EXCEEDS_POSITION":{"summary":"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.","value":{"error":{"code":"EXCEEDS_POSITION","category":"account","treatment":"fix_request","message":"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.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"INSUFFICIENT_LIQUIDITY":{"summary":"There isn't enough liquidity to fill the full size.","value":{"error":{"code":"INSUFFICIENT_LIQUIDITY","category":"liquidity","treatment":"refetch_state","message":"There isn't enough liquidity to fill the full size.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"SIMULATION_FAILED":{"summary":"The payload reverts in the simulation. `details.revert` has the decoded reason and `details.step` the step that failed.","value":{"error":{"code":"SIMULATION_FAILED","category":"simulation","treatment":"refetch_state","message":"The payload reverts in the simulation. `details.revert` has the decoded reason and `details.step` the step that failed.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"INVARIANT_VIOLATION":{"summary":"The payload failed a safety check, so no calldata is returned.","value":{"error":{"code":"INVARIANT_VIOLATION","category":"simulation","treatment":"fix_request","message":"The payload failed a safety check, so no calldata is returned.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"429":{"description":"`RATE_LIMITED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"RATE_LIMITED":{"summary":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","value":{"error":{"code":"RATE_LIMITED","category":"rate_limit","treatment":"retry","message":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"500":{"description":"`INTERNAL`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INTERNAL":{"summary":"Something failed on Tenor's side, and the failure has been reported. Retry.","value":{"error":{"code":"INTERNAL","category":"internal","treatment":"retry","message":"Something failed on Tenor's side, and the failure has been reported. Retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"503":{"description":"`RPC_UNAVAILABLE`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"RPC_UNAVAILABLE":{"summary":"The chain's RPC is unavailable or degraded. Retry shortly.","value":{"error":{"code":"RPC_UNAVAILABLE","category":"upstream","treatment":"retry","message":"The chain's RPC is unavailable or degraded. Retry shortly.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}}},"x-rate-limit-class":"prepare"}},"/v1/renew/prepare":{"post":{"operationId":"prepareRenew","summary":"Prepare a renewal","description":"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.\n\nIn `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.\n\n`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`.\n\nNo API key needed. A key sent must carry the `trade` scope.","tags":["Fixed rate"],"security":[{},{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RenewPrepareRequest"}}}},"responses":{"200":{"description":"Prepare a renewal.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Policy":{"$ref":"#/components/headers/X-RateLimit-Policy"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PreparedPositionMove"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}},"required":["data","meta"]}}}},"400":{"description":"`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `MARKET_MISMATCH`, `RATE_ABOVE_MAX`, `INVALID_BOUNDS`, `DEADLINE_INVALID`, `INVALID_OFFER_INPUT`, `STAIRCASE_INVALID`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INVALID_PARAMS":{"summary":"A parameter or the body failed validation. `details.issues` lists each problem.","value":{"error":{"code":"INVALID_PARAMS","category":"validation","treatment":"fix_request","message":"A parameter or the body failed validation. `details.issues` lists each problem.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"UNSUPPORTED_CHAIN":{"summary":"`chain_id` is unknown or not enabled on this API.","value":{"error":{"code":"UNSUPPORTED_CHAIN","category":"validation","treatment":"fix_request","message":"`chain_id` is unknown or not enabled on this API.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"MARKET_MISMATCH":{"summary":"The maturity doesn't belong to the given market.","value":{"error":{"code":"MARKET_MISMATCH","category":"validation","treatment":"fix_request","message":"The maturity doesn't belong to the given market.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"RATE_ABOVE_MAX":{"summary":"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`.","value":{"error":{"code":"RATE_ABOVE_MAX","category":"validation","treatment":"fix_request","message":"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`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"INVALID_BOUNDS":{"summary":"The limit rate and the size bounds contradict each other.","value":{"error":{"code":"INVALID_BOUNDS","category":"validation","treatment":"fix_request","message":"The limit rate and the size bounds contradict each other.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"DEADLINE_INVALID":{"summary":"The deadline is in the past, too soon, or beyond the wallet type's signing window.","value":{"error":{"code":"DEADLINE_INVALID","category":"validation","treatment":"fix_request","message":"The deadline is in the past, too soon, or beyond the wallet type's signing window.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"INVALID_OFFER_INPUT":{"summary":"Some offer fields are invalid. `details.issues` names them.","value":{"error":{"code":"INVALID_OFFER_INPUT","category":"validation","treatment":"fix_request","message":"Some offer fields are invalid. `details.issues` names them.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"STAIRCASE_INVALID":{"summary":"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`).","value":{"error":{"code":"STAIRCASE_INVALID","category":"validation","treatment":"fix_request","message":"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`).","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"401":{"description":"`UNAUTHENTICATED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"UNAUTHENTICATED":{"summary":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","value":{"error":{"code":"UNAUTHENTICATED","category":"auth","treatment":"fix_request","message":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"403":{"description":"`FORBIDDEN_SCOPE`, `WALLET_BLOCKED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"FORBIDDEN_SCOPE":{"summary":"The API key lacks a scope this route needs.","value":{"error":{"code":"FORBIDDEN_SCOPE","category":"auth","treatment":"fix_request","message":"The API key lacks a scope this route needs.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"WALLET_BLOCKED":{"summary":"The wallet is on a sanctions list that Tenor screens against, so no payload is prepared for it.","value":{"error":{"code":"WALLET_BLOCKED","category":"auth","treatment":"fix_request","message":"The wallet is on a sanctions list that Tenor screens against, so no payload is prepared for it.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"404":{"description":"`MATURITY_NOT_FOUND`, `POSITION_NOT_FOUND`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"MATURITY_NOT_FOUND":{"summary":"No maturity with this ID on this chain.","value":{"error":{"code":"MATURITY_NOT_FOUND","category":"not_found","treatment":"fix_request","message":"No maturity with this ID on this chain.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"POSITION_NOT_FOUND":{"summary":"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`).","value":{"error":{"code":"POSITION_NOT_FOUND","category":"not_found","treatment":"fix_request","message":"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`).","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"413":{"description":"`PAYLOAD_TOO_LARGE`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"PAYLOAD_TOO_LARGE":{"summary":"The request body is larger than 64 KiB.","value":{"error":{"code":"PAYLOAD_TOO_LARGE","category":"validation","treatment":"fix_request","message":"The request body is larger than 64 KiB.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"422":{"description":"`COUNTERPARTY_BLOCKED`, `MARKET_NOT_SUPPORTED`, `MATURITY_MATURED`, `DRY_RUN_UNAVAILABLE`, `NO_OFFERS`, `NO_VALID_OFFERS`, `INSUFFICIENT_LIQUIDITY`, `LIMIT_RATE_NOT_MET`, `SIMULATION_FAILED`, `SLIPPAGE_EXCEEDED`, `SELF_CROSS`, `OPPOSITE_POSITION`, `INVARIANT_VIOLATION`, `INSUFFICIENT_COLLATERAL`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"COUNTERPARTY_BLOCKED":{"summary":"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.","value":{"error":{"code":"COUNTERPARTY_BLOCKED","category":"state","treatment":"fix_request","message":"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_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"MARKET_NOT_SUPPORTED":{"summary":"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.","value":{"error":{"code":"MARKET_NOT_SUPPORTED","category":"state","treatment":"fix_request","message":"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.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"MATURITY_MATURED":{"summary":"The maturity is past `matures_at` and accepts no new lends or borrows. Lenders redeem, and borrowers repay.","value":{"error":{"code":"MATURITY_MATURED","category":"state","treatment":"fix_request","message":"The maturity is past `matures_at` and accepts no new lends or borrows. Lenders redeem, and borrowers repay.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"DRY_RUN_UNAVAILABLE":{"summary":"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`.","value":{"error":{"code":"DRY_RUN_UNAVAILABLE","category":"state","treatment":"fix_request","message":"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`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"NO_OFFERS":{"summary":"There are no open offers on that side.","value":{"error":{"code":"NO_OFFERS","category":"liquidity","treatment":"refetch_state","message":"There are no open offers on that side.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"NO_VALID_OFFERS":{"summary":"No offer on that side can be filled right now.","value":{"error":{"code":"NO_VALID_OFFERS","category":"liquidity","treatment":"refetch_state","message":"No offer on that side can be filled right now.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"INSUFFICIENT_LIQUIDITY":{"summary":"There isn't enough liquidity to fill the full size.","value":{"error":{"code":"INSUFFICIENT_LIQUIDITY","category":"liquidity","treatment":"refetch_state","message":"There isn't enough liquidity to fill the full size.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"LIMIT_RATE_NOT_MET":{"summary":"No fill is possible within the limit rate.","value":{"error":{"code":"LIMIT_RATE_NOT_MET","category":"liquidity","treatment":"refetch_state","message":"No fill is possible within the limit rate.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"SIMULATION_FAILED":{"summary":"The payload reverts in the simulation. `details.revert` has the decoded reason and `details.step` the step that failed.","value":{"error":{"code":"SIMULATION_FAILED","category":"simulation","treatment":"refetch_state","message":"The payload reverts in the simulation. `details.revert` has the decoded reason and `details.step` the step that failed.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"SLIPPAGE_EXCEEDED":{"summary":"The fill would fall outside the request's limit rate or size bounds.","value":{"error":{"code":"SLIPPAGE_EXCEEDED","category":"liquidity","treatment":"refetch_state","message":"The fill would fall outside the request's limit rate or size bounds.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"SELF_CROSS":{"summary":"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.","value":{"error":{"code":"SELF_CROSS","category":"account","treatment":"fix_request","message":"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.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"OPPOSITE_POSITION":{"summary":"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.","value":{"error":{"code":"OPPOSITE_POSITION","category":"account","treatment":"fix_request","message":"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.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"INVARIANT_VIOLATION":{"summary":"The payload failed a safety check, so no calldata is returned.","value":{"error":{"code":"INVARIANT_VIOLATION","category":"simulation","treatment":"fix_request","message":"The payload failed a safety check, so no calldata is returned.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"INSUFFICIENT_COLLATERAL":{"summary":"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.","value":{"error":{"code":"INSUFFICIENT_COLLATERAL","category":"account","treatment":"fund_account","message":"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.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"429":{"description":"`RATE_LIMITED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"RATE_LIMITED":{"summary":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","value":{"error":{"code":"RATE_LIMITED","category":"rate_limit","treatment":"retry","message":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"500":{"description":"`INTERNAL`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INTERNAL":{"summary":"Something failed on Tenor's side, and the failure has been reported. Retry.","value":{"error":{"code":"INTERNAL","category":"internal","treatment":"retry","message":"Something failed on Tenor's side, and the failure has been reported. Retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"503":{"description":"`ROUTER_UNAVAILABLE`, `ROUTER_BUSY`, `RPC_UNAVAILABLE`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"ROUTER_UNAVAILABLE":{"summary":"Tenor's quote engine is unavailable. Retry shortly.","value":{"error":{"code":"ROUTER_UNAVAILABLE","category":"upstream","treatment":"retry","message":"Tenor's quote engine is unavailable. Retry shortly.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"ROUTER_BUSY":{"summary":"Tenor's quote engine is at capacity. Retry shortly.","value":{"error":{"code":"ROUTER_BUSY","category":"upstream","treatment":"retry","message":"Tenor's quote engine is at capacity. Retry shortly.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"RPC_UNAVAILABLE":{"summary":"The chain's RPC is unavailable or degraded. Retry shortly.","value":{"error":{"code":"RPC_UNAVAILABLE","category":"upstream","treatment":"retry","message":"The chain's RPC is unavailable or degraded. Retry shortly.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}}},"x-rate-limit-class":"prepare"}},"/v1/repay/prepare":{"post":{"operationId":"prepareRepay","summary":"Prepare a repay","description":"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.\n\nNo API key needed. A key sent must carry the `trade` scope.","tags":["Fixed rate"],"security":[{},{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RepayPrepareRequest"}}}},"responses":{"200":{"description":"Prepare a repay.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Policy":{"$ref":"#/components/headers/X-RateLimit-Policy"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Prepared"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}},"required":["data","meta"]}}}},"400":{"description":"`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `MARKET_MISMATCH`, `RATE_ABOVE_MAX`, `INVALID_BOUNDS`, `DEADLINE_INVALID`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INVALID_PARAMS":{"summary":"A parameter or the body failed validation. `details.issues` lists each problem.","value":{"error":{"code":"INVALID_PARAMS","category":"validation","treatment":"fix_request","message":"A parameter or the body failed validation. `details.issues` lists each problem.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"UNSUPPORTED_CHAIN":{"summary":"`chain_id` is unknown or not enabled on this API.","value":{"error":{"code":"UNSUPPORTED_CHAIN","category":"validation","treatment":"fix_request","message":"`chain_id` is unknown or not enabled on this API.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"MARKET_MISMATCH":{"summary":"The maturity doesn't belong to the given market.","value":{"error":{"code":"MARKET_MISMATCH","category":"validation","treatment":"fix_request","message":"The maturity doesn't belong to the given market.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"RATE_ABOVE_MAX":{"summary":"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`.","value":{"error":{"code":"RATE_ABOVE_MAX","category":"validation","treatment":"fix_request","message":"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`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"INVALID_BOUNDS":{"summary":"The limit rate and the size bounds contradict each other.","value":{"error":{"code":"INVALID_BOUNDS","category":"validation","treatment":"fix_request","message":"The limit rate and the size bounds contradict each other.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"DEADLINE_INVALID":{"summary":"The deadline is in the past, too soon, or beyond the wallet type's signing window.","value":{"error":{"code":"DEADLINE_INVALID","category":"validation","treatment":"fix_request","message":"The deadline is in the past, too soon, or beyond the wallet type's signing window.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"401":{"description":"`UNAUTHENTICATED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"UNAUTHENTICATED":{"summary":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","value":{"error":{"code":"UNAUTHENTICATED","category":"auth","treatment":"fix_request","message":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"403":{"description":"`FORBIDDEN_SCOPE`, `WALLET_BLOCKED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"FORBIDDEN_SCOPE":{"summary":"The API key lacks a scope this route needs.","value":{"error":{"code":"FORBIDDEN_SCOPE","category":"auth","treatment":"fix_request","message":"The API key lacks a scope this route needs.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"WALLET_BLOCKED":{"summary":"The wallet is on a sanctions list that Tenor screens against, so no payload is prepared for it.","value":{"error":{"code":"WALLET_BLOCKED","category":"auth","treatment":"fix_request","message":"The wallet is on a sanctions list that Tenor screens against, so no payload is prepared for it.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"404":{"description":"`MATURITY_NOT_FOUND`, `POSITION_NOT_FOUND`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"MATURITY_NOT_FOUND":{"summary":"No maturity with this ID on this chain.","value":{"error":{"code":"MATURITY_NOT_FOUND","category":"not_found","treatment":"fix_request","message":"No maturity with this ID on this chain.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"POSITION_NOT_FOUND":{"summary":"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`).","value":{"error":{"code":"POSITION_NOT_FOUND","category":"not_found","treatment":"fix_request","message":"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`).","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"413":{"description":"`PAYLOAD_TOO_LARGE`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"PAYLOAD_TOO_LARGE":{"summary":"The request body is larger than 64 KiB.","value":{"error":{"code":"PAYLOAD_TOO_LARGE","category":"validation","treatment":"fix_request","message":"The request body is larger than 64 KiB.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"422":{"description":"`COUNTERPARTY_BLOCKED`, `MARKET_NOT_SUPPORTED`, `MATURITY_MATURED`, `DRY_RUN_UNAVAILABLE`, `NO_OFFERS`, `NO_VALID_OFFERS`, `INSUFFICIENT_LIQUIDITY`, `LIMIT_RATE_NOT_MET`, `INSUFFICIENT_BALANCE`, `SIMULATION_FAILED`, `SLIPPAGE_EXCEEDED`, `SELF_CROSS`, `INVARIANT_VIOLATION`, `EXCEEDS_POSITION`, `POSITION_UNHEALTHY`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"COUNTERPARTY_BLOCKED":{"summary":"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.","value":{"error":{"code":"COUNTERPARTY_BLOCKED","category":"state","treatment":"fix_request","message":"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_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"MARKET_NOT_SUPPORTED":{"summary":"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.","value":{"error":{"code":"MARKET_NOT_SUPPORTED","category":"state","treatment":"fix_request","message":"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.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"MATURITY_MATURED":{"summary":"The maturity is past `matures_at` and accepts no new lends or borrows. Lenders redeem, and borrowers repay.","value":{"error":{"code":"MATURITY_MATURED","category":"state","treatment":"fix_request","message":"The maturity is past `matures_at` and accepts no new lends or borrows. Lenders redeem, and borrowers repay.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"DRY_RUN_UNAVAILABLE":{"summary":"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`.","value":{"error":{"code":"DRY_RUN_UNAVAILABLE","category":"state","treatment":"fix_request","message":"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`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"NO_OFFERS":{"summary":"There are no open offers on that side.","value":{"error":{"code":"NO_OFFERS","category":"liquidity","treatment":"refetch_state","message":"There are no open offers on that side.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"NO_VALID_OFFERS":{"summary":"No offer on that side can be filled right now.","value":{"error":{"code":"NO_VALID_OFFERS","category":"liquidity","treatment":"refetch_state","message":"No offer on that side can be filled right now.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"INSUFFICIENT_LIQUIDITY":{"summary":"There isn't enough liquidity to fill the full size.","value":{"error":{"code":"INSUFFICIENT_LIQUIDITY","category":"liquidity","treatment":"refetch_state","message":"There isn't enough liquidity to fill the full size.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"LIMIT_RATE_NOT_MET":{"summary":"No fill is possible within the limit rate.","value":{"error":{"code":"LIMIT_RATE_NOT_MET","category":"liquidity","treatment":"refetch_state","message":"No fill is possible within the limit rate.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"INSUFFICIENT_BALANCE":{"summary":"The wallet doesn't hold the tokens this action needs.","value":{"error":{"code":"INSUFFICIENT_BALANCE","category":"account","treatment":"fund_account","message":"The wallet doesn't hold the tokens this action needs.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"SIMULATION_FAILED":{"summary":"The payload reverts in the simulation. `details.revert` has the decoded reason and `details.step` the step that failed.","value":{"error":{"code":"SIMULATION_FAILED","category":"simulation","treatment":"refetch_state","message":"The payload reverts in the simulation. `details.revert` has the decoded reason and `details.step` the step that failed.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"SLIPPAGE_EXCEEDED":{"summary":"The fill would fall outside the request's limit rate or size bounds.","value":{"error":{"code":"SLIPPAGE_EXCEEDED","category":"liquidity","treatment":"refetch_state","message":"The fill would fall outside the request's limit rate or size bounds.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"SELF_CROSS":{"summary":"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.","value":{"error":{"code":"SELF_CROSS","category":"account","treatment":"fix_request","message":"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.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"INVARIANT_VIOLATION":{"summary":"The payload failed a safety check, so no calldata is returned.","value":{"error":{"code":"INVARIANT_VIOLATION","category":"simulation","treatment":"fix_request","message":"The payload failed a safety check, so no calldata is returned.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"EXCEEDS_POSITION":{"summary":"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.","value":{"error":{"code":"EXCEEDS_POSITION","category":"account","treatment":"fix_request","message":"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.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"POSITION_UNHEALTHY":{"summary":"The action would leave the position liquidatable. Withdraw at most `details.max_amount`.","value":{"error":{"code":"POSITION_UNHEALTHY","category":"account","treatment":"fix_request","message":"The action would leave the position liquidatable. Withdraw at most `details.max_amount`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"429":{"description":"`RATE_LIMITED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"RATE_LIMITED":{"summary":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","value":{"error":{"code":"RATE_LIMITED","category":"rate_limit","treatment":"retry","message":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"500":{"description":"`INTERNAL`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INTERNAL":{"summary":"Something failed on Tenor's side, and the failure has been reported. Retry.","value":{"error":{"code":"INTERNAL","category":"internal","treatment":"retry","message":"Something failed on Tenor's side, and the failure has been reported. Retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"503":{"description":"`ROUTER_UNAVAILABLE`, `ROUTER_BUSY`, `RPC_UNAVAILABLE`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"ROUTER_UNAVAILABLE":{"summary":"Tenor's quote engine is unavailable. Retry shortly.","value":{"error":{"code":"ROUTER_UNAVAILABLE","category":"upstream","treatment":"retry","message":"Tenor's quote engine is unavailable. Retry shortly.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"ROUTER_BUSY":{"summary":"Tenor's quote engine is at capacity. Retry shortly.","value":{"error":{"code":"ROUTER_BUSY","category":"upstream","treatment":"retry","message":"Tenor's quote engine is at capacity. Retry shortly.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"RPC_UNAVAILABLE":{"summary":"The chain's RPC is unavailable or degraded. Retry shortly.","value":{"error":{"code":"RPC_UNAVAILABLE","category":"upstream","treatment":"retry","message":"The chain's RPC is unavailable or degraded. Retry shortly.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}}},"x-rate-limit-class":"prepare"}},"/v1/resell/prepare":{"post":{"operationId":"prepareResell","summary":"Prepare a resell","description":"Exits a lend before maturity by reselling it into the open lend offers. After maturity, redeem the lend instead.\n\nNo API key needed. A key sent must carry the `trade` scope.","tags":["Fixed rate"],"security":[{},{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResellPrepareRequest"}}}},"responses":{"200":{"description":"Prepare a resell.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Policy":{"$ref":"#/components/headers/X-RateLimit-Policy"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Prepared"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}},"required":["data","meta"]}}}},"400":{"description":"`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `MARKET_MISMATCH`, `RATE_ABOVE_MAX`, `INVALID_BOUNDS`, `DEADLINE_INVALID`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INVALID_PARAMS":{"summary":"A parameter or the body failed validation. `details.issues` lists each problem.","value":{"error":{"code":"INVALID_PARAMS","category":"validation","treatment":"fix_request","message":"A parameter or the body failed validation. `details.issues` lists each problem.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"UNSUPPORTED_CHAIN":{"summary":"`chain_id` is unknown or not enabled on this API.","value":{"error":{"code":"UNSUPPORTED_CHAIN","category":"validation","treatment":"fix_request","message":"`chain_id` is unknown or not enabled on this API.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"MARKET_MISMATCH":{"summary":"The maturity doesn't belong to the given market.","value":{"error":{"code":"MARKET_MISMATCH","category":"validation","treatment":"fix_request","message":"The maturity doesn't belong to the given market.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"RATE_ABOVE_MAX":{"summary":"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`.","value":{"error":{"code":"RATE_ABOVE_MAX","category":"validation","treatment":"fix_request","message":"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`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"INVALID_BOUNDS":{"summary":"The limit rate and the size bounds contradict each other.","value":{"error":{"code":"INVALID_BOUNDS","category":"validation","treatment":"fix_request","message":"The limit rate and the size bounds contradict each other.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"DEADLINE_INVALID":{"summary":"The deadline is in the past, too soon, or beyond the wallet type's signing window.","value":{"error":{"code":"DEADLINE_INVALID","category":"validation","treatment":"fix_request","message":"The deadline is in the past, too soon, or beyond the wallet type's signing window.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"401":{"description":"`UNAUTHENTICATED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"UNAUTHENTICATED":{"summary":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","value":{"error":{"code":"UNAUTHENTICATED","category":"auth","treatment":"fix_request","message":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"403":{"description":"`FORBIDDEN_SCOPE`, `WALLET_BLOCKED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"FORBIDDEN_SCOPE":{"summary":"The API key lacks a scope this route needs.","value":{"error":{"code":"FORBIDDEN_SCOPE","category":"auth","treatment":"fix_request","message":"The API key lacks a scope this route needs.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"WALLET_BLOCKED":{"summary":"The wallet is on a sanctions list that Tenor screens against, so no payload is prepared for it.","value":{"error":{"code":"WALLET_BLOCKED","category":"auth","treatment":"fix_request","message":"The wallet is on a sanctions list that Tenor screens against, so no payload is prepared for it.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"404":{"description":"`MATURITY_NOT_FOUND`, `POSITION_NOT_FOUND`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"MATURITY_NOT_FOUND":{"summary":"No maturity with this ID on this chain.","value":{"error":{"code":"MATURITY_NOT_FOUND","category":"not_found","treatment":"fix_request","message":"No maturity with this ID on this chain.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"POSITION_NOT_FOUND":{"summary":"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`).","value":{"error":{"code":"POSITION_NOT_FOUND","category":"not_found","treatment":"fix_request","message":"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`).","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"413":{"description":"`PAYLOAD_TOO_LARGE`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"PAYLOAD_TOO_LARGE":{"summary":"The request body is larger than 64 KiB.","value":{"error":{"code":"PAYLOAD_TOO_LARGE","category":"validation","treatment":"fix_request","message":"The request body is larger than 64 KiB.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"422":{"description":"`COUNTERPARTY_BLOCKED`, `MARKET_NOT_SUPPORTED`, `MATURITY_MATURED`, `DRY_RUN_UNAVAILABLE`, `NO_OFFERS`, `NO_VALID_OFFERS`, `INSUFFICIENT_LIQUIDITY`, `LIMIT_RATE_NOT_MET`, `INSUFFICIENT_BALANCE`, `SIMULATION_FAILED`, `SLIPPAGE_EXCEEDED`, `SELF_CROSS`, `INVARIANT_VIOLATION`, `EXCEEDS_POSITION`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"COUNTERPARTY_BLOCKED":{"summary":"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.","value":{"error":{"code":"COUNTERPARTY_BLOCKED","category":"state","treatment":"fix_request","message":"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_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"MARKET_NOT_SUPPORTED":{"summary":"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.","value":{"error":{"code":"MARKET_NOT_SUPPORTED","category":"state","treatment":"fix_request","message":"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.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"MATURITY_MATURED":{"summary":"The maturity is past `matures_at` and accepts no new lends or borrows. Lenders redeem, and borrowers repay.","value":{"error":{"code":"MATURITY_MATURED","category":"state","treatment":"fix_request","message":"The maturity is past `matures_at` and accepts no new lends or borrows. Lenders redeem, and borrowers repay.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"DRY_RUN_UNAVAILABLE":{"summary":"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`.","value":{"error":{"code":"DRY_RUN_UNAVAILABLE","category":"state","treatment":"fix_request","message":"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`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"NO_OFFERS":{"summary":"There are no open offers on that side.","value":{"error":{"code":"NO_OFFERS","category":"liquidity","treatment":"refetch_state","message":"There are no open offers on that side.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"NO_VALID_OFFERS":{"summary":"No offer on that side can be filled right now.","value":{"error":{"code":"NO_VALID_OFFERS","category":"liquidity","treatment":"refetch_state","message":"No offer on that side can be filled right now.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"INSUFFICIENT_LIQUIDITY":{"summary":"There isn't enough liquidity to fill the full size.","value":{"error":{"code":"INSUFFICIENT_LIQUIDITY","category":"liquidity","treatment":"refetch_state","message":"There isn't enough liquidity to fill the full size.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"LIMIT_RATE_NOT_MET":{"summary":"No fill is possible within the limit rate.","value":{"error":{"code":"LIMIT_RATE_NOT_MET","category":"liquidity","treatment":"refetch_state","message":"No fill is possible within the limit rate.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"INSUFFICIENT_BALANCE":{"summary":"The wallet doesn't hold the tokens this action needs.","value":{"error":{"code":"INSUFFICIENT_BALANCE","category":"account","treatment":"fund_account","message":"The wallet doesn't hold the tokens this action needs.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"SIMULATION_FAILED":{"summary":"The payload reverts in the simulation. `details.revert` has the decoded reason and `details.step` the step that failed.","value":{"error":{"code":"SIMULATION_FAILED","category":"simulation","treatment":"refetch_state","message":"The payload reverts in the simulation. `details.revert` has the decoded reason and `details.step` the step that failed.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"SLIPPAGE_EXCEEDED":{"summary":"The fill would fall outside the request's limit rate or size bounds.","value":{"error":{"code":"SLIPPAGE_EXCEEDED","category":"liquidity","treatment":"refetch_state","message":"The fill would fall outside the request's limit rate or size bounds.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"SELF_CROSS":{"summary":"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.","value":{"error":{"code":"SELF_CROSS","category":"account","treatment":"fix_request","message":"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.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"INVARIANT_VIOLATION":{"summary":"The payload failed a safety check, so no calldata is returned.","value":{"error":{"code":"INVARIANT_VIOLATION","category":"simulation","treatment":"fix_request","message":"The payload failed a safety check, so no calldata is returned.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"EXCEEDS_POSITION":{"summary":"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.","value":{"error":{"code":"EXCEEDS_POSITION","category":"account","treatment":"fix_request","message":"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.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"429":{"description":"`RATE_LIMITED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"RATE_LIMITED":{"summary":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","value":{"error":{"code":"RATE_LIMITED","category":"rate_limit","treatment":"retry","message":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"500":{"description":"`INTERNAL`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INTERNAL":{"summary":"Something failed on Tenor's side, and the failure has been reported. Retry.","value":{"error":{"code":"INTERNAL","category":"internal","treatment":"retry","message":"Something failed on Tenor's side, and the failure has been reported. Retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"503":{"description":"`ROUTER_UNAVAILABLE`, `ROUTER_BUSY`, `RPC_UNAVAILABLE`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"ROUTER_UNAVAILABLE":{"summary":"Tenor's quote engine is unavailable. Retry shortly.","value":{"error":{"code":"ROUTER_UNAVAILABLE","category":"upstream","treatment":"retry","message":"Tenor's quote engine is unavailable. Retry shortly.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"ROUTER_BUSY":{"summary":"Tenor's quote engine is at capacity. Retry shortly.","value":{"error":{"code":"ROUTER_BUSY","category":"upstream","treatment":"retry","message":"Tenor's quote engine is at capacity. Retry shortly.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"RPC_UNAVAILABLE":{"summary":"The chain's RPC is unavailable or degraded. Retry shortly.","value":{"error":{"code":"RPC_UNAVAILABLE","category":"upstream","treatment":"retry","message":"The chain's RPC is unavailable or degraded. Retry shortly.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}}},"x-rate-limit-class":"prepare"}},"/v1/simulate":{"post":{"operationId":"simulate","summary":"Simulate calls before signing","description":"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`.\n\nCalls 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.\n\nNo API key needed.","tags":["Transactions"],"security":[{},{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulateRequest"}}}},"responses":{"200":{"description":"Simulate calls before signing.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Policy":{"$ref":"#/components/headers/X-RateLimit-Policy"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Simulation"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}},"required":["data","meta"]}}}},"400":{"description":"`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INVALID_PARAMS":{"summary":"A parameter or the body failed validation. `details.issues` lists each problem.","value":{"error":{"code":"INVALID_PARAMS","category":"validation","treatment":"fix_request","message":"A parameter or the body failed validation. `details.issues` lists each problem.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"UNSUPPORTED_CHAIN":{"summary":"`chain_id` is unknown or not enabled on this API.","value":{"error":{"code":"UNSUPPORTED_CHAIN","category":"validation","treatment":"fix_request","message":"`chain_id` is unknown or not enabled on this API.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"401":{"description":"`UNAUTHENTICATED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"UNAUTHENTICATED":{"summary":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","value":{"error":{"code":"UNAUTHENTICATED","category":"auth","treatment":"fix_request","message":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"403":{"description":"`WALLET_BLOCKED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"WALLET_BLOCKED":{"summary":"The wallet is on a sanctions list that Tenor screens against, so no payload is prepared for it.","value":{"error":{"code":"WALLET_BLOCKED","category":"auth","treatment":"fix_request","message":"The wallet is on a sanctions list that Tenor screens against, so no payload is prepared for it.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"413":{"description":"`PAYLOAD_TOO_LARGE`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"PAYLOAD_TOO_LARGE":{"summary":"The request body is larger than 64 KiB.","value":{"error":{"code":"PAYLOAD_TOO_LARGE","category":"validation","treatment":"fix_request","message":"The request body is larger than 64 KiB.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"429":{"description":"`RATE_LIMITED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"RATE_LIMITED":{"summary":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","value":{"error":{"code":"RATE_LIMITED","category":"rate_limit","treatment":"retry","message":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"500":{"description":"`INTERNAL`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INTERNAL":{"summary":"Something failed on Tenor's side, and the failure has been reported. Retry.","value":{"error":{"code":"INTERNAL","category":"internal","treatment":"retry","message":"Something failed on Tenor's side, and the failure has been reported. Retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"503":{"description":"`RPC_UNAVAILABLE`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"RPC_UNAVAILABLE":{"summary":"The chain's RPC is unavailable or degraded. Retry shortly.","value":{"error":{"code":"RPC_UNAVAILABLE","category":"upstream","treatment":"retry","message":"The chain's RPC is unavailable or degraded. Retry shortly.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}}},"x-rate-limit-class":"prepare"}},"/v1/take/prepare":{"post":{"operationId":"prepareTake","summary":"Prepare a take","description":"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.\n\nSizing 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.\n\nNo API key needed. A key sent must carry the `trade` scope.","tags":["Fixed rate"],"security":[{},{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TakePrepareRequest"}}}},"responses":{"200":{"description":"Prepare a take.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Policy":{"$ref":"#/components/headers/X-RateLimit-Policy"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Prepared"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}},"required":["data","meta"]}}}},"400":{"description":"`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `MARKET_MISMATCH`, `RATE_ABOVE_MAX`, `INVALID_BOUNDS`, `DEADLINE_INVALID`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INVALID_PARAMS":{"summary":"A parameter or the body failed validation. `details.issues` lists each problem.","value":{"error":{"code":"INVALID_PARAMS","category":"validation","treatment":"fix_request","message":"A parameter or the body failed validation. `details.issues` lists each problem.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"UNSUPPORTED_CHAIN":{"summary":"`chain_id` is unknown or not enabled on this API.","value":{"error":{"code":"UNSUPPORTED_CHAIN","category":"validation","treatment":"fix_request","message":"`chain_id` is unknown or not enabled on this API.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"MARKET_MISMATCH":{"summary":"The maturity doesn't belong to the given market.","value":{"error":{"code":"MARKET_MISMATCH","category":"validation","treatment":"fix_request","message":"The maturity doesn't belong to the given market.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"RATE_ABOVE_MAX":{"summary":"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`.","value":{"error":{"code":"RATE_ABOVE_MAX","category":"validation","treatment":"fix_request","message":"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`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"INVALID_BOUNDS":{"summary":"The limit rate and the size bounds contradict each other.","value":{"error":{"code":"INVALID_BOUNDS","category":"validation","treatment":"fix_request","message":"The limit rate and the size bounds contradict each other.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"DEADLINE_INVALID":{"summary":"The deadline is in the past, too soon, or beyond the wallet type's signing window.","value":{"error":{"code":"DEADLINE_INVALID","category":"validation","treatment":"fix_request","message":"The deadline is in the past, too soon, or beyond the wallet type's signing window.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"401":{"description":"`UNAUTHENTICATED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"UNAUTHENTICATED":{"summary":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","value":{"error":{"code":"UNAUTHENTICATED","category":"auth","treatment":"fix_request","message":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"403":{"description":"`FORBIDDEN_SCOPE`, `WALLET_BLOCKED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"FORBIDDEN_SCOPE":{"summary":"The API key lacks a scope this route needs.","value":{"error":{"code":"FORBIDDEN_SCOPE","category":"auth","treatment":"fix_request","message":"The API key lacks a scope this route needs.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"WALLET_BLOCKED":{"summary":"The wallet is on a sanctions list that Tenor screens against, so no payload is prepared for it.","value":{"error":{"code":"WALLET_BLOCKED","category":"auth","treatment":"fix_request","message":"The wallet is on a sanctions list that Tenor screens against, so no payload is prepared for it.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"404":{"description":"`MATURITY_NOT_FOUND`, `OFFER_NOT_FOUND`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"MATURITY_NOT_FOUND":{"summary":"No maturity with this ID on this chain.","value":{"error":{"code":"MATURITY_NOT_FOUND","category":"not_found","treatment":"fix_request","message":"No maturity with this ID on this chain.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"OFFER_NOT_FOUND":{"summary":"No offer with this ID on this chain.","value":{"error":{"code":"OFFER_NOT_FOUND","category":"not_found","treatment":"fix_request","message":"No offer with this ID on this chain.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"409":{"description":"`OFFER_STATE_CHANGED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"OFFER_STATE_CHANGED":{"summary":"The offer can no longer be taken, and `details.reason` gives the cause. Read the open offers again.","value":{"error":{"code":"OFFER_STATE_CHANGED","category":"state","treatment":"refetch_state","message":"The offer can no longer be taken, and `details.reason` gives the cause. Read the open offers again.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"413":{"description":"`PAYLOAD_TOO_LARGE`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"PAYLOAD_TOO_LARGE":{"summary":"The request body is larger than 64 KiB.","value":{"error":{"code":"PAYLOAD_TOO_LARGE","category":"validation","treatment":"fix_request","message":"The request body is larger than 64 KiB.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"422":{"description":"`COUNTERPARTY_BLOCKED`, `MARKET_NOT_SUPPORTED`, `MATURITY_MATURED`, `DRY_RUN_UNAVAILABLE`, `INSUFFICIENT_LIQUIDITY`, `LIMIT_RATE_NOT_MET`, `INSUFFICIENT_BALANCE`, `SIMULATION_FAILED`, `SLIPPAGE_EXCEEDED`, `SELF_CROSS`, `OPPOSITE_POSITION`, `INVARIANT_VIOLATION`, `INSUFFICIENT_COLLATERAL`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"COUNTERPARTY_BLOCKED":{"summary":"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.","value":{"error":{"code":"COUNTERPARTY_BLOCKED","category":"state","treatment":"fix_request","message":"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_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"MARKET_NOT_SUPPORTED":{"summary":"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.","value":{"error":{"code":"MARKET_NOT_SUPPORTED","category":"state","treatment":"fix_request","message":"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.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"MATURITY_MATURED":{"summary":"The maturity is past `matures_at` and accepts no new lends or borrows. Lenders redeem, and borrowers repay.","value":{"error":{"code":"MATURITY_MATURED","category":"state","treatment":"fix_request","message":"The maturity is past `matures_at` and accepts no new lends or borrows. Lenders redeem, and borrowers repay.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"DRY_RUN_UNAVAILABLE":{"summary":"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`.","value":{"error":{"code":"DRY_RUN_UNAVAILABLE","category":"state","treatment":"fix_request","message":"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`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"INSUFFICIENT_LIQUIDITY":{"summary":"There isn't enough liquidity to fill the full size.","value":{"error":{"code":"INSUFFICIENT_LIQUIDITY","category":"liquidity","treatment":"refetch_state","message":"There isn't enough liquidity to fill the full size.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"LIMIT_RATE_NOT_MET":{"summary":"No fill is possible within the limit rate.","value":{"error":{"code":"LIMIT_RATE_NOT_MET","category":"liquidity","treatment":"refetch_state","message":"No fill is possible within the limit rate.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"INSUFFICIENT_BALANCE":{"summary":"The wallet doesn't hold the tokens this action needs.","value":{"error":{"code":"INSUFFICIENT_BALANCE","category":"account","treatment":"fund_account","message":"The wallet doesn't hold the tokens this action needs.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"SIMULATION_FAILED":{"summary":"The payload reverts in the simulation. `details.revert` has the decoded reason and `details.step` the step that failed.","value":{"error":{"code":"SIMULATION_FAILED","category":"simulation","treatment":"refetch_state","message":"The payload reverts in the simulation. `details.revert` has the decoded reason and `details.step` the step that failed.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"SLIPPAGE_EXCEEDED":{"summary":"The fill would fall outside the request's limit rate or size bounds.","value":{"error":{"code":"SLIPPAGE_EXCEEDED","category":"liquidity","treatment":"refetch_state","message":"The fill would fall outside the request's limit rate or size bounds.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"SELF_CROSS":{"summary":"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.","value":{"error":{"code":"SELF_CROSS","category":"account","treatment":"fix_request","message":"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.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"OPPOSITE_POSITION":{"summary":"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.","value":{"error":{"code":"OPPOSITE_POSITION","category":"account","treatment":"fix_request","message":"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.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"INVARIANT_VIOLATION":{"summary":"The payload failed a safety check, so no calldata is returned.","value":{"error":{"code":"INVARIANT_VIOLATION","category":"simulation","treatment":"fix_request","message":"The payload failed a safety check, so no calldata is returned.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"INSUFFICIENT_COLLATERAL":{"summary":"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.","value":{"error":{"code":"INSUFFICIENT_COLLATERAL","category":"account","treatment":"fund_account","message":"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.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"429":{"description":"`RATE_LIMITED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"RATE_LIMITED":{"summary":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","value":{"error":{"code":"RATE_LIMITED","category":"rate_limit","treatment":"retry","message":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"500":{"description":"`INTERNAL`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INTERNAL":{"summary":"Something failed on Tenor's side, and the failure has been reported. Retry.","value":{"error":{"code":"INTERNAL","category":"internal","treatment":"retry","message":"Something failed on Tenor's side, and the failure has been reported. Retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"503":{"description":"`ROUTER_UNAVAILABLE`, `ROUTER_BUSY`, `RPC_UNAVAILABLE`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"ROUTER_UNAVAILABLE":{"summary":"Tenor's quote engine is unavailable. Retry shortly.","value":{"error":{"code":"ROUTER_UNAVAILABLE","category":"upstream","treatment":"retry","message":"Tenor's quote engine is unavailable. Retry shortly.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"ROUTER_BUSY":{"summary":"Tenor's quote engine is at capacity. Retry shortly.","value":{"error":{"code":"ROUTER_BUSY","category":"upstream","treatment":"retry","message":"Tenor's quote engine is at capacity. Retry shortly.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"RPC_UNAVAILABLE":{"summary":"The chain's RPC is unavailable or degraded. Retry shortly.","value":{"error":{"code":"RPC_UNAVAILABLE","category":"upstream","treatment":"retry","message":"The chain's RPC is unavailable or degraded. Retry shortly.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}}},"x-rate-limit-class":"prepare"}},"/v1/tokens":{"get":{"operationId":"listTokens","summary":"List tokens","description":"Lists every token the chain's markets lend or accept as collateral, sorted by symbol.","tags":["Catalog"],"security":[{},{"ApiKey":[]}],"parameters":[{"name":"chain_id","in":"query","required":true,"description":"The EVM chain ID. `GET /v1/chains` lists the chains served.","schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"example":8453},{"name":"role","in":"query","required":false,"description":"Only loan tokens, or only collateral tokens.","schema":{"type":"string","enum":["loan","collateral"]}},{"name":"type","in":"query","required":false,"description":"Only plain tokens (`erc20`), or only vault shares (`erc4626`).","schema":{"type":"string","enum":["erc20","erc4626"]}},{"name":"search","in":"query","required":false,"description":"Part of a symbol or name, or a full address. Case-insensitive.","schema":{"type":"string","minLength":1,"maxLength":64},"example":"usd"},{"name":"listing","in":"query","required":false,"description":"Only tokens of markets with this listing: `listed` (the default), `otc`, or `all`.","schema":{"default":"listed","type":"string","enum":["listed","otc","all"]},"example":"listed"},{"name":"include_deprecated","in":"query","required":false,"description":"Also list tokens that trade only in deprecated markets.","schema":{"default":"false","type":"string","enum":["true","false"]}}],"responses":{"200":{"description":"List tokens.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Policy":{"$ref":"#/components/headers/X-RateLimit-Policy"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"Cache-Control":{"description":"How long the response may be reused.","schema":{"type":"string","examples":["public, max-age=60, stale-while-revalidate=240"]}},"ETag":{"description":"The response's tag. Send it in `If-None-Match` to get a 304 while the body hasn't changed.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Token"}},"meta":{"$ref":"#/components/schemas/ResponseMeta"}},"required":["data","meta"]}}}},"304":{"description":"Not modified. The `ETag` sent in `If-None-Match` still matches, so the cached copy is current.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"400":{"description":"`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INVALID_PARAMS":{"summary":"A parameter or the body failed validation. `details.issues` lists each problem.","value":{"error":{"code":"INVALID_PARAMS","category":"validation","treatment":"fix_request","message":"A parameter or the body failed validation. `details.issues` lists each problem.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"UNSUPPORTED_CHAIN":{"summary":"`chain_id` is unknown or not enabled on this API.","value":{"error":{"code":"UNSUPPORTED_CHAIN","category":"validation","treatment":"fix_request","message":"`chain_id` is unknown or not enabled on this API.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"401":{"description":"`UNAUTHENTICATED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"UNAUTHENTICATED":{"summary":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","value":{"error":{"code":"UNAUTHENTICATED","category":"auth","treatment":"fix_request","message":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"429":{"description":"`RATE_LIMITED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"RATE_LIMITED":{"summary":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","value":{"error":{"code":"RATE_LIMITED","category":"rate_limit","treatment":"retry","message":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"500":{"description":"`INTERNAL`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INTERNAL":{"summary":"Something failed on Tenor's side, and the failure has been reported. Retry.","value":{"error":{"code":"INTERNAL","category":"internal","treatment":"retry","message":"Something failed on Tenor's side, and the failure has been reported. Retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}}},"x-rate-limit-class":"read"}},"/v1/transactions/{tx_hash}":{"get":{"operationId":"getTransaction","summary":"Track a transaction","description":"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.","tags":["Transactions"],"security":[{},{"ApiKey":[]}],"parameters":[{"name":"tx_hash","in":"path","required":true,"description":"The transaction's hash (case-insensitive).","schema":{"type":"string","pattern":"^0x[0-9a-fA-F]{64}$"},"example":"0x5a2b9e0f1c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f60718293a4b5c6d7"},{"name":"chain_id","in":"query","required":true,"description":"The EVM chain ID. `GET /v1/chains` lists the chains served.","schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"example":8453},{"name":"include_onchain","in":"query","required":false,"description":"Also return `onchain`, with the receipt's events decoded (see `TransactionOnchain`).","schema":{"default":"false","type":"string","enum":["true","false"]}}],"responses":{"200":{"description":"Track a transaction.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Policy":{"$ref":"#/components/headers/X-RateLimit-Policy"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Transaction"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}},"required":["data","meta"]}}}},"400":{"description":"`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INVALID_PARAMS":{"summary":"A parameter or the body failed validation. `details.issues` lists each problem.","value":{"error":{"code":"INVALID_PARAMS","category":"validation","treatment":"fix_request","message":"A parameter or the body failed validation. `details.issues` lists each problem.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"UNSUPPORTED_CHAIN":{"summary":"`chain_id` is unknown or not enabled on this API.","value":{"error":{"code":"UNSUPPORTED_CHAIN","category":"validation","treatment":"fix_request","message":"`chain_id` is unknown or not enabled on this API.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"401":{"description":"`UNAUTHENTICATED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"UNAUTHENTICATED":{"summary":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","value":{"error":{"code":"UNAUTHENTICATED","category":"auth","treatment":"fix_request","message":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"429":{"description":"`RATE_LIMITED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"RATE_LIMITED":{"summary":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","value":{"error":{"code":"RATE_LIMITED","category":"rate_limit","treatment":"retry","message":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"500":{"description":"`INTERNAL`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INTERNAL":{"summary":"Something failed on Tenor's side, and the failure has been reported. Retry.","value":{"error":{"code":"INTERNAL","category":"internal","treatment":"retry","message":"Something failed on Tenor's side, and the failure has been reported. Retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"503":{"description":"`RPC_UNAVAILABLE`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"RPC_UNAVAILABLE":{"summary":"The chain's RPC is unavailable or degraded. Retry shortly.","value":{"error":{"code":"RPC_UNAVAILABLE","category":"upstream","treatment":"retry","message":"The chain's RPC is unavailable or degraded. Retry shortly.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}}},"x-rate-limit-class":"read"}},"/v1/variable/borrow/prepare":{"post":{"operationId":"prepareVariableBorrow","summary":"Prepare a variable borrow","description":"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`.\n\nA 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`.\n\nNo API key needed. A key sent must carry the `trade` scope.","tags":["Variable rate"],"security":[{},{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VariableBorrowPrepareRequest"}}}},"responses":{"200":{"description":"Prepare a variable borrow.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Policy":{"$ref":"#/components/headers/X-RateLimit-Policy"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Prepared"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}},"required":["data","meta"]}}}},"400":{"description":"`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INVALID_PARAMS":{"summary":"A parameter or the body failed validation. `details.issues` lists each problem.","value":{"error":{"code":"INVALID_PARAMS","category":"validation","treatment":"fix_request","message":"A parameter or the body failed validation. `details.issues` lists each problem.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"UNSUPPORTED_CHAIN":{"summary":"`chain_id` is unknown or not enabled on this API.","value":{"error":{"code":"UNSUPPORTED_CHAIN","category":"validation","treatment":"fix_request","message":"`chain_id` is unknown or not enabled on this API.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"401":{"description":"`UNAUTHENTICATED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"UNAUTHENTICATED":{"summary":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","value":{"error":{"code":"UNAUTHENTICATED","category":"auth","treatment":"fix_request","message":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"403":{"description":"`FORBIDDEN_SCOPE`, `WALLET_BLOCKED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"FORBIDDEN_SCOPE":{"summary":"The API key lacks a scope this route needs.","value":{"error":{"code":"FORBIDDEN_SCOPE","category":"auth","treatment":"fix_request","message":"The API key lacks a scope this route needs.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"WALLET_BLOCKED":{"summary":"The wallet is on a sanctions list that Tenor screens against, so no payload is prepared for it.","value":{"error":{"code":"WALLET_BLOCKED","category":"auth","treatment":"fix_request","message":"The wallet is on a sanctions list that Tenor screens against, so no payload is prepared for it.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"404":{"description":"`MARKET_NOT_FOUND`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"MARKET_NOT_FOUND":{"summary":"No market with this ID on this chain.","value":{"error":{"code":"MARKET_NOT_FOUND","category":"not_found","treatment":"fix_request","message":"No market with this ID on this chain.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"413":{"description":"`PAYLOAD_TOO_LARGE`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"PAYLOAD_TOO_LARGE":{"summary":"The request body is larger than 64 KiB.","value":{"error":{"code":"PAYLOAD_TOO_LARGE","category":"validation","treatment":"fix_request","message":"The request body is larger than 64 KiB.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"422":{"description":"`MARKET_NOT_SUPPORTED`, `DRY_RUN_UNAVAILABLE`, `INSUFFICIENT_BALANCE`, `SIMULATION_FAILED`, `INVARIANT_VIOLATION`, `INSUFFICIENT_LIQUIDITY`, `INSUFFICIENT_COLLATERAL`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"MARKET_NOT_SUPPORTED":{"summary":"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.","value":{"error":{"code":"MARKET_NOT_SUPPORTED","category":"state","treatment":"fix_request","message":"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.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"DRY_RUN_UNAVAILABLE":{"summary":"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`.","value":{"error":{"code":"DRY_RUN_UNAVAILABLE","category":"state","treatment":"fix_request","message":"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`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"INSUFFICIENT_BALANCE":{"summary":"The wallet doesn't hold the tokens this action needs.","value":{"error":{"code":"INSUFFICIENT_BALANCE","category":"account","treatment":"fund_account","message":"The wallet doesn't hold the tokens this action needs.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"SIMULATION_FAILED":{"summary":"The payload reverts in the simulation. `details.revert` has the decoded reason and `details.step` the step that failed.","value":{"error":{"code":"SIMULATION_FAILED","category":"simulation","treatment":"refetch_state","message":"The payload reverts in the simulation. `details.revert` has the decoded reason and `details.step` the step that failed.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"INVARIANT_VIOLATION":{"summary":"The payload failed a safety check, so no calldata is returned.","value":{"error":{"code":"INVARIANT_VIOLATION","category":"simulation","treatment":"fix_request","message":"The payload failed a safety check, so no calldata is returned.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"INSUFFICIENT_LIQUIDITY":{"summary":"There isn't enough liquidity to fill the full size.","value":{"error":{"code":"INSUFFICIENT_LIQUIDITY","category":"liquidity","treatment":"refetch_state","message":"There isn't enough liquidity to fill the full size.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"INSUFFICIENT_COLLATERAL":{"summary":"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.","value":{"error":{"code":"INSUFFICIENT_COLLATERAL","category":"account","treatment":"fund_account","message":"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.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"429":{"description":"`RATE_LIMITED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"RATE_LIMITED":{"summary":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","value":{"error":{"code":"RATE_LIMITED","category":"rate_limit","treatment":"retry","message":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"500":{"description":"`INTERNAL`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INTERNAL":{"summary":"Something failed on Tenor's side, and the failure has been reported. Retry.","value":{"error":{"code":"INTERNAL","category":"internal","treatment":"retry","message":"Something failed on Tenor's side, and the failure has been reported. Retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"503":{"description":"`RPC_UNAVAILABLE`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"RPC_UNAVAILABLE":{"summary":"The chain's RPC is unavailable or degraded. Retry shortly.","value":{"error":{"code":"RPC_UNAVAILABLE","category":"upstream","treatment":"retry","message":"The chain's RPC is unavailable or degraded. Retry shortly.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}}},"x-rate-limit-class":"prepare"}},"/v1/variable/lend/prepare":{"post":{"operationId":"prepareVariableLend","summary":"Prepare a variable lend","description":"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.\n\nNo API key needed. A key sent must carry the `trade` scope.","tags":["Variable rate"],"security":[{},{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VariableLendPrepareRequest"}}}},"responses":{"200":{"description":"Prepare a variable lend.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Policy":{"$ref":"#/components/headers/X-RateLimit-Policy"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Prepared"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}},"required":["data","meta"]}}}},"400":{"description":"`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INVALID_PARAMS":{"summary":"A parameter or the body failed validation. `details.issues` lists each problem.","value":{"error":{"code":"INVALID_PARAMS","category":"validation","treatment":"fix_request","message":"A parameter or the body failed validation. `details.issues` lists each problem.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"UNSUPPORTED_CHAIN":{"summary":"`chain_id` is unknown or not enabled on this API.","value":{"error":{"code":"UNSUPPORTED_CHAIN","category":"validation","treatment":"fix_request","message":"`chain_id` is unknown or not enabled on this API.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"401":{"description":"`UNAUTHENTICATED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"UNAUTHENTICATED":{"summary":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","value":{"error":{"code":"UNAUTHENTICATED","category":"auth","treatment":"fix_request","message":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"403":{"description":"`FORBIDDEN_SCOPE`, `WALLET_BLOCKED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"FORBIDDEN_SCOPE":{"summary":"The API key lacks a scope this route needs.","value":{"error":{"code":"FORBIDDEN_SCOPE","category":"auth","treatment":"fix_request","message":"The API key lacks a scope this route needs.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"WALLET_BLOCKED":{"summary":"The wallet is on a sanctions list that Tenor screens against, so no payload is prepared for it.","value":{"error":{"code":"WALLET_BLOCKED","category":"auth","treatment":"fix_request","message":"The wallet is on a sanctions list that Tenor screens against, so no payload is prepared for it.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"404":{"description":"`MARKET_NOT_FOUND`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"MARKET_NOT_FOUND":{"summary":"No market with this ID on this chain.","value":{"error":{"code":"MARKET_NOT_FOUND","category":"not_found","treatment":"fix_request","message":"No market with this ID on this chain.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"413":{"description":"`PAYLOAD_TOO_LARGE`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"PAYLOAD_TOO_LARGE":{"summary":"The request body is larger than 64 KiB.","value":{"error":{"code":"PAYLOAD_TOO_LARGE","category":"validation","treatment":"fix_request","message":"The request body is larger than 64 KiB.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"422":{"description":"`MARKET_NOT_SUPPORTED`, `DRY_RUN_UNAVAILABLE`, `INSUFFICIENT_BALANCE`, `SIMULATION_FAILED`, `INVARIANT_VIOLATION`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"MARKET_NOT_SUPPORTED":{"summary":"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.","value":{"error":{"code":"MARKET_NOT_SUPPORTED","category":"state","treatment":"fix_request","message":"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.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"DRY_RUN_UNAVAILABLE":{"summary":"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`.","value":{"error":{"code":"DRY_RUN_UNAVAILABLE","category":"state","treatment":"fix_request","message":"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`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"INSUFFICIENT_BALANCE":{"summary":"The wallet doesn't hold the tokens this action needs.","value":{"error":{"code":"INSUFFICIENT_BALANCE","category":"account","treatment":"fund_account","message":"The wallet doesn't hold the tokens this action needs.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"SIMULATION_FAILED":{"summary":"The payload reverts in the simulation. `details.revert` has the decoded reason and `details.step` the step that failed.","value":{"error":{"code":"SIMULATION_FAILED","category":"simulation","treatment":"refetch_state","message":"The payload reverts in the simulation. `details.revert` has the decoded reason and `details.step` the step that failed.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"INVARIANT_VIOLATION":{"summary":"The payload failed a safety check, so no calldata is returned.","value":{"error":{"code":"INVARIANT_VIOLATION","category":"simulation","treatment":"fix_request","message":"The payload failed a safety check, so no calldata is returned.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"429":{"description":"`RATE_LIMITED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"RATE_LIMITED":{"summary":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","value":{"error":{"code":"RATE_LIMITED","category":"rate_limit","treatment":"retry","message":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"500":{"description":"`INTERNAL`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INTERNAL":{"summary":"Something failed on Tenor's side, and the failure has been reported. Retry.","value":{"error":{"code":"INTERNAL","category":"internal","treatment":"retry","message":"Something failed on Tenor's side, and the failure has been reported. Retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"503":{"description":"`RPC_UNAVAILABLE`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"RPC_UNAVAILABLE":{"summary":"The chain's RPC is unavailable or degraded. Retry shortly.","value":{"error":{"code":"RPC_UNAVAILABLE","category":"upstream","treatment":"retry","message":"The chain's RPC is unavailable or degraded. Retry shortly.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}}},"x-rate-limit-class":"prepare"}},"/v1/variable/manage/prepare":{"post":{"operationId":"prepareVariableManage","summary":"Prepare a variable collateral change","description":"Deposits or withdraws collateral for the wallet's variable borrow, without changing the debt. Pass exactly one of `deposit_collateral` and `withdraw_collateral`.\n\nTo borrow more or repay part of the debt, use `/v1/variable/borrow/prepare` or `/v1/variable/repay/prepare`.\n\nNo API key needed. A key sent must carry the `trade` scope.","tags":["Variable rate"],"security":[{},{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VariableManagePrepareRequest"}}}},"responses":{"200":{"description":"Prepare a variable collateral change.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Policy":{"$ref":"#/components/headers/X-RateLimit-Policy"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Prepared"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}},"required":["data","meta"]}}}},"400":{"description":"`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INVALID_PARAMS":{"summary":"A parameter or the body failed validation. `details.issues` lists each problem.","value":{"error":{"code":"INVALID_PARAMS","category":"validation","treatment":"fix_request","message":"A parameter or the body failed validation. `details.issues` lists each problem.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"UNSUPPORTED_CHAIN":{"summary":"`chain_id` is unknown or not enabled on this API.","value":{"error":{"code":"UNSUPPORTED_CHAIN","category":"validation","treatment":"fix_request","message":"`chain_id` is unknown or not enabled on this API.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"401":{"description":"`UNAUTHENTICATED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"UNAUTHENTICATED":{"summary":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","value":{"error":{"code":"UNAUTHENTICATED","category":"auth","treatment":"fix_request","message":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"403":{"description":"`FORBIDDEN_SCOPE`, `WALLET_BLOCKED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"FORBIDDEN_SCOPE":{"summary":"The API key lacks a scope this route needs.","value":{"error":{"code":"FORBIDDEN_SCOPE","category":"auth","treatment":"fix_request","message":"The API key lacks a scope this route needs.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"WALLET_BLOCKED":{"summary":"The wallet is on a sanctions list that Tenor screens against, so no payload is prepared for it.","value":{"error":{"code":"WALLET_BLOCKED","category":"auth","treatment":"fix_request","message":"The wallet is on a sanctions list that Tenor screens against, so no payload is prepared for it.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"404":{"description":"`MARKET_NOT_FOUND`, `POSITION_NOT_FOUND`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"MARKET_NOT_FOUND":{"summary":"No market with this ID on this chain.","value":{"error":{"code":"MARKET_NOT_FOUND","category":"not_found","treatment":"fix_request","message":"No market with this ID on this chain.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"POSITION_NOT_FOUND":{"summary":"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`).","value":{"error":{"code":"POSITION_NOT_FOUND","category":"not_found","treatment":"fix_request","message":"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`).","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"413":{"description":"`PAYLOAD_TOO_LARGE`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"PAYLOAD_TOO_LARGE":{"summary":"The request body is larger than 64 KiB.","value":{"error":{"code":"PAYLOAD_TOO_LARGE","category":"validation","treatment":"fix_request","message":"The request body is larger than 64 KiB.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"422":{"description":"`MARKET_NOT_SUPPORTED`, `DRY_RUN_UNAVAILABLE`, `INSUFFICIENT_BALANCE`, `EXCEEDS_POSITION`, `POSITION_UNHEALTHY`, `SIMULATION_FAILED`, `INVARIANT_VIOLATION`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"MARKET_NOT_SUPPORTED":{"summary":"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.","value":{"error":{"code":"MARKET_NOT_SUPPORTED","category":"state","treatment":"fix_request","message":"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.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"DRY_RUN_UNAVAILABLE":{"summary":"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`.","value":{"error":{"code":"DRY_RUN_UNAVAILABLE","category":"state","treatment":"fix_request","message":"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`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"INSUFFICIENT_BALANCE":{"summary":"The wallet doesn't hold the tokens this action needs.","value":{"error":{"code":"INSUFFICIENT_BALANCE","category":"account","treatment":"fund_account","message":"The wallet doesn't hold the tokens this action needs.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"EXCEEDS_POSITION":{"summary":"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.","value":{"error":{"code":"EXCEEDS_POSITION","category":"account","treatment":"fix_request","message":"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.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"POSITION_UNHEALTHY":{"summary":"The action would leave the position liquidatable. Withdraw at most `details.max_amount`.","value":{"error":{"code":"POSITION_UNHEALTHY","category":"account","treatment":"fix_request","message":"The action would leave the position liquidatable. Withdraw at most `details.max_amount`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"SIMULATION_FAILED":{"summary":"The payload reverts in the simulation. `details.revert` has the decoded reason and `details.step` the step that failed.","value":{"error":{"code":"SIMULATION_FAILED","category":"simulation","treatment":"refetch_state","message":"The payload reverts in the simulation. `details.revert` has the decoded reason and `details.step` the step that failed.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"INVARIANT_VIOLATION":{"summary":"The payload failed a safety check, so no calldata is returned.","value":{"error":{"code":"INVARIANT_VIOLATION","category":"simulation","treatment":"fix_request","message":"The payload failed a safety check, so no calldata is returned.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"429":{"description":"`RATE_LIMITED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"RATE_LIMITED":{"summary":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","value":{"error":{"code":"RATE_LIMITED","category":"rate_limit","treatment":"retry","message":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"500":{"description":"`INTERNAL`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INTERNAL":{"summary":"Something failed on Tenor's side, and the failure has been reported. Retry.","value":{"error":{"code":"INTERNAL","category":"internal","treatment":"retry","message":"Something failed on Tenor's side, and the failure has been reported. Retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"503":{"description":"`RPC_UNAVAILABLE`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"RPC_UNAVAILABLE":{"summary":"The chain's RPC is unavailable or degraded. Retry shortly.","value":{"error":{"code":"RPC_UNAVAILABLE","category":"upstream","treatment":"retry","message":"The chain's RPC is unavailable or degraded. Retry shortly.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}}},"x-rate-limit-class":"prepare"}},"/v1/variable/repay/prepare":{"post":{"operationId":"prepareVariableRepay","summary":"Prepare a variable repay","description":"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.\n\nNo API key needed. A key sent must carry the `trade` scope.","tags":["Variable rate"],"security":[{},{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VariableRepayPrepareRequest"}}}},"responses":{"200":{"description":"Prepare a variable repay.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Policy":{"$ref":"#/components/headers/X-RateLimit-Policy"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Prepared"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}},"required":["data","meta"]}}}},"400":{"description":"`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INVALID_PARAMS":{"summary":"A parameter or the body failed validation. `details.issues` lists each problem.","value":{"error":{"code":"INVALID_PARAMS","category":"validation","treatment":"fix_request","message":"A parameter or the body failed validation. `details.issues` lists each problem.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"UNSUPPORTED_CHAIN":{"summary":"`chain_id` is unknown or not enabled on this API.","value":{"error":{"code":"UNSUPPORTED_CHAIN","category":"validation","treatment":"fix_request","message":"`chain_id` is unknown or not enabled on this API.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"401":{"description":"`UNAUTHENTICATED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"UNAUTHENTICATED":{"summary":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","value":{"error":{"code":"UNAUTHENTICATED","category":"auth","treatment":"fix_request","message":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"403":{"description":"`FORBIDDEN_SCOPE`, `WALLET_BLOCKED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"FORBIDDEN_SCOPE":{"summary":"The API key lacks a scope this route needs.","value":{"error":{"code":"FORBIDDEN_SCOPE","category":"auth","treatment":"fix_request","message":"The API key lacks a scope this route needs.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"WALLET_BLOCKED":{"summary":"The wallet is on a sanctions list that Tenor screens against, so no payload is prepared for it.","value":{"error":{"code":"WALLET_BLOCKED","category":"auth","treatment":"fix_request","message":"The wallet is on a sanctions list that Tenor screens against, so no payload is prepared for it.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"404":{"description":"`MARKET_NOT_FOUND`, `POSITION_NOT_FOUND`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"MARKET_NOT_FOUND":{"summary":"No market with this ID on this chain.","value":{"error":{"code":"MARKET_NOT_FOUND","category":"not_found","treatment":"fix_request","message":"No market with this ID on this chain.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"POSITION_NOT_FOUND":{"summary":"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`).","value":{"error":{"code":"POSITION_NOT_FOUND","category":"not_found","treatment":"fix_request","message":"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`).","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"413":{"description":"`PAYLOAD_TOO_LARGE`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"PAYLOAD_TOO_LARGE":{"summary":"The request body is larger than 64 KiB.","value":{"error":{"code":"PAYLOAD_TOO_LARGE","category":"validation","treatment":"fix_request","message":"The request body is larger than 64 KiB.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"422":{"description":"`MARKET_NOT_SUPPORTED`, `DRY_RUN_UNAVAILABLE`, `INSUFFICIENT_BALANCE`, `EXCEEDS_POSITION`, `POSITION_UNHEALTHY`, `SIMULATION_FAILED`, `INVARIANT_VIOLATION`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"MARKET_NOT_SUPPORTED":{"summary":"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.","value":{"error":{"code":"MARKET_NOT_SUPPORTED","category":"state","treatment":"fix_request","message":"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.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"DRY_RUN_UNAVAILABLE":{"summary":"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`.","value":{"error":{"code":"DRY_RUN_UNAVAILABLE","category":"state","treatment":"fix_request","message":"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`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"INSUFFICIENT_BALANCE":{"summary":"The wallet doesn't hold the tokens this action needs.","value":{"error":{"code":"INSUFFICIENT_BALANCE","category":"account","treatment":"fund_account","message":"The wallet doesn't hold the tokens this action needs.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"EXCEEDS_POSITION":{"summary":"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.","value":{"error":{"code":"EXCEEDS_POSITION","category":"account","treatment":"fix_request","message":"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.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"POSITION_UNHEALTHY":{"summary":"The action would leave the position liquidatable. Withdraw at most `details.max_amount`.","value":{"error":{"code":"POSITION_UNHEALTHY","category":"account","treatment":"fix_request","message":"The action would leave the position liquidatable. Withdraw at most `details.max_amount`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"SIMULATION_FAILED":{"summary":"The payload reverts in the simulation. `details.revert` has the decoded reason and `details.step` the step that failed.","value":{"error":{"code":"SIMULATION_FAILED","category":"simulation","treatment":"refetch_state","message":"The payload reverts in the simulation. `details.revert` has the decoded reason and `details.step` the step that failed.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"INVARIANT_VIOLATION":{"summary":"The payload failed a safety check, so no calldata is returned.","value":{"error":{"code":"INVARIANT_VIOLATION","category":"simulation","treatment":"fix_request","message":"The payload failed a safety check, so no calldata is returned.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"429":{"description":"`RATE_LIMITED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"RATE_LIMITED":{"summary":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","value":{"error":{"code":"RATE_LIMITED","category":"rate_limit","treatment":"retry","message":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"500":{"description":"`INTERNAL`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INTERNAL":{"summary":"Something failed on Tenor's side, and the failure has been reported. Retry.","value":{"error":{"code":"INTERNAL","category":"internal","treatment":"retry","message":"Something failed on Tenor's side, and the failure has been reported. Retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"503":{"description":"`RPC_UNAVAILABLE`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"RPC_UNAVAILABLE":{"summary":"The chain's RPC is unavailable or degraded. Retry shortly.","value":{"error":{"code":"RPC_UNAVAILABLE","category":"upstream","treatment":"retry","message":"The chain's RPC is unavailable or degraded. Retry shortly.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}}},"x-rate-limit-class":"prepare"}},"/v1/variable/withdraw/prepare":{"post":{"operationId":"prepareVariableWithdraw","summary":"Prepare a variable withdrawal","description":"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.\n\nA 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.\n\nNo API key needed. A key sent must carry the `trade` scope.","tags":["Variable rate"],"security":[{},{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VariableWithdrawPrepareRequest"}}}},"responses":{"200":{"description":"Prepare a variable withdrawal.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Policy":{"$ref":"#/components/headers/X-RateLimit-Policy"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PreparedVariableWithdraw"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}},"required":["data","meta"]}}}},"400":{"description":"`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INVALID_PARAMS":{"summary":"A parameter or the body failed validation. `details.issues` lists each problem.","value":{"error":{"code":"INVALID_PARAMS","category":"validation","treatment":"fix_request","message":"A parameter or the body failed validation. `details.issues` lists each problem.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"UNSUPPORTED_CHAIN":{"summary":"`chain_id` is unknown or not enabled on this API.","value":{"error":{"code":"UNSUPPORTED_CHAIN","category":"validation","treatment":"fix_request","message":"`chain_id` is unknown or not enabled on this API.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"401":{"description":"`UNAUTHENTICATED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"UNAUTHENTICATED":{"summary":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","value":{"error":{"code":"UNAUTHENTICATED","category":"auth","treatment":"fix_request","message":"The API key is missing, invalid, revoked or expired. Send a valid key in `X-Api-Key`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"403":{"description":"`FORBIDDEN_SCOPE`, `WALLET_BLOCKED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"FORBIDDEN_SCOPE":{"summary":"The API key lacks a scope this route needs.","value":{"error":{"code":"FORBIDDEN_SCOPE","category":"auth","treatment":"fix_request","message":"The API key lacks a scope this route needs.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"WALLET_BLOCKED":{"summary":"The wallet is on a sanctions list that Tenor screens against, so no payload is prepared for it.","value":{"error":{"code":"WALLET_BLOCKED","category":"auth","treatment":"fix_request","message":"The wallet is on a sanctions list that Tenor screens against, so no payload is prepared for it.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"404":{"description":"`MARKET_NOT_FOUND`, `POSITION_NOT_FOUND`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"MARKET_NOT_FOUND":{"summary":"No market with this ID on this chain.","value":{"error":{"code":"MARKET_NOT_FOUND","category":"not_found","treatment":"fix_request","message":"No market with this ID on this chain.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"POSITION_NOT_FOUND":{"summary":"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`).","value":{"error":{"code":"POSITION_NOT_FOUND","category":"not_found","treatment":"fix_request","message":"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`).","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"413":{"description":"`PAYLOAD_TOO_LARGE`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"PAYLOAD_TOO_LARGE":{"summary":"The request body is larger than 64 KiB.","value":{"error":{"code":"PAYLOAD_TOO_LARGE","category":"validation","treatment":"fix_request","message":"The request body is larger than 64 KiB.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"422":{"description":"`MARKET_NOT_SUPPORTED`, `DRY_RUN_UNAVAILABLE`, `EXCEEDS_POSITION`, `INSUFFICIENT_LIQUIDITY`, `SIMULATION_FAILED`, `INVARIANT_VIOLATION`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"MARKET_NOT_SUPPORTED":{"summary":"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.","value":{"error":{"code":"MARKET_NOT_SUPPORTED","category":"state","treatment":"fix_request","message":"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.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"DRY_RUN_UNAVAILABLE":{"summary":"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`.","value":{"error":{"code":"DRY_RUN_UNAVAILABLE","category":"state","treatment":"fix_request","message":"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`.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"EXCEEDS_POSITION":{"summary":"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.","value":{"error":{"code":"EXCEEDS_POSITION","category":"account","treatment":"fix_request","message":"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.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"INSUFFICIENT_LIQUIDITY":{"summary":"There isn't enough liquidity to fill the full size.","value":{"error":{"code":"INSUFFICIENT_LIQUIDITY","category":"liquidity","treatment":"refetch_state","message":"There isn't enough liquidity to fill the full size.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"SIMULATION_FAILED":{"summary":"The payload reverts in the simulation. `details.revert` has the decoded reason and `details.step` the step that failed.","value":{"error":{"code":"SIMULATION_FAILED","category":"simulation","treatment":"refetch_state","message":"The payload reverts in the simulation. `details.revert` has the decoded reason and `details.step` the step that failed.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}},"INVARIANT_VIOLATION":{"summary":"The payload failed a safety check, so no calldata is returned.","value":{"error":{"code":"INVARIANT_VIOLATION","category":"simulation","treatment":"fix_request","message":"The payload failed a safety check, so no calldata is returned.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"429":{"description":"`RATE_LIMITED`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"RATE_LIMITED":{"summary":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","value":{"error":{"code":"RATE_LIMITED","category":"rate_limit","treatment":"retry","message":"Too many requests. Wait the number of seconds in `Retry-After`, then retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"500":{"description":"`INTERNAL`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"INTERNAL":{"summary":"Something failed on Tenor's side, and the failure has been reported. Retry.","value":{"error":{"code":"INTERNAL","category":"internal","treatment":"retry","message":"Something failed on Tenor's side, and the failure has been reported. Retry.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}},"503":{"description":"`RPC_UNAVAILABLE`","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"RPC_UNAVAILABLE":{"summary":"The chain's RPC is unavailable or degraded. Retry shortly.","value":{"error":{"code":"RPC_UNAVAILABLE","category":"upstream","treatment":"retry","message":"The chain's RPC is unavailable or degraded. Retry shortly.","request_id":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"}}}}}}}},"x-rate-limit-class":"prepare"}}},"components":{"schemas":{"Access":{"type":"object","properties":{"organization_id":{"type":"string","description":"The organization the key belongs to.","examples":["5f0c6b1e-2a7d-4c43-9b8e-3f1d2c4a5b6e"]},"key_prefix":{"type":"string","description":"The key's public prefix, to tell keys apart in logs.","examples":["tnr_sk_live_Qm9vYmFy"]},"scopes":{"type":"array","items":{"type":"string","enum":["read","trade"]},"description":"The key's scopes: `read` for readiness and `trade` to prepare payloads.","examples":[["read","trade"]]},"mode":{"type":"string","enum":["live","test"],"description":"`live` or `test`. A test key works like a live one, but every prepare is a dry run."},"expires_at":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"When the key stops working, in Unix seconds. `null` when the key never expires.","examples":[1798761600]},"limits":{"type":"array","items":{"type":"object","properties":{"policy":{"type":"string","enum":["read","compute","prepare","cancel","rfq"]},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"examples":[120]},"window_s":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"examples":[60]}},"required":["policy","limit","window_s"]},"description":"The key's request budget per class: up to `limit` requests every `window_s` seconds."}},"required":["organization_id","key_prefix","scopes","mode","expires_at","limits"]},"Balance":{"type":"object","properties":{"token":{"type":"string","description":"The token, checksummed.","examples":["0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"]},"symbol":{"description":"`null` for a token outside the catalog.","examples":["USDC"],"type":["string","null"]},"decimals":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"`null` for a token outside the catalog.","examples":[6]},"amount":{"type":"string","description":"The wallet's balance. Integer string in the token's smallest unit.","examples":["25000000000"]},"reserved":{"type":"string","description":"The amount the wallet's open offers (the ones `GET /v1/offers?maker=` lists) can still take from the wallet when filled. Lend offers reserve the loan token, deposit-on-fill borrow offers the collateral, and yield-collateral borrow offers the loan token they add to each fill. Each group counts once, at its largest unfilled offer. Scheduled offers and offers that can't be taken now count too, since funding the wallet makes them fillable again. An offer without a size takes whatever the wallet holds, and reserves nothing. Idle capital comes from the variable lend, not the wallet. Integer string in the token's smallest unit.","examples":["10000000000"]},"available":{"type":"string","description":"`amount` minus `reserved`, never below zero: the amount the wallet can spend without leaving its offers short. Integer string in the token's smallest unit.","examples":["15000000000"]}},"required":["token","symbol","decimals","amount","reserved","available"]},"BorrowCollateral":{"type":"object","properties":{"token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"A collateral token of the market, from its `collaterals` in `GET /v1/markets`. A `yield_shares` collateral isn't accepted here.","examples":["0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf"]},"amount":{"type":"string","pattern":"^[1-9]\\d*$","description":"The amount to deposit. The payload pulls the full amount. Integer string in the token's smallest unit.","examples":["250000"]}},"required":["token","amount"],"additionalProperties":false,"description":"Collateral to deposit in the same payload. Leave `deposit_collateral` out to borrow against collateral the wallet has already posted."},"BorrowPrepareRequest":{"type":"object","properties":{"chain_id":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"The EVM chain ID. `GET /v1/chains` lists the chains served.","examples":[8453]},"wallet":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"The wallet that will sign and send the payload. Any address but the zero address is accepted, since a payload does nothing until that wallet signs it.","examples":["0x7A1f00000000000000000000000000000000C0de"]},"wallet_kind":{"type":"string","enum":["eoa","delegated_eoa","safe","smart_account"],"description":"How the wallet signs, which sets the shape of the payload. `eoa` sends each step as its own transaction, `delegated_eoa` (EIP-7702) batches them with `wallet_sendCalls`, `safe` runs them as one MultiSend transaction, and `smart_account` (ERC-4337 and others) as one user operation. Required: Tenor doesn't infer the wallet kind."},"limit_rate":{"description":"The worst rate the wallet accepts, at most 1 (100%). Enforced onchain: a worse fill reverts. A minimum when lending or repaying, and a maximum when borrowing or reselling. Default: the quote's worst rate, moved against the wallet by 0.10 percentage points for `eoa` and `delegated_eoa`, or 0.30 for `safe` and `smart_account`, which sign later. Annual rate as a decimal fraction (\"0.052\" = 5.2%).","examples":["0.045"],"type":"string","pattern":"^(0|[1-9]\\d*)(\\.\\d{1,18})?$"},"deadline_at":{"description":"The last moment the payload can be included in a block, enforced onchain. At least 60 s away, and within the wallet kind's signing window (5 min for `eoa` and `delegated_eoa`, 30 min for `safe` and `smart_account`). Default: the end of that window. Unix seconds.","examples":[1791561900],"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"dry_run":{"default":false,"description":"Preview the action with nothing to send. The simulation funds the wallet, so a dry run works before the wallet holds the tokens. Returns `status: preview_only`. Always on for test keys.","examples":[false],"type":"boolean"},"client_id":{"description":"The caller's own reference for this prepare, echoed back and logged.","examples":["desk-7:42"],"type":"string","pattern":"^[A-Za-z0-9._:-]{1,64}$"},"include_onchain":{"default":false,"description":"Also return `onchain`: the payload's calls decoded, with the result of each call in the simulation and the events they emitted. A dry run has no calldata, so `onchain` holds only the events.","examples":[false],"type":"boolean"},"maturity_id":{"type":"string","pattern":"^0x[0-9a-fA-F]{64}$","description":"The maturity to borrow on. `GET /v1/markets` lists them.","examples":["0x9c1e7f4a0b2d3e5f6a7b8c9d0e1f2a3b4c5d6e7f8091a2b3c4d5e6f708192a3b"]},"size":{"$ref":"#/components/schemas/BorrowSize"},"deposit_collateral":{"$ref":"#/components/schemas/BorrowCollateral"},"renewal":{"$ref":"#/components/schemas/RenewalSettings"}},"required":["chain_id","wallet","wallet_kind","maturity_id","size"],"additionalProperties":false},"BorrowSize":{"anyOf":[{"type":"object","properties":{"principal":{"type":"string","pattern":"^[1-9]\\d*$","description":"The amount the wallet receives now. The amount owed at maturity follows from the rate.","examples":["5000000"]}},"required":["principal"],"additionalProperties":false},{"type":"object","properties":{"amount_at_maturity":{"type":"string","pattern":"^[1-9]\\d*$","description":"The amount the wallet owes at maturity. The principal the wallet receives follows from the rate, and is at least the principal `limit_rate` allows.","examples":["5020050"]}},"required":["amount_at_maturity"],"additionalProperties":false}],"description":"Exactly one of `principal` or `amount_at_maturity`, in the loan token's smallest unit."},"Bounds":{"anyOf":[{"type":"object","properties":{"limit_rate":{"type":"string","description":"The worst rate the payload accepts, enforced onchain. Annual rate as a decimal fraction (\"0.052\" = 5.2%).","examples":["0.0471"]},"direction":{"type":"string","enum":["min","max"],"description":"`min` when lending or repaying (fills can't be at a lower rate), `max` when borrowing or reselling (fills can't be at a higher rate)."},"source":{"type":"string","enum":["explicit","quote_anchored"],"description":"`explicit`: the `limit_rate` in the request. `quote_anchored`: derived from the quote."},"deadline_at":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The deadline written into the payload. A payload included in a block after this moment reverts. Unix seconds.","examples":[1791561900]}},"required":["limit_rate","direction","source","deadline_at"]},{"type":"null"}],"description":"The rate and the deadline written into the payload's takes. `null` when the payload fills no offers."},"Call":{"type":"object","properties":{"to":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"The contract called.","examples":["0x6BFd8137e702540E7A42B74178A4a49Ba43920C4"]},"data":{"type":"string","pattern":"^0x([0-9a-fA-F]{2})*$","description":"The calldata.","examples":["0x374f435d"]},"value":{"type":"string","pattern":"^(0|[1-9]\\d*)$","description":"Native value, as an integer string in wei.","examples":["0"]}},"required":["to","data","value"]},"CancelOffersRequest":{"type":"object","properties":{"chain_id":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"The EVM chain ID. `GET /v1/chains` lists the chains served.","examples":[8453]},"wallet":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"The wallet that will sign and send the payload. Any address but the zero address is accepted, since a payload does nothing until that wallet signs it.","examples":["0x7A1f00000000000000000000000000000000C0de"]},"wallet_kind":{"type":"string","enum":["eoa","delegated_eoa","safe","smart_account"],"description":"How the wallet signs, which sets the shape of the payload. `eoa` sends each step as its own transaction, `delegated_eoa` (EIP-7702) batches them with `wallet_sendCalls`, `safe` runs them as one MultiSend transaction, and `smart_account` (ERC-4337 and others) as one user operation. Required: Tenor doesn't infer the wallet kind."},"dry_run":{"default":false,"description":"Preview the action with nothing to send. The simulation funds the wallet, so a dry run works before the wallet holds the tokens. Returns `status: preview_only`. Always on for test keys.","examples":[false],"type":"boolean"},"client_id":{"description":"The caller's own reference for this prepare, echoed back and logged.","examples":["desk-7:42"],"type":"string","pattern":"^[A-Za-z0-9._:-]{1,64}$"},"include_onchain":{"default":false,"description":"Also return `onchain`: the payload's calls decoded, with the result of each call in the simulation and the events they emitted. A dry run has no calldata, so `onchain` holds only the events.","examples":[false],"type":"boolean"},"offer_ids":{"description":"Up to 100 of the wallet's offers. A staircase's `offer_id` cancels the whole staircase, every window included. An offer that already filled, was cancelled or expired, or that Tenor has no record of, is skipped and left out of `cancels.offer_ids`. An offer posted by another wallet is a `400 OFFER_MAKER_MISMATCH`.","minItems":1,"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":256,"description":"One of the wallet's `offer_id`s, as `GET /v1/offers` lists it.","examples":["0f0e5c4e-6a8b-4a61-9a43-1c2d3e4f5a6b"]}},"groups":{"description":"Up to 100 groups, each cancelled in full. They are cancelled without checking Tenor's records, so a group posted a moment ago can be cancelled too.","minItems":1,"maxItems":100,"type":"array","items":{"type":"string","pattern":"^0x[0-9a-fA-F]{64}$","description":"A `group` of the wallet's offers, as `GET /v1/offers` or a post's `offers` gives it.","examples":["0x74656e6f720100c34f00000000000000000000000000000000000000000000a1"]}},"maturity_id":{"type":"string","pattern":"^0x[0-9a-fA-F]{64}$","description":"Cancel every offer the wallet has on this maturity. Not checked against the catalog, so a maturity the API doesn't serve works too; one with none of the wallet's live offers gets `422 NOTHING_TO_CANCEL`.","examples":["0x9c1e7f4a0b2d3e5f6a7b8c9d0e1f2a3b4c5d6e7f8091a2b3c4d5e6f708192a3b"]},"market_id":{"type":"string","pattern":"^0x[0-9a-fA-F]{64}$","description":"Cancel every offer the wallet has on any maturity of this market. Not checked against the catalog, like `maturity_id`.","examples":["0x3f81019286c6aa6265e5823a23c4f08e0f41c953236bad782c7739eb9ee6db11"]},"all":{"description":"Cancel every offer the wallet has on the chain.","examples":[true],"type":"boolean","const":true},"withdraw_idle_capital":{"default":false,"description":"Also withdraw, in the same payload, the idle capital of the groups the cancel ends in full. The amount is what their offers had left to fill, or the wallet's whole balance in the lending vault when that is less; a vault where the wallet's shares are worth nothing is skipped. A group cancelled only in part keeps its idle capital in the vault.","examples":[true],"type":"boolean"}},"required":["chain_id","wallet","wallet_kind"],"additionalProperties":false},"Cancels":{"type":"object","properties":{"offer_ids":{"type":"array","items":{"type":"string","examples":["0f0e5c4e-6a8b-4a61-9a43-1c2d3e4f5a6b"]},"description":"Every offer the payload ends, as `GET /v1/offers` lists them (a staircase is one ID, its live offer's). These are the offers selected, plus any others that share a Merkle root revoked to cancel them, which a `CANCELS_MORE` warning names. Empty when only `groups` were passed."},"groups":{"type":"array","items":{"type":"string","examples":["0x74656e6f720100c34f00000000000000000000000000000000000000000000a1"]},"description":"Groups ended in full. The protocol counts them as filled, so none of their offers can be taken again, including any Tenor has no record of."},"roots":{"type":"array","items":{"type":"object","properties":{"ratifier":{"type":"string","description":"The ratifier (the contract that validates the offers) the root is revoked on, checksummed.","examples":["0x800B5F12A61B8198a5a6EfD794Cac6699B294d63"]},"root":{"type":"string","description":"The Merkle root revoked.","examples":["0x5d1c2b3a4f5e6d7c8b9a0f1e2d3c4b5a69788796a5b4c3d2e1f0a9b8c7d6e5f4"]}},"required":["ratifier","root"]},"description":"Merkle roots revoked, which ends every offer signed under them. This is how offers are cancelled while the rest of their group stays live, such as one offer of an `oco` group."},"withdrawals":{"type":"array","items":{"type":"object","properties":{"principal":{"type":"string","description":"The most idle capital the payload withdraws to the wallet. Less when the wallet holds less. Integer string in the loan token's smallest unit.","examples":["3000000000"]},"onchain":{"type":"object","properties":{"vault":{"type":"string","description":"The lending vault the capital comes out of, checksummed.","examples":["0x8A1b2C3d4E5f60718293a4B5c6D7e8F901a2B3c4"]}},"required":["vault"]}},"required":["principal","onchain"]},"description":"With `withdraw_idle_capital`, the idle capital the payload withdraws to the wallet, one entry per lending vault. Empty otherwise."}},"required":["offer_ids","groups","roots","withdrawals"]},"Chain":{"type":"object","properties":{"chain_id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"examples":[8453]},"name":{"type":"string","examples":["Base"]},"block_time_ms":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Average time between blocks, in milliseconds.","examples":[2000]},"status":{"type":"string","enum":["operational","degraded"],"description":"The chain's current state. `degraded`: the chain's RPC or contract registry failed a check, so payloads and dry runs fail until the next check passes. Reads keep working."},"capabilities":{"type":"object","properties":{"curves":{"type":"boolean","description":"Set, preview and clear a passive quoting curve.","examples":[false]},"variable_to_fixed":{"type":"boolean","description":"Move a variable borrow to a fixed rate.","examples":[false]},"dry_run":{"type":"boolean","description":"Preview any action, even from an unfunded wallet.","examples":[false]},"safe_tx":{"type":"boolean","description":"Payloads for a Safe include a ready MultiSend transaction (`safe_tx`).","examples":[false]},"rfq":{"type":"boolean","description":"Ask market makers for a firm offer.","examples":[false]},"offers":{"type":"boolean","description":"Post firm offers, each holding its rate onchain.","examples":[false]},"idle_capital":{"type":"boolean","description":"Lend offers and lends whose waiting capital earns the market's variable rate (idle capital).","examples":[false]},"deposit_on_fill":{"type":"boolean","description":"Borrow offers whose collateral leaves the wallet only as they fill.","examples":[false]},"renew":{"type":"boolean","description":"Roll a position into a later maturity, now or at a limit rate, and renew borrows automatically.","examples":[false]},"variable":{"type":"boolean","description":"Lend, withdraw, borrow, repay and move collateral at a market's variable rate.","examples":[false]}},"required":["curves","variable_to_fixed","dry_run","safe_tx","rfq","offers","idle_capital","deposit_on_fill","renew","variable"],"description":"The features the API supports on this chain. A capability is turned on per chain as it ships, with no client release. `status` gives the chain's current state. New capabilities may be added: treat an unknown capability as off."},"contracts":{"type":"object","properties":{"midnight":{"type":"string","examples":["0xAdedD8ab6dE832766Fedf0FaC4992E5C4D3EA18A"]},"morpho_blue":{"type":"string","examples":["0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb"]},"bundler3":{"type":"string","examples":["0x6BFd8137e702540E7A42B74178A4a49Ba43920C4"]},"general_adapter1":{"type":"string","examples":["0xb98c948CFA24072e58935BC004a8A7b376AE746A"]},"tenor_adapter":{"type":"string","examples":["0x5675892d48828872fbFD2720489f98b42f48138F"]},"authorization_adapter":{"type":"string","examples":["0xDbb74BF80bD05a1959C8f21e2b821dcFEd87104C"]},"permit2":{"type":"string","examples":["0x000000000022D473030F116dDEE9F6B43aC78BA3"]},"mempool":{"type":"string","examples":["0xdD6DCE32e21f7b020898a8258dA37355b4017993"]},"market_making_policy_adapter":{"type":"string","examples":["0xAbee861f39a1d294020b1B9a6642B4D0D097526B"]},"migration_ratifier":{"type":"string","examples":["0xf96EC15aC7d0F8fa3560B6DdF9d1F9D54F31DAed"]},"rate_ratifier_v1":{"type":"string","examples":["0x3B2FbA901C88f026BF50A12c8B28484Cd81F9526"]},"setter_ratifier":{"type":"string","examples":["0x800B5F12A61B8198a5a6EfD794Cac6699B294d63"]},"price_ratifier_v1":{"type":"string","examples":["0x08a0e69772315652165921D722B3caAea4C326e6"]},"ecrecover_ratifier":{"type":"string","examples":["0xd6e70365C8E8DDa9a4ca662C07bbE663b017755E"]},"lend_vault_to_midnight_callback":{"type":"string","examples":["0xc0b438Bbf5a8cC4e57C0D81e1818C069e413DdDf"]},"lend_midnight_to_vault_callback":{"type":"string","examples":["0x1A4eD5BC9adC11a7Aa7fCB8f045A7B51604bBC50"]},"lend_midnight_renewal_callback":{"type":"string","examples":["0x93cfC1178C3cc6c315F6505C3A927B7974425188"]},"borrow_midnight_renewal_callback":{"type":"string","examples":["0x1524CB7499735379b34ba3b7C6F150808094d2d2"]},"borrow_midnight_to_blue_callback":{"type":"string","examples":["0x6Bb533CF102d164106A5F83739fd1C0078F3E2DA"]},"borrow_blue_to_midnight_callback":{"type":"string","examples":["0x7d4A92F88c22c6dD31F0fB67F27cAFC8e90f5F18"]},"borrow_blue_to_midnight_clamp":{"type":"string","examples":["0x18D126Dc1B0bf96c4D9363D689C994678db1D5fe"]},"midnight_supply_collateral_callback":{"type":"string","examples":["0x191c821B2681B098E05dd84B1e5433d194c94383"]},"midnight_supply_vault_shares_callback":{"type":"string","examples":["0xAbae3A858f53C7010D07ee930b3a0621adcFBBA8"]},"midnight_withdraw_vault_shares_callback":{"type":"string","examples":["0x519d415bf44C623B8E1226E9959E4548cb289F42"]},"midnight_withdrawable_callback":{"type":"string","examples":["0xba51eCCbA5552837e0745C168044db821D19A931"]}},"required":["midnight","morpho_blue","bundler3","general_adapter1","tenor_adapter","authorization_adapter","permit2","mempool","market_making_policy_adapter","migration_ratifier","rate_ratifier_v1","setter_ratifier","price_ratifier_v1","ecrecover_ratifier","lend_vault_to_midnight_callback","lend_midnight_to_vault_callback","lend_midnight_renewal_callback","borrow_midnight_renewal_callback","borrow_midnight_to_blue_callback","borrow_blue_to_midnight_callback","borrow_blue_to_midnight_clamp","midnight_supply_collateral_callback","midnight_supply_vault_shares_callback","midnight_withdraw_vault_shares_callback","midnight_withdrawable_callback"],"description":"Checksummed addresses of every contract a payload calls, approves or authorizes on this chain: a target outside this list isn't Tenor's. All are Tenor's but `morpho_blue` and `permit2`, which payloads also use. The same address can be a different contract on another chain, so always pair an address with its chain."}},"required":["chain_id","name","block_time_ms","status","capabilities","contracts"]},"CheckViolation":{"type":"object","properties":{"code":{"type":"string","description":"The check that failed, as named in `checks.checked`, or the safety rule within it.","examples":["WALLET_OUTFLOWS"]},"message":{"type":"string","examples":["The wallet approves 0x00000000000000000000000000000000000F0e19, outside Tenor's spenders, on 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913."]},"call_index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The call the violation is in. Left out when the violation isn't tied to one call.","examples":[2]},"details":{"description":"The token, spender or recipient, and amount the violation involves.","examples":[{"token":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","spender":"0x00000000000000000000000000000000000F0e19","amount":"5000000"}],"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message"]},"ClearCurveRequest":{"type":"object","properties":{"chain_id":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"The EVM chain ID. `GET /v1/chains` lists the chains served.","examples":[8453]},"wallet":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"The wallet that will sign and send the payload. Any address but the zero address is accepted, since a payload does nothing until that wallet signs it.","examples":["0x7A1f00000000000000000000000000000000C0de"]},"wallet_kind":{"type":"string","enum":["eoa","delegated_eoa","safe","smart_account"],"description":"How the wallet signs, which sets the shape of the payload. `eoa` sends each step as its own transaction, `delegated_eoa` (EIP-7702) batches them with `wallet_sendCalls`, `safe` runs them as one MultiSend transaction, and `smart_account` (ERC-4337 and others) as one user operation. Required: Tenor doesn't infer the wallet kind."},"dry_run":{"default":false,"description":"Preview the action with nothing to send. The simulation funds the wallet, so a dry run works before the wallet holds the tokens. Returns `status: preview_only`. Always on for test keys.","examples":[false],"type":"boolean"},"client_id":{"description":"The caller's own reference for this prepare, echoed back and logged.","examples":["desk-7:42"],"type":"string","pattern":"^[A-Za-z0-9._:-]{1,64}$"},"include_onchain":{"default":false,"description":"Also return `onchain`: the payload's calls decoded, with the result of each call in the simulation and the events they emitted. A dry run has no calldata, so `onchain` holds only the events.","examples":[false],"type":"boolean"},"market_id":{"type":"string","pattern":"^0x[0-9a-fA-F]{64}$","description":"The market whose curve to clear.","examples":["0x3f81019286c6aa6265e5823a23c4f08e0f41c953236bad782c7739eb9ee6db11"]},"vault":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"The vault the curve's lend and exit setup uses, which `disable` removes. Defaults to it. A named vault must be listed for the market's loan token and be the one the wallet's setup on the market uses (`422 VAULT_NOT_SUPPORTED`).","examples":["0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB"]},"disable":{"default":false,"description":"Also remove the lend and exit setup. Without `disable`, only the curve is cleared, and the next `POST /v1/curves/set/prepare` sets the curve in one call.","examples":[false],"type":"boolean"}},"required":["chain_id","wallet","wallet_kind","market_id"],"additionalProperties":false},"CollateralChange":{"type":"object","properties":{"token":{"type":"string","description":"The collateral token.","examples":["0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf"]},"delta":{"type":"string","description":"The change in collateral posted. Signed integer string in the token's smallest unit, negative for a decrease.","examples":["25000000"]}},"required":["token","delta"]},"Curve":{"type":"object","properties":{"chain_id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"examples":[8453]},"maker":{"type":"string","description":"The wallet, checksummed.","examples":["0x7A1f00000000000000000000000000000000C0de"]},"market_id":{"type":"string","examples":["0x3f81019286c6aa6265e5823a23c4f08e0f41c953236bad782c7739eb9ee6db11"]},"status":{"type":"string","enum":["active","paused","missing_authorization","missing_params","cleared"],"description":"`active`: the curve quotes every maturity in its window. `paused`: Tenor has halted curve quoting, so no curve quotes until quoting resumes. `missing_authorization`: the wallet revoked the curve's authorization, or the allowance its fills use. `missing_params`: the lend and exit setup is gone. `cleared`: cleared, with its last points kept. When several apply, the first of `cleared`, `missing_params`, `missing_authorization` and `paused` wins. `POST /v1/curves/set/prepare` fixes all but `paused`.","examples":["active"]},"points":{"type":"array","items":{"$ref":"#/components/schemas/CurvePoint"},"description":"1 to 8 points in ascending time to maturity. The curve's rate at any time to maturity is the straight line between the two nearest points, and the end point's rate past either end. Rates are stored onchain per second, `lend_rate` rounded up and `resell_rate` down by under 3.2e-11 a year. They read back rounded to 10 decimals, which gives the rates as set."},"window":{"anyOf":[{"type":"object","properties":{"min_time_to_maturity_s":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"examples":[3600]},"max_time_to_maturity_s":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"examples":[7776000]}},"required":["min_time_to_maturity_s","max_time_to_maturity_s"]},{"type":"null"}],"description":"The maturities the curve lends into, by time to maturity: its first and last points when it was set. `null` while the curve has no lend and exit setup."},"readiness":{"$ref":"#/components/schemas/CurveReadiness"},"onchain":{"$ref":"#/components/schemas/CurveOnchain"}},"required":["chain_id","maker","market_id","status","points","window","readiness","onchain"]},"CurveClear":{"type":"object","properties":{"mode":{"type":"string","enum":["clear","disable"],"description":"`clear`: removes only the curve, so nothing is quoted. `disable`: removes the curve and its lend and exit setup.","examples":["clear"]}},"required":["mode"]},"CurveLendQuote":{"type":"object","properties":{"status":{"type":"string","enum":["quoted","not_quoted"],"description":"`quoted`: Tenor holds a takeable offer that lends from the vault on this maturity.","examples":["quoted"]},"available":{"anyOf":[{"type":"string","description":"The principal a borrower can take now: the idle capital, minus the fee and the part the lending vault can't pay out. `null` when not quoted. Integer string in the loan token's smallest unit.","examples":["25000000000"]},{"type":"null"}]},"reason":{"description":"Why this side isn't quoted, or why it quotes less than it could. New codes can be added. Codes include `OUTSIDE_WINDOW` (the maturity is outside the curve's window), `UNFUNDED` (no idle capital), `NO_VAULT_LIQUIDITY` (the vault can't pay out the wallet's shares now, because its markets are lent out), `MISSING_AUTHORIZATION`, `MISSING_APPROVAL`, `MISSING_PARAMS`, `POLICY_PAUSED`, `CURVE_CLEARED`, `PENDING` (Tenor can't tell yet), `NOT_QUOTED` (no offer yet; Tenor reads a new curve within a minute) and `UNAVAILABLE` (nothing is quoted, and Tenor's quote engine gives no reason). `null` when nothing limits the quote.","examples":["OUTSIDE_WINDOW"],"type":["string","null"]}},"required":["status","available","reason"]},"CurveMaturity":{"type":"object","properties":{"maturity_id":{"type":"string","examples":["0x9c1e7f4a0b2d3e5f6a7b8c9d0e1f2a3b4c5d6e7f8091a2b3c4d5e6f708192a3b"]},"matures_at":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"examples":[1798243200]},"time_to_maturity_s":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"examples":[5184000]},"lend_rate":{"anyOf":[{"type":"string","description":"The curve's lend rate on this maturity at `meta.block_number`, before fees. `null` when the curve holds no points. The live offer is priced on the market's tick grid, rounded in the maker's favour by up to one tick step, and its take rate also counts the continuous fee. Annual rate as a decimal fraction (\"0.052\" = 5.2%).","examples":["0.0525"]},{"type":"null"}]},"resell_rate":{"anyOf":[{"type":"string","description":"The curve's exit rate on this maturity at `meta.block_number`, before fees. `null` when the curve holds no points. Annual rate as a decimal fraction (\"0.052\" = 5.2%).","examples":["0.0425"]},{"type":"null"}]},"lend":{"$ref":"#/components/schemas/CurveLendQuote"},"resell":{"anyOf":[{"$ref":"#/components/schemas/CurveResellQuote"},{"type":"null"}],"description":"`null` unless Tenor holds an offer reselling the wallet's lend on this maturity."}},"required":["maturity_id","matures_at","time_to_maturity_s","lend_rate","resell_rate","lend","resell"]},"CurveMaturityRate":{"type":"object","properties":{"maturity_id":{"type":"string","examples":["0x9c1e7f4a0b2d3e5f6a7b8c9d0e1f2a3b4c5d6e7f8091a2b3c4d5e6f708192a3b"]},"matures_at":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"examples":[1798243200]},"lend_rate":{"type":"string","description":"The rate the curve lends at on this maturity now, before fees. Annual rate as a decimal fraction (\"0.052\" = 5.2%).","examples":["0.0525"]},"resell_rate":{"type":"string","description":"The curve's exit rate on this maturity now, before fees. Annual rate as a decimal fraction (\"0.052\" = 5.2%).","examples":["0.0425"]},"in_window":{"type":"boolean","description":"Whether the maturity is inside the curve's window, so the curve lends into it.","examples":[true]}},"required":["maturity_id","matures_at","lend_rate","resell_rate","in_window"]},"CurveOnchain":{"type":"object","properties":{"policy":{"type":"string","description":"The contract that holds the curve's points.","examples":["0xABE1ccB0C5Bc0B30976d9435084Af9a7d8Fe5107"]},"vault":{"type":"string","description":"The vault the curve lends from and returns exit proceeds to: the vault its setup uses, or else the market's lending vault.","examples":["0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB"]}},"required":["policy","vault"]},"CurvePoint":{"type":"object","properties":{"time_to_maturity_s":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The time to maturity this point applies to, in seconds.","examples":[2592000]},"lend_rate":{"type":"string","description":"The rate the maker lends at on a maturity this far from maturing: the rate a borrower gets. Annual rate as a decimal fraction (\"0.052\" = 5.2%).","examples":["0.05"]},"resell_rate":{"type":"string","description":"The exit rate: the rate the maker resells its fixed lends at on a maturity this far from maturing. Below `lend_rate`. Annual rate as a decimal fraction (\"0.052\" = 5.2%).","examples":["0.04"]}},"required":["time_to_maturity_s","lend_rate","resell_rate"]},"CurvePreview":{"type":"object","properties":{"curve":{"$ref":"#/components/schemas/Curve"},"maturities":{"type":"array","items":{"$ref":"#/components/schemas/CurveMaturity"},"description":"Every maturity of the market not yet matured, earliest first. Deprecated maturities are included, since the curve quotes them too."}},"required":["curve","maturities"]},"CurveReadiness":{"type":"object","properties":{"authorized":{"type":"boolean","description":"Whether the wallet has authorized the contract that validates the curve's offers.","examples":[true]},"approved":{"type":"boolean","description":"Whether the wallet has approved the curve's vault shares, for at least its share balance, to the contract that pulls the shares on each fill.","examples":[true]},"idle_capital":{"type":"string","description":"The idle capital the wallet holds in the curve's vault, which the curve's fills lend from. Every curve on that vault uses this same balance. Integer string in the loan token's smallest unit.","examples":["25000000000"]}},"required":["authorized","approved","idle_capital"]},"CurveResellQuote":{"type":"object","properties":{"status":{"type":"string","enum":["quoted","not_quoted"],"description":"`quoted`: Tenor holds a takeable offer that resells the wallet's lend on this maturity.","examples":["quoted"]},"available":{"anyOf":[{"type":"string","description":"The amount the wallet's lend on this maturity resells for now. `null` when not quoted. Integer string in the loan token's smallest unit.","examples":["25000000000"]},{"type":"null"}]},"reason":{"description":"Why this side isn't quoted, or why it quotes less than it could. New codes can be added. Codes include `OUTSIDE_WINDOW` (the maturity is outside the curve's window), `UNFUNDED` (no idle capital), `NO_VAULT_LIQUIDITY` (the vault can't pay out the wallet's shares now, because its markets are lent out), `MISSING_AUTHORIZATION`, `MISSING_APPROVAL`, `MISSING_PARAMS`, `POLICY_PAUSED`, `CURVE_CLEARED`, `PENDING` (Tenor can't tell yet), `NOT_QUOTED` (no offer yet; Tenor reads a new curve within a minute) and `UNAVAILABLE` (nothing is quoted, and Tenor's quote engine gives no reason). `null` when nothing limits the quote.","examples":["OUTSIDE_WINDOW"],"type":["string","null"]}},"required":["status","available","reason"]},"CurveWrite":{"type":"object","properties":{"mode":{"type":"string","enum":["enable","reprice"],"description":"`reprice`: writes only the curve, in one call, since the setup is in place. `enable`: writes the curve with its setup (authorizations, the allowance its fills use, the lend and exit setup) and any `fund` deposit.","examples":["enable"]},"points":{"type":"array","items":{"$ref":"#/components/schemas/CurvePoint"},"description":"The points as they will read back. They are stored per second, `lend_rate` rounded up and `resell_rate` down by under 3.2e-11 a year, and shown to 10 decimals."},"maturities":{"type":"array","items":{"$ref":"#/components/schemas/CurveMaturityRate"},"description":"The curve's quote on each maturity of the market not yet matured, once the payload is included in a block."}},"required":["mode","points","maturities"]},"DbCheck":{"type":"object","properties":{"status":{"type":"string","enum":["up","down"]},"latency_ms":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Check duration in milliseconds.","examples":[4]}},"required":["status","latency_ms"]},"DepthLevel":{"type":"object","properties":{"rate":{"type":"string","description":"The level's rate, rounded toward zero to `bucket_bps`. Annual rate as a decimal fraction (\"0.052\" = 5.2%).","examples":["0.05"]},"liquidity":{"type":"string","description":"The principal available at this level. Integer string in the loan token's smallest unit.","examples":["84614479526"]},"cumulative_liquidity":{"type":"string","description":"The principal from the best level through this one. Integer string in the loan token's smallest unit.","examples":["567738664865"]}},"required":["rate","liquidity","cumulative_liquidity"]},"ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Stable error code to branch on. New codes may be added; handle unknown ones by `treatment`.","examples":["INVALID_PARAMS"]},"category":{"type":"string","enum":["validation","auth","not_found","state","liquidity","account","simulation","rate_limit","upstream","internal"]},"treatment":{"type":"string","enum":["fix_request","refetch_state","fund_account","retry"],"description":"The next step: fix the request, refetch state, fund the account, or retry."},"message":{"type":"string","description":"A readable explanation. For a validation error, the first problem. Don't parse the message.","examples":["size.principal must be a positive integer string in the token's smallest unit"]},"details":{"description":"Context for the code. A validation error lists every problem in `issues`, each with a `location` (`body`, `query` or `path`), the `path` to the field (`size.principal`), a short `code` (`missing` for a required field left out, `unknown_field` for a field the request doesn't take) and a `message`.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"request_id":{"type":"string","description":"The request's ID, also sent as `X-Request-Id`.","examples":["req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"]}},"required":["code","category","treatment","message","request_id"]}},"required":["error"]},"Fill":{"type":"object","properties":{"fill_id":{"type":"string","description":"`<chain_id>:<tx_hash>:<log_index>:<side>`. Stable, so a client can drop a fill it already has.","examples":["8453:0x5a2b9e0f1c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f60718293a4b5c6d7:212:lend"]},"chain_id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"examples":[8453]},"maturity_id":{"type":"string","description":"The maturity of the fill.","examples":["0x9c1e7f4a0b2d3e5f6a7b8c9d0e1f2a3b4c5d6e7f8091a2b3c4d5e6f708192a3b"]},"side":{"type":"string","enum":["lend","borrow"],"description":"Whether the wallet lent or borrowed in this fill."},"role":{"type":"string","enum":["maker","taker"],"description":"`maker`: one of the wallet's offers was taken. `taker`: the wallet took an offer."},"group":{"description":"The `group` of the maker's offer that filled, the same value as on the offer. `null` on an older fill until Tenor records it.","examples":["0x74656e6f720100c34f00000000000000000000000000000000000000000000a1"],"type":["string","null"]},"size":{"$ref":"#/components/schemas/FillSize"},"settlement_fee":{"anyOf":[{"type":"string","description":"The settlement fee the lender paid on top of the amount the borrower received. `null` when Tenor can't determine the fee. Integer string in the loan token's smallest unit.","examples":["1250000"]},{"type":"null"}]},"rate":{"anyOf":[{"type":"string","description":"The rate the wallet got: from its own principal to the amount at maturity, over the time left. `null` for a fill at or after maturity. Annual rate as a decimal fraction (\"0.052\" = 5.2%).","examples":["0.0521"]},{"type":"null"}]},"counterparty":{"description":"The wallet on the other side of the fill.","examples":["0x7A1f00000000000000000000000000000000C0de"],"type":["string","null"]},"block_number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"examples":[52872640]},"log_index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"examples":[212]},"filled_at":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The block's time. Unix seconds.","examples":[1792627200]},"tx_hash":{"type":"string","examples":["0x5a2b9e0f1c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f60718293a4b5c6d7"]}},"required":["fill_id","chain_id","maturity_id","side","role","group","size","settlement_fee","rate","counterparty","block_number","log_index","filled_at","tx_hash"]},"FillSize":{"type":"object","properties":{"principal":{"type":"string","description":"The principal for this wallet: the amount the lender paid, settlement fee included, or the amount the borrower received. Integer string in the loan token's smallest unit.","examples":["10000000000"]},"amount_at_maturity":{"type":"string","description":"The amount the fill adds to the amount owed at maturity. Integer string in the loan token's smallest unit.","examples":["10050000000"]}},"required":["principal","amount_at_maturity"]},"Health":{"type":"object","properties":{"status":{"type":"string","enum":["ok","degraded"],"description":"`degraded` when any dependency is down."},"checks":{"type":"object","properties":{"db":{"$ref":"#/components/schemas/DbCheck"},"rpc":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/RpcCheck"},"description":"One check per enabled chain, keyed by chain ID."},"router":{"$ref":"#/components/schemas/RouterCheck"},"registry":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/RegistryCheck"},"description":"One check per enabled chain, keyed by chain ID: whether the SDK's contract registry and the indexer agree."}},"required":["db","rpc","router","registry"]}},"required":["status","checks"]},"LendPrepareRequest":{"type":"object","properties":{"chain_id":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"The EVM chain ID. `GET /v1/chains` lists the chains served.","examples":[8453]},"wallet":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"The wallet that will sign and send the payload. Any address but the zero address is accepted, since a payload does nothing until that wallet signs it.","examples":["0x7A1f00000000000000000000000000000000C0de"]},"wallet_kind":{"type":"string","enum":["eoa","delegated_eoa","safe","smart_account"],"description":"How the wallet signs, which sets the shape of the payload. `eoa` sends each step as its own transaction, `delegated_eoa` (EIP-7702) batches them with `wallet_sendCalls`, `safe` runs them as one MultiSend transaction, and `smart_account` (ERC-4337 and others) as one user operation. Required: Tenor doesn't infer the wallet kind."},"limit_rate":{"description":"The worst rate the wallet accepts, at most 1 (100%). Enforced onchain: a worse fill reverts. A minimum when lending or repaying, and a maximum when borrowing or reselling. Default: the quote's worst rate, moved against the wallet by 0.10 percentage points for `eoa` and `delegated_eoa`, or 0.30 for `safe` and `smart_account`, which sign later. Annual rate as a decimal fraction (\"0.052\" = 5.2%).","examples":["0.045"],"type":"string","pattern":"^(0|[1-9]\\d*)(\\.\\d{1,18})?$"},"deadline_at":{"description":"The last moment the payload can be included in a block, enforced onchain. At least 60 s away, and within the wallet kind's signing window (5 min for `eoa` and `delegated_eoa`, 30 min for `safe` and `smart_account`). Default: the end of that window. Unix seconds.","examples":[1791561900],"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"dry_run":{"default":false,"description":"Preview the action with nothing to send. The simulation funds the wallet, so a dry run works before the wallet holds the tokens. Returns `status: preview_only`. Always on for test keys.","examples":[false],"type":"boolean"},"client_id":{"description":"The caller's own reference for this prepare, echoed back and logged.","examples":["desk-7:42"],"type":"string","pattern":"^[A-Za-z0-9._:-]{1,64}$"},"include_onchain":{"default":false,"description":"Also return `onchain`: the payload's calls decoded, with the result of each call in the simulation and the events they emitted. A dry run has no calldata, so `onchain` holds only the events.","examples":[false],"type":"boolean"},"maturity_id":{"type":"string","pattern":"^0x[0-9a-fA-F]{64}$","description":"The maturity to lend on. `GET /v1/markets` lists them.","examples":["0x9c1e7f4a0b2d3e5f6a7b8c9d0e1f2a3b4c5d6e7f8091a2b3c4d5e6f708192a3b"]},"size":{"$ref":"#/components/schemas/LendSize"},"post_rest":{"$ref":"#/components/schemas/PostRest"}},"required":["chain_id","wallet","wallet_kind","maturity_id","size"],"additionalProperties":false},"LendSize":{"anyOf":[{"type":"object","properties":{"principal":{"type":"string","pattern":"^[1-9]\\d*$","description":"The amount the wallet lends now. The amount at maturity follows from the rate.","examples":["5000000"]}},"required":["principal"],"additionalProperties":false},{"type":"object","properties":{"amount_at_maturity":{"type":"string","pattern":"^[1-9]\\d*$","description":"The amount the wallet gets back at maturity. The principal follows from the rate. The payload pulls at most the principal `limit_rate` allows, and returns the rest in the same transaction.","examples":["5020050"]}},"required":["amount_at_maturity"],"additionalProperties":false}],"description":"Exactly one of `principal` or `amount_at_maturity`, in the loan token's smallest unit."},"Live":{"type":"object","properties":{"status":{"type":"string","const":"ok"}},"required":["status"]},"ManageDeposit":{"type":"object","properties":{"token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"A collateral token of the market. A `yield_shares` collateral isn't accepted here.","examples":["0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf"]},"amount":{"type":"string","pattern":"^[1-9]\\d*$","description":"The amount to deposit. The payload pulls the full amount. Integer string in the token's smallest unit.","examples":["250000"]}},"required":["token","amount"],"additionalProperties":false,"description":"Collateral to add to the borrow. Accepted before any borrow exists, on deprecated maturities and after maturity."},"ManagePrepareRequest":{"type":"object","properties":{"chain_id":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"The EVM chain ID. `GET /v1/chains` lists the chains served.","examples":[8453]},"wallet":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"The wallet that will sign and send the payload. Any address but the zero address is accepted, since a payload does nothing until that wallet signs it.","examples":["0x7A1f00000000000000000000000000000000C0de"]},"wallet_kind":{"type":"string","enum":["eoa","delegated_eoa","safe","smart_account"],"description":"How the wallet signs, which sets the shape of the payload. `eoa` sends each step as its own transaction, `delegated_eoa` (EIP-7702) batches them with `wallet_sendCalls`, `safe` runs them as one MultiSend transaction, and `smart_account` (ERC-4337 and others) as one user operation. Required: Tenor doesn't infer the wallet kind."},"dry_run":{"default":false,"description":"Preview the action with nothing to send. The simulation funds the wallet, so a dry run works before the wallet holds the tokens. Returns `status: preview_only`. Always on for test keys.","examples":[false],"type":"boolean"},"client_id":{"description":"The caller's own reference for this prepare, echoed back and logged.","examples":["desk-7:42"],"type":"string","pattern":"^[A-Za-z0-9._:-]{1,64}$"},"include_onchain":{"default":false,"description":"Also return `onchain`: the payload's calls decoded, with the result of each call in the simulation and the events they emitted. A dry run has no calldata, so `onchain` holds only the events.","examples":[false],"type":"boolean"},"maturity_id":{"type":"string","pattern":"^0x[0-9a-fA-F]{64}$","description":"The maturity the wallet borrows on, or is about to borrow on.","examples":["0x9c1e7f4a0b2d3e5f6a7b8c9d0e1f2a3b4c5d6e7f8091a2b3c4d5e6f708192a3b"]},"deposit_collateral":{"$ref":"#/components/schemas/ManageDeposit"},"withdraw_collateral":{"$ref":"#/components/schemas/ManageWithdrawal"},"renewal":{"description":"Change the market's auto-renewal, on its own or with a collateral change. Turning auto-renewal on needs a borrow on this maturity.","$ref":"#/components/schemas/RenewalSettings"}},"required":["chain_id","wallet","wallet_kind","maturity_id"],"additionalProperties":false},"ManageWithdrawal":{"type":"object","properties":{"token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"A collateral token the wallet has posted on this maturity. A `yield_shares` collateral isn't accepted here.","examples":["0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf"]},"amount":{"type":"string","pattern":"^[1-9]\\d*$","description":"The amount to withdraw. Leave `amount` out to withdraw all of this collateral. Integer string in the token's smallest unit.","examples":["100000"]}},"required":["token"],"additionalProperties":false,"description":"Collateral to withdraw. Rejected when the remaining collateral couldn't carry the debt. The error's `details.max_amount` is the most the wallet can withdraw."},"Market":{"type":"object","properties":{"market_id":{"type":"string","description":"The market's ID, unique per chain.","examples":["0x3f81019286c6aa6265e5823a23c4f08e0f41c953236bad782c7739eb9ee6db11"]},"chain_id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"examples":[8453]},"listing":{"type":"string","enum":["listed","otc"],"description":"`listed`: a market Tenor curates, on a regular maturity cadence. `otc`: any other market whose loan token and collateral tokens are all whitelisted, whose oracles scale by its tokens' decimals, and that has no enter or liquidator gate. An OTC market's maturities are the ones offers name. Tenor doesn't review OTC markets: check their oracles and LLTVs before trading."},"loan_token":{"$ref":"#/components/schemas/Token"},"structure":{"type":"string","enum":["plain","loan_token","yield"],"description":"The collateral a borrower can post. `plain`: the collateral token. `loan_token`: the collateral token, or the loan token itself. `yield`: the collateral token, or `yield_shares` that earn this market's variable rate, so posted collateral keeps earning."},"collaterals":{"type":"array","items":{"type":"object","properties":{"token":{"$ref":"#/components/schemas/Token"},"kind":{"type":"string","enum":["token","loan_token","yield_shares"],"description":"`yield_shares`: vault shares that keep earning while posted."},"lltv":{"type":"string","description":"The LLTV: the loan-to-value at which a borrow against this collateral can be liquidated. Decimal fraction string (\"0.86\" = 86%).","examples":["0.86"]},"oracle":{"type":"string","description":"The price oracle for this collateral.","examples":["0x663BECd10daE6C4A3Dcd89F1d76c1174199639B9"]},"onchain":{"type":"object","properties":{"liquidation_cursor":{"type":"string","description":"The liquidation cursor of Morpho Midnight, the Morpho fixed-rate protocol Tenor is built on. It sets the liquidation incentive from the LLTV. Decimal fraction string (\"0.86\" = 86%).","examples":["0.3"]}},"required":["liquidation_cursor"]}},"required":["token","kind","lltv","oracle","onchain"]},"description":"Every token a borrower can post."},"variable":{"anyOf":[{"type":"object","properties":{"variable_market_id":{"type":"string","description":"The variable market behind this market's variable rate.","examples":["0x9103c3b4e834476c9a62ea009ba2c884ee42e94e6e314a26f04d312434191836"]},"collateral_token":{"type":"string","description":"The only token a variable borrow can post as collateral.","examples":["0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf"]},"lltv":{"type":"string","description":"The variable borrow's LLTV. Decimal fraction string (\"0.86\" = 86%).","examples":["0.86"]},"oracle":{"type":"string","description":"The variable borrow's price oracle.","examples":["0x663BECd10daE6C4A3Dcd89F1d76c1174199639B9"]},"onchain":{"type":"object","properties":{"irm":{"type":"string","description":"The interest rate model of the Morpho variable rate.","examples":["0x46415998764C29aB2a25CbeA6254146D50D22687"]}},"required":["irm"]}},"required":["variable_market_id","collateral_token","lltv","oracle","onchain"]},{"type":"null"}],"description":"The market's variable rate. `null` when it has none."},"maturities":{"type":"array","items":{"$ref":"#/components/schemas/Maturity"},"description":"Maturities open for new lends and borrows, earliest first. Deprecated maturities are listed only with `include_deprecated`."},"state":{"type":"object","properties":{"total_borrowed":{"type":"string","description":"Principal borrowed across every maturity. Integer string in the loan token's smallest unit.","examples":["250000000000"]}},"required":["total_borrowed"]},"tags":{"type":"array","items":{"type":"string"},"description":"Labels for grouping, such as `STABLE` or `BTC`.","examples":[["BTC","STABLE"]]},"status":{"type":"string","enum":["active","deprecated"]},"deprecated_at":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"When the market or maturity was deprecated, in Unix seconds. `null` when it isn't deprecated. Tenor is phasing out a deprecated market or maturity: Tenor no longer lists it, and its liquidity runs off. It still trades, and a prepare that adds exposure to it carries a `MARKET_DEPRECATED` warning.","examples":[null]},"onchain":{"type":"object","properties":{"rcf_threshold":{"type":"string","description":"Midnight's recovery close factor floor: a liquidation that would leave collateral worth less than this amount may take the whole position. Integer string in the loan token's smallest unit.","examples":["50000000"]},"enter_gate":{"type":"string","description":"Midnight's enter gate. The zero address when there is none.","examples":["0x0000000000000000000000000000000000000000"]},"liquidator_gate":{"type":"string","description":"Midnight's liquidator gate. The zero address when there is none.","examples":["0x0000000000000000000000000000000000000000"]},"lending_vault":{"anyOf":[{"type":"string","description":"The lending vault that holds variable lends and idle capital. `null` when there is none.","examples":["0x29f5cD67E543db9aC652eF9327009Db8Df1FD943"]},{"type":"null"}]}},"required":["rcf_threshold","enter_gate","liquidator_gate","lending_vault"]}},"required":["market_id","chain_id","listing","loan_token","structure","collaterals","variable","maturities","state","tags","status","deprecated_at","onchain"]},"MarketDepth":{"type":"object","properties":{"chain_id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"examples":[8453]},"maturity_id":{"type":"string","examples":["0x9c1e7f4a0b2d3e5f6a7b8c9d0e1f2a3b4c5d6e7f8091a2b3c4d5e6f708192a3b"]},"bucket_bps":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The level width used.","examples":[25]},"lend_offers":{"type":"array","items":{"$ref":"#/components/schemas/DepthLevel"},"description":"Levels of offers made by lenders, which a caller borrows from, lowest rate first."},"borrow_offers":{"type":"array","items":{"$ref":"#/components/schemas/DepthLevel"},"description":"Levels of offers made by borrowers, which a caller lends into, highest rate first."},"best_borrow_rate":{"anyOf":[{"type":"string","description":"The lowest rate in `lend_offers`: the rate borrowing pays now. `null` when there are no lend offers. A maturity with withdrawable liquidity carries a 0% lend offer (`syn:withdrawable:<maturity_id>`), so this can be `0`. Annual rate as a decimal fraction (\"0.052\" = 5.2%).","examples":["0.0125"]},{"type":"null"}]},"best_lend_rate":{"anyOf":[{"type":"string","description":"The highest rate in `borrow_offers`: the rate lending earns now. `null` when there are no borrow offers. Annual rate as a decimal fraction (\"0.052\" = 5.2%).","examples":["0.0098"]},{"type":"null"}]},"mid_rate":{"anyOf":[{"type":"string","description":"Halfway between the two best rates. `null` unless both sides have offers. Annual rate as a decimal fraction (\"0.052\" = 5.2%).","examples":["0.01115"]},{"type":"null"}]},"spread":{"anyOf":[{"type":"string","description":"`best_borrow_rate` minus `best_lend_rate`. `null` unless both sides have offers. Negative when the 0% withdrawable offer sits below the best borrow offer. Annual rate as a decimal fraction (\"0.052\" = 5.2%).","examples":["0.0027"]},{"type":"null"}]}},"required":["chain_id","maturity_id","bucket_bps","lend_offers","borrow_offers","best_borrow_rate","best_lend_rate","mid_rate","spread"]},"MarketTermStructure":{"type":"object","properties":{"chain_id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"examples":[8453]},"market_id":{"type":"string","examples":["0x3f81019286c6aa6265e5823a23c4f08e0f41c953236bad782c7739eb9ee6db11"]},"variable":{"anyOf":[{"$ref":"#/components/schemas/VariableRates"},{"type":"null"}],"description":"The market's variable rates. `null` when the market has no variable rate."},"maturities":{"type":"array","items":{"$ref":"#/components/schemas/TermStructureMaturity"},"description":"Every maturity not yet matured, earliest first."}},"required":["chain_id","market_id","variable","maturities"]},"Maturity":{"type":"object","properties":{"maturity_id":{"type":"string","description":"The maturity's ID, unique per chain.","examples":["0x9c1e7f4a0b2d3e5f6a7b8c9d0e1f2a3b4c5d6e7f8091a2b3c4d5e6f708192a3b"]},"market_id":{"type":"string","examples":["0x3f81019286c6aa6265e5823a23c4f08e0f41c953236bad782c7739eb9ee6db11"]},"chain_id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"examples":[8453]},"listing":{"type":"string","enum":["listed","otc"],"description":"The market's listing; see `Market.listing`."},"matures_at":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"When positions in this maturity come due, in Unix seconds.","examples":[1795190400]},"time_to_maturity_s":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Seconds left until `matures_at`. 0 once matured.","examples":[3628800]},"status":{"type":"string","enum":["active","matured","deprecated"],"description":"`active`: open for new lends and borrows. `matured`: past `matures_at`, so lenders redeem. `deprecated`: being phased out before maturity. A deprecated maturity still trades, with a `MARKET_DEPRECATED` warning on prepares that add exposure."},"deprecated_at":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"When the market or maturity was deprecated, in Unix seconds. `null` when it isn't deprecated. Tenor is phasing out a deprecated market or maturity: Tenor no longer lists it, and its liquidity runs off. It still trades, and a prepare that adds exposure to it carries a `MARKET_DEPRECATED` warning.","examples":[null]},"fees":{"type":"object","properties":{"settlement_fee_rate":{"type":"string","description":"The settlement fee a fill pays right now, as a share of its principal. Not annualized, and it depends on the time to maturity. Decimal fraction string (\"0.86\" = 86%).","examples":["0"]},"continuous_fee_rate":{"type":"string","description":"The continuous fee, as an annual rate taken from the amount lenders are owed at maturity. Decimal fraction string (\"0.86\" = 86%).","examples":["0"]}},"required":["settlement_fee_rate","continuous_fee_rate"]},"state":{"type":"object","properties":{"total_borrowed":{"type":"string","description":"Total principal borrowed on this maturity. Integer string in the loan token's smallest unit.","examples":["125000000000"]},"total_amount_at_maturity":{"type":"string","description":"The total amount lenders are owed at maturity. Integer string in the loan token's smallest unit.","examples":["127500000000"]},"redeemable":{"type":"string","description":"The total amount lenders can collect right now. Repayments and liquidations add to it, even before maturity. Integer string in the loan token's smallest unit.","examples":["0"]},"total_bad_debt":{"type":"string","description":"Debt left unpaid after liquidations. Integer string in the loan token's smallest unit.","examples":["0"]}},"required":["total_borrowed","total_amount_at_maturity","redeemable","total_bad_debt"],"description":"Totals from onchain events, refreshed every few seconds. They can lag the chain slightly."},"onchain":{"type":"object","properties":{"tick_spacing":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Offers on this maturity sit on ticks that are a multiple of this spacing.","examples":[4]},"settlement_fees_wad":{"type":"array","items":{"type":"string","examples":["0"]},"description":"Settlement fees at 0, 1, 7, 30, 90, 180 and 360 days to maturity, in WAD (18-decimal fixed point: 1e18 = 1). The fee in between is linear."},"continuous_fee_wad":{"type":"string","description":"The continuous fee per second, in WAD.","examples":["0"]}},"required":["tick_spacing","settlement_fees_wad","continuous_fee_wad"]}},"required":["maturity_id","market_id","chain_id","listing","matures_at","time_to_maturity_s","status","deprecated_at","fees","state","onchain"]},"MigratePrepareRequest":{"type":"object","properties":{"chain_id":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"The EVM chain ID. `GET /v1/chains` lists the chains served.","examples":[8453]},"wallet":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"The wallet that will sign and send the payload. Any address but the zero address is accepted, since a payload does nothing until that wallet signs it.","examples":["0x7A1f00000000000000000000000000000000C0de"]},"wallet_kind":{"type":"string","enum":["eoa","delegated_eoa","safe","smart_account"],"description":"How the wallet signs, which sets the shape of the payload. `eoa` sends each step as its own transaction, `delegated_eoa` (EIP-7702) batches them with `wallet_sendCalls`, `safe` runs them as one MultiSend transaction, and `smart_account` (ERC-4337 and others) as one user operation. Required: Tenor doesn't infer the wallet kind."},"limit_rate":{"description":"The worst rate the wallet accepts, at most 1 (100%). Enforced onchain: a worse fill reverts. A minimum when lending or repaying, and a maximum when borrowing or reselling. Default: the quote's worst rate, moved against the wallet by 0.10 percentage points for `eoa` and `delegated_eoa`, or 0.30 for `safe` and `smart_account`, which sign later. Annual rate as a decimal fraction (\"0.052\" = 5.2%).","examples":["0.045"],"type":"string","pattern":"^(0|[1-9]\\d*)(\\.\\d{1,18})?$"},"deadline_at":{"description":"The last moment the payload can be included in a block, enforced onchain. At least 60 s away, and within the wallet kind's signing window (5 min for `eoa` and `delegated_eoa`, 30 min for `safe` and `smart_account`). Default: the end of that window. Unix seconds.","examples":[1791561900],"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"dry_run":{"default":false,"description":"Preview the action with nothing to send. The simulation funds the wallet, so a dry run works before the wallet holds the tokens. Returns `status: preview_only`. Always on for test keys.","examples":[false],"type":"boolean"},"client_id":{"description":"The caller's own reference for this prepare, echoed back and logged.","examples":["desk-7:42"],"type":"string","pattern":"^[A-Za-z0-9._:-]{1,64}$"},"include_onchain":{"default":false,"description":"Also return `onchain`: the payload's calls decoded, with the result of each call in the simulation and the events they emitted. A dry run has no calldata, so `onchain` holds only the events.","examples":[false],"type":"boolean"},"market_id":{"type":"string","pattern":"^0x[0-9a-fA-F]{64}$","description":"The market whose variable borrow to move, as `/v1/variable/*` takes it. The wallet's whole borrow at the market's variable rate (`variable` in `GET /v1/markets`) moves.","examples":["0x74656e6f72000000000000000000000000000000000000000000000000000001"]},"target_maturity_id":{"type":"string","pattern":"^0x[0-9a-fA-F]{64}$","description":"A maturity of the same market to move the borrow into. `GET /v1/markets` lists them.","examples":["0x4d2a8b6c0e1f3a5b7c9d1e3f5a7b9c1d3e5f7a9b1c3d5e7f9a1b3c5d7e9f1a2b"]},"mode":{"default":"spot","description":"`spot`: take offers now, bounded onchain by `limit_rate` and `deadline_at`. `limit`: post an offer at `limit_rate` until `expires_at`. Each fill rolls the share of the position it fills.","examples":["spot"],"type":"string","enum":["spot","limit"]},"expires_at":{"description":"When the offer stops being takeable, at least 60 s away. Required with `limit`, and only used there. The offer stops at the target's maturity if that comes first. Unix seconds.","examples":[1791648000],"type":"integer","exclusiveMinimum":0,"maximum":9999999999}},"required":["chain_id","wallet","wallet_kind","market_id","target_maturity_id"],"additionalProperties":false},"Offer":{"type":"object","properties":{"offer_id":{"type":"string","description":"The ID to pass to `POST /v1/take/prepare` or `GET /v1/offers/{offer_id}`. For a staircase, this is the offer that is live now (or the next one), so the ID changes as each window ends.","examples":["0f0e5c4e-6a8b-4a61-9a43-1c2d3e4f5a6b"]},"chain_id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"examples":[8453]},"market_id":{"description":"`null` when Tenor's records don't hold the offer's market.","examples":["0x3f81019286c6aa6265e5823a23c4f08e0f41c953236bad782c7739eb9ee6db11"],"type":["string","null"]},"maturity_id":{"type":"string","examples":["0x9c1e7f4a0b2d3e5f6a7b8c9d0e1f2a3b4c5d6e7f8091a2b3c4d5e6f708192a3b"]},"matures_at":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"When positions on this maturity come due. Unix seconds.","examples":[1795190400]},"served":{"type":"boolean","description":"`false` when the API doesn't serve the offer's maturity: the offer can't be taken through the API, and has no `take_rate`, but it can still fill elsewhere until it ends. It is listed so a maker sees every offer a cancel can end.","examples":[true]},"side":{"type":"string","enum":["lend","borrow"],"description":"The maker's side. A taker borrows from a `lend` offer and lends into a `borrow` offer."},"maker":{"type":"string","description":"Checksummed.","examples":["0x7A1f00000000000000000000000000000000C0de"]},"rate":{"anyOf":[{"type":"string","description":"The maker's rate, before fees. For an offer that holds a rate onchain, this is that rate. In `GET /v1/offers`, a staircase shows the rate the maker set. A renewal's rate counts from the maturity of the position it renews. A renewal taken before then spreads the same amount over more time, so its `take_rate` is lower. `null` for a curve offer with nothing takeable right now. The rate a taker gets is `take_rate`. Annual rate as a decimal fraction (\"0.052\" = 5.2%).","examples":["0.0509"]},{"type":"null"}]},"take_rate":{"anyOf":[{"type":"string","description":"The rate a taker gets from this offer now, before fees: the best rate the chain accepts for a take included in a block in the next 5 minutes. Takes fill on the market's rate steps, so for an offer that holds a rate onchain, `take_rate` is slightly worse for the taker than `rate`. A staircase is taken at its live offer's rate. `null` unless the offer is `open` or `partially_filled`, and `null` when no rate qualifies. Annual rate as a decimal fraction (\"0.052\" = 5.2%).","examples":["0.0515"]},{"type":"null"}]},"size":{"anyOf":[{"$ref":"#/components/schemas/OfferSize"},{"type":"null"}],"description":"`null` when the offer has no cap of its own, as for a curve offer or capital lent from a variable market. `takeable_principal` then gives the amount the offer can fill."},"takeable_principal":{"anyOf":[{"type":"string","description":"The principal a taker could take right now, given the maker's balance, allowance and health. `null` when Tenor can't compute it yet, because the offer hasn't started or Tenor hasn't checked the offer. Integer string in the loan token's smallest unit.","examples":["600000000"]},{"type":"null"}]},"window":{"$ref":"#/components/schemas/OfferWindow"},"status":{"type":"string","enum":["open","partially_filled","scheduled","invalid","filled","cancelled","expired"],"description":"`scheduled`: posted, but the window hasn't started. `invalid`: inside its window but not takeable now. `reasons` gives the cause, and the offer can recover. `filled`, `cancelled` and `expired` are final, and the offer is served only briefly after reaching one."},"reasons":{"type":"array","items":{"type":"string","examples":["INSUFFICIENT_BALANCE"]},"description":"Why the offer is `invalid`, or why less than `size.remaining` is takeable. New codes can be added. Codes include `INSUFFICIENT_BALANCE`, `INSUFFICIENT_ALLOWANCE`, `RATIFIER_UNAUTHORIZED` (the wallet hasn't authorized the offer's ratifier; a new offer can read it for about 20 s after its transaction is indexed, until Tenor's quote engine reads the authorization) and `NOT_ROUTED` (Tenor's quote engine doesn't carry the offer, so the offer can't be taken through Tenor)."},"kind":{"type":"string","enum":["standard","deposit_on_fill","idle_capital","curve","renewal","migration","yield_collateral","withdrawable","unknown"],"description":"How the offer settles. `deposit_on_fill`: a borrow offer that posts its collateral as it fills. `idle_capital`: a lend offer whose capital earns the variable rate until the offer fills. `curve`: quoted from a passive quoting curve. `renewal` and `migration`: roll a position into another maturity, or move a variable borrow to a fixed rate. `yield_collateral`: posts `yield_shares` collateral. `withdrawable`: the 0% lend offer funded by the maturity's withdrawable liquidity (`syn:withdrawable:<maturity_id>`)."},"synthetic":{"type":"boolean","description":"Quoted from a passive quoting curve, from auto-renewal settings or from a maturity's withdrawable liquidity, instead of posted. `GET /v1/offers` doesn't list synthetic offers. Read them by ID.","examples":[false]},"staircase":{"anyOf":[{"$ref":"#/components/schemas/OfferStaircase"},{"type":"null"}],"description":"Set when the offer is one window of a staircase: offers posted together to hold one rate until `window.expires_at`."},"group":{"type":"string","description":"The offer's group. Offers posted together share a group and its fills. Cancel the group to cancel all of them.","examples":["0x74656e6f720100c34f00000000000000000000000000000000000000000000a1"]},"allowed_taker":{"description":"The only wallet that can take the offer, checksummed. `null` when anyone can.","examples":[null],"type":["string","null"]},"reduce_only":{"type":"boolean","description":"When `true`, the offer only fills against a position the maker already holds.","examples":[false]},"onchain":{"$ref":"#/components/schemas/OfferOnchain"}},"required":["offer_id","chain_id","market_id","maturity_id","matures_at","served","side","maker","rate","take_rate","size","takeable_principal","window","status","reasons","kind","synthetic","staircase","group","allowed_taker","reduce_only","onchain"]},"OfferChange":{"type":"object","properties":{"maker":{"type":"string","description":"The wallet whose offers changed.","examples":["0x7A1f00000000000000000000000000000000C0de"]},"group":{"type":"string","description":"The offers' `group`, as shown on each offer.","examples":["0x74656e6f720100c34f00000000000000000000000000000000000000000000a1"]},"maturity_id":{"description":"The maturity the offers are on. `null` when the maturity can't be determined: for a reduction, or a cancel of offers Tenor no longer has a record of.","examples":["0x9c1e7f4a0b2d3e5f6a7b8c9d0e1f2a3b4c5d6e7f8091a2b3c4d5e6f708192a3b"],"type":["string","null"]},"side":{"anyOf":[{"type":"string","enum":["lend","borrow"]},{"type":"null"}],"description":"The offers' side. `null` in the same cases as `maturity_id`."},"change":{"type":"string","enum":["posted","cancelled","reduced"],"description":"`posted`: new offers were posted. `cancelled`: the offers can no longer be taken. `reduced`: the group's fill limit was lowered, so less of the group can be taken. New values may be added."},"offer_ids":{"type":"array","items":{"type":"string"},"description":"The entries `GET /v1/offers` lists for these offers right now, with a staircase as one entry: read when the transaction is read, not stored with it. Empty for `cancelled`, since Tenor's records drop a cancelled offer, and empty once posted or reduced offers fill, expire or are cancelled. Fills aren't offer changes: they are in `fills`.","examples":[["0f6b8c2e-4d1a-4e7b-9a3c-5d2e8f1b7c40"]]}},"required":["maker","group","maturity_id","side","change","offer_ids"]},"OfferOnchain":{"type":"object","properties":{"tick":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"The tick the maker signed. `null` for an offer that signs a rate instead, whose tick is chosen when the offer is taken, and for a curve offer with no takeable tick right now.","examples":[1234]},"price":{"description":"Loan token paid per unit owed at maturity, in WAD (18-decimal fixed point: 1e18 = 1). `null` when `tick` is `null`.","examples":["995904000000000000"],"type":["string","null"]},"start":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Unix seconds.","examples":[1791561600]},"expiry":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Unix seconds.","examples":[1791648000]},"max_units":{"type":"string","examples":["0"]},"max_assets":{"type":"string","examples":["1000000000"]},"continuous_fee_cap":{"type":"string","examples":["0"]},"callback":{"type":"string","description":"Checksummed.","examples":["0x0000000000000000000000000000000000000000"]},"callback_data":{"type":"string","description":"ABI-encoded.","examples":["0x"]},"ratifier":{"type":"string","description":"Checksummed.","examples":["0x800B5F12A61B8198a5a6EfD794Cac6699B294d63"]},"ratifier_data":{"type":"string","description":"ABI-encoded.","examples":["0x"]},"receiver_if_maker_is_seller":{"type":"string","description":"Checksummed.","examples":["0x7A1f00000000000000000000000000000000C0de"]},"root":{"anyOf":[{"type":"string","description":"The Merkle root the offer was signed under. `null` for a synthetic offer.","examples":["0x5d1c2b3a4f5e6d7c8b9a0f1e2d3c4b5a69788796a5b4c3d2e1f0a9b8c7d6e5f4"]},{"type":"null"}]},"proof":{"type":"array","items":{"type":"string","examples":["0x74656e6f720100c34f00000000000000000000000000000000000000000000a1"]},"description":"The offer's Merkle proof under `root`."}},"required":["tick","price","start","expiry","max_units","max_assets","continuous_fee_cap","callback","callback_data","ratifier","ratifier_data","receiver_if_maker_is_seller","root","proof"],"description":"The offer as Morpho Midnight, the Morpho fixed-rate protocol Tenor is built on, stores it. For integrations that read or verify the offer onchain."},"OfferSize":{"type":"object","properties":{"denomination":{"type":"string","enum":["principal","amount_at_maturity"],"description":"The amount the maker capped: the principal that changes hands when the offer fills, or the amount owed at maturity."},"total":{"type":"string","description":"The cap the maker set. Integer string in the loan token's smallest unit.","examples":["1000000000"]},"remaining":{"type":"string","description":"The part of the cap left after fills. Offers in one group share their fills, so a fill on one offer reduces the cap left on the others. Integer string in the loan token's smallest unit.","examples":["600000000"]}},"required":["denomination","total","remaining"]},"OfferStaircase":{"type":"object","properties":{"target_rate":{"anyOf":[{"type":"string","description":"The rate the maker set when posting, to 6 decimals. `null` when it couldn't be read back. Annual rate as a decimal fraction (\"0.052\" = 5.2%).","examples":["0.05"]},{"type":"null"}]},"legs":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The number of offers left in the staircase, this one included. Each offer covers its own time window, one after the other.","examples":[24]},"oco":{"type":"boolean","description":"Whether the staircase is part of a ladder across maturities that shares one cap. A fill on any maturity then reduces the others.","examples":[false]}},"required":["target_rate","legs","oco"]},"OfferWindow":{"type":"object","properties":{"starts_at":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"When the offer becomes takeable. Unix seconds.","examples":[1791561600]},"expires_at":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"When the offer stops being takeable. For a staircase, when its last offer expires. Unix seconds.","examples":[1795190400]}},"required":["starts_at","expires_at"]},"Onchain":{"type":"object","properties":{"calls":{"type":"array","items":{"$ref":"#/components/schemas/OnchainCall"},"description":"Each call in order, with its result. Empty on a dry run, which has no calldata."},"events":{"type":"array","items":{"$ref":"#/components/schemas/OnchainEvent"},"description":"Every event the calls emitted, in order."}},"required":["calls","events"],"description":"The simulated calls decoded, each with the calls it bundles, and the events they emitted. Returned when `include_onchain` is `true`. This object follows the contracts' ABIs, not this API's vocabulary, and changes with them, so the compatibility rule in Conventions doesn't cover it. Use `onchain` to debug and verify, and build on the rest of the response."},"OnchainCall":{"type":"object","properties":{"index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The call's position in the batch.","examples":[1]},"to":{"type":"string","description":"The contract called, checksummed.","examples":["0xb98c948CFA24072e58935BC004a8A7b376AE746A"]},"contract":{"description":"The contract's role in the chain's Tenor registry, such as `bundler3` or `generalAdapter1`. `null` for an address outside the registry, such as a token.","examples":["generalAdapter1"],"type":["string","null"]},"function":{"type":"string","description":"The function name from the contract's ABI, or the 4-byte selector when no known ABI decodes the call. A Mempool post shows as `post`, with its offers decoded in `args.items`. A call with no data shows as `Native Transfer`.","examples":["erc20TransferFrom"]},"args":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The call's arguments, by their ABI names. A nested bundle's calls are in `children` instead. Integers are decimal strings. Addresses, bytes and hashes are hex.","examples":[{"token":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","receiver":"0xb98c948CFA24072e58935BC004a8A7b376AE746A","amount":"5000000"}]},"value":{"type":"string","description":"Native value sent with the call, as an integer string in wei.","examples":["0"]},"success":{"type":"boolean","description":"Whether the call executed in the simulation.","examples":[true]},"gas_used":{"type":"string","description":"Gas the call used in the simulation, as an integer string.","examples":["329000"]},"revert":{"description":"Why the call reverted, decoded when a known ABI describes the error.","examples":[null],"type":["string","null"]},"children":{"type":"array","items":{"$ref":"#/components/schemas/OnchainEntry"},"description":"The calls this call bundles, in order, with the callbacks each makes."}},"required":["index","to","contract","function","args","value","success","gas_used","revert","children"],"description":"One call of the batch, decoded."},"OnchainEntry":{"type":"object","properties":{"to":{"type":"string","description":"The contract called, checksummed.","examples":["0xb98c948CFA24072e58935BC004a8A7b376AE746A"]},"contract":{"description":"The contract's role in the chain's Tenor registry, such as `bundler3` or `generalAdapter1`. `null` for an address outside the registry, such as a token.","examples":["generalAdapter1"],"type":["string","null"]},"function":{"type":"string","description":"The function name from the contract's ABI, or the 4-byte selector when no known ABI decodes the call. A Mempool post shows as `post`, with its offers decoded in `args.items`. A call with no data shows as `Native Transfer`.","examples":["erc20TransferFrom"]},"args":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The call's arguments, by their ABI names. A nested bundle's calls are in `children` instead. Integers are decimal strings. Addresses, bytes and hashes are hex.","examples":[{"token":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","receiver":"0xb98c948CFA24072e58935BC004a8A7b376AE746A","amount":"5000000"}]},"value":{"type":"string","description":"Native value sent with the call, as an integer string in wei.","examples":["0"]},"skip_revert":{"type":"boolean","description":"When `true`, the bundle skips this call if it fails and carries on.","examples":[false]},"callback_hash":{"type":"string","description":"The hash of the bundle this call may pass back to Bundler3 in a callback. Zero when there is none.","examples":["0x0000000000000000000000000000000000000000000000000000000000000000"]},"children":{"type":"array","items":{"$ref":"#/components/schemas/OnchainEntry"},"description":"The calls this call bundles, or makes in its callback, in order."}},"required":["to","contract","function","args","value","skip_revert","callback_hash","children"],"description":"A call inside a bundle."},"OnchainEvent":{"type":"object","properties":{"call_index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The call that emitted the event. Always 0 in a mined transaction, which is one call.","examples":[1]},"log_index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The event's log index in the block.","examples":[4]},"address":{"type":"string","description":"The contract that emitted the event, checksummed.","examples":["0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"]},"contract":{"description":"The contract's role in the chain's Tenor registry, such as `bundler3` or `generalAdapter1`. `null` for an address outside the registry, such as a token.","examples":[null],"type":["string","null"]},"event":{"description":"The event name from the contract's ABI. `null` when no known ABI decodes the event. `args` then holds its raw `topics` and `data`.","examples":["Transfer"],"type":["string","null"]},"args":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The event's arguments, by their ABI names. Integers are decimal strings. Addresses, bytes and hashes are hex.","examples":[{"from":"0x7A1f00000000000000000000000000000000C0de","to":"0xb98c948CFA24072e58935BC004a8A7b376AE746A","value":"5000000"}]}},"required":["call_index","log_index","address","contract","event","args"],"description":"One event, decoded."},"OpenApiDocument":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"This API's OpenAPI 3.1 document."},"Position":{"type":"object","properties":{"position_id":{"type":"string","description":"Opaque, stable for the life of the position, and unique within a chain.","examples":["6b5e6644b322a1f0c2e19a4d07c6f3e1b9d84a2e5c7f0b3d6a9e2c4f8b1d7a05"]},"chain_id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"examples":[8453]},"wallet":{"type":"string","description":"The wallet that holds the position.","examples":["0x7A1f00000000000000000000000000000000C0de"]},"rate_type":{"type":"string","enum":["fixed","variable"],"description":"`fixed`: on one maturity, until it matures. `variable`: a lend or a borrow at a market's variable rate."},"side":{"type":"string","enum":["lend","borrow"],"description":"Whether the wallet lends or borrows."},"status":{"type":"string","enum":["open","matured","redeemable","repaid","closed","liquidated"],"description":"`open`: active. `matured`: a borrow past its maturity, still owed. `redeemable`: a lend past its maturity, ready to redeem. `repaid`: a borrow past its maturity with its debt repaid and collateral left to withdraw. `closed`: fully closed. `liquidated`: closed by a liquidation. Seized collateral and losses aren't shown. New values may be added."},"token":{"type":"string","description":"The loan token.","examples":["0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"]},"market_id":{"description":"The fixed position's market. `null` for a variable position, which lists its markets in `market_ids`.","examples":["0x3f81019286c6aa6265e5823a23c4f08e0f41c953236bad782c7739eb9ee6db11"],"type":["string","null"]},"market_ids":{"type":"array","items":{"type":"string"},"description":"Every market the position is in: one for a fixed position, and possibly several for a variable one, since one variable rate can serve several markets. A variable lend lists the markets whose lending vault holds it, and not a market it funds through a curve.","examples":[["0x3f81019286c6aa6265e5823a23c4f08e0f41c953236bad782c7739eb9ee6db11"]]},"structure":{"anyOf":[{"type":"string","enum":["plain","loan_token","yield"]},{"type":"null"}],"description":"The fixed position's market structure. `null` for a variable position."},"listing":{"anyOf":[{"type":"string","enum":["listed","otc"]},{"type":"null"}],"description":"The fixed position's market listing (see `Market.listing`). `null` for a variable position."},"maturity_id":{"description":"The maturity of a fixed position. `null` for a variable position.","examples":["0x9c1e7f4a0b2d3e5f6a7b8c9d0e1f2a3b4c5d6e7f8091a2b3c4d5e6f708192a3b"],"type":["string","null"]},"matures_at":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"When a fixed position matures. Unix seconds. `null` for a variable position.","examples":[1795190400]},{"type":"null"}]},"variable_market_id":{"description":"The variable market of a variable borrow. `null` otherwise.","examples":["0x9103c3b4e834476c9a62ea009ba2c884ee42e94e6e314a26f04d312434191836"],"type":["string","null"]},"balance":{"$ref":"#/components/schemas/PositionBalance"},"onchain":{"$ref":"#/components/schemas/PositionOnchain"},"collateral":{"type":"array","items":{"$ref":"#/components/schemas/PositionCollateral"},"description":"Posted collateral, in the order of the market's `collaterals`. Only tokens with collateral posted are listed."},"health":{"$ref":"#/components/schemas/PositionHealth"},"cost_basis":{"$ref":"#/components/schemas/PositionCostBasis"},"pnl":{"$ref":"#/components/schemas/PositionPnl"},"renewal":{"$ref":"#/components/schemas/PositionRenewal"}},"required":["position_id","chain_id","wallet","rate_type","side","status","token","market_id","market_ids","structure","listing","maturity_id","matures_at","variable_market_id","balance","onchain","collateral","health","cost_basis","pnl","renewal"]},"PositionBalance":{"type":"object","properties":{"amount_at_maturity":{"anyOf":[{"type":"string","description":"For a fixed lend, the amount the wallet collects at maturity, net of the continuous fee still to accrue. For a fixed borrow, the amount the wallet owes at maturity. Read onchain. Integer string in the loan token's smallest unit.","examples":["10050000000"]},{"type":"null"}]},"current_value":{"type":"string","description":"The position's value now. For a fixed position, its principal plus the interest accrued so far at its average rate. For a variable borrow, the debt. For a variable lend, the amount it redeems for. Both variable values are read onchain. Integer string in the loan token's smallest unit.","examples":["10021338211"]},"principal":{"type":"string","description":"The cost of the open position: the amount lent or borrowed, net of the part already closed. Integer string in the loan token's smallest unit.","examples":["10000000000"]}},"required":["amount_at_maturity","current_value","principal"]},"PositionChange":{"type":"object","properties":{"wallet":{"type":"string","description":"The wallet whose position changed.","examples":["0x7A1f00000000000000000000000000000000C0de"]},"position_id":{"description":"The position's `position_id` in `GET /v1/accounts/{wallet}/positions`. `null` for a variable market that `/positions` doesn't serve.","examples":["6b5e6644b322a1f0c2e19a4d07c6f3e1b9d84a2e5c7f0b3d6a9e2c4f8b1d7a05"],"type":["string","null"]},"rate_type":{"type":"string","enum":["fixed","variable"]},"side":{"type":"string","enum":["lend","borrow"],"description":"The position's side. A lend that pays down the wallet's borrow on the same maturity shows as a change to the borrow, and the reverse."},"maturity_id":{"description":"The maturity of a fixed position. `null` for a variable position.","examples":["0x9c1e7f4a0b2d3e5f6a7b8c9d0e1f2a3b4c5d6e7f8091a2b3c4d5e6f708192a3b"],"type":["string","null"]},"variable_market_id":{"description":"The variable market of a variable borrow. `null` for other positions.","examples":["0x9103c3b4e834476c9a62ea009ba2c884ee42e94e6e314a26f04d312434191836"],"type":["string","null"]},"amount_at_maturity_delta":{"anyOf":[{"type":"string","description":"For a fixed position, the change in the amount owed at maturity, before the continuous fee. `null` for a variable position. Signed integer string in the token's smallest unit, negative for a decrease.","examples":["10500000000"]},{"type":"null"}]},"principal_delta":{"anyOf":[{"type":"string","description":"For a variable borrow, the change in the principal borrowed. `null` for a fixed position. Signed integer string in the token's smallest unit, negative for a decrease.","examples":["-2500000000"]},{"type":"null"}]},"collateral":{"type":"array","items":{"$ref":"#/components/schemas/CollateralChange"},"description":"Collateral posted or taken out, by token, including any seized in a liquidation."}},"required":["wallet","position_id","rate_type","side","maturity_id","variable_market_id","amount_at_maturity_delta","principal_delta","collateral"],"description":"The transaction's change to one position, netted over its events."},"PositionCollateral":{"type":"object","properties":{"token":{"type":"string","description":"The collateral token.","examples":["0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf"]},"amount":{"type":"string","description":"The amount posted. Integer string in the token's smallest unit.","examples":["25000000"]},"value_in_loan":{"anyOf":[{"type":"string","description":"The collateral's value at the oracle price. `null` when the oracle can't be read. Integer string in the loan token's smallest unit.","examples":["25000000000"]},{"type":"null"}]},"price":{"anyOf":[{"type":"string","description":"The oracle price. `null` when the oracle can't be read or a token's decimals are unknown. Loan tokens per whole collateral token, as a decimal string.","examples":["100000"]},{"type":"null"}]},"liquidation_price":{"anyOf":[{"type":"string","description":"The price of this collateral at which the position becomes liquidatable, with any other collateral at its current price. `null` when no price makes the position liquidatable: there is no debt, or the other collateral covers the debt alone. Loan tokens per whole collateral token, as a decimal string.","examples":["52207.792207792207792208"]},{"type":"null"}]},"lltv":{"type":"string","description":"The LLTV: the loan-to-value at which this collateral's share of the debt can be liquidated. Decimal fraction string (\"0.52\" = 52%).","examples":["0.77"]}},"required":["token","amount","value_in_loan","price","liquidation_price","lltv"]},"PositionCostBasis":{"anyOf":[{"type":"object","properties":{"average_rate":{"anyOf":[{"type":"string","description":"The rate the open position was taken at, averaged over its fills. `null` when the position never held any units. Annual rate as a decimal fraction (\"0.052\" = 5.2%).","examples":["0.0521"]},{"type":"null"}]},"adjusted_cost_basis":{"anyOf":[{"type":"string","description":"Principal paid per unit owed at maturity, after partial closes. `null` when the position never held any units. Decimal fraction string (\"0.52\" = 52%).","examples":["0.975"]},{"type":"null"}]},"settled_ratio":{"type":"string","description":"The share of the position closed so far. Decimal fraction string (\"0.52\" = 52%).","examples":["0.25"]}},"required":["average_rate","adjusted_cost_basis","settled_ratio"]},{"type":"null"}],"description":"Fixed positions only."},"PositionHealth":{"anyOf":[{"type":"object","properties":{"ltv":{"anyOf":[{"type":"string","description":"Debt over the collateral's value. `null` when the collateral is worth nothing. Decimal fraction string (\"0.52\" = 52%).","examples":["0.402"]},{"type":"null"}]},"borrow_capacity_usage":{"anyOf":[{"type":"string","description":"Debt over the most the collateral can carry at its LLTVs. Above 1, the position can be liquidated. `null` when the collateral is worth nothing. Decimal fraction string (\"0.52\" = 52%).","examples":["0.522077922077922078"]},{"type":"null"}]},"is_healthy":{"type":"boolean","description":"Whether the protocol counts the position as safe from liquidation, read onchain.","examples":[true]}},"required":["ltv","borrow_capacity_usage","is_healthy"]},{"type":"null"}],"description":"`null` when there is no debt, or when the onchain reads fail."},"PositionOnchain":{"type":"object","properties":{"vault":{"anyOf":[{"type":"string","description":"For a variable lend, the lending vault that holds the lend.","examples":["0x616a4E1db48e22028f6bbf20444Cd3b8e3273738"]},{"type":"null"}]},"shares":{"anyOf":[{"type":"string","description":"A variable position as the protocol records it: its borrow shares, or its lending vault shares. Integer string in the token's smallest unit.","examples":["9927512617204659398"]},{"type":"null"}]}},"required":["vault","shares"],"description":"How the protocol holds a variable position, for reconciling against the contracts."},"PositionPnl":{"type":"object","properties":{"unrealized_interest":{"type":"string","description":"Interest on the open part so far: `current_value` minus `principal`. Earned on a lend, owed on a borrow. Integer string in the loan token's smallest unit.","examples":["21338211"]},"realized_interest":{"type":"string","description":"Interest settled on the parts already closed. Integer string in the loan token's smallest unit.","examples":["1520000"]},"mark_to_market":{"anyOf":[{"type":"string","description":"The open part's market value minus its cost, as of the last fill. `null` for variable positions. Integer string in the loan token's smallest unit.","examples":["-830000"]},{"type":"null"}]},"usd":{"$ref":"#/components/schemas/PositionPnlUsd"}},"required":["unrealized_interest","realized_interest","mark_to_market","usd"]},"PositionPnlUsd":{"type":"object","properties":{"unrealized_interest":{"description":"`unrealized_interest` at the loan token's current price. US dollars, as a decimal string.","examples":["21.338211"],"type":["string","null"]},"realized_interest":{"description":"`realized_interest` at the loan token's price at the position's latest trade. `null` when no price was known then. US dollars, as a decimal string.","examples":["1.52"],"type":["string","null"]},"mark_to_market":{"description":"`mark_to_market`, valued at each fill. US dollars, as a decimal string.","examples":["-0.83"],"type":["string","null"]}},"required":["unrealized_interest","realized_interest","mark_to_market"],"description":"The same figures in USD. Each is `null` when no price is known, and `mark_to_market` on variable positions and `realized_interest` on variable lends are `null` too."},"PositionPreview":{"type":"object","properties":{"side":{"anyOf":[{"type":"string","enum":["lend","borrow"]},{"type":"null"}],"description":"The wallet's side on this maturity. `null` when the wallet has no position there.","examples":["borrow"]},"amount_at_maturity":{"type":"string","description":"For a lend, the amount the wallet collects at maturity, net of the continuous fee still to accrue. For a borrow, the amount owed at maturity. Zero when the wallet has no position. Integer string in the token's smallest unit.","examples":["10050000000"]},"collateral":{"type":"array","items":{"$ref":"#/components/schemas/PositionCollateral"},"description":"Posted collateral, in the order of the market's `collaterals`. Only tokens with collateral posted are listed."},"health":{"$ref":"#/components/schemas/PositionHealth"}},"required":["side","amount_at_maturity","collateral","health"],"description":"The wallet's position on this maturity, read onchain."},"PositionRenewal":{"anyOf":[{"type":"object","properties":{"enabled":{"type":"boolean","description":"Whether the borrow rolls into the market's next maturity before it matures.","examples":[true]},"limit_rate":{"anyOf":[{"type":"string","description":"The highest rate a renewal accepts. Annual rate as a decimal fraction (\"0.052\" = 5.2%).","examples":["0.08"]},{"type":"null"}]},"fallback_enabled":{"type":"boolean","description":"Whether the borrow moves to the variable rate when no renewal fills.","examples":[false]}},"required":["enabled","limit_rate","fallback_enabled"]},{"type":"null"}],"description":"Fixed borrows only. `null` when the market has no auto-renewal set."},"PostCollateral":{"type":"object","properties":{"token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"A collateral token of the market, from its `collaterals` in `GET /v1/markets`. A `yield_shares` collateral isn't accepted here.","examples":["0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf"]},"amount":{"type":"string","pattern":"^[1-9]\\d*$","description":"The collateral backing the offers, in the token's smallest unit. The payload deposits this amount. With `deposit_on_fill`, it is the most the offers take as they fill.","examples":["250000"]},"deposit_on_fill":{"default":false,"description":"Leave the collateral in the wallet until a taker fills. Each offer takes its share as it fills, in proportion to its `principal` (to their sum, or to the largest under `oco`), and its full share once it fills completely. The offers may span any maturities that accept the token, and every size must be `principal`. The wallet must still hold the collateral when the offers fill. A fill the wallet can't cover fails, and readiness reports the shortfall.","examples":[true],"type":"boolean"},"max_ltv":{"description":"With `deposit_on_fill`, the highest LTV a fill may leave the borrow at (\"0.7\" = 70%). A fill that would go past `max_ltv` fails. By default, `max_ltv` is a little above the LTV the fill reaches on its own, and at most 95% of the LLTV. A value outside those bounds is moved into them, with a `MAX_LTV_ADJUSTED` warning.","examples":["0.7"],"type":"string","pattern":"^(0|[1-9]\\d*)(\\.\\d{1,18})?$"}},"required":["token","amount"],"additionalProperties":false,"description":"Collateral for a borrow post. Without `deposit_on_fill`, the payload deposits the collateral, and every offer must be on the same maturity. With `deposit_on_fill`, the offers take the collateral only as they fill."},"PostOffer":{"type":"object","properties":{"maturity_id":{"type":"string","pattern":"^0x[0-9a-fA-F]{64}$","description":"The maturity the offer is posted on. `GET /v1/markets` lists maturities, and one post can cover several.","examples":["0x9c1e7f4a0b2d3e5f6a7b8c9d0e1f2a3b4c5d6e7f8091a2b3c4d5e6f708192a3b"]},"rate":{"type":"string","pattern":"^(0|[1-9]\\d*)(\\.\\d{1,18})?$","description":"The rate the offer holds, before fees, as an annual rate (\"0.048\" = 4.8%). Above 0 and at most 0.3 (30%). The offer keeps this rate onchain for its whole window, whenever a taker fills it.","examples":["0.048"]},"size":{"$ref":"#/components/schemas/PostOfferSize"}},"required":["maturity_id","rate","size"],"additionalProperties":false},"PostOfferSize":{"anyOf":[{"type":"object","properties":{"principal":{"type":"string","pattern":"^[1-9]\\d*$","description":"The most principal the offer fills: the amount the wallet lends, or the amount it receives as a borrower.","examples":["1000000000"]}},"required":["principal"],"additionalProperties":false},{"type":"object","properties":{"amount_at_maturity":{"type":"string","pattern":"^[1-9]\\d*$","description":"The most the offer fills as an amount at maturity: the amount borrowers will owe the wallet, or the amount the wallet will owe.","examples":["1012000000"]}},"required":["amount_at_maturity"],"additionalProperties":false}],"description":"The offer's cap: exactly one of `principal` or `amount_at_maturity`, in the loan token's smallest unit. Under `oco`, every offer must use the same one."},"PostOffersRequest":{"type":"object","properties":{"chain_id":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"The EVM chain ID. `GET /v1/chains` lists the chains served.","examples":[8453]},"wallet":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"The wallet that will sign and send the payload. Any address but the zero address is accepted, since a payload does nothing until that wallet signs it.","examples":["0x7A1f00000000000000000000000000000000C0de"]},"wallet_kind":{"type":"string","enum":["eoa","delegated_eoa","safe","smart_account"],"description":"How the wallet signs, which sets the shape of the payload. `eoa` sends each step as its own transaction, `delegated_eoa` (EIP-7702) batches them with `wallet_sendCalls`, `safe` runs them as one MultiSend transaction, and `smart_account` (ERC-4337 and others) as one user operation. Required: Tenor doesn't infer the wallet kind."},"dry_run":{"default":false,"description":"Preview the action with nothing to send. The simulation funds the wallet, so a dry run works before the wallet holds the tokens. Returns `status: preview_only`. Always on for test keys.","examples":[false],"type":"boolean"},"client_id":{"description":"The caller's own reference for this prepare, echoed back and logged.","examples":["desk-7:42"],"type":"string","pattern":"^[A-Za-z0-9._:-]{1,64}$"},"include_onchain":{"default":false,"description":"Also return `onchain`: the payload's calls decoded, with the result of each call in the simulation and the events they emitted. A dry run has no calldata, so `onchain` holds only the events.","examples":[false],"type":"boolean"},"side":{"type":"string","enum":["lend","borrow"],"description":"`lend`: the wallet offers to lend, so takers borrow from the wallet. `borrow`: the wallet offers to borrow, so takers lend into its offers."},"offers":{"minItems":1,"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/PostOffer"},"description":"1 to 20 offers on the wallet's side, on one maturity or several. Several offers make a ladder. Each fills up to its own size, unless `oco` shares one fill limit across them."},"oco":{"default":false,"description":"Share one fill limit across all the offers: each fills up to its own size, minus the amount all of them have filled together. Equal sizes make a one-cancels-the-other, and growing sizes a liquidity ladder. Every size must then be `principal`, or every size `amount_at_maturity`.","examples":[false],"type":"boolean"},"starts_at":{"description":"When the offers become takeable. Defaults to now, and a moment already past also means now. Unix seconds.","examples":[1791561600],"type":"integer","exclusiveMinimum":0,"maximum":9999999999},"expires_at":{"type":"integer","exclusiveMinimum":0,"maximum":9999999999,"description":"When the offers stop being takeable, at least 60 s away. Unix seconds. An offer stops at its maturity if that comes first. `offers` in the response gives each offer's window.","examples":[1791648000]},"idle_capital":{"default":false,"description":"Lend posts only. Until the offers fill, their budget earns the market's variable rate as idle capital, and each fill is paid from it. The payload deposits only the amount the variable lend is short of the budget, so reposting over the same capital moves nothing. All the offers' maturities must share one lending vault.","examples":[false],"type":"boolean"},"collateral":{"$ref":"#/components/schemas/PostCollateral"},"replace_groups":{"description":"Up to 20 groups of the wallet's offers to cancel in the same payload, before the new offers are posted, so the old and new offers are never open together. The new offers may cross the offers they replace, since those are cancelled first. Groups aren't checked against Tenor's records, so a group posted a moment ago can be replaced; a group with none of the wallet's live offers ends nothing, and gets a `NOTHING_TO_REPLACE` warning.","maxItems":20,"type":"array","items":{"type":"string","pattern":"^0x[0-9a-fA-F]{64}$","description":"A `group` of the wallet's open offers, as `GET /v1/offers` lists it.","examples":["0x74656e6f720100c34f00000000000000000000000000000000000000000000a1"]}}},"required":["chain_id","wallet","wallet_kind","side","offers","expires_at"],"additionalProperties":false},"PostRest":{"description":"Fill the open offers at `limit_rate` or better now, and post the rest as one lend offer at `limit_rate`, in the same payload. Needs a `principal` size and a `limit_rate` of at most 0.3 (30%). The payload approves the whole size. The unfilled rest stays in the wallet behind the offer, or earns the variable rate with `idle_capital`. When no offer meets the limit, the whole size is posted.","type":"object","properties":{"expires_at":{"type":"integer","exclusiveMinimum":0,"maximum":9999999999,"description":"When the posted offer stops being takeable, at least 60 s away. The offer stops at maturity if that comes first. Unix seconds.","examples":[1791648000]},"idle_capital":{"default":false,"description":"The unfilled rest earns the market's variable rate, as idle capital, until a taker fills the offer.","examples":[true],"type":"boolean"}},"required":["expires_at"],"additionalProperties":false},"PostedOffer":{"type":"object","properties":{"maturity_id":{"type":"string","examples":["0x9c1e7f4a0b2d3e5f6a7b8c9d0e1f2a3b4c5d6e7f8091a2b3c4d5e6f708192a3b"]},"side":{"type":"string","enum":["lend","borrow"],"description":"The wallet's side."},"rate":{"type":"string","description":"The rate the offer holds, as requested and normalized (\"0.0480\" comes back as \"0.048\"). Onchain, the rate is stored per second and rounded in the maker's favour by less than 4e-11 a year. `GET /v1/offers` reads back the same value. Annual rate as a decimal fraction (\"0.052\" = 5.2%).","examples":["0.048"]},"size":{"$ref":"#/components/schemas/PostedOfferSize"},"kind":{"type":"string","enum":["standard","idle_capital","deposit_on_fill","renewal","migration"],"description":"How the offer settles, as `GET /v1/offers` reads it back. `idle_capital` uses idle capital earning the variable rate, `deposit_on_fill` posts collateral as it fills, and `renewal` and `migration` roll a position when they fill."},"group":{"type":"string","description":"The offer's group, new to this post. Offers in one group share their fills. Each offer of a ladder has its own group, and all the offers under `oco` share one. Pass the group in `replace_groups` to replace the offer later.","examples":["0x9f3c2a1b7e6d5c4b3a291807f6e5d4c3b2a19081f7e6d5c4b3a2918070605040"]},"starts_at":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"When the offer becomes takeable. Unix seconds.","examples":[1791561600]},"expires_at":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"When the offer stops being takeable: the request's `expires_at`, or the maturity if that comes first. Unix seconds.","examples":[1791648000]},"steps":{"description":"A renewal or a migration is posted as a staircase of this many offers, one after another. Each offer is set so the staircase holds `rate` as the maturity nears. `GET /v1/offers` lists the staircase as one entry.","examples":[12],"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["maturity_id","side","rate","size","kind","group","starts_at","expires_at"]},"PostedOfferSize":{"anyOf":[{"type":"object","properties":{"principal":{"type":"string","description":"The cap, as principal. Integer string in the loan token's smallest unit.","examples":["1000000000"]}},"required":["principal"]},{"type":"object","properties":{"amount_at_maturity":{"type":"string","description":"The cap, as an amount at maturity. Integer string in the loan token's smallest unit.","examples":["1012000000"]}},"required":["amount_at_maturity"]}],"description":"The offer's cap, as posted."},"Prepared":{"type":"object","properties":{"action":{"type":"string","enum":["lend","borrow","repay","resell","redeem","take","manage","post","cancel","curve_set","curve_clear","renew","migrate","variable_lend","variable_withdraw","variable_borrow","variable_repay","variable_manage"],"description":"The payload's action, named after its path: `curve_set` comes from `POST /v1/curves/set/prepare`, and `variable_lend` from `POST /v1/variable/lend/prepare`."},"chain_id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"examples":[8453]},"wallet":{"type":"string","description":"The wallet the payload is for, checksummed.","examples":["0x7A1f00000000000000000000000000000000C0de"]},"wallet_kind":{"type":"string","enum":["eoa","delegated_eoa","safe","smart_account"]},"status":{"type":"string","enum":["ready","preview_only"],"description":"`ready`: sign and send the payload. `preview_only`: a dry run, with the full preview and nothing to send."},"client_id":{"examples":["desk-7:42"],"type":"string"},"summary":{"type":"string","description":"A one-line description of the payload.","examples":["Lend 5 USDC at 4.81% fixed until 30 Oct 2026 (limit 4.71%)"]},"validity":{"$ref":"#/components/schemas/Validity"},"quote":{"description":"The quote the payload was prepared from, taken just now. Left out when the payload fills no offers, as for a redeem, a direct repay or a post.","$ref":"#/components/schemas/Quote"},"requires":{"type":"array","items":{"$ref":"#/components/schemas/Requirement"},"description":"The approvals and the one-time authorization the wallet must grant before the main step. Each requirement is also one of `steps`."},"steps":{"type":"array","items":{"$ref":"#/components/schemas/Step"},"description":"Every transaction in order, ending with the main one. An `eoa` sends each one and waits for its receipt before sending the next."},"calls":{"type":"array","items":{"$ref":"#/components/schemas/Call"},"description":"The same steps as one ordered batch, the form `wallet_sendCalls` and smart accounts expect. These are the calls that were simulated."},"transaction":{"anyOf":[{"$ref":"#/components/schemas/TransactionPayload"},{"type":"null"}],"description":"The main step, for `eoa` and `delegated_eoa`. `null` for `safe` and `smart_account`, which run `calls` as one operation."},"safe_tx":{"description":"Set for a `safe` on chains where `capabilities.safe_tx` is on. Execute it before `until_at`.","$ref":"#/components/schemas/SafeTransaction"},"bounds":{"$ref":"#/components/schemas/Bounds"},"preview":{"$ref":"#/components/schemas/Preview"},"renewal":{"$ref":"#/components/schemas/RenewalWrite"},"invariants":{"type":"object","properties":{"checked":{"type":"array","items":{"type":"string"},"description":"The safety checks the payload passed. `INFINITE_APPROVAL` allows one approval in full: a curve setup's, of the vault's shares to the curve's callback.","examples":[["INFINITE_APPROVAL","DEADLINE_IN_WINDOW"]]}},"required":["checked"]},"warnings":{"type":"array","items":{"$ref":"#/components/schemas/Warning"},"description":"Notices to show the user. Warnings never block a payload."},"onchain":{"$ref":"#/components/schemas/Onchain"}},"required":["action","chain_id","wallet","wallet_kind","status","summary","validity","requires","steps","calls","transaction","bounds","preview","invariants","warnings"]},"PreparedCancel":{"type":"object","properties":{"action":{"type":"string","enum":["lend","borrow","repay","resell","redeem","take","manage","post","cancel","curve_set","curve_clear","renew","migrate","variable_lend","variable_withdraw","variable_borrow","variable_repay","variable_manage"],"description":"The payload's action, named after its path: `curve_set` comes from `POST /v1/curves/set/prepare`, and `variable_lend` from `POST /v1/variable/lend/prepare`."},"chain_id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"examples":[8453]},"wallet":{"type":"string","description":"The wallet the payload is for, checksummed.","examples":["0x7A1f00000000000000000000000000000000C0de"]},"wallet_kind":{"type":"string","enum":["eoa","delegated_eoa","safe","smart_account"]},"status":{"type":"string","enum":["ready","preview_only"],"description":"`ready`: sign and send the payload. `preview_only`: a dry run, with the full preview and nothing to send."},"client_id":{"examples":["desk-7:42"],"type":"string"},"summary":{"type":"string","description":"A one-line description of the payload.","examples":["Lend 5 USDC at 4.81% fixed until 30 Oct 2026 (limit 4.71%)"]},"validity":{"$ref":"#/components/schemas/Validity"},"quote":{"description":"The quote the payload was prepared from, taken just now. Left out when the payload fills no offers, as for a redeem, a direct repay or a post.","$ref":"#/components/schemas/Quote"},"requires":{"type":"array","items":{"$ref":"#/components/schemas/Requirement"},"description":"The approvals and the one-time authorization the wallet must grant before the main step. Each requirement is also one of `steps`."},"steps":{"type":"array","items":{"$ref":"#/components/schemas/Step"},"description":"Every transaction in order, ending with the main one. An `eoa` sends each one and waits for its receipt before sending the next."},"calls":{"type":"array","items":{"$ref":"#/components/schemas/Call"},"description":"The same steps as one ordered batch, the form `wallet_sendCalls` and smart accounts expect. These are the calls that were simulated."},"transaction":{"anyOf":[{"$ref":"#/components/schemas/TransactionPayload"},{"type":"null"}],"description":"The main step, for `eoa` and `delegated_eoa`. `null` for `safe` and `smart_account`, which run `calls` as one operation."},"safe_tx":{"description":"Set for a `safe` on chains where `capabilities.safe_tx` is on. Execute it before `until_at`.","$ref":"#/components/schemas/SafeTransaction"},"bounds":{"$ref":"#/components/schemas/Bounds"},"preview":{"$ref":"#/components/schemas/Preview"},"renewal":{"$ref":"#/components/schemas/RenewalWrite"},"invariants":{"type":"object","properties":{"checked":{"type":"array","items":{"type":"string"},"description":"The safety checks the payload passed. `INFINITE_APPROVAL` allows one approval in full: a curve setup's, of the vault's shares to the curve's callback.","examples":[["INFINITE_APPROVAL","DEADLINE_IN_WINDOW"]]}},"required":["checked"]},"warnings":{"type":"array","items":{"$ref":"#/components/schemas/Warning"},"description":"Notices to show the user. Warnings never block a payload."},"onchain":{"$ref":"#/components/schemas/Onchain"},"cancels":{"description":"The offers, groups and roots the payload ends once it is included in a block. One payload ends at most 256 groups and roots. Past that, a `MORE_TO_CANCEL` warning gives the number left in `details.remaining`. Prepare the cancel again once this payload is included in a block.","$ref":"#/components/schemas/Cancels"}},"required":["action","chain_id","wallet","wallet_kind","status","summary","validity","requires","steps","calls","transaction","bounds","preview","invariants","warnings","cancels"],"description":"The payload of `POST /v1/offers/cancel/prepare`, with the offers it ends."},"PreparedCurve":{"type":"object","properties":{"action":{"type":"string","enum":["lend","borrow","repay","resell","redeem","take","manage","post","cancel","curve_set","curve_clear","renew","migrate","variable_lend","variable_withdraw","variable_borrow","variable_repay","variable_manage"],"description":"The payload's action, named after its path: `curve_set` comes from `POST /v1/curves/set/prepare`, and `variable_lend` from `POST /v1/variable/lend/prepare`."},"chain_id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"examples":[8453]},"wallet":{"type":"string","description":"The wallet the payload is for, checksummed.","examples":["0x7A1f00000000000000000000000000000000C0de"]},"wallet_kind":{"type":"string","enum":["eoa","delegated_eoa","safe","smart_account"]},"status":{"type":"string","enum":["ready","preview_only"],"description":"`ready`: sign and send the payload. `preview_only`: a dry run, with the full preview and nothing to send."},"client_id":{"examples":["desk-7:42"],"type":"string"},"summary":{"type":"string","description":"A one-line description of the payload.","examples":["Lend 5 USDC at 4.81% fixed until 30 Oct 2026 (limit 4.71%)"]},"validity":{"$ref":"#/components/schemas/Validity"},"quote":{"description":"The quote the payload was prepared from, taken just now. Left out when the payload fills no offers, as for a redeem, a direct repay or a post.","$ref":"#/components/schemas/Quote"},"requires":{"type":"array","items":{"$ref":"#/components/schemas/Requirement"},"description":"The approvals and the one-time authorization the wallet must grant before the main step. Each requirement is also one of `steps`."},"steps":{"type":"array","items":{"$ref":"#/components/schemas/Step"},"description":"Every transaction in order, ending with the main one. An `eoa` sends each one and waits for its receipt before sending the next."},"calls":{"type":"array","items":{"$ref":"#/components/schemas/Call"},"description":"The same steps as one ordered batch, the form `wallet_sendCalls` and smart accounts expect. These are the calls that were simulated."},"transaction":{"anyOf":[{"$ref":"#/components/schemas/TransactionPayload"},{"type":"null"}],"description":"The main step, for `eoa` and `delegated_eoa`. `null` for `safe` and `smart_account`, which run `calls` as one operation."},"safe_tx":{"description":"Set for a `safe` on chains where `capabilities.safe_tx` is on. Execute it before `until_at`.","$ref":"#/components/schemas/SafeTransaction"},"bounds":{"$ref":"#/components/schemas/Bounds"},"preview":{"$ref":"#/components/schemas/Preview"},"renewal":{"$ref":"#/components/schemas/RenewalWrite"},"invariants":{"type":"object","properties":{"checked":{"type":"array","items":{"type":"string"},"description":"The safety checks the payload passed. `INFINITE_APPROVAL` allows one approval in full: a curve setup's, of the vault's shares to the curve's callback.","examples":[["INFINITE_APPROVAL","DEADLINE_IN_WINDOW"]]}},"required":["checked"]},"warnings":{"type":"array","items":{"$ref":"#/components/schemas/Warning"},"description":"Notices to show the user. Warnings never block a payload."},"onchain":{"$ref":"#/components/schemas/Onchain"},"curve":{"$ref":"#/components/schemas/CurveWrite"}},"required":["action","chain_id","wallet","wallet_kind","status","summary","validity","requires","steps","calls","transaction","bounds","preview","invariants","warnings","curve"],"description":"The payload of `POST /v1/curves/set/prepare`, with the curve it writes."},"PreparedCurveClear":{"type":"object","properties":{"action":{"type":"string","enum":["lend","borrow","repay","resell","redeem","take","manage","post","cancel","curve_set","curve_clear","renew","migrate","variable_lend","variable_withdraw","variable_borrow","variable_repay","variable_manage"],"description":"The payload's action, named after its path: `curve_set` comes from `POST /v1/curves/set/prepare`, and `variable_lend` from `POST /v1/variable/lend/prepare`."},"chain_id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"examples":[8453]},"wallet":{"type":"string","description":"The wallet the payload is for, checksummed.","examples":["0x7A1f00000000000000000000000000000000C0de"]},"wallet_kind":{"type":"string","enum":["eoa","delegated_eoa","safe","smart_account"]},"status":{"type":"string","enum":["ready","preview_only"],"description":"`ready`: sign and send the payload. `preview_only`: a dry run, with the full preview and nothing to send."},"client_id":{"examples":["desk-7:42"],"type":"string"},"summary":{"type":"string","description":"A one-line description of the payload.","examples":["Lend 5 USDC at 4.81% fixed until 30 Oct 2026 (limit 4.71%)"]},"validity":{"$ref":"#/components/schemas/Validity"},"quote":{"description":"The quote the payload was prepared from, taken just now. Left out when the payload fills no offers, as for a redeem, a direct repay or a post.","$ref":"#/components/schemas/Quote"},"requires":{"type":"array","items":{"$ref":"#/components/schemas/Requirement"},"description":"The approvals and the one-time authorization the wallet must grant before the main step. Each requirement is also one of `steps`."},"steps":{"type":"array","items":{"$ref":"#/components/schemas/Step"},"description":"Every transaction in order, ending with the main one. An `eoa` sends each one and waits for its receipt before sending the next."},"calls":{"type":"array","items":{"$ref":"#/components/schemas/Call"},"description":"The same steps as one ordered batch, the form `wallet_sendCalls` and smart accounts expect. These are the calls that were simulated."},"transaction":{"anyOf":[{"$ref":"#/components/schemas/TransactionPayload"},{"type":"null"}],"description":"The main step, for `eoa` and `delegated_eoa`. `null` for `safe` and `smart_account`, which run `calls` as one operation."},"safe_tx":{"description":"Set for a `safe` on chains where `capabilities.safe_tx` is on. Execute it before `until_at`.","$ref":"#/components/schemas/SafeTransaction"},"bounds":{"$ref":"#/components/schemas/Bounds"},"preview":{"$ref":"#/components/schemas/Preview"},"renewal":{"$ref":"#/components/schemas/RenewalWrite"},"invariants":{"type":"object","properties":{"checked":{"type":"array","items":{"type":"string"},"description":"The safety checks the payload passed. `INFINITE_APPROVAL` allows one approval in full: a curve setup's, of the vault's shares to the curve's callback.","examples":[["INFINITE_APPROVAL","DEADLINE_IN_WINDOW"]]}},"required":["checked"]},"warnings":{"type":"array","items":{"$ref":"#/components/schemas/Warning"},"description":"Notices to show the user. Warnings never block a payload."},"onchain":{"$ref":"#/components/schemas/Onchain"},"curve":{"$ref":"#/components/schemas/CurveClear"}},"required":["action","chain_id","wallet","wallet_kind","status","summary","validity","requires","steps","calls","transaction","bounds","preview","invariants","warnings","curve"],"description":"The payload of `POST /v1/curves/clear/prepare`."},"PreparedLend":{"type":"object","properties":{"action":{"type":"string","enum":["lend","borrow","repay","resell","redeem","take","manage","post","cancel","curve_set","curve_clear","renew","migrate","variable_lend","variable_withdraw","variable_borrow","variable_repay","variable_manage"],"description":"The payload's action, named after its path: `curve_set` comes from `POST /v1/curves/set/prepare`, and `variable_lend` from `POST /v1/variable/lend/prepare`."},"chain_id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"examples":[8453]},"wallet":{"type":"string","description":"The wallet the payload is for, checksummed.","examples":["0x7A1f00000000000000000000000000000000C0de"]},"wallet_kind":{"type":"string","enum":["eoa","delegated_eoa","safe","smart_account"]},"status":{"type":"string","enum":["ready","preview_only"],"description":"`ready`: sign and send the payload. `preview_only`: a dry run, with the full preview and nothing to send."},"client_id":{"examples":["desk-7:42"],"type":"string"},"summary":{"type":"string","description":"A one-line description of the payload.","examples":["Lend 5 USDC at 4.81% fixed until 30 Oct 2026 (limit 4.71%)"]},"validity":{"$ref":"#/components/schemas/Validity"},"quote":{"description":"The quote the payload was prepared from, taken just now. Left out when the payload fills no offers, as for a redeem, a direct repay or a post.","$ref":"#/components/schemas/Quote"},"requires":{"type":"array","items":{"$ref":"#/components/schemas/Requirement"},"description":"The approvals and the one-time authorization the wallet must grant before the main step. Each requirement is also one of `steps`."},"steps":{"type":"array","items":{"$ref":"#/components/schemas/Step"},"description":"Every transaction in order, ending with the main one. An `eoa` sends each one and waits for its receipt before sending the next."},"calls":{"type":"array","items":{"$ref":"#/components/schemas/Call"},"description":"The same steps as one ordered batch, the form `wallet_sendCalls` and smart accounts expect. These are the calls that were simulated."},"transaction":{"anyOf":[{"$ref":"#/components/schemas/TransactionPayload"},{"type":"null"}],"description":"The main step, for `eoa` and `delegated_eoa`. `null` for `safe` and `smart_account`, which run `calls` as one operation."},"safe_tx":{"description":"Set for a `safe` on chains where `capabilities.safe_tx` is on. Execute it before `until_at`.","$ref":"#/components/schemas/SafeTransaction"},"bounds":{"$ref":"#/components/schemas/Bounds"},"preview":{"$ref":"#/components/schemas/Preview"},"renewal":{"$ref":"#/components/schemas/RenewalWrite"},"invariants":{"type":"object","properties":{"checked":{"type":"array","items":{"type":"string"},"description":"The safety checks the payload passed. `INFINITE_APPROVAL` allows one approval in full: a curve setup's, of the vault's shares to the curve's callback.","examples":[["INFINITE_APPROVAL","DEADLINE_IN_WINDOW"]]}},"required":["checked"]},"warnings":{"type":"array","items":{"$ref":"#/components/schemas/Warning"},"description":"Notices to show the user. Warnings never block a payload."},"onchain":{"$ref":"#/components/schemas/Onchain"},"offers":{"description":"With `post_rest`, the offer posted for the unfilled rest. Its `size` is the whole lend, and the part filled now counts against it, so takers can take only the rest.","type":"array","items":{"$ref":"#/components/schemas/PostedOffer"}}},"required":["action","chain_id","wallet","wallet_kind","status","summary","validity","requires","steps","calls","transaction","bounds","preview","invariants","warnings"],"description":"The payload of `POST /v1/lend/prepare`, with the offer posted for any unfilled rest."},"PreparedPositionMove":{"type":"object","properties":{"action":{"type":"string","enum":["lend","borrow","repay","resell","redeem","take","manage","post","cancel","curve_set","curve_clear","renew","migrate","variable_lend","variable_withdraw","variable_borrow","variable_repay","variable_manage"],"description":"The payload's action, named after its path: `curve_set` comes from `POST /v1/curves/set/prepare`, and `variable_lend` from `POST /v1/variable/lend/prepare`."},"chain_id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"examples":[8453]},"wallet":{"type":"string","description":"The wallet the payload is for, checksummed.","examples":["0x7A1f00000000000000000000000000000000C0de"]},"wallet_kind":{"type":"string","enum":["eoa","delegated_eoa","safe","smart_account"]},"status":{"type":"string","enum":["ready","preview_only"],"description":"`ready`: sign and send the payload. `preview_only`: a dry run, with the full preview and nothing to send."},"client_id":{"examples":["desk-7:42"],"type":"string"},"summary":{"type":"string","description":"A one-line description of the payload.","examples":["Lend 5 USDC at 4.81% fixed until 30 Oct 2026 (limit 4.71%)"]},"validity":{"$ref":"#/components/schemas/Validity"},"quote":{"description":"The quote the payload was prepared from, taken just now. Left out when the payload fills no offers, as for a redeem, a direct repay or a post.","$ref":"#/components/schemas/Quote"},"requires":{"type":"array","items":{"$ref":"#/components/schemas/Requirement"},"description":"The approvals and the one-time authorization the wallet must grant before the main step. Each requirement is also one of `steps`."},"steps":{"type":"array","items":{"$ref":"#/components/schemas/Step"},"description":"Every transaction in order, ending with the main one. An `eoa` sends each one and waits for its receipt before sending the next."},"calls":{"type":"array","items":{"$ref":"#/components/schemas/Call"},"description":"The same steps as one ordered batch, the form `wallet_sendCalls` and smart accounts expect. These are the calls that were simulated."},"transaction":{"anyOf":[{"$ref":"#/components/schemas/TransactionPayload"},{"type":"null"}],"description":"The main step, for `eoa` and `delegated_eoa`. `null` for `safe` and `smart_account`, which run `calls` as one operation."},"safe_tx":{"description":"Set for a `safe` on chains where `capabilities.safe_tx` is on. Execute it before `until_at`.","$ref":"#/components/schemas/SafeTransaction"},"bounds":{"$ref":"#/components/schemas/Bounds"},"preview":{"$ref":"#/components/schemas/Preview"},"renewal":{"$ref":"#/components/schemas/RenewalWrite"},"invariants":{"type":"object","properties":{"checked":{"type":"array","items":{"type":"string"},"description":"The safety checks the payload passed. `INFINITE_APPROVAL` allows one approval in full: a curve setup's, of the vault's shares to the curve's callback.","examples":[["INFINITE_APPROVAL","DEADLINE_IN_WINDOW"]]}},"required":["checked"]},"warnings":{"type":"array","items":{"$ref":"#/components/schemas/Warning"},"description":"Notices to show the user. Warnings never block a payload."},"onchain":{"$ref":"#/components/schemas/Onchain"},"offers":{"description":"With `limit`, the offer the payload posts, sized at the whole position. `steps` gives the number of offers it is posted as.","type":"array","items":{"$ref":"#/components/schemas/PostedOffer"}}},"required":["action","chain_id","wallet","wallet_kind","status","summary","validity","requires","steps","calls","transaction","bounds","preview","invariants","warnings"],"description":"Renews or migrates a position. `preview.source` is the position the payload closes, and the rest of `preview` is the target. With `limit`, `offers` holds the posted offer."},"PreparedPost":{"type":"object","properties":{"action":{"type":"string","enum":["lend","borrow","repay","resell","redeem","take","manage","post","cancel","curve_set","curve_clear","renew","migrate","variable_lend","variable_withdraw","variable_borrow","variable_repay","variable_manage"],"description":"The payload's action, named after its path: `curve_set` comes from `POST /v1/curves/set/prepare`, and `variable_lend` from `POST /v1/variable/lend/prepare`."},"chain_id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"examples":[8453]},"wallet":{"type":"string","description":"The wallet the payload is for, checksummed.","examples":["0x7A1f00000000000000000000000000000000C0de"]},"wallet_kind":{"type":"string","enum":["eoa","delegated_eoa","safe","smart_account"]},"status":{"type":"string","enum":["ready","preview_only"],"description":"`ready`: sign and send the payload. `preview_only`: a dry run, with the full preview and nothing to send."},"client_id":{"examples":["desk-7:42"],"type":"string"},"summary":{"type":"string","description":"A one-line description of the payload.","examples":["Lend 5 USDC at 4.81% fixed until 30 Oct 2026 (limit 4.71%)"]},"validity":{"$ref":"#/components/schemas/Validity"},"quote":{"description":"The quote the payload was prepared from, taken just now. Left out when the payload fills no offers, as for a redeem, a direct repay or a post.","$ref":"#/components/schemas/Quote"},"requires":{"type":"array","items":{"$ref":"#/components/schemas/Requirement"},"description":"The approvals and the one-time authorization the wallet must grant before the main step. Each requirement is also one of `steps`."},"steps":{"type":"array","items":{"$ref":"#/components/schemas/Step"},"description":"Every transaction in order, ending with the main one. An `eoa` sends each one and waits for its receipt before sending the next."},"calls":{"type":"array","items":{"$ref":"#/components/schemas/Call"},"description":"The same steps as one ordered batch, the form `wallet_sendCalls` and smart accounts expect. These are the calls that were simulated."},"transaction":{"anyOf":[{"$ref":"#/components/schemas/TransactionPayload"},{"type":"null"}],"description":"The main step, for `eoa` and `delegated_eoa`. `null` for `safe` and `smart_account`, which run `calls` as one operation."},"safe_tx":{"description":"Set for a `safe` on chains where `capabilities.safe_tx` is on. Execute it before `until_at`.","$ref":"#/components/schemas/SafeTransaction"},"bounds":{"$ref":"#/components/schemas/Bounds"},"preview":{"$ref":"#/components/schemas/Preview"},"renewal":{"$ref":"#/components/schemas/RenewalWrite"},"invariants":{"type":"object","properties":{"checked":{"type":"array","items":{"type":"string"},"description":"The safety checks the payload passed. `INFINITE_APPROVAL` allows one approval in full: a curve setup's, of the vault's shares to the curve's callback.","examples":[["INFINITE_APPROVAL","DEADLINE_IN_WINDOW"]]}},"required":["checked"]},"warnings":{"type":"array","items":{"$ref":"#/components/schemas/Warning"},"description":"Notices to show the user. Warnings never block a payload."},"onchain":{"$ref":"#/components/schemas/Onchain"},"offers":{"type":"array","items":{"$ref":"#/components/schemas/PostedOffer"},"description":"The offers the payload posts, in request order."},"cancels":{"description":"What the payload ends before the new offers rest: the `replace_groups` (`groups`), and the offers of them in Tenor's records (`offer_ids`), about a block behind the chain. `roots` and `withdrawals` stay empty. A group with none of the wallet's live offers ends nothing, and gets a `NOTHING_TO_REPLACE` warning.","$ref":"#/components/schemas/Cancels"}},"required":["action","chain_id","wallet","wallet_kind","status","summary","validity","requires","steps","calls","transaction","bounds","preview","invariants","warnings","offers","cancels"],"description":"The payload of `POST /v1/offers/post/prepare`, with the offers it posts."},"PreparedVariableWithdraw":{"type":"object","properties":{"action":{"type":"string","enum":["lend","borrow","repay","resell","redeem","take","manage","post","cancel","curve_set","curve_clear","renew","migrate","variable_lend","variable_withdraw","variable_borrow","variable_repay","variable_manage"],"description":"The payload's action, named after its path: `curve_set` comes from `POST /v1/curves/set/prepare`, and `variable_lend` from `POST /v1/variable/lend/prepare`."},"chain_id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"examples":[8453]},"wallet":{"type":"string","description":"The wallet the payload is for, checksummed.","examples":["0x7A1f00000000000000000000000000000000C0de"]},"wallet_kind":{"type":"string","enum":["eoa","delegated_eoa","safe","smart_account"]},"status":{"type":"string","enum":["ready","preview_only"],"description":"`ready`: sign and send the payload. `preview_only`: a dry run, with the full preview and nothing to send."},"client_id":{"examples":["desk-7:42"],"type":"string"},"summary":{"type":"string","description":"A one-line description of the payload.","examples":["Lend 5 USDC at 4.81% fixed until 30 Oct 2026 (limit 4.71%)"]},"validity":{"$ref":"#/components/schemas/Validity"},"quote":{"description":"The quote the payload was prepared from, taken just now. Left out when the payload fills no offers, as for a redeem, a direct repay or a post.","$ref":"#/components/schemas/Quote"},"requires":{"type":"array","items":{"$ref":"#/components/schemas/Requirement"},"description":"The approvals and the one-time authorization the wallet must grant before the main step. Each requirement is also one of `steps`."},"steps":{"type":"array","items":{"$ref":"#/components/schemas/Step"},"description":"Every transaction in order, ending with the main one. An `eoa` sends each one and waits for its receipt before sending the next."},"calls":{"type":"array","items":{"$ref":"#/components/schemas/Call"},"description":"The same steps as one ordered batch, the form `wallet_sendCalls` and smart accounts expect. These are the calls that were simulated."},"transaction":{"anyOf":[{"$ref":"#/components/schemas/TransactionPayload"},{"type":"null"}],"description":"The main step, for `eoa` and `delegated_eoa`. `null` for `safe` and `smart_account`, which run `calls` as one operation."},"safe_tx":{"description":"Set for a `safe` on chains where `capabilities.safe_tx` is on. Execute it before `until_at`.","$ref":"#/components/schemas/SafeTransaction"},"bounds":{"$ref":"#/components/schemas/Bounds"},"preview":{"$ref":"#/components/schemas/Preview"},"renewal":{"$ref":"#/components/schemas/RenewalWrite"},"invariants":{"type":"object","properties":{"checked":{"type":"array","items":{"type":"string"},"description":"The safety checks the payload passed. `INFINITE_APPROVAL` allows one approval in full: a curve setup's, of the vault's shares to the curve's callback.","examples":[["INFINITE_APPROVAL","DEADLINE_IN_WINDOW"]]}},"required":["checked"]},"warnings":{"type":"array","items":{"$ref":"#/components/schemas/Warning"},"description":"Notices to show the user. Warnings never block a payload."},"onchain":{"$ref":"#/components/schemas/Onchain"},"cancels":{"description":"With `cancel_idle_offers`, the groups of idle-capital offers the payload ends before withdrawing. Left out when the payload cancels none.","$ref":"#/components/schemas/Cancels"}},"required":["action","chain_id","wallet","wallet_kind","status","summary","validity","requires","steps","calls","transaction","bounds","preview","invariants","warnings"],"description":"Withdraws from a variable lend, after cancelling any idle-capital offers that `cancel_idle_offers` selects."},"Preview":{"type":"object","properties":{"size":{"type":"object","properties":{"principal":{"type":"string","description":"The principal that changes hands now. Integer string in the token's smallest unit.","examples":["5000000"]},"amount_at_maturity":{"type":"string","description":"The amount owed, or paid back, at maturity. Integer string in the token's smallest unit.","examples":["5020050"]}}},"rate":{"type":"string","description":"The simulated rate, fees included. Annual rate as a decimal fraction (\"0.052\" = 5.2%).","examples":["0.0481"]},"worst_rate":{"type":"string","description":"The worst rate in the route. Annual rate as a decimal fraction (\"0.052\" = 5.2%).","examples":["0.0481"]},"fees":{"type":"object","properties":{"settlement_fee":{"type":"string","description":"The settlement fee, taken when the payload fills. Integer string in the token's smallest unit.","examples":["0"]},"continuous_fee":{"type":"string","description":"The continuous fee, which accrues on the position until maturity. Integer string in the token's smallest unit.","examples":["0"]},"callback_fee":{"type":"string","description":"Paid to an offer's callback. Integer string in the token's smallest unit.","examples":["0"]}},"required":["settlement_fee","continuous_fee"]},"fills":{"type":"array","items":{"type":"object","properties":{"offer_id":{"type":"string","examples":["0f0e5c4e-6a8b-4a61-9a43-1c2d3e4f5a6b"]},"group":{"type":"string","description":"The offer's group.","examples":["0x74656e6f72000000000000000000000000000000000000000000000000000001"]},"principal":{"type":"string","description":"The principal of this fill. Integer string in the token's smallest unit.","examples":["5000000"]},"amount_at_maturity":{"type":"string","description":"The amount this fill owes or pays back at maturity. Integer string in the token's smallest unit.","examples":["5020050"]},"rate":{"type":"string","description":"This fill's rate, fees included. Annual rate as a decimal fraction (\"0.052\" = 5.2%).","examples":["0.0481"]}},"required":["offer_id","group","principal","amount_at_maturity","rate"]},"description":"The offers the payload is expected to fill. Fallback offers, taken only if one of these is gone, aren't listed."},"position_before":{"description":"The position before the payload, read in the simulated block. Left out when the onchain reads failed. The payload is unaffected.","$ref":"#/components/schemas/PositionPreview"},"position_after":{"description":"The position after the payload, read in the same block. A `HEALTH_THRESHOLD` warning flags a payload that leaves the position above 95% of its borrow capacity, and worse off than before.","$ref":"#/components/schemas/PositionPreview"},"source":{"$ref":"#/components/schemas/SourcePreview"},"variable_lend":{"$ref":"#/components/schemas/VariableLendPreview"},"variable_borrow":{"$ref":"#/components/schemas/VariableBorrowPreview"},"balance_changes":{"type":"array","items":{"type":"object","properties":{"token":{"type":"string","description":"The token. Native value is 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE.","examples":["0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"]},"delta":{"type":"string","description":"Negative when the token leaves the wallet. Integer string in the token's smallest unit.","examples":["-5000000"]}},"required":["token","delta"]},"description":"The wallet's net movement per token."},"simulation":{"type":"object","properties":{"block_number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"examples":[50812345]},"gas_used":{"type":"string","description":"Gas used by all the steps together. Integer string.","examples":["329000"]}},"required":["block_number","gas_used"]}},"required":["fees","fills","balance_changes","simulation"],"description":"The payload's effects, from simulating `calls` from the wallet at the latest block."},"Quote":{"type":"object","properties":{"chain_id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"examples":[8453]},"maturity_id":{"type":"string","examples":["0x9c1e7f4a0b2d3e5f6a7b8c9d0e1f2a3b4c5d6e7f8091a2b3c4d5e6f708192a3b"]},"action":{"type":"string","enum":["lend","borrow","repay","resell"],"description":"`lend` or `borrow` opens or adds to a position. `repay` pays back a borrow early by taking offers. `resell` resells a lend to another lender before maturity."},"size":{"type":"object","properties":{"principal":{"type":"string","description":"The principal that changes hands now. Integer string in the loan token's smallest unit.","examples":["1000000000"]},"amount_at_maturity":{"type":"string","description":"The amount owed, or paid back, on the maturity date. Integer string in the loan token's smallest unit.","examples":["1004110000"]}},"required":["principal","amount_at_maturity"]},"rate":{"type":"string","description":"The rate for the whole size, fees included. Annual rate as a decimal fraction (\"0.052\" = 5.2%).","examples":["0.0505"]},"best_rate":{"type":"string","description":"The best rate in the route. Annual rate as a decimal fraction (\"0.052\" = 5.2%).","examples":["0.0498"]},"worst_rate":{"type":"string","description":"The worst rate in the route. A prepare without `limit_rate` sets its bound from this rate, moved against the wallet by a margin that depends on `wallet_kind`. Annual rate as a decimal fraction (\"0.052\" = 5.2%).","examples":["0.0512"]},"rate_impact":{"type":"string","description":"The distance from `best_rate` to `rate`: the cost of the size. Annual rate as a decimal fraction (\"0.052\" = 5.2%).","examples":["0.0007"]},"partial":{"type":"boolean","description":"`true` when the open offers can fill only part of the size (with `allow_partial`). `size` is then the part they can fill.","examples":[false]},"route":{"type":"array","items":{"$ref":"#/components/schemas/QuoteRouteEntry"},"description":"The offers the size fills, in order."}},"required":["chain_id","maturity_id","action","size","rate","best_rate","worst_rate","rate_impact","partial","route"]},"QuoteRequest":{"type":"object","properties":{"chain_id":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"The EVM chain ID. `GET /v1/chains` lists the chains served.","examples":[8453]},"maturity_id":{"type":"string","pattern":"^0x[0-9a-fA-F]{64}$","description":"The maturity to quote, from `GET /v1/markets`.","examples":["0x9c1e7f4a0b2d3e5f6a7b8c9d0e1f2a3b4c5d6e7f8091a2b3c4d5e6f708192a3b"]},"action":{"type":"string","enum":["lend","borrow","repay","resell"],"description":"`lend` or `borrow` opens or adds to a position. `repay` pays back a borrow early by taking offers. `resell` resells a lend to another lender before maturity."},"size":{"$ref":"#/components/schemas/QuoteSize"},"limit_rate":{"description":"The worst rate accepted, at most 1 (100%): a minimum for `lend` and `repay`, a maximum for `borrow` and `resell`. Offers beyond the limit are skipped. Annual rate as a decimal fraction (\"0.052\" = 5.2%).","examples":["0.05"],"type":"string","pattern":"^(0|[1-9]\\d*)(\\.\\d{1,18})?$"},"allow_partial":{"default":false,"description":"Quote the part the open offers can fill when they can't fill the whole size, instead of failing with `INSUFFICIENT_LIQUIDITY`.","examples":[false],"type":"boolean"},"wallet":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"The wallet that would act on the quote, as passed to the prepare. The wallet's own offers are skipped, and offers reserved for it are included.","examples":["0x7A1f00000000000000000000000000000000C0de"]},"max_offers":{"default":16,"description":"The most offers the route may fill.","examples":[16],"type":"integer","minimum":1,"maximum":50},"wallet_kind":{"description":"How the wallet will sign. The quote fills only offers that stay fillable for the wallet's signing window (5 min for `eoa` and `delegated_eoa`, 30 min for `safe` and `smart_account`), as its prepare will.","type":"string","enum":["eoa","delegated_eoa","safe","smart_account"]}},"required":["chain_id","maturity_id","action","size"],"additionalProperties":false},"QuoteRouteEntry":{"type":"object","properties":{"offer_id":{"type":"string","description":"The offer this part of the size takes. A `syn:` ID is an offer quoted from a passive quoting curve.","examples":["0f0e5c4e-6a8b-4a61-9a43-1c2d3e4f5a6b"]},"maker":{"type":"string","description":"The offer's maker, checksummed.","examples":["0x7A1f00000000000000000000000000000000C0de"]},"rate":{"type":"string","description":"This part's own rate, fees included. Annual rate as a decimal fraction (\"0.052\" = 5.2%).","examples":["0.0505"]},"principal":{"type":"string","description":"The principal this part moves now. Integer string in the loan token's smallest unit.","examples":["500000000"]},"amount_at_maturity":{"type":"string","description":"The amount this part is owed, or pays back, at maturity. Integer string in the loan token's smallest unit.","examples":["502075000"]},"expires_at":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"When the offer stops being takeable, in Unix seconds. A payload prepared from this quote can't be valid past this time.","examples":[1791565200]},"synthetic":{"type":"boolean","description":"`true` when the offer is quoted from a passive quoting curve, and wasn't posted.","examples":[false]},"is_fallback":{"type":"boolean","description":"Taken only if an earlier offer is gone when the payload is included in a block. A fallback can widen the rate range, but never the size.","examples":[false]}},"required":["offer_id","maker","rate","principal","amount_at_maturity","expires_at","synthetic","is_fallback"]},"QuoteSize":{"anyOf":[{"type":"object","properties":{"principal":{"type":"string","pattern":"^[1-9]\\d*$","description":"The principal that changes hands now.","examples":["1000000000"]}},"required":["principal"],"additionalProperties":false},{"type":"object","properties":{"amount_at_maturity":{"type":"string","pattern":"^[1-9]\\d*$","description":"The amount owed, or paid back, on the maturity date.","examples":["1004110000"]}},"required":["amount_at_maturity"],"additionalProperties":false}],"description":"One of `principal` or `amount_at_maturity`, in the loan token's smallest unit. The quote returns both."},"Readiness":{"type":"object","properties":{"wallet":{"type":"string","description":"The wallet, checksummed.","examples":["0x7A1f00000000000000000000000000000000C0de"]},"chain_id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"examples":[8453]},"wallet_kind":{"type":"string","enum":["eoa","delegated_eoa","safe","smart_account"]},"ready":{"type":"boolean","examples":[false],"description":"`true` when every open offer of the wallet can be taken in full: `missing` and `shortfalls` are both empty. A wallet with no open offers is ready."},"authorizations":{"type":"array","items":{"type":"object","properties":{"authorized":{"type":"string","description":"The contract to authorize: a ratifier that validates the wallet's offers, or the contract that posts the collateral of deposit-on-fill or yield-collateral offers.","examples":["0x3B2FbA901C88f026BF50A12c8B28484Cd81F9526"]},"label":{"type":"string","examples":["the rate ratifier"]},"satisfied":{"type":"boolean","description":"Whether the wallet has authorized the contract.","examples":[true]}},"required":["authorized","label","satisfied"]},"description":"The contracts the wallet's open offers need authorized: each ratifier the offers name, and the contract that posts collateral for open deposit-on-fill or yield-collateral offers. A taker's fill fails unless the wallet has authorized each contract."},"allowances":{"type":"array","items":{"type":"object","properties":{"token":{"type":"string","description":"The loan token, a lending vault's shares, or a collateral token.","examples":["0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"]},"spender":{"type":"string","description":"The contract that takes the token on a fill: the protocol, the idle-capital contract or the collateral contract.","examples":["0xAdedD8ab6dE832766Fedf0FaC4992E5C4D3EA18A"]},"label":{"type":"string","examples":["Midnight"]},"current":{"type":"string","description":"The allowance now. Integer string in the token's smallest unit.","examples":["4000000000"]},"required":{"type":"string","description":"The amount the wallet's open offers can pull. For a token in the wallet, this equals `reserved` in `GET /v1/accounts/{wallet}/balances`. For a lending vault, this is the shares the offers' idle capital would withdraw. Integer string in the token's smallest unit.","examples":["10000000000"]},"satisfied":{"type":"boolean","examples":[false]}},"required":["token","spender","label","current","required","satisfied"]},"description":"One entry per token the wallet's open offers pull: the loan token of lend offers, the lending vault shares of idle-capital offers, the collateral of deposit-on-fill offers, and the loan token yield-collateral offers add to each fill. Every fill uses up allowance."},"shortfalls":{"type":"array","items":{"type":"object","properties":{"token":{"type":"string","description":"The loan token, a lending vault's shares, or a collateral token.","examples":["0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"]},"balance":{"type":"string","description":"The wallet's balance. Integer string in the token's smallest unit.","examples":["6000000000"]},"reserved":{"type":"string","description":"The amount the wallet's open offers can pull. For a lending vault, counted in shares. Integer string in the token's smallest unit.","examples":["10000000000"]},"missing":{"type":"string","description":"The amount to send to the wallet. Integer string in the token's smallest unit.","examples":["4000000000"]}},"required":["token","balance","reserved","missing"]},"description":"Tokens the wallet holds less of than its offers pull. Only funding the wallet fixes a shortfall."},"missing":{"type":"array","items":{"$ref":"#/components/schemas/Requirement"},"description":"The transactions that fix the authorizations and allowances above, in order: authorizations first, then approvals set to the amount the offers pull. An `eoa` sends each `transaction` and waits for its receipt, a `delegated_eoa` or `smart_account` sends `calls` as one batch, and a `safe` sends `safe_tx`. Empty once the transactions are included in a block. A test key gets no transactions."},"calls":{"type":"array","items":{"$ref":"#/components/schemas/Call"},"description":"The transactions in `missing` as one ordered batch, as simulated. Empty for a test key."},"safe_tx":{"description":"Set for a `safe` when something is missing, on chains where `capabilities.safe_tx` is on.","$ref":"#/components/schemas/SafeTransaction"},"warnings":{"type":"array","items":{"$ref":"#/components/schemas/Warning"},"description":"`WALLET_KIND_MISMATCH`, `TEST_KEY_DRY_RUN`."}},"required":["wallet","chain_id","wallet_kind","ready","authorizations","allowances","shortfalls","missing","calls","warnings"]},"RedeemPrepareRequest":{"type":"object","properties":{"chain_id":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"The EVM chain ID. `GET /v1/chains` lists the chains served.","examples":[8453]},"wallet":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"The wallet that will sign and send the payload. Any address but the zero address is accepted, since a payload does nothing until that wallet signs it.","examples":["0x7A1f00000000000000000000000000000000C0de"]},"wallet_kind":{"type":"string","enum":["eoa","delegated_eoa","safe","smart_account"],"description":"How the wallet signs, which sets the shape of the payload. `eoa` sends each step as its own transaction, `delegated_eoa` (EIP-7702) batches them with `wallet_sendCalls`, `safe` runs them as one MultiSend transaction, and `smart_account` (ERC-4337 and others) as one user operation. Required: Tenor doesn't infer the wallet kind."},"dry_run":{"default":false,"description":"Preview the action with nothing to send. The simulation funds the wallet, so a dry run works before the wallet holds the tokens. Returns `status: preview_only`. Always on for test keys.","examples":[false],"type":"boolean"},"client_id":{"description":"The caller's own reference for this prepare, echoed back and logged.","examples":["desk-7:42"],"type":"string","pattern":"^[A-Za-z0-9._:-]{1,64}$"},"include_onchain":{"default":false,"description":"Also return `onchain`: the payload's calls decoded, with the result of each call in the simulation and the events they emitted. A dry run has no calldata, so `onchain` holds only the events.","examples":[false],"type":"boolean"},"maturity_id":{"type":"string","pattern":"^0x[0-9a-fA-F]{64}$","description":"The maturity of the lend.","examples":["0x9c1e7f4a0b2d3e5f6a7b8c9d0e1f2a3b4c5d6e7f8091a2b3c4d5e6f708192a3b"]},"size":{"$ref":"#/components/schemas/RedeemSize"}},"required":["chain_id","wallet","wallet_kind","maturity_id"],"additionalProperties":false},"RedeemSize":{"anyOf":[{"type":"object","properties":{"principal":{"type":"string","pattern":"^[1-9]\\d*$","description":"The amount the wallet receives.","examples":["5020050"]}},"required":["principal"],"additionalProperties":false},{"type":"object","properties":{"amount_at_maturity":{"type":"string","pattern":"^[1-9]\\d*$","description":"The part of the lend to redeem.","examples":["5020050"]}},"required":["amount_at_maturity"],"additionalProperties":false}],"description":"Exactly one of `principal` or `amount_at_maturity`, in the loan token's smallest unit. Both mean the same here, since a redeem pays out the amount it collects. Leave `size` out to redeem the whole lend, or the part that is redeemable now."},"RegistryCheck":{"type":"object","properties":{"status":{"type":"string","enum":["ok","mismatch","pending"],"description":"`mismatch`: the SDK registry and the indexer disagree on a contract, so the chain is degraded. `pending`: not checked yet."},"checked_at":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"examples":[1791561600]},"mismatches":{"type":"array","items":{"type":"object","properties":{"contract":{"type":"string","examples":["SetterRatifier"]},"reason":{"type":"string","enum":["address_differs","listed_under_another_name"]},"sdk_address":{"type":"string","examples":["0x800B5F12A61B8198a5a6EfD794Cac6699B294d63"]},"indexer":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","examples":["SetterRatifier"]},"address":{"type":"string","examples":["0x800b5f12a61b8198a5a6efd794cac6699b294d63"]}},"required":["name","address"]},"description":"The indexer's value for the contract."}},"required":["contract","reason","sdk_address","indexer"]},"description":"Contracts the two registries disagree on."},"missing":{"type":"array","items":{"type":"string"},"description":"Contracts the SDK lists on this chain that the indexer doesn't track yet. Informational only: the chain stays `ok`.","examples":[["RateRatifierV1"]]}},"required":["status","checked_at","mismatches","missing"]},"RenewPrepareRequest":{"type":"object","properties":{"chain_id":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"The EVM chain ID. `GET /v1/chains` lists the chains served.","examples":[8453]},"wallet":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"The wallet that will sign and send the payload. Any address but the zero address is accepted, since a payload does nothing until that wallet signs it.","examples":["0x7A1f00000000000000000000000000000000C0de"]},"wallet_kind":{"type":"string","enum":["eoa","delegated_eoa","safe","smart_account"],"description":"How the wallet signs, which sets the shape of the payload. `eoa` sends each step as its own transaction, `delegated_eoa` (EIP-7702) batches them with `wallet_sendCalls`, `safe` runs them as one MultiSend transaction, and `smart_account` (ERC-4337 and others) as one user operation. Required: Tenor doesn't infer the wallet kind."},"limit_rate":{"description":"The worst rate the wallet accepts, at most 1 (100%). Enforced onchain: a worse fill reverts. A minimum when lending or repaying, and a maximum when borrowing or reselling. Default: the quote's worst rate, moved against the wallet by 0.10 percentage points for `eoa` and `delegated_eoa`, or 0.30 for `safe` and `smart_account`, which sign later. Annual rate as a decimal fraction (\"0.052\" = 5.2%).","examples":["0.045"],"type":"string","pattern":"^(0|[1-9]\\d*)(\\.\\d{1,18})?$"},"deadline_at":{"description":"The last moment the payload can be included in a block, enforced onchain. At least 60 s away, and within the wallet kind's signing window (5 min for `eoa` and `delegated_eoa`, 30 min for `safe` and `smart_account`). Default: the end of that window. Unix seconds.","examples":[1791561900],"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"dry_run":{"default":false,"description":"Preview the action with nothing to send. The simulation funds the wallet, so a dry run works before the wallet holds the tokens. Returns `status: preview_only`. Always on for test keys.","examples":[false],"type":"boolean"},"client_id":{"description":"The caller's own reference for this prepare, echoed back and logged.","examples":["desk-7:42"],"type":"string","pattern":"^[A-Za-z0-9._:-]{1,64}$"},"include_onchain":{"default":false,"description":"Also return `onchain`: the payload's calls decoded, with the result of each call in the simulation and the events they emitted. A dry run has no calldata, so `onchain` holds only the events.","examples":[false],"type":"boolean"},"maturity_id":{"type":"string","pattern":"^0x[0-9a-fA-F]{64}$","description":"The maturity of the wallet's position (a borrow or a lend, read onchain). The whole position rolls.","examples":["0x9c1e7f4a0b2d3e5f6a7b8c9d0e1f2a3b4c5d6e7f8091a2b3c4d5e6f708192a3b"]},"target_maturity_id":{"type":"string","pattern":"^0x[0-9a-fA-F]{64}$","description":"A later maturity of the same market to roll into. `GET /v1/markets` lists them.","examples":["0x4d2a8b6c0e1f3a5b7c9d1e3f5a7b9c1d3e5f7a9b1c3d5e7f9a1b3c5d7e9f1a2b"]},"mode":{"default":"spot","description":"`spot`: take offers now, bounded onchain by `limit_rate` and `deadline_at`. `limit`: post an offer at `limit_rate` until `expires_at`. Each fill rolls the share of the position it fills.","examples":["spot"],"type":"string","enum":["spot","limit"]},"expires_at":{"description":"When the offer stops being takeable, at least 60 s away. Required with `limit`, and only used there. The offer stops at the target's maturity if that comes first. Unix seconds.","examples":[1791648000],"type":"integer","exclusiveMinimum":0,"maximum":9999999999}},"required":["chain_id","wallet","wallet_kind","maturity_id","target_maturity_id"],"additionalProperties":false},"RenewalSettings":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Roll each borrow into the market's next maturity before it matures, at `limit_rate` or better.","examples":[true]},"limit_rate":{"description":"The highest rate a renewal accepts, above 0 and at most 0.15 (15%). Required when `enabled`. Annual rate as a decimal fraction (\"0.052\" = 5.2%).","examples":["0.06"],"type":"string","pattern":"^(0|[1-9]\\d*)(\\.\\d{1,18})?$"},"fallback_enabled":{"description":"Move a borrow that didn't renew to the variable rate at maturity. Defaults to `enabled`, and can't be false while `enabled` is true, since a renewal always falls back.","examples":[true],"type":"boolean"}},"required":["enabled"],"additionalProperties":false,"description":"Auto-renewal on this market, in the shape positions return in `renewal`. The setting applies to every maturity of the market, and needs the market's variable rate to fall back to. Set both `enabled` and `fallback_enabled` to false to clear auto-renewal."},"RenewalWrite":{"description":"The auto-renewal the payload writes. Left out when the payload writes none.","type":"object","properties":{"mode":{"type":"string","enum":["set","fallback","clear"],"description":"`set`: renewal on, falling back to the variable rate. `fallback`: falls back only. `clear`: both off."},"market_id":{"type":"string","description":"The market the setting applies to, across all its maturities.","examples":["0x74656e6f72000000000000000000000000000000000000000000000000000001"]},"variable_market_id":{"type":"string","description":"The variable market a borrow that didn't renew falls back to.","examples":["0x9c1e7f4a0b2d3e5f6a7b8c9d0e1f2a3b4c5d6e7f8091a2b3c4d5e6f708192a3b"]},"limit_rate":{"anyOf":[{"type":"string","description":"The highest rate a renewal accepts, read back from the per-second rate stored onchain (rounded down). `null` unless `mode` is `set`. Annual rate as a decimal fraction (\"0.052\" = 5.2%).","examples":["0.059999999999184"]},{"type":"null"}]}},"required":["mode","market_id","variable_market_id","limit_rate"]},"RepayPrepareRequest":{"type":"object","properties":{"chain_id":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"The EVM chain ID. `GET /v1/chains` lists the chains served.","examples":[8453]},"wallet":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"The wallet that will sign and send the payload. Any address but the zero address is accepted, since a payload does nothing until that wallet signs it.","examples":["0x7A1f00000000000000000000000000000000C0de"]},"wallet_kind":{"type":"string","enum":["eoa","delegated_eoa","safe","smart_account"],"description":"How the wallet signs, which sets the shape of the payload. `eoa` sends each step as its own transaction, `delegated_eoa` (EIP-7702) batches them with `wallet_sendCalls`, `safe` runs them as one MultiSend transaction, and `smart_account` (ERC-4337 and others) as one user operation. Required: Tenor doesn't infer the wallet kind."},"limit_rate":{"description":"The worst rate the wallet accepts, at most 1 (100%). Enforced onchain: a worse fill reverts. A minimum when lending or repaying, and a maximum when borrowing or reselling. Default: the quote's worst rate, moved against the wallet by 0.10 percentage points for `eoa` and `delegated_eoa`, or 0.30 for `safe` and `smart_account`, which sign later. Annual rate as a decimal fraction (\"0.052\" = 5.2%).","examples":["0.045"],"type":"string","pattern":"^(0|[1-9]\\d*)(\\.\\d{1,18})?$"},"deadline_at":{"description":"The last moment the payload can be included in a block, enforced onchain. At least 60 s away, and within the wallet kind's signing window (5 min for `eoa` and `delegated_eoa`, 30 min for `safe` and `smart_account`). Default: the end of that window. Unix seconds.","examples":[1791561900],"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"dry_run":{"default":false,"description":"Preview the action with nothing to send. The simulation funds the wallet, so a dry run works before the wallet holds the tokens. Returns `status: preview_only`. Always on for test keys.","examples":[false],"type":"boolean"},"client_id":{"description":"The caller's own reference for this prepare, echoed back and logged.","examples":["desk-7:42"],"type":"string","pattern":"^[A-Za-z0-9._:-]{1,64}$"},"include_onchain":{"default":false,"description":"Also return `onchain`: the payload's calls decoded, with the result of each call in the simulation and the events they emitted. A dry run has no calldata, so `onchain` holds only the events.","examples":[false],"type":"boolean"},"maturity_id":{"type":"string","pattern":"^0x[0-9a-fA-F]{64}$","description":"The maturity of the borrow to repay.","examples":["0x9c1e7f4a0b2d3e5f6a7b8c9d0e1f2a3b4c5d6e7f8091a2b3c4d5e6f708192a3b"]},"size":{"$ref":"#/components/schemas/RepaySize"},"direct":{"default":false,"description":"Repay by paying the full amount owed at maturity now, without taking offers. A direct repay has no quote, `limit_rate` or deadline. It costs more than repaying early by taking offers, but works when the open offers can't fill the repay. After maturity, every repay is direct.","examples":[false],"type":"boolean"},"withdraw_collateral":{"$ref":"#/components/schemas/RepayWithdrawal"}},"required":["chain_id","wallet","wallet_kind","maturity_id"],"additionalProperties":false},"RepaySize":{"anyOf":[{"type":"object","properties":{"principal":{"type":"string","pattern":"^[1-9]\\d*$","description":"The amount the wallet pays now. The debt repaid follows from the rate, and can't exceed the borrow.","examples":["5000000"]}},"required":["principal"],"additionalProperties":false},{"type":"object","properties":{"amount_at_maturity":{"type":"string","pattern":"^[1-9]\\d*$","description":"The part of the amount owed at maturity to repay. The principal paid follows from the rate. The payload pulls at most the principal `limit_rate` allows, and returns the rest in the same transaction.","examples":["5020050"]}},"required":["amount_at_maturity"],"additionalProperties":false}],"description":"Exactly one of `principal` or `amount_at_maturity`, in the loan token's smallest unit. Leave `size` out to repay the whole borrow, as owed in the block the payload is included in."},"RepayWithdrawal":{"type":"object","properties":{"token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"A collateral token the wallet has posted on this maturity. A `yield_shares` collateral isn't accepted here.","examples":["0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf"]},"amount":{"type":"string","pattern":"^[1-9]\\d*$","description":"The amount to withdraw. Leave `amount` out to withdraw all of this collateral. Integer string in the token's smallest unit.","examples":["250000"]}},"required":["token"],"additionalProperties":false,"description":"Collateral to withdraw in the same payload, after the repay. Rejected when the remaining collateral couldn't carry the remaining debt. The error's `details.max_amount` is the most the wallet can withdraw."},"Requirement":{"type":"object","properties":{"kind":{"type":"string","enum":["approval","authorization","bootstrap"]},"reason":{"type":"string","examples":["Allowance for this action"]},"rate_type":{"description":"Whether the authorization is for the market's fixed maturities or its variable rate.","type":"string","enum":["fixed","variable"]},"token":{"type":"string","description":"The token approved.","examples":["0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"]},"spender":{"type":"string","description":"The address allowed to spend the token.","examples":["0xb98c948CFA24072e58935BC004a8A7b376AE746A"]},"amount":{"type":"string","description":"The allowance after the approval. Integer string in the token's smallest unit.","examples":["5000000"]},"current":{"type":"string","description":"The allowance before the approval. Integer string in the token's smallest unit.","examples":["0"]},"transaction":{"description":"Left out on a dry run.","$ref":"#/components/schemas/TransactionPayload"}},"required":["kind","reason"]},"ResellPrepareRequest":{"type":"object","properties":{"chain_id":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"The EVM chain ID. `GET /v1/chains` lists the chains served.","examples":[8453]},"wallet":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"The wallet that will sign and send the payload. Any address but the zero address is accepted, since a payload does nothing until that wallet signs it.","examples":["0x7A1f00000000000000000000000000000000C0de"]},"wallet_kind":{"type":"string","enum":["eoa","delegated_eoa","safe","smart_account"],"description":"How the wallet signs, which sets the shape of the payload. `eoa` sends each step as its own transaction, `delegated_eoa` (EIP-7702) batches them with `wallet_sendCalls`, `safe` runs them as one MultiSend transaction, and `smart_account` (ERC-4337 and others) as one user operation. Required: Tenor doesn't infer the wallet kind."},"limit_rate":{"description":"The worst rate the wallet accepts, at most 1 (100%). Enforced onchain: a worse fill reverts. A minimum when lending or repaying, and a maximum when borrowing or reselling. Default: the quote's worst rate, moved against the wallet by 0.10 percentage points for `eoa` and `delegated_eoa`, or 0.30 for `safe` and `smart_account`, which sign later. Annual rate as a decimal fraction (\"0.052\" = 5.2%).","examples":["0.045"],"type":"string","pattern":"^(0|[1-9]\\d*)(\\.\\d{1,18})?$"},"deadline_at":{"description":"The last moment the payload can be included in a block, enforced onchain. At least 60 s away, and within the wallet kind's signing window (5 min for `eoa` and `delegated_eoa`, 30 min for `safe` and `smart_account`). Default: the end of that window. Unix seconds.","examples":[1791561900],"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"dry_run":{"default":false,"description":"Preview the action with nothing to send. The simulation funds the wallet, so a dry run works before the wallet holds the tokens. Returns `status: preview_only`. Always on for test keys.","examples":[false],"type":"boolean"},"client_id":{"description":"The caller's own reference for this prepare, echoed back and logged.","examples":["desk-7:42"],"type":"string","pattern":"^[A-Za-z0-9._:-]{1,64}$"},"include_onchain":{"default":false,"description":"Also return `onchain`: the payload's calls decoded, with the result of each call in the simulation and the events they emitted. A dry run has no calldata, so `onchain` holds only the events.","examples":[false],"type":"boolean"},"maturity_id":{"type":"string","pattern":"^0x[0-9a-fA-F]{64}$","description":"The maturity of the lend.","examples":["0x9c1e7f4a0b2d3e5f6a7b8c9d0e1f2a3b4c5d6e7f8091a2b3c4d5e6f708192a3b"]},"size":{"$ref":"#/components/schemas/ResellSize"}},"required":["chain_id","wallet","wallet_kind","maturity_id"],"additionalProperties":false},"ResellSize":{"anyOf":[{"type":"object","properties":{"principal":{"type":"string","pattern":"^[1-9]\\d*$","description":"The amount the wallet receives now. The part of the lend resold follows from the rate.","examples":["5000000"]}},"required":["principal"],"additionalProperties":false},{"type":"object","properties":{"amount_at_maturity":{"type":"string","pattern":"^[1-9]\\d*$","description":"The part of the lend to resell, as an amount at maturity before the continuous fee. A position's `amount_at_maturity` is net of that fee. To exit the whole lend, leave `size` out.","examples":["5020050"]}},"required":["amount_at_maturity"],"additionalProperties":false}],"description":"Exactly one of `principal` or `amount_at_maturity`, in the loan token's smallest unit. Leave `size` out to resell the whole lend, as held in the block the payload is included in."},"ResponseMeta":{"type":"object","properties":{"request_id":{"type":"string","description":"The request's ID, also sent as `X-Request-Id`.","examples":["req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"]},"generated_at":{"type":"string","description":"When the data was read, in ISO-8601 UTC.","examples":["2026-10-09T14:00:01Z"]},"block_number":{"description":"The block the data was read at. Set on chain-scoped reads only.","examples":[36512345],"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"next_cursor":{"description":"The `cursor` for the next page. `null` on the last page. Set on lists only.","examples":["eyJpZCI6IjEyMyJ9"],"type":["string","null"]}},"required":["request_id","generated_at"]},"RouterCheck":{"type":"object","properties":{"status":{"type":"string","enum":["up","down","unconfigured"],"description":"`down`: quotes, market depth and payloads fail with `ROUTER_UNAVAILABLE` until the quote engine recovers."},"latency_ms":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"examples":[42]},"circuit":{"type":"string","enum":["closed","open","half_open"],"description":"`open`: after repeated failures of the quote engine, calls fail at once. Then one trial call is let through."},"in_flight":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"examples":[3]},"queued":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"examples":[0]},"error":{"examples":["Tenor's quote engine didn't answer in time. Retry."],"type":"string"}},"required":["status","latency_ms","circuit","in_flight","queued"]},"RpcCheck":{"type":"object","properties":{"status":{"type":"string","enum":["up","degraded","pending"],"description":"`degraded`: payloads and dry runs are unavailable on this chain until the next check passes. `pending`: not checked yet."},"block_number":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"The RPC's latest block.","examples":[36512345]},"lag_s":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"The age of that block, in seconds.","examples":[1]},"simulate":{"anyOf":[{"type":"string","enum":["ok","failed"]},{"type":"null"}],"description":"Whether the RPC ran the test `eth_simulateV1` call."},"checked_at":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"examples":[1791561600]},"error":{"examples":["the RPC head is 75 s behind"],"type":"string"}},"required":["status","block_number","lag_s","simulate","checked_at"]},"SafeTransaction":{"type":"object","properties":{"to":{"type":"string","description":"MultiSendCallOnly v1.4.1.","examples":["0x9641d764fc13c8B624c04430C7356C1C7C8102e2"]},"data":{"type":"string","description":"`multiSend` over `calls`.","examples":["0x8d80ff0a"]},"value":{"type":"string","description":"Always zero. Integer string, in wei.","examples":["0"]},"operation":{"type":"number","const":1,"description":"Delegate call."}},"required":["to","data","value","operation"],"description":"For a `safe`, one Safe transaction that runs every step. Propose the transaction, collect the owners' signatures, then execute it."},"SetCurveRequest":{"type":"object","properties":{"chain_id":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"The EVM chain ID. `GET /v1/chains` lists the chains served.","examples":[8453]},"wallet":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"The wallet that will sign and send the payload. Any address but the zero address is accepted, since a payload does nothing until that wallet signs it.","examples":["0x7A1f00000000000000000000000000000000C0de"]},"wallet_kind":{"type":"string","enum":["eoa","delegated_eoa","safe","smart_account"],"description":"How the wallet signs, which sets the shape of the payload. `eoa` sends each step as its own transaction, `delegated_eoa` (EIP-7702) batches them with `wallet_sendCalls`, `safe` runs them as one MultiSend transaction, and `smart_account` (ERC-4337 and others) as one user operation. Required: Tenor doesn't infer the wallet kind."},"dry_run":{"default":false,"description":"Preview the action with nothing to send. The simulation funds the wallet, so a dry run works before the wallet holds the tokens. Returns `status: preview_only`. Always on for test keys.","examples":[false],"type":"boolean"},"client_id":{"description":"The caller's own reference for this prepare, echoed back and logged.","examples":["desk-7:42"],"type":"string","pattern":"^[A-Za-z0-9._:-]{1,64}$"},"include_onchain":{"default":false,"description":"Also return `onchain`: the payload's calls decoded, with the result of each call in the simulation and the events they emitted. A dry run has no calldata, so `onchain` holds only the events.","examples":[false],"type":"boolean"},"market_id":{"type":"string","pattern":"^0x[0-9a-fA-F]{64}$","description":"The market the curve quotes. `GET /v1/markets` lists markets.","examples":["0x3f81019286c6aa6265e5823a23c4f08e0f41c953236bad782c7739eb9ee6db11"]},"points":{"type":"array","items":{"type":"object","properties":{"time_to_maturity_s":{"type":"integer","exclusiveMinimum":0,"maximum":4294967295,"description":"The time to maturity this point applies to, in seconds.","examples":[2592000]},"lend_rate":{"type":"string","pattern":"^(0|[1-9]\\d*)(\\.\\d{1,18})?$","description":"The rate the wallet lends at on a maturity this far from maturing, at most 0.3 (30%), checked on the rate sent. Annual rate as a decimal fraction (\"0.052\" = 5.2%).","examples":["0.05"]},"resell_rate":{"type":"string","pattern":"^(0|[1-9]\\d*)(\\.\\d{1,18})?$","description":"The exit rate: the rate the wallet resells its fixed lends at on a maturity this far from maturing. Must be below `lend_rate`, so the curve's two sides never cross.","examples":["0.04"]}},"required":["time_to_maturity_s","lend_rate","resell_rate"],"additionalProperties":false},"minItems":2,"maxItems":8,"description":"2 to 8 points in ascending time to maturity, the first at least 3600 s from maturity. Between two points, the rate follows the straight line joining them. Past either end, the rate stays at the end point's rate. The first and last points also set the maturities the curve lends into."},"vault":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"The vault the curve lends from and returns exit proceeds to: a vault Tenor lists that holds the market's loan token, such as another market's lending vault. One vault can back curves on every market with that loan token, and those curves share its balance. Defaults to the vault the curve's setup already uses, else the market's lending vault.","examples":["0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB"]},"fund":{"description":"Deposit idle capital into the curve's vault, in the same payload.","type":"object","properties":{"principal":{"type":"string","pattern":"^[1-9]\\d*$","description":"The idle capital to deposit, in the loan token's smallest unit.","examples":["25000000000"]}},"required":["principal"],"additionalProperties":false}},"required":["chain_id","wallet","wallet_kind","market_id","points"],"additionalProperties":false},"SimulateRequest":{"type":"object","properties":{"chain_id":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"The EVM chain ID. `GET /v1/chains` lists the chains served.","examples":[8453]},"wallet":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"The wallet that will send the calls. The calls run from this wallet, in order.","examples":["0x7A1f00000000000000000000000000000000C0de"]},"wallet_kind":{"type":"string","enum":["eoa","delegated_eoa","safe","smart_account"],"description":"How the wallet signs, as passed to the prepare. A `safe` can send its `safe_tx` as the only call. The `safe_tx` is then checked as the calls it batches (up to 64), and the response's `calls` and every `call_index` count those. A value that doesn't match the wallet's code gets a `WALLET_KIND_MISMATCH` warning."},"calls":{"minItems":1,"maxItems":64,"type":"array","items":{"$ref":"#/components/schemas/Call"},"description":"1 to 64 calls, as the wallet will send them: a prepare's `calls`, edited or not. At least one call must go to one of Tenor's contracts on the chain: any `GET /v1/chains` lists but `morpho_blue` and `permit2`.","examples":[[{"to":"0xAdedD8ab6dE832766Fedf0FaC4992E5C4D3EA18A","data":"0xb78212ab000000000000000000000000dbb74bf80bd05a1959c8f21e2b821dcfed87104c00000000000000000000000000000000000000000000000000000000000000010000000000000000000000007a1f00000000000000000000000000000000c0de","value":"0"}]]},"include_onchain":{"default":false,"description":"Also return `onchain`: the calls decoded, with the result of each, and the events they emitted (see `Onchain`).","examples":[false],"type":"boolean"}},"required":["chain_id","wallet","wallet_kind","calls"],"additionalProperties":false},"SimulatedCall":{"type":"object","properties":{"index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The call's position in `calls`, or among the calls a `safe_tx` batches.","examples":[1]},"to":{"type":"string","description":"The contract called, checksummed.","examples":["0x6BFd8137e702540E7A42B74178A4a49Ba43920C4"]},"success":{"type":"boolean","description":"Whether the call executed.","examples":[true]},"gas_used":{"type":"string","description":"Gas the call used. Integer string.","examples":["329000"]},"gas":{"type":"string","description":"A gas limit to send this call on its own: the gas used, plus 50%, plus 50,000, as for a prepare's steps. A `safe_tx` sends its calls as one transaction, so size its gas from `preview.gas_used`. Integer string.","examples":["441250"]},"foreign":{"type":"boolean","description":"`true` when the call, or a call it bundles, goes to a contract outside Tenor's. The call is simulated, but Tenor doesn't check what it does. A `FOREIGN_CALL` warning names the address and the tokens the call sends from the wallet.","examples":[false]},"revert":{"description":"Why the call reverted, decoded when a known ABI describes the error.","examples":[null],"type":["string","null"]}},"required":["index","to","success","gas_used","gas","foreign","revert"]},"SimulatedFill":{"type":"object","properties":{"call_index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The call that made the fill.","examples":[1]},"maturity_id":{"type":"string","examples":["0x9c1e7f4a0b2d3e5f6a7b8c9d0e1f2a3b4c5d6e7f8091a2b3c4d5e6f708192a3b"]},"side":{"type":"string","enum":["lend","borrow"],"description":"The wallet's side. The wallet lends when it takes a borrow offer, and borrows when it takes a lend offer."},"group":{"type":"string","description":"The group of the maker's offer, as shown on the offer.","examples":["0x74656e6f72000000000000000000000000000000000000000000000000000001"]},"maker":{"type":"string","description":"The wallet whose offer was taken, checksummed.","examples":["0x3c4d1b5e6f708192a3B4c5d6e7f8091A2B3C4D5e"]},"principal":{"type":"string","description":"The amount the wallet paid as lender, or received as borrower. Integer string in the loan token's smallest unit.","examples":["5000000"]},"amount_at_maturity":{"type":"string","description":"The amount the wallet is owed, or owes, at maturity for this fill. Integer string in the loan token's smallest unit.","examples":["5020050"]},"rate":{"description":"This fill's rate at the simulated block. `null` when no call in the batch names the maturity's market, which the rate needs. Annual rate as a decimal fraction (\"0.052\" = 5.2%).","examples":["0.0481"],"type":["string","null"]}},"required":["call_index","maturity_id","side","group","maker","principal","amount_at_maturity","rate"],"description":"An offer the wallet takes, read from the simulated events."},"SimulatedPosition":{"type":"object","properties":{"maturity_id":{"type":"string","examples":["0x9c1e7f4a0b2d3e5f6a7b8c9d0e1f2a3b4c5d6e7f8091a2b3c4d5e6f708192a3b"]},"before":{"description":"The position before the calls.","$ref":"#/components/schemas/PositionPreview"},"after":{"description":"The position after the calls. A `HEALTH_THRESHOLD` warning flags a position left above 95% of its borrow capacity, and worse off than before.","$ref":"#/components/schemas/PositionPreview"}},"required":["maturity_id","before","after"]},"Simulation":{"type":"object","properties":{"status":{"type":"string","enum":["ok","reverts","unsafe"],"description":"`ok`: every call executes and every check passes. Check for a `FOREIGN_CALL` warning too: it names the tokens that calls outside Tenor's contracts send from the wallet, and no check covers those. `reverts`: a call fails, and its `revert` gives the reason. `unsafe`: the calls execute, but a check failed, named in `checks.violated`. New values may be added."},"calls":{"type":"array","items":{"$ref":"#/components/schemas/SimulatedCall"},"description":"Each call, in order, with its result."},"preview":{"$ref":"#/components/schemas/SimulationPreview"},"checks":{"$ref":"#/components/schemas/SimulationChecks"},"until_at":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"The last moment the calls can be included in a block, in Unix seconds: the earliest of their deadlines, the end of a taken offer's window, and the maturity. `null` when the calls fill no offers.","examples":[1791561900]},"warnings":{"type":"array","items":{"$ref":"#/components/schemas/Warning"},"description":"Notices to show the user. Warnings never block the calls."},"onchain":{"$ref":"#/components/schemas/Onchain"}},"required":["status","calls","preview","checks","until_at","warnings"]},"SimulationChecks":{"type":"object","properties":{"checked":{"type":"array","items":{"type":"string"},"description":"The safety checks that ran: the ones that don't need the original request. Checks that compare a prepare's payload with its request, such as the rate bound and the approval check, can't run here.","examples":[["FORBIDDEN_APPROVAL","INFINITE_APPROVAL","NO_PERMISSIVE_EXECUTE","NO_SELF_CROSS","REGISTRY_TARGETS","WALLET_OUTFLOWS"]]},"violated":{"type":"array","items":{"$ref":"#/components/schemas/CheckViolation"},"description":"The checks that failed. Empty when `status` is `ok`."}},"required":["checked","violated"]},"SimulationPreview":{"type":"object","properties":{"balance_changes":{"type":"array","items":{"type":"object","properties":{"token":{"type":"string","description":"The token. Native value is 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE.","examples":["0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"]},"delta":{"type":"string","description":"Negative when the token leaves the wallet. Integer string in the token's smallest unit.","examples":["-5000000"]}},"required":["token","delta"]},"description":"The wallet's net movement per token."},"fills":{"type":"array","items":{"$ref":"#/components/schemas/SimulatedFill"},"description":"The offers the wallet takes, in the order taken."},"positions":{"type":"array","items":{"$ref":"#/components/schemas/SimulatedPosition"},"description":"The wallet's position on each maturity the calls act on, read in the same block before and after them."},"positions_unread":{"type":"array","items":{"type":"string"},"description":"Maturities the calls act on whose position wasn't read, because they come after the first 8 or because the read failed.","examples":[[]]},"gas_used":{"type":"string","description":"Gas used by all the calls together. Integer string.","examples":["353000"]}},"required":["balance_changes","fills","positions","positions_unread","gas_used"],"description":"The effects of the calls, run from the wallet at the latest block."},"SourcePreview":{"type":"object","properties":{"rate_type":{"type":"string","enum":["fixed","variable"],"description":"`fixed` for a renew, which closes a position on a maturity; `variable` for a migration, which closes a variable borrow."},"maturity_id":{"type":"string","description":"The maturity the position moves out of. Set when `rate_type` is `fixed`.","examples":["0x9c1e7f4a0b2d3e5f6a7b8c9d0e1f2a3b4c5d6e7f8091a2b3c4d5e6f708192a3b"]},"variable_market_id":{"type":"string","description":"The variable market the borrow moves out of. Set when `rate_type` is `variable`.","examples":["0x9c1e7f4a0b2d3e5f6a7b8c9d0e1f2a3b4c5d6e7f8091a2b3c4d5e6f708192a3b"]},"bought_back":{"description":"The part of a borrow's debt repaid early by taking offers, for less than the amount owed. The rest is repaid in full. Left out when no part was repaid early.","type":"object","properties":{"principal":{"type":"string","description":"The principal paid now to repay this part by taking offers. Integer string in the token's smallest unit.","examples":["1990000000"]},"amount_at_maturity":{"type":"string","description":"The debt repaid, as an amount at maturity. Integer string in the token's smallest unit.","examples":["2000000000"]}},"required":["principal","amount_at_maturity"]},"position_before":{"$ref":"#/components/schemas/PositionPreview"},"position_after":{"description":"Empty once the payload is included in a block, since the whole position moves.","$ref":"#/components/schemas/PositionPreview"},"variable_before":{"$ref":"#/components/schemas/VariablePositionPreview"},"variable_after":{"$ref":"#/components/schemas/VariablePositionPreview"}},"required":["rate_type"],"description":"The position a renew or a migration closes, before and after the payload. Left out when the onchain reads failed."},"Step":{"type":"object","properties":{"index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"examples":[0]},"role":{"type":"string","enum":["bootstrap","approval","authorization","main"]},"transaction":{"$ref":"#/components/schemas/TransactionPayload"},"description":{"type":"string","examples":["Approve 5 USDC"]}},"required":["index","role","transaction","description"]},"TakeCollateral":{"type":"object","properties":{"token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"A collateral token of the market, from its `collaterals` in `GET /v1/markets`. A `yield_shares` collateral isn't accepted here.","examples":["0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf"]},"amount":{"type":"string","pattern":"^[1-9]\\d*$","description":"The amount to deposit. The payload pulls the full amount. Integer string in the token's smallest unit.","examples":["250000"]}},"required":["token","amount"],"additionalProperties":false,"description":"Collateral to deposit in the same payload when taking a lend offer. Leave `deposit_collateral` out to borrow against collateral the wallet has already posted. Taking a borrow offer needs no collateral."},"TakePrepareRequest":{"type":"object","properties":{"chain_id":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"The EVM chain ID. `GET /v1/chains` lists the chains served.","examples":[8453]},"wallet":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"The wallet that will sign and send the payload. Any address but the zero address is accepted, since a payload does nothing until that wallet signs it.","examples":["0x7A1f00000000000000000000000000000000C0de"]},"wallet_kind":{"type":"string","enum":["eoa","delegated_eoa","safe","smart_account"],"description":"How the wallet signs, which sets the shape of the payload. `eoa` sends each step as its own transaction, `delegated_eoa` (EIP-7702) batches them with `wallet_sendCalls`, `safe` runs them as one MultiSend transaction, and `smart_account` (ERC-4337 and others) as one user operation. Required: Tenor doesn't infer the wallet kind."},"limit_rate":{"description":"The worst rate the wallet accepts, at most 1 (100%). Enforced onchain: a worse fill reverts. A minimum when lending or repaying, and a maximum when borrowing or reselling. Default: the quote's worst rate, moved against the wallet by 0.10 percentage points for `eoa` and `delegated_eoa`, or 0.30 for `safe` and `smart_account`, which sign later. Annual rate as a decimal fraction (\"0.052\" = 5.2%).","examples":["0.045"],"type":"string","pattern":"^(0|[1-9]\\d*)(\\.\\d{1,18})?$"},"deadline_at":{"description":"The last moment the payload can be included in a block, enforced onchain. At least 60 s away, and within the wallet kind's signing window (5 min for `eoa` and `delegated_eoa`, 30 min for `safe` and `smart_account`). Default: the end of that window. Unix seconds.","examples":[1791561900],"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"dry_run":{"default":false,"description":"Preview the action with nothing to send. The simulation funds the wallet, so a dry run works before the wallet holds the tokens. Returns `status: preview_only`. Always on for test keys.","examples":[false],"type":"boolean"},"client_id":{"description":"The caller's own reference for this prepare, echoed back and logged.","examples":["desk-7:42"],"type":"string","pattern":"^[A-Za-z0-9._:-]{1,64}$"},"include_onchain":{"default":false,"description":"Also return `onchain`: the payload's calls decoded, with the result of each call in the simulation and the events they emitted. A dry run has no calldata, so `onchain` holds only the events.","examples":[false],"type":"boolean"},"offer_id":{"type":"string","pattern":"^[A-Za-z0-9:_-]{1,200}$","description":"The offer to take, from the takeable offers list or a quote's `route`: a UUID, a `syn:` ID for an offer quoted from a passive quoting curve, or `syn:withdrawable:<maturity_id>` for the 0% lend offer funded by the maturity's withdrawable liquidity. Taking a lend offer borrows, and taking a borrow offer lends.","examples":["0f0e5c4e-6a8b-4a61-9a43-1c2d3e4f5a6b"]},"size":{"$ref":"#/components/schemas/TakeSize"},"deposit_collateral":{"$ref":"#/components/schemas/TakeCollateral"}},"required":["chain_id","wallet","wallet_kind","offer_id","size"],"additionalProperties":false},"TakeSize":{"anyOf":[{"type":"object","properties":{"principal":{"type":"string","pattern":"^[1-9]\\d*$","description":"The principal that changes hands now: the amount the wallet receives when taking a lend offer, or pays when taking a borrow offer.","examples":["5000000"]}},"required":["principal"],"additionalProperties":false},{"type":"object","properties":{"amount_at_maturity":{"type":"string","pattern":"^[1-9]\\d*$","description":"The amount the wallet owes at maturity (taking a lend offer) or gets back (taking a borrow offer). The principal follows from the offer's rate, bounded by `limit_rate`.","examples":["5020050"]}},"required":["amount_at_maturity"],"additionalProperties":false}],"description":"Exactly one of `principal` or `amount_at_maturity`, in the loan token's smallest unit, at most the offer's remaining size."},"TakeableOffer":{"type":"object","properties":{"offer_id":{"type":"string","description":"The ID to pass to `POST /v1/take/prepare`. A `syn:` ID is an offer quoted from a passive quoting curve. `syn:withdrawable:<maturity_id>` is a 0% lend offer funded by the maturity's withdrawable liquidity.","examples":["0f0e5c4e-6a8b-4a61-9a43-1c2d3e4f5a6b"]},"maker":{"type":"string","description":"The offer's maker, checksummed.","examples":["0x7A1f00000000000000000000000000000000C0de"]},"rate":{"type":"string","description":"The rate the taker gets or pays on this offer, fees included. Annual rate as a decimal fraction (\"0.052\" = 5.2%).","examples":["0.0505"]},"principal":{"type":"string","description":"The principal that can be taken now: the amount a lender pays or a borrower receives. Integer string in the loan token's smallest unit.","examples":["500000000"]},"amount_at_maturity":{"type":"string","description":"The amount that principal is owed, or pays back, at maturity. Integer string in the loan token's smallest unit.","examples":["502075000"]},"expires_at":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"When the offer stops being takeable, in Unix seconds.","examples":[1791565200]},"synthetic":{"type":"boolean","description":"`true` when the offer wasn't posted: it is quoted from a passive quoting curve, or it is the 0% `syn:withdrawable` offer.","examples":[false]}},"required":["offer_id","maker","rate","principal","amount_at_maturity","expires_at","synthetic"]},"TakeableOffers":{"type":"object","properties":{"chain_id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"examples":[8453]},"maturity_id":{"type":"string","examples":["0x9c1e7f4a0b2d3e5f6a7b8c9d0e1f2a3b4c5d6e7f8091a2b3c4d5e6f708192a3b"]},"side":{"type":"string","enum":["lend","borrow"]},"offers":{"type":"array","items":{"$ref":"#/components/schemas/TakeableOffer"},"description":"Best rate first. The amounts all come from one route, so they can all be taken together."}},"required":["chain_id","maturity_id","side","offers"]},"TermStructureEntry":{"type":"object","properties":{"maturity_id":{"type":"string","examples":["0x9c1e7f4a0b2d3e5f6a7b8c9d0e1f2a3b4c5d6e7f8091a2b3c4d5e6f708192a3b"]},"matures_at":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"When positions in this maturity come due, in Unix seconds.","examples":[1795190400]},"time_to_maturity_s":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Seconds left until `matures_at`.","examples":[3628800]},"quote":{"anyOf":[{"$ref":"#/components/schemas/Quote"},{"type":"null"}],"description":"`null` when this maturity can't be quoted. `error` gives the reason."},"error":{"anyOf":[{"type":"object","properties":{"code":{"type":"string","description":"An error code, such as `NO_OFFERS`, `INSUFFICIENT_LIQUIDITY`, `LIMIT_RATE_NOT_MET` or `MATURITY_MATURED`.","examples":["NO_OFFERS"]},"message":{"type":"string","examples":["No offer can fill this size right now."]}},"required":["code","message"]},{"type":"null"}],"description":"Set when `quote` is `null`. `null` otherwise."}},"required":["maturity_id","matures_at","time_to_maturity_s","quote","error"]},"TermStructureMaturity":{"type":"object","properties":{"maturity_id":{"type":"string","examples":["0x9c1e7f4a0b2d3e5f6a7b8c9d0e1f2a3b4c5d6e7f8091a2b3c4d5e6f708192a3b"]},"matures_at":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"When positions in this maturity come due, in Unix seconds.","examples":[1795190400]},"time_to_maturity_s":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Seconds left until `matures_at`.","examples":[3628800]},"status":{"type":"string","enum":["active","deprecated"],"description":"`deprecated`: Tenor is phasing out the maturity. Deprecated maturities are listed only with `include_deprecated`."},"lend_rate":{"anyOf":[{"type":"string","description":"The rate lending earns now: the rate of the best borrow offer, before fees. `null` when there are no borrow offers. Annual rate as a decimal fraction (\"0.052\" = 5.2%).","examples":["0.0498"]},{"type":"null"}]},"borrow_rate":{"anyOf":[{"type":"string","description":"The rate borrowing pays now: the rate of the best lend offer, before fees. `null` when there are no lend offers. `0` when the maturity has withdrawable liquidity, which its 0% lend offer lends. Annual rate as a decimal fraction (\"0.052\" = 5.2%).","examples":["0.0525"]},{"type":"null"}]},"mid_rate":{"anyOf":[{"type":"string","description":"Halfway between `lend_rate` and `borrow_rate`. `null` unless both sides have offers. Annual rate as a decimal fraction (\"0.052\" = 5.2%).","examples":["0.05115"]},{"type":"null"}]},"lend_liquidity":{"type":"string","description":"The principal that can be lent now, across all rates. Integer string in the loan token's smallest unit.","examples":["250000000000"]},"borrow_liquidity":{"type":"string","description":"The principal that can be borrowed now, across all rates. Integer string in the loan token's smallest unit.","examples":["575046025162"]}},"required":["maturity_id","matures_at","time_to_maturity_s","status","lend_rate","borrow_rate","mid_rate","lend_liquidity","borrow_liquidity"]},"TermStructureQuote":{"type":"object","properties":{"chain_id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"examples":[8453]},"market_id":{"type":"string","examples":["0x3f81019286c6aa6265e5823a23c4f08e0f41c953236bad782c7739eb9ee6db11"]},"action":{"type":"string","enum":["lend","borrow"]},"maturities":{"type":"array","items":{"$ref":"#/components/schemas/TermStructureEntry"},"description":"One entry per maturity, earliest first."}},"required":["chain_id","market_id","action","maturities"]},"TermStructureQuoteRequest":{"type":"object","properties":{"chain_id":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"The EVM chain ID. `GET /v1/chains` lists the chains served.","examples":[8453]},"market_id":{"type":"string","pattern":"^0x[0-9a-fA-F]{64}$","description":"The market whose maturities to quote, from `GET /v1/markets`.","examples":["0x3f81019286c6aa6265e5823a23c4f08e0f41c953236bad782c7739eb9ee6db11"]},"action":{"type":"string","enum":["lend","borrow"],"description":"`lend` or `borrow`, quoted for the same size on every maturity."},"size":{"$ref":"#/components/schemas/QuoteSize"},"limit_rate":{"description":"The worst rate accepted, at most 1 (100%): a minimum for `lend` and `repay`, a maximum for `borrow` and `resell`. Offers beyond the limit are skipped. Annual rate as a decimal fraction (\"0.052\" = 5.2%).","examples":["0.05"],"type":"string","pattern":"^(0|[1-9]\\d*)(\\.\\d{1,18})?$"},"allow_partial":{"default":false,"description":"Quote the part the open offers can fill when they can't fill the whole size, instead of failing with `INSUFFICIENT_LIQUIDITY`.","examples":[false],"type":"boolean"},"wallet":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"The wallet that would act on the quote, as passed to the prepare. The wallet's own offers are skipped, and offers reserved for it are included.","examples":["0x7A1f00000000000000000000000000000000C0de"]},"max_offers":{"default":16,"description":"The most offers the route may fill.","examples":[16],"type":"integer","minimum":1,"maximum":50},"wallet_kind":{"description":"How the wallet will sign. The quote fills only offers that stay fillable for the wallet's signing window (5 min for `eoa` and `delegated_eoa`, 30 min for `safe` and `smart_account`), as its prepare will.","type":"string","enum":["eoa","delegated_eoa","safe","smart_account"]},"maturity_ids":{"description":"The maturities to quote, up to 12. Default: every maturity open for new lends and borrows, earliest first.","minItems":1,"maxItems":12,"type":"array","items":{"type":"string","pattern":"^0x[0-9a-fA-F]{64}$","description":"A maturity of this market.","examples":["0x9c1e7f4a0b2d3e5f6a7b8c9d0e1f2a3b4c5d6e7f8091a2b3c4d5e6f708192a3b"]}}},"required":["chain_id","market_id","action","size"],"additionalProperties":false},"Token":{"type":"object","properties":{"address":{"type":"string","description":"Checksummed.","examples":["0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"]},"chain_id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"examples":[8453]},"symbol":{"type":"string","examples":["USDC"]},"name":{"type":"string","examples":["USD Coin"]},"decimals":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"examples":[6]},"type":{"type":"string","enum":["erc20","erc4626"],"description":"`erc4626`: shares of a vault (see `underlying`)."},"underlying":{"anyOf":[{"type":"string","description":"For vault shares, the token the vault holds. `null` for other tokens.","examples":["0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"]},{"type":"null"}]}},"required":["address","chain_id","symbol","name","decimals","type","underlying"]},"Transaction":{"type":"object","properties":{"tx_hash":{"type":"string","examples":["0x5a2b9e0f1c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f60718293a4b5c6d7"]},"chain_id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"examples":[8453]},"status":{"type":"string","enum":["not_found","pending","mined","confirmed","reverted"],"description":"`not_found`: the chain doesn't know the hash yet, or the transaction was dropped or replaced. `pending`: waiting to be included in a block. `mined`: in a block, with fewer than `confirmations_required` confirmations. `success` shows whether it executed. `confirmed`: final, and executed. `reverted`: final, and reverted, so it changed nothing. `confirmed` and `reverted` don't change again. New values may be added."},"success":{"description":"`true` when the transaction executed, `false` when it reverted. `null` until it is mined.","examples":[true],"type":["boolean","null"]},"block_number":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"The block the transaction is in. `null` until it is mined.","examples":[52872640]},"mined_at":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"The block's time, in Unix seconds. `null` until the transaction is mined.","examples":[1792627200]},"confirmations":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The number of blocks from the transaction's block to the latest, both included. 1 when the transaction is in the latest block, 0 until it is mined.","examples":[3]},"confirmations_required":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The confirmations this chain needs before `confirmed` or `reverted`: 1 on Base and Arc, 2 on Ethereum.","examples":[1]},"receipt":{"anyOf":[{"$ref":"#/components/schemas/TransactionReceipt"},{"type":"null"}],"description":"`null` until the transaction is mined."},"indexed":{"type":"boolean","description":"`true` once `GET /v1/accounts/{wallet}/fills`, `/positions` and `GET /v1/offers` show the transaction, or the transaction did nothing Tenor records (an approval, a transfer, a revert). Tenor records fills, repays, redemptions, collateral moves, liquidations and offer changes. `fills`, `position_changes` and `offers_changed` are complete only once `indexed` is `true`. Rarely, Tenor records an event after `indexed` is already `true`. Always `false` before the transaction is mined.","examples":[true]},"fills":{"type":"array","items":{"$ref":"#/components/schemas/TransactionFill"},"description":"The fills the transaction made, both sides of each, in log order."},"position_changes":{"type":"array","items":{"$ref":"#/components/schemas/PositionChange"},"description":"Every position the transaction changed, for any wallet, in the order each first changed. Variable lends aren't included."},"offers_changed":{"type":"array","items":{"$ref":"#/components/schemas/OfferChange"},"description":"The offers the transaction posted, cancelled or reduced, by maker, group and maturity. Offers taken by a fill are in `fills`."},"onchain":{"$ref":"#/components/schemas/TransactionOnchain"}},"required":["tx_hash","chain_id","status","success","block_number","mined_at","confirmations","confirmations_required","receipt","indexed","fills","position_changes","offers_changed"]},"TransactionFill":{"type":"object","properties":{"wallet":{"type":"string","description":"The wallet on this side of the fill.","examples":["0x7A1f00000000000000000000000000000000C0de"]},"fill_id":{"type":"string","description":"`<chain_id>:<tx_hash>:<log_index>:<side>`. Stable, so a client can drop a fill it already has.","examples":["8453:0x5a2b9e0f1c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f60718293a4b5c6d7:212:lend"]},"chain_id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"examples":[8453]},"maturity_id":{"type":"string","description":"The maturity of the fill.","examples":["0x9c1e7f4a0b2d3e5f6a7b8c9d0e1f2a3b4c5d6e7f8091a2b3c4d5e6f708192a3b"]},"side":{"type":"string","enum":["lend","borrow"],"description":"Whether the wallet lent or borrowed in this fill."},"role":{"type":"string","enum":["maker","taker"],"description":"`maker`: one of the wallet's offers was taken. `taker`: the wallet took an offer."},"group":{"description":"The `group` of the maker's offer that filled, the same value as on the offer. `null` on an older fill until Tenor records it.","examples":["0x74656e6f720100c34f00000000000000000000000000000000000000000000a1"],"type":["string","null"]},"size":{"$ref":"#/components/schemas/FillSize"},"settlement_fee":{"anyOf":[{"type":"string","description":"The settlement fee the lender paid on top of the amount the borrower received. `null` when Tenor can't determine the fee. Integer string in the loan token's smallest unit.","examples":["1250000"]},{"type":"null"}]},"rate":{"anyOf":[{"type":"string","description":"The rate the wallet got: from its own principal to the amount at maturity, over the time left. `null` for a fill at or after maturity. Annual rate as a decimal fraction (\"0.052\" = 5.2%).","examples":["0.0521"]},{"type":"null"}]},"counterparty":{"description":"The wallet on the other side of the fill.","examples":["0x7A1f00000000000000000000000000000000C0de"],"type":["string","null"]},"block_number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"examples":[52872640]},"log_index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"examples":[212]},"filled_at":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The block's time. Unix seconds.","examples":[1792627200]},"tx_hash":{"type":"string","examples":["0x5a2b9e0f1c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f60718293a4b5c6d7"]}},"required":["wallet","fill_id","chain_id","maturity_id","side","role","group","size","settlement_fee","rate","counterparty","block_number","log_index","filled_at","tx_hash"],"description":"A fill as `GET /v1/accounts/{wallet}/fills` returns it for `wallet`, with the same `fill_id`. Each take has two: the maker's and the taker's."},"TransactionOnchain":{"type":"object","properties":{"events":{"type":"array","items":{"$ref":"#/components/schemas/OnchainEvent"},"description":"Every event in the receipt, in log order. Each has `call_index` 0, since a transaction is one call. Empty until the transaction is mined. An offer's posting log carries whatever its sender wrote, so read a wallet's offers from `offers_changed`."}},"required":["events"],"description":"The receipt's events, decoded by their ABIs like a prepare's `onchain.events`. The events carry only what the logs carry: a Mempool post holds whatever offers its sender wrote, for any maker. Read a wallet's offers from `offers_changed`. Returned when `include_onchain` is `true`. This object follows the contracts' ABIs, not this API's vocabulary, and changes with them, so the compatibility rule in Conventions doesn't cover it."},"TransactionPayload":{"type":"object","properties":{"chain_id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"examples":[8453]},"to":{"type":"string","description":"The contract the transaction calls.","examples":["0x6BFd8137e702540E7A42B74178A4a49Ba43920C4"]},"data":{"type":"string","description":"The calldata.","examples":["0x374f435d"]},"value":{"type":"string","description":"Native value to send. Integer string, in wei.","examples":["0"]},"gas":{"type":"string","description":"A gas limit: the simulated gas used, plus 50%, plus 50,000. Integer string.","examples":["412000"]},"description":{"type":"string","examples":["Lend 5 USDC"]}},"required":["chain_id","to","data","value","gas","description"],"description":"One unsigned transaction, ready for the wallet to sign."},"TransactionReceipt":{"type":"object","properties":{"from":{"type":"string","description":"The account that sent the transaction.","examples":["0x7A1f00000000000000000000000000000000C0de"]},"to":{"anyOf":[{"type":"string","description":"The account the transaction called. `null` for a contract creation.","examples":["0x6BFd8137e702540E7A42B74178A4a49Ba43920C4"]},{"type":"null"}]},"gas_used":{"type":"string","description":"Gas the transaction used, as an integer string.","examples":["412907"]},"effective_gas_price":{"type":"string","description":"The price paid per unit of gas. Integer string, in wei.","examples":["6002345"]}},"required":["from","to","gas_used","effective_gas_price"]},"Validity":{"type":"object","properties":{"until_at":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"The last moment the payload can be included in a block. A payload included later reverts, so it never fills at a worse rate or later than allowed. `null` when nothing in the payload expires (a redeem, a direct repay, a post): the payload takes effect whenever it is included in a block, or reverts if the position changed. Unix seconds.","examples":[1791561900]},"limited_by":{"type":"string","enum":["rate_lock","offer_window","deadline","maturity","none"],"description":"The constraint that sets `until_at`: `rate_lock` (the wallet kind's signing window), `offer_window` (an offer in the route stops being takeable), `deadline` (the request's `deadline_at`) or `maturity` (the maturity is near). `none` when there is no `until_at`."},"after":{"type":"string","enum":["reverts","no_effect"],"description":"The outcome of a payload included in a block after `until_at`."},"recommended_margin_s":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Seconds of margin to keep before `until_at`. If the wallet can't sign by `until_at` minus this margin, prepare again.","examples":[4]}},"required":["until_at","limited_by","after","recommended_margin_s"]},"VariableBorrowCollateral":{"type":"object","properties":{"token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"The collateral token of the market's variable rate (`variable.collateral_token` in `GET /v1/markets`).","examples":["0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf"]},"amount":{"type":"string","pattern":"^[1-9]\\d*$","description":"The amount to deposit. The payload pulls the full amount. Integer string in the token's smallest unit.","examples":["100000000"]}},"required":["token","amount"],"additionalProperties":false,"description":"Collateral to deposit first, in the same payload. Leave `deposit_collateral` out to borrow against collateral the wallet has already posted for the market's variable rate."},"VariableBorrowPrepareRequest":{"type":"object","properties":{"chain_id":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"The EVM chain ID. `GET /v1/chains` lists the chains served.","examples":[8453]},"wallet":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"The wallet that will sign and send the payload. Any address but the zero address is accepted, since a payload does nothing until that wallet signs it.","examples":["0x7A1f00000000000000000000000000000000C0de"]},"wallet_kind":{"type":"string","enum":["eoa","delegated_eoa","safe","smart_account"],"description":"How the wallet signs, which sets the shape of the payload. `eoa` sends each step as its own transaction, `delegated_eoa` (EIP-7702) batches them with `wallet_sendCalls`, `safe` runs them as one MultiSend transaction, and `smart_account` (ERC-4337 and others) as one user operation. Required: Tenor doesn't infer the wallet kind."},"dry_run":{"default":false,"description":"Preview the action with nothing to send. The simulation funds the wallet, so a dry run works before the wallet holds the tokens. Returns `status: preview_only`. Always on for test keys.","examples":[false],"type":"boolean"},"client_id":{"description":"The caller's own reference for this prepare, echoed back and logged.","examples":["desk-7:42"],"type":"string","pattern":"^[A-Za-z0-9._:-]{1,64}$"},"include_onchain":{"default":false,"description":"Also return `onchain`: the payload's calls decoded, with the result of each call in the simulation and the events they emitted. A dry run has no calldata, so `onchain` holds only the events.","examples":[false],"type":"boolean"},"market_id":{"type":"string","pattern":"^0x[0-9a-fA-F]{64}$","description":"The market to borrow in at the variable rate. `GET /v1/markets` lists markets, with each one's variable rate under `variable`.","examples":["0x5b1e2c3d4e5f60718293a4b5c6d7e8f9011a2b3c4d5e6f708192a3b4c5d6e7f8"]},"size":{"$ref":"#/components/schemas/VariableBorrowSize"},"deposit_collateral":{"$ref":"#/components/schemas/VariableBorrowCollateral"}},"required":["chain_id","wallet","wallet_kind","market_id","size"],"additionalProperties":false},"VariableBorrowPreview":{"description":"For a variable borrow, repay or collateral change, the wallet's variable borrow, read in the simulated block before and right after the payload. A `HEALTH_THRESHOLD` warning flags a payload that leaves the borrow above 95% of its borrow capacity, and worse off than before. Left out when the onchain reads failed.","type":"object","properties":{"before":{"$ref":"#/components/schemas/VariablePositionPreview"},"after":{"$ref":"#/components/schemas/VariablePositionPreview"}},"required":["before","after"]},"VariableBorrowSize":{"type":"object","properties":{"principal":{"type":"string","pattern":"^[1-9]\\d*$","description":"The amount the wallet receives now. The debt then grows at the variable rate. Integer string in the loan token's smallest unit.","examples":["500000000"]}},"required":["principal"],"additionalProperties":false,"description":"The amount to borrow."},"VariableLendPrepareRequest":{"type":"object","properties":{"chain_id":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"The EVM chain ID. `GET /v1/chains` lists the chains served.","examples":[8453]},"wallet":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"The wallet that will sign and send the payload. Any address but the zero address is accepted, since a payload does nothing until that wallet signs it.","examples":["0x7A1f00000000000000000000000000000000C0de"]},"wallet_kind":{"type":"string","enum":["eoa","delegated_eoa","safe","smart_account"],"description":"How the wallet signs, which sets the shape of the payload. `eoa` sends each step as its own transaction, `delegated_eoa` (EIP-7702) batches them with `wallet_sendCalls`, `safe` runs them as one MultiSend transaction, and `smart_account` (ERC-4337 and others) as one user operation. Required: Tenor doesn't infer the wallet kind."},"dry_run":{"default":false,"description":"Preview the action with nothing to send. The simulation funds the wallet, so a dry run works before the wallet holds the tokens. Returns `status: preview_only`. Always on for test keys.","examples":[false],"type":"boolean"},"client_id":{"description":"The caller's own reference for this prepare, echoed back and logged.","examples":["desk-7:42"],"type":"string","pattern":"^[A-Za-z0-9._:-]{1,64}$"},"include_onchain":{"default":false,"description":"Also return `onchain`: the payload's calls decoded, with the result of each call in the simulation and the events they emitted. A dry run has no calldata, so `onchain` holds only the events.","examples":[false],"type":"boolean"},"market_id":{"type":"string","pattern":"^0x[0-9a-fA-F]{64}$","description":"The market to lend in at the variable rate. `GET /v1/markets` lists markets, with each one's variable rate under `variable`.","examples":["0x5b1e2c3d4e5f60718293a4b5c6d7e8f9011a2b3c4d5e6f708192a3b4c5d6e7f8"]},"size":{"$ref":"#/components/schemas/VariableLendSize"}},"required":["chain_id","wallet","wallet_kind","market_id","size"],"additionalProperties":false},"VariableLendPreview":{"description":"For a variable lend or withdrawal, the wallet's variable lend before and after, valued the way `/positions` values its `current_value`.","type":"object","properties":{"before":{"type":"string","description":"The value of the wallet's variable lend before the payload, interest included. Integer string in the token's smallest unit.","examples":["250000000"]},"after":{"type":"string","description":"The value of the variable lend once the payload is included in a block. Integer string in the token's smallest unit.","examples":["1249999999"]}},"required":["before","after"]},"VariableLendSize":{"type":"object","properties":{"principal":{"type":"string","pattern":"^[1-9]\\d*$","description":"The amount the wallet lends now. Integer string in the loan token's smallest unit.","examples":["1000000000"]}},"required":["principal"],"additionalProperties":false,"description":"The amount to lend."},"VariableManageDeposit":{"type":"object","properties":{"token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"The collateral token of the market's variable rate (`variable.collateral_token` in `GET /v1/markets`).","examples":["0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf"]},"amount":{"type":"string","pattern":"^[1-9]\\d*$","description":"The amount to deposit. The payload pulls the full amount. Integer string in the token's smallest unit.","examples":["100000000"]}},"required":["token","amount"],"additionalProperties":false,"description":"Collateral to add to the variable borrow. Accepted before any borrow exists."},"VariableManagePrepareRequest":{"type":"object","properties":{"chain_id":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"The EVM chain ID. `GET /v1/chains` lists the chains served.","examples":[8453]},"wallet":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"The wallet that will sign and send the payload. Any address but the zero address is accepted, since a payload does nothing until that wallet signs it.","examples":["0x7A1f00000000000000000000000000000000C0de"]},"wallet_kind":{"type":"string","enum":["eoa","delegated_eoa","safe","smart_account"],"description":"How the wallet signs, which sets the shape of the payload. `eoa` sends each step as its own transaction, `delegated_eoa` (EIP-7702) batches them with `wallet_sendCalls`, `safe` runs them as one MultiSend transaction, and `smart_account` (ERC-4337 and others) as one user operation. Required: Tenor doesn't infer the wallet kind."},"dry_run":{"default":false,"description":"Preview the action with nothing to send. The simulation funds the wallet, so a dry run works before the wallet holds the tokens. Returns `status: preview_only`. Always on for test keys.","examples":[false],"type":"boolean"},"client_id":{"description":"The caller's own reference for this prepare, echoed back and logged.","examples":["desk-7:42"],"type":"string","pattern":"^[A-Za-z0-9._:-]{1,64}$"},"include_onchain":{"default":false,"description":"Also return `onchain`: the payload's calls decoded, with the result of each call in the simulation and the events they emitted. A dry run has no calldata, so `onchain` holds only the events.","examples":[false],"type":"boolean"},"market_id":{"type":"string","pattern":"^0x[0-9a-fA-F]{64}$","description":"The market the wallet borrows in at the variable rate, or is about to borrow in. `GET /v1/markets` lists markets, with each one's variable rate under `variable`.","examples":["0x5b1e2c3d4e5f60718293a4b5c6d7e8f9011a2b3c4d5e6f708192a3b4c5d6e7f8"]},"deposit_collateral":{"$ref":"#/components/schemas/VariableManageDeposit"},"withdraw_collateral":{"$ref":"#/components/schemas/VariableManageWithdrawal"}},"required":["chain_id","wallet","wallet_kind","market_id"],"additionalProperties":false},"VariableManageWithdrawal":{"type":"object","properties":{"token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"The collateral token of the market's variable rate (`variable.collateral_token` in `GET /v1/markets`).","examples":["0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf"]},"amount":{"type":"string","pattern":"^[1-9]\\d*$","description":"The amount to withdraw. Leave `amount` out to withdraw all of this collateral. Integer string in the token's smallest unit.","examples":["25000000"]}},"required":["token"],"additionalProperties":false,"description":"Collateral to withdraw. Rejected when the remaining collateral couldn't carry the debt. The error's `details.max_amount` is the most the wallet can withdraw."},"VariablePositionPreview":{"type":"object","properties":{"debt":{"type":"string","description":"The amount the wallet owes, with interest accrued up to the simulated block. Integer string in the token's smallest unit.","examples":["1004145095"]},"collateral":{"type":"array","items":{"$ref":"#/components/schemas/PositionCollateral"},"description":"Posted collateral. Only tokens with collateral posted are listed."},"health":{"$ref":"#/components/schemas/PositionHealth"}},"required":["debt","collateral","health"],"description":"The wallet's borrow at the variable rate."},"VariableRates":{"type":"object","properties":{"variable_market_id":{"type":"string","description":"The variable market behind this market's variable rate.","examples":["0x9103c3b4e834476c9a62ea009ba2c884ee42e94e6e314a26f04d312434191836"]},"lend_rate":{"type":"string","description":"The rate lending at the variable rate earns now, after the market's fee. Annual rate as a decimal fraction (\"0.052\" = 5.2%).","examples":["0.0412"]},"borrow_rate":{"type":"string","description":"The rate borrowing at the variable rate pays now. Annual rate as a decimal fraction (\"0.052\" = 5.2%).","examples":["0.0538"]}},"required":["variable_market_id","lend_rate","borrow_rate"]},"VariableRepayPrepareRequest":{"type":"object","properties":{"chain_id":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"The EVM chain ID. `GET /v1/chains` lists the chains served.","examples":[8453]},"wallet":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"The wallet that will sign and send the payload. Any address but the zero address is accepted, since a payload does nothing until that wallet signs it.","examples":["0x7A1f00000000000000000000000000000000C0de"]},"wallet_kind":{"type":"string","enum":["eoa","delegated_eoa","safe","smart_account"],"description":"How the wallet signs, which sets the shape of the payload. `eoa` sends each step as its own transaction, `delegated_eoa` (EIP-7702) batches them with `wallet_sendCalls`, `safe` runs them as one MultiSend transaction, and `smart_account` (ERC-4337 and others) as one user operation. Required: Tenor doesn't infer the wallet kind."},"dry_run":{"default":false,"description":"Preview the action with nothing to send. The simulation funds the wallet, so a dry run works before the wallet holds the tokens. Returns `status: preview_only`. Always on for test keys.","examples":[false],"type":"boolean"},"client_id":{"description":"The caller's own reference for this prepare, echoed back and logged.","examples":["desk-7:42"],"type":"string","pattern":"^[A-Za-z0-9._:-]{1,64}$"},"include_onchain":{"default":false,"description":"Also return `onchain`: the payload's calls decoded, with the result of each call in the simulation and the events they emitted. A dry run has no calldata, so `onchain` holds only the events.","examples":[false],"type":"boolean"},"market_id":{"type":"string","pattern":"^0x[0-9a-fA-F]{64}$","description":"The market the wallet borrows in at the variable rate. `GET /v1/markets` lists markets, with each one's variable rate under `variable`.","examples":["0x5b1e2c3d4e5f60718293a4b5c6d7e8f9011a2b3c4d5e6f708192a3b4c5d6e7f8"]},"size":{"$ref":"#/components/schemas/VariableRepaySize"},"withdraw_collateral":{"$ref":"#/components/schemas/VariableRepayWithdrawal"}},"required":["chain_id","wallet","wallet_kind","market_id"],"additionalProperties":false},"VariableRepaySize":{"type":"object","properties":{"principal":{"type":"string","pattern":"^[1-9]\\d*$","description":"The amount the wallet pays, at most the amount owed. Integer string in the loan token's smallest unit.","examples":["400000000"]}},"required":["principal"],"additionalProperties":false,"description":"The amount to repay. Leave `size` out to repay the whole borrow, with interest up to the block the payload is included in. The payload returns the unused part."},"VariableRepayWithdrawal":{"type":"object","properties":{"token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"The collateral token of the market's variable rate (`variable.collateral_token` in `GET /v1/markets`).","examples":["0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf"]},"amount":{"type":"string","pattern":"^[1-9]\\d*$","description":"The amount to withdraw. Leave `amount` out to withdraw all of this collateral. Integer string in the token's smallest unit.","examples":["25000000"]}},"required":["token"],"additionalProperties":false,"description":"Collateral to withdraw in the same payload, after the repay. Rejected when the remaining collateral couldn't carry the rest of the debt. The error's `details.max_amount` is the most the wallet can withdraw."},"VariableWithdrawPrepareRequest":{"type":"object","properties":{"chain_id":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"The EVM chain ID. `GET /v1/chains` lists the chains served.","examples":[8453]},"wallet":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"The wallet that will sign and send the payload. Any address but the zero address is accepted, since a payload does nothing until that wallet signs it.","examples":["0x7A1f00000000000000000000000000000000C0de"]},"wallet_kind":{"type":"string","enum":["eoa","delegated_eoa","safe","smart_account"],"description":"How the wallet signs, which sets the shape of the payload. `eoa` sends each step as its own transaction, `delegated_eoa` (EIP-7702) batches them with `wallet_sendCalls`, `safe` runs them as one MultiSend transaction, and `smart_account` (ERC-4337 and others) as one user operation. Required: Tenor doesn't infer the wallet kind."},"dry_run":{"default":false,"description":"Preview the action with nothing to send. The simulation funds the wallet, so a dry run works before the wallet holds the tokens. Returns `status: preview_only`. Always on for test keys.","examples":[false],"type":"boolean"},"client_id":{"description":"The caller's own reference for this prepare, echoed back and logged.","examples":["desk-7:42"],"type":"string","pattern":"^[A-Za-z0-9._:-]{1,64}$"},"include_onchain":{"default":false,"description":"Also return `onchain`: the payload's calls decoded, with the result of each call in the simulation and the events they emitted. A dry run has no calldata, so `onchain` holds only the events.","examples":[false],"type":"boolean"},"market_id":{"type":"string","pattern":"^0x[0-9a-fA-F]{64}$","description":"The market the wallet lends in at the variable rate. `GET /v1/markets` lists markets, with each one's variable rate under `variable`.","examples":["0x5b1e2c3d4e5f60718293a4b5c6d7e8f9011a2b3c4d5e6f708192a3b4c5d6e7f8"]},"size":{"$ref":"#/components/schemas/VariableWithdrawSize"},"cancel_idle_offers":{"default":false,"description":"Also cancel every group of the wallet's idle-capital offers funded by this variable lend, in the same payload and before the withdrawal. Without this flag, a withdrawal that leaves less than those offers can still fill gets an `IDLE_CAPITAL_SHORTFALL` warning. The offers then fill only up to the remaining amount.","examples":[false],"type":"boolean"}},"required":["chain_id","wallet","wallet_kind","market_id"],"additionalProperties":false},"VariableWithdrawSize":{"type":"object","properties":{"principal":{"type":"string","pattern":"^[1-9]\\d*$","description":"The amount the wallet receives. Integer string in the loan token's smallest unit.","examples":["400000000"]}},"required":["principal"],"additionalProperties":false,"description":"The amount to withdraw. Leave `size` out to withdraw the whole variable lend, interest included."},"Warning":{"type":"object","properties":{"code":{"type":"string","description":"A stable code. `/v1/llms.txt` lists every code with its meaning. New codes are added over time, so show the `message` of an unknown code.","examples":["SHORT_VALIDITY"]},"message":{"type":"string","examples":["The payload is valid for 7 s; sign and send it right away, or prepare again."]},"details":{"examples":[{"limited_by":"offer_window"}],"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message"]}},"headers":{"RequestId":{"description":"The request's ID: the `X-Request-Id` sent with the request, if it was valid, or one Tenor generated.","schema":{"type":"string"},"example":"req_01K7A9V6R4Q8Z2Y3X5W1T0S9PN"},"X-RateLimit-Policy":{"description":"The budget this request counted against, and its window in seconds.","schema":{"type":"string"},"example":"compute;w=60"},"X-RateLimit-Limit":{"description":"Requests allowed per window.","schema":{"type":"integer"},"example":120},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"},"example":117},"X-RateLimit-Reset":{"description":"When the current window resets, in Unix seconds.","schema":{"type":"integer"},"example":1791561660},"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"},"example":17}},"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"X-Api-Key","description":"The organization's API key. Only `GET /v1/access` needs one: elsewhere a key raises the rate limits from per IP address to per key. Keys starting with `tnr_sk_test_` are test keys, and every prepare made with a test key is a dry run."}}}}