PolymarketClob.API.MarketData (PolymarketClob v0.2.0)

Copy Markdown View Source

Public CLOB market, order-book, and price endpoint wrappers.

These functions are intentionally thin wrappers over PolymarketClob.HTTP.

Summary

Functions

Gets current CLOB market info by condition ID.

Gets the legacy fee-rate response for a token ID when available.

Gets the last trade price for a token ID.

Gets last trade prices for multiple token IDs using Python client body shape.

Gets a market by condition ID.

Gets market metadata by CLOB token ID.

Gets the live-activity trades stream for a market by condition ID.

Gets the midpoint price for a token ID.

Gets midpoints for multiple token IDs using Python client body shape.

Gets the negative-risk flag for a token ID.

Gets the order book for a token ID.

Gets order books for multiple token IDs using Python client body shape.

Gets a side-specific price for a token ID.

Gets side-specific prices for multiple token IDs using Python client body shape.

Gets historical prices using CLOB query parameter names.

Lists markets with sampling, paginated by :next_cursor.

Lists simplified markets with sampling, paginated by :next_cursor.

Lists simplified markets, paginated by :next_cursor.

Gets the spread for a token ID.

Gets spreads for multiple token IDs using Python client body shape.

Gets the minimum tick size for a token ID.

Returns CLOB server health.

Returns CLOB server time.

Returns CLOB server version.

Types

result()

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

Functions

get_clob_market_info(condition_id, opts \\ [])

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

Gets current CLOB market info by condition ID.

get_fee_rate(token_id, opts \\ [])

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

Gets the legacy fee-rate response for a token ID when available.

get_last_trade_price(token_id, opts \\ [])

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

Gets the last trade price for a token ID.

get_last_trades_prices(params, opts \\ [])

@spec get_last_trades_prices(
  [map()],
  keyword()
) :: result()

Gets last trade prices for multiple token IDs using Python client body shape.

get_market(condition_id, opts \\ [])

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

Gets a market by condition ID.

get_market_by_token(token_id, opts \\ [])

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

Gets market metadata by CLOB token ID.

get_market_trades_events(condition_id, opts \\ [])

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

Gets the live-activity trades stream for a market by condition ID.

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

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

Lists markets.

get_midpoint(token_id, opts \\ [])

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

Gets the midpoint price for a token ID.

get_midpoints(params, opts \\ [])

@spec get_midpoints(
  [map()],
  keyword()
) :: result()

Gets midpoints for multiple token IDs using Python client body shape.

get_neg_risk(token_id, opts \\ [])

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

Gets the negative-risk flag for a token ID.

get_order_book(token_id, opts \\ [])

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

Gets the order book for a token ID.

get_order_books(params, opts \\ [])

@spec get_order_books(
  [map()],
  keyword()
) :: result()

Gets order books for multiple token IDs using Python client body shape.

get_price(token_id, side, opts \\ [])

@spec get_price(String.t(), String.t() | atom() | integer(), keyword()) :: result()

Gets a side-specific price for a token ID.

get_prices(params, opts \\ [])

@spec get_prices(
  [map()],
  keyword()
) :: result()

Gets side-specific prices for multiple token IDs using Python client body shape.

get_prices_history(params, opts \\ [])

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

Gets historical prices using CLOB query parameter names.

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

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

Lists markets with sampling, paginated by :next_cursor.

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

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

Lists simplified markets with sampling, paginated by :next_cursor.

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

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

Lists simplified markets, paginated by :next_cursor.

get_spread(token_id, opts \\ [])

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

Gets the spread for a token ID.

get_spreads(params, opts \\ [])

@spec get_spreads(
  [map()],
  keyword()
) :: result()

Gets spreads for multiple token IDs using Python client body shape.

get_tick_size(token_id, opts \\ [])

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

Gets the minimum tick size for a token ID.

ok(opts \\ [])

@spec ok(keyword()) :: result()

Returns CLOB server health.

server_time(opts \\ [])

@spec server_time(keyword()) :: result()

Returns CLOB server time.

version(opts \\ [])

@spec version(keyword()) :: result()

Returns CLOB server version.