Library / SDK
nftechie/stonkfly avatar
nftechie/stonkfly

Stonkfly: a fly-connectome simulation that can place Coinbase orders

A full retained fly-connectome simulation with experimental memory and guarded Coinbase AgentKit trading actions.

702 stars122 forksPythonMIT

At a glance

What is it?
Stonkfly wires a retained MaleCNS fly brain graph to Coinbase AgentKit actions, with engineered dopamine reinforcement and paper trading by default. The README is explicit that profitable learning has not been demonstrated.
Who is it for?
Stonkfly is for engineers who want a real connectome driving a real trading API surface, and who are comfortable reading docs/model.md before trusting any of the reinforcement claims. It is not for anyone expecting a profitable strategy, and not for anyone unwilling to fund a separate Coinbase Advanced portfolio with at most 100 USDC and an ECDSA key scoped to View + Trade with no Transfer.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 8 days ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 16, 2026, and from our analysis. They are not legal advice.

DEEP OPEN-SOURCE ANALYSIS

What Stonkfly actually simulates, and who the target reader is

Stonkfly is a Python package that drives a retained fly connectome from live public crypto prices and turns its output into Coinbase Advanced spot orders. The README describes the graph as MaleCNS v1.0: 166,700 neurons and 25.6 million connections. Sensory input is split between 3,335 brightness channels and 811 R8 color channels, fed from a public Coinbase price chart rendered as RGB. A fixed readout reduces that activity to three proposals: buy, sell or hold.

The audience is narrow. This is for someone who has already read a connectome paper, is comfortable with a C++17 build step, and wants to see a biological graph attached to a real order API rather than a toy backtest. The README sets expectations itself: profitable learning has not been demonstrated. Anyone looking for a trading system with an edge is in the wrong repository. Anyone curious about embodied neural simulation with a live execution path is in the right one.

Price chart to neurons to orders: the data flow

The loop has four stages. Public Coinbase prices are fetched and drawn into an RGB image. That image stimulates the 3,335 brightness inputs and 811 R8 color inputs of the MaleCNS graph. Spiking activity propagates through the 25.6 million connections, and a fixed readout maps the result to buy, sell or hold.

Execution is not done by the neural code directly. A custom Coinbase AgentKit ActionProvider sits between the readout and the exchange. It checks limits and places spot orders through Coinbase Advanced. That separation matters: the connectome proposes, the ActionProvider disposes. Limits such as the $10 maximum order including reserved fees, 24 attempts per day, and no shorts or leverage live in the guarded action layer, not in the network.

The learning claim is the part to read carefully. Positive portfolio P&L stimulates 15 identified PAM11 dopamine cells; negative P&L stimulates two PPL101 aversive dopamine cells. A candidate memory rule then changes existing KC-to-MBON connections. The README calls these engineered reinforcement signals and explicitly says they are not modeled pain receptors. It also says synaptic changes do not establish that the fly learns to trade profitably. Treat the plasticity as an experiment with a documented mechanism, not as a demonstrated result.

Installing Stonkfly and running a first paper session

Requirements are Python 3.11, a C++17 compiler, and macOS or Linux. The README recommends 16 GB of RAM and warns that the dataset and dependencies need several GB. There are no published releases, so installation is from the repository itself with an editable install, which also pulls the test extra.

bash
python3.11 -m venv .venv
source .venv/bin/activate
pip install -e '.[test]'
python -m stonkfly prepare
python -m stonkfly run

The prepare step fetches and lays out the connectome data; run starts the simulation. The defaults are paper trades on real public BTC-USDC data with a $100 simulated balance, and no API key is required. Logs, sensory images and resumable brain state land in runs/paper/. Ctrl-C stops the process, and the same command resumes from the saved state rather than starting over.

Once it is running, status reports the current state and pytest exercises the test suite.

bash
python -m stonkfly status
python -m pytest -q

If you later want live orders, the README's sequence is to create a dedicated Coinbase Advanced portfolio funded with at most 100 USDC, generate a portfolio-scoped ECDSA key with View + Trade and no Transfer permission, copy .env.example to .env, and fill in COINBASE_KEY_FILE and COINBASE_PORTFOLIO_ID. Live mode also needs STONKFLY_LIVE set to the exact opt-in string, and the CLI flag. The README's own order is preflight first, then live:

bash
python -m stonkfly run --live --preflight-only
python -m stonkfly run --live

Preflight is the step that catches a misconfigured key or portfolio before any order is attempted. Skipping it is the fastest way to get an avoidable failure.

The drawdown stop does not do what the name suggests

The clearest limitation is stated in the README rather than hidden: a $20 drawdown stops new orders, and it does not liquidate holdings or cap further losses. That is a circuit breaker on new activity, not a risk limit on the position. If the market moves against an open spot position after the stop triggers, the loss continues to accumulate while the system sits idle. Anyone who reads "drawdown stop" as protection against loss size will be surprised.

The second limitation is the learning claim itself. Engineered dopamine stimulation tied to P&L is a plausible experimental design, but the README is careful to say that synaptic changes do not establish profitable trading. A candidate memory rule that modifies KC-to-MBON connections is a mechanism, not evidence of an edge. There is no benchmark in the repository showing the fly beating a baseline, and the description says profitable learning has not been demonstrated.

The third is operational. The connectome is large, the data footprint is measured in gigabytes, and the build needs a C++17 toolchain. This is not a package you install on a small CI runner to check a strategy idea. It is closer to a research rig with a trading API attached.

How Stonkfly differs from a conventional agent framework

The obvious alternative is a standard LLM agent stack built on the same Coinbase AgentKit, where a language model reads market data and emits tool calls. The difference is the decision layer. In an LLM agent, the policy is a prompt and a model checkpoint, and the interesting engineering is in tool schemas, guardrails and evaluation. In Stonkfly, the policy is a fixed readout over a 166,700-neuron graph, and the interesting engineering is in the sensory encoding and the dopamine wiring.

That changes what you can debug. With an LLM agent you can inspect the prompt and the tool call. With Stonkfly you inspect sensory images in runs/paper/, brain state files, and the ActionProvider's limit checks. It also changes what you can claim. An LLM agent's behaviour is described in natural language; Stonkfly's is described in terms of identified cell types (PAM11, PPL101) and connection-level changes. If your goal is an auditable decision trace in words, the connectome path is the harder one. If your goal is a biologically grounded controller, the LLM path gives you nothing comparable.

Both share the same execution surface, so the guardrails are comparable: order size caps, daily attempt limits, and no shorts or leverage. The choice is about the controller, not the exchange plumbing.

Maintenance cost, licence and what to check before funding anything

The project is MIT licensed, with a THIRD_PARTY.md file at the repository root for dependency attribution. The MIT terms cover the Stonkfly code; the connectome dataset and the pinned dependencies (coinbase-agentkit, coinbase-advanced-py, numpy, pandas, pyarrow, Pillow, pydantic, python-dotenv) carry their own licences, which THIRD_PARTY.md is the place to read. Nothing here is legal advice, but if you plan to redistribute or run this commercially, that file and the MaleCNS data terms are the two things to check.

Maintenance is a real consideration. The last push was on 2026-09-10, and there are no retrieved releases, so upgrades arrive as commits rather than versioned artifacts. The dependency pins are exact (coinbase-agentkit==0.7.4, numpy==2.4.6, and so on), which makes reproducible installs easier but means moving forward requires editing pyproject.toml yourself. There is no documented upgrade path in the README.

Before spending anything, verify that prepare completes and that the MaleCNS files resolve, either from the default location or via STONKFLY_DATA. Then run preflight against your own key. Only after both succeed should you consider the live command.

Editorial conclusion

Stonkfly is for engineers who want a real connectome driving a real trading API surface, and who are comfortable reading docs/model.md before trusting any of the reinforcement claims. It is not for anyone expecting a profitable strategy, and not for anyone unwilling to fund a separate Coinbase Advanced portfolio with at most 100 USDC and an ECDSA key scoped to View + Trade with no Transfer. Verify three things first: that prepare completes and the MaleCNS graph files are where STONKFLY_DATA points, that run --live --preflight-only passes against your own key, and that you accept that the $20 drawdown stop blocks new orders without liquidating existing holdings.

Frequently asked questions

Does Stonkfly need a Coinbase API key to run?

No. The default mode is paper trades on real public BTC-USDC data with a $100 simulated balance, and the README says no key is needed. Live execution requires your own local credentials and explicit opt-in.

What permissions should the Coinbase API key have for Stonkfly?

The README asks for a portfolio-scoped ECDSA key with View + Trade and no Transfer permission, scoped to a dedicated Coinbase Advanced portfolio funded with at most 100 USDC.

Can Stonkfly resume after being stopped?

Yes. The README states that Ctrl-C stops it and the same run command resumes, using resumable brain state stored in runs/paper/.

Does the $20 drawdown stop limit losses on Stonkfly?

No. The README says a $20 drawdown stops new orders, but it does not liquidate holdings or cap further losses.

Official sources

  1. Issues
  2. License: MIT
  3. nftechie/stonkfly on GitHub
  4. README
Community notes

Community notes