docs: sync with docs.polymarket.com - 2026-05-08

This commit is contained in:
Etherdrake
2026-05-08 14:59:53 +02:00
parent 2ac62926d8
commit a61457d6fa
227 changed files with 374 additions and 20740 deletions
+19 -15
View File
@@ -266,14 +266,15 @@ The `POLY_SIGNATURE` for L2 is an HMAC-SHA256 signature created using the user's
const account = privateKeyToAccount(process.env.PRIVATE_KEY as `0x${string}`); const account = privateKeyToAccount(process.env.PRIVATE_KEY as `0x${string}`);
const signer = createWalletClient({ account, transport: http() }); const signer = createWalletClient({ account, transport: http() });
const depositWalletAddress = process.env.DEPOSIT_WALLET_ADDRESS!;
const client = new ClobClient({ const client = new ClobClient({
host: "https://clob.polymarket.com", host: "https://clob.polymarket.com",
chain: 137, chain: 137,
signer, signer,
creds: apiCreds, // Generated from L1 auth, API credentials enable L2 methods creds: apiCreds, // Generated from L1 auth, API credentials enable L2 methods
signatureType: 1, // signatureType explained below signatureType: 3, // POLY_1271, explained below
funderAddress, // funder explained below funderAddress: depositWalletAddress, // deposit wallet funder
}); });
// Now you can trade! // Now you can trade!
@@ -295,8 +296,8 @@ The `POLY_SIGNATURE` for L2 is an HMAC-SHA256 signature created using the user's
chain_id=137, chain_id=137,
key=os.getenv("PRIVATE_KEY"), key=os.getenv("PRIVATE_KEY"),
creds=api_creds, # Generated from L1 auth, API credentials enable L2 methods creds=api_creds, # Generated from L1 auth, API credentials enable L2 methods
signature_type=1, # signatureType explained below signature_type=3, # POLY_1271, explained below
funder=os.getenv("FUNDER_ADDRESS") # funder explained below funder=os.getenv("DEPOSIT_WALLET_ADDRESS")
) )
# Now you can trade! # Now you can trade!
@@ -312,10 +313,12 @@ The `POLY_SIGNATURE` for L2 is an HMAC-SHA256 signature created using the user's
use polymarket_client_sdk_v2::clob::types::{Side, SignatureType}; use polymarket_client_sdk_v2::clob::types::{Side, SignatureType};
use polymarket_client_sdk_v2::types::dec; use polymarket_client_sdk_v2::types::dec;
let deposit_wallet = std::env::var("DEPOSIT_WALLET_ADDRESS")?.parse()?;
let client = Client::new("https://clob.polymarket.com", Config::default())? let client = Client::new("https://clob.polymarket.com", Config::default())?
.authentication_builder(&signer) .authentication_builder(&signer)
.signature_type(SignatureType::Proxy) // signatureType explained below .funder(deposit_wallet)
// Funder auto-derived via CREATE2 for Proxy/GnosisSafe .signature_type(SignatureType::Poly1271)
.authenticate() .authenticate()
.await?; .await?;
@@ -343,17 +346,18 @@ The `POLY_SIGNATURE` for L2 is an HMAC-SHA256 signature created using the user's
When initializing the L2 client, you must specify your wallet **signatureType** and the **funder** address which holds the funds: When initializing the L2 client, you must specify your wallet **signatureType** and the **funder** address which holds the funds:
| Signature Type | Value | Description | | Signature Type | Value | Description |
| -------------- | ----- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | -------------- | ----- | -------------------------------------------------------------------------------------------------------------------------- |
| EOA | `0` | Standard Ethereum wallet (MetaMask). Funder is the EOA address and will need POL to pay gas on transactions. | | EOA | `0` | Standard Ethereum wallet (MetaMask). Funder is the EOA address and will need POL to pay gas on transactions. |
| POLY\_PROXY | `1` | A custom proxy wallet only used with users who logged in via Magic Link email/Google. Using this requires the user to have exported their PK from Polymarket.com and imported into your app. | | POLY\_PROXY | `1` | Existing Polymarket proxy wallet flow, commonly used by users who logged in via Magic Link email/Google. |
| GNOSIS\_SAFE | `2` | Gnosis Safe multisig proxy wallet (most common). Use this for any new or returning user who does not fit the other 2 types. | | GNOSIS\_SAFE | `2` | Existing Gnosis Safe wallet flow. Existing Safe users can continue using this type. |
| POLY\_1271 | `3` | Deposit wallet flow for new API users. The funder is the deposit wallet address and orders are validated through ERC-1271. |
<Tip> <Tip>
The wallet address displayed to the user on Polymarket.com is the proxy wallet New API users should use deposit wallets with `POLY_1271`. Existing Safe and
and should be used as the funder. These can be deterministically derived or Proxy users are unaffected and can keep using their current funder address and
you can deploy them on behalf of the user. These proxy wallets are signature type. See the [Deposit Wallet Guide](/trading/deposit-wallets) for
automatically deployed for the user on their first login to Polymarket.com. setup details.
</Tip> </Tip>
*** ***
@@ -106,4 +106,4 @@ components:
pattern: ^0x[a-fA-F0-9]{40}$ pattern: ^0x[a-fA-F0-9]{40}$
example: '0x56687bf447db6ffa42ffe2204a05edaa20f55839' example: '0x56687bf447db6ffa42ffe2204a05edaa20f55839'
```` ````
@@ -132,4 +132,4 @@ components:
pattern: ^0x[a-fA-F0-9]{40}$ pattern: ^0x[a-fA-F0-9]{40}$
example: '0x56687bf447db6ffa42ffe2204a05edaa20f55839' example: '0x56687bf447db6ffa42ffe2204a05edaa20f55839'
```` ````
+1 -1
View File
@@ -221,4 +221,4 @@ components:
description: Impact cost of the transaction description: Impact cost of the transaction
example: 0 example: 0
```` ````
@@ -96,4 +96,4 @@ components:
description: Token decimals description: Token decimals
example: 6 example: 6
```` ````
@@ -151,4 +151,4 @@ components:
when status is DEPOSIT_DETECTED) when status is DEPOSIT_DETECTED)
example: 1757531217339 example: 1757531217339
```` ````
@@ -113,4 +113,4 @@ components:
required: required:
- error - error
```` ````
@@ -102,4 +102,4 @@ components:
required: required:
- error - error
```` ````
+3 -1
View File
@@ -77,7 +77,9 @@ Each repository includes working examples in the `/examples` directory.
## Relayer SDK ## Relayer SDK
For [gasless transactions](/trading/gasless) using proxy wallets, the relayer client handles submitting transactions through Polymarket's relayer: For [gasless transactions](/trading/gasless), the relayer client handles deposit
wallet creation and signed wallet batches for new API users. Existing Safe and
Proxy wallet flows remain supported.
| Language | Package | Repository | | Language | Package | Repository |
| ---------- | ------------------------------------ | ---------------------------------------------------------------------------------------------------------- | | ---------- | ------------------------------------ | ---------------------------------------------------------------------------------------------------------- |
@@ -209,4 +209,4 @@ components:
type: string type: string
nullable: true nullable: true
```` ````
@@ -234,4 +234,4 @@ components:
type: string type: string
nullable: true nullable: true
```` ````
+1 -1
View File
@@ -248,4 +248,4 @@ components:
type: string type: string
nullable: true nullable: true
```` ````
@@ -191,4 +191,4 @@ components:
required: required:
- error - error
```` ````
@@ -218,4 +218,4 @@ components:
required: required:
- error - error
```` ````
@@ -190,4 +190,4 @@ components:
outcomeIndex: outcomeIndex:
type: integer type: integer
```` ````
@@ -137,4 +137,4 @@ components:
pattern: ^0x[a-fA-F0-9]{40}$ pattern: ^0x[a-fA-F0-9]{40}$
example: '0x56687bf447db6ffa42ffe2204a05edaa20f55839' example: '0x56687bf447db6ffa42ffe2204a05edaa20f55839'
```` ````
@@ -94,4 +94,4 @@ components:
required: required:
- error - error
```` ````
@@ -158,4 +158,4 @@ components:
required: required:
- error - error
```` ````
@@ -190,4 +190,4 @@ components:
required: required:
- error - error
```` ````
+1 -1
View File
@@ -229,4 +229,4 @@ components:
required: required:
- error - error
```` ````
@@ -1 +1 @@
null null
@@ -102,4 +102,4 @@ components:
type: string type: string
description: Error message description: Error message
```` ````
+1 -1
View File
@@ -78,4 +78,4 @@ components:
type: string type: string
description: Error message description: Error message
```` ````
+1 -1
View File
@@ -1210,4 +1210,4 @@ components:
type: number type: number
nullable: true nullable: true
```` ````
@@ -1210,4 +1210,4 @@ components:
type: number type: number
nullable: true nullable: true
```` ````
+1 -1
View File
@@ -105,4 +105,4 @@ components:
type: boolean type: boolean
nullable: true nullable: true
```` ````
@@ -1468,4 +1468,4 @@ components:
type: number type: number
nullable: true nullable: true
```` ````
+1 -1
View File
@@ -1320,4 +1320,4 @@ components:
type: number type: number
nullable: true nullable: true
```` ````
@@ -1 +1 @@
null null
@@ -112,4 +112,4 @@ components:
type: string type: string
description: Error message description: Error message
```` ````
@@ -115,4 +115,4 @@ components:
type: string type: string
description: Error message description: Error message
```` ````
@@ -111,4 +111,4 @@ components:
type: string type: string
description: Error message description: Error message
```` ````
@@ -131,4 +131,4 @@ components:
type: string type: string
description: Error message description: Error message
```` ````
@@ -148,4 +148,4 @@ components:
type: string type: string
description: Error message description: Error message
```` ````
@@ -130,4 +130,4 @@ components:
type: string type: string
description: Error message description: Error message
```` ````
@@ -127,4 +127,4 @@ components:
type: string type: string
description: Error message description: Error message
```` ````
@@ -142,4 +142,4 @@ components:
type: string type: string
description: Error message description: Error message
```` ````
@@ -101,4 +101,4 @@ components:
type: string type: string
description: Error message description: Error message
```` ````
@@ -120,4 +120,4 @@ components:
type: string type: string
description: Error message description: Error message
```` ````
@@ -190,4 +190,4 @@ components:
description: Order size description: Order size
example: '100' example: '100'
```` ````
@@ -190,4 +190,4 @@ components:
description: Order size description: Order size
example: '100' example: '100'
```` ````
+1 -1
View File
@@ -100,4 +100,4 @@ components:
type: string type: string
description: Error message description: Error message
```` ````
@@ -118,4 +118,4 @@ components:
type: string type: string
description: Error message description: Error message
```` ````
@@ -112,4 +112,4 @@ components:
type: string type: string
description: Error message description: Error message
```` ````
@@ -116,4 +116,4 @@ components:
type: string type: string
description: Error message description: Error message
```` ````
@@ -135,4 +135,4 @@ components:
type: number type: number
format: float format: float
```` ````
@@ -1206,4 +1206,4 @@ components:
type: string type: string
nullable: true nullable: true
```` ````
@@ -1206,4 +1206,4 @@ components:
type: string type: string
nullable: true nullable: true
```` ````
@@ -105,4 +105,4 @@ components:
type: boolean type: boolean
nullable: true nullable: true
```` ````
@@ -134,4 +134,4 @@ components:
type: number type: number
format: float format: float
```` ````
@@ -180,4 +180,4 @@ components:
winner: winner:
type: boolean type: boolean
```` ````
@@ -127,4 +127,4 @@ components:
winner: winner:
type: boolean type: boolean
```` ````
@@ -127,4 +127,4 @@ components:
winner: winner:
type: boolean type: boolean
```` ````
@@ -1422,4 +1422,4 @@ components:
type: string type: string
nullable: true nullable: true
```` ````
+1 -1
View File
@@ -1333,4 +1333,4 @@ components:
type: string type: string
nullable: true nullable: true
```` ````
@@ -74,4 +74,4 @@ components:
required: required:
- error - error
```` ````
@@ -91,4 +91,4 @@ components:
pattern: ^0x[a-fA-F0-9]{64}$ pattern: ^0x[a-fA-F0-9]{64}$
example: '0xdd22472e552920b8438158ea7238bfadfa4f736aa4cee91a6b86c39ead110917' example: '0xdd22472e552920b8438158ea7238bfadfa4f736aa4cee91a6b86c39ead110917'
```` ````
+1 -1
View File
@@ -84,4 +84,4 @@ components:
required: required:
- error - error
```` ````
@@ -85,4 +85,4 @@ components:
required: required:
- error - error
```` ````
@@ -1 +1 @@
null null
@@ -1 +1 @@
null null
@@ -1 +1 @@
null null
@@ -1 +1 @@
null null
@@ -1 +1 @@
null null
@@ -1 +1 @@
null null
@@ -1 +1 @@
null null
@@ -151,4 +151,4 @@ components:
type: boolean type: boolean
description: Whether the user is a moderator description: Whether the user is a moderator
```` ````
@@ -155,4 +155,4 @@ components:
type: string type: string
description: Error message description: Error message
```` ````
@@ -136,4 +136,4 @@ components:
required: required:
- error - error
```` ````
@@ -103,4 +103,4 @@ components:
required: required:
- error - error
```` ````
@@ -205,4 +205,4 @@ components:
pattern: ^0x[a-fA-F0-9]{40}$ pattern: ^0x[a-fA-F0-9]{40}$
example: '0x6e0c80c90ea6c15917308F820Eac91Ce2724B5b5' example: '0x6e0c80c90ea6c15917308F820Eac91Ce2724B5b5'
```` ````
@@ -118,4 +118,4 @@ components:
required: required:
- error - error
```` ````
@@ -266,4 +266,4 @@ components:
required: required:
- error - error
```` ````
@@ -123,4 +123,4 @@ components:
required: required:
- error - error
```` ````
@@ -293,4 +293,4 @@ components:
description: Refund receiver address description: Refund receiver address
example: '0x0000000000000000000000000000000000000000' example: '0x0000000000000000000000000000000000000000'
```` ````
@@ -224,4 +224,4 @@ components:
- start_date - start_date
- rate_per_day - rate_per_day
```` ````
@@ -255,4 +255,4 @@ components:
name: POLY_TIMESTAMP name: POLY_TIMESTAMP
description: Unix timestamp of the request description: Unix timestamp of the request
```` ````
@@ -404,4 +404,4 @@ components:
- start_date - start_date
- rate_per_day - rate_per_day
```` ````
@@ -284,4 +284,4 @@ components:
- start_date - start_date
- rate_per_day - rate_per_day
```` ````
@@ -172,4 +172,4 @@ components:
name: POLY_TIMESTAMP name: POLY_TIMESTAMP
description: Unix timestamp of the request description: Unix timestamp of the request
```` ````
@@ -217,4 +217,4 @@ components:
name: POLY_TIMESTAMP name: POLY_TIMESTAMP
description: Unix timestamp of the request description: Unix timestamp of the request
```` ````
@@ -494,4 +494,4 @@ components:
name: POLY_TIMESTAMP name: POLY_TIMESTAMP
description: Unix timestamp of the request description: Unix timestamp of the request
```` ````
@@ -1364,4 +1364,4 @@ components:
type: number type: number
nullable: true nullable: true
```` ````
@@ -1206,4 +1206,4 @@ components:
type: number type: number
nullable: true nullable: true
```` ````
+1 -1
View File
@@ -1256,4 +1256,4 @@ components:
type: number type: number
nullable: true nullable: true
```` ````
@@ -87,4 +87,4 @@ components:
Series identifier linking the sport to a specific tournament or Series identifier linking the sport to a specific tournament or
season series season series
```` ````
@@ -62,4 +62,4 @@ components:
items: items:
type: string type: string
```` ````
+1 -1
View File
@@ -134,4 +134,4 @@ components:
format: date-time format: date-time
nullable: true nullable: true
```` ````
@@ -1 +1 @@
null null
@@ -91,4 +91,4 @@ components:
type: integer type: integer
nullable: true nullable: true
```` ````
@@ -91,4 +91,4 @@ components:
type: integer type: integer
nullable: true nullable: true
```` ````
+1 -1
View File
@@ -106,4 +106,4 @@ components:
type: boolean type: boolean
nullable: true nullable: true
```` ````
+1 -1
View File
@@ -106,4 +106,4 @@ components:
type: boolean type: boolean
nullable: true nullable: true
```` ````
@@ -114,4 +114,4 @@ components:
type: boolean type: boolean
nullable: true nullable: true
```` ````
@@ -114,4 +114,4 @@ components:
type: boolean type: boolean
nullable: true nullable: true
```` ````
+1 -1
View File
@@ -130,4 +130,4 @@ components:
type: boolean type: boolean
nullable: true nullable: true
```` ````
@@ -167,4 +167,4 @@ components:
name: POLY_TIMESTAMP name: POLY_TIMESTAMP
description: Unix timestamp of the request description: Unix timestamp of the request
```` ````
@@ -207,4 +207,4 @@ components:
name: POLY_TIMESTAMP name: POLY_TIMESTAMP
description: Unix timestamp of the request description: Unix timestamp of the request
```` ````
@@ -202,4 +202,4 @@ components:
name: POLY_TIMESTAMP name: POLY_TIMESTAMP
description: Unix timestamp of the request description: Unix timestamp of the request
```` ````
@@ -191,4 +191,4 @@ components:
name: POLY_TIMESTAMP name: POLY_TIMESTAMP
description: Unix timestamp of the request description: Unix timestamp of the request
```` ````

Some files were not shown because too many files have changed in this diff Show More