From 4e7df56e337e71d44cfcdd7fb3b6318b1675fa07 Mon Sep 17 00:00:00 2001 From: Arthur Breton Date: Thu, 2 Apr 2026 21:51:14 +0800 Subject: [PATCH 1/2] fix: Recent activity fields display orders and funding payments From 933e8f8e5249016bc1993de40c37cb87d11a0c1e Mon Sep 17 00:00:00 2001 From: Arthur Breton Date: Thu, 2 Apr 2026 22:49:56 +0800 Subject: [PATCH 2/2] fix: filter order and funding transactions from perps Recent Activity MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The perps home tab was showing order and funding transactions in the Recent Activity section. Only trades, deposits, and withdrawals should appear there — open orders are already shown in the Positions/Orders section, and funding payments belong in the full activity page. Adds a useMemo filter in perps-view.tsx and a regression test. --- ui/components/app/perps/perps-view.test.tsx | 25 +++++++++++++++++++++ ui/components/app/perps/perps-view.tsx | 16 ++++++++++++- 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/ui/components/app/perps/perps-view.test.tsx b/ui/components/app/perps/perps-view.test.tsx index 65438a8d58a6..bd72858d6537 100644 --- a/ui/components/app/perps/perps-view.test.tsx +++ b/ui/components/app/perps/perps-view.test.tsx @@ -173,6 +173,31 @@ describe('PerpsView', () => { ).toBeInTheDocument(); }); + it('filters out order and funding transactions from Recent Activity', () => { + // mockTransactions contains trades (tx-001, tx-002, tx-002b), + // a funding entry (tx-003), orders (tx-004 to tx-004d), and a deposit (tx-005) + jest.mocked(usePerpsTransactionHistory).mockReturnValueOnce({ + transactions: mocks.mockTransactions, + isLoading: false, + error: null, + refetch: jest.fn(), + }); + + renderWithProvider(, mockStore); + + // Trade and deposit cards should be shown + expect(screen.getByTestId('transaction-card-tx-001')).toBeInTheDocument(); + expect(screen.getByTestId('transaction-card-tx-005')).toBeInTheDocument(); + + // Funding and order cards must not appear in Recent Activity + expect( + screen.queryByTestId('transaction-card-tx-003'), + ).not.toBeInTheDocument(); + expect( + screen.queryByTestId('transaction-card-tx-004'), + ).not.toBeInTheDocument(); + }); + it('shows watchlist when mock watchlist symbols match market data', () => { renderWithProvider(, mockStore); diff --git a/ui/components/app/perps/perps-view.tsx b/ui/components/app/perps/perps-view.tsx index 50ce4af23014..c4abdd4f961b 100644 --- a/ui/components/app/perps/perps-view.tsx +++ b/ui/components/app/perps/perps-view.tsx @@ -46,11 +46,25 @@ export const PerpsView: React.FC = () => { } = usePerpsLiveMarketData(); const { - transactions: recentActivityTransactions, + transactions: allRecentActivityTransactions, isLoading: recentActivityLoading, error: recentActivityError, } = usePerpsTransactionHistory(); + // Recent Activity shows only trade executions, deposits, and withdrawals. + // Open orders are already surfaced in PerpsPositionsOrders above. + // Funding payments belong in the full activity page. + const recentActivityTransactions = useMemo( + () => + allRecentActivityTransactions.filter( + (tx) => + tx.type === 'trade' || + tx.type === 'deposit' || + tx.type === 'withdrawal', + ), + [allRecentActivityTransactions], + ); + // Show only user-placed limit orders resting on the orderbook. // Excludes all position-attached orders: // - isTrigger: TP/SL trigger orders