# Single-chain quote: 10 USDT to USDC on Polygon.
# Needs openssl, curl and OLYMPEX_API_KEY_ID, OLYMPEX_SECRET_KEY, OLYMPEX_PASSPHRASE.
METHOD=POST
ENDPOINT=/quotes
QUERY=''
BODY='{"mode":"single-chain","params":{"amount":"10","chainId":137,"gasPrice":"35","inTokenAddress":"0xc2132d05d31c914a87c6611c10748aeb04b58e8f","outTokenAddress":"0x3c499c542cef5e3811e1192ce70d8cc03d5c3359","slippage":"1"}}'
TS="${OLYMPEX_TIMESTAMP:-$(date +%s)}"
NONCE="${OLYMPEX_NONCE:-$(openssl rand -hex 12)}"
BODY_HASH="$(printf '%s' "$BODY" | openssl dgst -sha256 -binary | openssl base64 -A | tr '+/' '-_' | tr -d '=')"
VALUE_INFO="$(printf '%s\n%s\n%s' "$TS" "$NONCE" "$BODY_HASH")"
MESSAGE="$(printf 'OLPX-HMAC-SHA256-V2\n%s\n%s\n%s\n%s\n%s\n%s' "$TS" "$NONCE" "$METHOD" "/api/v1$ENDPOINT" "$QUERY" "$BODY_HASH")"
curl -sS -X "$METHOD" "https://api-rest.olympex.io/api/v1$ENDPOINT${QUERY:+?$QUERY}" \
-H "content-type: application/json" \
-H "x-api-key-id: $OLYMPEX_API_KEY_ID" \
-H "x-value-info: $(printf '%s' "$VALUE_INFO" | openssl base64 -A)" \
-H "x-passphrase: $OLYMPEX_PASSPHRASE" \
-H "x-signature: $(printf '%s' "$MESSAGE" | openssl dgst -sha256 -hmac "$OLYMPEX_SECRET_KEY" -binary | od -An -v -tx1 | tr -d ' \n')" \
--data-raw "$BODY"
import { olympexRequest } from "./sign-request.ts"; // /authentication/sign-requests
type QuoteData = { mode: "single-chain"; quote: { aggregatorId: string; outAmount: string } };
const data = await olympexRequest<QuoteData>("POST", "/quotes", {
mode: "single-chain",
params: {
chainId: 137,
inTokenAddress: "0xc2132d05d31c914a87c6611c10748aeb04b58e8f", // USDT
outTokenAddress: "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359", // USDC
amount: "10",
slippage: "1",
gasPrice: "35",
},
});
console.log(data.quote.aggregatorId, data.quote.outAmount);
from sign_request import olympex_request # /authentication/sign-requests
data = olympex_request("POST", "/quotes", {
"mode": "single-chain",
"params": {
"chainId": 137,
"inTokenAddress": "0xc2132d05d31c914a87c6611c10748aeb04b58e8f", # USDT
"outTokenAddress": "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359", # USDC
"amount": "10",
"slippage": "1",
"gasPrice": "35",
},
})
print(data["quote"]["aggregatorId"], data["quote"]["outAmount"])
{
"success": true,
"data": {
"mode": "single-chain",
"quote": {
"outAmount": "9979975",
"estimatedGas": "1578462",
"aggregatorId": "oneInch",
"aggregatorOrder": [
"oneInch",
"uniswapV3Hermes"
],
"market": [],
"routes": [
{
"percentage": 90.23750000000001,
"subRoutes": [
{
"from": "0xc2132d05d31c914a87c6611c10748aeb04b58e8f",
"to": "0xa3fa99a148fa48d14ed51d610c367c61876997f1",
"dexes": [
{
"name": "POLYGON_BALANCER_V2",
"percentage": 100
}
]
},
{
"from": "0xc2132d05d31c914a87c6611c10748aeb04b58e8f",
"to": "0x7ceb23fd6bc0add59e62ac25578270cff1b9f619",
"dexes": [
{
"name": "POLYGON_UNISWAP_V4",
"percentage": 100
}
]
}
]
},
{
"percentage": 9.762500000000001,
"subRoutes": [
{
"from": "0xc2132d05d31c914a87c6611c10748aeb04b58e8f",
"to": "0xa3fa99a148fa48d14ed51d610c367c61876997f1",
"dexes": [
{
"name": "POLYGON_BALANCER_V2",
"percentage": 100
}
]
},
{
"from": "0xc2132d05d31c914a87c6611c10748aeb04b58e8f",
"to": "0x7ceb23fd6bc0add59e62ac25578270cff1b9f619",
"dexes": [
{
"name": "POLYGON_UNISWAP_V4",
"percentage": 100
}
]
}
]
},
{
"percentage": 100,
"subRoutes": [
{
"from": "0xa3fa99a148fa48d14ed51d610c367c61876997f1",
"to": "0x1bfd67037b42cf73acf2047067bd4f2c47d9bfd6",
"dexes": [
{
"name": "POLYGON_QUICKSWAP_V3",
"percentage": 100
}
]
}
]
},
{
"percentage": 100,
"subRoutes": [
{
"from": "0x1bfd67037b42cf73acf2047067bd4f2c47d9bfd6",
"to": "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359",
"dexes": [
{
"name": "POLYGON_DODO_V2",
"percentage": 100
}
]
}
]
},
{
"percentage": 100,
"subRoutes": [
{
"from": "0x7ceb23fd6bc0add59e62ac25578270cff1b9f619",
"to": "0xac0f66379a6d7801d7726d5a943356a172549adb",
"dexes": [
{
"name": "POLYGON_QUICKSWAP",
"percentage": 100
}
]
}
]
},
{
"percentage": 100,
"subRoutes": [
{
"from": "0xac0f66379a6d7801d7726d5a943356a172549adb",
"to": "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359",
"dexes": [
{
"name": "POLYGON_UNISWAP_V3",
"percentage": 100
}
]
}
]
}
],
"gasMultiplier": "NONE",
"integratorFeeBreakdown": {
"protocolFeeBps": 15,
"integratorMarginBps": 0,
"protocolFeeAmount": "14969",
"integratorMarginAmount": "0"
}
}
},
"meta": {
"requestId": "EdttSh29oAMEPhw=",
"version": "v1",
"accountType": "integrator",
"apiKeyId": "00000000-0000-4000-8000-000000000000"
}
}
{
"success": true,
"data": {
"mode": "single-chain",
"quote": {
"outAmount": "9979975",
"estimatedGas": "1578462",
"aggregatorId": "oneInch",
"aggregatorOrder": [
"oneInch",
"uniswapV3Hermes"
],
"market": [],
"routes": [
{
"percentage": 90.23750000000001,
"subRoutes": [
{
"from": "0xc2132d05d31c914a87c6611c10748aeb04b58e8f",
"to": "0xa3fa99a148fa48d14ed51d610c367c61876997f1",
"dexes": [
{
"name": "POLYGON_BALANCER_V2",
"percentage": 100
}
]
},
{
"from": "0xc2132d05d31c914a87c6611c10748aeb04b58e8f",
"to": "0x7ceb23fd6bc0add59e62ac25578270cff1b9f619",
"dexes": [
{
"name": "POLYGON_UNISWAP_V4",
"percentage": 100
}
]
}
]
},
{
"percentage": 9.762500000000001,
"subRoutes": [
{
"from": "0xc2132d05d31c914a87c6611c10748aeb04b58e8f",
"to": "0xa3fa99a148fa48d14ed51d610c367c61876997f1",
"dexes": [
{
"name": "POLYGON_BALANCER_V2",
"percentage": 100
}
]
},
{
"from": "0xc2132d05d31c914a87c6611c10748aeb04b58e8f",
"to": "0x7ceb23fd6bc0add59e62ac25578270cff1b9f619",
"dexes": [
{
"name": "POLYGON_UNISWAP_V4",
"percentage": 100
}
]
}
]
},
{
"percentage": 100,
"subRoutes": [
{
"from": "0xa3fa99a148fa48d14ed51d610c367c61876997f1",
"to": "0x1bfd67037b42cf73acf2047067bd4f2c47d9bfd6",
"dexes": [
{
"name": "POLYGON_QUICKSWAP_V3",
"percentage": 100
}
]
}
]
},
{
"percentage": 100,
"subRoutes": [
{
"from": "0x1bfd67037b42cf73acf2047067bd4f2c47d9bfd6",
"to": "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359",
"dexes": [
{
"name": "POLYGON_DODO_V2",
"percentage": 100
}
]
}
]
},
{
"percentage": 100,
"subRoutes": [
{
"from": "0x7ceb23fd6bc0add59e62ac25578270cff1b9f619",
"to": "0xac0f66379a6d7801d7726d5a943356a172549adb",
"dexes": [
{
"name": "POLYGON_QUICKSWAP",
"percentage": 100
}
]
}
]
},
{
"percentage": 100,
"subRoutes": [
{
"from": "0xac0f66379a6d7801d7726d5a943356a172549adb",
"to": "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359",
"dexes": [
{
"name": "POLYGON_UNISWAP_V3",
"percentage": 100
}
]
}
]
}
],
"dataFeeTransaction": {
"effectiveGasPrice": "385800996250",
"transactionFee": "608972212142767500",
"transactionFeeInUSD": "0.074812",
"transactionFeeInToken": "0.074812",
"valueToApprove": "10.074812",
"nativePrice": "0.12285",
"tokenPrice": "1"
},
"gasMultiplier": "NONE",
"integratorFeeBreakdown": {
"protocolFeeBps": 15,
"integratorMarginBps": 0,
"protocolFeeAmount": "14969",
"integratorMarginAmount": "0"
}
}
},
"meta": {
"requestId": "EdtwKiuLoAMEPYQ=",
"version": "v1",
"accountType": "integrator",
"apiKeyId": "00000000-0000-4000-8000-000000000000"
}
}
{
"success": true,
"data": {
"mode": "single-chain",
"quote": {
"outAmount": "9954962",
"estimatedGas": "1578462",
"aggregatorId": "oneInch",
"aggregatorOrder": [
"oneInch",
"uniswapV3Hermes"
],
"market": [],
"routes": [
{
"percentage": 90.23750000000001,
"subRoutes": [
{
"from": "0xc2132d05d31c914a87c6611c10748aeb04b58e8f",
"to": "0xa3fa99a148fa48d14ed51d610c367c61876997f1",
"dexes": [
{
"name": "POLYGON_BALANCER_V2",
"percentage": 100
}
]
},
{
"from": "0xc2132d05d31c914a87c6611c10748aeb04b58e8f",
"to": "0x7ceb23fd6bc0add59e62ac25578270cff1b9f619",
"dexes": [
{
"name": "POLYGON_UNISWAP_V4",
"percentage": 100
}
]
}
]
},
{
"percentage": 9.762500000000001,
"subRoutes": [
{
"from": "0xc2132d05d31c914a87c6611c10748aeb04b58e8f",
"to": "0xa3fa99a148fa48d14ed51d610c367c61876997f1",
"dexes": [
{
"name": "POLYGON_BALANCER_V2",
"percentage": 100
}
]
},
{
"from": "0xc2132d05d31c914a87c6611c10748aeb04b58e8f",
"to": "0x7ceb23fd6bc0add59e62ac25578270cff1b9f619",
"dexes": [
{
"name": "POLYGON_UNISWAP_V4",
"percentage": 100
}
]
}
]
},
{
"percentage": 100,
"subRoutes": [
{
"from": "0xa3fa99a148fa48d14ed51d610c367c61876997f1",
"to": "0x1bfd67037b42cf73acf2047067bd4f2c47d9bfd6",
"dexes": [
{
"name": "POLYGON_QUICKSWAP_V3",
"percentage": 100
}
]
}
]
},
{
"percentage": 100,
"subRoutes": [
{
"from": "0x1bfd67037b42cf73acf2047067bd4f2c47d9bfd6",
"to": "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359",
"dexes": [
{
"name": "POLYGON_DODO_V2",
"percentage": 100
}
]
}
]
},
{
"percentage": 100,
"subRoutes": [
{
"from": "0x7ceb23fd6bc0add59e62ac25578270cff1b9f619",
"to": "0xac0f66379a6d7801d7726d5a943356a172549adb",
"dexes": [
{
"name": "POLYGON_QUICKSWAP",
"percentage": 100
}
]
}
]
},
{
"percentage": 100,
"subRoutes": [
{
"from": "0xac0f66379a6d7801d7726d5a943356a172549adb",
"to": "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359",
"dexes": [
{
"name": "POLYGON_UNISWAP_V3",
"percentage": 100
}
]
}
]
}
],
"gasMultiplier": "NONE",
"integratorFeeBreakdown": {
"protocolFeeBps": 15,
"integratorMarginBps": 25,
"protocolFeeAmount": "14932",
"integratorMarginAmount": "24887"
}
}
},
"meta": {
"requestId": "EdtzTjP3IAMEPSw=",
"version": "v1",
"accountType": "integrator",
"apiKeyId": "00000000-0000-4000-8000-000000000000"
}
}
{
"success": true,
"data": {
"mode": "cross-chain",
"quote": {
"aggregatorId": "rango",
"estimatedGas": "162807827210550000",
"estimateCostInUSD": "0.020004848960669123",
"fromTokenAmount": "10",
"toTokenAmount": "9985000",
"minimumReceived": "9885149",
"bridgeInfo": {
"icon": "https://raw.githubusercontent.com/rango-exchange/assets/main/swappers/BOB/icon.svg",
"displayName": "BOB Gateway"
},
"middlewareRoute": {
"chainFrom": [],
"chainTo": [
{
"fromAsset": {
"address": "0xc2132d05d31c914a87c6611c10748aeb04b58e8f",
"decimals": 6,
"symbol": "USDT"
},
"toAsset": {
"address": "0xdac17f958d2ee523a2206206994597c13d831ec7",
"decimals": 6,
"symbol": "USDT"
}
}
]
},
"integratorFeeBreakdown": {
"protocolFeeBps": 15,
"integratorMarginBps": 0,
"protocolFeeAmount": "15000",
"integratorMarginAmount": "0"
}
}
},
"meta": {
"requestId": "EduMjjALIAMEP4Q=",
"version": "v1",
"accountType": "integrator",
"apiKeyId": "00000000-0000-4000-8000-000000000000"
}
}
{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid request body",
"details": [
{
"field": "params.chainId",
"message": "Invalid input: expected number, received string"
},
{
"field": "params.inTokenAddress",
"message": "Must be a valid EVM address"
},
{
"field": "params.amount",
"message": "Invalid input: expected string, received number"
},
{
"field": "params.gasPrice",
"message": "Invalid input: expected string, received undefined"
}
]
},
"meta": {
"requestId": "ENUlmg3dIAMEMEw=",
"version": "v1",
"accountType": "integrator",
"apiKeyId": "00000000-0000-4000-8000-000000000000"
}
}
{
"success": false,
"error": {
"code": "NO_ROUTE",
"message": "No route found for this pair and amount. Providers may also be temporarily unavailable; retrying later can succeed.",
"details": [
{
"message": "The quote could be retrieved but the route is not available"
}
]
},
"meta": {
"requestId": "E7ef-j_MoAMEPBw=",
"version": "v1",
"accountType": "integrator",
"apiKeyId": "00000000-0000-4000-8000-000000000000"
}
}
{
"message": "Forbidden"
}
Get a quote
Get the best aggregated route for a swap on one chain or across two chains.
# Single-chain quote: 10 USDT to USDC on Polygon.
# Needs openssl, curl and OLYMPEX_API_KEY_ID, OLYMPEX_SECRET_KEY, OLYMPEX_PASSPHRASE.
METHOD=POST
ENDPOINT=/quotes
QUERY=''
BODY='{"mode":"single-chain","params":{"amount":"10","chainId":137,"gasPrice":"35","inTokenAddress":"0xc2132d05d31c914a87c6611c10748aeb04b58e8f","outTokenAddress":"0x3c499c542cef5e3811e1192ce70d8cc03d5c3359","slippage":"1"}}'
TS="${OLYMPEX_TIMESTAMP:-$(date +%s)}"
NONCE="${OLYMPEX_NONCE:-$(openssl rand -hex 12)}"
BODY_HASH="$(printf '%s' "$BODY" | openssl dgst -sha256 -binary | openssl base64 -A | tr '+/' '-_' | tr -d '=')"
VALUE_INFO="$(printf '%s\n%s\n%s' "$TS" "$NONCE" "$BODY_HASH")"
MESSAGE="$(printf 'OLPX-HMAC-SHA256-V2\n%s\n%s\n%s\n%s\n%s\n%s' "$TS" "$NONCE" "$METHOD" "/api/v1$ENDPOINT" "$QUERY" "$BODY_HASH")"
curl -sS -X "$METHOD" "https://api-rest.olympex.io/api/v1$ENDPOINT${QUERY:+?$QUERY}" \
-H "content-type: application/json" \
-H "x-api-key-id: $OLYMPEX_API_KEY_ID" \
-H "x-value-info: $(printf '%s' "$VALUE_INFO" | openssl base64 -A)" \
-H "x-passphrase: $OLYMPEX_PASSPHRASE" \
-H "x-signature: $(printf '%s' "$MESSAGE" | openssl dgst -sha256 -hmac "$OLYMPEX_SECRET_KEY" -binary | od -An -v -tx1 | tr -d ' \n')" \
--data-raw "$BODY"
import { olympexRequest } from "./sign-request.ts"; // /authentication/sign-requests
type QuoteData = { mode: "single-chain"; quote: { aggregatorId: string; outAmount: string } };
const data = await olympexRequest<QuoteData>("POST", "/quotes", {
mode: "single-chain",
params: {
chainId: 137,
inTokenAddress: "0xc2132d05d31c914a87c6611c10748aeb04b58e8f", // USDT
outTokenAddress: "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359", // USDC
amount: "10",
slippage: "1",
gasPrice: "35",
},
});
console.log(data.quote.aggregatorId, data.quote.outAmount);
from sign_request import olympex_request # /authentication/sign-requests
data = olympex_request("POST", "/quotes", {
"mode": "single-chain",
"params": {
"chainId": 137,
"inTokenAddress": "0xc2132d05d31c914a87c6611c10748aeb04b58e8f", # USDT
"outTokenAddress": "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359", # USDC
"amount": "10",
"slippage": "1",
"gasPrice": "35",
},
})
print(data["quote"]["aggregatorId"], data["quote"]["outAmount"])
{
"success": true,
"data": {
"mode": "single-chain",
"quote": {
"outAmount": "9979975",
"estimatedGas": "1578462",
"aggregatorId": "oneInch",
"aggregatorOrder": [
"oneInch",
"uniswapV3Hermes"
],
"market": [],
"routes": [
{
"percentage": 90.23750000000001,
"subRoutes": [
{
"from": "0xc2132d05d31c914a87c6611c10748aeb04b58e8f",
"to": "0xa3fa99a148fa48d14ed51d610c367c61876997f1",
"dexes": [
{
"name": "POLYGON_BALANCER_V2",
"percentage": 100
}
]
},
{
"from": "0xc2132d05d31c914a87c6611c10748aeb04b58e8f",
"to": "0x7ceb23fd6bc0add59e62ac25578270cff1b9f619",
"dexes": [
{
"name": "POLYGON_UNISWAP_V4",
"percentage": 100
}
]
}
]
},
{
"percentage": 9.762500000000001,
"subRoutes": [
{
"from": "0xc2132d05d31c914a87c6611c10748aeb04b58e8f",
"to": "0xa3fa99a148fa48d14ed51d610c367c61876997f1",
"dexes": [
{
"name": "POLYGON_BALANCER_V2",
"percentage": 100
}
]
},
{
"from": "0xc2132d05d31c914a87c6611c10748aeb04b58e8f",
"to": "0x7ceb23fd6bc0add59e62ac25578270cff1b9f619",
"dexes": [
{
"name": "POLYGON_UNISWAP_V4",
"percentage": 100
}
]
}
]
},
{
"percentage": 100,
"subRoutes": [
{
"from": "0xa3fa99a148fa48d14ed51d610c367c61876997f1",
"to": "0x1bfd67037b42cf73acf2047067bd4f2c47d9bfd6",
"dexes": [
{
"name": "POLYGON_QUICKSWAP_V3",
"percentage": 100
}
]
}
]
},
{
"percentage": 100,
"subRoutes": [
{
"from": "0x1bfd67037b42cf73acf2047067bd4f2c47d9bfd6",
"to": "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359",
"dexes": [
{
"name": "POLYGON_DODO_V2",
"percentage": 100
}
]
}
]
},
{
"percentage": 100,
"subRoutes": [
{
"from": "0x7ceb23fd6bc0add59e62ac25578270cff1b9f619",
"to": "0xac0f66379a6d7801d7726d5a943356a172549adb",
"dexes": [
{
"name": "POLYGON_QUICKSWAP",
"percentage": 100
}
]
}
]
},
{
"percentage": 100,
"subRoutes": [
{
"from": "0xac0f66379a6d7801d7726d5a943356a172549adb",
"to": "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359",
"dexes": [
{
"name": "POLYGON_UNISWAP_V3",
"percentage": 100
}
]
}
]
}
],
"gasMultiplier": "NONE",
"integratorFeeBreakdown": {
"protocolFeeBps": 15,
"integratorMarginBps": 0,
"protocolFeeAmount": "14969",
"integratorMarginAmount": "0"
}
}
},
"meta": {
"requestId": "EdttSh29oAMEPhw=",
"version": "v1",
"accountType": "integrator",
"apiKeyId": "00000000-0000-4000-8000-000000000000"
}
}
{
"success": true,
"data": {
"mode": "single-chain",
"quote": {
"outAmount": "9979975",
"estimatedGas": "1578462",
"aggregatorId": "oneInch",
"aggregatorOrder": [
"oneInch",
"uniswapV3Hermes"
],
"market": [],
"routes": [
{
"percentage": 90.23750000000001,
"subRoutes": [
{
"from": "0xc2132d05d31c914a87c6611c10748aeb04b58e8f",
"to": "0xa3fa99a148fa48d14ed51d610c367c61876997f1",
"dexes": [
{
"name": "POLYGON_BALANCER_V2",
"percentage": 100
}
]
},
{
"from": "0xc2132d05d31c914a87c6611c10748aeb04b58e8f",
"to": "0x7ceb23fd6bc0add59e62ac25578270cff1b9f619",
"dexes": [
{
"name": "POLYGON_UNISWAP_V4",
"percentage": 100
}
]
}
]
},
{
"percentage": 9.762500000000001,
"subRoutes": [
{
"from": "0xc2132d05d31c914a87c6611c10748aeb04b58e8f",
"to": "0xa3fa99a148fa48d14ed51d610c367c61876997f1",
"dexes": [
{
"name": "POLYGON_BALANCER_V2",
"percentage": 100
}
]
},
{
"from": "0xc2132d05d31c914a87c6611c10748aeb04b58e8f",
"to": "0x7ceb23fd6bc0add59e62ac25578270cff1b9f619",
"dexes": [
{
"name": "POLYGON_UNISWAP_V4",
"percentage": 100
}
]
}
]
},
{
"percentage": 100,
"subRoutes": [
{
"from": "0xa3fa99a148fa48d14ed51d610c367c61876997f1",
"to": "0x1bfd67037b42cf73acf2047067bd4f2c47d9bfd6",
"dexes": [
{
"name": "POLYGON_QUICKSWAP_V3",
"percentage": 100
}
]
}
]
},
{
"percentage": 100,
"subRoutes": [
{
"from": "0x1bfd67037b42cf73acf2047067bd4f2c47d9bfd6",
"to": "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359",
"dexes": [
{
"name": "POLYGON_DODO_V2",
"percentage": 100
}
]
}
]
},
{
"percentage": 100,
"subRoutes": [
{
"from": "0x7ceb23fd6bc0add59e62ac25578270cff1b9f619",
"to": "0xac0f66379a6d7801d7726d5a943356a172549adb",
"dexes": [
{
"name": "POLYGON_QUICKSWAP",
"percentage": 100
}
]
}
]
},
{
"percentage": 100,
"subRoutes": [
{
"from": "0xac0f66379a6d7801d7726d5a943356a172549adb",
"to": "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359",
"dexes": [
{
"name": "POLYGON_UNISWAP_V3",
"percentage": 100
}
]
}
]
}
],
"dataFeeTransaction": {
"effectiveGasPrice": "385800996250",
"transactionFee": "608972212142767500",
"transactionFeeInUSD": "0.074812",
"transactionFeeInToken": "0.074812",
"valueToApprove": "10.074812",
"nativePrice": "0.12285",
"tokenPrice": "1"
},
"gasMultiplier": "NONE",
"integratorFeeBreakdown": {
"protocolFeeBps": 15,
"integratorMarginBps": 0,
"protocolFeeAmount": "14969",
"integratorMarginAmount": "0"
}
}
},
"meta": {
"requestId": "EdtwKiuLoAMEPYQ=",
"version": "v1",
"accountType": "integrator",
"apiKeyId": "00000000-0000-4000-8000-000000000000"
}
}
{
"success": true,
"data": {
"mode": "single-chain",
"quote": {
"outAmount": "9954962",
"estimatedGas": "1578462",
"aggregatorId": "oneInch",
"aggregatorOrder": [
"oneInch",
"uniswapV3Hermes"
],
"market": [],
"routes": [
{
"percentage": 90.23750000000001,
"subRoutes": [
{
"from": "0xc2132d05d31c914a87c6611c10748aeb04b58e8f",
"to": "0xa3fa99a148fa48d14ed51d610c367c61876997f1",
"dexes": [
{
"name": "POLYGON_BALANCER_V2",
"percentage": 100
}
]
},
{
"from": "0xc2132d05d31c914a87c6611c10748aeb04b58e8f",
"to": "0x7ceb23fd6bc0add59e62ac25578270cff1b9f619",
"dexes": [
{
"name": "POLYGON_UNISWAP_V4",
"percentage": 100
}
]
}
]
},
{
"percentage": 9.762500000000001,
"subRoutes": [
{
"from": "0xc2132d05d31c914a87c6611c10748aeb04b58e8f",
"to": "0xa3fa99a148fa48d14ed51d610c367c61876997f1",
"dexes": [
{
"name": "POLYGON_BALANCER_V2",
"percentage": 100
}
]
},
{
"from": "0xc2132d05d31c914a87c6611c10748aeb04b58e8f",
"to": "0x7ceb23fd6bc0add59e62ac25578270cff1b9f619",
"dexes": [
{
"name": "POLYGON_UNISWAP_V4",
"percentage": 100
}
]
}
]
},
{
"percentage": 100,
"subRoutes": [
{
"from": "0xa3fa99a148fa48d14ed51d610c367c61876997f1",
"to": "0x1bfd67037b42cf73acf2047067bd4f2c47d9bfd6",
"dexes": [
{
"name": "POLYGON_QUICKSWAP_V3",
"percentage": 100
}
]
}
]
},
{
"percentage": 100,
"subRoutes": [
{
"from": "0x1bfd67037b42cf73acf2047067bd4f2c47d9bfd6",
"to": "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359",
"dexes": [
{
"name": "POLYGON_DODO_V2",
"percentage": 100
}
]
}
]
},
{
"percentage": 100,
"subRoutes": [
{
"from": "0x7ceb23fd6bc0add59e62ac25578270cff1b9f619",
"to": "0xac0f66379a6d7801d7726d5a943356a172549adb",
"dexes": [
{
"name": "POLYGON_QUICKSWAP",
"percentage": 100
}
]
}
]
},
{
"percentage": 100,
"subRoutes": [
{
"from": "0xac0f66379a6d7801d7726d5a943356a172549adb",
"to": "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359",
"dexes": [
{
"name": "POLYGON_UNISWAP_V3",
"percentage": 100
}
]
}
]
}
],
"gasMultiplier": "NONE",
"integratorFeeBreakdown": {
"protocolFeeBps": 15,
"integratorMarginBps": 25,
"protocolFeeAmount": "14932",
"integratorMarginAmount": "24887"
}
}
},
"meta": {
"requestId": "EdtzTjP3IAMEPSw=",
"version": "v1",
"accountType": "integrator",
"apiKeyId": "00000000-0000-4000-8000-000000000000"
}
}
{
"success": true,
"data": {
"mode": "cross-chain",
"quote": {
"aggregatorId": "rango",
"estimatedGas": "162807827210550000",
"estimateCostInUSD": "0.020004848960669123",
"fromTokenAmount": "10",
"toTokenAmount": "9985000",
"minimumReceived": "9885149",
"bridgeInfo": {
"icon": "https://raw.githubusercontent.com/rango-exchange/assets/main/swappers/BOB/icon.svg",
"displayName": "BOB Gateway"
},
"middlewareRoute": {
"chainFrom": [],
"chainTo": [
{
"fromAsset": {
"address": "0xc2132d05d31c914a87c6611c10748aeb04b58e8f",
"decimals": 6,
"symbol": "USDT"
},
"toAsset": {
"address": "0xdac17f958d2ee523a2206206994597c13d831ec7",
"decimals": 6,
"symbol": "USDT"
}
}
]
},
"integratorFeeBreakdown": {
"protocolFeeBps": 15,
"integratorMarginBps": 0,
"protocolFeeAmount": "15000",
"integratorMarginAmount": "0"
}
}
},
"meta": {
"requestId": "EduMjjALIAMEP4Q=",
"version": "v1",
"accountType": "integrator",
"apiKeyId": "00000000-0000-4000-8000-000000000000"
}
}
{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid request body",
"details": [
{
"field": "params.chainId",
"message": "Invalid input: expected number, received string"
},
{
"field": "params.inTokenAddress",
"message": "Must be a valid EVM address"
},
{
"field": "params.amount",
"message": "Invalid input: expected string, received number"
},
{
"field": "params.gasPrice",
"message": "Invalid input: expected string, received undefined"
}
]
},
"meta": {
"requestId": "ENUlmg3dIAMEMEw=",
"version": "v1",
"accountType": "integrator",
"apiKeyId": "00000000-0000-4000-8000-000000000000"
}
}
{
"success": false,
"error": {
"code": "NO_ROUTE",
"message": "No route found for this pair and amount. Providers may also be temporarily unavailable; retrying later can succeed.",
"details": [
{
"message": "The quote could be retrieved but the route is not available"
}
]
},
"meta": {
"requestId": "E7ef-j_MoAMEPBw=",
"version": "v1",
"accountType": "integrator",
"apiKeyId": "00000000-0000-4000-8000-000000000000"
}
}
{
"message": "Forbidden"
}
POST /quotes returns the best route Olympex finds across its liquidity sources for a swap on one chain (mode: "single-chain") or a transfer between two chains (mode: "cross-chain"). Pass the returned aggregatorId to POST /swap to get transaction calldata from the same liquidity source.
Units
| Field | Unit |
|---|---|
params.amount | Decimal string in human-readable units of the input token. "10" is 10 USDT. |
quote.outAmount, toTokenAmount, minimumReceived | Integer string in base units of the output token. "9979975" is 9.979975 USDC. |
quote.fromTokenAmount (cross-chain) | The input amount, echoed in human-readable units. |
params.slippage | Percent as a string. "1" is 1%. |
params.gasPrice (single-chain) | Gas price hint in whole gwei, as a string, rounded up. Some sources reject fractional gwei. On a chain whose gas price is below 1 gwei, the rounded hint is "1", higher than the chain’s gas price. The hint doesn’t set the gas price of your transaction: your wallet or signer does. |
quote.estimatedGas (single-chain) | Gas units that the source estimates for its own part of the route. It doesn’t include the Olympex contracts, so the swap uses more gas: estimate the transaction itself with eth_estimateGas. "0" means the source gave no estimate. |
dataFeeTransaction | Wei for effectiveGasPrice (the gas price the estimate used) and transactionFee, USD for the *InUSD and price fields, human-readable input-token units for transactionFeeInToken and valueToApprove. It’s based on estimatedGas, so treat the fee as a lower bound. |
Single-chain and cross-chain bodies
- Single-chain bodies use
chainId,inTokenAddressandoutTokenAddress, and requiregasPrice. The optionalincludeGasInfo,orderBy,gasMultiplierandexcludeMetaAggregatorIdapply only here. - Cross-chain bodies use
fromChainId,toChainId,inTokenAddressandoutTokenAddress, the same token fields as single-chain bodies. Unknown top-level keys are rejected with400. - Signed requests from API accounts receive cross-chain routes from
okxorrango. - Every quote carries
integratorFeeBreakdown.protocolFeeBpsis the Olympex protocol fee in basis points (15is 0.15%) and can be fractional, and it applies even when you send nofees. Addfeesto charge your own integrator fee:integratorMarginBpsthen equalsfees.feeBps. Liquidity sources can also charge their own fees inside the route: those are already reflected inoutAmountand aren’t part ofintegratorFeeBreakdown. The200 With integrator feeexample adds"fees": {"feeBps": 25, "feeRecipient": "0x1E67cb01969D79B2B895179e4A07D24a839dBb52"}to the single-chain body. See Gas and fees. "includeGasInfo": trueaddsdataFeeTransaction. For a limit order, quote the same pair and amount this way:transactionFeeInTokenestimates the execution gas cost in the token sold, which the maker’s allowance must cover on top ofamount. The estimate leaves out the Olympex contracts’ gas, so add a buffer tovalueToApprovebefore you approve it. See Order signatures and allowances.- A pair and amount that no source can route returns
422 NO_ROUTE, on single-chain and cross-chain quotes. It can be temporary: retry later with backoff, or change the amount or the pair.
slippage.Routes
On single-chain quotes,routes shows the path as the source reports it. Use it for display only:
routes[].percentageis the value the source reports. The values don’t always sum to 100, because later hops can appear as separate routes at 100.subRoutes[].fromandtoare token addresses as the source reports them. Case and the native-token address (0xeeee…or the zero address) vary by source, so compare addresses case-insensitively.
middlewareRoute can also show a native token as 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE or as the zero address, depending on the provider. Treat both as native.
# Single-chain quote: 10 USDT to USDC on Polygon.
# Needs openssl, curl and OLYMPEX_API_KEY_ID, OLYMPEX_SECRET_KEY, OLYMPEX_PASSPHRASE.
METHOD=POST
ENDPOINT=/quotes
QUERY=''
BODY='{"mode":"single-chain","params":{"amount":"10","chainId":137,"gasPrice":"35","inTokenAddress":"0xc2132d05d31c914a87c6611c10748aeb04b58e8f","outTokenAddress":"0x3c499c542cef5e3811e1192ce70d8cc03d5c3359","slippage":"1"}}'
TS="${OLYMPEX_TIMESTAMP:-$(date +%s)}"
NONCE="${OLYMPEX_NONCE:-$(openssl rand -hex 12)}"
BODY_HASH="$(printf '%s' "$BODY" | openssl dgst -sha256 -binary | openssl base64 -A | tr '+/' '-_' | tr -d '=')"
VALUE_INFO="$(printf '%s\n%s\n%s' "$TS" "$NONCE" "$BODY_HASH")"
MESSAGE="$(printf 'OLPX-HMAC-SHA256-V2\n%s\n%s\n%s\n%s\n%s\n%s' "$TS" "$NONCE" "$METHOD" "/api/v1$ENDPOINT" "$QUERY" "$BODY_HASH")"
curl -sS -X "$METHOD" "https://api-rest.olympex.io/api/v1$ENDPOINT${QUERY:+?$QUERY}" \
-H "content-type: application/json" \
-H "x-api-key-id: $OLYMPEX_API_KEY_ID" \
-H "x-value-info: $(printf '%s' "$VALUE_INFO" | openssl base64 -A)" \
-H "x-passphrase: $OLYMPEX_PASSPHRASE" \
-H "x-signature: $(printf '%s' "$MESSAGE" | openssl dgst -sha256 -hmac "$OLYMPEX_SECRET_KEY" -binary | od -An -v -tx1 | tr -d ' \n')" \
--data-raw "$BODY"
import { olympexRequest } from "./sign-request.ts"; // /authentication/sign-requests
type QuoteData = { mode: "single-chain"; quote: { aggregatorId: string; outAmount: string } };
const data = await olympexRequest<QuoteData>("POST", "/quotes", {
mode: "single-chain",
params: {
chainId: 137,
inTokenAddress: "0xc2132d05d31c914a87c6611c10748aeb04b58e8f", // USDT
outTokenAddress: "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359", // USDC
amount: "10",
slippage: "1",
gasPrice: "35",
},
});
console.log(data.quote.aggregatorId, data.quote.outAmount);
from sign_request import olympex_request # /authentication/sign-requests
data = olympex_request("POST", "/quotes", {
"mode": "single-chain",
"params": {
"chainId": 137,
"inTokenAddress": "0xc2132d05d31c914a87c6611c10748aeb04b58e8f", # USDT
"outTokenAddress": "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359", # USDC
"amount": "10",
"slippage": "1",
"gasPrice": "35",
},
})
print(data["quote"]["aggregatorId"], data["quote"]["outAmount"])
{
"success": true,
"data": {
"mode": "single-chain",
"quote": {
"outAmount": "9979975",
"estimatedGas": "1578462",
"aggregatorId": "oneInch",
"aggregatorOrder": [
"oneInch",
"uniswapV3Hermes"
],
"market": [],
"routes": [
{
"percentage": 90.23750000000001,
"subRoutes": [
{
"from": "0xc2132d05d31c914a87c6611c10748aeb04b58e8f",
"to": "0xa3fa99a148fa48d14ed51d610c367c61876997f1",
"dexes": [
{
"name": "POLYGON_BALANCER_V2",
"percentage": 100
}
]
},
{
"from": "0xc2132d05d31c914a87c6611c10748aeb04b58e8f",
"to": "0x7ceb23fd6bc0add59e62ac25578270cff1b9f619",
"dexes": [
{
"name": "POLYGON_UNISWAP_V4",
"percentage": 100
}
]
}
]
},
{
"percentage": 9.762500000000001,
"subRoutes": [
{
"from": "0xc2132d05d31c914a87c6611c10748aeb04b58e8f",
"to": "0xa3fa99a148fa48d14ed51d610c367c61876997f1",
"dexes": [
{
"name": "POLYGON_BALANCER_V2",
"percentage": 100
}
]
},
{
"from": "0xc2132d05d31c914a87c6611c10748aeb04b58e8f",
"to": "0x7ceb23fd6bc0add59e62ac25578270cff1b9f619",
"dexes": [
{
"name": "POLYGON_UNISWAP_V4",
"percentage": 100
}
]
}
]
},
{
"percentage": 100,
"subRoutes": [
{
"from": "0xa3fa99a148fa48d14ed51d610c367c61876997f1",
"to": "0x1bfd67037b42cf73acf2047067bd4f2c47d9bfd6",
"dexes": [
{
"name": "POLYGON_QUICKSWAP_V3",
"percentage": 100
}
]
}
]
},
{
"percentage": 100,
"subRoutes": [
{
"from": "0x1bfd67037b42cf73acf2047067bd4f2c47d9bfd6",
"to": "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359",
"dexes": [
{
"name": "POLYGON_DODO_V2",
"percentage": 100
}
]
}
]
},
{
"percentage": 100,
"subRoutes": [
{
"from": "0x7ceb23fd6bc0add59e62ac25578270cff1b9f619",
"to": "0xac0f66379a6d7801d7726d5a943356a172549adb",
"dexes": [
{
"name": "POLYGON_QUICKSWAP",
"percentage": 100
}
]
}
]
},
{
"percentage": 100,
"subRoutes": [
{
"from": "0xac0f66379a6d7801d7726d5a943356a172549adb",
"to": "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359",
"dexes": [
{
"name": "POLYGON_UNISWAP_V3",
"percentage": 100
}
]
}
]
}
],
"gasMultiplier": "NONE",
"integratorFeeBreakdown": {
"protocolFeeBps": 15,
"integratorMarginBps": 0,
"protocolFeeAmount": "14969",
"integratorMarginAmount": "0"
}
}
},
"meta": {
"requestId": "EdttSh29oAMEPhw=",
"version": "v1",
"accountType": "integrator",
"apiKeyId": "00000000-0000-4000-8000-000000000000"
}
}
{
"success": true,
"data": {
"mode": "single-chain",
"quote": {
"outAmount": "9979975",
"estimatedGas": "1578462",
"aggregatorId": "oneInch",
"aggregatorOrder": [
"oneInch",
"uniswapV3Hermes"
],
"market": [],
"routes": [
{
"percentage": 90.23750000000001,
"subRoutes": [
{
"from": "0xc2132d05d31c914a87c6611c10748aeb04b58e8f",
"to": "0xa3fa99a148fa48d14ed51d610c367c61876997f1",
"dexes": [
{
"name": "POLYGON_BALANCER_V2",
"percentage": 100
}
]
},
{
"from": "0xc2132d05d31c914a87c6611c10748aeb04b58e8f",
"to": "0x7ceb23fd6bc0add59e62ac25578270cff1b9f619",
"dexes": [
{
"name": "POLYGON_UNISWAP_V4",
"percentage": 100
}
]
}
]
},
{
"percentage": 9.762500000000001,
"subRoutes": [
{
"from": "0xc2132d05d31c914a87c6611c10748aeb04b58e8f",
"to": "0xa3fa99a148fa48d14ed51d610c367c61876997f1",
"dexes": [
{
"name": "POLYGON_BALANCER_V2",
"percentage": 100
}
]
},
{
"from": "0xc2132d05d31c914a87c6611c10748aeb04b58e8f",
"to": "0x7ceb23fd6bc0add59e62ac25578270cff1b9f619",
"dexes": [
{
"name": "POLYGON_UNISWAP_V4",
"percentage": 100
}
]
}
]
},
{
"percentage": 100,
"subRoutes": [
{
"from": "0xa3fa99a148fa48d14ed51d610c367c61876997f1",
"to": "0x1bfd67037b42cf73acf2047067bd4f2c47d9bfd6",
"dexes": [
{
"name": "POLYGON_QUICKSWAP_V3",
"percentage": 100
}
]
}
]
},
{
"percentage": 100,
"subRoutes": [
{
"from": "0x1bfd67037b42cf73acf2047067bd4f2c47d9bfd6",
"to": "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359",
"dexes": [
{
"name": "POLYGON_DODO_V2",
"percentage": 100
}
]
}
]
},
{
"percentage": 100,
"subRoutes": [
{
"from": "0x7ceb23fd6bc0add59e62ac25578270cff1b9f619",
"to": "0xac0f66379a6d7801d7726d5a943356a172549adb",
"dexes": [
{
"name": "POLYGON_QUICKSWAP",
"percentage": 100
}
]
}
]
},
{
"percentage": 100,
"subRoutes": [
{
"from": "0xac0f66379a6d7801d7726d5a943356a172549adb",
"to": "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359",
"dexes": [
{
"name": "POLYGON_UNISWAP_V3",
"percentage": 100
}
]
}
]
}
],
"dataFeeTransaction": {
"effectiveGasPrice": "385800996250",
"transactionFee": "608972212142767500",
"transactionFeeInUSD": "0.074812",
"transactionFeeInToken": "0.074812",
"valueToApprove": "10.074812",
"nativePrice": "0.12285",
"tokenPrice": "1"
},
"gasMultiplier": "NONE",
"integratorFeeBreakdown": {
"protocolFeeBps": 15,
"integratorMarginBps": 0,
"protocolFeeAmount": "14969",
"integratorMarginAmount": "0"
}
}
},
"meta": {
"requestId": "EdtwKiuLoAMEPYQ=",
"version": "v1",
"accountType": "integrator",
"apiKeyId": "00000000-0000-4000-8000-000000000000"
}
}
{
"success": true,
"data": {
"mode": "single-chain",
"quote": {
"outAmount": "9954962",
"estimatedGas": "1578462",
"aggregatorId": "oneInch",
"aggregatorOrder": [
"oneInch",
"uniswapV3Hermes"
],
"market": [],
"routes": [
{
"percentage": 90.23750000000001,
"subRoutes": [
{
"from": "0xc2132d05d31c914a87c6611c10748aeb04b58e8f",
"to": "0xa3fa99a148fa48d14ed51d610c367c61876997f1",
"dexes": [
{
"name": "POLYGON_BALANCER_V2",
"percentage": 100
}
]
},
{
"from": "0xc2132d05d31c914a87c6611c10748aeb04b58e8f",
"to": "0x7ceb23fd6bc0add59e62ac25578270cff1b9f619",
"dexes": [
{
"name": "POLYGON_UNISWAP_V4",
"percentage": 100
}
]
}
]
},
{
"percentage": 9.762500000000001,
"subRoutes": [
{
"from": "0xc2132d05d31c914a87c6611c10748aeb04b58e8f",
"to": "0xa3fa99a148fa48d14ed51d610c367c61876997f1",
"dexes": [
{
"name": "POLYGON_BALANCER_V2",
"percentage": 100
}
]
},
{
"from": "0xc2132d05d31c914a87c6611c10748aeb04b58e8f",
"to": "0x7ceb23fd6bc0add59e62ac25578270cff1b9f619",
"dexes": [
{
"name": "POLYGON_UNISWAP_V4",
"percentage": 100
}
]
}
]
},
{
"percentage": 100,
"subRoutes": [
{
"from": "0xa3fa99a148fa48d14ed51d610c367c61876997f1",
"to": "0x1bfd67037b42cf73acf2047067bd4f2c47d9bfd6",
"dexes": [
{
"name": "POLYGON_QUICKSWAP_V3",
"percentage": 100
}
]
}
]
},
{
"percentage": 100,
"subRoutes": [
{
"from": "0x1bfd67037b42cf73acf2047067bd4f2c47d9bfd6",
"to": "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359",
"dexes": [
{
"name": "POLYGON_DODO_V2",
"percentage": 100
}
]
}
]
},
{
"percentage": 100,
"subRoutes": [
{
"from": "0x7ceb23fd6bc0add59e62ac25578270cff1b9f619",
"to": "0xac0f66379a6d7801d7726d5a943356a172549adb",
"dexes": [
{
"name": "POLYGON_QUICKSWAP",
"percentage": 100
}
]
}
]
},
{
"percentage": 100,
"subRoutes": [
{
"from": "0xac0f66379a6d7801d7726d5a943356a172549adb",
"to": "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359",
"dexes": [
{
"name": "POLYGON_UNISWAP_V3",
"percentage": 100
}
]
}
]
}
],
"gasMultiplier": "NONE",
"integratorFeeBreakdown": {
"protocolFeeBps": 15,
"integratorMarginBps": 25,
"protocolFeeAmount": "14932",
"integratorMarginAmount": "24887"
}
}
},
"meta": {
"requestId": "EdtzTjP3IAMEPSw=",
"version": "v1",
"accountType": "integrator",
"apiKeyId": "00000000-0000-4000-8000-000000000000"
}
}
{
"success": true,
"data": {
"mode": "cross-chain",
"quote": {
"aggregatorId": "rango",
"estimatedGas": "162807827210550000",
"estimateCostInUSD": "0.020004848960669123",
"fromTokenAmount": "10",
"toTokenAmount": "9985000",
"minimumReceived": "9885149",
"bridgeInfo": {
"icon": "https://raw.githubusercontent.com/rango-exchange/assets/main/swappers/BOB/icon.svg",
"displayName": "BOB Gateway"
},
"middlewareRoute": {
"chainFrom": [],
"chainTo": [
{
"fromAsset": {
"address": "0xc2132d05d31c914a87c6611c10748aeb04b58e8f",
"decimals": 6,
"symbol": "USDT"
},
"toAsset": {
"address": "0xdac17f958d2ee523a2206206994597c13d831ec7",
"decimals": 6,
"symbol": "USDT"
}
}
]
},
"integratorFeeBreakdown": {
"protocolFeeBps": 15,
"integratorMarginBps": 0,
"protocolFeeAmount": "15000",
"integratorMarginAmount": "0"
}
}
},
"meta": {
"requestId": "EduMjjALIAMEP4Q=",
"version": "v1",
"accountType": "integrator",
"apiKeyId": "00000000-0000-4000-8000-000000000000"
}
}
{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid request body",
"details": [
{
"field": "params.chainId",
"message": "Invalid input: expected number, received string"
},
{
"field": "params.inTokenAddress",
"message": "Must be a valid EVM address"
},
{
"field": "params.amount",
"message": "Invalid input: expected string, received number"
},
{
"field": "params.gasPrice",
"message": "Invalid input: expected string, received undefined"
}
]
},
"meta": {
"requestId": "ENUlmg3dIAMEMEw=",
"version": "v1",
"accountType": "integrator",
"apiKeyId": "00000000-0000-4000-8000-000000000000"
}
}
{
"success": false,
"error": {
"code": "NO_ROUTE",
"message": "No route found for this pair and amount. Providers may also be temporarily unavailable; retrying later can succeed.",
"details": [
{
"message": "The quote could be retrieved but the route is not available"
}
]
},
"meta": {
"requestId": "E7ef-j_MoAMEPBw=",
"version": "v1",
"accountType": "integrator",
"apiKeyId": "00000000-0000-4000-8000-000000000000"
}
}
{
"message": "Forbidden"
}
Authorizations
Your API key ID (UUID). See Sign requests.
Base64 of timestamp + "\n" + nonce + "\n" + bodyHash, where timestamp is Unix seconds, nonce is 24 new hexadecimal characters and bodyHash is the unpadded base64url SHA-256 of the canonical body.
Your account passphrase. Treat it like the secret key.
Lowercase hex HMAC-SHA256 (signature v2), keyed with your secret key string (UTF-8, not decoded), of seven lines joined with \n, with no trailing newline: OLPX-HMAC-SHA256-V2, timestamp, nonce, the uppercase method, path, canonicalQuery and bodyHash. path is the request path including /api/v1, without the query string, for example /api/v1/limit-order/<id>. canonicalQuery is the query parameters decoded (+ is a space), sorted by key and then by value, re-encoded per RFC 3986 and joined with &, or the empty string when there is no query. Headers signed for one request are rejected on any other. See Sign requests.
Body
Was this page helpful?
