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

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

Get the best quote for a cross chain trade.

get
Authorizations
HTTPRequired

[just text field] Please enter token in following format: Bearer

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
chevron-right
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
srcTradeListstring[]Required

If there is no trade required on source chain, srcTradeList is an empty array

Example: [{}]
dstTradeListstring[]Required

If there is no trade required on destination chain, dstTradeList is an empty array

Example: [{}]
transactionDataobjectRequired

An object containing information on the parameters of the transaction.

nativeValuestringRequired

The total value of the transaction in native currency

Example: 29422186306758765852
nativeFeestringRequired

A string representation of the native fee associated with the transaction

Example: 1070050644652846329
processingTimenumberRequired

The time it took for the transaction to be processed

Example: 1000
tradeProtocolstringRequired

The protocol used to execute the transaction (CROSS_CHAIN_STARGATE | CROSS_CHAIN_CELER)

Example: CROSS_CHAIN_CELER
crossChainTradeQuotesTypestringRequired

Type of cross-chain trade quotes

Example: TRADE_ON_BOTH
sourceChainIdnumberRequired

A CHAINS enum value representing the source chain

Example: 137
destinationChainIdnumberRequired

A CHAINS enum value representing the destination chain

Example: 43114
contractVersionstringRequired

Version of the contract, V1 or V2

Example: V1
providerInfoobjectRequired

The interoperability provider information

Example: {"name":"Celer","contractVersion":"v2","logo":"https://api.zcx.com/data/logo/interoperability-provider/cbridge.svg"}
estimateGasobjectRequired

the estimated amount of gas needed for the transaction, if disableEstimate is set to false

Example: 11231133211313
estimateGasErrorobjectRequired

the estimate gas error, returned from RPC, if disableEstimate is set to false

Example: Execution reverted
gasPricestringRequired

Gas Price

Example: 56442235035
get
/v1/{chainId}/quote/cross
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

Last updated