Quick Start

Get up and running with the Opinion CLOB SDK in minutes. This guide will walk you through your first integration.

Prerequisites

Before starting, ensure you have:

  1. Python 3.8+ installed

  2. Opinion CLOB SDK installed (Installation Guide)

  3. API credentials from Opinion Labs:

    • API Key

    • Private Key (for signing orders)

    • Multi-sig wallet address (create on https://app.opinion.trade)

    • RPC URL (BNB Chain mainnet)

Need credentials? Fill out this short application form to get your API key.

5-Minute Quickstart

Step 1: Set Up Environment

Create a .env file in your project directory:

# .env file
API_KEY=your_api_key_here
RPC_URL=https://bsc-dataseed.binance.org
PRIVATE_KEY=0x1234567890abcdef...
MULTI_SIG_ADDRESS=0xYourWalletAddress...
HOST=https://proxy.opinion.trade:8443
CHAIN_ID=56
CONDITIONAL_TOKEN_ADDR=0xAD1a38cEc043e70E83a3eC30443dB285ED10D774
MULTISEND_ADDR=0x998739BFdAAdde7C933B942a68053933098f9EDa

Step 2: Initialize the Client

Create a new Python file (my_first_app.py):

Step 3: Fetch Market Data

Add market data fetching:

Step 4: Get Market Details

Step 5: Check Orderbook

Complete Example

Here's the complete my_first_app.py:

Run Your App

Expected Output:

Next Steps

Now that you've fetched market data, explore more advanced features:

Trading

Learn how to place orders:

See Placing Orders for detailed examples.

Position Management

Track your positions:

See Managing Positions for more.

Smart Contract Operations

Interact with blockchain:

See Contract Operations for details.

Common Patterns

Error Handling

Always check response status:

Using Try-Except

Pagination

For large datasets:

Configuration Tips

Cache Settings

Optimize performance with caching:

Set to 0 to disable caching:

Chain Selection

For production deployment, ensure you're using the correct configuration:

Resources


Ready to build? Explore the API Reference to see all available methods!

Last updated