refresh size when changing markets

This commit is contained in:
Maximilian Schneider 2021-10-01 18:26:06 +02:00
parent eb2568672c
commit 76762aae31
1 changed files with 4 additions and 0 deletions

View File

@ -131,6 +131,10 @@ export default function AdvancedTradeForm({
}
}, [set, tradeType, side])
useEffect(() => {
handleSetPositionSize(positionSizePercent, spotMargin)
}, [market])
const { max, deposits, borrows, spotMax } = useMemo(() => {
if (!mangoAccount) return { max: 0 }
const priceOrDefault = price