revert(predict): remove Polymarket balance/allowance refresh workaround cp-7.69.0#27162
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. |
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: 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:
No other areas (accounts, network management, snaps, ramps, perps, etc.) are affected by these file changes. Performance Test Selection: |
|
✅ E2E Fixture Validation — Schema is up to date |
|



Description
Reverts #26954.
Polymarket has resolved the underlying CLOB infrastructure issue that was causing intermittent
not enough balance / allowance400 errors during order placement. The temporaryrefreshBalanceAllowance()workaround (callingGET /balance-allowance/updatebefore each order) is no longer needed and is removed here.Changes:
utils.ts: RemoverefreshBalanceAllowance()utility and related HMAC auth logicPolymarketProvider.ts: Remove the preflight refresh call fromplaceOrder()utils.test.ts: Remove associated unit testsPolymarketProvider.test.ts: Remove associated integration testsChangelog
CHANGELOG entry: null
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
N/A — no UI changes
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
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
refreshBalanceAllowancefromutils.tsand dropping the pre-submit call inPolymarketProvider.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.