Skip to main content
Ultra Feature. Requires an Ultra subscription. Get started at api.mathematicalcompany.com

Oracle

Combines six independent signal extractors into a single ensemble probability estimate for each market, then surfaces edge opportunities where the forecast diverges materially from the current market price.

Smart Money Flow

Holder analysis weighted by wallet score.

Microstructure

Kyle’s lambda + VPIN for informed trading detection.

Momentum

EMA crossover (short/long span ratio).

Volume Profile

Buy vs sell volume imbalance.

Holder Concentration

HHI of top holders as conviction signal.

Temporal Patterns

Hour-of-day buy activity patterns.

Forecast a Market

import horizon as hz

fc = hz.forecast_market(
    "0xcondition...",
    market_title="Will X happen?",
    market_price=0.65,
)
print(f"Ensemble: {fc.ensemble_prob:.4f}")
print(f"Edge: {fc.edge_bps:.0f} bps")
for s in fc.signals:
    print(f"  {s.name}: {s.normalized_value:.4f} (weight={s.weight:.2f})")

Scan for Edges

edges = hz.scan_edges(min_edge_bps=300, max_markets=30)
for e in edges:
    print(f"{e.market_title}: {e.direction} | edge={e.edge_bps:.0f}bps | size=${e.recommended_size:.0f}")

Pipeline Mode

hz.run(
    name="oracle-mm",
    markets=["0xcondition..."],
    pipeline=[
        hz.oracle(forecast_interval_cycles=20),
        model,   # reads ctx.params["oracle_edge_bps"]
        quoter,
    ],
    interval=5.0,
)
Injects ctx.params["oracle_forecast"] and ctx.params["oracle_edge_bps"] every N cycles.

Full Report

report = hz.oracle_report(max_markets=20)
print(f"Coverage: {report.coverage} markets")
print(f"Avg confidence: {report.avg_confidence:.4f}")
print(f"Calibration (log loss): {report.model_calibration:.4f}")
for edge in report.top_edges:
    print(f"  {edge.market_title}: {edge.edge_bps:.0f}bps ({edge.direction})")

Signal Weights

Default weights (configurable via OracleConfig):
SignalWeightSource
smart_money_flow0.25get_top_holders() + score_wallet()
microstructure0.20get_market_trades() + Kyle’s lambda + VPIN
momentum0.15EMA crossover on trade prices
volume_profile0.15Buy/sell volume ratio
holder_concentration0.15HHI of top holders
temporal_pattern0.10Hour-of-day activity analysis

OracleConfig

ParameterDefaultDescription
signal_weightsSee aboveWeight per signal in ensemble
min_confidence0.3Minimum confidence to report forecast
edge_threshold_bps200.0Minimum edge to flag as opportunity
recalibrate_interval50Cycles between recalibration
holder_limit50Max holders to fetch per market
trade_limit200Max trades to fetch per market