Skip to main content
POST
Produce swap instruction (calldata) for client execution
This endpoint returns swap instructions (calldata + constraints) for you to execute. For execution options, see Swap.

Authorizations

Authorization
string
header
required

Basic Auth (assumed at gateway for MVP)

Body

application/json
chainId
integer<uint64>
required
Example:

1

tokenIn
string
required
Pattern: ^0x[a-fA-F0-9]{40}$
Example:

"0x742d35Cc6634C0532925a3b844Bc9e7595f5fE4b"

tokenOut
string
required
Pattern: ^0x[a-fA-F0-9]{40}$
Example:

"0x742d35Cc6634C0532925a3b844Bc9e7595f5fE4b"

tradeType
enum<string>
required
Available options:
EXACT_IN,
EXACT_OUT
amount
string
required

Amount (smallest units as string). Interpretation depends on tradeType.

Example:

"1000000"

slippageBps
integer
default:50
required
Required range: 0 <= x <= 5000
recipient
string

Recipient address for swap outputs (when applicable)

Pattern: ^0x[a-fA-F0-9]{40}$
Example:

"0x742d35Cc6634C0532925a3b844Bc9e7595f5fE4b"

deadline
string<date-time>

Response

Swap plan

quote
object
required
instructions
object[]

Ordered list of on-chain instructions required to complete the plan.

Notes:

  • For same-chain swaps, this will usually contain exactly 1 instruction.
  • Future upgrades (e.g. approvals, multi-call routers, cross-chain) can return 2+ items.