Skip to content

Zift batch 6: unpublished utxo_daily (transparent UTXO set) - #231

Merged
Kenbak merged 1 commit into
mainfrom
new/zift-utxo-daily
Nov 3, 2026
Merged

Kenbak merged 1 commit into
mainfrom
new/zift-utxo-daily

Conversation

@Kenbak

@Kenbak Kenbak commented Nov 3, 2026

Copy link
Copy Markdown
Owner

Adds an unpublished research dataset, utxo_daily, with one row per completed UTC date since 2016-10-28. Runbook: server/deploy/ask-analytics/utxo-daily.md (rollback first). Nothing is applied to any host by this PR.

Columns: date, utxos, unspent, age_lt_1m, age_1_3m, age_3_6m, age_6_12m, age_1_2y, age_gt_2y, spent_outputs, cdd, avg_dormancy_days, realized_cap_usd, avg_cost_basis_usd.

Source: the explorer's existing daily jobs, utxo_age_daily and transparent_realized_cap_daily (3,657 rows each). They are replicated with reviewed columns; created_at stays private.

Evidence (read-only, mainnet, 2026-11-02)

  • No gaps, NULLs or zero totals. Age bands sum to the total on every date, and both tables agree on the UTXO count on every date.
  • total_unspent_zat = analytics_history_daily.transparent_supply_zat on all 3,657 dates, and = the node-reported transparent pool on all 35 overlapping day ends.
  • The view runs in 4 ms under the reader's work_mem=1MB/temp_file_limit=16MB, with no temp files (the batch 5 lesson).

Design notes

  • Realized cap guard: it joins only when both summaries report the same UTXO count, so the dataset never mixes two job snapshots (otherwise NULL).
  • Units: the plan-quality unit lineage now maps every *_usd column to USD; previously only a column named usd was. cdd is ZEC × days.
  • Revisions: the jobs repair the last seven dates each morning. Replication carries the updates, and the description says recent dates can change.
  • Privacy: set-wide totals per date; no linkage.
  • Rollout: the reader grant is separate and applied after the worker. Step 8 verifies with the reader's limits set. The repin takes the feed to 19 relations.

Tests

  • Unit (catalogue = view columns, guarded migrations, column lists, unit lineage).
  • PG view (renames, rounding, count-guarded realized cap, gating).
  • Logical replication end to end, including an in-place morning repair.
  • Eval case utxo_dormant_2026_10 stays pending until publish.
  • Locally 1,290 API tests pass; the PG tests run in CI.

🤖 Generated with Claude Code

Daily transparent UTXO-set summaries from the explorer's existing jobs: count,
value, age bands (HODL waves), spends, coin-days destroyed, mean dormancy and
the daily-price realized cap, from 2016-10-28. Two small replicated tables with
reviewed columns; the realized cap joins only when both summaries agree on the
UTXO count. Reader grant is a separate post-worker step. Plan-quality unit
lineage now treats every *_usd column as USD.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
zecblock Ready Ready Preview Nov 3, 2026 12:07am UTC
2 Skipped Deployments
Project Deployment Actions Updated
zecblock-crosslink Ignored Ignored Preview Nov 3, 2026 12:07am UTC
zecblock-testnet Ignored Ignored Preview Nov 3, 2026 12:07am UTC

Request Review

@Kenbak
Kenbak merged commit 7c53ea6 into main Nov 3, 2026
30 checks passed
@Kenbak
Kenbak deleted the new/zift-utxo-daily branch November 3, 2026 02:12

This branch was successfully deployed

1 active deployment
Preview – zecblock — 5b4bc98c Deployed Nov 3, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant