Skip to Content
BackendFeature Tracking

Backend Feature Tracking

Last Updated: April 2026

Legend

SymbolMeaning
✅Implemented
🔵V2 (Future)

Overall Progress Summary

ModuleV1 ProgressStatusBDD Tests
Trading Account✅ 100%✅✅
Market Data Integration✅ 100%✅✅
Position Management (OMS)✅ 100%✅✅
Position Tracking✅ 100%✅✅
Risk Management✅ 100%✅✅
Challenge Rules✅ 100%✅✅
Anti-Cheat (V1)✅ 100%✅✅
Challenge List✅ 100%✅✅
Challenge Details✅ 100%✅✅
Live Challenge✅ 100%✅✅
End Challenge✅ 100%✅✅
Challenge Lifecycle✅ 100%✅✅
Analytics/Dashboard✅ 100%✅✅
Wallet/Settlement✅ 100%✅✅
Achievements✅ 100%✅✅
Notifications✅ 100%✅✅
Room-Based Matching✅ 100%✅✅
Social (Friends)✅ 100%✅✅
Match Lifecycle✅ 100%✅✅

V1 Complete. 110 BDD scenarios, all passing. See BDD Test Results for details.

V2 Features (Not in V1 scope)

  • Anti-cheat ML: latency analysis, copy-trade detection, bot detection
  • Stop-limit / OCO / trailing stop orders
  • Crypto futures and forex market data
  • Friend messaging, presence, groups
  • Advanced analytics: Sharpe ratio, VaR, cohort analysis, consistency score
  • Multi-provider market data (beyond Binance)
  • Rate limit handling for Binance API
  • Challenge prerequisites and seasonal events
  • Max order size limit
  • User-created challenges (P2P)
  • Upcoming/scheduled match status
  • Solana key management (KMS/Vault), WAF, DDoS protection, API versioning

1. Trading Account

Account Types

FeatureStatusDescriptionFile Reference
Real Wallet (Entry Fees)✅Solana HD wallet for real crypto paymentswallet_usecase.go
Virtual Trading Balance✅Per-match v_balance used for paper tradinggame_match_participant.go:23
Multiple accounts per user🔵 V2Allow users to have multiple trading accounts-

Account Information

FeatureStatusDescriptionFile Reference
Account ID✅Unique user UUID serves as account identifieruser.go
Balance (Real)✅Real cryptocurrency balance stored in Wallet.balancewallet.go:22
Balance (Virtual)✅Virtual trading balance per match participantgame_match_participant.go:23
Equity✅Total account value including unrealized PnL via participantEquity querygame_match.resolvers.go:34
Margin✅Amount locked per position (size / leverage)game_match_position.go:26
Free Margin✅Available margin (equity - used margin) via participantEquity querygame_match.resolvers.go:80
Leverage✅Position leverage (1x-100x). Free up to 10x, higher requires inventory itemgame_match_position.go:27
Market Data Provider✅Binance spot prices via WebSocket with exponential backoff reconnectbinance_client.go

2. Market Data Integration

Integration

FeatureStatusDescriptionFile Reference
API Connection (Read-only)✅Binance REST + WebSocket for real-time updatesbinance_client.go:30-108
Provider Interface✅Two-layer abstraction: adapter Client + domain MarketServicemarket.go, market_service.go
Reconnect Logic✅Exponential backoff (1s to 30s max), auto-reset after 1min sustained connectionbinance_client.go:138-222
Market Status Check✅Validates symbol has TRADING status before allowing positionsbinance_client.go:88
Rate Limit Handling🔵 V2No rate limiting implementation yet-

Supported Assets

FeatureStatusDescriptionFile Reference
Crypto (Spot Prices)✅Real-time spot prices from Binancebinance_client.go
Symbols Whitelist✅Per-challenge configurable via allowed_symbols fieldgame.go:51, game_usecase.go:659
Crypto Futures🔵 V2Would require different Binance endpoints-
Forex🔵 V2Would need different data provider-

3. Position Management (Order Management System)

Order Types

FeatureStatusDescriptionFile Reference
Market✅Immediate execution at current price with 10% slippage checkgame_match_position.go:30
Limit✅Execute when price reaches specified levelgame_match_position.go:30
Stop / Stop-Limit / OCO🔵 V2Trigger orders at stop level-

Order Lifecycle

FeatureStatusDescriptionFile Reference
Create✅Create with margin, leverage, entry price, SL/TP. 9+ validation checksgame_usecase.go:625
Modify✅Update stop loss and take profit levels on open positionsgame_usecase.go:493
Cancel✅Cancel pending orders. Refunds margin to virtual balancegame_usecase.go:426
Partial Close✅Close percentage of position (1-100%). Creates new closed recordgame_usecase_calc.go:417
Fill✅Position transitions from pending to open when entry conditions metgame_usecase_calc.go:165
Rejection✅9 rejection reasons: balance, max positions, symbol, leverage, direction, frequency, disqualified, trading locked, max loss per tradegame_usecase.go:649-757

Order Controls

FeatureStatusDescriptionFile Reference
Slippage Limit✅10% max slippage for market ordersgame_usecase_calc.go:21
Risk per Trade✅max_loss_per_trade_pct — limit margin as percentage of starting balancegame.go:49, game_usecase.go:747
Cooldown Between Trades✅max_trades_per_minute — prevent rapid-fire tradesgame.go:56, game_usecase.go:691
Max Order Size🔵 V2Currently limited by v_balance only-

4. Position Tracking

FeatureStatusDescriptionFile Reference
Open Positions List✅Query all open positions for a participantgame_usecase.go:687
Position Size✅margin * leverage in quote currencygame_match_position.go:40
Entry Price✅Stored on creationgame_match_position.go:24
Mark Price✅Current market price from Binance WebSocketgame_usecase_calc.go:39
Unrealized PnL✅Real-time via NATS notifications + participantEquity querygame_usecase_calc.go:504
Realized PnL✅Final profit/loss stored on position closegame_match_position.go:39
Liquidation Price✅Calculated based on leveragegame_match_position.go:41
Auto-Close (Liquidation)✅Position closed when mark price reaches liquidation pricegame_usecase_calc.go:571
Auto-Close (SL/TP)✅Position closed when stop loss or take profit hitgame_usecase_calc.go:254-270

5. Risk Management Engine

Risk Rules

FeatureStatusDescriptionFile Reference
Max Leverage Enforcement✅Per-challenge max_leverage + free up to 10xgame.go:52, game_usecase.go:676
Max Drawdown (Daily)✅max_daily_drawdown_pct — auto-disqualify on breachgame.go:47, game_usecase_calc.go:683
Max Drawdown (Total)✅max_total_drawdown_pct — auto-disqualify on breachgame.go:48, game_usecase_calc.go:671
Max Loss per Trade✅max_loss_per_trade_pct — reject oversized positionsgame.go:49, game_usecase.go:747
Max Number of Trades✅max_positions per gamegame.go:38
Forced Close Logic✅Admin force close + rule-based closure on drawdown breachgame_usecase.go:530, game_usecase_calc.go:228
Auto-Disqualification✅Automatic on drawdown breach. Sets is_disqualified, disqualification_reasongame_usecase_calc.go:699
Peak Balance Tracking✅peak_v_balance updated every price tick for drawdown calculationgame_usecase_calc.go:662

Kill Switch

FeatureStatusDescriptionFile Reference
Force Close Match✅Admin closes match and settles rewardsgame_usecase.go:530, game.graphqls:55
Lock Trading✅Prevent new positions while allowing existing to closegame_usecase.go:539, game.graphqls:58
Emergency Stop✅Lock trading on ALL open matches platform-widegame_usecase.go:549, game.graphqls:64

6. Challenge Rule Engine

FeatureStatusDescriptionFile Reference
Allowed Symbols✅Per-challenge list of tradeable symbolsgame.go:51, game_usecase.go:659
Time Window✅Match start and end timesgame_match.go:22-23
Trade Direction Limits✅long_only, short_only, or both per challengegame.go:53, game_usecase.go:681
Minimum Trades✅Required trade count for ranking eligibilitygame.go:54, game_usecase_close.go:159
Profit Target✅Auto-close positions when profit target reachedgame.go:55, game_usecase_calc.go:601
Drawdown Rules✅Per-challenge daily/total drawdown limitsgame.go:47-48
Trading Frequency✅max_trades_per_minute — prevent HFT-like behaviorgame.go:56, game_usecase.go:691
Win Condition✅Highest v_balance at match end winsgame_usecase_close.go:238
Pre-execution Validation✅Comprehensive: balance, max positions, symbol, leverage, direction, frequency, disqualified, trading locked, max lossgame_usecase.go:625-757
Difficulty Tag✅beginner, intermediate, expert per gamegame.go:57

7. Trade Monitoring & Anti-Cheat

FeatureStatusDescriptionFile Reference
Trade Audit Logs✅Structured trade_audit_log with 9 event typestrade_audit_log.go
Account Suspension✅is_suspended, suspended_at, suspension_reason on User. Blocks JoinMatchuser.go:33, game_usecase.go:397
Suspend/Unsuspend Mutations✅Admin can suspend and unsuspend usersuser.graphqls:42-45
Audit Log Writes✅Written at position create, close, cancel, liquidate, disqualify, match cancel/closegame_usecase.go:818
Latency Checks🔵 V2Detect abnormally fast trade execution-
Copy-Trading Detection🔵 V2Detect if players are copying trades-
ML-Based Detection🔵 V2Abnormal behavior detection-
Warning System🔵 V2Issue warnings before disqualification-

8. Challenge List (API/UI Data)

FeatureStatusDescriptionFile Reference
Name✅Challenge titlegame.go:32
Entry Fee✅Amount required to joingame.go:40
Reward Pool✅Prize amount for winnergame.go:44
Min/Max Participants✅Player count limitsgame.go:36-37
Start Time✅When match trading beginsgame_match.go:22
Duration✅Trading period lengthgame.go:35
Status✅waiting, open, closed, canceled, archivedgame_match.go:21
Difficulty Tag✅beginner, intermediate, expertgame.go:57

9. Challenge Details

FeatureStatusDescriptionFile Reference
Allowed Markets✅Per-challenge allowed_symbolsgame.go:51
Max Leverage✅Per-challenge leverage limitgame.go:52
Drawdown Rules✅Per-challenge max drawdown percentagesgame.go:47-48
Minimum Trades✅Required trade count for valid participationgame.go:54
Win Condition✅Highest v_balance at match endgame_usecase_close.go:238
Disqualification Rules✅Auto-DQ on drawdown breach, blocked from tradinggame_usecase_calc.go:699
Refund Logic✅Entry fee refund on match cancellationgame_usecase.go:549
Margin Type🔵 V2Isolated vs cross margin-

10. Live Challenge

FeatureStatusDescriptionFile Reference
Real-Time Ranking✅Live ranking by v_balancegame_usecase_close.go:238
PnL Updates✅Real-time PnL notifications via NATSgame_usecase_calc.go:504
Drawdown Tracking✅peak_v_balance tracked every price tickgame_usecase_calc.go:662
Trades Count✅Number of positions tracked per participant-
Status Indicators✅Position status notifications (opened, closed, liquidated)game_usecase_calc.go:560
Rule Breach Detection✅Real-time drawdown + profit target checks in arena PnL loopgame_usecase_calc.go:221-249
Anti-Cheat Checks🔵 V2Real-time cheat detection during match-

11. End Challenge

FeatureStatusDescriptionFile Reference
Final Ranking✅Calculate final positions by v_balancegame_usecase_close.go:238
Reward Distribution (Money)✅Transfer reward_price to winner’s walletgame_usecase_close.go:197
Reward Distribution (Items)✅Grant consumable items to winner via inventorygame_usecase_close.go:279
XP Calculation✅Award XP based on win_exp or lose_expgame_usecase_close.go:206
Cup Points✅Winner gains cups, losers lose cupsgame_usecase_close.go:255
Achievement Unlock✅Trigger achievement evaluation via Temporalgame_usecase_close.go:125
Wallet Settlement✅Update wallet balances with final settlementsgame_usecase_close.go:294
Challenge Summary✅matchSummary query: total trades, best/worst PnL, max drawdown, durationanalytics_usecase.go:196

12. Challenge Lifecycle

StatusImplementedDescription
Created✅Game entity exists as template
Waiting✅Match room created, players joining
Live (Open)✅Trading is active
Finished (Closed)✅Trading ended, settled
Canceled✅Match canceled, fees refunded
Archived✅Old matches moved to archive

13. Trade History & Analytics

FeatureStatusDescriptionFile Reference
Full Trade History✅All position records stored with full details-
Filter by Challenge✅Query positions by match ID-
Win Rate✅Percentage of profitable matches in UserPerformanceanalytics_usecase.go:80
Avg ROI✅Average return on investment across all participationsanalytics_usecase.go:104
Max Drawdown✅Largest peak-to-trough decline across participationsanalytics_usecase.go:110
Dashboard Stats✅Total users, active matches, total matches, total revenueanalytics_usecase.go:35
Leaderboard✅Time-windowed leaderboards (all-time, weekly, monthly)analytics_usecase.go:133
Match Summary✅Per-match summary: trades, participants, best/worst PnL, drawdownanalytics_usecase.go:196
Consistency Score🔵 V2Measure of trading consistency-

Supporting Systems

Wallet & Settlement

FeatureStatusDescription
Balance Management✅Real-time balance tracking with atomic updates
Locked Funds✅Lock funds during pending operations
Deposit✅Solana blockchain deposits
Withdraw✅Solana blockchain withdrawals
HD Wallet✅Hierarchical deterministic wallet derivation
Transaction History✅Full audit trail of all transactions

Achievement System

FeatureStatusDescription
Achievement CRUD✅Create, read, update, delete achievements
Rules Engine✅JSON-based achievement rules
User Achievements✅Track user progress on achievements
Progress Tracking✅Incremental progress towards completion
Temporal Workflows✅Async achievement processing

Notification System

FeatureStatusDescription
In-App (NATS)✅Real-time notifications via JetStream
Notification Center✅Persistent notification_record with read/unread, paginated queries
Email (OTP)✅OTP codes for authentication
Push (Firebase)✅Mobile push notifications
Position Updates✅Real-time PnL notifications
Match Events✅Match start/end notifications

Room-Based Matching

FeatureStatusDescription
Admin Creates Rooms✅createMatch creates a room in “waiting” status
Direct Join✅joinMatch — player joins specific room directly
Min/Max Players✅Configurable player limits per game
Balance Verification✅Pre-join balance check
Auto-Start✅Match auto-starts when max_players reached
Manual Start✅Admin can manually start a waiting match

Social (Friends)

FeatureStatusDescription
Send Friend Request✅Request sent, stored as pending
Accept/Reject Request✅Recipient can accept or reject
Remove Friend✅Either party can remove friendship
List Friends✅Paginated friends list
Pending Requests✅Query pending incoming requests
Duplicate Prevention✅Cannot send duplicate requests
Self-Request Prevention✅Cannot friend yourself

Game Creation

FeatureStatusDescription
Admin Game Creation✅Admins create game templates via GraphQL
User Game Creation🔵 V2Feature flag for user-created challenges

Test Coverage Summary

ModuleUnit TestsBDD TestsCoverage
Authentication✅✅ (OTP, login, refresh, inactive)High
User✅✅ (CRUD, suspend, pagination)High
Wallet✅✅ (create, deposit, withdraw, insufficient)High
Transaction✅✅ (deposit, withdraw, list)High
Game✅✅ (full lifecycle)High
Position✅✅ (open/close/SL/TP)High
Risk Management-✅ (drawdown, DQ, kill switch)High
Challenge Rules-✅ (symbols, leverage, direction, frequency)High
Achievement✅✅ (CRUD, list)High
Consumable✅✅ (CRUD, apply EXP/VBalance)High
Market (Binance)✅✅ (price set/change, multi-asset)High
Matchmaking✅✅ (room model)High
Friends✅✅ (5 scenarios)High
Analytics-✅ (dashboard, leaderboard, summary, emergency stop)High
Notification✅✅ (OTP capture, in-app, count)High

Test Files

BDD Test Suites (23 feature files, 110 scenarios):

See BDD Test Results for the full scenario list.

Unit Test Files (44 total): *_test.go files across usecases, resolvers, and adapters.

Last updated on