Skip to main content
A price gives the fees, amount out, and native messaging fee that a quote for the same order would carry right now. A price has no transaction to sign, so you display it and your user acts on a quote.

Price or Quote

A price is the way to show live fees. Each quote counts against the open quote limits until its order is submitted or its deadline passes. Prices skip those limits, so polling prices never counts against them. Before you decide when your app requests quotes, read Quote Limits.

Prerequisites

Step 1: Get an Order Price

GET /v1/transit/orders/price Send the parameters you will send with the quote, without permitSignature, permitDeadline, and responseFormat. Get Order Quote describes each parameter.
  • userAddress is optional and does not change the price, so you can show fees before your user connects a wallet.
  • Send the same integratorFee, integratorFeeReceiver, and distributorCode that the quote will carry. They change the fees.
With @paxoslabs/amplify-sdk, call client.transit.getOrderPrice with the same parameters.
You have a price when the response carries nativeFee and pricedAt.

Step 2: Show the Fees

Show amountOut, totalFees, and nativeFee on the same screen. totalFees is in the offer asset and nativeFee is in the source chain’s native token, and the order costs both amounts. Response Fields describes each field. Your user can now see all three values before they ask to place the order.

Step 3: Keep the Price Current

A price is correct as of its pricedAt. Fees move with live liquidity and gas.
  • Request a new price each time your user changes the amount, the route, or any other parameter.
  • While the fee is on screen, refresh it on a timer set to the longest interval your users accept for a stale fee, and no shorter than 10 seconds. Stop the timer when the fee leaves the screen.
The fee on screen now always comes from a price requested after your user’s last change.

Step 4: Request a Quote

When your user is ready to place the order, request a quote and follow Order Submission. The quote’s fees can differ from the last price, so show the quote’s fees for your user to confirm. Your user confirms the order against the quote’s fees.

Response Fields

A price has the same fields as a quote, without transaction and with two more. Understand the Response describes the shared fields.

Rate Limits

A price counts against the same rate limit as every other request, quotes included. Without an API key, each IP address has a lower limit, so send an API key when you poll prices in production. Every response carries three headers that show where you stand against the limit. Read them to slow your polling before a price is refused. A refused price returns 429 with error.status RESOURCE_EXHAUSTED. Retry after the number of seconds in the Retry-After header.

Common Errors

A price is refused for the same reasons and with the same errors as a quote for the same order, apart from the open quote limits, which apply to quotes only. See Common Errors in Order Submission. A price refused with 400, 403 or 404 means your user cannot place that order right now, so show the error in place of a fee. A 429 or 503 refuses only the price request: show fees as temporarily unavailable and retry after Retry-After (for 429) or with backoff (for 503), because the order itself may still be placeable.

Next Steps

Order Submission

Get quote calldata and submit the order when your user is ready.