Versions in this module Expand all Collapse all v1 v1.0.0 Jun 16, 2026 Changes in this version + var ErrRiskQueueFull = errors.New("risk queue full") + var ErrRiskRejected = errors.New("risk rejected") + func OrderDeniedEvent(order model.SubmitOrder, cause error) (model.ExecutionEvent, bool) + type Config struct + AccountLimits map[model.AccountID]Limits + Clock kernel.Clock + CommandRateWindow time.Duration + ExposureCurrency model.Currency + InstrumentLimits map[model.InstrumentID]Limits + MaxAccountExposure decimal.Decimal + MaxCommandsPerWindow int + MaxOpenOrders int + MaxOrderNotional decimal.Decimal + MaxPositionNotional decimal.Decimal + QueueSize int + StrategyLimits map[model.StrategyID]Limits + TradingState TradingState + type Decision struct + Error error + Event *model.ExecutionEvent + Order model.SubmitOrder + func (d Decision) Accepted() bool + type Engine struct + func NewEngine(c *cache.Cache, cfg Config) *Engine + func (e *Engine) Check(order model.SubmitOrder) error + func (e *Engine) CheckExistingOrder(order model.SubmitOrder) error + func (e *Engine) EngageKillSwitch(reason string) error + func (e *Engine) Execute(ctx context.Context, order model.SubmitOrder) (<-chan Decision, error) + func (e *Engine) Health() Health + func (e *Engine) Process(ctx context.Context, event model.ExecutionEvent) error + func (e *Engine) ResumeTrading() error + func (e *Engine) SetReducingOnly(reason string) error + func (e *Engine) SetTradingState(state TradingState, reason string) error + func (e *Engine) Start(ctx context.Context) error + func (e *Engine) Stop(ctx context.Context) error + type Health struct + CommandQueueCapacity int + CommandQueueDepth int + DroppedCommands int64 + DroppedEvents int64 + EventQueueCapacity int + EventQueueDepth int + ProcessedCommands int64 + ProcessedEvents int64 + RejectedCommands int64 + ThrottledCommands int64 + TradingState TradingState + TradingStateReason string + type Limits struct + MaxAccountExposure decimal.Decimal + MaxOrderNotional decimal.Decimal + MaxPositionNotional decimal.Decimal + type TradingState string + const TradingStateActive + const TradingStateHalted + const TradingStateReducing