Backend Feature Tracking
Last Updated: April 2026
Legend
| Symbol | Meaning |
|---|---|
| ✅ | Implemented |
| 🔵 | V2 (Future) |
Overall Progress Summary
| Module | V1 Progress | Status | BDD 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
| Feature | Status | Description | File Reference |
|---|---|---|---|
| Real Wallet (Entry Fees) | ✅ | Solana HD wallet for real crypto payments | wallet_usecase.go |
| Virtual Trading Balance | ✅ | Per-match v_balance used for paper trading | game_match_participant.go:23 |
| Multiple accounts per user | 🔵 V2 | Allow users to have multiple trading accounts | - |
Account Information
| Feature | Status | Description | File Reference |
|---|---|---|---|
| Account ID | ✅ | Unique user UUID serves as account identifier | user.go |
| Balance (Real) | ✅ | Real cryptocurrency balance stored in Wallet.balance | wallet.go:22 |
| Balance (Virtual) | ✅ | Virtual trading balance per match participant | game_match_participant.go:23 |
| Equity | ✅ | Total account value including unrealized PnL via participantEquity query | game_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 query | game_match.resolvers.go:80 |
| Leverage | ✅ | Position leverage (1x-100x). Free up to 10x, higher requires inventory item | game_match_position.go:27 |
| Market Data Provider | ✅ | Binance spot prices via WebSocket with exponential backoff reconnect | binance_client.go |
2. Market Data Integration
Integration
| Feature | Status | Description | File Reference |
|---|---|---|---|
| API Connection (Read-only) | ✅ | Binance REST + WebSocket for real-time updates | binance_client.go:30-108 |
| Provider Interface | ✅ | Two-layer abstraction: adapter Client + domain MarketService | market.go, market_service.go |
| Reconnect Logic | ✅ | Exponential backoff (1s to 30s max), auto-reset after 1min sustained connection | binance_client.go:138-222 |
| Market Status Check | ✅ | Validates symbol has TRADING status before allowing positions | binance_client.go:88 |
| Rate Limit Handling | 🔵 V2 | No rate limiting implementation yet | - |
Supported Assets
| Feature | Status | Description | File Reference |
|---|---|---|---|
| Crypto (Spot Prices) | ✅ | Real-time spot prices from Binance | binance_client.go |
| Symbols Whitelist | ✅ | Per-challenge configurable via allowed_symbols field | game.go:51, game_usecase.go:659 |
| Crypto Futures | 🔵 V2 | Would require different Binance endpoints | - |
| Forex | 🔵 V2 | Would need different data provider | - |
3. Position Management (Order Management System)
Order Types
| Feature | Status | Description | File Reference |
|---|---|---|---|
| Market | ✅ | Immediate execution at current price with 10% slippage check | game_match_position.go:30 |
| Limit | ✅ | Execute when price reaches specified level | game_match_position.go:30 |
| Stop / Stop-Limit / OCO | 🔵 V2 | Trigger orders at stop level | - |
Order Lifecycle
| Feature | Status | Description | File Reference |
|---|---|---|---|
| Create | ✅ | Create with margin, leverage, entry price, SL/TP. 9+ validation checks | game_usecase.go:625 |
| Modify | ✅ | Update stop loss and take profit levels on open positions | game_usecase.go:493 |
| Cancel | ✅ | Cancel pending orders. Refunds margin to virtual balance | game_usecase.go:426 |
| Partial Close | ✅ | Close percentage of position (1-100%). Creates new closed record | game_usecase_calc.go:417 |
| Fill | ✅ | Position transitions from pending to open when entry conditions met | game_usecase_calc.go:165 |
| Rejection | ✅ | 9 rejection reasons: balance, max positions, symbol, leverage, direction, frequency, disqualified, trading locked, max loss per trade | game_usecase.go:649-757 |
Order Controls
| Feature | Status | Description | File Reference |
|---|---|---|---|
| Slippage Limit | ✅ | 10% max slippage for market orders | game_usecase_calc.go:21 |
| Risk per Trade | ✅ | max_loss_per_trade_pct — limit margin as percentage of starting balance | game.go:49, game_usecase.go:747 |
| Cooldown Between Trades | ✅ | max_trades_per_minute — prevent rapid-fire trades | game.go:56, game_usecase.go:691 |
| Max Order Size | 🔵 V2 | Currently limited by v_balance only | - |
4. Position Tracking
| Feature | Status | Description | File Reference |
|---|---|---|---|
| Open Positions List | ✅ | Query all open positions for a participant | game_usecase.go:687 |
| Position Size | ✅ | margin * leverage in quote currency | game_match_position.go:40 |
| Entry Price | ✅ | Stored on creation | game_match_position.go:24 |
| Mark Price | ✅ | Current market price from Binance WebSocket | game_usecase_calc.go:39 |
| Unrealized PnL | ✅ | Real-time via NATS notifications + participantEquity query | game_usecase_calc.go:504 |
| Realized PnL | ✅ | Final profit/loss stored on position close | game_match_position.go:39 |
| Liquidation Price | ✅ | Calculated based on leverage | game_match_position.go:41 |
| Auto-Close (Liquidation) | ✅ | Position closed when mark price reaches liquidation price | game_usecase_calc.go:571 |
| Auto-Close (SL/TP) | ✅ | Position closed when stop loss or take profit hit | game_usecase_calc.go:254-270 |
5. Risk Management Engine
Risk Rules
| Feature | Status | Description | File Reference |
|---|---|---|---|
| Max Leverage Enforcement | ✅ | Per-challenge max_leverage + free up to 10x | game.go:52, game_usecase.go:676 |
| Max Drawdown (Daily) | ✅ | max_daily_drawdown_pct — auto-disqualify on breach | game.go:47, game_usecase_calc.go:683 |
| Max Drawdown (Total) | ✅ | max_total_drawdown_pct — auto-disqualify on breach | game.go:48, game_usecase_calc.go:671 |
| Max Loss per Trade | ✅ | max_loss_per_trade_pct — reject oversized positions | game.go:49, game_usecase.go:747 |
| Max Number of Trades | ✅ | max_positions per game | game.go:38 |
| Forced Close Logic | ✅ | Admin force close + rule-based closure on drawdown breach | game_usecase.go:530, game_usecase_calc.go:228 |
| Auto-Disqualification | ✅ | Automatic on drawdown breach. Sets is_disqualified, disqualification_reason | game_usecase_calc.go:699 |
| Peak Balance Tracking | ✅ | peak_v_balance updated every price tick for drawdown calculation | game_usecase_calc.go:662 |
Kill Switch
| Feature | Status | Description | File Reference |
|---|---|---|---|
| Force Close Match | ✅ | Admin closes match and settles rewards | game_usecase.go:530, game.graphqls:55 |
| Lock Trading | ✅ | Prevent new positions while allowing existing to close | game_usecase.go:539, game.graphqls:58 |
| Emergency Stop | ✅ | Lock trading on ALL open matches platform-wide | game_usecase.go:549, game.graphqls:64 |
6. Challenge Rule Engine
| Feature | Status | Description | File Reference |
|---|---|---|---|
| Allowed Symbols | ✅ | Per-challenge list of tradeable symbols | game.go:51, game_usecase.go:659 |
| Time Window | ✅ | Match start and end times | game_match.go:22-23 |
| Trade Direction Limits | ✅ | long_only, short_only, or both per challenge | game.go:53, game_usecase.go:681 |
| Minimum Trades | ✅ | Required trade count for ranking eligibility | game.go:54, game_usecase_close.go:159 |
| Profit Target | ✅ | Auto-close positions when profit target reached | game.go:55, game_usecase_calc.go:601 |
| Drawdown Rules | ✅ | Per-challenge daily/total drawdown limits | game.go:47-48 |
| Trading Frequency | ✅ | max_trades_per_minute — prevent HFT-like behavior | game.go:56, game_usecase.go:691 |
| Win Condition | ✅ | Highest v_balance at match end wins | game_usecase_close.go:238 |
| Pre-execution Validation | ✅ | Comprehensive: balance, max positions, symbol, leverage, direction, frequency, disqualified, trading locked, max loss | game_usecase.go:625-757 |
| Difficulty Tag | ✅ | beginner, intermediate, expert per game | game.go:57 |
7. Trade Monitoring & Anti-Cheat
| Feature | Status | Description | File Reference |
|---|---|---|---|
| Trade Audit Logs | ✅ | Structured trade_audit_log with 9 event types | trade_audit_log.go |
| Account Suspension | ✅ | is_suspended, suspended_at, suspension_reason on User. Blocks JoinMatch | user.go:33, game_usecase.go:397 |
| Suspend/Unsuspend Mutations | ✅ | Admin can suspend and unsuspend users | user.graphqls:42-45 |
| Audit Log Writes | ✅ | Written at position create, close, cancel, liquidate, disqualify, match cancel/close | game_usecase.go:818 |
| Latency Checks | 🔵 V2 | Detect abnormally fast trade execution | - |
| Copy-Trading Detection | 🔵 V2 | Detect if players are copying trades | - |
| ML-Based Detection | 🔵 V2 | Abnormal behavior detection | - |
| Warning System | 🔵 V2 | Issue warnings before disqualification | - |
8. Challenge List (API/UI Data)
| Feature | Status | Description | File Reference |
|---|---|---|---|
| Name | ✅ | Challenge title | game.go:32 |
| Entry Fee | ✅ | Amount required to join | game.go:40 |
| Reward Pool | ✅ | Prize amount for winner | game.go:44 |
| Min/Max Participants | ✅ | Player count limits | game.go:36-37 |
| Start Time | ✅ | When match trading begins | game_match.go:22 |
| Duration | ✅ | Trading period length | game.go:35 |
| Status | ✅ | waiting, open, closed, canceled, archived | game_match.go:21 |
| Difficulty Tag | ✅ | beginner, intermediate, expert | game.go:57 |
9. Challenge Details
| Feature | Status | Description | File Reference |
|---|---|---|---|
| Allowed Markets | ✅ | Per-challenge allowed_symbols | game.go:51 |
| Max Leverage | ✅ | Per-challenge leverage limit | game.go:52 |
| Drawdown Rules | ✅ | Per-challenge max drawdown percentages | game.go:47-48 |
| Minimum Trades | ✅ | Required trade count for valid participation | game.go:54 |
| Win Condition | ✅ | Highest v_balance at match end | game_usecase_close.go:238 |
| Disqualification Rules | ✅ | Auto-DQ on drawdown breach, blocked from trading | game_usecase_calc.go:699 |
| Refund Logic | ✅ | Entry fee refund on match cancellation | game_usecase.go:549 |
| Margin Type | 🔵 V2 | Isolated vs cross margin | - |
10. Live Challenge
| Feature | Status | Description | File Reference |
|---|---|---|---|
| Real-Time Ranking | ✅ | Live ranking by v_balance | game_usecase_close.go:238 |
| PnL Updates | ✅ | Real-time PnL notifications via NATS | game_usecase_calc.go:504 |
| Drawdown Tracking | ✅ | peak_v_balance tracked every price tick | game_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 loop | game_usecase_calc.go:221-249 |
| Anti-Cheat Checks | 🔵 V2 | Real-time cheat detection during match | - |
11. End Challenge
| Feature | Status | Description | File Reference |
|---|---|---|---|
| Final Ranking | ✅ | Calculate final positions by v_balance | game_usecase_close.go:238 |
| Reward Distribution (Money) | ✅ | Transfer reward_price to winner’s wallet | game_usecase_close.go:197 |
| Reward Distribution (Items) | ✅ | Grant consumable items to winner via inventory | game_usecase_close.go:279 |
| XP Calculation | ✅ | Award XP based on win_exp or lose_exp | game_usecase_close.go:206 |
| Cup Points | ✅ | Winner gains cups, losers lose cups | game_usecase_close.go:255 |
| Achievement Unlock | ✅ | Trigger achievement evaluation via Temporal | game_usecase_close.go:125 |
| Wallet Settlement | ✅ | Update wallet balances with final settlements | game_usecase_close.go:294 |
| Challenge Summary | ✅ | matchSummary query: total trades, best/worst PnL, max drawdown, duration | analytics_usecase.go:196 |
12. Challenge Lifecycle
| Status | Implemented | Description |
|---|---|---|
| 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
| Feature | Status | Description | File 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 UserPerformance | analytics_usecase.go:80 |
| Avg ROI | ✅ | Average return on investment across all participations | analytics_usecase.go:104 |
| Max Drawdown | ✅ | Largest peak-to-trough decline across participations | analytics_usecase.go:110 |
| Dashboard Stats | ✅ | Total users, active matches, total matches, total revenue | analytics_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, drawdown | analytics_usecase.go:196 |
| Consistency Score | 🔵 V2 | Measure of trading consistency | - |
Supporting Systems
Wallet & Settlement
| Feature | Status | Description |
|---|---|---|
| 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
| Feature | Status | Description |
|---|---|---|
| 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
| Feature | Status | Description |
|---|---|---|
| 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
| Feature | Status | Description |
|---|---|---|
| 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)
| Feature | Status | Description |
|---|---|---|
| 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
| Feature | Status | Description |
|---|---|---|
| Admin Game Creation | ✅ | Admins create game templates via GraphQL |
| User Game Creation | 🔵 V2 | Feature flag for user-created challenges |
Test Coverage Summary
| Module | Unit Tests | BDD Tests | Coverage |
|---|---|---|---|
| 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