Skip to content

Warn when limit/stop increase may be liquidatable at trigger price FEDEV-2399#2582

Open
qwinndev wants to merge 6 commits into
releasefrom
fedev-2399-liquidatable-increase-warning
Open

Warn when limit/stop increase may be liquidatable at trigger price FEDEV-2399#2582
qwinndev wants to merge 6 commits into
releasefrom
fedev-2399-liquidatable-increase-warning

Conversation

@qwinndev

@qwinndev qwinndev commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Flags Limit Increase / Stop Increase orders that would leave the resulting position liquidatable at the trigger (execution) price, so the user knows upfront that the order cannot execute.

Linear: https://linear.app/gmx-io/issue/FEDEV-2399

Behavior

  • Order list: red critical error on the order Type column when executing the order at its trigger price would leave the resulting position liquidatable.
  • Tradebox / order editor: the same check as a yellow non-blocking warning while composing or editing a Limit/Stop Increase order.
  • A trigger beyond the current liq price is not flagged: the position would be liquidated before the trigger is reached, and the order would then open a new position.
  • Orders with no existing position are checked against the standalone position they would open (e.g. dust-collateral API orders that can only freeze on execution).
  • The existing Market Increase "Invalid liquidation price" block is scoped to market orders (!isLimit); resting limit/stop orders get the non-blocking treatment above.

Changes

  • getIsPositionLiquidatableAtPrice shared helper (+ unit tests).
  • selectTradeboxIncreaseLiquidationRiskWarning selector; LiquidatableIncreaseWarningCard shared by the tradebox and the order editor.
  • getOrderErrors: resultingLiquidatable critical for Limit/Stop Increase orders, simulated via makeSelectOrderEditorNextPositionValuesForIncrease at the order trigger price (+ unit tests).
  • Warning copy translated across all locales.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 24, 2026

Copy link
Copy Markdown

Deploying gmx-interface-home with  Cloudflare Pages  Cloudflare Pages

Latest commit: 2762a7f
Status: ✅  Deploy successful!
Preview URL: https://de55c0bd.gmx-interface-home.pages.dev
Branch Preview URL: https://fedev-2399-liquidatable-incr.gmx-interface-home.pages.dev

View logs

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 24, 2026

Copy link
Copy Markdown

Deploying gmx-interface with  Cloudflare Pages  Cloudflare Pages

Latest commit: 2762a7f
Status: ✅  Deploy successful!
Preview URL: https://330574df.gmx-interface.pages.dev
Branch Preview URL: https://fedev-2399-liquidatable-incr.gmx-interface.pages.dev

View logs

qwinndev added 2 commits July 2, 2026 16:35
…rigger price

- yellow non-blocking warning in the tradebox and order editor, red critical
  error in the order list Type column
- flags only orders whose position survives to the trigger: a trigger beyond
  the current liq price means the position is liquidated first and the order
  then opens a new position, so it is not flagged
- orders with no existing position are checked against the standalone
  position they would open
- the market-increase liquidation block in getIncreaseError is scoped to
  market orders (resting limit/stop orders are handled by the warning)
@qwinndev qwinndev force-pushed the fedev-2399-liquidatable-increase-warning branch from 4ea9f3e to 4290e46 Compare July 2, 2026 14:37
divhead
divhead previously approved these changes Jul 7, 2026
…table-increase-warning

# Conflicts:
#	src/domain/synthetics/trade/utils/__tests__/validation.spec.ts
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

Playwright Component Test Report

All tests passed.

View Report

Commit 2762a7f

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.

2 participants