mirror of
https://github.com/laoxong/nofx.git
synced 2026-06-04 09:58:22 +08:00
refactor: remove all Debate Arena feature code
Remove the entire AI Debate Arena module (~5,300 lines) to simplify the codebase. This removes the multi-AI debate trading decision system including backend engine, API handlers, database store, frontend page, navigation, translations, and documentation references.
This commit is contained in:
@@ -3,8 +3,6 @@ package manager
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"nofx/debate"
|
||||
"nofx/kernel"
|
||||
"nofx/logger"
|
||||
"nofx/store"
|
||||
"nofx/trader"
|
||||
@@ -13,27 +11,6 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
// TraderExecutorAdapter wraps AutoTrader to implement debate.TraderExecutor
|
||||
type TraderExecutorAdapter struct {
|
||||
autoTrader *trader.AutoTrader
|
||||
}
|
||||
|
||||
// ExecuteDecision executes a trading decision
|
||||
func (a *TraderExecutorAdapter) ExecuteDecision(d *kernel.Decision) error {
|
||||
return a.autoTrader.ExecuteDecision(d)
|
||||
}
|
||||
|
||||
// GetBalance returns account balance
|
||||
func (a *TraderExecutorAdapter) GetBalance() (map[string]interface{}, error) {
|
||||
info, err := a.autoTrader.GetAccountInfo()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to get account info: %w", err)
|
||||
}
|
||||
// Log the balance for debugging
|
||||
logger.Infof("[Debate] GetBalance for trader, result: %+v", info)
|
||||
return info, nil
|
||||
}
|
||||
|
||||
// CompetitionCache competition data cache
|
||||
type CompetitionCache struct {
|
||||
data map[string]interface{}
|
||||
@@ -764,12 +741,3 @@ func (tm *TraderManager) addTraderFromStore(traderCfg *store.Trader, aiModelCfg
|
||||
return nil
|
||||
}
|
||||
|
||||
// GetTraderExecutor returns a TraderExecutor for the given trader ID
|
||||
// This is used by the debate module to execute consensus trades
|
||||
func (tm *TraderManager) GetTraderExecutor(traderID string) (debate.TraderExecutor, error) {
|
||||
at, err := tm.GetTrader(traderID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &TraderExecutorAdapter{autoTrader: at}, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user