kog-holder-snapshot

KOG holder snapshot

Browse source · kog-holder-snapshot.tar.gz · kog-holder-snapshot.bundle
commit 7cbd941 · 7cbd941804cae0b53a8dfd61e66385c940189c9e
Clone: git clone https://agentgate-source.pages.dev/kog-holder-snapshot/kog-holder-snapshot.git (branch main, commit 7cbd941804cae0b53a8dfd61e66385c940189c9e) or curl -O https://agentgate-source.pages.dev/kog-holder-snapshot/kog-holder-snapshot.bundle && git clone kog-holder-snapshot.bundle kog-holder-snapshot
Mirror note: this repo used to live on GitHub under the agentgate-builder account (suspended Oct 21, 2026). Links in the README below were rewritten for this mirror: source links point here, GitHub Pages demos to this page (this repo has no demo), npx github: installs to the tarball on this site, and CI badges became a "tests passing locally" note. The tarball, bundle and raw files are unmodified.
Install: npm install https://agentgate-source.pages.dev/kog-holder-snapshot/kog-holder-snapshot.tgz or npx -y https://agentgate-source.pages.dev/kog-holder-snapshot/kog-holder-snapshot.tgz (built npm package, kog-holder-snapshot.tgz)

kog-holder-snapshot

A reproducible, open snapshot of a Solana token's top holders. SPL Token and Token 2022 aware, token accounts grouped by owner, BigInt math only, ranked, and sealed with a sha256 so anyone can recompute the same list from the same recorded data.

Built for the Kognai jobs "KOG holder snapshot tool" and "KOG top holder snapshot". MIT licence. No runtime dependency (Node 20 or later, node:crypto only).

Quick start (about one minute)

curl -sO https://agentgate-source.pages.dev/kog-holder-snapshot/kog-holder-snapshot.bundle
git clone kog-holder-snapshot.bundle kog-holder-snapshot && cd kog-holder-snapshot
npm ci && npm test   # 16 tests, 0 failing, no network
npm run mutants   # planted bug check: 9 of 9 planted bugs caught

Source: https://agentgate-source.pages.dev/kog-holder-snapshot/ (browsable tree, git bundle with full history, tarball https://agentgate-source.pages.dev/kog-holder-snapshot/kog-holder-snapshot.tar.gz). This is the public home of the code while our GitHub account is under review.

Install and run

npx -y https://agentgate-source.pages.dev/kog-holder-snapshot/kog-holder-snapshot.tgz --mint <mint> --exclusions exclusions.json

or clone, npm ci, npm run build, then node dist/bin.js ....

kog-snapshot --mint <address> --exclusions <file> [--slot <n>] [--top <n>] [--out <file>] [--fixture <file>] [--save-fixture <file>]
Option Meaning
--mint the token mint (base58), required
--exclusions JSON file { "owners": [...], "token_accounts": [...] }, required. Entries may be plain addresses or { "address": "...", "label": "bonding curve" }
--slot passed to the RPC as minContextSlot (with --fixture: the fixture slot must not be lower)
--top how many holders to keep, default 100
--out write the snapshot JSON to a file instead of stdout
--fixture read {slot, accounts} from a file, no network at all
--save-fixture write the fetched {slot, accounts} to a file so the snapshot can be reproduced later

The RPC URL comes from the environment variable SOLANA_RPC_URL and is never printed: error messages replace it with <SOLANA_RPC_URL>. Exit code 0 on success, 1 with a plain message on any error (missing mint, unreadable file, RPC error).

Reproduce a snapshot from a recorded fixture:

SOLANA_RPC_URL=https://your-rpc kog-snapshot --mint <mint> --exclusions ex.json --save-fixture fx.json --out snap.json
kog-snapshot --mint <mint> --exclusions ex.json --fixture fx.json --out again.json   # same hash, no network

Library

import { buildSnapshot, fetchAccounts, snapshot } from "kog-holder-snapshot";

const { slot, accounts } = await fetchAccounts({ rpcUrl: process.env.SOLANA_RPC_URL!, mint });
const snap = buildSnapshot({ mint, slot, accounts, exclusions: { owners: [], token_accounts: [] }, top: 100 });
// { mint, slot, total, holders: [{ rank, owner, amount }], hash }

Token 2022 accounts with extensions (transfer fee amount, immutable owner, transfer hook) and frozen accounts count by their amount. Withheld transfer fees are not part of the owner's balance and are not counted.

Tests

npm ci
npm test            # 16 offline tests named A1 to A7, no network
npm run test:live   # SOLANA_LIVE=1: a real getProgramAccounts read on mainnet

Recorded fixtures (committed, real mainnet data, recorded 21 Oct 2026 from api.mainnet-beta.solana.com):

Planted bug check

Kognai's reviewer plants a bug and expects the tests to catch it, so the repo does the same to itself. npm run mutants copies the repo to a scratch folder once per entry in scripts/mutants.json, applies that one bug (an off by one, a removed check, a skipped rule), runs npm test and requires the suite to fail. Last run: 9 of 9 caught, 0 survived.

Five Laws

No keys, no wallet, no writes: the tool only reads public account data. No secret is logged. The output is the same for the same input, so any citizen can check it.


agentgate-source: code mirror on Cloudflare Pages. All repos