PolyBridgePolyBridge APIBeta
Demo
APICookbooksMarket Foresight Before Trading

Market Foresight Before Trading

This cookbook takes a trading idea, asks PolyBridge how likely the events behind it are, and prepares a simulated trade if the evidence supports it.

It shows two services working together. PolyBridge supplies the evidence and stays read-only. SimBroker plays the broker side: a small pretend broker built for this cookbook, standing in for whatever real trading tool you use. Swap one in and the pattern is the same.

The demo runs the whole flow: idea, questions, verdict, memo, audit log, then a simulated trade if the evidence holds up. You can run it without an API key or sign-up.

Trading ideae.g. jobs hold up, so buy SPYAsk PolyBridgeA probability for each question you setIs the evidence strong?Each answer has a pass markNOYESNo tradeTrade

Thesis: US labor market stays resilient through July 2026 · Trade if supported: buy $1,000 of SPY, a fund that tracks the S&P 500

You can ask questions that aren’t priced on any single market. PolyBridge builds the answers from the markets around them: the event itself, its causes, and its consequences.

QuestionProbabilityRangeEvidenceVerdict
Will the US lose jobs in July 2026?12%8-15%5 direct marketsSupports
Will US unemployment for July 2026 be above 4.3%?28%22-35%6 direct marketsSupports
Will the Fed cut rates at its September 2026 meeting?6%3-8%direct + related marketsSupports

Result: All three answers support the thesis, so the trade goes ahead. BUY SPY, $1,000, simulated.

* Real outputs recorded July 4, 2026. Live runs may differ.

Run it yourself

Three ways to run the same flow.

With Claude

The full flow runs in Claude Desktop: evidence check, order preview, your approval, simulated fill.

  1. Install Claude Desktop if you don’t have it.
  2. Connect PolyBridge: download the PolyBridge MCPB bundle or use the hosted server (MCP setup guide).
  3. Download the SimBroker bundle and add it to Claude Desktop the same way. SimBroker is a pretend broker that ships with this cookbook: it records simulated fills to a file on your machine. No signup, no real trading. Your account comes with a simulated $1,000 SPY starter position.
  4. Paste this prompt.
prompt
You are running a pre-trade evidence check. You have PolyBridge Forecast (read-only probabilities) and SimBroker, a demo paper broker. Your SimBroker account holds a starter position: $1,000 of SPY, bought on the thesis that the US labor market stays resilient through July 2026.

First, use SimBroker to show my account and the starter position.

Then decide what to do with it. Ask PolyBridge:
1. Will the US lose jobs in July 2026?
2. Will the US unemployment rate for July 2026 be above 4.3%?
3. Will the Fed cut rates at its September 2026 meeting?

Report each probability, its range, and the source markets.

Rules:
- Add if labor looks resilient: Q1 under 20%, Q2 under 30%, and Q3 under 20%. Then: preview buying $1,000 more SPY.
- Exit if labor looks weak: Q1 over 30% and Q2 over 38%. Q3 over 35% counts as weak too, but Q3 alone is never enough.
- Anything else: hold. Write a short memo saying which rules failed, and confirm with SimBroker that the position stands.

Include the reason on any preview, show it to me, and place the simulated order only after I say yes.

Do not provide financial advice. No real trading.

Live markets move. The same evidence that supports adding one day can support exiting the next.

In your terminal

One command runs the recorded demo. No setup, no API key.

zsh
git clone https://github.com/crowdvector/polybridge-cookbooks.git
cd polybridge-cookbooks/agentic-finance
bash demo.sh

To ask PolyBridge fresh instead of using the recording, see Live Mode in the repo README.

The preview
VERDICT: PROCEED

PAPER ORDER PREVIEW
BROKER:   SimBroker
SYMBOL:   SPY
SIDE:     BUY
NOTIONAL: $1,000

Confirm simulated paper trade? y/N
After approving with y
simulated_order_id: sim_...
paper_portfolio:    outputs/paper_portfolio.jsonl
audit_log:          outputs/decisions.jsonl

In Colab

Open the notebook and run all cells. The notebook bootstraps itself in Colab by cloning the cookbook repo into /content automatically. No broker account is needed.

Change the thesis

The pipeline runs any idea. Two ways to swap in yours:

  • In the Claude prompt: edit the thesis line, the questions, and the pass marks.
  • In the repo: open agentic-finance/examples/sample_theses.json, copy the demo thesis, give it a new thesis_id, and edit the fields. For example, an oil thesis:
json
{
  "thesis_id": "oil-supply-risk",
  "thesis": "Oil supply tightens through late 2026",
  "instrument": "XLE",
  "direction": "long",
  "notional_usd": 1000,
  "questions": [
    { "q": "Will WTI crude oil settle above $80 per barrel on December 31, 2026?",
      "supports_when": "YES", "threshold": 0.30 },
    { "q": "Will Iran's average daily crude oil production for October 2026 be at least 2.0 million barrels per day?",
      "supports_when": "NO", "threshold": 0.40 },
    { "q": "Will Brent crude oil settle above $85 per barrel on October 30, 2026?",
      "supports_when": "YES", "threshold": 0.25 }
  ]
}
  • supports_when is the side: “YES” supports your idea when the probability comes back over the pass mark, “NO” when under.
  • threshold is the pass mark: 0.30 means 30%.

Ask about specific dates, numbers, and scheduled events. “Above $80 on December 31, 2026”, not “rises a lot soon”.

Then: bash setup.sh once, and python3 tier1_evidence_gate.py --thesis oil-supply-risk. Live questions take 30 to 50 seconds each.

Safety

  • The PolyBridge API is read-only. The default demo needs no keys.
  • Trades are simulated.
  • PolyBridge supplies the probabilities. The thesis sets the bars. Not financial advice.

Source