Skip to main content
This flow is not live yet. The shapes on this page are the contract we are building to; field names can still change before it opens. Today, a key trades on-chain from organisation wallets granted to it, which TetraFi signs for (Choose wallets and accounts).
Name your wallet’s address in the quote request, sign the step each on-chain quote carries, and send it with your order. You pay your own gas; TetraFi never holds a key or a signing grant for the wallet.

At a glance

A trade takes two calls (quote, order) when the venue already has your token allowance, and three on a token’s first trade: an approval, then the trade. You need a key with venue trading, and no organisation-wallet grant. The wallet need not be registered first, unless your workspace lets keys trade only from wallets it approved (SIGNING_WALLET_NOT_ALLOWED): then get the address approved before you order.

Trade from your wallet

The full walk-through, with cast and viem: Move stablecoins from your own wallet.
1

Quote with your address

Send your wallet’s address for its network in source.tradingWallets, and fix sellAmount. Exchange and OTC venues quote as usual.
2

Sign the step

Sign the quote’s signing.firstStep (the step object).
3

Order with it

POST /api/v1/orders with firstStep, an Idempotency-Key, and minReceive when the quote reads minReceiveRequired: true.
4

Sign any later step

While next.kind is sign, submit next.step, then follow the order until terminal is true (Order status).

The step object

Each on-chain quote is firm for your address and carries the first step to sign in signing.firstStep; later steps arrive as the order’s next.step.
Output shape on each on-chain quote (shortened)
Sign transaction on the chain of the step’s network (eip155:8453 is chain 8453), keeping its nonce; gas and fees are yours to set. Every venue at opening uses transaction steps; typedData, an EIP-712 message, comes with later venues.
type is transaction or typedData; purpose is approval, trade, revoke, acceptance or funding. Both lists can grow: do not sign a type you do not know, and keep following the order.
signing.mode is you for an address TetraFi cannot sign for, and tetrafi for an organisation wallet granted to your key. Send source.signer: "you" to sign yourself for a wallet TetraFi could sign. The list of modes can grow.
The address is screened before anything is relayed. Your first checked signature proves the wallet is yours: it then appears in Treasury as an external wallet, and an Owner can remove it. The output goes back to the signing wallet; delivery to another wallet of your workspace comes later.
Uniswap, Across, Relay, Circle CCTP and Multiliquid on EVM networks, for a quote with sellAmount: with buyAmount these venues read unavailable (exactOutputDeliveryUnsupported). Other venues read unavailable (clientSignedVenueUnsupported). More venues, Solana and Tron follow as new step types.

Submit a step

Step 1 goes in the order body as firstStep, with its stepId. A later step goes to POST /api/v1/orders/{orderId}/steps/{stepId} with a new Idempotency-Key; the body is the submission itself, without quoteId or firstStep: {"kind":"signedTransaction","raw":"0x02f9…"}. The answer is the order once its next has moved past the step, or after at most 15 seconds.
Order request with step 1

How it ends

If your wallet’s nonce, allowance or balance changed between the quote and the order, or the minReceive you send changes the trade’s transaction, nothing is relayed: the order opens and next carries a fresh first step to sign.

Step refusals

TetraFi relayed nothing for the submission it refused. Earlier steps may already be on-chain, as may a transaction you broadcast yourself: read the order and its step hashes before you retry.

What comes next

Planned, and not available yet:
  • People approve one trade: signing.mode owners (your wallet’s owners approve the trade) and custodian (your custodian’s own approvers do). The order’s next.kind is then approve, with an approvalUrl where they approve it: the same pattern wallet creation uses.
  • Solana and Tron, as new step type values.
  • Bebop and StableFX from your own wallet. StableFX takes two signed messages and its quote lasts about 4 seconds, so only an automated signer keeps up.
  • Custody wallets that TetraFi signs for, as signing.mode tetrafi.
Build for them now: ignore a signing.mode, step type, purpose, submission kind or next.kind you do not know, never sign a step type you do not know, and keep following the order until terminal is true.

Next

Choose wallets and accounts

Every source a quote can trade from.

Order status

Follow the order to the end.

Recipe: move stablecoins from your own wallet

An approval, then a bridge deposit, signed with a local key.

How a trade runs

Every way a trade is funded, signed and settled.