FAQ
Common questions and answers about the Opinion CLOB SDK.
Installation & Setup
Q: What Python versions are supported?
A: Python 3.8 and higher. The SDK is tested on Python 3.8 through 3.13.
python --version # Must be 3.8+Q: How do I install the SDK?
A: Use pip:
pip install opinion_clob_sdkSee Installation Guide for details.
Q: Where do I get API credentials?
A: You need:
API Key - Fill out this short application form
Private Key - From your EVM wallet (e.g., MetaMask)
Multi-sig Address - Your wallet address (visible in "MyProfile")
RPC URL - Get from Nodereal, Alchemy, drpc etc..
Never share your private key or API key!
Q: What's the difference between private_key and multi_sig_addr?
private_key and multi_sig_addr?A:
private_key: The signer wallet that signs orders/transactions (hot wallet)multi_sig_addr: The assets wallet that holds funds/positions (can be cold wallet)
They can be the same address, or different for security (hot wallet signs for cold wallet).
Example:
Configuration
Q: Which chain IDs are supported?
A: Only BNB blockchain:
BNB Mainnet:
chain_id=56(production)
Q: How do I configure caching?
A: Use these parameters when creating the Client:
Set to 0 to disable caching:
Trading
Q: What's the difference between market and limit orders?
A:
Execution
Immediate
When price reached
Price
Best available
Your specified price or better
Guarantee
Fills immediately*
May not fill
Price field
Set to "0"
Set to desired price (e.g., "0.55")
* If sufficient liquidity exists
Examples:
Q: Should I use makerAmountInQuoteToken or makerAmountInBaseToken?
makerAmountInQuoteToken or makerAmountInBaseToken?A: Depends on order side:
For BUY orders:
β Recommended:
makerAmountInQuoteToken(specify how much USDT to spend)Alternative:
makerAmountInBaseToken(specify how many tokens to buy)
For SELL orders:
β Recommended:
makerAmountInBaseToken(specify how many tokens to sell)Alternative:
makerAmountInQuoteToken(specify how much USDT to receive)
Rules:
β Cannot specify both
β Market BUY cannot use
makerAmountInBaseTokenβ Market SELL cannot use
makerAmountInQuoteToken
Q: Do I need to call enable_trading() before every order?
enable_trading() before every order?A: No, only once! The SDK caches the result for enable_trading_check_interval seconds (default 1 hour).
Option 1: Manual (recommended for multiple orders)
Option 2: Automatic (convenient for single orders)
Q: How do I cancel all my open orders?
A: Use cancel_all_orders():
Smart Contracts
Q: What's the difference between split, merge, and redeem?
A:
split
USDT β YES + NO tokens
Before trading (create positions)
β Yes
merge
YES + NO β USDT
Exit position on unresolved market
β Yes
redeem
Winning tokens β USDT
Claim winnings after resolution
β Yes
Examples:
Q: Why do I need BNB if orders are gas-free?
A: BNB is needed for blockchain operations:
Gas-free (signed orders):
β
place_order()- No BNB neededβ
cancel_order()- No BNB neededβ All GET methods - No BNB needed
Requires BNB:
β½
enable_trading()- On-chain approvalβ½
split()- On-chain transactionβ½
merge()- On-chain transactionβ½
redeem()- On-chain transaction
How much BNB? Usually $0.005-0.05 per transaction on BNB Chain.
Q: Can I split without calling enable_trading()?
enable_trading()?A: Yes, but it will fail without approval. Use check_approval=True:
The same applies to merge() and redeem().
Errors
Q: What does InvalidParamError mean?
InvalidParamError mean?A: Your method parameters are invalid. Common causes:
Q: What does OpenApiError mean?
OpenApiError mean?A: API communication or business logic error. Common causes:
Check:
response.errno != 0β API returned errorresponse.errmsgβ Error messageChain ID matches between client and market
Q: What does errno != 0 mean in responses?
errno != 0 mean in responses?A: The API returned an error.
Success:
Error:
Always check errno before accessing result.
Performance
Q: Why are my API calls slow?
A: Possible reasons:
No caching - Enable caching for better performance:
Slow RPC - Use a faster provider:
Too many calls - Use batch operations:
Q: How do I reduce API calls?
A: Use caching and batch operations:
Caching:
Batch operations:
Data & Precision
Q: How do I convert USDT amount to wei?
A: Use safe_amount_to_wei():
Common decimals:
USDT: 18 decimals
BNB: 18 decimals
Outcome tokens: Same as quote token
Q: How are prices formatted?
A: Prices are strings with up to 2 decimal places:
Q: What token amounts are in the API responses?
A: Amounts are in wei units (smallest unit).
Example:
Troubleshooting
Q: "ModuleNotFoundError: No module named 'opinion_clob_sdk'"
A: SDK not installed. Install it:
Q: "InvalidParamError: chain_id must be one of [56]"
A: You're using an unsupported chain ID. Use BNB mainnet:
Q: "OpenApiError: Cannot place order on different chain"
A: Your client and market are on different chains.
Fix: Ensure client chain_id matches market chain_id:
Q: "BalanceNotEnough" error when calling split/merge
A: Insufficient token balance.
For split: Need enough USDT
For merge: Need equal amounts of both outcome tokens
Q: "InsufficientGasBalance" error
A: Not enough BNB for gas fees.
Fix: Add BNB to your signer wallet:
Last updated