diff --git a/apps/marginfi-v2-trading/src/hooks/useMarginfiClient.tsx b/apps/marginfi-v2-trading/src/hooks/useMarginfiClient.tsx index de8c2b534..d224d297e 100644 --- a/apps/marginfi-v2-trading/src/hooks/useMarginfiClient.tsx +++ b/apps/marginfi-v2-trading/src/hooks/useMarginfiClient.tsx @@ -55,7 +55,7 @@ export function useMarginfiClient({ const group = groupsByGroupPk[groupPk.toBase58()]; const pool = arenaPools[groupPk.toBase58()]; - if (!lut || !group || !pool) { + if (!group || !pool) { return null; } const tokenBank = banksByBankPk[pool.tokenBankPk.toBase58()]; diff --git a/apps/marginfi-v2-trading/src/store/tradeStoreV2.ts b/apps/marginfi-v2-trading/src/store/tradeStoreV2.ts index f3c3d0f5c..c7f55ec10 100644 --- a/apps/marginfi-v2-trading/src/store/tradeStoreV2.ts +++ b/apps/marginfi-v2-trading/src/store/tradeStoreV2.ts @@ -139,10 +139,6 @@ const stateCreator: StateCreator = (set, get) => ({ poolsFetched: false, userDataFetched: false, isRefreshingStore: false, - lutGroupsCache: {}, - groupsCache: {}, - tokenMetadataCache: {}, - bankMetadataCache: {}, searchResults: [], currentPage: 1, totalPages: 0, @@ -212,6 +208,7 @@ const stateCreator: StateCreator = (set, get) => ({ acc[pool.group] = { groupPk: new PublicKey(pool.group), + luts: pool.lookup_tables.map((lut) => new PublicKey(lut)), tokenSummary: { bankPk: new PublicKey(tokenBankPk), mint: new PublicKey(tokenMint.address), @@ -399,7 +396,7 @@ const stateCreator: StateCreator = (set, get) => ({ return acc; }, {} as Record); - if (!lutByGroupPk) { + if (!lutByGroupPk || Object.keys(lutByGroupPk).length === 0) { const lutResults: Record> | null> = {}; // Create lookup promises for each group