What the SDK does
The SDK covers every major surface area of the Polymarket platform:- Discovery — list and search markets and events via the Gamma API
- Market data — fetch live order books and midpoint prices via CLOB
- Trading — place and manage authenticated limit and market orders with
SecureClient - Account reads — query positions, portfolio value, and activity history via the Data API
- Websockets — subscribe to market, user, RTDS, and sports channels through a unified
subscribe()call - Hybrid pattern — an HTTP adapter example that lets a Solana (or any) front-end drive Polygon settlement
Crate layout
The SDK is split into three focused crates so you can depend on only the layer you need:| Crate | Role |
|---|---|
polymarket-types | Branded primitive IDs (MarketId, TokenId) and Polygon address types |
polymarket-bindings | Raw API deserialization structs and normalized domain models |
polymarket-client | PublicClient, SecureClient, pagination helpers, and error types |
polymarket-client, which re-exports the types and bindings you need day-to-day.
Install
Addpolymarket-client and Tokio to your Cargo.toml. The default feature set gives you HTTP discovery and CLOB market data with no extras compiled in:
secure feature. It is a superset that bundles everything in one flag:
Main client types
| Type | When to use it |
|---|---|
PublicClient | Unauthenticated reads: markets, events, order books, midpoints |
SecureClient | Authenticated writes and reads: orders, cancellations, account positions (secure feature required) |
Environment | Selects production or staging base URLs; pass it when constructing either client |
ListMarketsRequest | Paginated query builder for Gamma market discovery |
FetchOrderBookRequest | Single-book fetch by TokenId |
API reference
Full Rustdoc for every public type and method is published automatically on docs.rs: docs.rs/polymarket_clientNext steps
Quickstart
List live markets and fetch an order book in under five minutes
Feature Flags
Enable only the features your project needs
GitHub
Browse the source code and open issues
crates.io
View the published crate and release history

