Commit ffd74f7
feat(polymarket): CLOB V2 migration — hard-cut to V2 contracts and EIP-712 struct
Implements full Polymarket CLOB V2 cutover (go-live 2026-04-28 ~11:00 UTC):
- EIP-712 Order struct: drop taker/nonce/feeRateBps/expiration from signed types;
add timestamp(uint256 ms), metadata(bytes32), builder(bytes32)
- Domain version '1' → '2' (mainnet only; Amoy testnet keeps '1' for V1 contracts)
- V2 mainnet exchange/negRiskExchange contracts + pUSD/usdce/onramp/offramp addresses
- expiration kept in POST /order wire body only (excluded from signed struct per V2 spec)
- feeSchedule parsing from Gamma market payload (Mar 31 2026 change)
- Keyset cursor pagination in fetchMarkets/fetchOrders/fetchTrades (Apr 10 2026)
- wrapCollateral(): thin helper to wrap USDC.e → pUSD via CollateralOnramp.wrap()
- builderCode bytes32 pass-through + length validation (66 chars, 0x-prefixed)
- getSignatureType(): honour caller params.signatureType/signature_type override
- Fix extend() order in fetchOrders/fetchTrades so loop cursor wins over params
- salt = orderTimestamp (unified from separate milliseconds() calls)
- pro/polymarket.ts: declare missing marketUpdates property
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 6e1d536 commit ffd74f7
5 files changed
Lines changed: 258 additions & 131 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| 18 | + | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
| |||
0 commit comments