Prices and firm quotes
They’re two endpoints:POST /v1/price for a price, and POST /v1/quotes for a firm quote. Both take the same flat body: fromChain, fromAsset, fromAmount, toChain, and toAsset, with more fields for a firm quote.
A firm quote is the one object every quote endpoint and webhook returns:
GET /v1/quotes/{id}, the search, revealing, submitting, and quote.updated. The dollar values, price impact, and gas estimate stay on the price you showed the user.
A firm cross-chain quote asks solvers to compete and commit to a price, so request one only when the user confirms. Send an Idempotency-Key with it, so a retried request gets the same quote back instead of a new one.
Amounts
from.amount: exactly what the user sends.to.amount: what the user should receive.to.minAmount: the least the user will receive. A price has it when it differs fromto.amount; a firm quote always has it.
"1000000" is 1 USDC.
Same-chain swaps always have a minimum below the expected amount: below it, the swap reverts. Cross-chain swaps have one below to.amount when the solver has to buy the destination token as it fills, because that price can move. The solver commits to the minimum and passes on everything its purchase yields, so the user usually gets about to.amount. When nothing has to be bought, such as USDC for USDC, the two are the same.
slippageBps sets the gap between the expected amount and the minimum, in basis points (1 bps = 0.01%). It’s 50 (0.5%) by default and at most 300 (3%). Show the user both amounts, with the minimum labeled “Minimum received”.
Deadlines
Every quote has anexpiresAt, a Unix time. What it means depends on the quote:
Always read
expiresAt from the quote rather than assuming these values. After it passes, get a new quote.
Statuses
GET /v1/quotes/{id} tells you where a swap stands. A cross-chain swap moves like this:
Same-chain and private swaps are a single transaction, so they go straight from awaiting_deposit to completed once it confirms, or to expired if it’s never sent.
Stop checking once a status is final. Track a swap shows how to follow statuses in your app, and webhooks can push them to you instead.
Fees and pricing
What a swap costs, line by line.
Refunds
When and how users get their deposit back.