Working tree is now the canonical repo. Off-chain play-money + trustless on-chain (FPMM AMM + CLOB via UMA settlement), AI market factory, creator/social/distribution, mobile shell + push, one-command demo + deploy-kit. Secrets excluded (see ENV-AND-KEYS.md). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Predikt UMA CTF Adapter (settlement)
Part of Predikt's on-chain layer. MIT licensed. This is Predikt's own code — originally authored by Polymarket and adopted here as a first-class Foundry package.
Overview
This package contains the contracts that settle Predikt prediction markets. It is an oracle to Conditional Tokens Framework (CTF) conditions, resolving them trustlessly using UMA's Optimistic Oracle.
Trading of the resulting CTF outcome tokens is handled by the sibling
ctf-exchange package; orders are built and signed with the
@predikt/orders SDK.
How settlement works
When a new market is deployed, it is initialized, meaning:
- The market's parameters (ancillary data, request timestamp, reward token, reward, etc.) are stored on-chain
- The market is
preparedon the CTF contract - A resolution data request is sent to the Optimistic Oracle
UMA proposers respond off-chain. If the resolution data is not disputed, it becomes available to the adapter after a liveness period (currently ~2 hours).
The first time a request is disputed, the market is automatically reset (a new Optimistic Oracle
request is sent), so obviously incorrect disputes don't slow down resolution.
If disputed again, this signals a fundamental disagreement and the Optimistic Oracle falls back to UMA's DVM, which returns data after a 48–72 hour period.
Once resolution data is available, anyone can call resolve to settle the market.
Audit
The underlying contracts were audited by OpenZeppelin; the report is available here. Predikt's changes are surface/branding only — the audited settlement logic and interfaces are unchanged.
Development
Install Foundry (foundryup to update forge/cast).
- Build:
forge build - Test:
forge test(61+ tests, all green)
Deployment uses the script in src/scripts/deploy/DeployAdapter.s.sol; configure via .env
(see .env.example).