diff --git a/src/components/trade/TradeModule/AssetSelector/AssetOverlay/index.tsx b/src/components/trade/TradeModule/AssetSelector/AssetOverlay/index.tsx index 91bf68e9..46c1db48 100644 --- a/src/components/trade/TradeModule/AssetSelector/AssetOverlay/index.tsx +++ b/src/components/trade/TradeModule/AssetSelector/AssetOverlay/index.tsx @@ -87,18 +87,16 @@ export default function AssetOverlay(props: Props) { ) const [activePerpsPositions, availablePerpsMarkets] = useMemo(() => { - const activePerpsPositions = - account?.perps.length === 0 - ? [] - : props.buyAssets.filter((assets) => - account?.perps.find((perp) => perp.denom === assets.denom), - ) - const availablePerpsMarkets = props.buyAssets.filter( + if (!account) return [[], []] + const activePerpsPositions = assets.filter((assets) => + account?.perps.find((perp) => perp.denom === assets.denom), + ) + const availablePerpsMarkets = assets.filter( (assets) => !activePerpsPositions.find((perp) => perp.denom === assets.denom), ) return [activePerpsPositions, availablePerpsMarkets] - }, [props.buyAssets, account]) + }, [assets, account]) return (