fix perp position table tize click

This commit is contained in:
saml33 2023-06-05 10:19:19 +10:00
parent ab62e89893
commit 1a6e1d5b6d
1 changed files with 3 additions and 2 deletions

View File

@ -59,14 +59,15 @@ const PerpPositions = () => {
) )
} }
const newSide = positionSize > 0 ? 'sell' : 'buy' const newSide = positionSize > 0 ? 'sell' : 'buy'
const baseSize = Math.abs(positionSize)
const quoteSize = floorToDecimal( const quoteSize = floorToDecimal(
positionSize * price, baseSize * price,
getDecimalCount(market.tickSize) getDecimalCount(market.tickSize)
) )
set((s) => { set((s) => {
s.tradeForm.side = newSide s.tradeForm.side = newSide
s.tradeForm.baseSize = positionSize.toString() s.tradeForm.baseSize = baseSize.toString()
s.tradeForm.quoteSize = quoteSize.toString() s.tradeForm.quoteSize = quoteSize.toString()
}) })
} }