Platform Integrations
This page is the per-platform reference. Each of the eight venues pairs a backend service
(services/<platform>/markets.ts, the read-proxy + normalizer) with a web lib
(lib/<platform>Trade.ts, the browser signing flow). The signing model is what differs most;
the read surface is uniform.
Signing models at a glance
| Platform | Chain (id) | Venue | Order built | Signed in browser | Submitted by |
|---|---|---|---|---|---|
| Kalshi (via DFlow) | Solana (mainnet) | Outcome-token swap | Backend (DFlow /order) | yes (Wallet Standard / Privy) | User sends, or backend co-signs (sponsored) |
| Polymarket | Polygon (137) | CLOB | Client (@polymarket/clob-client-v2) | yes (viem) | Polymarket CLOB directly |
| Limitless | Base (8453) | CLOB | Backend (@limitless-exchange/sdk) | yes (EIP-712, viem) | Backend relays under partner HMAC |
| Predict.fun | BNB (56 / t97) | CLOB | Backend (@predictdotfun/sdk) | yes (EIP-712, viem) | Backend relays (x-api-key) |
| Rain | Cross-chain | AMM | Backend (returns unsigned tx) | yes (viem sendTransaction) | User sends to AMM |
| Opinion | BNB (56) | CLOB (macro) | Backend | yes when typed data returned (EIP-712) | Backend submits |
| Overtime V2 | Optimism (10) | Sports AMM | Client (SportsAMMV2.trade()) | yes (viem writeContract) | User sends on-chain |
| DFlow | Solana (mainnet) | Execution engine | Backend (DFlow /order) | yes | User sends, or sponsored co-sign |
All eight produce the signature in the browser from the user's own wallet. "Order built: Backend" means the backend returns an unsigned order/transaction only.
Kalshi (via DFlow)
- Chain: Solana — mainnet-only (the lib always signs/broadcasts on
solana:mainnet, even when the app's native cluster is devnet). - Venue: Kalshi prediction-market outcome tokens exposed by DFlow (Pond) as SPL / Token-2022 mints; a trade is a swap of settlement ↔ outcome token.
- Backend service:
services/dflow/markets.ts(markets, single, orderbook, positions) +services/dflow/trade.ts(build/quote, redeem, order-status) +services/dflow/sponsor.ts(gasless). Markets are Redis-cached 30s. - Web lib:
lib/dflowTrade.ts— UI tab isKalshiTradeModal. - Signing model: backend
POST /v1/dflow/tradereturns a pre-built base64VersionedTransactionfrom DFlow's/order; the lib deserializes it and eithersignAndSendTransaction(normal) or signs-without-sending for the sponsored path, then polls/v1/dflow/order-statusto terminal (async CLP fills — landing on-chain is not the fill). Buys can be Proof-KYC gated server-side (PROOF_REQUIRED). - Capabilities: markets · single · orderbook · positions (from on-chain Token-2022 accounts joined to market metadata) · trade · redeem · sponsored / gasless execution.
Polymarket
- Chain: Polygon (137).
- Venue: Central-limit orderbook. Data via Gamma API (discovery) + Data API (positions); trading via the CLOB.
- Backend service:
services/polymarket/markets.ts— Redis-cached 60s. Gamma returnsoutcomes/outcomePrices/clobTokenIdsas stringified JSON arrays; the service parses them and mapsclobTokenIds[0]=YES,[1]=NO. - Web lib:
lib/polymarketTrade.ts—PolymarketTradeModal. - Signing model: client-built. The lib runs
@polymarket/clob-client-v2in the browser (EOA /signatureType 0, funder = the user's own Privy EVM wallet),createAndPostMarketOrderas FOK. Explicitly never proxied server-side so the geoblock applies to the user's IP. OptionalBUILDER_CODEfor builder attribution. - Capabilities: markets · search · single · positions · trade (BUY/SELL) · on-chain
redeem (CTF
redeemPositions, standard + neg-risk adapter) · collateral/conditional allowance management.
Limitless
- Chain: Base (8453). USDC collateral (6dp);
ConditionalTokensCTF. - Venue: CLOB via the official
@limitless-exchange/sdkunder a partner HMAC account. - Backend service:
services/limitless/markets.ts(markets/search/single/positions) +services/limitless/trade.ts(signing-message, register, trade-config, buildOrder, submitOrder). Note upstream prices can be percentages (0–100) and are rescaled. - Web lib:
lib/limitlessTrade.ts—LimitlessTradeModal. - Signing model: SIGN-ONLY. The backend
OrderBuilderbuilds the authoritative FOK order- EIP-712
domain/types(POST /v1/limitless/order/build); the lib does on-chain approvals, signs theOrdertyped data with viem, and the backend relays under partner HMAC (ownerId/onBehalfOf= the user's partner sub-accountprofileId). One-time registration (/register, onepersonal_sign) creates that sub-account.
- EIP-712
- Capabilities: markets · search · single (slug or address) · positions · register ·
trade-config (profile fee) · build · submit · on-chain redeem (CTF, indexSets
[1,2]).
Predict.fun
- Chain: BNB Chain (mainnet 56 / testnet 97). USDT collateral (18 decimals on BSC).
- Venue: CLOB via the official
@predictdotfun/sdk. Supports neg-risk and yield-bearing conditional-token families (the SDK picks the right exchange). - Backend service:
services/predict/markets.ts(markets/single/orderbook, volume-sorted, 60s cache) +services/predict/trade.ts(build/submit, positions, trade-config, referral). - Web lib:
lib/predictTrade.ts—PredictTradeModal. Mirrors the Limitless sign-only split. - Signing model: SIGN-ONLY. Backend builds the unsigned LIMIT/FOK order + EIP-712 typed
data (
POST /v1/predict/order/build); the lib runs family-aware approvals, signs, and the backend relays (POST /v1/predict/order,x-api-key). A one-time referral enrolment sets MAGMA as the user's referrer for fee capture (/auth-message→personal_sign→/referral), gated bylocalStorage, non-blocking. - Capabilities: markets · single · orderbook · positions · trade-config · build · submit · referral · family-aware on-chain redeem (standard CTF + neg-risk adapter, yield-bearing variants).
Rain
- Chain: Cross-chain — a market declares its chain; the lib maps it to a viem chain (Base, Ethereum, Polygon, Arbitrum, Optimism, BNB) and switches the wallet before signing.
- Venue: AMM. The backend proxies Rain's REST for a live AMM quote and an unsigned EVM transaction.
- Backend service:
services/rain/markets.ts(markets/search/single/positions, create)services/rain/trade.ts(quote, build, eligibility). 60s cache.
- Web lib:
lib/rainTrade.ts—RainTradeModal. Includes theRainMarket/RainQuoteinterfaces mirrored from the backend. - Signing model: backend-built transaction.
POST /v1/rain/trade/buildreturnscontractAddress+txData(computed from a fresh quote and slippage-derivedminShares); the lib approves the AMM to pull collateral (per-chain default USDC, BNB→USDT), thensendTransaction. No order math in the lib. - Capabilities: markets · search · single · positions · create market (Rain-unique) · quote · build/trade. Eligibility is checked server-side on build.
Opinion
- Chain: BNB Chain (56).
- Venue: CLOB focused on macro / economics (economic indicators, thresholds, AI-oracle confidence, data sources).
- Backend service:
services/opinion/markets.ts(markets/search/single/orderbook/positions)services/opinion/trade.ts(build/submit, eligibility). 60s cache.
- Web lib:
lib/opinionTrade.ts—OpinionTradeModal. Includes theOpinionMarket/OpinionOrderbookinterfaces. - Signing model: backend build → submit.
POST /v1/opinion/order/buildreturns the built order; when the backend's CLOB SDK path returnsdomain/types/order, the lib signs the EIP-712 order on BNB Chain beforePOST /v1/opinion/order/submit; otherwise it relays the built order as-is. Market vs limit orders; eligibility checked on build. - Capabilities: markets · search · single · orderbook · positions · order build · submit.
Overtime V2
- Chain: Optimism (10). USDC collateral (6dp).
- Venue: Sports AMM — bets placed on-chain via
SportsAMMV2.trade()(Thales contracts-v2). Single-game and player-prop / combined markets, plus live in-play markets. - Backend service:
services/overtime/markets.ts(markets/live/search/single/positions) +services/overtime/trade.ts(quote, contracts config, eligibility). - Web lib:
lib/overtimeTrade.ts— UI modal isOvertimeBetModal(note: "Bet", not "Trade"). IncludesOvertimeMarket/OvertimeQuote/OvertimeContractsinterfaces and theSportsAMMV2.trade()ABI. - Signing model: client on-chain. Quote (payout/profit) via
POST /v1/overtime/quote; the bet itself iswriteContractagainstSportsAMMV2.trade()from the user's wallet, with USDC approval, odds/expected-quote scaled to1e18,line ×100, and the configured referrer. - Capabilities: markets · live-markets · search · single (with child markets) · positions · config (contract addresses) · quote · on-chain bet.
Verify-before-mainnet — Overtime trade ABI
The SportsAMMV2.trade() tuple and odds/line scaling in lib/overtimeTrade.ts follow the
documented Thales contracts-v2 shape but are flagged VERIFY-BEFORE-MAINNET in the source —
confirm against the deployed contract ABI before real-money use. The quote path is exact.
DFlow
- Chain: Solana — mainnet.
- Role: the execution engine behind Kalshi. DFlow (Pond) provides the metadata API
(events/markets/orderbook), the Trade API (
/order,/order-status), and the sponsored / gasless path. There is no separate "DFlow market type" — DFlow is the Kalshi integration. - Backend service:
services/dflow/markets.ts,services/dflow/trade.ts,services/dflow/sponsor.ts. - Web lib:
lib/dflowTrade.ts. - Signing model: see Kalshi above. Key extra capability: gasless —
sponsorExecmakes MAGMA's sponsor wallet the fee-payer; the tx needs both user and sponsor signatures, so the user signs without broadcasting and the backend co-signs and submits (POST /v1/dflow/sponsor-submit). The sponsor only co-signs a tx whose message bytes match a recently-issued order (anti blind-sign). Off unlessDFLOW_SPONSOR_ENABLED=true. - Capabilities: everything Kalshi exposes, plus
sponsor-statusandsponsor-submit.
See also
- Market Normalization — the
<Platform>Marketinterfaces. - Trading & Settlement — the full per-platform order lifecycle.
- API Reference — every
/v1/<platform>endpoint.