Troubleshooting
Solutions to common issues when using the Opinion CLOB SDK.
Installation Issues
ImportError: No module named 'opinion_clob_sdk'
Problem:
import opinion_clob_sdk
# ModuleNotFoundError: No module named 'opinion_clob_sdk'Solutions:
Install the SDK:
pip install opinion_clob_sdkVerify installation:
pip list | grep opinion python -c "import opinion_clob_sdk; print(opinion_clob_sdk.__version__)"Check Python environment:
which python # Ensure correct Python interpreter which pip # Ensure pip matches PythonUse virtual environment:
python3 -m venv venv source venv/bin/activate pip install opinion_clob_sdk
Dependency Conflicts
Problem:
Solutions:
Create fresh virtual environment:
Upgrade pip:
Force reinstall:
Configuration Issues
InvalidParamError: chain_id must be 56
Problem:
Solution: Use BNB Chain Mainnet 56
Missing Environment Variables
Problem:
Solutions:
Create
.envfile:Load environment variables:
Provide defaults:
API Errors
OpenApiError: errno != 0
Problem:
Solutions:
Always check errno:
Common errno codes:
CodeMeaningSolution0
Success
Proceed with result
404
Not found
Check ID exists
400
Bad request
Check parameters
401
Unauthorized
Check API key
500
Server error
Retry later or contact support
Wrap in try-except:
InvalidParamError: market_id is required
Problem:
Solution: Always provide required parameters:
Trading Errors
InvalidParamError: Price must be positive for limit orders
Problem:
Solution: Set valid price for limit orders:
InvalidParamError: makerAmountInBaseToken is not allowed for market buy
Problem:
Solution: Use correct amount field:
Market BUY:
Market SELL:
InvalidParamError: makerAmountInQuoteToken must be at least 1
Problem:
Solution: Use minimum amount of 1:
Blockchain Errors
BalanceNotEnough
Problem:
Solutions:
Check balance:
For merge - need both outcome tokens:
InsufficientGasBalance
Problem:
Solution: Add ETH to signer wallet:
Problem:
Common Causes:
Insufficient approval:
Insufficient balance: Check balance before operation (see BalanceNotEnough above)
Gas price too low:
Contract state changed:
Performance Issues
Too Many API Calls
Problem: Hitting rate limits.
Solutions:
Use caching:
Fetch once, use multiple times:
Paginate efficiently:
Data Issues
Precision Errors
Problem:
Solution: Use safe_amount_to_wei():
Type Mismatch
Problem:
Solution: Use correct types:
Authentication Issues
401 Unauthorized
Problem:
Solutions:
Check API key:
Verify key format:
Contact support: If key is correct but still failing, contact [email protected]
Private Key Issues
Problem:
Solutions:
Check format:
Verify length:
Debug Tips
Enable Logging
Inspect Responses
Check SDK Version
Verify Network Connection
Getting Help
If you're still experiencing issues:
Check FAQ: Frequently Asked Questions
Join Discord Dev Channel
When reporting issues, include:
SDK version
Python version
Full error traceback
Minimal code to reproduce
Expected vs actual behavior
Last updated