https://api-v2.dex.ag/trade?from=ETH&to=DAI&fromAmount=1&dex=ag
Parameter | Description |
| The token you want to send (input) |
| The token you want to receive (output) |
| The amount of "from" token you want to send |
| The amount of "to" token you want to receive |
| Slippage - if using if using |
| Slippage - set slippage for a trade as a percentage. eg: |
| Dex's to disclude from the aggregator. Eg discluded=bancor |
| A specific DEX ( |
| 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 |
| |
| Encoded ABI data to execute trade on smart contract function |
| Exchanges contract address |
| ETH required to make a trade |
| |
| |
| This contains the For example, example, if marketImpact = 5, the trade is executing at 5% above the market price. |
| 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. |
| (provided in case of dex=best) |
| DEX containing the best price (eg Uniswap) |
| Price denoted in the "from" token (eg ETH) |
| |
| |
| Token symbol |
| Token symbol |
| Swap amount (toAmount / fromAmount) |
| Description of queried DEXes |