Industry

Coinbase Engineer Deploys Simulated Fruit Fly Brain as Cryptocurrency Trading Bot

A developer has created Stonkfly, an open-source project that simulates a male fruit fly's neural system to autonomously trade digital assets based on candlestick charts and dopamine-driven reinforcement signals.

3 min read
Engineer turns simulated fly brain into a crypto day trader, posts downloadable sim to GitHub — 166,700 virtual neurons read candlestick charts for dopamine hits

The latest entry in a growing field of animal brain simulations comes from a Coinbase engineer who has built a trading system around a virtual insect. Following recent work that taught a simulated fly to play Doom, this new project, called Stonkfly, puts a digital fruit fly in charge of making buy and sell decisions on cryptocurrency markets. Those curious about the experiment's performance can observe the system trading in real time online.

At its core, Stonkfly runs a computational model of a male fruit fly's brain and visual apparatus. The system presents this simulated organism with candlestick price charts and allows it to decide whether to purchase, liquidate, or retain positions across various cryptocurrencies, which rotate through the display in sequence. The fly receives feedback based on trading outcomes: profitable moves trigger a dopamine signal sent to 15 neural cells, while losses activate two cells associated with negative responses. Transaction costs register as losses in this reward structure. Notably, the creator emphasizes the absence of pain or emotional processing in the model, and the fly operates under constraints that prevent leverage trading or short selling—restrictions that grant it more discipline than many human traders demonstrate.

The simulated brain comprises 166,700 neurons connected through 25.6 million synaptic links. The virtual fly perceives market data through a 320x180 pixel display split between its left and right eyes, with overlapping central vision. Rather than receiving numerical price data directly, the photoreceptor cells process RGB pixel values from the chart display. The system operates on a 500-millisecond decision cycle, with market information refreshing every 60 seconds. Each trade can involve up to $10, with a maximum of 24 orders permitted daily.

The engineer behind the project cautions against drawing broad conclusions from the experiment. According to the creator, the work merely demonstrates how visual input, neural processing, and synaptic modifications interact within the simulated system. The author specifically warns users not to interpret these neural changes as evidence of genuine trading capability, particularly given that rising cryptocurrency valuations can make any buyer appear competent. Nevertheless, some observers will likely attempt to extract investment insights from a fly's trading performance.

Google Preferred Source

Interested parties can obtain Stonkfly by cloning its repository on macOS or Linux systems equipped with at least 16 GB of RAM, Python 3.11, and a C++ 17 compiler. The simulation operates using paper trading and a default $100 virtual account balance, though it pulls real BTC-to-USDC market data. Documentation is available for users who wish to configure a live trading account and test whether their own trading instincts can match those of an arthropod.

Source: Tom's Hardware

Source: Tom's Hardware · Reporting supplemented by The Silicon Ledger staff.