Skip to content

fix: Perps rate limit hotfix cp-7.63.0#25472

Merged
joaoloureirop merged 4 commits intorelease/7.63.0from
fix/perps-ratelimit-hotfix-7.63.0
Feb 2, 2026
Merged

fix: Perps rate limit hotfix cp-7.63.0#25472
joaoloureirop merged 4 commits intorelease/7.63.0from
fix/perps-ratelimit-hotfix-7.63.0

Conversation

@gambinish
Copy link
Copy Markdown
Member

@gambinish gambinish commented Jan 30, 2026

Description

Includes two sets of fixes that improve 429 errors during Perps transactions. They were already merged to main, and have been included in a hotfix to 7.62.2 here: #25443

Changelog

CHANGELOG entry: hotfix to improve 429 error handling in Perps

Related issues

Fixes:

Manual testing steps

Feature: my feature name

  Scenario: user [verb for user action]
    Given [describe expected initial app state]

    When user [verb for user action]
    Then [describe expected outcome]

Screenshots/Recordings

Before

After

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • 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.

Note

Medium Risk
Touches Perps order/position management and provider networking behavior (cache-vs-REST fallbacks), which can affect trade execution flows and data freshness. Changes are mitigated by added validation, staleness checks, and expanded unit tests, but still warrant careful review in production-like conditions.

Overview
Reduces Perps 429s by shifting several read paths to cache-first WebSocket data with REST fallback: adds getOrFetchFills (provider + aggregated provider) and introduces atomic cache getters for orders/fills/prices in HyperLiquidSubscriptionService.

Updates HyperLiquidProvider to centralize price retrieval (getOrFetchPrice with validity checks), prefer live WebSocket positions for updatePositionTPSL/closePosition, and avoid multi-DEX REST queries when canceling TP/SL orders (use cached orders or single-DEX fallback).

Refactors stop-loss prompt handling: useHasExistingPosition now returns positionOpenedTimestamp (WS fills + REST fallback) and PerpsMarketDetailsView adds staleness/closure-safety refs so banner TP/SL updates don’t misapply after market/position changes; the banner UI switches from a toggle to a Set button with success checkmark + delayed fade-out. Also improves order flow UX by surfacing a toast when post-order TP/SL updates fail.

Written by Cursor Bugbot for commit 060868b. This will update automatically on new commits. Configure here.

@github-actions
Copy link
Copy Markdown
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.

@gambinish gambinish changed the base branch from main to release/7.63.0 January 30, 2026 22:07
@gambinish gambinish marked this pull request as ready for review January 30, 2026 22:18
@gambinish gambinish requested a review from a team as a code owner January 30, 2026 22:18
@gambinish
Copy link
Copy Markdown
Member Author

Please don't merge until @abretonc7s has given an approval

@gambinish gambinish requested a review from abretonc7s January 30, 2026 22:21
@joaoloureirop joaoloureirop enabled auto-merge (squash) February 2, 2026 10:46
@joaoloureirop joaoloureirop added the skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. label Feb 2, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 2, 2026

🔍 Smart E2E Test Selection

⏭️ Smart E2E selection skipped - base branch is not main (base: release/7.63.0)

All E2E tests pre-selected.

View GitHub Actions results

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.12953% with 48 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (release/7.63.0@f0a295f). Learn more about missing BASE report.

Files with missing lines Patch % Lines
.../PerpsMarketDetailsView/PerpsMarketDetailsView.tsx 51.85% 11 Missing and 2 partials ⚠️
...Perps/controllers/providers/HyperLiquidProvider.ts 82.43% 8 Missing and 5 partials ⚠️
...omponents/UI/Perps/hooks/useHasExistingPosition.ts 84.78% 5 Missing and 2 partials ⚠️
...I/Perps/services/HyperLiquidSubscriptionService.ts 56.25% 4 Missing and 3 partials ⚠️
...s/UI/Perps/Views/PerpsOrderView/PerpsOrderView.tsx 0.00% 4 Missing ⚠️
...s/controllers/providers/AggregatedPerpsProvider.ts 0.00% 4 Missing ⚠️
Additional details and impacted files
@@                Coverage Diff                @@
##             release/7.63.0   #25472   +/-   ##
=================================================
  Coverage                  ?   75.33%           
=================================================
  Files                     ?     4246           
  Lines                     ?   109315           
  Branches                  ?    22872           
=================================================
  Hits                      ?    82354           
  Misses                    ?    21015           
  Partials                  ?     5946           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Feb 2, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
78.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@joaoloureirop joaoloureirop merged commit c6e1142 into release/7.63.0 Feb 2, 2026
166 of 170 checks passed
@joaoloureirop joaoloureirop deleted the fix/perps-ratelimit-hotfix-7.63.0 branch February 2, 2026 12:47
@github-actions github-actions bot locked and limited conversation to collaborators Feb 2, 2026
@metamaskbot metamaskbot added the release-7.63.0 Issue or pull request that will be included in release 7.63.0 label Feb 6, 2026
@metamaskbot
Copy link
Copy Markdown
Collaborator

No release label on PR. Adding release label release-7.63.0 on PR, as PR was added to branch 7.63.0 when release was cut.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.63.0 Issue or pull request that will be included in release 7.63.0 size-XL skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants