Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions core/COMPLIANCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,43 @@ This document details the feature support and compliance status for each exchang
## Legend
- **Y** - Supported
- **-** - Not supported
- **E** - Emulated (backed by a non-native mechanism)

> NOTE: the grid above is regenerated by `generate:compliance` from
> `core/src/exchanges/*/index.ts`. The Hunch column below is documented inline
> until the next regeneration picks it up.

## Hunch

Hunch is a **parimutuel** prediction market on **Base** (USDC). Markets are
pool-based — there is no CLOB and no AMM curve; prices are *implied odds*.
Settlement is **x402 / EIP-3009 `transferWithAuthorization`** (the bettor's
wallet signs a USDC authorization; the relayer sponsors gas). Identity is
keyless — the wallet IS the account, so reads need no API key.

| Category | Function | Hunch | Notes |
| :--- | :--- | :---: | :--- |
| **Market Data** | `fetchMarkets` | Y | `GET /api/agent/v1/markets` |
| | `fetchEvents` | Y | No event tier — each market wrapped as a single-market event |
| | `fetchMarket` | Y | `GET /api/agent/v1/markets/{id}` |
| | `fetchEvent` | Y | Synthetic single-market event |
| **Public Data** | `fetchOHLCV` | Y | From research `oddsHistory` (flat candles) |
| | `fetchOrderBook` | E | Emulated: single level at the implied price, pool as depth |
| | `fetchTrades` | Y | research `oddsHistory` as the public tape |
| **Private Data** | `fetchBalance` | Y | `GET .../wallet/{address}/readiness` → USDC balance |
| | `fetchPositions` | Y | `GET /api/agent/v1/positions?wallet=` |
| | `fetchMyTrades` | - | Not exposed (use `fetchPositions` / proof) |
| **Trading** | `createOrder` | Y | Self-hosted Base **x402** money path; **market orders only** |
| | `cancelOrder` | - | Parimutuel pool — bets cannot be cancelled |
| | `fetchOrder` | - | Parimutuel — no resting orders |
| | `fetchOpenOrders` | Y | Always `[]` (no resting orders) |
| **Real-time** | `watchOrderBook` | E | Poll-based emulation |
| | `watchTrades` | E | Poll-based emulation |

`createOrder` accepts only `side: 'buy'` and `type: 'market'`; `outcomeId`
encodes the Hunch side as `"{marketId}:{side}"` where `side` is `yes`/`no` for
binary markets or the parimutuel bucket key for N-way ladder / date-window
markets. Bets above the $10 "simple tier" first fetch a price-locked quote.

## Compliance Policy
- **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.
Expand All @@ -52,4 +89,7 @@ MYRIAD_API_KEY=...
MYRIAD_WALLET_ADDRESS=0x...
# Metaculus (required for API access — unauthenticated requests return 403)
METACULUS_API_TOKEN=...
# Hunch (reads are keyless; privateKey signs the x402 USDC payment on Base)
HUNCH_PRIVATE_KEY=0x...
HUNCH_WALLET_ADDRESS=0x... # optional; derived from HUNCH_PRIVATE_KEY when absent
```
Loading