Prerequisites
Before you begin, ensure you have:Foundry Installed
Install from getfoundry.sh
Contract Addresses
UMA contract addresses for your target network
Whitelisted Token
An ERC20 token approved by UMA’s CollateralWhitelist
RPC Endpoint
Access to an Ethereum/Polygon RPC provider
Installation
Deploy the Adapter
You can deploy the adapter using either the provided deployment script or manually.- Using Deploy Script
- Manual Deployment
Create a Run the deployment script:
.env file with your configuration:.env
For production deployments on Polygon, see the official deployments page for verified contract addresses.
Initialize Your First Market
Once deployed, you can initialize a prediction market question.Choose market parameters
Select appropriate parameters for your market:
- rewardToken: Address of whitelisted ERC20 (e.g., USDC)
- reward: Amount to reward the proposer (e.g., 100 USDC)
- proposalBond: Bond required from proposers (0 = use default)
- liveness: Time before proposal is finalized (0 = use 2 hour default)
Monitor Your Market
After initialization, you can check the market status:Resolve Your Market
Once the Optimistic Oracle has a price available (after the liveness period):Testing Locally
For local development and testing, use Foundry’s built-in testing framework:test/YourTest.t.sol
Common Issues
UnsupportedToken error
UnsupportedToken error
The reward token must be on UMA’s CollateralWhitelist. Check the Configuration page for approved tokens on your network.
InvalidAncillaryData error
InvalidAncillaryData error
Ancillary data must be non-empty and less than 8139 bytes after the initializer address is appended.
Initialized error
Initialized error
Each unique ancillary data string (including appended initializer address) can only be used once. Use different question text for each market.
Next Steps
Learn the Architecture
Understand how the adapter works under the hood
Integration Guide
Deep dive into market initialization parameters
API Reference
Explore the complete contract API
Admin Operations
Learn about administrative controls