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_sdk

See Installation Guide for details.


Q: Where do I get API credentials?

A: You need:

  1. API Key - Fill out this short application form

  2. Private Key - From your EVM wallet (e.g., MetaMask)

  3. Multi-sig Address - Your wallet address (visible in "MyProfile")

  4. 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?

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:

Feature
Market Order
Limit Order

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?

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?

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:

Operation
Purpose
When to Use
Gas Required

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()?

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?

A: Your method parameters are invalid. Common causes:


Q: What does OpenApiError mean?

A: API communication or business logic error. Common causes:

Check:

  1. response.errno != 0 β†’ API returned error

  2. response.errmsg β†’ Error message

  3. Chain ID matches between client and market


Q: What does 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:

  1. No caching - Enable caching for better performance:

  2. Slow RPC - Use a faster provider:

  3. 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