sdk.getPrice({to: '', from: '', toAmount: 1, dex: ''})
Value | Description |
| The token you want to receive (Output) |
| The token you want to send (Input) |
| The amount of "to" token you want to receive |
| The amount of "from" token you want to receive |
| Dex's to disclude from the aggregator. Eg discluded=bancor |
| Specify a DEX instead of searching for the best price ag (aggregator), uniswap, or all (even external sources) |
Example: Get the price for 1 DAI with ETH from all exchanges:
sdk.getPrice({to: 'DAI', from: 'ETH', toAmount: 1, dex: 'all'})
Example: Get the price from Aggregator for 1 DAI with ETH:
sdk.getPrice({to: 'DAI', from: 'ETH', toAmount: 1, dex: 'ag'})
Response: the price for a single DEX or a list of prices.
Value | Description |
| Price denoted in the "from" token (e.g. ETH) |
| DEX providing the price (e.g. uniswap, ag) |
| |
| Base token of the trading pair |
| Quote token of the trading pair |