System Diagrams
Visual representations of the PlayOrbs architecture and flows.
System Architecture
┌─────────────────────────────────────────────────────────────────────────────┐
│ PORBS GAME ARCHITECTURE │
├─────────────────────────────────────────────────────────────────────────────┤
│ │
│ ┌─────────────────────────────────────────────────────────────────────┐ │
│ │ ON-CHAIN LAYER │ │
│ │ │ │
│ │ ┌───────────┐ ┌───────────┐ ┌───────────┐ ┌───────────┐ │ │
│ │ │ Root │ │ Round │ │ Player │ │ Season │ │ │
│ │ │ Account │ │ Pages │ │ Stats │ │ Snapshots │ │ │
│ │ └─────┬─────┘ └─────┬─────┘ └─────┬─────┘ └─────┬─────┘ │ │
│ │ │ │ │ │ │ │
│ │ └───────────────┴───────────────┴───────────────┘ │ │
│ │ │ │ │
│ │ ┌─────────────────────────────┴─────────────────────────────┐ │ │
│ │ │ INSTRUCTION SET │ │ │
│ │ │ join_round | settle_round | round_payout | update_stats │ │ │
│ │ │ convert_points | claim_season_pool | manage_liquidity │ │ │
│ │ └───────────────────────────────────────────────────────────┘ │ │
│ │ │ │
│ └─────────────────────────────────────────────────────────────────────┘ │
│ │ │
│ ▼ │
│ ┌─────────────────────────────────────────────────────────────────────┐ │
│ │ EXTERNAL INTEGRATIONS │ │
│ │ │ │
│ │ ┌─────────────┐ ┌─────────────┐ ┌─────────────────────────┐ │ │
│ │ │ ICP Canister│ │ Raydium │ │ SPL Token Program │ │ │
│ │ │ (Seed Gen) │ │ CLMM │ │ (PORB Mint/Transfer) │ │ │
│ │ └─────────────┘ └─────────────┘ └─────────────────────────┘ │ │
│ │ │ │
│ └─────────────────────────────────────────────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────────────────┘
Round State Machine
┌──────────────────────────────────────────────────┐
│ ROUND STATE MACHINE │
└──────────────────────────────────────────────────┘
│
▼
┌──────────────────────────────────────────────────┐
│ OPEN │
│ status = 0 │
│ │
│ Entry Condition: First player joins │
│ Actions: Accept joins, accumulate prize pool │
│ Invariant: joined_count < max_players │
└──────────────────────┬───────────────────────────┘
│
┌───────────────┴───────────────┐
│ joined_count >= min_players │
└───────────────┬───────────────┘
▼
┌──────────────────────────────────────────────────┐
│ COUNTDOWN │
│ status = 1 │
│ │
│ Transition: Auto-triggered on min_players │
│ Actions: Continue accepting joins, timer runs │
└──────────────────────┬───────────────────────────┘
│
┌───────────────┴───────────────┐
│ Timeout OR max_players reached│
└───────────────┬───────────────┘
▼
┌────────────────────────── ────────────────────────┐
│ SETTLED │
│ status = 2 │
│ │
│ Transition: Authority calls settle_round │
│ Actions: Set seed, distribute prizes, points │
│ Terminal: No further state changes │
└──────────────────────────────────────────────────┘
Fee Distribution Flow
┌─────────────────────────────────────────────────────────────────────────────┐
│ FEE DISTRIBUTION MODEL │
├─────────────────────────────────────────────────────────────────────────────┤
│ │
│ Player Payment │
│ total = entry_lamports + take_profit │
│ │ │
│ ▼ │
│ ┌────────────────────────────────────────────────────────────────────┐ │
│ │ PRIMARY SPLIT (80/20) │ │
│ └────────────────────────────────────────────────────────────────────┘ │
│ │ │ │
│ │ 80% │ 20% │
│ ▼ ▼ │
│ ┌────────────┐ ┌─────────────────────────────────┐ │
│ │ VAULT │ │ PROTOCOL FEES │ │
│ │ Prize Pool │ │ │ │
│ └────────────┘ └─────────────────────────────────┘ │
│ │ │ │
│ │ ┌──────────┴──────────┐ │
│ │ │ │ │
│ │ ┌────┴────┐ ┌─────┴─────┐ │
│ │ │ 50% │ │ 50% │ │
│ │ │ LP Vault│ │ Dev Split │ │
│ │ └─────────┘ └─────┬─────┘ │
│ │ │ │
│ │ ┌────┴────┐ │
│ │ ┌────┴───┐ ┌───┴────┐ │
│ │ │ 90% │ │ 10% │ │
│ │ │ Dev │ │Referral│ │
│ │ │ Wallet │ │ Vault │ │
│ ▼ └────────┘ └────────┘ │
│ ┌────────────────────────────────────────────────────────────────────┐ │
│ │ PRIZE DISTRIBUTION │ │
│ │ 70% Bounty (kill rewards) + 30% Survival (winner) │ │
│ └────────────────────────────────────────────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────────────────┘
Seed Generation Pipeline
┌─────────────────────────────────────────────────────────────────────────────┐
│ SEED GENERATION PIPELINE │
├─────────────────────────────────────────────────────────────────────────────┤
│ │
│ 1. PRE-GENERATION (Before any games) │
│ ┌─────────────────────────────────────────────────────────────────┐ │
│ │ ICP Canister generates N random seeds │ │
│ │ Seeds stored encrypted, Merkle tree computed │ │
│ │ Root hash published on Solana │ │
│ └─────────────────────────────────────────────────────────────────┘ │
│ │ │
│ ▼ │
│ 2. ROUND SETTLEMENT │
│ ┌─────────────────────────────────────────────────────────────────┐ │
│ │ Round ends → Request seed for round N │ │
│ │ ICP decrypts and returns: seed + Merkle proof │ │
│ │ Solana verifies proof against stored root │ │
│ └─────────────────────────────────────────────────────────────────┘ │
│ │ │
│ ▼ │
│ 3. DETERMINISTIC SIMULATION │
│ ┌─────────────────────────────────────────────────────────────────┐ │
│ │ seed → PRNG → physics simulation → results │ │
│ │ Anyone can verify: same seed = same outcome │ │
│ └─────────────────────────────────────────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────────────────┘
Token Emission Flow
┌─────────────────────────────────────────────────────────────────────────────┐
│ TOKEN EMISSION FLOW │
├─────────────────────────────────────────────────────────────────────────────┤