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 BalancePer-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 IDUnique 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
EquityTotal account value including unrealized PnL via participantEquity querygame_match.resolvers.go:34
MarginAmount locked per position (size / leverage)game_match_position.go:26
Free MarginAvailable margin (equity - used margin) via participantEquity querygame_match.resolvers.go:80
LeveragePosition leverage (1x-100x). Free up to 10x, higher requires inventory itemgame_match_position.go:27
Market Data ProviderBinance 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 InterfaceTwo-layer abstraction: adapter Client + domain MarketServicemarket.go, market_service.go
Reconnect LogicExponential backoff (1s to 30s max), auto-reset after 1min sustained connectionbinance_client.go:138-222
Market Status CheckValidates 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 WhitelistPer-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
MarketImmediate execution at current price with 10% slippage checkgame_match_position.go:30
LimitExecute when price reaches specified levelgame_match_position.go:30
Stop / Stop-Limit / OCO🔵 V2Trigger orders at stop level-

Order Lifecycle

FeatureStatusDescriptionFile Reference
CreateCreate with margin, leverage, entry price, SL/TP. 9+ validation checksgame_usecase.go:625
ModifyUpdate stop loss and take profit levels on open positionsgame_usecase.go:493
CancelCancel pending orders. Refunds margin to virtual balancegame_usecase.go:426
Partial CloseClose percentage of position (1-100%). Creates new closed recordgame_usecase_calc.go:417
FillPosition transitions from pending to open when entry conditions metgame_usecase_calc.go:165
Rejection9 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 Limit10% max slippage for market ordersgame_usecase_calc.go:21
Risk per Trademax_loss_per_trade_pct — limit margin as percentage of starting balancegame.go:49, game_usecase.go:747
Cooldown Between Tradesmax_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 ListQuery all open positions for a participantgame_usecase.go:687
Position Sizemargin * leverage in quote currencygame_match_position.go:40
Entry PriceStored on creationgame_match_position.go:24
Mark PriceCurrent market price from Binance WebSocketgame_usecase_calc.go:39
Unrealized PnLReal-time via NATS notifications + participantEquity querygame_usecase_calc.go:504
Realized PnLFinal profit/loss stored on position closegame_match_position.go:39
Liquidation PriceCalculated 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 EnforcementPer-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 Trademax_loss_per_trade_pct — reject oversized positionsgame.go:49, game_usecase.go:747
Max Number of Tradesmax_positions per gamegame.go:38
Forced Close LogicAdmin force close + rule-based closure on drawdown breachgame_usecase.go:530, game_usecase_calc.go:228
Auto-DisqualificationAutomatic on drawdown breach. Sets is_disqualified, disqualification_reasongame_usecase_calc.go:699
Peak Balance Trackingpeak_v_balance updated every price tick for drawdown calculationgame_usecase_calc.go:662

Kill Switch

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

6. Challenge Rule Engine

FeatureStatusDescriptionFile Reference
Allowed SymbolsPer-challenge list of tradeable symbolsgame.go:51, game_usecase.go:659
Time WindowMatch start and end timesgame_match.go:22-23
Trade Direction Limitslong_only, short_only, or both per challengegame.go:53, game_usecase.go:681
Minimum TradesRequired trade count for ranking eligibilitygame.go:54, game_usecase_close.go:159
Profit TargetAuto-close positions when profit target reachedgame.go:55, game_usecase_calc.go:601
Drawdown RulesPer-challenge daily/total drawdown limitsgame.go:47-48
Trading Frequencymax_trades_per_minute — prevent HFT-like behaviorgame.go:56, game_usecase.go:691
Win ConditionHighest v_balance at match end winsgame_usecase_close.go:238
Pre-execution ValidationComprehensive: balance, max positions, symbol, leverage, direction, frequency, disqualified, trading locked, max lossgame_usecase.go:625-757
Difficulty Tagbeginner, intermediate, expert per gamegame.go:57

7. Trade Monitoring & Anti-Cheat

FeatureStatusDescriptionFile Reference
Trade Audit LogsStructured trade_audit_log with 9 event typestrade_audit_log.go
Account Suspensionis_suspended, suspended_at, suspension_reason on User. Blocks JoinMatchuser.go:33, game_usecase.go:397
Suspend/Unsuspend MutationsAdmin can suspend and unsuspend usersuser.graphqls:42-45
Audit Log WritesWritten 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
NameChallenge titlegame.go:32
Entry FeeAmount required to joingame.go:40
Reward PoolPrize amount for winnergame.go:44
Min/Max ParticipantsPlayer count limitsgame.go:36-37
Start TimeWhen match trading beginsgame_match.go:22
DurationTrading period lengthgame.go:35
Statuswaiting, open, closed, canceled, archivedgame_match.go:21
Difficulty Tagbeginner, intermediate, expertgame.go:57

9. Challenge Details

FeatureStatusDescriptionFile Reference
Allowed MarketsPer-challenge allowed_symbolsgame.go:51
Max LeveragePer-challenge leverage limitgame.go:52
Drawdown RulesPer-challenge max drawdown percentagesgame.go:47-48
Minimum TradesRequired trade count for valid participationgame.go:54
Win ConditionHighest v_balance at match endgame_usecase_close.go:238
Disqualification RulesAuto-DQ on drawdown breach, blocked from tradinggame_usecase_calc.go:699
Refund LogicEntry fee refund on match cancellationgame_usecase.go:549
Margin Type🔵 V2Isolated vs cross margin-

10. Live Challenge

FeatureStatusDescriptionFile Reference
Real-Time RankingLive ranking by v_balancegame_usecase_close.go:238
PnL UpdatesReal-time PnL notifications via NATSgame_usecase_calc.go:504
Drawdown Trackingpeak_v_balance tracked every price tickgame_usecase_calc.go:662
Trades CountNumber of positions tracked per participant-
Status IndicatorsPosition status notifications (opened, closed, liquidated)game_usecase_calc.go:560
Rule Breach DetectionReal-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 RankingCalculate 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 CalculationAward XP based on win_exp or lose_expgame_usecase_close.go:206
Cup PointsWinner gains cups, losers lose cupsgame_usecase_close.go:255
Achievement UnlockTrigger achievement evaluation via Temporalgame_usecase_close.go:125
Wallet SettlementUpdate wallet balances with final settlementsgame_usecase_close.go:294
Challenge SummarymatchSummary query: total trades, best/worst PnL, max drawdown, durationanalytics_usecase.go:196

12. Challenge Lifecycle

StatusImplementedDescription
CreatedGame entity exists as template
WaitingMatch room created, players joining
Live (Open)Trading is active
Finished (Closed)Trading ended, settled
CanceledMatch canceled, fees refunded
ArchivedOld matches moved to archive

13. Trade History & Analytics

FeatureStatusDescriptionFile Reference
Full Trade HistoryAll position records stored with full details-
Filter by ChallengeQuery positions by match ID-
Win RatePercentage of profitable matches in UserPerformanceanalytics_usecase.go:80
Avg ROIAverage return on investment across all participationsanalytics_usecase.go:104
Max DrawdownLargest peak-to-trough decline across participationsanalytics_usecase.go:110
Dashboard StatsTotal users, active matches, total matches, total revenueanalytics_usecase.go:35
LeaderboardTime-windowed leaderboards (all-time, weekly, monthly)analytics_usecase.go:133
Match SummaryPer-match summary: trades, participants, best/worst PnL, drawdownanalytics_usecase.go:196
Consistency Score🔵 V2Measure of trading consistency-

Supporting Systems

Wallet & Settlement

FeatureStatusDescription
Balance ManagementReal-time balance tracking with atomic updates
Locked FundsLock funds during pending operations
DepositSolana blockchain deposits
WithdrawSolana blockchain withdrawals
HD WalletHierarchical deterministic wallet derivation
Transaction HistoryFull audit trail of all transactions

Achievement System

FeatureStatusDescription
Achievement CRUDCreate, read, update, delete achievements
Rules EngineJSON-based achievement rules
User AchievementsTrack user progress on achievements
Progress TrackingIncremental progress towards completion
Temporal WorkflowsAsync achievement processing

Notification System

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

Room-Based Matching

FeatureStatusDescription
Admin Creates RoomscreateMatch creates a room in “waiting” status
Direct JoinjoinMatch — player joins specific room directly
Min/Max PlayersConfigurable player limits per game
Balance VerificationPre-join balance check
Auto-StartMatch auto-starts when max_players reached
Manual StartAdmin can manually start a waiting match

Social (Friends)

FeatureStatusDescription
Send Friend RequestRequest sent, stored as pending
Accept/Reject RequestRecipient can accept or reject
Remove FriendEither party can remove friendship
List FriendsPaginated friends list
Pending RequestsQuery pending incoming requests
Duplicate PreventionCannot send duplicate requests
Self-Request PreventionCannot friend yourself

Game Creation

FeatureStatusDescription
Admin Game CreationAdmins 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