mirror of
https://github.com/NoFxAiOS/nofx.git
synced 2026-07-19 02:14:35 +08:00
feat: simplify Claw402 autopilot trading flow
This commit is contained in:
@@ -122,3 +122,62 @@ func TestStrategyConfigNormalizeProductSchemaForLLMLabels(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestStrategyConfigNormalizeProductSchemaForVergexSignal(t *testing.T) {
|
||||
cfg := GetDefaultStrategyConfig("zh")
|
||||
cfg.CoinSource = CoinSourceConfig{
|
||||
SourceType: "Claw402 Vergex 信号榜",
|
||||
}
|
||||
|
||||
cfg.NormalizeProductSchema()
|
||||
|
||||
if cfg.CoinSource.SourceType != "vergex_signal" {
|
||||
t.Fatalf("source_type = %q, want vergex_signal", cfg.CoinSource.SourceType)
|
||||
}
|
||||
if cfg.CoinSource.VergexLimit != 10 {
|
||||
t.Fatalf("vergex_limit = %d, want 10", cfg.CoinSource.VergexLimit)
|
||||
}
|
||||
if cfg.CoinSource.VergexMarketType != "all" {
|
||||
t.Fatalf("vergex_market_type = %q, want all", cfg.CoinSource.VergexMarketType)
|
||||
}
|
||||
if cfg.CoinSource.VergexChain != "hyperliquid" {
|
||||
t.Fatalf("vergex_chain = %q, want hyperliquid", cfg.CoinSource.VergexChain)
|
||||
}
|
||||
}
|
||||
|
||||
func TestStrategyConfigNormalizeProductSchemaForVergexSignalLimits(t *testing.T) {
|
||||
t.Run("dynamic board keeps the one built-in strategy candidate depth", func(t *testing.T) {
|
||||
cfg := GetDefaultStrategyConfig("zh")
|
||||
cfg.CoinSource = CoinSourceConfig{
|
||||
SourceType: "vergex_signal",
|
||||
VergexLimit: 1,
|
||||
StaticCoins: nil,
|
||||
VergexChain: "hyperliquid",
|
||||
VergexLiqBand: "",
|
||||
}
|
||||
|
||||
cfg.NormalizeProductSchema()
|
||||
|
||||
if cfg.CoinSource.VergexLimit != 10 {
|
||||
t.Fatalf("vergex_limit = %d, want 10", cfg.CoinSource.VergexLimit)
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("manual picks keep selected count", func(t *testing.T) {
|
||||
cfg := GetDefaultStrategyConfig("zh")
|
||||
cfg.CoinSource = CoinSourceConfig{
|
||||
SourceType: "vergex_signal",
|
||||
VergexLimit: 1,
|
||||
StaticCoins: []string{"xyz:nvda", "XYZ:AAPL"},
|
||||
}
|
||||
|
||||
cfg.NormalizeProductSchema()
|
||||
|
||||
if cfg.CoinSource.VergexLimit != 2 {
|
||||
t.Fatalf("vergex_limit = %d, want 2", cfg.CoinSource.VergexLimit)
|
||||
}
|
||||
if got := cfg.CoinSource.StaticCoins; len(got) != 2 || got[0] != "XYZ:NVDA" || got[1] != "XYZ:AAPL" {
|
||||
t.Fatalf("static_coins = %+v, want normalized xyz symbols", got)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user