GET https://codex-api.nomos.trade/v1/stream/fills
fills event per block (empty blocks included), about a second after the block: the live trade tape.
Head blocks are not final. A reorged block can come again, so deduplicate fills by
(tx, logIndex) and link blocks by parentHash. Some block numbers never arrive (a fetch that failed); the finalized routes have every fill.The Event
event
Show data
Show data
integer
The block.
string
Its hash.
string
Its parent’s hash: a mismatch with the block you hold means a reorg.
integer
Block time, unix seconds.
integer
When the block was first announced, unix ms.
integer
When Codex published it, unix ms.
string
Internal; ignore it.
object[]
Show fill
Show fill
string
Transaction hash.
integer
The log’s index in the block.
string
The order’s owner.
string
The order: one order can fill across several logs.
string
BUY or SELL, from the owner’s side.
string
The token, decimal.
number
USD a share, rounded to 6 decimals.
number
Shares.
number
Paid or received, before the fee.
string | null
Its market, when known.
integer | null
Its outcome.
integer
The wallet’s first Polymarket activity, unix seconds. Absent when unknown.
object | null
The wallet’s Polymarket profile
{ name, pseudonym, image }; null when it has none. Absent when not known in time.The Stream
retry: 2000
event: fills
data: {"block":94812431,"hash":"0x6c1f…","parentHash":"0x09ab…","ts":1790862168,"seenAt":1790862168912,"publishedAt":1790862169140,"source":"…","fills":[{"tx":"0x3f6a…7e9a","logIndex":88,"wallet":"0x56687bf447db6ffa42ffe2204a05edaa20f55839","orderHash":"0x7e30…","side":"BUY","asset":"85254962656314962064648492774584063365849461315753521676016468731069088672","price":0.241,"size":500,"usd":120.5,"conditionId":"0x8db33416a2d1ebde7438c80129e898f89a5deb3852ca64b37c4bf46513204409","outcomeIndex":0,"firstSeen":1783987320,"profile":{"name":"alpha-desk","pseudonym":"Brisk-Harbor","image":null}}]}
Read It
curl -N "https://codex-api.nomos.trade/v1/stream/fills" \
-H "Authorization: Bearer $CODEX_KEY"
import json, os, requests
with requests.get(
"https://codex-api.nomos.trade/v1/stream/fills",
headers={"Authorization": f"Bearer {os.environ['CODEX_KEY']}"},
stream=True,
timeout=(10, 60),
) as r:
r.raise_for_status()
for line in r.iter_lines(decode_unicode=True):
if line.startswith("data: "):
block = json.loads(line[6:])
for f in block["fills"]:
print(block["block"], f["side"], f["size"], f["price"], f["conditionId"])
// Node 18+
const res = await fetch("https://codex-api.nomos.trade/v1/stream/fills", {
headers: { Authorization: `Bearer ${process.env.CODEX_KEY}` },
});
const decoder = new TextDecoder();
let buffer = "";
for await (const chunk of res.body) {
buffer += decoder.decode(chunk, { stream: true });
let end;
while ((end = buffer.indexOf("\n\n")) >= 0) {
const raw = buffer.slice(0, end);
buffer = buffer.slice(end + 2);
const data = raw.match(/^data: (.*)$/m)?.[1];
if (data) for (const f of JSON.parse(data).fills) console.log(f.side, f.size, f.price, f.conditionId);
}
}
See Also
- Big-trade alerts: a complete listener with deduplication.
- Market Trades: the finalized fills, with fee, role and counterparty.