Skip to main content

Production Ready

All features below are fully implemented with PostgreSQL persistence, real Adrena data integration, and API endpoints. No mocks, no localStorage fallbacks.

Core Competition Engine

FeatureDescriptionKey Files
Leaderboard & ScoringMulti-dimensional scoring from real closed positionslib/competition/engine.ts
Challenge Evaluation5-tier prop challenges with profit targets, drawdown limits, daily loss capslib/competition/engine.ts
Enrollment & Entry PaymentsOn-chain USDC enrollment via Shoot Anchor program with PDA vaultslib/solana/program.ts, programs/shoot/src/lib.rs
Settlement PipelineOn-chain USDC payouts from vault to traders on cohort settlementlib/solana/settle.ts, app/api/admin/settle/route.ts
Sybil Detection3-heuristic convergence filter (funding clustering, pattern correlation, PnL mirroring)lib/competition/sybil-detector.ts
Adrena Live AdapterReal-time position fetch from datapi.adrena.trade, metric computation, snapshot assemblylib/competition/adrena-live-adapter.ts
Projection LabInteractive what-if scoring with slider inputs against live cohort dataapp/components/projection-lab.tsx
Specialist ChallengesAsset-class restrictions (Forex, Commodities, Crypto, Multi-Asset) driving RWA adoptionlib/competition/config.ts
Cron Score Refresh5-minute automated score refresh + cohort rotation via external POST triggersapp/api/cron/refresh-scores/route.ts

Engagement Systems

FeatureDescriptionKey Files
Quests (server-side)10 quests across 3 phases, DB-backed progress tracking, trigger-based completionlib/competition/quests.ts, app/api/competition/quests/route.ts
Streaks (server-side)DB-backed streak state machine with multiplier bands (up to 5x at 10+ days)lib/competition/streaks.ts, app/api/competition/streak/route.ts
Raffle DrawingsCryptographic weighted random selection with DB persistencelib/competition/raffle.ts
Head-to-Head MatchupsPaired trader comparisons with momentum trackingapp/api/competition/matchups/route.ts
Rivalry TrackingMulti-match rivalry detection with intensity scoring and narrative tagslib/competition/rivalries.ts
Live CommentaryNarrative beat generation (rank surges, upsets, comebacks) with SSE streaming + DB persistencelib/competition/narrative.ts, app/api/competition/stream/route.ts
Spectator VotingDB-persisted votes with aggregation and crowd favorites computationapp/api/world-cup/vote/route.ts, lib/competition/spectator.ts
Desk Wars8 desks with aggregate scoring, promotion/relegation, and UIlib/competition/desks.ts, app/components/competition-funded-desk.tsx

World Cup Tournament

FeatureDescriptionKey Files
Group StageSeeded group draw with round-robin scheduling and tiebreakerslib/world-cup/group-draw.ts
Knockout BracketSingle-elimination bracket with RAROI head-to-head scoringlib/world-cup/engine.ts
Redemption BracketRe-entry path for eliminated tradersapp/api/world-cup/redemption/route.ts
4 DivisionsCrypto Cup, Metals Cup, Energy Cup, Forex Cup with division-specific market restrictionslib/world-cup/engine.ts
Live World Cup DataFetches live positions for World Cup traders from Adrena APIlib/world-cup/live-adapter.ts

Financial

FeatureDescriptionKey Files
Fee Allocation60% rewards, 25% ADX buyback, 15% raffle — computed on settlementlib/competition/engine.ts
ADX BuybackJupiter V6 swap (USDC → ADX) executed on cohort settlementlib/competition/buyback.ts
Funded Ladder (evaluation)5-tier evaluation logic (Watchlist → Partner) with point thresholdslib/competition/funded-ladder.ts

Autopilot (24/7 Autonomous Trading)

FeatureDescriptionKey Files
Autopilot SDKTypeScript SDK with 5 playbooks, risk harness, autonomous execution loopsdk/src/
TrendSurfer PlaybookMACD histogram zero-line crossover for trend detectionsdk/src/playbooks/trend-surfer.ts
FadeTrader PlaybookKeltner Channel + Stochastic confirmation fadesdk/src/playbooks/fade-trader.ts
RangeSniper PlaybookATR squeeze-expansion with VWAP directional biassdk/src/playbooks/range-sniper.ts
FundingArb PlaybookPerpetual funding rate mean-reversion (unique to perps)sdk/src/playbooks/funding-arb.ts
GridRunner PlaybookDynamic ATR-based grid around VWAP anchorsdk/src/playbooks/grid-runner.ts
IndicatorsVWAP, ATR, MACD, Stochastic, Keltner Channels — all pure functionssdk/src/indicators/
RiskHarnessRisk enforcement: ceiling leverage, exposure fraction, cut-loss, lock-gain, cooldownsdk/src/cockpit/risk-harness.ts
Agent RegistrationOn-chain agent PDA with ELO, W/L, strategy hashprograms/shoot/src/lib.rs
OracleTap Price FeedReal-time prices from Pyth Hermes with ReplayTap for testingsdk/src/feed/oracle-tap.ts

Keeper Service (Rust)

FeatureDescriptionKey Files
Yellowstone gRPC SubscriberReal-time Adrena position monitoring with auto-reconnectkeeper/src/grpc/subscriber.rs
Position DecoderBorsh deserialization of Adrena’s position structkeeper/src/grpc/decoder.rs
Scoring EnginePure-function composite score computationkeeper/src/scoring/engine.rs
Metrics SuiteNet PnL, max drawdown, Sharpe, win rate, profit factor, equity curvekeeper/src/scoring/metrics.rs
Lifecycle FSMStrict linear state machine (Upcoming → Live → Scoring → Settled)keeper/src/lifecycle/fsm.rs
REST APIHealth, competitions, agents, leaderboard, SSE, Prometheus metricskeeper/src/api/

Infrastructure

ComponentStatus
PostgreSQL (Prisma)18 models, all state persisted to DB
Anchor Program (devnet)4HVnwG8...2iMG — 11 instructions, 22 errors, 11 events
Keeper Service (Rust)Yellowstone gRPC + PostgreSQL + Axum — matches Adrena’s keeper infrastructure
Adrena Data APILive position data from datapi.adrena.trade
Health Endpoint/api/health — DB ping, latency, status
Discord WebhooksLeaderboard changes, sybil alerts, challenge completions
SSE StreamReal-time leaderboard updates + narrative beats via Server-Sent Events
Cron EndpointsScore refresh (5min) + cohort rotation (15min) via external POST triggers
Railway (Docker)Multi-stage Docker build, deployed at shoot-production-f218.up.railway.app

Phase 2 Design Proposals

These features have type definitions and UI mockups but require additional infrastructure before production:
FeatureRequiresDescription
Dynamic Risk EventsReal-time market data feed, event scheduler8 event types that modify trader metrics mid-competition
Funded Trader (on-chain)On-chain revenue share program, admin multisigRevenue share payouts on-chain (evaluation logic is implemented, distribution is not)

How to Test

npm run dev                         # http://localhost:3000 — live Adrena data
npm test                            # 278 tests (main app)
cd sdk && npm test                  # 144 tests (autopilot SDK)
cd keeper && cargo test             # 60+ tests (keeper service)
npm run build                       # production build