Pigeon Puffs — NFT ecosystem driven by live on-chain analytics
Role: Backend developer (sole author, 442 commits / 853 all-branch) · Client: 3BUX LLC Stack: Node.js · Express · MongoDB (Mongoose, 50 models, 17 controllers, ~120 endpoints) · Redis/Bull · Firebase · Algorand JS SDK · CSP-hardened Live: app.pigeonpuffs.com · puffs.ghettopigeon.com · On-chain (Algorand mainnet): FAM ASA 2935126632 (984 holders) · HAYSTACK app 3172554435 · PUFF ASA 3196313859 Timeline: Nov 2024 → May 2026 (~18 months, active)
The problem
Pigeon Puffs is an NFT ecosystem with leaderboards, LP-staking, and a live token (FAM) that trades through an on-chain swap/liquidity application (HAYSTACK) on Algorand mainnet. The backend's defining challenge: its source of truth lives on-chain, not in its own database. Leaderboards, staking rewards, holder rankings, and whale alerts all have to be derived from real ledger state and kept fresh — the API can't just trust numbers it wrote itself.
Architecture
Six cron workers poll the Algorand indexer, recompute leaderboards and token metrics off live chain state, persist to MongoDB, push Discord notifications (including whale-swap alerts when a swap crosses a value threshold), and run the FAMverse distributor that pays community rewards on-chain. A complex LP-staking schema tracks stake positions and accrual.
The hardest decision: derive truth from the chain, don't assume it
The tempting shortcut is to treat the database as authoritative and update it whenever the app thinks something happened. On a system wired to a public token and a public swap contract, that drifts immediately — people trade FAM outside your app. I chose to make the indexer the source of truth: cron workers reconcile against live chain state on a schedule, so holder rankings and swap analytics reflect what actually happened on Algorand, not what my API hoped happened. The tradeoff is polling cost and a freshness window, accepted in exchange for correctness I can defend.
What I designed for
- CSP enforcement — a Content-Security-Policy monitoring + enforcement pipeline, with violation reporting, hardening the public surface.
- Abuse controls — blacklist and blocked-user support baked into the data model.
- Indexer resilience — analytics jobs tolerate indexer latency and recompute idempotently, so a missed cycle self-heals on the next run.
Results
- 442 commits (853 all-branch), sole author, 50 models, 6 cron workers, live since 2024.
- Real mainnet integration: two live ASAs (FAM, 984 holders; PUFF) + an on-chain swap/LP application, with analytics and whale alerts computed from ledger state (all IDs independently verifiable — see links above).
- The FAMverse distributor moved 79,346.66 FAM to 539 recipients across 567 transactions in a single cycle — concrete on-chain throughput, not a vanity metric.
- A sibling service,
pigeon-puffs-mint, batch-mints up to 2,000 ARC-19 NFTs with resume/checkpoint (CID encoded into the ASA reserve address; art pinned to IPFS via Pinata).
What this demonstrates
Treating the blockchain as the system of record: indexer-driven analytics, scheduled reconciliation, security hardening (CSP), and event notification off live on-chain activity.