ai agents are clearly the future and the entire workforce will be replaced or atleast using ai agents. while i am a quant and building agents for algo trading i will be contributing to all different types of ai agent flows and placing all of the agents here for free, 100% open sourced because i believe code is the great equalizer and we have never seen a regime shift like this so i need to get this code to the people
feel free to join our discord if you beleive ai agents will be integrated into the workforce
βοΈ first full concise documentation video (watch here)
βοΈ second full walkthrough video(watch here)
βοΈ third full walkthrough w/ big updates, new models, new agents(watch here)
π follow all updates here on youtube in this playlist: https://www.youtube.com/playlist?list=PLXrNVMjRZUJg4M4uz52iGd1LhXXGVbIFz
- RBI Agent (
rbi_agent.py): Uses DeepSeek to research trading strategies based on YouTube videos, PDFs, or text you provide, then codes out the backtest automatically - RBI Parallel Agent (
rbi_agent_pp_multi.py): Parallel version with 18 threads, tests across 20+ data sources, web dashboard included - Research Agent (
research_agent.py): Fills the ideas.txt file so the RBI agent can run forever - Websearch Agent (
websearch_agent.py): This agent searches the web, in my use case for trading strategy resources and then uses other ai's to split the website ideas into strategy files i can have myrbi_agent_pp_multi.pyprocess and build out backtests
- Trading Agent (
trading_agent.py): DUAL-MODE AI trading system - Toggle between single model (fast ~10s) or swarm mode (6-model consensus ~45-60s). Swarm mode queries Claude 4.5, GPT-5, Gemini 2.5, Grok-4, DeepSeek, and DeepSeek-R1 local for majority vote trading decisions. Configure viaUSE_SWARM_MODEin config.py - Strategy Agent (
strategy_agent.py): Manages and executes trading strategies placed in the strategies folder - Risk Agent (
risk_agent.py): Monitors and manages portfolio risk, enforcing position limits and PnL thresholds - Copy Agent (
copy_agent.py): Monitors copy bot for potential trades - Swarm Agent (
swarm_agent.py): Queries 6 AI models in parallel (Claude 4.5, GPT-5, Gemini 2.5, Grok-4, DeepSeek, DeepSeek-R1 local), generates AI consensus summary, returns clean JSON with model mapping for easy parsing π
- Whale Agent (
whale_agent.py): Monitors whale activity and announces when a whale enters the market - Sentiment Agent (
sentiment_agent.py): Analyzes Twitter sentiment for crypto tokens with voice announcements - Chart Agent (
chartanalysis_agent.py): Looks at any crypto chart and analyzes it with AI to make a buy/sell/nothing recommendation - Funding Agent (
funding_agent.py): Monitors funding rates across exchanges and uses AI to analyze opportunities, providing voice alerts for extreme funding situations with technical context π - Liquidation Agent (
liquidation_agent.py): Tracks liquidation events with configurable time windows (15min/1hr/4hr), providing AI analysis and voice alerts for significant liquidation spikes π¦ - Listing Arbitrage Agent (
listingarb_agent.py): Identifies promising Solana tokens on CoinGecko before they reach major exchanges like Binance and Coinbase, using parallel AI analysis for technical and fundamental insights - Funding Arbitrage Agent (
fundingarb_agent.py): Tracks the funding rate on HyperLiquid to find funding rate arbitrage opportunities between HL and Solana - New or Top Tokens Agent (
new_or_top_agent.py): Looks at the new tokens and the top tokens from CoinGecko API
- Sniper Agent (
sniper_agent.py): Watches for new Solana token launches, analyzes them, and maybe snipes - TX Agent (
tx_agent.py): Watches transactions made by your copy list and prints them out with optional auto tab open - Solana Agent (
solana_agent.py): Looks at the sniper agent and the TX agent to select which memes may be interesting
- Chat Agent (
chat_agent.py): Monitors YouTube live stream chat, moderates & responds to known questions. Absolute fire. - Twitter Agent (
tweet_agent.py): Takes in text and creates tweets using DeepSeek or other models - Video Agent (
video_agent.py): Takes in text to create videos by creating audio snippets using ElevenLabs and combining with raw_video footage - Clips Agent (
clips_agent.py): Helps clip long videos into shorter ones so you can upload to your YouTube and get paid. More info: https://discord.gg/XAw8US9aHT - Real-Time Clips Agent (
realtime_clips_agent.py): Makes real-time clips of streamers using OBS - Phone Agent (
phone_agent.py): An AI agent that can take phone calls for you
- Focus Agent (
focus_agent.py): Randomly samples audio during coding sessions to maintain productivity, providing focus scores and voice alerts when focus drops (~$10/month, perfect for voice-to-code workflows) - Million Agent (
million_agent.py): Uses million context window from Gemini to pull in a knowledge base - TikTok Agent (
tiktok_agent.py): Scrolls TikTok and gets screenshots of the video + comments to extract consumer data to feed into algos. Sometimes called social arbitrage - Compliance Agent (
compliance_agent.py): Analyzes TikTok ads for Facebook advertising compliance, extracting frames and transcribing audio to check against FB guidelines - Housecoin Agent (
housecoin_agent.py): DCA (dollar cost average) agent with AI confirmation layer using Grok-4 for the thesis: 1 House = 1 Housecoin π - Polymarket Agent (
polymarket_agent.py): Connects to the live trades feed via WebSocket and analyzes with the swarm agent to see which markets could be interesting to trade
There is no token associated with this project and there never will be. any token launched is not affiliated with this project, moon dev will never dm you. be careful. don't send funds anywhere
PLEASE READ CAREFULLY:
-
This is an experimental research project, NOT a trading system
-
There are NO plug-and-play solutions for guaranteed profits
-
We do NOT provide trading strategies
-
Success depends entirely on YOUR:
- Trading strategy
- Risk management
- Market research
- Testing and validation
- Overall trading approach
-
NO AI agent can guarantee profitable trading
-
You MUST develop and validate your own trading approach
-
Trading involves substantial risk of loss
-
Past performance does not indicate future results
Project updates will be posted in Discord, join here: discord.gg/8UPuVZ53bh
- Free Algo Trading Roadmap: moondev.com
- Algo Trading Education: algotradecamp.com
- Business Contact moon@algotradecamp.com
Why Start with Backtesting?
Before running ANY trading algorithm or AI agent with real money, you MUST backtest your strategies. Backtesting shows you how a strategy would have performed on historical data. The RBI (Research-Based Inference) Agent automates this entire process for you.
What is the RBI Agent?
The RBI Agent takes your trading ideas (from YouTube videos, PDFs, or plain text) and:
- π§ Uses AI to understand the trading strategy
- π» Codes a complete backtest using the
backtesting.pylibrary - π Tests across 20+ different market data sources
- β Only saves strategies that pass a 1% return threshold
- π― Tries to optimize strategies to hit a 50% target return
Python Version: 3.10.9 was used during development
- Click the star button to save it to your GitHub favorites
- Fork to your GitHub account to get your own copy
- This lets you make changes and track updates
git clone https://github.com/YOUR_USERNAME/moon-dev-ai-agents-for-trading.git
cd moon-dev-ai-agents-for-tradingRecommended IDEs:
- Cursor - AI-enabled coding
- Windsurfer - AI-enabled coding
The RBI Agent needs API keys to function. Create a .env file in the root directory:
# Copy the example file
cp .env.example .envRequired API Keys for RBI Agent:
# AI Model APIs (you need at least ONE of these)
ANTHROPIC_KEY=your_anthropic_api_key_here # Claude models (recommended)
OPENAI_KEY=your_openai_api_key_here # GPT models
DEEPSEEK_KEY=your_deepseek_api_key_here # DeepSeek models (cheap!)
GROQ_API_KEY=your_groq_api_key_here # Groq (fast inference)
GEMINI_KEY=your_gemini_api_key_here # Google Gemini
XAI_API_KEY=your_xai_api_key_here # Grok models
OPENROUTER_API_KEY=your_openrouter_api_key_here # OpenRouter (200+ models!)
# Market Data APIs (for downloading price data)
BIRDEYE_API_KEY=your_birdeye_api_key_here # Solana token data
COINGECKO_API_KEY=your_coingecko_api_key_here # Crypto market dataWhere to Get API Keys:
- Anthropic Claude: https://console.anthropic.com/
- OpenAI GPT: https://platform.openai.com/api-keys
- DeepSeek: https://platform.deepseek.com/ (very cheap, great for backtesting)
- Groq: https://console.groq.com/
- Google Gemini: https://aistudio.google.com/app/apikey
- xAI Grok: https://console.x.ai/
- OpenRouter: https://openrouter.ai/keys (access 200+ models including Qwen, GLM, and more!)
- BirdEye: https://birdeye.so/ (Solana data)
- CoinGecko: https://www.coingecko.com/en/api
.env file! It's in .gitignore for your safety.
Using conda (recommended):
conda create -n tflow python=3.10.9
conda activate tflow
pip install -r requirements.txtOr using pip directly:
pip install -r requirements.txtOption A: Single Strategy Test
Create a file called ideas.txt in src/data/rbi_pp_multi/:
Buy when RSI < 30 and sell when RSI > 70
Then run:
python src/agents/rbi_agent_pp_multi.pyOption B: Use the Web Dashboard
Start the dashboard:
cd src/data/rbi_pp_multi
python app.pyOpen browser to: http://localhost:8001
Click "New Backtests" and enter your strategy ideas!
The agent will:
- Process your strategy idea
- Generate backtest code
- Test across 20+ market datasets (BTC, ETH, SOL, etc.)
- Show results in a table with:
- Return %
- Buy & Hold %
- Max Drawdown
- Sharpe Ratio
- Sortino Ratio
- Number of Trades
Only strategies returning > 1% are saved to the CSV.
Results are saved to:
src/data/rbi_pp_multi/backtest_stats.csv- All passing backtestssrc/data/rbi_pp_multi/user_folders/- Organized by run name
Find your strategy files in:
src/data/rbi_pp_multi/10_25_2025_09_08/
Each successful backtest has:
- Python file: The actual backtest code you can review and modify
- Results: Performance metrics
Read the code! This is how you learn what works and what doesn't.
All settings are in src/agents/rbi_agent_pp_multi.py (lines 130-132):
# π― PROFIT TARGET CONFIGURATION
TARGET_RETURN = 50 # Target return in % (AI tries to optimize to this)
SAVE_IF_OVER_RETURN = 1.0 # Save backtest to CSV if return > this %How it works:
- AI tries to optimize strategies to hit 50% return
- But ANY backtest returning > 1% gets saved to CSV
- This way you can review all decent strategies, not just perfect ones
Other Settings:
MAX_WORKERS = 18 # Number of parallel threads (adjust based on your CPU)
DEBUG_BACKTEST_ERRORS = True # Auto-fix coding errors with AI
MAX_DEBUG_ITERATIONS = 10 # How many times to try fixing errorsWant to test on your own tokens? Edit the data list in rbi_agent_pp_multi.py (lines 157-178):
ALL_DATA_CONFIGS = [
# Crypto data from CoinGecko/BirdEye
{'symbol': 'BTC-USD', 'timeframe': '15m', 'days_back': 90},
{'symbol': 'ETH-USD', 'timeframe': '15m', 'days_back': 90},
{'symbol': 'SOL-USD', 'timeframe': '15m', 'days_back': 90},
# Add your own token (Solana contract address)
{'symbol': 'YOUR_TOKEN_ADDRESS', 'timeframe': '1H', 'days_back': 30},
]The agent will automatically download and cache the data.
- HyperLiquid Perps Integration β
- Swarm Consensus Trading β
- RBI Parallel Backtesting β
- Polymarket Integration - Prediction market trading
- Base Chain Integration - L2 network support
- Extended Integration - Additional exchange support
- HyperLiquid Spot Trading - Spot market support
- Trending Agent - Spots leaders on HyperLiquid
- Position Sizing Agent - Volume/liquidation-based sizing
- Regime Agents - Adaptive strategy switching
- Polymarket Sweeper Agent - Follow successful prediction traders
- Lighter Integration
- Pacifica Integration
- Hibachi Integration
- Aster Integration
- HyperEVM Support
Built with love by Moon Dev - Pioneering the future of AI-powered trading
The content presented is for educational and informational purposes only and does not constitute financial advice. All trading involves risk and may not be suitable for all investors. You should carefully consider your investment objectives, level of experience, and risk appetite before investing.
Past performance is not indicative of future results. There is no guarantee that any trading strategy or algorithm discussed will result in profits or will not incur losses.
CFTC Disclaimer: Commodity Futures Trading Commission (CFTC) regulations require disclosure of the risks associated with trading commodities and derivatives. There is a substantial risk of loss in trading and investing.
I am not a licensed financial advisor or a registered broker-dealer. Content & code is based on personal research perspectives and should not be relied upon as a guarantee of success in trading.
