Skip to main content
All types are implemented in Rust and exposed to Python via PyO3. Import them from horizon or horizon._horizon.

Enums

All enums support equality (==), hashing, and can be used as dict keys.

Side

Market side.

OrderSide

Buy or sell direction.

OrderType

TimeInForce

OrderStatus

AlertLevel

TriggerType

Contingent order trigger type.

AssetClass

Instrument asset class.

OptionType

Option contract type.

Quote

A quote represents a bid/ask pair at a given size.
Helper function (bid/ask clamped to [0.01, 0.99]; returns [] if crossed):

Market

A market definition.

Outcome

A single named outcome in a multi-outcome event. Each outcome is itself a binary contract with YES/NO tokens.

Event

Groups multiple outcomes under a shared event/condition. Used for multi-outcome prediction markets.
See Multi-Outcome Events for full usage guide.

EventArbitrageOpportunity

Represents an arbitrage opportunity across outcomes in a multi-outcome event (when outcome prices don’t sum to 1.0).

OrderRequest

An order request submitted to the engine.

Order

An order with current state. Created by the engine when an OrderRequest is submitted.

Position

A position in a market.
Position has no Python constructor. Positions are created internally by the engine when fills are processed. In tests, build positions via engine.process_fill().

Fill

A fill event from an exchange.

ContingentOrder

A contingent order (stop-loss or take-profit) that triggers when market conditions are met. Created via engine.add_stop_loss(), engine.add_take_profit(), or engine.submit_bracket().
ContingentOrder is read-only. Use engine.add_stop_loss(), engine.add_take_profit(), or engine.submit_bracket() to create contingent orders. Use engine.cancel_contingent() to remove them.

SimPosition

A position for Monte Carlo simulation input.

SimulationResult

Result of a Monte Carlo simulation. Created by hz.monte_carlo() or hz.simulate().
See Monte Carlo Simulation for the full guide.

EngineStatus

A snapshot of the engine’s current state.

FeedSnapshot

A snapshot of a feed’s current data (engine level).

RiskConfig

Risk configuration for the engine.
See Risk Management and Multi-Outcome Events for detailed documentation.