mirror of
https://github.com/NoFxAiOS/nofx.git
synced 2026-07-13 07:46:54 +08:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user