Skip to content
API reference

Quote a trade

POST
/v3/quote
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.

API-Revision
string
Allowed values: 0

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.

Media typeapplication/json
object
send
required
object
asset
required

CAIP-19 id of the asset the user sends.

string
>= 1 characters <= 256 characters
amount
required

What the user sends, in base units, fees included.

string
/^[1-9]\d*$/
receive
required
object
asset
required

CAIP-19 id of the asset the user receives.

string
>= 1 characters <= 256 characters

Example

{
"send": {
"asset": "eip155:42161/erc20:0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
"amount": "100000000"
},
"receive": {
"asset": "eip155:8453/erc20:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
}
}

The options.

Media typeapplication/json

Ways to make the trade. Each option is priced now; nothing is stored.

object
expiresAt
required

When the options stop being accepted by POST /orders.

string
options
required
Array<object>
object
id
required

A signed, expiring token. Pass it to POST /orders unchanged.

string
requires
required

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.

Array<string>
roles
required
Array<object>
object
role
required
Any of:
string
Allowed values: payer recipient refundTo
chain
required

CAIP-2 chain id.

string
/^[-a-z0-9]{3,8}:[-_a-zA-Z0-9]{1,32}$/
required
required
boolean
defaultFrom
required
Any of:
Any of:
string
Allowed values: payer
constraint
required
Any of:
Any of:
string
Allowed values: sender_bound
terms
required
object
send
required
object
asset
required
object
id
required

CAIP-19 asset id.

string
/^[-a-z0-9]{3,8}:[-_a-zA-Z0-9]{1,32}\/[-a-z0-9]{3,8}:[-.%a-zA-Z0-9]{1,128}$/
chain
required

CAIP-2 chain id.

string
/^[-a-z0-9]{3,8}:[-_a-zA-Z0-9]{1,32}$/
symbol
required
string
decimals
required
integer
amount
required

Base units.

string
/^\d+$/
receiveAsset
required
object
id
required

CAIP-19 asset id.

string
/^[-a-z0-9]{3,8}:[-_a-zA-Z0-9]{1,32}\/[-a-z0-9]{3,8}:[-.%a-zA-Z0-9]{1,128}$/
chain
required

CAIP-2 chain id.

string
/^[-a-z0-9]{3,8}:[-_a-zA-Z0-9]{1,32}$/
symbol
required
string
decimals
required
integer
minRate
required

The least a full fill pays per token sent, in whole tokens, fees included.

string
/^\d+(\.\d+)?$/
slippageBps
required
integer
fundWithinSeconds
required

From creation to fundBy: the time to send the deposit by, after which the funding steps close.

integer
> 0
fillWithinSeconds
required

From creation to fillBy, the deadline the order is signed with.

integer
> 0
display
required
object
send
required
object
asset
required
object
id
required

CAIP-19 asset id.

string
/^[-a-z0-9]{3,8}:[-_a-zA-Z0-9]{1,32}\/[-a-z0-9]{3,8}:[-.%a-zA-Z0-9]{1,128}$/
chain
required

CAIP-2 chain id.

string
/^[-a-z0-9]{3,8}:[-_a-zA-Z0-9]{1,32}$/
symbol
required
string
decimals
required
integer
amount
required

Base units.

string
/^\d+$/
receive
required

At the current price: the amount to show.

object
asset
required
object
id
required

CAIP-19 asset id.

string
/^[-a-z0-9]{3,8}:[-_a-zA-Z0-9]{1,32}\/[-a-z0-9]{3,8}:[-.%a-zA-Z0-9]{1,128}$/
chain
required

CAIP-2 chain id.

string
/^[-a-z0-9]{3,8}:[-_a-zA-Z0-9]{1,32}$/
symbol
required
string
decimals
required
integer
amount
required

Base units.

string
/^\d+$/
receiveMin
required

Guaranteed on a full fill: the slippage floor.

object
asset
required
object
id
required

CAIP-19 asset id.

string
/^[-a-z0-9]{3,8}:[-_a-zA-Z0-9]{1,32}\/[-a-z0-9]{3,8}:[-.%a-zA-Z0-9]{1,128}$/
chain
required

CAIP-2 chain id.

string
/^[-a-z0-9]{3,8}:[-_a-zA-Z0-9]{1,32}$/
symbol
required
string
decimals
required
integer
amount
required

Base units.

string
/^\d+$/
protocolFee
required

The flat fee plus the operator fee, rounded up.

object
asset
required
object
id
required

CAIP-19 asset id.

string
/^[-a-z0-9]{3,8}:[-_a-zA-Z0-9]{1,32}\/[-a-z0-9]{3,8}:[-.%a-zA-Z0-9]{1,128}$/
chain
required

CAIP-2 chain id.

string
/^[-a-z0-9]{3,8}:[-_a-zA-Z0-9]{1,32}$/
symbol
required
string
decimals
required
integer
amount
required

Base units.

string
/^\d+$/
flatFee
required

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
asset
required
object
id
required

CAIP-19 asset id.

string
/^[-a-z0-9]{3,8}:[-_a-zA-Z0-9]{1,32}\/[-a-z0-9]{3,8}:[-.%a-zA-Z0-9]{1,128}$/
chain
required

CAIP-2 chain id.

string
/^[-a-z0-9]{3,8}:[-_a-zA-Z0-9]{1,32}$/
symbol
required
string
decimals
required
integer
amount
required

Base units.

string
/^\d+$/
relayFee
required
Any of:
object
asset
required
object
id
required

CAIP-19 asset id.

string
/^[-a-z0-9]{3,8}:[-_a-zA-Z0-9]{1,32}\/[-a-z0-9]{3,8}:[-.%a-zA-Z0-9]{1,128}$/
chain
required

CAIP-2 chain id.

string
/^[-a-z0-9]{3,8}:[-_a-zA-Z0-9]{1,32}$/
symbol
required
string
decimals
required
integer
amount
required

Base units.

string
/^\d+$/
actions
required
object
cancel
required
object
available
required

Whether an order from this option can be cancelled once it publishes.

boolean
reason
required
Any of:
object
code
required

Open list.

string
message
required
string
details
required
Any of:
object
key
additional properties
signer
required
Any of:
string
Allowed values: payer recipient refundTo
format
required
Any of:
Any of:
string
Allowed values: eip191_cancel_proof tip191_cancel_proof sep53_cancel_proof

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).

Media typeapplication/json

Every v3 error, whatever the route.

object
code
required

Open list: handle a code you don’t know by its recovery.

string
message
required
string
details
required
Any of:
Any of:

VALIDATION_FAILED’s details when the request fails its schema: every field it got wrong.

object
issues
required
Array<object>
object
field
required

The field at fault, as a dotted path.

string
message
required
string
code
required

Open list.

string
field
required

The request field at fault, as a dotted path.

string | null
recovery
required

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).

string
Allowed values: fix_request requote retry read_order restart_sync contact_support
retryAfterSeconds
required
Any of:
integer
requestId
required
string

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.

Media typeapplication/json

Every v3 error, whatever the route.

object
code
required

Open list: handle a code you don’t know by its recovery.

string
message
required
string
details
required
Any of:
Any of:

VALIDATION_FAILED’s details when the request fails its schema: every field it got wrong.

object
issues
required
Array<object>
object
field
required

The field at fault, as a dotted path.

string
message
required
string
code
required

Open list.

string
field
required

The request field at fault, as a dotted path.

string | null
recovery
required

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).

string
Allowed values: fix_request requote retry read_order restart_sync contact_support
retryAfterSeconds
required
Any of:
integer
requestId
required
string

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.

Media typeapplication/json

Every v3 error, whatever the route.

object
code
required

Open list: handle a code you don’t know by its recovery.

string
message
required
string
details
required
Any of:
Any of:

VALIDATION_FAILED’s details when the request fails its schema: every field it got wrong.

object
issues
required
Array<object>
object
field
required

The field at fault, as a dotted path.

string
message
required
string
code
required

Open list.

string
field
required

The request field at fault, as a dotted path.

string | null
recovery
required

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).

string
Allowed values: fix_request requote retry read_order restart_sync contact_support
retryAfterSeconds
required
Any of:
integer
requestId
required
string

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.

Media typeapplication/json

Every v3 error, whatever the route.

object
code
required

Open list: handle a code you don’t know by its recovery.

string
message
required
string
details
required
Any of:
Any of:

VALIDATION_FAILED’s details when the request fails its schema: every field it got wrong.

object
issues
required
Array<object>
object
field
required

The field at fault, as a dotted path.

string
message
required
string
code
required

Open list.

string
field
required

The request field at fault, as a dotted path.

string | null
recovery
required

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).

string
Allowed values: fix_request requote retry read_order restart_sync contact_support
retryAfterSeconds
required
Any of:
integer
requestId
required
string

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.

Media typeapplication/json

Every v3 error, whatever the route.

object
code
required

Open list: handle a code you don’t know by its recovery.

string
message
required
string
details
required
Any of:
Any of:

VALIDATION_FAILED’s details when the request fails its schema: every field it got wrong.

object
issues
required
Array<object>
object
field
required

The field at fault, as a dotted path.

string
message
required
string
code
required

Open list.

string
field
required

The request field at fault, as a dotted path.

string | null
recovery
required

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).

string
Allowed values: fix_request requote retry read_order restart_sync contact_support
retryAfterSeconds
required
Any of:
integer
requestId
required
string

Example

{
"code": "RATE_LIMITED",
"message": "Too many requests, retry later",
"details": null,
"field": null,
"recovery": "retry",
"retryAfterSeconds": 60,
"requestId": "6f1d2c3b-4a5e-4f60-8718-293a4b5c6d7e"
}
Retry-After
integer

Seconds to wait.

INTERNAL: an unexpected failure that sending the request again won’t fix. Contact Khalani with requestId.

Media typeapplication/json

Every v3 error, whatever the route.

object
code
required

Open list: handle a code you don’t know by its recovery.

string
message
required
string
details
required
Any of:
Any of:

VALIDATION_FAILED’s details when the request fails its schema: every field it got wrong.

object
issues
required
Array<object>
object
field
required

The field at fault, as a dotted path.

string
message
required
string
code
required

Open list.

string
field
required

The request field at fault, as a dotted path.

string | null
recovery
required

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).

string
Allowed values: fix_request requote retry read_order restart_sync contact_support
retryAfterSeconds
required
Any of:
integer
requestId
required
string

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.

Media typeapplication/json

Every v3 error, whatever the route.

object
code
required

Open list: handle a code you don’t know by its recovery.

string
message
required
string
details
required
Any of:
Any of:

VALIDATION_FAILED’s details when the request fails its schema: every field it got wrong.

object
issues
required
Array<object>
object
field
required

The field at fault, as a dotted path.

string
message
required
string
code
required

Open list.

string
field
required

The request field at fault, as a dotted path.

string | null
recovery
required

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).

string
Allowed values: fix_request requote retry read_order restart_sync contact_support
retryAfterSeconds
required
Any of:
integer
requestId
required
string

Example

{
"code": "MAINTENANCE",
"message": "Order creation is paused for maintenance",
"details": null,
"field": null,
"recovery": "retry",
"retryAfterSeconds": 300,
"requestId": "6f1d2c3b-4a5e-4f60-8718-293a4b5c6d7e"
}
Retry-After
integer

Seconds to wait.