chore(runway): cherry-pick fix(social-leaderboard): keep QuickBuy Sell enabled when position price ticks - #34470
Merged
runway-github[bot] merged 1 commit intoAug 7, 2026
Conversation
…l enabled when position price ticks cp-8.7.0 (#34422) <!-- CURSOR_AGENT_PR_BODY_BEGIN --> ## Description Fixes QuickBuy **Sell** staying disabled after entering a valid amount even when a quote is on screen (silent \"Sell\" label, no insufficient-funds/gas/no-quotes error). **Root cause:** In sell mode, `sourceTokenAmount` was derived from the live `positionToken.currencyExchangeRate`. Market-data ticks changed the token amount for the same fiat input, so `isPendingQuoteRefresh` stayed true and the CTA never enabled. Buy mode avoids this because the pay-with token is a `useState` snapshot. **Fix:** 1. Freeze the sell-mode exchange rate used for quote amount conversion (display/balance rates stay live). 2. Fall back to matching `quote.srcTokenAmount` when `sentAmount` is missing/mismatched (partial `QuoteMetadata`). ## Changelog CHANGELOG entry: Fixed Quick Buy Sell button staying disabled after entering a valid amount ## Related issues Fixes: https://consensyssoftware.atlassian.net/browse/TSA-976 ## Manual testing steps ```gherkin Feature: Quick Buy sell CTA Scenario: sell remains actionable after a price tick Given Quick Buy is open in Sell mode for a priced position token And the user enters a valid fiat amount And a quote is shown (total includes network fee) When the position token market price updates Then the Sell button stays enabled And the committed source token amount does not change ``` ## Screenshots/Recordings N/A — logic-only fix; covered by unit regression tests. ## Pre-merge author checklist - [x] I've followed MetaMask Contributor Docs and MetaMask Mobile Coding Standards. - [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 format if applicable - [ ] I've applied the right labels on the PR #### Performance checks (if applicable) - [ ] I've tested on Android - [ ] I've tested with a power user scenario - [ ] I've instrumented key operations with Sentry traces for production performance metrics ## Pre-merge reviewer checklist - [ ] I've manually tested the PR - [ ] 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_AGENT_PR_BODY_END --> [Slack Thread](https://consensys.slack.com/archives/C092MDPA0LU/p1786029924237309?thread_ts=1786029924.237309&cid=C092MDPA0LU) <div><a href="https://cursor.com/agents/bc-9542177a-2aa0-5981-af17-a72f396a726a?cursor_ref=pr_footer&cursor_cta=open_in_web"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-web-light.png"><img alt="Open in Web" width="114" height="28" src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a> <a href="https://cursor.com/background-agent?bcId=bc-9542177a-2aa0-5981-af17-a72f396a726a&cursor_ref=pr_footer&cursor_cta=open_in_cursor"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img alt="Open in Cursor" width="131" height="28" src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a> </div> Co-authored-by: Cursor Agent <cursoragent@cursor.com>
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. |
Contributor
🔍 Smart E2E Test Selection⏭️ Smart E2E selection skipped - PR targets a release or stable branch (release/* or stable) All E2E tests pre-selected. |
|
Contributor
|
No release label on PR. Adding release label release-8.7.0 on PR, as PR was cherry-picked in branch 8.7.0. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
Fixes QuickBuy Sell staying disabled after entering a valid amount
even when a quote is on screen (silent "Sell" label, no
insufficient-funds/gas/no-quotes error).
Root cause: In sell mode,
sourceTokenAmountwas derived from thelive
positionToken.currencyExchangeRate. Market-data ticks changed thetoken amount for the same fiat input, so
isPendingQuoteRefreshstayedtrue and the CTA never enabled. Buy mode avoids this because the
pay-with token is a
useStatesnapshot.Fix:
(display/balance rates stay live).
quote.srcTokenAmountwhensentAmountismissing/mismatched (partial
QuoteMetadata).Changelog
CHANGELOG entry: Fixed Quick Buy Sell button staying disabled after
entering a valid amount
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/TSA-976
Manual testing steps
Screenshots/Recordings
N/A — logic-only fix; covered by unit regression tests.
Pre-merge author checklist
Standards.
Performance checks (if applicable)
performance metrics
Pre-merge reviewer checklist
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
Slack
Thread
Co-authored-by: Cursor Agent cursoragent@cursor.com 5449688