This guide will get you up and running in 10 minutes.
- Python 3.10 or higher
- Polymarket account (optional for testing)
- Anthropic API key (Get one here)
# Navigate to the project directory
cd probablyprofit
# Install dependencies
pip install -r requirements.txtCopy the example environment file:
cp .env.example .envEdit .env and add your API keys:
# Required - at least one AI provider
ANTHROPIC_API_KEY=sk-ant-...
# or OPENAI_API_KEY=sk-...
# or GOOGLE_API_KEY=...
# Optional (for live trading) - your Polygon wallet private key
PRIVATE_KEY=0x_your_private_key_here
# Optional (for news context)
PERPLEXITY_API_KEY=pplx-...Test that everything works:
python quickstart.pyThis will:
- Connect to Polymarket
- Fetch current markets
- Ask Claude to analyze them
- Show you the AI's reasoning
Try one of the three example strategies:
python examples/momentum_bot.pypython examples/contrarian_bot.pypython examples/news_bot.pyCreate a new file my_bot.py:
import asyncio
import os
from dotenv import load_dotenv
from probablyprofit import AnthropicAgent, PolymarketClient, RiskManager
load_dotenv()
# Define your strategy in natural language!
MY_STRATEGY = """
You are a [YOUR STRATEGY HERE] trader.
Your strategy:
1. [STEP 1]
2. [STEP 2]
Entry rules:
- [RULE 1]
- [RULE 2]
Exit rules:
- Take profit at [X%]
- Stop loss at [Y%]
"""
async def main():
client = PolymarketClient(
private_key=os.getenv("PRIVATE_KEY"),
)
risk_manager = RiskManager(initial_capital=1000.0)
agent = AnthropicAgent(
client=client,
risk_manager=risk_manager,
strategy_prompt=MY_STRATEGY,
)
await agent.run()
if __name__ == "__main__":
asyncio.run(main())Run it:
python my_bot.pyRead strategy-guide.md to learn how to write effective trading strategies.
Check out api-reference.md for detailed API documentation.
Before risking real money, backtest via CLI:
probablyprofit backtest --strategy "your strategy" --days 30Or check backtesting results in the web dashboard.
Test with fake money first:
# Via CLI
probablyprofit run "your strategy" --paper --paper-capital 10000
# Or via Python
agent = AnthropicAgent(..., paper_trading=True)When you're ready:
- Start with small position sizes
- Monitor closely for the first few days
- Gradually increase capital as you gain confidence
Make sure .env has your ANTHROPIC_API_KEY.
If you get this error, it means you're running in read-only mode (no Polymarket credentials). This is fine for testing - the bot will still analyze markets, it just won't execute trades.
You're making too many API calls. Increase loop_interval in your agent configuration.
- Start small - Use tiny position sizes initially
- Paper trade first - Test thoroughly before using real money
- Monitor closely - Check your bot frequently at first
- Set strict limits - Use conservative risk management settings
- Understand the code - Read through the framework before using it
- Only risk what you can afford to lose
- 📖 Read the docs in
docs/ - 💬 Check GitHub issues
- 🐛 Report bugs on GitHub
You now have:
- ✅ A working AI trading bot framework
- ✅ Three example strategies to learn from
- ✅ Tools to create your own custom bots
- ✅ Risk management and backtesting capabilities
The power is in the strategy prompt - experiment, test, and refine!
Happy trading! 🚀