Skip to content
rfguri.
Solo build · 2025

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.

Trading bots
Role
Solo strategy and engineering
Year
2025
Link
Private

01 · The problem

What Trading bots set out to solve.

Manual discretionary trading on perps is slow and emotional, and no one can run it 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. I wanted to test whether well-defined strategies, executed mechanically with hard risk limits, could capture those edges without me sitting in front of a screen. The goal was discipline and consistency; big returns were secondary.

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. I have traded and researched crypto markets for years and code in Python daily, so building the bots myself was the fastest way to encode my own thesis precisely. I treated this as a portfolio from the start: 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

I 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. I sized positions as a fixed fraction of equity so a string of losers shrinks exposure automatically and the damage stays contained. 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. I 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.

I wrote the entire system in Python myself: the signal logic, the execution layer against the Lighter API, and the shared risk controls that gate every order. I 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 I can reason about end to end, with a single risk module as the safety net under all three bots.

Impact
3
Live strategies across ETH, BTC, and gold
99.9%
Unattended uptime
100%
Trades inside risk limits

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. The result I care about most, ahead of any single P and L figure, is a system that trades my thesis consistently while I do other work.

What I’d carry forward

Risk management decides whether an algo trading project survives, more than signal generation does; a mediocre edge with strict stops survives, while a great edge with sloppy sizing eventually blows up. I 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 I could trace it from signal to fill in minutes.