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

# Database

> PostgreSQL migrations, provenance, and current projections.

PostgreSQL stores canonical block/event provenance and product projections. The migration runner applies each file in a single transaction and requires the exact continuous sequence `001` through `014`.

| Migration range | Main capability                                                                                     |
| --------------- | --------------------------------------------------------------------------------------------------- |
| `001`–`003`     | Blocks, events, checkpoints, tokens, curves, trades, fees, graduation, metadata, V3-only transition |
| `004`–`008`     | Holder balances, analytics, discovery, OHLC, and social metadata                                    |
| `009`–`011`     | V3 graduation plane, Uniswap V3 trades, and application exclusions                                  |
| `012`           | CTO treasuries, proposals, token state, checkpoints, transfers, and fee pulls                       |
| `013`           | Trade/chart normalization and fixed token-decimal constraint                                        |
| `014`           | Creator-bound metadata claims and wallet-holdings indexes                                           |

Amounts use PostgreSQL `NUMERIC` columns and are exposed as decimal strings. Canonical flags and block hashes retain reorg provenance. Derived rows are application views; the chain and contracts remain authoritative for balances and execution.

The repository proves the migration set and runner behavior. It does not prove which migrations are installed in an unspecified remote database.
