Estimate a swap
Get a quote for swapping one merchant asset into another. The estimate is held for **30 minutes** and is single-use — creating a swap from it consumes the quote.
Endpoint
POST /2.0/swap/estimate
Body parameters
assetIdFrom
string
yes
UUID of the source merchant asset (the asset you swap from).
assetIdTo
string
yes
UUID of the target merchant asset (the asset you receive).
amount
string
yes
Source amount in the asset’s base units (integer string, no decimal point). 100 USDT = "100000000".
cURL
curl -X POST "/2.0/swap/estimate" \
-H "Content-Type: application/json" \
-H "apiKey: <yourApiKey>" \
-d '{"assetIdFrom":"{assetIdFrom}","assetIdTo":"{assetIdTo}","amount":"{amount}"}'Response (200 OK)
{
"id": "estimage-uuid", // Estimate ID — pass this to "Create a swap"
"serviceId": "1inch", // Internal routing service identifier
"routeType": "dex", // Route type: "dex" or "cex"
"estimatedAmount": "99500000" // Estimated amount you will receive (target base units)
}The estimate is approximate. The final received amount (
amountTo) is fixed when the swap is executed and is reported via the swap object and callbacks.
Validation errors
400 Bad Request returns the standard validation envelope (see Error format). Common messages:
Asset from not found/Asset to not found— the asset UUID does not belong to your merchant.Unsupported source currency/Unsupported target currency— the currency is not enabled for swaps.Native currency not supported as target— native coins (ETH, BNB, …) cannot be the target asset.Unsupported source network/Unsupported target network— the network is not enabled for swaps.Min swap amount is <amount> <symbol>— the amount is below the minimum swap threshold.No route found— no DEX/CEX route is currently available for this pair and amount.
Last updated