Inspiration
A lot of trading strategies look good on paper but fall apart when everything is actually correlated. This is because a lot of popular polymarket topics such as geopolitics are highly linked, which can increase risk, especially when events are unpredictable.
There are also clear market inefficiencies in prediction markets that can be exploited. For example, it takes time to verify trades on Polymarket's end, even after the bet has clearly been resolved. One can exploit this edge by trading at the last second for a small but consistent gain. By frequently exploiting this edge, a profit compounds over time.
We've also been interested in how AI can extract signal from news, and how quantum-style optimisation (like QAOA) can search through complex decision spaces better than greedy methods.
So the idea was: what if we combine AI for signal and optimisation for decision-making, and treat trading like a real portfolio problem instead of isolated picks?
What it does
QEdge AI has two main strategies:
Strategy 1 — AI-powered, Quantum optimized portfolio construction
A general strategy to select trades ahead of time by taking advantage of all available information in news and related markets, using quantum optimisation to construct an optimal portfolio. Rather than just listing top trades, the system estimates probabilities using AI and news, measures how related different markets are, and builds a portfolio that balances edge and diversification. So instead of "top trades", you get a set of trades that actually make sense together.
Strategy 2 — Last-second edge exploitation
Targets the lag between visible resolution and on-chain settlement on Polymarket. By trading at the optimal moment, the system captures a small but repeatable edge that compounds through frequency.
How we built it
How the Live Trader works
The goal is simple: when a news event breaks, find the Polymarket markets it affects and get a trade in before the crowd reprices them.
Step 1 — News ingestion
18 RSS feeds (AP, Reuters, BBC, NYT, Politico, ESPN, CNBC and others) are polled in parallel every 15 seconds. This is the dominant latency constraint — RSS publication lag alone is 30 seconds to 3 minutes. The feed fetch itself takes 100–400ms.
Step 2 — Pre-filter + TF-IDF matching
Every incoming headline is regex-matched against keywords in under 1ms — no API call, no model. Headlines that pass get scored against all 16,835 active markets using TF-IDF, which ranks how closely a headline matches each market question. The top 10 candidates get passed forward.
Step 3 — Claude validation
The top 10 candidates, the headline, and current mid prices are sent to Claude Sonnet. Claude returns the best matching market, a YES/NO direction, an estimated post-news fair value, a confidence score, and a one-sentence reasoning. This takes 800ms–2s.
Step 4 — Risk check + trade
A trade only fires if:
confidence ≥ 0.65|fair_value − mid| ≥ 0.03
Position size is a fractional Kelly estimate, hard-capped at $25 per trade and $500 total gross exposure. The risk check itself completes in under 1ms.
Step 5 — SSE stream
Every event — article ingested, market matched, trade fired or rejected — is pushed to the Live Trader UI in real time via Server-Sent Events with under 5ms delivery latency.
The real bottleneck
The code is fast. The news isn't. A story that moves a market will often have already repriced by the time any RSS-based system sees it — RSS lag is 30 seconds to 3 minutes and sits entirely outside our control.
The C++ rt-engine exists to address this. Rather than waiting for news, it holds a live WebSocket connection to the Polymarket order book and detects stale-quote and resolve-now signals directly from order flow — reacting in microseconds without touching the news pipeline at all.
Strategy 2:
We broke it into a few parts:
- A scanner that pulls market data and calculates edge
- An AI layer that reads news and estimates probabilities
- A correlation system that checks how similar markets are
- A quantum optimizer that selects trades while avoiding overlap
For optimization, we used a fast greedy approach for real-time use, and a QUBO/QAOA formulation to explore better combinations. Everything is wrapped in a simple dashboard so you can interact with it directly.
Challenges we ran into
- Getting useful signals from news without overfitting
- Figuring out how to measure correlation between markets that aren't obviously linked
- Balancing speed vs accuracy — AI is slow, markets move fast
- Translating a trading problem into a QUBO formulation was harder than expected
Accomplishments that we're proud of
- We built something end-to-end that actually works
- The optimiser produces noticeably better portfolios than naive selection
- We connected AI, trading, and quantum ideas in a way that's practical
- The system is flexible enough to extend beyond just Polymarket
What we learned
- Most "good trades" are not independent — correlation matters a lot
- Optimisation is just as important as the signal
- AI is helpful, but only when combined with structure and constraints
- Real systems are all about tradeoffs, not perfect models
What's next for QEdge AI
- Improve how we model correlation (right now it's intentionally simple)
- Try running QAOA on actual quantum hardware
- Speed up the pipeline so it can run closer to real-time
- Expand to other markets beyond prediction markets
- Keep refining the optimiser and testing live performance
Built With
- claude
- css
- github
- javascript
- jupyternotebook
- lava
- openai
- python
- shell
- typescript
- webscrappers


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