market channel for public auction state, the
account channel for private order and fill events, or both. Authentication
uses a short-lived, single-use JWT ticket you create immediately before opening
the socket.
Prerequisites
Before you begin, ensure that you’ve:- Obtained a Circle API key with Match access
- Completed onboarding as a burn-side or mint-side participant (or both)
Steps
Step 1. Create a connection ticket
CallPOST /v1/match/ws/ticket to get a single-use JWT. The ticket is
short-lived, so create it immediately before you open the socket.
Each ticket is single-use and authenticates exactly one WebSocket connection.
Do not reuse a ticket after it has been used to open a connection.
Step 2. Open the connection
Pass the following twoSec-WebSocket-Protocol values in the upgrade request:
circle-match.v1: identifies the protocol versionticket.<jwt>: your ticket value, prefixed withticket.
$TICKET with the ticket value from the previous step.
Step 3. Handle the hello frame and subscribe
The server sends ahello frame immediately after the connection is
established:
hello, send a subscribe message for each channel you want to
receive events from. To subscribe to both channels, send two messages:
subscribed frame:
keepalive frames with a serverTime field to
confirm the connection is healthy.
If a subscription request is invalid or authorization fails, the server sends an
error frame with a channel and error field.
Receive events
Session frames
Market channel events (public)
Any valid ticket holder can subscribe to themarket channel. On subscribe, the
server delivers a snapshot of the current auction state, then streams
incremental events as the auction progresses.
Key fields present on market events:
phase: current auction phase (open,locked,settling)indicativeFeeBps: the fee that would clear if the auction settled nowmatchableSizeCents: volume that would match at the indicative feenetImbalanceCents: difference between burn-side and mint-side volume
Account channel events (private)
Theaccount channel delivers per-entity events for your own orders and fills.
On subscribe, the server delivers an account_snapshot with your current open
orders and balance.
Key fields on
account_cleared:
fills: array of per-order fill breakdowns, each withfilledAmount,unfilledAmount,clearingFeeBps, andmatchedAtforwardOrders: array of orders rolled into the next auctionfeesRebatedCents: signed integer; positive means a mint-side rebate, negative means a burn-side fee paid
Step 4. Handle reconnection
If the connection drops, follow these steps to restore your subscription:- Create a new ticket using
POST /v1/match/ws/ticket. The previous ticket is consumed or expired and cannot be reused. - Open a new socket using the new ticket as described in the preceding “Open the connection” and “Handle the hello frame and subscribe” sections.
- Re-send
subscribemessages for all channels you want to receive. - The server delivers a fresh
snapshot(market) oraccount_snapshot(account) for each channel.
The server does not replay events missed during a disconnection. If your
connection dropped while an auction was clearing and you missed the
account_cleared event, call GET /v1/match/orders to reconcile any fills
that occurred while you were offline.