Inspiration

Most prediction market interfaces treat every contract as an isolated bet. That is not how traders from options, rates, or volatility desks think. On Polymarket, many contracts are structurally linked:

  • BTC above $100k cannot be more likely than BTC above $90k
  • by May should not trade above by July
  • mutually exclusive outcomes should not add up to materially more than $1.00

We built Snapback because Polymarket already has the ingredients for TradFi-style relative-value trading, but the tooling to visualize and trade those relationships is still missing. The challenge asked for advanced trading tools that help users understand risk across time, price, and probability. Snapback does that by turning related contracts into a surface, showing where the surface breaks, and translating the break into a corrective spread.

What it does

Snapback is a Polymarket relative-value terminal for finding and visualizing structural mispricings across related market families.

The current product has three linked workflows:

  1. Scanner It discovers live Polymarket event families from the Gamma API, classifies them as strike ladders, expiry curves, or mutex sets, computes the current raw dislocation, and ranks the opportunities.
  2. Visualizer It plots the selected family against a no-arbitrage envelope so a trader can immediately see where the logical ordering is broken.
  3. Spread builder It turns the violated pair into a concrete two-leg trade, shows sizing, friction, break-even repair, edge after spread, and a P&L curve.

For a selected family, Snapback also loads:

  • CLOB price history to show how the two related markets moved over time
  • a 30-day spread series to compute sigma-normalized severity
  • a point-in-time replay/backtest view with episode detection and leave-one-out style evidence
  • top-of-book order book data to estimate live friction and spread sizing

This gives traders a working tool to reason about prediction markets more like a derivatives book: not just “what happens?”, but “which contract is mispriced relative to its logical siblings right now?”

How we built it

Snapback is built with:

  • React 18 + Vite for the application shell
  • Tailwind CSS v4 + shadcn/ui for the terminal UI
  • Chart.js for the price surface, spread history, replay chart, and P&L visualization
  • Auth0 for gated access

The implementation is split into a few important layers:

  • src/lib/gammaApi.js This is the scanner backbone. It fetches live Gamma /events, filters for active and minimally liquid markets, classifies family type from question text, computes raw dislocation, and produces ranked scanner rows. It also preserves a seed fallback path so the terminal still renders when Gamma is unavailable.
  • src/lib/clobApi.js This powers selected-family deep dives. Once a user picks a family, Snapback fetches CLOB /prices-history and /book data for the violating pair.
  • src/lib/PITStats.js This builds aligned spread series, computes sigma, detects dislocation episodes with point-in-time thresholds, and summarizes backtest-style evidence.
  • src/PolymarketRelativeValueTerminal.jsx This ties the scanner, visualizer, replay, and spread builder into one workflow.

From a challenge perspective, we focused on delivering a working end-to-end visualization and trading tool with clear interaction:

  • search and filter the family universe
  • choose a family
  • inspect its surface violation
  • view historical spread behavior
  • inspect the suggested spread and payoff profile

Challenges we ran into

1. The algorithmic challenge: turning raw Polymarket events into tradable structure

The hardest part of the project was not drawing charts. It was designing the algorithm that decides:

  • which markets belong together
  • what structural family they represent
  • what the correct constraint is
  • how to rank the severity of a violation without overclaiming precision

Polymarket does not hand us clean “strike ladder” or “expiry curve” labels. We had to infer that structure from noisy market titles. That meant building heuristics to extract:

  • numeric thresholds like $80k, $90k, $100k
  • month/deadline cues like May, June, July
  • grouped outcome sets that behave like mutex baskets

Then we had to sort those markets into the right order, compute the dislocation in a mathematically defensible way, and make sure the spread direction was structurally implied rather than discretionary.

This challenge matters because the whole product stands or falls on classification quality. If the grouping is wrong, the chart is wrong, the violation is wrong, and the trade construction is wrong.

2. Balancing correctness with implementation honesty

Our docs and product thesis describe a larger analytics vision, but the codebase is intentionally honest about what is live today:

  • Gamma-based family discovery and ranking are live
  • selected-family CLOB analytics are live on demand
  • scanner-wide sigma ranking is not fully wired yet
  • nested-event detection is part of the product thesis, but not yet implemented in the live family classifier
  • the app fetches once on load rather than running a real-time polling loop

One of the challenges was writing the UI and the project narrative so it clearly separates:

  • live values
  • heuristic values
  • illustrative/proxy values
  • future roadmap items

3. React + Chart.js lifecycle management

Snapback uses multiple charts at once, and they update based on selection, theme changes, and newly loaded CLOB data. We had to manage Chart.js instances carefully with refs and explicit cleanup to avoid canvas reuse issues and stale chart state.

4. Making the interface explain complex trading ideas quickly

The challenge emphasizes user understanding and visualization quality. That meant the UX problem was not just “show the data,” but:

  • make the violated surface obvious
  • make long market labels readable
  • make spread direction legible
  • expose replay/evidence without overwhelming the user
  • help the user see the difference between raw points, sigma, friction, and payoff

Accomplishments that we're proud of

  • We built a TradFi-style relative-value workflow on top of Polymarket instead of another single-market dashboard.
  • The scanner is already live against Gamma data and ranks real market families by current dislocation.
  • The no-arbitrage envelope makes a pricing violation understandable in seconds, even for users who do not want to read the underlying math first.
  • The spread builder goes beyond “there is a mispricing” and answers the practical trader question: “what do I actually buy, what does it cost, and what repair do I need to break even?”
  • The replay and backtest-style evidence layer makes the product about risk and trust, not just signal generation.
  • The fallback seed path keeps the app usable in demo or degraded network conditions instead of collapsing into an error page.

What we learned

  • Prediction markets have a real structural layer that is easy to miss if you only look at isolated contracts.
  • Traders need tools that connect probability, time, and payoff, not just a price feed.
  • A good trading tool has to be explicit about assumptions. In this space, clarity about what is live, inferred, historical, or simulated is part of product quality.
  • The UX for advanced market reasoning is as important as the math. A strong visualization can carry a lot of complexity if the workflow is sequenced well.

What's next for Snapback

The next steps are directly aligned with the challenge brief and with the current architecture:

  • expand the scanner from raw-point ranking to broader sigma-normalized ranking
  • finish nested-event logic so implication relationships can be scanned live
  • deepen CLOB integration for more realistic depth and slippage modeling
  • add real-time refresh or websocket-driven updates
  • improve multi-market portfolio views beyond the current pair-focused spread workflow
  • extend the terminal from “find and explain the inefficiency” toward “manage the strategy lifecycle”

Why this fits the Polymarket Design Challenge

Snapback is a direct response to the challenge prompt:

  • it uses real Polymarket market data
  • it provides a working interactive demo
  • it produces concrete outputs across price, time, and probability
  • it is grounded in a real trading workflow: detect mispricing, visualize it, size the spread, inspect friction, and evaluate historical behavior

Most importantly, it gives users a new mental model for using prediction markets. Instead of asking only “which side do I believe?”, Snapback helps them ask “which related contract is mispriced, what risk am I actually taking, and how does that payoff evolve if the market surface repairs?”

Built With

  • auth0
  • netlify
  • polymarketapi
  • react
  • tailwindcss
Share this project:

Updates