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
Adds an info: any field to the Position and Balance interfaces in types.ts, and populates it with the raw exchange response in 6 exchange normalizers: Hyperliquid, Kalshi, Limitless, Myriad, Polymarket, and Smarkets.
Blast Radius
core/src/types.ts -- core type definitions (all consumers affected)
6 exchange normalizers updated
OpenAPI schema (AST-derived, will auto-propagate on regeneration)
Python SDK models.py (needs manual update -- not done)
TypeScript SDK client.ts (pass-through via spread, will work)
Findings
CRITICAL: 5 exchanges missing info field: The Position interface now requires info (non-optional), but the following normalizers do NOT set it:
Since info is a required field (no ?), TypeScript compilation will fail for these exchanges. This is a build-breaking change.
CRITICAL: Myriad normalizePosition not updated: The diff shows info: rawItems added to normalizeBalance in Myriad, but normalizePosition at line 228 is not updated. The Myriad position normalizer will also fail to compile.
Python SDK models.py not updated: The Position and Balance dataclasses in sdks/python/pmxt/models.py do not have an info field. The _auto_convert function will silently drop the field (or fail depending on strictness). The info field should be added to both Python dataclasses as info: Any = None.
OpenAPI spec not regenerated: While the schema is now AST-derived from types.ts, the PR does not include a regenerated openapi.yaml. CI will likely fail the OpenAPI sync check.
info: any weakens type safety: Using any is the pragmatic choice for raw exchange data, but it means consumers get no type checking on the field. Consider info: unknown or info: Record<string, unknown> for slightly better safety, though any is consistent with how info is used in CCXT.
PMXT Pipeline Check
Field propagation: ISSUE (5+ exchange normalizers and Python SDK missing the field)
OpenAPI sync: ISSUE (spec not regenerated)
Type safety: ISSUE (required field not set in all implementations)
Semver Impact
minor -- adds a new field to public types (Position, Balance). Would be major if info stays required and breaks existing code that constructs these types.
Risk
This PR will not compile. All exchanges with normalizePosition or normalizeBalance must be updated before merge.
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.
Fixes #459