darwinia

darwinia is a skill for Claude Code, Codex from 0xSanei/darwinia. It costs 36 tokens per session (1,372 once invoked), scanned A, original, MIT.

A Python system evolves cryptocurrency trading strategies with genetic algorithms, an approach that keeps and combines better-performing candidates over repeated rounds, then tests them against difficult market conditions.

In plain words
What is it for?
Use it to evolve or optimize trading strategies, run adversarial stress tests, inspect results as JSON, or open the interactive dashboard.
Why use it?
It provides a way to search for strategies and expose weaknesses such as fake breakouts, sudden losses, and whipsaws in historical Bitcoin data.

Skill for Claude CodeCodex

Which agent this was written for is unclear — built for openclaw. Also seen: built for openclaw.

Good fit Use it to evolve or optimize trading strategies, run adversarial stress tests, inspect results as JSON, or open the interactive dashboard.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/0xsanei/darwinia/openclaw
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add 0xSanei/darwinia --skill openclaw
Clone the repo
git clone --depth 1 https://github.com/0xSanei/darwinia

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for darwinia

README.md
[![agentmods](https://agentmods.dev/badge/skills/0xsanei/darwinia/openclaw/github.svg)](https://agentmods.dev/skills/0xsanei/darwinia/openclaw)
Your own site
<a href="https://agentmods.dev/skills/0xsanei/darwinia/openclaw"><img src="https://agentmods.dev/badge/skills/0xsanei/darwinia/openclaw/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for darwinia

Your own site · 80×15
<a href="https://agentmods.dev/skills/0xsanei/darwinia/openclaw"><img src="https://agentmods.dev/badge/skills/0xsanei/darwinia/openclaw.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 36 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,372 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00036 $0.01372
Opus 5 $0.00018 $0.00686
Sonnet 5 $0.00007 $0.00274
Haiku 4.5 $0.00004 $0.00137

Measured 13d ago against content hash b831ce66793b, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

darwinia scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 13d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.openclaw/SKILL.md · 180 lines

How it starts

The opening of the file, as written. The whole thing — 180 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Darwinia — The Self-Evolving Agent Ecosystem

Darwinia evolves trading strategies through natural selection. 50 agents compete on real BTC market data, the weak die, the strong breed. After 50 generations, survivors handle rug pulls, fake breakouts, and whipsaws — because agents that couldn't survive didn't reproduce.

When to use this skill

  • User asks to "find a good trading strategy" or "optimize trading parameters"
  • User wants to stress-test a strategy against adversarial market conditions
  • User asks about genetic algorithms applied to trading
  • User wants to discover market patterns automatically
  • User says "evolve", "darwinia", "genetic trading", or "adversarial test"

Commands

Quick evolution (~30 seconds)

python -m darwinia evolve -g 10 --json

Full evolution with adversarial arena (~3 minutes)

python -m darwinia evolve -g 50 --json

Test champion against 6 attack types

python -m darwinia arena --json

System info

python -m darwinia info --json

Interactive dashboard

python -m darwinia dashboard

Always use --json when calling programmatically.

Interpreting results

Key JSON fields after evolve --json:

  • champion.fitness: Risk-adjusted score. >1.0 = outperforms buy-and-hold.
  • champion.genes: 17 floats [0,1] encoding the full trading strategy.
  • evolution_summary.patterns_discovered: Number of emergent trading rules found.
  • patterns: Emergent trading rules discovered by agents (not pre-programmed).

How to explain results to user

  • Fitness > 1.0 → Champion outperforms buy-and-hold on risk-adjusted basis
  • High genetic diversity → Population hasn't converged yet, more generations may help
  • Discovered patterns → Trading rules the agents found on their own

Installation

git clone https://github.com/0xSanei/darwinia.git
cd darwinia
pip install -e ".[dev]"

No API keys. No cloud. Pure Python + numpy. BTC/USDT 1h data (10,946 candles) included.

Read the full file on GitHub · 180 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 13d ago First seen · 180 lines · 36 tokens per session scan A b831ce66793b

Subscribe to this mod's changes

darwinia is a skill published in the GitHub repository 0xSanei/darwinia (87 stars, last pushed 5mo ago), licensed MIT. It adds 36 tokens to every session and 1,372 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.