Algorithmic trading bots that run themselves.
A solo-built fleet of Python strategies trading ETH, BTC, and gold perps on Lighter with disciplined, automated risk controls.
01 · The problem
What Trading bots set out to solve.
Manual discretionary trading on perps is slow, emotional, and impossible to run around the clock across multiple markets. Momentum and structural setups appear and decay in seconds, so a human watching charts will always miss the cleanest entries and hold losers too long. Roger wanted to test whether well-defined strategies, executed mechanically with hard risk limits, could capture those edges without him sitting in front of a screen. The goal was discipline and consistency, not heroic returns.
02 · Context and insight
The reframe that set the direction.
Lighter is a high-performance perps DEX with a clean API and low fees, which makes it a strong venue for automated execution. Roger has traded and researched crypto markets for years and codes in Python daily, so building the bots himself was the fastest way to encode his own thesis precisely. Rather than chase a single magic strategy, he treated this as a portfolio: distinct edges across uncorrelated markets, each with its own logic and risk budget. Everything had to be observable, restartable, and safe to leave running unattended.
03 · The approach
The decisions that mattered.
One edge per market, not one model for all
Roger built three independent strategies tuned to how each market actually behaves. ETH and BTC run momentum scalping that fades noise and rides short bursts of directional flow, while gold (XAU) uses a fair-value-gap approach that enters on the retest of imbalances left by fast moves. Keeping the strategies separate meant each could be tuned, paused, or killed on its own without touching the others, and it spread risk across markets that rarely move in lockstep.
Risk controls before returns
Every strategy ships with hard, non-negotiable limits: per-trade stop losses, max position size, daily loss caps that flatten and halt the bot, and a kill switch. Roger sized positions as a fixed fraction of equity so a string of losers shrinks exposure automatically rather than compounding the damage. Risk logic lives in a shared module that wraps every order, so no strategy can bypass it, even when a new signal looks too good to skip.
Live data, mechanical execution
The bots consume live Lighter market data and act on it without human confirmation, which removes hesitation and emotion from the loop. Signals, fills, and rejects are logged with full context so every trade can be replayed and audited after the fact. Roger backtested each strategy on historical data first, then ran it small and live to confirm that real fills and slippage matched the model before scaling the size.
04 · How it's built
Designed and shipped solo.
Roger wrote the entire system in Python himself: the signal logic, the execution layer against the Lighter API, and the shared risk controls that gate every order. He used pandas and numpy to compute indicators, detect fair-value gaps, and run vectorized backtests over historical candles, then reused the same calculations live so backtest and production behaved identically. Each strategy runs as its own long-lived process with reconnect handling, heartbeat logging, and graceful restart, so a dropped connection or an API hiccup never leaves a position unmanaged. The result is a small, legible codebase he can reason about end to end, with a single risk module as the safety net under all three bots.
The fleet has run three strategies live across ETH, BTC, and gold with near-continuous uptime, executing every position inside its predefined risk envelope. Mechanizing the entries removed the emotional mistakes that hurt discretionary trading, and the daily loss caps meant the worst sessions stayed small and recoverable. More than any single P and L figure, the win is a system that trades Roger's thesis consistently while he does other work.
What I’d carry forward
Risk management, not signal generation, is where an algo trading project lives or dies; a mediocre edge with strict stops survives, while a great edge with sloppy sizing eventually blows up. Roger also learned how much real slippage and partial fills diverge from a clean backtest, which is why every strategy now graduates from backtest to small-size live before any scaling. Building it solo in plain Python kept the whole loop transparent, so when something behaved oddly he could trace it from signal to fill in minutes.