Context plus the outputs of previous functions. The final function must return list[Quote].
Basic Example
How It Works
Horizon inspects each function’s signature to determine how many arguments it expects. Previous outputs are passed in order:
This means you can insert or remove pipeline stages without changing downstream functions.
Signature Introspection
The pipeline runner usesinspect.signature() to count parameters:
Pipeline Rules
- At least one function is required in the pipeline
- The final function must return
list[Quote](or a singleQuote) - Each function runs once per market per cycle
- If a function raises an exception, the error is logged and that market is skipped for the cycle
- The pipeline runs for every market in the
marketslist
Result Processing
After the pipeline runs,_process_result() handles the output:
- Cancel existing orders for the market (
cancel_market()) - Tick the paper exchange with the feed mid price (or quote mid as fallback)
- Update mark prices for unrealized P&L tracking
- Submit new quotes, routed to the correct exchange based on
market.exchange
Risk rejections during quote submission are logged at
debug level (not warning), since they’re expected during normal operation (e.g., position limits hit).