DEX.AG
Search…
Trade
Get trade details for a given trading pair and amount
/trade
1
https://api-v2.dex.ag/trade?from=ETH&to=DAI&fromAmount=1&dex=ag
Copied!
Parameter
Description
from
The token you want to send (input)
to
The token you want to receive (output)
fromAmount (optional*)
The amount of "from" token you want to send
toAmount (optional*)
The amount of "to" token you want to receive
limitAmount (optional**)
Slippage - if using fromAmountThe limit of "to" token to receive to still execute the trade
if using toAmount the limit of "from" token to send to still execute the trade
slippage (optional**)
Slippage - set slippage for a trade as a percentage. eg: slippage=0.1 will set a slippage rate of 0.1%
discluded
Dex's to disclude from the aggregator. Eg discluded=bancor
dex
A specific DEX (Uniswap), ag (aggregator)
proxy (optional)
Address of the proxy contract
*Note: either fromAmount or toAmount must be specified.
**Note: if setting slippage, either limitAmount or slippage must be specified.
Response: order details containing the DEX, price, and encoded ABI to pass into the web3 browser to execute via sdk.tradeOrder().
Value
Description
trade
data
Encoded ABI data to execute trade on smart contract function
to
Exchanges contract address
value
ETH required to make a trade
metadata
marketImpact
This contains the marketImpact of a trade which represents how the price for the current trade is compared to the current market price for this trade, expressed as a percentage.
For example, example, if marketImpact = 5, the trade is executing at 5% above the market price.
gasPrice
Max allowed gas price for exchanges with a gas price cap, e.g. Bancor. Note: This is NOT the suggested gas price, it's the maximum that the exchange in question will allow.
source
(provided in case of dex=best)
dex
DEX containing the best price (eg Uniswap)
price
Price denoted in the "from" token (eg ETH)
query
from
Token symbol
to
Token symbol
toAmount
Swap amount (toAmount / fromAmount)
dex
Description of queried DEXes
Last modified 1yr ago
Copy link