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).
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, withcast 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 insigning.firstStep; later steps arrive as the order’s next.step.
Output shape on each on-chain quote (shortened)
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.
What a step can be
What a step can be
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.Who signs
Who signs
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.Your wallet in TetraFi
Your wallet in TetraFi
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.
Venues and networks at opening
Venues and networks at opening
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 asfirstStep, 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
Submission kinds: signedTransaction, transactionHash, signature, declined
Submission kinds: signedTransaction, transactionHash, signature, declined
How it ends
If your wallet’s nonce, allowance or balance changed between the quote and the order, or theminReceive you send changes the trade’s transaction, nothing is relayed: the order opens and next carries a fresh first step to sign.
Endings: unsigned, reverted, nonce used
Endings: unsigned, reverted, nonce used
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.Every step refusal
Every step refusal
What comes next
Planned signing modes, step types and venues
Planned signing modes, step types and venues
Planned, and not available yet:
- People approve one trade:
signing.modeowners(your wallet’s owners approve the trade) andcustodian(your custodian’s own approvers do). The order’snext.kindis thenapprove, with anapprovalUrlwhere they approve it: the same pattern wallet creation uses. - Solana and Tron, as new step
typevalues. - 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.modetetrafi.
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.