mirror of
https://github.com/NoFxAiOS/nofx.git
synced 2026-07-17 09:24:36 +08:00
feat(hyperliquid): add stock symbol market data support
- Add Hyperliquid/XYZ symbol normalization tests and backend coverage - Extend kline and market data lookup paths for US stock symbols - Wire frontend data API types for stock-oriented market requests
This commit is contained in:
26
market/data_hyperliquid_xyz_test.go
Normal file
26
market/data_hyperliquid_xyz_test.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package market
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestHyperliquidXYZAliasesNormalizeForAIDecisionData(t *testing.T) {
|
||||
tests := []struct {
|
||||
input string
|
||||
normalized string
|
||||
isXyzAsset bool
|
||||
}{
|
||||
{input: "SMSN-USDC", normalized: "xyz:SMSN", isXyzAsset: true},
|
||||
{input: "SAMSUNG-USDC", normalized: "xyz:SMSN", isXyzAsset: true},
|
||||
{input: "xyz:SMSN", normalized: "xyz:SMSN", isXyzAsset: true},
|
||||
{input: "TESLA-USDC", normalized: "xyz:TSLA", isXyzAsset: true},
|
||||
{input: "TSLA-USDC", normalized: "xyz:TSLA", isXyzAsset: true},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
if got := Normalize(tt.input); got != tt.normalized {
|
||||
t.Fatalf("Normalize(%q) = %q, want %q", tt.input, got, tt.normalized)
|
||||
}
|
||||
if got := IsXyzDexAsset(tt.normalized); got != tt.isXyzAsset {
|
||||
t.Fatalf("IsXyzDexAsset(%q) = %v, want %v", tt.normalized, got, tt.isXyzAsset)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user