BTC Dip Buy Walkthrough
This example (examples/btc-dip-buy) is a docs-first strategy lifecycle demo.
npx tsx examples/btc-dip-buy/demo.ts- Load YAML strategy
- Parse and validate with
parseStrategyFromYaml - Start
StrategyEngine - Observe watch, action, and conditional step transitions
- Print final execution state
import { readFile } from 'node:fs/promises';import { parseStrategyFromYaml, type Strategy } from '@stendar/core';
const strategyYaml = await readFile('./strategy.yaml', 'utf8');const strategy: Strategy = parseStrategyFromYaml(strategyYaml);The demo uses a mocked runtime to keep iteration local and deterministic.
Event stream to expect
Section titled “Event stream to expect”strategy:startedstrategy:step_startedstrategy:step_completedstrategy:completed
When adapting this to live execution, swap in real runtime adapters/providers as shown in First strategy.