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

# Database

> Logical PostgreSQL model and canonical projection design.

The migration set currently contains versions 1 through 11.

| Entity                         | Purpose                                                         |
| ------------------------------ | --------------------------------------------------------------- |
| `chain_blocks`                 | Block hashes, parents, timestamps, canonical flag               |
| `chain_events`                 | Raw decoded log provenance and canonical flag                   |
| `indexer_checkpoints`          | Durable progress per chain/indexer                              |
| `tokens`                       | Launch identity and finalized presentation metadata             |
| `curves`                       | Curve address, reserves, sold supply, lifecycle, canonical pool |
| `trades`                       | Curve and Uniswap V3 buys/sells with exact integer amounts      |
| `fees`                         | Indexed fee events                                              |
| `graduations`                  | Curve terminal event and forwarded assets                       |
| `liquidity_events`             | Matched `GraduatedV3` custodian, NFT ID, and liquidity          |
| `token_metrics`                | Replayable aggregate discovery metrics                          |
| `token_holder_balances`        | Canonical ERC-20 balance projections                            |
| `token_trade_buckets`          | UTC buckets and nullable OHLC data                              |
| `token_metadata_drafts`        | Offchain draft/finalization lifecycle                           |
| `application_token_exclusions` | Reversible application-only projection exclusions               |

Amounts use `NUMERIC(78,0)` for uint256-compatible integers. Canonical rows reference the exact block hash. OHLC fields are nullable; missing history is not replaced by a current price.

Migration 010 requires replay of existing history to restore the actual transaction index because a migration cannot infer it from a transaction hash.
