mirror of
https://github.com/NoFxAiOS/nofx.git
synced 2026-07-14 16:26:57 +08:00
feat: add xyz dex balance calculation, market data providers, and UI improvements
- Fix xyz dex balance calculation (use marginSummary for isolated margin) - Add Alpaca provider for US stocks market data - Add TwelveData provider for forex & metals market data - Add Hyperliquid kline provider - Centralize API keys in config system - Add builder fee for order routing - Improve chart UI with compact design - Fix position history fee display precision - Add comprehensive balance calculation tests
This commit is contained in:
@@ -29,6 +29,11 @@ type Config struct {
|
||||
// Helps us understand product usage and improve the experience
|
||||
// Set EXPERIENCE_IMPROVEMENT=false to disable
|
||||
ExperienceImprovement bool
|
||||
|
||||
// Market data provider API keys
|
||||
AlpacaAPIKey string // Alpaca API key for US stocks
|
||||
AlpacaSecretKey string // Alpaca secret key
|
||||
TwelveDataKey string // TwelveData API key for forex & metals
|
||||
}
|
||||
|
||||
// Init initializes global configuration (from .env)
|
||||
@@ -76,6 +81,11 @@ func Init() {
|
||||
cfg.ExperienceImprovement = strings.ToLower(v) != "false"
|
||||
}
|
||||
|
||||
// Market data provider API keys
|
||||
cfg.AlpacaAPIKey = os.Getenv("ALPACA_API_KEY")
|
||||
cfg.AlpacaSecretKey = os.Getenv("ALPACA_SECRET_KEY")
|
||||
cfg.TwelveDataKey = os.Getenv("TWELVEDATA_API_KEY")
|
||||
|
||||
global = cfg
|
||||
|
||||
// Initialize experience improvement (installation ID will be set after database init)
|
||||
|
||||
Reference in New Issue
Block a user