feat: add experience improvement module and system config storage (#1248)

- Add experience module for product telemetry
- Add system_config table for persistent settings
- Update privacy policy documentation
This commit is contained in:
tinkle-community
2025-12-19 13:57:08 +08:00
committed by GitHub
parent c81e6b0094
commit 97f58b49f4
12 changed files with 409 additions and 4 deletions

View File

@@ -5,6 +5,7 @@ import (
"fmt"
"math"
"nofx/decision"
"nofx/experience"
"nofx/logger"
"nofx/market"
"nofx/mcp"
@@ -1710,6 +1711,18 @@ func (at *AutoTrader) recordAndConfirmOrder(orderResult map[string]interface{},
// Record position change with actual fill data
at.recordPositionChange(orderID, symbol, positionSide, action, actualQty, actualPrice, leverage, entryPrice, fee)
// Send anonymous trade statistics for experience improvement (async, non-blocking)
// This helps us understand overall product usage across all deployments
experience.TrackTrade(experience.TradeEvent{
Exchange: at.exchange,
TradeType: action,
Symbol: symbol,
AmountUSD: actualPrice * actualQty,
Leverage: leverage,
UserID: at.userID,
TraderID: at.id,
})
}
// recordPositionChange records position change (create record on open, update record on close)