Skip to content

refactor(perps): use params in the controller and remove unused route#25412

Merged
michalconsensys merged 2 commits intomainfrom
chore/perps/deposit-refactor
Jan 30, 2026
Merged

refactor(perps): use params in the controller and remove unused route#25412
michalconsensys merged 2 commits intomainfrom
chore/perps/deposit-refactor

Conversation

@michalconsensys
Copy link
Copy Markdown
Contributor

@michalconsensys michalconsensys commented Jan 29, 2026

Description

Refactor perps controller and remove unused route

Changelog

CHANGELOG entry: null

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

No visible change

After

No visible change

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

Medium Risk
Medium risk because it changes the public PerpsController.depositWithConfirmation/hook call signatures and the deposit+order transaction path toggle, which could break existing callers if any weren’t updated.

Overview
Refactors perps deposit entrypoints by changing PerpsController.depositWithConfirmation from positional args to a single DepositWithConfirmationParams object (amount, placeOrder), and updates depositWithOrder/usePerpsTrading accordingly.

Cleans up navigation by removing the unused Routes.PERPS.ORDER constant and its screen registration from the perps route stack. Tests are updated to match the new deposit API shape.

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

@github-actions
Copy link
Copy Markdown
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 Jan 29, 2026
@michalconsensys michalconsensys marked this pull request as ready for review January 29, 2026 20:37
@michalconsensys michalconsensys requested a review from a team as a code owner January 29, 2026 20:37
@github-actions
Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokePerps
  • Selected Performance tags: @PerformancePreps
  • Risk Level: medium
  • AI Confidence: 90%
click to see 🤖 AI reasoning details

E2E Test Selection:
The changes are isolated to the Perps (perpetuals trading) feature:

  1. PerpsController refactoring: The depositWithConfirmation method signature changed from positional arguments (amount?, depositAndPlaceOrder?) to a params object ({ amount, placeOrder }). This is a breaking API change but only affects internal Perps code.

  2. Navigation route removal: The Routes.PERPS.ORDER route was removed from the navigation stack. However, PerpsOrderView is still used in the confirmations flow for TransactionType.perpsDepositAndOrder, so it's not completely removed - just the direct navigation route.

  3. Hook updates: usePerpsTrading hook was updated to use the new params pattern, and depositWithOrder no longer accepts an amount parameter.

  4. Type additions: New DepositWithConfirmationParams interface added for better type safety.

All changes are contained within the app/components/UI/Perps/ directory and the Routes constant. The SmokePerps tag is the appropriate choice as it covers:

  • Add Funds flow to deposit USDC into the Perps trading account
  • Balance verification after deposits
  • Perps interface functionality

No other features are affected by these changes.

Performance Test Selection:
The changes modify the Perps deposit flow and order placement logic in PerpsController. The depositWithConfirmation method is a key part of the add funds flow, and the refactoring could potentially impact the performance of deposit transactions and order placement. The @PerformancePreps tag covers perps market loading, position management, add funds flow, and order execution - all of which could be affected by these controller changes.

View GitHub Actions results

@michalconsensys michalconsensys added the no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed label Jan 29, 2026
@sonarqubecloud
Copy link
Copy Markdown

@michalconsensys michalconsensys added this pull request to the merge queue Jan 30, 2026
Merged via the queue into main with commit bf19c03 Jan 30, 2026
116 checks passed
@michalconsensys michalconsensys deleted the chore/perps/deposit-refactor branch January 30, 2026 08:51
@github-actions github-actions bot locked and limited conversation to collaborators Jan 30, 2026
@metamaskbot metamaskbot added the release-7.65.0 Issue or pull request that will be included in release 7.65.0 label Jan 30, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed release-7.65.0 Issue or pull request that will be included in release 7.65.0 size-M team-perps Perps team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants