feat: price alert percentage feature#33339
Conversation
|
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. |
PR template — items to address before "Ready for review"Warnings — informational, address before merging:
See docs/readme/ready-for-review.md for the full Definition of Ready for Review. |
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 9f071af. Configure here.
a183fc3 to
bd02f31
Compare
There was a problem hiding this comment.
This is a common component to handle the input for both threshold and percent (the percent has a prefix and suffix).
There was a problem hiding this comment.
Dropped most of the code here and created new components for each alert type.
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
No E2E smoke tests exist for PriceAlerts - grep searches confirmed zero matches for PriceAlert/price-alert patterns in No shared components are affected - No changes to TabBar, navigation, modals, confirmations, or any other shared infrastructure that could break existing tests. No Engine/Controller changes - The API layer uses The changes are self-contained new feature development with unit/component tests only. No E2E smoke tags are warranted. Performance Test Selection: |
|




Description
Adds percent-change price alerts so users can get notified when a token moves up or down by a chosen percentage over a rolling 1h or 24h window, alongside existing absolute price-target alerts.
The create screen is refactored into a thin shell with an alert-type toggle (Price target / Price change) and dedicated forms (
AbsolutePriceAlertForm,PercentChangeAlertForm). Shared save behavior lives inuseAlertSaveFlow. Manage alerts lists both types, and the API layer adds/v1/alerts/percent-changeCRUD with alert-type routing and backward-compatible normalization (alerts missingtypedefault toabsolute_price).Changelog
CHANGELOG entry: Added percent-change price alerts so users can be notified when a token moves up or down by a set percentage over 1 hour or 24 hours
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/ASSETS-3593
Manual testing steps
Screenshots/Recordings
Before
N/A — percent-change alerts were not available (Price change was under development / placeholder). Absolute price-target create/manage unchanged in concept; attach prior screenshots if useful for comparison.
After
Simulator.Screen.Recording.-.iPhone.16.Pro.-.2026-07-15.at.15.57.34.mov
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
Note
Medium Risk
Touches authenticated price-alert API calls, navigation params, and a large refactor of create/save paths; regression risk is mitigated by tests but absolute-target behavior should be smoke-tested end-to-end.
Overview
Introduces percent-change price alerts (up/down % over 1h or 24h) next to existing absolute price target alerts.
Create flow:
CreatePriceAlertViewis slimmed to header, Price target / Price change toggle, and routing intoAbsolutePriceAlertFormorPercentChangeAlertForm. Absolute-target UI logic moves out of the monolithic view; shared keypad, recurring toggle, and save button live inAlertFormShell/useAlertSaveFlow. Edit mode locks alert type; percent edits lock period and direction.API & types: Alerts are modeled as
absolute_price|percent_changewithnormalizeAlerts(missingtype→ absolute). New/v1/alerts/percent-changeCRUD,useSubmitPercentAlert, andupdateAlertByType/deleteAlertByTyperoute by type.Manage: Lists both kinds with percent-specific copy; navigation passes
existingAbsoluteAlerts/existingPercentAlertsinstead of flatexistingThresholds. Duplicate checks use full alert objects (percent: threshold + period + direction).Tests & copy: Broad unit/component-view coverage; new i18n strings replace the old “under development” placeholder.
Reviewed by Cursor Bugbot for commit f134fe5. Bugbot is set up for automated code reviews on this repo. Configure here.