fix(symbolConverter): return 0 szDecimals for outcome markets - #195
Open
pucedoteth wants to merge 1 commit into
Open
pucedoteth wants to merge 1 commit into
pucedoteth wants to merge 1 commit into
Conversation
Outcome shares trade in whole units. The Hyperliquid app formats outcome markets with szDecimals 0, and live mainnet outcome trades, open orders and balances all have integer sizes. Reporting 5 let formatSize keep fractional share sizes and made formatPrice cap prices at 1 decimal (perp) or 3 decimals (spot), so a 0.29128 quote was truncated to 0.2 or 0.291. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
JulienKervarrec
added a commit
to JulienKervarrec/hyperliquid
that referenced
this pull request
Sep 25, 2026
…he loop Same behaviour as before: a slug produced by more than one outcome side is left unregistered. Registration now stays as on main and the ambiguous slugs are removed afterwards, so the szDecimals lines touched by nktkas#195 are left alone and the two changes merge cleanly in either order. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Julien Kervarrec <114134889+JulienKervarrec@users.noreply.github.com>
JulienKervarrec
added a commit
to JulienKervarrec/hyperliquid
that referenced
this pull request
Sep 25, 2026
The collision test only needs to know that a unique slug is still registered. Checking for a numeric szDecimals instead of 5 keeps it valid if nktkas#195 changes that value. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Julien Kervarrec <114134889+JulienKervarrec@users.noreply.github.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
SymbolConverter.getSzDecimalsreturns5for every outcome market, but outcome shares trade in whole units, so it should be0.Evidence:
app.hyperliquid.xyz/assets/index-*.js) builds outcome rows withszDecimals:0,coinKind:"outcome".recentTradesacross 304 outcome coins, then 332 open outcome orders and 267 non-zero outcome balances from 96 of the traders. Every size was an integer.Since
getSzDecimalsfeeds both formatters,5breaks orders built the waydocs/guides/market-orders.mdshows:0.29128is a real resting bid on#32530. With5, an IOC buy priced off it gets cut to0.2and doesn't fill.The change is the constant in
_processOutcomeMarkets, plus the JSDoc example,docs/utilities.mdand the outcomegetSzDecimals()test.Type of change
Testing
deno test -A tests/utils/symbolConverter.test.ts: 2 passed (27 steps). With onlysrc/utils/_symbolConverter.tsreverted, the outcomegetSzDecimals()step fails (5vs0).deno task checkpasses (fmt, lint, type check, jsdoc sync, export sync).Written with AI assistance (Claude Code).
🤖 Generated with Claude Code