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

# How It Works

> How Predexon turns raw blockchain and venue data into the fastest, most accurate prediction-market datasets.

**Concepts learning path · 3 of 3.** You know what prediction markets are and what smart money means. This page covers the machinery — how Predexon captures, indexes, and serves the data you read.

## The pipeline

Predexon runs its own indexing pipeline end to end — from our own blockchain nodes to the API response you read. Nothing is proxied from a venue's public feed, which is why the data is both faster and more complete than what the venues publish.

```mermaid theme={null}
flowchart LR
  NODES[Own nodes<br/>+ mempool access] --> IDX[Custom indexers<br/>per venue]
  VENUES[Venue APIs<br/>+ orderbook feeds] --> IDX
  IDX --> NORM[Normalization<br/>one schema across venues]
  NORM --> STORE[(Historical store<br/>billions of rows, since 2020)]
  NORM --> RT[Real-time layer]
  STORE --> REST[Data API<br/>REST]
  STORE --> TICKS[Tick history<br/>Parquet downloads]
  STORE --> ANA[Analytics<br/>P&L · smart money · leaderboards]
  RT --> WSS[WebSocket<br/>wss.predexon.com]
  ANA --> REST
```

## Stage by stage

<Steps>
  <Step title="Capture — own nodes with mempool access">
    We run our own blockchain nodes rather than paying an RPC provider. That gives us the **mempool**: pending transactions are visible before they confirm, which is how the [pending-trades channel](/websocket/pending-trades) streams fills up to **5 seconds ahead of Polymarket's RTDS**. In parallel, dedicated recorders capture every orderbook update from each venue, 24/7 — the raw stream behind [tick history](/data-signals/ticks/data-credits).
  </Step>

  <Step title="Index — custom decoders per venue">
    Each venue gets its own indexer: contract ABIs decoded, chain reorgs handled, gaps backfilled. When a protocol upgrades, we update the decoder — you never see the seam. This is the part that quietly breaks in self-built pipelines; it's our full-time job.
  </Step>

  <Step title="Normalize — one schema across venues">
    Polymarket prices are 0–1 decimals; Kalshi's are 0–100 cents. Field names, timestamps, and identifiers differ everywhere. The normalization layer maps everything into one consistent shape, so `GET /v2/kalshi/trades` reads like `GET /v2/polymarket/trades`.
  </Step>

  <Step title="Compute — analytics indexed from the chain">
    Wallet P\&L, smart-money classification, leaderboards, and cohort stats are computed from the complete on-chain history — every trade since 2020, not a sample. That's why a wallet's P\&L on Predexon matches what the chain says, block for block.
  </Step>

  <Step title="Serve — REST, WebSocket, and Parquet">
    The same underlying data reaches you three ways: [REST](/data-signals/overview) for state, [WebSocket](/websocket/overview) for change, and [bulk Parquet](/data-signals/ticks/data-credits) for the raw tick stream. Pick per use case; the shapes stay consistent.
  </Step>
</Steps>

## Why this is hard to replicate

| Property                      | Why it matters                | What it takes to build                                      |
| ----------------------------- | ----------------------------- | ----------------------------------------------------------- |
| **Mempool visibility**        | See flow before it confirms   | A co-located, self-run Polygon node and pending-tx decoding |
| **Complete tick capture**     | Replay the book at any moment | Recorders that never miss an update — a gap is permanent    |
| **Chain-accurate analytics**  | P\&L you can trust            | Full-history indexing with reorg handling since 2020        |
| **Cross-venue normalization** | One integration instead of N  | Per-venue decoders maintained as protocols evolve           |

## Data freshness & finalization

* **WebSocket** events arrive sub-second; pending-trade events arrive before on-chain confirmation.
* **REST** reads reflect indexed state within seconds of confirmation.
* **Tick history** datasets are finalized daily through the previous calendar day — finalized means gap-checked and immutable.

## Next

<CardGroup cols={2}>
  <Card title="Data & Signals overview" icon="chart-line" href="/data-signals/overview">
    Every endpoint, organized by what it's for.
  </Card>

  <Card title="Tick history & data credits" icon="wave-pulse" href="/data-signals/ticks/data-credits">
    How the raw tick datasets are priced and delivered.
  </Card>
</CardGroup>
