Get swap quote
Returns a persisted quote for swapping tokens on same or different chains. Provide either originChain + destinationChain or chainIdIn + chainIdOut. Provide exactly one of amountIn or amountOut. Quotes expire after 5 minutes; quote.deadline is a Unix timestamp in seconds and quote.deadlineDate is an ISO 8601 string (UTC).
Authorizations
API key for authentication. Obtain from your Deframe dashboard.
Query Parameters
Origin blockchain network name. Use with destinationChain.
"ethereum"
Origin chain ID. Alternative to originChain.
1
Destination blockchain network name. Use with originChain.
"polygon"
Destination chain ID. Alternative to destinationChain.
137
Input token contract address
"0xb794F5eA0ba39494cE839613fffBA74279579268"
Output token contract address
"0xb794F5eA0ba39494cE839613fffBA74279579268"
Input amount (in token smallest unit). Provide either amountIn or amountOut, not both.
"1000000000000000000"
Desired output amount (in token smallest unit). Provide either amountIn or amountOut, not both.
"1000000000000000000"
Sender address on the origin chain. When provided together with destinationAddress, the endpoint generates and returns transaction bytecode in the same response, skipping the need for a separate POST /v2/swap/bytecode call.
"0xb794F5eA0ba39494cE839613fffBA74279579268"
Recipient address on destination chain. When provided together with originAddress, the endpoint generates and returns transaction bytecode in the same response.
"0xb794F5eA0ba39494cE839613fffBA74279579268"
Address for refunds if swap fails
"0xb794F5eA0ba39494cE839613fffBA74279579268"
Request fee sponsorship on eligible Deframe bridge routes
false
Registered provider name to force when eligible for the route
"relay"
Slippage tolerance as a fraction of 1. Valid range is 0.0001 to 0.5.
"0.01"
Transfer speed for CCTP cross-chain swaps
fast, standard "fast"
Response
Quote generated successfully. When both originAddress and destinationAddress are provided, the response also includes transaction bytecode fields (id, chainId, transactionData) identical to those returned by POST /v2/swap/bytecode.
Swap quote with token details, fee breakdown, and expiration
ID created for execution tracking. Only present when originAddress and destinationAddress were both provided.
"65f1a2b3c4d5e6f789012345"
Chain ID where transactions should be executed. Only present when bytecode was generated.
1
Transaction data for execution
- object[]
- object