Skip to main content

Overview

POST /v1/swap returns a SwapPlan:
  • a fresh derived quote
  • an ordered list of instructions[] to execute on-chain
The Trading API produces instructions only. It does not sign or broadcast transactions.

Request parameters

The request includes:
  • chainId, tokenIn, tokenOut
  • tradeType (EXACT_IN or EXACT_OUT)
  • amount (smallest units as a string)
  • slippageBps (basis points)
Optional fields may include:
  • recipient: where swap outputs should be sent (if applicable)
  • deadline: a time-bound constraint for execution

Understanding the response

SwapPlan.instructions[] is an ordered list of EVM calls. Each instruction includes:
  • to: contract address to call (typically a router)
  • data: calldata hex
  • value: wei to send (as a string)
  • constraints: execution constraints such as notAfter and maxSlippageBps
In many same-chain swaps, instructions[] contains exactly one item. Future upgrades may return multiple instructions (for example, approval + swap).

Who executes?

  • Direct integration (core): you call the Trading API and receive instructions[]. You sign and broadcast using your own wallet infrastructure.
  • Client Node (coming soon): you call your self-hosted Client Node with executionMode=execute. It fetches the swap plan from the Trading API, then signs and broadcasts locally, returning execution receipts (such as txHash).
See Architecture and workflows for the end-to-end diagrams.

Example

Next steps

  • Orchestrate a multi-step payout: Payments