Skip to main content
GET
/
v1
/
swap
/
quotes
Get swap quotes
curl --request GET \
  --url https://api.zerion.io/v1/swap/quotes/ \
  --header 'Authorization: Basic <encoded-value>'
{
  "links": {
    "self": "https://api.zerion.io/v1/wallet/0x42b9df65b219b3dd36ff330a4dd8f327a6ada990/swap-list"
  },
  "data": [
    {
      "type": "swap_quotes",
      "id": "589a0095e2111df5276ebf073fff9a8bfb821f34",
      "attributes": {
        "liquidity_source": {
          "id": "relay",
          "name": "Relay",
          "icon": {
            "url": "https://token-icons.s3.amazonaws.com/0x0391d2021f89dc339f60fff84546ea23e337750f.png"
          }
        },
        "input_amount": {
          "quantity": "0.001",
          "value": 2.2830463441233997,
          "usd_value": 2.2830463441233997,
          "currency": "USD"
        },
        "output_amount": {
          "quantity": "0.001",
          "value": 2.2830463441233997,
          "usd_value": 2.2830463441233997,
          "currency": "USD"
        },
        "minimum_output_amount": {
          "quantity": "0.001",
          "value": 2.2830463441233997,
          "usd_value": 2.2830463441233997,
          "currency": "USD"
        },
        "output_amount_after_fees": {
          "quantity": "0.001",
          "value": 2.2830463441233997,
          "usd_value": 2.2830463441233997,
          "currency": "USD"
        },
        "slippage_percent": 2,
        "rate": [
          {
            "value": 1,
            "symbol": "WETH"
          }
        ],
        "protocol_fee": {
          "amount": {
            "quantity": "0.001",
            "value": 2.2830463441233997,
            "usd_value": 2.2830463441233997,
            "currency": "USD"
          },
          "base_percentage": 0.67,
          "percentage": 0,
          "included_in_rate": false,
          "fungible": {
            "type": "fungibles",
            "id": "eth"
          }
        },
        "bridge_fee": {
          "amount": {
            "quantity": "0.001",
            "value": 2.2830463441233997,
            "usd_value": 2.2830463441233997,
            "currency": "USD"
          },
          "included_in_rate": true,
          "fungible": {
            "type": "fungibles",
            "id": "eth"
          }
        },
        "network_fee": {
          "amount": {
            "quantity": "0.001",
            "value": 2.2830463441233997,
            "usd_value": 2.2830463441233997,
            "currency": "USD"
          },
          "free": true,
          "fungible": {
            "type": "fungibles",
            "id": "eth"
          }
        },
        "transaction_approve": {
          "evm": {
            "type": "0x2",
            "from": "0xbf9db3564c22fd22ff30a8db7f689d654bf5f1fd",
            "to": "0xb2be281e8b11b47fec825973fc8bb95332022a54",
            "nonce": "0x42",
            "chain_id": "0x1",
            "gas": "0x1c138",
            "value": "0x0",
            "data": "0xa9059cbb000000000000000000000000d8da6bf26964af9d7eed9e03e53415d37aa9604500000000000000000000000000000000000000000000000000000000000003e8",
            "gas_price": "0x9502f900",
            "max_fee": "0xc6a17141",
            "max_priority_fee": "0x35aeb151",
            "custom_data": {
              "paymaster_params": {
                "paymaster": "<string>",
                "paymaster_input": "<string>"
              },
              "gas_per_pubdata_byte": "<string>"
            }
          },
          "solana": {
            "raw": "<string>"
          }
        },
        "transaction_swap": {
          "evm": {
            "type": "0x2",
            "from": "0xbf9db3564c22fd22ff30a8db7f689d654bf5f1fd",
            "to": "0xb2be281e8b11b47fec825973fc8bb95332022a54",
            "nonce": "0x42",
            "chain_id": "0x1",
            "gas": "0x1c138",
            "value": "0x0",
            "data": "0xa9059cbb000000000000000000000000d8da6bf26964af9d7eed9e03e53415d37aa9604500000000000000000000000000000000000000000000000000000000000003e8",
            "gas_price": "0x9502f900",
            "max_fee": "0xc6a17141",
            "max_priority_fee": "0x35aeb151",
            "custom_data": {
              "paymaster_params": {
                "paymaster": "<string>",
                "paymaster_input": "<string>"
              },
              "gas_per_pubdata_byte": "<string>"
            }
          },
          "solana": {
            "raw": "<string>"
          }
        },
        "error": {
          "code": "not_enough_input_asset_balance",
          "hint": "topup",
          "message": "Input asset balance is not enough to execute a swap"
        },
        "estimated_time_seconds": 2
      },
      "relationships": {
        "input_chain": {
          "links": {
            "related": "https://api.zerion.io/v1/chains/polygon"
          },
          "data": {
            "type": "chains",
            "id": "polygon"
          }
        },
        "output_chain": {
          "links": {
            "related": "https://api.zerion.io/v1/chains/polygon"
          },
          "data": {
            "type": "chains",
            "id": "polygon"
          }
        },
        "input_fungible": {
          "links": {
            "related": "https://api.zerion.io/v1/fungibles/eth"
          },
          "data": {
            "type": "fungibles",
            "id": "eth"
          }
        },
        "output_fungible": {
          "links": {
            "related": "https://api.zerion.io/v1/fungibles/eth"
          },
          "data": {
            "type": "fungibles",
            "id": "eth"
          }
        }
      }
    }
  ]
}

Documentation Index

Fetch the complete documentation index at: https://developers.zerion.io/llms.txt

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

Authorizations

Authorization
string
header
required

Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.

Query Parameters

currency
string
default:usd

Currency in which fiat values of amounts and fees in the response are expressed.

from
string
required

Address of the wallet performing the swap. Must match the chain type of input[chain_id] (EVM hex or Solana base58).

to
string
required

Recipient of the output asset. Must match the chain type of output[chain_id]. For a same-chain swap to the same wallet, set to equal to from.

input
object
required

The asset being sent.

output
object
required

The asset being received.

slippage_percent
number<float>

Maximum acceptable slippage in percent. When omitted, an auto-slippage value is chosen.

Required range: x >= 0

Response

Response for the requested swap quotes.

data
object[]
required