Update Polymarket documentation - March 30, 2026
Updated 229 documentation pages reflecting latest official docs changes: - API Reference: authentication, rate-limits, clients-sdks, market-data endpoints - Developers: CLOB, Gamma Markets, RTDS, Sports Websocket, Builders, CTF - Trading: fees, bridge, orders, orderbook, clients - Polymarket Learn: get-started guides, deposits, trading - Builders: tiers, api-keys, profile, examples, order-attribution - Quickstart: overview, first-order, websocket guides - Concepts: markets-events, prices-orderbook, resolution - Market Makers: getting-started, trading, liquidity-rewards - Resources: error-codes, contract-addresses, blockchain-data
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
|
||||
# Builder Methods
|
||||
|
||||
> These methods require builder API credentials and are only relevant for Builders Program order attribution.
|
||||
> Methods for querying orders and trades using builder API credentials.
|
||||
|
||||
## Client Initialization
|
||||
|
||||
@@ -122,7 +122,70 @@ Builder methods require the client to initialize with a separate builder config
|
||||
|
||||
***
|
||||
|
||||
### getBuilderTrades()
|
||||
### getOrder
|
||||
|
||||
Get details for a specific order by ID using builder authentication. When called from a builder-configured client, the request authenticates with builder headers and returns orders attributed to the builder.
|
||||
|
||||
```typescript Signature theme={null}
|
||||
async getOrder(orderID: string): Promise<OpenOrder>
|
||||
```
|
||||
|
||||
<Info>
|
||||
When a `BuilderConfig` is present, the client automatically sends builder headers. If builder auth is unavailable, it falls back to standard L2 headers.
|
||||
</Info>
|
||||
|
||||
<CodeGroup>
|
||||
```typescript TypeScript theme={null}
|
||||
const order = await clobClient.getOrder("0xb816482a...");
|
||||
console.log(order);
|
||||
```
|
||||
|
||||
```python Python theme={null}
|
||||
order = clob_client.get_order("0xb816482a...")
|
||||
print(order)
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
***
|
||||
|
||||
### getOpenOrders
|
||||
|
||||
Get all open orders attributed to the builder. When called from a builder-configured client, returns orders placed through the builder rather than orders owned by the authenticated user.
|
||||
|
||||
```typescript Signature theme={null}
|
||||
async getOpenOrders(
|
||||
params?: OpenOrderParams,
|
||||
only_first_page?: boolean,
|
||||
): Promise<OpenOrder[]>
|
||||
```
|
||||
|
||||
**Params**
|
||||
|
||||
<ResponseField name="id" type="string">
|
||||
Optional. Filter by order ID.
|
||||
</ResponseField>
|
||||
|
||||
<ResponseField name="market" type="string">
|
||||
Optional. Filter by market condition ID.
|
||||
</ResponseField>
|
||||
|
||||
<ResponseField name="asset_id" type="string">
|
||||
Optional. Filter by token ID.
|
||||
</ResponseField>
|
||||
|
||||
```typescript TypeScript theme={null}
|
||||
// All open orders for this builder
|
||||
const orders = await clobClient.getOpenOrders();
|
||||
|
||||
// Filtered by market
|
||||
const marketOrders = await clobClient.getOpenOrders({
|
||||
market: "0xbd31dc8a...",
|
||||
});
|
||||
```
|
||||
|
||||
***
|
||||
|
||||
### getBuilderTrades
|
||||
|
||||
Retrieves all trades attributed to your builder account. Use this to track which trades were routed through your platform.
|
||||
|
||||
@@ -272,7 +335,7 @@ async getBuilderTrades(
|
||||
|
||||
***
|
||||
|
||||
### revokeBuilderApiKey()
|
||||
### revokeBuilderApiKey
|
||||
|
||||
Revokes the builder API key used to authenticate the current request. After revocation, the key can no longer be used for builder-authenticated requests.
|
||||
|
||||
@@ -305,3 +368,6 @@ async revokeBuilderApiKey(): Promise<any>
|
||||
Execute onchain operations without paying gas.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
|
||||
Built with [Mintlify](https://mintlify.com).
|
||||
@@ -58,7 +58,7 @@ L1 methods require the client to initialize with a signer.
|
||||
|
||||
***
|
||||
|
||||
### createApiKey()
|
||||
### createApiKey
|
||||
|
||||
Creates a new API key (L2 credentials) for the wallet signer. Each wallet can only have one active API key at a time — creating a new key invalidates the previous one.
|
||||
|
||||
@@ -84,7 +84,7 @@ async createApiKey(nonce?: number): Promise<ApiKeyCreds>
|
||||
|
||||
***
|
||||
|
||||
### deriveApiKey()
|
||||
### deriveApiKey
|
||||
|
||||
Derives an existing API key using a specific nonce. If you've already created credentials with a particular nonce, this returns the same credentials.
|
||||
|
||||
@@ -110,7 +110,7 @@ async deriveApiKey(nonce?: number): Promise<ApiKeyCreds>
|
||||
|
||||
***
|
||||
|
||||
### createOrDeriveApiKey()
|
||||
### createOrDeriveApiKey
|
||||
|
||||
Convenience method that attempts to derive an API key with the default nonce, or creates a new one if it doesn't exist. **Recommended for initial setup.**
|
||||
|
||||
@@ -134,7 +134,7 @@ async createOrDeriveApiKey(nonce?: number): Promise<ApiKeyCreds>
|
||||
|
||||
## Order Signing
|
||||
|
||||
### createOrder()
|
||||
### createOrder
|
||||
|
||||
Create and sign a limit order locally without posting it to the CLOB. Use this when you want to sign orders in advance or implement custom submission logic. Submit via [`postOrder()`](/trading/clients/l2#postorder) or [`postOrders()`](/trading/clients/l2#postorders).
|
||||
|
||||
@@ -239,7 +239,7 @@ async createOrder(
|
||||
|
||||
***
|
||||
|
||||
### createMarketOrder()
|
||||
### createMarketOrder
|
||||
|
||||
Create and sign a market order locally without posting it to the CLOB. Submit via [`postOrder()`](/trading/clients/l2#postorder) or [`postOrders()`](/trading/clients/l2#postorders).
|
||||
|
||||
@@ -339,7 +339,7 @@ async createMarketOrder(
|
||||
## Troubleshooting
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="Error: INVALID_SIGNATURE">
|
||||
<Accordion title="Error - INVALID_SIGNATURE">
|
||||
Your wallet's private key is incorrect or improperly formatted.
|
||||
|
||||
**Solution:**
|
||||
@@ -349,7 +349,7 @@ async createMarketOrder(
|
||||
* Check that the key has proper permissions
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="Error: NONCE_ALREADY_USED">
|
||||
<Accordion title="Error - NONCE_ALREADY_USED">
|
||||
The nonce you provided has already been used to create an API key.
|
||||
|
||||
**Solution:**
|
||||
@@ -358,7 +358,7 @@ async createMarketOrder(
|
||||
* Or use a different nonce with `createApiKey()`
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="Error: Invalid Funder Address">
|
||||
<Accordion title="Error - Invalid Funder Address">
|
||||
Your funder address is incorrect or doesn't match your wallet.
|
||||
|
||||
**Solution:** Check your proxy wallet address at [polymarket.com/settings](https://polymarket.com/settings). If it doesn't exist, the user has never logged in to Polymarket.com — deploy the proxy wallet first before creating L2 credentials.
|
||||
@@ -403,3 +403,6 @@ async createMarketOrder(
|
||||
Place and manage orders with API credentials.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
|
||||
Built with [Mintlify](https://mintlify.com).
|
||||
@@ -71,7 +71,7 @@ L2 methods require the client to initialize with a signer, signature type, API c
|
||||
|
||||
***
|
||||
|
||||
### createAndPostOrder()
|
||||
### createAndPostOrder
|
||||
|
||||
Convenience method that creates, signs, and posts a limit order in a single call. Use when you want to buy or sell at a specific price.
|
||||
|
||||
@@ -157,7 +157,7 @@ async createAndPostOrder(
|
||||
|
||||
***
|
||||
|
||||
### createAndPostMarketOrder()
|
||||
### createAndPostMarketOrder
|
||||
|
||||
Convenience method that creates, signs, and posts a market order in a single call. Use when you want to buy or sell at the current market price.
|
||||
|
||||
@@ -235,7 +235,7 @@ async createAndPostMarketOrder(
|
||||
|
||||
***
|
||||
|
||||
### postOrder()
|
||||
### postOrder
|
||||
|
||||
Posts a pre-signed order to the CLOB. Use with [`createOrder()`](/trading/clients/l1#createorder) or [`createMarketOrder()`](/trading/clients/l1#createmarketorder) from L1 methods.
|
||||
|
||||
@@ -249,7 +249,7 @@ async postOrder(
|
||||
|
||||
***
|
||||
|
||||
### postOrders()
|
||||
### postOrders
|
||||
|
||||
Posts up to 15 pre-signed orders in a single batch.
|
||||
|
||||
@@ -275,7 +275,7 @@ async postOrders(
|
||||
|
||||
***
|
||||
|
||||
### cancelOrder()
|
||||
### cancelOrder
|
||||
|
||||
Cancels a single open order.
|
||||
|
||||
@@ -295,7 +295,7 @@ async cancelOrder(orderID: string): Promise<CancelOrdersResponse>
|
||||
|
||||
***
|
||||
|
||||
### cancelOrders()
|
||||
### cancelOrders
|
||||
|
||||
Cancels multiple orders in a single batch.
|
||||
|
||||
@@ -305,7 +305,7 @@ async cancelOrders(orderIDs: string[]): Promise<CancelOrdersResponse>
|
||||
|
||||
***
|
||||
|
||||
### cancelAll()
|
||||
### cancelAll
|
||||
|
||||
Cancels all open orders.
|
||||
|
||||
@@ -315,7 +315,7 @@ async cancelAll(): Promise<CancelOrdersResponse>
|
||||
|
||||
***
|
||||
|
||||
### cancelMarketOrders()
|
||||
### cancelMarketOrders
|
||||
|
||||
Cancels all open orders for a specific market.
|
||||
|
||||
@@ -341,7 +341,7 @@ async cancelMarketOrders(
|
||||
|
||||
***
|
||||
|
||||
### getOrder()
|
||||
### getOrder
|
||||
|
||||
Get details for a specific order by ID.
|
||||
|
||||
@@ -413,7 +413,7 @@ async getOrder(orderID: string): Promise<OpenOrder>
|
||||
|
||||
***
|
||||
|
||||
### getOpenOrders()
|
||||
### getOpenOrders
|
||||
|
||||
Get all your open orders.
|
||||
|
||||
@@ -440,7 +440,7 @@ async getOpenOrders(
|
||||
|
||||
***
|
||||
|
||||
### getTrades()
|
||||
### getTrades
|
||||
|
||||
Get your trade history (filled orders).
|
||||
|
||||
@@ -589,7 +589,7 @@ async getTrades(
|
||||
|
||||
***
|
||||
|
||||
### getTradesPaginated()
|
||||
### getTradesPaginated
|
||||
|
||||
Get trade history with pagination for large result sets.
|
||||
|
||||
@@ -619,7 +619,7 @@ async getTradesPaginated(
|
||||
|
||||
***
|
||||
|
||||
### getBalanceAllowance()
|
||||
### getBalanceAllowance
|
||||
|
||||
Get your balance and allowance for specific tokens.
|
||||
|
||||
@@ -651,7 +651,7 @@ async getBalanceAllowance(
|
||||
|
||||
***
|
||||
|
||||
### updateBalanceAllowance()
|
||||
### updateBalanceAllowance
|
||||
|
||||
Updates the cached balance and allowance for specific tokens.
|
||||
|
||||
@@ -667,7 +667,7 @@ async updateBalanceAllowance(
|
||||
|
||||
***
|
||||
|
||||
### getApiKeys()
|
||||
### getApiKeys
|
||||
|
||||
Get all API keys associated with your account.
|
||||
|
||||
@@ -683,7 +683,7 @@ async getApiKeys(): Promise<ApiKeysResponse>
|
||||
|
||||
***
|
||||
|
||||
### deleteApiKey()
|
||||
### deleteApiKey
|
||||
|
||||
Deletes (revokes) the currently authenticated API key.
|
||||
|
||||
@@ -697,7 +697,7 @@ async deleteApiKey(): Promise<any>
|
||||
|
||||
***
|
||||
|
||||
### getNotifications()
|
||||
### getNotifications
|
||||
|
||||
Retrieves all event notifications for the authenticated user. Records are automatically removed after 48 hours.
|
||||
|
||||
@@ -735,7 +735,7 @@ async getNotifications(): Promise<Notification[]>
|
||||
|
||||
***
|
||||
|
||||
### dropNotifications()
|
||||
### dropNotifications
|
||||
|
||||
Mark notifications as read/dismissed.
|
||||
|
||||
@@ -770,3 +770,6 @@ async dropNotifications(params?: DropNotificationParams): Promise<void>
|
||||
Real-time market data streaming.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
|
||||
Built with [Mintlify](https://mintlify.com).
|
||||
@@ -52,6 +52,17 @@ Polymarket provides official open-source clients in TypeScript, Python, and Rust
|
||||
|
||||
markets = client.get_markets()
|
||||
```
|
||||
|
||||
```rust Rust theme={null}
|
||||
use polymarket_client_sdk::clob::{Client, Config};
|
||||
|
||||
let client = Client::new("https://clob.polymarket.com", Config::default())?
|
||||
.authentication_builder(&signer)
|
||||
.authenticate()
|
||||
.await?;
|
||||
|
||||
let markets = client.markets(None).await?;
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
## Source Code
|
||||
@@ -95,3 +106,6 @@ For [gasless transactions](/trading/gasless) using proxy wallets, the relayer cl
|
||||
Understand L1/L2 auth and API credentials.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
|
||||
Built with [Mintlify](https://mintlify.com).
|
||||
@@ -46,7 +46,7 @@ Public methods require the client to initialize with the host URL and Polygon ch
|
||||
|
||||
***
|
||||
|
||||
### getOk()
|
||||
### getOk
|
||||
|
||||
Health check endpoint to verify the CLOB service is operational.
|
||||
|
||||
@@ -60,7 +60,7 @@ async getOk(): Promise<any>
|
||||
|
||||
***
|
||||
|
||||
### getMarket()
|
||||
### getMarket
|
||||
|
||||
Get details for a single market by condition ID.
|
||||
|
||||
@@ -186,7 +186,7 @@ async getMarket(conditionId: string): Promise<Market>
|
||||
|
||||
***
|
||||
|
||||
### getMarkets()
|
||||
### getMarkets
|
||||
|
||||
Get details for multiple markets paginated.
|
||||
|
||||
@@ -208,7 +208,7 @@ async getMarkets(): Promise<PaginationPayload>
|
||||
|
||||
***
|
||||
|
||||
### getSimplifiedMarkets()
|
||||
### getSimplifiedMarkets
|
||||
|
||||
Get simplified market data paginated for faster loading.
|
||||
|
||||
@@ -230,7 +230,7 @@ async getSimplifiedMarkets(): Promise<PaginationPayload>
|
||||
|
||||
***
|
||||
|
||||
### getSamplingMarkets()
|
||||
### getSamplingMarkets
|
||||
|
||||
Get markets eligible for sampling/liquidity rewards.
|
||||
|
||||
@@ -240,7 +240,7 @@ async getSamplingMarkets(): Promise<PaginationPayload>
|
||||
|
||||
***
|
||||
|
||||
### getSamplingSimplifiedMarkets()
|
||||
### getSamplingSimplifiedMarkets
|
||||
|
||||
Get simplified market data for markets eligible for sampling/liquidity rewards.
|
||||
|
||||
@@ -254,7 +254,7 @@ async getSamplingSimplifiedMarkets(): Promise<PaginationPayload>
|
||||
|
||||
***
|
||||
|
||||
### calculateMarketPrice()
|
||||
### calculateMarketPrice
|
||||
|
||||
Calculate the estimated price for a market order of a given size.
|
||||
|
||||
@@ -289,7 +289,7 @@ async calculateMarketPrice(
|
||||
|
||||
***
|
||||
|
||||
### getOrderBook()
|
||||
### getOrderBook
|
||||
|
||||
Get the order book for a specific token ID.
|
||||
|
||||
@@ -335,7 +335,7 @@ async getOrderBook(tokenID: string): Promise<OrderBookSummary>
|
||||
|
||||
***
|
||||
|
||||
### getOrderBooks()
|
||||
### getOrderBooks
|
||||
|
||||
Get order books for multiple token IDs.
|
||||
|
||||
@@ -357,7 +357,7 @@ async getOrderBooks(params: BookParams[]): Promise<OrderBookSummary[]>
|
||||
|
||||
***
|
||||
|
||||
### getPrice()
|
||||
### getPrice
|
||||
|
||||
Get the current best price for buying or selling a token ID.
|
||||
|
||||
@@ -374,7 +374,7 @@ async getPrice(
|
||||
|
||||
***
|
||||
|
||||
### getPrices()
|
||||
### getPrices
|
||||
|
||||
Get the current best prices for multiple token IDs.
|
||||
|
||||
@@ -388,7 +388,7 @@ async getPrices(params: BookParams[]): Promise<PricesResponse>
|
||||
|
||||
***
|
||||
|
||||
### getMidpoint()
|
||||
### getMidpoint
|
||||
|
||||
Get the midpoint price (average of best bid and best ask) for a token ID.
|
||||
|
||||
@@ -402,7 +402,7 @@ async getMidpoint(tokenID: string): Promise<any>
|
||||
|
||||
***
|
||||
|
||||
### getMidpoints()
|
||||
### getMidpoints
|
||||
|
||||
Get the midpoint prices for multiple token IDs.
|
||||
|
||||
@@ -416,7 +416,7 @@ async getMidpoints(params: BookParams[]): Promise<any>
|
||||
|
||||
***
|
||||
|
||||
### getSpread()
|
||||
### getSpread
|
||||
|
||||
Get the spread (difference between best ask and best bid) for a token ID.
|
||||
|
||||
@@ -430,7 +430,7 @@ async getSpread(tokenID: string): Promise<SpreadResponse>
|
||||
|
||||
***
|
||||
|
||||
### getSpreads()
|
||||
### getSpreads
|
||||
|
||||
Get the spreads for multiple token IDs.
|
||||
|
||||
@@ -444,7 +444,7 @@ async getSpreads(params: BookParams[]): Promise<SpreadsResponse>
|
||||
|
||||
***
|
||||
|
||||
### getPricesHistory()
|
||||
### getPricesHistory
|
||||
|
||||
Get historical price data for a token.
|
||||
|
||||
@@ -486,7 +486,7 @@ async getPricesHistory(params: PriceHistoryFilterParams): Promise<MarketPrice[]>
|
||||
|
||||
***
|
||||
|
||||
### getLastTradePrice()
|
||||
### getLastTradePrice
|
||||
|
||||
Get the price of the most recent trade for a token.
|
||||
|
||||
@@ -504,7 +504,7 @@ async getLastTradePrice(tokenID: string): Promise<LastTradePrice>
|
||||
|
||||
***
|
||||
|
||||
### getLastTradesPrices()
|
||||
### getLastTradesPrices
|
||||
|
||||
Get the most recent trade prices for multiple tokens.
|
||||
|
||||
@@ -526,7 +526,7 @@ async getLastTradesPrices(params: BookParams[]): Promise<LastTradePriceWithToken
|
||||
|
||||
***
|
||||
|
||||
### getMarketTradesEvents()
|
||||
### getMarketTradesEvents
|
||||
|
||||
Get recent trade events for a market.
|
||||
|
||||
@@ -584,7 +584,7 @@ async getMarketTradesEvents(conditionID: string): Promise<MarketTradeEvent[]>
|
||||
|
||||
***
|
||||
|
||||
### getFeeRateBps()
|
||||
### getFeeRateBps
|
||||
|
||||
Get the fee rate in basis points for a token.
|
||||
|
||||
@@ -598,7 +598,7 @@ async getFeeRateBps(tokenID: string): Promise<number>
|
||||
|
||||
***
|
||||
|
||||
### getTickSize()
|
||||
### getTickSize
|
||||
|
||||
Get the tick size (minimum price increment) for a market.
|
||||
|
||||
@@ -612,7 +612,7 @@ async getTickSize(tokenID: string): Promise<TickSize>
|
||||
|
||||
***
|
||||
|
||||
### getNegRisk()
|
||||
### getNegRisk
|
||||
|
||||
Check if a market uses negative risk (binary complementary tokens).
|
||||
|
||||
@@ -626,9 +626,9 @@ async getNegRisk(tokenID: string): Promise<boolean>
|
||||
|
||||
***
|
||||
|
||||
## Time & Server Info
|
||||
## Time and Server Info
|
||||
|
||||
### getServerTime()
|
||||
### getServerTime
|
||||
|
||||
Get the current server timestamp.
|
||||
|
||||
@@ -661,3 +661,6 @@ async getServerTime(): Promise<number>
|
||||
Real-time market data streaming.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
|
||||
Built with [Mintlify](https://mintlify.com).
|
||||
Reference in New Issue
Block a user