Skip to content

[pull] main from MetaMask:main#364

Merged
pull[bot] merged 7 commits into
Reality2byte:mainfrom
MetaMask:main
Nov 28, 2025
Merged

[pull] main from MetaMask:main#364
pull[bot] merged 7 commits into
Reality2byte:mainfrom
MetaMask:main

Conversation

@pull
Copy link
Copy Markdown

@pull pull Bot commented Nov 28, 2025

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

grvgoel81 and others added 7 commits November 28, 2025 05:45
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**
* Convert onboarding component code from javascript to typescript.
* Jira: https://consensyssoftware.atlassian.net/browse/SL-315
<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->

## **Changelog**

<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`

If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`

(This helps the Release Engineer do their job more quickly and
accurately)
-->

CHANGELOG entry: null

## **Related issues**

Fixes:

## **Manual testing steps**

```gherkin
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**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**


https://github.com/user-attachments/assets/7652f646-cd17-4e6b-a5b3-abf8f256437a




<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [x] I’ve followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [x] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [x] 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.


<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Converts the Onboarding screen from a JS class to a typed TSX
functional component using hooks, with styles extracted and minor
refactors to networking, metrics, and tracing.
> 
> - **Onboarding (`app/components/Views/Onboarding`)**:
> - **Migration to TSX + Hooks**: Rewrites `index.js` class component to
`index.tsx` functional component using `useState`, `useEffect`,
`useRef`, `useCallback`, and `useContext`.
> - Replaces `connect`/HOCs with `useSelector`/`useDispatch` and
`useMetrics`.
> - Switches navigation to `useNavigation`/`useRoute` with typed params.
> - Adds TypeScript interfaces for state, route params, and OAuth
results; uses `AuthConnection` enum.
>     - Refactors animated values and trace contexts to `useRef`.
> - Adjusts NetInfo usage to `fetch` alias and tightens error handling.
> - **Styles Extraction**: Moves inline `StyleSheet.create` to
`styles.ts` with typed theme colors via `createStyles`.
> - **Logic Parity**: Preserves social login/import/create flows,
migration recovery check (`MIGRATION_ERROR_HAPPENED` +
`getVaultFromBackup`), metrics/tracing, notifications, and loaders.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
87513c6. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: Aslau Mario-Daniel <marioaslau@gmail.com>
Co-authored-by: metamaskbot <metamaskbot@users.noreply.github.com>
## **Description**

Fixes a bug where funding payments in the Activity/Transactions view
would alternate between showing different date ranges on each refresh
(e.g., Nov 5th � Oct 31st � Nov 5th).

**Root cause:** Multiple race conditions in the transaction history
fetching logic:

1. **Dependency array issue:** The `fetchAllTransactions` callback had
`userHistory` (an array) in its dependency array, causing callback
recreation on every fetch.

2. **Initial fetch race condition:** Both `useUserHistory` and
`usePerpsTransactionHistory` had their own `useEffect` hooks that
triggered fetches on mount. These ran in parallel, so
`fetchAllTransactions` would read an empty `userHistoryRef.current`
before user history completed.

3. **Epoch time fallback:** When `startTime` was undefined, it defaulted
to `0` (epoch time 1970), causing the HyperLiquid API to return the
oldest 500 records instead of the newest.

**Solution:**
1. Use a `useRef` to hold the latest `userHistory` value, removing it
from the callback's dependency array.
2. Remove the auto-fetch `useEffect` from `useUserHistory` - let the
parent hook control the fetch flow.
3. Use an `initialFetchDone` ref to ensure initial fetch runs once, and
use `refetch()` for the initial load. The `refetch()` function fetches
user history first, updates the ref, then fetches all transactions -
ensuring sequential data flow.
4. Replace the `startTime || 0` fallback with a configurable constant
(`DEFAULT_FUNDING_HISTORY_DAYS = 365`).
5. Fixed duplicate React key warning in `PerpsTransactionsSkeleton` by
adding section/item indices to keys.

## **Changelog**

CHANGELOG entry: Fixed funding payments alternating between different
date ranges on refresh in Activity view

## **Related issues**

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

## **Manual testing steps**

```gherkin
Feature: Funding payments display consistency

  Scenario: user refreshes Activity view multiple times
    Given user has funding payment history in their account
    And user navigates to the Activity/Transactions view
    And user selects the "Funding" tab

    When user refreshes the page multiple times (pull-to-refresh)
    Then the same funding payments should be displayed consistently
    And the latest funding payments should always be visible
    And the data should not alternate between different date ranges
```

## **Screenshots/Recordings**

### **Before**

Data alternates between Nov 5th and Oct 31st on each refresh due to race
conditions in the useCallback dependency array.

### **After**

Data remains consistent across refreshes, always showing the latest
funding payments.


https://github.com/user-attachments/assets/cc252246-7518-497c-934f-2315648b27ee


## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I've included tests if applicable
- [x] I've documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I've applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **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.
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

## Repack Main APK to Flask for E2E Tests

Instead of building Flask APKs from scratch, we now repack the Main APK
to Flask for E2E tests.

**Changes:**
- Removed `build-android-flask-apks` job from CI
- Added `repack-android-flask-apps` job that downloads Main APK
artifacts, repacks them to Flask using `scripts/repack.js`, and uploads
the repacked APKs
- Updated `flask-android-smoke` job to depend on the repack job instead
of a separate build job

**Benefits:**
- Faster CI: repacking is faster than a full build
- Reuses existing Main APK artifacts
- Reduces build time and resource usage


## **Changelog**

<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`

If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`

(This helps the Release Engineer do their job more quickly and
accurately)
-->

CHANGELOG entry:

## **Related issues**

Fixes:

## **Manual testing steps**

```gherkin
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**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [ ] I’ve followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **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.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Adds a workflow to repack main Android APKs for Flask E2E tests,
updates CI dependencies, and simplifies Android repack signing/paths.
> 
> - **CI/Workflows**:
> - **Android Flask E2E**: Introduces `repack-android-flask-apps` in
`run-e2e-smoke-tests-android-flask.yml` to download main APK artifacts,
repack them for Flask, upload repacked APKs, then run shard-based smoke
tests and post reports.
> - **Dependency tweak**: `e2e-smoke-tests-android-flask` in `ci.yml`
now depends on `build-android-apks` (removes separate Flask build job).
> - **Scripts**:
> - **`scripts/repack.js` (Android)**: Removes build-type branching;
standardizes on `prod` APK paths; ensures output dirs; uses QA keystore
env vars with `pass:` prefixes; cleans up temp files; logs sourcemap
path.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
6dd8a63. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
## **Description**

Adds an info tooltip to the Oracle Price field in the market statistics
card. When tapped, it displays: "The median of external prices reported
by validators, used for computing funding rate."

## **Changelog**

CHANGELOG entry: null

## **Related issues**

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

## **Manual testing steps**

```gherkin
Feature: Oracle price tooltip

  Scenario: user views oracle price tooltip
    Given user is on the Perps market details screen

    When user taps the info icon next to "Oracle price"
    Then a bottom sheet appears with title "Oracle price" and content "The median of external prices reported by validators, used for computing funding rate."
```

## **Screenshots/Recordings**

### **Before**

Oracle price row has no info icon

### **After**

Oracle price row displays info icon; tapping shows tooltip


https://github.com/user-attachments/assets/4ad3394e-19bd-480d-86b7-5485113ca298


## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I've included tests if applicable
- [x] I've documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I've applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **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.


<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Adds an info tooltip to the Perps market “Oracle price” row and wires
up types, registry, and i18n strings.
> 
> - **Perps Market Stats UI**:
> - Add info icon to `oracle_price` row in
`PerpsMarketStatisticsCard.tsx`, invoking
`onTooltipPress('oracle_price')` with `testID`.
> - **Tooltips**:
> - Extend `PerpsTooltipContentKey` with `oracle_price` in
`PerpsBottomSheetTooltip.types.ts`.
>   - Register `oracle_price` in `contentRegistry.ts`.
> - **Localization**:
> - Add `perps.tooltips.oracle_price` title and content in
`locales/languages/en.json`.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
d6502f6. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
## **Description**

This PR fixes an inconsistency in the button color A/B test (TAT-1937)
between the asset screen and trade screen.

**Problem:** When the "monochrome" variant is active, the asset screen
(`PerpsMarketDetailsView`) correctly shows white/neutral Long/Short
buttons, but the trade screen (`PerpsOrderView`) still showed green/red
semantic buttons.

**Solution:** Added the `usePerpsABTest` hook to `PerpsOrderView` with
conditional button rendering that matches the pattern already
implemented in `PerpsMarketDetailsView`. When the variant is
"monochrome", the button uses `ButtonVariants.Secondary` (white on dark
mode, dark on light mode) instead of the semantic Success/Danger colors.

**Bonus (Dev only):** Added faster feature flag polling interval (1
second) in development mode to make A/B test iteration faster.
Production still uses the default fetch interval.

## **Changelog**

CHANGELOG entry: null

## **Related issues**

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

## **Manual testing steps**

```gherkin
Feature: A/B test button color consistency

  Scenario: Monochrome variant shows white buttons on both screens
    Given the A/B test is enabled with "monochrome" variant
    And I am on the asset screen (PerpsMarketDetailsView)

    When I view the Long/Short buttons
    Then they should be white/neutral colored (Secondary variant)

    When I tap the Long or Short button
    Then I navigate to the trade screen (PerpsOrderView)
    And the place order button should also be white/neutral colored

  Scenario: Control variant shows semantic colored buttons on both screens
    Given the A/B test is enabled with "control" variant
    And I am on the asset screen (PerpsMarketDetailsView)

    When I view the Long/Short buttons
    Then the Long button should be green and Short button should be red

    When I tap the Long button
    Then I navigate to the trade screen (PerpsOrderView)
    And the place order button should be green (Success)

    When I tap the Short button from asset screen
    Then the place order button should be red (Danger)
```

## **Screenshots/Recordings**

### **Before**

Asset screen (monochrome): White buttons �
Trade screen (monochrome): Green/red buttons � (inconsistent)
<img width="401" height="848" alt="image"
src="https://github.com/user-attachments/assets/384bd1ed-c5ab-4306-b8a3-06c569f55cb9"
/>
<img width="403" height="824" alt="image"
src="https://github.com/user-attachments/assets/db936535-c8ba-4b09-86be-2350644d8a60"
/>
<img width="901" height="481" alt="image"
src="https://github.com/user-attachments/assets/56648625-69bf-41a4-9e42-cd9b72d63417"
/>

### **After**

Asset screen (monochrome): White buttons �
Trade screen (monochrome): White button � (consistent)
<img width="558" height="230" alt="image"
src="https://github.com/user-attachments/assets/4f5d27b1-4b35-41b0-bcc4-bb99f268c72a"
/>
<img width="398" height="840" alt="image"
src="https://github.com/user-attachments/assets/17341145-d11c-4e9b-9564-c6f06bdbba3c"
/>
<img width="401" height="834" alt="image"
src="https://github.com/user-attachments/assets/d7762779-abce-4954-9cea-2c05695dec3b"
/>

## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I've included tests if applicable
- [x] I've documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I've applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **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.


<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Adds A/B test-driven button styling to `PerpsOrderView` and speeds up
remote feature flag polling to 1s in development.
> 
> - **Perps Trading UI**
> - **A/B test integration**: `PerpsOrderView` now uses `usePerpsABTest`
with `BUTTON_COLOR_TEST` and `selectPerpsButtonColorTestVariant` to
conditionally render the place-order button.
> - `monochrome` variant: renders `Button` with `Secondary` style and
full width via `ButtonWidthTypes.Full`.
> - Other variants: retains `ButtonSemantic` with `Success/Danger`
severity based on direction.
> - **Remote Feature Flags**
> - **Dev polling**: `remote-feature-flag-controller-init.ts` sets
`fetchInterval` to 1000ms in `__DEV__`, otherwise uses the default
interval.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
0c75bbc. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
## **Description**
Adds Cursor issue analysis as a GitHub workflow.

When there is a new issue that's either (sev1 or sev2) and it's assigned
to `team-confirmations`, it will trigger a Cursor issue analysis.

## **Changelog**

CHANGELOG entry: null

## **Related issues**

Fixes:

## **Manual testing steps**


## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [ ] I’ve followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **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.


<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Introduce a GitHub Actions workflow that auto-posts a Cursor issue
analysis template on qualifying Sev1/Sev2 `team-confirmations` issues
without duplicating comments.
> 
> - **CI/CD**:
> - **New Workflow**: Adds
`/.github/workflows/cursor-issue-analysis.yml` to auto-comment an issue
analysis when an issue is opened/labeled with `team-confirmations` and
either `Sev1-high` or `Sev2-normal`.
>     - Skips if an existing `@cursor` comment is found.
> - Sparse-checkouts `.github/cursorPrompts` and posts the contents of
`issue-analysis.md` as the comment.
> - **Prompts**:
> - Adds `.github/cursorPrompts/issue-analysis.md` containing the
`@cursor` analysis template.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
06933b3. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Signed-off-by: dan437 <80175477+dan437@users.noreply.github.com>
…hreshold (#23242)

<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

This PR adds a price deviation warning feature to the Perps trading
interface. When the perps price deviates more than 10% from the spot
price (mark price), a warning banner is displayed to inform users that
new positions cannot be opened at that time. This helps protect users
from executing trades at unfavorable prices during periods of
significant price divergence.


## **Changelog**

CHANGELOG entry: Added price deviation warning to Perps trading
interface to prevent opening positions when perps price deviates
significantly from spot price

## **Related issues**

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

## **Manual testing steps**

```gherkin
Feature: Perps Price Deviation Warning

  Scenario: user views market details when price deviation is within threshold
    Given user is on the Perps Market Details view for BTC
    And the asset price is within 10% of the spot price
    When user views the market details page
    Then no price deviation warning should be displayed

  Scenario: user views market details when price deviation exceeds threshold
    Given user is on the Perps Market Details view for BTC
    And the perps price deviates more than 10% from the spot price
    When user views the market details page
    Then a price deviation warning banner should be displayed
    And the warning message should indicate that new positions cannot be opened

  Scenario: warning updates dynamically as price changes
    Given user is on the Perps Market Details view for BTC
    And the perps price initially deviates more than 10% from spot price
    When the price deviation decreases below 10%
    Then the warning banner should disappear
```

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

No notice shown

### **After**
Notice shown

<img width="1170" height="2532" alt="Simulator Screenshot - iPhone 16e -
2025-11-25 at 11 17 03"
src="https://github.com/user-attachments/assets/02cfb5d5-f57f-4101-8e8c-a852af73b606"
/>


## **Pre-merge author checklist**

- [x] I’ve followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **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.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Introduces a price deviation check and warning banner that disables
trade actions when perps price deviates beyond a configured threshold
from spot.
> 
> - **UI**
> - Add `PerpsPriceDeviationWarning` component and render it in
`PerpsMarketDetailsView` when `useIsPriceDeviatedAboveThreshold` signals
trading halt.
> - Hide fixed actions footer (Add Funds / Long / Short / Modify /
Close) while trading is halted.
> - Minor cleanup: remove unnecessary fragment around
`TradingViewChart`.
> - **Hooks**
> - New `useIsPriceDeviatedAboveThreshold(symbol)` leveraging
`usePerpsPrices` to detect deviation; exported via `hooks/index`.
> - **Config**
>   - Add `VALIDATION_THRESHOLDS.PRICE_DEVIATION` (10%).
> - **i18n**
>   - Add `perps.price_deviation_warning.message` copy.
> - **Tests**
> - Add comprehensive unit tests for `useIsPriceDeviatedAboveThreshold`.
> - Update `PerpsMarketDetailsView.test.tsx` with mocks for new hook and
connections; ensure rendering compatibility.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
81d14af. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
@pull pull Bot locked and limited conversation to collaborators Nov 28, 2025
@pull pull Bot added the ⤵️ pull label Nov 28, 2025
@pull pull Bot merged commit 6d2a205 into Reality2byte:main Nov 28, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants