Retrieve Delta price with fallback to Market
Get Delta Price with fallback to Market
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.
Query Parameters
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).
Query Modes Explained
The endpoint behaves differently based on the mode passed:
DELTA- will return the Delta pricing data in thedeltafield, which can then be used to build, sign and submit a Delta Order.MARKET- will return the Market pricing data in themarketfield , which is an equivalent to the successful response from/prices?version=6.2of the Velora API, which can then be used to build a swap transaction. Cross-chain orders are not supported inMARKETmode.ALL- default mode. Will return the Delta pricing data in thedeltafield. In case the Delta prices are unavailable, fallback toMARKETmode and returns the Market pricing data. Also specifies the fallback reason infallbackReasonfield. Refer here for example of usage of this mode.
Response
Fields
delta
object?
Main data structure containing details about the swap and bridge operation. Used to sign and submit a Delta order. See below for details
market
object?
Will return the Market pricing . Included when mode=MARKET, or mode=ALL and delta pricing is not available
deltaAddress
string
Address of the Delta smart contract used to execute the transaction.
delta Object
delta ObjectThis section provides information about the swap, bridging path, fees, and available bridge routes.
Core Fields
srcToken
string
ERC20 token address being sent (source token).
destToken
string
Token address being received . For cross-chain orders, this would be the token received on the source chain and sent to bridge
srcAmount
string
Amount of srcToken to be sent
destAmount
string
Final amount received after all fees. For cross-chain orders, this would be the amount received on the source chain and sent to bridge
destAmountBeforeFee
string
Destination token amount before applying fees
gasCostUSD
string
Estimated gas cost of executing the transaction, in USD.
gasCost
string
Estimated gas cost in units of gas.
srcUSD
string
USD equivalent of srcAmount.
destUSD
string
USD equivalent of destAmount after all fees.
partner
string
Partner identifier
partnerFee
number
Partner fee
bridge
Bridge?
Bridge details that should be signed within the order. Available only for cross-chain orders
bridgeInfo
BridgeInfo?
Provides metadata about the selected bridge route.
hmac
string
Hash-based message authentication code
BridgeInfo object
protocolName
string
Name of the bridge protocol (e.g., Across, CCTPStandard, StargateTaxi).
destAmountAfterBridge
string
Amount expected after bridging, in destination token units, on the destination chain
destUSDAfterBridge
string
USD value of destAmountAfterBridge.
estimatedTimeMs
number
Estimated transfer time in milliseconds.
fees
BridgeFee[]
Breakdown of fees charged by the bridge protocol. Some bridges might have no fee
BridgeFee object
feeToken
string
Token address in which the fee is charged (0xeeee... = native token).
amount
string
Fee amount in token’s smallest unit.
amountInUSD
string
Fee value in USD.
AvailableBridge object
AvailableBridge objectLists all potential bridge routes and their parameters. Each item represents one destination bridge option, containing:
destToken
string
Destination token received on the source chain
destAmount
string
Destination amount received on the source chain
destAmountBeforeFee
string
Destination amount received on the source chain before applying fees
destUSD
string
USD equivalent of destAmount.
gasCostUSD
string
Gas cost estimate in USD for the transaction
bridgeParams
BridgeParams[]
Set of configurations and objects for each protocol variant.
BridgeParams
BridgeParams bridgeInfo
BridgeInfo
Bridge metadata (same structure as above)
bridge
Bridge
Protocol configuration for that bridge (same structure as above)
Examples for Successful Responses for each mode.
{
"delta": {
"srcToken": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"destToken": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
"srcAmount": "100000000",
"destAmount": "41290907243749599",
"destAmountBeforeFee": "42763539574055205",
"gasCostUSD": "3.436417",
"gasCost": "318930",
"srcUSD": "99.99940000000001",
"destUSD": "96.3531578668",
"destUSDBeforeFee": "99.7895748668493",
"gasCostBeforeFee": "98300",
"gasCostUSDBeforeFee": "1.0591657900269833",
"partner": "paraswap.io-staging",
"partnerFee": 0,
"hmac": "7c6b4b9d3a7bfed5c29c924f84abe4bce4add7e9"
},
"deltaAddress": "0x0000000000bbf5c5fd284e657f01bd000933c96d"
}{
"delta": {
"srcToken": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"destToken": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"srcAmount": "10000000",
"destAmount": "9479298",
"destAmountBeforeFee": "10000000",
"gasCostUSD": "0.5206030000",
"gasCost": "338300",
"srcUSD": "9.9980900000",
"destUSD": "9.4774870000",
"destUSDBeforeFee": "9.9980900000",
"gasCostBeforeFee": "25000",
"gasCostUSDBeforeFee": "0.0384722157",
"partner": "anon",
"partnerFee": 0,
"bridge": {
"outputToken": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
"protocolData": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002258",
"scalingFactor": 0,
"destinationChainId": 8453,
"protocolSelector": "0x21eaa4cd"
},
"bridgeInfo": {
"protocolName": "Across",
"destAmountAfterBridge": "9474900",
"destUSDAfterBridge": "9.473090294099999",
"estimatedTimeMs": 20000,
"fees": [
{
"amount": "4396",
"feeToken": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"amountInSrcToken": "4396",
"amountInUSD": "0.004395160364"
}
]
},
"availableBridges": [
{
"destToken": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"destAmount": "9479298",
"destAmountBeforeFee": "10000000",
"destUSD": "9.4774870000",
"destUSDBeforeFee": "9.9980900000",
"gasCostUSD": "0.5206030000",
"gasCost": "338300",
"gasCostUSDBeforeFee": "0.0384722157",
"gasCostBeforeFee": "25000",
"bridgeParams": [
{
"bridgeInfo": {
"protocolName": "StargateTaxi",
"destAmountAfterBridge": "9405953",
"destUSDAfterBridge": "9.404156462977",
"estimatedTimeMs": 180828,
"fees": [
{
"feeToken": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
"amount": "14777250162456",
"amountInSrcToken": "59126",
"amountInUSD": "0.0591156504123971"
}
]
},
"bridge": {
"protocolSelector": "0x7ae1d4cb",
"destinationChainId": 8453,
"outputToken": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
"scalingFactor": 0,
"protocolData": "0x000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000075e8000000000000000000000000c026395860db2d07ee33e05fe50ed7bd583189c7000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008d644d0000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000d7098bf27180000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000001cdec000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
}
}
]
},
{
"destToken": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"destAmount": "9479298",
"destAmountBeforeFee": "10000000",
"destUSD": "9.4774870000",
"destUSDBeforeFee": "9.9980900000",
"gasCostUSD": "0.5206030000",
"gasCost": "338300",
"gasCostUSDBeforeFee": "0.0384722157",
"gasCostBeforeFee": "25000",
"bridgeParams": [
{
"bridgeInfo": {
"protocolName": "CCTPStandard",
"destAmountAfterBridge": "9476819",
"destUSDAfterBridge": "9.475008927571",
"estimatedTimeMs": 900000,
"fees": [
{
"feeToken": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
"amount": "619803340000",
"amountInUSD": "0.0025",
"amountInSrcToken": "2479"
}
]
},
"bridge": {
"protocolSelector": "0x786b64df",
"destinationChainId": 8453,
"outputToken": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
"scalingFactor": 0,
"protocolData": "0x0000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007d0"
}
},
{
"bridgeInfo": {
"protocolName": "CCTPFast",
"destAmountAfterBridge": "9475819",
"destUSDAfterBridge": "9.474009118570999",
"estimatedTimeMs": 20000,
"fees": [
{
"feeToken": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
"amount": "619803340000",
"amountInUSD": "0.0025",
"amountInSrcToken": "2479"
},
{
"feeToken": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"amount": "1000",
"amountInSrcToken": "1000",
"amountInUSD": "0.000999809"
}
]
},
"bridge": {
"protocolSelector": "0x786b64df",
"destinationChainId": 8453,
"outputToken": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
"scalingFactor": 0,
"protocolData": "0x000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000003e800000000000000000000000000000000000000000000000000000000000003e8"
}
}
]
},
{
"destToken": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"destAmount": "9479298",
"destAmountBeforeFee": "10000000",
"destUSD": "9.4774870000",
"destUSDBeforeFee": "9.9980900000",
"gasCostUSD": "0.5206030000",
"gasCost": "338300",
"gasCostUSDBeforeFee": "0.0384722157",
"gasCostBeforeFee": "25000",
"bridgeParams": [
{
"bridgeInfo": {
"protocolName": "Across",
"destAmountAfterBridge": "9474900",
"destUSDAfterBridge": "9.473090294099999",
"estimatedTimeMs": 20000,
"fees": [
{
"amount": "4396",
"feeToken": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"amountInSrcToken": "4396",
"amountInUSD": "0.004395160364"
}
]
},
"bridge": {
"outputToken": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
"protocolData": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002258",
"scalingFactor": 0,
"destinationChainId": 8453,
"protocolSelector": "0x21eaa4cd"
}
}
]
}
],
"hmac": "9079eea5889a708d7addff1658084bd508fe3798"
},
"deltaAddress": "0x76e0ebb8d4c6dccb3fdedab7a3e1c87036719a42"
}{
"fallbackReason": {
"errorType": "UnsupportedToken",
"details": "Token 0xa4bc2b90743294e5e6fd3321a9a131947f7785db is not supported"
},
"market": {
"blockNumber": 21222968,
"network": 1,
"srcToken": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"srcDecimals": 18,
"srcAmount": "1000000000000000000",
"destToken": "0xa4bc2b90743294e5e6fd3321a9a131947f7785db",
"destDecimals": 9,
"destAmount": "1106884085431",
"bestRoute": [
{
"percent": 100,
"swaps": [
{
"srcToken": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"srcDecimals": 18,
"destToken": "0xa4bc2b90743294e5e6fd3321a9a131947f7785db",
"destDecimals": 9,
"swapExchanges": [
{
"exchange": "UniswapV2",
"srcAmount": "1000000000000000000",
"destAmount": "1106884085431",
"percent": 100,
"poolAddresses": [
"0x98555273b697fA2b4CF3e009403B5ae31Fd2C7A1"
],
"data": {
"router": "0xF9234CB08edb93c0d4a4d4c70cC3FfD070e78e07",
"path": [
"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"0xa4bc2b90743294e5e6fd3321a9a131947f7785db"
],
"factory": "0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f",
"initCode": "0x96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f",
"feeFactor": 10000,
"pools": [
{
"address": "0x98555273b697fA2b4CF3e009403B5ae31Fd2C7A1",
"fee": 30,
"direction": false
}
],
"gasUSD": "5.896714"
}
}
]
}
]
}
],
"gasCostUSD": "9.771593",
"gasCost": "132570",
"side": "SELL",
"version": "6.2",
"contractAddress": "0x6a000f20005980200259b80c5102003040001068",
"tokenTransferProxy": "0x6a000f20005980200259b80c5102003040001068",
"contractMethod": "swapExactAmountInOnUniswapV2",
"partnerFee": 0,
"srcUSD": "3102.2276074900",
"destUSD": "3121.4131209154",
"partner": "paraswap.io",
"maxImpactReached": false,
"hmac": "b9c7c2ed6a47c98af2a835184a64db4a50fc2b61"
}
}{
"market": {
"blockNumber": 21222968,
"network": 1,
"srcToken": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"srcDecimals": 18,
"srcAmount": "1000000000000000000",
"destToken": "0xa4bc2b90743294e5e6fd3321a9a131947f7785db",
"destDecimals": 9,
"destAmount": "1106884085431",
"bestRoute": [
{
"percent": 100,
"swaps": [
{
"srcToken": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"srcDecimals": 18,
"destToken": "0xa4bc2b90743294e5e6fd3321a9a131947f7785db",
"destDecimals": 9,
"swapExchanges": [
{
"exchange": "UniswapV2",
"srcAmount": "1000000000000000000",
"destAmount": "1106884085431",
"percent": 100,
"poolAddresses": [
"0x98555273b697fA2b4CF3e009403B5ae31Fd2C7A1"
],
"data": {
"router": "0xF9234CB08edb93c0d4a4d4c70cC3FfD070e78e07",
"path": [
"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"0xa4bc2b90743294e5e6fd3321a9a131947f7785db"
],
"factory": "0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f",
"initCode": "0x96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f",
"feeFactor": 10000,
"pools": [
{
"address": "0x98555273b697fA2b4CF3e009403B5ae31Fd2C7A1",
"fee": 30,
"direction": false
}
],
"gasUSD": "5.896714"
}
}
]
}
]
}
],
"gasCostUSD": "9.771593",
"gasCost": "132570",
"side": "SELL",
"version": "6.2",
"contractAddress": "0x6a000f20005980200259b80c5102003040001068",
"tokenTransferProxy": "0x6a000f20005980200259b80c5102003040001068",
"contractMethod": "swapExactAmountInOnUniswapV2",
"partnerFee": 0,
"srcUSD": "3102.2276074900",
"destUSD": "3121.4131209154",
"partner": "paraswap.io",
"maxImpactReached": false,
"hmac": "b9c7c2ed6a47c98af2a835184a64db4a50fc2b61"
}
}{
"errorType": "UnsupportedToken",
"details": "Token 0xa4bc2b90743294e5e6fd3321a9a131947f7785db is not supported"
}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 Velora 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-BUYis 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