Skip to content

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

Open
kartojal wants to merge 3 commits into
mainfrom
fix/last-trade-no-trade-side
Open

fix(client): handle tokens without trades#257
kartojal wants to merge 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
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.

1 participant