feat: add Quick Buy button to Market Insights and related analytics#31014
Conversation
This commit introduces a Quick Buy button in the Market Insights view, allowing users to quickly purchase assets. The implementation includes: - Addition of `QUICK_BUY_BUTTON` test ID in `MarketInsightsSelectorsIDs`. - Updates to the `MarketInsightsView` component to handle Quick Buy interactions, including conditional rendering based on feature flags. - Integration of `AssetDetailsQuickBuy` for displaying the Quick Buy interface, with analytics tracking for user interactions. - Tests to ensure the Quick Buy button behaves correctly based on the feature flag state. This enhancement improves user experience by providing a streamlined purchasing option directly from the Market Insights section.
|
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. |
…tickyFooter This commit introduces logic to hide the Quick Buy button in the TokenDetailsStickyFooter component when the account has no eligible swap source. The changes include: - A new test case to verify the Quick Buy button is not rendered when there are no eligible swap tokens. - Updates to the component to conditionally render the Quick Buy button based on the eligibility of swap tokens. This enhancement improves the user experience by preventing the display of an inactive Quick Buy option.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit c6c5789. Configure here.
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: Key impacts:
The changes are feature-flagged (selectSocialAiAssetDetailsQuickBuyEnabled), reducing risk of regressions. The footer disclaimer text was also moved (layout change in MarketInsightsView). No changes to navigation, browser, accounts, identity, network, or snaps components. Performance Test Selection: |

Description
Screen.Recording.2026-06-03.at.14.57.07.mov
This PR adds the QuickBuy "flash" button entry point to the Market Insights view, mirroring its existing implementation in the parent Asset Details (Token Details) view.
TokenDetailsStickyFooter, but it did not expose the QuickBuy lightning button that Asset Details offers. Users reading an asset's Market Insights had no fast path to buy.onQuickBuyPress/quickBuyTestIDslot inMarketInsightsView, gated behind the samesocialAiAssetDetailsQuickBuyfeature flag, and open the reusedAssetDetailsQuickBuysheet with the in-scopestickyFooterToken. The sheet reports a distinctmarket_insightsanalytics source (a new value added toSocialLeaderboardSource/QuickBuySheetSource), and pressing the button fires aMARKET_INSIGHTS_INTERACTIONevent withinteraction_type: 'quick_buy', parallel to the existing swap/buy handlers.Note: the new analytics values (
market_insightssource,quick_buyinteraction type) are registered in a companionsegment-schemaPR so the events pass schema validation.Changelog
CHANGELOG entry: Added a Quick Buy button to the Market Insights view for faster asset purchases.
Related issues
Fixes: TSA-599
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Performance checks (if applicable)
trace()for usage andaddTokenfor an exampleFor performance guidelines and tooling, see the Performance Guide.
Pre-merge reviewer checklist
Made with Cursor
Note
Medium Risk
Exposes an in-app purchase/swap path from a new screen behind a flag, but reuses existing QuickBuy and footer gating rather than new payment logic.
Overview
Adds a Quick Buy (lightning) entry point on Market Insights for non-perps token views, using the same
socialAiAssetDetailsQuickBuyflag and sharedTokenDetailsStickyFooter/AssetDetailsQuickBuyflow as Asset Details.When the flag is on, the sticky footer receives
onQuickBuyPressand a new test ID; tapping it triggers haptics, opens the QuickBuy sheet forstickyFooterToken, and emitsMARKET_INSIGHTS_INTERACTIONwithinteraction_type: 'quick_buy'. QuickBuy analytics now accept an optionalsource(defaultasset_details; Market Insights passesmarket_insights), withQuickBuySheetSource/SocialLeaderboardSourceextended accordingly.TokenDetailsStickyFooteronly shows Quick Buy when there is an eligible swap source (hasEligibleSwapTokens). The Market Insights footer disclaimer moves into the scroll content above “What’s being said” instead of sitting under the sticky footer.Reviewed by Cursor Bugbot for commit c6c5789. Bugbot is set up for automated code reviews on this repo. Configure here.