quotes: the quotes that came back, best first, each one held for you under itsid;sources: every venue that was considered, with its outcome, so a missing quote always has a reason.
The request
POST /api/v1/quotes
The response
legs, fees, netReceived, eta and more.
Each quote tells you:
- where it executes, in
location.kind:singleChain,crossChainoroffChain, ormixedfor a route whose legs differ.mixeddescribes a quote only: you cannot filter on it, andfilters.locations: ["mixed"]is refused with400 INVALID_REQUEST; - whether the venue is bound to its price, in
firmwithexpiresAt(below), andlastLook, alwaysfalse: an accepted price is never re-checked before it fills; - what you do next, in
next.kind:order,fundorrequote(preflight,signandtransactappear only on Advanced quotes, which are not open yet).
venueAsked is false when every quote came from cached prices and no venue was contacted.
Executable and indicative quotes
|firm and expiresAt | What it means | minOut | staleAfter |
| --- | --- | --- | --- | --- |
| firm: true, expiresAt set | Executable: the venue delivers exactly this amount until expiry. | null | null |
| firm: false, expiresAt set | Executable: delivery may move, but never below minOut. | set | null |
| firm: false, expiresAt null | Indicative: the venue’s price, not a commitment. | null | set |
expiresAt is when an executable quote stops being orderable. Order before then, or requote it: see Requotes and expiry. An indicative quote has no expiry; staleAfter says when its price is old.
An indicative quote has no minOut, because it commits to nothing. You can still order one when its next is order: you send minReceive, the least you accept, the venue is asked for its price when you order, and the trade happens only if it delivers at least that (Orders). When its next is requote, ask the venue again first.
Sources: why a venue did or did not quote
Every venue considered appears once insources, whether or not it was asked (asked). detail is a sentence you can show to a person; reason, where present, is a token your code can match.
More statuses exist and new ones can appear. Treat any status you do not recognise as “other” and show its
detail.
What an API key sees depends on what it may do. Quotes from your connected venue accounts need a key with venue trading enabled that signs its requests; any other key gets those venues as
restricted with reason venueTradeScopeRequired. On-chain venues that TetraFi trades for you from an organisation wallet need that wallet granted to the key; otherwise they read unavailable with the reason apiKeyOrganisationWalletScopeRequired or onchainWalletNotUsable. See Authentication.JSON or a stream
By default you get one JSON reply when collection ends (3 seconds at most). SendAccept: text/event-stream to get server-sent events as venues answer:
Event ids increase, and the stream sends keepalive comments between events.
Rate limit
You may send one live quote request every 3 seconds. A faster one is refused with429 QUOTE_RATE_LIMITED, a Retry-After header in seconds, and the same wait in details.retryAfter (for example PT1S). Wait that long and send it again. A request answered entirely from cached prices is not counted.
For prices without that limit, read GET /api/v1/prices first.
Use values from discovery
Never hardcode Asset ids, chains or venue lists.GET /api/v1/assets returns what your workspace can trade:
assetId in sell.asset and buy.asset, and a deployment’s chain when you pin a side. offChainVenues lists the venue accounts that hold that variant. When eligibility.complete is false, reason says which part of the list could not be read. An API key needs the prices_read scope to read it, which the Read quotes permission grants (Permissions).
Refusals
A refused request answers one error body,{"error", "message", "requestId", "timestamp", "next"?, "details"?}, the same at every status. error is the code to match on; requestId equals the X-Request-Id header; details.value, where present, is the value that was refused. Errors and refusals lists every code.
Chain refusals are on Chains and routes.