All examples

Research · Python

Prediction Engine

A combined prediction-market oracle, paper-trading engine, and strategy backtesting toolkit.

View repository

Gordon boundary

Gordon governs the project's paid agent actions. The repository keeps its own strategy, runtime, data ingestion, and execution logic.

How it works

Each backtest run is assigned a session_id. The engine can call Exa and CoinGecko through Gordon for paid data fetches. Gordon groups successful paid x402 settlements by session, letting you compare research spend across model variants alongside P&L.

Integration recipe

How Gordon fits

Model research

Supported

Route paid evidence and market-data calls from live and replay runs through the same Gordon agent policy.

Backtest audit

Supported

Set session_id to the backtest run ID so the project can compare Gordon's per-run research costs with P&L.

Integration code

Backtest MCP research prompt
BACKTEST_PROMPT = """
Research the current evidence for {market_title}.

Use gordon_call_service with:
  operation: exa.search.web
  max_payment_units: 20000
  session_id: {run_id}

Return the sources and a short probability assessment.
"""

Connection path

01

Create an agent

Give this project its own Gordon identity, wallet, and API key.

02

Add MCP or SDK

Use Gordon MCP for hosted agents or gordon.fetch for application code.

03

Set policy

Allow only required services, then cap calls and daily spend.