diff --git a/docs/changelog/changelog.md b/docs/changelog/changelog.md index e69de29..3122c1f 100644 --- a/docs/changelog/changelog.md +++ b/docs/changelog/changelog.md @@ -0,0 +1,170 @@ +> ## Documentation Index +> Fetch the complete documentation index at: https://docs.polymarket.com/llms.txt +> Use this file to discover all available pages before exploring further. + +# Polymarket Changelog + +> Welcome to the Polymarket Changelog. Here you will find any important changes to Polymarket, including but not limited to CLOB, API, UI and Mobile Applications. + + + * **Support contact**: Added a link to [our Bridge API provider's support](https://intercom.help/funxyz/en/articles/10732578-contact-us) (Fun.xyz) for failed, stuck, or compliance-held bridge transactions. See [Deposit Status](/trading/bridge/status). + + + + * **New endpoints**: Added `GET /markets/keyset` and `GET /events/keyset` for cursor-based pagination, replacing offset-based `GET /markets` and `GET /events`. + * **How it works**: These use an opaque `after_cursor`/`next_cursor` token instead of `offset`, providing stable and efficient paging through large result sets. Same filters, same response shape per item — the only differences are the wrapper response (`{ "markets": [...], "next_cursor": "..." }`) and the rejection of `offset`. + * **Migration**: The existing `GET /markets` and `GET /events` endpoints remain available but will be deprecated in a future release. New integrations should use the keyset variants. + + + + * **`closed` default change**: The `closed` query parameter on `GET /markets` now defaults to `false`. Closed markets are excluded from results unless you explicitly pass `closed=true`. + + + + * **Fee calculation source**: Fees should now be calculated using the `feeSchedule` object within a market. + + + + * **New fee categories**: Fees now apply to Crypto, Sports, Finance, Politics, Economics, Culture, Weather, Tech, Mentions, and Other / General markets with updated rates per category. Geopolitical and world events markets remain fee-free. + * **Updated documentation**: [Fees](/trading/fees) and [Maker Rebates Program](/market-makers/maker-rebates). + + + + * **March Madness Liquidity Rewards**: Adding \$2M+ in liquidity rewards to both live and pregame markets. + * **How it works**: Liquidity rewards are payments for placing competitive bids. Rewards are paid out based on the size of your orders, how close they are to the midpoint, and how consistently they are quoted relative to other liquidity providers. Orders must be active on the book for a minimum of **3.5 seconds** to be eligible. + + **Daily reward rates for markets (subject to change):** + + **48 hours before GameStartTime:** + + * \$7.5k for full game ML market + * \$500 for 5 other markets (most recently created full game spread, most recently created full game total, 1st half ML, most recently created 1st half spread, most recently created 1st half total) + + **From game live to game completion (note: rewards are expressed in daily rates):** + + * \$60k for full game ML + * \$4k for most recently created full game spread and most recently created full game total + + **From game live to halftime (note: rewards are expressed in daily rates):** + + * \$8k for 1st half ML, most recently created 1st half spread, most recently created 1st half total + + * **Markets**: [Browse March Madness markets](https://polymarket.com/sports/cbb/games) + + * **More details**: [Liquidity Rewards documentation](/market-makers/liquidity-rewards#liquidity-rewards) + + + + * **Crypto market fees expansion**: Starting March 6, 2026, taker fees and maker rebates extend to all crypto markets including 1H, 4H, daily, and weekly. The same fee structure as existing crypto markets applies. Only new markets created after March 6 are affected. + * **Updated documentation**: [Fees](/trading/fees) and [Maker Rebates Program](/market-makers/maker-rebates) updated to reflect all crypto market coverage. + + + + * **5-minute crypto markets**: Launched with taker fees enabled. Fees follow the same curve as 15-minute crypto markets, peaking at 1.56% at 50% probability. + * **Maker Rebates**: Liquidity providers earn daily USDC rebates funded by taker fees, same as 15-minute crypto markets. + + + + * **Sports market fees**: Taker fees to be enabled on NCAAB (college basketball) and Serie A markets on February 18, 2026. + * **Per-market rebate calculation**: Rebates are now calculated per market, makers only compete with other makers in the same market. + * **Updated documentation**: [Maker Rebates Program](/market-makers/maker-rebates) updated with sports fee tables and parameters. + + + + * **Withdrawal Endpoint**: New `/withdraw` endpoint to bridge USDC.e from Polymarket to any supported chain and token. + * **Multi-chain withdrawals**: Withdraw to EVM chains (Ethereum, Arbitrum, Base, etc.), Solana, and Bitcoin. + * **Updated documentation**: Bridge API docs updated to reflect deposit and withdrawal functionality. + + + + * RTDS docs updated to reflect RTDS supports **comments** and **crypto prices** only. + * Removed legacy CLOB references and `clob_auth` from RTDS docs. + + + + * **Maker Rebates Program**: Updated funding schedule with distribution method (volume-weighted vs fee-curve weighted). + * **Fee-curve weighted rebates**: Documented fee-equivalent formula and rebate calculation. + * **FAQ**: Clarified how rebates are calculated during fee-curve weighted periods. + + + + * **Releases**: Daily Releases timing + * **HeartBeats API**: HeartBeats endpoint for monitoring connection status and canceling orders + * **Post Only Orders**: Orders that are rejected if they would immediately match against an existing order + + + + * **Taker Fees**: Enabled on 15-minute crypto markets. Fees vary by price and peak at 1.56% at 50% probability. + * **Maker Rebates**: Daily USDC rebates paid to liquidity providers, funded by taker fees. + + + + * **Crypto Price Feeds**: Access real-time cryptocurrency prices from two sources (Binance & Chainlink) + * **Comment Streaming**: Real-time updates for comment events including new comments, replies, and reactions + * **Dynamic Subscriptions**: Add, remove, and modify subscriptions without reconnecting + * **TypeScript Client**: Official TypeScript client available at [real-time-data-client](https://github.com/Polymarket/real-time-data-client) + For complete documentation, see [Market Data](/market-data/overview). + + + + * There has been a significant change to the structure of the price change message. This update will be applied at 11PM UTC September 15, 2025. We apologize for the short notice + * Please see the [Market Channel](/market-data/websocket/market-channel) for details. + + + + * Reduced maximum values for query parameters on Data-API /trades and /activity: + * `limit`: 500 + * `offset`: 1,000 + + + + * The batch orders limit has been increased from 5 -> 15. Read more about the batch orders functionality [here](/trading/orders/create). + + + + * 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. + * `neg_risk` + * type: boolean + * description: Boolean indicating whether the market is neg\_risk. + * `tick_size` + * type: string + * description: Minimum price increment. + + + + * 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 adding a new `side` field to the `MakerOrder` portion of the trade object. This field will indicate whether the maker order is a `buy` or `sell`, helping to clarify trade events where the maker side was previously ambiguous. For more details, refer to the MakerOrder object on the [Orders](/trading/orders/cancel) page. + + + + * The 100 token subscription limit has been removed for the Markets channel. You can now subscribe to as many token IDs as needed for your use case. + * New Subscribe Field `initial_dump` + * Optional field to indicate whether you want to receive the initial order book state when subscribing to a token or list of tokens. + * `default: true` + + + + 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. + + + + All API users will enjoy increased rate limits for the CLOB endpoints. + + * CLOB - /books (website) (300req - 10s / Throttle requests over the maximum configured rate) + * CLOB - /books (50 req - 10s / Throttle requests over the maximum configured rate) + * 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) - 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 + diff --git a/docs/quickstart/overview.md b/docs/quickstart/overview.md index e69de29..b24cf2c 100644 --- a/docs/quickstart/overview.md +++ b/docs/quickstart/overview.md @@ -0,0 +1,291 @@ +> ## Documentation Index +> Fetch the complete documentation index at: https://docs.polymarket.com/llms.txt +> Use this file to discover all available pages before exploring further. + +# Quickstart + +> Fetch a market and place your first order + +Get up and running with the Polymarket API in minutes — fetch market data and place your first order. + + + + All data endpoints are public — no API key or authentication needed. Use the markets endpoint to find a market and get its token IDs: + + + + ```bash theme={null} + curl "https://gamma-api.polymarket.com/markets?active=true&closed=false&limit=1" + ``` + + + + ```typescript theme={null} + const response = await fetch( + "https://gamma-api.polymarket.com/markets?active=true&closed=false&limit=1" + ); + const markets = await response.json(); + + const market = markets[0]; + console.log(market.question); + console.log(market.clobTokenIds); + // ["123456...", "789012..."] — [Yes token ID, No token ID] + ``` + + + + ```python theme={null} + import requests + + response = requests.get( + "https://gamma-api.polymarket.com/markets", + params={"active": "true", "closed": "false", "limit": 1} + ) + markets = response.json() + + market = markets[0] + print(market["question"]) + print(market["clobTokenIds"]) + # ["123456...", "789012..."] — [Yes token ID, No token ID] + ``` + + + + ```rust theme={null} + use polymarket_client_sdk::gamma::Client; + use polymarket_client_sdk::gamma::types::request::MarketsRequest; + + let client = Client::default(); + + let request = MarketsRequest::builder() + .closed(false) + .limit(1) + .build(); + let markets = client.markets(&request).await?; + + let market = &markets[0]; + println!("{:?}", market.question); + println!("{:?}", market.clob_token_ids); + // Some(["123456...", "789012..."]) — [Yes token ID, No token ID] + ``` + + + + Save a token ID from `clobTokenIds` — you'll need it to place an order. The first ID is the Yes token, the second is the No token. See [Fetching Markets](/market-data/fetching-markets) for more strategies like fetching by slug, tag, or event. + + + + + ```bash TypeScript theme={null} + npm install @polymarket/clob-client ethers@5 + ``` + + ```bash Python theme={null} + pip install py-clob-client + ``` + + ```bash Rust theme={null} + cargo add polymarket-client-sdk + ``` + + + + + Derive API credentials and initialize the trading client: + + + + ```typescript theme={null} + import { ClobClient } from "@polymarket/clob-client"; + import { Wallet } from "ethers"; // v5.8.0 + + const HOST = "https://clob.polymarket.com"; + const CHAIN_ID = 137; // Polygon mainnet + const signer = new Wallet(process.env.PRIVATE_KEY); + + // Derive API credentials (L1 → L2 auth) + const tempClient = new ClobClient(HOST, CHAIN_ID, signer); + const apiCreds = await tempClient.createOrDeriveApiKey(); + + // Initialize trading client + const client = new ClobClient( + HOST, + CHAIN_ID, + signer, + apiCreds, + 0, // Signature type: 0 = EOA + signer.address, // Funder address + ); + ``` + + + + ```python theme={null} + from py_clob_client.client import ClobClient + import os + + host = "https://clob.polymarket.com" + chain_id = 137 # Polygon mainnet + private_key = os.getenv("PRIVATE_KEY") + + # Derive API credentials (L1 → L2 auth) + temp_client = ClobClient(host, key=private_key, chain_id=chain_id) + api_creds = temp_client.create_or_derive_api_creds() + + # Initialize trading client + client = ClobClient( + host, + key=private_key, + chain_id=chain_id, + creds=api_creds, + signature_type=0, # Signature type: 0 = EOA + funder="YOUR_WALLET_ADDRESS", # Funder address + ) + ``` + + + + ```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 trading client (L1 → L2 auth) + // Signature type defaults to EOA (0) + let client = Client::new("https://clob.polymarket.com", Config::default())? + .authentication_builder(&signer) + .authenticate() + .await?; + ``` + + + + + This example uses an EOA wallet (signature type `0`) — your wallet pays its + own gas. Proxy wallet users (types `1` and `2`) can use Polymarket's gasless + relayer instead. See [Authentication](/api-reference/authentication) for + details on signature types. + + + + Before trading, your funder address needs **USDC.e** (for buying outcome + tokens) and **POL** (for gas, if using EOA type `0`). + + + + + Use the `token_id` from Step 1 to place a limit order: + + + + ```typescript theme={null} + import { Side, OrderType } from "@polymarket/clob-client"; + + // Fetch market details to get tick size and neg risk + const market = await client.getMarket("YOUR_CONDITION_ID"); + const tickSize = String(market.minimum_tick_size); // e.g., "0.01" + const negRisk = market.neg_risk; // e.g., false + + const response = await client.createAndPostOrder( + { + tokenID: "YOUR_TOKEN_ID", // From Step 1 + price: 0.50, + size: 10, + side: Side.BUY, + orderType: OrderType.GTC, + }, + { + tickSize, + negRisk, + }, + ); + + console.log("Order ID:", response.orderID); + console.log("Status:", response.status); + ``` + + + + ```python theme={null} + from py_clob_client.clob_types import OrderArgs, OrderType + from py_clob_client.order_builder.constants import BUY + + # Fetch market details to get tick size and neg risk + market = client.get_market("YOUR_CONDITION_ID") + tick_size = str(market["minimum_tick_size"]) # e.g., "0.01" + neg_risk = market["neg_risk"] # e.g., False + + response = client.create_and_post_order( + OrderArgs( + token_id="YOUR_TOKEN_ID", # From Step 1 + price=0.50, + size=10, + side=BUY, + order_type=OrderType.GTC, + ), + options={ + "tick_size": tick_size, + "neg_risk": neg_risk, + }, + ) + + print("Order ID:", response["orderID"]) + print("Status:", response["status"]) + ``` + + + + ```rust theme={null} + use polymarket_client_sdk::clob::types::Side; + use polymarket_client_sdk::types::dec; + + // token_id is a U256 — parse from the string returned in Step 1 + let token_id = "YOUR_TOKEN_ID".parse()?; + + // The Rust SDK auto-fetches tick size, neg risk, and fee rate + // No need to manually look them up — the order builder handles it + 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); + ``` + + + + + +*** + +## Next Steps + + + + Understand L1/L2 auth, signature types, and API credentials. + + + + Detailed trading guide with order management and troubleshooting. + + + + Strategies for discovering markets by slug, tag, or category. + + + + Understand markets, events, prices, and positions. + +