Retrieve Delta price with fallback to Market
This endpoint is also available in Paraswap SDK. You can find example usage here.
Get Delta Price with fallback to Market
GET
https://api.paraswap.io/quote
This endpoint gets the Delta price and with ability to fallback to market prices.
Query Parameters
srcToken*
string
Source Token Address.
srcDecimals*
integer
Source Token Decimals.
destToken*
string
Destination Token Address.
destDecimals*
integer
Destination Token Decimals.
amount*
string
srcToken amount (in case of SELL) or destToken amount (in case of BUY). The amount should be in WEI/Raw units (eg. 1WBTC -> 100000000)
side
SELL
| BUY
Default: SELL
.
chainId*
string
Chain ID. (Mainnet - 1, Optimism - 10, BSC - 56, Polygon - 137, Fantom - 250, zkEVM - 1101, Base - 8453, Arbitrum - 42161, Avalanche - 43114, Gnosis - 100).
userAddress
string
User's Wallet Address.
partner
string
Partner string.
mode
ALL
| DELTA
| MARKET
Preferred mode for the trade. In case of "all", Delta pricing is returned, with Market as a fallback.
Default: ALL
.
Query Modes Explained
The endpoint behaves differently based on the mode
passed:
DELTA
- will return the Delta pricing data in thedelta
field, which can then be used to build, sign and submit a Delta Order.MARKET
- will return the Market pricing data in themarket
field , which is an equivalent to the successful response from/prices?version=6.2
of the Paraswap API, which can then be used to build a swap transaction.ALL
- default mode. Will return the Delta pricing data in thedelta
field. In case the Delta prices are unavailable, fallback toMARKET
mode and returns the Market pricing data. Also specifies the fallback reason infallbackReason
field. Refer here for example of usage of this mode.
Examples for Successful Responses for each mode
.
Most common fallback reasons and error types
The following is a list of the most common error messages and fallback reasons of the /delta/quote
endpoint. Most are self-explanatory and can be self-solved, but feel free to contact ParaSwap Support using the chat in the bottom right corner of this page.
ValidationError
- validation for params failedUnsupportedChain
- the chain ID is not supported by Delta.UnsupportedToken
- the token is not supported by Delta.SourceEth
- Native chain token cannot be used as source token in Delta.UnsupportedSide
-BUY
is not supported by Delta yet.PricingError
- internal oracle failed to provide a price.GasCostExceedsTradeAmount
- estimated value paid for gas is bigger than trade amount.
Last updated