Quote a trade
const url = 'https://api.hyperstream.dev/v3/quote';const options = { method: 'POST', headers: { 'API-Revision': '0', 'X-API-Key': '<X-API-Key>', 'Content-Type': 'application/json' }, body: '{"send":{"asset":"eip155:42161/erc20:0xaf88d065e77c8cC2239327C5EDb3A432268e5831","amount":"100000000"},"receive":{"asset":"eip155:8453/erc20:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.hyperstream.dev/v3/quote \ --header 'API-Revision: 0' \ --header 'Content-Type: application/json' \ --header 'X-API-Key: <X-API-Key>' \ --data '{ "send": { "asset": "eip155:42161/erc20:0xaf88d065e77c8cC2239327C5EDb3A432268e5831", "amount": "100000000" }, "receive": { "asset": "eip155:8453/erc20:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913" } }'Prices sending send.amount of one asset for another and returns the options to create an order from. Nothing is stored.
Pass an option’s id to POST /orders unchanged before expiresAt. An option makes one order. Skip an option whose
requires names a capability you lack. A size out of range is a 422 carrying the range that would quote.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”The revision of v3 the request is built against. Without it, the revision that was current when your integration was set up. An unknown value is a 400 VALIDATION_FAILED naming API-Revision.
Request Bodyrequired
Section titled “Request Bodyrequired”object
object
CAIP-19 id of the asset the user sends.
What the user sends, in base units, fees included.
object
CAIP-19 id of the asset the user receives.
Example
{ "send": { "asset": "eip155:42161/erc20:0xaf88d065e77c8cC2239327C5EDb3A432268e5831", "amount": "100000000" }, "receive": { "asset": "eip155:8453/erc20:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913" }}Responses
Section titled “Responses”The options.
Ways to make the trade. Each option is priced now; nothing is stored.
object
When the options stop being accepted by POST /orders.
object
A signed, expiring token. Pass it to POST /orders unchanged.
Capabilities the client needs to fund the order, e.g. format:evm_call, or stellar:muxed_destination to pay a Stellar M… address as given, with no memo. solana:associated_token_account requires deriving the returned owner’s ATA for the asset’s mint under the standard SPL Token program, creating it idempotently if absent (sender pays rent), and sending one exact payment without memo, split or top-up. Skip an option with one you lack.
object
object
object
CAIP-19 asset id.
CAIP-2 chain id.
Base units.
object
CAIP-19 asset id.
CAIP-2 chain id.
The least a full fill pays per token sent, in whole tokens, fees included.
From creation to fundBy: the time to send the deposit by, after which the funding steps close.
From creation to fillBy, the deadline the order is signed with.
object
object
object
CAIP-19 asset id.
CAIP-2 chain id.
Base units.
At the current price: the amount to show.
object
object
CAIP-19 asset id.
CAIP-2 chain id.
Base units.
Guaranteed on a full fill: the slippage floor.
object
object
CAIP-19 asset id.
CAIP-2 chain id.
Base units.
The flat fee plus the operator fee, rounded up.
object
object
CAIP-19 asset id.
CAIP-2 chain id.
Base units.
The source’s depositFee plus the destination’s withdrawFee, in the source asset and rounded up. Kept whatever fills: an order that doesn’t fill refunds send less this. Show the user that refund before they pay.
object
object
CAIP-19 asset id.
CAIP-2 chain id.
Base units.
object
object
Whether an order from this option can be cancelled once it publishes.
Example
{ "expiresAt": "2026-08-17T20:53:20Z", "options": [ { "id": "opt_eyJ2IjoxLC4uLn0", "requires": [ "format:evm_call" ], "roles": [ { "role": "payer", "chain": "eip155:42161", "required": true, "defaultFrom": null, "constraint": "sender_bound" }, { "role": "recipient", "chain": "eip155:8453", "required": true, "defaultFrom": null, "constraint": null }, { "role": "refundTo", "chain": "eip155:42161", "required": false, "defaultFrom": "payer", "constraint": null } ], "terms": { "send": { "asset": { "id": "eip155:42161/erc20:0xaf88d065e77c8cC2239327C5EDb3A432268e5831", "chain": "eip155:42161", "symbol": "USDC", "decimals": 6 }, "amount": "100000000" }, "receiveAsset": { "id": "eip155:8453/erc20:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", "chain": "eip155:8453", "symbol": "USDC", "decimals": 6 }, "minRate": "0.99620254", "slippageBps": 0, "fundWithinSeconds": 2400, "fillWithinSeconds": 3600 }, "display": { "send": { "asset": { "id": "eip155:42161/erc20:0xaf88d065e77c8cC2239327C5EDb3A432268e5831", "chain": "eip155:42161", "symbol": "USDC", "decimals": 6 }, "amount": "100000000" }, "receive": { "asset": { "id": "eip155:8453/erc20:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", "chain": "eip155:8453", "symbol": "USDC", "decimals": 6 }, "amount": "99620254" }, "receiveMin": { "asset": { "id": "eip155:8453/erc20:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", "chain": "eip155:8453", "symbol": "USDC", "decimals": 6 }, "amount": "99620254" }, "protocolFee": { "asset": { "id": "eip155:42161/erc20:0xaf88d065e77c8cC2239327C5EDb3A432268e5831", "chain": "eip155:42161", "symbol": "USDC", "decimals": 6 }, "amount": "329910" }, "flatFee": { "asset": { "id": "eip155:42161/erc20:0xaf88d065e77c8cC2239327C5EDb3A432268e5831", "chain": "eip155:42161", "symbol": "USDC", "decimals": 6 }, "amount": "300000" }, "relayFee": { "asset": { "id": "eip155:42161/slip44:60", "chain": "eip155:42161", "symbol": "ETH", "decimals": 18 }, "amount": "100000000000000" } }, "actions": { "cancel": { "available": true, "reason": null, "signer": "refundTo", "format": "eip191_cancel_proof" } } } ]}VALIDATION_FAILED, UNSUPPORTED_ASSET (not in the catalog) or UNSUPPORTED_PAIR (the same asset twice, a deadline that leaves no time to fund, or a pair that can’t be quoted).
Every v3 error, whatever the route.
object
Open list: handle a code you don’t know by its recovery.
VALIDATION_FAILED’s details when the request fails its schema: every field it got wrong.
object
object
The field at fault, as a dotted path.
Open list.
AMOUNT_TOO_SMALL’s and AMOUNT_TOO_LARGE’s details: the send.amount range that would quote.
object
ACTION_UNAVAILABLE’s details: why the action can’t run.
object
Open list: actions.cancel.reason.code, or ORDER_OVERTAKEN.
object
The request field at fault, as a dotted path.
What to do next, whatever the code: fix_request (change the request), requote (get a new quote), retry (send the same request again), read_order (read the order to see where it stands), restart_sync (sync again with no cursor) or contact_support (with requestId).
Example
{ "code": "UNSUPPORTED_ASSET", "message": "eip155:1/erc20:0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 is not in the catalog", "details": null, "field": "send.asset", "recovery": "fix_request", "retryAfterSeconds": null, "requestId": "6f1d2c3b-4a5e-4f60-8718-293a4b5c6d7e"}UNAUTHENTICATED: the X-API-Key header is missing.
Every v3 error, whatever the route.
object
Open list: handle a code you don’t know by its recovery.
VALIDATION_FAILED’s details when the request fails its schema: every field it got wrong.
object
object
The field at fault, as a dotted path.
Open list.
AMOUNT_TOO_SMALL’s and AMOUNT_TOO_LARGE’s details: the send.amount range that would quote.
object
ACTION_UNAVAILABLE’s details: why the action can’t run.
object
Open list: actions.cancel.reason.code, or ORDER_OVERTAKEN.
object
The request field at fault, as a dotted path.
What to do next, whatever the code: fix_request (change the request), requote (get a new quote), retry (send the same request again), read_order (read the order to see where it stands), restart_sync (sync again with no cursor) or contact_support (with requestId).
Example
{ "code": "UNAUTHENTICATED", "message": "X-API-Key required", "details": null, "field": null, "recovery": "fix_request", "retryAfterSeconds": null, "requestId": "6f1d2c3b-4a5e-4f60-8718-293a4b5c6d7e"}FORBIDDEN: the key is unknown or inactive, or your terms can’t be used. It is about your account: don’t retry.
Every v3 error, whatever the route.
object
Open list: handle a code you don’t know by its recovery.
VALIDATION_FAILED’s details when the request fails its schema: every field it got wrong.
object
object
The field at fault, as a dotted path.
Open list.
AMOUNT_TOO_SMALL’s and AMOUNT_TOO_LARGE’s details: the send.amount range that would quote.
object
ACTION_UNAVAILABLE’s details: why the action can’t run.
object
Open list: actions.cancel.reason.code, or ORDER_OVERTAKEN.
object
The request field at fault, as a dotted path.
What to do next, whatever the code: fix_request (change the request), requote (get a new quote), retry (send the same request again), read_order (read the order to see where it stands), restart_sync (sync again with no cursor) or contact_support (with requestId).
Example
{ "code": "FORBIDDEN", "message": "Unknown or inactive integrator", "details": null, "field": null, "recovery": "contact_support", "retryAfterSeconds": null, "requestId": "6f1d2c3b-4a5e-4f60-8718-293a4b5c6d7e"}AMOUNT_TOO_SMALL or AMOUNT_TOO_LARGE, with the range that would quote in details. At or below the flat fee, minAmount only clears the fee and maxAmount is null: quote again at minAmount for the full range.
Every v3 error, whatever the route.
object
Open list: handle a code you don’t know by its recovery.
VALIDATION_FAILED’s details when the request fails its schema: every field it got wrong.
object
object
The field at fault, as a dotted path.
Open list.
AMOUNT_TOO_SMALL’s and AMOUNT_TOO_LARGE’s details: the send.amount range that would quote.
object
ACTION_UNAVAILABLE’s details: why the action can’t run.
object
Open list: actions.cancel.reason.code, or ORDER_OVERTAKEN.
object
The request field at fault, as a dotted path.
What to do next, whatever the code: fix_request (change the request), requote (get a new quote), retry (send the same request again), read_order (read the order to see where it stands), restart_sync (sync again with no cursor) or contact_support (with requestId).
Example
{ "code": "AMOUNT_TOO_SMALL", "message": "Requested amount is below what the solver will fill", "details": { "minAmount": { "asset": { "id": "eip155:42161/erc20:0xaf88d065e77c8cC2239327C5EDb3A432268e5831", "chain": "eip155:42161", "symbol": "USDC", "decimals": 6 }, "amount": "5000000" }, "maxAmount": { "asset": { "id": "eip155:42161/erc20:0xaf88d065e77c8cC2239327C5EDb3A432268e5831", "chain": "eip155:42161", "symbol": "USDC", "decimals": 6 }, "amount": "250000000000" } }, "field": "send.amount", "recovery": "fix_request", "retryAfterSeconds": null, "requestId": "6f1d2c3b-4a5e-4f60-8718-293a4b5c6d7e"}RATE_LIMITED: too many requests from your IP, or, on quote and create-order, from your integrator. Retry after retryAfterSeconds.
Every v3 error, whatever the route.
object
Open list: handle a code you don’t know by its recovery.
VALIDATION_FAILED’s details when the request fails its schema: every field it got wrong.
object
object
The field at fault, as a dotted path.
Open list.
AMOUNT_TOO_SMALL’s and AMOUNT_TOO_LARGE’s details: the send.amount range that would quote.
object
ACTION_UNAVAILABLE’s details: why the action can’t run.
object
Open list: actions.cancel.reason.code, or ORDER_OVERTAKEN.
object
The request field at fault, as a dotted path.
What to do next, whatever the code: fix_request (change the request), requote (get a new quote), retry (send the same request again), read_order (read the order to see where it stands), restart_sync (sync again with no cursor) or contact_support (with requestId).
Example
{ "code": "RATE_LIMITED", "message": "Too many requests, retry later", "details": null, "field": null, "recovery": "retry", "retryAfterSeconds": 60, "requestId": "6f1d2c3b-4a5e-4f60-8718-293a4b5c6d7e"}Headers
Section titled “Headers”Seconds to wait.
INTERNAL: an unexpected failure that sending the request again won’t fix. Contact Khalani with requestId.
Every v3 error, whatever the route.
object
Open list: handle a code you don’t know by its recovery.
VALIDATION_FAILED’s details when the request fails its schema: every field it got wrong.
object
object
The field at fault, as a dotted path.
Open list.
AMOUNT_TOO_SMALL’s and AMOUNT_TOO_LARGE’s details: the send.amount range that would quote.
object
ACTION_UNAVAILABLE’s details: why the action can’t run.
object
Open list: actions.cancel.reason.code, or ORDER_OVERTAKEN.
object
The request field at fault, as a dotted path.
What to do next, whatever the code: fix_request (change the request), requote (get a new quote), retry (send the same request again), read_order (read the order to see where it stands), restart_sync (sync again with no cursor) or contact_support (with requestId).
Example
{ "code": "INTERNAL", "message": "Internal error", "details": null, "field": null, "recovery": "contact_support", "retryAfterSeconds": null, "requestId": "6f1d2c3b-4a5e-4f60-8718-293a4b5c6d7e"}MAINTENANCE: order creation is paused. UPSTREAM_UNAVAILABLE, PRICE_UNAVAILABLE, NO_CAPACITY: a dependency, our storage or the market can’t serve the request now. Retry later.
Every v3 error, whatever the route.
object
Open list: handle a code you don’t know by its recovery.
VALIDATION_FAILED’s details when the request fails its schema: every field it got wrong.
object
object
The field at fault, as a dotted path.
Open list.
AMOUNT_TOO_SMALL’s and AMOUNT_TOO_LARGE’s details: the send.amount range that would quote.
object
ACTION_UNAVAILABLE’s details: why the action can’t run.
object
Open list: actions.cancel.reason.code, or ORDER_OVERTAKEN.
object
The request field at fault, as a dotted path.
What to do next, whatever the code: fix_request (change the request), requote (get a new quote), retry (send the same request again), read_order (read the order to see where it stands), restart_sync (sync again with no cursor) or contact_support (with requestId).
Example
{ "code": "MAINTENANCE", "message": "Order creation is paused for maintenance", "details": null, "field": null, "recovery": "retry", "retryAfterSeconds": 300, "requestId": "6f1d2c3b-4a5e-4f60-8718-293a4b5c6d7e"}Headers
Section titled “Headers”Seconds to wait.