This repository contains contracts used to resolve Polymarket prediction markets via UMA's optimistic oracle.
The Adapter is an oracle to CTF conditions, which Polymarket prediction markets are based on.
It fetches resolution data from UMA's Optmistic Oracle and resolves the condition based on said resolution data.
When a new market is deployed, it is initialized
, meaning:
- The market's parameters(request timestamp, reward, etc) are stored onchain
- The market is
prepared
on the CTF contract - A resolution data request is sent out to the Optimistic Oracle
UMA Proposers will then respond to the request and fetch resolution data offchain. If the resolution data is not disputed, the data will be available to the Adapter after a defined liveness period(currently about 2 hours). If the proposal is disputed, UMA's DVM is the fallback and will return data after a 48 - 72 hour period.
After resolution data is available, anyone can call resolve
which resolves the market using the resolution data.
Install dependencies with yarn install
Compile the contracts with yarn compile
Test the contracts with yarn test
Generate coverage reports with yarn coverage