diff --git a/docs/advanced/neg-risk.md b/docs/advanced/neg-risk.md index 84f9ac7..ef6aea9 100644 --- a/docs/advanced/neg-risk.md +++ b/docs/advanced/neg-risk.md @@ -143,3 +143,6 @@ The conversion operation is atomic and happens through the Neg Risk Adapter: Learn about token operations like split, merge, and redeem. + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/api-reference/authentication.md b/docs/api-reference/authentication.md index 80dd436..b69edef 100644 --- a/docs/api-reference/authentication.md +++ b/docs/api-reference/authentication.md @@ -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 @@ -105,6 +105,29 @@ Before making authenticated requests, you need to obtain API credentials using L # } ``` + + + ```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()); + ``` + @@ -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 @@ -274,6 +297,30 @@ The `POLY_SIGNATURE` for L2 is an HMAC-SHA256 signature created using the user's ) ``` + + + ```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?; + ``` + @@ -324,7 +371,7 @@ When initializing the L2 client, you must specify your wallet **signatureType** ## Troubleshooting - + 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 - + 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()` - + 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. + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/api-reference/bridge/create-deposit-addresses.md b/docs/api-reference/bridge/create-deposit-addresses.md index 45338fc..384b66e 100644 --- a/docs/api-reference/bridge/create-deposit-addresses.md +++ b/docs/api-reference/bridge/create-deposit-addresses.md @@ -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). \ No newline at end of file diff --git a/docs/api-reference/bridge/create-withdrawal-addresses.md b/docs/api-reference/bridge/create-withdrawal-addresses.md index 0bae592..e0fb395 100644 --- a/docs/api-reference/bridge/create-withdrawal-addresses.md +++ b/docs/api-reference/bridge/create-withdrawal-addresses.md @@ -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). \ No newline at end of file diff --git a/docs/api-reference/bridge/get-a-quote.md b/docs/api-reference/bridge/get-a-quote.md index 29a3494..82e0389 100644 --- a/docs/api-reference/bridge/get-a-quote.md +++ b/docs/api-reference/bridge/get-a-quote.md @@ -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). \ No newline at end of file diff --git a/docs/api-reference/bridge/get-supported-assets.md b/docs/api-reference/bridge/get-supported-assets.md index 8615548..f87e252 100644 --- a/docs/api-reference/bridge/get-supported-assets.md +++ b/docs/api-reference/bridge/get-supported-assets.md @@ -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). \ No newline at end of file diff --git a/docs/api-reference/bridge/get-transaction-status.md b/docs/api-reference/bridge/get-transaction-status.md index 8063bda..80aa50a 100644 --- a/docs/api-reference/bridge/get-transaction-status.md +++ b/docs/api-reference/bridge/get-transaction-status.md @@ -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). \ No newline at end of file diff --git a/docs/api-reference/builders/get-aggregated-builder-leaderboard.md b/docs/api-reference/builders/get-aggregated-builder-leaderboard.md index 6df43c8..a9f068e 100644 --- a/docs/api-reference/builders/get-aggregated-builder-leaderboard.md +++ b/docs/api-reference/builders/get-aggregated-builder-leaderboard.md @@ -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). \ No newline at end of file diff --git a/docs/api-reference/builders/get-daily-builder-volume-time-series.md b/docs/api-reference/builders/get-daily-builder-volume-time-series.md index 74f76cd..2035f5b 100644 --- a/docs/api-reference/builders/get-daily-builder-volume-time-series.md +++ b/docs/api-reference/builders/get-daily-builder-volume-time-series.md @@ -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). \ No newline at end of file diff --git a/docs/api-reference/clients-sdks.md b/docs/api-reference/clients-sdks.md index a5fdb47..dd4d30e 100644 --- a/docs/api-reference/clients-sdks.md +++ b/docs/api-reference/clients-sdks.md @@ -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?; + ``` ## Source Code @@ -95,3 +106,6 @@ For [gasless transactions](/trading/gasless) using proxy wallets, the relayer cl Understand L1/L2 auth and API credentials. + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/api-reference/comments/get-comments-by-comment-id.md b/docs/api-reference/comments/get-comments-by-comment-id.md index 0c54dba..fb561ce 100644 --- a/docs/api-reference/comments/get-comments-by-comment-id.md +++ b/docs/api-reference/comments/get-comments-by-comment-id.md @@ -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). \ No newline at end of file diff --git a/docs/api-reference/comments/get-comments-by-user-address.md b/docs/api-reference/comments/get-comments-by-user-address.md index 02988fc..820525a 100644 --- a/docs/api-reference/comments/get-comments-by-user-address.md +++ b/docs/api-reference/comments/get-comments-by-user-address.md @@ -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). \ No newline at end of file diff --git a/docs/api-reference/comments/list-comments.md b/docs/api-reference/comments/list-comments.md index a677177..49ffbdb 100644 --- a/docs/api-reference/comments/list-comments.md +++ b/docs/api-reference/comments/list-comments.md @@ -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). \ No newline at end of file diff --git a/docs/api-reference/core/get-closed-positions-for-a-user.md b/docs/api-reference/core/get-closed-positions-for-a-user.md index 9276a82..89e727f 100644 --- a/docs/api-reference/core/get-closed-positions-for-a-user.md +++ b/docs/api-reference/core/get-closed-positions-for-a-user.md @@ -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). \ No newline at end of file diff --git a/docs/api-reference/core/get-current-positions-for-a-user.md b/docs/api-reference/core/get-current-positions-for-a-user.md index 4d26310..67016d6 100644 --- a/docs/api-reference/core/get-current-positions-for-a-user.md +++ b/docs/api-reference/core/get-current-positions-for-a-user.md @@ -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). \ No newline at end of file diff --git a/docs/api-reference/core/get-positions-for-a-market.md b/docs/api-reference/core/get-positions-for-a-market.md index 3c164c5..e2741e7 100644 --- a/docs/api-reference/core/get-positions-for-a-market.md +++ b/docs/api-reference/core/get-positions-for-a-market.md @@ -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). \ No newline at end of file diff --git a/docs/api-reference/core/get-top-holders-for-markets.md b/docs/api-reference/core/get-top-holders-for-markets.md index b646ed8..033cec4 100644 --- a/docs/api-reference/core/get-top-holders-for-markets.md +++ b/docs/api-reference/core/get-top-holders-for-markets.md @@ -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). \ No newline at end of file diff --git a/docs/api-reference/core/get-total-value-of-a-users-positions.md b/docs/api-reference/core/get-total-value-of-a-users-positions.md index d51e115..324536e 100644 --- a/docs/api-reference/core/get-total-value-of-a-users-positions.md +++ b/docs/api-reference/core/get-total-value-of-a-users-positions.md @@ -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). \ No newline at end of file diff --git a/docs/api-reference/core/get-trader-leaderboard-rankings.md b/docs/api-reference/core/get-trader-leaderboard-rankings.md index ef3451a..639c286 100644 --- a/docs/api-reference/core/get-trader-leaderboard-rankings.md +++ b/docs/api-reference/core/get-trader-leaderboard-rankings.md @@ -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). \ No newline at end of file diff --git a/docs/api-reference/core/get-trades-for-a-user-or-markets.md b/docs/api-reference/core/get-trades-for-a-user-or-markets.md index 5b8050d..bf89d97 100644 --- a/docs/api-reference/core/get-trades-for-a-user-or-markets.md +++ b/docs/api-reference/core/get-trades-for-a-user-or-markets.md @@ -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). \ No newline at end of file diff --git a/docs/api-reference/core/get-user-activity.md b/docs/api-reference/core/get-user-activity.md index ec8fcd1..8e0cf25 100644 --- a/docs/api-reference/core/get-user-activity.md +++ b/docs/api-reference/core/get-user-activity.md @@ -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). \ No newline at end of file diff --git a/docs/api-reference/data/get-server-time.md b/docs/api-reference/data/get-server-time.md index 6cb9c49..4f8fe32 100644 --- a/docs/api-reference/data/get-server-time.md +++ b/docs/api-reference/data/get-server-time.md @@ -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). \ No newline at end of file diff --git a/docs/api-reference/events/get-event-by-id.md b/docs/api-reference/events/get-event-by-id.md index 6439a40..6183da8 100644 --- a/docs/api-reference/events/get-event-by-id.md +++ b/docs/api-reference/events/get-event-by-id.md @@ -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). \ No newline at end of file diff --git a/docs/api-reference/events/get-event-by-slug.md b/docs/api-reference/events/get-event-by-slug.md index c5086f8..3d0ba7d 100644 --- a/docs/api-reference/events/get-event-by-slug.md +++ b/docs/api-reference/events/get-event-by-slug.md @@ -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). \ No newline at end of file diff --git a/docs/api-reference/events/get-event-tags.md b/docs/api-reference/events/get-event-tags.md index 97ce97b..ba34fa9 100644 --- a/docs/api-reference/events/get-event-tags.md +++ b/docs/api-reference/events/get-event-tags.md @@ -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). \ No newline at end of file diff --git a/docs/api-reference/events/list-events.md b/docs/api-reference/events/list-events.md index ae022a2..92244fc 100644 --- a/docs/api-reference/events/list-events.md +++ b/docs/api-reference/events/list-events.md @@ -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). \ No newline at end of file diff --git a/docs/api-reference/geoblock.md b/docs/api-reference/geoblock.md index 24690aa..3519bb7 100644 --- a/docs/api-reference/geoblock.md +++ b/docs/api-reference/geoblock.md @@ -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") ``` + + + ```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"); + } + ``` + *** -## 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). + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/api-reference/introduction.md b/docs/api-reference/introduction.md index 003f8c4..d699672 100644 --- a/docs/api-reference/introduction.md +++ b/docs/api-reference/introduction.md @@ -57,3 +57,6 @@ The CLOB API has both public endpoints (orderbook, prices) and authenticated end Official TypeScript, Python, and Rust libraries. + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/api-reference/market-data/get-fee-rate-by-path-parameter.md b/docs/api-reference/market-data/get-fee-rate-by-path-parameter.md index 62742bc..dc467bd 100644 --- a/docs/api-reference/market-data/get-fee-rate-by-path-parameter.md +++ b/docs/api-reference/market-data/get-fee-rate-by-path-parameter.md @@ -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). \ No newline at end of file diff --git a/docs/api-reference/market-data/get-fee-rate.md b/docs/api-reference/market-data/get-fee-rate.md index dfd4fe7..051ed12 100644 --- a/docs/api-reference/market-data/get-fee-rate.md +++ b/docs/api-reference/market-data/get-fee-rate.md @@ -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). \ No newline at end of file diff --git a/docs/api-reference/market-data/get-last-trade-price.md b/docs/api-reference/market-data/get-last-trade-price.md index d85bcbf..47cf184 100644 --- a/docs/api-reference/market-data/get-last-trade-price.md +++ b/docs/api-reference/market-data/get-last-trade-price.md @@ -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). \ No newline at end of file diff --git a/docs/api-reference/market-data/get-last-trade-prices-query-parameters.md b/docs/api-reference/market-data/get-last-trade-prices-query-parameters.md index abde495..2df798e 100644 --- a/docs/api-reference/market-data/get-last-trade-prices-query-parameters.md +++ b/docs/api-reference/market-data/get-last-trade-prices-query-parameters.md @@ -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). \ No newline at end of file diff --git a/docs/api-reference/market-data/get-last-trade-prices-request-body.md b/docs/api-reference/market-data/get-last-trade-prices-request-body.md index 9046722..8aea367 100644 --- a/docs/api-reference/market-data/get-last-trade-prices-request-body.md +++ b/docs/api-reference/market-data/get-last-trade-prices-request-body.md @@ -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). \ No newline at end of file diff --git a/docs/api-reference/market-data/get-market-price.md b/docs/api-reference/market-data/get-market-price.md index f7d576d..4e2a49a 100644 --- a/docs/api-reference/market-data/get-market-price.md +++ b/docs/api-reference/market-data/get-market-price.md @@ -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). \ No newline at end of file diff --git a/docs/api-reference/market-data/get-market-prices-query-parameters.md b/docs/api-reference/market-data/get-market-prices-query-parameters.md index 50c67a8..2f9f89c 100644 --- a/docs/api-reference/market-data/get-market-prices-query-parameters.md +++ b/docs/api-reference/market-data/get-market-prices-query-parameters.md @@ -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). \ No newline at end of file diff --git a/docs/api-reference/market-data/get-market-prices-request-body.md b/docs/api-reference/market-data/get-market-prices-request-body.md index c8d3da6..a5c1210 100644 --- a/docs/api-reference/market-data/get-market-prices-request-body.md +++ b/docs/api-reference/market-data/get-market-prices-request-body.md @@ -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). \ No newline at end of file diff --git a/docs/api-reference/market-data/get-midpoint-prices-query-parameters.md b/docs/api-reference/market-data/get-midpoint-prices-query-parameters.md index 7307cb7..119a4c4 100644 --- a/docs/api-reference/market-data/get-midpoint-prices-query-parameters.md +++ b/docs/api-reference/market-data/get-midpoint-prices-query-parameters.md @@ -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). \ No newline at end of file diff --git a/docs/api-reference/market-data/get-midpoint-prices-request-body.md b/docs/api-reference/market-data/get-midpoint-prices-request-body.md index 1b3bf72..7f6cc42 100644 --- a/docs/api-reference/market-data/get-midpoint-prices-request-body.md +++ b/docs/api-reference/market-data/get-midpoint-prices-request-body.md @@ -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). \ No newline at end of file diff --git a/docs/api-reference/market-data/get-order-book.md b/docs/api-reference/market-data/get-order-book.md index 49553cc..8e49bcb 100644 --- a/docs/api-reference/market-data/get-order-book.md +++ b/docs/api-reference/market-data/get-order-book.md @@ -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). \ No newline at end of file diff --git a/docs/api-reference/market-data/get-order-books-request-body.md b/docs/api-reference/market-data/get-order-books-request-body.md index 611b22a..b0b59dd 100644 --- a/docs/api-reference/market-data/get-order-books-request-body.md +++ b/docs/api-reference/market-data/get-order-books-request-body.md @@ -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). \ No newline at end of file diff --git a/docs/api-reference/market-data/get-spread.md b/docs/api-reference/market-data/get-spread.md index c764a34..de6a811 100644 --- a/docs/api-reference/market-data/get-spread.md +++ b/docs/api-reference/market-data/get-spread.md @@ -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). \ No newline at end of file diff --git a/docs/api-reference/market-data/get-spreads.md b/docs/api-reference/market-data/get-spreads.md index 7739be0..890aa53 100644 --- a/docs/api-reference/market-data/get-spreads.md +++ b/docs/api-reference/market-data/get-spreads.md @@ -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). \ No newline at end of file diff --git a/docs/api-reference/market-data/get-tick-size-by-path-parameter.md b/docs/api-reference/market-data/get-tick-size-by-path-parameter.md index 1c4c5df..98095fc 100644 --- a/docs/api-reference/market-data/get-tick-size-by-path-parameter.md +++ b/docs/api-reference/market-data/get-tick-size-by-path-parameter.md @@ -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). \ No newline at end of file diff --git a/docs/api-reference/market-data/get-tick-size.md b/docs/api-reference/market-data/get-tick-size.md index c893938..2c2e81a 100644 --- a/docs/api-reference/market-data/get-tick-size.md +++ b/docs/api-reference/market-data/get-tick-size.md @@ -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). \ No newline at end of file diff --git a/docs/api-reference/markets/get-market-by-id.md b/docs/api-reference/markets/get-market-by-id.md index 2ce21f4..2804ac8 100644 --- a/docs/api-reference/markets/get-market-by-id.md +++ b/docs/api-reference/markets/get-market-by-id.md @@ -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). \ No newline at end of file diff --git a/docs/api-reference/markets/get-market-by-slug.md b/docs/api-reference/markets/get-market-by-slug.md index 0b0c661..623354a 100644 --- a/docs/api-reference/markets/get-market-by-slug.md +++ b/docs/api-reference/markets/get-market-by-slug.md @@ -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). \ No newline at end of file diff --git a/docs/api-reference/markets/get-market-tags-by-id.md b/docs/api-reference/markets/get-market-tags-by-id.md index f55385d..d596e5e 100644 --- a/docs/api-reference/markets/get-market-tags-by-id.md +++ b/docs/api-reference/markets/get-market-tags-by-id.md @@ -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). \ No newline at end of file diff --git a/docs/api-reference/markets/get-prices-history.md b/docs/api-reference/markets/get-prices-history.md index de671aa..06c19b2 100644 --- a/docs/api-reference/markets/get-prices-history.md +++ b/docs/api-reference/markets/get-prices-history.md @@ -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). \ No newline at end of file diff --git a/docs/api-reference/markets/get-sampling-markets.md b/docs/api-reference/markets/get-sampling-markets.md index d6329b2..bdf78fb 100644 --- a/docs/api-reference/markets/get-sampling-markets.md +++ b/docs/api-reference/markets/get-sampling-markets.md @@ -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). \ No newline at end of file diff --git a/docs/api-reference/markets/get-sampling-simplified-markets.md b/docs/api-reference/markets/get-sampling-simplified-markets.md index a29c04d..dcc5030 100644 --- a/docs/api-reference/markets/get-sampling-simplified-markets.md +++ b/docs/api-reference/markets/get-sampling-simplified-markets.md @@ -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). \ No newline at end of file diff --git a/docs/api-reference/markets/get-simplified-markets.md b/docs/api-reference/markets/get-simplified-markets.md index a93e047..c424f11 100644 --- a/docs/api-reference/markets/get-simplified-markets.md +++ b/docs/api-reference/markets/get-simplified-markets.md @@ -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). \ No newline at end of file diff --git a/docs/api-reference/markets/list-markets.md b/docs/api-reference/markets/list-markets.md index 7e3fb18..a646e2c 100644 --- a/docs/api-reference/markets/list-markets.md +++ b/docs/api-reference/markets/list-markets.md @@ -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). \ No newline at end of file diff --git a/docs/api-reference/misc/download-an-accounting-snapshot-zip-of-csvs.md b/docs/api-reference/misc/download-an-accounting-snapshot-zip-of-csvs.md index 44ad65a..b1bd7fc 100644 --- a/docs/api-reference/misc/download-an-accounting-snapshot-zip-of-csvs.md +++ b/docs/api-reference/misc/download-an-accounting-snapshot-zip-of-csvs.md @@ -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). \ No newline at end of file diff --git a/docs/api-reference/misc/get-live-volume-for-an-event.md b/docs/api-reference/misc/get-live-volume-for-an-event.md index 6839791..93ce8c9 100644 --- a/docs/api-reference/misc/get-live-volume-for-an-event.md +++ b/docs/api-reference/misc/get-live-volume-for-an-event.md @@ -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). \ No newline at end of file diff --git a/docs/api-reference/misc/get-open-interest.md b/docs/api-reference/misc/get-open-interest.md index 974ce09..7a90a33 100644 --- a/docs/api-reference/misc/get-open-interest.md +++ b/docs/api-reference/misc/get-open-interest.md @@ -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). \ No newline at end of file diff --git a/docs/api-reference/misc/get-total-markets-a-user-has-traded.md b/docs/api-reference/misc/get-total-markets-a-user-has-traded.md index 1a64750..6db8980 100644 --- a/docs/api-reference/misc/get-total-markets-a-user-has-traded.md +++ b/docs/api-reference/misc/get-total-markets-a-user-has-traded.md @@ -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). \ No newline at end of file diff --git a/docs/api-reference/profiles/get-public-profile-by-wallet-address.md b/docs/api-reference/profiles/get-public-profile-by-wallet-address.md index 46a8d7b..15dcfe6 100644 --- a/docs/api-reference/profiles/get-public-profile-by-wallet-address.md +++ b/docs/api-reference/profiles/get-public-profile-by-wallet-address.md @@ -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). \ No newline at end of file diff --git a/docs/api-reference/rate-limits.md b/docs/api-reference/rate-limits.md index 2d99713..3301b50 100644 --- a/docs/api-reference/rate-limits.md +++ b/docs/api-reference/rate-limits.md @@ -124,3 +124,6 @@ Trading endpoints have both **burst** limits (short spikes allowed) and **sustai Official TypeScript, Python, and Rust libraries. + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/api-reference/search/search-markets-events-and-profiles.md b/docs/api-reference/search/search-markets-events-and-profiles.md index 1cf53d6..d9a9940 100644 --- a/docs/api-reference/search/search-markets-events-and-profiles.md +++ b/docs/api-reference/search/search-markets-events-and-profiles.md @@ -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). \ No newline at end of file diff --git a/docs/api-reference/series/get-series-by-id.md b/docs/api-reference/series/get-series-by-id.md index da02162..1fbb392 100644 --- a/docs/api-reference/series/get-series-by-id.md +++ b/docs/api-reference/series/get-series-by-id.md @@ -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). \ No newline at end of file diff --git a/docs/api-reference/series/list-series.md b/docs/api-reference/series/list-series.md index 42e2dc5..5a092fb 100644 --- a/docs/api-reference/series/list-series.md +++ b/docs/api-reference/series/list-series.md @@ -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). \ No newline at end of file diff --git a/docs/api-reference/sports/get-sports-metadata-information.md b/docs/api-reference/sports/get-sports-metadata-information.md index 3f3bc42..8fb9b6b 100644 --- a/docs/api-reference/sports/get-sports-metadata-information.md +++ b/docs/api-reference/sports/get-sports-metadata-information.md @@ -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). \ No newline at end of file diff --git a/docs/api-reference/sports/get-valid-sports-market-types.md b/docs/api-reference/sports/get-valid-sports-market-types.md index db8f727..ee0a09d 100644 --- a/docs/api-reference/sports/get-valid-sports-market-types.md +++ b/docs/api-reference/sports/get-valid-sports-market-types.md @@ -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). \ No newline at end of file diff --git a/docs/api-reference/sports/list-teams.md b/docs/api-reference/sports/list-teams.md index efe7d45..d9186f9 100644 --- a/docs/api-reference/sports/list-teams.md +++ b/docs/api-reference/sports/list-teams.md @@ -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). \ No newline at end of file diff --git a/docs/api-reference/tags/get-related-tags-relationships-by-tag-id.md b/docs/api-reference/tags/get-related-tags-relationships-by-tag-id.md index 346cf9b..5d24ca0 100644 --- a/docs/api-reference/tags/get-related-tags-relationships-by-tag-id.md +++ b/docs/api-reference/tags/get-related-tags-relationships-by-tag-id.md @@ -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). \ No newline at end of file diff --git a/docs/api-reference/tags/get-related-tags-relationships-by-tag-slug.md b/docs/api-reference/tags/get-related-tags-relationships-by-tag-slug.md index 9ccd8c4..8cb76d2 100644 --- a/docs/api-reference/tags/get-related-tags-relationships-by-tag-slug.md +++ b/docs/api-reference/tags/get-related-tags-relationships-by-tag-slug.md @@ -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). \ No newline at end of file diff --git a/docs/api-reference/tags/get-tag-by-id.md b/docs/api-reference/tags/get-tag-by-id.md index 158c370..550e85b 100644 --- a/docs/api-reference/tags/get-tag-by-id.md +++ b/docs/api-reference/tags/get-tag-by-id.md @@ -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). \ No newline at end of file diff --git a/docs/api-reference/tags/get-tag-by-slug.md b/docs/api-reference/tags/get-tag-by-slug.md index 9b97824..61886c7 100644 --- a/docs/api-reference/tags/get-tag-by-slug.md +++ b/docs/api-reference/tags/get-tag-by-slug.md @@ -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). \ No newline at end of file diff --git a/docs/api-reference/tags/get-tags-related-to-a-tag-id.md b/docs/api-reference/tags/get-tags-related-to-a-tag-id.md index b13877a..2462e3f 100644 --- a/docs/api-reference/tags/get-tags-related-to-a-tag-id.md +++ b/docs/api-reference/tags/get-tags-related-to-a-tag-id.md @@ -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). \ No newline at end of file diff --git a/docs/api-reference/tags/get-tags-related-to-a-tag-slug.md b/docs/api-reference/tags/get-tags-related-to-a-tag-slug.md index 702e7fa..c121af9 100644 --- a/docs/api-reference/tags/get-tags-related-to-a-tag-slug.md +++ b/docs/api-reference/tags/get-tags-related-to-a-tag-slug.md @@ -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). \ No newline at end of file diff --git a/docs/api-reference/tags/list-tags.md b/docs/api-reference/tags/list-tags.md index 69e5fae..407e8ef 100644 --- a/docs/api-reference/tags/list-tags.md +++ b/docs/api-reference/tags/list-tags.md @@ -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). \ No newline at end of file diff --git a/docs/api-reference/trade/cancel-all-orders.md b/docs/api-reference/trade/cancel-all-orders.md index fe5f8e8..b42b54d 100644 --- a/docs/api-reference/trade/cancel-all-orders.md +++ b/docs/api-reference/trade/cancel-all-orders.md @@ -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). \ No newline at end of file diff --git a/docs/api-reference/trade/cancel-multiple-orders.md b/docs/api-reference/trade/cancel-multiple-orders.md index dc37ff7..0f5e053 100644 --- a/docs/api-reference/trade/cancel-multiple-orders.md +++ b/docs/api-reference/trade/cancel-multiple-orders.md @@ -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). \ No newline at end of file diff --git a/docs/api-reference/trade/cancel-orders-for-a-market.md b/docs/api-reference/trade/cancel-orders-for-a-market.md index e4ffa00..2080d3d 100644 --- a/docs/api-reference/trade/cancel-orders-for-a-market.md +++ b/docs/api-reference/trade/cancel-orders-for-a-market.md @@ -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). \ No newline at end of file diff --git a/docs/api-reference/trade/cancel-single-order.md b/docs/api-reference/trade/cancel-single-order.md index 8b8c10f..1c46030 100644 --- a/docs/api-reference/trade/cancel-single-order.md +++ b/docs/api-reference/trade/cancel-single-order.md @@ -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). \ No newline at end of file diff --git a/docs/api-reference/trade/get-builder-trades.md b/docs/api-reference/trade/get-builder-trades.md index 095cc1e..e18372d 100644 --- a/docs/api-reference/trade/get-builder-trades.md +++ b/docs/api-reference/trade/get-builder-trades.md @@ -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). \ No newline at end of file diff --git a/docs/api-reference/trade/get-order-scoring-status.md b/docs/api-reference/trade/get-order-scoring-status.md index c7f97ac..641f6a0 100644 --- a/docs/api-reference/trade/get-order-scoring-status.md +++ b/docs/api-reference/trade/get-order-scoring-status.md @@ -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). \ No newline at end of file diff --git a/docs/api-reference/trade/get-single-order-by-id.md b/docs/api-reference/trade/get-single-order-by-id.md index f1221eb..de4361f 100644 --- a/docs/api-reference/trade/get-single-order-by-id.md +++ b/docs/api-reference/trade/get-single-order-by-id.md @@ -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). \ No newline at end of file diff --git a/docs/api-reference/trade/get-trades.md b/docs/api-reference/trade/get-trades.md index e2d3ca8..f63b0e3 100644 --- a/docs/api-reference/trade/get-trades.md +++ b/docs/api-reference/trade/get-trades.md @@ -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). \ No newline at end of file diff --git a/docs/api-reference/trade/get-user-orders.md b/docs/api-reference/trade/get-user-orders.md index e35b31f..33b9ec4 100644 --- a/docs/api-reference/trade/get-user-orders.md +++ b/docs/api-reference/trade/get-user-orders.md @@ -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). \ No newline at end of file diff --git a/docs/api-reference/trade/post-a-new-order.md b/docs/api-reference/trade/post-a-new-order.md index 2bf2d9e..3530ce6 100644 --- a/docs/api-reference/trade/post-a-new-order.md +++ b/docs/api-reference/trade/post-a-new-order.md @@ -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). \ No newline at end of file diff --git a/docs/api-reference/trade/post-multiple-orders.md b/docs/api-reference/trade/post-multiple-orders.md index 7f6668d..235c9df 100644 --- a/docs/api-reference/trade/post-multiple-orders.md +++ b/docs/api-reference/trade/post-multiple-orders.md @@ -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). \ No newline at end of file diff --git a/docs/api-reference/trade/send-heartbeat.md b/docs/api-reference/trade/send-heartbeat.md index 477ad53..8bf3cdc 100644 --- a/docs/api-reference/trade/send-heartbeat.md +++ b/docs/api-reference/trade/send-heartbeat.md @@ -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). \ No newline at end of file diff --git a/docs/api-reference/wss/market.md b/docs/api-reference/wss/market.md index 8cd7d8e..460c26d 100644 --- a/docs/api-reference/wss/market.md +++ b/docs/api-reference/wss/market.md @@ -5,3 +5,1248 @@ # Market Channel > Public WebSocket for real-time orderbook, price, and market lifecycle updates. + + + +## AsyncAPI + +````yaml asyncapi.json market +id: market +title: Market Channel +description: >- + Public channel for real-time market data. Subscribe by providing asset IDs + (token IDs). Receive orderbook snapshots, price updates, trade executions, and + market lifecycle events. +servers: + - id: production + protocol: wss + host: ws-subscriptions-clob.polymarket.com + bindings: [] + variables: [] +address: /ws/market +parameters: [] +bindings: [] +operations: + - &ref_3 + id: subscribe + title: Subscribe + description: Send initial subscription request to receive market data + type: receive + messages: + - &ref_14 + id: subscriptionRequest + contentType: application/json + payload: + - name: Subscription Request + description: Initial subscription message sent after connecting + type: object + properties: + - name: assets_ids + type: array + description: Asset IDs (token IDs) to subscribe to + required: true + - name: type + type: string + description: Must be 'market' + required: true + - name: initial_dump + type: boolean + description: >- + Whether to send an initial orderbook snapshot on subscribe. + Defaults to true. + required: false + - name: level + type: integer + description: Subscription level. Defaults to 2. + enumValues: + - 1 + - 2 + - 3 + required: false + - name: custom_feature_enabled + type: boolean + description: Enable best_bid_ask, new_market, and market_resolved events. + required: false + headers: [] + jsonPayloadSchema: + type: object + description: Initial subscription request payload + required: + - assets_ids + - type + properties: + assets_ids: + type: array + description: Asset IDs (token IDs) to subscribe to + items: + type: string + x-parser-schema-id: + x-parser-schema-id: + type: + type: string + const: market + description: Must be 'market' + x-parser-schema-id: + initial_dump: + type: boolean + description: >- + Whether to send an initial orderbook snapshot on subscribe. + Defaults to true. + default: true + x-parser-schema-id: + level: + type: integer + enum: + - 1 + - 2 + - 3 + description: Subscription level. Defaults to 2. + default: 2 + x-parser-schema-id: + custom_feature_enabled: + type: boolean + description: Enable best_bid_ask, new_market, and market_resolved events. + default: false + x-parser-schema-id: + x-parser-schema-id: SubscriptionRequest + title: Subscription Request + description: Initial subscription message sent after connecting + example: |- + { + "assets_ids": [ + "65818619657568813474341868652308942079804919287380422192892211131408793125422", + "52114319501245915516055106046884209969926127482827954674443846427813813222426" + ], + "type": "market" + } + bindings: [] + extensions: + - id: x-parser-unique-object-id + value: subscriptionRequest + bindings: [] + extensions: &ref_0 + - id: x-parser-unique-object-id + value: market + - &ref_4 + id: updateSubscription + title: Update Subscription + description: Dynamically subscribe or unsubscribe from assets without reconnecting + type: receive + messages: + - &ref_15 + id: subscriptionRequestUpdate + contentType: application/json + payload: + - name: Subscription Update + description: Subscribe or unsubscribe from assets without reconnecting + type: object + properties: + - name: operation + type: string + enumValues: + - subscribe + - unsubscribe + required: true + - name: assets_ids + type: array + required: true + - name: level + type: integer + enumValues: + - 1 + - 2 + - 3 + required: false + - name: custom_feature_enabled + type: boolean + required: false + headers: [] + jsonPayloadSchema: + type: object + description: Dynamically update asset subscriptions + required: + - operation + - assets_ids + properties: + operation: + type: string + enum: + - subscribe + - unsubscribe + x-parser-schema-id: + assets_ids: + type: array + items: + type: string + x-parser-schema-id: + x-parser-schema-id: + level: + type: integer + enum: + - 1 + - 2 + - 3 + x-parser-schema-id: + custom_feature_enabled: + type: boolean + x-parser-schema-id: + x-parser-schema-id: SubscriptionRequestUpdate + title: Subscription Update + description: Subscribe or unsubscribe from assets without reconnecting + example: |- + { + "operation": "subscribe", + "assets_ids": [ + "71321045679252212594626385532706912750332728571942532289631379312455583992563" + ] + } + bindings: [] + extensions: + - id: x-parser-unique-object-id + value: subscriptionRequestUpdate + bindings: [] + extensions: *ref_0 + - &ref_5 + id: ping + title: Ping + description: Send PING every 10 seconds to keep the connection alive + type: receive + messages: + - &ref_16 + id: ping + contentType: text/plain + payload: + - type: string + const: PING + x-parser-schema-id: + name: Ping + description: Client heartbeat — send every 10 seconds + headers: [] + jsonPayloadSchema: + type: string + const: PING + x-parser-schema-id: + 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_6 + id: pong + title: Pong + description: Server responds to PING with PONG + type: send + messages: + - &ref_17 + id: pong + contentType: text/plain + payload: + - type: string + const: PONG + x-parser-schema-id: + name: Pong + description: Server heartbeat response + headers: [] + jsonPayloadSchema: + type: string + const: PONG + x-parser-schema-id: + title: Pong + description: Server heartbeat response + example: '{}' + bindings: [] + extensions: + - id: x-parser-unique-object-id + value: pong + bindings: [] + extensions: *ref_0 + - &ref_7 + id: receiveBook + title: Orderbook Snapshot + description: Full orderbook snapshot sent on subscribe or after a trade + type: send + messages: + - &ref_18 + id: book + contentType: application/json + payload: + - name: Orderbook Snapshot + description: Full aggregated orderbook for an asset + type: object + properties: + - name: event_type + type: string + description: book + required: true + - name: asset_id + type: string + description: Asset ID (token ID) + required: true + - name: market + type: string + description: Condition ID of the market + required: true + - name: bids + type: array + description: Aggregated buy orders by price level + required: true + - name: asks + type: array + description: Aggregated sell orders by price level + required: true + - name: timestamp + type: string + description: Unix timestamp in milliseconds + required: true + - name: hash + type: string + description: Hash of the orderbook content + required: true + headers: [] + jsonPayloadSchema: + type: object + description: Full orderbook snapshot + required: + - event_type + - asset_id + - market + - bids + - asks + - timestamp + - hash + properties: + event_type: + type: string + const: book + x-parser-schema-id: + asset_id: + type: string + description: Asset ID (token ID) + x-parser-schema-id: + market: + type: string + description: Condition ID of the market + x-parser-schema-id: + bids: + type: array + description: Aggregated buy orders by price level + items: &ref_1 + type: object + description: Aggregated order at a price level + required: + - price + - size + properties: + price: + type: string + description: Price level (e.g., '0.50') + x-parser-schema-id: + size: + type: string + description: Total size at this price level + x-parser-schema-id: + x-parser-schema-id: OrderSummary + x-parser-schema-id: + asks: + type: array + description: Aggregated sell orders by price level + items: *ref_1 + x-parser-schema-id: + timestamp: + type: string + description: Unix timestamp in milliseconds + x-parser-schema-id: + hash: + type: string + description: Hash of the orderbook content + x-parser-schema-id: + x-parser-schema-id: BookEvent + title: Orderbook Snapshot + description: Full aggregated orderbook for an asset + example: |- + { + "event_type": "book", + "asset_id": "65818619657568813474341868652308942079804919287380422192892211131408793125422", + "market": "0xbd31dc8a20211944f6b70f31557f1001557b59905b7738480ca09bd4532f84af", + "bids": [ + { + "price": "0.48", + "size": "30" + }, + { + "price": "0.49", + "size": "20" + }, + { + "price": "0.50", + "size": "15" + } + ], + "asks": [ + { + "price": "0.52", + "size": "25" + }, + { + "price": "0.53", + "size": "60" + }, + { + "price": "0.54", + "size": "10" + } + ], + "timestamp": "1757908892351", + "hash": "0xabc123..." + } + bindings: [] + extensions: + - id: x-parser-unique-object-id + value: book + bindings: [] + extensions: *ref_0 + - &ref_8 + id: receivePriceChange + title: Price Change + description: >- + Delta update to orderbook price levels when an order is placed or + cancelled + type: send + messages: + - &ref_19 + id: priceChange + contentType: application/json + payload: + - name: Price Change + description: Orderbook price level delta update + type: object + properties: + - name: event_type + type: string + description: price_change + required: true + - name: market + type: string + description: Condition ID of the market + required: true + - name: price_changes + type: array + required: true + - name: timestamp + type: string + description: Unix timestamp in milliseconds + required: true + headers: [] + jsonPayloadSchema: + type: object + description: One or more price level updates + required: + - event_type + - market + - price_changes + - timestamp + properties: + event_type: + type: string + const: price_change + x-parser-schema-id: + market: + type: string + description: Condition ID of the market + x-parser-schema-id: + price_changes: + type: array + items: + type: object + description: Individual price level change + required: + - asset_id + - price + - size + - side + - hash + properties: + asset_id: + type: string + x-parser-schema-id: + price: + type: string + description: Price level affected + x-parser-schema-id: + size: + type: string + description: New aggregate size (0 means level removed) + x-parser-schema-id: + side: + type: string + enum: + - BUY + - SELL + x-parser-schema-id: + hash: + type: string + description: Hash of the order that caused this change + x-parser-schema-id: + best_bid: + type: string + x-parser-schema-id: + best_ask: + type: string + x-parser-schema-id: + x-parser-schema-id: PriceChangeMessage + x-parser-schema-id: + timestamp: + type: string + description: Unix timestamp in milliseconds + x-parser-schema-id: + x-parser-schema-id: PriceChangeEvent + title: Price Change + description: Orderbook price level delta update + example: |- + { + "event_type": "price_change", + "market": "0x5f65177b394277fd294cd75650044e32ba009a95022d88a0c1d565897d72f8f1", + "price_changes": [ + { + "asset_id": "71321045679252212594626385532706912750332728571942532289631379312455583992563", + "price": "0.5", + "size": "200", + "side": "BUY", + "hash": "56621a121a47ed9333273e21c83b660cff37ae50", + "best_bid": "0.5", + "best_ask": "1" + } + ], + "timestamp": "1757908892351" + } + bindings: [] + extensions: + - id: x-parser-unique-object-id + value: priceChange + bindings: [] + extensions: *ref_0 + - &ref_9 + id: receiveLastTradePrice + title: Last Trade Price + description: Trade execution notification + type: send + messages: + - &ref_20 + id: lastTradePrice + contentType: application/json + payload: + - name: Last Trade Price + description: Trade execution event + type: object + properties: + - name: event_type + type: string + description: last_trade_price + required: true + - name: asset_id + type: string + required: true + - name: market + type: string + required: true + - name: price + type: string + description: Trade execution price + required: true + - name: size + type: string + description: Trade size + required: true + - name: fee_rate_bps + type: string + description: Fee rate in basis points + required: false + - name: side + type: string + description: From taker's perspective + enumValues: + - BUY + - SELL + required: true + - name: timestamp + type: string + description: Unix timestamp in milliseconds + required: true + - name: transaction_hash + type: string + required: false + headers: [] + jsonPayloadSchema: + type: object + description: Last trade price event + required: + - event_type + - asset_id + - market + - price + - size + - side + - timestamp + properties: + event_type: + type: string + const: last_trade_price + x-parser-schema-id: + asset_id: + type: string + x-parser-schema-id: + market: + type: string + x-parser-schema-id: + price: + type: string + description: Trade execution price + x-parser-schema-id: + size: + type: string + description: Trade size + x-parser-schema-id: + fee_rate_bps: + type: string + description: Fee rate in basis points + x-parser-schema-id: + side: + type: string + enum: + - BUY + - SELL + description: From taker's perspective + x-parser-schema-id: + timestamp: + type: string + description: Unix timestamp in milliseconds + x-parser-schema-id: + transaction_hash: + type: string + x-parser-schema-id: + x-parser-schema-id: LastTradePriceEvent + title: Last Trade Price + description: Trade execution event + example: |- + { + "event_type": "last_trade_price", + "asset_id": "114122071509644379678018727908709560226618148003371446110114509806601493071694", + "market": "0x6a67b9d828d53862160e470329ffea5246f338ecfffdf2cab45211ec578b0347", + "price": "0.456", + "size": "219.217767", + "fee_rate_bps": "0", + "side": "BUY", + "timestamp": "1750428146322", + "transaction_hash": "0xeeefffggghhh" + } + bindings: [] + extensions: + - id: x-parser-unique-object-id + value: lastTradePrice + bindings: [] + extensions: *ref_0 + - &ref_10 + id: receiveTickSizeChange + title: Tick Size Change + description: Market tick size update when price approaches limits + type: send + messages: + - &ref_21 + id: tickSizeChange + contentType: application/json + payload: + - name: Tick Size Change + description: Market tick size update event + type: object + properties: + - name: event_type + type: string + description: tick_size_change + required: true + - name: asset_id + type: string + required: true + - name: market + type: string + required: true + - name: old_tick_size + type: string + required: true + - name: new_tick_size + type: string + required: true + - name: timestamp + type: string + required: true + headers: [] + jsonPayloadSchema: + type: object + description: Tick size change event + required: + - event_type + - asset_id + - market + - old_tick_size + - new_tick_size + - timestamp + properties: + event_type: + type: string + const: tick_size_change + x-parser-schema-id: + asset_id: + type: string + x-parser-schema-id: + market: + type: string + x-parser-schema-id: + old_tick_size: + type: string + x-parser-schema-id: + new_tick_size: + type: string + x-parser-schema-id: + timestamp: + type: string + x-parser-schema-id: + x-parser-schema-id: TickSizeChangeEvent + title: Tick Size Change + description: Market tick size update event + example: |- + { + "event_type": "tick_size_change", + "asset_id": "65818619657568813474341868652308942079804919287380422192892211131408793125422", + "market": "0xbd31dc8a20211944f6b70f31557f1001557b59905b7738480ca09bd4532f84af", + "old_tick_size": "0.01", + "new_tick_size": "0.001", + "timestamp": "1757908892351" + } + bindings: [] + extensions: + - id: x-parser-unique-object-id + value: tickSizeChange + bindings: [] + extensions: *ref_0 + - &ref_11 + id: receiveBestBidAsk + title: Best Bid/Ask + description: 'Best bid and ask update (requires custom_feature_enabled: true)' + type: send + messages: + - &ref_22 + id: bestBidAsk + contentType: application/json + payload: + - name: Best Bid/Ask + description: >- + Best bid and ask price update — requires custom_feature_enabled: + true + type: object + properties: + - name: event_type + type: string + description: best_bid_ask + required: true + - name: asset_id + type: string + required: true + - name: market + type: string + required: true + - name: best_bid + type: string + required: true + - name: best_ask + type: string + required: true + - name: spread + type: string + required: true + - name: timestamp + type: string + required: true + headers: [] + jsonPayloadSchema: + type: object + description: Best bid/ask event — requires custom_feature_enabled + required: + - event_type + - asset_id + - market + - best_bid + - best_ask + - spread + - timestamp + properties: + event_type: + type: string + const: best_bid_ask + x-parser-schema-id: + asset_id: + type: string + x-parser-schema-id: + market: + type: string + x-parser-schema-id: + best_bid: + type: string + x-parser-schema-id: + best_ask: + type: string + x-parser-schema-id: + spread: + type: string + x-parser-schema-id: + timestamp: + type: string + x-parser-schema-id: + x-parser-schema-id: BestBidAskEvent + title: Best Bid/Ask + description: 'Best bid and ask price update — requires custom_feature_enabled: true' + example: |- + { + "event_type": "best_bid_ask", + "market": "0x0005c0d312de0be897668695bae9f32b624b4a1ae8b140c49f08447fcc74f442", + "asset_id": "85354956062430465315924116860125388538595433819574542752031640332592237464430", + "best_bid": "0.73", + "best_ask": "0.77", + "spread": "0.04", + "timestamp": "1766789469958" + } + bindings: [] + extensions: + - id: x-parser-unique-object-id + value: bestBidAsk + bindings: [] + extensions: *ref_0 + - &ref_12 + id: receiveNewMarket + title: New Market + description: 'New market creation event (requires custom_feature_enabled: true)' + type: send + messages: + - &ref_23 + id: newMarket + contentType: application/json + payload: + - name: New Market + description: 'New market creation event — requires custom_feature_enabled: true' + type: object + properties: + - name: event_type + type: string + description: new_market + required: true + - name: id + type: string + description: Market ID + required: true + - name: question + type: string + required: true + - name: market + type: string + description: Condition ID + required: true + - name: slug + type: string + required: true + - name: description + type: string + required: false + - name: assets_ids + type: array + required: true + - name: outcomes + type: array + required: true + - name: event_message + type: object + description: Parent event metadata for grouped markets + required: false + properties: + - name: id + type: string + required: false + - name: ticker + type: string + required: false + - name: slug + type: string + required: false + - name: title + type: string + required: false + - name: description + type: string + required: false + - name: timestamp + type: string + required: true + - name: tags + type: array + required: false + - name: condition_id + type: string + description: Condition ID + required: false + - name: active + type: boolean + description: Whether the market is active + required: false + - name: clob_token_ids + type: array + description: CLOB token IDs for the market + required: false + - name: sports_market_type + type: string + description: Sports market type such as spread or moneyline + required: false + - name: line + type: string + description: Betting line value, or an empty string when not applicable + required: false + - name: game_start_time + type: string + description: >- + Game start time in RFC3339 format, or an empty string when not + applicable + required: false + - name: order_price_min_tick_size + type: string + description: Minimum tick size for order prices + required: false + - name: group_item_title + type: string + description: Display title for the group item + required: false + headers: [] + jsonPayloadSchema: + type: object + description: New market creation event — requires custom_feature_enabled + required: + - event_type + - id + - question + - market + - slug + - assets_ids + - outcomes + - timestamp + properties: + event_type: + type: string + const: new_market + x-parser-schema-id: + id: + type: string + description: Market ID + x-parser-schema-id: + question: + type: string + x-parser-schema-id: + market: + type: string + description: Condition ID + x-parser-schema-id: + slug: + type: string + x-parser-schema-id: + description: + type: string + x-parser-schema-id: + assets_ids: + type: array + items: + type: string + x-parser-schema-id: + x-parser-schema-id: + outcomes: + type: array + items: + type: string + x-parser-schema-id: + x-parser-schema-id: + event_message: &ref_2 + type: object + description: Parent event metadata for grouped markets + properties: + id: + type: string + x-parser-schema-id: + ticker: + type: string + x-parser-schema-id: + slug: + type: string + x-parser-schema-id: + title: + type: string + x-parser-schema-id: + description: + type: string + x-parser-schema-id: + x-parser-schema-id: EventMessage + timestamp: + type: string + x-parser-schema-id: + tags: + type: array + items: + type: string + x-parser-schema-id: + x-parser-schema-id: + condition_id: + type: string + description: Condition ID + x-parser-schema-id: + active: + type: boolean + description: Whether the market is active + x-parser-schema-id: + clob_token_ids: + type: array + description: CLOB token IDs for the market + items: + type: string + x-parser-schema-id: + x-parser-schema-id: + sports_market_type: + type: string + description: Sports market type such as spread or moneyline + x-parser-schema-id: + line: + type: string + description: Betting line value, or an empty string when not applicable + x-parser-schema-id: + game_start_time: + type: string + description: >- + Game start time in RFC3339 format, or an empty string when not + applicable + x-parser-schema-id: + order_price_min_tick_size: + type: string + description: Minimum tick size for order prices + x-parser-schema-id: + group_item_title: + type: string + description: Display title for the group item + x-parser-schema-id: + x-parser-schema-id: NewMarketEvent + title: New Market + description: 'New market creation event — requires custom_feature_enabled: true' + example: |- + { + "event_type": "new_market", + "id": "1031769", + "question": "Will NVIDIA (NVDA) close above $240 end of January?", + "market": "0x311d0c4b6671ab54af4970c06fcf58662516f5168997bdda209ec3db5aa6b0c1", + "slug": "nvda-above-240-on-january-30-2026", + "description": "This market will resolve to \"Yes\" if the official closing price for NVIDIA (NVDA) on the final trading day of January 2026 is higher than the listed price. Otherwise, this market will resolve to \"No\".", + "assets_ids": [ + "76043073756653678226373981964075571318267289248134717369284518995922789326425", + "31690934263385727664202099278545688007799199447969475608906331829650099442770" + ], + "outcomes": [ + "Yes", + "No" + ], + "event_message": { + "id": "125819", + "ticker": "nvda-above-in-january-2026", + "slug": "nvda-above-in-january-2026", + "title": "Will NVIDIA (NVDA) close above ___ end of January?", + "description": "This market will resolve to \"Yes\" if the official closing price for NVIDIA (NVDA) on the final trading day of January 2026 is higher than the listed price. Otherwise, this market will resolve to \"No\"." + }, + "timestamp": "1766790415550", + "tags": [ + "stocks" + ], + "condition_id": "0x311d0c4b6671ab54af4970c06fcf58662516f5168997bdda209ec3db5aa6b0c1", + "active": true, + "clob_token_ids": [ + "76043073756653678226373981964075571318267289248134717369284518995922789326425", + "31690934263385727664202099278545688007799199447969475608906331829650099442770" + ], + "sports_market_type": "", + "line": "", + "game_start_time": "", + "order_price_min_tick_size": "0.01", + "group_item_title": "NVDA above $240" + } + bindings: [] + extensions: + - id: x-parser-unique-object-id + value: newMarket + bindings: [] + extensions: *ref_0 + - &ref_13 + id: receiveMarketResolved + title: Market Resolved + description: 'Market resolution event (requires custom_feature_enabled: true)' + type: send + messages: + - &ref_24 + id: marketResolved + contentType: application/json + payload: + - name: Market Resolved + description: 'Market resolution event — requires custom_feature_enabled: true' + type: object + properties: + - name: event_type + type: string + description: market_resolved + required: true + - name: id + type: string + required: true + - name: market + type: string + description: Condition ID + required: true + - name: assets_ids + type: array + required: true + - name: winning_asset_id + type: string + required: true + - name: winning_outcome + type: string + required: true + - name: event_message + type: object + description: Parent event metadata for grouped markets + required: false + properties: + - name: id + type: string + required: false + - name: ticker + type: string + required: false + - name: slug + type: string + required: false + - name: title + type: string + required: false + - name: description + type: string + required: false + - name: timestamp + type: string + required: true + - name: tags + type: array + required: false + headers: [] + jsonPayloadSchema: + type: object + description: Market resolution event — requires custom_feature_enabled + required: + - event_type + - id + - market + - assets_ids + - winning_asset_id + - winning_outcome + - timestamp + properties: + event_type: + type: string + const: market_resolved + x-parser-schema-id: + id: + type: string + x-parser-schema-id: + market: + type: string + description: Condition ID + x-parser-schema-id: + assets_ids: + type: array + items: + type: string + x-parser-schema-id: + x-parser-schema-id: + winning_asset_id: + type: string + x-parser-schema-id: + winning_outcome: + type: string + x-parser-schema-id: + event_message: *ref_2 + timestamp: + type: string + x-parser-schema-id: + tags: + type: array + items: + type: string + x-parser-schema-id: + x-parser-schema-id: + x-parser-schema-id: MarketResolvedEvent + title: Market Resolved + description: 'Market resolution event — requires custom_feature_enabled: true' + example: |- + { + "event_type": "market_resolved", + "id": "1031769", + "market": "0x311d0c4b6671ab54af4970c06fcf58662516f5168997bdda209ec3db5aa6b0c1", + "assets_ids": [ + "76043073756653678226373981964075571318267289248134717369284518995922789326425", + "31690934263385727664202099278545688007799199447969475608906331829650099442770" + ], + "winning_asset_id": "76043073756653678226373981964075571318267289248134717369284518995922789326425", + "winning_outcome": "Yes", + "timestamp": "1766790415550", + "tags": [ + "stocks" + ] + } + bindings: [] + extensions: + - id: x-parser-unique-object-id + value: marketResolved + bindings: [] + extensions: *ref_0 +sendOperations: + - *ref_3 + - *ref_4 + - *ref_5 +receiveOperations: + - *ref_6 + - *ref_7 + - *ref_8 + - *ref_9 + - *ref_10 + - *ref_11 + - *ref_12 + - *ref_13 +sendMessages: + - *ref_14 + - *ref_15 + - *ref_16 +receiveMessages: + - *ref_17 + - *ref_18 + - *ref_19 + - *ref_20 + - *ref_21 + - *ref_22 + - *ref_23 + - *ref_24 +extensions: + - id: x-parser-unique-object-id + value: market +securitySchemes: [] + +```` + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/api-reference/wss/sports.md b/docs/api-reference/wss/sports.md index b3c52b7..8062940 100644 --- a/docs/api-reference/wss/sports.md +++ b/docs/api-reference/wss/sports.md @@ -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: + name: Ping + description: Server heartbeat sent every 5 seconds + headers: [] + jsonPayloadSchema: + type: string + const: ping + x-parser-schema-id: + 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: + name: Pong + description: Client heartbeat response — must be sent within 10 seconds + headers: [] + jsonPayloadSchema: + type: string + const: pong + x-parser-schema-id: + 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: + live: + type: boolean + description: Whether the match is currently in progress + x-parser-schema-id: + ended: + type: boolean + description: Whether the match has ended + x-parser-schema-id: + score: + type: string + description: Current score (e.g., '2-1' for soccer, '14-7' for football) + x-parser-schema-id: + 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: + elapsed: + type: string + description: >- + Elapsed time in the current period in 'MM:SS' format. Empty + string if not applicable. + x-parser-schema-id: + last_update: + type: string + format: date-time + description: ISO 8601 timestamp of the last update + x-parser-schema-id: + finished_timestamp: + type: string + format: date-time + description: >- + ISO 8601 timestamp when the match ended. Only present for ended + matches. + x-parser-schema-id: + turn: + type: string + description: Team abbreviation with ball possession. NFL only. + x-parser-schema-id: + 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). \ No newline at end of file diff --git a/docs/api-reference/wss/user.md b/docs/api-reference/wss/user.md index ace49f8..0c48cfb 100644 --- a/docs/api-reference/wss/user.md +++ b/docs/api-reference/wss/user.md @@ -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: + secret: + type: string + description: CLOB API secret + x-parser-schema-id: + passphrase: + type: string + description: CLOB API passphrase + x-parser-schema-id: + x-parser-schema-id: WebSocketAuth + type: + type: string + const: user + description: Must be 'user' + x-parser-schema-id: + markets: + type: array + description: >- + Optional condition IDs to filter events. If omitted, receives + events for all markets. + items: + type: string + x-parser-schema-id: + x-parser-schema-id: + 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: + markets: + type: array + description: Condition IDs to subscribe to or unsubscribe from + items: + type: string + x-parser-schema-id: + x-parser-schema-id: + 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: + name: Ping + description: Client heartbeat — send every 10 seconds + headers: [] + jsonPayloadSchema: + type: string + const: PING + x-parser-schema-id: + 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: + name: Pong + description: Server heartbeat response + headers: [] + jsonPayloadSchema: + type: string + const: PONG + x-parser-schema-id: + 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: + id: + type: string + description: Order ID (hash) + x-parser-schema-id: + owner: + type: string + description: API key of the order owner + x-parser-schema-id: + market: + type: string + description: Condition ID of the market + x-parser-schema-id: + asset_id: + type: string + description: Asset ID (token ID) + x-parser-schema-id: + side: + type: string + enum: + - BUY + - SELL + x-parser-schema-id: + order_owner: + type: string + x-parser-schema-id: + original_size: + type: string + description: Original order size + x-parser-schema-id: + size_matched: + type: string + description: Amount matched so far + x-parser-schema-id: + price: + type: string + x-parser-schema-id: + associate_trades: + type: array + items: + type: string + x-parser-schema-id: + nullable: true + description: Trade IDs this order has been matched in + x-parser-schema-id: + outcome: + type: string + description: e.g. 'YES', 'NO' + x-parser-schema-id: + type: + type: string + enum: + - PLACEMENT + - UPDATE + - CANCELLATION + x-parser-schema-id: + created_at: + type: string + x-parser-schema-id: + expiration: + type: string + description: For GTD orders + x-parser-schema-id: + order_type: + type: string + enum: + - GTC + - GTD + - FOK + x-parser-schema-id: + status: + type: string + description: e.g. 'LIVE', 'MATCHED', 'CANCELED' + x-parser-schema-id: + maker_address: + type: string + x-parser-schema-id: + timestamp: + type: string + description: Event timestamp in milliseconds + x-parser-schema-id: + 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: + type: + type: string + const: TRADE + x-parser-schema-id: + id: + type: string + description: Trade ID + x-parser-schema-id: + taker_order_id: + type: string + x-parser-schema-id: + market: + type: string + description: Condition ID + x-parser-schema-id: + asset_id: + type: string + x-parser-schema-id: + side: + type: string + enum: + - BUY + - SELL + description: From taker's perspective + x-parser-schema-id: + size: + type: string + x-parser-schema-id: + price: + type: string + x-parser-schema-id: + fee_rate_bps: + type: string + x-parser-schema-id: + status: + type: string + enum: + - MATCHED + - MINED + - CONFIRMED + - RETRYING + - FAILED + x-parser-schema-id: + matchtime: + type: string + x-parser-schema-id: + last_update: + type: string + x-parser-schema-id: + outcome: + type: string + x-parser-schema-id: + owner: + type: string + description: API key of the taker + x-parser-schema-id: + trade_owner: + type: string + x-parser-schema-id: + maker_address: + type: string + x-parser-schema-id: + transaction_hash: + type: string + x-parser-schema-id: + bucket_index: + type: integer + x-parser-schema-id: + 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: + owner: + type: string + x-parser-schema-id: + maker_address: + type: string + x-parser-schema-id: + matched_amount: + type: string + x-parser-schema-id: + price: + type: string + x-parser-schema-id: + fee_rate_bps: + type: string + x-parser-schema-id: + asset_id: + type: string + x-parser-schema-id: + outcome: + type: string + x-parser-schema-id: + side: + type: string + enum: + - BUY + - SELL + x-parser-schema-id: + x-parser-schema-id: TradeMakerOrder + x-parser-schema-id: + trader_side: + type: string + enum: + - TAKER + - MAKER + description: Whether the receiving user was TAKER or MAKER + x-parser-schema-id: + timestamp: + type: string + description: Event timestamp in milliseconds + x-parser-schema-id: + 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). \ No newline at end of file diff --git a/docs/builders/api-keys.md b/docs/builders/api-keys.md index 662c87d..bb0cb51 100644 --- a/docs/builders/api-keys.md +++ b/docs/builders/api-keys.md @@ -98,6 +98,18 @@ Store your credentials as environment variables: ) ``` + + + ```rust theme={null} + use polymarket_client_sdk::auth::Credentials; + + let builder_creds = Credentials::new( + std::env::var("POLY_BUILDER_API_KEY")?.parse()?, + std::env::var("POLY_BUILDER_SECRET")?, + std::env::var("POLY_BUILDER_PASSPHRASE")?, + ); + ``` + ## Security Best Practices @@ -145,3 +157,6 @@ Store your credentials as environment variables: Learn about rate limits and how to upgrade. + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/builders/overview.md b/docs/builders/overview.md index 7a76bba..d310acb 100644 --- a/docs/builders/overview.md +++ b/docs/builders/overview.md @@ -20,17 +20,12 @@ A **builder** is a person, group, or organization that routes orders from users - - Earn a share of fees on orders you route - - ### What You Get | Benefit | Description | | ------------------- | ------------------------------------------------------------------------------- | | **Relayer Access** | Gas-free wallet deployment, approvals, order execution and CTF operations | | **Volume Tracking** | All orders attributed to your builder profile | -| **Weekly Rewards** | USDC rewards program based on volume (Verified+) | | **Leaderboard** | Public visibility on [builders.polymarket.com](https://builders.polymarket.com) | | **Support** | Telegram channel and engineering support (Verified+) | @@ -88,7 +83,7 @@ A **builder** is a person, group, or organization that routes orders from users -## SDKs & Libraries +## SDKs and Libraries @@ -216,3 +211,6 @@ For existing Magic Link users from Polymarket.com: Set up gasless transactions for your users. + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/builders/tiers.md b/docs/builders/tiers.md index c713cff..034a2d9 100644 --- a/docs/builders/tiers.md +++ b/docs/builders/tiers.md @@ -6,53 +6,45 @@ > Rate limits, rewards, and how to upgrade -The Builder Program uses a tiered system to manage rate limits while rewarding high-performing integrations. Higher tiers unlock increased limits, weekly rewards, revenue sharing, and priority support. +The Builder Program uses a tiered system to manage rate limits while rewarding high-performing integrations. Higher tiers unlock increased limits, weekly rewards, and priority support. ## Feature Definitions -| Feature | Description | -| --------------------------- | -------------------------------------------------------------------------- | -| **Daily Relayer Txn Limit** | Maximum Relayer transactions per day for Safe/Proxy wallet operations | -| **API Rate Limits** | Rate limits for non-relayer endpoints (CLOB, Gamma, etc.) | -| **Subsidized Transactions** | Gas fees subsidized for Relayer and CLOB operations via Safe/Proxy wallets | -| **Order Attribution** | Orders tracked and attributed to your Builder profile | -| **RevShare Protocol** | Infrastructure allowing Builders to charge fees | -| **Leaderboard Visibility** | Visibility on the [Builder Leaderboard](https://builders.polymarket.com/) | -| **Weekly Rewards** | Weekly USDC rewards program for visible builders based on volume | -| **Grants** | Builder grants subject to approval, awarded based on innovation and impact | -| **Telegram Channel** | Private Builders channel for announcements and support | -| **Badge** | Verified Builder affiliate badge on your Builder profile | -| **Engineering Support** | Direct access to engineering team | -| **Marketing Support** | Promotion via official Polymarket social accounts | -| **Weekly Reward Boosts** | Multiplier on the weekly USDC rewards program for visible builders | -| **Priority Access** | Early access to new features and products | +| Feature | Description | +| --------------------------- | ------------------------------------------------------------------------- | +| **Daily Relayer Txn Limit** | Maximum Relayer transactions per day for Safe/Proxy wallet operations | +| **API Rate Limits** | Rate limits for non-relayer endpoints (CLOB, Gamma, etc.) | +| **Gasless Trading** | Gas fees subsidized for trading via Safe/Proxy wallets | +| **Order Attribution** | Orders tracked and attributed to your Builder profile | +| **Builder Fees** | Builders who route orders can charge fees and monetize on flow | +| **Leaderboard Visibility** | Visibility on the [Builder Leaderboard](https://builders.polymarket.com/) | +| **Telegram Channel** | Private Builders channel for announcements and support | +| **Engineering Support** | Direct access to engineering team | +| **Marketing Support** | Promotion via official Polymarket social accounts | +| **Priority Access** | Early access to new features and products | *** ## Tier Comparison -| Feature | Unverified | Verified | Partner | -| --------------------------- | :-----------------: | :-----------------: | :-----------------: | -| **Daily Relayer Txn Limit** | 100/day | 3,000/day | Unlimited | -| **API Rate Limits** | Standard | Standard | Highest | -| **Subsidized Transactions** | Yes | Yes | Yes | -| **Order Attribution** | Yes | Yes | Yes | -| **RevShare Protocol** | — | Yes | Yes | -| **Leaderboard Visibility** | — | Yes | Yes | -| **Weekly Rewards** | — | Yes | Yes | -| **Grants** | Subject to approval | Subject to approval | Subject to approval | -| **Telegram Channel** | — | Yes | Yes | -| **Badge** | — | Yes | Yes | -| **Engineering Support** | — | Standard | Elevated | -| **Marketing Support** | — | Standard | Elevated | -| **Weekly Reward Boosts** | — | — | Yes | -| **Priority Access** | — | — | Yes | +| Feature | Unverified | Verified | Partner | +| --------------------------- | :--------: | :-------: | :-------: | +| **Daily Relayer Txn Limit** | 100/day | 3,000/day | Unlimited | +| **API Rate Limits** | Standard | Standard | Highest | +| **Gasless Trading**\* | Yes | Yes | Yes | +| **Order Attribution** | Yes | Yes | Yes | +| **Builder Fees** | Yes | Yes | Yes | +| **Leaderboard Visibility** | — | Yes | Yes | +| **Telegram Channel** | — | Yes | Yes | +| **Engineering Support** | — | Standard | Elevated | +| **Marketing Support** | — | Standard | Elevated | +| **Priority Access** | — | — | Yes | *** ## Unverified - + The default tier for all new builders. Start immediately with no approval required. @@ -68,48 +60,42 @@ The Builder Program uses a tiered system to manage rate limits while rewarding h * Gasless trading on all CLOB orders through Safe/Proxy wallets * Gas subsidized on all Relayer transactions up to daily limit (through Safe/Proxy wallets) -* Order attribution to your builder profile * Access to all client libraries and documentation *** ## Verified - + For builders who need higher throughput. Requires manual approval. **How to upgrade:** -Contact us with: +Contact us at [builder@polymarket.com](mailto:builder@polymarket.com) with: * Your Builder API Key * Use case description * Expected volume -* Links to your app, docs, or X profile +* Other relevant information (links, docs, decks, etc.) **Unlocks over Unverified:** * 30x daily Relayer transaction limit -* RevShare Protocol access +* Monetize with Builder fees * Leaderboard visibility at [builders.polymarket.com](https://builders.polymarket.com) -* Weekly USDC rewards based on volume * Private Telegram channel for announcements and support -* Verified affiliate badge and promotion from [@PolymarketBuild](https://x.com/PolymarketBuild) +* Weekly USDC rewards based on volume (subject to approval) * Grants (subject to approval) *** ## Partner - + Enterprise tier for high-volume integrations and strategic partners. -**How to apply:** - -Reach out to [builder@polymarket.com](mailto:builder@polymarket.com) to discuss partnership opportunities. - **Unlocks over Verified:** * Unlimited Relayer transactions @@ -117,7 +103,6 @@ Reach out to [builder@polymarket.com](mailto:builder@polymarket.com) to discuss * Elevated engineering support * Elevated and coordinated marketing support * Priority access to new features and products -* Multiplier on the Weekly Rewards Program *** @@ -154,18 +139,19 @@ Ready to upgrade or have questions? ## FAQ - + Verification is displayed in your [Builder Profile](https://polymarket.com/settings?tab=builder) settings. - + Relayer requests beyond your daily limit will be rate-limited and return an error. Consider upgrading to Verified or Partner tier if you're hitting limits. - - For special events or product launches, contact [builder@polymarket.com](mailto:builder@polymarket.com). + + If you're not routing orders for other users (wallets), you can get unlimited + daily Relay transactions by obtaining a [Relayer API key](https://polymarket.com/settings?tab=api-keys). @@ -182,3 +168,6 @@ Ready to upgrade or have questions? Configure your client to credit trades to your account. + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/changelog/changelog.md b/docs/changelog/changelog.md index ba67204..91e5655 100644 --- a/docs/changelog/changelog.md +++ b/docs/changelog/changelog.md @@ -99,7 +99,7 @@ - * We're adding new fields to the `get-book` and `get-books` CLOB endpoints to include key market metadata that previously required separate queries. + * We’re adding new fields to the `get-book` and `get-books` CLOB endpoints to include key market metadata that previously required separate queries. * `min_order_size` * type: string * description: Minimum price increment. @@ -112,7 +112,7 @@ - * We're excited to roll out a highly requested feature: **order batching**. With this new endpoint, users can now submit up to five trades in a single request. To help you get started, we've included sample code demonstrating how to use it. Please see [Create Orders](/trading/orders/create) for more details. + * We’re excited to roll out a highly requested feature: **order batching**. With this new endpoint, users can now submit up to five trades in a single request. To help you get started, we’ve included sample code demonstrating how to use it. Please see [Create Orders](/trading/orders/create) for more details. @@ -127,7 +127,7 @@ - We're excited to introduce a new order type soon to be available to all users: Fill and Kill (FAK). FAK orders behave similarly to the well-known Fill or Kill (FOK) orders, but with a key difference: + We’re excited to introduce a new order type soon to be available to all users: Fill and Kill (FAK). FAK orders behave similarly to the well-known Fill or Kill (FOK) orders, but with a key difference: * FAK will fill as many shares as possible immediately at your specified price, and any remaining unfilled portion will be canceled. * Unlike FOK, which requires the entire order to fill instantly or be canceled, FAK is more flexible and aims to capture partial fills if possible. @@ -141,5 +141,10 @@ * CLOB - /price (100req - 10s / Throttle requests over the maximum configured rate) * CLOB markets/0x (50req / 10s - Throttle requests over the maximum configured rate) * CLOB POST /order - 500 every 10s (50/s) - (BURST) - Throttle requests over the maximum configured rate - * CLOB POST /order - 3000 every 10 minutes (5/s) + * CLOB POST /order - 3000 every 10 minutes (5/s) - Throttle requests over the maximum configured rate + * CLOB DELETE /order - 500 every 10s (50/s) - (BURST) - Throttle requests over the maximum configured rate + * DELETE /order - 3000 every 10 minutes (5/s) - Throttle requests over the maximum configured rate + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/concepts/markets-events.md b/docs/concepts/markets-events.md index 1a2fedd..8ff4072 100644 --- a/docs/concepts/markets-events.md +++ b/docs/concepts/markets-events.md @@ -9,9 +9,9 @@ Every prediction on Polymarket is structured around two core concepts: **markets** and **events**. Understanding how they relate is essential for building on the platform. - + - + ## Markets @@ -19,9 +19,9 @@ Every prediction on Polymarket is structured around two core concepts: **markets A **market** is the fundamental tradable unit on Polymarket. Each market represents a single binary question with Yes/No outcomes. - + - + Every market has: @@ -106,3 +106,6 @@ Specifically for sports markets, outstanding limit orders are **automatically ca Start querying markets and events from the API. + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/concepts/order-lifecycle.md b/docs/concepts/order-lifecycle.md index d918391..8292e0b 100644 --- a/docs/concepts/order-lifecycle.md +++ b/docs/concepts/order-lifecycle.md @@ -9,9 +9,9 @@ Every trade on Polymarket follows a specific lifecycle. Orders are created offchain, matched by an operator, and settled onchain through smart contracts. This hybrid approach combines the speed of centralized matching with the security of blockchain settlement. - + - + ## How Orders Work @@ -39,7 +39,7 @@ Orders are **EIP712-signed messages**. When you place an order, you sign a struc Post-only orders will only rest on the book. If a post-only order would match immediately (cross the spread), it's rejected instead of executed. This guarantees you're always the maker, never the taker. - + Your client creates an order object containing: * Token ID (which outcome you're trading) @@ -155,3 +155,6 @@ Before placing orders, ensure: Start placing orders with our step-by-step guide. + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/concepts/positions-tokens.md b/docs/concepts/positions-tokens.md index 3183d8d..72ec24a 100644 --- a/docs/concepts/positions-tokens.md +++ b/docs/concepts/positions-tokens.md @@ -9,9 +9,9 @@ Every prediction on Polymarket is represented by **outcome tokens**. When you trade, you're buying and selling these tokens. Your **position** is simply your balance of tokens for a given market. - + - + ## Outcome Tokens @@ -92,11 +92,11 @@ If you hold 100 Yes tokens and Yes is trading at \$0.75: Position value = 100 × $0.75 = $75 ``` -## Profit & Loss +## Profit and Loss Your profit depends on how the market resolves compared to your entry price. -### Example: Buying Yes at \$0.40 +### Example - Buying Yes at 0.40 | Scenario | Outcome | Return | Profit | | ------------------- | -------- | ------ | ------------------------- | @@ -107,10 +107,13 @@ Your profit depends on how the market resolves compared to your entry price. Polymarket pays a **4.00% annualized** Holding Reward based on your total position value in eligible markets. Your total position value is randomly sampled once each hour, and the reward is distributed daily. The rate is variable and subject to change at Polymarket's discretion. -### Example: Selling before resolution +### Example - Selling Before Resolution You can lock in profits or cut losses by selling before the market resolves: * Bought Yes at `$0.40` * Price rises to `$0.70` * Sell at `$0.70` → Profit of `$0.30` per token (75%) + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/concepts/prices-orderbook.md b/docs/concepts/prices-orderbook.md index 059ccd0..f073457 100644 --- a/docs/concepts/prices-orderbook.md +++ b/docs/concepts/prices-orderbook.md @@ -9,12 +9,12 @@ Polymarket uses a **Central Limit Order Book (CLOB)** for trading. Prices aren't set by Polymarket—they emerge from supply and demand as users trade with each other. - + - + -## Prices = Probabilities +## Prices Are Probabilities Every share on Polymarket is priced between `$0.00` and `$1.00`. The price directly represents the market's belief in the probability of that outcome. @@ -80,9 +80,9 @@ Polymarket's CLOB is **hybrid-decentralized**: 2. **Onchain settlement** — Matched trades settle via smart contracts - + - + This design gives you the speed of centralized matching with the security of onchain settlement. You always maintain custody of your funds. @@ -114,3 +114,6 @@ When matched, `$1.00` is converted into 1 Yes token and 1 No token, each going t Understand what happens from order placement to settlement. + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/concepts/resolution.md b/docs/concepts/resolution.md index 3fef454..8a55bb5 100644 --- a/docs/concepts/resolution.md +++ b/docs/concepts/resolution.md @@ -11,9 +11,9 @@ When the outcome of an event becomes known, the market is **resolved**. Resoluti Polymarket uses the **UMA Optimistic Oracle** for decentralized, permissionless resolution. Anyone can propose an outcome, and anyone can dispute it if they believe it's incorrect. - + - + ## Resolution Rules @@ -58,7 +58,7 @@ Every market has pre-defined resolution rules that specify: 3. **Two disputes** — Propose, Challenge, second Propose, second Challenge, Resolve via DVM vote - + To dispute a proposal: 1. Post a counter-bond (same amount as proposer, typically \$750) @@ -149,3 +149,6 @@ Clarifications: Understand how markets are structured. + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/developers/CLOB/authentication.md b/docs/developers/CLOB/authentication.md index 80dd436..b69edef 100644 --- a/docs/developers/CLOB/authentication.md +++ b/docs/developers/CLOB/authentication.md @@ -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 @@ -105,6 +105,29 @@ Before making authenticated requests, you need to obtain API credentials using L # } ``` + + + ```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()); + ``` + @@ -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 @@ -274,6 +297,30 @@ The `POLY_SIGNATURE` for L2 is an HMAC-SHA256 signature created using the user's ) ``` + + + ```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?; + ``` + @@ -324,7 +371,7 @@ When initializing the L2 client, you must specify your wallet **signatureType** ## Troubleshooting - + 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 - + 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()` - + 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. + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/developers/CLOB/clients/methods-builder.md b/docs/developers/CLOB/clients/methods-builder.md index 85a209a..7cbe261 100644 --- a/docs/developers/CLOB/clients/methods-builder.md +++ b/docs/developers/CLOB/clients/methods-builder.md @@ -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 +``` + + + When a `BuilderConfig` is present, the client automatically sends builder headers. If builder auth is unavailable, it falls back to standard L2 headers. + + + + ```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) + ``` + + +*** + +### 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 +``` + +**Params** + + + Optional. Filter by order ID. + + + + Optional. Filter by market condition ID. + + + + Optional. Filter by token ID. + + +```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 Execute onchain operations without paying gas. + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/developers/CLOB/clients/methods-l1.md b/docs/developers/CLOB/clients/methods-l1.md index 3b3a6a8..71c3b6a 100644 --- a/docs/developers/CLOB/clients/methods-l1.md +++ b/docs/developers/CLOB/clients/methods-l1.md @@ -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 *** -### 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 *** -### 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 ## 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 - + Your wallet's private key is incorrect or improperly formatted. **Solution:** @@ -349,7 +349,7 @@ async createMarketOrder( * Check that the key has proper permissions - + 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()` - + 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. + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/developers/CLOB/clients/methods-l2.md b/docs/developers/CLOB/clients/methods-l2.md index fddb21a..0ed86a1 100644 --- a/docs/developers/CLOB/clients/methods-l2.md +++ b/docs/developers/CLOB/clients/methods-l2.md @@ -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 *** -### cancelOrders() +### cancelOrders Cancels multiple orders in a single batch. @@ -305,7 +305,7 @@ async cancelOrders(orderIDs: string[]): Promise *** -### cancelAll() +### cancelAll Cancels all open orders. @@ -315,7 +315,7 @@ async cancelAll(): Promise *** -### 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 *** -### 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 *** -### deleteApiKey() +### deleteApiKey Deletes (revokes) the currently authenticated API key. @@ -697,7 +697,7 @@ async deleteApiKey(): Promise *** -### getNotifications() +### getNotifications Retrieves all event notifications for the authenticated user. Records are automatically removed after 48 hours. @@ -735,7 +735,7 @@ async getNotifications(): Promise *** -### dropNotifications() +### dropNotifications Mark notifications as read/dismissed. @@ -770,3 +770,6 @@ async dropNotifications(params?: DropNotificationParams): Promise Real-time market data streaming. + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/developers/CLOB/clients/methods-overview.md b/docs/developers/CLOB/clients/methods-overview.md index a5fdb47..dd4d30e 100644 --- a/docs/developers/CLOB/clients/methods-overview.md +++ b/docs/developers/CLOB/clients/methods-overview.md @@ -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?; + ``` ## Source Code @@ -95,3 +106,6 @@ For [gasless transactions](/trading/gasless) using proxy wallets, the relayer cl Understand L1/L2 auth and API credentials. + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/developers/CLOB/clients/methods-public.md b/docs/developers/CLOB/clients/methods-public.md index 5e85742..2a099d8 100644 --- a/docs/developers/CLOB/clients/methods-public.md +++ b/docs/developers/CLOB/clients/methods-public.md @@ -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 *** -### getMarket() +### getMarket Get details for a single market by condition ID. @@ -186,7 +186,7 @@ async getMarket(conditionId: string): Promise *** -### getMarkets() +### getMarkets Get details for multiple markets paginated. @@ -208,7 +208,7 @@ async getMarkets(): Promise *** -### getSimplifiedMarkets() +### getSimplifiedMarkets Get simplified market data paginated for faster loading. @@ -230,7 +230,7 @@ async getSimplifiedMarkets(): Promise *** -### getSamplingMarkets() +### getSamplingMarkets Get markets eligible for sampling/liquidity rewards. @@ -240,7 +240,7 @@ async getSamplingMarkets(): Promise *** -### getSamplingSimplifiedMarkets() +### getSamplingSimplifiedMarkets Get simplified market data for markets eligible for sampling/liquidity rewards. @@ -254,7 +254,7 @@ async getSamplingSimplifiedMarkets(): Promise *** -### 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 *** -### getOrderBooks() +### getOrderBooks Get order books for multiple token IDs. @@ -357,7 +357,7 @@ async getOrderBooks(params: BookParams[]): Promise *** -### 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 *** -### 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 *** -### getMidpoints() +### getMidpoints Get the midpoint prices for multiple token IDs. @@ -416,7 +416,7 @@ async getMidpoints(params: BookParams[]): Promise *** -### 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 *** -### getSpreads() +### getSpreads Get the spreads for multiple token IDs. @@ -444,7 +444,7 @@ async getSpreads(params: BookParams[]): Promise *** -### getPricesHistory() +### getPricesHistory Get historical price data for a token. @@ -486,7 +486,7 @@ async getPricesHistory(params: PriceHistoryFilterParams): Promise *** -### getLastTradePrice() +### getLastTradePrice Get the price of the most recent trade for a token. @@ -504,7 +504,7 @@ async getLastTradePrice(tokenID: string): Promise *** -### getLastTradesPrices() +### getLastTradesPrices Get the most recent trade prices for multiple tokens. @@ -526,7 +526,7 @@ async getLastTradesPrices(params: BookParams[]): Promise *** -### getFeeRateBps() +### getFeeRateBps Get the fee rate in basis points for a token. @@ -598,7 +598,7 @@ async getFeeRateBps(tokenID: string): Promise *** -### getTickSize() +### getTickSize Get the tick size (minimum price increment) for a market. @@ -612,7 +612,7 @@ async getTickSize(tokenID: string): Promise *** -### getNegRisk() +### getNegRisk Check if a market uses negative risk (binary complementary tokens). @@ -626,9 +626,9 @@ async getNegRisk(tokenID: string): Promise *** -## Time & Server Info +## Time and Server Info -### getServerTime() +### getServerTime Get the current server timestamp. @@ -661,3 +661,6 @@ async getServerTime(): Promise Real-time market data streaming. + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/developers/CLOB/geoblock.md b/docs/developers/CLOB/geoblock.md index 24690aa..3519bb7 100644 --- a/docs/developers/CLOB/geoblock.md +++ b/docs/developers/CLOB/geoblock.md @@ -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") ``` + + + ```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"); + } + ``` + *** -## 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). + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/developers/CLOB/introduction.md b/docs/developers/CLOB/introduction.md index fa09274..af662a5 100644 --- a/docs/developers/CLOB/introduction.md +++ b/docs/developers/CLOB/introduction.md @@ -10,7 +10,7 @@ Polymarket's CLOB (Central Limit Order Book) is a hybrid-decentralized trading s We recommend using the open-source SDK clients, which handle order signing, authentication, and submission: - +

npm install @polymarket/clob-client @@ -20,6 +20,10 @@ We recommend using the open-source SDK clients, which handle order signing, auth

pip install py-clob-client

+ + +

cargo add polymarket-client-sdk

+
@@ -66,6 +70,23 @@ You use your private key once to derive **L2 credentials** (API key, secret, pas temp_client = ClobClient("https://clob.polymarket.com", key=private_key, chain_id=137) api_creds = temp_client.create_or_derive_api_creds() ``` + + ```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)); + + // Derive L2 API credentials and initialize client in one step + let client = Client::new("https://clob.polymarket.com", Config::default())? + .authentication_builder(&signer) + .authenticate() + .await?; + ``` *** @@ -110,6 +131,16 @@ When initializing the trading client, you must specify your wallet's **signature funder="0x..." # Your proxy wallet address ) ``` + + ```rust Rust theme={null} + use polymarket_client_sdk::clob::types::SignatureType; + + let client = Client::new("https://clob.polymarket.com", Config::default())? + .authentication_builder(&signer) + .signature_type(SignatureType::GnosisSafe) // Funder auto-derived via CREATE2 + .authenticate() + .await?; + ``` *** @@ -167,7 +198,7 @@ If you're using the REST API directly (without the SDK), you need to attach auth *** -## What's in This Section +## What Is in This Section @@ -198,3 +229,6 @@ If you're using the REST API directly (without the SDK), you need to attach auth Deposit and withdraw funds across chains + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/developers/CLOB/orders/cancel-orders.md b/docs/developers/CLOB/orders/cancel-orders.md index c712a57..cd26b4f 100644 --- a/docs/developers/CLOB/orders/cancel-orders.md +++ b/docs/developers/CLOB/orders/cancel-orders.md @@ -25,6 +25,12 @@ All cancel endpoints require [L2 authentication](/trading/overview#authenticatio # {"canceled": ["0xb816482a..."], "not_canceled": {}} ``` + ```rust Rust theme={null} + let resp = client.cancel_order("0xb816482a...").await?; + println!("{:?}", resp); + // CancelOrdersResponse { canceled: ["0xb816482a..."], not_canceled: {} } + ``` + ```bash REST theme={null} curl -X DELETE "https://clob.polymarket.com/order" \ -H "Content-Type: application/json" \ @@ -53,6 +59,10 @@ All cancel endpoints require [L2 authentication](/trading/overview#authenticatio ]) ``` + ```rust Rust theme={null} + let resp = client.cancel_orders(&["0xb816482a...", "0xc927593b..."]).await?; + ``` + ```bash REST theme={null} curl -X DELETE "https://clob.polymarket.com/orders" \ -H "Content-Type: application/json" \ @@ -80,6 +90,10 @@ Cancel every open order across all markets: resp = client.cancel_all() ``` + ```rust Rust theme={null} + let resp = client.cancel_all_orders().await?; + ``` + ```bash REST theme={null} curl -X DELETE "https://clob.polymarket.com/cancel-all" \ -H "POLY_ADDRESS: ..." \ @@ -111,6 +125,16 @@ Cancel all orders for a specific market, optionally filtered to a single token. ) ``` + ```rust Rust theme={null} + use polymarket_client_sdk::clob::types::request::CancelMarketOrderRequest; + + let request = CancelMarketOrderRequest::builder() + .market("0xbd31dc8a...".parse()?) + .asset_id("52114319501245...".parse()?) + .build(); + let resp = client.cancel_market_orders(&request).await?; + ``` + ```bash REST theme={null} curl -X DELETE "https://clob.polymarket.com/cancel-market-orders" \ -H "Content-Type: application/json" \ @@ -149,6 +173,11 @@ This is a fallback mechanism — API cancellation is instant while onchain cance order = client.get_order("0xb816482a...") print(order["status"], order["size_matched"]) ``` + + ```rust Rust theme={null} + let order = client.order("0xb816482a...").await?; + println!("{:?} {}", order.status, order.size_matched); + ``` ### Get Open Orders @@ -182,6 +211,19 @@ Retrieve all open orders, optionally filtered by market or token: OpenOrderParams(market="0xbd31dc8a...") ) ``` + + ```rust Rust theme={null} + use polymarket_client_sdk::clob::types::request::OrdersRequest; + + // All open orders + let orders = client.orders(&OrdersRequest::default(), None).await?; + + // Filtered by market + let request = OrdersRequest::builder() + .market("0xbd31dc8a...".parse()?) + .build(); + let market_orders = client.orders(&request, None).await?; + ``` ### OpenOrder Object @@ -238,11 +280,24 @@ When an order is matched, it creates a trade. Trades progress through these stat TradeParams(market="0xbd31dc8a...") ) ``` + + ```rust Rust theme={null} + use polymarket_client_sdk::clob::types::request::TradesRequest; + + // All trades + let trades = client.trades(&TradesRequest::default(), None).await?; + + // Filtered by market + let request = TradesRequest::builder() + .market("0xbd31dc8a...".parse()?) + .build(); + let market_trades = client.trades(&request, None).await?; + ``` Additional filter parameters: `id`, `maker_address`, `asset_id`, `before`, `after`. -For large result sets, use the paginated variant: +The Rust SDK uses cursor-based pagination via the `next_cursor` parameter: ```typescript TypeScript theme={null} @@ -253,6 +308,15 @@ For large result sets, use the paginated variant: ```python Python theme={null} page = client.get_trades_paginated(TradeParams(market="0xbd31dc8a...")) ``` + + ```rust Rust theme={null} + // First page + let page = client.trades(&request, None).await?; + println!("{} trades, cursor: {}", page.data.len(), page.next_cursor); + + // Next page + let page2 = client.trades(&request, Some(page.next_cursor)).await?; + ``` ### Trade Object @@ -312,6 +376,14 @@ Check if your resting orders are eligible for [maker rebates](/market-makers/mak OrdersScoringParams(orderIds=["0x...", "0x..."]) ) ``` + + ```rust Rust theme={null} + // Single order + let scoring = client.is_order_scoring("0x...").await?; + + // Multiple orders + let batch = client.are_orders_scoring(&["0x...", "0x..."]).await?; + ``` *** @@ -327,3 +399,6 @@ Check if your resting orders are eligible for [maker rebates](/market-makers/mak Understand fee structures and maker rebates
+ + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/developers/CLOB/orders/check-scoring.md b/docs/developers/CLOB/orders/check-scoring.md index 19a87c4..5aacbe6 100644 --- a/docs/developers/CLOB/orders/check-scoring.md +++ b/docs/developers/CLOB/orders/check-scoring.md @@ -71,6 +71,11 @@ Retrieve the tick size for a market using the SDK: tick_size = client.get_tick_size(token_id) # Returns: "0.1" | "0.01" | "0.001" | "0.0001" ``` + + ```rust Rust theme={null} + let resp = client.tick_size(token_id).await?; + // resp.minimum_tick_size: TickSize::Tenth | Hundredth | Thousandth | TenThousandth + ``` @@ -114,6 +119,21 @@ Multi-outcome events (e.g., "Who will win the election?" with 3+ candidates) use } ) ``` + + ```rust Rust theme={null} + // The Rust SDK auto-detects neg risk from the token ID — no flag needed. + // The order builder fetches neg_risk and uses the correct exchange contract. + let order = client + .limit_order() + .token_id("TOKEN_ID".parse()?) + .price(dec!(0.50)) + .size(dec!(10)) + .side(Side::Buy) + .build() + .await?; + let signed = client.sign(&signer, order).await?; + let response = client.post_order(signed).await?; + ``` You can check whether a market uses negative risk via the SDK or the market object's `neg_risk` field: @@ -126,6 +146,10 @@ You can check whether a market uses negative risk via the SDK or the market obje ```python Python theme={null} is_neg_risk = client.get_neg_risk(token_id) ``` + + ```rust Rust theme={null} + let is_neg_risk = client.neg_risk(token_id).await?; + ``` *** @@ -165,7 +189,7 @@ $$ ## Querying Orders -All query endpoints require [L2 authentication](/api-reference/authentication). +All query endpoints require [L2 authentication](/api-reference/authentication). [Builder-authenticated](/trading/clients/builder) clients can also query orders attributed to their builder account using the same methods. ### Get a Single Order @@ -181,6 +205,11 @@ Retrieve details for a specific order by its ID: order = client.get_order("0xb816482a...") print(order) ``` + + ```rust Rust theme={null} + let order = client.order("0xb816482a...").await?; + println!("{order:?}"); + ``` ### Get Open Orders @@ -216,6 +245,25 @@ Retrieve your open orders, optionally filtered by market or asset: ) ) ``` + + ```rust Rust theme={null} + use polymarket_client_sdk::clob::types::request::OrdersRequest; + + // All open orders + let orders = client.orders(&OrdersRequest::default(), None).await?; + + // Filtered by market + let request = OrdersRequest::builder() + .market("0xbd31dc8a...".parse()?) + .build(); + let market_orders = client.orders(&request, None).await?; + + // Filtered by asset + let request = OrdersRequest::builder() + .asset_id("52114319501245...".parse()?) + .build(); + let asset_orders = client.orders(&request, None).await?; + ``` ### OpenOrder Object @@ -325,6 +373,19 @@ Retrieve your trades with the SDK: ) ) ``` + + ```rust Rust theme={null} + use polymarket_client_sdk::clob::types::request::TradesRequest; + + // All trades + let trades = client.trades(&TradesRequest::default(), None).await?; + + // Filtered by market + let request = TradesRequest::builder() + .market("0xbd31dc8a...".parse()?) + .build(); + let market_trades = client.trades(&request, None).await?; + ``` *** @@ -352,6 +413,15 @@ The heartbeat endpoint maintains session liveness for order safety. If a valid h heartbeat_id = resp["heartbeat_id"] time.sleep(5) ``` + + ```rust Rust theme={null} + // With the `heartbeats` feature, auto-send in background: + Client::start_heartbeats(&mut client)?; + + // Or manually: + let resp = client.post_heartbeat(None).await?; // None for first call + let resp = client.post_heartbeat(Some(resp.heartbeat_id)).await?; + ``` * On each request, include the most recent `heartbeat_id` you received. For your first request, use an empty string. @@ -388,6 +458,15 @@ Check if your resting orders are eligible for [maker rebates](/market-makers/mak OrdersScoringParams(orderIds=["0x...", "0x..."]) ) ``` + + ```rust Rust theme={null} + // Single order + let scoring = client.is_order_scoring("0x...").await?; + println!("Scoring: {}", scoring.scoring); + + // Multiple orders + let batch = client.are_orders_scoring(&["0x...", "0x..."]).await?; + ``` *** @@ -461,3 +540,6 @@ The operator's privileges are limited to order matching and ensuring correct ord Cancel single, multiple, or all orders + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/developers/CLOB/orders/create-order-batch.md b/docs/developers/CLOB/orders/create-order-batch.md index 20d80ad..8373dbd 100644 --- a/docs/developers/CLOB/orders/create-order-batch.md +++ b/docs/developers/CLOB/orders/create-order-batch.md @@ -80,9 +80,29 @@ The simplest way to place a limit order — create, sign, and submit in one call print("Order ID:", response["orderID"]) print("Status:", response["status"]) ``` + + ```rust Rust theme={null} + use polymarket_client_sdk::clob::types::Side; + use polymarket_client_sdk::types::dec; + + let token_id = "TOKEN_ID".parse()?; + let order = client + .limit_order() + .token_id(token_id) + .price(dec!(0.50)) + .size(dec!(10)) + .side(Side::Buy) + .build() + .await?; + let signed = client.sign(&signer, order).await?; + let response = client.post_order(signed).await?; + + println!("Order ID: {}", response.order_id); + println!("Status: {:?}", response.status); + ``` -### Two-Step: Sign Then Submit +### Two-Step Sign Then Submit For more control, you can separate signing from submission. This is useful for batch orders or custom submission logic: @@ -121,11 +141,27 @@ For more control, you can separate signing from submission. This is useful for b # Step 2: Submit to the CLOB response = client.post_order(signed_order, OrderType.GTC) ``` + + ```rust Rust theme={null} + // Step 1: Create order (auto-fetches tick size, neg risk, fee rate) + let order = client + .limit_order() + .token_id("TOKEN_ID".parse()?) + .price(dec!(0.50)) + .size(dec!(10)) + .side(Side::Buy) + .build() + .await?; + + // Step 2: Sign and submit separately + let signed = client.sign(&signer, order).await?; + let response = client.post_order(signed).await?; + ``` *** -## GTD Orders (Expiring) +## GTD Orders GTD orders auto-expire at a specified time. Useful for quoting around known events. @@ -168,6 +204,24 @@ GTD orders auto-expire at a specified time. Useful for quoting around known even order_type=OrderType.GTD ) ``` + + ```rust Rust theme={null} + use chrono::{TimeDelta, Utc}; + use polymarket_client_sdk::clob::types::OrderType; + + let order = client + .limit_order() + .token_id("TOKEN_ID".parse()?) + .price(dec!(0.50)) + .size(dec!(10)) + .side(Side::Buy) + .order_type(OrderType::GTD) + .expiration(Utc::now() + TimeDelta::hours(1)) + .build() + .await?; + let signed = client.sign(&signer, order).await?; + let response = client.post_order(signed).await?; + ``` @@ -235,6 +289,38 @@ Market orders execute immediately against resting liquidity using FOK or FAK typ ) client.post_order(sell_order, OrderType.FOK) ``` + + ```rust Rust theme={null} + use polymarket_client_sdk::clob::types::{Amount, OrderType, Side}; + + let token_id = "TOKEN_ID".parse()?; + + // FOK BUY: spend exactly $100 or cancel entirely + let buy = client + .market_order() + .token_id(token_id) + .amount(Amount::usdc(dec!(100))?) + .price(dec!(0.50)) // worst-price limit (slippage protection) + .side(Side::Buy) + .order_type(OrderType::FOK) + .build() + .await?; + let signed = client.sign(&signer, buy).await?; + client.post_order(signed).await?; + + // FOK SELL: sell exactly 200 shares or cancel entirely + let sell = client + .market_order() + .token_id(token_id) + .amount(Amount::shares(dec!(200))?) + .price(dec!(0.45)) // worst-price limit (slippage protection) + .side(Side::Sell) + .order_type(OrderType::FOK) + .build() + .await?; + let signed = client.sign(&signer, sell).await?; + client.post_order(signed).await?; + ``` * **FOK** — fill entirely or cancel the whole order @@ -270,6 +356,20 @@ For convenience, `createAndPostMarketOrder` handles creation, signing, and submi order_type=OrderType.FOK, ) ``` + + ```rust Rust theme={null} + let order = client + .market_order() + .token_id("TOKEN_ID".parse()?) + .amount(Amount::usdc(dec!(100))?) + .price(dec!(0.50)) + .side(Side::Buy) + .order_type(OrderType::FOK) + .build() + .await?; + let signed = client.sign(&signer, order).await?; + let response = client.post_order(signed).await?; + ``` *** @@ -286,6 +386,20 @@ Post-only orders guarantee you're always the maker. If the order would match imm ```python Python theme={null} response = client.post_order(signed_order, OrderType.GTC, post_only=True) ``` + + ```rust Rust theme={null} + let order = client + .limit_order() + .token_id("TOKEN_ID".parse()?) + .price(dec!(0.50)) + .size(dec!(10)) + .side(Side::Buy) + .post_only(true) + .build() + .await?; + let signed = client.sign(&signer, order).await?; + let response = client.post_order(signed).await?; + ``` * Only works with **GTC** and **GTD** order types @@ -356,6 +470,31 @@ Place up to **15 orders** in a single request: ), ]) ``` + + ```rust Rust theme={null} + let token_id = "TOKEN_ID".parse()?; + + let bid = client + .limit_order() + .token_id(token_id) + .price(dec!(0.48)) + .size(dec!(500)) + .side(Side::Buy) + .build() + .await?; + let ask = client + .limit_order() + .token_id(token_id) + .price(dec!(0.52)) + .size(dec!(500)) + .side(Side::Sell) + .build() + .await?; + + let signed_bid = client.sign(&signer, bid).await?; + let signed_ask = client.sign(&signer, ask).await?; + let response = client.post_orders(vec![signed_bid, signed_ask]).await?; + ``` *** @@ -383,6 +522,11 @@ Your order price must conform to the market's tick size, or the order is rejecte ```python Python theme={null} tick_size = client.get_tick_size("TOKEN_ID") ``` + + ```rust Rust theme={null} + let token_id = "TOKEN_ID".parse()?; + let tick_size = client.tick_size(token_id).await?; + ``` ### Negative Risk @@ -397,11 +541,16 @@ Multi-outcome events (3+ outcomes) use the Neg Risk CTF Exchange. Pass `negRisk: ```python Python theme={null} is_neg_risk = client.get_neg_risk("TOKEN_ID") ``` + + ```rust Rust theme={null} + let token_id = "TOKEN_ID".parse()?; + let is_neg_risk = client.neg_risk(token_id).await?; + ``` Both values are also available on the market object: `minimum_tick_size` and - `neg_risk`. + `neg_risk`. In Rust, the order builder auto-fetches both — you don't need to look them up manually. *** @@ -513,6 +662,18 @@ The heartbeat endpoint maintains session liveness. If a valid heartbeat is not r heartbeat_id = resp["heartbeat_id"] time.sleep(5) ``` + + ```rust Rust theme={null} + // With the `heartbeats` feature, the Rust SDK can auto-send heartbeats + // in a background task — no manual loop needed: + Client::start_heartbeats(&mut client)?; + // ... your trading logic ... + client.stop_heartbeats().await?; + + // Or send manually: + let resp = client.post_heartbeat(None).await?; // None for first call + let resp = client.post_heartbeat(Some(resp.heartbeat_id)).await?; + ``` * Include the most recent `heartbeat_id` in each request. Use an empty string for the first request. @@ -531,3 +692,6 @@ The heartbeat endpoint maintains session liveness. If a valid heartbeat is not r Attribute orders to your builder account for volume credit + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/developers/CLOB/orders/create-order.md b/docs/developers/CLOB/orders/create-order.md index 20d80ad..8373dbd 100644 --- a/docs/developers/CLOB/orders/create-order.md +++ b/docs/developers/CLOB/orders/create-order.md @@ -80,9 +80,29 @@ The simplest way to place a limit order — create, sign, and submit in one call print("Order ID:", response["orderID"]) print("Status:", response["status"]) ``` + + ```rust Rust theme={null} + use polymarket_client_sdk::clob::types::Side; + use polymarket_client_sdk::types::dec; + + let token_id = "TOKEN_ID".parse()?; + let order = client + .limit_order() + .token_id(token_id) + .price(dec!(0.50)) + .size(dec!(10)) + .side(Side::Buy) + .build() + .await?; + let signed = client.sign(&signer, order).await?; + let response = client.post_order(signed).await?; + + println!("Order ID: {}", response.order_id); + println!("Status: {:?}", response.status); + ``` -### Two-Step: Sign Then Submit +### Two-Step Sign Then Submit For more control, you can separate signing from submission. This is useful for batch orders or custom submission logic: @@ -121,11 +141,27 @@ For more control, you can separate signing from submission. This is useful for b # Step 2: Submit to the CLOB response = client.post_order(signed_order, OrderType.GTC) ``` + + ```rust Rust theme={null} + // Step 1: Create order (auto-fetches tick size, neg risk, fee rate) + let order = client + .limit_order() + .token_id("TOKEN_ID".parse()?) + .price(dec!(0.50)) + .size(dec!(10)) + .side(Side::Buy) + .build() + .await?; + + // Step 2: Sign and submit separately + let signed = client.sign(&signer, order).await?; + let response = client.post_order(signed).await?; + ``` *** -## GTD Orders (Expiring) +## GTD Orders GTD orders auto-expire at a specified time. Useful for quoting around known events. @@ -168,6 +204,24 @@ GTD orders auto-expire at a specified time. Useful for quoting around known even order_type=OrderType.GTD ) ``` + + ```rust Rust theme={null} + use chrono::{TimeDelta, Utc}; + use polymarket_client_sdk::clob::types::OrderType; + + let order = client + .limit_order() + .token_id("TOKEN_ID".parse()?) + .price(dec!(0.50)) + .size(dec!(10)) + .side(Side::Buy) + .order_type(OrderType::GTD) + .expiration(Utc::now() + TimeDelta::hours(1)) + .build() + .await?; + let signed = client.sign(&signer, order).await?; + let response = client.post_order(signed).await?; + ``` @@ -235,6 +289,38 @@ Market orders execute immediately against resting liquidity using FOK or FAK typ ) client.post_order(sell_order, OrderType.FOK) ``` + + ```rust Rust theme={null} + use polymarket_client_sdk::clob::types::{Amount, OrderType, Side}; + + let token_id = "TOKEN_ID".parse()?; + + // FOK BUY: spend exactly $100 or cancel entirely + let buy = client + .market_order() + .token_id(token_id) + .amount(Amount::usdc(dec!(100))?) + .price(dec!(0.50)) // worst-price limit (slippage protection) + .side(Side::Buy) + .order_type(OrderType::FOK) + .build() + .await?; + let signed = client.sign(&signer, buy).await?; + client.post_order(signed).await?; + + // FOK SELL: sell exactly 200 shares or cancel entirely + let sell = client + .market_order() + .token_id(token_id) + .amount(Amount::shares(dec!(200))?) + .price(dec!(0.45)) // worst-price limit (slippage protection) + .side(Side::Sell) + .order_type(OrderType::FOK) + .build() + .await?; + let signed = client.sign(&signer, sell).await?; + client.post_order(signed).await?; + ``` * **FOK** — fill entirely or cancel the whole order @@ -270,6 +356,20 @@ For convenience, `createAndPostMarketOrder` handles creation, signing, and submi order_type=OrderType.FOK, ) ``` + + ```rust Rust theme={null} + let order = client + .market_order() + .token_id("TOKEN_ID".parse()?) + .amount(Amount::usdc(dec!(100))?) + .price(dec!(0.50)) + .side(Side::Buy) + .order_type(OrderType::FOK) + .build() + .await?; + let signed = client.sign(&signer, order).await?; + let response = client.post_order(signed).await?; + ``` *** @@ -286,6 +386,20 @@ Post-only orders guarantee you're always the maker. If the order would match imm ```python Python theme={null} response = client.post_order(signed_order, OrderType.GTC, post_only=True) ``` + + ```rust Rust theme={null} + let order = client + .limit_order() + .token_id("TOKEN_ID".parse()?) + .price(dec!(0.50)) + .size(dec!(10)) + .side(Side::Buy) + .post_only(true) + .build() + .await?; + let signed = client.sign(&signer, order).await?; + let response = client.post_order(signed).await?; + ``` * Only works with **GTC** and **GTD** order types @@ -356,6 +470,31 @@ Place up to **15 orders** in a single request: ), ]) ``` + + ```rust Rust theme={null} + let token_id = "TOKEN_ID".parse()?; + + let bid = client + .limit_order() + .token_id(token_id) + .price(dec!(0.48)) + .size(dec!(500)) + .side(Side::Buy) + .build() + .await?; + let ask = client + .limit_order() + .token_id(token_id) + .price(dec!(0.52)) + .size(dec!(500)) + .side(Side::Sell) + .build() + .await?; + + let signed_bid = client.sign(&signer, bid).await?; + let signed_ask = client.sign(&signer, ask).await?; + let response = client.post_orders(vec![signed_bid, signed_ask]).await?; + ``` *** @@ -383,6 +522,11 @@ Your order price must conform to the market's tick size, or the order is rejecte ```python Python theme={null} tick_size = client.get_tick_size("TOKEN_ID") ``` + + ```rust Rust theme={null} + let token_id = "TOKEN_ID".parse()?; + let tick_size = client.tick_size(token_id).await?; + ``` ### Negative Risk @@ -397,11 +541,16 @@ Multi-outcome events (3+ outcomes) use the Neg Risk CTF Exchange. Pass `negRisk: ```python Python theme={null} is_neg_risk = client.get_neg_risk("TOKEN_ID") ``` + + ```rust Rust theme={null} + let token_id = "TOKEN_ID".parse()?; + let is_neg_risk = client.neg_risk(token_id).await?; + ``` Both values are also available on the market object: `minimum_tick_size` and - `neg_risk`. + `neg_risk`. In Rust, the order builder auto-fetches both — you don't need to look them up manually. *** @@ -513,6 +662,18 @@ The heartbeat endpoint maintains session liveness. If a valid heartbeat is not r heartbeat_id = resp["heartbeat_id"] time.sleep(5) ``` + + ```rust Rust theme={null} + // With the `heartbeats` feature, the Rust SDK can auto-send heartbeats + // in a background task — no manual loop needed: + Client::start_heartbeats(&mut client)?; + // ... your trading logic ... + client.stop_heartbeats().await?; + + // Or send manually: + let resp = client.post_heartbeat(None).await?; // None for first call + let resp = client.post_heartbeat(Some(resp.heartbeat_id)).await?; + ``` * Include the most recent `heartbeat_id` in each request. Use an empty string for the first request. @@ -531,3 +692,6 @@ The heartbeat endpoint maintains session liveness. If a valid heartbeat is not r Attribute orders to your builder account for volume credit + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/developers/CLOB/orders/get-active-order.md b/docs/developers/CLOB/orders/get-active-order.md index 19a87c4..5aacbe6 100644 --- a/docs/developers/CLOB/orders/get-active-order.md +++ b/docs/developers/CLOB/orders/get-active-order.md @@ -71,6 +71,11 @@ Retrieve the tick size for a market using the SDK: tick_size = client.get_tick_size(token_id) # Returns: "0.1" | "0.01" | "0.001" | "0.0001" ``` + + ```rust Rust theme={null} + let resp = client.tick_size(token_id).await?; + // resp.minimum_tick_size: TickSize::Tenth | Hundredth | Thousandth | TenThousandth + ``` @@ -114,6 +119,21 @@ Multi-outcome events (e.g., "Who will win the election?" with 3+ candidates) use } ) ``` + + ```rust Rust theme={null} + // The Rust SDK auto-detects neg risk from the token ID — no flag needed. + // The order builder fetches neg_risk and uses the correct exchange contract. + let order = client + .limit_order() + .token_id("TOKEN_ID".parse()?) + .price(dec!(0.50)) + .size(dec!(10)) + .side(Side::Buy) + .build() + .await?; + let signed = client.sign(&signer, order).await?; + let response = client.post_order(signed).await?; + ``` You can check whether a market uses negative risk via the SDK or the market object's `neg_risk` field: @@ -126,6 +146,10 @@ You can check whether a market uses negative risk via the SDK or the market obje ```python Python theme={null} is_neg_risk = client.get_neg_risk(token_id) ``` + + ```rust Rust theme={null} + let is_neg_risk = client.neg_risk(token_id).await?; + ``` *** @@ -165,7 +189,7 @@ $$ ## Querying Orders -All query endpoints require [L2 authentication](/api-reference/authentication). +All query endpoints require [L2 authentication](/api-reference/authentication). [Builder-authenticated](/trading/clients/builder) clients can also query orders attributed to their builder account using the same methods. ### Get a Single Order @@ -181,6 +205,11 @@ Retrieve details for a specific order by its ID: order = client.get_order("0xb816482a...") print(order) ``` + + ```rust Rust theme={null} + let order = client.order("0xb816482a...").await?; + println!("{order:?}"); + ``` ### Get Open Orders @@ -216,6 +245,25 @@ Retrieve your open orders, optionally filtered by market or asset: ) ) ``` + + ```rust Rust theme={null} + use polymarket_client_sdk::clob::types::request::OrdersRequest; + + // All open orders + let orders = client.orders(&OrdersRequest::default(), None).await?; + + // Filtered by market + let request = OrdersRequest::builder() + .market("0xbd31dc8a...".parse()?) + .build(); + let market_orders = client.orders(&request, None).await?; + + // Filtered by asset + let request = OrdersRequest::builder() + .asset_id("52114319501245...".parse()?) + .build(); + let asset_orders = client.orders(&request, None).await?; + ``` ### OpenOrder Object @@ -325,6 +373,19 @@ Retrieve your trades with the SDK: ) ) ``` + + ```rust Rust theme={null} + use polymarket_client_sdk::clob::types::request::TradesRequest; + + // All trades + let trades = client.trades(&TradesRequest::default(), None).await?; + + // Filtered by market + let request = TradesRequest::builder() + .market("0xbd31dc8a...".parse()?) + .build(); + let market_trades = client.trades(&request, None).await?; + ``` *** @@ -352,6 +413,15 @@ The heartbeat endpoint maintains session liveness for order safety. If a valid h heartbeat_id = resp["heartbeat_id"] time.sleep(5) ``` + + ```rust Rust theme={null} + // With the `heartbeats` feature, auto-send in background: + Client::start_heartbeats(&mut client)?; + + // Or manually: + let resp = client.post_heartbeat(None).await?; // None for first call + let resp = client.post_heartbeat(Some(resp.heartbeat_id)).await?; + ``` * On each request, include the most recent `heartbeat_id` you received. For your first request, use an empty string. @@ -388,6 +458,15 @@ Check if your resting orders are eligible for [maker rebates](/market-makers/mak OrdersScoringParams(orderIds=["0x...", "0x..."]) ) ``` + + ```rust Rust theme={null} + // Single order + let scoring = client.is_order_scoring("0x...").await?; + println!("Scoring: {}", scoring.scoring); + + // Multiple orders + let batch = client.are_orders_scoring(&["0x...", "0x..."]).await?; + ``` *** @@ -461,3 +540,6 @@ The operator's privileges are limited to order matching and ensuring correct ord Cancel single, multiple, or all orders + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/developers/CLOB/orders/get-order.md b/docs/developers/CLOB/orders/get-order.md index 19a87c4..5aacbe6 100644 --- a/docs/developers/CLOB/orders/get-order.md +++ b/docs/developers/CLOB/orders/get-order.md @@ -71,6 +71,11 @@ Retrieve the tick size for a market using the SDK: tick_size = client.get_tick_size(token_id) # Returns: "0.1" | "0.01" | "0.001" | "0.0001" ``` + + ```rust Rust theme={null} + let resp = client.tick_size(token_id).await?; + // resp.minimum_tick_size: TickSize::Tenth | Hundredth | Thousandth | TenThousandth + ``` @@ -114,6 +119,21 @@ Multi-outcome events (e.g., "Who will win the election?" with 3+ candidates) use } ) ``` + + ```rust Rust theme={null} + // The Rust SDK auto-detects neg risk from the token ID — no flag needed. + // The order builder fetches neg_risk and uses the correct exchange contract. + let order = client + .limit_order() + .token_id("TOKEN_ID".parse()?) + .price(dec!(0.50)) + .size(dec!(10)) + .side(Side::Buy) + .build() + .await?; + let signed = client.sign(&signer, order).await?; + let response = client.post_order(signed).await?; + ``` You can check whether a market uses negative risk via the SDK or the market object's `neg_risk` field: @@ -126,6 +146,10 @@ You can check whether a market uses negative risk via the SDK or the market obje ```python Python theme={null} is_neg_risk = client.get_neg_risk(token_id) ``` + + ```rust Rust theme={null} + let is_neg_risk = client.neg_risk(token_id).await?; + ``` *** @@ -165,7 +189,7 @@ $$ ## Querying Orders -All query endpoints require [L2 authentication](/api-reference/authentication). +All query endpoints require [L2 authentication](/api-reference/authentication). [Builder-authenticated](/trading/clients/builder) clients can also query orders attributed to their builder account using the same methods. ### Get a Single Order @@ -181,6 +205,11 @@ Retrieve details for a specific order by its ID: order = client.get_order("0xb816482a...") print(order) ``` + + ```rust Rust theme={null} + let order = client.order("0xb816482a...").await?; + println!("{order:?}"); + ``` ### Get Open Orders @@ -216,6 +245,25 @@ Retrieve your open orders, optionally filtered by market or asset: ) ) ``` + + ```rust Rust theme={null} + use polymarket_client_sdk::clob::types::request::OrdersRequest; + + // All open orders + let orders = client.orders(&OrdersRequest::default(), None).await?; + + // Filtered by market + let request = OrdersRequest::builder() + .market("0xbd31dc8a...".parse()?) + .build(); + let market_orders = client.orders(&request, None).await?; + + // Filtered by asset + let request = OrdersRequest::builder() + .asset_id("52114319501245...".parse()?) + .build(); + let asset_orders = client.orders(&request, None).await?; + ``` ### OpenOrder Object @@ -325,6 +373,19 @@ Retrieve your trades with the SDK: ) ) ``` + + ```rust Rust theme={null} + use polymarket_client_sdk::clob::types::request::TradesRequest; + + // All trades + let trades = client.trades(&TradesRequest::default(), None).await?; + + // Filtered by market + let request = TradesRequest::builder() + .market("0xbd31dc8a...".parse()?) + .build(); + let market_trades = client.trades(&request, None).await?; + ``` *** @@ -352,6 +413,15 @@ The heartbeat endpoint maintains session liveness for order safety. If a valid h heartbeat_id = resp["heartbeat_id"] time.sleep(5) ``` + + ```rust Rust theme={null} + // With the `heartbeats` feature, auto-send in background: + Client::start_heartbeats(&mut client)?; + + // Or manually: + let resp = client.post_heartbeat(None).await?; // None for first call + let resp = client.post_heartbeat(Some(resp.heartbeat_id)).await?; + ``` * On each request, include the most recent `heartbeat_id` you received. For your first request, use an empty string. @@ -388,6 +458,15 @@ Check if your resting orders are eligible for [maker rebates](/market-makers/mak OrdersScoringParams(orderIds=["0x...", "0x..."]) ) ``` + + ```rust Rust theme={null} + // Single order + let scoring = client.is_order_scoring("0x...").await?; + println!("Scoring: {}", scoring.scoring); + + // Multiple orders + let batch = client.are_orders_scoring(&["0x...", "0x..."]).await?; + ``` *** @@ -461,3 +540,6 @@ The operator's privileges are limited to order matching and ensuring correct ord Cancel single, multiple, or all orders + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/developers/CLOB/orders/onchain-order-info.md b/docs/developers/CLOB/orders/onchain-order-info.md index 19a87c4..5aacbe6 100644 --- a/docs/developers/CLOB/orders/onchain-order-info.md +++ b/docs/developers/CLOB/orders/onchain-order-info.md @@ -71,6 +71,11 @@ Retrieve the tick size for a market using the SDK: tick_size = client.get_tick_size(token_id) # Returns: "0.1" | "0.01" | "0.001" | "0.0001" ``` + + ```rust Rust theme={null} + let resp = client.tick_size(token_id).await?; + // resp.minimum_tick_size: TickSize::Tenth | Hundredth | Thousandth | TenThousandth + ``` @@ -114,6 +119,21 @@ Multi-outcome events (e.g., "Who will win the election?" with 3+ candidates) use } ) ``` + + ```rust Rust theme={null} + // The Rust SDK auto-detects neg risk from the token ID — no flag needed. + // The order builder fetches neg_risk and uses the correct exchange contract. + let order = client + .limit_order() + .token_id("TOKEN_ID".parse()?) + .price(dec!(0.50)) + .size(dec!(10)) + .side(Side::Buy) + .build() + .await?; + let signed = client.sign(&signer, order).await?; + let response = client.post_order(signed).await?; + ``` You can check whether a market uses negative risk via the SDK or the market object's `neg_risk` field: @@ -126,6 +146,10 @@ You can check whether a market uses negative risk via the SDK or the market obje ```python Python theme={null} is_neg_risk = client.get_neg_risk(token_id) ``` + + ```rust Rust theme={null} + let is_neg_risk = client.neg_risk(token_id).await?; + ``` *** @@ -165,7 +189,7 @@ $$ ## Querying Orders -All query endpoints require [L2 authentication](/api-reference/authentication). +All query endpoints require [L2 authentication](/api-reference/authentication). [Builder-authenticated](/trading/clients/builder) clients can also query orders attributed to their builder account using the same methods. ### Get a Single Order @@ -181,6 +205,11 @@ Retrieve details for a specific order by its ID: order = client.get_order("0xb816482a...") print(order) ``` + + ```rust Rust theme={null} + let order = client.order("0xb816482a...").await?; + println!("{order:?}"); + ``` ### Get Open Orders @@ -216,6 +245,25 @@ Retrieve your open orders, optionally filtered by market or asset: ) ) ``` + + ```rust Rust theme={null} + use polymarket_client_sdk::clob::types::request::OrdersRequest; + + // All open orders + let orders = client.orders(&OrdersRequest::default(), None).await?; + + // Filtered by market + let request = OrdersRequest::builder() + .market("0xbd31dc8a...".parse()?) + .build(); + let market_orders = client.orders(&request, None).await?; + + // Filtered by asset + let request = OrdersRequest::builder() + .asset_id("52114319501245...".parse()?) + .build(); + let asset_orders = client.orders(&request, None).await?; + ``` ### OpenOrder Object @@ -325,6 +373,19 @@ Retrieve your trades with the SDK: ) ) ``` + + ```rust Rust theme={null} + use polymarket_client_sdk::clob::types::request::TradesRequest; + + // All trades + let trades = client.trades(&TradesRequest::default(), None).await?; + + // Filtered by market + let request = TradesRequest::builder() + .market("0xbd31dc8a...".parse()?) + .build(); + let market_trades = client.trades(&request, None).await?; + ``` *** @@ -352,6 +413,15 @@ The heartbeat endpoint maintains session liveness for order safety. If a valid h heartbeat_id = resp["heartbeat_id"] time.sleep(5) ``` + + ```rust Rust theme={null} + // With the `heartbeats` feature, auto-send in background: + Client::start_heartbeats(&mut client)?; + + // Or manually: + let resp = client.post_heartbeat(None).await?; // None for first call + let resp = client.post_heartbeat(Some(resp.heartbeat_id)).await?; + ``` * On each request, include the most recent `heartbeat_id` you received. For your first request, use an empty string. @@ -388,6 +458,15 @@ Check if your resting orders are eligible for [maker rebates](/market-makers/mak OrdersScoringParams(orderIds=["0x...", "0x..."]) ) ``` + + ```rust Rust theme={null} + // Single order + let scoring = client.is_order_scoring("0x...").await?; + println!("Scoring: {}", scoring.scoring); + + // Multiple orders + let batch = client.are_orders_scoring(&["0x...", "0x..."]).await?; + ``` *** @@ -461,3 +540,6 @@ The operator's privileges are limited to order matching and ensuring correct ord Cancel single, multiple, or all orders + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/developers/CLOB/orders/orders.md b/docs/developers/CLOB/orders/orders.md index 19a87c4..5aacbe6 100644 --- a/docs/developers/CLOB/orders/orders.md +++ b/docs/developers/CLOB/orders/orders.md @@ -71,6 +71,11 @@ Retrieve the tick size for a market using the SDK: tick_size = client.get_tick_size(token_id) # Returns: "0.1" | "0.01" | "0.001" | "0.0001" ``` + + ```rust Rust theme={null} + let resp = client.tick_size(token_id).await?; + // resp.minimum_tick_size: TickSize::Tenth | Hundredth | Thousandth | TenThousandth + ``` @@ -114,6 +119,21 @@ Multi-outcome events (e.g., "Who will win the election?" with 3+ candidates) use } ) ``` + + ```rust Rust theme={null} + // The Rust SDK auto-detects neg risk from the token ID — no flag needed. + // The order builder fetches neg_risk and uses the correct exchange contract. + let order = client + .limit_order() + .token_id("TOKEN_ID".parse()?) + .price(dec!(0.50)) + .size(dec!(10)) + .side(Side::Buy) + .build() + .await?; + let signed = client.sign(&signer, order).await?; + let response = client.post_order(signed).await?; + ``` You can check whether a market uses negative risk via the SDK or the market object's `neg_risk` field: @@ -126,6 +146,10 @@ You can check whether a market uses negative risk via the SDK or the market obje ```python Python theme={null} is_neg_risk = client.get_neg_risk(token_id) ``` + + ```rust Rust theme={null} + let is_neg_risk = client.neg_risk(token_id).await?; + ``` *** @@ -165,7 +189,7 @@ $$ ## Querying Orders -All query endpoints require [L2 authentication](/api-reference/authentication). +All query endpoints require [L2 authentication](/api-reference/authentication). [Builder-authenticated](/trading/clients/builder) clients can also query orders attributed to their builder account using the same methods. ### Get a Single Order @@ -181,6 +205,11 @@ Retrieve details for a specific order by its ID: order = client.get_order("0xb816482a...") print(order) ``` + + ```rust Rust theme={null} + let order = client.order("0xb816482a...").await?; + println!("{order:?}"); + ``` ### Get Open Orders @@ -216,6 +245,25 @@ Retrieve your open orders, optionally filtered by market or asset: ) ) ``` + + ```rust Rust theme={null} + use polymarket_client_sdk::clob::types::request::OrdersRequest; + + // All open orders + let orders = client.orders(&OrdersRequest::default(), None).await?; + + // Filtered by market + let request = OrdersRequest::builder() + .market("0xbd31dc8a...".parse()?) + .build(); + let market_orders = client.orders(&request, None).await?; + + // Filtered by asset + let request = OrdersRequest::builder() + .asset_id("52114319501245...".parse()?) + .build(); + let asset_orders = client.orders(&request, None).await?; + ``` ### OpenOrder Object @@ -325,6 +373,19 @@ Retrieve your trades with the SDK: ) ) ``` + + ```rust Rust theme={null} + use polymarket_client_sdk::clob::types::request::TradesRequest; + + // All trades + let trades = client.trades(&TradesRequest::default(), None).await?; + + // Filtered by market + let request = TradesRequest::builder() + .market("0xbd31dc8a...".parse()?) + .build(); + let market_trades = client.trades(&request, None).await?; + ``` *** @@ -352,6 +413,15 @@ The heartbeat endpoint maintains session liveness for order safety. If a valid h heartbeat_id = resp["heartbeat_id"] time.sleep(5) ``` + + ```rust Rust theme={null} + // With the `heartbeats` feature, auto-send in background: + Client::start_heartbeats(&mut client)?; + + // Or manually: + let resp = client.post_heartbeat(None).await?; // None for first call + let resp = client.post_heartbeat(Some(resp.heartbeat_id)).await?; + ``` * On each request, include the most recent `heartbeat_id` you received. For your first request, use an empty string. @@ -388,6 +458,15 @@ Check if your resting orders are eligible for [maker rebates](/market-makers/mak OrdersScoringParams(orderIds=["0x...", "0x..."]) ) ``` + + ```rust Rust theme={null} + // Single order + let scoring = client.is_order_scoring("0x...").await?; + println!("Scoring: {}", scoring.scoring); + + // Multiple orders + let batch = client.are_orders_scoring(&["0x...", "0x..."]).await?; + ``` *** @@ -461,3 +540,6 @@ The operator's privileges are limited to order matching and ensuring correct ord Cancel single, multiple, or all orders + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/developers/CLOB/quickstart.md b/docs/developers/CLOB/quickstart.md index 392c9ed..36e8301 100644 --- a/docs/developers/CLOB/quickstart.md +++ b/docs/developers/CLOB/quickstart.md @@ -18,6 +18,10 @@ This guide walks you through placing an order on Polymarket end-to-end. ```bash Python theme={null} pip install py-clob-client ``` + + ```bash Rust theme={null} + cargo add polymarket-client-sdk --features clob + ```
@@ -70,6 +74,23 @@ This guide walks you through placing an order on Polymarket end-to-end. funder="YOUR_WALLET_ADDRESS" ) ``` + + ```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)); + + // Derive API credentials and initialize client (EOA by default) + let client = Client::new("https://clob.polymarket.com", Config::default())? + .authentication_builder(&signer) + .authenticate() + .await?; + ``` @@ -131,6 +152,28 @@ This guide walks you through placing an order on Polymarket end-to-end. print("Order ID:", response["orderID"]) print("Status:", response["status"]) ``` + + ```rust Rust theme={null} + use polymarket_client_sdk::clob::types::Side; + use polymarket_client_sdk::types::dec; + + let token_id = "YOUR_TOKEN_ID".parse()?; + + // Tick size and neg risk are auto-fetched by the order builder + let order = client + .limit_order() + .token_id(token_id) + .price(dec!(0.50)) + .size(dec!(10)) + .side(Side::Buy) + .build() + .await?; + let signed_order = client.sign(&signer, order).await?; + let response = client.post_order(signed_order).await?; + + println!("Order ID: {}", response.order_id); + println!("Status: {:?}", response.status); + ``` @@ -167,6 +210,21 @@ This guide walks you through placing an order on Polymarket end-to-end. # Cancel an order client.cancel(order_id=response["orderID"]) ``` + + ```rust Rust theme={null} + use polymarket_client_sdk::clob::types::request::{OrdersRequest, TradesRequest}; + + // View all open orders + let open_orders = client.orders(&OrdersRequest::default(), None).await?; + println!("You have {} open orders", open_orders.data.len()); + + // View your trade history + let trades = client.trades(&TradesRequest::default(), None).await?; + println!("You've made {} trades", trades.data.len()); + + // Cancel an order + client.cancel_order(&response.order_id).await?; + ```
@@ -176,7 +234,7 @@ This guide walks you through placing an order on Polymarket end-to-end. ## Troubleshooting - + Wrong private key, signature type, or funder address for the derived API credentials. * Check that `signatureType` matches your account type (`0`, `1`, or `2`) @@ -184,7 +242,7 @@ This guide walks you through placing an order on Polymarket end-to-end. * Re-derive credentials with `createOrDeriveApiKey()` if unsure - + Your funder address doesn't have enough tokens: * **BUY orders**: need USDC.e in your funder address @@ -192,13 +250,13 @@ This guide walks you through placing an order on Polymarket end-to-end. * Ensure you have more USDC.e than what's committed in open orders - + You need to approve the Exchange contract to spend your tokens. This is typically done through the Polymarket UI on your first trade, or using the CTF contract's `setApprovalForAll()` method. - + Your funder address is the wallet where your funds are held: * **EOA (type 0)**: Your wallet address directly @@ -207,7 +265,7 @@ This guide walks you through placing an order on Polymarket end-to-end. If the proxy wallet doesn't exist, log into Polymarket.com first (it's deployed on first login). - + You're trying to place a trade from a restricted region. See [Geographic Restrictions](/api-reference/geoblock) for details. @@ -225,3 +283,6 @@ This guide walks you through placing an order on Polymarket end-to-end. Attribute orders to your builder account for volume credit + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/developers/CLOB/status.md b/docs/developers/CLOB/status.md index bf9f2a9..5d6b8ea 100644 --- a/docs/developers/CLOB/status.md +++ b/docs/developers/CLOB/status.md @@ -1,6 +1,6 @@ -Polymarket - StatusPolymarket - Status

Polymarket - Status Page

Website - Operational

100% - uptime

CLOB API - Operational

100% - uptime

Markets API - Operational

100% - uptime

Polygon (RPC) - Operational

100% - uptime

User auth - Operational

100% - uptime

Sports API - Operational

100% - uptime

Recent notices

Show notice history

Polymarket - Status Page

Website - Operational

100% - uptime

CLOB API - Operational

100% - uptime

Markets API - Operational

100% - uptime

Polygon (RPC) - Operational

100% - uptime

User auth - Operational

100% - uptime

Sports API - Operational

100% - uptime

Recent notices

Show notice history
+
\ No newline at end of file diff --git a/docs/developers/CLOB/timeseries.md b/docs/developers/CLOB/timeseries.md index de671aa..06c19b2 100644 --- a/docs/developers/CLOB/timeseries.md +++ b/docs/developers/CLOB/timeseries.md @@ -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). \ No newline at end of file diff --git a/docs/developers/CLOB/trades/trades-overview.md b/docs/developers/CLOB/trades/trades-overview.md index fa09274..af662a5 100644 --- a/docs/developers/CLOB/trades/trades-overview.md +++ b/docs/developers/CLOB/trades/trades-overview.md @@ -10,7 +10,7 @@ Polymarket's CLOB (Central Limit Order Book) is a hybrid-decentralized trading s We recommend using the open-source SDK clients, which handle order signing, authentication, and submission: - +

npm install @polymarket/clob-client @@ -20,6 +20,10 @@ We recommend using the open-source SDK clients, which handle order signing, auth

pip install py-clob-client

+ + +

cargo add polymarket-client-sdk

+
@@ -66,6 +70,23 @@ You use your private key once to derive **L2 credentials** (API key, secret, pas temp_client = ClobClient("https://clob.polymarket.com", key=private_key, chain_id=137) api_creds = temp_client.create_or_derive_api_creds() ``` + + ```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)); + + // Derive L2 API credentials and initialize client in one step + let client = Client::new("https://clob.polymarket.com", Config::default())? + .authentication_builder(&signer) + .authenticate() + .await?; + ``` *** @@ -110,6 +131,16 @@ When initializing the trading client, you must specify your wallet's **signature funder="0x..." # Your proxy wallet address ) ``` + + ```rust Rust theme={null} + use polymarket_client_sdk::clob::types::SignatureType; + + let client = Client::new("https://clob.polymarket.com", Config::default())? + .authentication_builder(&signer) + .signature_type(SignatureType::GnosisSafe) // Funder auto-derived via CREATE2 + .authenticate() + .await?; + ``` *** @@ -167,7 +198,7 @@ If you're using the REST API directly (without the SDK), you need to attach auth *** -## What's in This Section +## What Is in This Section @@ -198,3 +229,6 @@ If you're using the REST API directly (without the SDK), you need to attach auth Deposit and withdraw funds across chains + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/developers/CLOB/trades/trades.md b/docs/developers/CLOB/trades/trades.md index fa09274..af662a5 100644 --- a/docs/developers/CLOB/trades/trades.md +++ b/docs/developers/CLOB/trades/trades.md @@ -10,7 +10,7 @@ Polymarket's CLOB (Central Limit Order Book) is a hybrid-decentralized trading s We recommend using the open-source SDK clients, which handle order signing, authentication, and submission: - +

npm install @polymarket/clob-client @@ -20,6 +20,10 @@ We recommend using the open-source SDK clients, which handle order signing, auth

pip install py-clob-client

+ + +

cargo add polymarket-client-sdk

+
@@ -66,6 +70,23 @@ You use your private key once to derive **L2 credentials** (API key, secret, pas temp_client = ClobClient("https://clob.polymarket.com", key=private_key, chain_id=137) api_creds = temp_client.create_or_derive_api_creds() ``` + + ```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)); + + // Derive L2 API credentials and initialize client in one step + let client = Client::new("https://clob.polymarket.com", Config::default())? + .authentication_builder(&signer) + .authenticate() + .await?; + ``` *** @@ -110,6 +131,16 @@ When initializing the trading client, you must specify your wallet's **signature funder="0x..." # Your proxy wallet address ) ``` + + ```rust Rust theme={null} + use polymarket_client_sdk::clob::types::SignatureType; + + let client = Client::new("https://clob.polymarket.com", Config::default())? + .authentication_builder(&signer) + .signature_type(SignatureType::GnosisSafe) // Funder auto-derived via CREATE2 + .authenticate() + .await?; + ``` *** @@ -167,7 +198,7 @@ If you're using the REST API directly (without the SDK), you need to attach auth *** -## What's in This Section +## What Is in This Section @@ -198,3 +229,6 @@ If you're using the REST API directly (without the SDK), you need to attach auth Deposit and withdraw funds across chains + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/developers/CLOB/websocket/market-channel.md b/docs/developers/CLOB/websocket/market-channel.md index 65843f5..4791214 100644 --- a/docs/developers/CLOB/websocket/market-channel.md +++ b/docs/developers/CLOB/websocket/market-channel.md @@ -144,6 +144,10 @@ Emitted when the best bid or ask prices for a market change. Emitted when a new market is created. +The payload also includes market metadata fields such as `tags`, +`condition_id`, `active`, `clob_token_ids`, `sports_market_type`, `line`, +`game_start_time`, `order_price_min_tick_size`, and `group_item_title`. + ```json theme={null} { "id": "1031769", @@ -164,7 +168,19 @@ Emitted when a new market is created. "description": "This market will resolve to \"Yes\" if the official closing price..." }, "timestamp": "1766790415550", - "event_type": "new_market" + "event_type": "new_market", + "tags": ["stocks"], + "condition_id": "0x311d0c4b6671ab54af4970c06fcf58662516f5168997bdda209ec3db5aa6b0c1", + "active": true, + "clob_token_ids": [ + "76043073756653678226373981964075571318267289248134717369284518995922789326425", + "31690934263385727664202099278545688007799199447969475608906331829650099442770" + ], + "sports_market_type": "", + "line": "", + "game_start_time": "", + "order_price_min_tick_size": "0.01", + "group_item_title": "NVDA above $240" } ``` @@ -199,3 +215,6 @@ Emitted when a market is resolved. "event_type": "market_resolved" } ``` + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/developers/CLOB/websocket/user-channel.md b/docs/developers/CLOB/websocket/user-channel.md index f7eb507..4bcac00 100644 --- a/docs/developers/CLOB/websocket/user-channel.md +++ b/docs/developers/CLOB/websocket/user-channel.md @@ -122,3 +122,6 @@ Emitted when: "type": "PLACEMENT" } ``` + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/developers/CLOB/websocket/wss-auth.md b/docs/developers/CLOB/websocket/wss-auth.md index e0ecfc1..166d020 100644 --- a/docs/developers/CLOB/websocket/wss-auth.md +++ b/docs/developers/CLOB/websocket/wss-auth.md @@ -137,7 +137,7 @@ For the user channel, use `markets` instead of `assets_ids`: ## Heartbeats -### Market & User Channels +### Market and User Channels Send `PING` every 10 seconds. The server responds with `PONG`. @@ -165,7 +165,7 @@ pong close connections that don't subscribe within a timeout period.
- + You're not sending heartbeats. Send `PING` every 10 seconds for market/user channels, or respond to server `ping` with `pong` for the sports channel. @@ -176,6 +176,9 @@ pong expecting `best_bid_ask`, `new_market`, or `market_resolved` events - + Verify your API credentials are correct and haven't expired. + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/developers/CLOB/websocket/wss-overview.md b/docs/developers/CLOB/websocket/wss-overview.md index e0ecfc1..166d020 100644 --- a/docs/developers/CLOB/websocket/wss-overview.md +++ b/docs/developers/CLOB/websocket/wss-overview.md @@ -137,7 +137,7 @@ For the user channel, use `markets` instead of `assets_ids`: ## Heartbeats -### Market & User Channels +### Market and User Channels Send `PING` every 10 seconds. The server responds with `PONG`. @@ -165,7 +165,7 @@ pong close connections that don't subscribe within a timeout period. - + You're not sending heartbeats. Send `PING` every 10 seconds for market/user channels, or respond to server `ping` with `pong` for the sports channel. @@ -176,6 +176,9 @@ pong expecting `best_bid_ask`, `new_market`, or `market_resolved` events - + Verify your API credentials are correct and haven't expired. + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/developers/CTF/deployment-resources.md b/docs/developers/CTF/deployment-resources.md index 6aebddc..a616940 100644 --- a/docs/developers/CTF/deployment-resources.md +++ b/docs/developers/CTF/deployment-resources.md @@ -89,4 +89,21 @@ All Polymarket contracts are deployed on **Polygon mainnet** (Chain ID: 137). Th "NEG_RISK_CTF_EXCHANGE": "0xC5d563A36AE78145C45a50134d48A1215220f80a", } ``` + + ```rust Rust theme={null} + use polymarket_client_sdk::{POLYGON, contract_config}; + + // Addresses are built into the SDK — no hardcoding needed + let config = contract_config(POLYGON, false).expect("polygon config"); + // config.exchange: 0x4bFb41d5B3570DeFd03C39a9A4D8dE6Bd8B8982E + // config.collateral: 0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174 + // config.conditional_tokens: 0x4D97DCd97eC945f40cF65F87097ACe5EA0476045 + + let neg_config = contract_config(POLYGON, true).expect("polygon neg risk config"); + // neg_config.exchange: 0xC5d563A36AE78145C45a50134d48A1215220f80a + // neg_config.neg_risk_adapter: Some(0xd91E80cF2E7be2e162c6513ceD06f1dD0dA35296) + ``` + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/developers/CTF/merge.md b/docs/developers/CTF/merge.md index 664a3f2..bd97bb4 100644 --- a/docs/developers/CTF/merge.md +++ b/docs/developers/CTF/merge.md @@ -61,3 +61,6 @@ The operation is atomic — if you don't have enough of both tokens, the transac Learn more about the Conditional Token Framework + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/developers/CTF/overview.md b/docs/developers/CTF/overview.md index 7d36bb2..dcbecda 100644 --- a/docs/developers/CTF/overview.md +++ b/docs/developers/CTF/overview.md @@ -8,7 +8,7 @@ All outcomes on Polymarket are tokenized using the **Conditional Token Framework (CTF)**, an open standard developed by Gnosis. Understanding CTF operations enables advanced trading strategies, market making, and direct smart contract interactions. -## What is CTF? +## What is CTF The Conditional Token Framework creates **ERC1155 tokens** representing outcomes of prediction markets. Each binary market has two tokens: @@ -40,16 +40,16 @@ CTF provides three fundamental operations: ## Token Flow - + - + ## Token Identifiers Each outcome token has a unique **position ID** (also called token ID or asset ID), computed onchain in three steps. -### Step 1 — Condition ID +### Step 1 - Condition ID ``` getConditionId(oracle, questionId, outcomeSlotCount) @@ -61,7 +61,7 @@ getConditionId(oracle, questionId, outcomeSlotCount) | `questionId` | `bytes32` | Hash of the UMA ancillary data | | `outcomeSlotCount` | `uint` | `2` for all binary markets | -### Step 2 — Collection IDs +### Step 2 - Collection IDs ``` getCollectionId(parentCollectionId, conditionId, indexSet) @@ -75,7 +75,7 @@ getCollectionId(parentCollectionId, conditionId, indexSet) The `indexSet` is a bitmask denoting which outcome slots belong to a collection. It must be a nonempty proper subset of the condition's outcome slots. Binary markets always have exactly two collections — one per outcome. -### Step 3 — Position IDs +### Step 3 - Position IDs ``` getPositionId(collateralToken, collectionId) @@ -138,3 +138,6 @@ See [Contract Addresses](/resources/contract-addresses) for all Polymarket smart Collect winnings after resolution + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/developers/CTF/redeem.md b/docs/developers/CTF/redeem.md index 40d0539..ad5743b 100644 --- a/docs/developers/CTF/redeem.md +++ b/docs/developers/CTF/redeem.md @@ -92,3 +92,6 @@ When you call `redeemPositions()`: Understand how markets are resolved + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/developers/CTF/split.md b/docs/developers/CTF/split.md index 8869e8c..91ab1ff 100644 --- a/docs/developers/CTF/split.md +++ b/docs/developers/CTF/split.md @@ -67,3 +67,6 @@ The operation is atomic — if any step fails, the entire transaction reverts. Place orders using your newly split tokens + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/developers/RTDS/RTDS-comments.md b/docs/developers/RTDS/RTDS-comments.md index ffd0f0a..02db2fa 100644 --- a/docs/developers/RTDS/RTDS-comments.md +++ b/docs/developers/RTDS/RTDS-comments.md @@ -4,9 +4,9 @@ # Real-Time Data Socket -> Stream comments and crypto prices via WebSocket +> Stream comments, crypto prices, and equity prices via WebSocket -The Polymarket Real-Time Data Socket (RTDS) is a WebSocket-based streaming service that provides real-time updates for **comments** and **crypto prices**. +The Polymarket Real-Time Data Socket (RTDS) is a WebSocket-based streaming service that provides real-time updates for **comments**, **crypto prices**, and **equity prices**. Official RTDS TypeScript client (`real-time-data-client`). @@ -59,18 +59,18 @@ All messages follow this structure: } ``` -| Field | Type | Description | -| ----------- | ------ | ----------------------------------------------------------- | -| `topic` | string | The subscription topic (e.g., `crypto_prices`, `comments`) | -| `type` | string | The message type/event (e.g., `update`, `reaction_created`) | -| `timestamp` | number | Unix timestamp in milliseconds when the message was sent | -| `payload` | object | Event-specific data object | +| Field | Type | Description | +| ----------- | ------ | --------------------------------------------------------------------------- | +| `topic` | string | The subscription topic (e.g., `crypto_prices`, `equity_prices`, `comments`) | +| `type` | string | The message type/event (e.g., `update`, `reaction_created`) | +| `timestamp` | number | Unix timestamp in milliseconds when the message was sent | +| `payload` | object | Event-specific data object | ## Crypto Prices Real-time cryptocurrency price data from two sources: **Binance** and **Chainlink**. No authentication required. -### Binance Source (`crypto_prices`) +### Binance Source Subscribe to all symbols: @@ -133,7 +133,7 @@ Symbols use lowercase concatenated format (e.g., `solusdt`, `btcusdt`). } ``` -### Chainlink Source (`crypto_prices_chainlink`) +### Chainlink Source **Trading 15m Crypto Markets?** Get a sponsored Chainlink API key with onboarding support from Chainlink. Fill out [this form](https://pm-ds-request.streams.chain.link/). @@ -225,6 +225,191 @@ Symbols use slash-separated format (e.g., `eth/usd`, `btc/usd`). * `sol/usd` — Solana to USD * `xrp/usd` — XRP to USD +## Equity Prices + +Real-time price data for stocks, ETFs, forex pairs, precious metals, and commodities sourced from **Pyth Network**. No authentication required. + + + **Trading Equity Markets?** Get a Pyth Network data feed - first 30 days free, then \$99/month. [Subscribe here](https://buy.stripe.com/cNi8wPeiq76FgQrbsD4ZG09). + + +All asset classes stream through a single `equity_prices` topic. When you subscribe with a symbol filter, the server sends a historical snapshot (last 2 minutes of data), then continues streaming live updates. + +### Subscribe + +Subscribe to a specific symbol with a JSON filter: + +```json theme={null} +{ + "action": "subscribe", + "subscriptions": [ + { + "topic": "equity_prices", + "type": "update", + "filters": "{\"symbol\":\"AAPL\"}" + } + ] +} +``` + +Subscribe to multiple symbols across asset classes: + +```json theme={null} +{ + "action": "subscribe", + "subscriptions": [ + { "topic": "equity_prices", "type": "update", "filters": "{\"symbol\":\"AAPL\"}" }, + { "topic": "equity_prices", "type": "update", "filters": "{\"symbol\":\"EURUSD\"}" }, + { "topic": "equity_prices", "type": "update", "filters": "{\"symbol\":\"XAUUSD\"}" }, + { "topic": "equity_prices", "type": "update", "filters": "{\"symbol\":\"WTI\"}" } + ] +} +``` + +Use `type: "*"` to receive all message types (live updates and snapshots): + +```json theme={null} +{ + "action": "subscribe", + "subscriptions": [ + { + "topic": "equity_prices", + "type": "*", + "filters": "{\"symbol\":\"GOOGL\"}" + } + ] +} +``` + +Filter values are case-insensitive on subscribe, but the `symbol` field in payloads is always returned lowercase. + +### Live Price Update + +**Apple stock update:** + +```json theme={null} +{ + "topic": "equity_prices", + "type": "update", + "timestamp": 1711382400000, + "payload": { + "symbol": "aapl", + "value": 198.45, + "full_accuracy_value": "198.4523", + "timestamp": 1711382400000, + "received_at": 1711382400005 + } +} +``` + +**Gold price update (market closed):** + +```json theme={null} +{ + "topic": "equity_prices", + "type": "update", + "timestamp": 1711400000000, + "payload": { + "symbol": "xauusd", + "value": 2175.30, + "full_accuracy_value": "2175.3012", + "timestamp": 1711399000000, + "received_at": 1711400000002, + "is_carried_forward": true + } +} +``` + +### Historical Snapshot + +On subscribe, the server delivers a backfill of the last 2 minutes of price data. Use the `type` field to distinguish: `"subscribe"` for the initial snapshot vs `"update"` for live ticks. + +```json theme={null} +{ + "topic": "equity_prices", + "type": "subscribe", + "timestamp": 1711382400000, + "payload": { + "symbol": "aapl", + "data": [ + { "timestamp": 1711382280000, "value": 198.30 }, + { "timestamp": 1711382281000, "value": 198.32 }, + { "timestamp": 1711382340000, "value": 198.41 } + ] + } +} +``` + +### Equity Price Payload Fields + +| Field | Type | Description | +| --------------------- | ------- | --------------------------------------------------------------------------------------------------------- | +| `symbol` | string | Lowercase symbol identifier (e.g., `aapl`, `eurusd`, `xauusd`) | +| `value` | number | Spot price as a float | +| `full_accuracy_value` | string | Full-precision price as a string | +| `timestamp` | number | Price measurement timestamp in Unix milliseconds | +| `received_at` | number | When the system received the price, in Unix milliseconds. Only present when non-zero. | +| `is_carried_forward` | boolean | `true` when the market session is closed and the value is the last known price. Only present when `true`. | + +### Supported Symbols + +**Stocks:** + +| Symbol | Name | +| ------- | -------------- | +| `AAPL` | Apple | +| `TSLA` | Tesla | +| `MSFT` | Microsoft | +| `GOOGL` | Alphabet | +| `AMZN` | Amazon | +| `META` | Meta Platforms | +| `NVDA` | NVIDIA | +| `NFLX` | Netflix | +| `PLTR` | Palantir | +| `OPEN` | Opendoor | +| `RKLB` | Rocket Lab | +| `ABNB` | Airbnb | +| `COIN` | Coinbase | +| `HOOD` | Robinhood | + +**ETFs:** + +| Symbol | Name | +| ------ | ------------------------------------ | +| `QQQ` | Invesco QQQ ETF | +| `SPY` | S\&P 500 ETF | +| `EWY` | iShares MSCI South Korea ETF | +| `VXX` | Barclays iPath Series B S\&P 500 VIX | + +**Forex:** + +| Symbol | Pair | +| -------- | ---------------------------- | +| `EURUSD` | Euro / US Dollar | +| `GBPUSD` | British Pound / US Dollar | +| `USDCAD` | US Dollar / Canadian Dollar | +| `USDJPY` | US Dollar / Japanese Yen | +| `USDKRW` | US Dollar / South Korean Won | + +**Precious Metals:** + +| Symbol | Name | +| -------- | ------ | +| `XAUUSD` | Gold | +| `XAGUSD` | Silver | + +**Commodities** (rolling front-month futures): + +| Symbol | Name | +| ------ | --------------- | +| `WTI` | Crude Oil (WTI) | +| `CC` | Cocoa | +| `NGD` | Natural Gas | + +### Market Hours + +When a market session is closed, the stream continues with the last known price and `is_carried_forward: true`. This lets you distinguish stale prices from live ticks. Update frequency is sub-second (up to 5 per second per feed) during market hours. + ## Comments Real-time comment events on the Polymarket platform, including new comments, replies, reactions, and removals. May require Gamma authentication for user-specific data. @@ -359,3 +544,6 @@ Comments support nested threading: If subscribing to user-specific streams, ensure your `gamma_auth` object includes a valid wallet `address`. Authentication failures will prevent subscription to protected topics. + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/developers/RTDS/RTDS-crypto-prices.md b/docs/developers/RTDS/RTDS-crypto-prices.md index ffd0f0a..02db2fa 100644 --- a/docs/developers/RTDS/RTDS-crypto-prices.md +++ b/docs/developers/RTDS/RTDS-crypto-prices.md @@ -4,9 +4,9 @@ # Real-Time Data Socket -> Stream comments and crypto prices via WebSocket +> Stream comments, crypto prices, and equity prices via WebSocket -The Polymarket Real-Time Data Socket (RTDS) is a WebSocket-based streaming service that provides real-time updates for **comments** and **crypto prices**. +The Polymarket Real-Time Data Socket (RTDS) is a WebSocket-based streaming service that provides real-time updates for **comments**, **crypto prices**, and **equity prices**. Official RTDS TypeScript client (`real-time-data-client`). @@ -59,18 +59,18 @@ All messages follow this structure: } ``` -| Field | Type | Description | -| ----------- | ------ | ----------------------------------------------------------- | -| `topic` | string | The subscription topic (e.g., `crypto_prices`, `comments`) | -| `type` | string | The message type/event (e.g., `update`, `reaction_created`) | -| `timestamp` | number | Unix timestamp in milliseconds when the message was sent | -| `payload` | object | Event-specific data object | +| Field | Type | Description | +| ----------- | ------ | --------------------------------------------------------------------------- | +| `topic` | string | The subscription topic (e.g., `crypto_prices`, `equity_prices`, `comments`) | +| `type` | string | The message type/event (e.g., `update`, `reaction_created`) | +| `timestamp` | number | Unix timestamp in milliseconds when the message was sent | +| `payload` | object | Event-specific data object | ## Crypto Prices Real-time cryptocurrency price data from two sources: **Binance** and **Chainlink**. No authentication required. -### Binance Source (`crypto_prices`) +### Binance Source Subscribe to all symbols: @@ -133,7 +133,7 @@ Symbols use lowercase concatenated format (e.g., `solusdt`, `btcusdt`). } ``` -### Chainlink Source (`crypto_prices_chainlink`) +### Chainlink Source **Trading 15m Crypto Markets?** Get a sponsored Chainlink API key with onboarding support from Chainlink. Fill out [this form](https://pm-ds-request.streams.chain.link/). @@ -225,6 +225,191 @@ Symbols use slash-separated format (e.g., `eth/usd`, `btc/usd`). * `sol/usd` — Solana to USD * `xrp/usd` — XRP to USD +## Equity Prices + +Real-time price data for stocks, ETFs, forex pairs, precious metals, and commodities sourced from **Pyth Network**. No authentication required. + + + **Trading Equity Markets?** Get a Pyth Network data feed - first 30 days free, then \$99/month. [Subscribe here](https://buy.stripe.com/cNi8wPeiq76FgQrbsD4ZG09). + + +All asset classes stream through a single `equity_prices` topic. When you subscribe with a symbol filter, the server sends a historical snapshot (last 2 minutes of data), then continues streaming live updates. + +### Subscribe + +Subscribe to a specific symbol with a JSON filter: + +```json theme={null} +{ + "action": "subscribe", + "subscriptions": [ + { + "topic": "equity_prices", + "type": "update", + "filters": "{\"symbol\":\"AAPL\"}" + } + ] +} +``` + +Subscribe to multiple symbols across asset classes: + +```json theme={null} +{ + "action": "subscribe", + "subscriptions": [ + { "topic": "equity_prices", "type": "update", "filters": "{\"symbol\":\"AAPL\"}" }, + { "topic": "equity_prices", "type": "update", "filters": "{\"symbol\":\"EURUSD\"}" }, + { "topic": "equity_prices", "type": "update", "filters": "{\"symbol\":\"XAUUSD\"}" }, + { "topic": "equity_prices", "type": "update", "filters": "{\"symbol\":\"WTI\"}" } + ] +} +``` + +Use `type: "*"` to receive all message types (live updates and snapshots): + +```json theme={null} +{ + "action": "subscribe", + "subscriptions": [ + { + "topic": "equity_prices", + "type": "*", + "filters": "{\"symbol\":\"GOOGL\"}" + } + ] +} +``` + +Filter values are case-insensitive on subscribe, but the `symbol` field in payloads is always returned lowercase. + +### Live Price Update + +**Apple stock update:** + +```json theme={null} +{ + "topic": "equity_prices", + "type": "update", + "timestamp": 1711382400000, + "payload": { + "symbol": "aapl", + "value": 198.45, + "full_accuracy_value": "198.4523", + "timestamp": 1711382400000, + "received_at": 1711382400005 + } +} +``` + +**Gold price update (market closed):** + +```json theme={null} +{ + "topic": "equity_prices", + "type": "update", + "timestamp": 1711400000000, + "payload": { + "symbol": "xauusd", + "value": 2175.30, + "full_accuracy_value": "2175.3012", + "timestamp": 1711399000000, + "received_at": 1711400000002, + "is_carried_forward": true + } +} +``` + +### Historical Snapshot + +On subscribe, the server delivers a backfill of the last 2 minutes of price data. Use the `type` field to distinguish: `"subscribe"` for the initial snapshot vs `"update"` for live ticks. + +```json theme={null} +{ + "topic": "equity_prices", + "type": "subscribe", + "timestamp": 1711382400000, + "payload": { + "symbol": "aapl", + "data": [ + { "timestamp": 1711382280000, "value": 198.30 }, + { "timestamp": 1711382281000, "value": 198.32 }, + { "timestamp": 1711382340000, "value": 198.41 } + ] + } +} +``` + +### Equity Price Payload Fields + +| Field | Type | Description | +| --------------------- | ------- | --------------------------------------------------------------------------------------------------------- | +| `symbol` | string | Lowercase symbol identifier (e.g., `aapl`, `eurusd`, `xauusd`) | +| `value` | number | Spot price as a float | +| `full_accuracy_value` | string | Full-precision price as a string | +| `timestamp` | number | Price measurement timestamp in Unix milliseconds | +| `received_at` | number | When the system received the price, in Unix milliseconds. Only present when non-zero. | +| `is_carried_forward` | boolean | `true` when the market session is closed and the value is the last known price. Only present when `true`. | + +### Supported Symbols + +**Stocks:** + +| Symbol | Name | +| ------- | -------------- | +| `AAPL` | Apple | +| `TSLA` | Tesla | +| `MSFT` | Microsoft | +| `GOOGL` | Alphabet | +| `AMZN` | Amazon | +| `META` | Meta Platforms | +| `NVDA` | NVIDIA | +| `NFLX` | Netflix | +| `PLTR` | Palantir | +| `OPEN` | Opendoor | +| `RKLB` | Rocket Lab | +| `ABNB` | Airbnb | +| `COIN` | Coinbase | +| `HOOD` | Robinhood | + +**ETFs:** + +| Symbol | Name | +| ------ | ------------------------------------ | +| `QQQ` | Invesco QQQ ETF | +| `SPY` | S\&P 500 ETF | +| `EWY` | iShares MSCI South Korea ETF | +| `VXX` | Barclays iPath Series B S\&P 500 VIX | + +**Forex:** + +| Symbol | Pair | +| -------- | ---------------------------- | +| `EURUSD` | Euro / US Dollar | +| `GBPUSD` | British Pound / US Dollar | +| `USDCAD` | US Dollar / Canadian Dollar | +| `USDJPY` | US Dollar / Japanese Yen | +| `USDKRW` | US Dollar / South Korean Won | + +**Precious Metals:** + +| Symbol | Name | +| -------- | ------ | +| `XAUUSD` | Gold | +| `XAGUSD` | Silver | + +**Commodities** (rolling front-month futures): + +| Symbol | Name | +| ------ | --------------- | +| `WTI` | Crude Oil (WTI) | +| `CC` | Cocoa | +| `NGD` | Natural Gas | + +### Market Hours + +When a market session is closed, the stream continues with the last known price and `is_carried_forward: true`. This lets you distinguish stale prices from live ticks. Update frequency is sub-second (up to 5 per second per feed) during market hours. + ## Comments Real-time comment events on the Polymarket platform, including new comments, replies, reactions, and removals. May require Gamma authentication for user-specific data. @@ -359,3 +544,6 @@ Comments support nested threading: If subscribing to user-specific streams, ensure your `gamma_auth` object includes a valid wallet `address`. Authentication failures will prevent subscription to protected topics. + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/developers/RTDS/RTDS-overview.md b/docs/developers/RTDS/RTDS-overview.md index ffd0f0a..02db2fa 100644 --- a/docs/developers/RTDS/RTDS-overview.md +++ b/docs/developers/RTDS/RTDS-overview.md @@ -4,9 +4,9 @@ # Real-Time Data Socket -> Stream comments and crypto prices via WebSocket +> Stream comments, crypto prices, and equity prices via WebSocket -The Polymarket Real-Time Data Socket (RTDS) is a WebSocket-based streaming service that provides real-time updates for **comments** and **crypto prices**. +The Polymarket Real-Time Data Socket (RTDS) is a WebSocket-based streaming service that provides real-time updates for **comments**, **crypto prices**, and **equity prices**. Official RTDS TypeScript client (`real-time-data-client`). @@ -59,18 +59,18 @@ All messages follow this structure: } ``` -| Field | Type | Description | -| ----------- | ------ | ----------------------------------------------------------- | -| `topic` | string | The subscription topic (e.g., `crypto_prices`, `comments`) | -| `type` | string | The message type/event (e.g., `update`, `reaction_created`) | -| `timestamp` | number | Unix timestamp in milliseconds when the message was sent | -| `payload` | object | Event-specific data object | +| Field | Type | Description | +| ----------- | ------ | --------------------------------------------------------------------------- | +| `topic` | string | The subscription topic (e.g., `crypto_prices`, `equity_prices`, `comments`) | +| `type` | string | The message type/event (e.g., `update`, `reaction_created`) | +| `timestamp` | number | Unix timestamp in milliseconds when the message was sent | +| `payload` | object | Event-specific data object | ## Crypto Prices Real-time cryptocurrency price data from two sources: **Binance** and **Chainlink**. No authentication required. -### Binance Source (`crypto_prices`) +### Binance Source Subscribe to all symbols: @@ -133,7 +133,7 @@ Symbols use lowercase concatenated format (e.g., `solusdt`, `btcusdt`). } ``` -### Chainlink Source (`crypto_prices_chainlink`) +### Chainlink Source **Trading 15m Crypto Markets?** Get a sponsored Chainlink API key with onboarding support from Chainlink. Fill out [this form](https://pm-ds-request.streams.chain.link/). @@ -225,6 +225,191 @@ Symbols use slash-separated format (e.g., `eth/usd`, `btc/usd`). * `sol/usd` — Solana to USD * `xrp/usd` — XRP to USD +## Equity Prices + +Real-time price data for stocks, ETFs, forex pairs, precious metals, and commodities sourced from **Pyth Network**. No authentication required. + + + **Trading Equity Markets?** Get a Pyth Network data feed - first 30 days free, then \$99/month. [Subscribe here](https://buy.stripe.com/cNi8wPeiq76FgQrbsD4ZG09). + + +All asset classes stream through a single `equity_prices` topic. When you subscribe with a symbol filter, the server sends a historical snapshot (last 2 minutes of data), then continues streaming live updates. + +### Subscribe + +Subscribe to a specific symbol with a JSON filter: + +```json theme={null} +{ + "action": "subscribe", + "subscriptions": [ + { + "topic": "equity_prices", + "type": "update", + "filters": "{\"symbol\":\"AAPL\"}" + } + ] +} +``` + +Subscribe to multiple symbols across asset classes: + +```json theme={null} +{ + "action": "subscribe", + "subscriptions": [ + { "topic": "equity_prices", "type": "update", "filters": "{\"symbol\":\"AAPL\"}" }, + { "topic": "equity_prices", "type": "update", "filters": "{\"symbol\":\"EURUSD\"}" }, + { "topic": "equity_prices", "type": "update", "filters": "{\"symbol\":\"XAUUSD\"}" }, + { "topic": "equity_prices", "type": "update", "filters": "{\"symbol\":\"WTI\"}" } + ] +} +``` + +Use `type: "*"` to receive all message types (live updates and snapshots): + +```json theme={null} +{ + "action": "subscribe", + "subscriptions": [ + { + "topic": "equity_prices", + "type": "*", + "filters": "{\"symbol\":\"GOOGL\"}" + } + ] +} +``` + +Filter values are case-insensitive on subscribe, but the `symbol` field in payloads is always returned lowercase. + +### Live Price Update + +**Apple stock update:** + +```json theme={null} +{ + "topic": "equity_prices", + "type": "update", + "timestamp": 1711382400000, + "payload": { + "symbol": "aapl", + "value": 198.45, + "full_accuracy_value": "198.4523", + "timestamp": 1711382400000, + "received_at": 1711382400005 + } +} +``` + +**Gold price update (market closed):** + +```json theme={null} +{ + "topic": "equity_prices", + "type": "update", + "timestamp": 1711400000000, + "payload": { + "symbol": "xauusd", + "value": 2175.30, + "full_accuracy_value": "2175.3012", + "timestamp": 1711399000000, + "received_at": 1711400000002, + "is_carried_forward": true + } +} +``` + +### Historical Snapshot + +On subscribe, the server delivers a backfill of the last 2 minutes of price data. Use the `type` field to distinguish: `"subscribe"` for the initial snapshot vs `"update"` for live ticks. + +```json theme={null} +{ + "topic": "equity_prices", + "type": "subscribe", + "timestamp": 1711382400000, + "payload": { + "symbol": "aapl", + "data": [ + { "timestamp": 1711382280000, "value": 198.30 }, + { "timestamp": 1711382281000, "value": 198.32 }, + { "timestamp": 1711382340000, "value": 198.41 } + ] + } +} +``` + +### Equity Price Payload Fields + +| Field | Type | Description | +| --------------------- | ------- | --------------------------------------------------------------------------------------------------------- | +| `symbol` | string | Lowercase symbol identifier (e.g., `aapl`, `eurusd`, `xauusd`) | +| `value` | number | Spot price as a float | +| `full_accuracy_value` | string | Full-precision price as a string | +| `timestamp` | number | Price measurement timestamp in Unix milliseconds | +| `received_at` | number | When the system received the price, in Unix milliseconds. Only present when non-zero. | +| `is_carried_forward` | boolean | `true` when the market session is closed and the value is the last known price. Only present when `true`. | + +### Supported Symbols + +**Stocks:** + +| Symbol | Name | +| ------- | -------------- | +| `AAPL` | Apple | +| `TSLA` | Tesla | +| `MSFT` | Microsoft | +| `GOOGL` | Alphabet | +| `AMZN` | Amazon | +| `META` | Meta Platforms | +| `NVDA` | NVIDIA | +| `NFLX` | Netflix | +| `PLTR` | Palantir | +| `OPEN` | Opendoor | +| `RKLB` | Rocket Lab | +| `ABNB` | Airbnb | +| `COIN` | Coinbase | +| `HOOD` | Robinhood | + +**ETFs:** + +| Symbol | Name | +| ------ | ------------------------------------ | +| `QQQ` | Invesco QQQ ETF | +| `SPY` | S\&P 500 ETF | +| `EWY` | iShares MSCI South Korea ETF | +| `VXX` | Barclays iPath Series B S\&P 500 VIX | + +**Forex:** + +| Symbol | Pair | +| -------- | ---------------------------- | +| `EURUSD` | Euro / US Dollar | +| `GBPUSD` | British Pound / US Dollar | +| `USDCAD` | US Dollar / Canadian Dollar | +| `USDJPY` | US Dollar / Japanese Yen | +| `USDKRW` | US Dollar / South Korean Won | + +**Precious Metals:** + +| Symbol | Name | +| -------- | ------ | +| `XAUUSD` | Gold | +| `XAGUSD` | Silver | + +**Commodities** (rolling front-month futures): + +| Symbol | Name | +| ------ | --------------- | +| `WTI` | Crude Oil (WTI) | +| `CC` | Cocoa | +| `NGD` | Natural Gas | + +### Market Hours + +When a market session is closed, the stream continues with the last known price and `is_carried_forward: true`. This lets you distinguish stale prices from live ticks. Update frequency is sub-second (up to 5 per second per feed) during market hours. + ## Comments Real-time comment events on the Polymarket platform, including new comments, replies, reactions, and removals. May require Gamma authentication for user-specific data. @@ -359,3 +544,6 @@ Comments support nested threading: If subscribing to user-specific streams, ensure your `gamma_auth` object includes a valid wallet `address`. Authentication failures will prevent subscription to protected topics. + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/developers/builders/blockchain-data-resources.md b/docs/developers/builders/blockchain-data-resources.md index 6aebddc..11d7ca6 100644 --- a/docs/developers/builders/blockchain-data-resources.md +++ b/docs/developers/builders/blockchain-data-resources.md @@ -2,91 +2,72 @@ > Fetch the complete documentation index at: https://docs.polymarket.com/llms.txt > Use this file to discover all available pages before exploring further. -# Contract Addresses +# Data Resources -> All Polymarket smart contract addresses on Polygon +> Access Polymarket on-chain activity for data & analytics -All Polymarket contracts are deployed on **Polygon mainnet** (Chain ID: 137). This is the single source of truth for all contract addresses used across the platform. +Polymarket data that lands on the blockchain, such as trades, balances, positions, and redeems, is available through various on-chain analytics platforms and blockchain data providers. Polymarket also provides its own APIs and WebSockets. See the [API Endpoints reference](/quickstart/reference/endpoints) for more information. + +The purpose of this page is to serve as a public good for Polymarket builders, researches, and analysts alike. *** -## Core Trading Contracts +## Data -| Contract | Address | Description | -| ------------------------ | -------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------- | -| CTF Exchange | [`0x4bFb41d5B3570DeFd03C39a9A4D8dE6Bd8B8982E`](https://polygonscan.com/address/0x4bFb41d5B3570DeFd03C39a9A4D8dE6Bd8B8982E) | Standard market order matching and settlement | -| Neg Risk CTF Exchange | [`0xC5d563A36AE78145C45a50134d48A1215220f80a`](https://polygonscan.com/address/0xC5d563A36AE78145C45a50134d48A1215220f80a) | Order matching for [neg risk](/advanced/neg-risk) (multi-outcome) markets | -| Neg Risk Adapter | [`0xd91E80cF2E7be2e162c6513ceD06f1dD0dA35296`](https://polygonscan.com/address/0xd91E80cF2E7be2e162c6513ceD06f1dD0dA35296) | Converts No tokens between outcomes in neg risk markets | -| Conditional Tokens (CTF) | [`0x4D97DCd97eC945f40cF65F87097ACe5EA0476045`](https://polygonscan.com/address/0x4D97DCd97eC945f40cF65F87097ACe5EA0476045) | ERC1155 token storage — split, merge, and redeem operations | +### Goldsky -*** +[Goldsky](https://docs.goldsky.com/chains/polymarket) provides real-time streaming pipelines for Polymarket on-chain activity (i.e. trades, balances, positions, etc...) into your own database/data warehouse. -## Token Contracts +Goldsky also partnered with [ClickHouse](https://clickhouse.com) to create [CryptoHouse](https://crypto.clickhouse.com), where you can query Polymarket on-chain data using SQL. -| Contract | Address | Description | -| --------------------- | -------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- | -| USDC.e (Bridged USDC) | [`0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174`](https://polygonscan.com/address/0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174) | Collateral token used for all Polymarket trading (6 decimals) | +### Dune -*** +[Dune](https://dune.com) is a blockchain analytics platform that has Polymarket on-chain activity (i.e. trades, balances, positions, etc...). Query Polymarket data using SQL, create custom dashboards, and more. -## Wallet Factory Contracts +Here are a few simple queries to get started: -| Contract | Address | Description | -| ------------------------ | -------------------------------------------------------------------------------------------------------------------------- | --------------------- | -| Gnosis Safe Factory | [`0xaacfeea03eb1561c4e67d661e40682bd20e3541b`](https://polygonscan.com/address/0xaacfeea03eb1561c4e67d661e40682bd20e3541b) | Deploys Safe wallets | -| Polymarket Proxy Factory | [`0xaB45c5A4B0c941a2F231C04C3f49182e1A254052`](https://polygonscan.com/address/0xaB45c5A4B0c941a2F231C04C3f49182e1A254052) | Deploys proxy wallets | +| Query | Description | Link | +| ------------- | --------------------------------------------- | --------------------------------------------------- | +| Volume | Notional Volume and Maker & Taker USDC Volume | [View Dune Query](https://dune.com/queries/6545441) | +| TVL | USDC locked in Polymarket smart contracts | [View Dune Query](https://dune.com/queries/6588784) | +| Open Interest | Estimated market open interest, and over time | [View Dune Query](https://dune.com/queries/6555478) | -*** +### Allium -## Resolution Contracts +[Allium](https://docs.allium.so/historical-data/predictions) is a blockchain analytics platform that has Polymarket on-chain activity (i.e. trades, balances, positions, etc...). Query Polymarket data using SQL, create custom dashboards, and more. -| Contract | Address | Description | -| --------------------- | -------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------- | -| UMA Adapter | [`0x6A9D222616C90FcA5754cd1333cFD9b7fb6a4F74`](https://polygonscan.com/address/0x6A9D222616C90FcA5754cd1333cFD9b7fb6a4F74) | Adapter connecting Polymarket to the UMA Optimistic Oracle | -| UMA Optimistic Oracle | [`0xCB1822859cEF82Cd2Eb4E6276C7916e692995130`](https://polygonscan.com/address/0xCB1822859cEF82Cd2Eb4E6276C7916e692995130) | Handles market resolution proposals and disputes | +\-- -*** +## Dashboards -## Liquidity +Third-party blockchain analytics platforms that aggregate and visualize Polymarket data: -| Contract | Address | Description | -| --------------------------- | -------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------- | -| Uniswap v3 USDC.e/USDC Pool | [`0xd36ec33c8bed5a9f7b6630855f1533455b98a418`](https://polygonscan.com/address/0xd36ec33c8bed5a9f7b6630855f1533455b98a418) | Used for USDC.e ↔ USDC conversion during withdrawals | + + -*** + -## Source Code + - - - Order matching and settlement contracts - + - - Gnosis Conditional Token Framework (ERC1155) - + + + + + -*** +### Community Dashboards -## Usage in Code +Community-created Dune dashboards of Polymarket on-chain analytics: - - ```typescript TypeScript theme={null} - const ADDRESSES = { - USDC_E: "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174", - CTF: "0x4D97DCd97eC945f40cF65F87097ACe5EA0476045", - CTF_EXCHANGE: "0x4bFb41d5B3570DeFd03C39a9A4D8dE6Bd8B8982E", - NEG_RISK_CTF_EXCHANGE: "0xC5d563A36AE78145C45a50134d48A1215220f80a", - }; - ``` +| Dashboard | Created By | Link | +| ------------------------------------------------- | ----------------------------------------------- | ---------------------------------------------------------------------------- | +| Polymarket Overview | [@datadashboards](https://x.com/datadashboards) | [View Dashboard](https://dune.com/datadashboards/polymarket-overview) | +| Polymarket Volume, OI, Markets, Addresses and TVL | [@hildobby](https://x.com/hildobby) | [View Dashboard](https://dune.com/hildobby/polymarket) | +| Polymarket Historical Accuracy | [@alexmccullaaa](https://x.com/alexmccullaaa) | [View Dashboard](https://dune.com/alexmccullough/how-accurate-is-polymarket) | +| Polymarket Builders Dashboard | [@defioasis](https://x.com/defioasis) | [View Dashboard](https://dune.com/gateresearch/pmbuilders) | - ```python Python theme={null} - ADDRESSES = { - "USDC_E": "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174", - "CTF": "0x4D97DCd97eC945f40cF65F87097ACe5EA0476045", - "CTF_EXCHANGE": "0x4bFb41d5B3570DeFd03C39a9A4D8dE6Bd8B8982E", - "NEG_RISK_CTF_EXCHANGE": "0xC5d563A36AE78145C45a50134d48A1215220f80a", - } - ``` - + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/developers/builders/builder-intro.md b/docs/developers/builders/builder-intro.md index 7a76bba..d310acb 100644 --- a/docs/developers/builders/builder-intro.md +++ b/docs/developers/builders/builder-intro.md @@ -20,17 +20,12 @@ A **builder** is a person, group, or organization that routes orders from users - - Earn a share of fees on orders you route - - ### What You Get | Benefit | Description | | ------------------- | ------------------------------------------------------------------------------- | | **Relayer Access** | Gas-free wallet deployment, approvals, order execution and CTF operations | | **Volume Tracking** | All orders attributed to your builder profile | -| **Weekly Rewards** | USDC rewards program based on volume (Verified+) | | **Leaderboard** | Public visibility on [builders.polymarket.com](https://builders.polymarket.com) | | **Support** | Telegram channel and engineering support (Verified+) | @@ -88,7 +83,7 @@ A **builder** is a person, group, or organization that routes orders from users -## SDKs & Libraries +## SDKs and Libraries @@ -216,3 +211,6 @@ For existing Magic Link users from Polymarket.com: Set up gasless transactions for your users. + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/developers/builders/builder-profile.md b/docs/developers/builders/builder-profile.md index 7a76bba..d310acb 100644 --- a/docs/developers/builders/builder-profile.md +++ b/docs/developers/builders/builder-profile.md @@ -20,17 +20,12 @@ A **builder** is a person, group, or organization that routes orders from users - - Earn a share of fees on orders you route - - ### What You Get | Benefit | Description | | ------------------- | ------------------------------------------------------------------------------- | | **Relayer Access** | Gas-free wallet deployment, approvals, order execution and CTF operations | | **Volume Tracking** | All orders attributed to your builder profile | -| **Weekly Rewards** | USDC rewards program based on volume (Verified+) | | **Leaderboard** | Public visibility on [builders.polymarket.com](https://builders.polymarket.com) | | **Support** | Telegram channel and engineering support (Verified+) | @@ -88,7 +83,7 @@ A **builder** is a person, group, or organization that routes orders from users -## SDKs & Libraries +## SDKs and Libraries @@ -216,3 +211,6 @@ For existing Magic Link users from Polymarket.com: Set up gasless transactions for your users. + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/developers/builders/builder-tiers.md b/docs/developers/builders/builder-tiers.md index c713cff..034a2d9 100644 --- a/docs/developers/builders/builder-tiers.md +++ b/docs/developers/builders/builder-tiers.md @@ -6,53 +6,45 @@ > Rate limits, rewards, and how to upgrade -The Builder Program uses a tiered system to manage rate limits while rewarding high-performing integrations. Higher tiers unlock increased limits, weekly rewards, revenue sharing, and priority support. +The Builder Program uses a tiered system to manage rate limits while rewarding high-performing integrations. Higher tiers unlock increased limits, weekly rewards, and priority support. ## Feature Definitions -| Feature | Description | -| --------------------------- | -------------------------------------------------------------------------- | -| **Daily Relayer Txn Limit** | Maximum Relayer transactions per day for Safe/Proxy wallet operations | -| **API Rate Limits** | Rate limits for non-relayer endpoints (CLOB, Gamma, etc.) | -| **Subsidized Transactions** | Gas fees subsidized for Relayer and CLOB operations via Safe/Proxy wallets | -| **Order Attribution** | Orders tracked and attributed to your Builder profile | -| **RevShare Protocol** | Infrastructure allowing Builders to charge fees | -| **Leaderboard Visibility** | Visibility on the [Builder Leaderboard](https://builders.polymarket.com/) | -| **Weekly Rewards** | Weekly USDC rewards program for visible builders based on volume | -| **Grants** | Builder grants subject to approval, awarded based on innovation and impact | -| **Telegram Channel** | Private Builders channel for announcements and support | -| **Badge** | Verified Builder affiliate badge on your Builder profile | -| **Engineering Support** | Direct access to engineering team | -| **Marketing Support** | Promotion via official Polymarket social accounts | -| **Weekly Reward Boosts** | Multiplier on the weekly USDC rewards program for visible builders | -| **Priority Access** | Early access to new features and products | +| Feature | Description | +| --------------------------- | ------------------------------------------------------------------------- | +| **Daily Relayer Txn Limit** | Maximum Relayer transactions per day for Safe/Proxy wallet operations | +| **API Rate Limits** | Rate limits for non-relayer endpoints (CLOB, Gamma, etc.) | +| **Gasless Trading** | Gas fees subsidized for trading via Safe/Proxy wallets | +| **Order Attribution** | Orders tracked and attributed to your Builder profile | +| **Builder Fees** | Builders who route orders can charge fees and monetize on flow | +| **Leaderboard Visibility** | Visibility on the [Builder Leaderboard](https://builders.polymarket.com/) | +| **Telegram Channel** | Private Builders channel for announcements and support | +| **Engineering Support** | Direct access to engineering team | +| **Marketing Support** | Promotion via official Polymarket social accounts | +| **Priority Access** | Early access to new features and products | *** ## Tier Comparison -| Feature | Unverified | Verified | Partner | -| --------------------------- | :-----------------: | :-----------------: | :-----------------: | -| **Daily Relayer Txn Limit** | 100/day | 3,000/day | Unlimited | -| **API Rate Limits** | Standard | Standard | Highest | -| **Subsidized Transactions** | Yes | Yes | Yes | -| **Order Attribution** | Yes | Yes | Yes | -| **RevShare Protocol** | — | Yes | Yes | -| **Leaderboard Visibility** | — | Yes | Yes | -| **Weekly Rewards** | — | Yes | Yes | -| **Grants** | Subject to approval | Subject to approval | Subject to approval | -| **Telegram Channel** | — | Yes | Yes | -| **Badge** | — | Yes | Yes | -| **Engineering Support** | — | Standard | Elevated | -| **Marketing Support** | — | Standard | Elevated | -| **Weekly Reward Boosts** | — | — | Yes | -| **Priority Access** | — | — | Yes | +| Feature | Unverified | Verified | Partner | +| --------------------------- | :--------: | :-------: | :-------: | +| **Daily Relayer Txn Limit** | 100/day | 3,000/day | Unlimited | +| **API Rate Limits** | Standard | Standard | Highest | +| **Gasless Trading**\* | Yes | Yes | Yes | +| **Order Attribution** | Yes | Yes | Yes | +| **Builder Fees** | Yes | Yes | Yes | +| **Leaderboard Visibility** | — | Yes | Yes | +| **Telegram Channel** | — | Yes | Yes | +| **Engineering Support** | — | Standard | Elevated | +| **Marketing Support** | — | Standard | Elevated | +| **Priority Access** | — | — | Yes | *** ## Unverified - + The default tier for all new builders. Start immediately with no approval required. @@ -68,48 +60,42 @@ The Builder Program uses a tiered system to manage rate limits while rewarding h * Gasless trading on all CLOB orders through Safe/Proxy wallets * Gas subsidized on all Relayer transactions up to daily limit (through Safe/Proxy wallets) -* Order attribution to your builder profile * Access to all client libraries and documentation *** ## Verified - + For builders who need higher throughput. Requires manual approval. **How to upgrade:** -Contact us with: +Contact us at [builder@polymarket.com](mailto:builder@polymarket.com) with: * Your Builder API Key * Use case description * Expected volume -* Links to your app, docs, or X profile +* Other relevant information (links, docs, decks, etc.) **Unlocks over Unverified:** * 30x daily Relayer transaction limit -* RevShare Protocol access +* Monetize with Builder fees * Leaderboard visibility at [builders.polymarket.com](https://builders.polymarket.com) -* Weekly USDC rewards based on volume * Private Telegram channel for announcements and support -* Verified affiliate badge and promotion from [@PolymarketBuild](https://x.com/PolymarketBuild) +* Weekly USDC rewards based on volume (subject to approval) * Grants (subject to approval) *** ## Partner - + Enterprise tier for high-volume integrations and strategic partners. -**How to apply:** - -Reach out to [builder@polymarket.com](mailto:builder@polymarket.com) to discuss partnership opportunities. - **Unlocks over Verified:** * Unlimited Relayer transactions @@ -117,7 +103,6 @@ Reach out to [builder@polymarket.com](mailto:builder@polymarket.com) to discuss * Elevated engineering support * Elevated and coordinated marketing support * Priority access to new features and products -* Multiplier on the Weekly Rewards Program *** @@ -154,18 +139,19 @@ Ready to upgrade or have questions? ## FAQ - + Verification is displayed in your [Builder Profile](https://polymarket.com/settings?tab=builder) settings. - + Relayer requests beyond your daily limit will be rate-limited and return an error. Consider upgrading to Verified or Partner tier if you're hitting limits. - - For special events or product launches, contact [builder@polymarket.com](mailto:builder@polymarket.com). + + If you're not routing orders for other users (wallets), you can get unlimited + daily Relay transactions by obtaining a [Relayer API key](https://polymarket.com/settings?tab=api-keys). @@ -182,3 +168,6 @@ Ready to upgrade or have questions? Configure your client to credit trades to your account. + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/developers/builders/examples.md b/docs/developers/builders/examples.md index 7a76bba..d310acb 100644 --- a/docs/developers/builders/examples.md +++ b/docs/developers/builders/examples.md @@ -20,17 +20,12 @@ A **builder** is a person, group, or organization that routes orders from users - - Earn a share of fees on orders you route - - ### What You Get | Benefit | Description | | ------------------- | ------------------------------------------------------------------------------- | | **Relayer Access** | Gas-free wallet deployment, approvals, order execution and CTF operations | | **Volume Tracking** | All orders attributed to your builder profile | -| **Weekly Rewards** | USDC rewards program based on volume (Verified+) | | **Leaderboard** | Public visibility on [builders.polymarket.com](https://builders.polymarket.com) | | **Support** | Telegram channel and engineering support (Verified+) | @@ -88,7 +83,7 @@ A **builder** is a person, group, or organization that routes orders from users -## SDKs & Libraries +## SDKs and Libraries @@ -216,3 +211,6 @@ For existing Magic Link users from Polymarket.com: Set up gasless transactions for your users. + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/developers/builders/order-attribution.md b/docs/developers/builders/order-attribution.md index 59ea528..cb0ee83 100644 --- a/docs/developers/builders/order-attribution.md +++ b/docs/developers/builders/order-attribution.md @@ -33,7 +33,7 @@ Each builder receives API credentials from their [Builder Profile](https://polym *** -## Remote Signing (Recommended) +## Remote Signing Remote signing keeps your builder credentials secure on a server you control. The user's client sends order details to your server, which adds the builder headers before forwarding to the CLOB. @@ -165,6 +165,27 @@ Point the CLOB client to your signing server: # Orders automatically include builder headers response = client.create_and_post_order(...) ``` + + ```rust Rust theme={null} + use polymarket_client_sdk::auth::builder::Config as BuilderConfig; + use polymarket_client_sdk::clob::types::SignatureType; + + // First, authenticate as a normal user + let client = Client::new("https://clob.polymarket.com", Config::default())? + .authentication_builder(&signer) + .signature_type(SignatureType::GnosisSafe) + .authenticate() + .await?; + + // Then promote to builder with remote signing + let builder_config = BuilderConfig::remote( + "https://your-server.com/sign", + Some("optional-auth-token".to_owned()), + )?; + let client = client.promote_to_builder(builder_config).await?; + + // Orders automatically include builder headers + ``` *** @@ -235,6 +256,21 @@ Sign orders locally when you control the entire order placement flow (e.g., your # Orders automatically include builder headers response = client.create_and_post_order(...) ``` + + ```rust Rust theme={null} + use polymarket_client_sdk::auth::{Credentials, builder::Config as BuilderConfig}; + + let builder_creds = Credentials::new( + std::env::var("POLY_BUILDER_API_KEY")?.parse()?, + std::env::var("POLY_BUILDER_SECRET")?, + std::env::var("POLY_BUILDER_PASSPHRASE")?, + ); + + let builder_config = BuilderConfig::local(builder_creds); + let client = client.promote_to_builder(builder_config).await?; + + // Orders automatically include builder headers + ``` *** @@ -281,6 +317,18 @@ Query trades attributed to your builder account to verify attribution is working market="0xbd31dc8a..." ) ``` + + ```rust Rust theme={null} + use polymarket_client_sdk::clob::types::request::TradesRequest; + + let trades = client.builder_trades(&TradesRequest::default(), None).await?; + + // Filtered by market + let request = TradesRequest::builder() + .market("0xbd31dc8a...".parse()?) + .build(); + let market_trades = client.builder_trades(&request, None).await?; + ``` Each `BuilderTrade` includes: `id`, `market`, `assetId`, `side`, `size`, `price`, `status`, `outcome`, `owner`, `maker`, `transactionHash`, `matchTime`, `fee`, and `feeUsdc`. @@ -297,6 +345,10 @@ If your credentials are compromised, revoke them immediately: ```python Python theme={null} client.revoke_builder_api_key() ``` + + ```rust Rust theme={null} + client.revoke_builder_api_key().await?; + ``` After revoking, generate new credentials from your [Builder Profile](https://polymarket.com/settings?tab=builder). @@ -337,3 +389,6 @@ After revoking, generate new credentials from your [Builder Profile](https://pol Build, sign, and submit orders + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/developers/builders/relayer-client.md b/docs/developers/builders/relayer-client.md index 50f7186..6c0a6eb 100644 --- a/docs/developers/builders/relayer-client.md +++ b/docs/developers/builders/relayer-client.md @@ -19,11 +19,10 @@ The relayer acts as a transaction sponsor: 5. The transaction executes from the user's wallet - Gasless transactions require **Builder Program** membership. You'll need - Builder API credentials to authenticate with the relayer. + Gasless transactions require authentication with **Builder API Keys** or **Relayer API Keys**. -## What's Covered +## What Is Covered Polymarket pays gas for all operations routed through the relayer: @@ -34,15 +33,51 @@ Polymarket pays gas for all operations routed through the relayer: | **CTF operations** | Split, merge, and redeem positions | | **Transfers** | Move tokens between addresses | +## Authentication + +The relayer supports two authentication methods. Choose the one that fits your use case. + +### Using Builder API Keys + +Builder API Keys are for [Builder Program](/builders/overview) members. They authenticate via HMAC-SHA256 signed headers and are required to use the relayer SDKs. + +All requests must include these headers: + +| Header | Description | +| ------------------------- | ----------------------- | +| `POLY_BUILDER_API_KEY` | Your Builder API key | +| `POLY_BUILDER_TIMESTAMP` | Unix timestamp | +| `POLY_BUILDER_PASSPHRASE` | Your Builder passphrase | +| `POLY_BUILDER_SIGNATURE` | HMAC-SHA256 signature | + +The SDKs handle header generation automatically when you provide your credentials via `BuilderConfig`. + +### Using Relayer API Keys + +Relayer API Keys are for market makers and anyone who needs a simpler alternative. You can create them from [Settings > API Keys](https://polymarket.com/settings?tab=api-keys) on the Polymarket website. + +Include these headers with your requests: + +| Header | Description | +| ------------------------- | ----------------------------- | +| `RELAYER_API_KEY` | Your Relayer API key | +| `RELAYER_API_KEY_ADDRESS` | The address that owns the key | + + + If you want to use the Relayer API Key directly without the SDK, see the [Relayer API Reference](/api-reference/relayer). + + ## Prerequisites Before using the relayer, you need: -| Requirement | Source | -| ---------------------------- | -------------------------------------------------------------- | -| Builder API credentials | [Builder Profile](https://polymarket.com/settings?tab=builder) | -| User's private key or signer | Your wallet integration | -| USDC.e balance | For trading (not for gas) | +| Requirement | Source | +| ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | +| Builder API credentials **or** Relayer API key | [Builder Profile](https://polymarket.com/settings?tab=builder) or [Settings > API Keys](https://polymarket.com/settings?tab=api-keys) | +| User's private key or signer | Your wallet integration | +| USDC.e balance | For trading (not for gas) | + +> The below section is for the Builder SDKs only. If you want to use the Relayer API Key directly without the SDK, see the [Relayer API Reference](/api-reference/relayer). ## Installation @@ -238,19 +273,6 @@ Initialize the relayer client with your signing configuration: variables or a secrets manager.
-### Relayer Authentication Headers - -All requests to the relayer must include these authentication headers: - -| Header | Description | -| ------------------------- | ----------------------- | -| `POLY_BUILDER_API_KEY` | Your Builder API key | -| `POLY_BUILDER_TIMESTAMP` | Unix timestamp | -| `POLY_BUILDER_PASSPHRASE` | Your Builder passphrase | -| `POLY_BUILDER_SIGNATURE` | HMAC-SHA256 signature | - -The SDKs handle header generation automatically when you provide your credentials via `BuilderConfig`. - ## Wallet Types Choose a wallet type when initializing the client: @@ -553,3 +575,6 @@ See [Contract Addresses](/resources/contract-addresses) for all Polymarket smart Understand token operations like split, merge, and redeem. + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/developers/gamma-markets-api/fetch-markets-guide.md b/docs/developers/gamma-markets-api/fetch-markets-guide.md index ee119af..ee49404 100644 --- a/docs/developers/gamma-markets-api/fetch-markets-guide.md +++ b/docs/developers/gamma-markets-api/fetch-markets-guide.md @@ -158,3 +158,6 @@ curl "https://gamma-api.polymarket.com/events?active=true&closed=false&limit=50& Query onchain data directly from the Polymarket subgraph. + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/developers/gamma-markets-api/gamma-structure.md b/docs/developers/gamma-markets-api/gamma-structure.md index 1a2fedd..8ff4072 100644 --- a/docs/developers/gamma-markets-api/gamma-structure.md +++ b/docs/developers/gamma-markets-api/gamma-structure.md @@ -9,9 +9,9 @@ Every prediction on Polymarket is structured around two core concepts: **markets** and **events**. Understanding how they relate is essential for building on the platform. - + - + ## Markets @@ -19,9 +19,9 @@ Every prediction on Polymarket is structured around two core concepts: **markets A **market** is the fundamental tradable unit on Polymarket. Each market represents a single binary question with Yes/No outcomes. - + - + Every market has: @@ -106,3 +106,6 @@ Specifically for sports markets, outstanding limit orders are **automatically ca Start querying markets and events from the API. + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/developers/gamma-markets-api/overview.md b/docs/developers/gamma-markets-api/overview.md index a114bc8..6ec0a4b 100644 --- a/docs/developers/gamma-markets-api/overview.md +++ b/docs/developers/gamma-markets-api/overview.md @@ -58,7 +58,7 @@ Each market has `outcomes` and `outcomePrices` arrays that map 1:1. Prices repre Endpoints are split across three APIs. See the [API Reference](/api-reference/introduction) for full endpoint documentation with parameters and response schemas. -### Gamma API (`gamma-api.polymarket.com`) — Events, Markets & Discovery +### Gamma API - Events Markets and Discovery | Endpoint | Description | | -------------------- | ------------------------------------------- | @@ -72,7 +72,7 @@ Endpoints are split across three APIs. See the [API Reference](/api-reference/in | `GET /sports` | Sports metadata | | `GET /teams` | Teams | -### CLOB API (`clob.polymarket.com`) — Prices & Orderbooks +### CLOB API - Prices and Orderbooks | Endpoint | Description | | --------------------- | --------------------------------- | @@ -84,7 +84,7 @@ Endpoints are split across three APIs. See the [API Reference](/api-reference/in | `GET /midpoint` | Midpoint price for a token | | `GET /spread` | Spread for a token | -### Data API (`data-api.polymarket.com`) — Positions, Trades & Analytics +### Data API - Positions Trades and Analytics | Endpoint | Description | | -------------------------------------- | ---------------------------- | @@ -109,3 +109,6 @@ Endpoints are split across three APIs. See the [API Reference](/api-reference/in Full endpoint documentation with parameters and response schemas. + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/developers/market-makers/data-feeds.md b/docs/developers/market-makers/data-feeds.md index ee119af..ee49404 100644 --- a/docs/developers/market-makers/data-feeds.md +++ b/docs/developers/market-makers/data-feeds.md @@ -158,3 +158,6 @@ curl "https://gamma-api.polymarket.com/events?active=true&closed=false&limit=50& Query onchain data directly from the Polymarket subgraph. + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/developers/market-makers/introduction.md b/docs/developers/market-makers/introduction.md index e4c68bc..c6e115c 100644 --- a/docs/developers/market-makers/introduction.md +++ b/docs/developers/market-makers/introduction.md @@ -50,7 +50,7 @@ Market makers are essential to Polymarket's ecosystem — they provide liquidity *** -## What's in This Section +## What Is in This Section @@ -81,3 +81,6 @@ Market makers are essential to Polymarket's ecosystem — they provide liquidity ## Support For market maker onboarding and support, contact [support@polymarket.com](mailto:support@polymarket.com). + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/developers/market-makers/setup.md b/docs/developers/market-makers/setup.md index ca9a8f5..fea86d1 100644 --- a/docs/developers/market-makers/setup.md +++ b/docs/developers/market-makers/setup.md @@ -37,11 +37,11 @@ Before you can start market making, you need to complete these one-time setup st - ### EOA (Externally Owned Account) + ### EOA Standard Ethereum wallet. You pay for all onchain transactions (approvals, splits, merges, trade execution). - ### Safe Wallet (Recommended) + ### Safe Wallet Gnosis Safe-based wallet deployed via Polymarket's relayer. Benefits: @@ -97,7 +97,7 @@ Before you can start market making, you need to complete these one-time setup st | CTF (outcome tokens) | CTF Exchange | Trade outcome tokens | | CTF (outcome tokens) | Neg Risk CTF Exchange | Trade neg-risk market tokens | - ### Contract Addresses (Polygon Mainnet) + ### Contract Addresses ```typescript theme={null} const ADDRESSES = { @@ -189,27 +189,22 @@ Before you can start market making, you need to complete these one-time setup st temp_client = ClobClient("https://clob.polymarket.com", key=private_key, chain_id=137) credentials = temp_client.create_or_derive_api_creds() ``` - - Once you have credentials, initialize the client for authenticated operations: + ```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}; - - ```typescript TypeScript theme={null} - const tradingClient = new ClobClient( - "https://clob.polymarket.com", - 137, - wallet, - credentials, - ); - ``` + let private_key = std::env::var("POLYMARKET_PRIVATE_KEY")?; + let signer = LocalSigner::from_str(&private_key)? + .with_chain_id(Some(POLYGON)); - ```python Python theme={null} - client = ClobClient( - "https://clob.polymarket.com", - key=private_key, - chain_id=137, - creds=credentials, - ) + // The Rust SDK derives credentials and initializes in one step + let client = Client::new("https://clob.polymarket.com", Config::default())? + .authentication_builder(&signer) + .authenticate() + .await?; ``` @@ -230,3 +225,6 @@ Before you can start market making, you need to complete these one-time setup st Connect to real-time market data + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/developers/misc-endpoints/bridge-overview.md b/docs/developers/misc-endpoints/bridge-overview.md index d9ffc9a..54f1f02 100644 --- a/docs/developers/misc-endpoints/bridge-overview.md +++ b/docs/developers/misc-endpoints/bridge-overview.md @@ -103,3 +103,6 @@ If you deposited the wrong token on Ethereum or Polygon, use these tools to reco Track your deposit progress through completion. + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/developers/neg-risk/overview.md b/docs/developers/neg-risk/overview.md index 84f9ac7..ef6aea9 100644 --- a/docs/developers/neg-risk/overview.md +++ b/docs/developers/neg-risk/overview.md @@ -143,3 +143,6 @@ The conversion operation is atomic and happens through the Neg Risk Adapter: Learn about token operations like split, merge, and redeem. + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/developers/proxy-wallet.md b/docs/developers/proxy-wallet.md index 80dd436..b69edef 100644 --- a/docs/developers/proxy-wallet.md +++ b/docs/developers/proxy-wallet.md @@ -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 @@ -105,6 +105,29 @@ Before making authenticated requests, you need to obtain API credentials using L # } ``` + + + ```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()); + ``` + @@ -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 @@ -274,6 +297,30 @@ The `POLY_SIGNATURE` for L2 is an HMAC-SHA256 signature created using the user's ) ``` + + + ```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?; + ``` + @@ -324,7 +371,7 @@ When initializing the L2 client, you must specify your wallet **signatureType** ## Troubleshooting - + 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 - + 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()` - + 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. + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/developers/resolution/UMA.md b/docs/developers/resolution/UMA.md index 3fef454..8a55bb5 100644 --- a/docs/developers/resolution/UMA.md +++ b/docs/developers/resolution/UMA.md @@ -11,9 +11,9 @@ When the outcome of an event becomes known, the market is **resolved**. Resoluti Polymarket uses the **UMA Optimistic Oracle** for decentralized, permissionless resolution. Anyone can propose an outcome, and anyone can dispute it if they believe it's incorrect. - + - + ## Resolution Rules @@ -58,7 +58,7 @@ Every market has pre-defined resolution rules that specify: 3. **Two disputes** — Propose, Challenge, second Propose, second Challenge, Resolve via DVM vote - + To dispute a proposal: 1. Post a counter-bond (same amount as proposer, typically \$750) @@ -149,3 +149,6 @@ Clarifications: Understand how markets are structured. + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/developers/sports-websocket/message-format.md b/docs/developers/sports-websocket/message-format.md index d29c12f..b5e65e1 100644 --- a/docs/developers/sports-websocket/message-format.md +++ b/docs/developers/sports-websocket/message-format.md @@ -150,7 +150,7 @@ Game status values vary by sport: | `Forfeit` | Game forfeited | | `NotNecessary` | Scheduled, but not needed | -### NBA / CBB +### NBA and CBB | Status | Description | | -------------- | ------------------------- | @@ -213,3 +213,6 @@ Game status values vary by sport: | `finished` | Match completed | | `postponed` | Match postponed | | `cancelled` | Match canceled | + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/developers/sports-websocket/overview.md b/docs/developers/sports-websocket/overview.md index d29c12f..b5e65e1 100644 --- a/docs/developers/sports-websocket/overview.md +++ b/docs/developers/sports-websocket/overview.md @@ -150,7 +150,7 @@ Game status values vary by sport: | `Forfeit` | Game forfeited | | `NotNecessary` | Scheduled, but not needed | -### NBA / CBB +### NBA and CBB | Status | Description | | -------------- | ------------------------- | @@ -213,3 +213,6 @@ Game status values vary by sport: | `finished` | Match completed | | `postponed` | Match postponed | | `cancelled` | Match canceled | + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/developers/sports-websocket/quickstart.md b/docs/developers/sports-websocket/quickstart.md index d29c12f..b5e65e1 100644 --- a/docs/developers/sports-websocket/quickstart.md +++ b/docs/developers/sports-websocket/quickstart.md @@ -150,7 +150,7 @@ Game status values vary by sport: | `Forfeit` | Game forfeited | | `NotNecessary` | Scheduled, but not needed | -### NBA / CBB +### NBA and CBB | Status | Description | | -------------- | ------------------------- | @@ -213,3 +213,6 @@ Game status values vary by sport: | `finished` | Match completed | | `postponed` | Match postponed | | `cancelled` | Match canceled | + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/developers/subgraph/overview.md b/docs/developers/subgraph/overview.md index b13638e..9bbbd15 100644 --- a/docs/developers/subgraph/overview.md +++ b/docs/developers/subgraph/overview.md @@ -95,3 +95,6 @@ The subgraph is open source. Review the schema and mappings on GitHub: View source code, schema definitions, and deployment configuration. + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/index.md b/docs/index.md index 7ad6548..1556d30 100644 --- a/docs/index.md +++ b/docs/index.md @@ -28,12 +28,18 @@ export const IconCard = ({ icon, title, description, href, color }) => { ); }; + + 🇺🇸 + Looking for Polymarket US documentation? + Visit US Docs → + +
-
+

Polymarket Documentation

@@ -81,6 +87,17 @@ export const IconCard = ({ icon, title, description, href, color }) => { options={"tick_size": "0.01", "neg_risk": False} ) ``` + + ```rust Rust theme={null} + use polymarket_client_sdk::clob::{Client, Config}; + use polymarket_client_sdk::clob::types::Side; + use polymarket_client_sdk::types::dec; + + let client = Client::new(host, Config::default())?.authentication_builder(&signer).authenticate().await?; + let order = client.limit_order().token_id(token_id).price(dec!(0.50)).size(dec!(10)).side(Side::Buy).build().await?; + let signed = client.sign(&signer, order).await?; + let response = client.post_order(signed).await?; + ```
@@ -109,14 +126,14 @@ export const IconCard = ({ icon, title, description, href, color }) => { - Official Python and TypeScript libraries for faster development. + Official Python, TypeScript, and Rust libraries for faster development.
@@ -131,3 +148,6 @@ export const IconCard = ({ icon, title, description, href, color }) => { + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/market-data/fetching-markets.md b/docs/market-data/fetching-markets.md index ee119af..ee49404 100644 --- a/docs/market-data/fetching-markets.md +++ b/docs/market-data/fetching-markets.md @@ -158,3 +158,6 @@ curl "https://gamma-api.polymarket.com/events?active=true&closed=false&limit=50& Query onchain data directly from the Polymarket subgraph. + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/market-data/overview.md b/docs/market-data/overview.md index a114bc8..6ec0a4b 100644 --- a/docs/market-data/overview.md +++ b/docs/market-data/overview.md @@ -58,7 +58,7 @@ Each market has `outcomes` and `outcomePrices` arrays that map 1:1. Prices repre Endpoints are split across three APIs. See the [API Reference](/api-reference/introduction) for full endpoint documentation with parameters and response schemas. -### Gamma API (`gamma-api.polymarket.com`) — Events, Markets & Discovery +### Gamma API - Events Markets and Discovery | Endpoint | Description | | -------------------- | ------------------------------------------- | @@ -72,7 +72,7 @@ Endpoints are split across three APIs. See the [API Reference](/api-reference/in | `GET /sports` | Sports metadata | | `GET /teams` | Teams | -### CLOB API (`clob.polymarket.com`) — Prices & Orderbooks +### CLOB API - Prices and Orderbooks | Endpoint | Description | | --------------------- | --------------------------------- | @@ -84,7 +84,7 @@ Endpoints are split across three APIs. See the [API Reference](/api-reference/in | `GET /midpoint` | Midpoint price for a token | | `GET /spread` | Spread for a token | -### Data API (`data-api.polymarket.com`) — Positions, Trades & Analytics +### Data API - Positions Trades and Analytics | Endpoint | Description | | -------------------------------------- | ---------------------------- | @@ -109,3 +109,6 @@ Endpoints are split across three APIs. See the [API Reference](/api-reference/in Full endpoint documentation with parameters and response schemas. + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/market-data/subgraph.md b/docs/market-data/subgraph.md index b13638e..9bbbd15 100644 --- a/docs/market-data/subgraph.md +++ b/docs/market-data/subgraph.md @@ -95,3 +95,6 @@ The subgraph is open source. Review the schema and mappings on GitHub: View source code, schema definitions, and deployment configuration. + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/market-data/websocket/market-channel.md b/docs/market-data/websocket/market-channel.md index 65843f5..4791214 100644 --- a/docs/market-data/websocket/market-channel.md +++ b/docs/market-data/websocket/market-channel.md @@ -144,6 +144,10 @@ Emitted when the best bid or ask prices for a market change. Emitted when a new market is created. +The payload also includes market metadata fields such as `tags`, +`condition_id`, `active`, `clob_token_ids`, `sports_market_type`, `line`, +`game_start_time`, `order_price_min_tick_size`, and `group_item_title`. + ```json theme={null} { "id": "1031769", @@ -164,7 +168,19 @@ Emitted when a new market is created. "description": "This market will resolve to \"Yes\" if the official closing price..." }, "timestamp": "1766790415550", - "event_type": "new_market" + "event_type": "new_market", + "tags": ["stocks"], + "condition_id": "0x311d0c4b6671ab54af4970c06fcf58662516f5168997bdda209ec3db5aa6b0c1", + "active": true, + "clob_token_ids": [ + "76043073756653678226373981964075571318267289248134717369284518995922789326425", + "31690934263385727664202099278545688007799199447969475608906331829650099442770" + ], + "sports_market_type": "", + "line": "", + "game_start_time": "", + "order_price_min_tick_size": "0.01", + "group_item_title": "NVDA above $240" } ``` @@ -199,3 +215,6 @@ Emitted when a market is resolved. "event_type": "market_resolved" } ``` + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/market-data/websocket/overview.md b/docs/market-data/websocket/overview.md index e0ecfc1..166d020 100644 --- a/docs/market-data/websocket/overview.md +++ b/docs/market-data/websocket/overview.md @@ -137,7 +137,7 @@ For the user channel, use `markets` instead of `assets_ids`: ## Heartbeats -### Market & User Channels +### Market and User Channels Send `PING` every 10 seconds. The server responds with `PONG`. @@ -165,7 +165,7 @@ pong close connections that don't subscribe within a timeout period.
- + You're not sending heartbeats. Send `PING` every 10 seconds for market/user channels, or respond to server `ping` with `pong` for the sports channel. @@ -176,6 +176,9 @@ pong expecting `best_bid_ask`, `new_market`, or `market_resolved` events - + Verify your API credentials are correct and haven't expired. + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/market-data/websocket/rtds.md b/docs/market-data/websocket/rtds.md index ffd0f0a..02db2fa 100644 --- a/docs/market-data/websocket/rtds.md +++ b/docs/market-data/websocket/rtds.md @@ -4,9 +4,9 @@ # Real-Time Data Socket -> Stream comments and crypto prices via WebSocket +> Stream comments, crypto prices, and equity prices via WebSocket -The Polymarket Real-Time Data Socket (RTDS) is a WebSocket-based streaming service that provides real-time updates for **comments** and **crypto prices**. +The Polymarket Real-Time Data Socket (RTDS) is a WebSocket-based streaming service that provides real-time updates for **comments**, **crypto prices**, and **equity prices**. Official RTDS TypeScript client (`real-time-data-client`). @@ -59,18 +59,18 @@ All messages follow this structure: } ``` -| Field | Type | Description | -| ----------- | ------ | ----------------------------------------------------------- | -| `topic` | string | The subscription topic (e.g., `crypto_prices`, `comments`) | -| `type` | string | The message type/event (e.g., `update`, `reaction_created`) | -| `timestamp` | number | Unix timestamp in milliseconds when the message was sent | -| `payload` | object | Event-specific data object | +| Field | Type | Description | +| ----------- | ------ | --------------------------------------------------------------------------- | +| `topic` | string | The subscription topic (e.g., `crypto_prices`, `equity_prices`, `comments`) | +| `type` | string | The message type/event (e.g., `update`, `reaction_created`) | +| `timestamp` | number | Unix timestamp in milliseconds when the message was sent | +| `payload` | object | Event-specific data object | ## Crypto Prices Real-time cryptocurrency price data from two sources: **Binance** and **Chainlink**. No authentication required. -### Binance Source (`crypto_prices`) +### Binance Source Subscribe to all symbols: @@ -133,7 +133,7 @@ Symbols use lowercase concatenated format (e.g., `solusdt`, `btcusdt`). } ``` -### Chainlink Source (`crypto_prices_chainlink`) +### Chainlink Source **Trading 15m Crypto Markets?** Get a sponsored Chainlink API key with onboarding support from Chainlink. Fill out [this form](https://pm-ds-request.streams.chain.link/). @@ -225,6 +225,191 @@ Symbols use slash-separated format (e.g., `eth/usd`, `btc/usd`). * `sol/usd` — Solana to USD * `xrp/usd` — XRP to USD +## Equity Prices + +Real-time price data for stocks, ETFs, forex pairs, precious metals, and commodities sourced from **Pyth Network**. No authentication required. + + + **Trading Equity Markets?** Get a Pyth Network data feed - first 30 days free, then \$99/month. [Subscribe here](https://buy.stripe.com/cNi8wPeiq76FgQrbsD4ZG09). + + +All asset classes stream through a single `equity_prices` topic. When you subscribe with a symbol filter, the server sends a historical snapshot (last 2 minutes of data), then continues streaming live updates. + +### Subscribe + +Subscribe to a specific symbol with a JSON filter: + +```json theme={null} +{ + "action": "subscribe", + "subscriptions": [ + { + "topic": "equity_prices", + "type": "update", + "filters": "{\"symbol\":\"AAPL\"}" + } + ] +} +``` + +Subscribe to multiple symbols across asset classes: + +```json theme={null} +{ + "action": "subscribe", + "subscriptions": [ + { "topic": "equity_prices", "type": "update", "filters": "{\"symbol\":\"AAPL\"}" }, + { "topic": "equity_prices", "type": "update", "filters": "{\"symbol\":\"EURUSD\"}" }, + { "topic": "equity_prices", "type": "update", "filters": "{\"symbol\":\"XAUUSD\"}" }, + { "topic": "equity_prices", "type": "update", "filters": "{\"symbol\":\"WTI\"}" } + ] +} +``` + +Use `type: "*"` to receive all message types (live updates and snapshots): + +```json theme={null} +{ + "action": "subscribe", + "subscriptions": [ + { + "topic": "equity_prices", + "type": "*", + "filters": "{\"symbol\":\"GOOGL\"}" + } + ] +} +``` + +Filter values are case-insensitive on subscribe, but the `symbol` field in payloads is always returned lowercase. + +### Live Price Update + +**Apple stock update:** + +```json theme={null} +{ + "topic": "equity_prices", + "type": "update", + "timestamp": 1711382400000, + "payload": { + "symbol": "aapl", + "value": 198.45, + "full_accuracy_value": "198.4523", + "timestamp": 1711382400000, + "received_at": 1711382400005 + } +} +``` + +**Gold price update (market closed):** + +```json theme={null} +{ + "topic": "equity_prices", + "type": "update", + "timestamp": 1711400000000, + "payload": { + "symbol": "xauusd", + "value": 2175.30, + "full_accuracy_value": "2175.3012", + "timestamp": 1711399000000, + "received_at": 1711400000002, + "is_carried_forward": true + } +} +``` + +### Historical Snapshot + +On subscribe, the server delivers a backfill of the last 2 minutes of price data. Use the `type` field to distinguish: `"subscribe"` for the initial snapshot vs `"update"` for live ticks. + +```json theme={null} +{ + "topic": "equity_prices", + "type": "subscribe", + "timestamp": 1711382400000, + "payload": { + "symbol": "aapl", + "data": [ + { "timestamp": 1711382280000, "value": 198.30 }, + { "timestamp": 1711382281000, "value": 198.32 }, + { "timestamp": 1711382340000, "value": 198.41 } + ] + } +} +``` + +### Equity Price Payload Fields + +| Field | Type | Description | +| --------------------- | ------- | --------------------------------------------------------------------------------------------------------- | +| `symbol` | string | Lowercase symbol identifier (e.g., `aapl`, `eurusd`, `xauusd`) | +| `value` | number | Spot price as a float | +| `full_accuracy_value` | string | Full-precision price as a string | +| `timestamp` | number | Price measurement timestamp in Unix milliseconds | +| `received_at` | number | When the system received the price, in Unix milliseconds. Only present when non-zero. | +| `is_carried_forward` | boolean | `true` when the market session is closed and the value is the last known price. Only present when `true`. | + +### Supported Symbols + +**Stocks:** + +| Symbol | Name | +| ------- | -------------- | +| `AAPL` | Apple | +| `TSLA` | Tesla | +| `MSFT` | Microsoft | +| `GOOGL` | Alphabet | +| `AMZN` | Amazon | +| `META` | Meta Platforms | +| `NVDA` | NVIDIA | +| `NFLX` | Netflix | +| `PLTR` | Palantir | +| `OPEN` | Opendoor | +| `RKLB` | Rocket Lab | +| `ABNB` | Airbnb | +| `COIN` | Coinbase | +| `HOOD` | Robinhood | + +**ETFs:** + +| Symbol | Name | +| ------ | ------------------------------------ | +| `QQQ` | Invesco QQQ ETF | +| `SPY` | S\&P 500 ETF | +| `EWY` | iShares MSCI South Korea ETF | +| `VXX` | Barclays iPath Series B S\&P 500 VIX | + +**Forex:** + +| Symbol | Pair | +| -------- | ---------------------------- | +| `EURUSD` | Euro / US Dollar | +| `GBPUSD` | British Pound / US Dollar | +| `USDCAD` | US Dollar / Canadian Dollar | +| `USDJPY` | US Dollar / Japanese Yen | +| `USDKRW` | US Dollar / South Korean Won | + +**Precious Metals:** + +| Symbol | Name | +| -------- | ------ | +| `XAUUSD` | Gold | +| `XAGUSD` | Silver | + +**Commodities** (rolling front-month futures): + +| Symbol | Name | +| ------ | --------------- | +| `WTI` | Crude Oil (WTI) | +| `CC` | Cocoa | +| `NGD` | Natural Gas | + +### Market Hours + +When a market session is closed, the stream continues with the last known price and `is_carried_forward: true`. This lets you distinguish stale prices from live ticks. Update frequency is sub-second (up to 5 per second per feed) during market hours. + ## Comments Real-time comment events on the Polymarket platform, including new comments, replies, reactions, and removals. May require Gamma authentication for user-specific data. @@ -359,3 +544,6 @@ Comments support nested threading: If subscribing to user-specific streams, ensure your `gamma_auth` object includes a valid wallet `address`. Authentication failures will prevent subscription to protected topics. + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/market-data/websocket/sports.md b/docs/market-data/websocket/sports.md index d29c12f..b5e65e1 100644 --- a/docs/market-data/websocket/sports.md +++ b/docs/market-data/websocket/sports.md @@ -150,7 +150,7 @@ Game status values vary by sport: | `Forfeit` | Game forfeited | | `NotNecessary` | Scheduled, but not needed | -### NBA / CBB +### NBA and CBB | Status | Description | | -------------- | ------------------------- | @@ -213,3 +213,6 @@ Game status values vary by sport: | `finished` | Match completed | | `postponed` | Match postponed | | `cancelled` | Match canceled | + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/market-makers/getting-started.md b/docs/market-makers/getting-started.md index ca9a8f5..fea86d1 100644 --- a/docs/market-makers/getting-started.md +++ b/docs/market-makers/getting-started.md @@ -37,11 +37,11 @@ Before you can start market making, you need to complete these one-time setup st - ### EOA (Externally Owned Account) + ### EOA Standard Ethereum wallet. You pay for all onchain transactions (approvals, splits, merges, trade execution). - ### Safe Wallet (Recommended) + ### Safe Wallet Gnosis Safe-based wallet deployed via Polymarket's relayer. Benefits: @@ -97,7 +97,7 @@ Before you can start market making, you need to complete these one-time setup st | CTF (outcome tokens) | CTF Exchange | Trade outcome tokens | | CTF (outcome tokens) | Neg Risk CTF Exchange | Trade neg-risk market tokens | - ### Contract Addresses (Polygon Mainnet) + ### Contract Addresses ```typescript theme={null} const ADDRESSES = { @@ -189,27 +189,22 @@ Before you can start market making, you need to complete these one-time setup st temp_client = ClobClient("https://clob.polymarket.com", key=private_key, chain_id=137) credentials = temp_client.create_or_derive_api_creds() ``` - - Once you have credentials, initialize the client for authenticated operations: + ```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}; - - ```typescript TypeScript theme={null} - const tradingClient = new ClobClient( - "https://clob.polymarket.com", - 137, - wallet, - credentials, - ); - ``` + let private_key = std::env::var("POLYMARKET_PRIVATE_KEY")?; + let signer = LocalSigner::from_str(&private_key)? + .with_chain_id(Some(POLYGON)); - ```python Python theme={null} - client = ClobClient( - "https://clob.polymarket.com", - key=private_key, - chain_id=137, - creds=credentials, - ) + // The Rust SDK derives credentials and initializes in one step + let client = Client::new("https://clob.polymarket.com", Config::default())? + .authentication_builder(&signer) + .authenticate() + .await?; ``` @@ -230,3 +225,6 @@ Before you can start market making, you need to complete these one-time setup st Connect to real-time market data + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/market-makers/inventory.md b/docs/market-makers/inventory.md index f919569..7fc7366 100644 --- a/docs/market-makers/inventory.md +++ b/docs/market-makers/inventory.md @@ -95,6 +95,24 @@ Split converts USDC.e into equal amounts of YES and NO tokens — creating the i response = client.execute([split_tx], "Split USDCe into tokens") response.wait() ``` + + ```rust Rust theme={null} + use polymarket_client_sdk::ctf::Client as CtfClient; + use polymarket_client_sdk::ctf::types::SplitPositionRequest; + use polymarket_client_sdk::types::{U256, address}; + + let ctf_client = CtfClient::new(provider, 137)?; + + // Split $1000 USDCe into YES/NO tokens + let request = SplitPositionRequest::builder() + .collateral_token(address!("0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174")) + .condition_id(condition_id) + .partition(vec![U256::from(1), U256::from(2)]) + .amount(U256::from(1000_000_000u64)) // 1000 USDCe (6 decimals) + .build(); + let result = ctf_client.split_position(&request).await?; + println!("Split tx: {:?}", result.transaction_hash); + ``` After splitting 1000 USDC.e, you receive 1000 YES tokens and 1000 NO tokens. Your USDC.e balance decreases by 1000. @@ -161,6 +179,19 @@ Merge converts equal amounts of YES and NO tokens back into USDC.e — useful fo response = client.execute([merge_tx], "Merge tokens to USDCe") response.wait() ``` + + ```rust Rust theme={null} + use polymarket_client_sdk::ctf::types::MergePositionsRequest; + + // Merge 500 YES + 500 NO back to 500 USDCe + let request = MergePositionsRequest::builder() + .collateral_token(address!("0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174")) + .condition_id(condition_id) + .partition(vec![U256::from(1), U256::from(2)]) + .amount(U256::from(500_000_000u64)) // 500 USDCe (6 decimals) + .build(); + let result = ctf_client.merge_positions(&request).await?; + ``` After merging 500 of each, your YES and NO balances decrease by 500 and your USDC.e balance increases by 500. @@ -188,6 +219,15 @@ Once a market resolves, redeem winning tokens for USDC.e. Each winning token is winning = next(t for t in market["tokens"] if t.get("winner")) print("Winning outcome:", winning["outcome"]) ``` + + ```rust Rust theme={null} + let market = clob_client.market(condition_id).await?; + if market.closed { + if let Some(winner) = market.tokens.iter().find(|t| t.winner) { + println!("Winning outcome: {}", winner.outcome); + } + } + ``` ### Redeem Winning Tokens @@ -240,6 +280,17 @@ Once a market resolves, redeem winning tokens for USDC.e. Each winning token is response = client.execute([redeem_tx], "Redeem winning tokens") response.wait() ``` + + ```rust Rust theme={null} + use polymarket_client_sdk::ctf::types::RedeemPositionsRequest; + + let request = RedeemPositionsRequest::builder() + .collateral_token(address!("0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174")) + .condition_id(condition_id) + .index_sets(vec![U256::from(1), U256::from(2)]) // Redeem both (only winners pay) + .build(); + let result = ctf_client.redeem_positions(&request).await?; + ``` *** @@ -337,3 +388,6 @@ await response.wait(); Relayer Client setup and configuration + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/market-makers/liquidity-rewards.md b/docs/market-makers/liquidity-rewards.md index 54a9e01..dd5acef 100644 --- a/docs/market-makers/liquidity-rewards.md +++ b/docs/market-makers/liquidity-rewards.md @@ -59,17 +59,17 @@ Quadratic scoring rule for an order based on position between the adjusted midpo $S(v,s)= (\frac{v-s}{v})^2 \cdot b$ -### 2. First Market Side Score (Qne) +### 2. First Market Side Score $Q_{one}= S(v,Spread_{m_1}) \cdot BidSize_{m_1} + S(v,Spread_{m_2}) \cdot BidSize_{m_2} + \dots $ $ + S(v, Spread_{m^\prime_1}) \cdot AskSize_{m^\prime_1} + S(v, Spread_{m^\prime_2}) \cdot AskSize_{m^\prime_2}$ -### 3. Second Market Side Score (Qno) +### 3. Second Market Side Score $Q_{two}= S(v,Spread_{m_1}) \cdot AskSize_{m_1} + S(v,Spread_{m_2}) \cdot AskSize_{m_2} + \dots $ $ + S(v, Spread_{m^\prime_1}) \cdot BidSize_{m^\prime_1} + S(v, Spread_{m^\prime_2}) \cdot BidSize_{m^\prime_2}$ -### 4. Minimum Score (Qmin) +### 4. Minimum Score Boosts two-sided liquidity by taking the minimum of Qne and Qno, while still rewarding single-sided liquidity at a reduced rate (divided by c). @@ -81,19 +81,19 @@ $Q_{\min} = \max(\min({Q_{one}, Q_{two}}), \max(Q_{one}/c, Q_{two}/c))$ $Q_{\min} = \min({Q_{one}, Q_{two}})$ -### 5. Normalized Score (Qnormal) +### 5. Normalized Score Qmin of a market maker divided by the sum of all Qmin across market makers in a given sample: $Q_{normal} = \frac{Q_{min}}{\sum_{n=1}^{N}{(Q_{min})_n}}$ -### 6. Epoch Score (Qepoch) +### 6. Epoch Score Sum of all Qnormal for a trader across all samples in an epoch: $Q_{epoch} = \sum_{u=1}^{10,080}{(Q_{normal})_u}$ -### 7. Final Score (Qfinal) +### 7. Final Score Normalizes Qepoch by dividing by the sum of all market makers' Qepoch in a given epoch. This value is multiplied by the rewards available for the market to get a trader's reward: @@ -105,7 +105,7 @@ $Q_{final}=\frac{Q_{epoch}}{\sum_{n=1}^{N}{(Q_{epoch})_n}}$ Assume an adjusted market midpoint of 0.50 and a max spread config of 3 cents for both m and m'. -### Step 2 — First Side Score +### Step 2 - First Side Score A trader has the following open orders: @@ -119,7 +119,7 @@ $$ Qne is calculated every minute using random sampling. -### Step 3 — Second Side Score +### Step 3 - Second Side Score The same trader also has: @@ -133,7 +133,7 @@ $$ Qno is calculated every minute using random sampling. -### Steps 4–7 +### Steps 4-7 4. Take the minimum of Qne and Qno (with single-sided adjustment if midpoint is in \[0.10, 0.90]) 5. Normalize against all other market makers in the sample @@ -161,6 +161,9 @@ Qno is calculated every minute using random sampling. - Earn USDC rebates on 15-minute crypto markets + Earn USDC rebates on eligible crypto and sports markets + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/market-makers/overview.md b/docs/market-makers/overview.md index e4c68bc..c6e115c 100644 --- a/docs/market-makers/overview.md +++ b/docs/market-makers/overview.md @@ -50,7 +50,7 @@ Market makers are essential to Polymarket's ecosystem — they provide liquidity *** -## What's in This Section +## What Is in This Section @@ -81,3 +81,6 @@ Market makers are essential to Polymarket's ecosystem — they provide liquidity ## Support For market maker onboarding and support, contact [support@polymarket.com](mailto:support@polymarket.com). + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/market-makers/trading.md b/docs/market-makers/trading.md index 28b839c..7098bb8 100644 --- a/docs/market-makers/trading.md +++ b/docs/market-makers/trading.md @@ -70,6 +70,27 @@ The core market making workflow is posting a bid and ask around your fair value. order_type=OrderType.GTC, ) ``` + + ```rust Rust theme={null} + use polymarket_client_sdk::clob::types::Side; + use polymarket_client_sdk::types::dec; + + let token_id = "3409705850427531082723332342151729...".parse()?; + + // Bid at 0.48 + let bid = client.limit_order() + .token_id(token_id).price(dec!(0.48)).size(dec!(1000)).side(Side::Buy) + .build().await?; + let signed = client.sign(&signer, bid).await?; + client.post_order(signed).await?; + + // Ask at 0.52 + let ask = client.limit_order() + .token_id(token_id).price(dec!(0.52)).size(dec!(1000)).side(Side::Sell) + .build().await?; + let signed = client.sign(&signer, ask).await?; + client.post_order(signed).await?; + ``` ### Batch Orders @@ -121,6 +142,20 @@ For tighter spreads across multiple levels, use `postOrders` to submit up to 15 ), ]) ``` + + ```rust Rust theme={null} + let mut signed_orders = Vec::new(); + for (price, side) in [ + (dec!(0.48), Side::Buy), (dec!(0.47), Side::Buy), + (dec!(0.52), Side::Sell), (dec!(0.53), Side::Sell), + ] { + let order = client.limit_order() + .token_id(token_id).price(price).size(dec!(500)).side(side) + .build().await?; + signed_orders.push(client.sign(&signer, order).await?); + } + let response = client.post_orders(signed_orders).await?; + ``` @@ -174,6 +209,23 @@ Auto-expire quotes before known events like market close or resolution: order_type=OrderType.GTD, ) ``` + + ```rust Rust theme={null} + use chrono::{TimeDelta, Utc}; + use polymarket_client_sdk::clob::types::OrderType; + + // Expire in 1 hour + let order = client.limit_order() + .token_id(token_id) + .price(dec!(0.50)) + .size(dec!(1000)) + .side(Side::Buy) + .order_type(OrderType::GTD) + .expiration(Utc::now() + TimeDelta::hours(1)) + .build().await?; + let signed = client.sign(&signer, order).await?; + client.post_order(signed).await?; + ``` *** @@ -197,6 +249,12 @@ Cancel individual orders, by market, or everything at once: client.cancel_market_orders(market=condition_id) # All orders in a market client.cancel_all() # Everything ``` + + ```rust Rust theme={null} + client.cancel_order(order_id).await?; // Single order + client.cancel_market_orders(&request).await?; // All orders in a market + client.cancel_all_orders().await?; // Everything + ``` See [Cancel Orders](/trading/orders/cancel) for full details including onchain cancellation. @@ -222,6 +280,17 @@ See [Cancel Orders](/trading/orders/cancel) for full details including onchain c OpenOrderParams(market="0xbd31dc8a...") ) ``` + + ```rust Rust theme={null} + use polymarket_client_sdk::clob::types::request::OrdersRequest; + + let order = client.order(order_id).await?; + + let request = OrdersRequest::builder() + .market("0xbd31dc8a...".parse()?) + .build(); + let orders = client.orders(&request, None).await?; + ``` *** @@ -240,19 +309,26 @@ Your order price must conform to the market's tick size, or it will be rejected. tick_size = client.get_tick_size(token_id) # Returns: "0.1" | "0.01" | "0.001" | "0.0001" ``` + + ```rust Rust theme={null} + let resp = client.tick_size(token_id).await?; + // resp.minimum_tick_size: TickSize::Tenth | Hundredth | Thousandth | TenThousandth + ``` *** ## Fees -Most markets have **zero fees** for both makers and takers. However, the following market types have taker fees: +Most markets charge a small taker fee. Makers are never charged fees. **Geopolitical and world events markets are fee-free.** -* **5-minute crypto markets** -* **15-minute crypto markets** -* **Select sports markets** (e.g., NCAAB, Serie A) +Taker fees fund the [Maker Rebates Program](/market-makers/maker-rebates), which pays daily USDC rebates to liquidity providers. -See [Fees](/trading/fees) for the full fee schedule and calculation details. + + Fees apply only to markets deployed on or after the activation date. Pre-existing markets are unaffected. Markets with fees enabled have `feesEnabled` set to `true` on the market object. + + +See [Fees](/trading/fees) for the full fee schedule, rates by category, and calculation details. *** @@ -294,3 +370,6 @@ See [Fees](/trading/fees) for the full fee schedule and calculation details. Full order creation reference with all options + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/polymarket-101.md b/docs/polymarket-101.md index 303ffae..a4f3d7a 100644 --- a/docs/polymarket-101.md +++ b/docs/polymarket-101.md @@ -30,12 +30,12 @@ Polymarket operates on a non-custodial model. You maintain full control of your ## How Polymarket Works - Polymarket Overview + Polymarket Overview - Polymarket Overview + Polymarket Overview -### Prices = Probabilities +### Prices Are Probabilities Every share on Polymarket is priced between `$0.00` and `$1.00`. The price represents the market's belief in the probability of that outcome occurring. @@ -76,7 +76,7 @@ When an event concludes, markets are resolved through the **UMA Optimistic Oracl This community-driven process ensures fair and accurate market resolution. -## Why Blockchain? +## Why Blockchain Polymarket is built on **Polygon**, a blockchain network, for several key reasons: @@ -117,3 +117,6 @@ Ready to start trading? Browse active prediction markets on Polymarket. + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/polymarket-learn/FAQ/does-polymarket-have-an-api.md b/docs/polymarket-learn/FAQ/does-polymarket-have-an-api.md index 0531691..5d3e639 100644 --- a/docs/polymarket-learn/FAQ/does-polymarket-have-an-api.md +++ b/docs/polymarket-learn/FAQ/does-polymarket-have-an-api.md @@ -1,4 +1,4 @@ -Does Polymarket have an API? | Polymarket Help Center
Skip to main content

Does Polymarket have an API?

Getting data from Polymarket

Updated over a month ago

Yes! Developers can find all the information they need for interacting with Polymarket. This includes documentation on market discovery, resolution, trading etc.

Whether you are an academic researcher a market maker or an indepedent developer, this documentation should provide you what you need to get started. All the code you find linked here and on our GitHub is open source and free to use.

If you have any questions please join our Discord and direct your questions to the #devs channel.

Did this answer your question?
- +--text-on-primary-color: #ffffff}
Skip to main content

Does Polymarket have an API?

Getting data from Polymarket

Updated over 2 months ago

Yes! Developers can find all the information they need for interacting with Polymarket. This includes documentation on market discovery, resolution, trading etc.

Whether you are an academic researcher a market maker or an indepedent developer, this documentation should provide you what you need to get started. All the code you find linked here and on our GitHub is open source and free to use.

If you have any questions please join our Discord and direct your questions to the #devs channel.

Did this answer your question?
\ No newline at end of file diff --git a/docs/polymarket-learn/FAQ/embeds.md b/docs/polymarket-learn/FAQ/embeds.md index 454e327..8d98fe2 100644 --- a/docs/polymarket-learn/FAQ/embeds.md +++ b/docs/polymarket-learn/FAQ/embeds.md @@ -1,4 +1,4 @@ -How To Use Embeds | Polymarket Help Center
Skip to main content

How To Use Embeds

Adding market embeds to your Substack or website.

Updated over a month ago

Polymarket allows you to embed a live-updating widget displaying the latest odds for markets in many places around the web.

​Web

Navigate to the individual market you want to embed and click the embed (< >) link. Select light or dark mode, and copy the auto-generated code Paste the code into your code editor or CMS and publish as normal.

​Twitter / X

Navigate to any Polymarket market Copy the URL from your browser Paste the URL into the compose window.

​Substack

The embeds feature currently supports single markets only (eg “USA to Win Most Gold Medals”, not “Most Gold Medals at Paris Olympics’)

To embed a market, navigate on Polymarket.com to the single market you want to embed and click “copy link.”

Navigate to your Substack editor and paste the link directly into the body of your newsletter. The editor will recognize the market and convert it to a widget that automatically refreshes with the latest odds.

Did this answer your question?
- +--text-on-primary-color: #ffffff}
Skip to main content

How To Use Embeds

Adding market embeds to your Substack or website.

Updated over 2 months ago

Polymarket allows you to embed a live-updating widget displaying the latest odds for markets in many places around the web.

​Web

Navigate to the individual market you want to embed and click the embed (< >) link. Select light or dark mode, and copy the auto-generated code Paste the code into your code editor or CMS and publish as normal.

​Twitter / X

Navigate to any Polymarket market Copy the URL from your browser Paste the URL into the compose window.

​Substack

The embeds feature currently supports single markets only (eg “USA to Win Most Gold Medals”, not “Most Gold Medals at Paris Olympics’)

To embed a market, navigate on Polymarket.com to the single market you want to embed and click “copy link.”

Navigate to your Substack editor and paste the link directly into the body of your newsletter. The editor will recognize the market and convert it to a widget that automatically refreshes with the latest odds.

Did this answer your question?
\ No newline at end of file diff --git a/docs/polymarket-learn/FAQ/geoblocking.md b/docs/polymarket-learn/FAQ/geoblocking.md index 24690aa..3519bb7 100644 --- a/docs/polymarket-learn/FAQ/geoblocking.md +++ b/docs/polymarket-learn/FAQ/geoblocking.md @@ -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") ``` + + + ```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"); + } + ``` + *** -## 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). + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/polymarket-learn/FAQ/how-to-export-private-key.md b/docs/polymarket-learn/FAQ/how-to-export-private-key.md index 741106f..ada5f42 100644 --- a/docs/polymarket-learn/FAQ/how-to-export-private-key.md +++ b/docs/polymarket-learn/FAQ/how-to-export-private-key.md @@ -1,4 +1,4 @@ -How Do I Export My Key? | Polymarket Help Center
Skip to main content

How Do I Export My Key?

Exporting your private key on Magic.Link

Updated over a month ago

Exporting your private key gives you direct control and security over your funds. This process is applicable if you’ve signed up via email.

DO NOT share your private key with other parties, platforms, or people. We will never ask for your private key.

  1. Access the Export Link while signed into Polymarket: https://reveal.magic.link/polymarket

  2. Sign-in on Magic.Link

  3. Export Private Key. Once revealed, you should securely store the private key displayed, where others can’t access it.

  4. Log out of Magic.Link


Did this answer your question?
- +--text-on-primary-color: #ffffff}
Skip to main content

How Do I Export My Key?

Exporting your private key on Magic.Link

Updated over 2 months ago

Exporting your private key gives you direct control and security over your funds. This process is applicable if you’ve signed up via email.

DO NOT share your private key with other parties, platforms, or people. We will never ask for your private key.

  1. Access the Export Link while signed into Polymarket: https://reveal.magic.link/polymarket

  2. Sign-in on Magic.Link

  3. Export Private Key. Once revealed, you should securely store the private key displayed, where others can’t access it.

  4. Log out of Magic.Link


Did this answer your question?
\ No newline at end of file diff --git a/docs/polymarket-learn/FAQ/is-my-money-safe.md b/docs/polymarket-learn/FAQ/is-my-money-safe.md index a2ebc17..32b3426 100644 --- a/docs/polymarket-learn/FAQ/is-my-money-safe.md +++ b/docs/polymarket-learn/FAQ/is-my-money-safe.md @@ -1,4 +1,4 @@ -Is My Money Safe? | Polymarket Help Center
Skip to main content

Is My Money Safe?

Yes. Polymarket is non-custodial, so you’re in control of your funds.

Updated over a month ago

Non-custodial, you’re in control

Polymarket recognizes the importance of a trustworthy environment for managing your funds. To ensure this, Polymarket uses non-custodial wallets, meaning we never take possession of your USDC. This approach gives you full control over your assets, providing protection against potential security threats like hacks, misuse, and unauthorized transactions.

​Your keys = your funds

A private key acts like a highly secure password, essential for managing and moving your assets without restrictions. You can export your private key at any time, ensuring sole access to your funds. Learn how to export your private key here

​Keep your private keys private.

Do not share your private key with others. While Polymarket provides the infrastructure, the security of your assets depends on how securely you handle your private key and passwords. Losing your private key or passwords can result in losing access to your funds. It’s crucial to store this information in a safe and secure environment.

​Our Commitment

Polymarket aims to give you peace of mind, knowing that your assets are safe and fully under your control at all times. We encourage you to take necessary precautions to secure your digital assets effectively. The ability to manage your private key means you are not reliant on Polymarket to secure your assets; you have the control to ensure your financial security.

Did this answer your question?
- +--text-on-primary-color: #ffffff}
Skip to main content

Is My Money Safe?

Yes. Polymarket is non-custodial, so you’re in control of your funds.

Updated over 2 months ago

Non-custodial, you’re in control

Polymarket recognizes the importance of a trustworthy environment for managing your funds. To ensure this, Polymarket uses non-custodial wallets, meaning we never take possession of your USDC. This approach gives you full control over your assets, providing protection against potential security threats like hacks, misuse, and unauthorized transactions.

​Your keys = your funds

A private key acts like a highly secure password, essential for managing and moving your assets without restrictions. You can export your private key at any time, ensuring sole access to your funds. Learn how to export your private key here

​Keep your private keys private.

Do not share your private key with others. While Polymarket provides the infrastructure, the security of your assets depends on how securely you handle your private key and passwords. Losing your private key or passwords can result in losing access to your funds. It’s crucial to store this information in a safe and secure environment.

​Our Commitment

Polymarket aims to give you peace of mind, knowing that your assets are safe and fully under your control at all times. We encourage you to take necessary precautions to secure your digital assets effectively. The ability to manage your private key means you are not reliant on Polymarket to secure your assets; you have the control to ensure your financial security.

Did this answer your question?
\ No newline at end of file diff --git a/docs/polymarket-learn/FAQ/is-polymarket-the-house.md b/docs/polymarket-learn/FAQ/is-polymarket-the-house.md index 9461b33..e4d5c74 100644 --- a/docs/polymarket-learn/FAQ/is-polymarket-the-house.md +++ b/docs/polymarket-learn/FAQ/is-polymarket-the-house.md @@ -1,4 +1,4 @@ -Is Polymarket The House? | Polymarket Help Center
Skip to main content

Is Polymarket The House?

No, Polymarket is not the house. All trades happen peer-to-peer (p2p).

Updated over a month ago

Polymarket is different in three ways:

​1. Traders interact directly with each other, not with Polymarket.

Polymarket is a marketplace comprised of traders on both sides of any given market. This means you’re always trading with other users, not against a centralized entity or “house.” Prices on Polymarket are determined by supply and demand. As traders buy and sell shares in outcomes, prices fluctuate to reflect the collective sentiment and knowledge of market participants.

​2. Polymarket does not charge trading fees.

Unlike bookmakers or wagering operations, Polymarket does not charge deposit/withdrawal fees, or any type of trading fees. This means that Polymarket does not stand to benefit from the outcome of any market or usage of any trader.

​3. Transact at any time.

Polymarket enables you to sell your position at any time before the market resolves, provided there is a willing buyer of your shares. This offers flexibility and allows you to manage your risk and lock in profits or cut losses as you see fit.

In essence, Polymarket empowers you to trade based on your own knowledge and research, without going up against a “house” with potentially unfair advantages.

Did this answer your question?
- +--text-on-primary-color: #ffffff}
Skip to main content

Is Polymarket The House?

No, Polymarket is not the house. All trades happen peer-to-peer (p2p).

Updated over 2 months ago

Polymarket is different in three ways:

​1. Traders interact directly with each other, not with Polymarket.

Polymarket is a marketplace comprised of traders on both sides of any given market. This means you’re always trading with other users, not against a centralized entity or “house.” Prices on Polymarket are determined by supply and demand. As traders buy and sell shares in outcomes, prices fluctuate to reflect the collective sentiment and knowledge of market participants.

​2. Polymarket does not charge trading fees.

Unlike bookmakers or wagering operations, Polymarket does not charge deposit/withdrawal fees, or any type of trading fees. This means that Polymarket does not stand to benefit from the outcome of any market or usage of any trader.

​3. Transact at any time.

Polymarket enables you to sell your position at any time before the market resolves, provided there is a willing buyer of your shares. This offers flexibility and allows you to manage your risk and lock in profits or cut losses as you see fit.

In essence, Polymarket empowers you to trade based on your own knowledge and research, without going up against a “house” with potentially unfair advantages.

Did this answer your question?
\ No newline at end of file diff --git a/docs/polymarket-learn/FAQ/polling.md b/docs/polymarket-learn/FAQ/polling.md index 9903783..a5d2705 100644 --- a/docs/polymarket-learn/FAQ/polling.md +++ b/docs/polymarket-learn/FAQ/polling.md @@ -1,4 +1,4 @@ -Polymarket vs. Polling | Polymarket Help Center
Skip to main content

Polymarket vs. Polling

How is Polymarket better than traditional / legacy polling?

Updated over a month ago

While legacy polls capture a snapshot of opinion at a specific moment, they are often outdated by the time they’re published—sometimes lagging by several days. In contrast, Polymarket reflects real-time sentiment as events unfold, offering continuous updates and a more dynamic understanding of public opinion.

Studies show that prediction markets like Polymarket tend to outperform traditional pollsters because participants are financially incentivized to be correct. This creates more thoughtful, data-driven predictions. Research by James Surowiecki, author of The Wisdom of Crowds, has highlighted how markets like these can be more accurate than polls due to the “collective intelligence” of diverse participants. Additionally, the Iowa Electronic Markets, an academic research project at the University of Iowa, has consistently demonstrated the superior accuracy of prediction markets like Polymarket over traditional polling in predicting political outcomes.

Polymarket provides a constantly updating picture of public sentiment, offering a degree of accuracy and timeliness that traditional pollsters, who typically report data that is days old, simply cannot match.


Did this answer your question?
- +--text-on-primary-color: #ffffff}
Skip to main content

Polymarket vs. Polling

How is Polymarket better than traditional / legacy polling?

Updated over 2 months ago

While legacy polls capture a snapshot of opinion at a specific moment, they are often outdated by the time they’re published—sometimes lagging by several days. In contrast, Polymarket reflects real-time sentiment as events unfold, offering continuous updates and a more dynamic understanding of public opinion.

Studies show that prediction markets like Polymarket tend to outperform traditional pollsters because participants are financially incentivized to be correct. This creates more thoughtful, data-driven predictions. Research by James Surowiecki, author of The Wisdom of Crowds, has highlighted how markets like these can be more accurate than polls due to the “collective intelligence” of diverse participants. Additionally, the Iowa Electronic Markets, an academic research project at the University of Iowa, has consistently demonstrated the superior accuracy of prediction markets like Polymarket over traditional polling in predicting political outcomes.

Polymarket provides a constantly updating picture of public sentiment, offering a degree of accuracy and timeliness that traditional pollsters, who typically report data that is days old, simply cannot match.


Did this answer your question?
\ No newline at end of file diff --git a/docs/polymarket-learn/FAQ/recover-missing-deposit.md b/docs/polymarket-learn/FAQ/recover-missing-deposit.md index 648bd1d..774572b 100644 --- a/docs/polymarket-learn/FAQ/recover-missing-deposit.md +++ b/docs/polymarket-learn/FAQ/recover-missing-deposit.md @@ -1,4 +1,4 @@ -Recover Missing Deposit | Polymarket Help Center
Skip to main content

Recover Missing Deposit

If you deposited the wrong cryptocurrency on Ethereum or Polygon, use these tools to recover those funds.

Updated over a month ago


Recover on Ethereum

Use this tool if you deposited the wrong token on Ethereum.

  1. Go to https://recovery.polymarket.com and sign in with your Polymarket account or connect the wallet you use on Polymarket.

  2. Select the asset you incorrectly deposited.

  3. You’ll then see the asset balance displayed, and will have the ability to recover those funds to your specified wallet.

​Recover on Polygon

Use this tool if you deposited the wrong token on Polygon.

  1. Go to https://matic-recovery.polymarket.com and sign in with your Polymarket account or connect the wallet you use on Polymarket

  2. Select the asset you incorrectly deposited.

  3. You’ll then see the asset balance displayed, and will have the ability to recover those funds to your specified wallet.

Did this answer your question?
- +--text-on-primary-color: #ffffff}
Skip to main content

Recover Missing Deposit

If you deposited the wrong cryptocurrency on Ethereum or Polygon, use these tools to recover those funds.

Updated over 2 months ago


Recover on Ethereum

Use this tool if you deposited the wrong token on Ethereum.

  1. Go to https://recovery.polymarket.com and sign in with your Polymarket account or connect the wallet you use on Polymarket.

  2. Select the asset you incorrectly deposited.

  3. You’ll then see the asset balance displayed, and will have the ability to recover those funds to your specified wallet.

​Recover on Polygon

Use this tool if you deposited the wrong token on Polygon.

  1. Go to https://matic-recovery.polymarket.com and sign in with your Polymarket account or connect the wallet you use on Polymarket

  2. Select the asset you incorrectly deposited.

  3. You’ll then see the asset balance displayed, and will have the ability to recover those funds to your specified wallet.

Did this answer your question?
\ No newline at end of file diff --git a/docs/polymarket-learn/FAQ/sell-early.md b/docs/polymarket-learn/FAQ/sell-early.md index 20472f6..0a12b57 100644 --- a/docs/polymarket-learn/FAQ/sell-early.md +++ b/docs/polymarket-learn/FAQ/sell-early.md @@ -1,4 +1,4 @@ -Can I Sell Early? | Polymarket Help Center
Skip to main content

Can I Sell Early?

Yes, you can sell or close your position early.

Updated over a month ago

You may sell shares at any point before the market is resolved by either placing a market order to sell shares at the prevailing bid price in the orderbook, or by placing a limit order for how many shares you wish to sell and at what price.

The limit order will only be executed if/when there is a willing buyer for your shares at the price you set.


Did this answer your question?
- +--text-on-primary-color: #ffffff}
Skip to main content

Can I Sell Early?

Yes, you can sell or close your position early.

Updated over 2 months ago

You may sell shares at any point before the market is resolved by either placing a market order to sell shares at the prevailing bid price in the orderbook, or by placing a limit order for how many shares you wish to sell and at what price.

The limit order will only be executed if/when there is a willing buyer for your shares at the price you set.


Did this answer your question?
\ No newline at end of file diff --git a/docs/polymarket-learn/FAQ/support.md b/docs/polymarket-learn/FAQ/support.md index 3e56d68..67aae1e 100644 --- a/docs/polymarket-learn/FAQ/support.md +++ b/docs/polymarket-learn/FAQ/support.md @@ -1,4 +1,4 @@ -How Do I Contact Support? | Polymarket Help Center
Skip to main content

How Do I Contact Support?

Updated over a month ago

Polymarket offers technical support through our website chat feature, and through Discord.

To contact support through our website:

  • Navigate to Polymarket.

  • Click the blue chat icon in the bottom right and start your chat session.

For technical support on Discord:

  • Navigate to the Support sidebar and click #open-a-ticket. This will open a private conversation with a Polymarket team member.

Be aware of numerous scams and malicious links. Polymarket team members will never DM you first or ask for private keys or personal information. Polymarket team members are identified in blue font on Discord.

Did this answer your question?
- +--text-on-primary-color: #ffffff}
Skip to main content

How Do I Contact Support?

Updated over 2 months ago

Polymarket offers technical support through our website chat feature, and through Discord.

To contact support through our website:

  • Navigate to Polymarket.

  • Click the blue chat icon in the bottom right and start your chat session.

For technical support on Discord:

  • Navigate to the Support sidebar and click #open-a-ticket. This will open a private conversation with a Polymarket team member.

Be aware of numerous scams and malicious links. Polymarket team members will never DM you first or ask for private keys or personal information. Polymarket team members are identified in blue font on Discord.

Did this answer your question?
\ No newline at end of file diff --git a/docs/polymarket-learn/FAQ/wen-token.md b/docs/polymarket-learn/FAQ/wen-token.md index 7848ba7..bcfc5af 100644 --- a/docs/polymarket-learn/FAQ/wen-token.md +++ b/docs/polymarket-learn/FAQ/wen-token.md @@ -1,4 +1,4 @@ -Does Polymarket Have a Token? | Polymarket Help Center
Skip to main content

Does Polymarket Have a Token?

Polymarket does not have a token

Updated over a month ago
Did this answer your question?
- +--text-on-primary-color: #ffffff}
Skip to main content

Does Polymarket Have a Token?

Polymarket does not have a token

Updated over 2 months ago
Did this answer your question?
\ No newline at end of file diff --git a/docs/polymarket-learn/FAQ/what-are-prediction-markets.md b/docs/polymarket-learn/FAQ/what-are-prediction-markets.md index 10d56ed..2dc228c 100644 --- a/docs/polymarket-learn/FAQ/what-are-prediction-markets.md +++ b/docs/polymarket-learn/FAQ/what-are-prediction-markets.md @@ -1,4 +1,4 @@ -What is a Prediction Market? | Polymarket Help Center
Skip to main content

What is a Prediction Market?

How people collectively forecast the future.

Updated over a month ago

A prediction market is a platform where people can bet on the outcome of future events. By buying and selling shares in the outcomes, participants collectively forecast the likelihood of events such as sports results, political elections, or entertainment awards.

​How it works

Market Prices = Probabilities: The price of shares in a prediction market represents the current probability of an event happening. For example, if shares of an event are trading at 20 cents, it indicates a 20% chance of that event occurring.

​Making predictions

If you believe the actual probability of an event is higher than the market price suggests, you can buy shares. For instance, if you think a team has a better than 20% chance of winning, you would buy shares at 20 cents. If the event occurs, each share becomes worth $1, yielding a profit.

​Free-market trading

You can buy or sell shares at any time before the event concludes, based on new information or changing circumstances. This flexibility allows the market prices to continuously reflect the most current and accurate probabilities.

​Trust the markets

Prediction markets provide unbiased and accurate probabilities in real time, cutting through the noise of human and media biases. Traditional sources often have their own incentives and slants, but prediction markets operate on the principle of “put your money where your mouth is.” Here, participants are financially motivated to provide truthful insights, as their profits depend on the accuracy of their predictions.

In a prediction market, prices reflect the aggregated sentiment of all participants, weighing news, data, expert opinions, and culture to determine the true odds. Unlike media narratives, which can be swayed by various biases, prediction markets offer a transparent view of where people genuinely believe we’re heading.

​Why use prediction markets?

Prediction markets are often more accurate than traditional polls and expert predictions. The collective wisdom of diverse participants, each motivated by the potential for profit, leads to highly reliable forecasts. This makes prediction markets an excellent tool for gauging real-time probabilities of future events.

Polymarket, the world’s largest prediction market, offers a user-friendly platform to bet on a wide range of topics, from sports to politics. By participating, you can profit from your knowledge while contributing to the accuracy of market predictions.

Did this answer your question?
- +--text-on-primary-color: #ffffff}
Skip to main content

What is a Prediction Market?

How people collectively forecast the future.

Updated over 2 months ago

A prediction market is a platform where people can bet on the outcome of future events. By buying and selling shares in the outcomes, participants collectively forecast the likelihood of events such as sports results, political elections, or entertainment awards.

​How it works

Market Prices = Probabilities: The price of shares in a prediction market represents the current probability of an event happening. For example, if shares of an event are trading at 20 cents, it indicates a 20% chance of that event occurring.

​Making predictions

If you believe the actual probability of an event is higher than the market price suggests, you can buy shares. For instance, if you think a team has a better than 20% chance of winning, you would buy shares at 20 cents. If the event occurs, each share becomes worth $1, yielding a profit.

​Free-market trading

You can buy or sell shares at any time before the event concludes, based on new information or changing circumstances. This flexibility allows the market prices to continuously reflect the most current and accurate probabilities.

​Trust the markets

Prediction markets provide unbiased and accurate probabilities in real time, cutting through the noise of human and media biases. Traditional sources often have their own incentives and slants, but prediction markets operate on the principle of “put your money where your mouth is.” Here, participants are financially motivated to provide truthful insights, as their profits depend on the accuracy of their predictions.

In a prediction market, prices reflect the aggregated sentiment of all participants, weighing news, data, expert opinions, and culture to determine the true odds. Unlike media narratives, which can be swayed by various biases, prediction markets offer a transparent view of where people genuinely believe we’re heading.

​Why use prediction markets?

Prediction markets are often more accurate than traditional polls and expert predictions. The collective wisdom of diverse participants, each motivated by the potential for profit, leads to highly reliable forecasts. This makes prediction markets an excellent tool for gauging real-time probabilities of future events.

Polymarket, the world’s largest prediction market, offers a user-friendly platform to bet on a wide range of topics, from sports to politics. By participating, you can profit from your knowledge while contributing to the accuracy of market predictions.

Did this answer your question?
\ No newline at end of file diff --git a/docs/polymarket-learn/FAQ/why-do-i-need-crypto.md b/docs/polymarket-learn/FAQ/why-do-i-need-crypto.md index 60990ea..34288ed 100644 --- a/docs/polymarket-learn/FAQ/why-do-i-need-crypto.md +++ b/docs/polymarket-learn/FAQ/why-do-i-need-crypto.md @@ -1,4 +1,4 @@ -Why Crypto? | Polymarket Help Center
Skip to main content

Why Crypto?

Why Polymarket uses crypto and blockchain technology to create the world’s largest Prediction market.

Updated over a month ago

Polymarket operates on Polygon, a proof-of-stake layer two blockchain built on Ethereum. All transactions are denominated in USDC, a US-dollar pegged stablecoin.This architecture offers several advantages over traditional prediction markets:

​Why USDC?

​Stable Value

Polymarket denominates trades in USDC, which is pegged 1:1 to the US Dollar. This shields you from the volatility associated with other cryptocurrencies and offers a stable medium for trading.

​Regulated Reserves

USDC operates in adherence to regulatory standards and is backed by reserved assets.

​Transparency

Blockchain technology facilitates transparency, as all transactions are recorded publicly.

​Global Reach

Research has shown that wide availability of prediction markets increases their accuracy. Using decentralized blockchain technology removes the need for a central authority in trading, which fosters fairness and open participation around the globe.

Did this answer your question?
- +--text-on-primary-color: #ffffff}
Skip to main content

Why Crypto?

Why Polymarket uses crypto and blockchain technology to create the world’s largest Prediction market.

Updated over 2 months ago

Polymarket operates on Polygon, a proof-of-stake layer two blockchain built on Ethereum. All transactions are denominated in USDC, a US-dollar pegged stablecoin.This architecture offers several advantages over traditional prediction markets:

​Why USDC?

​Stable Value

Polymarket denominates trades in USDC, which is pegged 1:1 to the US Dollar. This shields you from the volatility associated with other cryptocurrencies and offers a stable medium for trading.

​Regulated Reserves

USDC operates in adherence to regulatory standards and is backed by reserved assets.

​Transparency

Blockchain technology facilitates transparency, as all transactions are recorded publicly.

​Global Reach

Research has shown that wide availability of prediction markets increases their accuracy. Using decentralized blockchain technology removes the need for a central authority in trading, which fosters fairness and open participation around the globe.

Did this answer your question?
\ No newline at end of file diff --git a/docs/polymarket-learn/deposits/coinbase.md b/docs/polymarket-learn/deposits/coinbase.md index 385bd21..abc6b1b 100644 --- a/docs/polymarket-learn/deposits/coinbase.md +++ b/docs/polymarket-learn/deposits/coinbase.md @@ -1,4 +1,4 @@ -How to Deposit | Polymarket Help Center
Skip to main content

How to Deposit

How to add cash to your balance on Polymarket.

Updated over a month ago

To deposit funds into your Polymarket account:

  1. Click Deposit.

  2. Select your deposit method (for example, Transfer Crypto).

  3. Choose the token and network (chain) you want to use.

  4. Copy your deposit address.

  5. Send the minimum required amount to that address.

  6. After the transaction confirms, refresh the page — your funds will appear in your balance.

Always double-check the network and deposit address before sending funds. Transactions sent to the wrong chain or address cannot be reversed.

Did this answer your question?
- +--text-on-primary-color: #ffffff}
Skip to main content

How to Deposit

How to add cash to your balance on Polymarket.

Updated over 2 months ago

To deposit funds into your Polymarket account:

  1. Click Deposit.

  2. Select your deposit method (for example, Transfer Crypto).

  3. Choose the token and network (chain) you want to use.

  4. Copy your deposit address.

  5. Send the minimum required amount to that address.

  6. After the transaction confirms, refresh the page — your funds will appear in your balance.

Always double-check the network and deposit address before sending funds. Transactions sent to the wrong chain or address cannot be reversed.

Did this answer your question?
\ No newline at end of file diff --git a/docs/polymarket-learn/deposits/how-to-withdraw.md b/docs/polymarket-learn/deposits/how-to-withdraw.md index c365578..25db6f7 100644 --- a/docs/polymarket-learn/deposits/how-to-withdraw.md +++ b/docs/polymarket-learn/deposits/how-to-withdraw.md @@ -1,4 +1,4 @@ -How to Withdraw | Polymarket Help Center
Skip to main content

How to Withdraw

Updated over a month ago
Did this answer your question?
- +--text-on-primary-color: #ffffff}
Skip to main content

How to Withdraw

Updated over 2 months ago
Did this answer your question?
\ No newline at end of file diff --git a/docs/polymarket-learn/deposits/large-cross-chain-deposits.md b/docs/polymarket-learn/deposits/large-cross-chain-deposits.md index d9ffc9a..54f1f02 100644 --- a/docs/polymarket-learn/deposits/large-cross-chain-deposits.md +++ b/docs/polymarket-learn/deposits/large-cross-chain-deposits.md @@ -103,3 +103,6 @@ If you deposited the wrong token on Ethereum or Polygon, use these tools to reco Track your deposit progress through completion. + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/polymarket-learn/deposits/moonpay.md b/docs/polymarket-learn/deposits/moonpay.md index e29f90b..be02c8a 100644 --- a/docs/polymarket-learn/deposits/moonpay.md +++ b/docs/polymarket-learn/deposits/moonpay.md @@ -1,4 +1,4 @@ -How to Deposit | Polymarket Help Center
Skip to main content

How to Deposit

How to add cash to your balance on Polymarket.

Updated over a month ago

To deposit funds into your Polymarket account:

  1. Click Deposit.

  2. Select your deposit method (for example, Transfer Crypto).

  3. Choose the token and network (chain) you want to use.

  4. Copy your deposit address.

  5. Send the minimum required amount to that address.

  6. After the transaction confirms, refresh the page — your funds will appear in your balance.

Always double-check the network and deposit address before sending funds. Transactions sent to the wrong chain or address cannot be reversed.

Did this answer your question?
- +--text-on-primary-color: #ffffff}
Skip to main content

How to Deposit

How to add cash to your balance on Polymarket.

Updated over 2 months ago

To deposit funds into your Polymarket account:

  1. Click Deposit.

  2. Select your deposit method (for example, Transfer Crypto).

  3. Choose the token and network (chain) you want to use.

  4. Copy your deposit address.

  5. Send the minimum required amount to that address.

  6. After the transaction confirms, refresh the page — your funds will appear in your balance.

Always double-check the network and deposit address before sending funds. Transactions sent to the wrong chain or address cannot be reversed.

Did this answer your question?
\ No newline at end of file diff --git a/docs/polymarket-learn/deposits/supported-tokens.md b/docs/polymarket-learn/deposits/supported-tokens.md index a3ed03e..5445ce1 100644 --- a/docs/polymarket-learn/deposits/supported-tokens.md +++ b/docs/polymarket-learn/deposits/supported-tokens.md @@ -60,3 +60,6 @@ Most L2 chains (Polygon, Arbitrum, Base, Optimism) have low minimums of $2, whil Track your deposit progress. + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/polymarket-learn/deposits/usdc-on-eth.md b/docs/polymarket-learn/deposits/usdc-on-eth.md index 8b20d07..b108b86 100644 --- a/docs/polymarket-learn/deposits/usdc-on-eth.md +++ b/docs/polymarket-learn/deposits/usdc-on-eth.md @@ -1,4 +1,4 @@ -How to Deposit | Polymarket Help Center
Skip to main content

How to Deposit

How to add cash to your balance on Polymarket.

Updated over a month ago

To deposit funds into your Polymarket account:

  1. Click Deposit.

  2. Select your deposit method (for example, Transfer Crypto).

  3. Choose the token and network (chain) you want to use.

  4. Copy your deposit address.

  5. Send the minimum required amount to that address.

  6. After the transaction confirms, refresh the page — your funds will appear in your balance.

Always double-check the network and deposit address before sending funds. Transactions sent to the wrong chain or address cannot be reversed.

Did this answer your question?
- +--text-on-primary-color: #ffffff}
Skip to main content

How to Deposit

How to add cash to your balance on Polymarket.

Updated over 2 months ago

To deposit funds into your Polymarket account:

  1. Click Deposit.

  2. Select your deposit method (for example, Transfer Crypto).

  3. Choose the token and network (chain) you want to use.

  4. Copy your deposit address.

  5. Send the minimum required amount to that address.

  6. After the transaction confirms, refresh the page — your funds will appear in your balance.

Always double-check the network and deposit address before sending funds. Transactions sent to the wrong chain or address cannot be reversed.

Did this answer your question?
\ No newline at end of file diff --git a/docs/polymarket-learn/get-started/how-to-deposit.md b/docs/polymarket-learn/get-started/how-to-deposit.md index 1fd0720..1ff0bc0 100644 --- a/docs/polymarket-learn/get-started/how-to-deposit.md +++ b/docs/polymarket-learn/get-started/how-to-deposit.md @@ -1,4 +1,4 @@ -How to Deposit | Polymarket Help Center
Skip to main content

How to Deposit

How to add cash to your balance on Polymarket.

Updated over a month ago

To deposit funds into your Polymarket account:

  1. Click Deposit.

  2. Select your deposit method (for example, Transfer Crypto).

  3. Choose the token and network (chain) you want to use.

  4. Copy your deposit address.

  5. Send the minimum required amount to that address.

  6. After the transaction confirms, refresh the page — your funds will appear in your balance.

Always double-check the network and deposit address before sending funds. Transactions sent to the wrong chain or address cannot be reversed.

Did this answer your question?
- +--text-on-primary-color: #ffffff}
Skip to main content

How to Deposit

How to add cash to your balance on Polymarket.

Updated over 2 months ago

To deposit funds into your Polymarket account:

  1. Click Deposit.

  2. Select your deposit method (for example, Transfer Crypto).

  3. Choose the token and network (chain) you want to use.

  4. Copy your deposit address.

  5. Send the minimum required amount to that address.

  6. After the transaction confirms, refresh the page — your funds will appear in your balance.

Always double-check the network and deposit address before sending funds. Transactions sent to the wrong chain or address cannot be reversed.

Did this answer your question?
\ No newline at end of file diff --git a/docs/polymarket-learn/get-started/how-to-signup.md b/docs/polymarket-learn/get-started/how-to-signup.md index 5eb3d15..80e5b7e 100644 --- a/docs/polymarket-learn/get-started/how-to-signup.md +++ b/docs/polymarket-learn/get-started/how-to-signup.md @@ -1,4 +1,4 @@ -How to Sign-Up | Polymarket Help Center
Skip to main content

How to Sign-Up

How to create a Polymarket account.

Updated over a month ago

There are three ways to sign up for Polymarket.

Sign Up With Google

  1. Click Sign Up.

  2. Select Continue with Google.

  3. Connect your Google account.

  4. Complete the signup process.

You can now log in using your Google account.

Sign Up with Email

  1. Click Sign Up.

  2. Enter your email address and click Continue.

  3. Enter the 6-digit code sent to your email.

  4. You're signed up.

You can now log in using your email and 6-digit code.

Never share your 6-digit login code - not even with Polymarket staff. If someone gains access to your code, they can access your account and funds. Polymarket support cannot recover lost funds caused by shared codes.

Sign Up with Crypto Wallet

  1. Click Sign Up.

  2. Connect your crypto wallet (such as MetaMask, Rabby, or Phantom).

  3. Sign a message to Connect your wallet to Polymarket.

  4. Sign another message to Enable Trading.

  5. You're signed up.

You can now log in using your connected wallet.

Did this answer your question?
- +--text-on-primary-color: #ffffff}
Skip to main content

How to Sign-Up

How to create a Polymarket account.

Updated over 2 months ago

There are three ways to sign up for Polymarket.

Sign Up With Google

  1. Click Sign Up.

  2. Select Continue with Google.

  3. Connect your Google account.

  4. Complete the signup process.

You can now log in using your Google account.

Sign Up with Email

  1. Click Sign Up.

  2. Enter your email address and click Continue.

  3. Enter the 6-digit code sent to your email.

  4. You're signed up.

You can now log in using your email and 6-digit code.

Never share your 6-digit login code - not even with Polymarket staff. If someone gains access to your code, they can access your account and funds. Polymarket support cannot recover lost funds caused by shared codes.

Sign Up with Crypto Wallet

  1. Click Sign Up.

  2. Connect your crypto wallet (such as MetaMask, Rabby, or Phantom).

  3. Sign a message to Connect your wallet to Polymarket.

  4. Sign another message to Enable Trading.

  5. You're signed up.

You can now log in using your connected wallet.

Did this answer your question?
\ No newline at end of file diff --git a/docs/polymarket-learn/get-started/making-your-first-trade.md b/docs/polymarket-learn/get-started/making-your-first-trade.md index 20d80ad..8373dbd 100644 --- a/docs/polymarket-learn/get-started/making-your-first-trade.md +++ b/docs/polymarket-learn/get-started/making-your-first-trade.md @@ -80,9 +80,29 @@ The simplest way to place a limit order — create, sign, and submit in one call print("Order ID:", response["orderID"]) print("Status:", response["status"]) ``` + + ```rust Rust theme={null} + use polymarket_client_sdk::clob::types::Side; + use polymarket_client_sdk::types::dec; + + let token_id = "TOKEN_ID".parse()?; + let order = client + .limit_order() + .token_id(token_id) + .price(dec!(0.50)) + .size(dec!(10)) + .side(Side::Buy) + .build() + .await?; + let signed = client.sign(&signer, order).await?; + let response = client.post_order(signed).await?; + + println!("Order ID: {}", response.order_id); + println!("Status: {:?}", response.status); + ``` -### Two-Step: Sign Then Submit +### Two-Step Sign Then Submit For more control, you can separate signing from submission. This is useful for batch orders or custom submission logic: @@ -121,11 +141,27 @@ For more control, you can separate signing from submission. This is useful for b # Step 2: Submit to the CLOB response = client.post_order(signed_order, OrderType.GTC) ``` + + ```rust Rust theme={null} + // Step 1: Create order (auto-fetches tick size, neg risk, fee rate) + let order = client + .limit_order() + .token_id("TOKEN_ID".parse()?) + .price(dec!(0.50)) + .size(dec!(10)) + .side(Side::Buy) + .build() + .await?; + + // Step 2: Sign and submit separately + let signed = client.sign(&signer, order).await?; + let response = client.post_order(signed).await?; + ``` *** -## GTD Orders (Expiring) +## GTD Orders GTD orders auto-expire at a specified time. Useful for quoting around known events. @@ -168,6 +204,24 @@ GTD orders auto-expire at a specified time. Useful for quoting around known even order_type=OrderType.GTD ) ``` + + ```rust Rust theme={null} + use chrono::{TimeDelta, Utc}; + use polymarket_client_sdk::clob::types::OrderType; + + let order = client + .limit_order() + .token_id("TOKEN_ID".parse()?) + .price(dec!(0.50)) + .size(dec!(10)) + .side(Side::Buy) + .order_type(OrderType::GTD) + .expiration(Utc::now() + TimeDelta::hours(1)) + .build() + .await?; + let signed = client.sign(&signer, order).await?; + let response = client.post_order(signed).await?; + ``` @@ -235,6 +289,38 @@ Market orders execute immediately against resting liquidity using FOK or FAK typ ) client.post_order(sell_order, OrderType.FOK) ``` + + ```rust Rust theme={null} + use polymarket_client_sdk::clob::types::{Amount, OrderType, Side}; + + let token_id = "TOKEN_ID".parse()?; + + // FOK BUY: spend exactly $100 or cancel entirely + let buy = client + .market_order() + .token_id(token_id) + .amount(Amount::usdc(dec!(100))?) + .price(dec!(0.50)) // worst-price limit (slippage protection) + .side(Side::Buy) + .order_type(OrderType::FOK) + .build() + .await?; + let signed = client.sign(&signer, buy).await?; + client.post_order(signed).await?; + + // FOK SELL: sell exactly 200 shares or cancel entirely + let sell = client + .market_order() + .token_id(token_id) + .amount(Amount::shares(dec!(200))?) + .price(dec!(0.45)) // worst-price limit (slippage protection) + .side(Side::Sell) + .order_type(OrderType::FOK) + .build() + .await?; + let signed = client.sign(&signer, sell).await?; + client.post_order(signed).await?; + ``` * **FOK** — fill entirely or cancel the whole order @@ -270,6 +356,20 @@ For convenience, `createAndPostMarketOrder` handles creation, signing, and submi order_type=OrderType.FOK, ) ``` + + ```rust Rust theme={null} + let order = client + .market_order() + .token_id("TOKEN_ID".parse()?) + .amount(Amount::usdc(dec!(100))?) + .price(dec!(0.50)) + .side(Side::Buy) + .order_type(OrderType::FOK) + .build() + .await?; + let signed = client.sign(&signer, order).await?; + let response = client.post_order(signed).await?; + ``` *** @@ -286,6 +386,20 @@ Post-only orders guarantee you're always the maker. If the order would match imm ```python Python theme={null} response = client.post_order(signed_order, OrderType.GTC, post_only=True) ``` + + ```rust Rust theme={null} + let order = client + .limit_order() + .token_id("TOKEN_ID".parse()?) + .price(dec!(0.50)) + .size(dec!(10)) + .side(Side::Buy) + .post_only(true) + .build() + .await?; + let signed = client.sign(&signer, order).await?; + let response = client.post_order(signed).await?; + ``` * Only works with **GTC** and **GTD** order types @@ -356,6 +470,31 @@ Place up to **15 orders** in a single request: ), ]) ``` + + ```rust Rust theme={null} + let token_id = "TOKEN_ID".parse()?; + + let bid = client + .limit_order() + .token_id(token_id) + .price(dec!(0.48)) + .size(dec!(500)) + .side(Side::Buy) + .build() + .await?; + let ask = client + .limit_order() + .token_id(token_id) + .price(dec!(0.52)) + .size(dec!(500)) + .side(Side::Sell) + .build() + .await?; + + let signed_bid = client.sign(&signer, bid).await?; + let signed_ask = client.sign(&signer, ask).await?; + let response = client.post_orders(vec![signed_bid, signed_ask]).await?; + ``` *** @@ -383,6 +522,11 @@ Your order price must conform to the market's tick size, or the order is rejecte ```python Python theme={null} tick_size = client.get_tick_size("TOKEN_ID") ``` + + ```rust Rust theme={null} + let token_id = "TOKEN_ID".parse()?; + let tick_size = client.tick_size(token_id).await?; + ``` ### Negative Risk @@ -397,11 +541,16 @@ Multi-outcome events (3+ outcomes) use the Neg Risk CTF Exchange. Pass `negRisk: ```python Python theme={null} is_neg_risk = client.get_neg_risk("TOKEN_ID") ``` + + ```rust Rust theme={null} + let token_id = "TOKEN_ID".parse()?; + let is_neg_risk = client.neg_risk(token_id).await?; + ``` Both values are also available on the market object: `minimum_tick_size` and - `neg_risk`. + `neg_risk`. In Rust, the order builder auto-fetches both — you don't need to look them up manually. *** @@ -513,6 +662,18 @@ The heartbeat endpoint maintains session liveness. If a valid heartbeat is not r heartbeat_id = resp["heartbeat_id"] time.sleep(5) ``` + + ```rust Rust theme={null} + // With the `heartbeats` feature, the Rust SDK can auto-send heartbeats + // in a background task — no manual loop needed: + Client::start_heartbeats(&mut client)?; + // ... your trading logic ... + client.stop_heartbeats().await?; + + // Or send manually: + let resp = client.post_heartbeat(None).await?; // None for first call + let resp = client.post_heartbeat(Some(resp.heartbeat_id)).await?; + ``` * Include the most recent `heartbeat_id` in each request. Use an empty string for the first request. @@ -531,3 +692,6 @@ The heartbeat endpoint maintains session liveness. If a valid heartbeat is not r Attribute orders to your builder account for volume credit + + +Built with [Mintlify](https://mintlify.com). \ No newline at end of file diff --git a/docs/polymarket-learn/get-started/what-is-polymarket.md b/docs/polymarket-learn/get-started/what-is-polymarket.md index 81e77cf..c06054e 100644 --- a/docs/polymarket-learn/get-started/what-is-polymarket.md +++ b/docs/polymarket-learn/get-started/what-is-polymarket.md @@ -1,4 +1,4 @@ -What is Polymarket | Polymarket Help Center
Skip to main content

What is Polymarket

Polymarket is the world’s largest prediction market, allowing you to stay informed and profit from your knowledge by betting on future events across various topics.

Updated over a month ago

Studies show prediction markets are often more accurate than pundits because they combine news, polls, and expert opinions into a single value that represents the market’s view of an event’s odds. Our markets reflect accurate, unbiased, and real-time probabilities for the events that matter most to you. Markets seek truth.

​Quick Overview

  • On Polymarket, you can representing future event outcomes (i.e. “Will TikTok be banned in the U.S. this year?”)buy and sell shares

  • Shares in event outcomes are between 0.00 and 1.00 , and every pair of event outcomes (i.e. each pair of “YES” + “NO” shares) is fully collateralized by $1.00 USDC.always pricedUSDC

  • Shares are created when , such that the sum of what each side is willing to pay is equal to $1.00.opposing sides come to an agreement on odds

  • The shares representing the correct, final outcome are paid out $1.00 USDC each upon .market resolution

  • Unlike sportsbooks, you are not betting against “the house” – the counterparty to each trade is another Polymarket user. As such:

    • Shares can be sold before the event outcome is known_ (i.e. to lock in profits or cut losses)

    • There is no “house” to ban you for winning too much.

​Understanding Prices

Prices = Probabilities.

Prices (odds) on Polymarket represent the current probability of an event occurring. For example, in a market predicting whether the Miami Heat will win the 2025 NBA Finals, if YES shares are trading at 18 cents, it indicates a 18% chance of Miami winning.

These odds are determined by what price other Polymarket users are currently willing to buy & sell those shares at. Just how stock exchanges don’t “set” the prices of stocks, Polymarket does not set prices / odds - they’re a function of supply & demand.

​Making money on markets

In the example above, if you believe Miami’s chances of winning are higher than 18%, you would buy “Yes” shares at 18 cents each. If Miami wins, each “Yes” share would be worth $1, resulting in an 82-cent profit per share. Conversely, any trader who owned “No” shares would see their investment become worthless once the game is over.

Since it’s a market, you’re not locked into your trade. You can sell your shares at any time at the current market price. As the news changes, the supply and demand for shares fluctuates, causing the share price to reflect the new odds for the event.

​How accurate are Polymarket odds?

Research shows prediction markets are often more accurate than experts, polls, and pundits. Traders aggregate news, polls, and expert opinions, making informed trades. Their economic incentives ensure market prices adjust to reflect true odds as more knowledgeable participants join.

This makes prediction markets the best source of real-time event probabilities. People use Polymarket for the most accurate odds, gaining the ability to make informed decisions about the future.

If you’re an expert on a certain topic, Polymarket is your opportunity to profit from trading based on your knowledge, while improving the market’s accuracy.

Did this answer your question?
- +--text-on-primary-color: #ffffff}
Skip to main content

What is Polymarket

Polymarket is the world’s largest prediction market, allowing you to stay informed and profit from your knowledge by betting on future events across various topics.

Updated over 2 months ago

Studies show prediction markets are often more accurate than pundits because they combine news, polls, and expert opinions into a single value that represents the market’s view of an event’s odds. Our markets reflect accurate, unbiased, and real-time probabilities for the events that matter most to you. Markets seek truth.

​Quick Overview

  • On Polymarket, you can representing future event outcomes (i.e. “Will TikTok be banned in the U.S. this year?”)buy and sell shares

  • Shares in event outcomes are between 0.00 and 1.00 , and every pair of event outcomes (i.e. each pair of “YES” + “NO” shares) is fully collateralized by $1.00 USDC.always pricedUSDC

  • Shares are created when , such that the sum of what each side is willing to pay is equal to $1.00.opposing sides come to an agreement on odds

  • The shares representing the correct, final outcome are paid out $1.00 USDC each upon .market resolution

  • Unlike sportsbooks, you are not betting against “the house” – the counterparty to each trade is another Polymarket user. As such:

    • Shares can be sold before the event outcome is known_ (i.e. to lock in profits or cut losses)

    • There is no “house” to ban you for winning too much.

​Understanding Prices

Prices = Probabilities.

Prices (odds) on Polymarket represent the current probability of an event occurring. For example, in a market predicting whether the Miami Heat will win the 2025 NBA Finals, if YES shares are trading at 18 cents, it indicates a 18% chance of Miami winning.

These odds are determined by what price other Polymarket users are currently willing to buy & sell those shares at. Just how stock exchanges don’t “set” the prices of stocks, Polymarket does not set prices / odds - they’re a function of supply & demand.

​Making money on markets

In the example above, if you believe Miami’s chances of winning are higher than 18%, you would buy “Yes” shares at 18 cents each. If Miami wins, each “Yes” share would be worth $1, resulting in an 82-cent profit per share. Conversely, any trader who owned “No” shares would see their investment become worthless once the game is over.

Since it’s a market, you’re not locked into your trade. You can sell your shares at any time at the current market price. As the news changes, the supply and demand for shares fluctuates, causing the share price to reflect the new odds for the event.

​How accurate are Polymarket odds?

Research shows prediction markets are often more accurate than experts, polls, and pundits. Traders aggregate news, polls, and expert opinions, making informed trades. Their economic incentives ensure market prices adjust to reflect true odds as more knowledgeable participants join.

This makes prediction markets the best source of real-time event probabilities. People use Polymarket for the most accurate odds, gaining the ability to make informed decisions about the future.

If you’re an expert on a certain topic, Polymarket is your opportunity to profit from trading based on your knowledge, while improving the market’s accuracy.

Did this answer your question?
\ No newline at end of file diff --git a/docs/polymarket-learn/markets/dispute.md b/docs/polymarket-learn/markets/dispute.md index 4ad7afd..75e2c85 100644 --- a/docs/polymarket-learn/markets/dispute.md +++ b/docs/polymarket-learn/markets/dispute.md @@ -1,4 +1,4 @@ -How Are Markets Disputed? | Polymarket Help Center
Skip to main content

How Are Markets Disputed?

Anyone can dispute a proposed market resolution if they feel it was proposed in error.

Updated over a month ago

Once a market is proposed for resolution it goes into a challenge period of 2 hours.

If no one challenges the proposal the resolution is deemed valid and the proposer receives their bond back plus the reward.

During the 2-hour challenge period, anyone may dispute the proposal on the UMA dapp by posting a challenge bond of the same amount as the proposer bond (usually $750).

This begins the debate period of 24-48 hours (votes happen every other day and there will always be at least 24 hours for discussion). Anyone wishing to contribute evidence to the discussion can do so in the Uma Discord server in the #evidence-rationale and #voting-discussion channels.

After the debate period, Uma token holders vote (this process takes approximately 48 hours) and one of four outcomes happens:

Outcomes

​Proposer wins

Proposer receives their bond back plus half the disputer’s bond as a bounty. Disputer loses their bond.

​Disputer wins

Disputer receives their bond back plus half the proposer’s bond as a bounty. Proposer loses their bond.

​Too Early

This outcome is for proposals for which the underlying event has not yet happened. Eg the result of a sports match that is still ongoing. Disputer receives their bond back plus half the proposer’s bond as a bounty. Proposer loses their bond.

​Unknown/50-50

This (rarely used) outcome is for events where none of the other options are appropriate. In this case the market price resolves to 50 yes and 50 no. Disputer receives their bond back plus half the proposer’s bond as a bounty. Proposer loses their bond.

Did this answer your question?
- +--text-on-primary-color: #ffffff}
Skip to main content

How Are Markets Disputed?

Anyone can dispute a proposed market resolution if they feel it was proposed in error.

Updated over 2 months ago

Once a market is proposed for resolution it goes into a challenge period of 2 hours.

If no one challenges the proposal the resolution is deemed valid and the proposer receives their bond back plus the reward.

During the 2-hour challenge period, anyone may dispute the proposal on the UMA dapp by posting a challenge bond of the same amount as the proposer bond (usually $750).

This begins the debate period of 24-48 hours (votes happen every other day and there will always be at least 24 hours for discussion). Anyone wishing to contribute evidence to the discussion can do so in the Uma Discord server in the #evidence-rationale and #voting-discussion channels.

After the debate period, Uma token holders vote (this process takes approximately 48 hours) and one of four outcomes happens:

Outcomes

​Proposer wins

Proposer receives their bond back plus half the disputer’s bond as a bounty. Disputer loses their bond.

​Disputer wins

Disputer receives their bond back plus half the proposer’s bond as a bounty. Proposer loses their bond.

​Too Early

This outcome is for proposals for which the underlying event has not yet happened. Eg the result of a sports match that is still ongoing. Disputer receives their bond back plus half the proposer’s bond as a bounty. Proposer loses their bond.

​Unknown/50-50

This (rarely used) outcome is for events where none of the other options are appropriate. In this case the market price resolves to 50 yes and 50 no. Disputer receives their bond back plus half the proposer’s bond as a bounty. Proposer loses their bond.

Did this answer your question?
\ No newline at end of file diff --git a/docs/polymarket-learn/markets/how-are-markets-clarified.md b/docs/polymarket-learn/markets/how-are-markets-clarified.md index 6c19f6b..74cb86b 100644 --- a/docs/polymarket-learn/markets/how-are-markets-clarified.md +++ b/docs/polymarket-learn/markets/how-are-markets-clarified.md @@ -1,4 +1,4 @@ -How Are Markets Clarified? | Polymarket Help Center
Skip to main content

How Are Markets Clarified?

How are markets on Polymarket clarified?

Updated over a month ago
Did this answer your question?
- +--text-on-primary-color: #ffffff}
Skip to main content

How Are Markets Clarified?

How are markets on Polymarket clarified?

Updated over 2 months ago
Did this answer your question?
\ No newline at end of file diff --git a/docs/polymarket-learn/markets/how-are-markets-created.md b/docs/polymarket-learn/markets/how-are-markets-created.md index cf41d50..d4b2a56 100644 --- a/docs/polymarket-learn/markets/how-are-markets-created.md +++ b/docs/polymarket-learn/markets/how-are-markets-created.md @@ -1,4 +1,4 @@ -How Are Markets Created? | Polymarket Help Center
Skip to main content

How Are Markets Created?

Markets are created by the markets team with input from users and the community.

Updated over a month ago


Can I create my own market?

While users cannot directly create their own markets, they are encouraged to suggest ideas for new markets.

​Submit your market proposal

To give your proposal the best chance of being listed, include as much information as possible, such as:

  • What is the market title?

  • What is the resolution source?

  • Evidence of demand for trading that market

The best ways to propose a new market are:

  • On Discord in the #market-suggestion channel

  • On Twitter / X by tagging @polymarket

Did this answer your question?
- +--text-on-primary-color: #ffffff}
Skip to main content

How Are Markets Created?

Markets are created by the markets team with input from users and the community.

Updated over 2 months ago


Can I create my own market?

While users cannot directly create their own markets, they are encouraged to suggest ideas for new markets.

​Submit your market proposal

To give your proposal the best chance of being listed, include as much information as possible, such as:

  • What is the market title?

  • What is the resolution source?

  • Evidence of demand for trading that market

The best ways to propose a new market are:

  • On Discord in the #market-suggestion channel

  • On Twitter / X by tagging @polymarket

Did this answer your question?
\ No newline at end of file diff --git a/docs/polymarket-learn/markets/how-are-markets-resolved.md b/docs/polymarket-learn/markets/how-are-markets-resolved.md index 92602f1..137bb8f 100644 --- a/docs/polymarket-learn/markets/how-are-markets-resolved.md +++ b/docs/polymarket-learn/markets/how-are-markets-resolved.md @@ -1,4 +1,4 @@ -How Are Prediction Markets Resolved? | Polymarket Help Center
Skip to main content

How Are Prediction Markets Resolved?

Markets are resolved by the UMA Optimistic Oracle, a smart-contract based optimistic oracle.

Updated over a month ago

Overview

  • When the result of a market becomes clear, the market can be “resolved,” or permanently finalized.

  • Markets are resolved according to the market’s pre-defined rules, which can be found under market’s the order book.

  • When a market is resolved, holders of winning shares receive $1 per share, losing shares become worthless, and trading of shares is no longer possible.

  • To resolve a market, an outcome must first be “proposed,” which involves putting up a bond in USDC.e which will be forfeited if the proposal is unsuccessful.

  • If the proposal is validated as accurate, the proposer will receive a reward for your proposal.

If you propose a market too early, or are unsuccessful in your proposal, you will lose all of your $750 bond. Do not propose a resolution unless you understand the process and are confident in your view.

To propose a market resolution

Once in the verification process, UMA will review the transaction to ensure it was proposed correctly. If approved, you will receive your bond amount back in your wallet plus the reward. If not approved, it will enter Uma’s dispute resolution process, which is described in detail here.

​To dispute a proposed resolution

Once a market is proposed for resolution it goes into a challenge period of 2 hours.

If you do not agree with a proposed resolution, you can dispute the outcome.

Did this answer your question?
- +--text-on-primary-color: #ffffff}
Skip to main content

How Are Prediction Markets Resolved?

Markets are resolved by the UMA Optimistic Oracle, a smart-contract based optimistic oracle.

Updated over 2 months ago

Overview

  • When the result of a market becomes clear, the market can be “resolved,” or permanently finalized.

  • Markets are resolved according to the market’s pre-defined rules, which can be found under market’s the order book.

  • When a market is resolved, holders of winning shares receive $1 per share, losing shares become worthless, and trading of shares is no longer possible.

  • To resolve a market, an outcome must first be “proposed,” which involves putting up a bond in USDC.e which will be forfeited if the proposal is unsuccessful.

  • If the proposal is validated as accurate, the proposer will receive a reward for your proposal.

If you propose a market too early, or are unsuccessful in your proposal, you will lose all of your $750 bond. Do not propose a resolution unless you understand the process and are confident in your view.

To propose a market resolution

Once in the verification process, UMA will review the transaction to ensure it was proposed correctly. If approved, you will receive your bond amount back in your wallet plus the reward. If not approved, it will enter Uma’s dispute resolution process, which is described in detail here.

​To dispute a proposed resolution

Once a market is proposed for resolution it goes into a challenge period of 2 hours.

If you do not agree with a proposed resolution, you can dispute the outcome.

Did this answer your question?
\ No newline at end of file diff --git a/docs/polymarket-learn/trading/fees.md b/docs/polymarket-learn/trading/fees.md index 544926e..72d3257 100644 --- a/docs/polymarket-learn/trading/fees.md +++ b/docs/polymarket-learn/trading/fees.md @@ -6,56 +6,35 @@ > Understanding trading fees on Polymarket -Polymarket does not charge fees on most markets. However, certain markets have taker fees enabled to fund the [Maker Rebates Program](/market-makers/maker-rebates). +Polymarket charges a small taker fee on certain markets. These fees fund the [Maker Rebates Program](/market-makers/maker-rebates), which redistributes fees daily to market makers to incentivize deeper liquidity and tighter spreads. + +**Geopolitical and world events markets are fee-free.** Polymarket does not charge fees or profit from trading activity on these markets. There are also no Polymarket fees to deposit or withdraw USDC (though intermediaries like Coinbase or MoonPay may charge their own fees). + + + Fees apply only to markets deployed on or after the activation date. Pre-existing markets are unaffected. Markets with fees enabled have `feesEnabled` set to `true` on the market object. + *** -## Fee-Free Markets +## Current Fee Structure -The vast majority of Polymarket markets have **no trading fees**: +The following fee parameters are currently live. **New fee parameters will take effect on March 30, 2026** — see [Upcoming Fee Structure](#upcoming-fee-structure) below. -* No fees to deposit or withdraw USDC (though intermediaries like Coinbase or MoonPay may charge their own fees) -* No fees to trade shares +Currently, only **Crypto** and **Sports** markets have taker fees enabled. -*** - -## Markets With Fees - -The following market types charge a small taker fee on each trade. These fees are collected and redistributed daily to market makers as rebates, incentivizing deeper liquidity and tighter spreads. - -* **15-minute crypto markets** -* **5-minute crypto markets** -* **NCAAB (college basketball) markets** (starting February 18, 2026 for new markets) -* **Serie A markets** (starting February 18, 2026 for new markets) - -### Fee Structure - -Fees are calculated using the following formula: - -```text theme={null} -fee = C × p × feeRate × (p × (1 - p))^exponent -``` - -Where **C** = number of shares traded and **p** = price of the shares. The fee parameters differ by market type: - -| Parameter | Sports (NCAAB, Serie A) | 5-Min & 15-Min Crypto | -| -------------- | ----------------------- | --------------------- | -| Fee Rate | 0.0175 | 0.25 | -| Exponent | 1 | 2 | -| Maker Rebate % | 25% | 20% | - -Taker fees are calculated in USDC and vary based on the share price. However, fees are collected in shares on buy orders and USDC on sell orders. The effective rate **peaks at 50%** probability and decreases symmetrically toward the extremes. +| Category | Fee Rate | Exponent | Maker Rebate | Peak Effective Rate | +| -------- | -------- | -------- | ------------ | ------------------- | +| Crypto | 0.25 | 2 | 20% | 1.56% | +| Sports | 0.0175 | 1 | 25% | 0.44% |
-