Open
Conversation
fixing - geth_poa_middleware creating self.creds fixing - _init_api_keys fixing - MarketOrderArgs in execute_market_order def
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
|
|
||
| self.web3 = Web3(Web3.HTTPProvider(self.polygon_rpc)) | ||
| self.web3.middleware_onion.inject(geth_poa_middleware, layer=0) | ||
| self.w3.middleware_onion.inject(poa_middleware, layer=0) |
There was a problem hiding this comment.
POA middleware injected into wrong Web3 instance
High Severity
The POA middleware is injected into self.w3 (created on line 53) but all contract interactions (self.usdc, self.ctf) and _init_approvals use self.web3 (created on line 64). The original code correctly called self.web3.middleware_onion.inject(...) — the change to self.w3 means self.web3 no longer has the POA middleware, which will cause failures when interacting with the Polygon PoA chain.
Additional Locations (1)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


fixing - geth_poa_middleware
creating self.creds
fixing - _init_api_keys
fixing - MarketOrderArgs in execute_market_order def
Note
Medium Risk
Medium risk because it changes how the Polymarket CLOB client is authenticated/funded and how market orders are constructed, which can affect live trading behavior and transaction signing.
Overview
Polymarket agent setup is updated to work with newer dependencies and Polymarket CLOB auth. It replaces direct
geth_poa_middlewareusage with a version-compatible POA middleware import and injection.CLOB client initialization now supports proxy funding and explicit API credentials. The agent reads
PROXY_ADDRESSplusPOLY_API_KEY/POLY_API_SECRET/POLY_API_PASSPHRASEfrom env, buildsApiCreds, and passessignature_type=2,funder, andcredsintoClobClient.Market order execution is adjusted.
execute_market_ordernow accepts an optionalsideparameter and maps it toMarketOrderArgs.side(BUY/SELL).Written by Cursor Bugbot for commit b2ea664. This will update automatically on new commits. Configure here.