Skip to content

Commit 9b18b5f

Browse files
authored
Merge pull request #67 from Polymarket/suhail/clob-v2
Migrate CLOB order submission to SDK v2
2 parents 4b5a749 + 9bce2b1 commit 9b18b5f

37 files changed

Lines changed: 665 additions & 369 deletions

.gitignore

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11

22
rs-clob-client/
3+
rs-clob-client-v2-main/
34

45
/target/
56
**/target/
@@ -17,5 +18,10 @@ rs-clob-client/
1718

1819
*.local
1920
.env
21+
.env.e2e.*
22+
.e2e/
23+
e2e-output/
24+
e2e-*.log
25+
scripts/e2e.sh
2026

21-
CLAUDE.md
27+
CLAUDE.md

Cargo.lock

Lines changed: 103 additions & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ name = "polymarket"
1414
path = "src/main.rs"
1515

1616
[dependencies]
17-
polymarket-client-sdk = { version = "0.4", features = ["gamma", "data", "bridge", "clob", "ctf"] }
18-
alloy = { version = "1.6.3", default-features = false, features = ["providers", "sol-types", "contract", "reqwest", "reqwest-rustls-tls", "signer-local", "signers"] }
17+
polymarket_client_sdk_v2 = { version = "0.5.1", features = ["gamma", "data", "bridge", "clob", "ctf"] }
18+
alloy = { version = "1.6.3", default-features = false, features = ["providers", "rpc-types", "sol-types", "contract", "reqwest", "reqwest-rustls-tls", "signer-local", "signers"] }
1919
clap = { version = "4", features = ["derive"] }
2020
tokio = { version = "1", features = ["rt-multi-thread", "macros"] }
2121
serde_json = "1"

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -332,14 +332,14 @@ polymarket data builder-volume --period month
332332

333333
### Contract Approvals
334334

335-
Before trading, Polymarket contracts need ERC-20 (USDC) and ERC-1155 (CTF token) approvals.
335+
Before trading, Polymarket contracts need ERC-20 (pUSD) and ERC-1155 (CTF token) approvals.
336336

337337
```bash
338338
# Check current approvals (read-only)
339339
polymarket approve check
340340
polymarket approve check 0xSOME_ADDRESS
341341

342-
# Approve all contracts (sends 6 on-chain transactions, needs MATIC for gas)
342+
# Approve all contracts (sends on-chain transactions, needs MATIC for gas)
343343
polymarket approve set
344344
```
345345

@@ -348,10 +348,10 @@ polymarket approve set
348348
Split, merge, and redeem conditional tokens directly on-chain.
349349

350350
```bash
351-
# Split $10 USDC into YES/NO tokens
351+
# Split $10 pUSD into YES/NO tokens
352352
polymarket ctf split --condition 0xCONDITION... --amount 10
353353

354-
# Merge tokens back to USDC
354+
# Merge tokens back to pUSD
355355
polymarket ctf merge --condition 0xCONDITION... --amount 10
356356

357357
# Redeem winning tokens after resolution
@@ -366,7 +366,7 @@ polymarket ctf collection-id --condition 0xCONDITION... --index-set 1
366366
polymarket ctf position-id --collection 0xCOLLECTION...
367367
```
368368

369-
`--amount` is in USDC (e.g., `10` = $10). The `--partition` flag defaults to binary (`1,2`). On-chain operations require MATIC for gas on Polygon.
369+
`--amount` is in pUSD (e.g., `10` = $10). The `--partition` flag defaults to binary (`1,2`). On-chain operations require MATIC for gas on Polygon.
370370

371371
### Bridge
372372

0 commit comments

Comments
 (0)