Cross-Impact Matrix
When you trade in one prediction market, correlated markets move. The cross-impact matrix quantifies this relationship: how much does a $1 trade in market A move the price of market B? Horizon estimates this matrix from synchronized return and volume data, then exposes it for cost-aware execution and portfolio construction.Cross-Impact Estimation
hz.estimate_cross_impact() computes the N x N impact matrix from return and volume histories.Streaming Estimator
CrossImpactEstimator maintains a rolling window and updates the matrix incrementally as new data arrives.Impact Decomposition
Separates self-impact (diagonal) from cross-impact (off-diagonal) to identify contagion channels.
Pipeline Integration
hz.cross_impact_monitor() injects the live impact matrix into your strategy context each cycle.hz.estimate_cross_impact
Estimate the cross-impact matrix from synchronized return and volume matrices. The estimator regresses price changes in each market against signed volume flow in all markets.| Parameter | Type | Description |
|---|---|---|
returns_matrix | list[list[float]] | T x N matrix of log returns (T observations, N markets) |
volume_matrix | list[list[float]] | T x N matrix of signed volume (positive = net buy pressure) |
names | list[str] | Market names, length N |
CrossImpactMatrix Type
| Field | Type | Description |
|---|---|---|
matrix | list[list[float]] | N x N cross-impact matrix. Entry (i, j) is the price impact on market i per unit volume in market j |
self_impact | list[float] | Diagonal entries (Kyle’s lambda for each market) |
names | list[str] | Market names in the same order as rows/columns |
condition_number | float | Condition number of the matrix (high values indicate instability) |
The matrix is generally asymmetric: trading in the election market may move the recession market more than the reverse. Large off-diagonal entries indicate strong cross-market contagion.
CrossImpactEstimator
A streaming estimator that maintains a rolling window of observations and recomputes the cross-impact matrix as new data arrives.| Parameter | Type | Description |
|---|---|---|
n_markets | int | Number of markets to track |
lookback | int | Maximum number of observations to retain (FIFO eviction) |
Methods
| Method | Parameters | Returns | Description |
|---|---|---|---|
add_observation | returns: list[float], volumes: list[float] | None | Append one time step of returns and volumes |
estimate | names: list[str] | CrossImpactMatrix or None | Compute the matrix from buffered data. Returns None if insufficient observations |
Reading the Matrix
Pipeline Integration
Thehz.cross_impact_monitor() pipeline function recomputes the cross-impact matrix every N cycles and injects it into ctx.params["cross_impact"].
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
feed | str | required | Feed name to read prices and volumes from |
lookback | int | 200 | Rolling window size for the estimator |
update_every | int | 10 | Recompute the matrix every N cycles |
Mathematical Background
Cross-Impact Regression
Cross-Impact Regression
The cross-impact matrix Lambda is estimated via multivariate OLS regression:delta_p_i(t) = sum_j Lambda_ij * v_j(t) + epsilon_i(t)where delta_p_i(t) is the return of market i at time t, and v_j(t) is the signed volume in market j. The diagonal entries Lambda_ii correspond to Kyle’s lambda (self-impact), and off-diagonal entries Lambda_ij capture how volume in market j moves the price of market i.
Why Cross-Impact Matters
Why Cross-Impact Matters
In prediction markets, related events share information. A large buy in “Fed cuts rates in June” signals dovish expectations, which should also move “Recession by Q4” and “S&P above 5000.” Ignoring cross-impact leads to underestimating execution cost when trading correlated markets simultaneously. The cross-impact matrix lets you:
- Route orders to minimize total market impact across all correlated markets
- Avoid inadvertently signaling your view through cross-market contagion
- Identify which markets are most informationally connected
Condition Number
Condition Number
A high condition number indicates that the estimated matrix is sensitive to small perturbations in the input data. This typically happens when markets are nearly collinear (e.g., two markets track almost the same event). When the condition number exceeds 100, consider reducing the number of markets or increasing the lookback window.