Insightra Docs

How Insightra markets, factories, and the Predikt Oracle fit together.

Overview

Insightra is a prediction-market protocol powered by factory-deployed markets and a lightweight, on-chain oracle called Predikt. Users can create markets, trade outcome tokens, and redeem after resolution from the oracle.

Contracts & Architecture
  • Factories: BinaryFactory, CategoricalFactory, ScalarFactory create market instances and handle listing controls (remove/restore, redeem fee bps).
  • Markets: BinaryMarket, CategoricalMarket, ScalarMarket extend MarketBase; mint outcome tokens, take/add liquidity, and settle via finalizeFromOracle().
  • Oracle: KasOracle (Predikt) exposes createQuestionPublic (with fee), commit/recommit, reveal, finalize, escalate, and receiveArbitratorRuling. Questions are keyed by a bytes32 id.
  • Arbitration: SimpleArbitrator can be plugged in for escalations and final rulings.
FactoriesMarketsBinary/Categorical/ScalarPredikt Oracledeployresolve via id
Market Lifecycle
  1. Create: Anyone can create a market. The app calls createQuestionPublic on the oracle (pays the current questionFee in the oracle’s bondToken), then calls the relevant factory submit* to deploy the market linked to that questionId.
  2. Trade: Liquidity is added and outcome tokens trade; LPs earn fees on volume.
  3. Report: Reporters first commit a hashed answer, then later reveal the answer and post a bond. Each round’s minimum bond is either minBaseBond or the previous best bond × bondMultiplier, up to maxRounds.
  4. Finalize: If unchallenged and liveness expires, anyone can finalize(id). The market then calls finalizeFromOracle() to settle.
  5. Dispute & Escalate: If challenged repeatedly, the question can escalate to the on-chain arbitrator for a final ruling (consumed by receiveArbitratorRuling).
commit(hash)reveal(answer)finalize()
Predikt Oracle

Predikt (KasOracle) is a commitment-based optimistic oracle with bond escalation and optional arbitration.

  • Public creation: createQuestionPublic (pays questionFee in bondToken).
  • Commit → Reveal: Reporters submit hashCommit = keccak256(abi.encode(id, encodedOutcome, salt, msg.sender)), then reveal with encodedOutcome + salt and a bond that meets the round’s minimum.
  • Bonds: Start with minBaseBond, then escalate geometrically using bondMultiplier up to maxRounds.
  • Fees: On finalize(id), the bond pool is distributed to the winner minus feeBps sent to feeSink.
  • Arbitration: If escalation reaches the limit, a final on-chain decision is provided and consumed by receiveArbitratorRuling.
Why Predikt vs UMA OO

UMA’s Optimistic Oracle (OO) popularized proposer/disputer with liveness and a fallback to the DVM. Predikt keeps the same spirit but adapts for lean, chain-local markets:

  • Commit–Reveal: Predikt uses commit/reveal (and recommit) to prevent copycats during liveness; UMA’s default flow doesn’t require this step.
  • Local Arbitration: Final escalations go to a pluggable on-chain arbitrator, keeping policy and finality on your chain rather than routing to UMA’s DVM.
  • Security knobs: Per-question minBaseBond, bondMultiplier, and maxRounds for stronger spam/grief resistance.
For Developers
// Oracle (selected, user-visible surface)
function createQuestionPublic(QuestionParams p, bytes32 salt) payable returns (bytes32);
function commit(bytes32 id, bytes32 hashCommit);
function recommit(bytes32 id, bytes32 hashCommit);
function reveal(bytes32 id, bytes encodedOutcome, bytes32 salt, uint256 bond);
function finalize(bytes32 id);
function escalate(bytes32 id);
function receiveArbitratorRuling(bytes32 id, bytes encodedOutcome, address payee);

// Market
function finalizeFromOracle(); // pulls oracle result and settles
FAQ

How do I create a market? Use the Create page. You’ll pay the oracle’s questionFee in its bondToken, then the app deploys the market via a factory.

What’s the commit hash? keccak256(abi.encode(id, encodedOutcome, salt, msg.sender)).

What triggers arbitration? Reaching maxRounds of escalation routes the question to the on-chain arbitrator for a final ruling.