Skip to Content
DocumentationExamplesDelta-Neutral BTC Trader

Delta-Neutral BTC Basis Trader

A complete reference agent ships with the repo at examples/delta-neutral-btc/. It captures the positive basis between BTC spot and perpetual futures while staying delta-neutral.

This is the canonical example used in unit tests, evaluation runs, and the forge eval-pack smoke test.

Strategy in plain English

Buy spot BTC. Short BTC perp at the same notional. When the futures-spot spread (basis) is wide and the funding rate favors shorts, you collect both the spread carry and the funding payments. Unwind when basis tightens or volatility spikes.

The agent has zero directional exposure to BTC price — it only profits from the convergence between two BTC instruments.

Why this is a good example

  • Two-sided execution — every action requires both a spot leg and a perp leg
  • Real risk management — exposure caps, unwind triggers, halt conditions
  • Multi-source data — spot price + funding rate + basis spread
  • Production scenarios — baseline, volatility unwind, exposure breach, stale data halt

What’s in the example directory

FilePurpose
agent-spec.jsonContract: name, summary, owners, promotion path
capability-manifest.json6 declared capabilities (market data, exchange order, balance, memory)
policy-bundle.jsonNotional caps, allowed venues, halt rules
scenario-pack.json4 evaluation scenarios
scaffold.manifest.jsonProject structure
research-record.jsonSlow-mode autoresearch findings
promotion-record.jsonSandbox → paper → canary promotion record

Capabilities declared

CapabilityKindRiskEffect
cap-market-btc-pricedata-sourcelowFetch BTC spot price
cap-market-basisdata-sourcelowFetch perp-spot basis spread + funding rate
cap-exchange-balancedata-sourcelowRead exchange account balances
cap-exchange-orderexchange-actionhighPlace/cancel orders (requires approval in live)
memory.readdata-sourcelowRead prior decisions
memory.writetoollowPersist tick summaries

Test scenarios

ScenarioWhat it tests
scen-baseline-basis-wideHappy path — basis 30+ bps, agent enters position
scen-volatility-unwindVol spikes — agent unwinds before stop-out
scen-policy-exposure-breachTries to exceed notional cap — must be denied by policy gate
scen-stale-data-haltPrice feed stale > 60s — agent halts

Run it yourself

Validate the spec

forge validate examples/delta-neutral-btc/ # Validated 5 artifacts in examples/delta-neutral-btc/

Run scenario evaluations

forge eval-pack examples/delta-neutral-btc/ # Scenario pack: total=4 matched=4 pass=3 hold=1 fail=0

Use it as a starting point

The simplest path to your own basis trader:

# Copy the example cp -r examples/delta-neutral-btc/ ./my-basis-trader # Edit the strategy parameters vim my-basis-trader/policy-bundle.json # notional caps vim my-basis-trader/scenario-pack.json # your test cases # Provision a real wallet forge wallet-create --name basis-trader # Validate everything forge validate my-basis-trader/ # Paper trade forge run my-basis-trader --environment sandbox --mode paper --auto-approve

Promotion record

This example has already been promoted through the full pipeline (recorded in promotion-record.json):

sandbox → paper → canary-live ✓ ✓ ✓

Each promotion required:

  • All scenarios passing
  • Policy compliance verified
  • Approver sign-off
  • Scenario replay evidence

This is the reference for what a “production-ready” agent looks like in Aether Forge.

Last updated on