Provides a list of supported blockchains as well as a list of tokens for a destination network.
Request sample:https://api.yetanotherdefi.com/v1/tokens/allForSwapAndBridge
An array of supported tokens for "destination" network.
chainId
int
The blockchain network ID.
address
str
The token smart contract address.
name
str
Full name of the token.
symbol
str
Abbreviated name of the token.
decimals
int
The number of decimals used to get its user representation. For example, if decimals equals 2, a balance of 505 tokens should be displayed to a user as 5,05 (505 / 10 ** 2).
logoURI
str
A link to the token logo.
is_active
boolean
FALSE = the token is rarely used in exchanges on DEXs.
is_rfq_mode
boolean
TRUE = the token is supported by RFQ providers.
Get gas prices
GETv1/{chainID}/gasprices
Provides calculated gas price values in GWEI (nAVAX for Avalanche).
The gas price at which the transaction is most likely to be accepted not earlier than after block 5. There is a risk of a long transaction confirmation.
medium
str
The gas price at which the transaction is most likely to be accepted in the next 2-3 blocks.
high
str
The gas price at which the transaction is most likely to be accepted in the next block.
lowInfo (mediumInfo / highInfo)
map
Detailed gas price info for EIP-1559.
price
str
Gas price (for legacy transactions, not EIP-1559).
maxPriorityFeePerGas
str
Max Priority Fee Per Gas (tips in EIP-1559).
maxFeePerGas
str
Max Fee Per Gas (for EIP-1559).
Get price for pair
GETv1/price
Returns the best route and exchange offer for pair, no calldata for transaction. Works faster than /quote.
Request sample:
https://api.yetanotherdefi.com/v1/price?fromChainID=1&toChainID=137&fromTokenAddress=0xdac17f958d2ee523a2206206994597c13d831ec7&toTokenAddress=0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063&amount=150&slippage=10&feeRecipient=0x47ac0fb4f2d84898e4d9e7b4dab3c24507a6d503&sellTokenPercentageFee=10&rfqOnly=false
Query Parameters
Name
Type
Description
fromTokenAddress*
String
Smart contract address of the sale token.
toTokenAddress*
String
Smart contract address of the purchase token.
amount*
Integer
The amount of sale tokens in decimals of the token (can be taken from the method /tokens).
slippage*
Number
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 revert. Min = 1 (0.1%), max = 500 (50%).
Default value : 1
gasPrice
String
Gas price value for making a transaction in WEI (nAVAX for Avalanche) (1 GWEI = 1000000000 WEI), default value is the value high from /gasprices.
feeRecipient
String
Wallet address for receiving fees. The commission is paid from the purchase token.
sellTokenPercentageFee
Integer
Percentage of commission from the amount of sale tokens, is taken in favor of feeRecipient. (10 = 1%, maximum value is 500).
rfqOnly
Boolean
If TRUE: use only RFQ providers for routing.
Default value : false
excludeAggregator
String
Exclude some aggregators from routing (add several parameters for multiple exclude).
includeAggregator
String
Include some aggregators from routing (add several parameters for multiple include). This parameter cannot be combined with excludedAggregators.
fromChainID*
Integer
Source/sell blockchain ID
toChainID*
Intger
Destination/buy blockchain ID
onchainExcludeAggregator
String
Exclude some aggregators from on-chain routing (add several parameters for multiple exclude).
onchainIncludeAggregator
String
Include some aggregators from on-chain routing (add several parameters for multiple include). This parameter cannot be combined with onchainExcludeAggregators.
The amount of purchase tokens in decimals of the token.
estimate_gas_total
str
The estimated amount of gas that will be used during the transaction.
token_in
str
Smart contract address of the sale token.
token_out
str
Smart contract address of the purchase token.
gas_price
str
Gas price value for a transaction in WEI (nAVAX for Avalanche).
bridge_fee
str
Bridge protocol fee.
fees
array
Partner's fee.
amount
str
The amount of sell tokens in decimals of the token, which will be taken in favor of feeRecipient. The value will be 0 if feeRecipient and sellTokenPercentageFee fields are not specified.
recipient
str
Wallet address for receiving fees. The commission is paid from the purchase token.
token
str
Address of fee token.
routes
array
An array of DEXs the transaction will be carried out through.
type
str
Liquidity source type.
protocol_name
str
DEX name the transaction will be carried out through.
percent
int
The percent of amount will be swapped on the current DEX.
Transaction allowance
GETv1/{chainID}/transaction/allowance
Checks how many of the user’s tokens the exchange smart contract has access to.
One of the input parameters for processing a transaction providing access to tokens.
gas_price
str
Gas price value for a transaction in WEI.
to
str
Address of the smart contract the transaction should be sent to.
estimate_gas
str
The estimated amount of gas that will be used during the transaction.
Get quote for pair
GETv1/quote
Returns the best exchange offer and input parameters for the transaction.
Request sample:
https://api.yetanotherdefi.com/v1/quote?fromChainID=1&toChainID=137&fromTokenAddress=0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee&toTokenAddress=0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063&takerAddress=0x47ac0fb4f2d84898e4d9e7b4dab3c24507a6d503&amount=150&slippage=10&feeRecipient=0x47ac0fb4f2d84898e4d9e7b4dab3c24507a6d503&sellTokenPercentageFee=10&rfqOnly=false&skipValidation=true
Query Parameters
Name
Type
Description
fromTokenAddress*
String
Smart contract address of the sale token.
toTokenAddress*
String
Smart contract address of the purchase token.
amount*
Integer
The amount of sale tokens in decimals of the token (can be taken from the method /tokens).
slippage*
Number
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 revert. Min = 1 (0.1%), max = 500 (50%).
Default value : 1
gasPrice
String
Gas price value for making a transaction in WEI (nAVAX for Avalanche) (1 GWEI = 1000000000 WEI), default value is the value high from /gasprices.
feeRecipient
String
Wallet address for receiving fees. The commission is paid from the purchase token.
sellTokenPercentageFee
Integer
Percentage of commission from the amount of sale tokens, is taken in favor of feeRecipient. (10 = 1%, maximum value is 500).
rfqOnly
Boolean
If TRUE: use only RFQ providers for routing.
Default value : false
excludeAggregator
String
Exclude some aggregators from routing (add several parameters for multiple exclude).
includeAggregator
String
Include some aggregators from routing (add several parameters for multiple include). This parameter cannot be combined with excludedAggregators.
fromChainID*
Integer
Source/sell blockchain ID
toChainID*
Intger
Destination/buy blockchain ID
onchainExcludeAggregator
String
Exclude some aggregators from on-chain routing (add several parameters for multiple exclude).
onchainIncludeAggregator
String
Include some aggregators from on-chain routing (add several parameters for multiple include). This parameter cannot be combined with onchainExcludeAggregators.
takerAddress*
String
The address which will fill the quote. When provided the gas will be estimated and returned.
recipientAddress
String
Percentage of commission from the amount of sell tokens, is taken in favor of feeRecipient. (10 = 1%, maximum value is 500).
The amount of purchase tokens in decimals of the token.
estimate_gas_total
str
The estimated amount of gas that will be used during the transaction.
token_in
str
Smart contract address of the sale token.
token_out
str
Smart contract address of the purchase token.
gas_price
str
Gas price value for a transaction in WEI (nAVAX for Avalanche).
bridge_fee
str
Bridge protocol fee.
fees
array
Partner's fee.
amount
str
The amount of sell tokens in decimals of the token, which will be taken in favor of feeRecipient. The value will be 0 if feeRecipient and sellTokenPercentageFee fields are not specified.
recipient
str
Wallet address for receiving fees. The commission is paid from the purchase token.
token
str
Address of fee token.
routes
array
An array of DEXs the transaction will be carried out through.
type
str
Liquidity source type.
protocol_name
str
DEX name the transaction will be carried out through.
percent
int
The percent of amount will be swapped on the current DEX.
calldata
str
One of the input parameters for processing a transaction for tokens exchange.
to
str
Smart contract address where input parameters should be sent to.
value
str
ETH value that must be transferred along with the transaction in order for it to be successful.
The number of decimals used to get its user representation. For example, if decimals equals 2, a balance of 505 tokens should be displayed to a user as 5.05 (505 / 10 ** 2).
logoURI
str
A link to the token logo.
is_active
boolean
FALSE = the token is rarely used in exchanges on DEXs.
priority
int
Recommended priority of a token to be shown to the user, based on the popularity of the token.