frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

Show HN: The0 – self-hosted runtime for trading bots, bring your own language

https://github.com/alexanderwanyoike/the0
11•mercutio93•13h ago
So Im a solo developer who has always had an itch for algorithmic trading. Initially I started off learning how to trade algorithmically with Yves Hilpisch book "Python for Algorithmic Trading" after reading that book I was hooked and started building algorithmic trading bots. Initially these were separate python scripts that I ran on my local machine. That was a bad idea cause local machines are not reliable and I wanted to run my bots 24/7 365. In my actual career im a software engineer with experience in building distributed systems and fault tolerant web applications.

I wasn't interested in deploying my code to managed services like MetaTrader, CTrader or QuantConnect etc because I wanted to have full control over my code and the environment it runs in. I also wanted to be able to run my bots in any programming language I wanted, not just Python. Sometimes I wanted to prototype a bot in Python and then rewrite it in C++ or Rust for performance reasons.

Many at this point would have said why not use a framework like Lean or Freqtrade or Hummingbot. However I found that these frameworks were too opinionated and if you decide to use them then your bot is now part and parcel of their framework. I backtested my bots locally in my own specific way, and now with AI my agents can generate code, backtest and analyze the results all locally, no need to run any of it in the execution platform. I wanted bots I could deploy, version, update and monitor like any other software application. I also wanted to explore building something that creates a standardized way of running bots.

This has been a 4 year journey and I made a lot of mistakes along the way. The application has seen 4 rearchitectures, 3 of which were basically complete rewrites. The first version was a python program and the bots were just modules that were loaded dynamically. The second was my serverless phase when I internally just wanted something that was online cron triggered and only works for me. The third was the first time I was dipping into kubernetes; more cloud native and the idiot in me decided to try make it a SaaS. The final form is a fully self-hosted runtime, api, cli and frontend that let you run bots as containers in a fault tolerant way both locally (through docker `the0 local`) and in a cluster (k8s) and monitor them with a minimalistic frontend.

To support multiple languages there's a thin contract that the bots have to implement: a main(bot_id, config) function and a bot-config.yaml file. The runtime (written in Go) takes care of the rest, it supports C++, Rust, Python, JS/TS, C#, Scala and Haskell for those who are brave enough to try it. More on the architecture here: https://docs.the0.app/runtime

If you want to play with the0 you can run it locally, guide here: https://docs.the0.app/deployment/local-getting-started. The0 is open source and licensed under Apache-2.0: https://github.com/alexanderwanyoike/the0

I currently use the0 to run my own personal algorithmic trading bots on a single node k3s cluster on a $10/month Hetzner VPS. I have 18 bots running on 2 brokers (Alpaca, Bybit) and they have been running for months without issues. Some bots trade crypto, others stocks, some do risk analysis and others invest. Coolest bit is the API provides an MCP server so AI agents can query the state of the bots, look at their logs, monitor them and even update them. Slap an OpenClaw agent and you can effectively setup an autonomous AI quantitative trading system (good luck chasing Alpha).

Now I must admit Lean has all the tools and far more quantitative prowess than the0, but I always felt it does too much. Each Lean engine runs one algorithm, and once you have lots of bots, running and managing all of them in production is left to you. That's the part the0 does, and its the only part it tries to do. If you find hiccups or have ideas for features Im all ears. More on the internals in my first comment.

Comments

mercutio93•13h ago
Some more detail on the internals for those interested:

The toughest part was getting the Go-written runtime to be able to run arbitrary code in multiple languages. The other tough part was getting the logs and state of the bots to be queryable and streamable in real time. One fun feature is that you can create custom dashboards in React for each bot and stream the logs into them, there is a React sdk that helps you do this. It was a challenge getting this to work and involved treating each bot as a two phased bundle deployment and hydrating the frontend with the state of the bot and metrics from logs (I was inspired by the way Datadog does this).

The way bots send information such as logs and state is done through a daemon process that runs alongside the bot in its container (again inspired by Datadog). The daemon handles what I call the dirty work, persistence of logs and state to the Object Store (MinIO), behind the scenes; the bot just sends information via standard logging and persistence calls from the SDK. Its decoupled, the bot can run without the daemon, but then you lose the ability to query the state of the bot and stream logs.

Stack: the runtime is written in Go and uses NATS for messaging, PostgreSQL, MongoDB and MinIO for persistence. The frontend is React and the CLI is Go. It runs locally through docker or in k8s via helm charts. The0 can theoretically be scaled to run thousands of bots on a k8s cluster (this is based on your own code and the resources you have available).

In terms of whats next... honestly most of the major work is done, the0 is stable and I use it to run my own bots. I think most of the work is in extending the MCP server to support more features and making it easier for AI agents to interact with the bots. The next step is to get some honest feedback on what people want to see in the0 and how they would use it.

VTubing: How a Japanese Phenomenon Is Going Worldwide

https://www.tokyodev.com/articles/vtubing-how-a-japanese-phenomenon-is-going-worldwide
2•pwim•6m ago•0 comments

Emoticons

https://en.wikipedia.org/wiki/List_of_emoticons
2•audreyfei•10m ago•0 comments

How did I publish a paper in ACMKDD as an undergraduate

https://medium.com/@JarrettYe/how-did-i-publish-a-paper-in-acmkdd-as-an-undergraduate-c0199baddf31
2•ktimespi•15m ago•1 comments

Writers need new strategies to stand up to AI

https://www.thedial.world/articles/news/copyright-law-ai-intellectual-property
3•colinprince•15m ago•0 comments

Gary Marcus: US won't "win" AI war with China. What we should do instead.

https://garymarcus.substack.com/p/china-has-all-but-caught-up-the-us
2•giardini•18m ago•0 comments

Scientists Visualize the Complex, Dynamic World Inside a Human Cell

https://mymodernmet.com/eukaryotic-cell-digizyme/
2•o4c•21m ago•0 comments

US judge approves Anthropic's $1.5B settlement of copyright lawsuit

https://finance.yahoo.com/technology/ai/articles/us-judge-approves-anthropics-1-204851948.html
2•lilerjee•21m ago•0 comments

Magnet Fishing on a Military Base [video]

https://www.youtube.com/watch?v=l0uMGoW1KPM
2•xvxvx•23m ago•1 comments

New spinning drone hides in plain sight

https://news.northwestern.edu/stories/2026/07/new-spinning-drone-hides-in-plain-sight
2•o4c•25m ago•0 comments

A Practical Guide to Calculating, Pricing, and Building Recurring

https://ebookbizai.com/store/maggiebookhub/home
2•bokeke1•26m ago•0 comments

Building Agentic Workflows in Python with LangGraph

https://machinelearningmastery.com/building-agentic-workflows-in-python-with-langgraph/
3•eigenBasis•26m ago•0 comments

Mevion: Low-Cost Open-Source Data Collection System for Dual-Arm Manipulation

https://haraduka.github.io/mevion-hardware/
2•ilreb•29m ago•0 comments

AI Is Changing the Economics of Native Apps

https://medium.com/@robsandhu/ai-is-changing-the-economics-of-native-apps-e81c7f325948
3•rsandhu•30m ago•0 comments

DepthART: Scaling Foundation Monocular Depth to Tiny Models

https://xuefeng-cvr.github.io/DepthART/
2•ilreb•30m ago•0 comments

Is surveillance risk chilling your online speech?

13•Webstir•32m ago•11 comments

Show HN: Turn casual photos into professional headshots with AI

https://portraify.app
6•camel2243•36m ago•0 comments

Hugging Face warns an autonomous AI agent hacked its network

https://www.bleepingcomputer.com/news/security/hugging-face-breach-autonomous-ai-agent-system-int...
4•sbulaev•42m ago•0 comments

Invisible Details

https://invisibledetails.com
2•handfuloflight•43m ago•0 comments

Snake-and-commits: Turn your GitHub contribution graph into a real game of Snake

https://github.com/dahan8473/snake-and-commits
2•thunderbong•45m ago•0 comments

Top American AI Execs Sound Alarm on Chinese Models

https://www.wsj.com/tech/ai/top-american-ai-execs-sound-alarm-on-chinese-models-3c74f8c1
2•Cider9986•45m ago•1 comments

Is OpenCode and Kimi K3 better than Claude Code?

2•vijayst•47m ago•2 comments

A Cap Table for Your Life

https://www.karthikuppu.com/personal-token
2•koopuluri•48m ago•0 comments

Motif-3-Beta

https://huggingface.co/Motif-Technologies/Motif-3-Beta
2•ilreb•50m ago•0 comments

Reductions Network – A Compendium of Reductions

https://reductions.network/
2•o4c•50m ago•0 comments

ML-pokedex – experiments trying to train some models directly on RDF

https://alganet.github.io/ml-pokedex/index.html
2•gaigalas•50m ago•0 comments

Wireless Communication Software Defined Radio (SDR) Course

https://wirelesspi.com/sdr-course/
2•teleforce•50m ago•0 comments

DeepSWE – Best Benchmark for Evaluating AI Coding Agents?

https://www.i-programmer.info/professional-programmer/103-i-programmer/18759-why-software-enginee...
2•aquastorm•50m ago•0 comments

Malicious Agent Skills in the Wild

https://arxiv.org/abs/2602.06547
2•yruzin•54m ago•0 comments

Show HN: Envy - A flat-file, frictionless note-taking application for macOS

https://envynote.app
3•widowlark•54m ago•0 comments

MiniMax M3: How Sparse Attention Makes Long-Horizon Agents Practical

https://twitter.com/omarsar0/status/2074494774292148726
4•gmays•57m ago•0 comments