Skip to content

Commit e2de61a

Browse files
docs: auto-update for v2.50.10
1 parent bc77cdd commit e2de61a

3 files changed

Lines changed: 39 additions & 57 deletions

File tree

docs/api-reference/openapi.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"info": {
44
"title": "PMXT Hosted API",
55
"description": "One API for every prediction market. Cross-venue search in under 10ms, a single unified schema, and the complete venue surface from reads to trades.",
6-
"version": "2.50.9"
6+
"version": "2.50.10"
77
},
88
"servers": [
99
{

docs/concepts/venues.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ description: "Every venue PMXT currently speaks."
77
AUTO-GENERATED from pmxt-core's openapi spec (ExchangeParam enum).
88
Do not edit by hand — run `npm run generate:mintlify` to regenerate.
99
Source: docs/api-reference/openapi.json
10-
pmxt-core version at last sync: 2.50.9
10+
pmxt-core version at last sync: 2.50.10
1111
*/}
1212

1313
PMXT Hosted currently supports the following venues. The **wire key** is

docs/llms-full.txt

Lines changed: 37 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ directly:
543543
order = poly.create_order(
544544
outcome=market.yes,
545545
side="buy",
546-
type="limit",
546+
order_type="limit",
547547
price=0.42,
548548
amount=100,
549549
)
@@ -1194,15 +1194,16 @@ In [self-hosted mode](https://pmxt.dev/docs/guides/self-hosted) — `POST /api/{
11941194

11951195
If you already have a venue-native id (e.g. a saved database of Polymarket `conditionId`s) and want the catalog UUID for cross-venue work:
11961196

1197-
```python
1198-
clusters = router.fetch_matched_market_clusters(
1199-
venue="polymarket",
1200-
venue_market_id="0xc704f74e2f9dfae70f770cb253ffadde10768eeab41233098bf5ac67995a94b5",
1201-
)
1202-
catalog_uuid = clusters[0].market_id
1197+
The SDK does not expose a single-shot `venue_market_id` -> catalog UUID kwarg today. For batch or one-off reverse lookups, query the catalog directly via `POST /v0/sql`:
1198+
1199+
```sql
1200+
SELECT market_id
1201+
FROM prediction_markets.markets
1202+
WHERE venue = 'polymarket'
1203+
AND venue_market_id = '0xc704f74e2f9dfae70f770cb253ffadde10768eeab41233098bf5ac67995a94b5';
12031204
```
12041205

1205-
For batch workflows, `POST /v0/sql` gives you direct access to `prediction_markets.markets` and `prediction_markets.outcomes` with the canonical UUID alongside the venue-native fields (`venue_market_id`, `venue_outcome_id` / `token_id`).
1206+
`prediction_markets.markets` and `prediction_markets.outcomes` carry the canonical UUID alongside the venue-native fields (`venue_market_id`, `venue_outcome_id` / `token_id`), so the same query shape covers outcomes too.
12061207

12071208
#### Examples (the two ids for one market)
12081209

@@ -1340,13 +1341,13 @@ After the deposit transaction confirms on-chain, the balance shows up in escrow.
13401341
```python Python
13411342
balances = client.fetch_balance()
13421343
usdc = balances[0]
1343-
print(f"Free: {usdc.free}, Used: {usdc.used}, Total: {usdc.total}")
1344+
print(f"Available: {usdc.available}, Locked: {usdc.locked}, Total: {usdc.total}")
13441345
```
13451346

13461347
```typescript TypeScript
13471348
const balances = await client.fetchBalance();
13481349
const usdc = balances[0];
1349-
console.log(`Free: ${usdc.free}, Used: ${usdc.used}, Total: ${usdc.total}`);
1350+
console.log(`Available: ${usdc.available}, Locked: ${usdc.locked}, Total: ${usdc.total}`);
13501351
```
13511352
</CodeGroup>
13521353

@@ -1513,10 +1514,10 @@ const order = await client.createOrder({
15131514
marketId: "2eeb03dc-404b-41d5-bc57-6aeb37927ae6",
15141515
outcomeId: "a114f052-1fd1-4bcd-b9cf-de019db81b67",
15151516
side: "buy",
1516-
orderType: "market",
1517+
type: "market",
15171518
amount: 5,
15181519
denom: "usdc",
1519-
slippagePct: 30,
1520+
slippage_pct: 30,
15201521
});
15211522
```
15221523
</CodeGroup>
@@ -1543,17 +1544,19 @@ Because reads don't require a signature, anyone with the `pmxt_api_key` can read
15431544

15441545
#### Advanced: bring your own signer
15451546

1546-
If your key lives in a hardware wallet, HSM, MPC service, or anything that isn't a raw hex private key, skip `private_key` and use the lower-level `build_order` / `submit_order` flow. Any object that implements `sign_typed_data(domain, types, message) -> hex` works.
1547+
If your key lives in a hardware wallet, HSM, MPC service, or anything that isn't a raw hex private key, skip `private_key` and inject a custom signer at construction. The SDK uses it transparently for every hosted write — you keep calling `create_order` as usual.
1548+
1549+
The signer protocol is one method: `sign_typed_data(typed_data: dict) -> hex` (Python) or `signTypedData(typedData): Promise<string>` plus a readonly `address` (TypeScript).
15471550

15481551
<CodeGroup>
15491552
```python Python
15501553
client = pmxt.Polymarket(
15511554
pmxt_api_key="pmxt_live_...",
15521555
wallet_address="0xYourWallet...",
1553-
# no private_key
1556+
signer=my_custom_signer, # exposes sign_typed_data(typed_data) -> hex
15541557
)
15551558

1556-
built = client.build_order(
1559+
order = client.create_order(
15571560
market_id="2eeb03dc-...",
15581561
outcome_id="a114f052-...",
15591562
side="buy",
@@ -1562,46 +1565,28 @@ amount=5.0,
15621565
denom="usdc",
15631566
slippage_pct=30.0,
15641567
)
1565-
1566-
typed_data = built.raw["typed_data"]
1567-
signature = my_custom_signer.sign_typed_data(
1568-
domain=typed_data["domain"],
1569-
types=typed_data["types"],
1570-
message=typed_data["message"],
1571-
)
1572-
built.signed_order = signature # attach signature for submit
1573-
order = client.submit_order(built)
15741568
```
15751569

15761570
```typescript TypeScript
15771571
const client = new Polymarket({
15781572
pmxtApiKey: "pmxt_live_...",
15791573
walletAddress: "0xYourWallet...",
1580-
// no privateKey
1574+
signer: myCustomSigner, // { address, signTypedData(typedData) -> Promise<hex> }
15811575
});
15821576

1583-
const built = await client.buildOrder({
1577+
const order = await client.createOrder({
15841578
marketId: "2eeb03dc-...",
15851579
outcomeId: "a114f052-...",
15861580
side: "buy",
1587-
orderType: "market",
1581+
type: "market",
15881582
amount: 5,
15891583
denom: "usdc",
1590-
slippagePct: 30,
1584+
slippage_pct: 30,
15911585
});
1592-
1593-
const typedData = built.raw.typed_data;
1594-
const signature = await myCustomSigner.signTypedData(
1595-
typedData.domain,
1596-
typedData.types,
1597-
typedData.message,
1598-
);
1599-
built.signedOrder = signature;
1600-
const order = await client.submitOrder(built);
16011586
```
16021587
</CodeGroup>
16031588

1604-
For Opinion, `built` carries two payloads (`typed_data` and `pull_typed_data`); sign both and pass `signature` + `pull_signature` to `submit_order`. The SDK's `EthAccountSigner` / `EthersSigner` are reference implementations of the signer protocol — ethers v6 supports Ledger out of the box; for MPC see Fireblocks / Privy / Turnkey docs.
1589+
For Opinion's dual-signature flow, the same injected signer is invoked twice (once per payload) — no extra wiring. The SDK's `EthAccountSigner` (Python) / `EthersSigner` (TypeScript) are reference implementations; ethers v6 supports Ledger out of the box, and for MPC see Fireblocks / Privy / Turnkey docs.
16051590

16061591
### Handling Hosted Errors
16071592

@@ -1757,12 +1742,12 @@ Hardware-wallet signing is the most common cause — Ledger confirmations can ta
17571742
```python Python
17581743
from pmxt._hosted_errors import BuiltOrderExpired
17591744

1760-
def submit_with_retry(client, *, market_id, outcome_id, **kwargs):
1745+
def submit_with_retry(client, **kwargs):
1746+
# In hosted mode, create_order handles build -> sign -> submit atomically.
1747+
# On BuiltOrderExpired the internal submit raced the 30s TTL; just call again.
17611748
for attempt in range(2):
1762-
built = client.build_order(market_id=market_id, outcome_id=outcome_id, **kwargs)
1763-
built.signed_order = signer.sign_typed_data(built.raw["typed_data"])
17641749
try:
1765-
return client.submit_order(built)
1750+
return client.create_order(**kwargs)
17661751
except BuiltOrderExpired:
17671752
if attempt == 1:
17681753
raise
@@ -1771,23 +1756,20 @@ for attempt in range(2):
17711756

17721757
```typescript TypeScript
17731758
import { BuiltOrderExpired } from "pmxtjs";
1759+
import type { CreateOrderParams, Order } from "pmxtjs";
17741760

1775-
async function submitWithRetry(client, params) {
1761+
async function submitWithRetry(client, params: CreateOrderParams): Promise<Order> {
1762+
// In hosted mode, createOrder handles build -> sign -> submit atomically.
1763+
// On BuiltOrderExpired the internal submit raced the 30s TTL; just call again.
17761764
for (let attempt = 0; attempt < 2; attempt++) {
1777-
const built = await client.buildOrder(params);
1778-
const typedData = built.raw.typed_data;
1779-
built.signedOrder = await signer.signTypedData(
1780-
typedData.domain,
1781-
typedData.types,
1782-
typedData.message,
1783-
);
17841765
try {
1785-
return await client.submitOrder(built);
1766+
return await client.createOrder(params);
17861767
} catch (e) {
17871768
if (e instanceof BuiltOrderExpired && attempt === 0) continue;
17881769
throw e;
17891770
}
17901771
}
1772+
throw new Error("unreachable");
17911773
}
17921774
```
17931775
</CodeGroup>
@@ -1817,7 +1799,7 @@ pass
18171799
import { NoLiquidity } from "pmxtjs";
18181800

18191801
try {
1820-
await client.createOrder({ orderType: "market", ... });
1802+
await client.createOrder({ type: "market", ... });
18211803
} catch (e) {
18221804
if (e instanceof NoLiquidity) {
18231805
// Wait, retry against a different outcome, or post limits via self-hosted.
@@ -2033,7 +2015,7 @@ poly = pmxt.Polymarket(private_key="0xYourPrivateKey...")
20332015
order = poly.create_order(
20342016
outcome=market.yes,
20352017
side="buy",
2036-
type="limit",
2018+
order_type="limit",
20372019
price=0.42,
20382020
amount=100,
20392021
)
@@ -3073,7 +3055,7 @@ poly = pmxt.Polymarket(private_key="0x...")
30733055
clusters = router.fetch_matched_market_clusters(relation="identity", limit=20)
30743056

30753057
# 2. Inspect the order book on a specific venue
3076-
book = poly.fetch_order_book(market_id=clusters[0].markets[0].market_id)
3058+
book = poly.fetch_order_book(outcome_id=clusters[0].markets[0].outcomes[0].outcome_id)
30773059

30783060
# 3. Place an order locally (never proxied through PMXT)
30793061
# poly.create_order(...)
@@ -3969,7 +3951,7 @@ main();
39693951
Source: https://pmxt.dev/docs/api-reference/fetch-ohlcv
39703952

39713953
> **Note:**
3972-
**More data with an API key** — Without an API key, OHLCV is limited to Polymarket's native API: short history windows, no volume, and venue-specific rate limits. With a PMXT API key you get volume, 1+ years of history, and normalized candles across venues. Kalshi, Limitless, and more are coming soon. [Get your API key](https://pmxt.dev/docs/dashboard).
3954+
**More data with an API key** — Without an API key, OHLCV is limited to Polymarket's native API: short history windows, no volume, and venue-specific rate limits. With a PMXT API key you get volume, 1+ years of history, and normalized candles across venues. Kalshi, Limitless, and more are coming soon. [Get your API key](https://pmxt.dev/dashboard).
39733955

39743956

39753957
#### Use cases

0 commit comments

Comments
 (0)