diff --git a/docs/api-reference/openapi-hosted.json b/docs/api-reference/openapi-hosted.json index 0336ff54..e6a6a0be 100644 --- a/docs/api-reference/openapi-hosted.json +++ b/docs/api-reference/openapi-hosted.json @@ -3,7 +3,7 @@ "info": { "title": "PMXT Hosted Router API", "description": "Hosted-only endpoints for cross-venue search, matching, arbitrage, and SQL.", - "version": "49fbcd4" + "version": "3bed49d" }, "servers": [ { @@ -16,24 +16,6 @@ "bearerAuth": [] } ], - "tags": [ - { - "name": "Trading (Hosted)", - "description": "Hosted trading endpoints. Build / submit / cancel orders via `trade.pmxt.dev/v0/*`. Hosted-mode is the default when `pmxt_api_key` is set." - }, - { - "name": "Orders & Positions (Hosted)", - "description": "Hosted account reads. Open orders, fills, balances, and positions via `trade.pmxt.dev/v0/*`. Requires `pmxt_api_key` + `wallet_address`." - }, - { - "name": "MatchedMarkets", - "description": "Cross-venue matched market and event clusters." - }, - { - "name": "SQL", - "description": "Direct read-only SQL access to the catalog (Enterprise)." - } - ], "paths": { "/v0/matched-event-clusters": { "get": { @@ -870,490 +852,6 @@ "type": "string" } } - }, - "HostedErrorResponse": { - "type": "object", - "description": "Error envelope returned by `trade.pmxt.dev/v0/*` endpoints. Mirrors the `ErrorDetail` shape used inside `BaseResponse.error` from the sidecar spec.", - "required": [ - "error" - ], - "properties": { - "error": { - "type": "object", - "properties": { - "message": { - "type": "string" - }, - "code": { - "type": "string", - "description": "Stable hosted-mode error code.", - "enum": [ - "HOSTED_TRADING_ERROR", - "INSUFFICIENT_ESCROW_BALANCE", - "ORDER_SIZE_TOO_SMALL", - "INVALID_API_KEY", - "OUTCOME_NOT_FOUND", - "CATALOG_UNAVAILABLE", - "BUILT_ORDER_EXPIRED", - "INVALID_SIGNATURE", - "NO_LIQUIDITY", - "MISSING_WALLET_ADDRESS", - "ORDER_NOT_FOUND", - "INVALID_ORDER" - ] - }, - "retryable": { - "type": "boolean" - }, - "exchange": { - "type": "string", - "nullable": true - }, - "detail": { - "type": "object", - "additionalProperties": {}, - "nullable": true - } - } - } - } - }, - "BuildOrderHostedRequest": { - "type": "object", - "description": "Hosted build-order request. Keys mirror the SDK constructor of an `Order`: pass catalog UUIDs (`market_id`, `outcome_id`), not venue-native ids.", - "required": [ - "market_id", - "outcome_id", - "side", - "amount", - "user_address" - ], - "properties": { - "market_id": { - "type": "string", - "format": "uuid", - "description": "Catalog market UUID." - }, - "outcome_id": { - "type": "string", - "format": "uuid", - "description": "Catalog outcome UUID." - }, - "side": { - "type": "string", - "enum": [ - "buy", - "sell" - ] - }, - "order_type": { - "type": "string", - "enum": [ - "market", - "limit" - ], - "default": "market" - }, - "amount": { - "type": "number", - "minimum": 0, - "description": "Order size. For `market` buys, in USDC; for `market` sells / `limit`, in shares." - }, - "denom": { - "type": "string", - "enum": [ - "shares", - "usdc" - ], - "default": "shares" - }, - "price": { - "type": "number", - "minimum": 0, - "maximum": 1, - "nullable": true, - "description": "Required for `limit` orders. Probability in [0, 1]." - }, - "slippage_pct": { - "type": "number", - "minimum": 0, - "maximum": 100, - "nullable": true - }, - "user_address": { - "type": "string", - "description": "EVM wallet address that will sign the resulting typed data." - } - } - }, - "BuildOrderHostedResponse": { - "type": "object", - "description": "Hosted build-order response. The caller must sign `typed_data` locally (and `pull_typed_data` if present) and POST the signatures back via `submitOrderHosted` before the order expires.", - "required": [ - "built_order_id", - "side", - "typed_data", - "quote" - ], - "properties": { - "built_order_id": { - "type": "string", - "description": "Opaque server-side key used by `submitOrderHosted` to look up the build context." - }, - "side": { - "type": "string", - "enum": [ - "buy", - "sell" - ] - }, - "typed_data": { - "type": "object", - "description": "EIP-712 typed data for the order. Sign locally with the wallet that matches `user_address`." - }, - "pull_typed_data": { - "type": "object", - "nullable": true, - "description": "Optional secondary EIP-712 payload for venues that require a pull-authorization (e.g. Polymarket neg-risk markets)." - }, - "quote": { - "type": "object", - "description": "Pre-trade quote: expected average fill price, slippage, and fees.", - "properties": { - "best_price": { - "type": "number" - }, - "expected_avg_price": { - "type": "number" - }, - "expected_slippage_pct": { - "type": "number" - }, - "estimated_cost_or_proceeds": { - "type": "number" - }, - "fillable": { - "type": "boolean" - }, - "liquidity": { - "type": "number" - }, - "fee_amount": { - "type": "number" - }, - "tick_size": { - "type": "string" - } - } - }, - "resolved": { - "type": "object", - "nullable": true, - "description": "Venue-native fields resolved from the catalog UUIDs (`venue`, `token_id`, `neg_risk`, `tick_size`).", - "properties": { - "venue": { - "type": "string", - "enum": [ - "polymarket", - "opinion" - ] - }, - "token_id": { - "type": "string" - }, - "neg_risk": { - "type": "boolean" - }, - "tick_size": { - "type": "number" - }, - "opinion_market_id": { - "type": "integer", - "nullable": true - } - } - } - } - }, - "SubmitOrderHostedRequest": { - "type": "object", - "description": "Hosted submit-order request. `signature` is the local EIP-712 signature over `BuildOrderHostedResponse.typed_data`.", - "required": [ - "built_order_id", - "signature" - ], - "properties": { - "built_order_id": { - "type": "string" - }, - "signature": { - "type": "string", - "description": "Hex-encoded EIP-712 signature." - }, - "pull_signature": { - "type": "string", - "nullable": true, - "description": "Signature for the secondary pull-authorization, required when `pull_typed_data` was returned." - }, - "wait": { - "type": "boolean", - "default": false, - "description": "When `true`, the server waits for on-chain settlement before responding." - } - } - }, - "CancelBuildHostedRequest": { - "type": "object", - "required": [ - "order_id", - "user_address" - ], - "properties": { - "order_id": { - "type": "string", - "description": "Unified order id, as returned by `fetchOpenOrdersHosted`." - }, - "user_address": { - "type": "string" - } - } - }, - "CancelBuildHostedResponse": { - "type": "object", - "required": [ - "cancel_id", - "typed_data", - "deadline" - ], - "properties": { - "cancel_id": { - "type": "string" - }, - "typed_data": { - "type": "object" - }, - "pull_typed_data": { - "type": "object", - "nullable": true - }, - "deadline": { - "type": "integer", - "description": "Unix epoch (s) after which the cancel build expires." - } - } - }, - "OrderV0": { - "type": "object", - "description": "Hosted-mode `Order` shape. Mirrors `pmxt.Order` so the SDK can return it directly. `tx_hash`, `chain`, and `block_number` populate once execution settles on-chain.", - "required": [ - "id", - "status" - ], - "properties": { - "id": { - "type": "string" - }, - "market_id": { - "type": "string", - "format": "uuid", - "nullable": true - }, - "outcome_id": { - "type": "string", - "format": "uuid", - "nullable": true - }, - "side": { - "type": "string", - "enum": [ - "buy", - "sell" - ], - "nullable": true - }, - "type": { - "type": "string", - "enum": [ - "market", - "limit" - ], - "nullable": true - }, - "amount": { - "type": "number", - "nullable": true - }, - "price": { - "type": "number", - "nullable": true - }, - "filled": { - "type": "number" - }, - "remaining": { - "type": "number" - }, - "status": { - "type": "string" - }, - "fee": { - "type": "number", - "nullable": true - }, - "timestamp": { - "type": "string", - "nullable": true - }, - "tx_hash": { - "type": "string", - "nullable": true, - "description": "On-chain transaction hash. Null until settled." - }, - "chain": { - "type": "string", - "nullable": true - }, - "block_number": { - "type": "integer", - "nullable": true - } - } - }, - "UserTradeV0": { - "type": "object", - "description": "Hosted-mode `UserTrade` shape. Mirrors `pmxt.UserTrade`.", - "properties": { - "id": { - "type": "string", - "nullable": true - }, - "market_id": { - "type": "string", - "format": "uuid", - "nullable": true - }, - "outcome_id": { - "type": "string", - "format": "uuid", - "nullable": true - }, - "side": { - "type": "string", - "enum": [ - "buy", - "sell" - ], - "nullable": true - }, - "amount": { - "type": "number", - "nullable": true - }, - "price": { - "type": "number", - "nullable": true - }, - "fee": { - "type": "number", - "nullable": true - }, - "timestamp": { - "type": "string", - "nullable": true - }, - "tx_hash": { - "type": "string", - "nullable": true - }, - "chain": { - "type": "string", - "nullable": true - }, - "venue": { - "type": "string", - "enum": [ - "polymarket", - "opinion" - ], - "nullable": true - } - } - }, - "PositionV0": { - "type": "object", - "description": "Hosted-mode `Position` shape. `current_price`, `current_value`, `entry_price`, `realized_pnl`, and `outcome_label` may be null when the server doesn't yet have the data.", - "required": [ - "venue", - "shares" - ], - "properties": { - "market_id": { - "type": "string", - "format": "uuid", - "nullable": true - }, - "outcome_id": { - "type": "string", - "format": "uuid", - "nullable": true - }, - "venue": { - "type": "string", - "enum": [ - "polymarket", - "opinion" - ] - }, - "shares": { - "type": "number" - }, - "current_price": { - "type": "number", - "nullable": true - }, - "current_value": { - "type": "number", - "nullable": true - }, - "outcome_label": { - "type": "string", - "nullable": true - }, - "entry_price": { - "type": "number", - "nullable": true - }, - "realized_pnl": { - "type": "number", - "nullable": true - } - } - }, - "BalanceV0": { - "type": "object", - "description": "Hosted-mode `Balance` shape. Returns USDC held inside the PMXT `PreFundedEscrow` contract.", - "required": [ - "currency", - "amount" - ], - "properties": { - "currency": { - "type": "string", - "default": "USDC" - }, - "amount": { - "type": "number" - }, - "venue": { - "type": "string", - "enum": [ - "polymarket", - "opinion" - ], - "nullable": true, - "description": "Set when the hosted backend returns a per-venue breakdown; null when balance is venue-agnostic." - } - } } } } diff --git a/docs/concepts/venues.mdx b/docs/concepts/venues.mdx index 87a56ec1..f7aa7031 100644 --- a/docs/concepts/venues.mdx +++ b/docs/concepts/venues.mdx @@ -54,6 +54,7 @@ The hosted catalog currently ingests the following venues: | Smarkets | `smarkets` | polling | | Probable | `probable` | polling | | Myriad | `myriad` | polling | +| hyperliquid | `hyperliquid` | polling | {/* HOSTED-AUTOGEN:catalog-venues:END */} ## Feature support diff --git a/docs/docs.json b/docs/docs.json index 29c878b4..9a7f6249 100644 --- a/docs/docs.json +++ b/docs/docs.json @@ -146,6 +146,14 @@ ], "openapi": "api-reference/openapi.json" }, + { + "group": "Cross Exchange", + "openapi": "api-reference/openapi-hosted.json", + "pages": [ + "GET /v0/matched-event-clusters", + "GET /v0/matched-market-clusters" + ] + }, { "group": "Trading", "openapi": "api-reference/openapi-hosted-trading.json", @@ -167,14 +175,6 @@ "GET /v0/user/{address}/balances" ] }, - { - "group": "Cross Exchange", - "openapi": "api-reference/openapi-hosted.json", - "pages": [ - "GET /v0/matched-event-clusters", - "GET /v0/matched-market-clusters" - ] - }, { "group": "Order Book & Trades", "pages": [ @@ -224,6 +224,7 @@ "group": "Enterprise", "openapi": "api-reference/openapi-hosted.json", "pages": [ + "sql", "POST /v0/sql" ] } diff --git a/docs/llms-full.txt b/docs/llms-full.txt index d7212c4a..3813e898 100644 --- a/docs/llms-full.txt +++ b/docs/llms-full.txt @@ -751,12 +751,10 @@ and `trade.pmxt.dev`) — see [hosts](https://pmxt.dev/docs/authentication#hosts #### Limits -| Plan | Monthly credits | Per-minute | WebSocket streams | Price | -| ---- | --------------- | ---------- | ----------------- | ----- | -| Free | 25,000 | 60 | 5 | $0/mo | -| Starter | 250,000 | 300 | 20 | $29.99/mo | -| Pro | 1,000,000 | 1,000 | 100 | $99.99/mo | -| Enterprise | Custom | Custom | Custom | [Contact us](https://pmxt.dev/pricing) | +| Endpoint | Per-minute | Per-month | +| -------- | ---------- | --------- | +| `/v0/*` | 60 | 25,000 | +| `/api/*` | 60 | 25,000 | Limits apply per API key across both hosts (`api.pmxt.dev` and @@ -1028,6 +1026,7 @@ The hosted catalog currently ingests the following venues: | Smarkets | `smarkets` | polling | | Probable | `probable` | polling | | Myriad | `myriad` | polling | +| hyperliquid | `hyperliquid` | polling | #### Feature support @@ -3887,6 +3886,157 @@ curl "https://api.pmxt.dev/api/polymarket/fetchMarket?slug=will-gavin-newsom-win +## Cross Exchange + +### Fetch matched event clusters + +`GET /v0/matched-event-clusters` + +Returns connected clusters of semantically matched events across venues. Use this endpoint to browse or anchor event-level matches while preserving each venue's child markets. + +| Parameter | Type | Required | Description | +| --- | --- | --- | --- | +| `eventId` | string | No | Anchor the response to a specific event ID. | +| `slug` | string | No | Anchor the response to a specific event slug. | +| `url` | string | No | Anchor the response to a specific event URL. | +| `query` | string | No | Text search across cluster titles. | +| `category` | string | No | Filter both sides of matched edges by event category. | +| `relations` | string | No | Comma-separated relation filter. Valid values: identity (same resolution), subset (A yes implies B yes), superset (B yes implies A yes), overlap (some shared scenarios), and disjoint (mutually exclusive). Defaults to identity. For subset and superset, direction follows the pairwise edge direction returned in rawMatches when includeRawMatches=true. | +| `relation` | string | No | Single relation filter. Alias for relations. | +| `minConfidence` | number | No | | +| `venues` | string | No | Comma-separated venue allow-list. | +| `excludeVenues` | string | No | Comma-separated venue deny-list. | +| `minVenues` | integer | No | Minimum number of venues required in a cluster. | +| `withOrderbook` | boolean | No | Require at least one live orderbook on each matched edge. | +| `updatedSince` | string | No | Only include matches updated after this timestamp. | +| `includeRawMatches` | boolean | No | Include the pairwise match edges used to build each cluster. | +| `sort` | string | No | | +| `limit` | integer | No | | +| `offset` | integer | No | | +| `edgeLimit` | integer | No | Maximum number of pairwise edges to scan before clustering. | + +**Python:** +```python +import pmxt + +router = pmxt.Router(pmxt_api_key="YOUR_PMXT_API_KEY") +clusters = router.fetch_matched_event_clusters( + query="Satoshi", + relation="identity", + min_venues=2, + include_raw_matches=True, + limit=5, +) + +for cluster in clusters: + venues = [event.source_exchange for event in cluster.events] + print(cluster.canonical_title, venues) + +``` + +**TypeScript:** +```typescript +import { Router } from "pmxtjs"; + +const router = new Router({ pmxtApiKey: "YOUR_PMXT_API_KEY" }); + +async function main() { + const clusters = await router.fetchMatchedEventClusters({ + query: "Satoshi", + relation: "identity", + minVenues: 2, + includeRawMatches: true, + limit: 5, + }); + + for (const cluster of clusters) { + console.log( + cluster.canonicalTitle, + cluster.events.map((event) => event.sourceExchange), + ); + } +} + +main(); + +``` + + +### Fetch matched market clusters + +`GET /v0/matched-market-clusters` + +Returns connected clusters of semantically matched markets across venues. Use this endpoint to browse or anchor market-level matches without flattening the response into pairwise rows. + +| Parameter | Type | Required | Description | +| --- | --- | --- | --- | +| `marketId` | string | No | Anchor the response to a specific market ID. | +| `slug` | string | No | Anchor the response to a specific market slug. | +| `url` | string | No | Anchor the response to a specific market URL. | +| `query` | string | No | Text search across cluster titles. | +| `category` | string | No | Filter both sides of matched edges by market category. | +| `relations` | string | No | Comma-separated relation filter. Valid values: identity (same resolution), subset (A yes implies B yes), superset (B yes implies A yes), overlap (some shared scenarios), and disjoint (mutually exclusive). Defaults to identity. For subset and superset, direction follows the pairwise edge direction returned in rawMatches when includeRawMatches=true. | +| `relation` | string | No | Single relation filter. Alias for relations. | +| `minConfidence` | number | No | | +| `venues` | string | No | Comma-separated venue allow-list. | +| `excludeVenues` | string | No | Comma-separated venue deny-list. | +| `minVenues` | integer | No | Minimum number of venues required in a cluster. | +| `withOrderbook` | boolean | No | Require at least one live orderbook on each matched edge. | +| `updatedSince` | string | No | Only include matches updated after this timestamp. | +| `includeRawMatches` | boolean | No | Include the pairwise match edges used to build each cluster. | +| `sort` | string | No | | +| `limit` | integer | No | | +| `offset` | integer | No | | +| `edgeLimit` | integer | No | Maximum number of pairwise edges to scan before clustering. | + +**Python:** +```python +import pmxt + +router = pmxt.Router(pmxt_api_key="YOUR_PMXT_API_KEY") +clusters = router.fetch_matched_market_clusters( + query="Satoshi", + relation="identity", + min_venues=2, + include_raw_matches=True, + limit=5, +) + +for cluster in clusters: + venues = [market.source_exchange for market in cluster.markets] + print(cluster.canonical_title, venues) + +``` + +**TypeScript:** +```typescript +import { Router } from "pmxtjs"; + +const router = new Router({ pmxtApiKey: "YOUR_PMXT_API_KEY" }); + +async function main() { + const clusters = await router.fetchMatchedMarketClusters({ + query: "Satoshi", + relation: "identity", + minVenues: 2, + includeRawMatches: true, + limit: 5, + }); + + for (const cluster of clusters) { + console.log( + cluster.canonicalTitle, + cluster.markets.map((market) => market.sourceExchange), + ); + } +} + +main(); + +``` + + + ## Trading ### Create Order @@ -4341,157 +4491,6 @@ console.log(balances[0].available, balances[0].currency); -## Cross Exchange - -### Fetch matched event clusters - -`GET /v0/matched-event-clusters` - -Returns connected clusters of semantically matched events across venues. Use this endpoint to browse or anchor event-level matches while preserving each venue's child markets. - -| Parameter | Type | Required | Description | -| --- | --- | --- | --- | -| `eventId` | string | No | Anchor the response to a specific event ID. | -| `slug` | string | No | Anchor the response to a specific event slug. | -| `url` | string | No | Anchor the response to a specific event URL. | -| `query` | string | No | Text search across cluster titles. | -| `category` | string | No | Filter both sides of matched edges by event category. | -| `relations` | string | No | Comma-separated relation filter. Valid values: identity (same resolution), subset (A yes implies B yes), superset (B yes implies A yes), overlap (some shared scenarios), and disjoint (mutually exclusive). Defaults to identity. For subset and superset, direction follows the pairwise edge direction returned in rawMatches when includeRawMatches=true. | -| `relation` | string | No | Single relation filter. Alias for relations. | -| `minConfidence` | number | No | | -| `venues` | string | No | Comma-separated venue allow-list. | -| `excludeVenues` | string | No | Comma-separated venue deny-list. | -| `minVenues` | integer | No | Minimum number of venues required in a cluster. | -| `withOrderbook` | boolean | No | Require at least one live orderbook on each matched edge. | -| `updatedSince` | string | No | Only include matches updated after this timestamp. | -| `includeRawMatches` | boolean | No | Include the pairwise match edges used to build each cluster. | -| `sort` | string | No | | -| `limit` | integer | No | | -| `offset` | integer | No | | -| `edgeLimit` | integer | No | Maximum number of pairwise edges to scan before clustering. | - -**Python:** -```python -import pmxt - -router = pmxt.Router(pmxt_api_key="YOUR_PMXT_API_KEY") -clusters = router.fetch_matched_event_clusters( - query="Satoshi", - relation="identity", - min_venues=2, - include_raw_matches=True, - limit=5, -) - -for cluster in clusters: - venues = [event.source_exchange for event in cluster.events] - print(cluster.canonical_title, venues) - -``` - -**TypeScript:** -```typescript -import { Router } from "pmxtjs"; - -const router = new Router({ pmxtApiKey: "YOUR_PMXT_API_KEY" }); - -async function main() { - const clusters = await router.fetchMatchedEventClusters({ - query: "Satoshi", - relation: "identity", - minVenues: 2, - includeRawMatches: true, - limit: 5, - }); - - for (const cluster of clusters) { - console.log( - cluster.canonicalTitle, - cluster.events.map((event) => event.sourceExchange), - ); - } -} - -main(); - -``` - - -### Fetch matched market clusters - -`GET /v0/matched-market-clusters` - -Returns connected clusters of semantically matched markets across venues. Use this endpoint to browse or anchor market-level matches without flattening the response into pairwise rows. - -| Parameter | Type | Required | Description | -| --- | --- | --- | --- | -| `marketId` | string | No | Anchor the response to a specific market ID. | -| `slug` | string | No | Anchor the response to a specific market slug. | -| `url` | string | No | Anchor the response to a specific market URL. | -| `query` | string | No | Text search across cluster titles. | -| `category` | string | No | Filter both sides of matched edges by market category. | -| `relations` | string | No | Comma-separated relation filter. Valid values: identity (same resolution), subset (A yes implies B yes), superset (B yes implies A yes), overlap (some shared scenarios), and disjoint (mutually exclusive). Defaults to identity. For subset and superset, direction follows the pairwise edge direction returned in rawMatches when includeRawMatches=true. | -| `relation` | string | No | Single relation filter. Alias for relations. | -| `minConfidence` | number | No | | -| `venues` | string | No | Comma-separated venue allow-list. | -| `excludeVenues` | string | No | Comma-separated venue deny-list. | -| `minVenues` | integer | No | Minimum number of venues required in a cluster. | -| `withOrderbook` | boolean | No | Require at least one live orderbook on each matched edge. | -| `updatedSince` | string | No | Only include matches updated after this timestamp. | -| `includeRawMatches` | boolean | No | Include the pairwise match edges used to build each cluster. | -| `sort` | string | No | | -| `limit` | integer | No | | -| `offset` | integer | No | | -| `edgeLimit` | integer | No | Maximum number of pairwise edges to scan before clustering. | - -**Python:** -```python -import pmxt - -router = pmxt.Router(pmxt_api_key="YOUR_PMXT_API_KEY") -clusters = router.fetch_matched_market_clusters( - query="Satoshi", - relation="identity", - min_venues=2, - include_raw_matches=True, - limit=5, -) - -for cluster in clusters: - venues = [market.source_exchange for market in cluster.markets] - print(cluster.canonical_title, venues) - -``` - -**TypeScript:** -```typescript -import { Router } from "pmxtjs"; - -const router = new Router({ pmxtApiKey: "YOUR_PMXT_API_KEY" }); - -async function main() { - const clusters = await router.fetchMatchedMarketClusters({ - query: "Satoshi", - relation: "identity", - minVenues: 2, - includeRawMatches: true, - limit: 5, - }); - - for (const cluster of clusters) { - console.log( - cluster.canonicalTitle, - cluster.markets.map((market) => market.sourceExchange), - ); - } -} - -main(); - -``` - - - ## Order Book & Trades ### Fetch OHLCV diff --git a/docs/llms.txt b/docs/llms.txt index f78c573d..989b7f69 100644 --- a/docs/llms.txt +++ b/docs/llms.txt @@ -42,6 +42,8 @@ GitHub: https://github.com/pmxt-dev/pmxt - [Fetch Markets](https://pmxt.dev/docs/api-reference/fetch-markets) - [Fetch Markets Paginated](https://pmxt.dev/docs/api-reference/fetchMarketsPaginated): Fetch markets with cursor-based pagination backed by a stable in-memory snapshot. On the first call (or when no cursor is supplied), fetches all markets once and caches them. Subsequent calls with a cursor returned from a previous call slice directly from the cached snapshot — no additional API calls are made. The snapshot is invalidated after `snapshotTTL` ms (configured via `ExchangeOptions` in the constructor). A request using a cursor from an expired snapshot throws `'Cursor has expired'`. - [Fetch Market](https://pmxt.dev/docs/api-reference/fetch-market) +- [Fetch matched event clusters](https://pmxt.dev/docs/api-reference/getV0Matched-event-clusters): Returns connected clusters of semantically matched events across venues. Use this endpoint to browse or anchor event-level matches while preserving each venue's child markets. +- [Fetch matched market clusters](https://pmxt.dev/docs/api-reference/getV0Matched-market-clusters): Returns connected clusters of semantically matched markets across venues. Use this endpoint to browse or anchor market-level matches without flattening the response into pairwise rows. - [Create Order](https://pmxt.dev/docs/api-reference/createOrderHosted): Place a buy or sell order on Polymarket, Opinion, or Limitless. Returns the resulting order with id, fill status, average price, fees, and the on-chain tx hash once it settles. - [Build Order](https://pmxt.dev/docs/api-reference/buildOrderHosted): Build an order *without* placing it. Returns the order's typed-data payload (for the wallet to sign) plus a `built_order_id` to pass to `submitOrderHosted` once it's signed. - [Submit Order](https://pmxt.dev/docs/api-reference/submitOrderHosted): Submit a signed order returned by `buildOrderHosted` and get back the resulting order — id, fill status, average price, and the on-chain tx hash once it settles. @@ -51,8 +53,6 @@ GitHub: https://github.com/pmxt-dev/pmxt - [Fetch My Trades](https://pmxt.dev/docs/api-reference/fetchMyTradesHosted): List the wallet's historical fills on Polymarket, Opinion, and Limitless. Each trade carries the executed price (net of venue fees), size, and on-chain settlement tx hash. - [Fetch Positions](https://pmxt.dev/docs/api-reference/fetchPositionsHosted): List the open positions held by `address` across Polymarket, Opinion, and Limitless. Each position carries the market, outcome, share count, and average entry price. - [Fetch Balance](https://pmxt.dev/docs/api-reference/fetchBalanceHosted): Check the USDC available for trading. Returns the wallet's balance inside the PMXT escrow on Polygon — *not* the wallet's on-chain USDC balance. -- [Fetch matched event clusters](https://pmxt.dev/docs/api-reference/getV0Matched-event-clusters): Returns connected clusters of semantically matched events across venues. Use this endpoint to browse or anchor event-level matches while preserving each venue's child markets. -- [Fetch matched market clusters](https://pmxt.dev/docs/api-reference/getV0Matched-market-clusters): Returns connected clusters of semantically matched markets across venues. Use this endpoint to browse or anchor market-level matches without flattening the response into pairwise rows. - [Fetch OHLCV](https://pmxt.dev/docs/api-reference/fetch-ohlcv) - [Fetch Order Book](https://pmxt.dev/docs/api-reference/fetch-order-book) - [Fetch Order Books](https://pmxt.dev/docs/api-reference/fetchOrderBooks): Batch variant of {@link fetchOrderBook}. Fetches order books for multiple outcomes in a single request where the exchange supports it. diff --git a/docs/rate-limits.mdx b/docs/rate-limits.mdx index 031a3544..16439013 100644 --- a/docs/rate-limits.mdx +++ b/docs/rate-limits.mdx @@ -12,12 +12,10 @@ and `trade.pmxt.dev`) — see [hosts](/authentication#hosts). ## Limits {/* HOSTED-AUTOGEN:rate-limits-table:START */} -| Plan | Monthly credits | Per-minute | WebSocket streams | Price | -| ---- | --------------- | ---------- | ----------------- | ----- | -| Free | 25,000 | 60 | 5 | $0/mo | -| Starter | 250,000 | 300 | 20 | $29.99/mo | -| Pro | 1,000,000 | 1,000 | 100 | $99.99/mo | -| Enterprise | Custom | Custom | Custom | [Contact us](https://pmxt.dev/pricing) | +| Endpoint | Per-minute | Per-month | +| -------- | ---------- | --------- | +| `/v0/*` | 60 | 25,000 | +| `/api/*` | 60 | 25,000 | {/* HOSTED-AUTOGEN:rate-limits-table:END */} Limits apply per API key across both hosts (`api.pmxt.dev` and