API
Trade with the CEXISWAP API
Trade with the CEXISWAP API
swap/v1/price
chain
: 'ETH', 'POLYGON', 'BSC', 'THUNDERCORE', 'AVAX'
buyToken
: 'ETH', 'WBTC', 'USDT'
sellToken
: (same as buyToken)
buyAmount
or sellAmount
: amount in the on-chain units of the token, e.g. 1000000
is 1 USDT
price
: the price of buyToken in sellToken or vice versa
swap/v1/quote
chain
: 'ETH', 'POLYGON', 'BSC', 'THUNDERCORE', 'AVAX'
buyToken
: 'ETH', 'WBTC', 'USDT'
sellToken
: (same as buyToken)
buyAmount
or sellAmount
: amount in the on-chain units of the token, e.g. 1000000
is 1 USDT
(same as swap/v1/price)
to
: the address of the contract to send the blockchain transaction to
data
: the call data for the blockchain transaction
allowanceTarget
: the target contract address for setting ERC20 sell token allowance
price
: the price of buyToken in sellToken or vice versa
swap/v1/tokens
chain
: 'ETH', 'POLYGON', 'BSC', 'THUNDERCORE', 'AVAX'
List of { "symbol", "chain", "address", "decimals", "disabled" }
Allowance Targets
When your sellToken
is an ERC-20 token, you will need to give CEXISWAP contracts permission to use that token by setting a token allowance. The allowanceTarget
in the response is the contract address that you should set the allowance for.
For example: inputToken.approve(response.allowanceTarget)
Last updated