Trading
Live books and fills (SSE)
GET
https://www.slay.money/api/trade/streamRequires an API key: Authorization: Bearer spk_…Limit: 20 connections / min per key, 3 open
Server-Sent Events: order books for up to 10 markets on both venues (top 10 levels, at most 4 updates a second a book) and the API key's account's own fills. Events: ready (each market's coins on each venue), book, fill (its id: is the fill's time in ms), reconnect. A stream lasts about a minute, then says reconnect: EventSource reconnects on its own and sends Last-Event-ID, and fills since then are replayed, so none are missed (the same fill can come twice across a reconnect: use tradeId or txHash). Three streams at once per key. Send the key as a header; ?key= exists only for browser EventSource, which can't set headers.
Request
curl -X GET 'https://www.slay.money/api/trade/stream' \ -H 'Authorization: Bearer $SLAY_TOKEN'
Parameters
marketsstring · queryComma-separated ids from /data/markets. Without it, fills only. e.g.
q-669,q-198Last-Event-IDinteger · headerReplay fills since this time (ms, within 24 h). EventSource sends it on reconnect.
Responses
200text/event-stream.
book: { market, option, outcome, venue, coin, bids: [[price, shares]…], asks, time }. fill: { venue, coin, side, price, shares, fee, orderId, tradeId, txHash, time }.401Missing, unknown or revoked API key.
404No live market with that id.
429Too many connections, or three already open.