PolymarketClob.API.Gamma (PolymarketClob v0.2.0)

Copy Markdown View Source

Polymarket Gamma API wrappers — the public markets/events catalog (gamma-api.polymarket.com).

This is the right surface for market discovery: every market and event, with rich filters (active/closed, slug, series, tags, volume ordering), including the high-frequency recurring series (e.g. the 5-minute "BTC Up or Down" markets) that the CLOB sampling-markets endpoint — which only lists reward-bearing liquidity markets — does not return.

Thin wrappers over PolymarketClob.HTTP with the host pointed at the Gamma API. Responses are JSON arrays (events/markets) rather than the CLOB's %{"data" => [...]} envelope.

Notable response fields

  • an event has slug, title, active, closed, markets (array), series (array, with recurrence like "5m"), tags;
  • a market has question, conditionId, clobTokenIds (a JSON-encoded string array of the two token ids), outcomes (e.g. ["Up","Down"]), active, closed.

Summary

Functions

Fetch a single event by slug (returns the matching event(s)).

List events. Common params: active: true, closed: false, slug: "...", series_id: ..., tag: "...", limit:, offset:, order: "volume24hr", ascending: false.

List markets. Same filter vocabulary as get_events/2 plus clob_token_ids: / condition_ids: to fetch specific markets.

List series (recurring market groups). Params: active:, closed:, slug:.

Types

result()

@type result() :: {:ok, term()} | {:error, PolymarketClob.Error.t()}

Functions

get_event_by_slug(slug, opts \\ [])

@spec get_event_by_slug(
  String.t(),
  keyword()
) :: result()

Fetch a single event by slug (returns the matching event(s)).

get_events(params \\ [], opts \\ [])

@spec get_events(keyword(), keyword()) :: result()

List events. Common params: active: true, closed: false, slug: "...", series_id: ..., tag: "...", limit:, offset:, order: "volume24hr", ascending: false.

get_markets(params \\ [], opts \\ [])

@spec get_markets(keyword(), keyword()) :: result()

List markets. Same filter vocabulary as get_events/2 plus clob_token_ids: / condition_ids: to fetch specific markets.

get_series(params \\ [], opts \\ [])

@spec get_series(keyword(), keyword()) :: result()

List series (recurring market groups). Params: active:, closed:, slug:.