Modules
Elixir client for the Polymarket APIs.
Client for the Polymarket CLOB REST API (https://clob.polymarket.com).
EIP-712 L1 authentication for the Polymarket CLOB.
On-chain contract addresses for the Polymarket CTF Exchange, keyed by chain and by whether the market is a negative-risk market.
Derives a wallet's deposit-wallet address — the contract wallet Polymarket trades through on a user's behalf.
Polymarket CLOB L2 (HMAC) authentication.
Serialises signed Polymarket.Schemas.Orders into the JSON wire body the CLOB
expects — a single SendOrder object for POST /order, or a JSON array of them
for the batch POST /orders.
EIP-712 signing for Polymarket CLOB V2 orders.
Low-level Ethereum cryptographic primitives used to sign Polymarket orders.
Minimal EIP-712 typed-data hashing, tailored to Polymarket orders.
Client for the Polymarket Gamma REST API (https://gamma-api.polymarket.com).
Client for Polymarket's geoblock check (https://polymarket.com/api/geoblock).
Shared Req-based HTTP plumbing for the Polymarket API clients
(Polymarket.Gamma, Polymarket.Clob).
Helpers for massaging raw JSON (as decoded from an external API) into the shapes our schemas expect.
A single ask price level in an order book. Part of a BookEvent.
Best bid/ask event.
A single bid price level in an order book. Part of a BookEvent.
Book event. A full order book snapshot for an asset.
A non-200 error from a CLOB request, pairing the HTTP status with the
server's message.
A CLOB liquidity-reward configuration attached to a Polymarket.Schemas.Market.
Helpers for building schema structs directly from a decoded message, without
the overhead of Ecto.Changeset casting.
Polymarket CLOB API credentials: the api_key, secret and passphrase
returned by GET /auth/derive-api-key and POST /auth/api-key, plus the
address of the EOA that owns them.
An event returned by the Gamma REST API (e.g. GET /events/keyset).
Event message describing the parent event of a market. Part of a NewMarketEvent.
Internal metadata attached to an Event returned by the Gamma API.
Fee schedule for a market. Part of a NewMarketEvent.
The geoblock status for the caller, as returned by GET /api/geoblock on the
Polymarket site (https://polymarket.com).
Last trade price event. Reports the price, size and side of the most recent trade executed against an asset.
A market returned by the Gamma REST API (e.g. GET /markets/:id).
The parent market for a given token ID, as returned by the CLOB API
GET /markets-by-token/:token_id.
Sports metadata for a market. Part of a Market returned by the Gamma API.
Market resolved event. Announces that a market has settled, naming the winning asset and its outcome.
New market event. Announces a freshly created market on the websocket feed.
A Polymarket CLOB V2 order — the value that gets EIP-712 signed and posted
to POST /order.
Price change struct. Part of a PriceChangeEvent.
Price change event.
The exact POST /order request payload — a signed order plus its routing
metadata — mirroring the CLOB SendOrder object.
A successful (200) response from the CLOB's POST /order.
A series an Event belongs to, as returned by the Gamma API (e.g. nested in
GET /events/keyset).
A tag attached to a Market returned by the Gamma API.
Tick size change event. Announces that the minimum price increment for an asset has changed.
Supervisor for the processes to communicate with Polymarket.
A WebSocket client for the Polymarket CLOB market feed.
Behaviour for modules that handle decoded Polymarket websocket events.
Default no-op websocket handler.
Pure functions to handle messages coming from the Polymarket websocket.
Dynamic supervisor for all websocket connections to polymarket.