| name | atomic-distribute |
| description | Use when the user wants to distribute USDC rewards to holders of a pump.fun coin with sqrt-weighted allocation and a minimum-bps floor, or to do an EMERGENCY sweep of all rewards to a single address. Triggers on "distribute rewards", "pay out holders", "distribute.js", "rewards bot", "sqrt weighted distribution", or "EMERGENCY sweep". |
atomic-distribute — sqrt-weighted USDC payouts to holders
Distributes USDC to current holders of a pump.fun coin, with each holder's share computed as sqrt(balance) / sum(sqrt(balance)) — flattens the curve so whales don't dominate while still rewarding larger holders. Includes a MIN_BPS floor so dust holders below threshold are skipped.
Script
src/distribute.js
Setup
Run all commands from the repo root — package.json lives there and defines npm scripts (npm run launch, npm run collect, etc.).
npm install
cp .env.example .env
The script reads all token accounts for MINT, applies the weighting, and submits batched USDC transfers from FUNDER_SECRET to each eligible holder.
Flow
Normal sqrt-weighted distribution:
MINT=<your-coin-mint> \
REWARD_PERCENT=80 \
MIN_BPS=10 \
FUNDER_SECRET=<base58-USDC-holder> \
npm run distribute
This pays out 80% of the funder wallet's USDC balance, weighted by sqrt(holder balance), to every holder with at least 0.1% (10 bps) of the supply.
Emergency sweep (pause + drain):
MINT=<your-coin-mint> \
EMERGENCY=1 \
EMERGENCY_DESTINATION=<single-address> \
FUNDER_SECRET=<base58-USDC-holder> \
npm run distribute