Skip to main content

Arboretum v4.2 β€” Railway Β· Supabase Β· Solana

Arboretum Trading System

YouTube cognition extracted by Gemini, converted to signals, executed autonomously

3 Railway services 4 modules 19 DB tables Paper mode active

Plain English

How it actually works

No jargon. The full cycle from YouTube video to closed trade, in 8 steps.

1

Watch traders on YouTube

The system monitors YouTube channels of crypto traders I've registered. When a trader uploads a new video, it downloads the transcript and video clip automatically.

2

Extract what they're thinking

Google's Gemini AI watches and reads each video, pulling out the trader's actual reasoning β€” what coins they're looking at, whether they're bullish or bearish, and how confident they seem. This gets stored as a "trading pattern."

3

Check the market

Every few minutes, the system takes a snapshot of what's happening in the crypto market right now β€” current prices, how easy it is to buy or sell (liquidity), and how fast the data is arriving.

4

AI panel debates the trade

Four separate AI agents act like a panel of analysts. They each look at the trading pattern and the market snapshot independently, then vote: should we buy or not? If the panel doesn't agree, the trade is skipped.

5

Safety checks before buying

Even if the panel says "buy," the trade goes through 10 safety checks. Is the system paused? Is there too much money already invested? Is the coin on the approved list? Is the price moving too fast? Any single check can block the trade.

6

Execute the trade

Right now, all trades are simulated (paper trading) β€” no real money. The system records the buy price, calculates realistic fees and slippage, and saves everything to the database. A Telegram message is sent so I know it happened.

7

Watch the position around the clock

A background program checks every open position every 30 seconds, 24/7. It compares the current price against the stop-loss β€” a pre-set "sell if it drops this far" price. Think of it like a standing instruction to a broker: "if the price drops below $82, sell immediately."

8

Close when it's time

When the price hits the stop-loss, the position is automatically closed. The system calculates the profit or loss, updates the database, and sends a Telegram notification. The whole cycle β€” from watching a YouTube video to closing a trade β€” runs without any human intervention.

Current status

The system is live in paper mode β€” all trades are simulated with no real money. It's currently trading SOL (Solana) priced in USDC (a stablecoin pegged to the US dollar). Each position is $10, with stop-losses set about 6% below the buy price to limit downside.

Architecture diagrams & technical detail below

System Architecture

How it's structured

Five layers from operator to data store. Click any node for details.

OPERATOR Timothy Sole operator registers traders Telegram Bot API alerts + commands TELEGRAM_BOT_TOKEN RAILWAY PLATFORM β€” 3 SERVICES trading-swarm cron Β· main.py Layer A β†’ B β†’ C stop-daemon always-on Β· runner.py 30s price poll bot always-on Β· runner.py Telegram commands ARBORETUM MODULES Pipeline trader_service Β· video_discovery Β· ingestion Β· extraction arboretum/pipeline/ Trading signal_evaluator Β· order_router Β· paper_engine arboretum/trading/ Stop Daemon monitor_loop arboretum/stop_daemon/ Bot command_handler arboretum/bot/ EXTERNAL APIs YouTube API v3 discovery Gemini 2.5 Flash extraction S3 / R2 Storage clip storage Jupiter DEX Solana spot Hyperliquid perp / spot Jupiter Price API stop monitoring DATA STORE Supabase β€” supabase-trading traders Β· videos Β· trading_patterns Β· signal_store Β· trade_executions Β· positions Β· stop_daemon_registrations Β· swarm_config Β· approved_tickers Β· kill_switch_events (19 tables) register commands runs calls trades price reads / writes
live service
paper mode active
external API

Execution Process

How a trade happens

Three pipeline phases: ingest trader cognition, decide on a signal, execute and monitor the position.

PHASE 1 β€” INGEST PHASE 2 β€” DECIDE PHASE 3 β€” EXECUTE Register Trader YouTube channel URL + alias TraderService Β· YouTube API v3 Discover Videos new videos since last scan VideoDiscoveryService Ingest Clip + Transcript yt_dlp + youtube_transcript_api IngestionPipeline Β· S3/R2 upload Gemini Extraction 4-pass multimodal analysis GeminiExtractor Β· 2.5 Flash Store trading_patterns structural + conviction fields Supabase Β· extraction_log cron fires Layer A β€” Market Snapshot price Β· slippage Β· liquidity Β· RTT deterministic_pull() snapshot = None? ABORT Layer B β€” LLM Swarm APPROVE or REJECT + reasoning run_swarm() Β· swarm_reasoning verdict = REJECT? SKIP Limit-Buy Gate price vs LIMIT_BUY_PRICE env check_limit_buy() price above limit? SKIP OrderRouter β€” 9 Gates halt Β· mode Β· risk Β· stop Β· ticker slippage Β· positions Β· exposure Β· liquidity OrderRouter.route() BLOCKED gate fail? APPROVED PaperTradingEngine slippage + fee simulation trade_mode = "paper" Write DB + Telegram Alert trade_executions Β· positions Β· stop_regs PAPER TRADE | {ticker} BUY @ {price} StopDaemon β€” 30s Poll monitors price vs stop_price price > stop β†’ wait Β· price ≀ stop β†’ close StopDaemon.monitor_loop() wait Close Position write close_price + realised_pnl positions.status = closed Position Closed βœ“
process step
decision gate
abort / reject