Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix(core): type live numeric response fields#1217

Open
realfishsam wants to merge 1 commit into
main from
fix/response-drift-numeric-fields-1211-1213
Open

fix(core): type live numeric response fields #1217
realfishsam wants to merge 1 commit into
main from
fix/response-drift-numeric-fields-1211-1213

Conversation

@realfishsam

@realfishsam realfishsam commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Type Limitless live volume / volumeFormatted payload fields as number | string
  • Type Probable live volume24hr / volume / liquidity payload fields as number | string
  • Add regression coverage that Polymarket, Limitless, and Probable string numeric fields normalize to numbers

Fixes #1211
Fixes #1212
Fixes #1213

Test Plan

  • npm test --workspace=pmxt-core -- --runTestsByPath test/normalizers/exchange-normalizers.test.ts test/normalizers/exchange-normalizers-2.test.ts (300 passed)
  • npm run build --workspace=pmxt-core

Copy link
Copy Markdown
Contributor Author

Validation update:

Copy link
Copy Markdown
Contributor Author

PR Review: PASS (NOT VERIFIED)

What This Does

Updates the core raw venue TypeScript models so live numeric fields that arrive as strings from Limitless and Probable are typed as number | string. This matters to SDK consumers because the existing normalizers already coerce those fields to numeric unified volume / liquidity values, and the raw types now match the venue payloads instead of forcing casts.

Blast Radius

Core exchange raw types for Limitless and Probable plus normalizer regression tests. No OpenAPI schema, SDK shim, auth, router, or generated SDK files are changed.

Consumer Verification

Before (base branch):
Static contract only: the old raw interfaces modeled LimitlessRawMarket.volumeFormatted, LimitlessRawMarket.volume, ProbableRawMarket.volume24hr, ProbableRawMarket.volume, and ProbableRawMarket.liquidity as number only, even though the PR fixtures describe live venue responses where those fields can be strings. I did not run a live consumer API before/after because this PR changes TypeScript source typing/test coverage, not runtime normalization logic.

After (PR branch):
Static contract now accepts the observed response drift:

// core/src/exchanges/limitless/fetcher.ts
volumeFormatted?: number | string;
volume?: number | string;
// core/src/exchanges/probable/fetcher.ts
volume24hr?: number | string;
volume?: number | string;
liquidity?: number | string;

Focused normalizer tests confirm string numeric fixtures still normalize to number-valued unified fields.

Test Results

  • Build: PASS (npm run build --workspace=pmxt-core)
  • Unit tests: PASS (300 passed, 0 failed: test/normalizers/exchange-normalizers.test.ts, test/normalizers/exchange-normalizers-2.test.ts)
  • Server starts: PASS (GET /health succeeded on local sidecar)
  • E2E smoke: NOT VERIFIED (no live venue/API consumer delta; runtime code path is unchanged)

Findings

No blocking findings.

PMXT Pipeline Check

  • Field propagation (3-layer): N/A — no unified field or schema change; raw input typing only
  • OpenAPI sync: N/A
  • Financial precision: OK — no new arithmetic; existing normalizer coercion is covered by tests
  • Type safety: OK — raw interfaces now match observed string-or-number venue payloads
  • Auth safety: N/A

Semver Impact

patch -- type accuracy/regression coverage for existing normalized fields, with no public response-shape change.

Risk

Live venue verification was not performed, so this review verifies the static type contract and normalizer behavior rather than a live Limitless/Probable sidecar response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

AltStyle によって変換されたページ (->オリジナル) /