diff --git a/core/api-doc-config.generated.json b/core/api-doc-config.generated.json index 50d74c7e..9daf67ae 100644 --- a/core/api-doc-config.generated.json +++ b/core/api-doc-config.generated.json @@ -1,5 +1,5 @@ { - "_generated": "Auto-generated by extract-jsdoc.js on 2026-06-08T09:58:54.515Z. Do not edit manually.", + "_generated": "Auto-generated by extract-jsdoc.js on 2026-06-08T11:11:42.806Z. Do not edit manually.", "methods": { "has": { "summary": "HTTP verb for the endpoint (e.g. GET, POST). */", diff --git a/core/specs/kalshi/Kalshi.yaml b/core/specs/kalshi/Kalshi.yaml index 2fc91f66..e1766c28 100644 --- a/core/specs/kalshi/Kalshi.yaml +++ b/core/specs/kalshi/Kalshi.yaml @@ -4096,8 +4096,7 @@ components: format: int64 description: Unix timestamp of the last update to the balance. balance_dollars: - type: number - format: double + $ref: '#/components/schemas/FixedPointDollars' description: Member's available balance in USD dollars. CreateSubaccountResponse: @@ -4853,8 +4852,8 @@ components: - price - yes_price - no_price - - yes_price_fixed - - no_price_fixed + - yes_price_dollars + - no_price_dollars - is_taker - fee_cost properties: @@ -4896,11 +4895,11 @@ components: no_price: type: integer description: Fill price for the no side in cents - yes_price_fixed: - type: string + yes_price_dollars: + $ref: '#/components/schemas/FixedPointDollars' description: Fill price for the yes side in fixed point dollars - no_price_fixed: - type: string + no_price_dollars: + $ref: '#/components/schemas/FixedPointDollars' description: Fill price for the no side in fixed point dollars is_taker: type: boolean diff --git a/core/specs/metaculus/Metaculus.yaml b/core/specs/metaculus/Metaculus.yaml index a0eb3738..7500db06 100644 --- a/core/specs/metaculus/Metaculus.yaml +++ b/core/specs/metaculus/Metaculus.yaml @@ -53,9 +53,9 @@ components: title: type: string example: "Binary Post title" - url_title: + short_title: type: string - example: "Binary Post url title" + example: "Binary Post short title" slug: type: string example: "numeric-post" diff --git a/core/specs/polymarket/PolymarketClobAPI.yaml b/core/specs/polymarket/PolymarketClobAPI.yaml index 311a3b36..a7781b63 100644 --- a/core/specs/polymarket/PolymarketClobAPI.yaml +++ b/core/specs/polymarket/PolymarketClobAPI.yaml @@ -989,7 +989,7 @@ paths: - L2Auth: [] parameters: - $ref: '#/components/parameters/L2Headers' - - name: orderId + - name: order_id in: query required: true schema: diff --git a/core/specs/polymarket/Polymarket_Data_API.yaml b/core/specs/polymarket/Polymarket_Data_API.yaml index 9f46f99b..2a61cc44 100644 --- a/core/specs/polymarket/Polymarket_Data_API.yaml +++ b/core/specs/polymarket/Polymarket_Data_API.yaml @@ -372,6 +372,11 @@ paths: name: user schema: $ref: '#/components/schemas/Address' + - in: query + name: maker_address + schema: + $ref: '#/components/schemas/Address' + description: Maker address filter for trade lookups. - in: query name: side schema: @@ -379,15 +384,30 @@ paths: enum: - BUY - SELL + - in: query + name: next_cursor + schema: + type: string + description: Cursor for fetching the next page of trades. responses: '200': description: Success content: application/json: schema: - type: array - items: - $ref: '#/components/schemas/Trade' + type: object + properties: + limit: + type: integer + next_cursor: + type: string + nullable: true + count: + type: integer + data: + type: array + items: + $ref: '#/components/schemas/Trade' '400': description: Bad Request content: diff --git a/core/src/exchanges/hyperliquid/utils.ts b/core/src/exchanges/hyperliquid/utils.ts index 4675e4d0..7ff6bdb3 100644 --- a/core/src/exchanges/hyperliquid/utils.ts +++ b/core/src/exchanges/hyperliquid/utils.ts @@ -54,12 +54,12 @@ export function fromCoinEncoding(encoding: number): { outcomeId: number; side: ' /** * Convert an outcome ID to the allMids lookup key. * - * The allMids endpoint keys prediction-market outcomes as "@{outcomeId}" - * (e.g. "@8"), which is distinct from the "#encoding" coin notation used - * for orders and positions. + * The allMids endpoint keys HIP-4 prediction-market outcomes using the same + * "#encoding" form as coin notation. For the Yes side, encoding is + * 10 * outcomeId + 0 (e.g. outcome 8 -> "#80"). */ export function toMidKey(outcomeId: number): string { - return `@${outcomeId}`; + return toCoinNotation(outcomeId, 'yes'); } /** diff --git a/core/src/exchanges/metaculus/utils.ts b/core/src/exchanges/metaculus/utils.ts index 5360f613..da557c6b 100644 --- a/core/src/exchanges/metaculus/utils.ts +++ b/core/src/exchanges/metaculus/utils.ts @@ -6,7 +6,7 @@ import { buildSourceMetadata } from "../../utils/metadata"; // — excluded from sourceMetadata so we capture only what the unified shape drops. const METACULUS_PROMOTED_MARKET_KEYS = [ // identity / slug - 'id', 'slug', 'url_title', + 'id', 'slug', 'short_title', 'url_title', // title 'title', // description lives inside question / group_of_questions — those are excluded below @@ -24,7 +24,7 @@ const METACULUS_PROMOTED_MARKET_KEYS = [ // Raw Metaculus Post fields already promoted to first-class UnifiedEvent columns. export const METACULUS_PROMOTED_EVENT_KEYS = [ - 'id', 'slug', 'url_title', + 'id', 'slug', 'short_title', 'url_title', 'title', 'question', 'group_of_questions', 'projects', @@ -282,7 +282,7 @@ export function mapMarketToUnified(post: any, eventId?: string, groupPostId?: nu question.description ?? question.resolution_criteria ?? "", - slug: post.slug ?? post.url_title ?? undefined, + slug: post.slug ?? post.short_title ?? post.url_title ?? undefined, outcomes, resolutionDate, volume24h: 0, // Metaculus has no monetary volume @@ -334,6 +334,7 @@ function mapGroupPostToMarkets(post: any, eventId?: string): UnifiedMarket[] { question: subQuestion, // Inherit metadata from the parent post slug: post.slug, + short_title: post.short_title, url_title: post.url_title, projects: post.projects, nr_forecasters: subQuestion.nr_forecasters ?? post.nr_forecasters, diff --git a/core/src/exchanges/polymarket/api-clob.ts b/core/src/exchanges/polymarket/api-clob.ts index 69d3427b..bcf42f84 100644 --- a/core/src/exchanges/polymarket/api-clob.ts +++ b/core/src/exchanges/polymarket/api-clob.ts @@ -512,7 +512,7 @@ export const polymarketClobSpec = { "$ref": "#/components/parameters/L2Headers" }, { - "name": "orderId", + "name": "order_id", "in": "query", "required": true, "schema": { diff --git a/core/src/exchanges/polymarket/api-data.ts b/core/src/exchanges/polymarket/api-data.ts index 8e3e42e5..79fc9212 100644 --- a/core/src/exchanges/polymarket/api-data.ts +++ b/core/src/exchanges/polymarket/api-data.ts @@ -329,6 +329,13 @@ export const polymarketDataSpec = { "$ref": "#/components/schemas/Address" } }, + { + "in": "query", + "name": "maker_address", + "schema": { + "$ref": "#/components/schemas/Address" + } + }, { "in": "query", "name": "side", @@ -339,6 +346,13 @@ export const polymarketDataSpec = { "SELL" ] } + }, + { + "in": "query", + "name": "next_cursor", + "schema": { + "type": "string" + } } ] } diff --git a/core/src/exchanges/polymarket/fetcher.ts b/core/src/exchanges/polymarket/fetcher.ts index 785f5e48..c1c9d5ac 100644 --- a/core/src/exchanges/polymarket/fetcher.ts +++ b/core/src/exchanges/polymarket/fetcher.ts @@ -83,6 +83,8 @@ export interface PolymarketRawOrderBook { bids?: PolymarketRawOrderBookLevel[]; asks?: PolymarketRawOrderBookLevel[]; timestamp?: string | number; + tick_size?: string; + min_order_size?: string; } export interface PolymarketRawTrade { @@ -278,8 +280,8 @@ export class PolymarketFetcher implements IExchangeFetcher, POLYMARKET_US_PROMOTED_MARKET_KEYS, diff --git a/core/src/server/openapi.yaml b/core/src/server/openapi.yaml index c82d3771..7b438695 100644 --- a/core/src/server/openapi.yaml +++ b/core/src/server/openapi.yaml @@ -2953,6 +2953,9 @@ components: tickSize: type: number description: 'Minimum price increment (e.g., 0.01, 0.001)' + minOrderSize: + type: number + description: 'Minimum tradeable quantity/contracts for this market, when venue-provided' status: type: string description: 'Venue-native lifecycle status (e.g. ''active'', ''closed'', ''archived'').' @@ -3187,6 +3190,12 @@ components: datetime: type: string description: ISO 8601 datetime string of the snapshot (CCXT-compatible). + tickSize: + type: number + description: Venue-provided minimum price increment for orders against this book. + minOrderSize: + type: number + description: Venue-provided minimum order size/contracts for this book. required: - bids - asks diff --git a/core/src/types.ts b/core/src/types.ts index e9bdda9a..96681a68 100644 --- a/core/src/types.ts +++ b/core/src/types.ts @@ -89,6 +89,7 @@ export interface UnifiedMarket { /** Optional list of tags. More granular than category — e.g. ["Crypto", "Crypto Prices", "Bitcoin"] or ["Politics", "Elections", "Trump"]. Tags vary by venue: Polymarket markets carry several, Kalshi typically one. */ tags?: string[]; tickSize?: number; // Minimum price increment (e.g., 0.01, 0.001) + minOrderSize?: number; // Minimum tradeable quantity/contracts for this market, when venue-provided /** Venue-native lifecycle status (e.g. 'active', 'closed', 'archived'). */ status?: string; @@ -183,6 +184,10 @@ export interface OrderBook { timestamp?: number; /** ISO 8601 datetime string of the snapshot (CCXT-compatible). */ datetime?: string; + /** Venue-provided minimum price increment for orders against this book. */ + tickSize?: number; + /** Venue-provided minimum order size/contracts for this book. */ + minOrderSize?: number; } export interface Trade { diff --git a/docs/api-reference/openapi.json b/docs/api-reference/openapi.json index 628c6b9a..bfd464f4 100644 --- a/docs/api-reference/openapi.json +++ b/docs/api-reference/openapi.json @@ -9466,6 +9466,10 @@ "type": "number", "description": "Minimum price increment (e.g., 0.01, 0.001)" }, + "minOrderSize": { + "type": "number", + "description": "Minimum tradeable quantity/contracts for this market, when venue-provided" + }, "status": { "type": "string", "description": "Venue-native lifecycle status (e.g. 'active', 'closed', 'archived')." @@ -9773,6 +9777,14 @@ "datetime": { "type": "string", "description": "ISO 8601 datetime string of the snapshot (CCXT-compatible)." + }, + "tickSize": { + "type": "number", + "description": "Venue-provided minimum price increment for orders against this book." + }, + "minOrderSize": { + "type": "number", + "description": "Venue-provided minimum order size/contracts for this book." } }, "required": [ diff --git a/sdks/python/API_REFERENCE.md b/sdks/python/API_REFERENCE.md index 7ecc5224..57bfb5e2 100644 --- a/sdks/python/API_REFERENCE.md +++ b/sdks/python/API_REFERENCE.md @@ -1466,6 +1466,7 @@ image: str # Optional image URL for the market. category: str # Optional category label. Venue-defined — common values include "Sports", "Politics", "Crypto", "Economics", "Science", "Culture". Polymarket uses finer-grained categories like "Bitcoin", "Soccer", "Economic Policy"; Kalshi uses broader ones like "Sports" or "Mentions". tags: List[string] # Optional list of tags. More granular than category — e.g. ["Crypto", "Crypto Prices", "Bitcoin"] or ["Politics", "Elections", "Trump"]. Tags vary by venue: Polymarket markets carry several, Kalshi typically one. tick_size: float # Minimum price increment (e.g., 0.01, 0.001) +min_order_size: float # Minimum tradeable quantity/contracts for this market, when venue-provided status: str # Venue-native lifecycle status (e.g. 'active', 'closed', 'archived'). contract_address: str # On-chain contract / condition identifier where applicable (Polymarket conditionId, etc.). source_metadata: object # Raw venue-specific metadata not captured by first-class fields (e.g. Kalshi series_ticker / series_title from the parent event, Polymarket series). Passed through verbatim so downstream consumers can recover anything the unified shape omits. Each venue populates what it has. @@ -1564,6 +1565,8 @@ bids: List[OrderLevel] # Order book bid levels, sorted by price descending. asks: List[OrderLevel] # Order book ask levels, sorted by price ascending. timestamp: float # Unix timestamp in milliseconds when the snapshot was taken. datetime: str # ISO 8601 datetime string of the snapshot (CCXT-compatible). +tick_size: float # Venue-provided minimum price increment for orders against this book. +min_order_size: float # Venue-provided minimum order size/contracts for this book. ``` --- @@ -2813,7 +2816,7 @@ Check Order Reward Scoring *(Auth required)* **Parameters:** - `` (, string) -- `orderId` (query, string) **required** +- `order_id` (query, string) **required** --- ##### `postOrdersScoring` @@ -2927,7 +2930,9 @@ Get trades for a user or markets - `market` (query, array) — Comma-separated list of condition IDs. Mutually exclusive with eventId. - `eventId` (query, array) — Comma-separated list of event IDs. Mutually exclusive with market. - `user` (query, string) +- `maker_address` (query, string) — Maker address filter for trade lookups. - `side` (query, string) — enum: `BUY,SELL` +- `next_cursor` (query, string) — Cursor for fetching the next page of trades. --- ##### `getActivity` diff --git a/sdks/typescript/API_REFERENCE.md b/sdks/typescript/API_REFERENCE.md index a2d42f0b..0d7bc0f3 100644 --- a/sdks/typescript/API_REFERENCE.md +++ b/sdks/typescript/API_REFERENCE.md @@ -1466,6 +1466,7 @@ image: string; // Optional image URL for the market. category: string; // Optional category label. Venue-defined — common values include "Sports", "Politics", "Crypto", "Economics", "Science", "Culture". Polymarket uses finer-grained categories like "Bitcoin", "Soccer", "Economic Policy"; Kalshi uses broader ones like "Sports" or "Mentions". tags: string[]; // Optional list of tags. More granular than category — e.g. ["Crypto", "Crypto Prices", "Bitcoin"] or ["Politics", "Elections", "Trump"]. Tags vary by venue: Polymarket markets carry several, Kalshi typically one. tickSize: number; // Minimum price increment (e.g., 0.01, 0.001) +minOrderSize: number; // Minimum tradeable quantity/contracts for this market, when venue-provided status: string; // Venue-native lifecycle status (e.g. 'active', 'closed', 'archived'). contractAddress: string; // On-chain contract / condition identifier where applicable (Polymarket conditionId, etc.). sourceMetadata: object; // Raw venue-specific metadata not captured by first-class fields (e.g. Kalshi series_ticker / series_title from the parent event, Polymarket series). Passed through verbatim so downstream consumers can recover anything the unified shape omits. Each venue populates what it has. @@ -1564,6 +1565,8 @@ bids: OrderLevel[]; // Order book bid levels, sorted by price descending. asks: OrderLevel[]; // Order book ask levels, sorted by price ascending. timestamp: number; // Unix timestamp in milliseconds when the snapshot was taken. datetime: string; // ISO 8601 datetime string of the snapshot (CCXT-compatible). +tickSize: number; // Venue-provided minimum price increment for orders against this book. +minOrderSize: number; // Venue-provided minimum order size/contracts for this book. } ``` @@ -2814,7 +2817,7 @@ Check Order Reward Scoring *(Auth required)* **Parameters:** - `` (, string) -- `orderId` (query, string) **required** +- `order_id` (query, string) **required** --- ##### `postOrdersScoring` @@ -2928,7 +2931,9 @@ Get trades for a user or markets - `market` (query, array) — Comma-separated list of condition IDs. Mutually exclusive with eventId. - `eventId` (query, array) — Comma-separated list of event IDs. Mutually exclusive with market. - `user` (query, string) +- `maker_address` (query, string) — Maker address filter for trade lookups. - `side` (query, string) — enum: `BUY,SELL` +- `next_cursor` (query, string) — Cursor for fetching the next page of trades. --- ##### `getActivity`