Downloads · 30 days
0
bryceweiner/fly-trader
fly-trader is a reinforcement learning model from bryceweiner. Use it for the reinforcement learning task on the model card, and read the license before you ship it in a product. It is set up for pytorch. The card lists the license as mit.
A fruit-fly connectome that trades Solana memecoins with your money.
Downloads · 30 days
0
Access
Public
Updated Sep 24, 2026
Repo size
698 MB
Likes
0
Public
Click a slice to open those files.
.parquet613 MB · 93%
From the Hugging Face model README
A fruit-fly connectome that trades Solana memecoins with your money.
⚠️ Read this first
This software signs real transactions from a wallet you fund. It buys tokens that graduated from pump.fun, holds them for about two hours, and sells. It can lose everything in that wallet, quickly. The model was trained on a few months of data; the market it trades is adversarial and changes. Nothing here is a claim of profit, and nothing here is financial advice. Run it only with money you can lose entirely, on a wallet used for nothing else. MIT licence — no warranty of any kind. See LICENSE.
This is the ready-to-run branch: the trading engine, its console, a trained fly, the selector that taught it, and the
connectome they run on. The training pipeline lives on master.
git clone -b distribution https://github.com/bryceweiner/fly-trader.git && cd fly-trader
.env and paste the two API keys into it:
cp .env.example .env
docker compose up -d --build
The first start builds the image (several minutes), creates the database, installs the models and starts the market
feed and the trading engine..env:
docker compose exec fly fly-trader wallet new
Back up .env now. It is the only copy of that key.docker compose restart fly
That is all. From here it runs on its own. The first ~24 hours are a warm-up (it needs a day of candles before it scores anything); then it trades paper until 20 trades have closed; then it trades the wallet.
| Want to | Do |
|---|---|
| See what it is doing | http://localhost:8501 — Overview (books, open positions, wealth), Trades, Safety & wallet (rails, wallet), Processes |
| Pause new entries | Safety & wallet → Pause entries, or docker compose exec fly fly-trader pause-entries |
| Clear a tripped kill switch | Safety & wallet → Clear kill switch, or docker compose exec fly fly-trader reset-circuit --kill (re-bases the peak) |
| Stop everything | docker compose down — open positions stay open in the wallet; start again and it sells them on schedule, or sell them yourself |
| See the logs | docker compose logs -f fly |
| Start again from nothing | docker compose down -v (deletes the database) and delete data/ |
The console listens on 127.0.0.1 only. Do not expose it: it can start and stop the engine and clear the rails.
| Path | What |
|---|---|
models/policies/fly_*.pt | the fly (brain_snapshots #62): taught by selector #59, two strategies (ev, capitulation), 120-minute hold, its own buy lines |
models/selectors/selector_*.joblib | the selector that taught it (#59), kept so the console can show the paper selector alongside |
models/connectome/ | the FlyWire FAFB v783 central brain as the fly runs on it (14 MB), with its calibrated scale |
models/wallet_skill/ | the fitted wallet-skill inputs: config.json (the horizon and lookback the model was trained with) and the name of the newest per-day table. The table itself (~300 MB) is on Hugging Face; the container fetches it once at first start |
seed/seed.sql | the database rows that admit the fly to trade: the model records, the passed replay verdict, autostart |
.env.example | every knob, set for 0.5 SOL |
docker-compose.yml, Dockerfile, docker/entrypoint.sh | one Postgres, one engine + console |
The fly's replay verdict shipped here: over the 28 evaluation days it made +1.52 % per trade after real costs (profit factor 1.13) against −5.27 % for random picks of the same tokens. That is a backtest on one corpus, not a forecast.
Edit .env, then docker compose restart fly. The ones that matter:
| Variable | Shipped | Meaning |
|---|---|---|
CAPITAL_SOL | 0.5 | what you funded; also the paper warm-up bankroll |
MAX_POSITION_SOL / MAX_POSITION_FRACTION | 0.05 / 0.10 | per-position caps (the smaller wins) |
GAS_RESERVE_SOL | 0.05 | never spent |
KILL_SWITCH_DRAWDOWN / KILL_SWITCH_LIQUIDATE | 0.20 / 1 | drawdown from peak that halts and sells everything |
HANDOVER_MIN_TRADES | 20 | closed paper trades before it goes live |
LIVE_ENABLED | 1 | set 0 to run paper only |
Scaling the wallet up scales the position caps with it (MAX_POSITION_FRACTION), but MAX_POSITION_SOL is a hard
ceiling: raise it deliberately or not at all.
Optional. The CPU image trades fine; a GPU makes the once-a-minute scoring and the fly's learning a little faster. You need the NVIDIA driver (560 or newer) and the NVIDIA Container Toolkit on the host; then start with the CUDA override instead of the plain command in step 3:
docker compose -f docker-compose.yml -f docker-compose.cuda.yml up -d --build
The image is built with the CUDA 12.6 torch wheel (TORCH_INDEX: cu126 in docker-compose.cuda.yml; cu130 for the
newest drivers) and the container is given every GPU. DEVICE=auto in .env then resolves to the GPU; the console's
Model page shows which device the fly is on. Batch sizes are derived from the card's free memory, so an 8 GB card works;
on a shared card set DEVICE_MEMORY_GB in .env to what the fly may use.
The container keeps itself current. Every hour it asks Hugging Face whether
bryceweiner/fly-trader has a new release; when it has, it downloads
the new code and model, restarts (about a minute; the paper books, the fly's learned state and any open positions are
untouched -- open positions are sold on schedule by the restarted engine) and keeps the previous release beside the new
one. If the new release does not come up within five minutes it goes back to the previous one and never tries that
release again. docker compose logs -f fly shows what it did. AUTO_UPDATE=0 in .env turns this off; then the
"Refreshing the model" steps below are the manual way.
The model is a snapshot of one training run. To ship a newer one, on a master checkout with its database, after a
passed replay:
.venv/bin/python tools/make_seed.py --out dist
cp -R dist/models/* models/ && cp -R dist/seed/* seed/
Commit models/ and seed/ on this branch. The seed is idempotent: an install that already has these rows is not
changed by it, so pull the branch, docker compose up -d --build, and the new model is in place.
bryceweiner/fly-tradermaster): bryceweiner/fly-trader-seedFlyWire consortium, Dorkenwald et al., Neuronal wiring diagram of an adult brain, Nature 2024; annotations Schlegel et al. 2024; synapse signs Shiu et al. 2024. Connectome export: snedea/flybrain (MIT). Market data: PumpAPI; routing: Jupiter.
MIT.