latestOpenAPI 3.1.02026-08-153864115.7 MB
c301132dbfd7
Swaps
Create Swap Quote
Previews the price of a swap. Fiat pairs quote the in-ledger mid-market conversion — the same rate creating the swap fills at. No funds move and nothing is saved.
post/swaps/quote
Headers
Idempotency-Keystring
Example:d9105228-4a08-46b1-8b91-42fed586d383
A unique key that makes this request safe to retry. See Idempotent requests.
Request body
Example request
{
"amount": "100",
"from_address": "0x6f1c0a3d5b2e4f8a9c7d1e0b3a5f7c9d2e4b6a80",
"from_chain": "plasma",
"from_token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"metadata": {
"external_id": "shop_4417"
},
"slippage_bps": 50,
"to_address": "0x9d2e4b6a806f1c0a3d5b2e4f8a9c7d1e0b3a5f7c",
"to_chain": "plasma",
"to_token": "0x1b64b9025eebb9a6239575df9ea4b9ac46d4d193"
}Response
swap quote created
Example response
{
"amount_in": "100",
"amount_out": "0.15",
"amount_out_min": "0.148",
"bridge_fee": "0.25",
"estimated_duration_seconds": 30,
"fee_bps": 100,
"from_address": "0x6f1c0a3d5b2e4f8a9c7d1e0b3a5f7c9d2e4b6a80",
"from_token": {
"address": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"chain_id": 9745,
"decimals": 6,
"network": "plasma",
"symbol": "USDT"
},
"metadata": {
"external_id": "shop_4417"
},
"object": "swap_quote",
"rate": "1.5",
"requires_token_approval": true,
"to_address": "0x9d2e4b6a806f1c0a3d5b2e4f8a9c7d1e0b3a5f7c",
"to_token": {
"address": "0x1b64b9025eebb9a6239575df9ea4b9ac46d4d193",
"chain_id": 9745,
"decimals": 6,
"network": "plasma",
"symbol": "XAUT"
}
}