Requesting a Quote
POST https://api.orda.network/v1/quote
This guide explains how to request a quote using the orda API. A quote request lets you execute a crypto-to-crypto transaction across any of our supported tokens and chains.
PrerequisitesCopied!
Before you start, make sure you have:
-
A project client id a project secret and your HMAC signature.
-
The details of the transaction you want to quote
AuthenticationCopied!
All API requests to orda require HMAC signatures using your project’s client ID and client secret. To authenticate your quote request:
-
Generate an
x-signature
header using your client secret. -
Include your
x-client-id
in the request headers.
For detailed instructions on generating the signature, refer to our Authentication Guide.
Required Headers
Header |
Description |
---|---|
|
Your project's client ID |
|
HMAC-SHA256 signature derived from your client secret |
|
|
The signature is an HMAC-SHA256 hash of the request body, using your Client Secret as the key. Never share your Client Secret or include it directly in your client-side code.
What is a Quote Request?Copied!
A quote request enables you to obtain pricing information for a potential transaction before executing it. This is useful for:
-
Showing the user how much they'll pay before they commit
-
Understanding the current exchange rates and fees
-
Preparing the necessary transaction details
Requesting a quoteCopied!
Intent Specification: The quote request uses an intent
Object to specify the amount calculation method:
-
usd
: Calculate based on USD amount (10 = 10$) -
fromAmount
: Calculate based on the source token amount -
toAmount
: Calculate based on the destination token amount
fromAmount
and toAmount
Methods must be in the token's smallest unit based on its decimal precision per token:
-
ETH: 18 decimals (1 ETH = 1e18 units)
-
USDC: 6 decimals (1 USDC = 1e6 units)
-
BTC: 8 decimals (1 BTC = 1e8 units)
Examples:
-
Swap 2.5 ETH:
fromAmount: "2500000000000000000"
(2.5 × 10^18) -
Receive 1000 USDC:
toAmount: "1000000000"
(1000 × 10^6)
Implementation NotesCopied!
-
Only one intent type should be specified per quote request
-
The specified amount serves as the constraint, while other amounts are calculated
-
Market conditions, slippage, and fees affect the calculated amounts
-
Always validate that the calculated amounts meet your requirements before executing the swap
Best PracticesCopied!
-
Use
fromAmount
for liquidating existing positions -
Use
toAmount
for precise purchasing requirements -
Use
usd
for dollar-cost averaging or consistent value strategies
Important Notes:
-
No need to worry about filling in your own settlement details - we use the settlement information you provided within the developer portal.
-
The
fromChain
should be a valid chain ID. Refer to the Active Chains documentation for supported networks. -
The
fromToken
should be the token address on the source blockchain. -
The API uses rate limiting to prevent abuse.
Additional Information:
-
Quote Provider: The response includes details from the selected quote provider (e.g., LiFi, Relay, Wormhole or internal routing).
-
Approval Transaction: approvalTxParams is only present if token approval is required.
-
Chain IDs: Refer to active chains documentation.
-
Gas Estimates: Based on current network conditions and may change.
-
Quote Expiration: Quotes have a limited validity period of approximately 30 seconds. It’s advisable to set up an automatic quote refresh system for users who haven’t completed their transactions within the 30 second timeframe.
-
Slippage: The actual received amount may differ due to price fluctuations.
-
Cross-Chain Transfers: For multi-chain transactions, additional monitoring steps may be required.
-
Response Variation: Structure may vary slightly based on the selected provider and transfer type (direct or cross-chain).
-
Best Quote Selection: The API automatically selects the most optimal quote from available providers.
Common Issues
-
Incorrect HMAC Signature: Verify that your signature is calculated over the exact request body and generated with your client secret. Refer to the Authentication Guide for more info.
-
Stale Data: Quotes are valid for only a short period, so ensure that you request new quotes if the user delays or changes transaction parameters.
-
Incomplete Request Data: Make sure all required transaction details are provided to avoid errors in the quote calculation.