Inspiration

Prediction markets like Polymarket are a powerful tool for forecasting, but their complexity can be a major barrier for new users. The data is dense, the concepts can be intimidating, and the risk is real.

My inspiration for PolyPulse was to bridge this gap. I wanted to use the power of Claude AI not just as a Q&A bot, but as a personal AI analyst and educational co-pilot. The goal was to create an application that makes Polymarket accessible, insightful, and—most importantly—a powerful learning tool, allowing users to build confidence before committing real money.

What it does

PolyPulse is an AI co-pilot that guides users through a complete "learn, test, trade, review" loop for Polymarket.

Chat: Users start by chatting with an AI analyst, powered by Claude. They can ask questions about specific markets, strategies, or general concepts.

Deep Dive Quiz: To test their understanding, a user can request a "Deep Dive Quiz." The AI dynamically generates a Socratic-style quiz about the market they're discussing to challenge their assumptions.

Paper Trading: Once confident, the user can place a risk-free paper trade directly from the chat interface.

AI Analysis Report: After the trade is "resolved," the AI provides a custom, personalized report. This report breaks down the trade's outcome, analyzes what happened in the market, and provides actionable lessons, turning every prediction into a learning opportunity.

How we built it

PolyPulse is built around a guided, interactive user journey, managed by a React frontend and a Node.js/Express backend.

Core Connection: The backend (index.ts) is the project's heart, connecting to both the Anthropic API (for Claude's intelligence) and the Polymarket MCP (for live market data). It uses WebSockets (ws) to manage a real-time, stateful conversation with the user.

The User Flow: The frontend (chat.tsx) isn't just a simple chat window. It manages several distinct application stages (AppStage) to guide the user:

Chat: General Q&A.

Deep Dive Quiz: AI-generated quiz view (DeepDiveQuiz.tsx).

Paper Trading: A modal (PaperTradeModal.tsx) for placing risk-free bets.

AI Analysis Report: A final, streaming report (AnalysisReport.tsx) analyzing the user's trade.

Built With:

Languages: TypeScript

Frontend: React, Tailwind CSS

Backend: Node.js, Express

Real-time Comms: WebSockets (ws library)

AI: Anthropic API (Claude)

Data: Polymarket MCP (Model-Context Protocol)

UI / Icons: shadcn/ui, Lucide React

Challenges we ran into

Prompt Engineering: The most significant challenge was prompt engineering. It was easy to get Claude to answer a question, but much harder to have it create a relevant, non-trivial quiz question with valid options (DeepDiveQuiz). It was even more challenging to get it to write a concise, insightful analysis of a trade outcome (AnalysisReport) that felt like a real analyst's report.

Data and State Flow: Managing the flow of data was complex. A market selected in the chat stage had to be passed to the PaperTradeModal and then used by the backend to generate the AnalysisReport. Using a central state in the main chat.tsx component was my solution for this.

Streaming Responses: Implementing the streaming analysis report (AnalysisReport.tsx) required careful handling of WebSocket messages to append the text as it arrived, creating a "live" and engaging user experience.

Accomplishments that we're proud of

The "Learn, Test, Trade, Review" Loop: I'm proud of creating a complete, guided user journey. It moves beyond a simple chatbot and provides a structured educational path that builds user confidence.

AI as a Tool-Builder: This project successfully uses Claude as more than a Q&A bot. It acts as a generative tool-builder—dynamically creating a unique quiz for any market and generating a structured, post-hoc analysis report for any trade.

A Fully-Integrated UI: I was able to manage a complex UI state that seamlessly transitions the user between four distinct application stages (Chat, Quiz, Trade Modal, and Report) without ever feeling lost.

What we learned

Managing UI State: Juggling the different application stages in React was key. It required passing data (like the currentMarket) and managing UI state (AppStage) based on user actions and WebSocket messages, ensuring a smooth transition from chat to quiz to modal to report.

Integrating APIs: I learned how to effectively combine a data-heavy, real-time API (Polymarket MCP) with a powerful language model (Claude), using the LLM to interpret and add significant value to the raw data.

The Power of Prompting: This project reinforced how critical prompt engineering is. The difference between a "basic" bot and an "expert" analyst lies entirely in the structure, context, and constraints given to the AI.

What's next for PolyPulse

Portfolio & History: Add a persistent user portfolio to track paper trading performance over time. This would allow the AI to provide even deeper analysis based on a user's trading history and biases.

Proactive Insights: Allow the AI to proactively scan markets and send notifications to the user about interesting opportunities or significant market movements.

Real Trading Integration: Implement a secure wallet connection to allow users to "graduate" from paper trading to placing real, low-stakes trades, all within the same guided interface.

Built With

Share this project:

Updates