Skip to main content
GET
/
v2
/
swap
/
quote
Get swap quote
curl --request GET \
  --url https://api.deframe.io/v2/swap/quote \
  --header 'x-api-key: <api-key>'
{
  "quote": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "quoteId": "550e8400-e29b-41d4-a716-446655440000",
    "originChain": "ethereum",
    "destinationChain": "polygon",
    "tokenIn": {
      "contract": "0xb794F5eA0ba39494cE839613fffBA74279579268",
      "symbol": "USDC",
      "decimals": 6,
      "amount": "1000000000000000000",
      "chainId": 1,
      "priceUSD": "1.00"
    },
    "tokenOut": {
      "contract": "0xb794F5eA0ba39494cE839613fffBA74279579268",
      "symbol": "USDC",
      "decimals": 6,
      "amount": "1000000000000000000",
      "chainId": 1,
      "priceUSD": "1.00"
    },
    "provider": "teleswap",
    "deadline": 1705753800,
    "deadlineDate": "2024-01-20T12:30:00.000Z",
    "chainIdIn": 1,
    "chainIdOut": 137,
    "rawQuote": "<unknown>",
    "status": "pending",
    "feeSponsorship": false,
    "customer": "<string>"
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.deframe.io/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

x-api-key
string
header
required

API key for authentication. Obtain from your Deframe dashboard.

Query Parameters

originChain
string

Origin blockchain network name. Use with destinationChain.

Example:

"ethereum"

chainIdIn
number

Origin chain ID. Alternative to originChain.

Example:

1

destinationChain
string

Destination blockchain network name. Use with originChain.

Example:

"polygon"

chainIdOut
number

Destination chain ID. Alternative to destinationChain.

Example:

137

tokenIn
string
required

Input token contract address

Example:

"0xb794F5eA0ba39494cE839613fffBA74279579268"

tokenOut
string
required

Output token contract address

Example:

"0xb794F5eA0ba39494cE839613fffBA74279579268"

amountIn
string

Input amount (in token smallest unit). Provide either amountIn or amountOut, not both.

Example:

"1000000000000000000"

amountOut
string

Desired output amount (in token smallest unit). Provide either amountIn or amountOut, not both.

Example:

"1000000000000000000"

destinationAddress
string

Recipient address on destination chain

Example:

"0xb794F5eA0ba39494cE839613fffBA74279579268"

refundAddress
string

Address for refunds if swap fails

Example:

"0xb794F5eA0ba39494cE839613fffBA74279579268"

feeSponsorship
boolean

Request fee sponsorship on eligible Deframe bridge routes

Example:

false

preferredProvider
string

Registered provider name to force when eligible for the route

Example:

"relay"

slippage
string

Slippage tolerance as a fraction of 1. Valid range is 0.0001 to 0.5.

Example:

"0.01"

transferSpeed
enum<string>

Transfer speed for CCTP cross-chain swaps

Available options:
fast,
standard
Example:

"fast"

Response

Quote generated successfully

quote
object
required

Swap quote with token details and expiration