update market position faster for perp accounts

This commit is contained in:
Tyler Shipe 2021-08-31 19:28:39 -04:00
parent 5aaf079122
commit 6820ac854f
1 changed files with 4 additions and 5 deletions

View File

@ -96,11 +96,10 @@ export default function MarketPosition() {
return getMarketIndexBySymbol(mangoGroupConfig, baseSymbol)
}, [mangoGroupConfig, baseSymbol])
const perpAccount = useMemo(() => {
if (marketName.includes('PERP') && mangoAccount) {
return mangoAccount.perpAccounts[marketIndex]
}
}, [marketName, mangoAccount, marketIndex])
let perpAccount
if (marketName.includes('PERP') && mangoAccount) {
perpAccount = mangoAccount.perpAccounts[marketIndex]
}
const handleSizeClick = (size) => {
setMangoStore((state) => {