Deep dive
On-Chain Truth, Off-Chain Speed: Indexing an NFT Marketplace Correctly
NFT marketplaces need fast search and analytics without letting the database become a second source of truth. The answer is a replay-safe indexed projection.

A marketplace cannot render every screen by querying raw chain state from scratch. Search, activity feeds, collection rankings, ownership summaries, floor data, and historical charts all need an indexed view. The danger is letting that database quietly become a second authority. When an index is wrong, the interface can show a listing that no longer exists, count one sale twice, assign an outdated owner, or calculate percentages from the wrong supply number. The architecture should be fast because it projects chain state, not because it replaces it.
The chain is authoritative; the index is a projection
Settlement, ownership changes, policy resolution, and other transaction outcomes happen on chain. The index translates those outcomes into shapes that are convenient for a product: sale rows, activity events, collection statistics, searchable items, ownership views, and status summaries. Ganbitera makes this distinction explicit with Marketplace Settlement on chain and Sale Recording off chain. The database answers fast product questions while the transaction remains the source of truth for whether the trade actually completed.

Idempotency is not optional
A production indexer must assume events will be retried and historical ranges will be replayed. Network failures, process restarts, deploys, and reconciliation jobs make at-least-once processing normal. Ganbitera's sale recorder uses the transaction digest and event sequence as the identity of a sale event. Processing the same event again therefore converges on the same row instead of adding another sale and another increment to collection volume.

Derived metrics need precise denominators
Many marketplace bugs are not event-processing bugs; they are definition bugs. Maximum release capacity is not the same as the number of minted or tracked items. Public supply is not the same as total capacity when inventory is reserved. A percentage listed, ownership concentration, or holder share needs the correct denominator. Ganbitera distinguishes Release Capacity from Item Count specifically because substituting one for the other can create plausible-looking but materially wrong statistics.
Reconciliation closes the gap
Even a well-designed event pipeline should have a repair path. Fast event consumption gives the interface freshness; reconciliation compares the indexed projection with authoritative state and repairs gaps after a missed event, a deployment, or a changed derived rule. Replay-safe handlers make that process practical. If rebuilding a range can corrupt totals, the index is too fragile. If it is idempotent, recovery becomes an expected operational tool.
Speed and correctness are compatible
The goal is not to force users to wait for a low-level chain query on every page. It is to build a fast read model whose definitions and lifecycle are anchored in chain events and state. The index can be aggressively optimized for search and presentation as long as it remains reproducible. That gives a marketplace the responsiveness users expect without turning a convenient cache into an invisible second ledger.

