Skip to main content
GET
/
v1
/
swap
/
offers
Get available swap offers
curl --request GET \
  --url https://api.zerion.io/v1/swap/offers/ \
  --header 'Authorization: Basic <encoded-value>'
{
  "links": {
    "self": "https://api.zerion.io/v1/wallet/0x42b9df65b219b3dd36ff330a4dd8f327a6ada990/swap-list"
  },
  "data": [
    {
      "type": "swaps",
      "id": "52d994a173d755e99845e861d534a419",
      "attributes": {
        "preconditions_met": {
          "enough_allowance": true,
          "enough_balance": true
        },
        "input_quantity_max": {
          "int": "12345678",
          "decimals": 5,
          "float": 123.45678,
          "numeric": "123.45678"
        },
        "output_quantity_min": {
          "int": "12345678",
          "decimals": 5,
          "float": 123.45678,
          "numeric": "123.45678"
        },
        "estimation": {
          "input_quantity": {
            "int": "12345678",
            "decimals": 5,
            "float": 123.45678,
            "numeric": "123.45678"
          },
          "output_quantity": {
            "int": "12345678",
            "decimals": 5,
            "float": 123.45678,
            "numeric": "123.45678"
          },
          "gas": 100000,
          "seconds": 120
        },
        "liquidity_source": {
          "id": "1inch-v4",
          "name": "USD Coin",
          "icon": {
            "url": "https://token-icons.s3.amazonaws.com/0x0391d2021f89dc339f60fff84546ea23e337750f.png"
          }
        },
        "asset_spender": "<string>",
        "slippage_type": "normal",
        "transaction": {
          "to": "0xB2BE281e8b11b47FeC825973fc8BB95332022A54",
          "from": "0xB2BE281e8b11b47FeC825973fc8BB95332022A54",
          "chain_id": "0x1",
          "gas": 115000,
          "data": "<string>",
          "value": "1000000000000000000"
        },
        "fee": {
          "protocol": {
            "base_percent": 0.5,
            "percent": 0,
            "quantity": {
              "int": "12345678",
              "decimals": 5,
              "float": 123.45678,
              "numeric": "123.45678"
            }
          },
          "integrator": {
            "percent": 1,
            "quantity": {
              "int": "12345678",
              "decimals": 5,
              "float": 123.45678,
              "numeric": "123.45678"
            }
          }
        }
      },
      "relationships": {
        "input_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_chain": {
          "links": {
            "related": "https://api.zerion.io/v1/chains/polygon"
          },
          "data": {
            "type": "chains",
            "id": "polygon"
          }
        },
        "output_fungible": {
          "links": {
            "related": "https://api.zerion.io/v1/fungibles/eth"
          },
          "data": {
            "type": "fungibles",
            "id": "eth"
          }
        }
      }
    }
  ]
}

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

input
object

Information about what the wallet wants to send.

output
object

Information about what the wallet wants to receive.

gas_price
integer<int64>

Gas price in wei. If nothing specified then current market classic gas price is used.

Required range: x >= 0
liquidity_source_id
enum<string>

The source to be used for exchanges search. If nothing specified then all is used. Available exchange sources.

Available options:
all,
weth,
1inch-v4,
0x,
defi-sdk,
uniswap-v2,
uniswap-v3,
sushiswap,
trisolaris,
wintermute,
paraswap,
hashflow,
movr
Example:

"0x"

sort
enum<string>

Order of output transactions result. If nothing specified then amount is used.

Available options:
amount,
time
slippage_percent
number<float>

Maximum slippage value for the transaction to be approved. Slippage is a term used in crypto exchanges to describe the difference between the expected price of a trade and the actual price at which the trade is executed. It occurs due to the volatility and liquidity of the market, and can result in a higher or lower price than expected. If nothing specified then 2 is used.

Required range: 0 <= x <= 3
integrator
object

Integrator service related parameters.

Response

Response for requested trade.

data
object[]
required