> For the complete documentation index, see [llms.txt](https://intracloud.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://intracloud.gitbook.io/docs/contracts/prediction-market.md).

# Prediction Market Contract

`IntraPredictionMarket` powers IntraCloud's onchain binary rounds.

## Network

* Chain: Sepolia (`11155111`)
* Contract address: `0xEf16C4d27859F5D6Ab2506F7c3a1C0f199C18d89`
* Deployment tx: `0xbe79492322516f9b00fcbae201c9acf5d285eb3f4ce852f57e824ee4df9bc19d`
* Deployed at (UTC): `2026-04-28 14:47:24 UTC`
* Explorer:
  * `https://sepolia.etherscan.io/address/0xEf16C4d27859F5D6Ab2506F7c3a1C0f199C18d89`
  * `https://sepolia.etherscan.io/tx/0xbe79492322516f9b00fcbae201c9acf5d285eb3f4ce852f57e824ee4df9bc19d`

## What it does

* Creates short prediction rounds (`5-15` minutes).
* Accepts user participation on two sides: `YES` and `NO`.
* Resolves outcome using Uniswap v3 TWAP direction between round start and round end.
* Supports claim-based payouts for winners (or refunds for void rounds).

## Round lifecycle

1. Operator creates a round for a Uniswap v3 pool.
2. Users participate on `YES` or `NO` while round is open.
3. After end time, anyone can resolve the round.
4. Users claim payout or refund.

## Resolution rules

* `YES` wins if end TWAP tick > start TWAP tick.
* `NO` wins if end TWAP tick < start TWAP tick.
* Round is voided when:
  * end TWAP tick == start TWAP tick, or
  * one side has zero stake.

## Payout rules

* Non-void rounds:
  * Total pool = `YES stake + NO stake`.
  * Protocol fee is deducted from total pool.
  * Remaining amount is distributed to winners proportionally by winning stake share.
* Voided rounds:
  * Each participant gets full refund of their own stake.

## Access model

* Owner manages operators, protocol fee, pause/unpause, and protocol-fee withdrawals.
* Operators create new rounds.
* Anyone can resolve ended rounds and claim own payout.

## Integrator methods

* `createRound(pool, duration, twapWindow, statement)`
* `placeBet(roundId, side)` (payable)
* `resolveRound(roundId)`
* `claim(roundId)`
* `getRound(roundId)`
* `getBet(roundId, account)`
* `previewClaim(roundId, account)`
* `previewBetQuote(roundId, side, amount)`

## Important events

* `RoundCreated`
* `BetPlaced`
* `RoundResolved`
* `Claimed`
