Before you begin
Make sure you have:- Completed the installation steps
- Configured your environment variables (minimum:
BET_FROM_PRIVATE_KEYandOPENAI_API_KEY)
Running the coinflip agent
The coinflip agent is the simplest agent in the library. It makes random predictions by “flipping a coin” to decide between yes/no on binary markets.Run the agent
Execute the coinflip agent on the Omen market:The agent will:
- Fetch available markets from Omen/Presagio
- Select a market to bet on
- Make a random prediction (coin flip)
- Place a bet on the market
Available agents and markets
Viewing available options
To see all available agents and market types:Agent options
The library includes many pre-built agents:- Simple agents
- Research agents
- Advanced agents
- Platform-specific
coinflip- Random predictionsknownoutcome- Bets on markets with known outcomes (for testing)
Market type options
Supported market platforms:omen- Decentralized prediction markets on Gnosis Chain (Presagio)manifold- Play-money prediction marketspolymarket- Cryptocurrency-based prediction marketsmetaculus- Forecasting platform
Running other agents
Try running different agents on different platforms:Understanding the coinflip agent code
Here’s the complete implementation of the coinflip agent to understand how simple it is to create an agent:prediction_market_agent/agents/coinflip_agent/deploy.py
Key components
DeployableTraderAgent base class
DeployableTraderAgent base class
All agents inherit from
DeployableTraderAgent which provides:- Market fetching and filtering
- Bet placement logic
- Error handling and logging
- Trade interval management
verify_market method
verify_market method
Called to determine if the agent should consider a market. The coinflip agent accepts all markets by returning
True.answer_binary_market method
answer_binary_market method
The core logic that returns a prediction. Must return a
ProbabilisticAnswer with:p_yes- Probability of “yes” outcome (0.0 to 1.0)confidence- Agent’s confidence in the predictionreasoning- Explanation of the prediction
Interactive Streamlit app
For a more interactive experience, try the agent research app:- Browse prediction markets
- Select multiple agents to analyze the same question
- Compare agent predictions and reasoning
- See real-time research and analysis
The Streamlit app is also deployed at pma-agent.ai.gnosisdev.com
Next steps
Create your own agent
Learn how to build custom agents by subclassing DeployableTraderAgent
Deploy to production
Deploy your agent to cloud infrastructure for continuous trading
Advanced configuration
Configure advanced features like trade intervals, market filtering, and more
View live agents
Track deployed agents on the Dune Analytics dashboard