To add a new prediction market exchange, you must implement an exchange directory in core/src/exchanges/<name>/. An implementation typically consists of several files responsible for API specifications, utility mappings, error handling, authentication, data fetching (REST), and real-time streaming (WebSocket).
| File | Purpose |
|------|---------|
| `api.ts` | Auto-generated from the exchange's OpenAPI spec -- the source of all implicit API methods |
| `utils.ts` | API URLs, status mapping, `mapMarketToUnified()` helper |
| `errors.ts` | Exchange-specific error patterns extending `ErrorMapper` |
| `auth.ts` | Credential validation, header/signer generation |
| `fetchMarkets.ts` | Fetch and normalize markets to `UnifiedMarket[]` |
| `fetchEvents.ts` | Fetch and normalize events to `UnifiedEvent[]` |
| `fetchOHLCV.ts` | Historical candle data mapped to `PriceCandle[]` |
| `fetchOrderBook.ts` | *(optional)* Order book -- create if the logic is complex enough to warrant it |
| `fetchTrades.ts` | *(optional)* Trade history -- create if the logic is complex enough to warrant it |
| `websocket.ts` | Real-time streaming (`watchOrderBook`, `watchTrades`, `close`) |
| `index.ts` | Main class: constructor calls `defineImplicitApi`, methods use `callApi` |