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:
Etherdrake
2026-03-30 12:53:20 +02:00
parent 240ece03cc
commit 50a13414c0
229 changed files with 7322 additions and 935 deletions
+57 -7
View File
@@ -26,7 +26,7 @@ The CLOB API uses two levels of authentication: **L1 (Private Key)** and **L2 (A
The CLOB uses two levels of authentication: L1 (Private Key) and L2 (API Key). Either can be accomplished using the CLOB client or REST API
### L1 Authentication (Private Key)
### L1 Authentication
L1 authentication uses the wallet's private key to sign an EIP-712 message used in the request header. It proves ownership and control over the private key. The private key stays in control of the user and all trading activity remains non-custodial.
@@ -36,7 +36,7 @@ L1 authentication uses the wallet's private key to sign an EIP-712 message used
* Deriving existing API credentials
* Signing and creating user's orders locally
### L2 Authentication (API Credentials)
### L2 Authentication
L2 uses API credentials (apiKey, secret, passphrase) generated from L1 authentication. These are used solely to authenticate requests made to the CLOB API. Requests are signed using HMAC-SHA256.
@@ -57,7 +57,7 @@ L2 uses API credentials (apiKey, secret, passphrase) generated from L1 authentic
Before making authenticated requests, you need to obtain API credentials using L1 authentication.
### Using the SDK (Recommended)
### Using the SDK
<Tabs>
<Tab title="TypeScript">
@@ -105,6 +105,29 @@ Before making authenticated requests, you need to obtain API credentials using L
# }
```
</Tab>
<Tab title="Rust">
```rust theme={null}
use std::str::FromStr;
use polymarket_client_sdk::POLYGON;
use polymarket_client_sdk::auth::{LocalSigner, Signer};
use polymarket_client_sdk::clob::{Client, Config};
let private_key = std::env::var("POLYMARKET_PRIVATE_KEY")?;
let signer = LocalSigner::from_str(&private_key)?
.with_chain_id(Some(POLYGON));
// Creates new credentials or derives existing ones,
// then initializes the authenticated client — all in one step
let client = Client::new("https://clob.polymarket.com", Config::default())?
.authentication_builder(&signer)
.authenticate()
.await?;
let credentials = client.credentials();
println!("API Key: {}", credentials.key());
```
</Tab>
</Tabs>
<Warning>
@@ -228,7 +251,7 @@ All trading endpoints require these 5 headers:
The `POLY_SIGNATURE` for L2 is an HMAC-SHA256 signature created using the user's API credentials `secret` value. Reference implementations can be found in the [TypeScript](https://github.com/Polymarket/clob-client/blob/main/src/signing/hmac.ts) and [Python](https://github.com/Polymarket/py-clob-client/blob/main/py_clob_client/signing/hmac.py) clients.
### CLOB Client (L2)
### CLOB Client
<Tabs>
<Tab title="TypeScript">
@@ -274,6 +297,30 @@ The `POLY_SIGNATURE` for L2 is an HMAC-SHA256 signature created using the user's
)
```
</Tab>
<Tab title="Rust">
```rust theme={null}
use polymarket_client_sdk::clob::types::{Side, SignatureType};
use polymarket_client_sdk::types::dec;
let client = Client::new("https://clob.polymarket.com", Config::default())?
.authentication_builder(&signer)
.signature_type(SignatureType::Proxy) // signatureType explained below
// Funder auto-derived via CREATE2 for Proxy/GnosisSafe
.authenticate()
.await?;
// Now you can trade!
let order = client.limit_order()
.token_id("123456".parse()?)
.price(dec!(0.65))
.size(dec!(100))
.side(Side::Buy)
.build().await?;
let signed = client.sign(&signer, order).await?;
let response = client.post_order(signed).await?;
```
</Tab>
</Tabs>
<Info>
@@ -324,7 +371,7 @@ When initializing the L2 client, you must specify your wallet **signatureType**
## Troubleshooting
<AccordionGroup>
<Accordion title="Error: INVALID_SIGNATURE">
<Accordion title="Error - INVALID_SIGNATURE">
Your wallet's private key is incorrect or improperly formatted.
**Solutions:**
@@ -334,7 +381,7 @@ When initializing the L2 client, you must specify your wallet **signatureType**
* 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.
**Solutions:**
@@ -343,7 +390,7 @@ When initializing the L2 client, you must specify your wallet **signatureType**
* 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 Polymarket profile address at [polymarket.com/settings](https://polymarket.com/settings).
@@ -375,3 +422,6 @@ When initializing the L2 client, you must specify your wallet **signatureType**
Check trading availability by region.
</Card>
</CardGroup>
Built with [Mintlify](https://mintlify.com).
@@ -8,7 +8,7 @@
## OpenAPI
````yaml api-spec/bridge-openapi.yaml post /deposit
````yaml /api-spec/bridge-openapi.yaml post /deposit
openapi: 3.0.3
info:
title: Polymarket Bridge API
@@ -107,3 +107,5 @@ components:
example: '0x56687bf447db6ffa42ffe2204a05edaa20f55839'
````
Built with [Mintlify](https://mintlify.com).
@@ -8,7 +8,7 @@
## OpenAPI
````yaml api-spec/bridge-openapi.yaml post /withdraw
````yaml /api-spec/bridge-openapi.yaml post /withdraw
openapi: 3.0.3
info:
title: Polymarket Bridge API
@@ -133,3 +133,5 @@ components:
example: '0x56687bf447db6ffa42ffe2204a05edaa20f55839'
````
Built with [Mintlify](https://mintlify.com).
+3 -1
View File
@@ -8,7 +8,7 @@
## OpenAPI
````yaml api-spec/bridge-openapi.yaml post /quote
````yaml /api-spec/bridge-openapi.yaml post /quote
openapi: 3.0.3
info:
title: Polymarket Bridge API
@@ -222,3 +222,5 @@ components:
example: 0
````
Built with [Mintlify](https://mintlify.com).
@@ -8,7 +8,7 @@
## OpenAPI
````yaml api-spec/bridge-openapi.yaml get /supported-assets
````yaml /api-spec/bridge-openapi.yaml get /supported-assets
openapi: 3.0.3
info:
title: Polymarket Bridge API
@@ -97,3 +97,5 @@ components:
example: 6
````
Built with [Mintlify](https://mintlify.com).
@@ -8,7 +8,7 @@
## OpenAPI
````yaml api-spec/bridge-openapi.yaml get /status/{address}
````yaml /api-spec/bridge-openapi.yaml get /status/{address}
openapi: 3.0.3
info:
title: Polymarket Bridge API
@@ -148,3 +148,5 @@ components:
example: 1757531217339
````
Built with [Mintlify](https://mintlify.com).
@@ -8,7 +8,7 @@
## OpenAPI
````yaml api-spec/data-openapi.yaml get /v1/builders/leaderboard
````yaml /api-spec/data-openapi.yaml get /v1/builders/leaderboard
openapi: 3.0.3
info:
title: Polymarket Data API
@@ -114,3 +114,5 @@ components:
- error
````
Built with [Mintlify](https://mintlify.com).
@@ -8,7 +8,7 @@
## OpenAPI
````yaml api-spec/data-openapi.yaml get /v1/builders/volume
````yaml /api-spec/data-openapi.yaml get /v1/builders/volume
openapi: 3.0.3
info:
title: Polymarket Data API
@@ -103,3 +103,5 @@ components:
- error
````
Built with [Mintlify](https://mintlify.com).
+14
View File
@@ -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).
@@ -8,7 +8,7 @@
## OpenAPI
````yaml api-spec/gamma-openapi.yaml get /comments/{id}
````yaml /api-spec/gamma-openapi.yaml get /comments/{id}
openapi: 3.0.3
info:
title: Markets API
@@ -210,3 +210,5 @@ components:
nullable: true
````
Built with [Mintlify](https://mintlify.com).
@@ -8,7 +8,7 @@
## OpenAPI
````yaml api-spec/gamma-openapi.yaml get /comments/user_address/{user_address}
````yaml /api-spec/gamma-openapi.yaml get /comments/user_address/{user_address}
openapi: 3.0.3
info:
title: Markets API
@@ -235,3 +235,5 @@ components:
nullable: true
````
Built with [Mintlify](https://mintlify.com).
+3 -1
View File
@@ -8,7 +8,7 @@
## OpenAPI
````yaml api-spec/gamma-openapi.yaml get /comments
````yaml /api-spec/gamma-openapi.yaml get /comments
openapi: 3.0.3
info:
title: Markets API
@@ -249,3 +249,5 @@ components:
nullable: true
````
Built with [Mintlify](https://mintlify.com).
@@ -8,7 +8,7 @@
## OpenAPI
````yaml api-spec/data-openapi.yaml get /closed-positions
````yaml /api-spec/data-openapi.yaml get /closed-positions
openapi: 3.0.3
info:
title: Polymarket Data API
@@ -192,3 +192,5 @@ components:
- error
````
Built with [Mintlify](https://mintlify.com).
@@ -8,7 +8,7 @@
## OpenAPI
````yaml api-spec/data-openapi.yaml get /positions
````yaml /api-spec/data-openapi.yaml get /positions
openapi: 3.0.3
info:
title: Polymarket Data API
@@ -219,3 +219,5 @@ components:
- error
````
Built with [Mintlify](https://mintlify.com).
@@ -8,7 +8,7 @@
## OpenAPI
````yaml api-spec/data-openapi.yaml get /v1/market-positions
````yaml /api-spec/data-openapi.yaml get /v1/market-positions
openapi: 3.0.3
info:
title: Polymarket Data API
@@ -191,3 +191,5 @@ components:
type: integer
````
Built with [Mintlify](https://mintlify.com).
@@ -8,7 +8,7 @@
## OpenAPI
````yaml api-spec/data-openapi.yaml get /holders
````yaml /api-spec/data-openapi.yaml get /holders
openapi: 3.0.3
info:
title: Polymarket Data API
@@ -138,3 +138,5 @@ components:
example: '0x56687bf447db6ffa42ffe2204a05edaa20f55839'
````
Built with [Mintlify](https://mintlify.com).
@@ -8,7 +8,7 @@
## OpenAPI
````yaml api-spec/data-openapi.yaml get /value
````yaml /api-spec/data-openapi.yaml get /value
openapi: 3.0.3
info:
title: Polymarket Data API
@@ -95,3 +95,5 @@ components:
- error
````
Built with [Mintlify](https://mintlify.com).
@@ -8,7 +8,7 @@
## OpenAPI
````yaml api-spec/data-openapi.yaml get /v1/leaderboard
````yaml /api-spec/data-openapi.yaml get /v1/leaderboard
openapi: 3.0.3
info:
title: Polymarket Data API
@@ -159,3 +159,5 @@ components:
- error
````
Built with [Mintlify](https://mintlify.com).
@@ -8,7 +8,7 @@
## OpenAPI
````yaml api-spec/data-openapi.yaml get /trades
````yaml /api-spec/data-openapi.yaml get /trades
openapi: 3.0.3
info:
title: Polymarket Data API
@@ -191,3 +191,5 @@ components:
- error
````
Built with [Mintlify](https://mintlify.com).
+5 -1
View File
@@ -8,7 +8,7 @@
## OpenAPI
````yaml api-spec/data-openapi.yaml get /activity
````yaml /api-spec/data-openapi.yaml get /activity
openapi: 3.0.3
info:
title: Polymarket Data API
@@ -89,6 +89,7 @@ paths:
- REWARD
- CONVERSION
- MAKER_REBATE
- REFERRAL_REWARD
- in: query
name: start
schema:
@@ -182,6 +183,7 @@ components:
- REWARD
- CONVERSION
- MAKER_REBATE
- REFERRAL_REWARD
size:
type: number
usdcSize:
@@ -228,3 +230,5 @@ components:
- error
````
Built with [Mintlify](https://mintlify.com).
+5 -1
View File
@@ -12,7 +12,7 @@ This can be used to synchronize client time with server time.
## OpenAPI
````yaml api-spec/clob-openapi.yaml get /time
````yaml /api-spec/clob-openapi.yaml get /time
openapi: 3.1.0
info:
title: Polymarket CLOB API
@@ -38,6 +38,8 @@ tags:
description: User notification endpoints
- name: Rewards
description: Rewards and earnings endpoints
- name: Rebates
description: Maker rebate endpoints
paths:
/time:
get:
@@ -77,3 +79,5 @@ components:
description: Error message
````
Built with [Mintlify](https://mintlify.com).
+3 -1
View File
@@ -8,7 +8,7 @@
## OpenAPI
````yaml api-spec/gamma-openapi.yaml get /events/{id}
````yaml /api-spec/gamma-openapi.yaml get /events/{id}
openapi: 3.0.3
info:
title: Markets API
@@ -1191,3 +1191,5 @@ components:
nullable: true
````
Built with [Mintlify](https://mintlify.com).
@@ -8,7 +8,7 @@
## OpenAPI
````yaml api-spec/gamma-openapi.yaml get /events/slug/{slug}
````yaml /api-spec/gamma-openapi.yaml get /events/slug/{slug}
openapi: 3.0.3
info:
title: Markets API
@@ -1191,3 +1191,5 @@ components:
nullable: true
````
Built with [Mintlify](https://mintlify.com).
+3 -1
View File
@@ -8,7 +8,7 @@
## OpenAPI
````yaml api-spec/gamma-openapi.yaml get /events/{id}/tags
````yaml /api-spec/gamma-openapi.yaml get /events/{id}/tags
openapi: 3.0.3
info:
title: Markets API
@@ -106,3 +106,5 @@ components:
nullable: true
````
Built with [Mintlify](https://mintlify.com).
+3 -1
View File
@@ -8,7 +8,7 @@
## OpenAPI
````yaml api-spec/gamma-openapi.yaml get /events
````yaml /api-spec/gamma-openapi.yaml get /events
openapi: 3.0.3
info:
title: Markets API
@@ -1301,3 +1301,5 @@ components:
nullable: true
````
Built with [Mintlify](https://mintlify.com).
+20 -1
View File
@@ -71,6 +71,7 @@ The following countries are restricted from placing orders on Polymarket. Countr
| LY | Libya | Blocked |
| MM | Myanmar | Blocked |
| NI | Nicaragua | Blocked |
| NL | Netherlands | Blocked |
| PL | Poland | Close-only |
| RU | Russia | Blocked |
| SG | Singapore | Close-only |
@@ -162,11 +163,26 @@ The geoblocking system includes:
print("Trading available")
```
</Tab>
<Tab title="Rust">
```rust theme={null}
use polymarket_client_sdk::clob::Client;
let client = Client::default();
let geo = client.check_geoblock().await?;
if geo.blocked {
println!("Trading not available in {}", geo.country);
} else {
println!("Trading available");
}
```
</Tab>
</Tabs>
***
## Why These Restrictions?
## Why These Restrictions
Geographic restrictions are implemented to ensure compliance with:
@@ -191,3 +207,6 @@ If you believe you are incorrectly restricted or have questions about geographic
Start placing orders (from eligible regions).
</Card>
</CardGroup>
Built with [Mintlify](https://mintlify.com).
+3
View File
@@ -57,3 +57,6 @@ The CLOB API has both public endpoints (orderbook, prices) and authenticated end
Official TypeScript, Python, and Rust libraries.
</Card>
</CardGroup>
Built with [Mintlify](https://mintlify.com).
@@ -11,7 +11,7 @@
## OpenAPI
````yaml api-spec/clob-openapi.yaml get /fee-rate/{token_id}
````yaml /api-spec/clob-openapi.yaml get /fee-rate/{token_id}
openapi: 3.1.0
info:
title: Polymarket CLOB API
@@ -37,6 +37,8 @@ tags:
description: User notification endpoints
- name: Rewards
description: Rewards and earnings endpoints
- name: Rebates
description: Maker rebate endpoints
paths:
/fee-rate/{token_id}:
get:
@@ -111,3 +113,5 @@ components:
description: Error message
````
Built with [Mintlify](https://mintlify.com).
@@ -12,7 +12,7 @@ The fee rate can be provided either as a query parameter or as a path parameter.
## OpenAPI
````yaml api-spec/clob-openapi.yaml get /fee-rate
````yaml /api-spec/clob-openapi.yaml get /fee-rate
openapi: 3.1.0
info:
title: Polymarket CLOB API
@@ -38,6 +38,8 @@ tags:
description: User notification endpoints
- name: Rewards
description: Rewards and earnings endpoints
- name: Rebates
description: Maker rebate endpoints
paths:
/fee-rate:
get:
@@ -114,3 +116,5 @@ components:
description: Error message
````
Built with [Mintlify](https://mintlify.com).
@@ -12,7 +12,7 @@ Returns default values of "0.5" for price and empty string for side if no trades
## OpenAPI
````yaml api-spec/clob-openapi.yaml get /last-trade-price
````yaml /api-spec/clob-openapi.yaml get /last-trade-price
openapi: 3.1.0
info:
title: Polymarket CLOB API
@@ -38,6 +38,8 @@ tags:
description: User notification endpoints
- name: Rewards
description: Rewards and earnings endpoints
- name: Rebates
description: Maker rebate endpoints
paths:
/last-trade-price:
get:
@@ -110,3 +112,5 @@ components:
description: Error message
````
Built with [Mintlify](https://mintlify.com).
@@ -12,7 +12,7 @@ Maximum 500 token IDs can be requested per call.
## OpenAPI
````yaml api-spec/clob-openapi.yaml get /last-trades-prices
````yaml /api-spec/clob-openapi.yaml get /last-trades-prices
openapi: 3.1.0
info:
title: Polymarket CLOB API
@@ -38,6 +38,8 @@ tags:
description: User notification endpoints
- name: Rewards
description: Rewards and earnings endpoints
- name: Rebates
description: Maker rebate endpoints
paths:
/last-trades-prices:
get:
@@ -130,3 +132,5 @@ components:
description: Error message
````
Built with [Mintlify](https://mintlify.com).
@@ -12,7 +12,7 @@ Maximum 500 token IDs can be requested per call.
## OpenAPI
````yaml api-spec/clob-openapi.yaml post /last-trades-prices
````yaml /api-spec/clob-openapi.yaml post /last-trades-prices
openapi: 3.1.0
info:
title: Polymarket CLOB API
@@ -38,6 +38,8 @@ tags:
description: User notification endpoints
- name: Rewards
description: Rewards and earnings endpoints
- name: Rebates
description: Maker rebate endpoints
paths:
/last-trades-prices:
post:
@@ -147,3 +149,5 @@ components:
description: Error message
````
Built with [Mintlify](https://mintlify.com).
@@ -12,7 +12,7 @@ Returns the best bid price for BUY side or best ask price for SELL side.
## OpenAPI
````yaml api-spec/clob-openapi.yaml get /price
````yaml /api-spec/clob-openapi.yaml get /price
openapi: 3.1.0
info:
title: Polymarket CLOB API
@@ -38,6 +38,8 @@ tags:
description: User notification endpoints
- name: Rewards
description: Rewards and earnings endpoints
- name: Rebates
description: Maker rebate endpoints
paths:
/price:
get:
@@ -129,3 +131,5 @@ components:
description: Error message
````
Built with [Mintlify](https://mintlify.com).
@@ -11,7 +11,7 @@
## OpenAPI
````yaml api-spec/clob-openapi.yaml get /prices
````yaml /api-spec/clob-openapi.yaml get /prices
openapi: 3.1.0
info:
title: Polymarket CLOB API
@@ -37,6 +37,8 @@ tags:
description: User notification endpoints
- name: Rewards
description: Rewards and earnings endpoints
- name: Rebates
description: Maker rebate endpoints
paths:
/prices:
get:
@@ -126,3 +128,5 @@ components:
description: Error message
````
Built with [Mintlify](https://mintlify.com).
@@ -12,7 +12,7 @@ Each request must include both token_id and side.
## OpenAPI
````yaml api-spec/clob-openapi.yaml post /prices
````yaml /api-spec/clob-openapi.yaml post /prices
openapi: 3.1.0
info:
title: Polymarket CLOB API
@@ -38,6 +38,8 @@ tags:
description: User notification endpoints
- name: Rewards
description: Rewards and earnings endpoints
- name: Rebates
description: Maker rebate endpoints
paths:
/prices:
post:
@@ -141,3 +143,5 @@ components:
description: Error message
````
Built with [Mintlify](https://mintlify.com).
@@ -12,7 +12,7 @@ The midpoint is calculated as the average of the best bid and best ask prices.
## OpenAPI
````yaml api-spec/clob-openapi.yaml get /midpoints
````yaml /api-spec/clob-openapi.yaml get /midpoints
openapi: 3.1.0
info:
title: Polymarket CLOB API
@@ -38,6 +38,8 @@ tags:
description: User notification endpoints
- name: Rewards
description: Rewards and earnings endpoints
- name: Rebates
description: Maker rebate endpoints
paths:
/midpoints:
get:
@@ -100,3 +102,5 @@ components:
description: Error message
````
Built with [Mintlify](https://mintlify.com).
@@ -12,7 +12,7 @@ The midpoint is calculated as the average of the best bid and best ask prices.
## OpenAPI
````yaml api-spec/clob-openapi.yaml post /midpoints
````yaml /api-spec/clob-openapi.yaml post /midpoints
openapi: 3.1.0
info:
title: Polymarket CLOB API
@@ -38,6 +38,8 @@ tags:
description: User notification endpoints
- name: Rewards
description: Rewards and earnings endpoints
- name: Rebates
description: Maker rebate endpoints
paths:
/midpoints:
post:
@@ -119,3 +121,5 @@ components:
description: Error message
````
Built with [Mintlify](https://mintlify.com).
@@ -12,7 +12,7 @@ Includes bids, asks, market details, and last trade price.
## OpenAPI
````yaml api-spec/clob-openapi.yaml get /book
````yaml /api-spec/clob-openapi.yaml get /book
openapi: 3.1.0
info:
title: Polymarket CLOB API
@@ -38,6 +38,8 @@ tags:
description: User notification endpoints
- name: Rewards
description: Rewards and earnings endpoints
- name: Rebates
description: Maker rebate endpoints
paths:
/book:
get:
@@ -189,3 +191,5 @@ components:
example: '100'
````
Built with [Mintlify](https://mintlify.com).
@@ -11,7 +11,7 @@
## OpenAPI
````yaml api-spec/clob-openapi.yaml post /books
````yaml /api-spec/clob-openapi.yaml post /books
openapi: 3.1.0
info:
title: Polymarket CLOB API
@@ -37,6 +37,8 @@ tags:
description: User notification endpoints
- name: Rewards
description: Rewards and earnings endpoints
- name: Rebates
description: Maker rebate endpoints
paths:
/books:
post:
@@ -189,3 +191,5 @@ components:
example: '100'
````
Built with [Mintlify](https://mintlify.com).
+5 -1
View File
@@ -12,7 +12,7 @@ The spread is the difference between the best ask and best bid prices.
## OpenAPI
````yaml api-spec/clob-openapi.yaml get /spread
````yaml /api-spec/clob-openapi.yaml get /spread
openapi: 3.1.0
info:
title: Polymarket CLOB API
@@ -38,6 +38,8 @@ tags:
description: User notification endpoints
- name: Rewards
description: Rewards and earnings endpoints
- name: Rebates
description: Maker rebate endpoints
paths:
/spread:
get:
@@ -99,3 +101,5 @@ components:
description: Error message
````
Built with [Mintlify](https://mintlify.com).
@@ -12,7 +12,7 @@ The spread is the difference between the best ask and best bid prices.
## OpenAPI
````yaml api-spec/clob-openapi.yaml post /spreads
````yaml /api-spec/clob-openapi.yaml post /spreads
openapi: 3.1.0
info:
title: Polymarket CLOB API
@@ -38,6 +38,8 @@ tags:
description: User notification endpoints
- name: Rewards
description: Rewards and earnings endpoints
- name: Rebates
description: Maker rebate endpoints
paths:
/spreads:
post:
@@ -117,3 +119,5 @@ components:
description: Error message
````
Built with [Mintlify](https://mintlify.com).
@@ -11,7 +11,7 @@
## OpenAPI
````yaml api-spec/clob-openapi.yaml get /tick-size/{token_id}
````yaml /api-spec/clob-openapi.yaml get /tick-size/{token_id}
openapi: 3.1.0
info:
title: Polymarket CLOB API
@@ -37,6 +37,8 @@ tags:
description: User notification endpoints
- name: Rewards
description: Rewards and earnings endpoints
- name: Rebates
description: Maker rebate endpoints
paths:
/tick-size/{token_id}:
get:
@@ -111,3 +113,5 @@ components:
description: Error message
````
Built with [Mintlify](https://mintlify.com).
@@ -12,7 +12,7 @@ The tick size can be provided either as a query parameter or as a path parameter
## OpenAPI
````yaml api-spec/clob-openapi.yaml get /tick-size
````yaml /api-spec/clob-openapi.yaml get /tick-size
openapi: 3.1.0
info:
title: Polymarket CLOB API
@@ -38,6 +38,8 @@ tags:
description: User notification endpoints
- name: Rewards
description: Rewards and earnings endpoints
- name: Rebates
description: Maker rebate endpoints
paths:
/tick-size:
get:
@@ -115,3 +117,5 @@ components:
description: Error message
````
Built with [Mintlify](https://mintlify.com).
@@ -8,7 +8,7 @@
## OpenAPI
````yaml api-spec/gamma-openapi.yaml get /markets/{id}
````yaml /api-spec/gamma-openapi.yaml get /markets/{id}
openapi: 3.0.3
info:
title: Markets API
@@ -1187,3 +1187,5 @@ components:
nullable: true
````
Built with [Mintlify](https://mintlify.com).
@@ -8,7 +8,7 @@
## OpenAPI
````yaml api-spec/gamma-openapi.yaml get /markets/slug/{slug}
````yaml /api-spec/gamma-openapi.yaml get /markets/slug/{slug}
openapi: 3.0.3
info:
title: Markets API
@@ -1187,3 +1187,5 @@ components:
nullable: true
````
Built with [Mintlify](https://mintlify.com).
@@ -8,7 +8,7 @@
## OpenAPI
````yaml api-spec/gamma-openapi.yaml get /markets/{id}/tags
````yaml /api-spec/gamma-openapi.yaml get /markets/{id}/tags
openapi: 3.0.3
info:
title: Markets API
@@ -106,3 +106,5 @@ components:
nullable: true
````
Built with [Mintlify](https://mintlify.com).
@@ -10,7 +10,7 @@
## OpenAPI
````yaml api-spec/clob-openapi.yaml get /prices-history
````yaml /api-spec/clob-openapi.yaml get /prices-history
openapi: 3.1.0
info:
title: Polymarket CLOB API
@@ -36,6 +36,8 @@ tags:
description: User notification endpoints
- name: Rewards
description: Rewards and earnings endpoints
- name: Rebates
description: Maker rebate endpoints
paths:
/prices-history:
get:
@@ -133,3 +135,5 @@ components:
format: float
````
Built with [Mintlify](https://mintlify.com).
@@ -8,7 +8,7 @@
## OpenAPI
````yaml api-spec/clob-openapi.yaml get /sampling-markets
````yaml /api-spec/clob-openapi.yaml get /sampling-markets
openapi: 3.1.0
info:
title: Polymarket CLOB API
@@ -34,6 +34,8 @@ tags:
description: User notification endpoints
- name: Rewards
description: Rewards and earnings endpoints
- name: Rebates
description: Maker rebate endpoints
paths:
/sampling-markets:
get:
@@ -179,3 +181,5 @@ components:
type: boolean
````
Built with [Mintlify](https://mintlify.com).
@@ -8,7 +8,7 @@
## OpenAPI
````yaml api-spec/clob-openapi.yaml get /sampling-simplified-markets
````yaml /api-spec/clob-openapi.yaml get /sampling-simplified-markets
openapi: 3.1.0
info:
title: Polymarket CLOB API
@@ -34,6 +34,8 @@ tags:
description: User notification endpoints
- name: Rewards
description: Rewards and earnings endpoints
- name: Rebates
description: Maker rebate endpoints
paths:
/sampling-simplified-markets:
get:
@@ -126,3 +128,5 @@ components:
type: boolean
````
Built with [Mintlify](https://mintlify.com).
@@ -8,7 +8,7 @@
## OpenAPI
````yaml api-spec/clob-openapi.yaml get /simplified-markets
````yaml /api-spec/clob-openapi.yaml get /simplified-markets
openapi: 3.1.0
info:
title: Polymarket CLOB API
@@ -34,6 +34,8 @@ tags:
description: User notification endpoints
- name: Rewards
description: Rewards and earnings endpoints
- name: Rebates
description: Maker rebate endpoints
paths:
/simplified-markets:
get:
@@ -126,3 +128,5 @@ components:
type: boolean
````
Built with [Mintlify](https://mintlify.com).
+3 -1
View File
@@ -8,7 +8,7 @@
## OpenAPI
````yaml api-spec/gamma-openapi.yaml get /markets
````yaml /api-spec/gamma-openapi.yaml get /markets
openapi: 3.0.3
info:
title: Markets API
@@ -1313,3 +1313,5 @@ components:
nullable: true
````
Built with [Mintlify](https://mintlify.com).
@@ -8,7 +8,7 @@
## OpenAPI
````yaml api-spec/data-openapi.yaml get /v1/accounting/snapshot
````yaml /api-spec/data-openapi.yaml get /v1/accounting/snapshot
openapi: 3.0.3
info:
title: Polymarket Data API
@@ -75,3 +75,5 @@ components:
- error
````
Built with [Mintlify](https://mintlify.com).
@@ -8,7 +8,7 @@
## OpenAPI
````yaml api-spec/data-openapi.yaml get /live-volume
````yaml /api-spec/data-openapi.yaml get /live-volume
openapi: 3.0.3
info:
title: Polymarket Data API
@@ -92,3 +92,5 @@ components:
example: '0xdd22472e552920b8438158ea7238bfadfa4f736aa4cee91a6b86c39ead110917'
````
Built with [Mintlify](https://mintlify.com).
+3 -1
View File
@@ -8,7 +8,7 @@
## OpenAPI
````yaml api-spec/data-openapi.yaml get /oi
````yaml /api-spec/data-openapi.yaml get /oi
openapi: 3.0.3
info:
title: Polymarket Data API
@@ -85,3 +85,5 @@ components:
- error
````
Built with [Mintlify](https://mintlify.com).
@@ -8,7 +8,7 @@
## OpenAPI
````yaml api-spec/data-openapi.yaml get /traded
````yaml /api-spec/data-openapi.yaml get /traded
openapi: 3.0.3
info:
title: Polymarket Data API
@@ -86,3 +86,5 @@ components:
- error
````
Built with [Mintlify](https://mintlify.com).
@@ -8,7 +8,7 @@
## OpenAPI
````yaml api-spec/gamma-openapi.yaml get /public-profile
````yaml /api-spec/gamma-openapi.yaml get /public-profile
openapi: 3.0.3
info:
title: Markets API
@@ -152,3 +152,5 @@ components:
description: Whether the user is a moderator
````
Built with [Mintlify](https://mintlify.com).
+3
View File
@@ -124,3 +124,6 @@ Trading endpoints have both **burst** limits (short spikes allowed) and **sustai
Official TypeScript, Python, and Rust libraries.
</Card>
</CardGroup>
Built with [Mintlify](https://mintlify.com).
@@ -8,7 +8,7 @@
## OpenAPI
````yaml api-spec/gamma-openapi.yaml get /public-search
````yaml /api-spec/gamma-openapi.yaml get /public-search
openapi: 3.0.3
info:
title: Markets API
@@ -1345,3 +1345,5 @@ components:
nullable: true
````
Built with [Mintlify](https://mintlify.com).
@@ -8,7 +8,7 @@
## OpenAPI
````yaml api-spec/gamma-openapi.yaml get /series/{id}
````yaml /api-spec/gamma-openapi.yaml get /series/{id}
openapi: 3.0.3
info:
title: Markets API
@@ -1187,3 +1187,5 @@ components:
nullable: true
````
Built with [Mintlify](https://mintlify.com).
+7 -1
View File
@@ -8,7 +8,7 @@
## OpenAPI
````yaml api-spec/gamma-openapi.yaml get /series
````yaml /api-spec/gamma-openapi.yaml get /series
openapi: 3.0.3
info:
title: Markets API
@@ -79,6 +79,10 @@ paths:
in: query
schema:
type: string
- name: exclude_events
in: query
schema:
type: boolean
responses:
'200':
description: List of series
@@ -1233,3 +1237,5 @@ components:
nullable: true
````
Built with [Mintlify](https://mintlify.com).
@@ -8,7 +8,7 @@
## OpenAPI
````yaml api-spec/gamma-openapi.yaml get /sports
````yaml /api-spec/gamma-openapi.yaml get /sports
openapi: 3.0.3
info:
title: Markets API
@@ -88,3 +88,5 @@ components:
season series
````
Built with [Mintlify](https://mintlify.com).
@@ -8,7 +8,7 @@
## OpenAPI
````yaml api-spec/gamma-openapi.yaml get /sports/market-types
````yaml /api-spec/gamma-openapi.yaml get /sports/market-types
openapi: 3.0.3
info:
title: Markets API
@@ -63,3 +63,5 @@ components:
type: string
````
Built with [Mintlify](https://mintlify.com).
+3 -1
View File
@@ -8,7 +8,7 @@
## OpenAPI
````yaml api-spec/gamma-openapi.yaml get /teams
````yaml /api-spec/gamma-openapi.yaml get /teams
openapi: 3.0.3
info:
title: Markets API
@@ -135,3 +135,5 @@ components:
nullable: true
````
Built with [Mintlify](https://mintlify.com).
@@ -8,7 +8,7 @@
## OpenAPI
````yaml api-spec/gamma-openapi.yaml get /tags/{id}/related-tags
````yaml /api-spec/gamma-openapi.yaml get /tags/{id}/related-tags
openapi: 3.0.3
info:
title: Markets API
@@ -92,3 +92,5 @@ components:
nullable: true
````
Built with [Mintlify](https://mintlify.com).
@@ -8,7 +8,7 @@
## OpenAPI
````yaml api-spec/gamma-openapi.yaml get /tags/slug/{slug}/related-tags
````yaml /api-spec/gamma-openapi.yaml get /tags/slug/{slug}/related-tags
openapi: 3.0.3
info:
title: Markets API
@@ -92,3 +92,5 @@ components:
nullable: true
````
Built with [Mintlify](https://mintlify.com).
+3 -1
View File
@@ -8,7 +8,7 @@
## OpenAPI
````yaml api-spec/gamma-openapi.yaml get /tags/{id}
````yaml /api-spec/gamma-openapi.yaml get /tags/{id}
openapi: 3.0.3
info:
title: Markets API
@@ -107,3 +107,5 @@ components:
nullable: true
````
Built with [Mintlify](https://mintlify.com).
+3 -1
View File
@@ -8,7 +8,7 @@
## OpenAPI
````yaml api-spec/gamma-openapi.yaml get /tags/slug/{slug}
````yaml /api-spec/gamma-openapi.yaml get /tags/slug/{slug}
openapi: 3.0.3
info:
title: Markets API
@@ -107,3 +107,5 @@ components:
nullable: true
````
Built with [Mintlify](https://mintlify.com).
@@ -8,7 +8,7 @@
## OpenAPI
````yaml api-spec/gamma-openapi.yaml get /tags/{id}/related-tags/tags
````yaml /api-spec/gamma-openapi.yaml get /tags/{id}/related-tags/tags
openapi: 3.0.3
info:
title: Markets API
@@ -115,3 +115,5 @@ components:
nullable: true
````
Built with [Mintlify](https://mintlify.com).
@@ -8,7 +8,7 @@
## OpenAPI
````yaml api-spec/gamma-openapi.yaml get /tags/slug/{slug}/related-tags/tags
````yaml /api-spec/gamma-openapi.yaml get /tags/slug/{slug}/related-tags/tags
openapi: 3.0.3
info:
title: Markets API
@@ -115,3 +115,5 @@ components:
nullable: true
````
Built with [Mintlify](https://mintlify.com).
+3 -1
View File
@@ -8,7 +8,7 @@
## OpenAPI
````yaml api-spec/gamma-openapi.yaml get /tags
````yaml /api-spec/gamma-openapi.yaml get /tags
openapi: 3.0.3
info:
title: Markets API
@@ -131,3 +131,5 @@ components:
nullable: true
````
Built with [Mintlify](https://mintlify.com).
@@ -11,7 +11,7 @@
## OpenAPI
````yaml api-spec/clob-openapi.yaml delete /cancel-all
````yaml /api-spec/clob-openapi.yaml delete /cancel-all
openapi: 3.1.0
info:
title: Polymarket CLOB API
@@ -37,6 +37,8 @@ tags:
description: User notification endpoints
- name: Rewards
description: Rewards and earnings endpoints
- name: Rebates
description: Maker rebate endpoints
paths:
/cancel-all:
delete:
@@ -166,3 +168,5 @@ components:
description: Unix timestamp of the request
````
Built with [Mintlify](https://mintlify.com).
@@ -13,7 +13,7 @@ Works even in cancel-only mode.
## OpenAPI
````yaml api-spec/clob-openapi.yaml delete /orders
````yaml /api-spec/clob-openapi.yaml delete /orders
openapi: 3.1.0
info:
title: Polymarket CLOB API
@@ -39,6 +39,8 @@ tags:
description: User notification endpoints
- name: Rewards
description: Rewards and earnings endpoints
- name: Rebates
description: Maker rebate endpoints
paths:
/orders:
delete:
@@ -206,3 +208,5 @@ components:
description: Unix timestamp of the request
````
Built with [Mintlify](https://mintlify.com).
@@ -12,7 +12,7 @@ Works even in cancel-only mode.
## OpenAPI
````yaml api-spec/clob-openapi.yaml delete /cancel-market-orders
````yaml /api-spec/clob-openapi.yaml delete /cancel-market-orders
openapi: 3.1.0
info:
title: Polymarket CLOB API
@@ -38,6 +38,8 @@ tags:
description: User notification endpoints
- name: Rewards
description: Rewards and earnings endpoints
- name: Rebates
description: Maker rebate endpoints
paths:
/cancel-market-orders:
delete:
@@ -201,3 +203,5 @@ components:
description: Unix timestamp of the request
````
Built with [Mintlify](https://mintlify.com).
@@ -11,7 +11,7 @@
## OpenAPI
````yaml api-spec/clob-openapi.yaml delete /order
````yaml /api-spec/clob-openapi.yaml delete /order
openapi: 3.1.0
info:
title: Polymarket CLOB API
@@ -37,6 +37,8 @@ tags:
description: User notification endpoints
- name: Rewards
description: Rewards and earnings endpoints
- name: Rebates
description: Maker rebate endpoints
paths:
/order:
delete:
@@ -190,3 +192,5 @@ components:
description: Unix timestamp of the request
````
Built with [Mintlify](https://mintlify.com).
@@ -12,7 +12,7 @@ Builders can only see their own originated trades.
## OpenAPI
````yaml api-spec/clob-openapi.yaml get /builder/trades
````yaml /api-spec/clob-openapi.yaml get /builder/trades
openapi: 3.1.0
info:
title: Polymarket CLOB API
@@ -38,6 +38,8 @@ tags:
description: User notification endpoints
- name: Rewards
description: Rewards and earnings endpoints
- name: Rebates
description: Maker rebate endpoints
paths:
/builder/trades:
get:
@@ -362,3 +364,5 @@ components:
description: Unix timestamp for builder authentication
````
Built with [Mintlify](https://mintlify.com).
@@ -17,7 +17,7 @@ An order is considered "scoring" if it meets all the criteria for earning maker
## OpenAPI
````yaml api-spec/clob-openapi.yaml get /order-scoring
````yaml /api-spec/clob-openapi.yaml get /order-scoring
openapi: 3.1.0
info:
title: Polymarket CLOB API
@@ -43,6 +43,8 @@ tags:
description: User notification endpoints
- name: Rewards
description: Rewards and earnings endpoints
- name: Rebates
description: Maker rebate endpoints
paths:
/order-scoring:
get:
@@ -184,3 +186,5 @@ components:
description: Unix timestamp of the request
````
Built with [Mintlify](https://mintlify.com).
@@ -5,13 +5,14 @@
# Get single order by ID
> Retrieves a specific order by its ID (order hash) for the authenticated user.
Builder-authenticated clients can also use this endpoint to retrieve orders attributed to their builder account.
## OpenAPI
````yaml api-spec/clob-openapi.yaml get /order/{orderID}
````yaml /api-spec/clob-openapi.yaml get /order/{orderID}
openapi: 3.1.0
info:
title: Polymarket CLOB API
@@ -37,6 +38,8 @@ tags:
description: User notification endpoints
- name: Rewards
description: Rewards and earnings endpoints
- name: Rebates
description: Maker rebate endpoints
paths:
/order/{orderID}:
get:
@@ -46,6 +49,9 @@ paths:
description: >
Retrieves a specific order by its ID (order hash) for the authenticated
user.
Builder-authenticated clients can also use this endpoint to retrieve
orders attributed to their builder account.
operationId: getOrder
parameters:
- name: orderID
@@ -117,6 +123,10 @@ paths:
polySignature: []
polyPassphrase: []
polyTimestamp: []
- polyBuilderApiKey: []
polyBuilderPassphrase: []
polyBuilderSignature: []
polyBuilderTimestamp: []
components:
schemas:
OpenOrder:
@@ -247,5 +257,27 @@ components:
in: header
name: POLY_TIMESTAMP
description: Unix timestamp of the request
polyBuilderApiKey:
type: apiKey
in: header
name: POLY_BUILDER_API_KEY
description: Builder API key for authentication
polyBuilderPassphrase:
type: apiKey
in: header
name: POLY_BUILDER_PASSPHRASE
description: Passphrase for builder authentication
polyBuilderSignature:
type: apiKey
in: header
name: POLY_BUILDER_SIGNATURE
description: HMAC signature for builder authentication
polyBuilderTimestamp:
type: apiKey
in: header
name: POLY_BUILDER_TIMESTAMP
description: Unix timestamp for builder authentication
````
Built with [Mintlify](https://mintlify.com).
+5 -1
View File
@@ -12,7 +12,7 @@ Requires readonly or level 2 API key authentication.
## OpenAPI
````yaml api-spec/clob-openapi.yaml get /trades
````yaml /api-spec/clob-openapi.yaml get /trades
openapi: 3.1.0
info:
title: Polymarket CLOB API
@@ -38,6 +38,8 @@ tags:
description: User notification endpoints
- name: Rewards
description: Rewards and earnings endpoints
- name: Rebates
description: Maker rebate endpoints
paths:
/trades:
get:
@@ -385,3 +387,5 @@ components:
description: Unix timestamp of the request
````
Built with [Mintlify](https://mintlify.com).
+33 -1
View File
@@ -5,13 +5,14 @@
# Get user orders
> Retrieves open orders for the authenticated user. Returns paginated results.
Builder-authenticated clients can also use this endpoint to retrieve orders attributed to their builder account.
## OpenAPI
````yaml api-spec/clob-openapi.yaml get /orders
````yaml /api-spec/clob-openapi.yaml get /orders
openapi: 3.1.0
info:
title: Polymarket CLOB API
@@ -37,6 +38,8 @@ tags:
description: User notification endpoints
- name: Rewards
description: Rewards and earnings endpoints
- name: Rebates
description: Maker rebate endpoints
paths:
/orders:
get:
@@ -46,6 +49,9 @@ paths:
description: >
Retrieves open orders for the authenticated user. Returns paginated
results.
Builder-authenticated clients can also use this endpoint to retrieve
orders attributed to their builder account.
operationId: getOrders
parameters:
- name: id
@@ -154,6 +160,10 @@ paths:
polySignature: []
polyPassphrase: []
polyTimestamp: []
- polyBuilderApiKey: []
polyBuilderPassphrase: []
polyBuilderSignature: []
polyBuilderTimestamp: []
components:
schemas:
OrdersResponse:
@@ -311,5 +321,27 @@ components:
in: header
name: POLY_TIMESTAMP
description: Unix timestamp of the request
polyBuilderApiKey:
type: apiKey
in: header
name: POLY_BUILDER_API_KEY
description: Builder API key for authentication
polyBuilderPassphrase:
type: apiKey
in: header
name: POLY_BUILDER_PASSPHRASE
description: Passphrase for builder authentication
polyBuilderSignature:
type: apiKey
in: header
name: POLY_BUILDER_SIGNATURE
description: HMAC signature for builder authentication
polyBuilderTimestamp:
type: apiKey
in: header
name: POLY_BUILDER_TIMESTAMP
description: Unix timestamp for builder authentication
````
Built with [Mintlify](https://mintlify.com).
+5 -1
View File
@@ -11,7 +11,7 @@
## OpenAPI
````yaml api-spec/clob-openapi.yaml post /order
````yaml /api-spec/clob-openapi.yaml post /order
openapi: 3.1.0
info:
title: Polymarket CLOB API
@@ -37,6 +37,8 @@ tags:
description: User notification endpoints
- name: Rewards
description: Rewards and earnings endpoints
- name: Rebates
description: Maker rebate endpoints
paths:
/order:
post:
@@ -374,3 +376,5 @@ components:
description: Unix timestamp of the request
````
Built with [Mintlify](https://mintlify.com).
@@ -12,7 +12,7 @@ Maximum 15 orders per request.
## OpenAPI
````yaml api-spec/clob-openapi.yaml post /orders
````yaml /api-spec/clob-openapi.yaml post /orders
openapi: 3.1.0
info:
title: Polymarket CLOB API
@@ -38,6 +38,8 @@ tags:
description: User notification endpoints
- name: Rewards
description: Rewards and earnings endpoints
- name: Rebates
description: Maker rebate endpoints
paths:
/orders:
post:
@@ -396,3 +398,5 @@ components:
description: Unix timestamp of the request
````
Built with [Mintlify](https://mintlify.com).
+5 -1
View File
@@ -14,7 +14,7 @@ if the system becomes unresponsive.
## OpenAPI
````yaml api-spec/clob-openapi.yaml post /heartbeats
````yaml /api-spec/clob-openapi.yaml post /heartbeats
openapi: 3.1.0
info:
title: Polymarket CLOB API
@@ -40,6 +40,8 @@ tags:
description: User notification endpoints
- name: Rewards
description: Rewards and earnings endpoints
- name: Rebates
description: Maker rebate endpoints
paths:
/heartbeats:
post:
@@ -136,3 +138,5 @@ components:
description: Unix timestamp of the request
````
Built with [Mintlify](https://mintlify.com).
File diff suppressed because it is too large Load Diff
+235
View File
@@ -5,3 +5,238 @@
# Sports Channel
> Public WebSocket for real-time sports match results.
## AsyncAPI
````yaml asyncapi-sports.json sports
id: sports
title: Sports Channel
description: >-
Public channel broadcasting live sports results. No subscription message
required — connect and immediately start receiving updates for all active
events. The server sends a ping every 5 seconds; respond with pong within 10
seconds to stay connected.
servers:
- id: production
protocol: wss
host: sports-api.polymarket.com
bindings: []
variables: []
address: /ws
parameters: []
bindings: []
operations:
- &ref_2
id: ping
title: Ping
description: Server sends ping every 5 seconds — respond with pong within 10 seconds
type: send
messages:
- &ref_5
id: ping
contentType: text/plain
payload:
- type: string
const: ping
x-parser-schema-id: <anonymous-schema-1>
name: Ping
description: Server heartbeat sent every 5 seconds
headers: []
jsonPayloadSchema:
type: string
const: ping
x-parser-schema-id: <anonymous-schema-1>
title: Ping
description: Server heartbeat sent every 5 seconds
example: '{}'
bindings: []
extensions:
- id: x-parser-unique-object-id
value: ping
bindings: []
extensions: &ref_0
- id: x-parser-unique-object-id
value: sports
- &ref_1
id: pong
title: Pong
description: Client responds to server ping
type: receive
messages:
- &ref_4
id: pong
contentType: text/plain
payload:
- type: string
const: pong
x-parser-schema-id: <anonymous-schema-2>
name: Pong
description: Client heartbeat response — must be sent within 10 seconds
headers: []
jsonPayloadSchema:
type: string
const: pong
x-parser-schema-id: <anonymous-schema-2>
title: Pong
description: Client heartbeat response — must be sent within 10 seconds
example: '{}'
bindings: []
extensions:
- id: x-parser-unique-object-id
value: pong
bindings: []
extensions: *ref_0
- &ref_3
id: receiveSportsUpdate
title: Sports Update
description: Live match update broadcast to all connected clients
type: send
messages:
- &ref_6
id: sportsUpdate
contentType: application/json
payload:
- name: Sports Result Update
description: Real-time sports match update
type: object
properties:
- name: slug
type: string
description: Unique match identifier (e.g., 'mci-liv-2025-02-03')
required: true
- name: live
type: boolean
description: Whether the match is currently in progress
required: false
- name: ended
type: boolean
description: Whether the match has ended
required: false
- name: score
type: string
description: Current score (e.g., '2-1' for soccer, '14-7' for football)
required: false
- name: period
type: string
description: >-
Current period. Soccer: '1H', '2H', 'HT', 'FT', 'PEN'. NFL:
'Q1''Q4', 'HT', 'OT', 'FT'. NBA/CBB: 'Q1''Q4', 'HT', 'OT',
'FT'. MLB: 'Top 1st', 'Bot 1st', ... Ice Hockey: 'P1', 'P2',
'P3', 'OT', 'PEN', 'FT'. Cricket: '1H', '1A', '2H', '2A',
'SO', 'FT'. Other: 'CAN', 'POST', 'INT', 'AB'.
required: false
- name: elapsed
type: string
description: >-
Elapsed time in the current period in 'MM:SS' format. Empty
string if not applicable.
required: false
- name: last_update
type: string
description: ISO 8601 timestamp of the last update
required: false
- name: finished_timestamp
type: string
description: >-
ISO 8601 timestamp when the match ended. Only present for
ended matches.
required: false
- name: turn
type: string
description: Team abbreviation with ball possession. NFL only.
required: false
headers: []
jsonPayloadSchema:
type: object
description: >-
Real-time sports match update. Only slug is required; all other
fields may be omitted if not applicable.
required:
- slug
properties:
slug:
type: string
description: Unique match identifier (e.g., 'mci-liv-2025-02-03')
x-parser-schema-id: <anonymous-schema-3>
live:
type: boolean
description: Whether the match is currently in progress
x-parser-schema-id: <anonymous-schema-4>
ended:
type: boolean
description: Whether the match has ended
x-parser-schema-id: <anonymous-schema-5>
score:
type: string
description: Current score (e.g., '2-1' for soccer, '14-7' for football)
x-parser-schema-id: <anonymous-schema-6>
period:
type: string
description: >-
Current period. Soccer: '1H', '2H', 'HT', 'FT', 'PEN'. NFL:
'Q1''Q4', 'HT', 'OT', 'FT'. NBA/CBB: 'Q1''Q4', 'HT', 'OT',
'FT'. MLB: 'Top 1st', 'Bot 1st', ... Ice Hockey: 'P1', 'P2',
'P3', 'OT', 'PEN', 'FT'. Cricket: '1H', '1A', '2H', '2A', 'SO',
'FT'. Other: 'CAN', 'POST', 'INT', 'AB'.
x-parser-schema-id: <anonymous-schema-7>
elapsed:
type: string
description: >-
Elapsed time in the current period in 'MM:SS' format. Empty
string if not applicable.
x-parser-schema-id: <anonymous-schema-8>
last_update:
type: string
format: date-time
description: ISO 8601 timestamp of the last update
x-parser-schema-id: <anonymous-schema-9>
finished_timestamp:
type: string
format: date-time
description: >-
ISO 8601 timestamp when the match ended. Only present for ended
matches.
x-parser-schema-id: <anonymous-schema-10>
turn:
type: string
description: Team abbreviation with ball possession. NFL only.
x-parser-schema-id: <anonymous-schema-11>
x-parser-schema-id: SportResult
title: Sports Result Update
description: Real-time sports match update
example: |-
{
"slug": "mci-liv-2025-02-03",
"live": true,
"ended": false,
"score": "1-0",
"period": "1H",
"elapsed": "32:15",
"last_update": "2025-02-03T19:50:16.939Z"
}
bindings: []
extensions:
- id: x-parser-unique-object-id
value: sportsUpdate
bindings: []
extensions: *ref_0
sendOperations:
- *ref_1
receiveOperations:
- *ref_2
- *ref_3
sendMessages:
- *ref_4
receiveMessages:
- *ref_5
- *ref_6
extensions:
- id: x-parser-unique-object-id
value: sports
securitySchemes: []
````
Built with [Mintlify](https://mintlify.com).
+786
View File
@@ -5,3 +5,789 @@
# User Channel
> Authenticated WebSocket for real-time order and trade updates.
## AsyncAPI
````yaml asyncapi-user.json user
id: user
title: User Channel
description: >-
Authenticated channel for real-time order and trade updates. Send API
credentials in the initial subscription message. Optionally filter by market
condition IDs.
servers:
- id: production
protocol: wss
host: ws-subscriptions-clob.polymarket.com
bindings: []
variables: []
address: /ws/user
parameters: []
bindings: []
operations:
- &ref_1
id: subscribe
title: Subscribe
description: Send authenticated subscription request
type: receive
messages:
- &ref_7
id: userSubscriptionRequest
contentType: application/json
payload:
- name: Subscription Request
description: Authenticated subscription message sent after connecting
type: object
properties:
- name: auth
type: object
description: CLOB API credentials for authentication
required: true
properties:
- name: apiKey
type: string
description: CLOB API key (UUID format)
required: false
- name: secret
type: string
description: CLOB API secret
required: false
- name: passphrase
type: string
description: CLOB API passphrase
required: false
- name: type
type: string
description: Must be 'user'
required: true
- name: markets
type: array
description: >-
Optional condition IDs to filter events. If omitted, receives
events for all markets.
required: false
headers: []
jsonPayloadSchema:
type: object
description: Authenticated subscription request for the user channel
required:
- auth
- type
properties:
auth:
type: object
description: CLOB API credentials for authentication
required:
- apiKey
- secret
- passphrase
properties:
apiKey:
type: string
description: CLOB API key (UUID format)
x-parser-schema-id: <anonymous-schema-1>
secret:
type: string
description: CLOB API secret
x-parser-schema-id: <anonymous-schema-2>
passphrase:
type: string
description: CLOB API passphrase
x-parser-schema-id: <anonymous-schema-3>
x-parser-schema-id: WebSocketAuth
type:
type: string
const: user
description: Must be 'user'
x-parser-schema-id: <anonymous-schema-4>
markets:
type: array
description: >-
Optional condition IDs to filter events. If omitted, receives
events for all markets.
items:
type: string
x-parser-schema-id: <anonymous-schema-6>
x-parser-schema-id: <anonymous-schema-5>
x-parser-schema-id: UserSubscriptionRequest
title: Subscription Request
description: Authenticated subscription message sent after connecting
example: |-
{
"auth": {
"apiKey": "your-api-key-uuid",
"secret": "your-api-secret",
"passphrase": "your-passphrase"
},
"type": "user"
}
bindings: []
extensions:
- id: x-parser-unique-object-id
value: userSubscriptionRequest
bindings: []
extensions: &ref_0
- id: x-parser-unique-object-id
value: user
- &ref_2
id: updateSubscription
title: Update Subscription
description: Dynamically subscribe or unsubscribe from markets without reconnecting
type: receive
messages:
- &ref_8
id: userSubscriptionRequestUpdate
contentType: application/json
payload:
- name: Subscription Update
description: Subscribe or unsubscribe from markets without reconnecting
type: object
properties:
- name: operation
type: string
enumValues:
- subscribe
- unsubscribe
required: true
- name: markets
type: array
description: Condition IDs to subscribe to or unsubscribe from
required: true
headers: []
jsonPayloadSchema:
type: object
description: Dynamically update market subscriptions
required:
- operation
- markets
properties:
operation:
type: string
enum:
- subscribe
- unsubscribe
x-parser-schema-id: <anonymous-schema-7>
markets:
type: array
description: Condition IDs to subscribe to or unsubscribe from
items:
type: string
x-parser-schema-id: <anonymous-schema-9>
x-parser-schema-id: <anonymous-schema-8>
x-parser-schema-id: UserSubscriptionRequestUpdate
title: Subscription Update
description: Subscribe or unsubscribe from markets without reconnecting
example: |-
{
"operation": "subscribe",
"markets": [
"0x5f65177b394277fd294cd75650044e32ba009a95022d88a0c1d565897d72f8f1"
]
}
bindings: []
extensions:
- id: x-parser-unique-object-id
value: userSubscriptionRequestUpdate
bindings: []
extensions: *ref_0
- &ref_3
id: ping
title: Ping
description: Send PING every 10 seconds to keep the connection alive
type: receive
messages:
- &ref_9
id: ping
contentType: text/plain
payload:
- type: string
const: PING
x-parser-schema-id: <anonymous-schema-10>
name: Ping
description: Client heartbeat — send every 10 seconds
headers: []
jsonPayloadSchema:
type: string
const: PING
x-parser-schema-id: <anonymous-schema-10>
title: Ping
description: Client heartbeat — send every 10 seconds
example: '{}'
bindings: []
extensions:
- id: x-parser-unique-object-id
value: ping
bindings: []
extensions: *ref_0
- &ref_4
id: pong
title: Pong
description: Server responds to PING with PONG
type: send
messages:
- &ref_10
id: pong
contentType: text/plain
payload:
- type: string
const: PONG
x-parser-schema-id: <anonymous-schema-11>
name: Pong
description: Server heartbeat response
headers: []
jsonPayloadSchema:
type: string
const: PONG
x-parser-schema-id: <anonymous-schema-11>
title: Pong
description: Server heartbeat response
example: '{}'
bindings: []
extensions:
- id: x-parser-unique-object-id
value: pong
bindings: []
extensions: *ref_0
- &ref_5
id: receiveOrder
title: Order Event
description: Order placement, update, or cancellation event for the authenticated user
type: send
messages:
- &ref_11
id: order
contentType: application/json
payload:
- name: Order Event
description: Order placement, update, or cancellation
type: object
properties:
- name: event_type
type: string
description: order
required: true
- name: id
type: string
description: Order ID (hash)
required: true
- name: owner
type: string
description: API key of the order owner
required: true
- name: market
type: string
description: Condition ID of the market
required: true
- name: asset_id
type: string
description: Asset ID (token ID)
required: true
- name: side
type: string
enumValues:
- BUY
- SELL
required: true
- name: order_owner
type: string
required: false
- name: original_size
type: string
description: Original order size
required: true
- name: size_matched
type: string
description: Amount matched so far
required: true
- name: price
type: string
required: true
- name: associate_trades
type: array
description: Trade IDs this order has been matched in
required: false
- name: outcome
type: string
description: e.g. 'YES', 'NO'
required: false
- name: type
type: string
enumValues:
- PLACEMENT
- UPDATE
- CANCELLATION
required: true
- name: created_at
type: string
required: false
- name: expiration
type: string
description: For GTD orders
required: false
- name: order_type
type: string
enumValues:
- GTC
- GTD
- FOK
required: false
- name: status
type: string
description: e.g. 'LIVE', 'MATCHED', 'CANCELED'
required: false
- name: maker_address
type: string
required: false
- name: timestamp
type: string
description: Event timestamp in milliseconds
required: true
headers: []
jsonPayloadSchema:
type: object
description: Order placement, update, or cancellation event
required:
- event_type
- id
- owner
- market
- asset_id
- side
- original_size
- size_matched
- price
- type
- timestamp
properties:
event_type:
type: string
const: order
x-parser-schema-id: <anonymous-schema-12>
id:
type: string
description: Order ID (hash)
x-parser-schema-id: <anonymous-schema-13>
owner:
type: string
description: API key of the order owner
x-parser-schema-id: <anonymous-schema-14>
market:
type: string
description: Condition ID of the market
x-parser-schema-id: <anonymous-schema-15>
asset_id:
type: string
description: Asset ID (token ID)
x-parser-schema-id: <anonymous-schema-16>
side:
type: string
enum:
- BUY
- SELL
x-parser-schema-id: <anonymous-schema-17>
order_owner:
type: string
x-parser-schema-id: <anonymous-schema-18>
original_size:
type: string
description: Original order size
x-parser-schema-id: <anonymous-schema-19>
size_matched:
type: string
description: Amount matched so far
x-parser-schema-id: <anonymous-schema-20>
price:
type: string
x-parser-schema-id: <anonymous-schema-21>
associate_trades:
type: array
items:
type: string
x-parser-schema-id: <anonymous-schema-23>
nullable: true
description: Trade IDs this order has been matched in
x-parser-schema-id: <anonymous-schema-22>
outcome:
type: string
description: e.g. 'YES', 'NO'
x-parser-schema-id: <anonymous-schema-24>
type:
type: string
enum:
- PLACEMENT
- UPDATE
- CANCELLATION
x-parser-schema-id: <anonymous-schema-25>
created_at:
type: string
x-parser-schema-id: <anonymous-schema-26>
expiration:
type: string
description: For GTD orders
x-parser-schema-id: <anonymous-schema-27>
order_type:
type: string
enum:
- GTC
- GTD
- FOK
x-parser-schema-id: <anonymous-schema-28>
status:
type: string
description: e.g. 'LIVE', 'MATCHED', 'CANCELED'
x-parser-schema-id: <anonymous-schema-29>
maker_address:
type: string
x-parser-schema-id: <anonymous-schema-30>
timestamp:
type: string
description: Event timestamp in milliseconds
x-parser-schema-id: <anonymous-schema-31>
x-parser-schema-id: OrderEvent
title: Order Event
description: Order placement, update, or cancellation
example: |-
{
"event_type": "order",
"id": "0xff354cd7ca7539dfa9c28d90943ab5779a4eac34b9b37a757d7b32bdfb11790b",
"owner": "9180014b-33c8-9240-a14b-bdca11c0a465",
"market": "0xbd31dc8a20211944f6b70f31557f1001557b59905b7738480ca09bd4532f84af",
"asset_id": "52114319501245915516055106046884209969926127482827954674443846427813813222426",
"side": "SELL",
"order_owner": "9180014b-33c8-9240-a14b-bdca11c0a465",
"original_size": "10",
"size_matched": "0",
"price": "0.57",
"associate_trades": null,
"outcome": "YES",
"type": "PLACEMENT",
"created_at": "1672290687",
"expiration": "1234567",
"order_type": "GTD",
"status": "LIVE",
"maker_address": "0x1234...",
"timestamp": "1672290687"
}
bindings: []
extensions:
- id: x-parser-unique-object-id
value: order
bindings: []
extensions: *ref_0
- &ref_6
id: receiveTrade
title: Trade Event
description: Trade match or status change event for the authenticated user
type: send
messages:
- &ref_12
id: trade
contentType: application/json
payload:
- name: Trade Event
description: Trade match, confirmation, or status change
type: object
properties:
- name: event_type
type: string
description: trade
required: true
- name: type
type: string
description: TRADE
required: true
- name: id
type: string
description: Trade ID
required: true
- name: taker_order_id
type: string
required: true
- name: market
type: string
description: Condition ID
required: true
- name: asset_id
type: string
required: true
- name: side
type: string
description: From taker's perspective
enumValues:
- BUY
- SELL
required: true
- name: size
type: string
required: true
- name: price
type: string
required: true
- name: fee_rate_bps
type: string
required: false
- name: status
type: string
enumValues:
- MATCHED
- MINED
- CONFIRMED
- RETRYING
- FAILED
required: true
- name: matchtime
type: string
required: false
- name: last_update
type: string
required: false
- name: outcome
type: string
required: false
- name: owner
type: string
description: API key of the taker
required: true
- name: trade_owner
type: string
required: false
- name: maker_address
type: string
required: false
- name: transaction_hash
type: string
required: false
- name: bucket_index
type: integer
required: false
- name: maker_orders
type: array
required: false
- name: trader_side
type: string
description: Whether the receiving user was TAKER or MAKER
enumValues:
- TAKER
- MAKER
required: false
- name: timestamp
type: string
description: Event timestamp in milliseconds
required: true
headers: []
jsonPayloadSchema:
type: object
description: Trade match, confirmation, or status change event
required:
- event_type
- type
- id
- taker_order_id
- market
- asset_id
- side
- size
- price
- status
- owner
- timestamp
properties:
event_type:
type: string
const: trade
x-parser-schema-id: <anonymous-schema-32>
type:
type: string
const: TRADE
x-parser-schema-id: <anonymous-schema-33>
id:
type: string
description: Trade ID
x-parser-schema-id: <anonymous-schema-34>
taker_order_id:
type: string
x-parser-schema-id: <anonymous-schema-35>
market:
type: string
description: Condition ID
x-parser-schema-id: <anonymous-schema-36>
asset_id:
type: string
x-parser-schema-id: <anonymous-schema-37>
side:
type: string
enum:
- BUY
- SELL
description: From taker's perspective
x-parser-schema-id: <anonymous-schema-38>
size:
type: string
x-parser-schema-id: <anonymous-schema-39>
price:
type: string
x-parser-schema-id: <anonymous-schema-40>
fee_rate_bps:
type: string
x-parser-schema-id: <anonymous-schema-41>
status:
type: string
enum:
- MATCHED
- MINED
- CONFIRMED
- RETRYING
- FAILED
x-parser-schema-id: <anonymous-schema-42>
matchtime:
type: string
x-parser-schema-id: <anonymous-schema-43>
last_update:
type: string
x-parser-schema-id: <anonymous-schema-44>
outcome:
type: string
x-parser-schema-id: <anonymous-schema-45>
owner:
type: string
description: API key of the taker
x-parser-schema-id: <anonymous-schema-46>
trade_owner:
type: string
x-parser-schema-id: <anonymous-schema-47>
maker_address:
type: string
x-parser-schema-id: <anonymous-schema-48>
transaction_hash:
type: string
x-parser-schema-id: <anonymous-schema-49>
bucket_index:
type: integer
x-parser-schema-id: <anonymous-schema-50>
maker_orders:
type: array
items:
type: object
description: Maker order details within a trade
required:
- order_id
- owner
- matched_amount
- price
- asset_id
properties:
order_id:
type: string
x-parser-schema-id: <anonymous-schema-52>
owner:
type: string
x-parser-schema-id: <anonymous-schema-53>
maker_address:
type: string
x-parser-schema-id: <anonymous-schema-54>
matched_amount:
type: string
x-parser-schema-id: <anonymous-schema-55>
price:
type: string
x-parser-schema-id: <anonymous-schema-56>
fee_rate_bps:
type: string
x-parser-schema-id: <anonymous-schema-57>
asset_id:
type: string
x-parser-schema-id: <anonymous-schema-58>
outcome:
type: string
x-parser-schema-id: <anonymous-schema-59>
side:
type: string
enum:
- BUY
- SELL
x-parser-schema-id: <anonymous-schema-60>
x-parser-schema-id: TradeMakerOrder
x-parser-schema-id: <anonymous-schema-51>
trader_side:
type: string
enum:
- TAKER
- MAKER
description: Whether the receiving user was TAKER or MAKER
x-parser-schema-id: <anonymous-schema-61>
timestamp:
type: string
description: Event timestamp in milliseconds
x-parser-schema-id: <anonymous-schema-62>
x-parser-schema-id: TradeEvent
title: Trade Event
description: Trade match, confirmation, or status change
example: |-
{
"event_type": "trade",
"type": "TRADE",
"id": "28c4d2eb-bbea-40e7-a9f0-b2fdb56b2c2e",
"taker_order_id": "0x06bc63e346ed4ceddce9efd6b3af37c8f8f440c92fe7da6b2d0f9e4ccbc50c42",
"market": "0xbd31dc8a20211944f6b70f31557f1001557b59905b7738480ca09bd4532f84af",
"asset_id": "52114319501245915516055106046884209969926127482827954674443846427813813222426",
"side": "BUY",
"size": "10",
"price": "0.57",
"fee_rate_bps": "0",
"status": "MATCHED",
"matchtime": "1672290701",
"last_update": "1672290701",
"outcome": "YES",
"owner": "9180014b-33c8-9240-a14b-bdca11c0a465",
"trade_owner": "9180014b-33c8-9240-a14b-bdca11c0a465",
"maker_address": "0x1234...",
"transaction_hash": "",
"bucket_index": 0,
"maker_orders": [
{
"order_id": "0xff354cd7ca7539dfa9c28d90943ab5779a4eac34b9b37a757d7b32bdfb11790b",
"owner": "9180014b-33c8-9240-a14b-bdca11c0a465",
"maker_address": "0x5678...",
"matched_amount": "10",
"price": "0.57",
"fee_rate_bps": "0",
"asset_id": "52114319501245915516055106046884209969926127482827954674443846427813813222426",
"outcome": "YES",
"side": "SELL"
}
],
"trader_side": "TAKER",
"timestamp": "1672290701"
}
bindings: []
extensions:
- id: x-parser-unique-object-id
value: trade
bindings: []
extensions: *ref_0
sendOperations:
- *ref_1
- *ref_2
- *ref_3
receiveOperations:
- *ref_4
- *ref_5
- *ref_6
sendMessages:
- *ref_7
- *ref_8
- *ref_9
receiveMessages:
- *ref_10
- *ref_11
- *ref_12
extensions:
- id: x-parser-unique-object-id
value: user
securitySchemes: []
````
Built with [Mintlify](https://mintlify.com).