Skip to content

Commit

Permalink
fix missing dependency for perp order price calc
Browse files Browse the repository at this point in the history
  • Loading branch information
saml33 committed Oct 18, 2024
1 parent 51ffc98 commit 735f3ef
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions components/trade/AdvancedTradeForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 735f3ef

Please sign in to comment.