Skip to main content
POST
JavaScript

Headers

Idempotency-Key
string

A unique key that makes this request safe to retry. See Idempotent requests.

Maximum string length: 255
Example:

"d9105228-4a08-46b1-8b91-42fed586d383"

Body

application/json
amount
string
required

Source token amount.

Example:

"100"

from_token
string
required

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

Example:

"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

to_token
string
required

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

Example:

"0x1b64b9025eebb9a6239575df9ea4b9ac46d4d193"

from_address
string | null

Source wallet address used for the quote.

Example:

"0x6f1c0a3d5b2e4f8a9c7d1e0b3a5f7c9d2e4b6a80"

from_chain

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

Example:

"plasma"

metadata
object

Metadata to include with the quote response.

Example:
slippage_bps
integer | null

Maximum slippage tolerance in basis points.

Example:

50

to_address
string | null

Destination wallet address used for the quote.

Example:

"0x9d2e4b6a806f1c0a3d5b2e4f8a9c7d1e0b3a5f7c"

to_chain

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

Example:

"plasma"

Response

swap quote created

amount_in
string
required

Source token amount used for the quote.

Example:

"100"

amount_out
string
required

Estimated destination token amount.

Example:

"0.15"

fee_bps
integer
required

Whop fee in basis points.

Example:

100

from_token
object
required

Resolved source token details.

Example:
metadata
object
required

Metadata from the request.

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

"swap_quote"

rate
string
required

Quoted exchange rate.

Example:

"1.5"

to_token
object
required

Resolved destination token details.

Example:
amount_out_min
string

Minimum destination amount after slippage.

Example:

"0.148"

bridge_fee
string | null

Estimated bridge fee for cross-chain swaps.

Example:

"0.25"

estimated_duration_seconds
integer | null

Estimated time for the swap to complete.

Example:

30

from_address
string | null

Source wallet address used for the quote.

Example:

"0x6f1c0a3d5b2e4f8a9c7d1e0b3a5f7c9d2e4b6a80"

requires_token_approval
boolean | null

Whether the source token needs approval before swapping.

Example:

true

to_address
string | null

Destination wallet address used for the quote.

Example:

"0x9d2e4b6a806f1c0a3d5b2e4f8a9c7d1e0b3a5f7c"