# Single-chain swap calldata: 10 USDT to USDC on Polygon, routed through the quote's aggregatorId.
# Needs openssl, curl and OLYMPEX_API_KEY_ID, OLYMPEX_SECRET_KEY, OLYMPEX_PASSPHRASE.
METHOD=POST
ENDPOINT=/swap
QUERY=''
BODY='{"mode":"single-chain","params":{"account":"0x1E67cb01969D79B2B895179e4A07D24a839dBb52","aggregatorId":"oneInch","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; aggregatorOrder: string[] | null; outAmount: string } };
type SwapData = {
mode: "single-chain";
swap: { to: string; data: string; value: string; contractToApprove: string; outAmount: string; minOutAmount: string };
};
const params = {
chainId: 137,
inTokenAddress: "0xc2132d05d31c914a87c6611c10748aeb04b58e8f", // USDT
outTokenAddress: "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359", // USDC
amount: "10",
slippage: "1",
gasPrice: "35",
};
const { quote } = await olympexRequest<QuoteData>("POST", "/quotes", { mode: "single-chain", params });
const { swap } = await olympexRequest<SwapData>("POST", "/swap", {
mode: "single-chain",
params: { ...params, account: "0x1E67cb01969D79B2B895179e4A07D24a839dBb52", aggregatorId: quote.aggregatorId },
});
// Next: approve swap.contractToApprove for exactly 10 USDT, then run eth_estimateGas and send from `account` right away.
// If the estimate reverts, build again with the next aggregatorId in quote.aggregatorOrder.
const transaction = { to: swap.to, data: swap.data, value: BigInt(swap.value) };
console.log(transaction, swap.contractToApprove, swap.minOutAmount);
from sign_request import olympex_request # /authentication/sign-requests
params = {
"chainId": 137,
"inTokenAddress": "0xc2132d05d31c914a87c6611c10748aeb04b58e8f", # USDT
"outTokenAddress": "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359", # USDC
"amount": "10",
"slippage": "1",
"gasPrice": "35",
}
quote = olympex_request("POST", "/quotes", {"mode": "single-chain", "params": params})["quote"]
swap = olympex_request("POST", "/swap", {
"mode": "single-chain",
"params": {**params, "account": "0x1E67cb01969D79B2B895179e4A07D24a839dBb52", "aggregatorId": quote["aggregatorId"]},
})["swap"]
# Next: approve swap["contractToApprove"] for exactly 10 USDT, then run eth_estimateGas and send from `account` right away.
# If the estimate reverts, build again with the next aggregatorId in quote["aggregatorOrder"].
transaction = {"to": swap["to"], "data": swap["data"], "value": int(swap["value"])}
print(transaction, swap["contractToApprove"], swap["minOutAmount"])
{
"success": true,
"data": {
"mode": "single-chain",
"swap": {
"to": "0xA91e13e8BfEbbC57ea008bfb2dE94AdD3F484E68",
"gasLimit": "3000000",
"contractToApprove": "0xa754451D6d32aB624111e5120409a474D29C2364",
"data": "0x8ad0a76c0000000000000000000000000000000000000000000000000000000000000020…0000000000000000",
"minOutAmount": "9891061",
"outAmount": "9991223",
"value": "0",
"estimatedGas": "1500000"
}
},
"meta": {
"requestId": "Edt_pjJloAMEVjg=",
"version": "v1",
"accountType": "integrator",
"apiKeyId": "00000000-0000-4000-8000-000000000000"
}
}
{
"success": true,
"data": {
"mode": "cross-chain",
"swap": {
"to": "0xA91e13e8BfEbbC57ea008bfb2dE94AdD3F484E68",
"gasLimit": "323438069024099968",
"calldata": "0x0044fcef0000000000000000000000000000000000000000000000000000000000000020…0000000000000000",
"value": "0",
"estimatedGas": "161719034512049984",
"contractToApprove": "0x9f770bC130f57C2D1C7Bf9bb4965Ab7c79AdE22E",
"dexHash": "0x2676e2ee99986d45baa8242aea50a63a90b996df49a22e8975ba756b3706279f"
}
},
"meta": {
"requestId": "EduNEjxWIAMEZew=",
"version": "v1",
"accountType": "integrator",
"apiKeyId": "00000000-0000-4000-8000-000000000000"
}
}
{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid request body",
"details": [
{
"field": "params.account",
"message": "Invalid input: expected string, received undefined"
},
{
"field": "params.aggregatorId",
"message": "Invalid input: expected string, received undefined"
}
]
},
"meta": {
"requestId": "ENJ8rjAeoAMEbpQ=",
"version": "v1",
"accountType": "integrator",
"apiKeyId": "00000000-0000-4000-8000-000000000000"
}
}
{
"message": "Forbidden"
}
{
"success": false,
"error": {
"code": "SWAP_ERROR",
"message": "Error fetching single-chain swap",
"details": [
{
"message": "Request failed with status code 400"
}
]
},
"meta": {
"requestId": "E7egOiScoAMEZWw=",
"version": "v1",
"accountType": "integrator",
"apiKeyId": "00000000-0000-4000-8000-000000000000"
}
}
Build a swap
Get unsigned transaction calldata for a quoted route, on one chain or across two chains.
# Single-chain swap calldata: 10 USDT to USDC on Polygon, routed through the quote's aggregatorId.
# Needs openssl, curl and OLYMPEX_API_KEY_ID, OLYMPEX_SECRET_KEY, OLYMPEX_PASSPHRASE.
METHOD=POST
ENDPOINT=/swap
QUERY=''
BODY='{"mode":"single-chain","params":{"account":"0x1E67cb01969D79B2B895179e4A07D24a839dBb52","aggregatorId":"oneInch","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; aggregatorOrder: string[] | null; outAmount: string } };
type SwapData = {
mode: "single-chain";
swap: { to: string; data: string; value: string; contractToApprove: string; outAmount: string; minOutAmount: string };
};
const params = {
chainId: 137,
inTokenAddress: "0xc2132d05d31c914a87c6611c10748aeb04b58e8f", // USDT
outTokenAddress: "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359", // USDC
amount: "10",
slippage: "1",
gasPrice: "35",
};
const { quote } = await olympexRequest<QuoteData>("POST", "/quotes", { mode: "single-chain", params });
const { swap } = await olympexRequest<SwapData>("POST", "/swap", {
mode: "single-chain",
params: { ...params, account: "0x1E67cb01969D79B2B895179e4A07D24a839dBb52", aggregatorId: quote.aggregatorId },
});
// Next: approve swap.contractToApprove for exactly 10 USDT, then run eth_estimateGas and send from `account` right away.
// If the estimate reverts, build again with the next aggregatorId in quote.aggregatorOrder.
const transaction = { to: swap.to, data: swap.data, value: BigInt(swap.value) };
console.log(transaction, swap.contractToApprove, swap.minOutAmount);
from sign_request import olympex_request # /authentication/sign-requests
params = {
"chainId": 137,
"inTokenAddress": "0xc2132d05d31c914a87c6611c10748aeb04b58e8f", # USDT
"outTokenAddress": "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359", # USDC
"amount": "10",
"slippage": "1",
"gasPrice": "35",
}
quote = olympex_request("POST", "/quotes", {"mode": "single-chain", "params": params})["quote"]
swap = olympex_request("POST", "/swap", {
"mode": "single-chain",
"params": {**params, "account": "0x1E67cb01969D79B2B895179e4A07D24a839dBb52", "aggregatorId": quote["aggregatorId"]},
})["swap"]
# Next: approve swap["contractToApprove"] for exactly 10 USDT, then run eth_estimateGas and send from `account` right away.
# If the estimate reverts, build again with the next aggregatorId in quote["aggregatorOrder"].
transaction = {"to": swap["to"], "data": swap["data"], "value": int(swap["value"])}
print(transaction, swap["contractToApprove"], swap["minOutAmount"])
{
"success": true,
"data": {
"mode": "single-chain",
"swap": {
"to": "0xA91e13e8BfEbbC57ea008bfb2dE94AdD3F484E68",
"gasLimit": "3000000",
"contractToApprove": "0xa754451D6d32aB624111e5120409a474D29C2364",
"data": "0x8ad0a76c0000000000000000000000000000000000000000000000000000000000000020…0000000000000000",
"minOutAmount": "9891061",
"outAmount": "9991223",
"value": "0",
"estimatedGas": "1500000"
}
},
"meta": {
"requestId": "Edt_pjJloAMEVjg=",
"version": "v1",
"accountType": "integrator",
"apiKeyId": "00000000-0000-4000-8000-000000000000"
}
}
{
"success": true,
"data": {
"mode": "cross-chain",
"swap": {
"to": "0xA91e13e8BfEbbC57ea008bfb2dE94AdD3F484E68",
"gasLimit": "323438069024099968",
"calldata": "0x0044fcef0000000000000000000000000000000000000000000000000000000000000020…0000000000000000",
"value": "0",
"estimatedGas": "161719034512049984",
"contractToApprove": "0x9f770bC130f57C2D1C7Bf9bb4965Ab7c79AdE22E",
"dexHash": "0x2676e2ee99986d45baa8242aea50a63a90b996df49a22e8975ba756b3706279f"
}
},
"meta": {
"requestId": "EduNEjxWIAMEZew=",
"version": "v1",
"accountType": "integrator",
"apiKeyId": "00000000-0000-4000-8000-000000000000"
}
}
{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid request body",
"details": [
{
"field": "params.account",
"message": "Invalid input: expected string, received undefined"
},
{
"field": "params.aggregatorId",
"message": "Invalid input: expected string, received undefined"
}
]
},
"meta": {
"requestId": "ENJ8rjAeoAMEbpQ=",
"version": "v1",
"accountType": "integrator",
"apiKeyId": "00000000-0000-4000-8000-000000000000"
}
}
{
"message": "Forbidden"
}
{
"success": false,
"error": {
"code": "SWAP_ERROR",
"message": "Error fetching single-chain swap",
"details": [
{
"message": "Request failed with status code 400"
}
]
},
"meta": {
"requestId": "E7egOiScoAMEZWw=",
"version": "v1",
"accountType": "integrator",
"apiKeyId": "00000000-0000-4000-8000-000000000000"
}
}
POST /swap returns unsigned transaction calldata for a route: a swap on one chain (mode: "single-chain") or a transfer between two chains (mode: "cross-chain"). Olympex never signs or broadcasts your transaction. You approve the input token when needed, then send the transaction from account with your own signer. Get a quote from POST /quotes first and pass its aggregatorId here.
account moves that wallet’s funds, and there is no testnet or sandbox. Start with small amounts.Request body
The swap takes the same trade as the quote, plus the wallet and the route:| Purpose | Single-chain swap | Cross-chain swap | Cross-chain quote, for comparison |
|---|---|---|---|
| Chains | chainId (integer) | fromChainId, toChainId (integers) | fromChainId, toChainId |
| Token you sell | inTokenAddress | inTokenAddress | inTokenAddress |
| Token you receive | outTokenAddress | outTokenAddress | outTokenAddress |
| Size and protection | amount, slippage | amount, slippage | amount, slippage |
| Gas price hint | gasPrice (whole gwei, rounded up) | Not sent | Not sent |
| Wallet | account | account | Not sent |
| Route | aggregatorId | aggregatorId | Returned as quote.aggregatorId |
aggregatorIdis the valuePOST /quotesreturned for the same pair and amount. Cross-chain swaps from signed API accounts can useokxorrango. On single-chain quotes,quote.aggregatorOrderlists every source that quoted, best first: if the swap fails with422 NO_ROUTEor500 SWAP_ERROR, oreth_estimateGasof its calldata reverts, build it again with the next one.accountis the wallet that sends the transaction and receives the output (on the destination chain, for cross-chain). The calldata is bound to it.- Keep the quote’s inputs. Send the same
amount,slippage,gasPrice(single-chain) and, if you used it,feesobject.amountstays human-readable:"10"is 10 USDT. See Gas and fees forfees. dryRunis accepted on single-chain bodies for compatibility and has no effect, because this endpoint never broadcasts. Cross-chain bodies reject it with400, like any other unknown top-level key.
Response fields
| Field | Mode | Meaning |
|---|---|---|
to | Both | The Olympex aggregator contract on the chain you send from. The transaction’s to. |
data | Single-chain | Transaction calldata. |
calldata | Cross-chain | Transaction calldata. Same role as data, different name. |
value | Both | Native token to send with the transaction, in wei. "0" for ERC-20 input. |
contractToApprove | Both | The ERC-20 spender for this swap. Approve this address, not to: they can differ. It isn’t the order contract that limit orders and DCA use. |
outAmount | Single-chain | Expected output, in base units of the output token. "9991223" is 9.991223 USDC. |
minOutAmount | Single-chain | Minimum output after slippage, in base units. The transaction reverts below it. |
dexHash | Cross-chain | Identifies the provider. Store it with the transaction hash for POST /tx-status. |
gasLimit, estimatedGas | Both | Unreliable. See Estimate gas yourself. |
outAmount and minOutAmount from this response, not from the quote.
Estimate gas yourself
gasLimit is estimatedGas × 2, and estimatedGas is unreliable: it’s "1500000" as a placeholder when the source gives no estimate, it can be "0", and on cross-chain routes it can be a wei amount rather than gas units (on okx routes, the gas price). A source’s estimate also covers only its own part of the route, not the Olympex contracts, so the transaction uses more gas than the quote’s estimatedGas. Estimate gas for the exact transaction with eth_estimateGas (from: account, to, data or calldata, value) and add a buffer, for example 20%. Use gasLimit only as a fallback, and never when it’s "0". Gas and fees has more on both estimates.
Check that the calldata executes
A200 means Olympex built calldata for the route, not that the transaction succeeds: a source can return calldata that reverts. Always run eth_estimateGas on the exact transaction before you send it, and treat a revert as a failed build:
- Rule out your side first. Check the allowance to
contractToApprove, the balance ofaccountand the calldata’s expiry. - Fall back to another route. If those are fine, the route can’t execute. For a single-chain swap, build it again with the next
aggregatorIdin the quote’saggregatorOrder. For a cross-chain swap, request a new quote and build with itsaggregatorId. Show the user the newoutAmountandminOutAmountbefore they sign. - Send right after you build. Some routes include a market maker’s firm quote (an RFQ leg) whose price expires within seconds of the build. If the estimate or the transaction reverts because that quote expired, build the swap again and send it at once.
Execute the transaction
Approve the exact amount (ERC-20 input only)
allowance(account, contractToApprove) on the input token. If it’s below amount in base units, send approve(contractToApprove, amount) for exactly that amount, never an unlimited one, and wait for it to confirm. Some tokens, such as USDT, require you to set the allowance to 0 before you change it: do that first. Native-token input needs no approval.Estimate gas
eth_estimateGas from account with to, data (or calldata) and value, then add your buffer. Estimation usually fails until the approval confirms. If it still reverts once the approval has confirmed, don’t send: fall back to another route.Send right away
{to, data | calldata, value, gas} from account as soon as you have the estimate. If the approval took a while to confirm, call POST /swap again before you send.Track the result
GET /transactions/{hash} with the chain ID until status is success or reverted, or read the receipt from your RPC. For a cross-chain transfer, then poll POST /tx-status with the source transaction hash, the source chain ID and dexHash.account: another Olympex swap from the same account can invalidate calldata you built earlier. Call POST /swap right before the user signs, not when you first show the quote, and send at once.200 examples shorten the calldata with …: a real response carries the full hex string. The cross-chain 200 example goes from 10 USDT on Polygon to USDT on Ethereum through rango. Its gasLimit, "323438069024099968", is derived from a wei amount, not a number of gas units: estimate gas yourself.
# Single-chain swap calldata: 10 USDT to USDC on Polygon, routed through the quote's aggregatorId.
# Needs openssl, curl and OLYMPEX_API_KEY_ID, OLYMPEX_SECRET_KEY, OLYMPEX_PASSPHRASE.
METHOD=POST
ENDPOINT=/swap
QUERY=''
BODY='{"mode":"single-chain","params":{"account":"0x1E67cb01969D79B2B895179e4A07D24a839dBb52","aggregatorId":"oneInch","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; aggregatorOrder: string[] | null; outAmount: string } };
type SwapData = {
mode: "single-chain";
swap: { to: string; data: string; value: string; contractToApprove: string; outAmount: string; minOutAmount: string };
};
const params = {
chainId: 137,
inTokenAddress: "0xc2132d05d31c914a87c6611c10748aeb04b58e8f", // USDT
outTokenAddress: "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359", // USDC
amount: "10",
slippage: "1",
gasPrice: "35",
};
const { quote } = await olympexRequest<QuoteData>("POST", "/quotes", { mode: "single-chain", params });
const { swap } = await olympexRequest<SwapData>("POST", "/swap", {
mode: "single-chain",
params: { ...params, account: "0x1E67cb01969D79B2B895179e4A07D24a839dBb52", aggregatorId: quote.aggregatorId },
});
// Next: approve swap.contractToApprove for exactly 10 USDT, then run eth_estimateGas and send from `account` right away.
// If the estimate reverts, build again with the next aggregatorId in quote.aggregatorOrder.
const transaction = { to: swap.to, data: swap.data, value: BigInt(swap.value) };
console.log(transaction, swap.contractToApprove, swap.minOutAmount);
from sign_request import olympex_request # /authentication/sign-requests
params = {
"chainId": 137,
"inTokenAddress": "0xc2132d05d31c914a87c6611c10748aeb04b58e8f", # USDT
"outTokenAddress": "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359", # USDC
"amount": "10",
"slippage": "1",
"gasPrice": "35",
}
quote = olympex_request("POST", "/quotes", {"mode": "single-chain", "params": params})["quote"]
swap = olympex_request("POST", "/swap", {
"mode": "single-chain",
"params": {**params, "account": "0x1E67cb01969D79B2B895179e4A07D24a839dBb52", "aggregatorId": quote["aggregatorId"]},
})["swap"]
# Next: approve swap["contractToApprove"] for exactly 10 USDT, then run eth_estimateGas and send from `account` right away.
# If the estimate reverts, build again with the next aggregatorId in quote["aggregatorOrder"].
transaction = {"to": swap["to"], "data": swap["data"], "value": int(swap["value"])}
print(transaction, swap["contractToApprove"], swap["minOutAmount"])
{
"success": true,
"data": {
"mode": "single-chain",
"swap": {
"to": "0xA91e13e8BfEbbC57ea008bfb2dE94AdD3F484E68",
"gasLimit": "3000000",
"contractToApprove": "0xa754451D6d32aB624111e5120409a474D29C2364",
"data": "0x8ad0a76c0000000000000000000000000000000000000000000000000000000000000020…0000000000000000",
"minOutAmount": "9891061",
"outAmount": "9991223",
"value": "0",
"estimatedGas": "1500000"
}
},
"meta": {
"requestId": "Edt_pjJloAMEVjg=",
"version": "v1",
"accountType": "integrator",
"apiKeyId": "00000000-0000-4000-8000-000000000000"
}
}
{
"success": true,
"data": {
"mode": "cross-chain",
"swap": {
"to": "0xA91e13e8BfEbbC57ea008bfb2dE94AdD3F484E68",
"gasLimit": "323438069024099968",
"calldata": "0x0044fcef0000000000000000000000000000000000000000000000000000000000000020…0000000000000000",
"value": "0",
"estimatedGas": "161719034512049984",
"contractToApprove": "0x9f770bC130f57C2D1C7Bf9bb4965Ab7c79AdE22E",
"dexHash": "0x2676e2ee99986d45baa8242aea50a63a90b996df49a22e8975ba756b3706279f"
}
},
"meta": {
"requestId": "EduNEjxWIAMEZew=",
"version": "v1",
"accountType": "integrator",
"apiKeyId": "00000000-0000-4000-8000-000000000000"
}
}
{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid request body",
"details": [
{
"field": "params.account",
"message": "Invalid input: expected string, received undefined"
},
{
"field": "params.aggregatorId",
"message": "Invalid input: expected string, received undefined"
}
]
},
"meta": {
"requestId": "ENJ8rjAeoAMEbpQ=",
"version": "v1",
"accountType": "integrator",
"apiKeyId": "00000000-0000-4000-8000-000000000000"
}
}
{
"message": "Forbidden"
}
{
"success": false,
"error": {
"code": "SWAP_ERROR",
"message": "Error fetching single-chain swap",
"details": [
{
"message": "Request failed with status code 400"
}
]
},
"meta": {
"requestId": "E7egOiScoAMEZWw=",
"version": "v1",
"accountType": "integrator",
"apiKeyId": "00000000-0000-4000-8000-000000000000"
}
}
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
- Single-chain
- Cross-chain
single-chain Show child attributes
Show child attributes
Accepted for compatibility and ignored: POST /swap never broadcasts, whatever the value.
Your integrator fee. It appears in integratorFeeBreakdown.integratorMarginBps and integratorMarginAmount.
Show child attributes
Show child attributes
Was this page helpful?
