Download OpenAPI specification:Download
Key features:
You can check an example of a DEX service developed on the basis of the DEX API.
{X-API-Key: <key>}
.ChainID=1
.POST /v2/tokens/list
.calldata
) for a transaction to provide access to tokens, and the address of the contract where the transaction should be sent to.Provides a list of supported blockchains.
X-Api-Key | string Your API access key. Without an API access key, a number of requests per second is limited. |
curl --location --request GET 'https://dex-api.changelly.com/v1/platforms'
{- "platforms": [
- {
- "chainId": 1,
- "name": "Ethereum",
- "shortname": ""
}, - {
- "chainId": 10,
- "name": "Optimistic Ethereum",
- "shortname": "Optimism"
}, - {
- "chainId": 56,
- "name": "BNB Smart Chain",
- "shortame": "BSC"
}
]
}
Returns list of tokens with filtration and pagination.
X-Api-Key | string Your API access key. Without an API access key, a number of requests per second is limited. |
Filter with pagination.
Note. Only paging object is required.
object (filter) Object with information for filtration. | |
required | object (paging) Object with information for pagination. |
{- "filter": {
- "addresses": [
- "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
], - "chain_ids": [
- 1
], - "is_active": true,
- "names": [
- "Ethereum"
], - "symbols": [
- "ETH"
]
}, - "paging": {
- "page": 1,
- "page_size": 100
}
}
{- "tokens": [
- {
- "chainId": 1,
- "address": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
- "name": "Ethereum",
- "symbol": "ETH",
- "decimals": 18,
- "is_active": true,
- "priority": 1
}
]
}
Provides calculated gas price values in GWEI (nAVAX for Avalanche).
chainId required |
X-Api-Key | string Your API access key. Without an API access key, a number of requests per second is limited. |
curl --location --request GET 'https://dex-api.changelly.com/v1/1/gasprices'
{- "low": "29.521",
- "medium": "31.521",
- "high": "33.521"
}
Provides a list of liquidity sources.
X-Api-Key | string Your API access key. Without an API access key, a number of requests per second is limited. |
curl --location --request GET 'https://dex-api.changelly.com/v1/sources'
{- "sources": [
- {
- "name": "Uniswap V2",
}
]
}
Returns only the best exchange offer.
Doesn't generate the input parameters for creating exchange transaction.
chainId required |
fromTokenAddress required | string Example: fromTokenAddress=0xdac17f958d2ee523a2206206994597c13d831ec7 Smart contract address of the sale token. |
toTokenAddress required | string Example: toTokenAddress=0x6b175474e89094c44da98b954eedeac495271d0f Smart contract address of the purchase token. |
amount required | integer Example: amount=1500000000 The amount of sale tokens in decimals of the token. Can be taken from the /{chainID}/tokens endpoint. |
slippage required | number Example: slippage=1 The amount of slippage allowed during the actual execution of the transaction (10 = 1% slippage). If the price changes by more than this percentage, the transaction will be reverted. |
gasPrice | string Example: gasPrice=16000000000 Gas price value for making a transaction in WEI (nAVAX for Avalanche). 1 GWEI = 1000000000 WEI. Default value is the value high from the /{chainID}/gasprices endpoint. |
feeRecipient | string Example: feeRecipient=0xdac17f958d2ee523a2206206994597c13d831ec7 Wallet address for receiving fees. The commission is paid from the purchase or sale token. It depends on which of the fields is sent in the request: |
buyTokenPercentageFee | integer Example: buyTokenPercentageFee=1 Percentage of commission from the amount of purchase tokens, is taken in favor of 10 = 1%, maximum value is 500. If you specify both fields ( |
sellTokenPercentageFee | integer Example: sellTokenPercentageFee=1 Percentage of commission from the amount of sale tokens, is taken in favor of 10 = 1%, maximum value is 500. If you specify both fields ( |
X-Api-Key | string Your API access key. Without an API access key, a number of requests per second is limited. |
curl --location --request GET 'https://dex-api.changelly.com/v1/1/price?fromTokenAddress=0xdac17f958d2ee523a2206206994597c13d831ec7&toTokenAddress=0x6b175474e89094c44da98b954eedeac495271d0f&amount=1500000000&slippage=1&gasPrice=16000000000&feeRecipient=0xdac17f958d2ee523a2206206994597c13d831ec7&buyTokenPercentageFee=1&sellTokenPercentageFee=1'
{- "amount_out_total": "1520418496203262297769",
- "estimate_gas_total": "144085",
- "token_in": "0xdac17f958d2ee523a2206206994597c13d831ec7",
- "token_out": "0x6b175474e89094c44da98b954eedeac495271d0f",
- "gas_price": "16000000000",
- "fee_recipient_amount": "1518896558810500225",
- "routes": {
- "protocol_name": "Uniswap_V3",
- "percent": 100,
- "pools": null,
- "amount_in": "",
- "amount_out": ""
}
}
Checks how many user’s tokens the exchange smart contract has access to.
chainId required |
tokenAddress required | string Example: tokenAddress=0xdAC17F958D2ee523a2206206994597C13D831ec7 Smart contract address of the token for which access is being checked. |
walletAddress required | string Example: walletAddress=0x58f58219e2d2598588c1b457bb6da65c34d99310 Wallet of the user for which access is being checked. |
X-Api-Key | string Your API access key. Without an API access key, a number of requests per second is limited. |
curl --location --request GET 'https://dex-api.changelly.com/v1/1/transaction/allowance?tokenAddress=0xdAC17F958D2ee523a2206206994597C13D831ec7&walletAddress=0x58f58219e2d2598588c1b457bb6da65c34d99310'
{- "remaining": "11579208923731620000"
}
Generates input parameters for the access transaction. This transaction provides access to the user's tokens for the exchange smart contract.
Note. The endpoint doesn't generate transaction.
chainId required |
tokenAddress required | string Example: tokenAddress=0xdAC17F958D2ee523a2206206994597C13D831ec7 Smart contract address of the token for which access is being checked. |
amount required | integer Example: amount=1500000000 The amount of sale tokens in decimals of the token. Can be taken from the /{chainID}/tokens endpoint. |
gasPrice | string Example: gasPrice=16000000000 Gas price value for making a transaction in WEI (nAVAX for Avalanche). 1 GWEI = 1000000000 WEI. Default value is the value high from the /{chainID}/gasprices endpoint. |
X-Api-Key | string Your API access key. Without an API access key, a number of requests per second is limited. |
curl --location --request GET 'https://dex-api.changelly.com/v1/1/transaction/approve?tokenAddress=0xdAC17F958D2ee523a2206206994597C13D831ec7&amount=100000000000&gasPrice=100000000000'
{- "calldata": "0x095ea7b30000000000000000000000001aaad07998466cd3eb8140827dddb37570be1e63000000000000000000000000000000000000000000000000000000174876e800",
- "estimate_gas": "48561",
- "gas_price": "100000000000",
- "to": "0xdac17f958d2ee523a2206206994597c13d831ec7"
}
Returns the best route and generates input parameters for exchange transaction.
Note. The endpoint doesn't generate transaction.
chainId required |
fromTokenAddress required | string Example: fromTokenAddress=0xdac17f958d2ee523a2206206994597c13d831ec7 Smart contract address of the sale token. |
toTokenAddress required | string Example: toTokenAddress=0x6b175474e89094c44da98b954eedeac495271d0f Smart contract address of the purchase token. |
amount required | integer Example: amount=1500000000 The amount of sale tokens in decimals of the token. Can be taken from the /{chainID}/tokens endpoint. |
slippage required | number Example: slippage=1 The amount of slippage allowed during the actual execution of the transaction (10 = 1% slippage). If the price changes by more than this percentage, the transaction will be reverted. |
gasPrice | string Example: gasPrice=16000000000 Gas price value for making a transaction in WEI (nAVAX for Avalanche). 1 GWEI = 1000000000 WEI. Default value is the value high from the /{chainID}/gasprices endpoint. |
feeRecipient | string Example: feeRecipient=0xdac17f958d2ee523a2206206994597c13d831ec7 Wallet address for receiving fees. The commission is paid from the purchase or sale token. It depends on which of the fields is sent in the request: |
buyTokenPercentageFee | integer Example: buyTokenPercentageFee=1 Percentage of commission from the amount of purchase tokens, is taken in favor of 10 = 1%, maximum value is 500. If you specify both fields ( |
sellTokenPercentageFee | integer Example: sellTokenPercentageFee=1 Percentage of commission from the amount of sale tokens, is taken in favor of 10 = 1%, maximum value is 500. If you specify both fields ( |
recipientAddress | string Example: recipientAddress=0xFD5c1C3d086a9CC0f21beaB6ddE3900C9351FC59 The address of the recipient of the tokens after the exchange. If this field is not specified, then the recipient of the tokens will be the one who sends the transaction for the exchange. |
takerAddress | string Example: takerAddress=0xF9C7aE9200CAc6597AE57b0C047205c28A7f53f7 The wallet address from which the transaction will be performed. If the local transaction fails, the 500 error code and JSON will return as response. |
skipValidation | boolean Example: skipValidation=true Validation flag. If value is true - validation will be skipped. |
X-Api-Key | string Your API access key. Without an API access key, a number of requests per second is limited. |
curl --location --request GET 'https://dex-api.changelly.com/v1/1/quote?fromTokenAddress=0xdac17f958d2ee523a2206206994597c13d831ec7&toTokenAddress=0x6b175474e89094c44da98b954eedeac495271d0f&amount=1500000000&slippage=1&gasPrice=16000000000&feeRecipient=0xdac17f958d2ee523a2206206994597c13d831ec7&buyTokenPercentageFee=1&sellTokenPercentageFee=1&recipientAddress=0xFD5c1C3d086a9CC0f21beaB6ddE3900C9351FC59&takerAddress=0xF9C7aE9200CAc6597AE57b0C047205c28A7f53f7&skipValidation=true'
{- "amount_out_total": "1494075314383326809742",
- "estimate_gas_total": "401000",
- "token_in": "0xdac17f958d2ee523a2206206994597c13d831ec7",
- "token_out": "0x6b175474e89094c44da98b954eedeac495271d0f",
- "gas_price": "16000000000",
- "fee_recipient_amount": "1497002",
- "routes": {
- "protocol_name": "xSigma",
- "percent": 100,
- "pools": null,
- "amount_in": "1498500000",
- "amount_out": "1517754723711759186599"
}, - "calldata": "0x351eb598000000000000000000000000fd5c1c3d086a9cc0f21beab6dde3900c9351fc.....00000eada1c640EF9200000",
- "to": "0x1AAAd07998466cD3Eb8140827DDdb37570BE1e63"
}