Skip to main content

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

PlatformChain (id)VenueOrder builtSigned in browserSubmitted by
Kalshi (via DFlow)Solana (mainnet)Outcome-token swapBackend (DFlow /order)yes (Wallet Standard / Privy)User sends, or backend co-signs (sponsored)
PolymarketPolygon (137)CLOBClient (@polymarket/clob-client-v2)yes (viem)Polymarket CLOB directly
LimitlessBase (8453)CLOBBackend (@limitless-exchange/sdk)yes (EIP-712, viem)Backend relays under partner HMAC
Predict.funBNB (56 / t97)CLOBBackend (@predictdotfun/sdk)yes (EIP-712, viem)Backend relays (x-api-key)
RainCross-chainAMMBackend (returns unsigned tx)yes (viem sendTransaction)User sends to AMM
OpinionBNB (56)CLOB (macro)Backendyes when typed data returned (EIP-712)Backend submits
Overtime V2Optimism (10)Sports AMMClient (SportsAMMV2.trade())yes (viem writeContract)User sends on-chain
DFlowSolana (mainnet)Execution engineBackend (DFlow /order)yesUser 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 is KalshiTradeModal.
  • Signing model: backend POST /v1/dflow/trade returns a pre-built base64 VersionedTransaction from DFlow's /order; the lib deserializes it and either signAndSendTransaction (normal) or signs-without-sending for the sponsored path, then polls /v1/dflow/order-status to 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 returns outcomes / outcomePrices / clobTokenIds as stringified JSON arrays; the service parses them and maps clobTokenIds[0]=YES, [1]=NO.
  • Web lib: lib/polymarketTrade.tsPolymarketTradeModal.
  • Signing model: client-built. The lib runs @polymarket/clob-client-v2 in the browser (EOA / signatureType 0, funder = the user's own Privy EVM wallet), createAndPostMarketOrder as FOK. Explicitly never proxied server-side so the geoblock applies to the user's IP. Optional BUILDER_CODE for 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); ConditionalTokens CTF.
  • Venue: CLOB via the official @limitless-exchange/sdk under 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.tsLimitlessTradeModal.
  • Signing model: SIGN-ONLY. The backend OrderBuilder builds the authoritative FOK order
    • EIP-712 domain/types (POST /v1/limitless/order/build); the lib does on-chain approvals, signs the Order typed data with viem, and the backend relays under partner HMAC (ownerId/onBehalfOf = the user's partner sub-account profileId). One-time registration (/register, one personal_sign) creates that sub-account.
  • 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.tsPredictTradeModal. 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-messagepersonal_sign/referral), gated by localStorage, 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.tsRainTradeModal. Includes the RainMarket / RainQuote interfaces mirrored from the backend.
  • Signing model: backend-built transaction. POST /v1/rain/trade/build returns contractAddress + txData (computed from a fresh quote and slippage-derived minShares); the lib approves the AMM to pull collateral (per-chain default USDC, BNB→USDT), then sendTransaction. 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.tsOpinionTradeModal. Includes the OpinionMarket / OpinionOrderbook interfaces.
  • Signing model: backend build → submit. POST /v1/opinion/order/build returns the built order; when the backend's CLOB SDK path returns domain/types/order, the lib signs the EIP-712 order on BNB Chain before POST /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 is OvertimeBetModal (note: "Bet", not "Trade"). Includes OvertimeMarket / OvertimeQuote / OvertimeContracts interfaces and the SportsAMMV2.trade() ABI.
  • Signing model: client on-chain. Quote (payout/profit) via POST /v1/overtime/quote; the bet itself is writeContract against SportsAMMV2.trade() from the user's wallet, with USDC approval, odds/expected-quote scaled to 1e18, 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: gaslesssponsorExec makes 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 unless DFLOW_SPONSOR_ENABLED=true.
  • Capabilities: everything Kalshi exposes, plus sponsor-status and sponsor-submit.

See also