Skip to content

feat: show current liquidation price alongside new price in margin modal (fixes #4)#204

Open
jiangyj545 wants to merge 1 commit into
capofficial:mainfrom
jiangyj545:fix/liquidation-price-margin-4
Open

feat: show current liquidation price alongside new price in margin modal (fixes #4)#204
jiangyj545 wants to merge 1 commit into
capofficial:mainfrom
jiangyj545:fix/liquidation-price-margin-4

Conversation

@jiangyj545
Copy link
Copy Markdown

Summary

Fixes #4: Show both current and new liquidation prices in the Add/Remove Margin modal.

Problem

The Edit Margin modal only showed the "New Liq. Price" after entering a margin amount. Users could not easily compare the current vs new liquidation price.

Solution

Added a "Current Liq. Price" row above the existing "New Liq. Price" row, displaying data.position.liqprice (the position's current liquidation price). This gives users full clarity on how their margin change affects liquidation risk.

Changes

  • File: src/components/modals/EditMargin.svelte
  • Added 1 LabelValue row showing current liq price (data.position.liqprice)
  • No logic changes — the calculation was already implemented
  • Build verified: npx rollup -c

Screenshot (before/after)

Before: Only "New Liq. Price" shown
After: Both "Current Liq. Price" and "New Liq. Price" shown for easy comparison

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.

Show new liquidation price when adding or removing margin

1 participant