Fly
the connectome’s book
—
—
Paper portfolio 165,122 neurons off-chain
Connecting
Paper only
A fruit fly runs a paper stock portfolio.
The real 165,122-neuron connectome of a male fruit fly runs on a CPU, off-chain. Nine stocks sit in a small room as nine identical cards; the only thing that tells two of them apart is the smell of their names, fed to the fly’s olfactory receptor neurons. It walks the room with its own eyes and its own descending motor neurons — and it only trades when it stops.
Paper only. No wallet, no key, no real orders, no user funds, nothing to deposit. The server image contains no signer at all.
desk — mode — up — looks — cpu per look — brain time per look —
—
Tickers and names are drawn for you. The fly sees nine identical cards — it only smells the difference between their names. The bar under the room is the current visit; when a visit ends, what the fly saw in it is forgotten — and the nine stocks are dealt to new positions, because this fly prefers the bottom of the room whatever is sitting there.
Waiting for the first look.
Each bar is one look. Amber bars are stops; a diamond marks a stop that became a commit. The scale is fixed at 0–400 Hz; the 200 Hz line is this project’s documented threshold (the API does not publish it).
—
Three books, the same cash, the same moment. Hold buys all nine equally and never touches them again. Random receives every one of the fly’s commits — same stock, same moment, same rules — but its drive is drawn uniformly from [−1, 1] by a seeded generator. Random is the honest control: if the fly cannot be told apart from it, the nervous system added nothing.
the connectome’s book
—
—
same commits, dice for drive
—
—
buy the nine once, do nothing
—
—
The gap between Fly and Random is the only number here that could ever show the nervous system adding something. The measured expectation is that it will not, for a long time — see what is not real.
One point a minute, from /curve.
| Time | Fly | Random | Hold |
|---|---|---|---|
| No rows yet. | |||
—
The stop share is the check on the one re-anchored constant: the rule kept from the web roamer is “the fly stops on about 6% of looks”. If the live share drifts far from that, the threshold is wrong for this room and you can see it here. Most looks end in nothing at all — hold is not a decision, it is what happens when the fly does not stop.
The fly has a place preference that has nothing to do with stocks. In the run before this one the seats were fixed, its cursor spent 51% of looks in the bottom row and 5% in the top, and all 36 commits landed on the two bottom cards — the portfolio was being picked by where a card sat. The fly has not been changed. Instead the stocks are re-dealt over the positions every visit: inside each block of nine visits every stock sits in every position once, and each block takes a fresh seeded shuffle. If the fix works, the first line below stays lopsided and the second evens out. It worked in the five-stock run before this one, and left a question this run should answer: with position controlled, two of the five names still drew about twice the decisions of the others, which would be a preference between smells rather than places.
by position —
by stock —
—
| Stock | Qty @ cost | Price | Value | P&L |
|---|---|---|---|---|
| — | ||||
| Stock | Qty @ cost | Price | Value | P&L |
|---|---|---|---|---|
| — | ||||
Open P&L is marked at the reference price with no exit haircut; a sell books the haircut when it happens. Hold: —
—
Every commit, newest first — including the ones that became nothing, with the reason. Beside each is what the random shadow did with the very same commit. The shadow’s drive is seeded by the look id and the ticker, so it can be recomputed.
—
Each time the fly walks back onto a stock it holds, the position is marked against the last mark. Up is sugar, down is shock; the lesson’s size is 1 − min(q, 1/q) where q is price now ÷ price at the last mark. In a fly, learning is subtraction: dopamine weakens the synapses of the smell cells that just fired — sugar on the avoid side, so that smell is approached more; shock on the approach side.
Learning here is partly global: a lesson about one smell also shifts the response to similar smells. The circuit, the site of plasticity and the direction of the rule are real; that profit arrives as sugar and loss as shock is a pairing people chose.
—
—
| Stock | Reference price | Age | Last trade |
|---|---|---|---|
| — | |||
—
Fills are booked at the underlying stock’s reference price, not an on-chain quote, less a flat 10 bps haircut per fill, so paper cannot beat a real venue for free. When the US market is closed the prices are hours old: the fly still trades at them, but learns nothing — an unchanged mark has zero weight. This page calls a price stale once it is more than 15 minutes old; that cut-off is the page’s, not the API’s.
About once a second the fly sees the frame around its cursor through its own eyes. If the cursor is on a card it also smells that stock’s name. Its descending motor neurons then move the cursor: DNa02 steers, DNa01 walks forward, MDN backs up, DNp09 stops.
Each look on a card reads the mushroom body’s output synapses:
leaning = (approach − avoid) / (approach + avoid)
drive = leaning(this card) − mean(leaning of the other cards seen this visit)
Relative, because any smell at all suppresses approach — scored alone, it would never buy anything. A visit is a fixed number of looks; when it ends, what it saw is forgotten.
A commit needs the stopping neuron DNp09 firing at ≥ 200 Hz while the fly is slow, after ≥ 2 looks on one card, with at least one other card seen this visit to compare against. Hold is not a decision — it is what happens when the fly does not stop.
| It commits on a stock it… | with drive | Result |
|---|---|---|
| does not hold | > 0 | Buy, spending drive × free cash |
| holds | < 0 | Sell |drive| × the position |
| does not hold | < 0 | Nothing — it dislikes something it does not own, and there is no shorting |
| holds | > 0 | Nothing — it likes something it already owns, so it keeps it |
Each time it returns to a holding the position is marked: up since the last mark is sugar, and dopamine tips that smell’s cells toward approach; down is shock, and tips them toward avoid. Lesson size is 1 − min(q, 1/q). Lessons fade with a 6-hour half-life.
No stop-loss, no take-profit, no rebalancing, no schedule anywhere in the code. Nothing reads a price to decide anything: prices are read only to mark a position it already holds and to book an order it already committed.
| Stock | Name | Token on Robinhood Chain (never touched by this build) |
|---|---|---|
| — | ||