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": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
      "symbol": "USDC",
      "decimals": 6,
      "amount": "1000000",
      "chainId": 1
    },
    "tokenOut": {
      "contract": "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",
      "symbol": "USDC",
      "decimals": 6,
      "amount": "998500",
      "chainId": 137
    },
    "provider": "teleswap",
    "deadline": "2024-01-20T12:30:00.000Z"
  }
}

Authorizations

x-api-key
string
header
required

API key for authentication. Obtain from your Deframe dashboard.

Query Parameters

originChain
string
required

Origin blockchain network

Example:

"ethereum"

destinationChain
string
required

Destination blockchain network

Example:

"polygon"

tokenIn
string
required

Input token contract address

Example:

"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"

tokenOut
string
required

Output token contract address

Example:

"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"

amountIn
string

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

Example:

"1000000"

amountOut
string

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

Example:

"1000000"

destinationAddress
string

Recipient address on destination chain

Example:

"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"

refundAddress
string

Address for refunds if swap fails

Example:

"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"

Response

Quote generated successfully

quote
object
required

Swap quote with token details and expiration

Example:
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"quoteId": "550e8400-e29b-41d4-a716-446655440000",
"originChain": "ethereum",
"destinationChain": "polygon",
"tokenIn": {
"contract": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"symbol": "USDC",
"decimals": 6,
"amount": "1000000",
"chainId": 1
},
"tokenOut": {
"contract": "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",
"symbol": "USDC",
"decimals": 6,
"amount": "998500",
"chainId": 137
},
"provider": "teleswap",
"deadline": "2024-01-20T12:30:00.000Z"
}