Skip to content

Commit bac12b5

Browse files
committed
fix: address self-review feedback (TAT-3086)
1 parent 4bc2e98 commit bac12b5

1 file changed

Lines changed: 6 additions & 18 deletions

File tree

app/components/UI/Perps/Views/PerpsOrderView/PerpsOrderView.tsx

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -677,27 +677,15 @@ const PerpsOrderViewContentBase: React.FC<PerpsOrderViewContentProps> = ({
677677
});
678678

679679
// Memoize liquidation price params to prevent infinite recalculation
680-
const liquidationPriceParams = useMemo(() => {
681-
// Use limit price for limit orders, market price for market orders
682-
const entryPrice =
683-
orderForm.type === 'limit' && orderForm.limitPrice
684-
? parseFloat(orderForm.limitPrice)
685-
: assetData.price;
686-
687-
return {
688-
entryPrice,
680+
const liquidationPriceParams = useMemo(
681+
() => ({
682+
entryPrice: effectivePrice,
689683
leverage: orderForm.leverage,
690684
direction: orderForm.direction,
691685
asset: orderForm.asset,
692-
};
693-
}, [
694-
assetData.price,
695-
orderForm.leverage,
696-
orderForm.direction,
697-
orderForm.asset,
698-
orderForm.type,
699-
orderForm.limitPrice,
700-
]);
686+
}),
687+
[effectivePrice, orderForm.leverage, orderForm.direction, orderForm.asset],
688+
);
701689

702690
const depositAmount = useMemo(() => {
703691
if (marginRequired !== undefined && marginRequired !== null) {

0 commit comments

Comments
 (0)