Documentation is in progress. Every page in this section describes the current implementation and may change as PolyLab evolves.
Data Sources

Markets and Events Source

In Progress Last updated 2026-03-10

Exact documentation of the Gamma market and event endpoints that feed the PolyLab market snapshot.

Current Implementation

This page is intentionally explicit and implementation-first. If the product or upstream APIs change, the current behavior described here can change with them.

Upstream endpoints

PolyLab fetches market and event data from:

  • https://gamma-api.polymarket.com/markets
  • https://gamma-api.polymarket.com/events

Current request shape

The market fetcher pages through both endpoints with these parameters:

EndpointParameters
/marketsactive=true, closed=false, archived=false, limit, offset, enableOrderBook=false
/eventsactive=true, closed=false, archived=false, limit, offset

Why enableOrderBook=false matters

PolyLab is not fetching or storing a live order-book view in this path. The scanner is built around market snapshot fields, not an execution-grade order-book model.

What comes from /events

The events payload is used for:

  • slug
  • icon or image
  • tags

Those values are then used to enrich market rows with:

  • event_slug
  • icon_url
  • tag_label rows in market_tags
  • primary category

What comes from /markets

The markets payload is used for:

  • market id
  • condition id
  • question
  • outcomes
  • outcome prices
  • spread
  • volume
  • liquidity
  • start and end date
  • market-level fallback slug and icon fields

Event resolution and fallbacks

PolyLab first looks for the first nested event in m["events"][0]. If that event can be resolved in the fetched event map, it uses the event-level slug, icon, and tags.

If not, it falls back to:

  • nested event slug/icon directly
  • then market-level slug/icon

Per-outcome expansion

Markets are not stored one row per market. PolyLab expands the outcomes array and outcomePrices array into one row per outcome in active_market_outcomes.

That is why the scanner naturally sorts and filters outcome rows.