Builder Mode
Non-custodial integration for building trading terminals on top of Opinion's prediction market.
To request Builder access, Please kindly fill out this short application form .
What is Builder Mode?
Builder mode lets you create your own trading application on top of Opinion's prediction market:
2,000 free gasless transactions per day (order placement and cancellation)
Non-custodial: you never handle user private keys; users sign with their own wallets
Full API coverage: user management, order building, Safe transactions, and more
Architecture
┌──────────────┐ ┌──────────────────┐ ┌────────────┐
│ Your App │ │ Opinion Backend │ │ BNB Chain │
│ (Builder) │────>│ (API + Relayer) │────>│ (On-chain) │
│ │ │ │ │ │
│ BuilderClient│<────│ - Order matching │<────│ - Safe │
│ + UserClient │ │ - TX relay │ │ - CTF │
│ │ │ - Safe creation │ │ - ERC20 │
└──────────────┘ └──────────────────┘ └────────────┘Three identities involved:
EOA (signer)
Signs orders and Safe transactions
User (private key)
Safe (asset wallet)
Holds funds, executes trades
Multi-sig (EOA is owner)
Builder API key
Authenticates builder API calls
Builder (your server)
Quick Start
Constructor Parameters
host
str
Yes
API host URL
builder_apikey
str
Yes
Builder API key (uses builder-apikey header)
chain_id
int
Yes
Blockchain chain ID (56 for BNB Chain)
rpc_url
str
No
RPC endpoint URL (required for Safe operations)
use_beta
bool
No
Use beta (test env) mode (default: False)
contract_addresses
dict
No
Override contract addresses (required if use_beta=True)
API Reference
create_user()
get_user(), regenerate_user_apikey()
get_quote_tokens()
get_market(), get_orderbook()
build_order_for_signing(), sign_order_with_private_key()
place_order_for_user(), place_order_for_user_from_build_result()
cancel_order_for_user(), cancel_orders_batch_for_user(), cancel_all_orders_for_user(), get_user_orders()
build_enable_trading_tx()
build_split_tx(), build_merge_tx(), build_redeem_tx(), build_withdraw_tx(), submit_safe_tx()
UserClient testing helper
Signing Patterns
There are two distinct signing patterns:
Order signing (gasless, for placing orders):
Safe TX signing (relayed, for on-chain operations):
Signature Types
EOA
0
Direct EOA signature (maker == signer)
GNOSIS_SAFE
2
Gnosis Safe signature (maker != signer)
The type is determined automatically based on whether signer_address differs from user_wallet_address.
Error Handling
Exception hierarchy: BuilderError > InvalidParamError, ApiError.
Last updated