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:
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,217 @@
|
||||
> ## 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.
|
||||
|
||||
# Geographic Restrictions
|
||||
|
||||
> Check geographic restrictions before placing orders on the Polymarket API
|
||||
|
||||
Polymarket restricts order placement from certain geographic locations due to regulatory requirements and compliance with international sanctions. Before placing orders, builders should verify the location.
|
||||
|
||||
<Warning>
|
||||
Orders submitted from blocked regions will be rejected. Implement geoblock
|
||||
checks in your application to provide users with appropriate feedback before
|
||||
they attempt to trade.
|
||||
</Warning>
|
||||
|
||||
***
|
||||
|
||||
## Geoblock Endpoint
|
||||
|
||||
Check the geographic eligibility of the requesting IP address:
|
||||
|
||||
```bash theme={null}
|
||||
GET https://polymarket.com/api/geoblock
|
||||
```
|
||||
|
||||
<Note>This endpoint is on `polymarket.com`, not the API servers.</Note>
|
||||
|
||||
### Response
|
||||
|
||||
```json theme={null}
|
||||
{
|
||||
"blocked": true,
|
||||
"ip": "203.0.113.42",
|
||||
"country": "US",
|
||||
"region": "NY"
|
||||
}
|
||||
```
|
||||
|
||||
| Field | Type | Description |
|
||||
| --------- | ------- | ----------------------------------------------- |
|
||||
| `blocked` | boolean | Whether the user is blocked from placing orders |
|
||||
| `ip` | string | Detected IP address |
|
||||
| `country` | string | ISO 3166-1 alpha-2 country code |
|
||||
| `region` | string | Region/state code |
|
||||
|
||||
***
|
||||
|
||||
## Blocked Countries
|
||||
|
||||
The following countries are restricted from placing orders on Polymarket. Countries marked as **close-only** can close existing positions but cannot open new ones. Countries marked as **frontend UI restricted** are blocked only on the Polymarket frontend; the API itself is not restricted:
|
||||
|
||||
| Country Code | Country Name | Status |
|
||||
| ------------ | ------------------------------------ | ---------------------- |
|
||||
| AU | Australia | Blocked |
|
||||
| BE | Belgium | Blocked |
|
||||
| BY | Belarus | Blocked |
|
||||
| BI | Burundi | Blocked |
|
||||
| CF | Central African Republic | Blocked |
|
||||
| CD | Congo (Kinshasa) | Blocked |
|
||||
| CU | Cuba | Blocked |
|
||||
| DE | Germany | Blocked |
|
||||
| ET | Ethiopia | Blocked |
|
||||
| FR | France | Blocked |
|
||||
| GB | United Kingdom | Blocked |
|
||||
| IR | Iran | Blocked |
|
||||
| IQ | Iraq | Blocked |
|
||||
| IT | Italy | Blocked |
|
||||
| JP | Japan | Frontend UI restricted |
|
||||
| KP | North Korea | Blocked |
|
||||
| LB | Lebanon | Blocked |
|
||||
| LY | Libya | Blocked |
|
||||
| MM | Myanmar | Blocked |
|
||||
| NI | Nicaragua | Blocked |
|
||||
| NL | Netherlands | Blocked |
|
||||
| PL | Poland | Close-only |
|
||||
| RU | Russia | Blocked |
|
||||
| SG | Singapore | Close-only |
|
||||
| SO | Somalia | Blocked |
|
||||
| SS | South Sudan | Blocked |
|
||||
| SD | Sudan | Blocked |
|
||||
| SY | Syria | Blocked |
|
||||
| TH | Thailand | Close-only |
|
||||
| TW | Taiwan | Close-only |
|
||||
| UM | United States Minor Outlying Islands | Blocked |
|
||||
| US | United States | Blocked |
|
||||
| VE | Venezuela | Blocked |
|
||||
| YE | Yemen | Blocked |
|
||||
| ZW | Zimbabwe | Blocked |
|
||||
|
||||
***
|
||||
|
||||
## Blocked Regions
|
||||
|
||||
In addition to fully blocked countries, the following specific regions within otherwise accessible countries are also restricted:
|
||||
|
||||
| Country | Region | Region Code |
|
||||
| ------------ | ------- | ----------- |
|
||||
| Canada (CA) | Ontario | ON |
|
||||
| Ukraine (UA) | Crimea | 43 |
|
||||
| Ukraine (UA) | Donetsk | 14 |
|
||||
| Ukraine (UA) | Luhansk | 09 |
|
||||
|
||||
***
|
||||
|
||||
## Blocking Logic
|
||||
|
||||
The geoblocking system includes:
|
||||
|
||||
1. **OFAC-Sanctioned Countries**: Countries sanctioned by the U.S. Office of Foreign Assets Control (OFAC)
|
||||
2. **Additional Regulatory Restrictions**: Countries added for specific regulatory compliance reasons
|
||||
|
||||
***
|
||||
|
||||
## Server Infrastructure
|
||||
|
||||
* **Primary Servers**: eu-west-2
|
||||
* **Closest Non-Georestricted Region**: eu-west-1
|
||||
|
||||
<Tip>
|
||||
**Direct co-location available.** Users who complete the [KYC/KYB
|
||||
form](https://docs.google.com/forms/d/e/1FAIpQLSfY-3Dl3yxq8HKFjFad8YzKZmm0k3Gdg29HD6gL-K-AmI6KXw/viewform) can get access to co-locate
|
||||
directly in `eu-west-2` for the lowest possible latency to Polymarket's
|
||||
primary servers.
|
||||
</Tip>
|
||||
|
||||
***
|
||||
|
||||
## Usage Examples
|
||||
|
||||
<Tabs>
|
||||
<Tab title="TypeScript">
|
||||
```typescript theme={null}
|
||||
interface GeoblockResponse {
|
||||
blocked: boolean;
|
||||
ip: string;
|
||||
country: string;
|
||||
region: string;
|
||||
}
|
||||
|
||||
async function checkGeoblock(): Promise<GeoblockResponse> {
|
||||
const response = await fetch("https://polymarket.com/api/geoblock");
|
||||
return response.json();
|
||||
}
|
||||
|
||||
// Usage
|
||||
const geo = await checkGeoblock();
|
||||
|
||||
if (geo.blocked) {
|
||||
console.log(`Trading not available in ${geo.country}`);
|
||||
} else {
|
||||
console.log("Trading available");
|
||||
}
|
||||
```
|
||||
</Tab>
|
||||
|
||||
<Tab title="Python">
|
||||
```python theme={null}
|
||||
import requests
|
||||
|
||||
def check_geoblock() -> dict:
|
||||
response = requests.get("https://polymarket.com/api/geoblock")
|
||||
return response.json()
|
||||
|
||||
# Usage
|
||||
geo = check_geoblock()
|
||||
|
||||
if geo["blocked"]:
|
||||
print(f"Trading not available in {geo['country']}")
|
||||
else:
|
||||
print("Trading available")
|
||||
```
|
||||
</Tab>
|
||||
|
||||
<Tab title="Rust">
|
||||
```rust theme={null}
|
||||
use polymarket_client_sdk_v2::clob::{Client, Config};
|
||||
|
||||
let client = Client::new("https://clob.polymarket.com", Config::default())?;
|
||||
let geo = client.check_geoblock().await?;
|
||||
|
||||
if geo.blocked {
|
||||
println!("Trading not available in {}", geo.country);
|
||||
} else {
|
||||
println!("Trading available");
|
||||
}
|
||||
```
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
***
|
||||
|
||||
## Why These Restrictions
|
||||
|
||||
Geographic restrictions are implemented to ensure compliance with:
|
||||
|
||||
* International sanctions and embargoes
|
||||
* Local financial regulations
|
||||
* Gambling and prediction market laws
|
||||
* Anti-money laundering (AML) requirements
|
||||
* Know Your Customer (KYC) regulations
|
||||
|
||||
If you believe you are incorrectly restricted or have questions about geographic availability, please contact [Polymarket Support](https://polymarket.com/support).
|
||||
|
||||
***
|
||||
|
||||
## Next Steps
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card title="Authentication" icon="key" href="/api-reference/authentication">
|
||||
Learn how to authenticate trading requests.
|
||||
</Card>
|
||||
|
||||
<Card title="Place Orders" icon="plus" href="/trading/quickstart">
|
||||
Start placing orders (from eligible regions).
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,104 @@
|
||||
> ## 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.
|
||||
|
||||
# Deposit
|
||||
|
||||
> Bridge assets from any supported chain to fund your Polymarket account
|
||||
|
||||
Polymarket uses **pUSD** (Polymarket USD) on Polygon as collateral for all trading. The Bridge API lets you deposit assets from Ethereum, Solana, Bitcoin, and other chains—they're automatically converted to pUSD on Polygon.
|
||||
|
||||
## How It Works
|
||||
|
||||
1. Request bridge addresses for your Polymarket wallet
|
||||
2. Send assets to the appropriate address for your source chain
|
||||
3. Assets are bridged and swapped to pUSD automatically
|
||||
4. pUSD is credited to your wallet for trading
|
||||
|
||||
## Create Bridge Addresses
|
||||
|
||||
Generate unique bridge addresses linked to your Polymarket wallet. See the [Bridge API Reference](/api-reference/introduction) for full request and response schemas.
|
||||
|
||||
```bash theme={null}
|
||||
curl -X POST https://bridge.polymarket.com/deposit \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"address": "0x56687bf447db6ffa42ffe2204a05edaa20f55839"}'
|
||||
```
|
||||
|
||||
### Address Types
|
||||
|
||||
| Address | Use For |
|
||||
| ------- | -------------------------------------------------------- |
|
||||
| `evm` | Ethereum, Arbitrum, Base, Optimism, and other EVM chains |
|
||||
| `svm` | Solana |
|
||||
| `btc` | Bitcoin |
|
||||
| `tvm` | Tron |
|
||||
|
||||
<Warning>
|
||||
Each address is unique to your wallet. Only send assets from supported chains
|
||||
to the correct address type.
|
||||
</Warning>
|
||||
|
||||
## Deposit Flow
|
||||
|
||||
<Steps>
|
||||
<Step title="Get Your Bridge Address">
|
||||
Call `POST /deposit` with your Polymarket wallet address to get bridge
|
||||
addresses.
|
||||
</Step>
|
||||
|
||||
<Step title="Check Supported Assets">
|
||||
Verify your token is supported and meets the minimum deposit amount via
|
||||
`/supported-assets`.
|
||||
</Step>
|
||||
|
||||
<Step title="Send Assets">
|
||||
Transfer tokens to the appropriate bridge address from your source chain.
|
||||
</Step>
|
||||
|
||||
<Step title="Track Status">
|
||||
Monitor your deposit progress using `/status/{address}`.
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## USDC vs pUSD
|
||||
|
||||
You can deposit either USDC (native) or USDC.e (bridged) as the source asset to your Polymarket wallet. Either way, the incoming USDC or USDC.e is wrapped into pUSD via the Collateral Onramp, and pUSD is what you hold and trade with on Polymarket.
|
||||
|
||||
## Large Deposits
|
||||
|
||||
For deposits over \$50,000 originating from a chain other than Polygon, we recommend using a third-party bridge to minimize slippage:
|
||||
|
||||
* [DeBridge](https://app.debridge.finance/)
|
||||
* [Across](https://app.across.to/bridge)
|
||||
* [Portal](https://portalbridge.com/)
|
||||
|
||||
Bridge directly to your Polymarket USDC (Polygon) bridge address. Polymarket is not affiliated with or responsible for any third-party bridge.
|
||||
|
||||
## Minimum Deposits
|
||||
|
||||
Each asset has a minimum deposit amount. Deposits below the minimum will not be processed. Check `/supported-assets` for current minimums.
|
||||
|
||||
## Deposit Recovery
|
||||
|
||||
If you deposited the wrong token, use this tool to recover your funds:
|
||||
|
||||
[recovery.polymarket.com](https://recovery.polymarket.com/)
|
||||
|
||||
<Warning>
|
||||
Sending unsupported tokens may cause **irrecoverable loss**. Always verify
|
||||
your token is listed in [Supported Assets](/trading/bridge/supported-assets)
|
||||
before depositing.
|
||||
</Warning>
|
||||
|
||||
## Next Steps
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card title="Supported Assets" icon="coins" href="/trading/bridge/supported-assets">
|
||||
See all supported chains and tokens with minimum amounts.
|
||||
</Card>
|
||||
|
||||
<Card title="Check Status" icon="clock" href="/trading/bridge/status">
|
||||
Track your deposit progress through completion.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,62 @@
|
||||
> ## 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.
|
||||
|
||||
# Supported Assets
|
||||
|
||||
> Chains and tokens supported for deposits to Polymarket
|
||||
|
||||
The Bridge API supports deposits from multiple chains and tokens. All deposits are automatically converted to **pUSD on Polygon**, which is used as collateral for trading on Polymarket.
|
||||
|
||||
## Get Supported Assets
|
||||
|
||||
Retrieve the full list of supported chains and tokens with their minimum deposit amounts.
|
||||
|
||||
```bash theme={null}
|
||||
curl https://bridge.polymarket.com/supported-assets
|
||||
```
|
||||
|
||||
## Supported Chains
|
||||
|
||||
The bridge supports deposits from these blockchain networks:
|
||||
|
||||
| Chain | Address Type | Min Deposit | Example Tokens |
|
||||
| --------------- | ------------ | ----------- | ------------------------------------------- |
|
||||
| Ethereum | EVM | \$7 | ETH, USDC, USDT, WBTC, DAI, LINK, UNI, AAVE |
|
||||
| Polygon | EVM | \$2 | POL, USDC, USDT, DAI, WETH, SAND |
|
||||
| Arbitrum | EVM | \$2 | ETH, ARB, USDC, USDT, DAI, WBTC, USDe |
|
||||
| Base | EVM | \$2 | ETH, USDC, USDT, DAI, cbBTC, AERO, USDS |
|
||||
| Optimism | EVM | \$2 | ETH, OP, USDC, USDT, DAI, USDe |
|
||||
| BNB Smart Chain | EVM | \$2 | BNB, USDC, USDT, DAI, ETH, BTCB, BUSD |
|
||||
| Solana | SVM | \$2 | SOL, USDC, USDT, USDe, TRUMP |
|
||||
| Bitcoin | BTC | \$9 | BTC |
|
||||
| Tron | TVM | \$9 | USDT |
|
||||
| HyperEVM | EVM | \$2 | HYPE, USDC, USDe, stHYPE, UBTC, UETH |
|
||||
| Abstract | EVM | \$2 | ETH, USDC, USDT |
|
||||
| Monad | EVM | \$2 | MON, USDC, USDT |
|
||||
| Ethereal | EVM | \$2 | USDe, WUSDe |
|
||||
| Katana | EVM | \$2 | AUSD |
|
||||
| Lighter | EVM | \$2 | USDC |
|
||||
|
||||
<Note>
|
||||
Supported assets change over time. Always call `/supported-assets` for the
|
||||
current list before initiating a deposit.
|
||||
</Note>
|
||||
|
||||
## Minimum Amounts
|
||||
|
||||
Each asset has a `minCheckoutUsd` value—the minimum deposit amount in USD equivalent. Deposits below this threshold may fail to process.
|
||||
|
||||
Most L2 chains (Polygon, Arbitrum, Base, Optimism) have low minimums of $2, while Ethereum deposits require $7 minimum. Bitcoin and Tron have \$9 minimums due to higher bridging costs.
|
||||
|
||||
## Next Steps
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card title="Create Deposit" icon="arrow-right-to-bracket" href="/trading/bridge/deposit">
|
||||
Generate bridge addresses for your wallet.
|
||||
</Card>
|
||||
|
||||
<Card title="Check Status" icon="clock" href="/trading/bridge/status">
|
||||
Track your deposit progress.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,699 @@
|
||||
> ## 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.
|
||||
|
||||
# Create Order
|
||||
|
||||
> Build, sign, and submit orders
|
||||
|
||||
All orders on Polymarket are expressed as **limit orders**. Market orders are supported by submitting a limit order with a marketable price — your order executes immediately at the best available price on the book.
|
||||
|
||||
<Info>
|
||||
The SDK handles EIP-712 signing and submission for you. If you prefer the REST
|
||||
API directly, see [Authentication](/api-reference/authentication) for
|
||||
constructing the required headers and the [API
|
||||
Reference](/api-reference/introduction) for full endpoint documentation
|
||||
including the raw order object fields and request/response schemas.
|
||||
</Info>
|
||||
|
||||
***
|
||||
|
||||
## Order Types
|
||||
|
||||
| Type | Behavior | Use Case |
|
||||
| ------- | -------------------------------------------------------------------- | ------------------------------- |
|
||||
| **GTC** | Good-Til-Cancelled — rests on the book until filled or cancelled | Default for limit orders |
|
||||
| **GTD** | Good-Til-Date — active until a specified expiration time | Auto-expire before known events |
|
||||
| **FOK** | Fill-Or-Kill — must fill immediately and entirely, or cancel | All-or-nothing market orders |
|
||||
| **FAK** | Fill-And-Kill — fills what's available immediately, cancels the rest | Partial-fill market orders |
|
||||
|
||||
* **GTC** and **GTD** are limit order types — they rest on the book at your specified price.
|
||||
* **FOK** and **FAK** are market order types — they execute against resting liquidity immediately.
|
||||
* **BUY**: specify the dollar amount you want to spend
|
||||
* **SELL**: specify the number of shares you want to sell
|
||||
|
||||
***
|
||||
|
||||
## Limit Orders
|
||||
|
||||
The simplest way to place a limit order — create, sign, and submit in one call:
|
||||
|
||||
<CodeGroup>
|
||||
```typescript TypeScript theme={null}
|
||||
import { ClobClient, Side, OrderType } from "@polymarket/clob-client-v2";
|
||||
|
||||
const response = await client.createAndPostOrder(
|
||||
{
|
||||
tokenID: "TOKEN_ID",
|
||||
price: 0.5,
|
||||
size: 10,
|
||||
side: Side.BUY,
|
||||
},
|
||||
{
|
||||
tickSize: "0.01",
|
||||
negRisk: false,
|
||||
},
|
||||
OrderType.GTC,
|
||||
);
|
||||
|
||||
console.log("Order ID:", response.orderID);
|
||||
console.log("Status:", response.status);
|
||||
```
|
||||
|
||||
```python Python theme={null}
|
||||
from py_clob_client_v2 import OrderArgs, OrderType, PartialCreateOrderOptions
|
||||
from py_clob_client_v2.order_builder.constants import BUY
|
||||
|
||||
response = client.create_and_post_order(
|
||||
OrderArgs(
|
||||
token_id="TOKEN_ID",
|
||||
price=0.50,
|
||||
size=10,
|
||||
side=BUY,
|
||||
),
|
||||
options=PartialCreateOrderOptions(tick_size="0.01", neg_risk=False),
|
||||
order_type=OrderType.GTC
|
||||
)
|
||||
|
||||
print("Order ID:", response["orderID"])
|
||||
print("Status:", response["status"])
|
||||
```
|
||||
|
||||
```rust Rust theme={null}
|
||||
use polymarket_client_sdk_v2::clob::types::Side;
|
||||
use polymarket_client_sdk_v2::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);
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
### Two-Step Sign Then Submit
|
||||
|
||||
For more control, you can separate signing from submission. This is useful for batch orders or custom submission logic:
|
||||
|
||||
<CodeGroup>
|
||||
```typescript TypeScript theme={null}
|
||||
// Step 1: Create and sign locally
|
||||
const signedOrder = await client.createOrder(
|
||||
{
|
||||
tokenID: "TOKEN_ID",
|
||||
price: 0.5,
|
||||
size: 10,
|
||||
side: Side.BUY,
|
||||
},
|
||||
{ tickSize: "0.01", negRisk: false },
|
||||
);
|
||||
|
||||
// Step 2: Submit to the CLOB
|
||||
const response = await client.postOrder(signedOrder, OrderType.GTC);
|
||||
```
|
||||
|
||||
```python Python theme={null}
|
||||
# Step 1: Create and sign locally
|
||||
signed_order = client.create_order(
|
||||
OrderArgs(
|
||||
token_id="TOKEN_ID",
|
||||
price=0.50,
|
||||
size=10,
|
||||
side=BUY,
|
||||
),
|
||||
options=PartialCreateOrderOptions(tick_size="0.01", neg_risk=False)
|
||||
)
|
||||
|
||||
# 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?;
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
***
|
||||
|
||||
## GTD Orders
|
||||
|
||||
GTD orders auto-expire at a specified time. Useful for quoting around known events.
|
||||
|
||||
<CodeGroup>
|
||||
```typescript TypeScript theme={null}
|
||||
// Expire in 1 hour (+ 60s security threshold buffer)
|
||||
const expiration = Math.floor(Date.now() / 1000) + 60 + 3600;
|
||||
|
||||
const response = await client.createAndPostOrder(
|
||||
{
|
||||
tokenID: "TOKEN_ID",
|
||||
price: 0.5,
|
||||
size: 10,
|
||||
side: Side.BUY,
|
||||
expiration,
|
||||
},
|
||||
{ tickSize: "0.01", negRisk: false },
|
||||
OrderType.GTD,
|
||||
);
|
||||
```
|
||||
|
||||
```python Python theme={null}
|
||||
import time
|
||||
|
||||
# Expire in 1 hour (+ 60s security threshold buffer)
|
||||
expiration = int(time.time()) + 60 + 3600
|
||||
|
||||
response = client.create_and_post_order(
|
||||
OrderArgs(
|
||||
token_id="TOKEN_ID",
|
||||
price=0.50,
|
||||
size=10,
|
||||
side=BUY,
|
||||
expiration=expiration,
|
||||
),
|
||||
options=PartialCreateOrderOptions(tick_size="0.01", neg_risk=False),
|
||||
order_type=OrderType.GTD
|
||||
)
|
||||
```
|
||||
|
||||
```rust Rust theme={null}
|
||||
use chrono::{TimeDelta, Utc};
|
||||
use polymarket_client_sdk_v2::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?;
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
<Note>
|
||||
There is a security threshold of one minute on GTD expiration. To set an
|
||||
effective lifetime of N seconds, use `now + 60 + N`. For example, for a
|
||||
30-second effective lifetime, set the expiration to `now + 60 + 30`.
|
||||
</Note>
|
||||
|
||||
***
|
||||
|
||||
## Market Orders
|
||||
|
||||
Market orders execute immediately against resting liquidity using FOK or FAK types:
|
||||
|
||||
<CodeGroup>
|
||||
```typescript TypeScript theme={null}
|
||||
import { Side, OrderType } from "@polymarket/clob-client-v2";
|
||||
|
||||
// FOK BUY: spend exactly $100 or cancel entirely
|
||||
const buyOrder = await client.createMarketOrder(
|
||||
{
|
||||
tokenID: "TOKEN_ID",
|
||||
side: Side.BUY,
|
||||
amount: 100, // dollar amount
|
||||
price: 0.5, // worst-price limit (slippage protection)
|
||||
},
|
||||
{ tickSize: "0.01", negRisk: false },
|
||||
);
|
||||
await client.postOrder(buyOrder, OrderType.FOK);
|
||||
|
||||
// FOK SELL: sell exactly 200 shares or cancel entirely
|
||||
const sellOrder = await client.createMarketOrder(
|
||||
{
|
||||
tokenID: "TOKEN_ID",
|
||||
side: Side.SELL,
|
||||
amount: 200, // number of shares
|
||||
price: 0.45, // worst-price limit (slippage protection)
|
||||
},
|
||||
{ tickSize: "0.01", negRisk: false },
|
||||
);
|
||||
await client.postOrder(sellOrder, OrderType.FOK);
|
||||
```
|
||||
|
||||
```python Python theme={null}
|
||||
from py_clob_client_v2.order_builder.constants import BUY, SELL
|
||||
from py_clob_client_v2 import MarketOrderArgs, OrderType, PartialCreateOrderOptions
|
||||
|
||||
# FOK BUY: spend exactly $100 or cancel entirely
|
||||
buy_order = client.create_market_order(
|
||||
order_args=MarketOrderArgs(
|
||||
token_id="TOKEN_ID",
|
||||
side=BUY,
|
||||
amount=100, # dollar amount
|
||||
price=0.50, # worst-price limit (slippage protection)
|
||||
),
|
||||
options=PartialCreateOrderOptions(tick_size="0.01", neg_risk=False),
|
||||
)
|
||||
client.post_order(buy_order, OrderType.FOK)
|
||||
|
||||
# FOK SELL: sell exactly 200 shares or cancel entirely
|
||||
sell_order = client.create_market_order(
|
||||
order_args=MarketOrderArgs(
|
||||
token_id="TOKEN_ID",
|
||||
side=SELL,
|
||||
amount=200, # number of shares
|
||||
price=0.45, # worst-price limit (slippage protection)
|
||||
),
|
||||
options=PartialCreateOrderOptions(tick_size="0.01", neg_risk=False),
|
||||
)
|
||||
client.post_order(sell_order, OrderType.FOK)
|
||||
```
|
||||
|
||||
```rust Rust theme={null}
|
||||
use polymarket_client_sdk_v2::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?;
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
* **FOK** — fill entirely or cancel the whole order
|
||||
* **FAK** — fill what's available, cancel the rest
|
||||
|
||||
The `price` field on market orders acts as a **worst-price limit** (slippage protection), not a target execution price.
|
||||
|
||||
### One-Step Market Order
|
||||
|
||||
For convenience, `createAndPostMarketOrder` handles creation, signing, and submission in one call:
|
||||
|
||||
<CodeGroup>
|
||||
```typescript TypeScript theme={null}
|
||||
const response = await client.createAndPostMarketOrder(
|
||||
{
|
||||
tokenID: "TOKEN_ID",
|
||||
side: Side.BUY,
|
||||
amount: 100,
|
||||
price: 0.5,
|
||||
},
|
||||
{ tickSize: "0.01", negRisk: false },
|
||||
OrderType.FOK,
|
||||
);
|
||||
```
|
||||
|
||||
```python Python theme={null}
|
||||
from py_clob_client_v2 import MarketOrderArgs, OrderType, PartialCreateOrderOptions
|
||||
from py_clob_client_v2.order_builder.constants import BUY
|
||||
|
||||
response = client.create_and_post_market_order(
|
||||
order_args=MarketOrderArgs(
|
||||
token_id="TOKEN_ID",
|
||||
side=BUY,
|
||||
amount=100,
|
||||
price=0.50,
|
||||
),
|
||||
options=PartialCreateOrderOptions(tick_size="0.01", neg_risk=False),
|
||||
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?;
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
***
|
||||
|
||||
## Post-Only Orders
|
||||
|
||||
Post-only orders guarantee you're always the maker. If the order would match immediately (cross the spread), it's rejected instead of executed.
|
||||
|
||||
<CodeGroup>
|
||||
```typescript TypeScript theme={null}
|
||||
const response = await client.postOrder(signedOrder, OrderType.GTC, true);
|
||||
```
|
||||
|
||||
```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?;
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
* Only works with **GTC** and **GTD** order types
|
||||
* Rejected if combined with FOK or FAK
|
||||
|
||||
***
|
||||
|
||||
## Batch Orders
|
||||
|
||||
Place up to **15 orders** in a single request:
|
||||
|
||||
<CodeGroup>
|
||||
```typescript TypeScript theme={null}
|
||||
import { OrderType, Side, PostOrdersArgs } from "@polymarket/clob-client-v2";
|
||||
|
||||
const orders: PostOrdersArgs[] = [
|
||||
{
|
||||
order: await client.createOrder(
|
||||
{
|
||||
tokenID: "TOKEN_ID",
|
||||
price: 0.48,
|
||||
side: Side.BUY,
|
||||
size: 500,
|
||||
},
|
||||
{ tickSize: "0.01", negRisk: false },
|
||||
),
|
||||
orderType: OrderType.GTC,
|
||||
},
|
||||
{
|
||||
order: await client.createOrder(
|
||||
{
|
||||
tokenID: "TOKEN_ID",
|
||||
price: 0.52,
|
||||
side: Side.SELL,
|
||||
size: 500,
|
||||
},
|
||||
{ tickSize: "0.01", negRisk: false },
|
||||
),
|
||||
orderType: OrderType.GTC,
|
||||
},
|
||||
];
|
||||
|
||||
const response = await client.postOrders(orders);
|
||||
```
|
||||
|
||||
```python Python theme={null}
|
||||
from py_clob_client_v2 import OrderArgs, OrderType, PostOrdersV2Args, PartialCreateOrderOptions
|
||||
from py_clob_client_v2.order_builder.constants import BUY, SELL
|
||||
|
||||
response = client.post_orders([
|
||||
PostOrdersV2Args(
|
||||
order=client.create_order(OrderArgs(
|
||||
price=0.48,
|
||||
size=500,
|
||||
side=BUY,
|
||||
token_id="TOKEN_ID",
|
||||
), options=PartialCreateOrderOptions(tick_size="0.01", neg_risk=False)),
|
||||
orderType=OrderType.GTC,
|
||||
),
|
||||
PostOrdersV2Args(
|
||||
order=client.create_order(OrderArgs(
|
||||
price=0.52,
|
||||
size=500,
|
||||
side=SELL,
|
||||
token_id="TOKEN_ID",
|
||||
), options=PartialCreateOrderOptions(tick_size="0.01", neg_risk=False)),
|
||||
orderType=OrderType.GTC,
|
||||
),
|
||||
])
|
||||
```
|
||||
|
||||
```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?;
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
***
|
||||
|
||||
## Order Options
|
||||
|
||||
Every order requires two market-specific options: `tickSize` and `negRisk`. For
|
||||
details on signature types (`0` = EOA, `1` = POLY\_PROXY, `2` = GNOSIS\_SAFE,
|
||||
`3` = POLY\_1271 deposit wallet), see
|
||||
[Authentication](/api-reference/authentication#signature-types-and-funder).
|
||||
|
||||
### Tick Sizes
|
||||
|
||||
Your order price must conform to the market's tick size, or the order is rejected.
|
||||
|
||||
| Tick Size | Precision | Example Prices |
|
||||
| --------- | ---------- | ---------------------- |
|
||||
| `0.1` | 1 decimal | 0.1, 0.2, 0.5 |
|
||||
| `0.01` | 2 decimals | 0.01, 0.50, 0.99 |
|
||||
| `0.001` | 3 decimals | 0.001, 0.500, 0.999 |
|
||||
| `0.0001` | 4 decimals | 0.0001, 0.5000, 0.9999 |
|
||||
|
||||
<CodeGroup>
|
||||
```typescript TypeScript theme={null}
|
||||
const tickSize = await client.getTickSize("TOKEN_ID");
|
||||
```
|
||||
|
||||
```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?;
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
### Negative Risk
|
||||
|
||||
Multi-outcome events (3+ outcomes) use the Neg Risk CTF Exchange. Pass `negRisk: true` for these markets.
|
||||
|
||||
<CodeGroup>
|
||||
```typescript TypeScript theme={null}
|
||||
const isNegRisk = await client.getNegRisk("TOKEN_ID");
|
||||
```
|
||||
|
||||
```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?;
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
<Tip>
|
||||
Both values are also available on the market object: `minimum_tick_size` and
|
||||
`neg_risk`. In Rust, the order builder auto-fetches both — you don't need to
|
||||
look them up manually.
|
||||
</Tip>
|
||||
|
||||
***
|
||||
|
||||
## Prerequisites
|
||||
|
||||
Before placing an order, your funder address must have approved the Exchange contract to spend the relevant tokens:
|
||||
|
||||
* **BUY orders**: pUSD allowance >= spending amount
|
||||
* **SELL orders**: conditional token allowance >= selling amount
|
||||
|
||||
Order size is limited by your available balance minus amounts reserved by existing open orders:
|
||||
|
||||
$$
|
||||
\text{maxOrderSize} = \text{balance} - \sum(\text{openOrderSize} - \text{filledAmount})
|
||||
$$
|
||||
|
||||
<Warning>
|
||||
Orders are continuously monitored for validity — balances and allowances are
|
||||
tracked in real time. Any maker caught intentionally abusing these checks will
|
||||
be blacklisted.
|
||||
</Warning>
|
||||
|
||||
### Sports Markets
|
||||
|
||||
Sports markets have additional behaviors:
|
||||
|
||||
* Outstanding limit orders are **automatically cancelled** once the game begins, clearing the entire order book at the official start time
|
||||
* Marketable orders have a **1-second placement delay** before matching
|
||||
* Game start times can shift — monitor your orders closely, as they may not be cleared if the start time changes unexpectedly
|
||||
|
||||
***
|
||||
|
||||
## Response
|
||||
|
||||
A successful order placement returns:
|
||||
|
||||
```json theme={null}
|
||||
{
|
||||
"success": true,
|
||||
"errorMsg": "",
|
||||
"orderID": "0xabc123...",
|
||||
"takingAmount": "",
|
||||
"makingAmount": "",
|
||||
"status": "live",
|
||||
"transactionsHashes": [],
|
||||
"tradeIDs": []
|
||||
}
|
||||
```
|
||||
|
||||
### Statuses
|
||||
|
||||
| Status | Description |
|
||||
| ----------- | ------------------------------------------------------------- |
|
||||
| `live` | Order resting on the book |
|
||||
| `matched` | Order matched immediately with a resting order |
|
||||
| `delayed` | Marketable order accepted into an asynchronous matching delay |
|
||||
| `unmatched` | Marketable but failed to delay — placement still successful |
|
||||
|
||||
<Note>
|
||||
Selected crypto and finance up/down markets apply a 250 ms taker delay to
|
||||
marketable orders. To check a specific market, call `GET
|
||||
https://clob.polymarket.com/clob-markets/{condition_id}` or SDK
|
||||
`getClobMarketInfo(conditionID)` and look for `itode: true`. The API waits for
|
||||
this short hold and returns the final order result, so these orders usually
|
||||
return `matched`, `live`, or `unmatched` rather than `delayed`. Orders cannot
|
||||
be canceled while they are pending in the delay window.
|
||||
</Note>
|
||||
|
||||
### Error Messages
|
||||
|
||||
| Error | Description |
|
||||
| ---------------------------------- | ----------------------------------------------- |
|
||||
| `INVALID_ORDER_MIN_TICK_SIZE` | Price doesn't conform to the market's tick size |
|
||||
| `INVALID_ORDER_MIN_SIZE` | Order size below the minimum threshold |
|
||||
| `INVALID_ORDER_DUPLICATED` | Identical order already placed |
|
||||
| `INVALID_ORDER_NOT_ENOUGH_BALANCE` | Insufficient balance or allowance |
|
||||
| `INVALID_ORDER_EXPIRATION` | Expiration timestamp is in the past |
|
||||
| `INVALID_POST_ONLY_ORDER_TYPE` | Post-only used with FOK/FAK |
|
||||
| `INVALID_POST_ONLY_ORDER` | Post-only order would cross the book |
|
||||
| `FOK_ORDER_NOT_FILLED_ERROR` | FOK order couldn't be fully filled |
|
||||
| `INVALID_ORDER_ERROR` | System error inserting the order |
|
||||
| `EXECUTION_ERROR` | System error executing the trade |
|
||||
| `ORDER_DELAYED` | Order match delayed due to market conditions |
|
||||
| `DELAYING_ORDER_ERROR` | System error while delaying the order |
|
||||
| `MARKET_NOT_READY` | Market not yet accepting orders |
|
||||
|
||||
***
|
||||
|
||||
## Heartbeat
|
||||
|
||||
The heartbeat endpoint maintains session liveness. If a valid heartbeat is not received within **10 seconds** (with a 5-second buffer), **all open orders are cancelled**.
|
||||
|
||||
<CodeGroup>
|
||||
```typescript TypeScript theme={null}
|
||||
let heartbeatId = "";
|
||||
setInterval(async () => {
|
||||
const resp = await client.postHeartbeat(heartbeatId);
|
||||
heartbeatId = resp.heartbeat_id;
|
||||
}, 5000);
|
||||
```
|
||||
|
||||
```python Python theme={null}
|
||||
import time
|
||||
|
||||
heartbeat_id = ""
|
||||
while True:
|
||||
resp = client.post_heartbeat(heartbeat_id)
|
||||
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?;
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
* Include the most recent `heartbeat_id` in each request. Use an empty string for the first request.
|
||||
* If you send an expired ID, the server responds with `400` and the correct ID. Update and retry.
|
||||
|
||||
***
|
||||
|
||||
## Next Steps
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card title="Cancel Orders" icon="xmark" href="/trading/orders/cancel">
|
||||
Cancel single, multiple, or all open orders
|
||||
</Card>
|
||||
|
||||
<Card title="Order Attribution" icon="tag" href="/trading/orders/attribution">
|
||||
Attribute orders to your builder account for volume credit
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,207 @@
|
||||
> ## 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.
|
||||
|
||||
# Fees
|
||||
|
||||
> Understanding trading fees on Polymarket
|
||||
|
||||
Polymarket charges a small taker fee on certain markets. Fees are set by the protocol and applied at match time — you don't include fee information in your orders. 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. Takers can also earn a portion of fees back through the tiered [Taker Rebate Program](/trading/taker-rebates).
|
||||
|
||||
**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).
|
||||
|
||||
<Note>
|
||||
Fees are determined per-market at match time. Markets with fees enabled have
|
||||
`feesEnabled` set to `true` on the market object. Query fee parameters for
|
||||
any market with `getClobMarketInfo(conditionID)`.
|
||||
</Note>
|
||||
|
||||
***
|
||||
|
||||
## Fee Structure
|
||||
|
||||
Fees are calculated using the following formula:
|
||||
|
||||
```text theme={null}
|
||||
fee = C × feeRate × p × (1 - p)
|
||||
```
|
||||
|
||||
Where **C** = number of shares traded and **p** = price of the shares.
|
||||
|
||||
**Makers are never charged fees.** Only takers pay fees. The fee parameters differ by market category:
|
||||
|
||||
| Category | Taker Fee Rate | Maker Fee Rate | Maker Rebate |
|
||||
| --------------- | -------------- | -------------- | ------------ |
|
||||
| Crypto | 0.07 | 0 | 20% |
|
||||
| Sports | 0.03 | 0 | 25% |
|
||||
| Finance | 0.04 | 0 | 25% |
|
||||
| Politics | 0.04 | 0 | 25% |
|
||||
| Economics | 0.05 | 0 | 25% |
|
||||
| Culture | 0.05 | 0 | 25% |
|
||||
| Weather | 0.05 | 0 | 25% |
|
||||
| Other / General | 0.05 | 0 | 25% |
|
||||
| Mentions | 0.04 | 0 | 25% |
|
||||
| Tech | 0.04 | 0 | 25% |
|
||||
| Geopolitics | 0 | 0 | — |
|
||||
|
||||
Taker fees are calculated in USDC and vary based on the share price. The fee amount in USDC is symmetric around 50% probability — a trade at 30¢ incurs the same dollar fee as a trade at 70¢.
|
||||
|
||||
<Frame>
|
||||
<div className="p-3 bg-white rounded-xl">
|
||||
<iframe title="Fee Curves" aria-label="Line chart" id="datawrapper-chart-cY9H4" src="https://datawrapper.dwcdn.net/cY9H4/" scrolling="no" frameborder="0" width={700} style={{ width: "0", minWidth: "100% !important", border: "none" }} height="450" data-external="1" />
|
||||
</div>
|
||||
</Frame>
|
||||
|
||||
### Fee Tables (100 Shares)
|
||||
|
||||
<Tabs>
|
||||
<Tab title="Crypto">
|
||||
| Price | Trade Value | Taker Fee (USDC) |
|
||||
| ------ | ----------- | ---------------- |
|
||||
| \$0.01 | \$1 | \$0.07 |
|
||||
| \$0.05 | \$5 | \$0.33 |
|
||||
| \$0.10 | \$10 | \$0.63 |
|
||||
| \$0.15 | \$15 | \$0.89 |
|
||||
| \$0.20 | \$20 | \$1.12 |
|
||||
| \$0.25 | \$25 | \$1.31 |
|
||||
| \$0.30 | \$30 | \$1.47 |
|
||||
| \$0.35 | \$35 | \$1.59 |
|
||||
| \$0.40 | \$40 | \$1.68 |
|
||||
| \$0.45 | \$45 | \$1.73 |
|
||||
| \$0.50 | \$50 | \$1.75 |
|
||||
| \$0.55 | \$55 | \$1.73 |
|
||||
| \$0.60 | \$60 | \$1.68 |
|
||||
| \$0.65 | \$65 | \$1.59 |
|
||||
| \$0.70 | \$70 | \$1.47 |
|
||||
| \$0.75 | \$75 | \$1.31 |
|
||||
| \$0.80 | \$80 | \$1.12 |
|
||||
| \$0.85 | \$85 | \$0.89 |
|
||||
| \$0.90 | \$90 | \$0.63 |
|
||||
| \$0.95 | \$95 | \$0.33 |
|
||||
| \$0.99 | \$99 | \$0.07 |
|
||||
|
||||
The fee in USDC **peaks at 50%** probability (\$1.75) and decreases symmetrically toward both extremes.
|
||||
</Tab>
|
||||
|
||||
<Tab title="Sports">
|
||||
| Price | Trade Value | Taker Fee (USDC) |
|
||||
| ------ | ----------- | ---------------- |
|
||||
| \$0.01 | \$1 | \$0.03 |
|
||||
| \$0.05 | \$5 | \$0.14 |
|
||||
| \$0.10 | \$10 | \$0.27 |
|
||||
| \$0.15 | \$15 | \$0.38 |
|
||||
| \$0.20 | \$20 | \$0.48 |
|
||||
| \$0.25 | \$25 | \$0.56 |
|
||||
| \$0.30 | \$30 | \$0.63 |
|
||||
| \$0.35 | \$35 | \$0.68 |
|
||||
| \$0.40 | \$40 | \$0.72 |
|
||||
| \$0.45 | \$45 | \$0.74 |
|
||||
| \$0.50 | \$50 | \$0.75 |
|
||||
| \$0.55 | \$55 | \$0.74 |
|
||||
| \$0.60 | \$60 | \$0.72 |
|
||||
| \$0.65 | \$65 | \$0.68 |
|
||||
| \$0.70 | \$70 | \$0.63 |
|
||||
| \$0.75 | \$75 | \$0.56 |
|
||||
| \$0.80 | \$80 | \$0.48 |
|
||||
| \$0.85 | \$85 | \$0.38 |
|
||||
| \$0.90 | \$90 | \$0.27 |
|
||||
| \$0.95 | \$95 | \$0.14 |
|
||||
| \$0.99 | \$99 | \$0.03 |
|
||||
|
||||
The fee in USDC **peaks at 50%** probability (\$0.75) and decreases symmetrically toward both extremes.
|
||||
</Tab>
|
||||
|
||||
<Tab title="Finance / Politics / Mentions / Tech">
|
||||
| Price | Trade Value | Taker Fee (USDC) |
|
||||
| ------ | ----------- | ---------------- |
|
||||
| \$0.01 | \$1 | \$0.04 |
|
||||
| \$0.05 | \$5 | \$0.19 |
|
||||
| \$0.10 | \$10 | \$0.36 |
|
||||
| \$0.15 | \$15 | \$0.51 |
|
||||
| \$0.20 | \$20 | \$0.64 |
|
||||
| \$0.25 | \$25 | \$0.75 |
|
||||
| \$0.30 | \$30 | \$0.84 |
|
||||
| \$0.35 | \$35 | \$0.91 |
|
||||
| \$0.40 | \$40 | \$0.96 |
|
||||
| \$0.45 | \$45 | \$0.99 |
|
||||
| \$0.50 | \$50 | \$1.00 |
|
||||
| \$0.55 | \$55 | \$0.99 |
|
||||
| \$0.60 | \$60 | \$0.96 |
|
||||
| \$0.65 | \$65 | \$0.91 |
|
||||
| \$0.70 | \$70 | \$0.84 |
|
||||
| \$0.75 | \$75 | \$0.75 |
|
||||
| \$0.80 | \$80 | \$0.64 |
|
||||
| \$0.85 | \$85 | \$0.51 |
|
||||
| \$0.90 | \$90 | \$0.36 |
|
||||
| \$0.95 | \$95 | \$0.19 |
|
||||
| \$0.99 | \$99 | \$0.04 |
|
||||
|
||||
The fee in USDC **peaks at 50%** probability (\$1.00) and decreases symmetrically toward both extremes.
|
||||
</Tab>
|
||||
|
||||
<Tab title="Economics / Culture / Weather / Other">
|
||||
| Price | Trade Value | Taker Fee (USDC) |
|
||||
| ------ | ----------- | ---------------- |
|
||||
| \$0.01 | \$1 | \$0.05 |
|
||||
| \$0.05 | \$5 | \$0.24 |
|
||||
| \$0.10 | \$10 | \$0.45 |
|
||||
| \$0.15 | \$15 | \$0.64 |
|
||||
| \$0.20 | \$20 | \$0.80 |
|
||||
| \$0.25 | \$25 | \$0.94 |
|
||||
| \$0.30 | \$30 | \$1.05 |
|
||||
| \$0.35 | \$35 | \$1.14 |
|
||||
| \$0.40 | \$40 | \$1.20 |
|
||||
| \$0.45 | \$45 | \$1.24 |
|
||||
| \$0.50 | \$50 | \$1.25 |
|
||||
| \$0.55 | \$55 | \$1.24 |
|
||||
| \$0.60 | \$60 | \$1.20 |
|
||||
| \$0.65 | \$65 | \$1.14 |
|
||||
| \$0.70 | \$70 | \$1.05 |
|
||||
| \$0.75 | \$75 | \$0.94 |
|
||||
| \$0.80 | \$80 | \$0.80 |
|
||||
| \$0.85 | \$85 | \$0.64 |
|
||||
| \$0.90 | \$90 | \$0.45 |
|
||||
| \$0.95 | \$95 | \$0.24 |
|
||||
| \$0.99 | \$99 | \$0.05 |
|
||||
|
||||
The fee in USDC **peaks at 50%** probability (\$1.25) and decreases symmetrically toward both extremes.
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
### Fee Precision
|
||||
|
||||
Fees are rounded to 5 decimal places. The smallest fee charged is **0.00001 USDC**. Anything smaller rounds to zero, so very small trades near the extremes may incur no fee at all.
|
||||
|
||||
***
|
||||
|
||||
## Fee Handling
|
||||
|
||||
Fees are calculated and applied at match time by the protocol — you do not need to include fee information in your orders. The SDK handles everything automatically.
|
||||
|
||||
To query fee parameters for a specific market, use `getClobMarketInfo(conditionID)`:
|
||||
|
||||
<CodeGroup>
|
||||
```typescript TypeScript theme={null}
|
||||
const info = await client.getClobMarketInfo(conditionID);
|
||||
// info.fd = { r: feeRate, e: exponent, to: takerOnly }
|
||||
```
|
||||
|
||||
```python Python theme={null}
|
||||
info = client.get_clob_market_info(condition_id)
|
||||
# info["fd"] = { "r": fee_rate, "e": exponent, "to": taker_only }
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
***
|
||||
|
||||
## Next Steps
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card title="Maker Rebates Program" icon="coins" href="/market-makers/maker-rebates">
|
||||
Learn how taker fees fund daily USDC rebates for liquidity providers.
|
||||
</Card>
|
||||
|
||||
<Card title="Place Orders" icon="plus" href="/trading/quickstart">
|
||||
Start placing orders on Polymarket.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,169 @@
|
||||
> ## 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.
|
||||
|
||||
# Maker Rebates Program
|
||||
|
||||
> Earn daily pUSD rebates by providing liquidity on Polymarket
|
||||
|
||||
Polymarket charges taker fees across multiple market categories. Fees are determined by the protocol at match time and fund a **Maker Rebates** program that pays daily pUSD rebates to liquidity providers.
|
||||
|
||||
***
|
||||
|
||||
## Why Maker Rebates
|
||||
|
||||
Deeper liquidity means tighter spreads, lower price impact, more reliable fills, and greater resilience during volatility. Maker Rebates incentivize **consistent, competitive quoting** so everyone gets a better trading experience.
|
||||
|
||||
***
|
||||
|
||||
## How Maker Rebates Work
|
||||
|
||||
* **Paid daily in pUSD:** Rebates are calculated and distributed every day.
|
||||
* **Performance-based:** You earn based on the share of liquidity you provided that actually got taken.
|
||||
|
||||
### Eligibility
|
||||
|
||||
Place orders that add liquidity to the book and get filled (i.e., your liquidity is taken by another trader).
|
||||
|
||||
### Payment
|
||||
|
||||
Rebates are paid daily in pUSD, directly to your wallet. A minimum accrued rebate of **\$1 pUSD** is required for a payout.
|
||||
|
||||
***
|
||||
|
||||
## Funding
|
||||
|
||||
Maker Rebates are funded by taker fees collected in eligible markets. A percentage of these fees are redistributed to makers who keep the markets liquid. The rebate percentage differs by market type.
|
||||
|
||||
| Category | Maker Rebate | Distribution Method |
|
||||
| --------------- | ------------ | ------------------- |
|
||||
| Crypto | 20% | Fee-curve weighted |
|
||||
| Sports | 25% | Fee-curve weighted |
|
||||
| Finance | 25% | Fee-curve weighted |
|
||||
| Politics | 25% | Fee-curve weighted |
|
||||
| Economics | 25% | Fee-curve weighted |
|
||||
| Culture | 25% | Fee-curve weighted |
|
||||
| Weather | 25% | Fee-curve weighted |
|
||||
| Other / General | 25% | Fee-curve weighted |
|
||||
| Mentions | 25% | Fee-curve weighted |
|
||||
| Tech | 25% | Fee-curve weighted |
|
||||
| Geopolitics | — | Fee-free |
|
||||
|
||||
<Note>
|
||||
Polymarket collects taker fees in eligible markets across all fee-enabled categories.
|
||||
The rebate percentage is at the sole discretion of Polymarket
|
||||
and may change over time.
|
||||
</Note>
|
||||
|
||||
***
|
||||
|
||||
## Fee-Curve Weighted Rebates
|
||||
|
||||
Rebates are distributed using the **same formula as taker fees**. This ensures makers are rewarded proportionally to the fee value their liquidity generates.
|
||||
|
||||
For each filled maker order:
|
||||
|
||||
```text theme={null}
|
||||
fee_equivalent = C × feeRate × p × (1 - p)
|
||||
```
|
||||
|
||||
Where **C** = number of shares traded and **p** = price of the shares. The fee parameters differ by market type:
|
||||
|
||||
| Category | Taker Fee Rate | Maker Fee Rate |
|
||||
| --------------- | -------------- | -------------- |
|
||||
| Crypto | 0.07 | 0 |
|
||||
| Sports | 0.03 | 0 |
|
||||
| Finance | 0.04 | 0 |
|
||||
| Politics | 0.04 | 0 |
|
||||
| Economics | 0.05 | 0 |
|
||||
| Culture | 0.05 | 0 |
|
||||
| Weather | 0.05 | 0 |
|
||||
| Other / General | 0.05 | 0 |
|
||||
| Mentions | 0.04 | 0 |
|
||||
| Tech | 0.04 | 0 |
|
||||
| Geopolitics | 0 | 0 |
|
||||
|
||||
Your daily rebate:
|
||||
|
||||
```text theme={null}
|
||||
rebate = (your_fee_equivalent / total_fee_equivalent) * rebate_pool
|
||||
```
|
||||
|
||||
Totals are calculated per market, so you only compete with other makers in the same market.
|
||||
|
||||
***
|
||||
|
||||
## Taker Fee Structure
|
||||
|
||||
Taker fees are calculated in pUSD and vary based on the share price. The fee amount in pUSD is symmetric around 50% probability — a trade at 30¢ incurs the same dollar fee as a trade at 70¢.
|
||||
|
||||
<Frame>
|
||||
<div className="p-3 bg-white rounded-xl">
|
||||
<iframe title="Fee Curves" aria-label="Line chart" id="datawrapper-chart-cY9H4" src="https://datawrapper.dwcdn.net/cY9H4/" scrolling="no" frameborder="0" width={700} style={{ width: "0", minWidth: "100% !important", border: "none" }} height="450" data-external="1" />
|
||||
</div>
|
||||
</Frame>
|
||||
|
||||
### Fee Tables (100 Shares)
|
||||
|
||||
For detailed fee tables for each market category, see the [Fees](/trading/fees) page.
|
||||
|
||||
### Fee Precision
|
||||
|
||||
Fees are rounded to 5 decimal places. The smallest fee charged is 0.00001 pUSD. Anything smaller rounds to zero, so very small trades near the extremes may incur no fee at all.
|
||||
|
||||
***
|
||||
|
||||
## Which Markets Are Eligible
|
||||
|
||||
The following market categories have taker fees enabled and are eligible for maker rebates: Crypto, Sports, Finance, Politics, Economics, Culture, Weather, Tech, Mentions, and Other / General.
|
||||
|
||||
<Note>
|
||||
Markets with fees enabled have `feesEnabled` set to `true` on the market
|
||||
object. Query per-market fee parameters via `getClobMarketInfo(conditionID)`.
|
||||
</Note>
|
||||
|
||||
***
|
||||
|
||||
## FAQ
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="How do I qualify for maker rebates">
|
||||
Place orders that add liquidity to the book and get filled (i.e., your
|
||||
liquidity is taken by another trader).
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="When are rebates paid">Daily, in pUSD. You must accrue at least \$1 in rebates before a payout is issued.</Accordion>
|
||||
|
||||
<Accordion title="How are rebates calculated">
|
||||
Rebates are proportional to your share of executed maker liquidity in each
|
||||
eligible market. Totals are calculated per market, so you only compete with
|
||||
other makers in the same market.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="Where does the rebate pool come from">
|
||||
Taker fees collected in eligible markets are allocated to the maker rebate
|
||||
pool and distributed daily.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="Which markets have fees enabled">
|
||||
Crypto, Sports, Finance, Politics, Economics, Culture, Weather, Tech, Mentions, and Other / General markets.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="Is Polymarket charging fees on all markets">
|
||||
Fees apply to markets in fee-enabled categories. Markets with fees enabled have `feesEnabled` set to `true` on the market object — check it per-market via `getClobMarketInfo(conditionID)`.
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
***
|
||||
|
||||
## Next Steps
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card title="Fee Structure" icon="receipt" href="/trading/fees">
|
||||
Full fee handling guide for SDK and REST API users.
|
||||
</Card>
|
||||
|
||||
<Card title="Taker Rebate Program" icon="trophy" href="/trading/taker-rebates">
|
||||
Climb the tiers and earn daily pUSD rebates on taker trades.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
@@ -0,0 +1,699 @@
|
||||
> ## 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.
|
||||
|
||||
# Create Order
|
||||
|
||||
> Build, sign, and submit orders
|
||||
|
||||
All orders on Polymarket are expressed as **limit orders**. Market orders are supported by submitting a limit order with a marketable price — your order executes immediately at the best available price on the book.
|
||||
|
||||
<Info>
|
||||
The SDK handles EIP-712 signing and submission for you. If you prefer the REST
|
||||
API directly, see [Authentication](/api-reference/authentication) for
|
||||
constructing the required headers and the [API
|
||||
Reference](/api-reference/introduction) for full endpoint documentation
|
||||
including the raw order object fields and request/response schemas.
|
||||
</Info>
|
||||
|
||||
***
|
||||
|
||||
## Order Types
|
||||
|
||||
| Type | Behavior | Use Case |
|
||||
| ------- | -------------------------------------------------------------------- | ------------------------------- |
|
||||
| **GTC** | Good-Til-Cancelled — rests on the book until filled or cancelled | Default for limit orders |
|
||||
| **GTD** | Good-Til-Date — active until a specified expiration time | Auto-expire before known events |
|
||||
| **FOK** | Fill-Or-Kill — must fill immediately and entirely, or cancel | All-or-nothing market orders |
|
||||
| **FAK** | Fill-And-Kill — fills what's available immediately, cancels the rest | Partial-fill market orders |
|
||||
|
||||
* **GTC** and **GTD** are limit order types — they rest on the book at your specified price.
|
||||
* **FOK** and **FAK** are market order types — they execute against resting liquidity immediately.
|
||||
* **BUY**: specify the dollar amount you want to spend
|
||||
* **SELL**: specify the number of shares you want to sell
|
||||
|
||||
***
|
||||
|
||||
## Limit Orders
|
||||
|
||||
The simplest way to place a limit order — create, sign, and submit in one call:
|
||||
|
||||
<CodeGroup>
|
||||
```typescript TypeScript theme={null}
|
||||
import { ClobClient, Side, OrderType } from "@polymarket/clob-client-v2";
|
||||
|
||||
const response = await client.createAndPostOrder(
|
||||
{
|
||||
tokenID: "TOKEN_ID",
|
||||
price: 0.5,
|
||||
size: 10,
|
||||
side: Side.BUY,
|
||||
},
|
||||
{
|
||||
tickSize: "0.01",
|
||||
negRisk: false,
|
||||
},
|
||||
OrderType.GTC,
|
||||
);
|
||||
|
||||
console.log("Order ID:", response.orderID);
|
||||
console.log("Status:", response.status);
|
||||
```
|
||||
|
||||
```python Python theme={null}
|
||||
from py_clob_client_v2 import OrderArgs, OrderType, PartialCreateOrderOptions
|
||||
from py_clob_client_v2.order_builder.constants import BUY
|
||||
|
||||
response = client.create_and_post_order(
|
||||
OrderArgs(
|
||||
token_id="TOKEN_ID",
|
||||
price=0.50,
|
||||
size=10,
|
||||
side=BUY,
|
||||
),
|
||||
options=PartialCreateOrderOptions(tick_size="0.01", neg_risk=False),
|
||||
order_type=OrderType.GTC
|
||||
)
|
||||
|
||||
print("Order ID:", response["orderID"])
|
||||
print("Status:", response["status"])
|
||||
```
|
||||
|
||||
```rust Rust theme={null}
|
||||
use polymarket_client_sdk_v2::clob::types::Side;
|
||||
use polymarket_client_sdk_v2::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);
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
### Two-Step Sign Then Submit
|
||||
|
||||
For more control, you can separate signing from submission. This is useful for batch orders or custom submission logic:
|
||||
|
||||
<CodeGroup>
|
||||
```typescript TypeScript theme={null}
|
||||
// Step 1: Create and sign locally
|
||||
const signedOrder = await client.createOrder(
|
||||
{
|
||||
tokenID: "TOKEN_ID",
|
||||
price: 0.5,
|
||||
size: 10,
|
||||
side: Side.BUY,
|
||||
},
|
||||
{ tickSize: "0.01", negRisk: false },
|
||||
);
|
||||
|
||||
// Step 2: Submit to the CLOB
|
||||
const response = await client.postOrder(signedOrder, OrderType.GTC);
|
||||
```
|
||||
|
||||
```python Python theme={null}
|
||||
# Step 1: Create and sign locally
|
||||
signed_order = client.create_order(
|
||||
OrderArgs(
|
||||
token_id="TOKEN_ID",
|
||||
price=0.50,
|
||||
size=10,
|
||||
side=BUY,
|
||||
),
|
||||
options=PartialCreateOrderOptions(tick_size="0.01", neg_risk=False)
|
||||
)
|
||||
|
||||
# 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?;
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
***
|
||||
|
||||
## GTD Orders
|
||||
|
||||
GTD orders auto-expire at a specified time. Useful for quoting around known events.
|
||||
|
||||
<CodeGroup>
|
||||
```typescript TypeScript theme={null}
|
||||
// Expire in 1 hour (+ 60s security threshold buffer)
|
||||
const expiration = Math.floor(Date.now() / 1000) + 60 + 3600;
|
||||
|
||||
const response = await client.createAndPostOrder(
|
||||
{
|
||||
tokenID: "TOKEN_ID",
|
||||
price: 0.5,
|
||||
size: 10,
|
||||
side: Side.BUY,
|
||||
expiration,
|
||||
},
|
||||
{ tickSize: "0.01", negRisk: false },
|
||||
OrderType.GTD,
|
||||
);
|
||||
```
|
||||
|
||||
```python Python theme={null}
|
||||
import time
|
||||
|
||||
# Expire in 1 hour (+ 60s security threshold buffer)
|
||||
expiration = int(time.time()) + 60 + 3600
|
||||
|
||||
response = client.create_and_post_order(
|
||||
OrderArgs(
|
||||
token_id="TOKEN_ID",
|
||||
price=0.50,
|
||||
size=10,
|
||||
side=BUY,
|
||||
expiration=expiration,
|
||||
),
|
||||
options=PartialCreateOrderOptions(tick_size="0.01", neg_risk=False),
|
||||
order_type=OrderType.GTD
|
||||
)
|
||||
```
|
||||
|
||||
```rust Rust theme={null}
|
||||
use chrono::{TimeDelta, Utc};
|
||||
use polymarket_client_sdk_v2::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?;
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
<Note>
|
||||
There is a security threshold of one minute on GTD expiration. To set an
|
||||
effective lifetime of N seconds, use `now + 60 + N`. For example, for a
|
||||
30-second effective lifetime, set the expiration to `now + 60 + 30`.
|
||||
</Note>
|
||||
|
||||
***
|
||||
|
||||
## Market Orders
|
||||
|
||||
Market orders execute immediately against resting liquidity using FOK or FAK types:
|
||||
|
||||
<CodeGroup>
|
||||
```typescript TypeScript theme={null}
|
||||
import { Side, OrderType } from "@polymarket/clob-client-v2";
|
||||
|
||||
// FOK BUY: spend exactly $100 or cancel entirely
|
||||
const buyOrder = await client.createMarketOrder(
|
||||
{
|
||||
tokenID: "TOKEN_ID",
|
||||
side: Side.BUY,
|
||||
amount: 100, // dollar amount
|
||||
price: 0.5, // worst-price limit (slippage protection)
|
||||
},
|
||||
{ tickSize: "0.01", negRisk: false },
|
||||
);
|
||||
await client.postOrder(buyOrder, OrderType.FOK);
|
||||
|
||||
// FOK SELL: sell exactly 200 shares or cancel entirely
|
||||
const sellOrder = await client.createMarketOrder(
|
||||
{
|
||||
tokenID: "TOKEN_ID",
|
||||
side: Side.SELL,
|
||||
amount: 200, // number of shares
|
||||
price: 0.45, // worst-price limit (slippage protection)
|
||||
},
|
||||
{ tickSize: "0.01", negRisk: false },
|
||||
);
|
||||
await client.postOrder(sellOrder, OrderType.FOK);
|
||||
```
|
||||
|
||||
```python Python theme={null}
|
||||
from py_clob_client_v2.order_builder.constants import BUY, SELL
|
||||
from py_clob_client_v2 import MarketOrderArgs, OrderType, PartialCreateOrderOptions
|
||||
|
||||
# FOK BUY: spend exactly $100 or cancel entirely
|
||||
buy_order = client.create_market_order(
|
||||
order_args=MarketOrderArgs(
|
||||
token_id="TOKEN_ID",
|
||||
side=BUY,
|
||||
amount=100, # dollar amount
|
||||
price=0.50, # worst-price limit (slippage protection)
|
||||
),
|
||||
options=PartialCreateOrderOptions(tick_size="0.01", neg_risk=False),
|
||||
)
|
||||
client.post_order(buy_order, OrderType.FOK)
|
||||
|
||||
# FOK SELL: sell exactly 200 shares or cancel entirely
|
||||
sell_order = client.create_market_order(
|
||||
order_args=MarketOrderArgs(
|
||||
token_id="TOKEN_ID",
|
||||
side=SELL,
|
||||
amount=200, # number of shares
|
||||
price=0.45, # worst-price limit (slippage protection)
|
||||
),
|
||||
options=PartialCreateOrderOptions(tick_size="0.01", neg_risk=False),
|
||||
)
|
||||
client.post_order(sell_order, OrderType.FOK)
|
||||
```
|
||||
|
||||
```rust Rust theme={null}
|
||||
use polymarket_client_sdk_v2::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?;
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
* **FOK** — fill entirely or cancel the whole order
|
||||
* **FAK** — fill what's available, cancel the rest
|
||||
|
||||
The `price` field on market orders acts as a **worst-price limit** (slippage protection), not a target execution price.
|
||||
|
||||
### One-Step Market Order
|
||||
|
||||
For convenience, `createAndPostMarketOrder` handles creation, signing, and submission in one call:
|
||||
|
||||
<CodeGroup>
|
||||
```typescript TypeScript theme={null}
|
||||
const response = await client.createAndPostMarketOrder(
|
||||
{
|
||||
tokenID: "TOKEN_ID",
|
||||
side: Side.BUY,
|
||||
amount: 100,
|
||||
price: 0.5,
|
||||
},
|
||||
{ tickSize: "0.01", negRisk: false },
|
||||
OrderType.FOK,
|
||||
);
|
||||
```
|
||||
|
||||
```python Python theme={null}
|
||||
from py_clob_client_v2 import MarketOrderArgs, OrderType, PartialCreateOrderOptions
|
||||
from py_clob_client_v2.order_builder.constants import BUY
|
||||
|
||||
response = client.create_and_post_market_order(
|
||||
order_args=MarketOrderArgs(
|
||||
token_id="TOKEN_ID",
|
||||
side=BUY,
|
||||
amount=100,
|
||||
price=0.50,
|
||||
),
|
||||
options=PartialCreateOrderOptions(tick_size="0.01", neg_risk=False),
|
||||
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?;
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
***
|
||||
|
||||
## Post-Only Orders
|
||||
|
||||
Post-only orders guarantee you're always the maker. If the order would match immediately (cross the spread), it's rejected instead of executed.
|
||||
|
||||
<CodeGroup>
|
||||
```typescript TypeScript theme={null}
|
||||
const response = await client.postOrder(signedOrder, OrderType.GTC, true);
|
||||
```
|
||||
|
||||
```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?;
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
* Only works with **GTC** and **GTD** order types
|
||||
* Rejected if combined with FOK or FAK
|
||||
|
||||
***
|
||||
|
||||
## Batch Orders
|
||||
|
||||
Place up to **15 orders** in a single request:
|
||||
|
||||
<CodeGroup>
|
||||
```typescript TypeScript theme={null}
|
||||
import { OrderType, Side, PostOrdersArgs } from "@polymarket/clob-client-v2";
|
||||
|
||||
const orders: PostOrdersArgs[] = [
|
||||
{
|
||||
order: await client.createOrder(
|
||||
{
|
||||
tokenID: "TOKEN_ID",
|
||||
price: 0.48,
|
||||
side: Side.BUY,
|
||||
size: 500,
|
||||
},
|
||||
{ tickSize: "0.01", negRisk: false },
|
||||
),
|
||||
orderType: OrderType.GTC,
|
||||
},
|
||||
{
|
||||
order: await client.createOrder(
|
||||
{
|
||||
tokenID: "TOKEN_ID",
|
||||
price: 0.52,
|
||||
side: Side.SELL,
|
||||
size: 500,
|
||||
},
|
||||
{ tickSize: "0.01", negRisk: false },
|
||||
),
|
||||
orderType: OrderType.GTC,
|
||||
},
|
||||
];
|
||||
|
||||
const response = await client.postOrders(orders);
|
||||
```
|
||||
|
||||
```python Python theme={null}
|
||||
from py_clob_client_v2 import OrderArgs, OrderType, PostOrdersV2Args, PartialCreateOrderOptions
|
||||
from py_clob_client_v2.order_builder.constants import BUY, SELL
|
||||
|
||||
response = client.post_orders([
|
||||
PostOrdersV2Args(
|
||||
order=client.create_order(OrderArgs(
|
||||
price=0.48,
|
||||
size=500,
|
||||
side=BUY,
|
||||
token_id="TOKEN_ID",
|
||||
), options=PartialCreateOrderOptions(tick_size="0.01", neg_risk=False)),
|
||||
orderType=OrderType.GTC,
|
||||
),
|
||||
PostOrdersV2Args(
|
||||
order=client.create_order(OrderArgs(
|
||||
price=0.52,
|
||||
size=500,
|
||||
side=SELL,
|
||||
token_id="TOKEN_ID",
|
||||
), options=PartialCreateOrderOptions(tick_size="0.01", neg_risk=False)),
|
||||
orderType=OrderType.GTC,
|
||||
),
|
||||
])
|
||||
```
|
||||
|
||||
```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?;
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
***
|
||||
|
||||
## Order Options
|
||||
|
||||
Every order requires two market-specific options: `tickSize` and `negRisk`. For
|
||||
details on signature types (`0` = EOA, `1` = POLY\_PROXY, `2` = GNOSIS\_SAFE,
|
||||
`3` = POLY\_1271 deposit wallet), see
|
||||
[Authentication](/api-reference/authentication#signature-types-and-funder).
|
||||
|
||||
### Tick Sizes
|
||||
|
||||
Your order price must conform to the market's tick size, or the order is rejected.
|
||||
|
||||
| Tick Size | Precision | Example Prices |
|
||||
| --------- | ---------- | ---------------------- |
|
||||
| `0.1` | 1 decimal | 0.1, 0.2, 0.5 |
|
||||
| `0.01` | 2 decimals | 0.01, 0.50, 0.99 |
|
||||
| `0.001` | 3 decimals | 0.001, 0.500, 0.999 |
|
||||
| `0.0001` | 4 decimals | 0.0001, 0.5000, 0.9999 |
|
||||
|
||||
<CodeGroup>
|
||||
```typescript TypeScript theme={null}
|
||||
const tickSize = await client.getTickSize("TOKEN_ID");
|
||||
```
|
||||
|
||||
```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?;
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
### Negative Risk
|
||||
|
||||
Multi-outcome events (3+ outcomes) use the Neg Risk CTF Exchange. Pass `negRisk: true` for these markets.
|
||||
|
||||
<CodeGroup>
|
||||
```typescript TypeScript theme={null}
|
||||
const isNegRisk = await client.getNegRisk("TOKEN_ID");
|
||||
```
|
||||
|
||||
```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?;
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
<Tip>
|
||||
Both values are also available on the market object: `minimum_tick_size` and
|
||||
`neg_risk`. In Rust, the order builder auto-fetches both — you don't need to
|
||||
look them up manually.
|
||||
</Tip>
|
||||
|
||||
***
|
||||
|
||||
## Prerequisites
|
||||
|
||||
Before placing an order, your funder address must have approved the Exchange contract to spend the relevant tokens:
|
||||
|
||||
* **BUY orders**: pUSD allowance >= spending amount
|
||||
* **SELL orders**: conditional token allowance >= selling amount
|
||||
|
||||
Order size is limited by your available balance minus amounts reserved by existing open orders:
|
||||
|
||||
$$
|
||||
\text{maxOrderSize} = \text{balance} - \sum(\text{openOrderSize} - \text{filledAmount})
|
||||
$$
|
||||
|
||||
<Warning>
|
||||
Orders are continuously monitored for validity — balances and allowances are
|
||||
tracked in real time. Any maker caught intentionally abusing these checks will
|
||||
be blacklisted.
|
||||
</Warning>
|
||||
|
||||
### Sports Markets
|
||||
|
||||
Sports markets have additional behaviors:
|
||||
|
||||
* Outstanding limit orders are **automatically cancelled** once the game begins, clearing the entire order book at the official start time
|
||||
* Marketable orders have a **1-second placement delay** before matching
|
||||
* Game start times can shift — monitor your orders closely, as they may not be cleared if the start time changes unexpectedly
|
||||
|
||||
***
|
||||
|
||||
## Response
|
||||
|
||||
A successful order placement returns:
|
||||
|
||||
```json theme={null}
|
||||
{
|
||||
"success": true,
|
||||
"errorMsg": "",
|
||||
"orderID": "0xabc123...",
|
||||
"takingAmount": "",
|
||||
"makingAmount": "",
|
||||
"status": "live",
|
||||
"transactionsHashes": [],
|
||||
"tradeIDs": []
|
||||
}
|
||||
```
|
||||
|
||||
### Statuses
|
||||
|
||||
| Status | Description |
|
||||
| ----------- | ------------------------------------------------------------- |
|
||||
| `live` | Order resting on the book |
|
||||
| `matched` | Order matched immediately with a resting order |
|
||||
| `delayed` | Marketable order accepted into an asynchronous matching delay |
|
||||
| `unmatched` | Marketable but failed to delay — placement still successful |
|
||||
|
||||
<Note>
|
||||
Selected crypto and finance up/down markets apply a 250 ms taker delay to
|
||||
marketable orders. To check a specific market, call `GET
|
||||
https://clob.polymarket.com/clob-markets/{condition_id}` or SDK
|
||||
`getClobMarketInfo(conditionID)` and look for `itode: true`. The API waits for
|
||||
this short hold and returns the final order result, so these orders usually
|
||||
return `matched`, `live`, or `unmatched` rather than `delayed`. Orders cannot
|
||||
be canceled while they are pending in the delay window.
|
||||
</Note>
|
||||
|
||||
### Error Messages
|
||||
|
||||
| Error | Description |
|
||||
| ---------------------------------- | ----------------------------------------------- |
|
||||
| `INVALID_ORDER_MIN_TICK_SIZE` | Price doesn't conform to the market's tick size |
|
||||
| `INVALID_ORDER_MIN_SIZE` | Order size below the minimum threshold |
|
||||
| `INVALID_ORDER_DUPLICATED` | Identical order already placed |
|
||||
| `INVALID_ORDER_NOT_ENOUGH_BALANCE` | Insufficient balance or allowance |
|
||||
| `INVALID_ORDER_EXPIRATION` | Expiration timestamp is in the past |
|
||||
| `INVALID_POST_ONLY_ORDER_TYPE` | Post-only used with FOK/FAK |
|
||||
| `INVALID_POST_ONLY_ORDER` | Post-only order would cross the book |
|
||||
| `FOK_ORDER_NOT_FILLED_ERROR` | FOK order couldn't be fully filled |
|
||||
| `INVALID_ORDER_ERROR` | System error inserting the order |
|
||||
| `EXECUTION_ERROR` | System error executing the trade |
|
||||
| `ORDER_DELAYED` | Order match delayed due to market conditions |
|
||||
| `DELAYING_ORDER_ERROR` | System error while delaying the order |
|
||||
| `MARKET_NOT_READY` | Market not yet accepting orders |
|
||||
|
||||
***
|
||||
|
||||
## Heartbeat
|
||||
|
||||
The heartbeat endpoint maintains session liveness. If a valid heartbeat is not received within **10 seconds** (with a 5-second buffer), **all open orders are cancelled**.
|
||||
|
||||
<CodeGroup>
|
||||
```typescript TypeScript theme={null}
|
||||
let heartbeatId = "";
|
||||
setInterval(async () => {
|
||||
const resp = await client.postHeartbeat(heartbeatId);
|
||||
heartbeatId = resp.heartbeat_id;
|
||||
}, 5000);
|
||||
```
|
||||
|
||||
```python Python theme={null}
|
||||
import time
|
||||
|
||||
heartbeat_id = ""
|
||||
while True:
|
||||
resp = client.post_heartbeat(heartbeat_id)
|
||||
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?;
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
* Include the most recent `heartbeat_id` in each request. Use an empty string for the first request.
|
||||
* If you send an expired ID, the server responds with `400` and the correct ID. Update and retry.
|
||||
|
||||
***
|
||||
|
||||
## Next Steps
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card title="Cancel Orders" icon="xmark" href="/trading/orders/cancel">
|
||||
Cancel single, multiple, or all open orders
|
||||
</Card>
|
||||
|
||||
<Card title="Order Attribution" icon="tag" href="/trading/orders/attribution">
|
||||
Attribute orders to your builder account for volume credit
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,116 @@
|
||||
> ## 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.
|
||||
|
||||
# Prices & Orderbook
|
||||
|
||||
> How prices work and how the order book enables peer-to-peer trading
|
||||
|
||||
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.
|
||||
|
||||
<Frame>
|
||||
<img src="https://mintcdn.com/polymarket-292d1b1b/FOMte3ewbG-LVy3k/images/core-concepts/orderbook.png?fit=max&auto=format&n=FOMte3ewbG-LVy3k&q=85&s=119174bcaaeb3b9abbd4c2d94b7bdae6" alt="" className="dark:hidden" width="1540" height="952" data-path="images/core-concepts/orderbook.png" />
|
||||
|
||||
<img src="https://mintcdn.com/polymarket-292d1b1b/FOMte3ewbG-LVy3k/images/dark/core-concepts/orderbook.png?fit=max&auto=format&n=FOMte3ewbG-LVy3k&q=85&s=b940f4b5f28ab6ed5845dda2bfe03edb" alt="" className="hidden dark:block" width="1540" height="952" data-path="images/dark/core-concepts/orderbook.png" />
|
||||
</Frame>
|
||||
|
||||
## 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.
|
||||
|
||||
| Price | Implied Probability |
|
||||
| ------ | ------------------- |
|
||||
| \$0.25 | 25% chance |
|
||||
| \$0.50 | 50% chance |
|
||||
| \$0.75 | 75% chance |
|
||||
|
||||
<Note>
|
||||
The displayed price is the **midpoint** of the bid-ask spread. If the spread
|
||||
is wider than \$0.10, the last traded price is shown instead.
|
||||
</Note>
|
||||
|
||||
### Example
|
||||
|
||||
If the best bid for "Yes" is `$0.34` and the best ask is `$0.40`:
|
||||
|
||||
```
|
||||
Displayed price = ($0.34 + $0.40) / 2 = $0.37 (37% probability)
|
||||
```
|
||||
|
||||
You won't necessarily trade at `$0.37`—you'll pay the ask (`$0.40`) when buying or receive the bid (`$0.34`) when selling.
|
||||
|
||||
## The Order Book
|
||||
|
||||
The order book is a list of all open buy and sell orders for a market. It has two sides:
|
||||
|
||||
| Side | Description |
|
||||
| ---- | ----------------------------------------------------------- |
|
||||
| Bids | Buy orders—the highest prices traders are willing to pay |
|
||||
| Asks | Sell orders—the lowest prices traders are willing to accept |
|
||||
|
||||
The **spread** is the gap between the highest bid and lowest ask. Tighter spreads mean more liquid markets.
|
||||
|
||||
## Order Types
|
||||
|
||||
### Market Orders
|
||||
|
||||
Execute immediately at the best available price. Use when you want instant execution and are willing to pay the spread.
|
||||
|
||||
* **Buying**: You pay the lowest ask price
|
||||
* **Selling**: You receive the highest bid price
|
||||
|
||||
### Limit Orders
|
||||
|
||||
Execute only at your specified price or better. Use when you want price control and are willing to wait.
|
||||
|
||||
* Your order sits in the book until someone trades against it
|
||||
* Orders can **partially fill** as different traders match portions of your order
|
||||
* You can cancel unfilled orders at any time
|
||||
|
||||
<Note>
|
||||
All orders on Polymarket are technically limit orders. A "market order" is
|
||||
simply a limit order priced to execute immediately against resting orders.
|
||||
</Note>
|
||||
|
||||
## How Trades Work
|
||||
|
||||
Polymarket's CLOB is **hybrid-decentralized**:
|
||||
|
||||
1. **Offchain matching** — An operator matches compatible orders
|
||||
2. **Onchain settlement** — Matched trades settle via smart contracts
|
||||
|
||||
<Frame>
|
||||
<img src="https://mintcdn.com/polymarket-292d1b1b/FOMte3ewbG-LVy3k/images/core-concepts/trade-lifecycle.png?fit=max&auto=format&n=FOMte3ewbG-LVy3k&q=85&s=2acec8befdfbba57fb554170f7d5813c" alt="" className="dark:hidden" width="1540" height="952" data-path="images/core-concepts/trade-lifecycle.png" />
|
||||
|
||||
<img src="https://mintcdn.com/polymarket-292d1b1b/FOMte3ewbG-LVy3k/images/dark/core-concepts/trade-lifecycle.png?fit=max&auto=format&n=FOMte3ewbG-LVy3k&q=85&s=d18b22ad7629820ad554dda8cb83ec18" alt="" className="hidden dark:block" width="1540" height="952" data-path="images/dark/core-concepts/trade-lifecycle.png" />
|
||||
</Frame>
|
||||
|
||||
This design gives you the speed of centralized matching with the security of onchain settlement. You always maintain custody of your funds.
|
||||
|
||||
## Price Discovery
|
||||
|
||||
When a new market launches, there's no initial price. The first price emerges when:
|
||||
|
||||
1. Someone places a limit order to buy Yes at a price (e.g., `$0.60`)
|
||||
2. Someone places a limit order to buy No at the complementary price (e.g., `$0.40`)
|
||||
3. Since `$0.60` + `$0.40` = `$1.00`, the orders match
|
||||
|
||||
When matched, `$1.00` is converted into 1 Yes token and 1 No token, each going to their respective buyers.
|
||||
|
||||
## Next Steps
|
||||
|
||||
<Note>
|
||||
Polymarket's orderbook has **no trading size limits** — it matches willing
|
||||
buyers and sellers of any amount. However, large orders may move the price
|
||||
significantly. Always check orderbook depth before trading in size.
|
||||
</Note>
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card title="Positions & Tokens" icon="coins" href="/concepts/positions-tokens">
|
||||
Learn about outcome tokens and how positions work.
|
||||
</Card>
|
||||
|
||||
<Card title="Order Lifecycle" icon="arrows-spin" href="/concepts/order-lifecycle">
|
||||
Understand what happens from order placement to settlement.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
Reference in New Issue
Block a user