Synthetic Index
There is no S&P 500 for prediction markets. Horizon’s index module lets you build one. Combine multiple markets into a weighted index, track rebalancing drift, and detect arbitrage between the index level and its components. All math is in Rust.Overview
Index Construction
hz.compute_index_level() computes a weighted index from component prices.Weighting Methods
Equal, inverse-vol, liquidity, or custom weight schemes.
Rebalancing
hz.rebalance_weights() calculates drift and rebalance actions.Index Arbitrage
hz.index_arb_signal() detects deviations between index and components.Core Functions
hz.compute_index_level
Compute a weighted index level from component prices.| Parameter | Type | Default | Description |
|---|---|---|---|
prices | list[float] | required | Component prices |
weights | list[float] | required | Component weights (should sum to ~1.0) |
base_level | float | 100.0 | Base index level |
hz.compute_weights_equal / inverse_vol / liquidity
hz.rebalance_weights
Calculate delta between current and target weights.hz.index_tracking_error
Tracking error between a portfolio and an index.hz.index_arb_signal
Detect deviation between the index level and its fair value from components.Pipeline Functions
hz.index
Compute and track a synthetic index level each cycle.| Parameter | Type | Default | Description |
|---|---|---|---|
config | IndexConfig | None | Full index configuration |
market_feeds | dict[str, str] | None | market_id -> feed_name mapping |
weighting | str | "equal" | equal, inverse_vol, liquidity, or custom |
base_level | float | 100.0 | Base index level |