Skip to content

revert(predict): remove Polymarket balance/allowance refresh workaround cp-7.69.0#27162

Merged
matallui merged 1 commit into
mainfrom
predict/revert-workaround
Mar 7, 2026
Merged

revert(predict): remove Polymarket balance/allowance refresh workaround cp-7.69.0#27162
matallui merged 1 commit into
mainfrom
predict/revert-workaround

Conversation

@matallui

@matallui matallui commented Mar 6, 2026

Copy link
Copy Markdown
Contributor

Description

Reverts #26954.

Polymarket has resolved the underlying CLOB infrastructure issue that was causing intermittent not enough balance / allowance 400 errors during order placement. The temporary refreshBalanceAllowance() workaround (calling GET /balance-allowance/update before each order) is no longer needed and is removed here.

Changes:

  • utils.ts: Remove refreshBalanceAllowance() utility and related HMAC auth logic
  • PolymarketProvider.ts: Remove the preflight refresh call from placeOrder()
  • utils.test.ts: Remove associated unit tests
  • PolymarketProvider.test.ts: Remove associated integration tests

Changelog

CHANGELOG entry: null

Related issues

Fixes:

Manual testing steps

Feature: Polymarket order placement without refresh workaround

  Scenario: user places a BUY order on a prediction market
    Given the user has USDC deposited in their Polymarket proxy wallet

    When user places a BUY order on any market
    Then the order completes successfully without a preflight refresh call

  Scenario: user places a SELL order on a prediction market
    Given the user holds outcome tokens for a market

    When user places a SELL order
    Then the order completes successfully without a preflight refresh call

Screenshots/Recordings

N/A — no UI changes

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
Changes Polymarket order submission behavior by removing a preflight balance/allowance refresh; if the upstream CLOB issue is not fully resolved, this could reintroduce intermittent order failures under load.

Overview
Removes the temporary Polymarket CLOB balance/allowance refresh workaround by deleting refreshBalanceAllowance from utils.ts and dropping the pre-submit call in PolymarketProvider.placeOrder().

Cleans up the associated unit/integration coverage by removing mocks and test cases that asserted the refresh call ordering and failure handling.

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

@github-actions

github-actions Bot commented Mar 6, 2026

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.

@metamaskbot metamaskbot added the team-predict Predict team label Mar 6, 2026
@matallui matallui marked this pull request as ready for review March 6, 2026 23:05
@matallui matallui requested a review from a team as a code owner March 6, 2026 23:05
@matallui matallui changed the title revert(predict): remove Polymarket balance/allowance refresh workaround revert(predict): remove Polymarket balance/allowance refresh workaround cp-7.69.0 Mar 6, 2026
@github-actions

github-actions Bot commented Mar 6, 2026

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokePredictions, SmokeWalletPlatform, SmokeConfirmations
  • Selected Performance tags: @PerformancePredict
  • Risk Level: medium
  • AI Confidence: 85%
click to see 🤖 AI reasoning details

E2E Test Selection:
The changes are limited to the Polymarket provider and related utility logic under app/components/UI/Predict/providers/polymarket/. This directly impacts the Predictions (Polymarket) feature, including market data handling and related business logic.

SmokePredictions is required because it validates the full Polymarket lifecycle (open position, cash out, claim winnings, balance updates, error handling). Any changes in the provider or its utils could affect API responses, position handling, or balance synchronization.

Per tag requirements:

  • SmokePredictions must also include SmokeWalletPlatform because Predictions is embedded in the Trending tab and changes may affect rendering and integration within that section.
  • SmokePredictions must also include SmokeConfirmations because opening/closing prediction positions involves on-chain transactions that go through the confirmation flow.

No other areas (accounts, network management, snaps, ramps, perps, etc.) are affected by these file changes.

Performance Test Selection:
Changes in the Polymarket provider and utils may affect prediction market list loading, market detail data processing, and balance synchronization logic. These can influence data fetching and rendering performance in the Predict feature. Running @PerformancePredict ensures no regressions in market loading, deposit flows, and balance display performance.

View GitHub Actions results

@github-actions github-actions Bot added the size-M label Mar 6, 2026
@matallui matallui enabled auto-merge March 6, 2026 23:07
@github-actions

github-actions Bot commented Mar 6, 2026

Copy link
Copy Markdown
Contributor

E2E Fixture Validation — Schema is up to date
7 value mismatches detected (expected — fixture represents an existing user).
View details

@sonarqubecloud

sonarqubecloud Bot commented Mar 6, 2026

Copy link
Copy Markdown

@caieu caieu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@matallui matallui added this pull request to the merge queue Mar 6, 2026
Merged via the queue into main with commit 8099e72 Mar 7, 2026
122 checks passed
@matallui matallui deleted the predict/revert-workaround branch March 7, 2026 00:12
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 7, 2026
@metamaskbot metamaskbot added the release-7.70.0 Issue or pull request that will be included in release 7.70.0 label Mar 7, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.70.0 Issue or pull request that will be included in release 7.70.0 size-M team-predict Predict team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants