# Stonkfly's $20 drawdown stop halts new orders and does nothing else

> A fly connectome simulation that maps public Coinbase prices onto a retained MaleCNS graph and reads a fixed buy, sell or hold signal, with a custom Coinbase AgentKit action provider behind two opt-in gates. The project says plainly that profitable learning has not been demonstrated, and its own risk note admits the stop does not liquidate holdings or cap further losses.

**nftechie/stonkfly** — A full retained fly-connectome simulation with experimental memory and guarded Coinbase AgentKit trading actions.

- Repository: https://github.com/nftechie/stonkfly
- Stars: 864 · Forks: 161
- Language: Python
- License: MIT
- Published: 2026-09-17 · Updated: 2026-09-17 · Language: en
- Canonical page: https://hysenlabs.com/projects/nftechie-stonkfly

## The drawdown stop gates order entry, not exposure

The risk controls are stated in the same sentence as the limit they do not cover:

> A $20 drawdown stops new orders; it does not liquidate holdings or cap further losses.

So the stop is an entry gate. Once a position is open, nothing in that sentence closes it, and the project says outright that further losses are not capped. A price gap against an open spot position is exactly the case a fixed dollar trigger does not cover, and with direction limited to spot the exposure is at least capped by whatever capital sits in the portfolio.

The other defaults sit in the same paragraph and are the sensible ones: a $10 maximum order including reserved fees, 24 attempts per day, and spot only with no borrowing and no derivatives. So a single order cannot be large, the order count is bounded, and the direction is spot only.

Read together, the risk profile is: bounded frequency, bounded size, uncapped exit. If the goal is to test the Coinbase integration rather than to hold assets, the portfolio being small is what actually bounds the damage, not the stop. The page also names where the detail lives, with operation and recovery written up separately in `docs/operations.md`.

## Live mode needs two independent opt-ins and a portfolio-scoped key

The credentials and the flags are arranged so that no single mistake reaches the exchange. The environment example states the rule in a comment: live mode requires both the exact opt-in value and the command line flag.

```
COINBASE_KEY_FILE=coinbase-key.json
COINBASE_PORTFOLIO_ID=
# Live mode requires both this exact opt-in and the --live CLI flag.
STONKFLY_LIVE=I_ACCEPT_REAL_TRADES
```

Because the opt-in is a specific string rather than a boolean, a missing or misspelled value fails rather than enabling anything. And because the flag is also required, having the file alone is not enough.

The key handling is the part worth copying. `.env` holds a path, not a secret, with the comment to keep the key file outside git. The recommended key is portfolio-scoped ECDSA with View and Trade and explicitly no Transfer, so even a compromised process cannot move funds out of the portfolio it was issued for. The recommendation is a dedicated Advanced portfolio funded with at most 100 quote-currency units.

The run sequence adds a dry step before the real one, `python -m stonkfly run --live --preflight-only` followed by `python -m stonkfly run --live`, so the environment can be checked without sending an order. The page closes with the line that matters most for a first-time reader: the repository does not come funded or connected to anyone's account.

## The decision is a fixed readout over a retained connectome

The substrate is specific. Public Coinbase prices become an RGB chart, which stimulates 3,335 brightness inputs and 811 R8 color inputs in a retained MaleCNS v1.0 graph of 166,700 neurons and 25.6 million connections. From there a fixed neural readout proposes buy, sell or hold, and a custom Coinbase AgentKit ActionProvider checks limits and places spot orders through Coinbase Advanced.

The word fixed is the load-bearing one. The action is not a policy learned end to end; it is a readout that produces one of three proposals, and what is allowed to change is a single candidate memory rule acting on existing KC-to-MBON connections. So the system's adaptive component is narrow and bounded, which is consistent with the project's own statement that synaptic changes do not establish that it learns to trade profitably.

Two consequences follow for anyone evaluating it. Comparing a fixed readout against a trained policy is not a like-for-like test, and a graph of that size is a substantial artifact to verify, which is why the environment file carries an optional `STONKFLY_DATA=data` setting for the location of verified MaleCNS files and the page asks for several GB of disk and 16 GB of RAM.

## Fifteen reward cells and two aversive cells, engineered rather than modeled

The reinforcement wiring is described at cell resolution. Positive portfolio profit and loss stimulates 15 identified PAM11 dopamine cells, and negative portfolio profit and loss stimulates two PPL101 aversive dopamine cells. A candidate memory rule then changes existing KC-to-MBON connections.

What the project is careful about is the interpretation. The text states that these are engineered reinforcement signals and not modeled pain receptors. That is a claim about the model, not a claim about biology, and the distinction is the one that matters: a cell named after a Drosophila dopamine receptor is being used as a signal label in a simulation, and the page says so rather than inviting the other reading.

The same care shows in the opening line, which says profitable learning has not been demonstrated, and again at the end of the mechanism paragraph, which says synaptic changes do not establish that it learns to trade profitably. Two disclaimers on a short page is a deliberate choice, and it is the reason this is safe to describe as an experiment rather than as a strategy.

The evidence and modelling detail is not on that page at all. It is pointed at a separate document, `docs/model.md`, which is where the claims behind the cell assignments and the connection counts would have to be checked.

## Paper mode is the default and uses real prices with a simulated balance

The default run needs no key, no account and no money. It is described as paper trades on real public BTC-USDC data with a $100 simulated balance. The distinction is worth holding onto: the price feed is genuine, so the visual input, the dopamine stimulation and the order-sizing logic all see actual market movement, while only the balance is invented.

That makes the default path a real test of everything except settlement. A bug in chart construction, in the connectome update loop, or in the limit checks inside the action provider will show up against live prices, which a synthetic feed would not reproduce.

State handling is explicit. Local logs, sensory images and resumable brain state go into `runs/paper/`. So the simulation persists rather than restarting, and Ctrl-C stops the process while the same command resumes it. For a system with 166,700 neurons and 25.6 million connections, being able to stop and continue without losing the run is what makes it workable at all.

Two more commands complete the loop. `python -m stonkfly status` reports state, and `python -m pytest -q` runs the suite, which the packaging configures against a `tests` directory.

## Every runtime dependency is exactly pinned and the build system declares no compiler

The dependency list is entirely exact:

```
coinbase-agentkit==0.7.4", "coinbase-advanced-py==1.8.4",
  "numpy==2.4.6", "pandas==3.0.5", "pyarrow==25.0.1", "Pillow==12.3.0",
  "pydantic==2.13.5", "python-dotenv==1.2.3"
```

No lower or upper bounds, just `==` on all eight, with the test extra pinning `pytest==9.1.1`. For a project that places real orders, that is the right trade: a run is reproducible, and a Coinbase SDK patch release cannot change behaviour between a paper run and a live one. The cost is that every one of those pins has to be bumped by hand, and two of them are the exchange integration where a change matters most.

The build declaration is thinner than the prerequisite. The build system requires `setuptools>=80` and nothing else, and the native sources travel as package data rather than as a declared extension:

```
[tool.setuptools.package-data]
"stonkfly.neural" = ["*.cpp", "*.json"]
```

Yet the run instructions ask for a C++17 compiler. So the C++ is compiled somewhere outside the declared build pipeline, most likely during the prepare step, and a reader looking at the packaging metadata alone would not learn that a compiler is required. The `prepare` command between install and run is the undocumented piece of that sequence.

## The install is an editable one on a named interpreter, and the console script goes unused

The setup is five commands, and the interpreter is named explicitly:

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

The `python3.11` in the first line is not incidental. The package requires 3.11 or newer, and the platform is stated as macOS or Linux, so there is no Windows path here. The install is editable and includes the test extra, which makes the documented setup a development configuration rather than a clean one, and that is consistent with a project whose instructions begin with running a test suite.

The package also declares a console entry point, `stonkfly = "stonkfly.cli:main"`, so `pip install` produces a `stonkfly` command. Every command on the page instead uses `python -m stonkfly`, including the preflight and the status call. Both work, but the documented form is the module invocation, which is the one that behaves the same whether or not the script landed on your path.

The remaining structure is small and pointed. `AGENTS.md` and `THIRD_PARTY.md` sit beside `LICENSE` and `pyproject.toml`, and the substantive detail is delegated to two documents, `docs/model.md` for the model and its evidence and `docs/operations.md` for operation and recovery. A workflow directory exists for continuous integration. There are no GitHub releases, the project version is 0.1.0, and the last push is dated 2026-09-10, so cloning and installing is the only route the page describes.

One last detail, since it explains the project's visibility: the name collides in search with a fictional insect from a children's cartoon, and the related queries are all about that character rather than about this repository.

## Conclusion

Read this as a simulation with a small, well-scope-limited live mode attached, not as a trading system. Two things decide that. The repository states in its opening line that profitable learning has not been demonstrated, and repeats that synaptic changes do not establish it, so nothing here should be read as evidence of edge. And the risk control it advertises is a circuit breaker on order entry, not on exposure: a $20 drawdown stops new orders while positions stay open, so a gap in the market or a position that keeps moving leaves the loss uncapped. What the design does get right is the blast radius. Live mode needs both an environment token and a command line flag, the key is portfolio-scoped with View and Trade but no Transfer, the portfolio is recommended to hold at most 100 USDC, and the credential lives in a file the git ignore is meant to cover. Run the paper path first, and treat the live path as a way to test the plumbing rather than to make money.

## FAQ

### Does stonkfly place real trades by default?

No. The default is paper trades on real public BTC-USDC data with a $100 simulated balance, and no key is needed. Real orders require both an environment value of I_ACCEPT_REAL_TRADES and the --live flag, and the repository does not come funded or connected to any account.

### What happens when stonkfly hits its $20 drawdown limit?

It stops placing new orders. The page states explicitly that the limit does not liquidate holdings and does not cap further losses. The other defaults are a $10 maximum order including reserved fees, 24 attempts per day, and spot only with no borrowing and no derivatives.

### What Coinbase API permissions does stonkfly ask for?

A portfolio-scoped ECDSA key with View and Trade and no Transfer permission, pointed at a dedicated portfolio funded with at most 100 quote-currency units. The environment file holds only a path to the key file, with a comment to keep that file outside git.

### How large is the neural graph stonkfly runs?

The retained MaleCNS v1.0 graph is described as 166,700 neurons and 25.6 million connections, stimulated by 3,335 brightness inputs and 811 R8 color inputs derived from an RGB chart of public Coinbase prices. A fixed neural readout proposes buy, sell or hold.

### Has stonkfly been shown to trade profitably?

No, and the project says so in its opening line: profitable learning has not been demonstrated. It also states that the reward cells are engineered reinforcement signals rather than modeled pain receptors, and that synaptic changes do not establish that it learns to trade profitably.

### What does installing stonkfly require?

Python 3.11 or newer, a C++17 compiler, and macOS or Linux, with several GB of disk and 16 GB of RAM recommended. The documented sequence creates a venv with python3.11, installs with `pip install -e '.[test]'`, then runs `python -m stonkfly prepare` before `python -m stonkfly run`.

## Sources

- [Issues](https://github.com/nftechie/stonkfly/issues)
- [License: MIT](https://github.com/nftechie/stonkfly/blob/main/LICENSE)
- [nftechie/stonkfly on GitHub](https://github.com/nftechie/stonkfly)
- [README](https://github.com/nftechie/stonkfly/blob/main/README.md)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/nftechie-stonkfly
