Skip to content

feat: Zetta B20 Intelligence V1 — token indexer, profiles, activity, Luca skill#130

Merged
danbuildss merged 2 commits into
mainfrom
claude/luca-aeon-skills-caYGZ
Jun 23, 2026
Merged

feat: Zetta B20 Intelligence V1 — token indexer, profiles, activity, Luca skill#130
danbuildss merged 2 commits into
mainfrom
claude/luca-aeon-skills-caYGZ

Conversation

@danbuildss

Copy link
Copy Markdown
Owner

What this ships

Zetta B20 Intelligence — the financial intelligence layer for B20 tokens, issuers, and agent-linked assets on Base.

Not a token launcher. A token indexer, profiler, and attribution tracker.


Architecture layer added

ERC-8004            = agent identity
.agent/wallets.json = wallet attribution
B20 (this PR)       = token / asset layer
Zetta Books         = financial analysis
Luca                = explanation layer

Files shipped (11 files, 1,865 lines)

Data layer

  • src/lib/b20-client.ts — token identity via alchemy_getContractMetadata + eth_call fallbacks; activity via alchemy_getAssetTransfers; issuer→agent linking (known_token → manifest → candidate); Luca summary generator
  • src/lib/b20-db.ts — Supabase CRUD: upsert/get tokens, batch-insert activity events, stats aggregation

Migration (run first)

  • migrations/2026-06-23_b20-tables.sqlb20_tokens + b20_activity tables

Admin indexer

  • POST /api/admin/index-b20 — modes: from_registry | single | activity_only; dry run + activity scan toggle

Public API

  • GET /api/b20/tokens — all indexed tokens + stats
  • GET /api/b20/tokens/[address] — token profile + activity

Luca Skill #7

  • POST /api/luca/skills/b20-token-analysis — token identity, issuer, linked agent, manifest status, activity, Luca read, limitations

Pages

  • /b20 — public B20 Intelligence page
  • /b20/[address] — token profile page
  • /luca-admin/b20-intelligence — admin indexer UI

Data integrity enforced throughout

  • Token contracts → never books-eligible
  • Token transfers → not operating revenue
  • Issuer wallets → not attributed unless manifest-confirmed
  • B20 activity → excluded from Agent GDP

Test plan

  • Run SQL migration in Supabase
  • POST /api/admin/index-b20 with { mode: "from_registry", dryRun: true } — confirm tokens discovered from agent registry
  • POST /api/admin/index-b20 with { mode: "from_registry", dryRun: false } — write to DB
  • GET /api/b20/tokens — returns indexed tokens
  • /b20 public page loads with stats
  • POST /api/luca/skills/b20-token-analysis with a known agent token address
  • /luca-admin/b20-intelligence admin UI — run indexer, check results table

🤖 Generated with Claude Code

https://claude.ai/code/session_01RHDXdEbGQsn88zks713gye


Generated by Claude Code

Financial intelligence layer for B20 tokens, issuers, and agent-linked assets on Base.
Not a token launcher — a token indexer, profiler, and attribution tracker.

Architecture layer added:
  ERC-8004 = agent identity
  .agent/wallets.json = wallet attribution
  B20 = token / asset layer  ← this commit
  Zetta Books = financial analysis
  Luca = explanation layer

Files added:

  migrations/2026-06-23_b20-tables.sql
    b20_tokens: address, name, symbol, issuer, linked_agent, link_method,
                manifest_status, luca_summary
    b20_activity: mint/burn/transfer events with tx_hash + log_index unique key

  src/lib/b20-client.ts
    fetchB20TokenIdentity() — alchemy_getContractMetadata + eth_call fallbacks
    fetchB20Activity()      — mint scan (from 0x0) + burn filter via alchemy_getAssetTransfers
    linkTokenToAgent()      — known_token > manifest > candidate matching
    deriveManifestStatus()  — attributed | candidate | none
    buildLucaSummary()      — Luca read with data integrity statements baked in

  src/lib/b20-db.ts
    upsertB20Token(), getB20Tokens(), getB20Token()
    upsertB20ActivityBatch(), getB20Activity()
    getB20Stats(), buildActivitySummaryFromDb()

  src/app/api/admin/index-b20/route.ts   (internalAuth)
    POST — modes: from_registry | single | activity_only
    dry run support, activity scan toggle

  src/app/api/b20/tokens/route.ts        (public)
    GET — list all indexed tokens + stats

  src/app/api/b20/tokens/[address]/route.ts  (public)
    GET — token profile + activity summary

  src/app/api/luca/skills/b20-token-analysis/route.ts  (v1Auth)
    POST — 7th Luca Skill: token identity, issuer, agent link, activity,
            luca_read, limitations, data_integrity_warnings

  src/app/b20/page.tsx
    Public B20 Intelligence page — stats bar, token table, data integrity callout

  src/app/b20/[address]/page.tsx
    Token profile page — identity, attribution, financial readiness grid,
    mint/burn activity, Luca read

  src/app/luca-admin/b20-intelligence/page.tsx
    Admin indexer UI — mode selector, dry run toggle, activity scan toggle, results table

Data integrity enforced throughout:
  token contracts    → never books-eligible
  token transfers    → not operating revenue
  issuer wallets     → not attributed unless manifest-confirmed
  B20 activity       → excluded from Agent GDP

SQL migration: run migrations/2026-06-23_b20-tables.sql in Supabase before indexing.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RHDXdEbGQsn88zks713gye
@vercel

vercel Bot commented Jun 23, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
zetta Ready Ready Preview, Comment Jun 23, 2026 5:52am

Replace BigInt literals (0n, 10n) with BigInt() constructor calls to
target ES2019 compatibility. Fix .select() call with invalid second
argument by removing it and using rows.length for the insert count.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RHDXdEbGQsn88zks713gye
@danbuildss danbuildss merged commit 546a2f3 into main Jun 23, 2026
3 checks passed
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.

2 participants