[WIP] fix: add funder and signature_type to examples#238
Open
vikions wants to merge 2 commits intoPolymarket:mainfrom
Open
[WIP] fix: add funder and signature_type to examples#238vikions wants to merge 2 commits intoPolymarket:mainfrom
vikions wants to merge 2 commits intoPolymarket:mainfrom
Conversation
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.
Overview
Examples
order.pyandmarket_buy_order.pyare missingfunderandsignature_typeparameters, causing errors for most users. This PR updates examples to match README documentation.Description
The current examples don't include critical parameters that are documented in README:
funderparameter (address holding funds on Polymarket)signature_typeparameter (0=EOA, 1=Magic, 2=Proxy).env.examplewith new variables and explanationsReal-world experience:
While building Opipolix Bot (a Polymarket/Opiniona trading bot), we experienced
invalid signatureandnot enough balance / allowanceerrors when following the examples. The bot only started working after addingfunderandsignature_typeparameters — exactly as documented in README but missing from examples.Our working implementation:
Related issues: #109, #198, #187
Testing instructions
No changes to test runner. Examples can be tested manually with valid credentials.
Types of changes
Notes
README was updated ~3 months ago with correct parameters, but examples (~8 months old) were not updated to match.
Status
[WIP]if necessary (changes not yet made).Note
Examples updated to match current client usage and mainnet defaults
funderandsignature_typetoClobClientinitialization inorder.pyandmarket_buy_order.py; remove manualApiCredswiring and insteadcreate_or_derive_api_creds()+set_api_creds()AMOYtoPOLYGON; default host remainshttps://clob.polymarket.com0.50, clarify BUYamountis USDC; useOrderType.FOKfor market buy).env.examplewithFUNDER,SIGNATURE_TYPE, and clearer API URL/credential guidanceWritten by Cursor Bugbot for commit c16cd82. This will update automatically on new commits. Configure here.