You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: sdks/python/API_REFERENCE.md
+47-16Lines changed: 47 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1443,6 +1443,25 @@ for pos in positions:
1443
1443
1444
1444
## Data Models
1445
1445
1446
+
### `ExchangeOptions`
1447
+
1448
+
Constructor-level options for venue clients (Polymarket, Kalshi, Opinion, etc.).
1449
+
Hosted mode is the default when pmxtApiKey is set; otherwise the SDK runs against
1450
+
a local sidecar with venue credentials.
1451
+
1452
+
```python
1453
+
@dataclass
1454
+
classExchangeOptions:
1455
+
pmxt_api_key: str# PMXT customer API key. When set, the SDK routes to api.pmxt.dev (catalog) and trade.pmxt.dev (trading). Get one at pmxt.dev/dashboard.
1456
+
wallet_address: str# EVM wallet address for hosted reads/writes. Required for endpoints that operate on a wallet (balances, positions, trades, open orders).
1457
+
signer: object# Optional pre-built signer for hosted writes. If absent and privateKey is set, the SDK auto-wraps privateKey into a signer.
1458
+
private_key: str# Private key. In hosted mode, used to derive an EIP-712 signer for writes (wraps into EthAccountSigner/EthersSigner). In self-hosted mode, used as the venue credential directly.
1459
+
base_url: str# Explicit base URL override. When unset, the SDK uses api.pmxt.dev when pmxtApiKey is set, or the local sidecar otherwise.
1460
+
api_key: str# Venue-side API key (e.g. Polymarket CLOB key). Only relevant for self-hosted mode.
1461
+
auto_start_server: bool# Auto-start the local sidecar when running self-hosted. Defaults to true when no pmxtApiKey is set, false when hosted.
1462
+
```
1463
+
1464
+
---
1446
1465
### `UnifiedMarket`
1447
1466
1448
1467
@@ -1527,11 +1546,11 @@ id: str # Stable venue-native series identifier (e.g. "KXATPMATCH" on Kalshi, "a
1527
1546
ticker: str# Venue-native ticker, when distinct from `id`.
1528
1547
slug: str# Venue-native slug.
1529
1548
title: str# Human-readable series title (e.g. "ATP Match Winner", "WTA").
timestamp: float# Unix timestamp in milliseconds when the order was created.
1638
1660
fee: float# Fee paid for this order, if known.
1639
1661
fee_rate_bps: float# Fee rate in basis points applied to this order (e.g. 100 = 1%).
1662
+
tx_hash: str# Populated in hosted mode after on-chain settlement; null for local-mode and for non-on-chain venues.
1663
+
chain: str# Populated in hosted mode after on-chain settlement; null for local-mode and for non-on-chain venues.
1664
+
block_number: float# Populated in hosted mode after on-chain settlement; null for local-mode and for non-on-chain venues.
1640
1665
```
1641
1666
1642
1667
---
1643
1668
### `Position`
1644
1669
1645
-
1670
+
A current position in a market. In hosted mode, `outcomeLabel`, `entryPrice`, `currentPrice` and `unrealizedPnL` may be null when the server cannot derive them (e.g. `with_mtm=false` or no fill history). Venue-direct callers continue to populate every field.
1646
1671
1647
1672
```python
1648
1673
@dataclass
1649
1674
classPosition:
1650
1675
market_id: str# The market this position is held in.
1651
1676
outcome_id: str# The outcome this position is held in.
1652
-
outcome_label: str# Human-readable label for the outcome held.
1677
+
outcome_label: str# Human-readable label for the outcome held. Optional in hosted mode.
1653
1678
size: float# Positive for long, negative for short
1654
-
entry_price: float# Average entry price for the position (probability between 0.0 and 1.0).
1655
-
current_price: float# Current mark price for the position (probability between 0.0 and 1.0).
1656
-
unrealized_pnl: float# Unrealized profit or loss at the current price (USD).
1679
+
entry_price: float# Average entry price for the position (probability between 0.0 and 1.0). Optional in hosted mode when no fill history is available.
1680
+
current_price: float# Current mark price for the position (probability between 0.0 and 1.0). Optional in hosted mode when mark-to-market data is unavailable.
1681
+
current_value: float# Current market value of the position (size * currentPrice). Null when currentPrice is unavailable.
1682
+
unrealized_pnl: float# Unrealized profit or loss at the current price (USD). Optional in hosted mode when mark-to-market data is unavailable.
1657
1683
realized_pnl: float# Realized profit or loss booked so far (USD).
1684
+
tx_hash: str# Populated in hosted mode after on-chain settlement (from the last fill); null for local-mode and for non-on-chain venues.
1685
+
chain: str# Populated in hosted mode after on-chain settlement (from the last fill); null for local-mode and for non-on-chain venues.
1686
+
block_number: float# Populated in hosted mode after on-chain settlement (from the last fill); null for local-mode and for non-on-chain venues.
Copy file name to clipboardExpand all lines: sdks/typescript/API_REFERENCE.md
+47-16Lines changed: 47 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1444,6 +1444,25 @@ positions.forEach(pos => {
1444
1444
1445
1445
## Data Models
1446
1446
1447
+
### `ExchangeOptions`
1448
+
1449
+
Constructor-level options for venue clients (Polymarket, Kalshi, Opinion, etc.).
1450
+
Hosted mode is the default when pmxtApiKey is set; otherwise the SDK runs against
1451
+
a local sidecar with venue credentials.
1452
+
1453
+
```typescript
1454
+
interface ExchangeOptions {
1455
+
pmxtApiKey: string; // PMXT customer API key. When set, the SDK routes to api.pmxt.dev (catalog) and trade.pmxt.dev (trading). Get one at pmxt.dev/dashboard.
1456
+
walletAddress: string; // EVM wallet address for hosted reads/writes. Required for endpoints that operate on a wallet (balances, positions, trades, open orders).
1457
+
signer: object; // Optional pre-built signer for hosted writes. If absent and privateKey is set, the SDK auto-wraps privateKey into a signer.
1458
+
privateKey: string; // Private key. In hosted mode, used to derive an EIP-712 signer for writes (wraps into EthAccountSigner/EthersSigner). In self-hosted mode, used as the venue credential directly.
1459
+
baseUrl: string; // Explicit base URL override. When unset, the SDK uses api.pmxt.dev when pmxtApiKey is set, or the local sidecar otherwise.
1460
+
apiKey: string; // Venue-side API key (e.g. Polymarket CLOB key). Only relevant for self-hosted mode.
1461
+
autoStartServer: boolean; // Auto-start the local sidecar when running self-hosted. Defaults to true when no pmxtApiKey is set, false when hosted.
1462
+
}
1463
+
```
1464
+
1465
+
---
1447
1466
### `UnifiedMarket`
1448
1467
1449
1468
@@ -1527,11 +1546,11 @@ id: string; // Stable venue-native series identifier (e.g. "KXATPMATCH" on Kalsh
1527
1546
ticker: string; // Venue-native ticker, when distinct from `id`.
1528
1547
slug: string; // Venue-native slug.
1529
1548
title: string; // Human-readable series title (e.g. "ATP Match Winner", "WTA").
1530
-
description: any; // Long-form series description.
timestamp: number; // Unix timestamp in milliseconds when the order was created.
1638
1660
fee: number; // Fee paid for this order, if known.
1639
1661
feeRateBps: number; // Fee rate in basis points applied to this order (e.g. 100 = 1%).
1662
+
txHash: string; // Populated in hosted mode after on-chain settlement; null for local-mode and for non-on-chain venues.
1663
+
chain: string; // Populated in hosted mode after on-chain settlement; null for local-mode and for non-on-chain venues.
1664
+
blockNumber: number; // Populated in hosted mode after on-chain settlement; null for local-mode and for non-on-chain venues.
1640
1665
}
1641
1666
```
1642
1667
1643
1668
---
1644
1669
### `Position`
1645
1670
1646
-
1671
+
A current position in a market. In hosted mode, `outcomeLabel`, `entryPrice`, `currentPrice` and `unrealizedPnL` may be null when the server cannot derive them (e.g. `with_mtm=false` or no fill history). Venue-direct callers continue to populate every field.
1647
1672
1648
1673
```typescript
1649
1674
interfacePosition {
1650
1675
marketId: string; // The market this position is held in.
1651
1676
outcomeId: string; // The outcome this position is held in.
1652
-
outcomeLabel: string; // Human-readable label for the outcome held.
1677
+
outcomeLabel: string; // Human-readable label for the outcome held. Optional in hosted mode.
1653
1678
size: number; // Positive for long, negative for short
1654
-
entryPrice: number; // Average entry price for the position (probability between 0.0 and 1.0).
1655
-
currentPrice: number; // Current mark price for the position (probability between 0.0 and 1.0).
1656
-
unrealizedPnL: number; // Unrealized profit or loss at the current price (USD).
1679
+
entryPrice: number; // Average entry price for the position (probability between 0.0 and 1.0). Optional in hosted mode when no fill history is available.
1680
+
currentPrice: number; // Current mark price for the position (probability between 0.0 and 1.0). Optional in hosted mode when mark-to-market data is unavailable.
1681
+
currentValue: number; // Current market value of the position (size * currentPrice). Null when currentPrice is unavailable.
1682
+
unrealizedPnL: number; // Unrealized profit or loss at the current price (USD). Optional in hosted mode when mark-to-market data is unavailable.
1657
1683
realizedPnL: number; // Realized profit or loss booked so far (USD).
1684
+
txHash: string; // Populated in hosted mode after on-chain settlement (from the last fill); null for local-mode and for non-on-chain venues.
1685
+
chain: string; // Populated in hosted mode after on-chain settlement (from the last fill); null for local-mode and for non-on-chain venues.
1686
+
blockNumber: number; // Populated in hosted mode after on-chain settlement (from the last fill); null for local-mode and for non-on-chain venues.
0 commit comments