Skip to content

fix: narrow OrderBookSummary.tick_size from string to TickSize - #93

Open
osr21 wants to merge 1 commit into
Polymarket:mainfrom
osr21:fix/orderbook-tick-size-type
Open

fix: narrow OrderBookSummary.tick_size from string to TickSize#93
osr21 wants to merge 1 commit into
Polymarket:mainfrom
osr21:fix/orderbook-tick-size-type

Conversation

@osr21

@osr21 osr21 commented Jul 24, 2026

Copy link
Copy Markdown

Problem

OrderBookSummary.tick_size is typed as string but the CLOB API always returns a value that is one of the TickSize literals ("0.1" | "0.01" | "0.005" | "0.0025" | "0.001" | "0.0001"). Callers must cast or validate before passing tick_size to anything that accepts TickSize.

Fix

Change tick_size: stringtick_size: TickSize in the OrderBookSummary interface in src/types/clob.ts. TickSize is already defined in the same file, so no import is needed.

Fixes #50


Note

Low Risk
Type-only change with no runtime behavior; may surface compile errors where callers assumed an arbitrary string.

Overview
Narrows OrderBookSummary.tick_size from string to the existing TickSize union in src/types/clob.ts, matching what the CLOB order book API actually returns.

Consumers of getOrderBook / getOrderBooks can pass tick_size into CreateOrderOptions and related helpers without extra casts or runtime checks.

Reviewed by Cursor Bugbot for commit 12f6cb9. Bugbot is set up for automated code reviews on this repo. Configure here.

The CLOB API always returns a tick_size value that is one of the defined
TickSize literals ("0.1" | "0.01" | "0.005" | "0.0025" | "0.001" | "0.0001").
Typing the field as plain string forces callers to validate/cast before
passing it to functions that accept TickSize.

Change: tick_size: string → tick_size: TickSize in OrderBookSummary.
TickSize is defined in the same file so no import is needed.

Fixes: Polymarket#50
@osr21
osr21 requested a review from a team as a code owner July 24, 2026 06:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Isn't getOrderBook's return type supposed to have tick_size: TickSize?

1 participant