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

amountstring required

Source token amount.

from_addressstring nullable

Source wallet address used for the quote.

from_tokenstring required

Source token contract address or ticker symbol, such as "USDT".

metadataobject

Metadata to include with the quote response.

slippage_bpsinteger nullable

Maximum slippage tolerance in basis points.

to_addressstring nullable

Destination wallet address used for the quote.

to_tokenstring required

Destination token contract address or ticker symbol, such as "XAUT".

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

amount_instring required

Source token amount used for the quote.

amount_outstring required

Estimated destination token amount.

amount_out_minstring

Minimum destination amount after slippage.

bridge_feestring nullable

Estimated bridge fee for cross-chain swaps.

estimated_duration_secondsinteger nullable

Estimated time for the swap to complete.

fee_bpsinteger required

Whop fee in basis points.

from_addressstring nullable

Source wallet address used for the quote.

from_tokenobject required

Resolved source token details.

metadataobject required

Metadata from the request.

object'swap_quote' required
ratestring required

Quoted exchange rate.

requires_token_approvalboolean nullable

Whether the source token needs approval before swapping.

to_addressstring nullable

Destination wallet address used for the quote.

to_tokenobject required

Resolved destination token details.

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"
  }
}