Skip to content

fix(client): handle tokens without trades - #257

Merged
kartojal merged 3 commits into
mainfrom
fix/last-trade-no-trade-side
Aug 11, 2026
Merged

fix(client): handle tokens without trades#257
kartojal merged 3 commits into
mainfrom
fix/last-trade-no-trade-side

Conversation

@kartojal

@kartojal kartojal commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Returns None for a token without trades and documents the placeholder price response.

DEV-506


Note

Medium Risk
Breaking change: callers must handle LastTradePrice | None on get_last_trade_price; behavior is limited to CLOB read parsing with no auth or trading impact.

Overview
get_last_trade_price now returns None when the CLOB responds with an empty side (the API’s placeholder for tokens that have never traded), instead of surfacing a bogus LastTradePrice.

Parsing goes through a new _LastTradePriceResponse in clob actions that accepts side: "" and maps it to None. Return types and docstrings are updated on public, secure, and async clients; get_last_trade_prices docs note that untraded tokens are omitted and results must be matched by token_id, not by input order.

The market_prices example prints N/A when there is no last trade. Unit/transport tests cover the no-trade response.

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

@kartojal
kartojal marked this pull request as ready for review August 7, 2026 10:15
@kartojal
kartojal requested a review from naruto11eth August 11, 2026 09:11

@naruto11eth naruto11eth left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approved — matches the merged ts-sdk #279 design

@kartojal
kartojal merged commit 39b9075 into main Aug 11, 2026
7 checks passed
@kartojal
kartojal deleted the fix/last-trade-no-trade-side branch August 11, 2026 16:06
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.

2 participants