| Mode | Example | type in response |
|---|---|---|
| One-to-one | WETH → USDC | 121 |
| Many-to-one | (WETH + WBTC) → USDC | M21 |
| One-to-many | WETH → (USDT + USDC + PYUSD) | 12M |
How It Differs from Single-Token Trades
The API interface is nearly identical. The differences are: Request: Pass comma-separated token addresses and amounts instead of single values. Response: TheonchainOrderType is MultiOrder or AggregateOrder instead of SingleOrder. The API returns MultiOrder when a single maker fills the trade, or AggregateOrder when multiple makers are involved.
EIP-712 signing: MultiOrder uses flat array types (address[], uint256[]), while AggregateOrder uses nested arrays (address[][], uint256[][]) with one entry per maker.
1. Request a Multi-Token Quote
Separate multiple token addresses and amounts with commas. The order of amounts must match the order of token addresses.Many-to-one: sell USDC + DAI → buy USDT
One-to-many: sell WETH → buy USDT + USDC + PYUSD
For one-to-many, specify a singlesell_tokens / sell_amounts and comma-separated buy_tokens. Use buy_amounts instead of sell_amounts to control how much of each output token you want:
2. Understand the Response
The response structure is the same as single-token quotes, but with multiple entries insellTokens or buyTokens:
When a single maker fills the trade, the API returns MultiOrder with flat arrays:
AggregateOrder with nested arrays - one entry per maker:
MultiOrder uses singular maker_address / maker_nonce and flat token/amount arrays, while AggregateOrder uses plural maker_addresses / maker_nonces and nested arrays where each outer index corresponds to a maker.
3. Sign and Broadcast
The API returnsMultiOrder or AggregateOrder depending on whether one or multiple makers fill the trade. For self-execution, this distinction doesn’t matter - you broadcast the tx object directly. For gasless (EIP-712 signing), use the onchainOrderType from the response as your primaryType.
The API selects the order type automatically -
SingleOrder, MultiOrder, or AggregateOrder - based on the trade structure. Use the onchainOrderType from the quote response as your primaryType. See the EIP-712 order type schemas for the full type definitions.