@polymarket/uma-ctf-binary-adapter
v2.0.0
Published
Contracts to resolve Polymarket prediction markets via UMA's Optimistic Oracle
Downloads
12
Readme
Polymarket UMA CTF Adapter
Overview
This repository contains contracts used to resolve Polymarket prediction markets via UMA's optimistic oracle.
Architecture
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.
Deployments
Dependencies
Install dependencies with yarn install
Compile
Compile the contracts with yarn compile
Testing
Test the contracts with yarn test
Coverage
Generate coverage reports with yarn coverage