Experimental · Solana mainnet

A Fruit Fly Is Learning To Trade. 139,255 Neurons. Real Synapses. Real Markets. Open Source. Open Brain. No Stopping.

The complete adult Drosophila connectome, wired to a memecoin tape and trained on the money.

01 · About

One brain, 128 tokens, one second at a time

fly-trader does not use a neural network shaped like a brain. It uses the brain: the synapse-level wiring diagram of an adult fruit fly, run as a recurrent policy whose only trainable freedom is how strongly each real synapse fires.

The brain

The wiring comes from FlyWire FAFB v783, the first complete synaptic connectome of an adult animal brain (Dorkenwald et al., 2024; annotations from Schlegel et al., 2024). Every neuron is present. Every connection between them is a real, electron-microscopy-reconstructed synapse. Neurotransmitter signs follow Shiu et al. (2024): GABA and glutamate inhibit, everything else excites. The build reproduces the MIT-licensed flybrain export edge for edge.

Neurons
139,255

Whole brain, both hemispheres, optic lobes included

Connections
2.70 M

Distinct pre→post pairs; ≈33.9 M individual synapses

Kenyon cells
5,177

Sparse odor code of the mushroom body

Output neurons (MBONs)
96

Approach and avoid readouts of the mushroom body

Dopaminergic neurons
323

307 PAM (reward) · 16 PPL1 (punishment)

Olfactory glomeruli
48

Antennal-lobe channels the encoder writes into

Named populations
26

Sensory, mushroom body, central complex, descending

Source
FAFB v783

FlyWire consortium, Nature 2024

How it works

Sensing. Every second the system watches up to 128 recently graduated pump.fun tokens at once. For each one it computes a 45-dimensional market observation: returns and realized volatility over one minute to three hours, buy/sell imbalance, volume, trade counts, unique signers, burstiness, liquidity, drawdown, exit cost, and holder statistics. A small learned encoder writes that observation into the fly's afferent neurons, the populations that in a living fly carry smell, taste, touch, and temperature.

Propagation. Activity then flows through the connectome exactly as the wiring allows: a neuron can only influence the neurons it actually synapses onto. The sign of every synapse is fixed by its neurotransmitter (Dale's law) and the topology never changes. What training adjusts is the magnitude of each connection, plus a gain and bias per neuron. This follows the FlyGM approach (arXiv 2602.17997) in which a whole connectome is trained end to end as a graph model and outperforms both size-matched multilayer perceptrons and random graphs of the same density.

Acting. A decoder reads the 1,303 descending neurons, the fly's motor output, and produces a target exposure between 0 and 1 for each token. Exposure is a fraction of the maximum position size; the runner buys, resizes, or sells to match it, and a trade only fires when the target moves by at least a quarter of a position.

Learning. Training runs in three stages: a rule-based expert generates demonstrations, the connectome is warm-started by imitation with DAgger correction, then recurrent proximal policy optimisation (PPO) refines it against net profit and loss after Jupiter fees, pool fees, and constant-product price impact. Gradients flow back through time and through every synapse of the graph.

Trained graph · central brain
Neurons
41,756
Edges
1,040,700
Trainable parameters
1.31 M
Message-passing steps
4 per beat
Beat
1 s · 128 slots
Compute
Apple M-series GPU

The optic lobes (97,499 neurons) are excluded from the trained policy; the market has no photoreceptors to speak to them. The full 139,255-neuron graph is retained for the spiking mode.

Also in the code · spiking mode

An earlier design runs the full brain as leaky integrate-and-fire neurons with dopamine-gated three-factor plasticity confined to the Kenyon-cell → MBON synapses, the site of associative learning in the real fly. It remains available behind a flag and is retained for research, but the trained policy is the default.

Training data

The fly learns from the post-graduation life of pump.fun tokens on Solana: candles and per-trade rows pulled from pump.fun's own swap API, an hourly historical replay archive, and a live tape of every swap on watched pools streamed through Helius. Token metadata and holder statistics come from Jupiter. All of it is stored in Postgres and Parquet and every decision is replayable from journaled inputs.

Market features
45

Per token per beat, over 1 m · 5 m · 15 m · 1 h · 3 h windows

Graduated tokens in corpus
14,922

1-minute candles for the first 12 h, 5-minute to 7 days; 31 GB

Corpus feature rows
2.7 M

One row per traded minute per token

Historical trade rows
405 M

Replay archive, every pump.fun trade, hour by hour

Live swaps captured
1.49 M

Helius websocket tape on watched pools

Slot observations
472 k

Behind the measured eligibility gates

Graduations per hour
≈36

Measured rate of new pump.fun migrations

Sources
pump.fun · PumpAPI · Helius · Jupiter

What we taught the fly

A connectome does not come with a trading strategy. The expert that demonstrates one for it is deliberately simple and every threshold in it was measured on the fly's own data before it was allowed to teach.

UNIVERSE

Graduated pump.fun tokens only

  • Mint and freeze authority must be disabled
  • At least 1 SOL of swap volume in the last 3 hours
  • Watched for up to 7 days after graduation
  • Everything else (liquidity, age, holders) is sensory input, never a filter
ELIGIBILITY

Measured on 472 k observations

  • At least 6 hours since graduation: younger tokens averaged −0.7 % forward return
  • Buy imbalance ≥ 0.2 over both 5 and 15 minutes
  • Within 5 % of the one-hour high, and rising
  • Each condition independently raised the 5- and 15-minute forward return
EXPERT STRATEGIES

Four demonstrations, walk-forward tested

  • Breakout with volume confirmation
  • Participation flow from per-trade rows
  • Quality survivor and graduation survivor
  • Exit grid: trailing 5–20 %, hard stop 3–8 %, max hold 30–120 min
INNATE VALENCE

What smells good before learning

  • Rank score over short-horizon momentum and buy/sell flow
  • Penalty on bot-inflated volume: a low organic score smells bad
  • Backtest: top-versus-bottom decile spread of +0.75 % over 5 minutes
REFLEXES

Exits the fly cannot unlearn

  • Bitter: exit at −2 % unrealized
  • Turned: was up 1 % or more, now flat or below
  • Satiety: a gain held long enough is taken, if it clears the round-trip fee
  • Hard stop at −50 %; dead-bag sweep after 3 hours without a swap
RISK RAILS

Capital protection outside the brain

  • 0.1 SOL maximum per position, valence-proportional sizing
  • 10 SOL rolling 24-hour notional cap
  • Kill switch at −30 % from peak wealth blocks new entries
  • Gas reserve, circuit breaker on failed executions, stale-feed halt
Status · 2026-09

fly-trader is an experiment. The policy is still in training and its out-of-sample results are unproven; no performance is claimed here or anywhere else. Live trading is default-deny. Paper books run first, every observation, decision, and fill is written to Postgres, and the whole history is replayable. Read the code before you trust it, and never fund it with money you cannot lose.

02 · Token

$FLY

A Solana token launching on Pump.fun alongside the software. It exists to gather the community around the experiment. It has no utility today.

Ticker
$FLY
Total supply
1,000,000,000
Chain
Solana
Venue
Pump.fun
Contract address
TBA

Contract address and buy link are published here and on the X community at launch. Anything elsewhere is not us.

Utility

Coming soon!

Ties between $FLY and the fly-trader software are forthcoming and will be announced on this page and in the X community. Until they are announced, the token does nothing and confers nothing.

Disclaimer

$FLY is a memecoin. It is not an offer or solicitation to buy securities, and nothing on this site is investment, financial, legal, or tax advice. There is no expectation of profit from the efforts of others; the token may lose all of its value. It confers no ownership, revenue, governance, or other rights, and no utility is promised. Do your own research, understand the risks of Pump.fun and Solana tokens, and comply with the law where you live. Only spend what you can afford to lose.

03 · Get Started

Run your own fly

The whole system is open source under the MIT license: connectome build, data ingest, training, the trading runner, and the operator console. It runs on a single Mac.

You will need

  • A Mac with Apple SiliconThe brain runs on the Metal GPU through PyTorch. M-series with 32 GB or more is comfortable.
  • Python 3.13 and uvuv installs everything else. No other runtime is required.
  • PostgreSQLLocal database for the tape, decisions, fills, and brain snapshots. Homebrew's works.
  • A Helius API keyStreams swaps and resolves transactions. The free developer tier is enough to watch.
  • A Solana wallet (optional)Only for live trading. The bot creates its own; you fund it with what you are willing to lose.
  • PatienceThe connectome build downloads about 100 MB of FlyWire data and the first training run takes hours.

Steps

  1. Clone and install

    git clone https://github.com/bryceweiner/fly-trader.git
    cd fly-trader
    uv sync
  2. Configure

    Copy the template and paste your Helius key. Leave LIVE_ENABLED=0; paper books run by default.

    cp .env.example .env
  3. Create the database

    createdb fly_trader
    uv run fly-trader init-db
  4. Build the brain

    Downloads the FlyWire export, checks it against the published neuron and edge counts, and writes the connectome artifact.

    uv run fly-trader build-connectome
  5. Open the console

    One Streamlit app starts and supervises every worker: discovery, capture, training, and the trading runner. Nothing runs outside it.

    uv run fly-trader ui

    Then open http://localhost:8501, start the discover and capture workers, and let the tape fill for a few hours before training.

  6. Train, then trade on paper

    Build a dataset from the captured tape and train the policy from the Training tab or the command line. Promote the checkpoint you like. Watch the paper books before you consider anything else.

    uv run fly-trader build-dataset
    uv run fly-trader train-policy
  7. Go live only if you mean it

    Create the bot wallet, fund it modestly, set LIVE_ENABLED=1 with your capital caps, and run the swap smoke test first. Every cap in the About section is enforced in code, and the kill switch is yours.

    uv run fly-trader wallet new
    uv run fly-trader swap-smoke --sol 0.01