This repository generates, verifies, and publishes Stake DAO weekly reward distributions. It covers sdToken voting incentives, vlCVX voter/delegator rewards, and the current Spectra sdToken pipeline.
- Processes voting incentives for Curve, Balancer, Frax, FXN, and Cake reports.
- Builds legacy
merkle.jsonoutputs plus newer chain-specific universal merkle files insdTkns/. - Supports raw token distributions from
bounties-reports/{timestamp}/raw/{protocol}/. - Publishes active files under
bounties-reports/latest/through thesdTokens: Merkleworkflow.
- Processes Convex Votemarket and Votium rewards.
- Splits rewards between direct voters, delegators, and Votium forwarders.
- Publishes main and chain-specific merkles under
bounties-reports/latest/vlCVX/.
- Generates the Spectra report and repartition data.
- Uses
script/sdTkns/generateUniversalMerkleSpectra.tsto publish the Base sdSpectra merkle assdTkns/sdtkns_merkle_8453.json.
.
├── automation/ # Make targets used by GitHub Actions and local ops
├── bounties-reports/
│ ├── {timestamp}/ # Weekly report, repartition, APR, and merkle outputs
│ │ ├── merkle.json # Legacy sdToken merkle output
│ │ ├── delegationsAPRs.json # sdToken delegation APRs
│ │ ├── {protocol}.csv # Protocol reports
│ │ ├── raw/{protocol}/ # Optional raw token reports
│ │ ├── sdTkns/ # Universal sdToken merkles by chain
│ │ ├── spectra/ # Spectra repartition and compatibility merkle data
│ │ └── vlCVX/ # vlCVX repartitions, APRs, and merkles
│ └── latest/ # Current published copies consumed by claim UIs/contracts
│ ├── merkle.json
│ ├── delegationsAPRs.json
│ ├── sdTkns/sdtkns_merkle_{chainId}.json
│ └── vlCVX/
├── data/ # Indexed delegation data, metadata, and extra merkles
├── script/
│ ├── reports/ # Report generation
│ ├── sdTkns/ # sdToken merkle generation and claim fetchers
│ ├── special-distribs/ # One-off extra distribution scripts
│ ├── spectra/ # Spectra report and repartition steps
│ ├── utils/ # Shared utilities
│ ├── verify/ # Automated verification and LLM triage
│ └── vlCVX/ # vlCVX distribution pipeline
└── weekly-bounties/ # Claimed rewards fetched from external platforms
pnpm install
cp .env.example .envFill the RPC/API keys needed by the pipeline you are running. Common variables are WEB3_ALCHEMY_API_KEY, EXPLORER_KEY, ETHERSCAN_TOKEN, BOTS_ENVIO_GRAPHQL_URL_WORKER, and Telegram variables for notification scripts.
# Legacy sdToken merkle
pnpm sd-merkle
# Universal sdFXS and sdSpectra merkles
pnpm sd-merkle:frax
pnpm spectra-report
pnpm spectra-repartition
pnpm sd-merkle:spectra
# vlCVX report, repartition, and merkles
make -f automation/reports.mk run-weekly-vlcvx
make -f automation/distribution.mk run-repartition PROTOCOL=vlCVX
make -f automation/distribution.mk run-merkles PROTOCOL=vlCVX TYPE=non-delegators
make -f automation/distribution.mk run-merkles PROTOCOL=vlCVX TYPE=delegators
# Tests
pnpm test
pnpm test:unit
pnpm test:integration- Add persistent exclusions per protocol in
data/excluded-transactions.json. Entries can be plain hashes or objects withhash, optionalnote, and optionalperiods,startPeriod, orendPeriod. - Add ad-hoc exclusions with
--exclude-tx:pnpm tsx script/reports/generateReport.ts curve --exclude-tx 0xabc.... - Load exclusions from a file with
--exclude-tx-file. - Use
--no-default-exclusionsto ignoredata/excluded-transactions.jsonfor one run.
Current workflow entry points are:
Claims- fetches claimed rewards intoweekly-bounties/.Reports- generates weekly and OTC CSV reports.sdTokens: Verify Reports- verifies sdToken report inputs.sdTokens: Merkle- runs and publishes legacy, sdFXS, and sdSpectra merkle steps.vlCVX: Distribution- runs vlCVX repartition, merkle, verification, and publish steps.Compute APR- recomputes latest vlCVX APR files.System: Index Delegators- refreshes delegation caches.
Every merkle step pins the files a verifier needs to IPFS through script/helpers/pinToIpfs.ts, one Pinata pin per file with a CIDv0, so they stay readable while raw.githubusercontent.com is down. Each pin carries the keyvalues repo, pipeline, period, path (repo-relative) and sha256, so a reader lists GET https://api.pinata.cloud/v3/files/public?keyvalues[pipeline]=sdtokens&keyvalues[period]=<timestamp>&limit=50 without GitHub, fetches <gateway>/ipfs/<cid> and checks the hash. The same map lands in bounties-reports/{timestamp}/ipfs/{pipeline}.json (one file per pipeline, so concurrent runs never conflict) together with ipfsHash, the bytes32 a URD submitRoot(root, ipfsHash) slot takes (the CIDv0 minus its 0x1220 prefix). Pinned sets: sdtokens (tree, distribution, log.json, curve/fxn CSVs and attributions, the two merkle_updates entries), vlCVX voters (vlcvx_merkle*.json), vlCVX delegators (merkle_data_delegators.json), the sdSpectra and sdFXS trees. The step needs the PINATA_JWT secret (legacy scope pinFileToIPFS) and skips with a warning when it is unset. A map entry is only valid while it equals the committed bytes of its path: IPFS: evidence index also runs on every push touching a pinned file, re-pins drifted entries from the checkout (pinToIpfs.ts --heal, one ::warning:: per re-pin) and fails if any remain (--check); --pipeline refuses a checkout behind origin/main (PIN_ALLOW_STALE=1 overrides), which is how the 1788393600 sdtokens map came to carry pre-freeze bytes on 2026-09-09.
A push of those maps triggers IPFS: evidence index, the single writer that pins a browsable index (index.json, index.html) built from every map and commits its CID and EIP-1577 contenthash to data/ipfs-index.json. automation-jobs' ens_publish job ([Bribes] ENS Publish - rewards.stakedao.eth, dispatched by that workflow) mirrors that pointer into the contenthash of rewards.stakedao.eth, so https://rewards.stakedao.eth.limo/ and any ENS-aware client reach the evidence without GitHub or a Pinata key. With PINNING_SERVICE_URL (variable, e.g. https://api.filebase.io/v1/ipfs) and PINNING_SERVICE_TOKEN (secret) set, every CID is replicated on that second provider through the IPFS Pinning Service API.
Reusable Claude commands live in .claude/commands/:
/verify-distribverifies vlCVX distribution files./verify-votemarketverifies bounty report CSVs, attribution files, and claimed rewards.