Skip to content

feat(scripts): migration-candidates CSV for upgrader.co deposit list#97

Open
r4topunk wants to merge 3 commits into
mainfrom
update/migration-candidates
Open

feat(scripts): migration-candidates CSV for upgrader.co deposit list#97
r4topunk wants to merge 3 commits into
mainfrom
update/migration-candidates

Conversation

@r4topunk

@r4topunk r4topunk commented May 6, 2026

Copy link
Copy Markdown
Owner

Summary

  • Walks the Gnars-backed pool graph (1 hop from GNARS + 1 hop from each member creator coin) and emits a ranked migration deposit list ready for upgrader.co.
  • Tags every coin with a backing_tier (gnars / member-creator / paired-with-gnars / paired-with-member-creator / skip) and a recommended_action (must / should / consider / skip) by TVL and holders.
  • Fixes the "14 of 1011 members" cache-truncation bug — fetchAllMembers now cross-checks dao.ownerCount and refetches when the cache looks truncated.

Changes

  • scripts/export-creator-liquidity.ts
    • New stage: GeckoTerminal /tokens/{seed}/pools enumeration for GNARS + every member-created coin (cached per seed under output/cache/gecko-backed-pools).
    • New stage: Zora getCoin for downstream content coins (caches under output/cache/zora-coins).
    • New aggregator buildMigrationCandidates + new CSV writer producing migration-candidates-{stamp}.csv.
    • Creators CSV now also exposes creator_coin_address/symbol/tvl_usd and total_holders_across_coins (airdrop scope).
    • Renamed GNARS_CREATOR_COINGNARS_ZORA_TOKEN (alias kept for back-compat), added ZORA/USDC/WETH root-token constants used to identify creator coins.
    • Docs/usage note: NEXT_PUBLIC_TOKEN_ADDRESS in .env.local can shadow the DAO — pass it inline when running this script.

Test plan

  • Typecheck via tsc with bundler resolution — clean.
  • Smoke run against real Gnars subgraph with LIMIT=20: 1011 members fetched, 4 creators in top-20 holders, 127 unique created coins, 20 downstream content coins enriched, 13 ENS resolved, migration-candidates CSV schema verified (rank, backing_tier, recommended_action, coin_, creator_, backing_token_, best_pool_, total_tvl_all_pools_usd, holders_count, …).
  • Tier counts match expectations: t1=1 (GNARS), t2=2 (member creator coins), t3=18 (content coins paired with GNARS), t4=0.
  • Full run with no LIMIT once Gecko paid tier or longer wall-clock is acceptable.

Operator notes

Run with explicit DAO address override (mandatory if .env.local points elsewhere):

NEXT_PUBLIC_TOKEN_ADDRESS=0x880fb3cf5c6cc2d7dfc13a993e839a9411200c17 \
  pnpm tsx scripts/export-creator-liquidity.ts

Caches under output/cache/; rerun resumes. To force-refresh one stage, delete the matching folder.

Generated with Claude Code

Walk the Gnars-backed pool graph (1 hop from GNARS, 1 hop from each member
creator coin) and emit a ranked migration deposit list. Adds ~676 lines to
scripts/export-creator-liquidity.ts.

What's new:
- New stage: gecko `/tokens/{seed}/pools` enumeration for GNARS + every
  member-created coin (cached per seed under output/cache/gecko-backed-pools).
- New stage: Zora `getCoin` for downstream content coins discovered via the
  pool walk so we get symbol/creator/holders for non-member coins.
- buildMigrationCandidates() tags each coin with a backing tier:
    tier_1_gnars, tier_2_member_creator_coin, tier_3_paired_with_gnars,
    tier_4_paired_with_member_creator, skip
  and a recommended_action (must/should/consider/skip) by TVL + holders.
- New `migration-candidates-{stamp}.csv` ranked list ready for upgrader.co.
- creators CSV now surfaces creator_coin_address/symbol/tvl + total holders
  across coins (airdrop scope sizing).
- fetchAllMembers cross-checks dao.ownerCount and discards/refetches when the
  cached member count looks truncated (prevents the "only 14 of 1011 members"
  bug we hit on the prior run).
- Constants: rename GNARS_CREATOR_COIN -> GNARS_ZORA_TOKEN with alias; add
  ZORA/USDC/WETH root tokens used to identify creator coins.
- Docs note that NEXT_PUBLIC_TOKEN_ADDRESS in .env.local can override the DAO;
  pass it inline when running this script.

Verified with LIMIT=20 against the real Gnars subgraph: 1011 members fetched,
3 must_include + 3 should_include + 10 consider candidates emitted, t1=1
t2=2 t3=18 t4=0. Migration CSV schema matches kompreni's upgrader.co list
shape.

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

vercel Bot commented May 6, 2026

Copy link
Copy Markdown

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

2 Skipped Deployments
Project Deployment Actions Updated (UTC)
gnars-shadcn Ignored Ignored May 11, 2026 3:36pm
hackertestdao Ignored Ignored May 11, 2026 3:36pm

Request Review

r4topunk and others added 2 commits May 7, 2026 12:23
… creators

The previous strict `creatorAddr !== m.owner` filter dropped 30+ DAO
members whose Zora deployer wallet differs from their DAO holder address.
Notable miss: gami (DAO holder 0x387a..., Zora deployer 0x347c...) had
all 82 of her coins dropped — including her ether/gami creator coins
with $79k+ TVL across 982 holders.

Fix:
- buildCoinRows now uses `m.owner` as the canonical creator (DAO
  membership is the signal we care about) and surfaces the actual
  on-chain deployer in a new `deployer_address` column on the coins CSV.
- buildMigrationCandidates adds a coin->member reverse map from the
  profileMap so member-attribution falls back to "this coin appeared on
  member X's Zora profile" when the on-chain deployer isn't a holder.
- Renamed the leftover `GNARS_CREATOR_COIN` references to
  `GNARS_ZORA_TOKEN` for consistency.

Verified by rerunning against the full Gnars subgraph (1011 holders):
- creators with coins: 4 -> 35
- coin rows: 13 -> 620
- migration candidates by tier: t1=1, t2=2->26, t3=18, t4=0
- migration recs: must=3->27, should=3, consider=10
- gami appears at rank 3 (must_include, $79k TVL, 982 holders)

Known limitation: when a member's profile lookup misses their canonical
creator coin (because the coin was deployed by a linked wallet not
queried), our heuristic picks the WETH/USDC-paired coin instead. The
proper fix is to capture `profile.creatorCoin.address` from the Zora
SDK response — left for a follow-up since the current output is already
useful and correct on member-attribution.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Some creators we want in the migration list (skatehacker/sktbrd.eth,
linked wallets of existing members, ex-holders, governance contributors)
don't currently hold the Gnars DAO NFT, so they're invisible to the
holders-based member walk. Add an env-driven allow-list so operators can
include arbitrary wallets without touching code.

Usage:
  EXTRA_MEMBERS="0x41cb…,0xdf42…,0x1c89…" pnpm tsx scripts/export-creator-liquidity.ts

Behavior:
- Parsed as comma/whitespace-separated address list, deduped against
  existing DAO holders, appended with daoTokenCount=0.
- Rest of the pipeline (profileCoins, gecko pools, backed-pool walk,
  Zora metadata, ENS/Farcaster enrichment, migration ranking) treats
  them identically to real members.

Verified by rerunning with skatehacker's three Zora-linked wallets:
- creators with coins: 35 -> 38
- coin rows: 620 -> 761
- must_include: 27 -> 28
- total TVL: $237k -> $315k
- skatehacker creator coin (0x774e…6d04) now appears at rank 49 with
  $1,921 best-pool TVL, $6,088 across 12 pools, 138 holders

Known limitation: the heuristic for picking a member's "canonical"
creator coin still grabs the first root-paired coin (WETH/USDC/ZORA),
which can mis-tag the canonical Zora creator coin as skip. The proper
fix is to capture `profile.creatorCoin.address` from the Zora SDK
response and use that authoritatively. Tracked for a follow-up.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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