You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SuiBets updated their live API to nest critical liquidity data inside a new onchainState object. Because PMXT's SuibetsRawOffer interface did not model this nested object, the makerRemaining data was being silently dropped during normalization, resulting in inaccurate size calculations for the order book.
This PR:
Updates the SuibetsRawOffer interface to explicitly model the onchainState payload.
Threads onchainState.makerRemaining through normalizer.ts so order book levels now reflect true resting liquidity rather than placeholder zeroes.
Implements safe fallbacks to prevent NaN pollution if the object is missing.
Models SuiBets onchainState on raw offers and uses onchainState.makerRemaining ahead of legacy remainingStake / creatorStake when normalizing market liquidity. SDK consumers should see more accurate market.liquidity when SuiBets returns live on-chain remaining liquidity.
Blast Radius
SuiBets fetch/normalize path only: core/src/exchanges/suibets/fetcher.ts and normalizer.ts. No SDK surface, OpenAPI schema, router, or auth changes.
Consumer Verification
Before (base branch):
Static consumer-path trace: normalizeMarket() computed liquidity from remainingStake ?? creatorStake, so a raw offer with only onchainState.makerRemaining would ignore the live on-chain amount.
After (PR branch):
Static trace: liquidity() now uses offer.onchainState?.makerRemaining ?? offer.remainingStake ?? offer.creatorStake (core/src/exchanges/suibets/normalizer.ts:14-17). I could not verify against the live SuiBets API from the consumer HTTP sidecar path in this run.
Test Results
Build: PASS for current main core build during scheduled run
Unit tests: PASS for current main core Jest (699 passed, 3 skipped)
Server starts: NOT VERIFIED for this PR head
E2E smoke: NOT VERIFIED (no live SuiBets consumer call completed)
Findings
No blocking findings.
PMXT Pipeline Check
Field propagation (3-layer): N/A (existing liquidity field only)
OpenAPI sync: N/A
Financial precision: OK (existing mistToSui conversion path is reused)
Type safety: OK
Auth safety: N/A
Semver Impact
patch -- exchange normalizer bug fix for an existing field.
Risk
Live SuiBets payload shape was not independently fetched; if makerRemaining units differ from legacy mist-denominated stake fields, consumer liquidity would still be wrong.
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
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.
Description
Fixes #1354.
SuiBets updated their live API to nest critical liquidity data inside a new
onchainStateobject. Because PMXT'sSuibetsRawOfferinterface did not model this nested object, themakerRemainingdata was being silently dropped during normalization, resulting in inaccurate size calculations for the order book.This PR:
SuibetsRawOfferinterface to explicitly model theonchainStatepayload.onchainState.makerRemainingthroughnormalizer.tsso order book levels now reflect true resting liquidity rather than placeholder zeroes.NaNpollution if the object is missing.