diff --git a/core/COMPLIANCE.md b/core/COMPLIANCE.md index 84834b55..263667ea 100644 --- a/core/COMPLIANCE.md +++ b/core/COMPLIANCE.md @@ -8,28 +8,28 @@ This document details the feature support and compliance status for each exchang ## Functions Status -| Category | Function | Polymarket | PolymarketUS | Kalshi | Limitless | Probable | Baozi | Myriad | Opinion | Metaculus | Smarkets | Hyperliquid | GeminiTitan | SuiBets | Rain | Hunch | -| :--- | :--- | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | -| **Market Data** | `fetchMarkets` | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | -| | `fetchEvents` | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | -| | `fetchMarket` | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | -| | `fetchEvent` | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | -| **Public Data** | `fetchOHLCV` | Y | - | Y | Y | Y | Y | Y | Y | - | - | Y | - | - | Y | Y | -| | `fetchOrderBook` | Y | Y | Y | Y | Y | Y | Y | Y | - | Y | Y | Y | Y | Y | Y | -| | `fetchTrades` | Y | - | Y | Y | Y | Y | Y | - | - | Y | Y | - | - | Y | Y | -| **Private Data** | `fetchBalance` | Y | Y | Y | Y | Y | Y | Y | - | - | Y | Y | - | - | Y | Y | -| | `fetchPositions` | Y | Y | Y | Y | Y | Y | Y | Y | - | Y | Y | Y | Y | Y | Y | -| | `fetchMyTrades` | Y | Y | Y | Y | Y | - | Y | Y | - | Y | Y | - | - | Y | - | -| **Trading** | `createOrder` | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | - | Y | Y | -| | `cancelOrder` | Y | Y | Y | Y | Y | Y | - | Y | Y | Y | Y | Y | - | Y | - | -| | `fetchOrder` | Y | Y | Y | Y | Y | Y | - | Y | - | Y | - | - | - | Y | - | -| | `fetchOpenOrders` | Y | Y | Y | Y | Y | Y | Y | Y | - | Y | Y | Y | - | Y | Y | -| | `fetchClosedOrders` | - | - | Y | Y | - | - | - | Y | - | Y | Y | Y | - | - | - | -| | `fetchAllOrders` | - | - | Y | Y | - | - | - | Y | - | Y | Y | Y | - | - | - | -| **Calculations** | `getExecutionPrice` | Y | Y | Y | Y | Y | Y | Y | Y | - | Y | Y | Y | Y | Y | Y | -| | `getExecutionPriceDetailed` | Y | Y | Y | Y | Y | Y | Y | Y | - | Y | Y | Y | Y | Y | Y | -| **Real-time** | `watchOrderBook` | Y | Y | Y | Y | Y | Y | Y | Y | - | - | - | Y | - | Y | Y | -| | `watchTrades` | Y | Y | Y | Y | - | - | Y | Y | - | - | - | Y | - | Y | Y | +| Category | Function | Polymarket | PolymarketUS | Kalshi | Limitless | Probable | Baozi | Myriad | Opinion | Metaculus | Smarkets | Hyperliquid | GeminiTitan | SuiBets | Rain | Hunch | GADUIN | +| :--- | :--- | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | +| **Market Data** | `fetchMarkets` | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | +| | `fetchEvents` | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | - | +| | `fetchMarket` | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | +| | `fetchEvent` | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | - | +| **Public Data** | `fetchOHLCV` | Y | - | Y | Y | Y | Y | Y | Y | - | - | Y | - | - | Y | Y | Y | +| | `fetchOrderBook` | Y | Y | Y | Y | Y | Y | Y | Y | - | Y | Y | Y | Y | Y | Y | - | +| | `fetchTrades` | Y | - | Y | Y | Y | Y | Y | - | - | Y | Y | - | - | Y | Y | - | +| **Private Data** | `fetchBalance` | Y | Y | Y | Y | Y | Y | Y | - | - | Y | Y | - | - | Y | Y | - | +| | `fetchPositions` | Y | Y | Y | Y | Y | Y | Y | Y | - | Y | Y | Y | Y | Y | Y | - | +| | `fetchMyTrades` | Y | Y | Y | Y | Y | - | Y | Y | - | Y | Y | - | - | Y | - | - | +| **Trading** | `createOrder` | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | - | Y | Y | - | +| | `cancelOrder` | Y | Y | Y | Y | Y | Y | - | Y | Y | Y | Y | Y | - | Y | - | - | +| | `fetchOrder` | Y | Y | Y | Y | Y | Y | - | Y | - | Y | - | - | - | Y | - | - | +| | `fetchOpenOrders` | Y | Y | Y | Y | Y | Y | Y | Y | - | Y | Y | Y | - | Y | Y | - | +| | `fetchClosedOrders` | - | - | Y | Y | - | - | - | Y | - | Y | Y | Y | - | - | - | - | +| | `fetchAllOrders` | - | - | Y | Y | - | - | - | Y | - | Y | Y | Y | - | - | - | - | +| **Calculations** | `getExecutionPrice` | Y | Y | Y | Y | Y | Y | Y | Y | - | Y | Y | Y | Y | Y | Y | - | +| | `getExecutionPriceDetailed` | Y | Y | Y | Y | Y | Y | Y | Y | - | Y | Y | Y | Y | Y | Y | - | +| **Real-time** | `watchOrderBook` | Y | Y | Y | Y | Y | Y | Y | Y | - | - | - | Y | - | Y | Y | - | +| | `watchTrades` | Y | Y | Y | Y | - | - | Y | Y | - | - | - | Y | - | Y | Y | - | ## Legend - **Y** - Supported @@ -112,4 +112,7 @@ RAIN_WS_RPC_URL=... HUNCH_PRIVATE_KEY=0x... HUNCH_WALLET_ADDRESS=0x... HUNCH_BASE_URL=... + +# GADUIN (read-only API key, required for every REST read) +GADUIN_API_KEY=pk_live_... ``` diff --git a/core/scripts/fetch-openapi-specs.js b/core/scripts/fetch-openapi-specs.js index 694a9d96..4ca486bd 100644 --- a/core/scripts/fetch-openapi-specs.js +++ b/core/scripts/fetch-openapi-specs.js @@ -59,6 +59,12 @@ const SPECS = [ outFile: path.resolve(__dirname, '../src/exchanges/opinion/api.ts'), exportName: 'opinionApiSpec', }, + { + name: 'gaduin', + localFile: path.resolve(__dirname, '../specs/gaduin/gaduin.yaml'), + outFile: path.resolve(__dirname, '../src/exchanges/gaduin/api.ts'), + exportName: 'gaduinApiSpec', + }, ]; function fetch(url) { diff --git a/core/scripts/generate-compliance.js b/core/scripts/generate-compliance.js index 12b18914..2170d84c 100644 --- a/core/scripts/generate-compliance.js +++ b/core/scripts/generate-compliance.js @@ -40,6 +40,7 @@ const PREFERRED_EXCHANGE_ORDER = [ 'suibets', 'rain', 'hunch', + 'gaduin', ]; // kalshi-demo is a demo wrapper around Kalshi, and mock is for local tests. @@ -49,6 +50,7 @@ const DISPLAY_NAMES = { polymarket_us: 'PolymarketUS', 'gemini-titan': 'GeminiTitan', suibets: 'SuiBets', + gaduin: 'GADUIN', }; function listProductionExchangeSlugs() { @@ -298,6 +300,9 @@ RAIN_WS_RPC_URL=... HUNCH_PRIVATE_KEY=0x... HUNCH_WALLET_ADDRESS=0x... HUNCH_BASE_URL=... + +# GADUIN (read-only API key, required for every REST read) +GADUIN_API_KEY=pk_live_... \`\`\` `; diff --git a/core/scripts/generate-openapi.js b/core/scripts/generate-openapi.js index 93d8f7a4..175e8fb0 100644 --- a/core/scripts/generate-openapi.js +++ b/core/scripts/generate-openapi.js @@ -992,6 +992,7 @@ function buildCapabilityMap() { suibets: new pmxt.SuiBets(), rain: new pmxt.Rain(), hunch: new pmxt.Hunch(), + gaduin: new pmxt.Gaduin(), router: new pmxt.Router({ apiKey: '_' }), }; @@ -2707,7 +2708,7 @@ function buildSpec(methodSpecs) { name: 'exchange', schema: { type: 'string', - enum: ['polymarket', 'kalshi', 'kalshi-demo', 'limitless', 'probable', 'baozi', 'myriad', 'opinion', 'metaculus', 'smarkets', 'polymarket_us', 'gemini-titan', 'hyperliquid', 'suibets', 'rain', 'hunch', 'mock', 'router'], + enum: ['polymarket', 'kalshi', 'kalshi-demo', 'limitless', 'probable', 'baozi', 'myriad', 'opinion', 'metaculus', 'smarkets', 'polymarket_us', 'gemini-titan', 'hyperliquid', 'suibets', 'rain', 'hunch', 'gaduin', 'mock', 'router'], }, required: true, description: 'The prediction market exchange to target.', diff --git a/core/specs/gaduin/gaduin.yaml b/core/specs/gaduin/gaduin.yaml new file mode 100644 index 00000000..f5cefdea --- /dev/null +++ b/core/specs/gaduin/gaduin.yaml @@ -0,0 +1,410 @@ +openapi: 3.1.0 +info: + title: GADUIN Public Read API + version: 1.0.0 + description: Read-only endpoints for browsing prediction markets on real-world transport outcomes. Every request needs a bearer token exchanged from a read-only API key (see /auth.md), limited to 1 request per second and an hourly budget of distinct markets and rows per account; the website admits browsers with a human check instead. The same key reads your own account; the MCP server card describes the read-only MCP tools. Trading and withdrawals happen only on the website. +servers: + - url: https://gaduin.com/api/v1 + description: Production +security: + - bearerAuth: [] +paths: + /flights/discovery: + get: + operationId: GetFlightsDiscovery + summary: Browse recurring flights with sufficient recent observed history. + description: Returns up to 100 qualified flight identities per candidate page. Continue with next_cursor even when flights is empty. Cursors retain the observation window and filters. next_after is a stable directory position for starting a new observation window. The cursor expires after one hour. The unfiltered first page interleaves airlines; the pages after it run in airline and flight-number order, so some of its flights appear again there. + parameters: + - name: cursor + in: query + description: Opaque continuation from the previous response; do not combine with after. + schema: + type: string + - name: after + in: query + description: Stable exclusive position, for example BAW:117. + schema: + type: string + pattern: ^[A-Z]{3}:[1-9][0-9]{0,4}[A-Z]?$ + - name: bucket + in: query + description: Stable sitemap partition. + schema: + type: integer + minimum: 0 + maximum: 63 + - name: airline + in: query + description: Verified IATA or ICAO airline code; do not combine with numbers. + schema: + type: string + - name: numbers + in: query + description: Comma-separated flight designators, at most 100; do not combine with airline. + schema: + type: string + responses: + '200': + description: Qualified identities with generated_at, as_of and optional next_cursor/next_after. + '400': + description: Invalid, conflicting or expired pagination/filter parameters. + '401': + description: 'No valid credential: {"code":"clearance_required"}. Send a token exchanged from a read-only API key.' + '409': + description: Airline code cannot be resolved unambiguously. + '429': + description: Over the rate limit ({"code":"rate_limited"}) or temporarily blocked ({"code":"scraping_suspected"}); honour Retry-After. + '503': + description: Discovery is temporarily unavailable; no partial inventory is returned. + /markets: + get: + operationId: GetMarkets + summary: List markets. + parameters: + - name: status + in: query + description: Filter by status. Omit it to get markets in every status. + schema: + type: string + enum: + - DRAFT + - OPEN + - CLOSED + - SETTLED + - CANCELLED + - DISPUTED + - name: category + in: query + description: Filter by transport category. + schema: + type: string + enum: + - FLIGHT + - TRAIN + - SHIP + - name: limit + in: query + description: Page size. Defaults to 100; above 100 is a 400, not a clamp. + schema: + type: integer + minimum: 1 + maximum: 100 + default: 100 + - name: offset + in: query + description: Rows to skip in the sorted result. Capped at 10000. A deeper offset is a 400, not a clamp. Use sort=close_desc to reach the far end of a filter larger than that. + schema: + type: integer + minimum: 0 + maximum: 10000 + - name: close_after + in: query + description: Inclusive RFC3339 floor on close_at. Walk it forward as a keyset cursor to page past the offset ceiling. + schema: + type: string + format: date-time + - name: tradable + in: query + description: 'true keeps only markets that still accept orders now: OPEN, before their trading deadline and not yet decided. Combining it with a status other than OPEN is a 400.' + schema: + type: boolean + default: false + - name: sort + in: query + description: Row order. close_asc (the default) is soonest close_at first; close_desc is the same order reversed, so the newest rows are offset 0. + schema: + type: string + enum: + - close_asc + - close_desc + default: close_asc + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + required: + - markets + properties: + markets: + type: array + items: + $ref: '#/components/schemas/Market' + '401': + description: 'No valid credential: {"code":"clearance_required"}. Send a token exchanged from a read-only API key.' + '429': + description: Over the rate limit ({"code":"rate_limited"}) or temporarily blocked ({"code":"scraping_suspected"}); honour Retry-After. + /markets/{id}: + get: + operationId: GetMarket + summary: Get a single market; a settled market carries settled_on, the rule and times it settled on. + parameters: + - name: id + in: path + required: true + description: Market UUID or slug. A retired slug answers 301 to the current one. + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + required: + - market + properties: + market: + $ref: '#/components/schemas/Market' + '401': + description: 'No valid credential: {"code":"clearance_required"}. Send a token exchanged from a read-only API key.' + '429': + description: Over the rate limit ({"code":"rate_limited"}) or temporarily blocked ({"code":"scraping_suspected"}); honour Retry-After. + /markets/{id}/activity: + get: + operationId: GetMarketActivity + summary: 'Recent trades for a market, newest first (anonymous: no trader is named).' + parameters: + - name: id + in: path + required: true + description: Market UUID. + schema: + type: string + format: uuid + - name: limit + in: query + description: Entries to return. Defaults to 50; above 500 is a 400, not a clamp. + schema: + type: integer + minimum: 1 + maximum: 500 + default: 50 + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + required: + - entries + properties: + entries: + type: array + items: + type: object + required: + - occurred_at + - outcome_idx + - amount + properties: + occurred_at: + type: string + format: date-time + outcome_idx: + type: integer + amount: + type: string + description: Cost paid, USDT decimal string. + truncated: + type: boolean + description: True when the market has older trades than the entries returned. + '401': + description: 'No valid credential: {"code":"clearance_required"}. Send a token exchanged from a read-only API key.' + '429': + description: Over the rate limit ({"code":"rate_limited"}) or temporarily blocked ({"code":"scraping_suspected"}); honour Retry-After. + /markets/{id}/price-history: + get: + operationId: GetMarketPriceHistory + summary: Historical price snapshots for a market. + parameters: + - name: id + in: path + required: true + description: Market UUID. + schema: + type: string + format: uuid + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + required: + - points + properties: + points: + type: array + items: + type: object + required: + - t + - prices + properties: + t: + type: string + format: date-time + prices: + type: array + items: + type: number + truncated: + type: boolean + description: 'True when the market has more trades than the window: points cover only the most recent ones.' + starts_at: + type: string + format: date-time + description: When the window starts; set with truncated. + '401': + description: 'No valid credential: {"code":"clearance_required"}. Send a token exchanged from a read-only API key.' + '429': + description: Over the rate limit ({"code":"rate_limited"}) or temporarily blocked ({"code":"scraping_suspected"}); honour Retry-After. + /markets/config: + get: + operationId: GetMarketsConfig + summary: Trading bounds (min/max trade amount). + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + min_trade_amount: + type: string + description: Decimal string; absent when unset. + max_trade_amount: + type: string + description: Decimal string; absent when unset. + '401': + description: 'No valid credential: {"code":"clearance_required"}. Send a token exchanged from a read-only API key.' + '429': + description: Over the rate limit ({"code":"rate_limited"}) or temporarily blocked ({"code":"scraping_suspected"}); honour Retry-After. +components: + securitySchemes: + bearerAuth: + type: http + scheme: bearer + bearerFormat: JWT + description: Exchange a read-only API key at POST /api/v1/auth/token; see /auth.md. + schemas: + Market: + type: object + properties: + id: + type: string + format: uuid + slug: + type: string + kind: + type: string + enum: + - LMSR + category: + type: string + enum: + - FLIGHT + - TRAIN + - SHIP + question: + type: string + rules: + type: string + description: The delay or counting rule the question leaves out, e.g. "Delayed means more than 15 minutes late." Absent when the market has none. + status: + type: string + enum: + - DRAFT + - OPEN + - CLOSED + - SETTLED + - CANCELLED + - DISPUTED + settlement_source: + type: string + close_at: + type: string + format: date-time + trading_closes_at: + type: string + format: date-time + description: When trades start being refused; never later than close_at. + tradable: + type: boolean + description: 'Whether the order gate admitted an order when this response was built: false once trading stops, even while status is still OPEN.' + feed_eligible: + type: boolean + description: 'Whether the homepage may offer the market: it trades at least 30 more minutes and its journey is not about to settle.' + prices: + type: + - array + - 'null' + items: + type: number + description: Current price per outcome (0–1), indexed like outcomes. null for CANCELLED and DISPUTED markets. + volume: + type: string + description: USDT, decimal string. + outcomes: + type: array + items: + type: object + required: + - idx + - label + properties: + idx: + type: integer + label: + type: string + settled_outcome_idx: + type: integer + description: Winning outcome; present once settled. + hold: + type: object + description: Present while the market is paused because its scheduled side cannot yet be taken from a source the public can see. It still trades, and ends in a settlement or a full refund. + properties: + code: + type: string + enum: + - schedule_not_published + - schedule_not_timetabled + - planned_berthing_only + - under_review + reason: + type: string + since: + type: string + format: date-time + judged_arrival: + type: object + description: 'Flight markets: the scheduled arrival the outcome is measured against, drawn by the settlement''s own rule; on a settled market, the one its settlement measured against. scheduled_at is present only when status is fixed: awaiting_airport_schedule means the destination airport has not yet published the figure the market is measured against, not_established that its schedule at opening cannot be established, so the market is held and refunded if that persists.' + properties: + status: + type: string + enum: + - fixed + - awaiting_airport_schedule + - not_established + scheduled_at: + type: string + format: date-time + required: + - id + - slug + - kind + - category + - question + - outcomes + - status + - close_at + - trading_closes_at + - prices + - volume diff --git a/core/src/exchanges/gaduin/api.ts b/core/src/exchanges/gaduin/api.ts new file mode 100644 index 00000000..972789ac --- /dev/null +++ b/core/src/exchanges/gaduin/api.ts @@ -0,0 +1,228 @@ +/** + * Auto-generated from core/specs/gaduin/gaduin.yaml + * Generated at: 2026-11-23T11:42:22.000Z + * Do not edit manually -- run "npm run fetch:openapi" to regenerate. + */ +export const gaduinApiSpec = { + "openapi": "3.1.0", + "info": { + "title": "GADUIN Public Read API", + "version": "1.0.0" + }, + "servers": [ + { + "url": "https://gaduin.com/api/v1" + } + ], + "security": [ + { + "bearerAuth": [] + } + ], + "paths": { + "/flights/discovery": { + "get": { + "operationId": "GetFlightsDiscovery", + "summary": "Browse recurring flights with sufficient recent observed history.", + "parameters": [ + { + "name": "cursor", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "after", + "in": "query", + "schema": { + "type": "string", + "pattern": "^[A-Z]{3}:[1-9][0-9]{0,4}[A-Z]?$" + } + }, + { + "name": "bucket", + "in": "query", + "schema": { + "type": "integer", + "minimum": 0, + "maximum": 63 + } + }, + { + "name": "airline", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "numbers", + "in": "query", + "schema": { + "type": "string" + } + } + ] + } + }, + "/markets": { + "get": { + "operationId": "GetMarkets", + "summary": "List markets.", + "parameters": [ + { + "name": "status", + "in": "query", + "schema": { + "type": "string", + "enum": [ + "DRAFT", + "OPEN", + "CLOSED", + "SETTLED", + "CANCELLED", + "DISPUTED" + ] + } + }, + { + "name": "category", + "in": "query", + "schema": { + "type": "string", + "enum": [ + "FLIGHT", + "TRAIN", + "SHIP" + ] + } + }, + { + "name": "limit", + "in": "query", + "schema": { + "type": "integer", + "minimum": 1, + "maximum": 100, + "default": 100 + } + }, + { + "name": "offset", + "in": "query", + "schema": { + "type": "integer", + "minimum": 0, + "maximum": 10000 + } + }, + { + "name": "close_after", + "in": "query", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "tradable", + "in": "query", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "sort", + "in": "query", + "schema": { + "type": "string", + "enum": [ + "close_asc", + "close_desc" + ], + "default": "close_asc" + } + } + ] + } + }, + "/markets/{id}": { + "get": { + "operationId": "GetMarket", + "summary": "Get a single market; a settled market carries settled_on, the rule and times it settled on.", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ] + } + }, + "/markets/{id}/activity": { + "get": { + "operationId": "GetMarketActivity", + "summary": "Recent trades for a market, newest first (anonymous: no trader is named).", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "limit", + "in": "query", + "schema": { + "type": "integer", + "minimum": 1, + "maximum": 500, + "default": 50 + } + } + ] + } + }, + "/markets/{id}/price-history": { + "get": { + "operationId": "GetMarketPriceHistory", + "summary": "Historical price snapshots for a market.", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ] + } + }, + "/markets/config": { + "get": { + "operationId": "GetMarketsConfig", + "summary": "Trading bounds (min/max trade amount)." + } + } + }, + "components": { + "securitySchemes": { + "bearerAuth": { + "type": "http", + "scheme": "bearer", + "bearerFormat": "JWT", + "description": "Exchange a read-only API key at POST /api/v1/auth/token; see /auth.md." + } + } + } +}; diff --git a/core/src/exchanges/gaduin/auth.ts b/core/src/exchanges/gaduin/auth.ts new file mode 100644 index 00000000..9397f297 --- /dev/null +++ b/core/src/exchanges/gaduin/auth.ts @@ -0,0 +1,31 @@ +import { AxiosInstance } from 'axios'; + +/** + * Exchanges a read-only GADUIN API key (`pk_live_...`) for a short-lived JWT + * at POST /auth/token and caches it until shortly before it expires. + */ +export class GaduinAuth { + private token?: string; + private expiresAt = 0; + + constructor( + private readonly apiKey: string, + private readonly http: AxiosInstance, + private readonly baseUrl: string, + ) {} + + async refresh(): Promise { + if (this.token && Date.now() < this.expiresAt) return; + // An empty JSON body: axios would otherwise label the request as a form, which the endpoint reads as an OAuth grant. + const { data } = await this.http.post(`${this.baseUrl}/auth/token`, {}, { + headers: { Authorization: `Bearer ${this.apiKey}` }, + }); + this.token = data.access_token; + // Renew a minute early so a token never expires between refresh and use. + this.expiresAt = Date.now() + (Number(data.expires_in) - 60) * 1000; + } + + getHeaders(): Record { + return { Authorization: `Bearer ${this.token}` }; + } +} diff --git a/core/src/exchanges/gaduin/errors.ts b/core/src/exchanges/gaduin/errors.ts new file mode 100644 index 00000000..b47b2bb8 --- /dev/null +++ b/core/src/exchanges/gaduin/errors.ts @@ -0,0 +1,3 @@ +import { ErrorMapper } from '../../utils/error-mapper'; + +export const gaduinErrorMapper = new ErrorMapper('Gaduin'); diff --git a/core/src/exchanges/gaduin/fetchMarkets.ts b/core/src/exchanges/gaduin/fetchMarkets.ts new file mode 100644 index 00000000..3eb43f30 --- /dev/null +++ b/core/src/exchanges/gaduin/fetchMarkets.ts @@ -0,0 +1,50 @@ +import { MarketFetchParams } from '../../BaseExchange'; +import { BaseError } from '../../errors'; +import { UnifiedMarket } from '../../types'; +import { GaduinMarket, mapMarketToUnified } from './utils'; + +type CallApi = (operationId: string, params?: Record) => Promise; + +// API-key reads are refused above 100 rows per page. +const PAGE_MAX = 100; + +function toApiStatuses(status?: string): (string | undefined)[] { + if (status === 'all') return [undefined]; + if (status === 'closed' || status === 'inactive') return ['CLOSED', 'SETTLED']; + return ['OPEN']; +} + +export async function fetchMarkets( + params: MarketFetchParams | undefined, + callApi: CallApi, +): Promise { + // GET /markets/{id} accepts a market UUID or slug. + const id = params?.marketId ?? params?.slug ?? params?.outcomeId?.replace(/:\d+$/, ''); + if (id) { + try { + const data = await callApi('GetMarket', { id }); + return [mapMarketToUnified(data.market)]; + } catch (error) { + if (error instanceof BaseError && error.status === 404) return []; + throw error; + } + } + // GADUIN has no event tier. + if (params?.eventId) return []; + + const limit = Math.min(params?.limit ?? PAGE_MAX, PAGE_MAX); + const pages = await Promise.all( + toApiStatuses(params?.status).map((status) => + callApi('GetMarkets', { + status, + limit, + sort: status === 'OPEN' ? 'close_asc' : 'close_desc', + }), + ), + ); + const markets = pages.flatMap((page) => page.markets as GaduinMarket[]).map(mapMarketToUnified); + + // No server-side keyword search: match the question text of the fetched page. + const query = params?.query?.toLowerCase(); + return query ? markets.filter((m) => m.title.toLowerCase().includes(query)) : markets; +} diff --git a/core/src/exchanges/gaduin/fetchOHLCV.ts b/core/src/exchanges/gaduin/fetchOHLCV.ts new file mode 100644 index 00000000..46cbff19 --- /dev/null +++ b/core/src/exchanges/gaduin/fetchOHLCV.ts @@ -0,0 +1,55 @@ +import { OHLCVParams } from '../../BaseExchange'; +import { ValidationError } from '../../errors'; +import { PriceCandle } from '../../types'; +import { parseOutcomeId } from './utils'; + +type CallApi = (operationId: string, params?: Record) => Promise; + +const UNIT_MS: Record = { m: 60_000, h: 3_600_000, d: 86_400_000 }; + +export function resolutionToMs(resolution: string): number { + const match = /^([1-9]\d*)([mhd])$/.exec(resolution ?? ''); + if (!match) { + throw new ValidationError( + `Unsupported resolution "${resolution}". Use m, h or d, e.g. "1h".`, + 'resolution', + 'Gaduin', + ); + } + return Number(match[1]) * UNIT_MS[match[2]]; +} + +/** + * Buckets GET /markets/{id}/price-history points (the outcome prices after + * each trade) into candles. The API publishes no per-point volume. + */ +export async function fetchOHLCV( + outcomeId: string, + params: OHLCVParams, + callApi: CallApi, +): Promise { + const { marketId, idx } = parseOutcomeId(outcomeId); + const step = resolutionToMs(params.resolution); + const start = params.start?.getTime() ?? -Infinity; + const end = params.end?.getTime() ?? Infinity; + + const data = await callApi('GetMarketPriceHistory', { id: marketId }); + const points = (data.points as { t: string; prices: number[] }[]) + .map((p) => ({ t: Date.parse(p.t), price: p.prices[idx] })) + .filter((p) => p.price !== undefined && p.t >= start && p.t <= end) + .sort((a, b) => a.t - b.t); + + const candles: PriceCandle[] = []; + for (const { t, price } of points) { + const timestamp = Math.floor(t / step) * step; + const last = candles[candles.length - 1]; + if (last?.timestamp === timestamp) { + last.high = Math.max(last.high, price); + last.low = Math.min(last.low, price); + last.close = price; + } else { + candles.push({ timestamp, open: price, high: price, low: price, close: price }); + } + } + return params.limit ? candles.slice(-params.limit) : candles; +} diff --git a/core/src/exchanges/gaduin/index.ts b/core/src/exchanges/gaduin/index.ts new file mode 100644 index 00000000..c0c473d1 --- /dev/null +++ b/core/src/exchanges/gaduin/index.ts @@ -0,0 +1,91 @@ +import { PredictionMarketExchange, MarketFetchParams, OHLCVParams, ExchangeCredentials } from '../../BaseExchange'; +import { UnifiedMarket, PriceCandle } from '../../types'; +import { AuthenticationError } from '../../errors'; +import { parseOpenApiSpec } from '../../utils/openapi'; +import { gaduinApiSpec } from './api'; +import { GaduinAuth } from './auth'; +import { gaduinErrorMapper } from './errors'; +import { fetchMarkets } from './fetchMarkets'; +import { fetchOHLCV } from './fetchOHLCV'; +import { BASE_URL } from './utils'; + +/** + * GADUIN exchange integration (read-only). + * + * GADUIN is a prediction market on transport outcomes (flight delays, train + * punctuality, ship arrivals, weekly ship counts through chokepoints). Prices + * come from an automated market maker (LMSR), so there is no order book. + * + * ## Supported operations + * + * - **fetchMarkets / fetchMarket**: Lookup by `marketId`, `slug` or `outcomeId`, + * or a listing of up to 100 markets filtered by `status`. `category` is one + * of `FLIGHT`, `TRAIN`, `SHIP`. Outcomes are published as-is (binary yes/no + * or multi-outcome such as on_time / delayed / cancelled). + * - **fetchOHLCV**: Candles bucketed from the market's price history. + * + * ## Authentication + * + * Every REST read, market data included, needs a read-only API key + * (`pk_live_...`) minted at https://gaduin.com/account/ai. Pass `{ apiKey }`; + * it is exchanged for a short-lived token automatically. API access is + * read-only: trading happens only on the GADUIN website. + * + * ## Not covered + * + * This venue reads the markets API only. GADUIN's transport data (flight + * status, airport and rail station boards, ship traffic through chokepoints) + * is a separate REST API with its own key: https://gaduin.com/docs/api + */ +export class GaduinExchange extends PredictionMarketExchange { + private readonly auth?: GaduinAuth; + + constructor(credentials?: ExchangeCredentials) { + super(credentials); + const baseUrl = credentials?.baseUrl || BASE_URL; + if (credentials?.apiKey) { + this.auth = new GaduinAuth(credentials.apiKey, this.http, baseUrl); + } + this.defineImplicitApi(parseOpenApiSpec(gaduinApiSpec, baseUrl)); + } + + get name(): string { + return 'Gaduin'; + } + + protected override mapImplicitApiError(error: any): any { + throw gaduinErrorMapper.mapError(error); + } + + protected override async callApi(operationId: string, params?: Record | any[]): Promise { + try { + await this.ensureAuth().refresh(); + } catch (error) { + throw gaduinErrorMapper.mapError(error); + } + return super.callApi(operationId, params); + } + + protected override sign(_method: string, _path: string, _params: Record): Record { + return this.ensureAuth().getHeaders(); + } + + private ensureAuth(): GaduinAuth { + if (!this.auth) { + throw new AuthenticationError( + 'Gaduin requires an API key for every REST read. Mint a read-only key at ' + + 'https://gaduin.com/account/ai and pass { apiKey: "pk_live_..." }.', + 'Gaduin', + ); + } + return this.auth; + } + + protected async fetchMarketsImpl(params?: MarketFetchParams): Promise { + return fetchMarkets(params, this.callApi.bind(this)); + } + + async fetchOHLCV(outcomeId: string, params: OHLCVParams): Promise { + return fetchOHLCV(outcomeId, params, this.callApi.bind(this)); + } +} diff --git a/core/src/exchanges/gaduin/utils.ts b/core/src/exchanges/gaduin/utils.ts new file mode 100644 index 00000000..23d9d9df --- /dev/null +++ b/core/src/exchanges/gaduin/utils.ts @@ -0,0 +1,74 @@ +import { UnifiedMarket } from '../../types'; +import { ValidationError } from '../../errors'; + +export const BASE_URL = 'https://gaduin.com/api/v1'; +const SITE_URL = 'https://gaduin.com'; + +/** Market shape from GET /markets and GET /markets/{id} (see core/specs/gaduin/gaduin.yaml). */ +export interface GaduinMarket { + id: string; + slug: string; + kind: string; + category: string; + question: string; + rules?: string; + status: string; + close_at: string; + trading_closes_at: string; + tradable?: boolean; + prices: number[] | null; + volume: string; + outcomes: { idx: number; label: string }[]; + settled_outcome_idx?: number; +} + +/** Outcome ids are `:`. */ +export function parseOutcomeId(outcomeId: string): { marketId: string; idx: number } { + const match = /^(.+):(\d+)$/.exec(outcomeId); + if (!match) { + throw new ValidationError( + `Invalid Gaduin outcomeId "${outcomeId}". Expected ":".`, + 'outcomeId', + 'Gaduin', + ); + } + return { marketId: match[1], idx: Number(match[2]) }; +} + +export function mapMarketToUnified(raw: GaduinMarket): UnifiedMarket { + const market: UnifiedMarket = { + marketId: raw.id, + title: raw.question, + description: raw.rules ?? '', + slug: raw.slug, + outcomes: raw.outcomes.map((o) => ({ + outcomeId: `${raw.id}:${o.idx}`, + marketId: raw.id, + label: o.label, + // prices is null on CANCELLED and DISPUTED markets. + price: raw.prices?.[o.idx] ?? 0, + })), + resolutionDate: new Date(raw.close_at), + // The API publishes lifetime volume only, and no liquidity figure. + volume24h: 0, + volume: Number(raw.volume), + liquidity: 0, + url: `${SITE_URL}/markets/${encodeURIComponent(raw.slug)}`, + category: raw.category, + status: raw.status === 'OPEN' ? 'active' : raw.status.toLowerCase(), + sourceMetadata: { + kind: raw.kind, + tradable: raw.tradable, + tradingClosesAt: raw.trading_closes_at, + settledOutcomeIdx: raw.settled_outcome_idx, + }, + }; + // Only literal yes/no markets get yes/no accessors, labels kept as published; other outcome sets (e.g. on_time/delayed) get none. + const yes = market.outcomes.find((o) => o.label.toLowerCase() === 'yes'); + const no = market.outcomes.find((o) => o.label.toLowerCase() === 'no'); + if (market.outcomes.length === 2 && yes && no) { + market.yes = yes; + market.no = no; + } + return market; +} diff --git a/core/src/index.ts b/core/src/index.ts index 70879a58..0c608674 100644 --- a/core/src/index.ts +++ b/core/src/index.ts @@ -20,6 +20,7 @@ export * from './exchanges/gemini-titan'; export * from './exchanges/suibets'; export * from './exchanges/rain'; export * from './exchanges/hunch'; +export * from './exchanges/gaduin'; export * from './router'; export * from './feeds'; export * from './server/app'; @@ -43,6 +44,7 @@ import { GeminiTitanExchange } from './exchanges/gemini-titan'; import { SuiBetsExchange } from './exchanges/suibets'; import { RainExchange } from './exchanges/rain'; import { HunchExchange } from './exchanges/hunch'; +import { GaduinExchange } from './exchanges/gaduin'; import { Router } from './router'; const pmxt = { @@ -63,6 +65,7 @@ const pmxt = { SuiBets: SuiBetsExchange, Rain: RainExchange, Hunch: HunchExchange, + Gaduin: GaduinExchange, Router, }; @@ -83,5 +86,6 @@ export const GeminiTitan = GeminiTitanExchange; export const SuiBets = SuiBetsExchange; export const Rain = RainExchange; export const Hunch = HunchExchange; +export const Gaduin = GaduinExchange; export default pmxt; diff --git a/core/src/server/app.ts b/core/src/server/app.ts index 771ee899..c174dcf9 100644 --- a/core/src/server/app.ts +++ b/core/src/server/app.ts @@ -272,6 +272,7 @@ const defaultExchanges: Record = { metaculus: null, smarkets: null, hunch: null, + gaduin: null, mock: null, }; diff --git a/core/src/server/exchange-factory.ts b/core/src/server/exchange-factory.ts index 94141880..2f9a48bd 100644 --- a/core/src/server/exchange-factory.ts +++ b/core/src/server/exchange-factory.ts @@ -15,6 +15,7 @@ import { GeminiTitanExchange } from "../exchanges/gemini-titan"; import { SuiBetsExchange } from "../exchanges/suibets"; import { RainExchange } from "../exchanges/rain"; import { HunchExchange } from "../exchanges/hunch"; +import { GaduinExchange } from "../exchanges/gaduin"; import { MockExchange } from "../exchanges/mock"; import { Router } from "../router"; @@ -177,6 +178,11 @@ export function createExchange( process.env.HUNCH_WALLET_ADDRESS, baseUrl: credentials?.baseUrl || process.env.HUNCH_BASE_URL, }); + case "gaduin": + return new GaduinExchange({ + apiKey: credentials?.apiKey || process.env.GADUIN_API_KEY, + baseUrl: credentials?.baseUrl, + }); case "mock": return new MockExchange(); case "router": diff --git a/core/src/server/openapi.yaml b/core/src/server/openapi.yaml index 16dea933..5745ca6f 100644 --- a/core/src/server/openapi.yaml +++ b/core/src/server/openapi.yaml @@ -232,6 +232,7 @@ paths: - suibets - rain - hunch + - gaduin - router required: true description: The prediction market exchange to target. @@ -926,6 +927,7 @@ paths: - hyperliquid - rain - hunch + - gaduin required: true description: The prediction market exchange to target. - in: query @@ -3118,6 +3120,7 @@ components: - suibets - rain - hunch + - gaduin - mock - router required: true @@ -5057,6 +5060,17 @@ x-sdk-constructors: tsName: privateKey type: string description: Private key for authentication + gaduin: + className: Gaduin + params: + - name: pmxt_api_key + tsName: pmxtApiKey + type: string + description: PMXT API key for hosted access + - name: api_key + tsName: apiKey + type: string + description: API key for authentication mock: className: Mock params: diff --git a/core/test/exchanges/gaduin.test.ts b/core/test/exchanges/gaduin.test.ts new file mode 100644 index 00000000..683ba558 --- /dev/null +++ b/core/test/exchanges/gaduin.test.ts @@ -0,0 +1,168 @@ +import { AxiosError, InternalAxiosRequestConfig } from 'axios'; +import { GaduinExchange } from '../../src/exchanges/gaduin'; +import { AuthenticationError, MarketNotFound, ValidationError } from '../../src/errors'; + +// Fixtures follow the response shapes in core/specs/gaduin/gaduin.yaml. +const BINARY = { + id: '3b1f2c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d', + slug: 'flight-ba117-2026-09-28', + kind: 'LMSR', + category: 'FLIGHT', + question: 'Will BA117 arrive on time on 28 Sep?', + rules: 'Delayed means more than 15 minutes late.', + outcomes: [{ idx: 0, label: 'yes' }, { idx: 1, label: 'no' }], + status: 'OPEN', + close_at: '2026-09-30T12:00:00Z', + trading_closes_at: '2026-09-30T11:00:00Z', + tradable: true, + prices: [0.53, 0.47], + volume: '250.75', +}; + +const MULTI = { + id: '9a8b7c6d-0000-4000-8000-000000000001', + slug: 'train-ic123-2026-09-28', + kind: 'LMSR', + category: 'TRAIN', + question: 'How will IC 123 arrive on 28 Sep?', + outcomes: [{ idx: 0, label: 'on_time' }, { idx: 1, label: 'delayed' }, { idx: 2, label: 'cancelled' }], + status: 'OPEN', + close_at: '2026-09-29T08:00:00Z', + trading_closes_at: '2026-09-29T07:00:00Z', + tradable: true, + prices: [0.6, 0.3, 0.1], + volume: '10', +}; + +const CANCELLED = { ...BINARY, id: 'c0000000-0000-4000-8000-000000000002', status: 'CANCELLED', prices: null, tradable: false }; + +type Reply = { status?: number; data: unknown }; + +function setup(routes: (config: InternalAxiosRequestConfig) => Reply) { + const exchange = new GaduinExchange({ apiKey: 'pk_live_test' }); + exchange.enableRateLimit = false; + const requests: InternalAxiosRequestConfig[] = []; + exchange.http.defaults.adapter = async (config: InternalAxiosRequestConfig) => { + requests.push(config); + if (config.url?.endsWith('/auth/token')) { + expect(config.headers.Authorization).toBe('Bearer pk_live_test'); + // A form-encoded body would be read as an OAuth client_credentials grant. + expect(String(config.headers['Content-Type'])).toContain('application/json'); + return { data: { access_token: 'jwt-1', token_type: 'Bearer', expires_in: 3600 }, status: 200, statusText: 'OK', headers: {}, config }; + } + expect(config.headers.Authorization).toBe('Bearer jwt-1'); + const reply = routes(config); + const response = { data: reply.data, status: reply.status ?? 200, statusText: '', headers: {}, config }; + if (response.status >= 400) { + throw new AxiosError(`Request failed with status code ${response.status}`, 'ERR_BAD_REQUEST', config, null, response); + } + return response; + }; + return { exchange, requests }; +} + +describe('GaduinExchange', () => { + test('refuses reads without an API key', async () => { + await expect(new GaduinExchange().fetchMarkets()).rejects.toBeInstanceOf(AuthenticationError); + }); + + test('lists open markets with a token exchanged once from the API key', async () => { + const { exchange, requests } = setup(() => ({ data: { markets: [BINARY, MULTI] } })); + + const markets = await exchange.fetchMarkets({ limit: 5 }); + await exchange.fetchMarkets(); + + const tokenCalls = requests.filter((r) => r.url?.endsWith('/auth/token')); + expect(tokenCalls).toHaveLength(1); + expect(tokenCalls[0].method).toBe('post'); + const list = requests.find((r) => r.url === 'https://gaduin.com/api/v1/markets'); + expect(list?.params).toEqual({ status: 'OPEN', limit: 5, sort: 'close_asc' }); + + expect(markets).toHaveLength(2); + const [binary, multi] = markets; + expect(binary).toMatchObject({ + marketId: BINARY.id, + title: BINARY.question, + description: BINARY.rules, + slug: BINARY.slug, + category: 'FLIGHT', + status: 'active', + volume: 250.75, + url: 'https://gaduin.com/markets/flight-ba117-2026-09-28', + resolutionDate: new Date('2026-09-30T12:00:00Z'), + }); + expect(binary.yes).toMatchObject({ outcomeId: `${BINARY.id}:0`, label: 'yes', price: 0.53 }); + expect(binary.no).toMatchObject({ outcomeId: `${BINARY.id}:1`, label: 'no', price: 0.47 }); + + expect(multi.outcomes.map((o) => [o.outcomeId, o.label, o.price])).toEqual([ + [`${MULTI.id}:0`, 'on_time', 0.6], + [`${MULTI.id}:1`, 'delayed', 0.3], + [`${MULTI.id}:2`, 'cancelled', 0.1], + ]); + expect(multi.yes).toBeUndefined(); + expect(multi.no).toBeUndefined(); + }); + + test('caps the page size and filters by category', async () => { + const { exchange, requests } = setup(() => ({ data: { markets: [BINARY, MULTI] } })); + + const markets = await exchange.fetchMarkets({ category: 'TRAIN', limit: 500 }); + + expect(markets.map((m) => m.marketId)).toEqual([MULTI.id]); + expect(requests.find((r) => r.url?.endsWith('/markets'))?.params.limit).toBe(100); + }); + + test('closed status reads CLOSED and SETTLED markets', async () => { + const { exchange, requests } = setup((config) => ({ + data: { markets: config.params.status === 'SETTLED' ? [{ ...BINARY, status: 'SETTLED', settled_outcome_idx: 1 }] : [] }, + })); + + const markets = await exchange.fetchMarkets({ status: 'closed' }); + + expect(requests.filter((r) => r.url?.endsWith('/markets')).map((r) => r.params.status).sort()).toEqual(['CLOSED', 'SETTLED']); + expect(markets[0].status).toBe('settled'); + expect(markets[0].sourceMetadata).toMatchObject({ settledOutcomeIdx: 1 }); + }); + + test('fetchMarket looks up by id or slug and maps 404 to MarketNotFound', async () => { + const { exchange, requests } = setup((config) => + config.url?.endsWith(`/markets/${CANCELLED.id}`) ? { data: { market: CANCELLED } } : { status: 404, data: { error: 'market not found' } }, + ); + + const market = await exchange.fetchMarket({ marketId: CANCELLED.id }); + expect(market.status).toBe('cancelled'); + expect(market.outcomes.map((o) => o.price)).toEqual([0, 0]); + + await expect(exchange.fetchMarket({ slug: 'no-such-market' })).rejects.toBeInstanceOf(MarketNotFound); + expect(requests.some((r) => r.url === 'https://gaduin.com/api/v1/markets/no-such-market')).toBe(true); + }); + + test('fetchOHLCV buckets price history for one outcome', async () => { + const { exchange, requests } = setup(() => ({ + data: { + points: [ + { t: '2026-09-28T10:40:00Z', prices: [0.5, 0.3, 0.2] }, + { t: '2026-09-28T10:05:00Z', prices: [0.4, 0.4, 0.2] }, + { t: '2026-09-28T11:10:00Z', prices: [0.55, 0.3, 0.15] }, + { t: '2026-09-28T10:20:00Z', prices: [0.35, 0.45, 0.2] }, + ], + }, + })); + + const candles = await exchange.fetchOHLCV(`${MULTI.id}:0`, { resolution: '1h' }); + + expect(requests.some((r) => r.url === `https://gaduin.com/api/v1/markets/${MULTI.id}/price-history`)).toBe(true); + expect(candles).toEqual([ + { timestamp: Date.parse('2026-09-28T10:00:00Z'), open: 0.4, high: 0.5, low: 0.35, close: 0.5 }, + { timestamp: Date.parse('2026-09-28T11:00:00Z'), open: 0.55, high: 0.55, low: 0.55, close: 0.55 }, + ]); + expect(await exchange.fetchOHLCV(`${MULTI.id}:0`, { resolution: '1h', limit: 1 })).toHaveLength(1); + }); + + test('fetchOHLCV rejects malformed outcome ids and resolutions', async () => { + const { exchange } = setup(() => ({ data: { points: [] } })); + + await expect(exchange.fetchOHLCV(MULTI.id, { resolution: '1h' })).rejects.toBeInstanceOf(ValidationError); + await expect(exchange.fetchOHLCV(`${MULTI.id}:0`, { resolution: '1w' })).rejects.toBeInstanceOf(ValidationError); + }); +}); diff --git a/core/test/unit/generate-compliance.test.js b/core/test/unit/generate-compliance.test.js index 3180adc2..aacbb340 100644 --- a/core/test/unit/generate-compliance.test.js +++ b/core/test/unit/generate-compliance.test.js @@ -33,6 +33,7 @@ describe('generate-compliance', () => { 'SuiBets', 'Rain', 'Hunch', + 'GADUIN', ]; for (const exchange of expectedExchangeHeaders) { @@ -54,6 +55,7 @@ describe('generate-compliance', () => { 'SUIBETS_WALLET_ADDRESS', 'RAIN_WALLET_ADDRESS', 'HUNCH_WALLET_ADDRESS', + 'GADUIN_API_KEY', ]; for (const variableName of expectedCredentialVariables) { diff --git a/core/test/unit/llms-docs.test.js b/core/test/unit/llms-docs.test.js index d5f60f87..ee0f575e 100644 --- a/core/test/unit/llms-docs.test.js +++ b/core/test/unit/llms-docs.test.js @@ -95,6 +95,7 @@ describe('LLMS docs generation', () => { '| SuiBets | `suibets` |', '| Rain | `rain` |', '| Hunch | `hunch` |', + '| GADUIN | `gaduin` |', ]; for (const row of expectedRows) { diff --git a/core/test/unit/mintlify-venues.test.js b/core/test/unit/mintlify-venues.test.js index 84b87416..4acbd236 100644 --- a/core/test/unit/mintlify-venues.test.js +++ b/core/test/unit/mintlify-venues.test.js @@ -30,6 +30,7 @@ describe('Mintlify venues page generation', () => { '| SuiBets | `suibets` |', '| Rain | `rain` |', '| Hunch | `hunch` |', + '| GADUIN | `gaduin` |', ]; for (const row of expectedRows) { diff --git a/core/test/unit/readme-supported-exchanges.test.js b/core/test/unit/readme-supported-exchanges.test.js index c34dcac4..651579c9 100644 --- a/core/test/unit/readme-supported-exchanges.test.js +++ b/core/test/unit/readme-supported-exchanges.test.js @@ -23,6 +23,7 @@ describe('README supported exchanges', () => { 'SuiBets', 'Rain', 'Hunch', + 'GADUIN', ]; for (const altText of expectedAltTexts) { diff --git a/docs/api-reference/openapi.json b/docs/api-reference/openapi.json index ccc9b8ac..bd325f7e 100644 --- a/docs/api-reference/openapi.json +++ b/docs/api-reference/openapi.json @@ -183,6 +183,11 @@ "label": "Hunch", "source": "import pmxt\n\n# API key optional — enables faster catalog-backed lookups\nexchange = pmxt.Hunch(\n pmxt_api_key=\"YOUR_PMXT_API_KEY\",\n)\nresult = exchange.get_auth_nonce()" }, + { + "lang": "python", + "label": "Gaduin", + "source": "import pmxt\n\n# API key optional — enables faster catalog-backed lookups\nexchange = pmxt.Gaduin(\n pmxt_api_key=\"YOUR_PMXT_API_KEY\",\n)\nresult = exchange.get_auth_nonce()" + }, { "lang": "javascript", "label": "Polymarket", @@ -262,6 +267,11 @@ "lang": "javascript", "label": "Hunch", "source": "import { Hunch } from \"pmxtjs\";\n\n// API key optional — enables faster catalog-backed lookups\nconst exchange = new Hunch({\n pmxtApiKey: \"YOUR_PMXT_API_KEY\",\n});\nconst result = await exchange.getAuthNonce();" + }, + { + "lang": "javascript", + "label": "Gaduin", + "source": "import { Gaduin } from \"pmxtjs\";\n\n// API key optional — enables faster catalog-backed lookups\nconst exchange = new Gaduin({\n pmxtApiKey: \"YOUR_PMXT_API_KEY\",\n});\nconst result = await exchange.getAuthNonce();" } ] } @@ -418,6 +428,11 @@ "label": "Hunch", "source": "import pmxt\n\n# API key optional — enables faster catalog-backed lookups\nexchange = pmxt.Hunch(\n pmxt_api_key=\"YOUR_PMXT_API_KEY\",\n)\nresult = exchange.login_with_signature()" }, + { + "lang": "python", + "label": "Gaduin", + "source": "import pmxt\n\n# API key optional — enables faster catalog-backed lookups\nexchange = pmxt.Gaduin(\n pmxt_api_key=\"YOUR_PMXT_API_KEY\",\n)\nresult = exchange.login_with_signature()" + }, { "lang": "javascript", "label": "Polymarket", @@ -497,6 +512,11 @@ "lang": "javascript", "label": "Hunch", "source": "import { Hunch } from \"pmxtjs\";\n\n// API key optional — enables faster catalog-backed lookups\nconst exchange = new Hunch({\n pmxtApiKey: \"YOUR_PMXT_API_KEY\",\n});\nconst result = await exchange.loginWithSignature();" + }, + { + "lang": "javascript", + "label": "Gaduin", + "source": "import { Gaduin } from \"pmxtjs\";\n\n// API key optional — enables faster catalog-backed lookups\nconst exchange = new Gaduin({\n pmxtApiKey: \"YOUR_PMXT_API_KEY\",\n});\nconst result = await exchange.loginWithSignature();" } ] } @@ -627,6 +647,11 @@ "label": "Hunch", "source": "import pmxt\n\n# API key optional — enables faster catalog-backed lookups\nexchange = pmxt.Hunch(\n pmxt_api_key=\"YOUR_PMXT_API_KEY\",\n)\nresult = exchange.logout()" }, + { + "lang": "python", + "label": "Gaduin", + "source": "import pmxt\n\n# API key optional — enables faster catalog-backed lookups\nexchange = pmxt.Gaduin(\n pmxt_api_key=\"YOUR_PMXT_API_KEY\",\n)\nresult = exchange.logout()" + }, { "lang": "javascript", "label": "Polymarket", @@ -706,6 +731,11 @@ "lang": "javascript", "label": "Hunch", "source": "import { Hunch } from \"pmxtjs\";\n\n// API key optional — enables faster catalog-backed lookups\nconst exchange = new Hunch({\n pmxtApiKey: \"YOUR_PMXT_API_KEY\",\n});\nconst result = await exchange.logout();" + }, + { + "lang": "javascript", + "label": "Gaduin", + "source": "import { Gaduin } from \"pmxtjs\";\n\n// API key optional — enables faster catalog-backed lookups\nconst exchange = new Gaduin({\n pmxtApiKey: \"YOUR_PMXT_API_KEY\",\n});\nconst result = await exchange.logout();" } ] } @@ -852,6 +882,11 @@ "label": "Hunch", "source": "import pmxt\n\n# API key optional — enables faster catalog-backed lookups\nexchange = pmxt.Hunch(\n pmxt_api_key=\"YOUR_PMXT_API_KEY\",\n)\nresult = exchange.is_session_active()" }, + { + "lang": "python", + "label": "Gaduin", + "source": "import pmxt\n\n# API key optional — enables faster catalog-backed lookups\nexchange = pmxt.Gaduin(\n pmxt_api_key=\"YOUR_PMXT_API_KEY\",\n)\nresult = exchange.is_session_active()" + }, { "lang": "javascript", "label": "Polymarket", @@ -931,6 +966,11 @@ "lang": "javascript", "label": "Hunch", "source": "import { Hunch } from \"pmxtjs\";\n\n// API key optional — enables faster catalog-backed lookups\nconst exchange = new Hunch({\n pmxtApiKey: \"YOUR_PMXT_API_KEY\",\n});\nconst result = await exchange.isSessionActive();" + }, + { + "lang": "javascript", + "label": "Gaduin", + "source": "import { Gaduin } from \"pmxtjs\";\n\n// API key optional — enables faster catalog-backed lookups\nconst exchange = new Gaduin({\n pmxtApiKey: \"YOUR_PMXT_API_KEY\",\n});\nconst result = await exchange.isSessionActive();" } ] } @@ -1079,6 +1119,11 @@ "label": "Hunch", "source": "import pmxt\n\n# API key optional — enables faster catalog-backed lookups\nexchange = pmxt.Hunch(\n pmxt_api_key=\"YOUR_PMXT_API_KEY\",\n)\nresult = exchange.load_markets()" }, + { + "lang": "python", + "label": "Gaduin", + "source": "import pmxt\n\n# API key optional — enables faster catalog-backed lookups\nexchange = pmxt.Gaduin(\n pmxt_api_key=\"YOUR_PMXT_API_KEY\",\n)\nresult = exchange.load_markets()" + }, { "lang": "javascript", "label": "Polymarket", @@ -1158,6 +1203,11 @@ "lang": "javascript", "label": "Hunch", "source": "import { Hunch } from \"pmxtjs\";\n\n// API key optional — enables faster catalog-backed lookups\nconst exchange = new Hunch({\n pmxtApiKey: \"YOUR_PMXT_API_KEY\",\n});\nconst result = await exchange.loadMarkets();" + }, + { + "lang": "javascript", + "label": "Gaduin", + "source": "import { Gaduin } from \"pmxtjs\";\n\n// API key optional — enables faster catalog-backed lookups\nconst exchange = new Gaduin({\n pmxtApiKey: \"YOUR_PMXT_API_KEY\",\n});\nconst result = await exchange.loadMarkets();" } ] } @@ -1426,6 +1476,11 @@ "label": "Hunch", "source": "import pmxt\n\n# API key optional — enables faster catalog-backed lookups\nexchange = pmxt.Hunch(\n pmxt_api_key=\"YOUR_PMXT_API_KEY\",\n)\nresult = exchange.fetch_markets(\n query=\"election\",\n limit=10,\n status=\"active\",\n)" }, + { + "lang": "python", + "label": "Gaduin", + "source": "import pmxt\n\n# API key optional — enables faster catalog-backed lookups\nexchange = pmxt.Gaduin(\n pmxt_api_key=\"YOUR_PMXT_API_KEY\",\n)\nresult = exchange.fetch_markets(\n query=\"election\",\n limit=10,\n status=\"active\",\n)" + }, { "lang": "python", "label": "Router", @@ -1511,6 +1566,11 @@ "label": "Hunch", "source": "import { Hunch } from \"pmxtjs\";\n\n// API key optional — enables faster catalog-backed lookups\nconst exchange = new Hunch({\n pmxtApiKey: \"YOUR_PMXT_API_KEY\",\n});\nconst result = await exchange.fetchMarkets({\n query: \"election\",\n limit: 10,\n status: \"active\",\n});" }, + { + "lang": "javascript", + "label": "Gaduin", + "source": "import { Gaduin } from \"pmxtjs\";\n\n// API key optional — enables faster catalog-backed lookups\nconst exchange = new Gaduin({\n pmxtApiKey: \"YOUR_PMXT_API_KEY\",\n});\nconst result = await exchange.fetchMarkets({\n query: \"election\",\n limit: 10,\n status: \"active\",\n});" + }, { "lang": "javascript", "label": "Router", @@ -1662,6 +1722,11 @@ "label": "Hunch", "source": "import pmxt\n\n# API key optional — enables faster catalog-backed lookups\nexchange = pmxt.Hunch(\n pmxt_api_key=\"YOUR_PMXT_API_KEY\",\n)\nresult = exchange.fetch_markets_paginated(limit=10, cursor=\"abc123\")" }, + { + "lang": "python", + "label": "Gaduin", + "source": "import pmxt\n\n# API key optional — enables faster catalog-backed lookups\nexchange = pmxt.Gaduin(\n pmxt_api_key=\"YOUR_PMXT_API_KEY\",\n)\nresult = exchange.fetch_markets_paginated(limit=10, cursor=\"abc123\")" + }, { "lang": "javascript", "label": "Polymarket", @@ -1741,6 +1806,11 @@ "lang": "javascript", "label": "Hunch", "source": "import { Hunch } from \"pmxtjs\";\n\n// API key optional — enables faster catalog-backed lookups\nconst exchange = new Hunch({\n pmxtApiKey: \"YOUR_PMXT_API_KEY\",\n});\nconst result = await exchange.fetchMarketsPaginated({ limit: 10, cursor: \"abc123\" });" + }, + { + "lang": "javascript", + "label": "Gaduin", + "source": "import { Gaduin } from \"pmxtjs\";\n\n// API key optional — enables faster catalog-backed lookups\nconst exchange = new Gaduin({\n pmxtApiKey: \"YOUR_PMXT_API_KEY\",\n});\nconst result = await exchange.fetchMarketsPaginated({ limit: 10, cursor: \"abc123\" });" } ] } @@ -1888,6 +1958,11 @@ "label": "Hunch", "source": "import pmxt\n\n# API key optional — enables faster catalog-backed lookups\nexchange = pmxt.Hunch(\n pmxt_api_key=\"YOUR_PMXT_API_KEY\",\n)\nresult = exchange.fetch_events_paginated(limit=10, cursor=\"abc123\")" }, + { + "lang": "python", + "label": "Gaduin", + "source": "import pmxt\n\n# API key optional — enables faster catalog-backed lookups\nexchange = pmxt.Gaduin(\n pmxt_api_key=\"YOUR_PMXT_API_KEY\",\n)\nresult = exchange.fetch_events_paginated(limit=10, cursor=\"abc123\")" + }, { "lang": "javascript", "label": "Polymarket", @@ -1967,6 +2042,11 @@ "lang": "javascript", "label": "Hunch", "source": "import { Hunch } from \"pmxtjs\";\n\n// API key optional — enables faster catalog-backed lookups\nconst exchange = new Hunch({\n pmxtApiKey: \"YOUR_PMXT_API_KEY\",\n});\nconst result = await exchange.fetchEventsPaginated({ limit: 10, cursor: \"abc123\" });" + }, + { + "lang": "javascript", + "label": "Gaduin", + "source": "import { Gaduin } from \"pmxtjs\";\n\n// API key optional — enables faster catalog-backed lookups\nconst exchange = new Gaduin({\n pmxtApiKey: \"YOUR_PMXT_API_KEY\",\n});\nconst result = await exchange.fetchEventsPaginated({ limit: 10, cursor: \"abc123\" });" } ] } @@ -2817,6 +2897,11 @@ "label": "Hunch", "source": "import pmxt\n\n# API key optional — enables faster catalog-backed lookups\nexchange = pmxt.Hunch(\n pmxt_api_key=\"YOUR_PMXT_API_KEY\",\n)\nresult = exchange.fetch_market(market_id=\"12345\")" }, + { + "lang": "python", + "label": "Gaduin", + "source": "import pmxt\n\n# API key optional — enables faster catalog-backed lookups\nexchange = pmxt.Gaduin(\n pmxt_api_key=\"YOUR_PMXT_API_KEY\",\n)\nresult = exchange.fetch_market(market_id=\"12345\")" + }, { "lang": "javascript", "label": "Polymarket", @@ -2896,6 +2981,11 @@ "lang": "javascript", "label": "Hunch", "source": "import { Hunch } from \"pmxtjs\";\n\n// API key optional — enables faster catalog-backed lookups\nconst exchange = new Hunch({\n pmxtApiKey: \"YOUR_PMXT_API_KEY\",\n});\nconst result = await exchange.fetchMarket({ marketId: \"12345\" });" + }, + { + "lang": "javascript", + "label": "Gaduin", + "source": "import { Gaduin } from \"pmxtjs\";\n\n// API key optional — enables faster catalog-backed lookups\nconst exchange = new Gaduin({\n pmxtApiKey: \"YOUR_PMXT_API_KEY\",\n});\nconst result = await exchange.fetchMarket({ marketId: \"12345\" });" } ] } @@ -3177,6 +3267,11 @@ "label": "Hunch", "source": "import pmxt\n\n# API key optional — enables faster catalog-backed lookups\nexchange = pmxt.Hunch(\n pmxt_api_key=\"YOUR_PMXT_API_KEY\",\n)\nresult = exchange.fetch_event(event_id=\"12345\")" }, + { + "lang": "python", + "label": "Gaduin", + "source": "import pmxt\n\n# API key optional — enables faster catalog-backed lookups\nexchange = pmxt.Gaduin(\n pmxt_api_key=\"YOUR_PMXT_API_KEY\",\n)\nresult = exchange.fetch_event(event_id=\"12345\")" + }, { "lang": "javascript", "label": "Polymarket", @@ -3256,6 +3351,11 @@ "lang": "javascript", "label": "Hunch", "source": "import { Hunch } from \"pmxtjs\";\n\n// API key optional — enables faster catalog-backed lookups\nconst exchange = new Hunch({\n pmxtApiKey: \"YOUR_PMXT_API_KEY\",\n});\nconst result = await exchange.fetchEvent({ eventId: \"12345\" });" + }, + { + "lang": "javascript", + "label": "Gaduin", + "source": "import { Gaduin } from \"pmxtjs\";\n\n// API key optional — enables faster catalog-backed lookups\nconst exchange = new Gaduin({\n pmxtApiKey: \"YOUR_PMXT_API_KEY\",\n});\nconst result = await exchange.fetchEvent({ eventId: \"12345\" });" } ] } @@ -3385,6 +3485,11 @@ "label": "Hunch", "source": "import pmxt\n\n# API key optional — enables faster catalog-backed lookups\nexchange = pmxt.Hunch(\n pmxt_api_key=\"YOUR_PMXT_API_KEY\",\n)\nresult = exchange.fetch_event_metadata(event_ticker=\"value\")" }, + { + "lang": "python", + "label": "Gaduin", + "source": "import pmxt\n\n# API key optional — enables faster catalog-backed lookups\nexchange = pmxt.Gaduin(\n pmxt_api_key=\"YOUR_PMXT_API_KEY\",\n)\nresult = exchange.fetch_event_metadata(event_ticker=\"value\")" + }, { "lang": "javascript", "label": "Polymarket", @@ -3464,6 +3569,11 @@ "lang": "javascript", "label": "Hunch", "source": "import { Hunch } from \"pmxtjs\";\n\n// API key optional — enables faster catalog-backed lookups\nconst exchange = new Hunch({\n pmxtApiKey: \"YOUR_PMXT_API_KEY\",\n});\nconst result = await exchange.fetchEventMetadata({ eventTicker: \"value\" });" + }, + { + "lang": "javascript", + "label": "Gaduin", + "source": "import { Gaduin } from \"pmxtjs\";\n\n// API key optional — enables faster catalog-backed lookups\nconst exchange = new Gaduin({\n pmxtApiKey: \"YOUR_PMXT_API_KEY\",\n});\nconst result = await exchange.fetchEventMetadata({ eventTicker: \"value\" });" } ] } @@ -3633,6 +3743,11 @@ "label": "Hunch", "source": "import pmxt\nfrom datetime import datetime, timezone\n\n# API key optional — enables faster catalog-backed lookups\nexchange = pmxt.Hunch(\n pmxt_api_key=\"YOUR_PMXT_API_KEY\",\n)\nresult = exchange.fetch_ohlcv(\n \"67890\",\n resolution=\"1h\",\n start=datetime(2026, 1, 1, tzinfo=timezone.utc),\n end=datetime(2026, 1, 31, tzinfo=timezone.utc),\n limit=10,\n)" }, + { + "lang": "python", + "label": "Gaduin", + "source": "import pmxt\nfrom datetime import datetime, timezone\n\n# API key optional — enables faster catalog-backed lookups\nexchange = pmxt.Gaduin(\n pmxt_api_key=\"YOUR_PMXT_API_KEY\",\n)\nresult = exchange.fetch_ohlcv(\n \"67890\",\n resolution=\"1h\",\n start=datetime(2026, 1, 1, tzinfo=timezone.utc),\n end=datetime(2026, 1, 31, tzinfo=timezone.utc),\n limit=10,\n)" + }, { "lang": "javascript", "label": "Polymarket", @@ -3712,6 +3827,11 @@ "lang": "javascript", "label": "Hunch", "source": "import { Hunch } from \"pmxtjs\";\n\n// API key optional — enables faster catalog-backed lookups\nconst exchange = new Hunch({\n pmxtApiKey: \"YOUR_PMXT_API_KEY\",\n});\nconst result = await exchange.fetchOHLCV(\n \"67890\",\n {\n resolution: \"1h\",\n start: new Date(\"2026-01-01T00:00:00Z\"),\n end: new Date(\"2026-01-31T00:00:00Z\"),\n limit: 10,\n },\n);" + }, + { + "lang": "javascript", + "label": "Gaduin", + "source": "import { Gaduin } from \"pmxtjs\";\n\n// API key optional — enables faster catalog-backed lookups\nconst exchange = new Gaduin({\n pmxtApiKey: \"YOUR_PMXT_API_KEY\",\n});\nconst result = await exchange.fetchOHLCV(\n \"67890\",\n {\n resolution: \"1h\",\n start: new Date(\"2026-01-01T00:00:00Z\"),\n end: new Date(\"2026-01-31T00:00:00Z\"),\n limit: 10,\n },\n);" } ] } @@ -7118,6 +7238,11 @@ "label": "Hunch", "source": "import pmxt\n\n# API key optional — enables faster catalog-backed lookups\nexchange = pmxt.Hunch(\n pmxt_api_key=\"YOUR_PMXT_API_KEY\",\n)\norder_book = pmxt.OrderBook(\n bids=[pmxt.OrderLevel(price=0.52, size=100)],\n asks=[pmxt.OrderLevel(price=0.54, size=100)],\n)\nresult = exchange.get_execution_price(order_book, \"buy\", 10)" }, + { + "lang": "python", + "label": "Gaduin", + "source": "import pmxt\n\n# API key optional — enables faster catalog-backed lookups\nexchange = pmxt.Gaduin(\n pmxt_api_key=\"YOUR_PMXT_API_KEY\",\n)\norder_book = pmxt.OrderBook(\n bids=[pmxt.OrderLevel(price=0.52, size=100)],\n asks=[pmxt.OrderLevel(price=0.54, size=100)],\n)\nresult = exchange.get_execution_price(order_book, \"buy\", 10)" + }, { "lang": "javascript", "label": "Polymarket", @@ -7197,6 +7322,11 @@ "lang": "javascript", "label": "Hunch", "source": "import { Hunch } from \"pmxtjs\";\n\n// API key optional — enables faster catalog-backed lookups\nconst exchange = new Hunch({\n pmxtApiKey: \"YOUR_PMXT_API_KEY\",\n});\nconst orderBook = {\n bids: [{ price: 0.52, size: 100 }],\n asks: [{ price: 0.54, size: 100 }],\n timestamp: Date.now(),\n};\nconst result = exchange.getExecutionPrice(orderBook, \"buy\", 10);" + }, + { + "lang": "javascript", + "label": "Gaduin", + "source": "import { Gaduin } from \"pmxtjs\";\n\n// API key optional — enables faster catalog-backed lookups\nconst exchange = new Gaduin({\n pmxtApiKey: \"YOUR_PMXT_API_KEY\",\n});\nconst orderBook = {\n bids: [{ price: 0.52, size: 100 }],\n asks: [{ price: 0.54, size: 100 }],\n timestamp: Date.now(),\n};\nconst result = exchange.getExecutionPrice(orderBook, \"buy\", 10);" } ] } @@ -7357,6 +7487,11 @@ "label": "Hunch", "source": "import pmxt\n\n# API key optional — enables faster catalog-backed lookups\nexchange = pmxt.Hunch(\n pmxt_api_key=\"YOUR_PMXT_API_KEY\",\n)\norder_book = pmxt.OrderBook(\n bids=[pmxt.OrderLevel(price=0.52, size=100)],\n asks=[pmxt.OrderLevel(price=0.54, size=100)],\n)\nresult = exchange.get_execution_price_detailed(order_book, \"buy\", 10)" }, + { + "lang": "python", + "label": "Gaduin", + "source": "import pmxt\n\n# API key optional — enables faster catalog-backed lookups\nexchange = pmxt.Gaduin(\n pmxt_api_key=\"YOUR_PMXT_API_KEY\",\n)\norder_book = pmxt.OrderBook(\n bids=[pmxt.OrderLevel(price=0.52, size=100)],\n asks=[pmxt.OrderLevel(price=0.54, size=100)],\n)\nresult = exchange.get_execution_price_detailed(order_book, \"buy\", 10)" + }, { "lang": "javascript", "label": "Polymarket", @@ -7436,6 +7571,11 @@ "lang": "javascript", "label": "Hunch", "source": "import { Hunch } from \"pmxtjs\";\n\n// API key optional — enables faster catalog-backed lookups\nconst exchange = new Hunch({\n pmxtApiKey: \"YOUR_PMXT_API_KEY\",\n});\nconst orderBook = {\n bids: [{ price: 0.52, size: 100 }],\n asks: [{ price: 0.54, size: 100 }],\n timestamp: Date.now(),\n};\nconst result = await exchange.getExecutionPriceDetailed(orderBook, \"buy\", 10);" + }, + { + "lang": "javascript", + "label": "Gaduin", + "source": "import { Gaduin } from \"pmxtjs\";\n\n// API key optional — enables faster catalog-backed lookups\nconst exchange = new Gaduin({\n pmxtApiKey: \"YOUR_PMXT_API_KEY\",\n});\nconst orderBook = {\n bids: [{ price: 0.52, size: 100 }],\n asks: [{ price: 0.54, size: 100 }],\n timestamp: Date.now(),\n};\nconst result = await exchange.getExecutionPriceDetailed(orderBook, \"buy\", 10);" } ] } @@ -7601,6 +7741,11 @@ "label": "Hunch", "source": "import pmxt\n\n# API key optional — enables faster catalog-backed lookups\nexchange = pmxt.Hunch(\n pmxt_api_key=\"YOUR_PMXT_API_KEY\",\n)\nresult = exchange.filter_markets()" }, + { + "lang": "python", + "label": "Gaduin", + "source": "import pmxt\n\n# API key optional — enables faster catalog-backed lookups\nexchange = pmxt.Gaduin(\n pmxt_api_key=\"YOUR_PMXT_API_KEY\",\n)\nresult = exchange.filter_markets()" + }, { "lang": "javascript", "label": "Polymarket", @@ -7680,6 +7825,11 @@ "lang": "javascript", "label": "Hunch", "source": "import { Hunch } from \"pmxtjs\";\n\n// API key optional — enables faster catalog-backed lookups\nconst exchange = new Hunch({\n pmxtApiKey: \"YOUR_PMXT_API_KEY\",\n});\nconst result = await exchange.filterMarkets();" + }, + { + "lang": "javascript", + "label": "Gaduin", + "source": "import { Gaduin } from \"pmxtjs\";\n\n// API key optional — enables faster catalog-backed lookups\nconst exchange = new Gaduin({\n pmxtApiKey: \"YOUR_PMXT_API_KEY\",\n});\nconst result = await exchange.filterMarkets();" } ] } @@ -7845,6 +7995,11 @@ "label": "Hunch", "source": "import pmxt\n\n# API key optional — enables faster catalog-backed lookups\nexchange = pmxt.Hunch(\n pmxt_api_key=\"YOUR_PMXT_API_KEY\",\n)\nresult = exchange.filter_events()" }, + { + "lang": "python", + "label": "Gaduin", + "source": "import pmxt\n\n# API key optional — enables faster catalog-backed lookups\nexchange = pmxt.Gaduin(\n pmxt_api_key=\"YOUR_PMXT_API_KEY\",\n)\nresult = exchange.filter_events()" + }, { "lang": "javascript", "label": "Polymarket", @@ -7924,6 +8079,11 @@ "lang": "javascript", "label": "Hunch", "source": "import { Hunch } from \"pmxtjs\";\n\n// API key optional — enables faster catalog-backed lookups\nconst exchange = new Hunch({\n pmxtApiKey: \"YOUR_PMXT_API_KEY\",\n});\nconst result = await exchange.filterEvents();" + }, + { + "lang": "javascript", + "label": "Gaduin", + "source": "import { Gaduin } from \"pmxtjs\";\n\n// API key optional — enables faster catalog-backed lookups\nconst exchange = new Gaduin({\n pmxtApiKey: \"YOUR_PMXT_API_KEY\",\n});\nconst result = await exchange.filterEvents();" } ] } @@ -8052,6 +8212,11 @@ "label": "Hunch", "source": "import pmxt\n\n# API key optional — enables faster catalog-backed lookups\nexchange = pmxt.Hunch(\n pmxt_api_key=\"YOUR_PMXT_API_KEY\",\n)\nresult = exchange.close()" }, + { + "lang": "python", + "label": "Gaduin", + "source": "import pmxt\n\n# API key optional — enables faster catalog-backed lookups\nexchange = pmxt.Gaduin(\n pmxt_api_key=\"YOUR_PMXT_API_KEY\",\n)\nresult = exchange.close()" + }, { "lang": "javascript", "label": "Polymarket", @@ -8131,6 +8296,11 @@ "lang": "javascript", "label": "Hunch", "source": "import { Hunch } from \"pmxtjs\";\n\n// API key optional — enables faster catalog-backed lookups\nconst exchange = new Hunch({\n pmxtApiKey: \"YOUR_PMXT_API_KEY\",\n});\nconst result = await exchange.close();" + }, + { + "lang": "javascript", + "label": "Gaduin", + "source": "import { Gaduin } from \"pmxtjs\";\n\n// API key optional — enables faster catalog-backed lookups\nconst exchange = new Gaduin({\n pmxtApiKey: \"YOUR_PMXT_API_KEY\",\n});\nconst result = await exchange.close();" } ] } @@ -10102,6 +10272,7 @@ "suibets", "rain", "hunch", + "gaduin", "router" ] }, @@ -12673,6 +12844,23 @@ } ] }, + "gaduin": { + "className": "Gaduin", + "params": [ + { + "name": "pmxt_api_key", + "tsName": "pmxtApiKey", + "type": "string", + "description": "PMXT API key for hosted access" + }, + { + "name": "api_key", + "tsName": "apiKey", + "type": "string", + "description": "API key for authentication" + } + ] + }, "router": { "className": "Router", "params": [ diff --git a/docs/concepts/venues.mdx b/docs/concepts/venues.mdx index 8bf3b384..ece4801b 100644 --- a/docs/concepts/venues.mdx +++ b/docs/concepts/venues.mdx @@ -32,6 +32,7 @@ or `new pmxt.Polymarket({})` from the SDKs. | SuiBets | `suibets` | `POST /api/suibets/:method` | | Rain | `rain` | `POST /api/rain/:method` | | Hunch | `hunch` | `POST /api/hunch/:method` | +| GADUIN | `gaduin` | `POST /api/gaduin/:method` | This list is regenerated automatically from the `ExchangeParam` enum diff --git a/docs/introduction.mdx b/docs/introduction.mdx index 82c8a8f7..61f001e2 100644 --- a/docs/introduction.mdx +++ b/docs/introduction.mdx @@ -10,7 +10,7 @@ tag: "Start here" PMXT is a unified API for supported prediction-market venues — Polymarket, -Kalshi, Limitless, Smarkets, and [12 more venues](/concepts/venues). It uses +Kalshi, Limitless, Smarkets, and [13 more venues](/concepts/venues). It uses shared SDK method names and unified response shapes where each venue supports the underlying capability. diff --git a/docs/llms-full.txt b/docs/llms-full.txt index ab3c596e..74cab528 100644 --- a/docs/llms-full.txt +++ b/docs/llms-full.txt @@ -1,6 +1,6 @@ # PMXT — Full Documentation -> One API for supported prediction markets. Unified data and hosted catalog search across Polymarket, Kalshi, Limitless, Smarkets, and 12 more venues. Trading where venues expose writes. +> One API for supported prediction markets. Unified data and hosted catalog search across Polymarket, Kalshi, Limitless, Smarkets, and 13 more venues. Trading where venues expose writes. Docs: https://pmxt.dev/docs API Base: https://api.pmxt.dev @@ -23,7 +23,7 @@ Source: https://pmxt.dev/docs/introduction PMXT is a unified API for supported prediction-market venues — Polymarket, -Kalshi, Limitless, Smarkets, and [12 more venues](https://pmxt.dev/docs/concepts/venues). It uses +Kalshi, Limitless, Smarkets, and [13 more venues](https://pmxt.dev/docs/concepts/venues). It uses shared SDK method names and unified response shapes where each venue supports the underlying capability. @@ -1007,6 +1007,7 @@ or `new pmxt.Polymarket({})` from the SDKs. | SuiBets | `suibets` | `POST /api/suibets/:method` | | Rain | `rain` | `POST /api/rain/:method` | | Hunch | `hunch` | `POST /api/hunch/:method` | +| GADUIN | `gaduin` | `POST /api/gaduin/:method` | > **Note:** diff --git a/docs/llms.txt b/docs/llms.txt index 1403edd0..c896f9c2 100644 --- a/docs/llms.txt +++ b/docs/llms.txt @@ -1,6 +1,6 @@ # PMXT -> One API for supported prediction markets. Unified data and hosted catalog search across Polymarket, Kalshi, Limitless, Smarkets, and 12 more venues. Trading where venues expose writes. +> One API for supported prediction markets. Unified data and hosted catalog search across Polymarket, Kalshi, Limitless, Smarkets, and 13 more venues. Trading where venues expose writes. Docs: https://pmxt.dev/docs API Base: https://api.pmxt.dev diff --git a/readme.md b/readme.md index ee787221..2f3196af 100644 --- a/readme.md +++ b/readme.md @@ -78,6 +78,8 @@ Rain Rain      Hunch Hunch +      + GADUIN GADUIN

[Feature Support & Compliance](core/COMPLIANCE.md). diff --git a/scripts/generate-llms.js b/scripts/generate-llms.js index ebd51833..a247da1e 100644 --- a/scripts/generate-llms.js +++ b/scripts/generate-llms.js @@ -613,7 +613,7 @@ fullSections.push(errorCodesSection); const llmsTxtLines = [ "# PMXT", "", - "> One API for supported prediction markets. Unified data and hosted catalog search across Polymarket, Kalshi, Limitless, Smarkets, and 12 more venues. Trading where venues expose writes.", + "> One API for supported prediction markets. Unified data and hosted catalog search across Polymarket, Kalshi, Limitless, Smarkets, and 13 more venues. Trading where venues expose writes.", "", `Docs: ${BASE_URL}`, `API Base: https://api.pmxt.dev`, @@ -650,7 +650,7 @@ console.log(`wrote docs/llms.txt (${llmsTxtLines.length} lines)`); const header = [ "# PMXT — Full Documentation", "", - "> One API for supported prediction markets. Unified data and hosted catalog search across Polymarket, Kalshi, Limitless, Smarkets, and 12 more venues. Trading where venues expose writes.", + "> One API for supported prediction markets. Unified data and hosted catalog search across Polymarket, Kalshi, Limitless, Smarkets, and 13 more venues. Trading where venues expose writes.", "", `Docs: ${BASE_URL}`, `API Base: https://api.pmxt.dev`, diff --git a/scripts/generate-mintlify-docs.js b/scripts/generate-mintlify-docs.js index b1ce43d0..3a91cd44 100644 --- a/scripts/generate-mintlify-docs.js +++ b/scripts/generate-mintlify-docs.js @@ -48,6 +48,7 @@ const VENUE_LABELS = { suibets: 'SuiBets', rain: 'Rain', hunch: 'Hunch', + gaduin: 'GADUIN', }; const INTERNAL_EXCHANGE_TARGETS = new Set(['mock', 'router']); diff --git a/sdks/python/pmxt/__init__.py b/sdks/python/pmxt/__init__.py index 7c792ec3..1c2c0509 100644 --- a/sdks/python/pmxt/__init__.py +++ b/sdks/python/pmxt/__init__.py @@ -20,7 +20,7 @@ from .client import Exchange from .constants import ENV, ENV_BASE_URL, ENV_API_KEY -from ._exchanges import Polymarket, Limitless, Kalshi, KalshiDemo, Probable, Baozi, Myriad, Opinion, Metaculus, Smarkets, PolymarketUS, Polymarket_us, Hyperliquid, GeminiTitan, SuiBets, Suibets, Rain, Hunch, Mock, Router +from ._exchanges import Polymarket, Limitless, Kalshi, KalshiDemo, Probable, Baozi, Myriad, Opinion, Metaculus, Smarkets, PolymarketUS, Polymarket_us, Hyperliquid, GeminiTitan, SuiBets, Suibets, Rain, Hunch, Gaduin, Mock, Router from .router import Router from .feed_client import FeedClient from .server_manager import ServerManager @@ -192,6 +192,7 @@ def restart_server() -> None: "Suibets", "Rain", "Hunch", + "Gaduin", "Mock", "Router", "Exchange", diff --git a/sdks/python/pmxt/_exchanges.py b/sdks/python/pmxt/_exchanges.py index 2b1249c6..1052c54f 100644 --- a/sdks/python/pmxt/_exchanges.py +++ b/sdks/python/pmxt/_exchanges.py @@ -698,6 +698,43 @@ def __init__( ) +class Gaduin(Exchange): + """Gaduin exchange client.""" + + def __init__( + self, + api_key: Optional[str] = None, + base_url: Optional[str] = None, + auto_start_server: Optional[bool] = None, + pmxt_api_key: Optional[str] = None, + wallet_address: Optional[str] = None, + signer: Optional[object] = None, + websocket: Optional[dict] = None, + ) -> None: + """ + Initialize Gaduin client. + + Args: + api_key: API key for authentication (optional) + base_url: Base URL of the PMXT sidecar server + auto_start_server: Automatically start server if not running (default: True) + pmxt_api_key: Hosted PMXT API key (optional; enables hosted mode) + wallet_address: Wallet address for hosted reads/writes (optional) + signer: Custom signer for hosted writes (optional) + websocket: WebSocket transport configuration dict (optional) + """ + super().__init__( + exchange_name="gaduin", + api_key=api_key, + base_url=base_url, + auto_start_server=auto_start_server, + pmxt_api_key=pmxt_api_key, + wallet_address=wallet_address, + signer=signer, + websocket=websocket, + ) + + class Mock(Exchange): """Mock exchange client.""" diff --git a/sdks/typescript/index.ts b/sdks/typescript/index.ts index 63d78dd1..c389307b 100644 --- a/sdks/typescript/index.ts +++ b/sdks/typescript/index.ts @@ -19,7 +19,7 @@ */ -import { Exchange, Polymarket, Kalshi, KalshiDemo, Limitless, Myriad, Probable, Baozi, Opinion, Metaculus, Smarkets, PolymarketUS, Polymarket_us, GeminiTitan, Hyperliquid, SuiBets, Suibets, Rain, Hunch, Mock } from "./pmxt/client.js"; +import { Exchange, Polymarket, Kalshi, KalshiDemo, Limitless, Myriad, Probable, Baozi, Opinion, Metaculus, Smarkets, PolymarketUS, Polymarket_us, GeminiTitan, Hyperliquid, SuiBets, Suibets, Rain, Hunch, Gaduin, Mock } from "./pmxt/client.js"; import { Router } from "./pmxt/router.js"; import { ServerManager } from "./pmxt/server-manager.js"; import { FeedClient } from "./pmxt/feed-client.js"; @@ -28,7 +28,7 @@ import * as errors from "./pmxt/errors.js"; export const __version__ = "2.17.1"; -export { Exchange, Polymarket, Kalshi, KalshiDemo, Limitless, Myriad, Probable, Baozi, Opinion, Metaculus, Smarkets, PolymarketUS, Polymarket_us, GeminiTitan, Hyperliquid, SuiBets, Suibets, Rain, Hunch, Mock, PolymarketOptions } from "./pmxt/client.js"; +export { Exchange, Polymarket, Kalshi, KalshiDemo, Limitless, Myriad, Probable, Baozi, Opinion, Metaculus, Smarkets, PolymarketUS, Polymarket_us, GeminiTitan, Hyperliquid, SuiBets, Suibets, Rain, Hunch, Gaduin, Mock, PolymarketOptions } from "./pmxt/client.js"; export type { ExchangeOptions, SuiBetsOptions } from "./pmxt/client.js"; export { FeedClient } from "./pmxt/feed-client.js"; export type { Ticker, Tickers, OHLCV, Market as FeedMarket, OracleRound, FeedClientOptions } from "./pmxt/feed-client.js"; @@ -104,6 +104,7 @@ const pmxt = { Suibets, Rain, Hunch, + Gaduin, Mock, Router, ServerManager, diff --git a/sdks/typescript/pmxt/client.ts b/sdks/typescript/pmxt/client.ts index 04ddc27f..fab9bb78 100644 --- a/sdks/typescript/pmxt/client.ts +++ b/sdks/typescript/pmxt/client.ts @@ -3729,6 +3729,24 @@ export class Hunch extends Exchange { } } +/** + * GADUIN exchange client. + * + * GADUIN is a read-only venue for prediction markets on transport outcomes + * (flights, trains, ships). Every read needs a GADUIN API key. + * + * @example + * ```typescript + * const gaduin = new Gaduin({ apiKey: 'pk_live_...' }); + * const markets = await gaduin.fetchMarkets({ category: 'FLIGHT' }); + * ``` + */ +export class Gaduin extends Exchange { + constructor(options: ExchangeOptions = {}) { + super("gaduin", options); + } +} + /** * Mock exchange client. *