Skip to content
PredictFlow

How it works

From market click to on-chain fill, six deterministic steps.

Every trade you place on PredictFlow follows the same pipeline. Nothing is custom per wallet or per market. Here's exactly what happens between "Buy YES" and "fill confirmed".

  1. 1

    Connect a Solana wallet

    PredictFlow detects Phantom, Solflare, or Backpack from the browser. No wallet-adapter dependency, no WalletConnect handshake. Your public key is mirrored to localStorage for reconnect on reload — never the key material.

  2. 2

    Browse markets

    The catalog comes from DFlow's REST API, proxied through a Cloudflare Pages Function (or your host of choice) to keep the origin same-site and CSP strict. Filter by category — Sports, Politics, Crypto, Economics — or search by keyword.

  3. 3

    Place an order

    Pick a side and an order type. Market fires immediately. Limit / stop-loss / take-profit / DCA arm a client-side monitor that polls the live price feed every 5 seconds and triggers when your condition is met.

  4. 4

    The signing pipeline

    Before your wallet ever sees a prompt: DFlow responds with a pre-built Solana transaction. PredictFlow validates its size, decodes every instruction with @solana/web3.js, asserts every target program against a strict whitelist, and simulates the transaction against your RPC. Any failure blocks the signing prompt.

  5. 5

    Your wallet signs

    Only then — with a verified, preflighted transaction — does your wallet open the signing prompt. You see the human-readable outcome the wallet displays, with no surprises underneath.

  6. 6

    Settlement

    The signed transaction broadcasts to Solana mainnet. Typical confirmation time is ~400ms. Your fill is persisted locally and immediately visible in the Portfolio tab, with live mark-to-market P&L against the latest DFlow price.

Under the hood

// Every trade executes this pipeline:

const txPayload      = await fetch(DFLOW_ORDER_URL, { headers: { 'X-Idempotency-Key': nonce } })
validateTxPayload(txPayload)                 // reject > 2× MAX_TX_SIZE
const tx             = decodeDflowTransaction(txPayload)
assertAllowedPrograms(tx)                    // System / SPL / ATA / ComputeBudget / Memo / DFlow router
await preflightTransaction(tx, rpcEndpoints) // simulate — fails closed on RPC error

const sig = await wallet.signAndSendTransaction(tx)
appendPosition({ market, side, amount, sig, price })

Source: useTradeSubmit.js · lib/txDecoder.js · lib/solanaPreflight.js

Conditional-order monitor

Limit, stop-loss, and take-profit orders don't execute automatically on the chain — they can't, because the outcome price isn't on-chain. PredictFlow runs a client-side monitor that evaluates triggers locally and fires the same signing pipeline when conditions are met.

Live price feed

DFlow WebSocket subscribes to the markets you're watching. On disconnect, an exponential backoff kicks in with a 10-failure circuit breaker that falls through to REST polling (if VITE_LIVE_PRICE_URL is configured).

Monitor loop

Every 5 seconds, the monitor walks each pending order and evaluates its trigger against the latest price. If the condition matches, the order fires through the same pipeline as a manual market order.

Important

Conditional orders only execute while the browser tab is open. A persistent banner in the app reminds you whenever pending conditional orders or active DCA strategies exist. Server-side scheduled execution is on the roadmap.

Ready to trade prediction markets like a pro?

Connect a Solana wallet, pick a market, and place your first conditional order in under a minute.