Order Manipulation
Your First Order
Placing your first order using the Python client is relatively straightforward.
After installing the Client pip install py-clob-client
you should be able to run the below code. Take the time to fill in the constants at the top and ensure you’re using the proper client
In addition to detailed comments in the code snippet, here are some more tips to help you get started.
- See the Python example for details on the proper way to intialize a Py-Clob-Client depending on your wallet type. Three exhaustive examples are given. If using a MetaMask wallet or EOA please see the resources here, for instructions on setting allowances.
- When buying into a market you purchase a “Token” that token represents either a Yes or No outcome of the event. To easily get required token pairs for a given event we have provided an interactive endpoint here.
- Common pitfalls:
- Negrisk Markets require an additional flag in the OrderArgs
negrisk=False
invalid signature
error, likely due to one of the following.- Incorrect Funder and or Private Key
- Incorrect NegRisk flag in your order arguments
not enough balance / allowance
.
- Negrisk Markets require an additional flag in the OrderArgs