Skip to main content
TetraFi handles three trade shapes, each settling atomically in a single order: Many-to-one and one-to-many shapes shine when you’re rebalancing a portfolio, consolidating stablecoin balances, or fanning one asset out into several - without running a separate swap (and paying separate overhead) for each leg.

What Changes vs a Single-Token Trade

The API surface barely moves. The differences: Request: list several entries in intent.inputs[] or intent.outputs[] instead of one each. Response: the order payload widens to cover every leg. When one LP fills everything, you get a single-counterparty order; when several LPs each take a slice, the payload becomes a split fill with one entry per counterparty. Signing: unchanged - preflight hands you the complete typed envelope for whatever shape came back, and you sign it verbatim. One signature covers every leg.

1. Quote a Multi-Token Intent

List each leg as its own entry. Amounts pair with their own entry, so decimals stay unambiguous.

Many-to-one: sell USDC + DAI → buy USDT

One-to-many: sell WETH → buy USDC + DAI + USDT

Flip the shape: a single input, several outputs. Use ExactOutput when you want to pin how much of each output token arrives:

2. Read the Multi-Leg Response

The response looks like any other quote list, with preview widened to every leg: When a single LP covers the whole intent, the preview pairs your inputs against its combined delivery:
When several LPs split the fill, the quote is a split-fill order - each counterparty commits to its slice, but you still see one combined preview and sign once:
The structural takeaway: single-LP orders carry one counterparty commitment; split fills carry one per LP - but from your side the contract is identical: the escrow enforces the combined minimum delivery, atomically, or refunds every leg.

3. Preflight, Sign, Settle

Shape makes no difference to your code. Preflight the quote you picked, sign the typed data it returns, submit - the same three calls as a one-to-one trade:
The order payload’s shape - single counterparty or split fill - is chosen by the platform from how LPs answered your intent. You never select it: sign whatever preflight returns. The Order Submission guide breaks down what the envelope always binds.