Can be the same address or different (e.g., hot wallet signs for cold wallet)
Where to find:
Check your Opinion platform "My Profile" section
Or use the wallet address where you hold USDT/positions
Optional Parameters
conditionalTokensAddress
Type: AddressDescription: ConditionalTokens contract address
Default: 0xAD1a38cEc043e70E83a3eC30443dB285ED10D774 (BNB Chain mainnet)
When to set: Only if using a custom deployment
multiSendAddress
Type: AddressDescription: Gnosis Safe MultiSend contract address
Default: 0x38869bf66a61cF6bDB996A6aE40D5853Fd43B526
When to set: Only if using a custom Gnosis Safe deployment
feeManagerAddress
Type: AddressDescription: Fee rate management contract address
Default: 0xC9063Dc52dEEfb518E5b6634A6b8D624bc5d7c36
When to set: Only if using a custom deployment
enableTradingCheckInterval
Type: numberDescription: Cache duration (in seconds) for trading approval checks
Default: 3600 (1 hour)
Range: 0 to infinity
Type: numberDescription: Cache duration (in seconds) for quote token data
Default: 3600 (1 hour)
Range: 0 to infinity
Impact:
Quote tokens rarely change
Higher values improve performance
Recommended: 3600 or higher
marketCacheTtl
Type: numberDescription: Cache duration (in seconds) for market data
Default: 300 (5 minutes)
Range: 0 to infinity
Impact:
Markets change frequently (prices, status)
Lower values -> More current data
Recommended: 300 for balance of performance and freshness
proxyUrl
Type: stringDescription: HTTP proxy URL for API requests
Default: undefined (no proxy)
Environment Variables
Using .env Files
Create a .env file in your project root:
Load in your code:
Using System Environment Variables
Set in shell:
Then access in your code:
Configuration Patterns
Multi-Environment Setup
Manage different environments (dev, staging, prod):
Factory Function
Organize configuration in a factory function:
Read-Only Client
For applications that only read data (no trading):
Performance Tuning
High-Frequency Trading
For trading bots with frequent API calls:
Analytics/Research
For data analysis with less frequent updates:
Real-Time Monitoring
For dashboards requiring fresh data:
Smart Contract Addresses
BNB Chain Mainnet (Chain ID: 56)
The following smart contract addresses are used by the Opinion CLOB TypeScript SDK on BNB Chain mainnet:
Contract
Address
Description
ConditionalTokens
0xAD1a38cEc043e70E83a3eC30443dB285ED10D774
ERC1155 conditional tokens contract for outcome tokens
MultiSend
0x38869bf66a61cF6bDB996A6aE40D5853Fd43B526
Gnosis Safe MultiSend contract for batch transactions
FeeManager
0xC9063Dc52dEEfb518E5b6634A6b8D624bc5d7c36
Fee rate management contract
These addresses are automatically used by the SDK when you specify chainId: 56. You only need to provide custom addresses if you are using a custom deployment.
import { CHAIN_ID_BNB_MAINNET } from '@opinion-labs/opinion-clob-sdk';
chainId: CHAIN_ID_BNB_MAINNET // 56
// Public RPC (rate limited)
rpcUrl: 'https://bsc-dataseed.binance.org'
// Private RPC (recommended for production)
rpcUrl: 'https://bsc.nodereal.io'
privateKey: '0x1234567890abcdef...' as `0x${string}` // Must have 0x prefix
multiSigAddress: '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb' as `0x${string}`
// Default: check approval status every hour
enableTradingCheckInterval: 3600
// Check every time (no caching)
enableTradingCheckInterval: 0
// Check daily
enableTradingCheckInterval: 86400