docs: refresh all documentation - fill 98 empty files and update changelog
Date: 2026-06-19 Changes: - Fixed 98 empty .md files that had failed to scrape - Updated changelog with latest entries (Jun 15, 2026: CLOB DELETE /orders limit reduced to 1000) - Refreshed FAQ, Polymarket Learn, Developers, and other sections Notable updates: - Jun 15, 2026: CLOB DELETE /orders maximum batch size reduced to 1000 - Jun 1, 2026: Increased CLOB order rate limits - May 18, 2026: builderCode added to builders endpoints - May 14, 2026: GET /markets/keyset limit reduced to 100
This commit is contained in:
@@ -0,0 +1,156 @@
|
||||
> ## 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.
|
||||
|
||||
# Fetching Markets
|
||||
|
||||
> Three strategies for discovering and querying markets
|
||||
|
||||
<Tip>
|
||||
Both the events and markets endpoints are paginated. See
|
||||
[pagination](#pagination) for details.
|
||||
</Tip>
|
||||
|
||||
There are three main strategies for retrieving market data, each optimized for different use cases:
|
||||
|
||||
1. **By Slug** — Best for fetching specific individual markets or events
|
||||
2. **By Tags** — Ideal for filtering markets by category or sport
|
||||
3. **Via Events Endpoint** — Most efficient for retrieving all active markets
|
||||
|
||||
***
|
||||
|
||||
## Fetch by Slug
|
||||
|
||||
**Use case:** When you need to retrieve a specific market or event that you already know about.
|
||||
|
||||
Individual markets and events are best fetched using their unique slug identifier. The slug can be found directly in the Polymarket frontend URL.
|
||||
|
||||
### How to Extract the Slug
|
||||
|
||||
From any Polymarket URL, the slug is the path segment after `/event/`:
|
||||
|
||||
```
|
||||
https://polymarket.com/event/fed-decision-in-october
|
||||
↑
|
||||
Slug: fed-decision-in-october
|
||||
```
|
||||
|
||||
### Examples
|
||||
|
||||
```bash theme={null}
|
||||
# Fetch an event by slug (query parameter)
|
||||
curl "https://gamma-api.polymarket.com/events?slug=fed-decision-in-october"
|
||||
|
||||
# Or use the path endpoint
|
||||
curl "https://gamma-api.polymarket.com/events/slug/fed-decision-in-october"
|
||||
```
|
||||
|
||||
```bash theme={null}
|
||||
# Fetch a market by slug (query parameter)
|
||||
curl "https://gamma-api.polymarket.com/markets?slug=fed-decision-in-october"
|
||||
|
||||
# Or use the path endpoint
|
||||
curl "https://gamma-api.polymarket.com/markets/slug/fed-decision-in-october"
|
||||
```
|
||||
|
||||
***
|
||||
|
||||
## Fetch by Tags
|
||||
|
||||
**Use case:** When you want to filter markets by category, sport, or topic.
|
||||
|
||||
Tags provide a way to categorize and filter markets. You can discover available tags and then use them to filter your requests.
|
||||
|
||||
### Discover Available Tags
|
||||
|
||||
**General tags:** `GET /tags` (Gamma API)
|
||||
|
||||
**Sports tags and metadata:** `GET /sports` (Gamma API)
|
||||
|
||||
The `/sports` endpoint returns metadata for sports including tag IDs, images, resolution sources, and series information.
|
||||
|
||||
### Filter by Tag
|
||||
|
||||
Once you have tag IDs, use the `tag_id` parameter in both events and markets endpoints:
|
||||
|
||||
```bash theme={null}
|
||||
# Fetch events for a specific tag
|
||||
curl "https://gamma-api.polymarket.com/events?tag_id=100381&limit=10&active=true&closed=false"
|
||||
```
|
||||
|
||||
### Additional Tag Filtering
|
||||
|
||||
You can also:
|
||||
|
||||
* Use `related_tags=true` to include related tag markets
|
||||
* Exclude specific tags with `exclude_tag_id`
|
||||
|
||||
```bash theme={null}
|
||||
# Include related tags
|
||||
curl "https://gamma-api.polymarket.com/events?tag_id=100381&related_tags=true&active=true&closed=false"
|
||||
```
|
||||
|
||||
***
|
||||
|
||||
## Fetch All Active Markets
|
||||
|
||||
**Use case:** When you need to retrieve all available active markets, typically for broader analysis or market discovery.
|
||||
|
||||
The most efficient approach is to use the events endpoint with `active=true&closed=false`, as events contain their associated markets.
|
||||
|
||||
```bash theme={null}
|
||||
curl "https://gamma-api.polymarket.com/events?active=true&closed=false&limit=100"
|
||||
```
|
||||
|
||||
### Key Parameters
|
||||
|
||||
| Parameter | Description |
|
||||
| ----------- | ---------------------------------------------------------------------------------------------------------------- |
|
||||
| `order` | Field to order by (`volume_24hr`, `volume`, `liquidity`, `start_date`, `end_date`, `competitive`, `closed_time`) |
|
||||
| `ascending` | Sort direction (`true` for ascending, `false` for descending). Default: `false` |
|
||||
| `active` | Filter by active status (`true` for live tradable events) |
|
||||
| `closed` | Filter by closed status. Default: `false` |
|
||||
| `limit` | Results per page |
|
||||
| `offset` | Number of results to skip for pagination |
|
||||
|
||||
```bash theme={null}
|
||||
# Get the highest volume active events
|
||||
curl "https://gamma-api.polymarket.com/events?active=true&closed=false&order=volume_24hr&ascending=false&limit=100"
|
||||
```
|
||||
|
||||
***
|
||||
|
||||
## Pagination
|
||||
|
||||
All list endpoints return paginated responses with `limit` and `offset` parameters:
|
||||
|
||||
```bash theme={null}
|
||||
# Page 1: First 50 results
|
||||
curl "https://gamma-api.polymarket.com/events?active=true&closed=false&limit=50&offset=0"
|
||||
|
||||
# Page 2: Next 50 results
|
||||
curl "https://gamma-api.polymarket.com/events?active=true&closed=false&limit=50&offset=50"
|
||||
|
||||
# Page 3: Next 50 results
|
||||
curl "https://gamma-api.polymarket.com/events?active=true&closed=false&limit=50&offset=100"
|
||||
```
|
||||
|
||||
***
|
||||
|
||||
## Best Practices
|
||||
|
||||
1. **For individual markets:** Use the slug method for direct lookups
|
||||
2. **For category browsing:** Use tag filtering to reduce API calls
|
||||
3. **For complete market discovery:** Use the events endpoint with pagination
|
||||
4. **Always include `active=true`** when fetching live markets. The `closed` parameter now defaults to `false`, so closed markets are excluded automatically — pass `closed=true` only if you need historical data
|
||||
5. **Use the events endpoint** and work backwards — events contain their associated markets, reducing the number of API calls needed
|
||||
|
||||
***
|
||||
|
||||
## Next Steps
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card title="API Reference" icon="code" href="/api-reference/introduction">
|
||||
Full endpoint documentation with parameters and response schemas.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
> ## 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.
|
||||
|
||||
# Overview
|
||||
|
||||
> Market making on Polymarket
|
||||
|
||||
A Market Maker (MM) on Polymarket is a trader who provides liquidity to prediction markets by continuously posting bid and ask orders. By laying the spread, market makers enable other users to trade efficiently while earning the spread as compensation for the risk they take.
|
||||
|
||||
Market makers are essential to Polymarket's ecosystem — they provide liquidity across markets, tighten spreads for better user experience, enable price discovery through continuous quoting, and absorb trading flow from retail and institutional users.
|
||||
|
||||
<Note>
|
||||
**Not a Market Maker?** If you're building an application that routes orders
|
||||
for your users, see the [Builder Program](/builders/overview) instead.
|
||||
</Note>
|
||||
|
||||
***
|
||||
|
||||
## Getting Started
|
||||
|
||||
<Steps>
|
||||
<Step title="Complete Setup">
|
||||
Deploy wallets, fund with pUSD, and set token approvals. See the [Getting
|
||||
Started](/market-makers/getting-started) guide.
|
||||
</Step>
|
||||
|
||||
<Step title="Connect to Data Feeds">
|
||||
WebSocket for real-time orderbook updates, Gamma API for market metadata.
|
||||
See [Market Data](/market-data/overview).
|
||||
</Step>
|
||||
|
||||
<Step title="Start Quoting">
|
||||
Post orders via the CLOB REST API. See [Trading ](/market-makers/trading).
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
***
|
||||
|
||||
## Quick Reference
|
||||
|
||||
| Action | Tool | Documentation |
|
||||
| -------------------- | -------------- | ------------------------------------------------- |
|
||||
| Deposit pUSD | Bridge API | [Bridge](/trading/bridge/deposit) |
|
||||
| Approve tokens | Relayer Client | [Getting Started](/market-makers/getting-started) |
|
||||
| Post limit orders | CLOB REST API | [Create Orders](/trading/orders/create) |
|
||||
| Monitor orderbook | WebSocket | [WebSocket](/market-data/websocket/overview) |
|
||||
| Split pUSD to tokens | CTF / Relayer | [Inventory](/market-makers/inventory) |
|
||||
| Merge tokens to pUSD | CTF / Relayer | [Inventory](/market-makers/inventory) |
|
||||
|
||||
***
|
||||
|
||||
## What Is in This Section
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card title="Getting Started" icon="gear" href="/market-makers/getting-started">
|
||||
Deposits, token approvals, wallet deployment, API keys
|
||||
</Card>
|
||||
|
||||
<Card title="Trading" icon="chart-line" href="/market-makers/trading">
|
||||
Quoting best practices, strategies, and risk controls
|
||||
</Card>
|
||||
|
||||
<Card title="Inventory Management" icon="boxes-stacked" href="/market-makers/inventory">
|
||||
Split, merge, and redeem outcome tokens
|
||||
</Card>
|
||||
|
||||
<Card title="Liquidity Rewards" icon="gift" href="/market-makers/liquidity-rewards">
|
||||
Earn rewards for providing liquidity
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
## Risks
|
||||
|
||||
<Warning>
|
||||
Be careful with spread management — if your bid price is higher than your ask
|
||||
price (a "negative spread" or "crossed market"), you will lose money on every
|
||||
fill. Always validate your quote prices before submission.
|
||||
</Warning>
|
||||
|
||||
## Support
|
||||
|
||||
For market maker onboarding and support, contact [support@polymarket.com](mailto:support@polymarket.com).
|
||||
|
||||
@@ -0,0 +1,241 @@
|
||||
> ## 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.
|
||||
|
||||
# Getting Started
|
||||
|
||||
> One-time setup for market making on Polymarket
|
||||
|
||||
Before you can start market making, you need to complete these one-time setup steps — deposit pUSD to Polygon, deploy a wallet, approve tokens for trading, and generate API credentials.
|
||||
|
||||
<Steps>
|
||||
<Step title="Deposit pUSD">
|
||||
Market makers need pUSD on Polygon to fund their trading operations.
|
||||
|
||||
| Method | Best For | Documentation |
|
||||
| ----------------------- | ------------------------------------ | ---------------------------------------------------- |
|
||||
| Bridge API | Automated deposits from other chains | [Bridge Deposit](/trading/bridge/deposit) |
|
||||
| Direct Polygon transfer | Already have pUSD on Polygon | N/A |
|
||||
| Cross-chain bridge | Large deposits from Ethereum | [Supported Assets](/trading/bridge/supported-assets) |
|
||||
|
||||
### Using the Bridge API
|
||||
|
||||
```typescript theme={null}
|
||||
// Get bridge addresses for your Polymarket wallet
|
||||
const deposit = await fetch("https://bridge.polymarket.com/deposit", {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({
|
||||
address: "YOUR_POLYMARKET_WALLET_ADDRESS",
|
||||
}),
|
||||
});
|
||||
|
||||
// Returns bridge addresses for EVM, SVM, and BTC networks
|
||||
const addresses = await deposit.json();
|
||||
// Send USDC to the appropriate address for your source chain
|
||||
```
|
||||
</Step>
|
||||
|
||||
<Step title="Deploy a Wallet">
|
||||
### EOA
|
||||
|
||||
Standard Ethereum wallet. You pay for all onchain transactions (approvals, splits, merges, trade execution).
|
||||
|
||||
### Deposit Wallet
|
||||
|
||||
Deposit wallets are the recommended wallet path for new API users. They are
|
||||
deployed through Polymarket's relayer and use `POLY_1271` order signatures.
|
||||
|
||||
See the [Deposit Wallet Guide](/trading/deposit-wallets) for the
|
||||
wallet creation, approval, balance sync, and order-signing flow.
|
||||
|
||||
### Existing Safe Wallets
|
||||
|
||||
Existing Gnosis Safe users can continue using their current wallet. Safe wallets
|
||||
are deployed via Polymarket's relayer and support:
|
||||
|
||||
* **Gasless transactions** — Polymarket pays gas fees for onchain operations
|
||||
* **Contract wallet** — Enables advanced features like batched transactions
|
||||
|
||||
For existing Safe integrations, deploy a Safe wallet using the Relayer Client:
|
||||
|
||||
<CodeGroup>
|
||||
```typescript TypeScript theme={null}
|
||||
import { RelayClient, RelayerTxType } from "@polymarket/builder-relayer-client";
|
||||
|
||||
const client = new RelayClient({
|
||||
host: "https://relayer-v2.polymarket.com/",
|
||||
chain: 137,
|
||||
signer,
|
||||
relayerApiKey: process.env.RELAYER_API_KEY!,
|
||||
relayerApiKeyAddress: process.env.RELAYER_API_KEY_ADDRESS!,
|
||||
txType: RelayerTxType.SAFE,
|
||||
});
|
||||
|
||||
// Deploy the Safe wallet
|
||||
const response = await client.deploy();
|
||||
const result = await response.wait();
|
||||
console.log("Safe Address:", result?.proxyAddress);
|
||||
```
|
||||
|
||||
```python Python theme={null}
|
||||
from py_builder_relayer_client.client import RelayClient
|
||||
|
||||
# client initialized with Relayer API Key credentials (see Gasless Transactions)
|
||||
|
||||
# Deploy the Safe wallet
|
||||
response = client.deploy()
|
||||
result = response.wait()
|
||||
print("Safe Address:", result.get("proxyAddress"))
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
<Info>
|
||||
See [Gasless Transactions](/trading/gasless) for full Relayer Client setup
|
||||
including local and remote signing configurations.
|
||||
</Info>
|
||||
</Step>
|
||||
|
||||
<Step title="Approve Tokens">
|
||||
Before trading, you must approve the exchange contracts to spend your tokens.
|
||||
|
||||
### Required Approvals
|
||||
|
||||
| Token | Spender | Purpose |
|
||||
| -------------------- | --------------------- | ------------------------------ |
|
||||
| pUSD | CTF Contract | Split pUSD into outcome tokens |
|
||||
| CTF (outcome tokens) | CTF Exchange | Trade outcome tokens |
|
||||
| CTF (outcome tokens) | Neg Risk CTF Exchange | Trade neg-risk market tokens |
|
||||
|
||||
### Contract Addresses
|
||||
|
||||
```typescript theme={null}
|
||||
const ADDRESSES = {
|
||||
pUSD: "0xC011a7E12a19f7B1f670d46F03B03f3342E82DFB",
|
||||
CTF: "0x4D97DCd97eC945f40cF65F87097ACe5EA0476045",
|
||||
CTF_EXCHANGE: "0xE111180000d2663C0091e4f400237545B87B996B",
|
||||
NEG_RISK_CTF_EXCHANGE: "0xe2222d279d744050d28e00520010520000310F59",
|
||||
NEG_RISK_ADAPTER: "0xd91E80cF2E7be2e162c6513ceD06f1dD0dA35296",
|
||||
};
|
||||
```
|
||||
|
||||
### Approve via Relayer Client
|
||||
|
||||
<CodeGroup>
|
||||
```typescript TypeScript theme={null}
|
||||
import { ethers } from "ethers";
|
||||
import { Interface } from "ethers/lib/utils";
|
||||
|
||||
const erc20Interface = new Interface([
|
||||
"function approve(address spender, uint256 amount) returns (bool)",
|
||||
]);
|
||||
|
||||
// Approve pUSD for CTF contract
|
||||
const approveTx = {
|
||||
to: ADDRESSES.pUSD,
|
||||
data: erc20Interface.encodeFunctionData("approve", [
|
||||
ADDRESSES.CTF,
|
||||
ethers.constants.MaxUint256,
|
||||
]),
|
||||
value: "0",
|
||||
};
|
||||
|
||||
const response = await client.execute([approveTx], "Approve pUSD for CTF");
|
||||
await response.wait();
|
||||
```
|
||||
|
||||
```python Python theme={null}
|
||||
from web3 import Web3
|
||||
|
||||
pUSD = "0xC011a7E12a19f7B1f670d46F03B03f3342E82DFB"
|
||||
CTF = "0x4D97DCd97eC945f40cF65F87097ACe5EA0476045"
|
||||
MAX_UINT256 = 2**256 - 1
|
||||
|
||||
approve_tx = {
|
||||
"to": pUSD,
|
||||
"data": Web3().eth.contract(
|
||||
address=pUSD,
|
||||
abi=[{
|
||||
"name": "approve",
|
||||
"type": "function",
|
||||
"inputs": [
|
||||
{"name": "spender", "type": "address"},
|
||||
{"name": "amount", "type": "uint256"}
|
||||
],
|
||||
"outputs": [{"type": "bool"}]
|
||||
}]
|
||||
).encode_abi(abi_element_identifier="approve", args=[CTF, MAX_UINT256]),
|
||||
"value": "0"
|
||||
}
|
||||
|
||||
response = client.execute([approve_tx], "Approve pUSD for CTF")
|
||||
response.wait()
|
||||
```
|
||||
</CodeGroup>
|
||||
</Step>
|
||||
|
||||
<Step title="Generate API Credentials">
|
||||
To place orders and access authenticated endpoints, you need L2 API credentials derived from your wallet.
|
||||
|
||||
<CodeGroup>
|
||||
```typescript TypeScript theme={null}
|
||||
import { ClobClient } from "@polymarket/clob-client-v2";
|
||||
|
||||
const client = new ClobClient({
|
||||
host: "https://clob.polymarket.com",
|
||||
chain: 137,
|
||||
signer,
|
||||
});
|
||||
|
||||
// Derive API credentials from your wallet
|
||||
const credentials = await client.createOrDeriveApiKey();
|
||||
console.log("API Key:", credentials.key);
|
||||
console.log("Secret:", credentials.secret);
|
||||
console.log("Passphrase:", credentials.passphrase);
|
||||
```
|
||||
|
||||
```python Python theme={null}
|
||||
from py_clob_client_v2 import ClobClient
|
||||
import os
|
||||
|
||||
private_key = os.getenv("PRIVATE_KEY")
|
||||
|
||||
temp_client = ClobClient("https://clob.polymarket.com", key=private_key, chain_id=137)
|
||||
credentials = temp_client.create_or_derive_api_key()
|
||||
```
|
||||
|
||||
```rust Rust theme={null}
|
||||
use std::str::FromStr;
|
||||
use polymarket_client_sdk_v2::POLYGON;
|
||||
use polymarket_client_sdk_v2::auth::{LocalSigner, Signer};
|
||||
use polymarket_client_sdk_v2::clob::{Client, Config};
|
||||
|
||||
let private_key = std::env::var("POLYMARKET_PRIVATE_KEY")?;
|
||||
let signer = LocalSigner::from_str(&private_key)?
|
||||
.with_chain_id(Some(POLYGON));
|
||||
|
||||
// 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?;
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
See [Authentication](/trading/overview#authentication) for full details on signature types and REST API headers.
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
***
|
||||
|
||||
## Next Steps
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card title="Trading" icon="chart-line" href="/market-makers/trading">
|
||||
Post limit orders and manage quotes
|
||||
</Card>
|
||||
|
||||
<Card title="Market Data" icon="database" href="/market-data/overview">
|
||||
Connect to real-time market data
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
Reference in New Issue
Block a user