Building your own

Write a strategy from scratch. Start with the trade, write the playbook, state your limits in prose, plug in extra context only when you need it.

Writing a strategy is mostly an exercise in being precise about what you want.

There's no template you have to follow, no fixed indicator list, no mode of operation. The shape below is a strong default, not a requirement.

Start with the trade

Before you write a single file, write one sentence:

I want to fade extreme funding on liquid perps, except in vol spikes.

If you can't say what you're trying to do in one sentence, you're not ready to configure the bundle. Once you have it, you'll express the idea across two files (sometimes three).

  • STRATEGY.md is the playbook the agent reads — the whole strategy, in prose.
  • strategy.yaml is identity: name, version, author wallet, and marketplace metadata.
  • tools.yaml and endpoints.yaml are optional. Add them when your thesis depends on context the agent can't already see.

The playbook

The playbook is what the agent reads the way a junior trader reads a senior trader's notes. Be concrete; specifics beat generalities. The starter template Engine ships uses this scaffold — a strong default, not a requirement:

  • Mandate. What the strategy does and doesn't do; its temperament.
  • Universe. Which markets, and why they fit the edge.
  • Entry setups. The conditions to engage, and the independent confirmations each one needs.
  • Sizing and risk. How big, at what leverage, how many positions at once, when to stop adding.
  • Position management. Adds, trims, trails — the trade's lifecycle once it's on.
  • Exit doctrine. What invalidates the thesis; when to take profit or cut.
  • Time horizon. How long you expect to hold.
  • Abstain when. The regimes and conditions where you sit out.

But the playbook is just prose. Write whatever you want, in whatever order — the agent reads the whole file and applies all of it. Be specific where specificity matters; lean on judgment where judgment matters. Lead with conditions, not opinions: "Skip during a volatility spike and reassess after an hour" is stronger than "don't trade choppy markets."

The config

strategy.yaml is identity only — name, slug, your author wallet, version, a one-line description, capacity, and tags. It's what the marketplace shows; no trading logic lives here.

Everything about how to trade — universe, risk limits, default exits, how selective to be — goes in STRATEGY.md as prose. There's a reason for that:

Engine doesn't turn your playbook into hard rails. The agent reads your prose and trades in its spirit, applying judgment tick to tick. The limits you write are guidance it respects, not clamps the platform imposes. The only hard limits are your allocation size (the real cap on exposure) and a handful of platform breakers that halt trading entirely: a drawdown trip, a revoked agent key, or a paused allocation.

So write your risk posture plainly in the playbook — "cap any single position at 4% of NAV, never run more than 2x leverage, step away after a 3% daily loss" — and the agent holds to it. If a constraint matters, say it clearly; tighter prose is how you get tighter behavior. There's no minimum-conviction setting and no per-field risk engine to fall back on, so the playbook is where your discipline lives.

Extend the agent's world

The agent already sees a rich snapshot of every market in your universe: price, funding, basis, open interest, depth, realized volatility, regime tags, plus account state, recent fills, and retrieved memory. For many strategies, that's all the input you need.

When your thesis depends on context Engine doesn't surface by default, you have three ways to plug it in.

Custom data sources are always-on. Declare HTTPS feeds in endpoints.yaml. Engine polls them on a schedule (you set the TTL, anywhere from one second to one hour) and merges the returned numeric identifiers into the agent's view of every market. Use this for signals the agent should always have available: a proprietary regime score, a custom sentiment index, an on-chain flow metric you've spent years building. Up to 6 feeds per strategy, up to 4 identifiers each, bearer auth via env-var-named secret.

Tools are on-demand. Declare HTTPS endpoints in tools.yaml with a description, a JSON Schema for inputs, and an optional output schema. Engine registers them with the agent alongside its built-in tools. The agent calls them by name only when a setup is close enough to justify the latency. Use this for things you don't want to pay for every tick: news headlines, a deeper liquidity report, a custom analyst model, a private backtest service. Up to 16 tools, any HTTPS method (GET/POST/PUT/PATCH/DELETE), bearer auth.

References hold long-form depth. Drop markdown files into a references/ folder. The agent lazy-loads any of them on its own when a setup needs more than the main playbook covers. Use this for regime playbooks, market-specific tactics, sizing matrices, post-mortems — material that would bloat the everyday prompt if it were always loaded. Up to 64 reference files, 64KB each.

You can also organize the bundle with author-named subfolders for whatever else you want to ship alongside (notes, helper scripts, configuration JSON). Bundle limit is 64 files, 1MB total.

Secrets never live in the bundle. You reference an env-style name in your config, and the actual value sits in Engine's strategy secrets panel.

A complete example

A compact bundle:

strategy bundle
STRATEGY.md
-----------
# Funding Harvester

Trade against extreme negative funding on liquid perps when open interest
confirms that shorts are still crowding in. When leveraged shorts are crowded,
the basis mean-reverts and we collect the unwind.

## Mandate
Selective and patient — most checks end in no trade. Act only when funding is
genuinely stretched and structure confirms the crowd, never on funding alone.

## Universe
BTC-PERP, ETH-PERP, SOL-PERP, and HYPE-PERP — the deepest perps, where the
crowding signal is clean and the unwind is tradable.

## Entry Setups
A crowded-short fade needs three things together:
- Funding deeply negative and sustained (below about -100bps/hr for 2+ hours).
- Open interest rising into the move, not falling.
- Realized volatility normal — not in cascade mode.

## Sizing and Risk
Size in margin: about 5% of NAV at 2x leverage, halved when one condition is
marginal. Stop ~1.2%, target ~2%, with the stop placed where the crowding
thesis is invalidated. Daily loss budget ~3%; step away once it's spent.

## Position Management
Hold while funding stays stretched and structure holds. Trail the stop only
after the trade has protected entry.

## Exit Doctrine
Take profit when funding mean-reverts toward zero or price squeezes into
resistance. Exit when the crowding thesis is gone — not on proximity to the stop.

## Time Horizon
Short — hours to a day or two. This is an event around positioning, not a
position to carry.

## Abstain When
- A volatility spike or a macro event window — reassess in an hour.
- Funding is extreme but realized vol is also extreme (directional flow, not crowding).
- The book is thin or signals conflict.

strategy.yaml
-------------
name: funding-harvester
slug: funding-harvester
author: "0x4f2a000000000000000000000000000000000001"
version: 1.0.0
description: Fade crowded negative funding on liquid perps when OI confirms shorts are still piling in.
capacity_usd: 500000
tags: [funding, mean-reversion, crypto]

Best practices

Write to a trader, not a parser. The agent reads the playbook as prose. If a sentence wouldn't make sense to a human, it won't make sense to the agent.

Be specific where it counts. "Funding is extreme" is vague. "Funding below -100bps and falling for 2+ hours" is actionable.

Always have an abstain path. A strategy that doesn't say when to sit out will force trades in regimes it doesn't understand.

State your limits plainly. Engine enforces your allocation size and a few safety breakers; everything else is the agent applying your playbook. So if a constraint matters, write it clearly and unambiguously — that's how it holds.

Iterate. First drafts are wrong in surprising ways. After a few days, look at the agent's decisions. Where did it abstain? Where did it size up? That tells you what to tighten or relax.

What's next

See How strategies work for the model behind a bundle.