docs: daily sync Polymarket docs 2026-06-16 - 118 files updated

This commit is contained in:
Etherdrake
2026-06-16 14:13:28 +02:00
parent 46bcbfdd05
commit 72269f5586
122 changed files with 307 additions and 21200 deletions
+117 -43
View File
@@ -517,16 +517,23 @@ async with await AsyncSecureClient.create(
Create a secure client when you need wallet-scoped reads or trading.
<Note>
Secure clients own multiple network transports. Wrap them in `async with`,
or call `await secure_client.close()` when you are done, to release the
underlying connections. The snippets below show client creation and
subsequent calls as a flat sequence for readability — in real code, keep
the client inside an `async with` block or close it explicitly.
Secure clients own multiple network transports. Wrap them in `async with`, or
call `await secure_client.close()` when you are done, to release the
underlying connections. The snippets below show client creation and subsequent
calls as a flat sequence for readability — in real code, keep the client
inside an `async with` block or close it explicitly.
</Note>
### Private Key Setup
The Python SDK authenticates with a local private key. Pass `wallet` when you want to operate on a Polymarket wallet address that differs from the signer address; if omitted, the client uses the signer address as the account wallet.
The Python SDK authenticates with a local private key. By default,
`AsyncSecureClient.create` uses the signer's deterministic Deposit Wallet as the
account wallet. Pass `wallet` when you want to authenticate an existing wallet,
such as an existing Deposit Wallet, Poly Safe, Poly Proxy, or the signer address
itself for EOA trading.
The examples below pass `wallet` to make account selection explicit. Omit
`wallet` to use the default Deposit Wallet flow.
```python theme={null}
import os
@@ -543,9 +550,10 @@ async with await AsyncSecureClient.create(
Keep private keys and API credentials in your secret manager or local environment. Do not commit them to source control.
### API Key Authentication
### API Key Authorization
Configure an API key when the SDK needs to set up gasless wallet operations.
Configure API key authorization when the SDK needs to deploy a Deposit Wallet or
submit approval transactions.
<CodeGroup>
```python Relayer API Key theme={null}
@@ -584,51 +592,32 @@ Configure an API key when the SDK needs to set up gasless wallet operations.
<Note>
Builder API keys are supported for backwards compatibility with builders that
still use them for gasless workflows. They are not used for order attribution.
still use them for wallet operations. They are not used for order attribution.
Use `builder_code` on orders for attribution.
</Note>
### Trading Setup
Before placing orders, make sure the authenticated wallet has the required trading approvals. If you use gasless wallet operations, configure API key authentication first.
Before placing orders, make sure the authenticated wallet is deployed and has
the required trading approvals. `AsyncSecureClient.create` resolves the signer's
deterministic Deposit Wallet by default and deploys it if needed.
<Note>
From this point forward, snippets in Trading Setup, Trading, Position
Lifecycle, and Wallet Operations submit real on-chain transactions or
live orders against the configured environment when executed. Review
each call before running it against a wallet that holds funds.
Lifecycle, and Wallet Operations submit real on-chain transactions or live
orders against the configured environment when executed. Review each call
before running it against a wallet that holds funds.
</Note>
<Steps>
<Step title="Check Gasless Readiness">
Optionally check whether the deposit wallet for the authenticated EOA is already deployed. The result is informational — call `setup_gasless_wallet()` in the next step regardless, since it is idempotent on deployment and is the call that binds the client to the deposit wallet.
Set up the approvals required for trading.
```python theme={null}
is_gasless_ready = await secure_client.is_gasless_ready()
```
</Step>
```python theme={null}
await secure_client.setup_trading_approvals()
```
<Step title="Set Up Gasless Wallet">
Always call `setup_gasless_wallet()` for gasless workflows. It deploys the deposit wallet if needed and returns a new client bound to the deposit wallet address. Close the previous client when you replace it.
```python theme={null}
gasless_client = await secure_client.setup_gasless_wallet()
await secure_client.close()
secure_client = gasless_client
```
</Step>
<Step title="Set Up Trading Approvals">
Set up the approvals required for trading and wait for the setup transaction to complete.
```python theme={null}
handle = await secure_client.setup_trading_approvals()
outcome = await handle.wait()
# outcome.transaction_hash: TransactionHash
```
</Step>
</Steps>
`setup_trading_approvals()` waits for the setup transaction internally and is
idempotent. If the wallet already has the required approvals, it returns without
submitting a transaction.
### Trading
@@ -828,7 +817,11 @@ Create signed orders separately when you want to review, store, or batch them be
### Position Lifecycle
Use position lifecycle methods to split collateral into outcome tokens, merge complete sets back into collateral, or redeem resolved positions. These examples assume the secure client is configured with API key authentication as shown in [API Key Authentication](#api-key-authentication).
Use position lifecycle methods to split collateral into outcome tokens, merge
complete sets back into collateral, or redeem resolved positions. These examples
assume the secure client is configured with API key authorization as shown in
[API Key Authorization](#api-key-authorization), and that you set up trading
approvals as shown above.
<Tabs>
<Tab title="Split Position">
@@ -880,7 +873,10 @@ Use position lifecycle methods to split collateral into outcome tokens, merge co
### Wallet Operations
Use wallet operation methods for direct token movements from the authenticated wallet. Amounts are in base units. These examples assume the secure client is configured with API key authentication as shown in [API Key Authentication](#api-key-authentication).
Use wallet operation methods for direct token movements from the authenticated
wallet. Amounts are in base units. These examples assume the secure client is
configured with API key authorization as shown in [API Key
Authorization](#api-key-authorization).
```python theme={null}
import os
@@ -1103,3 +1099,81 @@ Secure clients expose the API credentials created for the authenticated session.
```
</Tab>
</Tabs>
## Changelog
### `0.1.0b7`
* Point Combos RFQ endpoints at the production domains: `combos-rfq-api.polymarket.com` (REST) and `combos-rfq-gateway-quoter.polymarket.com` (quoter WebSocket).
### `0.1.0b6`
* Added `list_combo_markets` for fetching the Combo market catalog with SDK pagination. See [Combos](/market-makers/combos).
* Parse RFQ quote rejections that use the `SUBMISSION_WINDOW_CLOSED` gateway error code.
### `0.1.0b5`
* Added Combos support for multi-leg RFQ positions. See [Combos](/market-makers/combos).
* Added notebook-friendly model display for Jupyter workflows.
* `ConditionId` is now deprecated in favor of `CtfConditionId`; existing
`ConditionId` exports remain available as deprecated aliases.
### `0.1.0b4`
* Added dataframe conversion support for SDK models and response collections.
**Secure client setup now defaults to the Deposit Wallet flow**
`AsyncSecureClient.create` can now derive and use the signer's deterministic
Deposit Wallet when you omit `wallet`. If you already know which Polymarket
wallet you want to use, keep passing `wallet`.
```diff theme={null}
secure_client = await AsyncSecureClient.create(
private_key=os.environ["POLYMARKET_PRIVATE_KEY"],
- wallet=os.environ["POLYMARKET_WALLET_ADDRESS"],
)
```
If you want to keep account selection explicit, no change is required:
```python theme={null}
secure_client = await AsyncSecureClient.create(
private_key=os.environ["POLYMARKET_PRIVATE_KEY"],
wallet=os.environ["POLYMARKET_WALLET_ADDRESS"],
)
```
**`setup_trading_approvals()` now waits internally**
You no longer need to wait on the returned handle. Call the method once before
trading; it is safe to call again if approvals are already set.
```diff theme={null}
-handle = await secure_client.setup_trading_approvals()
-await handle.wait()
+await secure_client.setup_trading_approvals()
```
**Gasless setup helpers are deprecated**
You no longer need to call `is_gasless_ready()` or `setup_gasless_wallet()` in
the normal setup path. Create the secure client, then set up trading approvals.
```diff theme={null}
-ready = await secure_client.is_gasless_ready()
-
-if not ready:
- secure_client = await secure_client.setup_gasless_wallet()
-
await secure_client.setup_trading_approvals()
```
### `0.1.0b1`
First beta release of the unified Python SDK. Install the beta package with your
package manager:
```bash theme={null}
uv add polymarket-client
```
+108 -31
View File
@@ -404,7 +404,7 @@ Use discovery methods to browse events, markets, teams, tags, comments, sports m
});
const userComments = client.listCommentsByUserAddress({
address: "0x1234...",
address: "0x1234",
pageSize: 10,
order: "DESC",
});
@@ -473,6 +473,15 @@ for await (const event of stream) {
Create a secure client when you need wallet-scoped reads or trading.
By default, `createSecureClient` uses the signer's deterministic Deposit Wallet
as the account wallet. The SDK deploys that wallet if needed during client
creation. Pass `wallet` only when you want to authenticate an existing wallet,
such as an existing Deposit Wallet, Poly Safe, Poly Proxy, or the signer address
itself for EOA trading.
The examples below pass `wallet` to make account selection explicit. Omit
`wallet` to use the default Deposit Wallet flow.
### Wallet Integrations
The SDK is intended to support a variety of wallet libraries. At launch, we support [Viem](https://viem.sh), [Privy](https://www.privy.io/docs), and [Ethers v5](https://docs.ethers.org/v5/). We will expand support for more libraries based on demand.
@@ -595,17 +604,20 @@ The SDK is intended to support a variety of wallet libraries. At launch, we supp
### Trading Setup
Before placing orders, configure API key authentication if you need gasless wallet setup, then make sure the authenticated wallet has the required trading approvals.
Before placing orders, make sure the authenticated wallet is deployed and has
the required trading approvals. `createSecureClient` resolves the signer's
deterministic Deposit Wallet by default and deploys it if needed.
<Steps>
<Step title="Configure API Key Authentication">
Configure an API key when the SDK needs to set up gasless wallet operations.
<Step title="Configure API Key Authorization">
Configure API key authorization when the SDK needs to deploy a Deposit Wallet or
submit approval transactions.
<CodeGroup>
```ts Relayer API Key theme={null}
import { createSecureClient, relayerApiKey } from "@polymarket/client";
let secureClient = await createSecureClient({
const secureClient = await createSecureClient({
wallet: "YOUR_POLYMARKET_WALLET_ADDRESS",
signer,
apiKey: relayerApiKey({
@@ -619,7 +631,7 @@ Before placing orders, configure API key authentication if you need gasless wall
import { createSecureClient } from "@polymarket/client";
import { builderApiKey } from "@polymarket/client/node";
let secureClient = await createSecureClient({
const secureClient = await createSecureClient({
wallet: "YOUR_POLYMARKET_WALLET_ADDRESS",
signer,
apiKey: builderApiKey({
@@ -633,36 +645,21 @@ Before placing orders, configure API key authentication if you need gasless wall
<Note>
Builder API keys are supported for backwards compatibility with builders that
still use them for gasless workflows. They are not used for order attribution.
still use them for wallet operations. They are not used for order attribution.
Use `builderCode` on orders for attribution.
</Note>
</Step>
<Step title="Check Gasless Readiness">
Check whether the authenticated wallet is already ready for gasless transactions.
```ts theme={null}
const isGaslessReady = await secureClient.isGaslessReady();
```
</Step>
<Step title="Set Up Gasless Wallet">
If needed, set up the gasless wallet and continue with the returned secure client.
```ts theme={null}
if (!isGaslessReady) {
secureClient = await secureClient.setupGaslessWallet();
}
```
</Step>
<Step title="Set Up Trading Approvals">
Set up the approvals required for trading and wait for the setup transaction to complete.
Then set up trading approvals.
```ts theme={null}
const handle = await secureClient.setupTradingApprovals();
await handle.wait();
await secureClient.setupTradingApprovals();
```
`setupTradingApprovals()` waits for the setup transaction internally and is
idempotent. If the wallet already has the required approvals, it returns without
submitting a transaction.
</Step>
</Steps>
@@ -766,7 +763,7 @@ Order placement returns a discriminated response. Check `response.ok` before rea
side: OrderSide.BUY,
price: 0.52,
size: 10,
builderCode: "0xabc123...",
builderCode: "0xabc123",
});
if (response.ok) {
@@ -840,7 +837,9 @@ Create signed orders separately when you want to review, store, or batch them be
### Position Lifecycle
Use position lifecycle methods to split collateral into outcome tokens, merge complete sets back into collateral, or redeem resolved positions. These examples assume the secure client is configured with API key authentication as shown in [Trading Setup](#trading-setup).
Use position lifecycle methods to split collateral into outcome tokens, merge
complete sets back into collateral, or redeem resolved positions. These examples
assume you created a secure client and set up trading approvals as shown above.
<Tabs>
<Tab title="Split Position">
@@ -884,7 +883,8 @@ Use position lifecycle methods to split collateral into outcome tokens, merge co
### Wallet Operations
Use wallet operation methods for direct token movements from the authenticated wallet. These examples assume the secure client is configured with API key authentication as shown in [Trading Setup](#trading-setup).
Use wallet operation methods for direct token movements from the authenticated
wallet. These examples assume you created a secure client as shown above.
```ts theme={null}
const handle = await secureClient.transferErc20({
@@ -1100,3 +1100,80 @@ Secure clients expose the API credentials created for the authenticated session.
```
</Tab>
</Tabs>
## Changelog
### `0.1.0-beta.6`
* Point Combos RFQ endpoints at the production domains: `combos-rfq-api.polymarket.com` (REST) and `combos-rfq-gateway-quoter.polymarket.com` (quoter WebSocket).
### `0.1.0-beta.5`
* Added `listComboMarkets` for fetching the Combo market catalog with typed bindings and SDK-owned pagination. See [Combos](/market-makers/combos).
* Parse RFQ quote rejections that use the `SUBMISSION_WINDOW_CLOSED` gateway error code.
### `0.1.0-beta.4`
* Added Combos support for multi-leg RFQ positions. See [Combos](/market-makers/combos).
* Reject whitespace-only search queries and trim leading or trailing search input.
* `ConditionId` is now deprecated in favor of `CtfConditionId`; existing
`ConditionId` exports remain available as deprecated aliases.
### `0.1.0-beta.3`
**Secure client setup now defaults to the Deposit Wallet flow**
`createSecureClient` can now derive and use the signer's deterministic Deposit
Wallet when you omit `wallet`. If you already know which Polymarket wallet you
want to use, keep passing `wallet`.
```diff theme={null}
const secureClient = await createSecureClient({
- wallet: "YOUR_POLYMARKET_WALLET_ADDRESS",
signer,
});
```
If you want to keep account selection explicit, no change is required:
```ts theme={null}
const secureClient = await createSecureClient({
wallet: "YOUR_POLYMARKET_WALLET_ADDRESS",
signer,
});
```
**`setupTradingApprovals()` now waits internally**
You no longer need to wait on the returned handle. Call the method once before
trading; it is safe to call again if approvals are already set.
```diff theme={null}
-const handle = await secureClient.setupTradingApprovals();
-await handle.wait();
+await secureClient.setupTradingApprovals();
```
**Gasless setup helpers are deprecated**
You no longer need to call `isGaslessReady()` or `setupGaslessWallet()` in the
normal setup path. Create the secure client, then set up trading approvals.
```diff theme={null}
-const ready = await secureClient.isGaslessReady();
-
-if (!ready) {
- secureClient = await secureClient.setupGaslessWallet();
-}
-
await secureClient.setupTradingApprovals();
```
### `0.1.0-beta.2`
First beta release of the unified TypeScript SDK. Install the beta package with
your package manager:
```bash theme={null}
pnpm add @polymarket/client@beta
```