An engineer at Coinbase has released a software simulation that turns a virtual fruit fly into a cryptocurrency trader. This project matters because it demonstrates a novel approach to reinforcement learning where the agent receives dopamine-like rewards for profit and aversive signals for losses. The code is now available for developers who want to experiment with biological neural networks in financial contexts.

Open-source simulation uses virtual neurons to trade crypto via dopamine signals
The simulation, named Stonkfly, models a fruit fly brain with 166,700 virtual neurons and 25.6 million synaptic connections. It processes market data by reading RGB pixels from a 320×180 display that shows candlestick charts. The system makes trading decisions every 500 milliseconds based on this visual input.
Stonkfly operates within strict limits to prevent runaway behavior. It refreshes market data every 60 seconds and allows a maximum bet of $10 per order. The agent can execute up to 24 trades per day. It triggers a dopamine rush for rising portfolio values and aversive signals for losses, including trading fees.
The project is available as an open-source repository for macOS and Linux users. Running the simulation requires 16 GB of RAM and a Python 3.11 environment with a C++ 17 compiler. The author explicitly warns that the simulation does not prove actual trading ability or financial success.



Discussion
0 comments
Log in to join the thread with a thoughtful take, question, or correction.