We took the measured wiring of a fruit-fly brain, ran it inside Pine Script and tested whether it holds an edge. It does not. This is the audit trail.
Most connectome demos start by asking where to plug the neurons in. We never had to: biology had already answered it.
The fruit fly has command neurons whose function is known from experiments — stimulate the cell, watch what the animal does. Forward, backward, turn, escape, sit still. That is the same discrete action space a discretionary trader picks from. Not a metaphor, a structural match — and it is the main integrity argument of the project.
All five are present in MaleCNS v1.0 — the complete connectome of an adult male fruit fly, released in September 2026 under CC BY 4.0.
The map above was a claim, not a mechanism. Silencing four of these six circuits changed nothing at all, and a 313-neuron model holding only the looming detectors and the giant fiber reproduced every trade exactly.
Each circuit was given its own sensory input. Silencing any one of the 13 circuits tested now moves between 3% and 32% of positions.
That same stripped model now disagrees with the full network on three quarters of its bars. The mapping above is what the network actually uses.
Real BTCUSDT candles, H1 timeframe. The test window opens on 7 October 2018 and runs to 3 May 2026 — seven and a half years, no window shopping. The replay is deterministic and causal: on bar N the fly has only seen bars up to N. Charge builds in the giant fiber, a selloff fires it, and the position is flattened.
Starting equity is $1,000, one position, long only: the fly stays long while calm and sits in cash after an escape. Amber is its equity curve, grey is the same $1,000 bought and held. Fees are excluded in the replay, exactly as in the Python reference — what they do to the result is right below. The same computation runs inside the Pine script on a live chart; here it is a playback, because bar replay in TradingView hits the platform's execution limits.
+323% · max drawdown 48% · exposure 44.6% · 13,958 round trips
+1,090% · max drawdown 77% · one entry in seven and a half years
Which version this is. The replay above is version 1 of the strategy, where trades were driven by the looming detectors and the giant fiber alone. Version 3, the one published now, puts every circuit into the decision — and over the same window it returns −69.9% at a drawdown of 86.5%. Making the brain participate made the trading worse, and that is the honest result. The section below is where it is taken apart.
The first thing to say out loud: the dumbest possible benchmark wins by 2.8×. Buying bitcoin in 2018 and doing nothing beats a brain with a million synaptic contacts. On BTC, buy & hold is the benchmark any strategy has to clear, and we do not clear it.
The second: the fly's own P&L carries no information. It was long 45% of the time in an asset that went up 12×, so any process entering at that rate would also print a profit. We measured that instead of assuming it.
Twelve runs of a coin flip at the same 44.6% exposure. The fly beat six of twelve — a coin flip about a coin flip. The dispersion of the random benchmark swallows the fly's result whole.
0.02% per side — the maker fee on Binance futures.
27,915 fills: 13,958 entries and 13,957 exits, the last position still open. At two basis points a side, $1,000 of starting equity ends at $16.
So — does it make money? On paper yes, in substance no: the return is just over a third of buy & hold, statistically indistinguishable from random entries at the same exposure, and fully consumed by fees. The one result that survived every control is drawdown: lower than the random benchmark in ten runs out of twelve, and 1.6× lower than buy & hold. The effect is small, and it is about risk, not return — which is why drawdown was the project's target metric from day one.
The remaining job is to feed it something its neurons evolved to handle. Three channels, each riding a measured pathway.
A selloff is an object looming toward you. Looming detectors LC4 and LPLC2 feed the giant fiber directly: 11,198 synaptic contacts, measured. In a live fly this is the fastest known route to takeoff.
Kenyon cells emit a sparse code of context — about 5% active. Mathematically that is a random projection with a threshold. We feed bar features in and get "what the market smells like right now".
A winning trade stimulates PAM neurons, a losing one PPL1. That is how reward and punishment are encoded in the animal during odour learning.
Bolting conventional RL onto a connectome defeats the purpose: the moment an optimiser touches the weights, the gradient is trading, not the fly. But the animal ships with its own reinforcement-learning machinery, so we used that.
Measured connections in the full circuit, 17,000 in the Pine build. No reward, no gradient, no fitting — there is nothing here to overfit with.
Numbers the connectome does not contain: sensory gain, the threshold that turns spikes into an order. These we did fit — the brain we did not touch.
KC→MBON synapses in the full circuit, 5,816 in the Pine build. They depress when a cell was active as dopamine arrived — the same three-factor rule the animal uses.
Learning runs bar by bar inside the backtest: on bar N the fly has only seen bars up to N. Look-ahead bias is structurally impossible.
Every connectome demo runs into one question: is the fly brain responding, or the scaffolding the author wrote around it? The test is cheap — shuffle the connection weights while preserving the node degree distribution. Same neuron count, same connection count, same total activity; only the wiring diagram is randomised.
Below, one identical looming stimulus is fed to both networks. Real MaleCNS wiring on the left, shuffled on the right. Total activity is practically identical — 15,651 spikes versus 15,439 over a hundred simulation steps. Only the addressing differs. Watch the giant fiber charge.
The LC4/LPLC2 → DNp01 cascade is intact: 11,198 measured contacts. Charge clears the threshold, the giant fiber fires, the fly takes off. Reproducible across every seed.
The network is no quieter — excitation scatters to random addresses and never accumulates on the command neuron. At most one spike across the ten seeds tested.
The avoidance response disappears completely. So the "looming detected → escape" pathway rests on the measured connections, not on our scaffolding. No project in this wave of connectome demos has published such a control — and without one, "the fly brain is doing it" is just a caption. We run the same control on every hypothesis in the next section.
The control runs on the full circuit — 5,828 neurons, 121,325 connections. The pruned Pine build keeps the pathway: the distilled circuit reproduces 36 of the 39 escapes the full one produces over the same window.
Shuffling the connections asks whether the wiring matters. The other direction asks something harder — can the wiring alone tell us what a circuit is, with no anatomy supplied?
The fly steers by a ring of cells that holds its heading as a bump of activity. We never told the script which cell points where. Take the EPG subgraph, normalise its Laplacian, look at the eigenvalues: two of them come out almost equal. That near-degenerate pair is the signature of a cycle, and the matching eigenvectors give the cosine and sine of every cell's angle. Fifty cells, one ring, nothing placed by hand.
Then we checked the result against anatomy that never entered the computation:
Cyan and violet are the two sides of the body. Ticks mark where the alternation switches.
This is the part we did not have to model. The compass was already in the connectome; we only had to read it.
This is the dull part and the important one: ten hypotheses, roughly forty-five runs. Each went through the same protocol — shuffled-weight control, honest out-of-sample split, several seeds.
An oracle with access to every price feature calls the sign of the next bar at this hit rate. Timing a single instrument off price alone is not predictable — for anyone, fly or not.
Cross-sectional momentum on the top 10 coins looked like signal (t 2.8). On a 40-coin universe it decays to t 1.5. There was no effect, only selection.
The retail long/short account ratio worked convincingly in-sample and fell apart out-of-sample. The effect is non-stationary.
The result we publish as a result: no configuration beat a random benchmark reliably on price inputs. Drawdown came in below buy & hold — but that is the arithmetic of running 44.6% exposure, not evidence about the wiring, and we tested that separately.
A negative result is a result. None of the five preceding projects on this connectome published one.
The full circuit is 5,828 neurons and 121,325 connections. The budget on a live chart is roughly a thousand neurons and seventeen thousand connections. Six sevenths had to go.
17,000 of 121,325
the distilled circuit reproduces the full one's positions, BTC H1 2022–2026
over the same window; on history from 2018 there are 219
Most of the brain did not fit into TradingView, and the decisions barely moved. The reusable by-product: a recipe for porting a network with measured weights into Pine — packing the edge list into string literals, event-driven propagation instead of a full sweep, and a budget of about a hundred million operations per run. None of that is specific to flies.
The whole thing could have stayed in Python. Three reasons it did not, and each mattered more than expected.
Every other connectome demo is a recording — Doom, Minecraft, Beat Saber. This one is source code you paste into the Pine Editor: it computes on your instrument, your timeframe, your history. The difference between watching and running.
TradingView's Community Scripts expect the source to be published and moderated. For a project whose entire argument is "we checked it, here is the control", that is not a constraint — it is the precondition.
Beyond price, Pine reaches 20+ non-price feeds — funding, open interest, the retail long/short account ratio. We tested an entire round of hypotheses on them without a single API key.
//@version=6 strategy("FlyTV 🪰 Fly Brain", "FlyTV", overlay = false, initial_capital = 10000, process_orders_on_close = false) // network state survives between bars — that is what var arrays are for var int[] pot = array.new_int(N, 0) // membrane potential per cell var float[] kcw = array.new_float(E, 1.0) // KC→MBON — the only thing that learns // the network steps once per closed bar — otherwise it re-runs on every tick if barstate.isconfirmed loom = math.max(0.0, -ret) * loomGain // candle → current into LC4 / LPLC2 spikes = stepNetwork(loom, STEPS) if spikes >= gfMin strategy.close("L", comment = "escape") // the giant fiber fired
That is the whole shape of it: var arrays keep the membrane
potential and the learned weights alive from bar to bar, barstate.isconfirmed makes the
network step exactly once per closed bar, and a giant-fiber spike becomes
strategy.close(). Everything a Pine author already knows — applied to 17,000 measured
synapses instead of a moving average.
The platform limits turned out to be the useful part. They are a budget you cannot buy your way out of, and they are what forced us to distil 121,325 connections down to 17,000 and then prove the decisions had not moved. In Python that discipline never appears: there is always more hardware.
That last one is the trick the whole port hangs on: a string literal costs a single token no matter how long it is, so the edge list ships inside the script as packed text and is expanded on the first bar.
So the reusable by-product of a fruit-fly joke is a fairly general recipe: how to carry a network with measured weights into Pine Script and keep it inside the execution budget. If you write Pine, the useful page here is the code, and the script itself is published on TradingView.
A connectome is a static anatomical snapshot, not a living brain. We are not claiming to have validated physiology, and certainly not that a fly can trade. Nothing here is investment advice.