Skip to content

Conversation

@gambinish
Copy link
Contributor

@gambinish gambinish commented Dec 19, 2025

Description

Changelog

CHANGELOG entry:

Related issues

Fixes:

Manual testing steps

Feature: my feature name

  Scenario: user [verb for user action]
    Given [describe expected initial app state]

    When user [verb for user action]
    Then [describe expected outcome]

Screenshots/Recordings

Before

After

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Note

Introduce usePerpsMarketFills to merge WebSocket and REST fills (filtered, deduped, sorted) and switch PerpsMarketTradesList to use it.

  • Hooks:
    • Add usePerpsMarketFills that merges WebSocket (usePerpsLiveFills) and REST (getOrderFills) data, filters by symbol, deduplicates by orderId-timestamp, sorts desc by timestamp, and exposes refresh, isInitialLoading, isRefreshing.
    • Export usePerpsMarketFills from hooks/index.ts.
  • UI:
    • Update PerpsMarketTradesList.tsx to use usePerpsMarketFills; remove in-component filtering/sorting and keep limiting via PERPS_CONSTANTS.RECENT_ACTIVITY_LIMIT.
  • Tests:
    • Add usePerpsMarketFills.test.ts covering symbol filtering, data merging precedence, sorting, REST fetching/error handling, refresh behavior, throttling, and symbol changes.

Written by Cursor Bugbot for commit 15e1a33. This will update automatically on new commits. Configure here.

@github-actions
Copy link
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@metamaskbot metamaskbot added the team-perps Perps team label Dec 19, 2025
@github-actions
Copy link
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokePerps
  • Risk Level: low
  • AI Confidence: 95%
click to see 🤖 AI reasoning details

The changes are entirely contained within the Perps (Perpetuals trading) feature directory (app/components/UI/Perps/). The PR introduces:

  1. A new hook usePerpsMarketFills.ts that combines WebSocket and REST API data for fetching market-specific fills
  2. Comprehensive unit tests for the new hook (535 lines of tests)
  3. An update to PerpsMarketTradesList.tsx to use the new hook instead of usePerpsLiveFills
  4. Export of the new hook in the hooks index file

The changes are well-isolated:

  • The new hook is only used by the modified component
  • The component is only used within Perps views
  • No core modules, controllers, or critical infrastructure is affected
  • The changes include thorough unit test coverage

This is a feature-specific enhancement to the Perpetuals trading functionality with no impact on other wallet features. Only the SmokePerps tag is needed to verify this change.

View GitHub Actions results

@sonarqubecloud
Copy link

@gambinish gambinish marked this pull request as ready for review December 20, 2025 00:02
@gambinish gambinish requested a review from a team as a code owner December 20, 2025 00:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants