Crazy Embryo Club
Live · Algorand mainnet- Role
- Sole backend developer (100% of repo)
- Timeline
- Apr 2025 → Feb 2026 (~10 mo)
- Chain
- Algorand (mainnet)
- Scale
- 89 commits (100% sole author) · 14 models · ~30 endpoints
- Stack
- Node 20 · Express · MongoDB (14 models) · Algorand SDK v2 · Redis/Bull · Cloudinary · PM2
Crazy Embryo Club turns an Algorand NFT collection into a gamified missions economy — part treasure hunt, part raffle. Holders send their CEC NFTs out on time-boxed "Missions," pay an entry fee, and win tiered loot — ALGO, ASAs, or NFTs — dealt by a 4-tier weighted reward engine built to stay fair and solvent. Around that core sit NFT-gated access, multi-collection handling, an admin dashboard for running missions, and holder comms. I'm the sole backend developer on it, and it's live on mainnet.
The problem
The product is the mission draw, and a naïve random draw fails in two opposite ways:
- It must feel fair and stay solvent. A pure random draw streaks — a run of top-tier wins drains the reward pool and kills the economy; a run of nothing-wins makes players quit. Both are failure modes the draw has to actively correct for.
- Rewards are real on-chain assets. Paying out means minting and transferring ASAs and NFTs from custodial wallets as atomic groups — exactly, idempotently, and recoverably, so a retried or interrupted payout never double-pays or strands a mission.
- Access is gated by what you hold. Only specific NFTs across the collection's sub-collections may enter a given mission — the backend has to reason about real holders and real staked assets.
Architecture
A generated allowlist is the single source of truth for which NFTs are allowed to enter a mission. Each mission gets its own short-lived wallet to hold and pay out that mission's rewards: it's created when the mission starts and wiped when it ends, and its key is encrypted the whole time it exists — so there's never one big hot wallet holding everything, just small scoped ones that don't outlive the mission they belong to.
The hardest decision: a 4-tier reward engine that defends its own economy
The naïve version of this is a single random roll against a static weight table. I built a 4-tier weighted-probability engine that actively corrects for the two failure modes raw randomness creates:
- Anti-streak / pity boosts. If a player keeps missing the top tier, a no-top-tier boost gradually raises their odds; a consistency boost rewards sustained participation; progressive boosts compound over a losing run — so outcomes trend toward "feels fair" instead of being left to raw variance.
- Per-tier caps + inventory-aware fallback. Each tier has a cap that throttles how fast it can be awarded, so a lucky cluster can't drain the high-value pool; if a tier's inventory is exhausted, the draw falls back gracefully instead of failing.
The tradeoff: this is far more stateful than a stateless dice roll — every draw reads and writes a player's streak history and the pool's tier budgets. I accepted that because on a real-asset economy, "provably uniform random" is the wrong target; "fair-feeling and self-limiting" is the right one, and it can only come from a draw engine that remembers.
What I built around it
- The mission lifecycle + admin dashboard. Operators create missions in a guided 3-step flow, top up reward pools, end missions, and view entries — all through a dashboard wired to the backend.
- NFT gating + multi-collection handling. Entry is restricted to eligible NFTs across the collection's sub-collections; the allowlist and trait-based rules decide who's in.
- Chain resilience. The chain layer wraps ASA mint/transfer, atomic transaction groups, opt-ins, and NFD in circuit breakers + a Bottleneck limiter + backoff retry — so reward payouts ride out transient node hiccups or provider rate limits instead of dropping a mission.
- A hardened public surface. Helmet + a CSP pipeline (report-only with a violation collector), CORS allowlist, mongo-sanitize, xss-clean, and an endpoint allowlist.
- Holder comms. Email (MailerSend/Nodemailer) and Discord alerts on wins, plus a chunked upload → Cloudinary pipeline for collection media.
Results
- 89 commits, sole backend developer — a live mainnet NFT-staking economy, end to end.
- 14 models · ~30 endpoints, a 4-tier probabilistic reward engine with anti-streak pity logic and per-tier caps, a guided admin dashboard, and scoped per-mission custodial wallets with encrypted keys.
- A CSP-hardened surface and a resilient chain layer that keeps payouts landing even when a public node is slow or rate-limiting.
What this demonstrates
Designing an economy, not just an API: a probabilistic system that stays fair and solvent under real variance, on-chain reward settlement hardened against transient node and rate-limit failures, scoped custodial key handling, and the operational tooling (admin dashboard, holder comms) and security discipline (CSP, sanitization, allowlists) for a public mainnet product I owned end to end.