> ## Documentation Index
> Fetch the complete documentation index at: https://dash-docs.nomos.trade/llms.txt
> Use this file to discover all available pages before exploring further.

# Live Tape

> Server-Sent Events: every fill at the chain head, one event per block, about a second after the block.

```
GET https://codex-api.nomos.trade/v1/stream/fills
```

Every fill at the chain head, one `fills` event per block (empty blocks included), about a second after the block: the live trade tape.

<Warning>
  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.
</Warning>

Only the V2 exchanges are on the tape (no V1, no combos). Fee, role and counterparty are on [Market Trades](/api-reference/markets/market-trades). A heartbeat comment arrives every 15 s; at most 2 streams per key.

## The Event

<ResponseField name="fills" type="event">
  <Expandable title="data">
    <ResponseField name="block" type="integer">The block.</ResponseField>
    <ResponseField name="hash" type="string">Its hash.</ResponseField>
    <ResponseField name="parentHash" type="string">Its parent's hash: a mismatch with the block you hold means a reorg.</ResponseField>
    <ResponseField name="ts" type="integer">Block time, unix seconds.</ResponseField>
    <ResponseField name="seenAt" type="integer">When the block was first announced, unix ms.</ResponseField>
    <ResponseField name="publishedAt" type="integer">When Codex published it, unix ms.</ResponseField>
    <ResponseField name="source" type="string">Internal; ignore it.</ResponseField>

    <ResponseField name="fills" type="object[]">
      <Expandable title="fill">
        <ResponseField name="tx" type="string">Transaction hash.</ResponseField>
        <ResponseField name="logIndex" type="integer">The log's index in the block.</ResponseField>
        <ResponseField name="wallet" type="string">The order's owner.</ResponseField>
        <ResponseField name="orderHash" type="string">The order: one order can fill across several logs.</ResponseField>
        <ResponseField name="side" type="string">BUY or SELL, from the owner's side.</ResponseField>
        <ResponseField name="asset" type="string">The token, decimal.</ResponseField>
        <ResponseField name="price" type="number">USD a share, rounded to 6 decimals.</ResponseField>
        <ResponseField name="size" type="number">Shares.</ResponseField>
        <ResponseField name="usd" type="number">Paid or received, before the fee.</ResponseField>
        <ResponseField name="conditionId" type="string | null">Its market, when known.</ResponseField>
        <ResponseField name="outcomeIndex" type="integer | null">Its outcome.</ResponseField>
        <ResponseField name="firstSeen" type="integer">The wallet's first Polymarket activity, unix seconds. Absent when unknown.</ResponseField>
        <ResponseField name="profile" type="object | null">The wallet's Polymarket profile `{ name, pseudonym, image }`; null when it has none. Absent when not known in time.</ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

## The Stream

```text theme={null}
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

<CodeGroup>
  ```bash cURL theme={null}
  curl -N "https://codex-api.nomos.trade/v1/stream/fills" \
    -H "Authorization: Bearer $CODEX_KEY"
  ```

  ```python Python theme={null}
  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"])
  ```

  ```javascript JavaScript theme={null}
  // 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);
    }
  }
  ```
</CodeGroup>

## See Also

* [Big-trade alerts](/recipes/big-trades): a complete listener with deduplication.
* [Market Trades](/api-reference/markets/market-trades): the finalized fills, with fee, role and counterparty.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.