GuidesBuild schemas by venue
Opinion
Step zero — from nothing to your first trade
Section titled “Step zero — from nothing to your first trade”- Create the account. Open opinion.trade, connect the BNB Smart Chain EOA you will trade from, and follow the current prompts; Predictefy has no verified information on the identity-check sequence, so confirm it with the venue.
- Set up credentials. First create a wallet and secure its seed phrase; never share the private key, which Predictefy never sees. Get the user API key in your venue account’s API settings. The direct path sends it only to Opinion.
- Fund and approve. A practical first test is about $10–$25 of USDT on BNB Smart Chain (
56), plus a little BNB for gas—not a venue minimum. Approve the exact market-derived exchange; do not hardcode the spender. If funds are on another chain, start withGET /v1/bridge/quote. - Allow time. Budget 1–2 hours for a first wallet, bridge, and approval; less if already funded.
Opinion’s account and jurisdiction rules still apply, and the direct path uses your real connection.
What you need first
Section titled “What you need first”- Production status: Enabled for build, submit, and cancel. Hosted requests use eligible regional egress and reach Opinion; a live credentialed submit has not yet been verified on that path.
- Wallet and chain: A BSC (
56) EOA signs. Signature type2additionally uses an Opinion Safe as maker while the EOA remains its controlling signer. - Venue account: For the working venue-direct SDK path, use an Opinion account with a user API key. Hosted build needs no caller venue credential.
- Credentials: On
client.accounts.opinion, the user API key stays in the caller’s process and goes only to Opinion. Hosted cancel/status accepts it transiently and never retains it. - Funding: Hold the market-authoritative BSC quote token in the maker EOA or Safe and approve the exact exchange. The current documented route is BSC USDT through LI.FI.
Opinion is server-built by default. Send asset, or outcome plus outcomeSide, together with
isBuy, price, size, and owner. Optional fields are signatureType, safeAddress, and
taker. When the deployment enables Opinion market orders, the build also accepts
orderType (LIMIT, the default, or MARKET) and postOnly on limit orders. While the capability
is off, both fields are unexpected-field refusals, exactly as before. With no order object, the
service resolves the token through Predictefy’s catalog, fetches that exact Opinion market, then
follows its quote token to the authoritative BSC exchange and collateral decimals. A missing or
ambiguous mapping, or any catalog/API disagreement, fails closed before an execution is persisted.
Identity is explicit:
- Signature type
0is plain EOA:maker == signer == owner;safeAddressis rejected. - Signature type
2requiressafeAddress:maker == safeAddressis the funds-holding Safe, whilesigner == owneris its controlling EOA. They are deliberately not forced equal.
Opinion’s pinned 0.6.1 builder fixes LIMIT prices to six decimals and order fees to 0. A price
must round inside 0.000001..0.999999. Opinion sets order expiry itself: every server-built order
carries the venue’s documented 30-day expiry, and expiresAt is not caller-settable, so the build
refuses that field. The server generates a full-width 256-bit cryptographic salt. Opinion’s
relay serializes that uint256 as a decimal string, so the Polymarket safe-integer salt limit does
not apply. The response includes the venue-shaped unsigned order, buildVersion: 1, and canonical
types, primaryType, domain, and message for wallet signing. The legacy echoed buildResult
remains accepted unchanged.
Market orders
Section titled “Market orders”Market orders are off by default and turn on only when the deployment enables them for this service. The build follows Opinion’s SDK exactly:
- A market BUY sizes
sizein the quote token: the amount of USDT to spend. - A market SELL sizes
sizein the base token: the number of outcome shares to sell. priceis ignored and carried as0. The signed order has a zero taker leg.- Opinion’s documented $5 minimum order is enforced before the wallet is asked to sign. Because a market SELL has no fixed price, it also needs at least five shares, the smallest count that can reach $5 at the $1 maximum payout.
postOnlyis refused on a market order. On a limit order it passes through to the venue.
The spend caps treat a market BUY as its full quote spend. A market SELL is bounded at $1 per signed share, so the per-order cap still applies.
await client.accounts.opinion.createOrder( { idempotencyKey: 'your-stable-market-key', asset: '123456789', isBuy: true, size: 10, // 10 USDT to spend orderType: 'MARKET', owner: account.address, signatureType: 0, }, account,);Client-side submit route
Section titled “Client-side submit route”Opinion rejects order traffic from restricted regions. Hosted requests now use Predictefy’s eligible regional egress relay; venue reads and order requests are verified to reach Opinion through it, but a live credentialed submit remains unverified. The caller-direct route below remains supported: it builds at Predictefy, signs in the caller’s wallet, and submits from the caller’s own eligible connection with their user API key.
const client = new Predictefy({ apiKey: process.env.PREDICTEFY_API_KEY, execBaseUrl: PREDICTEFY_EXEC_BASE_URL, venueCredentials: { opinion: { apiKey: process.env.OPINION_API_KEY! } },});
const placed = await client.accounts.opinion.createOrder( { idempotencyKey: 'your-stable-build-key', asset: '123456789', isBuy: true, price: 0.4, size: 10, owner: account.address, signatureType: 0, }, account,);
const accountAuth = { apiKey: process.env.OPINION_API_KEY! };const status = await client.accounts.opinion.fetchOrder(placed.orderId, accountAuth);await client.accounts.opinion.cancelOrder(placed.orderId, accountAuth);The build request has an explicit field allowlist. Unknown fields are rejected before any request,
and their values are never included in errors. Before asking the wallet to sign, the SDK rebuilds
the exact-key Opinion order and canonical EIP-712 types, pins chain 56, domain name
OPINION CTF Exchange, version 1, and verifies the market-derived exchange against the execution
service’s known-exchange allowlist. It independently compares the digest and structHash, then binds
the requested token, side, venue-rounded amounts, maker, signer, and signature type. Opinion sets
order expiry itself, so a caller expiresAt is refused before the build.
The SDK also reads the market’s authoritative outcome-token mapping from the fixed venue origin and
refuses to sign unless the signed token is the requested side’s token for that market — in asset
mode the signed token must belong to the routed market. A failed or malformed venue read refuses
before signing; the mapping is fetched once per market per client and reused.
After signing, it recovers the EOA from the signature and requires it to match the requested owner.
Safe mode remains a plain EOA signature over the complete order: signature type 2 uses the Safe as
maker and its controlling EOA as signer. It never uses EIP-1271.
The SDK sends the opinion-clob-sdk 0.6.1 wire body under the caller’s apikey header to the fixed
https://openapi.opinion.trade/openapi origin. Create is POST /order, status is
GET /order/{orderId}, and cancel is POST /order/cancel. Hosted build traffic and credentialed
venue traffic use separate fetch seams. Venue calls refuse redirects, and failures expose typed,
generic errors without upstream text or credentials. The route does not bypass Opinion’s account or
jurisdiction rules.