Skip to content

fix(ts-sdk): align execution price calculation - #2026

Closed
Purin1410 wants to merge 1 commit into
pmxt-dev:mainfrom
Purin1410:codex/fix-1970-execution-price
Closed

fix(ts-sdk): align execution price calculation#2026
Purin1410 wants to merge 1 commit into
pmxt-dev:mainfrom
Purin1410:codex/fix-1970-execution-price

Conversation

@Purin1410

Copy link
Copy Markdown

Summary

  • Reuse getExecutionPriceDetailed in the TypeScript helper.
  • Sort levels consistently, ignore non-positive sizes, and preserve the 0 result when liquidity is insufficient.

Test plan

  • npm test --workspace=pmxtjs -- --runInBand tests/execution-price-detailed-local.test.ts
  • npm test --workspace=pmxtjs -- --runInBand
  • npm run build --workspace=pmxtjs
  • git diff --check origin/main...HEAD

Note

Amounts less than or equal to zero now use the detailed helper's existing validation behavior.

Fixes #1460

@Purin1410
Purin1410 force-pushed the codex/fix-1970-execution-price branch from a6bc91d to dfb5832 Compare August 12, 2026 07:07
@Purin1410

Copy link
Copy Markdown
Author

Replaced by #2029 after renaming the source branch.

@Purin1410 Purin1410 closed this Aug 12, 2026
@Purin1410
Purin1410 deleted the codex/fix-1970-execution-price branch August 12, 2026 07:52
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.

SDK drift: TypeScript getExecutionPrice doesn't sort/filter order book levels, unlike getExecutionPriceDetailed and unlike Python's get_execution_price

1 participant