FlyTV - a real fruit fly connectome trading on your chart — Strategy by gsoloviev
By gsoloviev
Performance Metrics
- Author: gsoloviev
- Symbol: BINANCE:BTCUSDT
- Timeframe: 1 hour
Description
A real fruit-fly brain, wired into a trading strategy and tested honestly. 17,000 measured connections from the MaleCNS v1.0 connectome run on every bar: looming detectors watch the candles, the giant fiber fires the escape reflex, and the mushroom bodies learn from realised P&L. The answer to the obvious question is no — it does not beat buy & hold, and this publication shows exactly how that was established.█ WHAT IS REAL AND WHAT IS MODELEDMeasured — taken from the connectome, not invented:the wiring: 995 neurons and 17,000 connections in this script, distilled from a 5,084-neuron, 108,317-connection subgraph of MaleCNS v1.0the looming pathway LC4 / LPLC2 → DNp01, 11,198 synaptic contactsconnection signs derived from predicted neurotransmittersthe identity and function of the command neurons, known from stimulation experimentsthe KC→MBON plasticity rule and MBON valence, which matched the published literatureModeled — our assumptions, and they matter:spiking dynamics: leaky integrate-and-fire, 20 steps per barsensory tuning, which the annotations do not contain at allthe entire mapping from market data to sensory organshow spikes become an orderno retinotopy: every detector receives the same stimulusA connectome is a static anatomical snapshot, not a living brain. This is a visualization of measured neuroscience, not a validation of fly physiology.█ CONCEPTSMost connectome demos begin by choosing where to plug the neurons in. That question is already answered by biology: the fly has command neurons whose function is known from experiments, and they span the same discrete action space a trader picks from.DNp09 — walks forward → go longMDN, the "moonwalker" — walks backward → exitDNa01 / DNa02 — turns → flip directionDNp01, the giant fiber — takes off and escapes → flatten now, risk-offDNg11 — grooms → stay flat and waitA selloff is, to a fly, an object rushing toward its eye. That is not a metaphor: LC4 and LPLC2 are looming detectors and they feed the giant fiber directly, which is the fastest escape pathway in the animal.Reward is not bolted on with reinforcement learning — the moment an optimiser touches the weights, the gradient is trading, not the fly. The animal ships its own machinery: Kenyon cells give a sparse code of context, dopaminergic PAM and PPL1 neurons carry reward and punishment, and KC→MBON synapses depress when a cell was active as dopamine arrived. Realised P&L drives that dopamine, so learning happens bar by bar, inside the backtest, using only bars the fly has already seen.█ THREE LAYERS, ONLY ONE OF THEM LEARNSReflexes — frozen. The measured connections. No reward, no gradient, no fitting. There is nothing here to overfit with.Body interface — about 15 numbers. Sensory gain, the spikes-to-order threshold, the escape cooldown. These are not in the connectome, so they were tuned externally. The brain was not touched.Mushroom bodies — online learning. 4,934 KC→MBON synapses in this build, updated by the three-factor rule the animal uses.█ FEATURESVersion selector: buy & hold, reflexes only, reflexes + mushroom bodies, or mushroom bodies only. Use it to see which layer is responsible for what.The fly panel: one pixel fly with a see-through head, drawn on the price chart. Optic lobes, mushroom bodies, central complex, giant fiber and legs light up as the circuits that carry them fire.HUD: per-circuit readout — looming input, giant-fiber charge against its threshold, mushroom body bias, dopamine, and how much of the synaptic weight the learning has eaten so far.Crowd sense: an optional non-price input, the long/short account ratio on the perpetual. Off by default, and the description below explains why.█ HOW TO USE ITBuilt and tested on crypto, H1. Start with the defaults, watch the giant-fiber charge during a selloff, and switch Version between "reflexes" and "reflexes+MB" to see which part moves the curve. Every state update happens on bar close; the avatar animates intraday, the network does not. The network is computed over the last 4,000 bars only — 17,000 connections times 20 steps per bar does not leave room for more inside the 20-second run budget — so the Strategy Tester covers that window, not the seven and a half years quoted below. The mushroom bodies need a long run to accumulate anything, so keep the timeframe low enough that 4,000 bars still span a meaningful stretch.█ RESULTS, AND WHY THEY PROVE NOTHINGTested on BTCUSDT, H1, from 7 October 2018 to 3 May 2026 — 66,315 bars, one window, no window shopping. Starting equity $1,000, long only, one position.the fly: $4,231, max drawdown 48%, exposure 44.6%, 13,958 round tripsbuy & hold: $11,904, max drawdown 77%, one entry in seven and a half yearsrandom entries at the same exposure, 12 seeds: $7,400 ± 8,900 — the fly beat six of twelvewith a realistic maker fee of 0.02% per side: $16So it ends up in profit, and the profit carries no information. It was long 45% of the time in an asset that went up 12x; any process entering at that rate would also print a gain, and the random benchmark's dispersion swallows the result whole. The simplest possible approach — buy and do nothing — wins by almost three times. Fees finish what randomness starts.One result did survive every control: drawdown came in below the random benchmark in ten runs out of twelve, and 1.6x below buy & hold. The effect is small and it is about risk, not return.█ LIMITATIONSNo edge was found. Ten hypotheses, roughly forty-five runs, each with a shuffled-weight control and an out-of-sample split. None beat a random benchmark reliably on price inputs.The escape reflex does not anticipate. It fires on the close of the bar that already fell. It catches crashes cleanly — 19 of the 20 largest drops — but there is no foresight in it.Crowd sense is non-stationary: 17/18 in-sample, 6/18 out-of-sample. That is why it ships off.Trade count is high. Any realistic fee dominates the result. The script ships with a 0.02% maker fee per side and no slippage, because that is what the published test used. Set both to your own venue before drawing conclusions from the Strategy Tester.This is a distillation. The full subgraph is six times larger; it does not fit in the platform budget. Measured on a separate 2022-2026 window, the distilled circuit reproduces 0.968 of the full circuit's giant-fiber activity and 36 of its 39 escapes to within one bar.█ THE CONTROL THAT MAKES THIS MORE THAN A STUNTAny connectome demo faces one question: is the brain responding, or the scaffolding around it? Shuffle the connection weights while preserving the node degree distribution — same neurons, same connection count, same total activity, random addressing. On the same looming stimulus the real wiring produces 98 giant-fiber spikes over 100 simulation steps and the shuffled one produces zero, identically across ten seeds, while total network activity differs by half a percent (15,648 versus 15,570). The avoidance response lives in the measured connections, not in the code around them.█ WHY THIS IS IN PINE AND NOT IN A NOTEBOOKThe platform limits are the interesting part: 500 ms per bar, 20 seconds per run, a cap on tokens in the source. A budget you cannot buy your way out of, which is what forced the distillation and then the proof that the decisions had not moved. Two techniques do the heavy lifting and are reusable for any network with fixed weights: a string literal costs one token regardless of length, so the edge list ships as packed text and expands on the first bar; and propagation is event-driven, walking a spike queue instead of sweeping every cell. The source is open — take them.█ DATA AND CREDITSConnectome: MaleCNS v1.0, licensed CC BY 4.0 — FlyEM at HHMI Janelia Research Campus, University of Cambridge, MRC Laboratory of Molecular Biology, and Google Research. Berg et al., 2026. The FlyWire connectome is deliberately not used here: its licence is non-commercial.Nothing in this publication is financial advice. Past behaviour of any strategy, including this one, says nothing about the future.