๐ Monad Adventures Docs
Product + technical reference for gameplay, tokens, persistence, APIs, and security controls.
โ๏ธ 1) Core Gameplay
- ๐บ๏ธ 3 dungeons: Training Field, Mad Wizard, Grand Colosseum.
- ๐ Runs are up to 10 levels with decreasing win odds as level increases.
- ๐ง Character progression is unlimited and increases from boss kills.
- ๐งฉ Item progression is level-based; equipped items gain EXP from boss kills.
- ๐จ Cash out lets players escape early and claim accumulated SPIKES.
๐ฐ 2) Currencies & Economy
- ๐ช Primary in-game currency is SPIKES.
- ๐๏ธ Mad Wizard + Grand Colosseum require SPIKES entry fees.
- โก Training Field is free entry, but consumes daily energy.
- ๐ Spike Loot Box gives 500 SPIKES for 2 USDC (fixed reward).
- ๐ Items can be sold for a flat 5 SPIKES each.
- ๐งฏ Jackpot mechanics are disabled for now.
๐ฎ 3) MON Boss Loot
- ๐ฒ MON loot appearance chance is 10% per boss level.
- ๐ If MON appears and you defeat the boss, a win roll determines reward.
- ๐ธ Reward is 5 MON and shown in the victory overlay with the MON icon.
- ๐งพ Claim IDs prevent duplicate payouts for the same boss clear.
- ๐ง MON payout mode can be independent from SPIKES settlement mode.
๐ 4) Daily Energy
- ๐ Daily cap is 100 energy; Training Field costs 10 per entry.
- ๐ Energy resets by day key and is enforced server-side (UTC day).
- ๐๏ธ Mad Wizard + Grand Colosseum do not consume energy.
- ๐ UI shows a full-width energy bar on the Training Field card.
๐ 5) Item Loot & Inventory
- ๐งช Two-step loot: appearance roll, then win roll on boss victory.
- ๐ Current settings: 25% appear, 80% win if you beat the boss.
- ๐งท Drops go to wallet inventory and can be equipped by slot.
- โป๏ธ Selling an equipped item auto-unequips and recalculates boosts.
- ๐๏ธ Inventory is identity-scoped and persisted in Postgres.
๐ 6) Reward Scaling
- ๐ SPIKES level rewards scale up as win odds decrease.
- ๐งฎ Uses base dungeon reward + level win chance to scale payout.
- ๐ฏ Higher risk levels pay more to match difficulty.
๐งฑ 7) Persistence (Postgres)
- ๐๏ธ State is persisted in PostgreSQL with normalized tables.
- ๐งพ Tables: players, sessions, wallet_items, used_payment_tx_hashes, jackpots, chat_messages.
- โ๏ธ Server keeps in-memory state and flushes to Postgres.
- ๐งณ Legacy migration supports old JSON / older DB formats.
๐ 8) Auth & Identity
- ๐งพ Onchain mode uses signed wallet challenge auth.
- ๐ชช Mock mode uses identity keys (wallet or guest) passed to APIs.
- ๐งท Ownership checks protect player/session state mutations.
๐ 9) Deployment
- ๐ Frontend: Vercel (Next.js).
- ๐ค๏ธ Backend: Railway (Node + Postgres plugin).
- ๐ช SPIKES settlement: mock or onchain via escrow.
- ๐ฎ MON payout: independent via MON_REWARD_MODE (mock/onchain).
๐ก๏ธ 10) Security Controls
- ๐ฆ Global rate limiting with bounded bucket map.
- ๐ง No-store API headers + basic hardening headers.
- ๐ Replay protection for token payment tx hashes.
- ๐งพ Duplicate-claim prevention for MON payouts.
- ๐ฌ Chat is capped to latest 20 messages (client load control).
- ๐ง Chat + player creation require identity in mock mode.
๐งฐ 11) API Overview
- ๐ค Players: create, resume, state, inventory, sell item.
- ๐ Ranking: global character leaderboard (level + EXP ordering).
- ๐บ๏ธ Dungeons: list, enter.
- ๐งจ Sessions: equip, attack, cashout, claim.
- ๐ Tokens: buy (mock), open loot box.
- ๐ฌ Chat: list latest, post message.
โจ Tip: Docs are meant to be player-friendly; dev details live in the backend README.
