Packages

Higher-level Elixir SDK for Polymarket: Gamma market discovery, Data API, CTF/pUSD helpers, and convenience facades. Depends on polymarket_clob for the low-level CLOB surface.

Current section

Files

Jump to
polymarket_sdk lib polymarket config.ex
Raw

lib/polymarket/config.ex

defmodule Polymarket.Config do
@moduledoc """
Shared host constants for the Polymarket SDK.
This module owns the Gamma host. The Data API host is intentionally
re-exported from `PolymarketClob.Config` so the two packages cannot drift:
if Polymarket ever moves the Data API to a new host, the change lands once
in `polymarket_clob` and propagates to every SDK caller.
CLOB-related constants (the CLOB host, exchange addresses, signature-type
values, side constants) live in `PolymarketClob.Config` and should be read
from there directly.
"""
@gamma_host "https://gamma-api.polymarket.com"
@doc """
Current production Gamma API host.
Used for market discovery, event metadata, and resolution lookups.
"""
@spec gamma_host() :: String.t()
def gamma_host, do: @gamma_host
@doc """
Current production Data API host.
Delegates to `PolymarketClob.Config.data_api_host/0` so this package and
`polymarket_clob` stay aligned automatically.
"""
@spec data_api_host() :: String.t()
def data_api_host, do: PolymarketClob.Config.data_api_host()
end