LogoLogo
  • Introduction to Unizen
    • Unizen Overview
      • Unizen Liquidity Distribution Mechanism (ULDM)
        • ULDM Performance
      • Unizen Interoperability Protocol (UIP)
        • LayerZero
        • DeBridge
        • Stargate
        • Celer
        • Axelar
        • Thorchain
    • Unizen Dashboard
      • General
      • Portfolio
      • History
    • Unizen Trade
      • Fees
    • Unizen Explore
      • Unizen Omni-Chain Data Pool
    • Unizen Earn
  • ZCX
    • Token Utility
    • Tokenomics
  • API - Introduction
    • Introduction
    • Before you get started
      • Understanding Price Impact and Price Slippage in Token Swaps
      • Token Allowance Management for Non-updatable Allowance Tokens
      • Tokens with taxes
      • Wrapping and Unwrapping Native Tokens
      • Quote expiration deadline
    • Security Best Practices for Integrating Unizen
      • Why disable CORS
      • How to integrate with a reverse proxy
    • Version 2 of our smart contracts
      • Migration to smart contract v2
  • API - GET STARTED
    • QuickStart guide
    • Swagger
    • Information endpoints
      • GET /trade/v1/info/chains
      • GET /trade/v1/info/sources
      • GET/v1/info/cross-providers
      • GET /trade/v1/info/token/search
      • GET /v1/info/token/popular
      • GET /trade/v1/info/token/{chainId}/{tokenAddress}
      • GET /trade/v1/info/tokenLogo/{chainId}/{tokenAddress}
      • GET /info/thorchain-inbound-address
      • GET /trade/v1/info/tx/{txHash}
      • GET /trade/v1/info/trade/{chainId}/{txHash}
      • GET /trade/v1/info/trades
    • Approval
      • GET /trade/v1/{chainId}/approval/spender
      • GET /trade/v1/{chainId}/approval/transaction
      • GET /trade/v1/{chainId}/approval/allowance
    • Single-Chain Swap
      • GET /trade/v1/{chainId}/quote/single
      • GET /trade/v1/{chainId}/swap/single
      • Send transaction in evm chains
      • Send transaction in Solana
    • Cross-Chain Swap
      • GET /trade/v1/{chainId}/quote/cross
      • GET /trade/v1/{chainId}/swap/cross
      • Send transaction
    • Gasless orders
      • POST /trade/v1/gasless/typed-data
      • POST /v1/gasless/estimate
      • POST /v1/gasless/create
      • POST /v1/gasless/cancel
      • GET /trade/v1/gasless/status/{orderId}
      • GET /v1/gasless/orderByAddress/{address}
    • UTXO Assets and Cosmos Swap
      • GET /trade/v1/{chainId}/quote/cross 1
      • GET /trade/v1/{chainId}/swap/cross
      • Sending transactions
    • Efficient Quote Retrieval with Batch Processing
      • GET /trade/v1/{chainId}/batch_quote/single
    • Error Messages
  • GASLESS TRADES
    • Obtaining gasless quotes
    • Gas estimation
    • Executing the trade
    • Following the orders
  • On-Chain Contracts - Get Started
    • Integration with Unizen Contracts for Token Swapping
    • Registering Errors on Smart Contract Calls
  • PERMIT2
    • What is Permit2?
    • Usage in our api
  • WIDGET - Get Started
    • Embed the Unizen Widget
    • Playground
  • Other
    • Smart Contracts
    • Security Audits
    • Roadmap
  • links
    • Unizen
    • Marketing Website
    • Medium
    • Twitter
    • Discord
    • Telegram
Powered by GitBook
On this page

Was this helpful?

  1. API - GET STARTED
  2. Cross-Chain Swap

GET /trade/v1/{chainId}/quote/cross

Find all available quotes for cross-chain trade via Unizen DEX Aggregator

PreviousCross-Chain SwapNextGET /trade/v1/{chainId}/swap/cross

Last updated 10 months ago

Was this helpful?

Get the best quote for a cross chain trade.

get
Authorizations
Path parameters
chainIdnumber · enumRequired

The chain ID of the chain to quote on.

Example: 137Possible values:
Query parameters
fromTokenAddressstringRequired

The address of the token being traded. If native, use address zero.

Example: 0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270
toTokenAddressstringRequired

The address of the token to receive in exchange. If native, use address zero.

Example: 0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7
amountstringRequired

Amount of tokens being traded

Example: 10000000000000000000
destinationChainIdnumber · enumRequired

The chain ID of the destination network.

Example: 43114Possible values:
senderstringRequired

The address of the sender.

Example: 0x54c47034887C582Fc1Af4a9a3b68180a8a9eF2d2
receiverstringOptional

The address of the receiver of the funds.

Example: bc1qf7cd6pvs9sqnkr0nadsuhgecy8prnc9t8k0jny
slippagenumberOptional

The maximum slippage percentage allowed.

Example: 0.005
deadlinenumberOptional

The timestamp of the transaction deadline.

Example: 1685541105
excludedDexesstringOptional

List of dexes excluded by chain

Example: {"1":["0x0000000000000"]}
priceImpactProtectionPercentagenumberOptional

The percentage of price impact protection, from 0 to 1

Example: 0.5
feePercentagenumberOptional

The fee percentage, from 0 to 1

slippageProtectionPercentagenumberOptional

The percentage of slippage protection, from 0 to 1, default 0.5

Example: 0.5
disableEstimatebooleanOptional

Disable estimate gas, default is true.

isExactOutbooleanOptional

Whether it is an exact out trade.

isSplitbooleanOptional

Whether split trade is enabled. Default is true.

Responses
200
The response is an array of objects, with each object representing one provider. Currently, we support two interoperable providers for cross-chain transactions: Stargate, Celer
application/json
get
GET /trade/v1/{chainId}/quote/cross?fromTokenAddress=text&toTokenAddress=text&amount=text&destinationChainId=1&sender=text HTTP/1.1
Host: 
Authorization: Bearer Bearer
Accept: */*
200

The response is an array of objects, with each object representing one provider. Currently, we support two interoperable providers for cross-chain transactions: Stargate, Celer

[
  {
    "srcTradeList": [
      {}
    ],
    "dstTradeList": [
      {}
    ],
    "srcTrade": {
      "fromTokenAmount": "26031659637168024367",
      "toTokenAmount": "26031659637168024367",
      "deltaAmount": "26083722956442360416",
      "tokenFrom": {
        "name": "ZCX",
        "symbol": "ZCX",
        "decimals": 18,
        "contractAddress": "0xc52c326331e9ce41f04484d3b5e5648158028804",
        "priceInUsd": 0.1,
        "chainId": 1,
        "buyTax": 0,
        "sellTax": 0
      },
      "tokenTo": {
        "name": "ZCX",
        "symbol": "ZCX",
        "decimals": 18,
        "contractAddress": "0xc52c326331e9ce41f04484d3b5e5648158028804",
        "priceInUsd": 0.1,
        "chainId": 1,
        "buyTax": 0,
        "sellTax": 0
      },
      "protocol": [
        {}
      ],
      "transactionData": {
        "info": {
          "amountIn": "26031659637168024367",
          "amountOutMin": "26031659637168024367",
          "amountInMax": "26083722956442360416",
          "amountOut": "26083722956442360416",
          "actualQuote": "26083722956442360416",
          "srcToken": "text",
          "dstToken": "text",
          "uuid": "text",
          "apiId": "text",
          "userPSFee": 0,
          "deadline": 1684251,
          "tradeType": 0,
          "slippage": 0.1,
          "feePercent": 0,
          "sharePercent": 0,
          "tokenHasTaxes": false,
          "path": false,
          "v3Path": false
        },
        "amountInfo": {
          "amount": "26031659637168024367",
          "actualQuote": "26031659637168024367"
        },
        "call": [
          "text"
        ]
      }
    },
    "dstTrade": {
      "fromTokenAmount": "26031659637168024367",
      "toTokenAmount": "26031659637168024367",
      "deltaAmount": "26083722956442360416",
      "tokenFrom": {
        "name": "ZCX",
        "symbol": "ZCX",
        "decimals": 18,
        "contractAddress": "0xc52c326331e9ce41f04484d3b5e5648158028804",
        "priceInUsd": 0.1,
        "chainId": 1,
        "buyTax": 0,
        "sellTax": 0
      },
      "tokenTo": {
        "name": "ZCX",
        "symbol": "ZCX",
        "decimals": 18,
        "contractAddress": "0xc52c326331e9ce41f04484d3b5e5648158028804",
        "priceInUsd": 0.1,
        "chainId": 1,
        "buyTax": 0,
        "sellTax": 0
      },
      "protocol": [
        {}
      ],
      "transactionData": {
        "info": {
          "amountIn": "26031659637168024367",
          "amountOutMin": "26031659637168024367",
          "amountInMax": "26083722956442360416",
          "amountOut": "26083722956442360416",
          "actualQuote": "26083722956442360416",
          "srcToken": "text",
          "dstToken": "text",
          "uuid": "text",
          "apiId": "text",
          "userPSFee": 0,
          "deadline": 1684251,
          "tradeType": 0,
          "slippage": 0.1,
          "feePercent": 0,
          "sharePercent": 0,
          "tokenHasTaxes": false,
          "path": false,
          "v3Path": false
        },
        "amountInfo": {
          "amount": "26031659637168024367",
          "actualQuote": "26031659637168024367"
        },
        "call": [
          "text"
        ]
      }
    },
    "transactionData": {},
    "nativeValue": "29422186306758765852",
    "nativeFee": "1070050644652846329",
    "processingTime": 1000,
    "tradeProtocol": "CROSS_CHAIN_CELER",
    "crossChainTradeQuotesType": "TRADE_ON_BOTH",
    "sourceChainId": 137,
    "destinationChainId": 43114,
    "contractVersion": "V1",
    "providerInfo": {
      "name": "Celer",
      "contractVersion": "v2",
      "logo": "https://api.zcx.com/data/logo/interoperability-provider/cbridge.svg"
    },
    "estimateGas": "11231133211313",
    "estimateGasError": "Execution reverted",
    "gasPrice": "56442235035"
  }
]