whitepaper · v1
peggy.cash
the complete document. what cope is, how it's measured, how the leaderboard ranks fumblers, and how the $PEGGY airdrop rewards the worst of them.
01abstract
peggy.cash is a public, on-chain regret calculator for Solana memecoin traders. paste a wallet, get back two numbers — peak cope and diamond cope — that quantify how much SOL you fumbled by selling. the wallet's worst trades become a shareable receipt. the worst wallets land on a public leaderboard called the wall of pain. eligible top-20 wallets can claim a tiered $PEGGY airdrop directly from the site.
there is no auth. nothing is stored per-user except the localStorage chip of your last searches. the math is honest, the tone is not.
02the thesis
every Solana memecoin trader has sold the same coin too early. they all know. nobody talks about it. portfolio trackers focus on what you made — peggy focuses on what you didn't. the regret has always been there; we just turn it into a number so it can be shared.
the bet is simple: the most viral on-chain content is the kind that hurts. the more people cope, the more we know about how to measure cope. that's the loop.
03the score
two numbers come out of every scoring run. peak cope is what you'd have if you'd sold each position at its all-time high. diamond cope is what you'd have if you'd just held everything until now.
peak_cope_sol = Σ max(0, ATH_price_usd - avg_sell_price_usd) × tokens_sold / sol_usd diamond_cope_sol = Σ max(0, current_price_usd - avg_sell_price_usd) × tokens_sold / sol_usd
for most memecoin traders, diamond cope is 0 SOL — everything they sold went to zero. peak cope captures the real fumble: there was a moment you could've sold higher, and you didn't.
tiers are assigned by peak cope; the full formula breakdown — exclusions, dust filters, the depth selector — lives in the methodology page.
04the receipt
every scored wallet produces a receipt with seven cards. the first two are aggregates; the rest are specific roasts pulled from the trade history.
- peak cope
- the headline number. SOL fumbled across every position.
- diamond cope
- SOL still on the table if you'd held everything.
- worst single sell
- one transaction. biggest (ATH − sell) × tokens.
- worst fumble
- token-level. biggest aggregate cope across a single ticker.
- biggest cope
- highest ATH ÷ avg-sell multiplier. relative regret, not dollars.
- shortest hold
- fastest first-buy → first-sell on a fumbled position.
- day from hell
- the UTC day with the worst cumulative peak cope.
- best hold-that-never-was
- a sell that's still mooning. the only amber card.
every fumble card prints the token's contract address with a one-click copy. tokens that never had a peak (sold at/above their ATH, missing data) are excluded by design.
05the leaderboard
every successful scoring run lands the wallet on the wall of pain — a single global leaderboard ranked by peak cope. the page is server-rendered and revalidates every 30s, so it feels live without sockets.
- window
- 7 days. wallets fall off the board 7 days after their last scoring.
- rank scope
- top 20 displayed. server overfetches 50 to handle TTL gaps cleanly.
- excludes
- wallets with peak cope = 0 (no fumble) and any that scored empty.
- storage
- upstash redis sorted set keyed by peakCopeSol, with per-wallet metadata.
there is no anti-spam yet. at current volume that's fine; if the site scales we'd add IP-level rate limiting on the scoring endpoint and a minimum activity threshold.
06what is $peggy
$PEGGY is the native token of peggy.cash. it's a standard Solana SPL token, transferable like any other. its purpose is single and deliberate: to reward the worst sellers on the wall of pain — the people willing to paste their wallet and own the fumble in public.
there is no presale, no team allocation, no points farm. every $PEGGY in circulation enters the world by being claimed off the leaderboard. the more cope the network surfaces, the more of the supply gets distributed.
specs
- network
- Solana (mainnet)
- standard
- SPL token
- ticker
- $PEGGY
- mint address
- published at launch · pinned on @PeggyOnPF
- supply
- fixed at mint · no inflation, no reissue
distribution
the entire claimable supply lives in the dev wallet and only leaves it through the airdrop claim flow described in the next section. tier multipliers shape who gets what: the #1 fumbler walks away with five times the base; rank #20 still walks away with something. drift off the top-20 within seven days and the seat opens up for someone worse.
utility
- claim reward — the immediate utility. you cope, you get paid.
- social proof — holding $PEGGY is a receipt of public humiliation. that's the point.
- future hooks — token-gated leaderboard cosmetics, seasonal rewards, and snapshot-based airdrops for the worst weeks/months are on the roadmap. anything that gets added compounds on the same supply already in circulation.
07the airdrop claim
the top 20 wallets on the wall of pain are eligible to claim a tiered $PEGGY airdrop directly from /leaderboard. the bigger the cope, the bigger the bag.
tier multipliers on a configurable base amount:
- rank #15× base
- ranks #2 – 33× base
- ranks #4 – 101.5× base
- ranks #11 – 201× base
- outside top 20not eligible
eligibility is re-checked against the live top-20 at claim time — not against a stale snapshot the client provides. claiming a stale rank that's since dropped off the board returns an error.
claim flow
- connect Phantom; the UI reads your pubkey.
- UI hits the eligibility endpoint — server reports your rank, tier, amount, and whether you've already claimed.
- if eligible and unclaimed, click claim. Phantom prompts you to sign a short message containing your wallet address and a current timestamp.
- UI posts the signature + timestamp to the claim endpoint. server verifies the ed25519 signature, re-checks eligibility against the live board, takes an atomic redis lock, and sends an SPL transfer from the dev wallet to your ATA (creating the ATA if needed).
- on confirmation, the claim is recorded permanently. the UI shows a solscan link to the transaction.
security model
- signer key
- lives only in a server-side env var. never reaches any client bundle.
- ownership proof
- 5-minute freshness window on the signed message. signature is verified against a canonical message the server reconstructs from (wallet, ts), so the client can't inject arbitrary payloads.
- double-claim
- per-wallet redis lock for the duration of the transfer; permanent claim record on success.
- rate limit
- 5 claim attempts per IP per 60s.
- graceful disable
- if any required env var is missing or malformed, the feature self-disables and the claim card stays hidden — the rest of the site is unaffected.
08architecture
- frontend
- next.js 15 app router · react 19 · server components everywhere except the small interactive bits (wallet input, claim widget).
- data plane
- solana tracker rest api for PnL, ATHs, current prices, and individual trades. one stream per scoring run.
- cache
- upstash redis for receipt cache (24h TTL), share-page lookup, leaderboard sorted set, claim records, and rate-limiting counters. local in-memory fallback for dev.
- chain
- @solana/web3.js + @solana/spl-token. mainnet. signer wallet pays transaction fees and ATA rent.
- hosting
- vercel. node 22+ runtime on every api route. streamed responses for the scoring pipeline.
09open source
the entire stack is public. every component described in this document — the scoring pipeline, the leaderboard, the airdrop claim flow, the whitepaper you're reading right now — lives in one repo under an MIT license. fork it, run it, fix our bugs, or ship a worse version. all fine.
- license
- MIT · permissive · do whatever, just keep the notice
- language
- typescript · next.js 15 app router · server components by default
- commit cadence
- main is always shippable; every push deploys to vercel.
run it locally
git clone https://github.com/1RubinaSingla/Peggy cd Peggy npm install # set SOLANA_TRACKER_API_KEY in .env (rest is optional) npm run dev # http://localhost:3000
the scoring pipeline works with just the solana tracker key. upstash redis, the airdrop env vars, and the rpc url are all optional — the app falls back to an in-memory cache and hides the claim card if anything is missing. nothing breaks.
contributing
PRs welcome. bug reports especially welcome if you find a wallet where the score is clearly wrong — that's how the dust filters and exclusions get better. the codebase is small enough to read end-to-end in one sitting; the data layer is src/, the routes are app/api/, everything else is rendering.
10privacy & trust
peggy.cash has no accounts, no email, no analytics tying you to a session. you paste a wallet, we score it, the result is public — same as the on-chain history it came from.
- what we store
- the scored receipt (24h TTL), leaderboard metadata (8d TTL), claim records (permanent).
- what we don't
- your IP beyond rate-limit windows, your phantom pubkey unless you claim, cross-session identity.
- what stays on your device
- the recent-search chips on the home page. localStorage only. cleared if you clear site data.
the airdrop signer key is generated by the operator and held in env. we recommend a dedicated wallet funded only with the airdrop budget so blast radius is bounded if the key ever leaks.
11what we can't see
this is an entertainment product. the math is honest, but it has limits:
- spl ↔ spl swaps
- we only score sells where the trader received SOL. routing through an intermediate token hides the trade.
- airdrop sells
- no cost basis from a buy → no usable peak cope math.
- pre-indexing ATHs
- peaks that happened before solana tracker started indexing the token are invisible.
- sol/usd drift
- we convert at the current rate, not the trade-time rate. trades from much higher sol prices are slightly under-counted in sol terms.
- noisy ATHs
- a $5m mcap on $200 of volume can still inflate peak cope. dust positions are filtered; the ATH itself is not yet liquidity-floor-checked.
if you find a wallet where the number is clearly wrong, send it — we'll look at it and improve the filters.
12roadmap
- liquidity-floor on ATH so dead-token peaks don't inflate scores.
- trade-time sol/usd conversion for historical accuracy.
- spl-to-spl swap support so non-sol-routed sells count.
- more roast cards: revenge buy, rug-holder, weekend trader.
- per-wallet share images that quote the worst card on a 1200×630 canvas.
- seasonal leaderboards (weekly / monthly hall of pain).
- retroactive airdrop snapshots so each cycle has a clean eligibility set.