Skip to main content
POST
/
swaps
/
quote
Create Swap Quote
curl --request POST \
  --url https://{defaultHost}/swaps/quote \
  --header 'Content-Type: application/json' \
  --data '
{
  "amount": "<string>",
  "from_token": "<string>",
  "to_token": "<string>",
  "from_chain": "<string>",
  "to_chain": "<string>",
  "from_address": "<string>",
  "to_address": "<string>",
  "slippage_bps": 123,
  "metadata": {}
}
'
{
  "object": "swap_quote",
  "amount_in": "<string>",
  "amount_out": "<string>",
  "rate": "<string>",
  "fee_bps": 123,
  "from_token": {},
  "to_token": {},
  "metadata": {},
  "amount_out_min": "<string>",
  "bridge_fee": "<string>",
  "estimated_duration_seconds": 123,
  "requires_token_approval": true,
  "from_address": "<string>",
  "to_address": "<string>"
}

Body

application/json
amount
string
required

Source token amount.

from_token
string
required

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

to_token
string
required

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

from_chain

Source chain name or chain ID. Defaults to the source token's chain when omitted.

to_chain

Destination chain name or chain ID. Defaults to the destination token's chain when omitted.

from_address
string | null

Source wallet address used for the quote.

to_address
string | null

Destination wallet address used for the quote.

slippage_bps
integer | null

Maximum slippage tolerance in basis points.

metadata
object

Metadata to include with the quote response.

Response

swap quote created

object
enum<string>
required
Available options:
swap_quote
amount_in
string
required

Source token amount used for the quote.

amount_out
string
required

Estimated destination token amount.

rate
string
required

Quoted exchange rate.

fee_bps
integer
required

Whop fee in basis points.

from_token
object
required

Resolved source token details.

to_token
object
required

Resolved destination token details.

metadata
object
required

Metadata from the request.

amount_out_min
string

Minimum destination amount after slippage.

bridge_fee
string | null

Estimated bridge fee for cross-chain swaps.

estimated_duration_seconds
integer | null

Estimated time for the swap to complete.

requires_token_approval
boolean | null

Whether the source token needs approval before swapping.

from_address
string | null

Source wallet address used for the quote.

to_address
string | null

Destination wallet address used for the quote.