Blog

Arliax Nexus and Bot: a crypto trading experiment

A holiday project that grew into a real-time market-data aggregator and trading bot - and why I have decided to stop trading it.

July 5, 20265 min readSergi

For the last year, I have spent parts of my holidays building a crypto-trading experiment called Arliax. It eventually became 2 projects: Arliax Nexus, a market-data aggregator, and Arliax Bot, the bot that consumes that data to research, paper-trade, backtest, and, when explicitly configured, place live trades.

I have now open-sourced both projects under the GNU GPLv3. The code is there for anyone who is curious about it, wants to learn from it, or would like to build on it while keeping the same freedoms for the next person.

This is not investment advice, and it is not a recommendation to run a trading bot with real money. It is a small personal software project that taught me a lot, including a very practical lesson about risk.

Why I built it

I enjoy systems that turn a noisy stream of events into something understandable. Crypto markets are an unusually intense version of that problem: trades arrive continuously from multiple exchanges, symbols are named differently, data is incomplete or delayed, and every decision has a cost.

The original idea was simple: collect market activity from several exchanges, normalize it into a useful view of a pair, and give a strategy engine access to real-time and historical data. I wanted to learn how far I could take the whole pipeline on my own, from exchange feeds and SQLite storage to terminal dashboards, backtests, parameter optimization, a journal, and finally order execution.

I started with Go because it felt like the sensible choice for concurrent network services. At some point, for fun, I moved the project to TypeScript and Bun. Bun made the iteration loop feel fast and pleasant, and TypeScript made it easy to keep the domain model, tooling, dashboards, and bot in the same ecosystem. It was a side project, so enjoying the tools was a perfectly valid technical requirement.

The complete Arliax data, execution, and research loop. Solid lines show runtime paths on the current main branches; the dashed line marks the dynamic subscription control path available on the Nexus subscription branch. Select the diagram to inspect it at full size.

Arliax Nexus: the data layer

Nexus watches live trade streams from multiple exchanges, combines the markets that belong to the same logical pair, aggregates them into candles, and stores closed candles in SQLite. It then exposes real-time and historical data through Unix sockets. The bot can ask it for previous candles while also subscribing to the candle that is still being formed.

That separation turned out to be important. Nexus can focus on ingesting, normalizing, aggregating, and persisting data; the bot can focus on indicators, strategies, risk controls, and execution. They can evolve independently without turning the trading logic into a collection of exchange-specific special cases.

Open source · GPLv3sergi-io/arliax-nexusArliax Nexus aggregates real-time market data from multiple exchanges. Browse or download the code on GitHub.

Nexus monitoring live exchange workers, their symbols, and whether data is arriving.

A short walkthrough of the Nexus data pipeline.

The terminal tools were not just decorative. They made it possible to see which exchanges were alive, inspect current candles and flow data, and quickly spot when a feed was behaving differently from the rest. That kind of visibility matters more than it initially seems when the input is a live system you do not control.

The real-time view used to inspect an in-progress candle, recent history, and the events flowing through Nexus.

Arliax Bot: research, execution, and the journal

Arliax Bot sits on top of Nexus. It has a modular strategy pipeline, technical-analysis and risk managers, paper trading, historical backtests, and parameter optimization. It can also generate a static trading journal from recorded positions, which is a much better way to review decisions than reading a long terminal log.

The project supported live execution, but I treated paper trading and backtesting as first-class workflows. A strategy that looks promising in a chart is not automatically resilient once fees, slippage, changing market regimes, and the simple pressure of real money enter the picture.

138 knobs and a genetic algorithm

The bot configuration contains 138 configurable strategy and risk values: indicator periods, thresholds, risk-reward ratios, stop-loss rules, position sizing, and switches that enable or disable individual modules. In the configuration I used, 23 of those values are marked as optimizable. Each one has a range or a set of possible values, so the total number of combinations becomes far too large to test exhaustively.

That is why I added a genetic algorithm. It starts with a population of candidate configurations, runs a backtest for each one, scores the results, keeps the strongest candidates, and creates new ones through crossover and mutation. The current setup uses a population of 1,000 configurations over 20 generations. Its fitness score can balance factors such as profit and loss, profit factor, win rate, and maximum adverse excursion instead of simply chasing the highest return.

My friend Roberto introduced me to the idea. He suggested that a genetic algorithm could search for a strong configuration without having to brute-force every possible combination, which becomes impractical very quickly as the number of parameters grows.

In my head, this sounded like a very good way to find the best configuration for a given backtest. In practice, it is much harder than that. A backtest can reward an overfitted configuration, and a better score on old data does not make a strategy robust in a changing market. I am not a quant trader; people who do this professionally know far more about the statistical, market, and risk questions involved. Still, building it was a lot of fun, and it was a great way to understand why the problem is difficult.

Open source · GPLv3sergi-io/arliax-botArliax Bot researches, backtests, and paper-trades strategies using market data from Nexus. Browse or download the code on GitHub.

The generated journal made each small experiment easier to review than raw logs alone.

Why I stopped

I did make a small amount of money with it, and I also lost some. In the end, I more or less broke even. That is still satisfying after so much time spent building data pipelines and testing ideas during holidays, but it is also the part that could easily tell the wrong story.

The potential downside was far larger than the upside. Crypto markets are volatile, the operational surface is wide, strategies can stop working without warning, and a small gain does not prove that a system is safe or durable. I did not want a side project to quietly become a source of financial stress, so I decided to drop the live-trading side of it.

That does not make the project a failure. It did what I wanted it to do: I learned a lot, had fun building it, and ended up with 2 complete open-source projects. Arliax Nexus and Arliax Bot are now available under GPLv3 for anyone who wants to inspect the code, run it carefully, or take a different direction with it.

Thanks for reading, Hack the Planet!