From 735f3ef624337d69d6658752dcc2811579f37784 Mon Sep 17 00:00:00 2001 From: saml33 Date: Fri, 18 Oct 2024 13:01:46 +1100 Subject: [PATCH] fix missing dependency for perp order price calc --- components/trade/AdvancedTradeForm.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/components/trade/AdvancedTradeForm.tsx b/components/trade/AdvancedTradeForm.tsx index 0f0ad3f6..c11542ad 100644 --- a/components/trade/AdvancedTradeForm.tsx +++ b/components/trade/AdvancedTradeForm.tsx @@ -671,10 +671,11 @@ const AdvancedTradeForm = () => { } } catch (e) { //simple fallback if something go wrong - const maxSlippage = 0.025 orderPrice = price * - (tradeForm.side === 'buy' ? 1 + maxSlippage : 1 - maxSlippage) + (tradeForm.side === 'buy' + ? 1 + MAX_PERP_SLIPPAGE + : 1 - MAX_PERP_SLIPPAGE) } notify({ type: 'info', @@ -817,7 +818,7 @@ const AdvancedTradeForm = () => { } finally { setPlacingOrder(false) } - }, [isFormValid, oraclePrice, soundSettings, tickDecimals]) + }, [calcOrderPrice, isFormValid, poolIsPerpReadyForRefresh, soundSettings]) const handleTriggerOrder = useCallback(() => { const mangoAccount = mangoStore.getState().mangoAccount.current