Quick Start

Execute your first autonomous prediction market trade in 5 minutes.


Prerequisites

Before starting, ensure you have:

  • ✅ MoltMarket installed (Installation Guide)

  • ✅ Configuration file created at ~/.moltmarket/config.yaml

  • ✅ At least one platform configured (Polymarket or Kalshi)

  • ✅ Funded wallet with $50+ for testing


Step 1: Initialize Agent

Create a new Python file market_agent.py:

from openclaw import Agent
from moltmarket import PredictionMarketProvider

# Initialize agent with MoltMarket
agent = Agent(
    name="market_analyst",
    providers=[
        PredictionMarketProvider(
            platforms=["polymarket", "kalshi"],
            config_path="~/.moltmarket/config.yaml"
        )
    ]
)

print("✓ Agent initialized successfully")

Run the agent:

Expected output:


Step 2: Search Markets

Add natural language market search:

Expected output:


Step 3: Open a Position

Execute a conditional trade:

Expected output:


Step 4: Monitor Portfolio

Check your positions and P&L:

Expected output:


Step 5: Close Position

Close your position when ready:

Expected output:


Complete Example

Here's the full working example:

Run the complete example:


Advanced Examples

Arbitrage Detection

Market Making

Portfolio Rebalancing


Safety Tips

  1. Start Small - Test with $50-100 before scaling

  2. Set Stop-Losses - Always define maximum loss tolerance

  3. Monitor Positions - Check portfolio at least daily

  4. Understand Markets - Read market rules before trading

  5. Use Demo Mode - Kalshi offers demo environment for testing


What's Next?

Now that you've executed your first trade, explore:


Troubleshooting

Position Not Executing

Cause: Insufficient balance or risk limits exceeded

Solution:

"Market Not Found" Error

Cause: Market ID changed or market closed

Solution:

Transaction Failed

Cause: Insufficient gas, slippage too high, or market moved

Solution:


Support

Questions? Reach out:

Last updated