docs: sync Polymarket documentation (2026-05-04)

This commit is contained in:
Etherdrake
2026-05-04 14:56:14 +02:00
parent a54a713360
commit 88de1ab5cd
35 changed files with 189 additions and 180 deletions
+30 -21
View File
@@ -63,12 +63,16 @@ Before making authenticated requests, you need to obtain API credentials using L
<Tab title="TypeScript">
```typescript theme={null}
import { ClobClient } from "@polymarket/clob-client-v2";
import { Wallet } from "ethers"; // v5.8.0
import { createWalletClient, http } from "viem";
import { privateKeyToAccount } from "viem/accounts";
const account = privateKeyToAccount(process.env.PRIVATE_KEY as `0x${string}`);
const signer = createWalletClient({ account, transport: http() });
const client = new ClobClient({
host: "https://clob.polymarket.com",
chain: 137, // Polygon mainnet
signer: new Wallet(process.env.PRIVATE_KEY),
signer,
});
// Creates new credentials or derives existing ones
@@ -76,7 +80,7 @@ Before making authenticated requests, you need to obtain API credentials using L
console.log(credentials);
// {
// apiKey: "550e8400-e29b-41d4-a716-446655440000",
// key: "550e8400-e29b-41d4-a716-446655440000",
// secret: "base64EncodedSecretString",
// passphrase: "randomPassphraseString"
// }
@@ -85,17 +89,17 @@ Before making authenticated requests, you need to obtain API credentials using L
<Tab title="Python">
```python theme={null}
from py_clob_client.client import ClobClient
from py_clob_client_v2 import ClobClient
import os
client = ClobClient(
host="https://clob.polymarket.com",
chain=137, # Polygon mainnet
chain_id=137, # Polygon mainnet
key=os.getenv("PRIVATE_KEY")
)
# Creates new credentials or derives existing ones
credentials = client.create_or_derive_api_creds()
credentials = client.create_or_derive_api_key()
print(credentials)
# {
@@ -109,9 +113,9 @@ Before making authenticated requests, you need to obtain API credentials using L
<Tab title="Rust">
```rust theme={null}
use std::str::FromStr;
use polymarket_client_sdk::POLYGON;
use polymarket_client_sdk::auth::{LocalSigner, Signer};
use polymarket_client_sdk::clob::{Client, Config};
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)?
@@ -221,7 +225,7 @@ The `POLY_SIGNATURE` is generated by signing the following EIP-712 struct:
Reference implementations:
* [TypeScript](https://github.com/Polymarket/clob-client-v2/blob/main/src/signing/eip712.ts)
* [Python](https://github.com/Polymarket/py-clob-client-v2/blob/main/py_clob_client/signing/eip712.py)
* [Python](https://github.com/Polymarket/py-clob-client-v2/blob/main/py_clob_client_v2/signing/eip712.py)
Response:
@@ -249,20 +253,24 @@ All trading endpoints require these 5 headers:
| `POLY_API_KEY` | User's API `apiKey` value |
| `POLY_PASSPHRASE` | User's API `passphrase` value |
The `POLY_SIGNATURE` for L2 is an HMAC-SHA256 signature created using the user's API credentials `secret` value. Reference implementations can be found in the [TypeScript](https://github.com/Polymarket/clob-client-v2/blob/main/src/signing/hmac.ts) and [Python](https://github.com/Polymarket/py-clob-client-v2/blob/main/py_clob_client/signing/hmac.py) clients.
The `POLY_SIGNATURE` for L2 is an HMAC-SHA256 signature created using the user's API credentials `secret` value. Reference implementations can be found in the [TypeScript](https://github.com/Polymarket/clob-client-v2/blob/main/src/signing/hmac.ts) and [Python](https://github.com/Polymarket/py-clob-client-v2/blob/main/py_clob_client_v2/signing/hmac.py) clients.
### CLOB Client
<Tabs>
<Tab title="TypeScript">
```typescript theme={null}
import { ClobClient } from "@polymarket/clob-client-v2";
import { Wallet } from "ethers"; // v5.8.0
import { ClobClient, Side } from "@polymarket/clob-client-v2";
import { createWalletClient, http } from "viem";
import { privateKeyToAccount } from "viem/accounts";
const account = privateKeyToAccount(process.env.PRIVATE_KEY as `0x${string}`);
const signer = createWalletClient({ account, transport: http() });
const client = new ClobClient({
host: "https://clob.polymarket.com",
chain: 137,
signer: new Wallet(process.env.PRIVATE_KEY),
signer,
creds: apiCreds, // Generated from L1 auth, API credentials enable L2 methods
signatureType: 1, // signatureType explained below
funderAddress, // funder explained below
@@ -270,7 +278,7 @@ The `POLY_SIGNATURE` for L2 is an HMAC-SHA256 signature created using the user's
// Now you can trade!
const order = await client.createAndPostOrder(
{ tokenID: "123456", price: 0.65, size: 100, side: "BUY" },
{ tokenID: "123456", price: 0.65, size: 100, side: Side.BUY },
{ tickSize: "0.01", negRisk: false }
);
```
@@ -278,12 +286,13 @@ The `POLY_SIGNATURE` for L2 is an HMAC-SHA256 signature created using the user's
<Tab title="Python">
```python theme={null}
from py_clob_client.client import ClobClient
from py_clob_client_v2 import ClobClient, OrderArgs, PartialCreateOrderOptions
from py_clob_client_v2.order_builder.constants import BUY
import os
client = ClobClient(
host="https://clob.polymarket.com",
chain=137,
chain_id=137,
key=os.getenv("PRIVATE_KEY"),
creds=api_creds, # Generated from L1 auth, API credentials enable L2 methods
signature_type=1, # signatureType explained below
@@ -292,16 +301,16 @@ The `POLY_SIGNATURE` for L2 is an HMAC-SHA256 signature created using the user's
# Now you can trade!
order = client.create_and_post_order(
{"token_id": "123456", "price": 0.65, "size": 100, "side": "BUY"},
{"tick_size": "0.01", "neg_risk": False}
OrderArgs(token_id="123456", price=0.65, size=100, side=BUY),
options=PartialCreateOrderOptions(tick_size="0.01", neg_risk=False),
)
```
</Tab>
<Tab title="Rust">
```rust theme={null}
use polymarket_client_sdk::clob::types::{Side, SignatureType};
use polymarket_client_sdk::types::dec;
use polymarket_client_sdk_v2::clob::types::{Side, SignatureType};
use polymarket_client_sdk_v2::types::dec;
let client = Client::new("https://clob.polymarket.com", Config::default())?
.authentication_builder(&signer)
+6 -6
View File
@@ -12,7 +12,7 @@ Polymarket provides official open-source clients in TypeScript, Python, and Rust
<CodeGroup>
```bash TypeScript theme={null}
npm install @polymarket/clob-client-v2 ethers@5
npm install @polymarket/clob-client-v2 viem
```
```bash Python theme={null}
@@ -20,7 +20,7 @@ Polymarket provides official open-source clients in TypeScript, Python, and Rust
```
```bash Rust theme={null}
cargo add polymarket-client-sdk
cargo add polymarket_client_sdk_v2 --features clob
```
</CodeGroup>
@@ -41,12 +41,12 @@ Polymarket provides official open-source clients in TypeScript, Python, and Rust
```
```python Python theme={null}
from py_clob_client.client import ClobClient
from py_clob_client_v2 import ClobClient
client = ClobClient(
"https://clob.polymarket.com",
key=private_key,
chain=137,
chain_id=137,
creds=api_creds,
)
@@ -54,7 +54,7 @@ Polymarket provides official open-source clients in TypeScript, Python, and Rust
```
```rust Rust theme={null}
use polymarket_client_sdk::clob::{Client, Config};
use polymarket_client_sdk_v2::clob::{Client, Config};
let client = Client::new("https://clob.polymarket.com", Config::default())?
.authentication_builder(&signer)
@@ -71,7 +71,7 @@ Polymarket provides official open-source clients in TypeScript, Python, and Rust
| ---------- | ---------------------------- | ------------------------------------------------------------------------------------------ |
| TypeScript | `@polymarket/clob-client-v2` | [github.com/Polymarket/clob-client-v2](https://github.com/Polymarket/clob-client-v2) |
| Python | `py-clob-client-v2` | [github.com/Polymarket/py-clob-client-v2](https://github.com/Polymarket/py-clob-client-v2) |
| Rust | `polymarket-client-sdk` | [github.com/Polymarket/rs-clob-client-v2](https://github.com/Polymarket/rs-clob-client-v2) |
| Rust | `polymarket_client_sdk_v2` | [github.com/Polymarket/rs-clob-client-v2](https://github.com/Polymarket/rs-clob-client-v2) |
Each repository includes working examples in the `/examples` directory.
+6 -6
View File
@@ -166,7 +166,7 @@
</Update>
<Update label="July 23, 2025" description="Get Book(s) update">
* We're adding new fields to the `get-book` and `get-books` CLOB endpoints to include key market metadata that previously required separate queries.
* Were adding new fields to the `get-book` and `get-books` CLOB endpoints to include key market metadata that previously required separate queries.
* `min_order_size`
* type: string
* description: Minimum price increment.
@@ -179,7 +179,7 @@
</Update>
<Update label="June 3, 2025" description="New Batch Orders Endpoint">
* We're excited to roll out a highly requested feature: **order batching**. With this new endpoint, users can now submit up to five trades in a single request. To help you get started, we've included sample code demonstrating how to use it. Please see [Create Orders](/trading/orders/create) for more details.
* Were excited to roll out a highly requested feature: **order batching**. With this new endpoint, users can now submit up to five trades in a single request. To help you get started, weve included sample code demonstrating how to use it. Please see [Create Orders](/trading/orders/create) for more details.
</Update>
<Update label="June 3, 2025" description="Change to /data/trades">
@@ -194,7 +194,7 @@
</Update>
<Update label="May 28, 2025" description="New FAK Order Type">
We're excited to introduce a new order type soon to be available to all users: Fill and Kill (FAK). FAK orders behave similarly to the well-known Fill or Kill (FOK) orders, but with a key difference:
Were excited to introduce a new order type soon to be available to all users: Fill and Kill (FAK). FAK orders behave similarly to the well-known Fill or Kill (FOK) orders, but with a key difference:
* FAK will fill as many shares as possible immediately at your specified price, and any remaining unfilled portion will be canceled.
* Unlike FOK, which requires the entire order to fill instantly or be canceled, FAK is more flexible and aims to capture partial fills if possible.
@@ -208,7 +208,7 @@
* CLOB - /price (100req - 10s / Throttle requests over the maximum configured rate)
* CLOB markets/0x (50req / 10s - Throttle requests over the maximum configured rate)
* CLOB POST /order - 500 every 10s (50/s) - (BURST) - Throttle requests over the maximum configured rate
* CLOB POST /order - 3000 every 10 minutes (5/s) - Throttle requests over the maximum configured rate)
* CLOB POST /order - 3000 every 10 minutes (5/s) - Throttle requests over the maximum configured rate
* CLOB DELETE /order - 500 every 10s (50/s) - (BURST) - Throttle requests over the maximum configured rate
* DELETE /order - 3000 every 10 minutes (5/s) - Throttle requests over the maximum configured rate)
</Update>
* DELETE /order - 3000 every 10 minutes (5/s) - Throttle requests over the maximum configured rate
</Update>
+7 -7
View File
@@ -78,20 +78,20 @@ export const IconCard = ({ icon, title, description, href, color }) => {
```
```python Python theme={null}
from py_clob_client.client import ClobClient
from py_clob_client.order_builder.constants import BUY
from py_clob_client_v2 import ClobClient, OrderArgs, PartialCreateOrderOptions
from py_clob_client_v2.order_builder.constants import BUY
client = ClobClient(host, key=key, chain=chain, creds=creds)
client = ClobClient(host, key=key, chain_id=chain, creds=creds)
order = client.create_and_post_order(
OrderArgs(token_id=token_id, price=0.50, size=10, side=BUY),
options={"tick_size": "0.01", "neg_risk": False}
options=PartialCreateOrderOptions(tick_size="0.01", neg_risk=False)
)
```
```rust Rust theme={null}
use polymarket_client_sdk::clob::{Client, Config};
use polymarket_client_sdk::clob::types::Side;
use polymarket_client_sdk::types::dec;
use polymarket_client_sdk_v2::clob::{Client, Config};
use polymarket_client_sdk_v2::clob::types::Side;
use polymarket_client_sdk_v2::types::dec;
let client = Client::new(host, Config::default())?.authentication_builder(&signer).authenticate().await?;
let order = client.limit_order().token_id(token_id).price(dec!(0.50)).size(dec!(10)).side(Side::Buy).build().await?;
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+2 -2
View File
@@ -167,9 +167,9 @@ The geoblocking system includes:
<Tab title="Rust">
```rust theme={null}
use polymarket_client_sdk::clob::Client;
use polymarket_client_sdk_v2::clob::{Client, Config};
let client = Client::default();
let client = Client::new("https://clob.polymarket.com", Config::default())?;
let geo = client.check_geoblock().await?;
if geo.blocked {
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
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
@@ -60,8 +60,8 @@ The simplest way to place a limit order — create, sign, and submit in one call
```
```python Python theme={null}
from py_clob_client.clob_types import OrderArgs, OrderType
from py_clob_client.order_builder.constants import BUY
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(
@@ -70,10 +70,7 @@ The simplest way to place a limit order — create, sign, and submit in one call
size=10,
side=BUY,
),
options={
"tick_size": "0.01",
"neg_risk": False,
},
options=PartialCreateOrderOptions(tick_size="0.01", neg_risk=False),
order_type=OrderType.GTC
)
@@ -82,8 +79,8 @@ The simplest way to place a limit order — create, sign, and submit in one call
```
```rust Rust theme={null}
use polymarket_client_sdk::clob::types::Side;
use polymarket_client_sdk::types::dec;
use polymarket_client_sdk_v2::clob::types::Side;
use polymarket_client_sdk_v2::types::dec;
let token_id = "TOKEN_ID".parse()?;
let order = client
@@ -132,10 +129,7 @@ For more control, you can separate signing from submission. This is useful for b
size=10,
side=BUY,
),
options={
"tick_size": "0.01",
"neg_risk": False,
}
options=PartialCreateOrderOptions(tick_size="0.01", neg_risk=False)
)
# Step 2: Submit to the CLOB
@@ -197,17 +191,14 @@ GTD orders auto-expire at a specified time. Useful for quoting around known even
side=BUY,
expiration=expiration,
),
options={
"tick_size": "0.01",
"neg_risk": False,
},
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::clob::types::OrderType;
use polymarket_client_sdk_v2::clob::types::OrderType;
let order = client
.limit_order()
@@ -266,32 +257,36 @@ Market orders execute immediately against resting liquidity using FOK or FAK typ
```
```python Python theme={null}
from py_clob_client.order_builder.constants import BUY, SELL
from py_clob_client.clob_types import OrderType
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(
token_id="TOKEN_ID",
side=BUY,
amount=100, # dollar amount
price=0.50, # worst-price limit (slippage protection)
options={"tick_size": "0.01", "neg_risk": False},
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(
token_id="TOKEN_ID",
side=SELL,
amount=200, # number of shares
price=0.45, # worst-price limit (slippage protection)
options={"tick_size": "0.01", "neg_risk": False},
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::clob::types::{Amount, OrderType, Side};
use polymarket_client_sdk_v2::clob::types::{Amount, OrderType, Side};
let token_id = "TOKEN_ID".parse()?;
@@ -347,12 +342,17 @@ For convenience, `createAndPostMarketOrder` handles creation, signing, and submi
```
```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(
token_id="TOKEN_ID",
side=BUY,
amount=100,
price=0.50,
options={"tick_size": "0.01", "neg_risk": False},
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,
)
```
@@ -446,26 +446,26 @@ Place up to **15 orders** in a single request:
```
```python Python theme={null}
from py_clob_client.clob_types import OrderArgs, OrderType, PostOrdersArgs
from py_clob_client.order_builder.constants import BUY, SELL
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([
PostOrdersArgs(
PostOrdersV2Args(
order=client.create_order(OrderArgs(
price=0.48,
size=500,
side=BUY,
token_id="TOKEN_ID",
), options={"tick_size": "0.01", "neg_risk": False}),
), options=PartialCreateOrderOptions(tick_size="0.01", neg_risk=False)),
orderType=OrderType.GTC,
),
PostOrdersArgs(
PostOrdersV2Args(
order=client.create_order(OrderArgs(
price=0.52,
size=500,
side=SELL,
token_id="TOKEN_ID",
), options={"tick_size": "0.01", "neg_risk": False}),
), options=PartialCreateOrderOptions(tick_size="0.01", neg_risk=False)),
orderType=OrderType.GTC,
),
])
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
+41 -41
View File
@@ -60,8 +60,8 @@ The simplest way to place a limit order — create, sign, and submit in one call
```
```python Python theme={null}
from py_clob_client.clob_types import OrderArgs, OrderType
from py_clob_client.order_builder.constants import BUY
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(
@@ -70,10 +70,7 @@ The simplest way to place a limit order — create, sign, and submit in one call
size=10,
side=BUY,
),
options={
"tick_size": "0.01",
"neg_risk": False,
},
options=PartialCreateOrderOptions(tick_size="0.01", neg_risk=False),
order_type=OrderType.GTC
)
@@ -82,8 +79,8 @@ The simplest way to place a limit order — create, sign, and submit in one call
```
```rust Rust theme={null}
use polymarket_client_sdk::clob::types::Side;
use polymarket_client_sdk::types::dec;
use polymarket_client_sdk_v2::clob::types::Side;
use polymarket_client_sdk_v2::types::dec;
let token_id = "TOKEN_ID".parse()?;
let order = client
@@ -132,10 +129,7 @@ For more control, you can separate signing from submission. This is useful for b
size=10,
side=BUY,
),
options={
"tick_size": "0.01",
"neg_risk": False,
}
options=PartialCreateOrderOptions(tick_size="0.01", neg_risk=False)
)
# Step 2: Submit to the CLOB
@@ -197,17 +191,14 @@ GTD orders auto-expire at a specified time. Useful for quoting around known even
side=BUY,
expiration=expiration,
),
options={
"tick_size": "0.01",
"neg_risk": False,
},
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::clob::types::OrderType;
use polymarket_client_sdk_v2::clob::types::OrderType;
let order = client
.limit_order()
@@ -266,32 +257,36 @@ Market orders execute immediately against resting liquidity using FOK or FAK typ
```
```python Python theme={null}
from py_clob_client.order_builder.constants import BUY, SELL
from py_clob_client.clob_types import OrderType
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(
token_id="TOKEN_ID",
side=BUY,
amount=100, # dollar amount
price=0.50, # worst-price limit (slippage protection)
options={"tick_size": "0.01", "neg_risk": False},
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(
token_id="TOKEN_ID",
side=SELL,
amount=200, # number of shares
price=0.45, # worst-price limit (slippage protection)
options={"tick_size": "0.01", "neg_risk": False},
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::clob::types::{Amount, OrderType, Side};
use polymarket_client_sdk_v2::clob::types::{Amount, OrderType, Side};
let token_id = "TOKEN_ID".parse()?;
@@ -347,12 +342,17 @@ For convenience, `createAndPostMarketOrder` handles creation, signing, and submi
```
```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(
token_id="TOKEN_ID",
side=BUY,
amount=100,
price=0.50,
options={"tick_size": "0.01", "neg_risk": False},
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,
)
```
@@ -446,26 +446,26 @@ Place up to **15 orders** in a single request:
```
```python Python theme={null}
from py_clob_client.clob_types import OrderArgs, OrderType, PostOrdersArgs
from py_clob_client.order_builder.constants import BUY, SELL
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([
PostOrdersArgs(
PostOrdersV2Args(
order=client.create_order(OrderArgs(
price=0.48,
size=500,
side=BUY,
token_id="TOKEN_ID",
), options={"tick_size": "0.01", "neg_risk": False}),
), options=PartialCreateOrderOptions(tick_size="0.01", neg_risk=False)),
orderType=OrderType.GTC,
),
PostOrdersArgs(
PostOrdersV2Args(
order=client.create_order(OrderArgs(
price=0.52,
size=500,
side=SELL,
token_id="TOKEN_ID",
), options={"tick_size": "0.01", "neg_risk": False}),
), options=PartialCreateOrderOptions(tick_size="0.01", neg_risk=False)),
orderType=OrderType.GTC,
),
])
File diff suppressed because one or more lines are too long