Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppState ¶
type AppState interface {
Stats() (orders int, fills int, pnl float64)
IsRunning() bool
IsDryRun() bool
MonitoredAssets() []string
SetEmergencyStop(stop bool)
RecentFills(limit int) []execution.Fill
ActiveOrders() []execution.OrderState
TrackedPositions() map[string]execution.Position
UnrealizedPnL() float64
RiskSnapshot() risk.Snapshot
TradingMode() string
PaperSnapshot() paper.Snapshot
KPIStats() map[string]interface{}
}
AppState exposes the trading app's state for the API layer.
type BuilderProvider ¶
type BuilderProvider interface {
DailyVolumeJSON() interface{}
LeaderboardJSON() interface{}
LastSync() time.Time
}
BuilderProvider exposes builder volume data (nil if unavailable).
type PortfolioProvider ¶
PortfolioProvider exposes portfolio data (nil if unavailable).
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is a lightweight HTTP API for the trading dashboard.
func NewServer ¶
func NewServer(addr string, appState AppState, portfolio PortfolioProvider, builder BuilderProvider) *Server
NewServer creates a new API server bound to addr.
func (*Server) SetAuthToken ¶
SetAuthToken enables lightweight token auth for all API endpoints except health and readiness.
Click to show internal directories.
Click to hide internal directories.