Skip to content

PolyPulse is a comprehensive market intelligence platform that provides real-time analytics, volume tracking, and price monitoring for Polymarket traders. Built with modern web technologies and designed for professional traders who need actionable insights across 100+ prediction markets.

Notifications You must be signed in to change notification settings

Marvy247/PolyPulse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 

Repository files navigation

PolyPulse

Professional Trading Dashboard for Polymarket

PolyPulse is a comprehensive market intelligence platform that provides real-time analytics, volume tracking, and price monitoring for Polymarket traders. Built with modern web technologies and designed for professional traders who need actionable insights across 100+ prediction markets.

TypeScript Next.js React License


Overview

PolyPulse addresses critical challenges faced by Polymarket traders:

  • Manual Market Monitoring: Automating surveillance of 100+ markets simultaneously
  • Volume Analysis: Detecting unusual trading activity 2.5x above category averages
  • Price Tracking: Monitoring 1%+ price movements with 30-second refresh intervals
  • Market Intelligence: Comprehensive analytics dashboard with sentiment distribution and category performance

Why PolyPulse?

Polymarket hosts hundreds of prediction markets. Manual analysis is time-consuming and you miss opportunities. PolyPulse provides automated, real-time analysis with professional-grade analytics running continuously.


Key Features

1. Market Analytics Dashboard

Comprehensive analytics with:

  • Sentiment Distribution: Visualize price distribution (Very Bullish, Bullish, Neutral, Bearish, Very Bearish)
  • Category Performance: Top 5 categories by 24h trading volume
  • Most Active Markets: Real-time ranking by volume
  • Key Metrics: Total volume, 24h volume, average liquidity, active markets count

2. Volume Analysis

Advanced volume monitoring:

  • Spike Detection: Identifies markets with 2.5x above category average volume
  • High Volume Tracking: Markets with >$100K in 24h volume
  • Statistical Analysis: Average volume calculations across all markets
  • Visual Indicators: Progress bars showing spike intensity

3. Price Tracking

Sensitive price movement detection:

  • 1% Threshold: Catches early sentiment shifts in stable markets
  • Directional Analysis: Separate tracking for upward vs downward movements
  • Real-Time Monitoring: 30-second refresh intervals
  • Movement Statistics: Count and magnitude of price changes

4. Professional Dashboard

Multi-view interface:

  • Tab Navigation: Overview, Market Analytics, Volume Analysis, Price Tracking, Arbitrage
  • Sticky Header: Always-visible navigation
  • Dark Mode Support: Full dark mode compatibility
  • Responsive Design: Optimized for mobile, tablet, and desktop

5. Real-Time Updates

  • Live market data updates every 30 seconds
  • Automatic deduplication of alerts
  • WebSocket status monitoring
  • Background refresh with React Query caching

Technology Stack

Frontend

  • Next.js 16.0.3 - React framework with App Router
  • React 19.2.0 - Latest React with concurrent features
  • TypeScript 5.x - Type-safe development

State Management

  • Zustand 5.0.8 - Lightweight global state
  • React Query 5.90.10 - Server state management and caching

UI & Styling

  • Tailwind CSS 4.x - Utility-first CSS
  • Radix UI - Accessible component primitives
  • Lucide React - Consistent icon library
  • Framer Motion - Smooth animations
  • shadcn/ui - Reusable component collection

Data & APIs

  • Axios 1.13.2 - HTTP client
  • Polymarket Gamma API - Market data
  • Polymarket CLOB API - Order book data
  • WebSocket - Real-time updates

Testing

  • Vitest 4.0.10 - Fast unit testing
  • Testing Library 16.3.0 - Component testing
  • 25 Passing Tests - Comprehensive coverage

Getting Started

Prerequisites

  • Node.js 18.0.0 or higher
  • npm 9.0.0 or higher

Installation

  1. Clone the repository

    git clone <your-repo-url>
    cd poly-pulse
  2. Install dependencies

    npm install
  3. Environment Setup

    cp .env.local.example .env.local

    Default values (no API keys required):

    NEXT_PUBLIC_POLYMARKET_GAMMA_API=https://gamma-api.polymarket.com
    NEXT_PUBLIC_POLYMARKET_CLOB_API=https://clob.polymarket.com
    NEXT_PUBLIC_POLYMARKET_WS_URL=wss://ws-subscriptions-clob.polymarket.com/ws
  4. Start development server

    npm run dev

    Open http://localhost:3000

Commands

npm run dev          # Development server with hot reload
npm run build        # Production build
npm run start        # Start production server
npm run test         # Run tests in watch mode
npm run test:run     # Run tests once (CI mode)
npm run lint         # ESLint code quality checks

Project Structure

poly-pulse/
├── app/                          # Next.js App Router
│   ├── api/markets/             # API routes for market data
│   ├── dashboard/               # Main dashboard page
│   ├── page.tsx                 # Landing page
│   └── layout.tsx               # Root layout with providers
│
├── components/                   # React Components
│   ├── market-analytics-panel.tsx    # Comprehensive analytics
│   ├── volume-analysis.tsx           # Volume spike detection
│   ├── price-tracker.tsx             # Price movement tracking
│   ├── arbitrage-opportunities.tsx   # Arbitrage monitoring
│   ├── market-alerts.tsx             # Alert notifications
│   └── ui/                           # Base UI components
│
├── lib/                          # Core Libraries
│   ├── hooks/use-markets.ts     # Market data hooks
│   ├── polymarket/              # Polymarket API clients
│   │   ├── gamma-client.ts      # Gamma API client
│   │   ├── analytics.ts         # Analytics engine
│   │   └── __tests__/           # Unit tests
│   ├── stores/market-store.ts   # Zustand state management
│   └── providers/               # React context providers
│
├── types/polymarket.ts          # TypeScript type definitions
├── package.json                 # Dependencies
└── README.md                    # This file

Architecture Diagrams

System Architecture

graph TB
    subgraph "Client Layer"
        UI[React UI Components]
        State[Zustand State]
        Cache[React Query Cache]
    end

    subgraph "Application Layer"
        Dashboard[Dashboard Page]
        Landing[Landing Page]
        Analytics[Analytics Engine]
    end

    subgraph "API Layer"
        APIRoute[Next.js API Routes]
        GammaClient[Gamma API Client]
    end

    subgraph "External Services"
        PolymarketAPI[Polymarket Gamma API]
    end

    UI --> State
    UI --> Cache
    Dashboard --> Analytics
    Dashboard --> APIRoute
    APIRoute --> GammaClient
    GammaClient --> PolymarketAPI
    Analytics --> State
    State --> UI
Loading

Data Flow Sequence

sequenceDiagram
    participant User
    participant Dashboard
    participant ReactQuery
    participant APIRoute
    participant PolymarketAPI
    participant Analytics
    participant Store

    User->>Dashboard: Load Dashboard
    Dashboard->>ReactQuery: Request Markets
    ReactQuery->>APIRoute: GET /api/markets
    APIRoute->>PolymarketAPI: Fetch Markets
    PolymarketAPI-->>APIRoute: Market Data
    APIRoute->>APIRoute: Extract Categories
    APIRoute->>APIRoute: Parse JSON Strings
    APIRoute-->>ReactQuery: Transformed Data
    ReactQuery-->>Dashboard: Market List
    Dashboard->>Analytics: Analyze Markets
    Analytics->>Analytics: Detect Volume Spikes
    Analytics->>Analytics: Track Price Movements
    Analytics->>Store: Store Opportunities
    Store-->>Dashboard: Update UI
    Dashboard-->>User: Display Results
Loading

Analytics Pipeline

flowchart TD
    Start([Market Data]) --> Parse[Parse JSON & Extract Categories]
    Parse --> Validate{Valid Data?}
    Validate -->|No| Error[Skip Market]
    Validate -->|Yes| Volume[Volume Analysis]
    
    Volume --> CheckVol{Volume > 2.5x Avg?}
    CheckVol -->|Yes| StoreVol[Store Volume Spike]
    CheckVol -->|No| Price[Price Analysis]
    
    StoreVol --> Price
    Price --> HasPrev{Has Previous Price?}
    HasPrev -->|No| Wait[Wait for Next Cycle]
    HasPrev -->|Yes| CheckPrice{Change > 1%?}
    
    CheckPrice -->|Yes| StorePrice[Store Price Movement]
    CheckPrice -->|No| Dedup[Deduplication Check]
    
    StorePrice --> Dedup
    Dedup --> UI[Update UI]
    Wait --> End([Complete])
    UI --> End
    Error --> End
Loading

Component Hierarchy

graph LR
    subgraph "Pages"
        Landing[Landing Page]
        Dashboard[Dashboard Page]
    end

    subgraph "Layout"
        Header[Header with Logo]
        ThemeToggle[Theme Toggle]
    end

    subgraph "Dashboard Views"
        Overview[Overview Tab]
        AnalyticsTab[Analytics Panel]
        VolumeTab[Volume Analysis]
        PriceTab[Price Tracker]
        ArbitrageTab[Arbitrage Monitor]
    end

    subgraph "Components"
        Logo[PolyPulse Logo]
        Cards[Analytics Cards]
        Charts[Visual Indicators]
    end

    Landing --> Header
    Dashboard --> Header
    Dashboard --> Overview
    Dashboard --> AnalyticsTab
    Dashboard --> VolumeTab
    Dashboard --> PriceTab
    Dashboard --> ArbitrageTab
    AnalyticsTab --> Cards
    VolumeTab --> Charts
    PriceTab --> Charts
Loading

How It Works

Data Flow Summary

  1. API Route (/api/markets) fetches data from Polymarket Gamma API
  2. Category Extraction analyzes event titles to categorize markets
  3. React Query caches data with 30-second refresh
  4. Analytics Engine processes markets for volume spikes and price movements
  5. Zustand Store manages detected opportunities with deduplication
  6. UI Components display real-time analytics across multiple views

Category Detection

Markets are automatically categorized based on event title keywords:

  • Economics: Fed, rate, recession, economy, GDP, inflation
  • Crypto: Bitcoin, Ethereum, Tether, DeFi, NFT
  • Politics: Trump, election, president, congress, senate
  • Sports: Match, team, game, NFL, NBA, soccer
  • Technology: AI, SpaceX, Tesla, Apple, Google, Meta
  • Entertainment: Movie, box office, Oscar, Grammy, music
  • Weather: Climate, temperature, hurricane, earthquake

Analytics Thresholds

  • Volume Spikes: 2.5x above category average
  • Price Movements: 1% threshold (optimized for Polymarket's stable prices)
  • Refresh Rate: 30 seconds
  • Deduplication: 30-second window to prevent duplicates

Understanding Polymarket Efficiency

Why 1% Price Threshold?

Polymarket is a highly efficient market:

  • ✅ Automated market makers keep prices stable
  • ✅ Professional arbitrageurs correct inefficiencies instantly
  • ✅ YES + NO prices always equal $1.00 (zero arbitrage opportunities found)
  • ✅ 5%+ price movements are extremely rare even over 24 hours

Our Solution: 1% threshold catches early sentiment shifts before they become obvious, providing real trading value.

What Actually Changes?

  • Volume is more volatile than price
  • Trading activity spikes before price movements
  • Early detection at 1% provides edge over 5% threshold

Analytics Features

Market Analytics Panel

  • Aggregate metrics across all markets
  • Sentiment distribution visualization
  • Category performance rankings
  • Most active markets tracking

Volume Analysis

  • Real-time spike detection
  • Category-based comparisons
  • High-volume market identification
  • Statistical analysis

Price Tracking

  • 1% sensitivity for early detection
  • Bullish/bearish directional analysis
  • Movement history and statistics
  • Visual trend indicators

Arbitrage Monitoring

  • Continuous monitoring for rare opportunities
  • Educational content about market efficiency
  • Historical tracking when opportunities occur

Deployment

Vercel (Recommended)

vercel --prod

Docker

docker build -t polypulse .
docker run -p 3000:3000 polypulse

Manual

npm run build
npm start

Testing

npm run test        # Watch mode
npm run test:run    # Single run
npm run test:ui     # UI dashboard

Test Coverage: 25 passing tests covering analytics engine, volume detection, and price tracking.


Performance

  • Build Time: ~7 seconds with Turbopack
  • Lighthouse Score Target: 95+ performance
  • Data Refresh: 30-second intervals
  • Market Capacity: 100+ markets simultaneously
  • Bundle Optimization: Code splitting, tree shaking, minification

Contributing

  1. Fork the repository
  2. Create feature branch (git checkout -b feature/your-feature)
  3. Make changes with tests
  4. Run npm run test:run && npm run lint
  5. Commit changes (git commit -m 'feat: add feature')
  6. Push and create PR

Roadmap

Future Enhancements

  • Telegram/Discord notifications
  • Historical price charts
  • Custom alert preferences
  • Portfolio tracking
  • API for third-party integrations
  • Mobile application

License

MIT License - See LICENSE file for details


Acknowledgments

  • Polymarket for public APIs
  • shadcn/ui for component architecture
  • Next.js Team for excellent framework
  • Vercel for hosting infrastructure

Built for Polymarket Builder Grant

PolyPulse demonstrates:

  • ✅ Deep understanding of Polymarket's market efficiency
  • ✅ Professional-grade analytics that provide real value
  • ✅ Modern tech stack with excellent architecture
  • ✅ Honest approach to market dynamics
  • ✅ Focus on features that actually work (volume/price vs rare arbitrage)

Built with precision for the Polymarket ecosystem

About

PolyPulse is a comprehensive market intelligence platform that provides real-time analytics, volume tracking, and price monitoring for Polymarket traders. Built with modern web technologies and designed for professional traders who need actionable insights across 100+ prediction markets.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published