Retrieve Delta price with fallback to Market
Last updated
Last updated
GET
https://api.paraswap.io/quote
When implementing this endpoint, you can enable API to fallback to market prices if the Delta pricing is not available. If the quote obtained comes from Market pricing data, you’ll get the learn more about the cause in the fallback reason parameter.
srcToken*
string
Source Token Address.
srcDecimals*
integer
Source Token Decimals.
destToken*
string
Destination Token Address. For cross-chain quote - destination token on the destination chain. Supported destination tokens for cross-chain can be obtained from /bridge-info
endpoint
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*
number
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
.
MARKET
mode is not supported for cross-chain orders
destChainId
number
Destination chain ID for cross-chain quote. (Mainnet - 1, Optimism - 10, BSC - 56, Polygon - 137, Fantom - 250, zkEVM - 1101, Base - 8453, Arbitrum - 42161, Avalanche - 43114, Gnosis - 100).
The endpoint behaves differently based on the mode
passed:
DELTA
- will return the Delta pricing data in the delta
field, which can then be used to build, sign and submit a Delta Order.
Examples for Successful Responses for each mode
.
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 Velora Support using the chat in the bottom right corner of this page.
ValidationError
- validation for params failed
UnsupportedChain
- 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.
MARKET
- will return the Market pricing data in the market
field , which is an equivalent to the successful response from /prices?version=6.2
of the Velora API, which can then be used to . Cross-chain orders are not supported in MARKET
mode.
ALL
- default mode. Will return the Delta pricing data in the delta
field. In case the Delta prices are unavailable, fallback to MARKET
mode and returns the Market pricing data. Also specifies the fallback reason in fallbackReason
field. Refer for example of usage of this mode.