Create Swap Instructions
Headers
Request
Base-58 encoded taker wallet address.
Input token mint, base-58 encoded. Use So11111111111111111111111111111111111111111 for native SOL.
Output token mint, base-58 encoded. Use So11111111111111111111111111111111111111111 for native SOL.
DEX sources to exclude from routing. Valid source names are returned by /enabled-sources.
Base-58 encoded recipient for swap output. If output token is native SOL this must be the address of the recipient, else a valid token account for that output token mint.
Comma-separated volume-based swap fees in parts per million.
Must be provided together with swap_fee_recipient.
Each entry must be between 0 and the per-app maximum (100_000 unless configured otherwise).
A value of 0 disables that fee entry.
Multiple fees on the same side are applied sequentially, each on the amount remaining after prior deductions — not the original amount. Fee amounts are rounded up to the nearest base unit.
Comma-separated base-58 encoded recipients for the swap fees.
Must be provided together with swap_fee_ppm.
The number of entries must match swap_fee_ppm.
If the respective token for swap_fee_side is native SOL this must be an address, else a valid token account for that token mint.
Comma-separated fee sides for each fee entry.
Supported values are buy and sell.
This field may be omitted only when every fee uses the default buy side.
When provided, the number of entries must match swap_fee_ppm.
Trade surplus cap in parts per million of the total realized trade size.
Must be provided together with trade_surplus_recipient, or both fields must be omitted.
A value of 0 disables trade surplus collection for the request.
When 0x controls trade surplus collection, the request value is ignored and the configured 0x policy is applied instead.
The transferred amount is capped relative to trade size.
Base-58 encoded recipient that should receive trade surplus.
Must be provided together with trade_surplus_cap_ppm, or both fields must be omitted.
If the output token is native SOL this must be an address, else a valid token account for that token mint.
When 0x controls trade surplus collection, the request value is ignored and the configured 0x recipient is used instead.
Response
Unique 12-byte hex identifier for this request.