Coinbase Engineer Simulates Fruit Fly Brain for Crypto Day Trading with Stonkfly
An engineer from Coinbase has created an open-source project called Stonkfly that simulates a male fruit fly brain and visual system to trade cryptocurrency in real time. The simulation connects a neural model of 166,700 neurons and 25.6 million synapses to a standard candlestick chart, allowing the virtual insect to execute buy, sell, or hold decisions.
How the Fly Trades
The simulated fly views a 320×180 pixel representation of historical pricing data across its left and right eyes, with an intersecting central region. Photoreceptor cells receive raw RGB pixel values rather than explicit price information. By default, the fly “thinks” and acts every 500 milliseconds, while market data refreshes every 60 seconds. Each trade can risk up to $10, with a maximum of 24 orders per day.
Profitable trades trigger a dopamine-like reinforcement signal to 15 neurons, while losses activate two aversive neurons. Trading fees are counted as losses. The author emphasizes that no pain or emotional mechanisms are modeled. Notably, the fly cannot use leveraged positions or short selling, displaying what the project describes as far better judgement than most human traders.
Technical Details and Caveats
The project’s author cautions that this small experiment does not prove anything beyond the connection between input mechanisms, visual signals, and synaptic changes. He warns users against assuming those changes indicate actual trading ability, especially given a general rise in crypto prices that ‘can make any buyer look skilled’.
Running Your Own Stonkfly
The simulation runs on macOS or Linux, requiring 16 GB of RAM, Python 3.11, and a C++ 17 compiler. By default it operates in paper-trading mode with a virtual $100 balance using real BTC-to-USDC data. Instructions are provided for connecting a live exchange account to compare human performance against the insect’s.

