Integration flows
Each flow is the order in which a client calls the API for one job. Steps run top to bottom. A box's colour shows the transport — green for /info, blue for WebSocket, yellow for /exchange — and signed actions say which key signs them. See Signing for the two signing flows.
Place and track a perp order
Authorize an agent once, then let it sign. Watch the order on the stream; reconcile from history.
- POST /exchangeAccount-signed
approveAgentOnce per agent key. The account key signs it; from here on the agent signs trading actions.
Agent authorized
- POST /exchangeAgent-signed
orderAgent-signed. One action can carry a batch of orders, applied in order.
One
successfor the whole action — the oid and fills come from the stream below - Do all of these
- POST /info
userFillsExecutions for history and reconciliation. Indexed, so it can lag the stream briefly.
Trade an Outcome market
Fund the Outcome sub-account, place the order, then follow two channels on two endpoints.
A successful order response can mean queued, not matched. Subscribe to both channels in step 4, or a rejected queue entry looks like an order that never filled.
- POST /exchangeAccount-signed
tokenSendMove USDC from
perptooutcome. Account-signed; an agent cannot move funds. - POST /exchangeAgent-signed
orderais theinstrument_id;b/rencode the leg (buy NO =b: false, r: false) andpis that leg's price. TIFGtc,Gtd, orAlo—Iocis rejected.Possibly an async acceptance with a
traceId - Do all of these
- POST /info
outcomePositionsPositions only — no margin summary. Use
clearinghouseStatewithaccountType=outcomefor that.
The Outcome Integration Guide walks through the same flow with TypeScript SDK code.
Deposit USDC
Look up Bridge2, fund it one of three ways, then confirm the balance.
- Pick one of 3POST /infoAccount-signed
depositWithPermitUser has no ETH: sign an EIP-2612 permit and the API host submits it.
Withdraw funds
USDC to Arbitrum has its own action; everything else goes out through a TxRelay peg.
- Pick one of 2TxRelay
deposit-addressOther chains: request a peg address with
src_chain: "txflow", then send to it withtokenSend.
Earn builder fees
Each user approves a cap once; your orders carry the fee; you claim what accrues.
If the user has not approved you, or the fee exceeds the cap, the builder fee is silently ignored and the order still goes through.
- POST /exchangeAccount-signed
approveBuilderFeeSigned by the user’s account key, once per builder. Sets
maxFeeRate. - POST /exchangeAgent-signed
orderAdd the action-level
builderobject (baddress,ffee) besideorders.
See Builder Code for fee caps and eligibility.