-
-
Sector fallback + Gemini Vision: Fed chart analyzed: neutral δ=1 oblique, Financials/Real Estate/Tech tagged. Delta feeds conviction scoring
-
emini Vision input: CNBC chart showing Fed funds rate held at 3.5–3.75% in Jan 2026, dropped into the vision panel for multimodal analysis
-
DUK/AEP: 83.5% Polymarket vs 37.9% equity-implied. 45.6 edge Full Bloomberg thesis, edge and risk generated by the Gemini Flash agentic loop
-
USB/FITB: HIGH confidence LONG_SPREAD z=-3.15. Polymarket 83.5% vs equity 80.7% Gemini stress-tests its own recommendation in the risk field
-
O/WEC: HIGH LONG_SPREAD, z=-3.71. Southern Co oversold vs WEC. Disagreement scatter mapping 12 live signals across the full pair universe
Inspiration
Statistical arbitrage is a well-studied field, but it operates in a vacuum — equity spreads mean-revert based on historical price relationships, with no external signal confirming whether a dislocation is temporary noise or a permanent macro shift. Prediction markets like Polymarket aggregate real-time informed opinion on macro outcomes. The gap between what Polymarket prices and what equity spreads imply is untapped alpha. Arbiter acts as the bridge, using AI to quantify the lag between decentralized conviction and traditional market pricing.
What it does
Arbiter is a live agentic signal engine that monitors 32 cointegrated equity pairs and fires a Gemini Flash agent whenever a spread crosses a z-score threshold. The agent uses semantic vector search to match the equity signal to active Polymarket contracts, computes the implied equity probability via a sigmoid bridge formula, and synthesizes a Bloomberg-style trade brief quantifying the exact disagreement between markets.
The core math:
$$P_{implied} = \frac{1}{1 + e^{-1.5 \cdot \delta \cdot (|z| - 2.2)}}$$
$$\text{edge} = P_{poly} - P_{implied}$$
Where δ ∈ [0.5, 1.5] is a directional alignment score Gemini assigns based on news context.
Three novel features power the system:
Pre-signal panel — instead of waiting for equity z-scores to fire, Arbiter scans Polymarket first and surfaces pairs where conviction is building but equity hasn't moved yet. Poly leads equity.
Gemini multimodal vision — drop any chart, earnings slide, or news screenshot into the vision panel. Gemini extracts sentiment, identifies the macro catalyst, and outputs a suggested delta that feeds the orchestrator's conviction scoring.
Forced synthesis fallback — when the 8-call tool cap is hit, a final generate_content fires with tools=[] to guarantee a brief is always produced.
How we built it
- Pair universe: 32 cointegrated pairs screened via Engle-Granger cointegration test, Hurst exponent, and Ornstein-Uhlenbeck half-life fitting across the S&P 500
- Backend: FastAPI + asyncio, SSE streaming for live brief delivery
- Orchestrator: Manual Gemini Flash tool-calling loop with semaphore-gated concurrency (max 2 signals), exponential backoff retry, and directional consistency validation
- Semantic matching: TF-IDF cosine similarity across 200 active Polymarket contracts with sector-based macro fallbacks
- Frontend: React + Vite + Tailwind — signal feed, disagreement scatter, pre-signal panel, Gemini vision upload
Challenges
- The Gemini SDK migrated from
google.generativeaitogoogle.genaimid-build, requiring a full orchestrator rewrite - Automatic function calling intercepted our manual tool loop and returned empty content — disabled AFC and rebuilt the loop with explicit cap enforcement
- Polymarket's semantic index dominated by a single Fed pause contract, requiring deduplication logic in the pre-signal panel
- SSE connections were silently dropping due to missing proxy routes in Vite — we engineered a brief history replay buffer on reconnect to ensure zero data loss during live dashboard updates.
What we learned
Prediction markets and equity markets price the same macro events on very different timescales. The information lag is real and measurable. Gemini Flash's agentic tool-calling is powerful but requires careful manual management to prevent runaway billing and ensure synthesis always completes.
What's next
- Swap TF-IDF for Gemini embeddings for higher-accuracy contract matching
- Wire in a live news feed for real-time delta adjustment
- Add backtesting against historical spread data to validate the sigmoid bridge calibration
- Expand the pair universe to 200+ pairs across international markets
Built With
- asyncio
- fastapi
- gemini-vision
- google-gemini-flash
- newsapi.org
- polymarket-gamma-api
- python
- react
- scikit-learn
- server-sent
- tailwind-css
- vite
- yfinance

Log in or sign up for Devpost to join the conversation.