Skip to content

Conversation

@michalconsensys
Copy link
Contributor

@michalconsensys michalconsensys commented Nov 11, 2025

Description

This PR enables live PnL (Profit and Loss) updates in the Perps Market Tabs by subscribing to real-time price updates from the WebSocket stream.

Changelog

CHANGELOG entry: Fixed live PnL updates in Perps market tabs to reflect real-time price changes

Related issues

Fixes: https://consensyssoftware.atlassian.net/browse/TAT-1946

Manual testing steps

Feature: Live PnL updates in Perps Market Tabs

  Scenario: user views position with live PnL updates
    Given user has an open perpetual position
    And user is on the Perps Market Tabs screen
    
    When market price changes
    Then the unrealized PnL and ROE values update in real-time
    And the position card reflects current market conditions

Screenshots/Recordings

Before

No visible changes

After

No visible changes

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

Enable live PnL updates by passing useLivePnl: true to usePerpsLivePositions in PerpsMarketTabs.tsx.

Written by Cursor Bugbot for commit 32657d9. 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 Nov 11, 2025
@michalconsensys michalconsensys marked this pull request as ready for review November 11, 2025 14:26
@michalconsensys michalconsensys requested a review from a team as a code owner November 11, 2025 14:26
@abretonc7s abretonc7s changed the title fix(perps): enable live PnL in perps position card fix(perps): enable live PnL in perps position card cp-7.59.0 Nov 12, 2025
@sonarqubecloud
Copy link

@michalconsensys michalconsensys added this pull request to the merge queue Nov 12, 2025
Merged via the queue into main with commit 6fe856c Nov 12, 2025
86 checks passed
@michalconsensys michalconsensys deleted the fix/perps/price-live-updates branch November 12, 2025 15:53
@github-actions github-actions bot locked and limited conversation to collaborators Nov 12, 2025
@metamaskbot metamaskbot added the release-7.60.0 Issue or pull request that will be included in release 7.60.0 label Nov 12, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.60.0 Issue or pull request that will be included in release 7.60.0 size-XS team-perps Perps team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants