Skip to content

Commit d4fa08c

Browse files
committed
fix: register Hunch in ExchangeParam enum so it surfaces in docs
The 2.51.0 Hunch adapter was wired into the runtime but `hunch` was missing from the ExchangeParam enum in generate-openapi.js. That enum is the source of truth for venues.mdx, openapi.yaml, and COMPLIANCE.md generation, so Hunch was invisible on pmxt.dev/docs/concepts/venues. - generate-openapi.js: add `hunch` to ExchangeParam enum - generate-compliance.js: add `hunch` to EXCHANGE_ORDER - README: add Hunch to supported-exchanges row - regenerated openapi.yaml, openapi.json, venues.mdx (18 venues), COMPLIANCE.md (Hunch 15/20) - changelog: 2.51.1
1 parent 0b5bef3 commit d4fa08c

8 files changed

Lines changed: 410 additions & 1694 deletions

File tree

changelog.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [2.51.1] - 2026-06-23
6+
7+
Followup to the Hunch venue ship in 2.51.0: the adapter was wired into the runtime (factory, registry, exports) but `hunch` was missing from the `ExchangeParam` enum in `core/scripts/generate-openapi.js`. That enum is the source of truth for `docs/concepts/venues.mdx` (auto-generated), the OpenAPI path enum, and `COMPLIANCE.md`, so Hunch was invisible on pmxt.dev/docs/concepts/venues and absent from the compliance matrix.
8+
9+
### Fixed
10+
11+
- **`core/scripts/generate-openapi.js` — added `hunch` to the `ExchangeParam` enum.** Regenerated `core/src/server/openapi.yaml`, `docs/api-reference/openapi.json`, and `docs/concepts/venues.mdx` (now 18 venues).
12+
- **`core/scripts/generate-compliance.js` — added `hunch` to `EXCHANGE_ORDER`.** Regenerated `core/COMPLIANCE.md` (Hunch: 15/20 methods supported).
13+
- **`README.md` — added Hunch to the supported-exchanges row.**
14+
515
## [2.51.0] - 2026-06-22
616

717
New venue: **Hunch** (parimutuel prediction market on Base, x402 settlement). And a full assertion-based audit of the Hyperliquid SDK surface (both Python + TS) caught ten silent bugs that prior "did the call throw?" smoke tests had hidden — several since the venue was added. Read paths now have behavioral assertions on shape AND values; trading paths are verified end-to-end against a live mainnet wallet. Final HL state: every no-creds method behaviorally green in both SDKs (43/43 assertions), credentialed reads cross-checked vs HL raw API (open orders: 7/7 exact match; user trades: 2000/2000 match; synthesized closed orders: 104/104 match), and the full createOrder → openOrders → cancelOrder → openOrders-empty lifecycle proven live.

core/COMPLIANCE.md

Lines changed: 22 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -8,69 +8,32 @@ This document details the feature support and compliance status for each exchang
88

99
## Functions Status
1010

11-
| Category | Function | Polymarket | Kalshi | Limitless | Probable | Baozi | Myriad | Opinion | Metaculus |
12-
| :--- | :--- | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
13-
| **Market Data** | `fetchMarkets` | Y | Y | Y | Y | Y | Y | Y | Y |
14-
| | `fetchEvents` | Y | Y | Y | Y | Y | Y | Y | Y |
15-
| | `fetchMarket` | Y | Y | Y | Y | Y | Y | Y | Y |
16-
| | `fetchEvent` | Y | Y | Y | Y | Y | Y | Y | Y |
17-
| **Public Data** | `fetchOHLCV` | Y | Y | Y | Y | Y | Y | Y | - |
18-
| | `fetchOrderBook` | Y | Y | Y | Y | Y | Y | Y | - |
19-
| | `fetchTrades` | Y | Y | Y | Y | Y | Y | - | - |
20-
| **Private Data** | `fetchBalance` | Y | Y | Y | Y | Y | Y | - | - |
21-
| | `fetchPositions` | Y | Y | Y | Y | Y | Y | Y | - |
22-
| | `fetchMyTrades` | Y | Y | Y | Y | - | Y | Y | - |
23-
| **Trading** | `createOrder` | Y | Y | Y | Y | Y | Y | Y | Y |
24-
| | `cancelOrder` | Y | Y | Y | Y | Y | - | Y | Y |
25-
| | `fetchOrder` | Y | Y | Y | Y | Y | - | Y | - |
26-
| | `fetchOpenOrders` | Y | Y | Y | Y | Y | Y | Y | - |
27-
| | `fetchClosedOrders` | - | Y | Y | - | - | - | Y | - |
28-
| | `fetchAllOrders` | - | Y | Y | - | - | - | Y | - |
29-
| **Calculations** | `getExecutionPrice` | Y | Y | Y | Y | Y | Y | Y | - |
30-
| | `getExecutionPriceDetailed` | Y | Y | Y | Y | Y | Y | Y | - |
31-
| **Real-time** | `watchOrderBook` | Y | Y | Y | Y | Y | Y | Y | - |
32-
| | `watchTrades` | Y | Y | Y | - | - | Y | Y | - |
11+
| Category | Function | Polymarket | Kalshi | Limitless | Probable | Baozi | Myriad | Opinion | Metaculus | Hunch |
12+
| :--- | :--- | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
13+
| **Market Data** | `fetchMarkets` | Y | Y | Y | Y | Y | Y | Y | Y | Y |
14+
| | `fetchEvents` | Y | Y | Y | Y | Y | Y | Y | Y | Y |
15+
| | `fetchMarket` | Y | Y | Y | Y | Y | Y | Y | Y | Y |
16+
| | `fetchEvent` | Y | Y | Y | Y | Y | Y | Y | Y | Y |
17+
| **Public Data** | `fetchOHLCV` | Y | Y | Y | Y | Y | Y | Y | - | Y |
18+
| | `fetchOrderBook` | Y | Y | Y | Y | Y | Y | Y | - | Y |
19+
| | `fetchTrades` | Y | Y | Y | Y | Y | Y | - | - | Y |
20+
| **Private Data** | `fetchBalance` | Y | Y | Y | Y | Y | Y | - | - | Y |
21+
| | `fetchPositions` | Y | Y | Y | Y | Y | Y | Y | - | Y |
22+
| | `fetchMyTrades` | Y | Y | Y | Y | - | Y | Y | - | - |
23+
| **Trading** | `createOrder` | Y | Y | Y | Y | Y | Y | Y | Y | Y |
24+
| | `cancelOrder` | Y | Y | Y | Y | Y | - | Y | Y | - |
25+
| | `fetchOrder` | Y | Y | Y | Y | Y | - | Y | - | - |
26+
| | `fetchOpenOrders` | Y | Y | Y | Y | Y | Y | Y | - | Y |
27+
| | `fetchClosedOrders` | - | Y | Y | - | - | - | Y | - | - |
28+
| | `fetchAllOrders` | - | Y | Y | - | - | - | Y | - | - |
29+
| **Calculations** | `getExecutionPrice` | Y | Y | Y | Y | Y | Y | Y | - | Y |
30+
| | `getExecutionPriceDetailed` | Y | Y | Y | Y | Y | Y | Y | - | Y |
31+
| **Real-time** | `watchOrderBook` | Y | Y | Y | Y | Y | Y | Y | - | Y |
32+
| | `watchTrades` | Y | Y | Y | - | - | Y | Y | - | Y |
3333

3434
## Legend
3535
- **Y** - Supported
3636
- **-** - Not supported
37-
- **E** - Emulated (backed by a non-native mechanism)
38-
39-
> NOTE: the grid above is regenerated by `generate:compliance` from
40-
> `core/src/exchanges/*/index.ts`. The Hunch column below is documented inline
41-
> until the next regeneration picks it up.
42-
43-
## Hunch
44-
45-
Hunch is a **parimutuel** prediction market on **Base** (USDC). Markets are
46-
pool-based — there is no CLOB and no AMM curve; prices are *implied odds*.
47-
Settlement is **x402 / EIP-3009 `transferWithAuthorization`** (the bettor's
48-
wallet signs a USDC authorization; the relayer sponsors gas). Identity is
49-
keyless — the wallet IS the account, so reads need no API key.
50-
51-
| Category | Function | Hunch | Notes |
52-
| :--- | :--- | :---: | :--- |
53-
| **Market Data** | `fetchMarkets` | Y | `GET /api/agent/v1/markets` |
54-
| | `fetchEvents` | Y | No event tier — each market wrapped as a single-market event |
55-
| | `fetchMarket` | Y | `GET /api/agent/v1/markets/{id}` |
56-
| | `fetchEvent` | Y | Synthetic single-market event |
57-
| **Public Data** | `fetchOHLCV` | Y | From research `oddsHistory` (flat candles) |
58-
| | `fetchOrderBook` | E | Emulated: single level at the implied price, pool as depth |
59-
| | `fetchTrades` | Y | research `oddsHistory` as the public tape |
60-
| **Private Data** | `fetchBalance` | Y | `GET .../wallet/{address}/readiness` → USDC balance |
61-
| | `fetchPositions` | Y | `GET /api/agent/v1/positions?wallet=` |
62-
| | `fetchMyTrades` | - | Not exposed (use `fetchPositions` / proof) |
63-
| **Trading** | `createOrder` | Y | Self-hosted Base **x402** money path; **market orders only** |
64-
| | `cancelOrder` | - | Parimutuel pool — bets cannot be cancelled |
65-
| | `fetchOrder` | - | Parimutuel — no resting orders |
66-
| | `fetchOpenOrders` | Y | Always `[]` (no resting orders) |
67-
| **Real-time** | `watchOrderBook` | E | Poll-based emulation |
68-
| | `watchTrades` | E | Poll-based emulation |
69-
70-
`createOrder` accepts only `side: 'buy'` and `type: 'market'`; `outcomeId`
71-
encodes the Hunch side as `"{marketId}:{side}"` where `side` is `yes`/`no` for
72-
binary markets or the parimutuel bucket key for N-way ladder / date-window
73-
markets. Bets above the $10 "simple tier" first fetch a price-locked quote.
7437

7538
## Compliance Policy
7639
- **Failure over Warning**: Tests must fail if no relevant data (markets, events, candles) is found. This ensures that we catch API breakages or unexpected empty responses.
@@ -89,7 +52,4 @@ MYRIAD_API_KEY=...
8952
MYRIAD_WALLET_ADDRESS=0x...
9053
# Metaculus (required for API access — unauthenticated requests return 403)
9154
METACULUS_API_TOKEN=...
92-
# Hunch (reads are keyless; privateKey signs the x402 USDC payment on Base)
93-
HUNCH_PRIVATE_KEY=0x...
94-
HUNCH_WALLET_ADDRESS=0x... # optional; derived from HUNCH_PRIVATE_KEY when absent
9555
```

core/scripts/generate-compliance.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const METHOD_CATEGORIES = [
2323
];
2424

2525
// Exchange display order (skip kalshi-demo since it inherits Kalshi fully)
26-
const EXCHANGE_ORDER = ['polymarket', 'kalshi', 'limitless', 'probable', 'baozi', 'myriad', 'opinion', 'metaculus'];
26+
const EXCHANGE_ORDER = ['polymarket', 'kalshi', 'limitless', 'probable', 'baozi', 'myriad', 'opinion', 'metaculus', 'hunch'];
2727

2828
function toDisplayName(slug) {
2929
return slug.split('-').map(p => p.charAt(0).toUpperCase() + p.slice(1)).join('');

core/scripts/generate-openapi.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2462,7 +2462,7 @@ function buildSpec(methodSpecs) {
24622462
name: 'exchange',
24632463
schema: {
24642464
type: 'string',
2465-
enum: ['polymarket', 'kalshi', 'kalshi-demo', 'limitless', 'probable', 'baozi', 'myriad', 'opinion', 'metaculus', 'smarkets', 'polymarket_us', 'gemini-titan', 'hyperliquid', 'suibets', 'rain', 'mock', 'router'],
2465+
enum: ['polymarket', 'kalshi', 'kalshi-demo', 'limitless', 'probable', 'baozi', 'myriad', 'opinion', 'metaculus', 'smarkets', 'polymarket_us', 'gemini-titan', 'hyperliquid', 'suibets', 'rain', 'hunch', 'mock', 'router'],
24662466
},
24672467
required: true,
24682468
description: 'The prediction market exchange to target.',

core/src/server/openapi.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2911,6 +2911,7 @@ components:
29112911
- hyperliquid
29122912
- suibets
29132913
- rain
2914+
- hunch
29142915
- mock
29152916
- router
29162917
required: true

0 commit comments

Comments
 (0)