refactor(perps): ensure object parameter consistency in controller files#25688
refactor(perps): ensure object parameter consistency in controller files#25688abretonc7s merged 4 commits intomainfrom
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. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #25688 +/- ##
==========================================
- Coverage 80.50% 80.50% -0.01%
==========================================
Files 4292 4296 +4
Lines 111089 111268 +179
Branches 23641 23697 +56
==========================================
+ Hits 89432 89574 +142
- Misses 15442 15461 +19
- Partials 6215 6233 +18 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
Key observations:
Selected tags based on tag descriptions:
Risk is medium because while the changes are refactoring-only with no logic changes, they touch a critical controller (PerpsController) and multiple service layers that handle real trading functionality. Performance Test Selection: |
|


Description
This PR refactors the Perps codebase to ensure consistent usage of object parameters across all service and provider methods. This is a pure code quality improvement with no behavioral changes.
Changes Summary
1. HyperLiquidClientService.ts
HyperLiquidWalletParamsinterface (was duplicated 3x)ensureTransportReady(timeoutMs)toensureTransportReady({ timeoutMs? })fetchHistoricalCandles(symbol, interval, limit, endTime)to object params2. EligibilityService.ts
checkEligibility(blockedRegions)tocheckEligibility({ blockedRegions })3. HyperLiquidProvider.ts
updateMargin()to use existingUpdateMarginParamstype from types/index.ts4. PerpsController.ts
fetchHistoricalCandles()to use object parameters5. Updated all call sites:
Why This Change
The Perps codebase already uses object parameters pattern for ~95% of its methods. This PR addresses the remaining 5% of inconsistencies to:
Changelog
CHANGELOG entry: null
Related issues
N/A - Code quality refactor
Manual testing steps
Screenshots/Recordings
N/A - No visual changes
Before
N/A
After
N/A
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Low Risk
Mostly signature/type refactors with updated tests; primary risk is missed call sites or subtle default-value differences causing runtime argument mismatches.
Overview
Standardizes Perps controller/service/provider APIs to use object parameters instead of positional arguments, updating all call sites and tests accordingly.
Key refactors include:
PerpsController.fetchHistoricalCandles,MarketDataServicedelegation to providerclientService.fetchHistoricalCandles,EligibilityService.checkEligibility, andHyperLiquidClientService.ensureTransportReady/fetchHistoricalCandles(plus extracting a sharedHyperLiquidWalletParamstype).HyperLiquidProvider.updateMarginis also switched to the sharedUpdateMarginParamstype.Written by Cursor Bugbot for commit e3023f5. This will update automatically on new commits. Configure here.