Polymarket Analytics Workspace
A full prediction-market analytics web application built around Polymarket data: events and markets are cached into Postgres, price history is charted, related news is attached, and an AI layer produces an analysis for each event. The same data is also exposed to LLM clients over MCP.
Private repository. Source code is not public. Implementation details, a guided walkthrough, or a sanitized sample are available on request.
This page leads the proof set with a complete analytics application rather than a single utility. It shows the full path from third-party market APIs to a cached, charted, news-enriched UI with an AI analysis layer — and the same data re-exposed to LLM clients over MCP. It is private-repo proof: the architecture is verifiable in source, while a public deployment and any measured outcome remain separate work.
Proof assets and links
- private-repo-proof: Mavline/polymarket_analytic — Next.js + Supabase event/market cache, CLOB price history, news enrichment, OpenRouter AI analysis, and an MCP endpoint; architecture documented in docs/ARCHITECTURE.md. No public deployment claimed.
Problem
A prediction market like Polymarket exposes a lot of raw event and market data through APIs, but turning it into a usable analytics surface — with cached browsing, charts, news context, and a structured opinion per event — is a real application, not a single API call.
Context
This is a complete web application, not a script. It pulls from the Polymarket Gamma and CLOB APIs, caches into Supabase/Postgres so the UI is not API-bound on every load, enriches events with news, and adds an AI analysis layer. It is presented here as private-repo proof: the architecture is verifiable in source, but no public deployment, trading capability, or measured result is claimed.
Inputs
- Polymarket Gamma events and markets (categories, timeframes, pagination)
- Polymarket CLOB market price history
- Related news for an event (news enrichment provider)
Technical approach
The frontend is a Next.js App Router UI with client-side query caching. API routes read from a Supabase/Postgres cache instead of hitting Gamma on every request; after a page load a background sync pages through Gamma with offset pagination and upserts events and markets, while an hourly cron job pre-warms popular categories (tags, sports, events, prices). Dedicated client modules wrap Gamma, the CLOB price-history endpoint, and the news provider; logic modules handle caching, market snapshots, quote handling, and tag/timeframe resolution. An OpenRouter client produces the per-event AI analysis, and an MCP route exposes the same data to LLM tooling through the Model Context Protocol.
Stack
- Next.js (App Router) and React
- Supabase / Postgres cache
- Recharts for price-history charts
- MCP handler with the Model Context Protocol SDK
- Gamma, CLOB, and news API clients; OpenRouter for AI analysis
What was built
A multi-surface analytics application: a homepage event grid with category and timeframe filters, an event detail view with price-history charts and attached news, an AI analysis layer per event, background sync and hourly cron warming for the cache, snapshot and archive jobs, and an MCP endpoint so an LLM client can query the same cached data. The structure (API routes, client wrappers, logic modules) is documented in the repository's architecture notes.
Deployment
Private-repo proof. The architecture is verifiable in source; no public live URL, trading function, or measured analytics outcome is claimed for this page.
What can be reused
- Cache-first API design: serve from Postgres, refresh upstream in the background
- Scheduled cron warming for popular query paths
- An MCP endpoint that re-exposes an app's own cached data to LLM clients
- Per-record AI analysis layered on top of structured data and news
Boundaries
- Private repository proof, not a deployed public app claim
- Analytics and research only — no trading is performed and this is not financial advice
- No API keys, user data, or measured results are exposed