feat: perps improve protocol abstraction and handle edge order edge cases#17809
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. |
|
@abretonc7s Just a quick heads-up that we'll probably want to stop skipping E2E tests if there isn't an active issue with them blocking us. I know Perps is mostly (if not fully self-contained) but the mobile-platform team may dislike that we're skipping them often. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #17809 +/- ##
==========================================
+ Coverage 74.38% 74.43% +0.05%
==========================================
Files 2985 2991 +6
Lines 67286 67504 +218
Branches 11289 11342 +53
==========================================
+ Hits 50051 50249 +198
+ Misses 14006 14002 -4
- Partials 3229 3253 +24 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
nickewansmith
left a comment
There was a problem hiding this comment.
Re-approving after conflict resolution



Description
This PR implements critical edge case handling for perpetual trading (JIRA TAT-1280) while
establishing a robust protocol-agnostic architecture. The key achievement is moving all
validation logic from the UI layer to the protocol provider level, ensuring that
protocol-specific rules are properly encapsulated and maintainable.
Key improvements:
(HyperLiquidProvider), not in UI components
protocol-specific validation
The architecture now supports easy addition of new protocols without touching UI code - just
implement the IPerpsProvider interface.
Changelog
CHANGELOG entry: Fixed perpetual trading edge cases and improved protocol-agnostic validation
architecture to properly enforce minimum order sizes and asset-specific limits
Related issues
Fixes: TAT-1280
Manual testing steps
validation error
error with correct max
size
Screenshots/Recordings
Before
After
Pre-merge author checklist
and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.g ithub/guidelines/CODING_GUIDELINES.md).
aMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for
external contributors.
Pre-merge reviewer checklist
changed).
closes and includes the necessary testing evidence such as recordings and or screenshots.