Skip to content

Cherry-picking commits from main to release/8.0.0 for PR #32037#32093

Open
runway-github[bot] wants to merge 1 commit into
release/8.0.0from
runway-cherry-pick-8.0.0-1781879978
Open

Cherry-picking commits from main to release/8.0.0 for PR #32037#32093
runway-github[bot] wants to merge 1 commit into
release/8.0.0from
runway-cherry-pick-8.0.0-1781879978

Conversation

@runway-github

@runway-github runway-github Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Description

The APY in the Money account was previously hardcoded in __DEV__
blocks — a temporary workaround for the vault returning 0%. This
replaces that with a proper remote-config-driven solution via a new
earnMoneyVaultApyControl feature flag.

Two knobs are exposed:

  • vaultApyFallback — shown only when the APY service returns
    undefined (e.g. third-party outage). Lets us set a sensible display
    value without overriding a live rate.
  • vaultApyOverride — always shown instead of the service value
    when set. Useful for scheduled maintenance or launch-window display
    control.

Precedence: vaultApyOverride > live serviceApy > vaultApyFallback

undefined.

Changelog

CHANGELOG entry: added remotely configurable Money vault APY control

Related issues

Manual testing steps

Feature: Remote APY control for Money account

  Scenario: APY fallback shown when service is unavailable
    Given earnMoneyVaultApyControl.vaultApyFallback = 0.04 in remote config
    And the vault APY service returns no data
    When user opens the Money account screen
    And remote feature flags fetch successfully
    Then the displayed APY is 4%

  Scenario: APY override always wins over live service value
    Given earnMoneyVaultApyControl.vaultApyOverride = 0.08 in remote config
    And the vault APY service returns 5%
    When user opens the Money account screen
    And remote feature flags fetch successfully
    Then the displayed APY is 8%

  Scenario: Live service APY shown when no override configured
    Given earnMoneyVaultApyControl has no vaultApyOverride
    And the vault APY service returns 5%
    When user opens the Money account screen
    Then the displayed APY is 5%

Screenshots/Recordings

Before

N/A — no UI layout changes; only the data source for the APY value
changes.

After

N/A — no UI layout changes; only the data source for the APY value
changes.

Pre-merge author checklist

Performance checks (if applicable)

  • I've tested on Android
    • Ideally on a mid-range device; emulator is acceptable
  • I've tested with a power user scenario
  • Use these power-user
    SRPs

    to import wallets with many accounts and tokens
  • I've instrumented key operations with Sentry traces for production
    performance metrics
  • See trace() for usage and
    addToken
    for an example

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
Displayed APY can diverge from the live vault service when override or
fallback is set; behavior is intentional but affects user-facing yield
messaging.

Overview
Replaces the temporary __DEV__ hardcoded 4% APY in
useMoneyAccountBalance with remote feature flag
earnMoneyVaultApyControl, exposing vaultApyFallback and
vaultApyOverride via selectMoneyVaultApyRemoteConfig.

Effective APY is now: override (when set) → live vault service →
fallback (only after the APY query settles or errors, not while loading,
to avoid flicker). Real 0% from the service is preserved when no
override is set.

Adds parseNonNegativeFinite and reuses it for
selectMoneyDepositMinBalance so negative remote/env values are
rejected. Registers the new flag in the feature-flag registry with
production defaults.

Reviewed by Cursor Bugbot for commit
1a4d182. Bugbot is set up for automated
code reviews on this repo. Configure
here.

[b235142](https://github.com/MetaMask/metamask-mobile/commit/b23514281fb9720af11f9a96a8f16ca603c2672c)

…erride cp-8.0.0 (#32037)

## **Description**

<!-- mms-check: type=text required=true -->

The APY in the Money account was previously hardcoded in `__DEV__`
blocks — a temporary workaround for the vault returning 0%. This
replaces that with a proper remote-config-driven solution via a new
`earnMoneyVaultApyControl` feature flag.

Two knobs are exposed:
- **`vaultApyFallback`** — shown only when the APY service returns
`undefined` (e.g. third-party outage). Lets us set a sensible display
value without overriding a live rate.
- **`vaultApyOverride`** — always shown instead of the service value
when set. Useful for scheduled maintenance or launch-window display
control.

Precedence: `vaultApyOverride` > live `serviceApy` > `vaultApyFallback`
> `undefined`.

## **Changelog**

<!-- mms-check: type=changelog required=true blocking=true -->

CHANGELOG entry: added remotely configurable Money vault APY control

## **Related issues**

<!-- mms-check: type=issue-link required=true -->

- Fixes:
[MUSD-1026](https://consensyssoftware.atlassian.net/browse/MUSD-1026)

## **Manual testing steps**

<!-- mms-check: type=manual-testing required=true -->

```gherkin
Feature: Remote APY control for Money account

  Scenario: APY fallback shown when service is unavailable
    Given earnMoneyVaultApyControl.vaultApyFallback = 0.04 in remote config
    And the vault APY service returns no data
    When user opens the Money account screen
    And remote feature flags fetch successfully
    Then the displayed APY is 4%

  Scenario: APY override always wins over live service value
    Given earnMoneyVaultApyControl.vaultApyOverride = 0.08 in remote config
    And the vault APY service returns 5%
    When user opens the Money account screen
    And remote feature flags fetch successfully
    Then the displayed APY is 8%

  Scenario: Live service APY shown when no override configured
    Given earnMoneyVaultApyControl has no vaultApyOverride
    And the vault APY service returns 5%
    When user opens the Money account screen
    Then the displayed APY is 5%
```

## **Screenshots/Recordings**

<!-- mms-check: type=screenshot required=true -->

### **Before**

<!-- [screenshots/recordings] -->
N/A — no UI layout changes; only the data source for the APY value
changes.

### **After**

<!-- [screenshots/recordings] -->
N/A — no UI layout changes; only the data source for the APY value
changes.

## **Pre-merge author checklist**

<!-- mms-check: type=checklist required=true -->

- [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.

#### Performance checks (if applicable)

- [x] I've tested on Android
  - Ideally on a mid-range device; emulator is acceptable
- [x] I've tested with a power user scenario
- Use these [power-user
SRPs](https://consensyssoftware.atlassian.net/wiki/spaces/TL1/pages/edit-v2/401401446401?draftShareId=9d77e1e1-4bdc-4be1-9ebb-ccd916988d93)
to import wallets with many accounts and tokens
- [x] I've instrumented key operations with Sentry traces for production
performance metrics
- See [`trace()`](/app/util/trace.ts) for usage and
[`addToken`](/app/components/Views/AddAsset/components/AddCustomToken/AddCustomToken.tsx#L274)
for an example

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

<!-- Generated with the help of the pr-description AI skill -->


[MUSD-1026]:
https://consensyssoftware.atlassian.net/browse/MUSD-1026?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Displayed APY can diverge from the live vault service when override or
fallback is set; behavior is intentional but affects user-facing yield
messaging.
> 
> **Overview**
> Replaces the temporary **`__DEV__` hardcoded 4% APY** in
`useMoneyAccountBalance` with remote feature flag
**`earnMoneyVaultApyControl`**, exposing **`vaultApyFallback`** and
**`vaultApyOverride`** via `selectMoneyVaultApyRemoteConfig`.
> 
> **Effective APY** is now: override (when set) → live vault service →
fallback (only after the APY query settles or errors, not while loading,
to avoid flicker). Real **0%** from the service is preserved when no
override is set.
> 
> Adds **`parseNonNegativeFinite`** and reuses it for
**`selectMoneyDepositMinBalance`** so negative remote/env values are
rejected. Registers the new flag in the feature-flag registry with
production defaults.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
1a4d182. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
@runway-github runway-github Bot requested review from a team as code owners June 19, 2026 14:39
@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.

@mm-token-exchange-service mm-token-exchange-service Bot added the team-bots Bot team (for MetaMask Bot, Runway Bot, etc.) label Jun 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

⏭️ Smart E2E selection skipped - PR targets a release or stable branch (release/* or stable)

All E2E tests pre-selected.

View GitHub Actions results

@github-actions github-actions Bot added size-L risk:low AI analysis: low risk labels Jun 19, 2026
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:low AI analysis: low risk size-L team-bots Bot team (for MetaMask Bot, Runway Bot, etc.)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant