About the Project
Inspiration
The prediction market ecosystem is exploding, but the tooling infrastructure hasn't kept up. While Polymarket provides the platform, most users are flying blind—making decisions based on sentiment rather than data. We realized there was a massive gap between casual "Yes/No" betting and institutional-grade quantitative trading.
We were inspired to build PulseForge to bridge this gap. We wanted to give researchers and traders a "telescope" for the market—a tool that could mathematically prove when a market is broken, visualize complex payoff scenarios, and leverage AI to synthesize research in seconds. We believe that for prediction markets to become true sources of truth, the participants need better tools to find that truth.
What it does
PulseForge is a production-ready research terminal designed specifically for Polymarket. It goes beyond simple price tracking to offer deep, actionable insights:
- Real-Time Market Explorer: Fetches live data directly from Polymarket's Gamma (discovery) and CLOB (orderbook) APIs. There is zero mock data; what you see is the actual state of the market.
- Inefficiency Scanner: This is the core quantitative engine. It scans market clusters to detect logical constraints and pricing errors, such as:
- Sum-to-One Violations: Identifying mutually exclusive events where the total probability does not equal 1. $$\sum_{i=1}^{n} P(outcome_i) \neq 1$$
- Threshold Inconsistency: Flagging illogical pricing in scalar markets—for example, if the market implies that Bitcoin reaching $100k is more likely than reaching $80k: $$P(\text{Bitcoin} > \$100k) > P(\text{Bitcoin} > \$80k)$$
- Arbitrage Bundles: Detecting opportunities where buying a basket of outcomes guarantees a risk-free profit.
- Strategy Builder & Payoff Surfaces: A visual sandbox for modeling multi-market positions. It calculates the Expected Value (EV) and visualizes the "Payoff Surface"—mapping profit against both probability and time \( t \). It includes a time-value discounting slider to account for the opportunity cost of capital locked in long-duration markets.
- Gemini AI Research Briefs: We integrated Google Gemini to act as an on-demand quantitative analyst. It parses complex market data to generate structured research briefs, resolution checklists, and "Pre-Mortem" scenario analyses.
- Seda Post Composer: A social integration that formats these insights into engaging, debate-ready posts tagged for the
#nexhacksecosystem.
How we built it
We built PulseForge as a modern, type-safe web application tailored for speed and reliability:
- Core Stack: We used Next.js 14 (App Router) with TypeScript for the framework, ensuring a robust and scalable architecture.
- Data Ingestion: We built a custom hook architecture to handle Polymarket's dual-API system. We query the Gamma API for metadata and the CLOB API for high-frequency price and order book depth.
- AI Integration: We utilized the Google Gemini API for our research engine. We engineered specific system prompts to force Gemini to output structured JSON data, allowing us to render the AI's analysis as interactive UI elements (checklists, variable cards) rather than just plain text.
- Math Engine: We implemented a custom utility library in TypeScript to handle the financial logic, specifically using linear algebra for arbitrage detection and exponential decay functions for time-value discounting: $$PV = FV \cdot e^{-rt}$$
- Visualization: We used Recharts for the financial charting and Framer Motion to give the UI a polished, "Bloomberg Terminal" feel.
Challenges we ran into
- Handling Live CLOB Data: The Central Limit Order Book (CLOB) is noisy and fast. Visualizing the depth of liquidity without overwhelming the browser was a challenge. We had to implement aggressive caching and data normalization to keep the UI responsive while handling high-frequency updates.
- Prompt Engineering for Structure: Getting an LLM to consistently return valid JSON for strict UI components was difficult. Early versions of the "AI Brief" would often hallucinate keys or return unstructured paragraphs. We solved this by providing Gemini with rigid TypeScript interface definitions in the system prompt.
- Modeling Payoff Surfaces: Visualizing a 3-dimensional concept (Profit vs. Price vs. Time) on a 2D screen required significant iteration. We ultimately settled on a heatmap approach that allows traders to see how their profitability decays as the market approaches its expiration date.
Accomplishments that we're proud of
- The "Math-First" Scanner: We are incredibly proud of the Inefficiency Scanner. Seeing the algorithm correctly identify a real-world threshold violation where \( P(A) > P(B) \) despite \( A \subset B \) was a massive "aha!" moment.
- Zero Mock Data: We resisted the urge to fake data for the demo. Every number, price, and market seen in PulseForge is live.
- Seamless AI Integration: We managed to make Gemini feel like a native part of the financial tool, not just a chatbot tacked onto the side.
- Production Grade UI: We achieved a dark-mode aesthetic that feels professional and trustworthy, suitable for financial research.
What we learned
- Prediction Market Microstructure: We gained a deep understanding of how binary options pricing differs from traditional equities, particularly how liquidity crunches in the order book can create temporary arbitrage opportunities.
- Time-Value Mechanics: We learned the importance of discounting in long-term markets. A $0.90 position paying out $1.00 in a week is very different from one paying out in a year, and our math engine now reflects that reality using \( PV = FV \cdot e^{-rt} \).
- Next.js Server Actions: We learned how to effectively use Server Actions to proxy API requests, keeping our API keys secure while fetching data from third-party sources.
What's next for PulseForge
- Wallet Integration & Execution: Currently, PulseForge is a powerful read-only tool. The next logical step is integrating Web3 wallets to allow users to execute the strategies they build with one click.
- Automated Arbitrage Bots: We plan to move the Inefficiency Scanner to a background worker that runs 24/7, alerting users via push notification the moment a constraint violation like \( \sum P > 1 \) is detected.
- Mobile App: We want to bring this level of analysis to mobile devices, allowing traders to check market health on the go.
Built With
- gemini
- next.js
- polymarket
- react
- typescript
- xapi
Log in or sign up for Devpost to join the conversation.