Inspiration
The traditional financial markets have been conquered by algorithms. Hedge funds use quantitative strategies to exploit tiny mispricings worth fractions of a percent. But prediction markets? They're still driven by raw human emotion—and that creates massive opportunities.
We realized there's over $40 million locked in inefficient Polymarket positions at any given time. These aren't mistakes by professionals—they're everyday people making decisions based on viral Twitter threads that spike search volume 600%+ overnight, emotional reactions to breaking news, mathematical illiteracy around probability, and pure herd mentality. When a political event goes viral, Google Trends explodes, YES prices rocket to 80-90%, and then... they revert. Not because the outcome changed—but because the emotional traders exit and rational pricing returns.
Our mission: Democratize quantitative trading strategies for prediction markets. Take the same mean reversion indicators used by Renaissance Technologies and Two Sigma in equities, adapt them to event-driven betting markets, and give anyone the tools to trade like a Wall Street quant. Think of it as bringing a sniper rifle to a knife fight. While others trade on hunches and headlines, we trade on math.
What it does
PolyProfitz is a real-time sentiment arbitrage engine that identifies mispriced prediction markets caused by viral hype spikes. Here's the workflow:
- User searches for any market topic (e.g., "Trump election 2024")
- Backend fuses data from three sources:
- Polymarket API: 7-day price history, volume, market metadata
- Claude API: Converts complex market questions into optimal search queries
- Calculates a quantitative Trade_Score using six components:
- VC (Volume Change): Market Volume spike percentage
- PM (Price Movement): 7-day price change
- VS (Velocity Score): How much moved in last 24h vs full 7 days
- OES (Odds Extremity Score): Distance from 50% odds
- RW (Recency Weight): Is the trend still peaking?
- MRI (Mean Reversion Indicator): Category-specific reversion likelihood
- Outputs actionable signals:
- STRONG BUY: Extreme mispricing, clear contrarian opportunity
- Entry price, expected return, target exit timeline
- All underlying metrics and direct link to Polymarket
Philosophy: We don't predict outcomes. We arbitrage emotional overreactions by trading volatility caused by viral hype spikes. Buy when the public panics in, sell when they calm down.
How we built it
Tech Stack:
- Backend: TypeScript + Node.js + Express
- Frontend: React + TypeScript + Tailwind CSS
- APIs: Polymarket (market data), Claude (NLP)
Architecture:
Custom PolymarketClient Class
findClosestEvent(query): Matches user search to active marketsgetPriceHistory(tokenId, startDate, endDate, fidelity): Fetches hourly price data over 7 days- Handles token resolution (YES/NO outcomes) and event metadata extraction
Multi-Source Data Pipeline
- Parallel API calls to Polymarket for speed
- Claude API prompt engineering to convert "Will Donald Trump win the 2024 US Presidential Election?" → "Trump election"
- Output caching system (
output.json) to avoid redundant API calls
Quantitative Scoring Engine
Trade_Score = Hype_Ratio × MRI × Confidence
Hype_Ratio = (VC × PM × VS) / log(volume + 1) × (1 + OES) × RW
Confidence = min(VC, PM * 5, volume/10k) × RW
- Each variable normalized and weighted based on backtested signals
- Category-specific MRI values (politics=0.8, crypto=0.9, sports=0.6)
Market Categorization System
- Fuzzy keyword matching on Polymarket tags
- Fallback logic for untagged markets (default category="other", MRI=0.7)
Frontend Dashboard
- Clean React UI displaying trade signals, metrics breakdown, and recommendations
- Real-time calculation status and error handling
Challenges we ran into
1. Multi-Source Data Pipeline Orchestration
We're hitting different APIs with different interfaces and rate limits. Polymarket required nested token ID resolution, and Claude needed carefully tuned prompts. We built comprehensive error handling with graceful fallbacks, parallel request optimization, and defensive programming to make this reliable in production.
2. Market Categorization from Unstructured Tags
Polymarket's tag system is inconsistent. Some events have clean tags like ["Politics"], others have ["2024-election-trump-vs-biden"], and some have no tags at all. We built a fuzzy keyword matcher with nested fallback logic to reliably map markets to categories (which determines the MRI score).
Accomplishments that we're proud of
1. Building a Production-Ready Quant System from Scratch
We didn't just build a proof-of-concept—we built a robust, scalable system that handles real-world data chaos. Our pipeline gracefully handles API failures, missing data, edge cases, and still delivers accurate signals.
2. Successfully Adapting Wall Street Strategies to Prediction Markets
We proved that mean reversion, momentum indicators, and volatility analysis from equities trading directly transfer to prediction markets. The formulas work—and they're mathematically sound.
3. Democratizing Access to Sophisticated Trading Tools
Before PolyProfitz, only whales with custom Python scripts could systematically exploit these inefficiencies. Now anyone can identify mispriced markets with one search query.
4. Clean, Intuitive UX Despite Complex Backend
We distilled six quantitative metrics, two APIs, and a multi-variable formula into a simple traffic-light signal system (STRONG BUY / MODERATE / WEAK / SKIP) that anyone can understand.
What we learned
1. Stock Market Patterns Transfer Perfectly to Prediction Markets
Mean reversion isn't unique to equities—it's fundamental to any market with emotional participants, asymmetric information, and liquidity constraints. Indicators like price velocity, Bollinger Bands logic, and RSI concepts apply directly to political/sports betting markets.
2. Extreme Odds Create Extreme Opportunities
In prediction markets, prices >70% or <30% are psychologically sticky. People see 85% and think "basically guaranteed"—but mathematically that's a 6:1 bet. If true odds are 70%, you're paying a 21% premium. Our Odds Extremity Score specifically targets these emotional mispricings.
3. Systematic Rules Eliminate Human Bias
Manual traders suffer from confirmation bias, recency bias, and loss aversion. By encoding our strategy into a formula, we remove political opinions, trade volatility instead of outcomes, and exit positions based on math rather than hope. We don't care who wins the election—we care that 85% is overpriced when search trends are peaking.
What's next for PolyProfitz
1. Backtesting Engine
Build historical simulation system to test our formula against past markets and measure actual returns. This will let us tune weights (SVC vs PM vs VS) and validate our edge with real data.
2. Multi-Market Portfolio View
Instead of analyzing one market at a time, scan all active Polymarket events and surface the top 10 opportunities ranked by Trade_Score. Give users a daily "best bets" dashboard.
3. Automated Trade Execution
Integrate with Polymarket's trading API to let users set thresholds (e.g., "auto-buy when Trade_Score > 0.6") and execute positions without manual intervention. Full algo-trading for prediction markets.
4. Enhanced Sentiment Analysis
Add Twitter API integration to measure tweet volume/sentiment alongside Google Trends. Combine social media velocity with search trends for even stronger signals.
5. Mobile App
React Native version for iOS/Android so traders can monitor signals on the go and execute positions from their phone.
6. Community Features
Let users share their winning trades, compare returns, and discuss strategy refinements. Build a community of quant-minded prediction market traders.
The long-term vision: Make PolyProfitz the Bloomberg Terminal for prediction markets—the essential tool that every serious trader uses to identify edge and execute systematically.
Built With
- claude
- express.js
- polymarket
- react
- typescript
- vite
Log in or sign up for Devpost to join the conversation.