Gas Operations
The Opinion CLOB SDK uses a hybrid execution model. Order matching occurs off-chain via CLOB infrastructure (gas-free), while direct smart contract operations require BNB for transaction fees.
Gas-Free Operations
These operations are authenticated via EIP712 cryptographic signatures and submitted to the Opinion API. No gas is required.
Supported Operations:
Market data queries (
getMarkets,getOrderbook,getLatestPrice, etc.)Order management (
placeOrder,cancelOrder,placeOrdersBatch, etc.)Position tracking (
getMyBalances,getMyPositions,getMyTrades)
Gas-Required Operations
These operations modify blockchain state and require BNB native token for gas fees.
enableTrading
~100,000
One-time ERC20/ERC1155 approvals
split
~150,000
Convert collateral to outcome tokens
merge
~120,000
Convert outcome tokens back to collateral
redeem
~180,000
Claim winning payouts after resolution
Enable Trading
One-time approval to allow the exchange to use your tokens. Result is cached.
The return type is TransactionResult:
Split
Convert collateral (USDT) into outcome token pairs (YES + NO).
Parameters:
marketId(number) - The market IDamount(bigint) - Amount in weicheckApproval(boolean, defaulttrue) - Auto-callenableTrading()if needed
Merge
Convert outcome token pairs back to collateral.
Parameters:
marketId(number) - The market IDamount(bigint) - Amount in weicheckApproval(boolean, defaulttrue) - Auto-callenableTrading()if needed
Redeem
Claim winnings from resolved markets.
Parameters:
marketId(number) - The market ID (must be in RESOLVED status)checkApproval(boolean, defaulttrue) - Auto-callenableTrading()if needed
Gas Cost Estimation
At typical BNB Chain conditions (0.05 Gwei gas price, ~$600/BNB):
enableTrading
~$0.003
split
~$0.0045
merge
~$0.004
redeem
~$0.005
Recommended BNB Balance
Initial setup
0.001 BNB (~$0.60)
Active trading
0.01 BNB (~$6.00)
High-frequency
0.1 BNB (~$60.00)