| sim_ts | side | path | amount $ | price $ | cost % | realized $ | realized % |
|---|---|---|---|---|---|---|---|
| 2026-02-01 06:00:00 | BUY | E | $3000.00 | $78620.91 | 0.53% | — | — |
| 2026-02-01 07:00:00 | SELL | stop | $2956.18 | $78300.00 | 0.53% | $-43.82 | -1.46% |
| 2026-02-01 11:00:00 | BUY | E | $2986.85 | $78279.73 | 0.53% | — | — |
| 2026-02-01 12:00:00 | SELL | stop | $2972.79 | $78743.56 | 0.53% | $-14.06 | -0.47% |
| 2026-02-01 14:00:00 | BUY | E | $2982.64 | $78317.51 | 0.53% | — | — |
| 2026-02-01 15:00:00 | SELL | stop | $2947.11 | $78211.12 | 0.53% | $-35.52 | -1.19% |
| 2026-02-01 16:00:00 | BUY | A | $4953.30 | $77593.40 | 0.55% | — | — |
| 2026-02-01 17:00:00 | SELL | stop | $4892.80 | $77494.77 | 0.55% | $-60.50 | -1.22% |
| 2026-02-01 20:00:00 | BUY | E | $2953.83 | $77174.78 | 0.53% | — | — |
| 2026-02-01 21:00:00 | SELL | stop | $2919.92 | $77103.04 | 0.53% | $-33.91 | -1.15% |
| 2026-02-01 22:00:00 | BUY | E | $2943.65 | $76526.03 | 0.53% | — | — |
| 2026-02-01 23:00:00 | SELL | stop | $2940.09 | $77249.31 | 0.53% | $-3.56 | -0.12% |
| 2026-02-02 04:00:00 | BUY | E | $2942.59 | $76292.98 | 0.53% | — | — |
| 2026-02-02 05:00:00 | SELL | stop | $2896.30 | $75894.15 | 0.53% | $-46.29 | -1.57% |
| 2026-02-02 20:00:00 | BUY | E | $2928.70 | $78341.50 | 0.53% | — | — |
| 2026-02-02 21:00:00 | SELL | stop | $2885.47 | $78008.59 | 0.53% | $-43.23 | -1.48% |
| 2026-02-03 03:00:00 | BUY | E | $2915.73 | $77808.01 | 0.53% | — | — |
| 2026-02-03 04:00:00 | SELL | stop | $2920.00 | $78753.32 | 0.53% | +$4.27 | +0.15% |
| 2026-02-03 17:00:00 | BUY | E | $2917.01 | $76488.08 | 0.53% | — | — |
| 2026-02-03 18:00:00 | SELL | stop | $2826.91 | $74915.79 | 0.53% | $-90.10 | -3.09% |
| 2026-02-03 19:00:00 | BUY | E | $2889.98 | $73139.13 | 0.53% | — | — |
| 2026-02-03 20:00:00 | SELL | reversal | $2929.69 | $74935.00 | 0.53% | +$39.71 | +1.37% |
| 2026-02-03 23:00:00 | BUY | E | $2901.89 | $75708.83 | 0.53% | — | — |
| 2026-02-04 00:00:00 | SELL | stop | $2873.60 | $75770.21 | 0.53% | $-28.29 | -0.97% |
| 2026-02-04 08:00:00 | BUY | E | $2893.41 | $76514.30 | 0.53% | — | — |
| 2026-02-04 09:00:00 | SELL | stop | $2865.61 | $76587.26 | 0.53% | $-27.79 | -0.96% |
| 2026-02-04 11:00:00 | BUY | E | $2885.07 | $76302.10 | 0.53% | — | — |
| 2026-02-04 12:00:00 | SELL | stop | $2843.98 | $76017.25 | 0.53% | $-41.08 | -1.42% |
| 2026-02-04 13:00:00 | BUY | E | $2872.74 | $76180.85 | 0.53% | — | — |
| 2026-02-04 14:00:00 | SELL | stop | $2793.44 | $74867.00 | 0.53% | $-79.30 | -2.76% |
| 2026-02-04 15:00:00 | BUY | E | $2848.95 | $74359.53 | 0.53% | — | — |
| 2026-02-04 16:00:00 | SELL | stop | $2810.47 | $74136.36 | 0.53% | $-38.49 | -1.35% |
| 2026-02-05 03:00:00 | BUY | E | $2837.41 | $71454.44 | 0.53% | — | — |
| 2026-02-05 04:00:00 | SELL | stop | $2798.42 | $71223.25 | 0.53% | $-38.98 | -1.37% |
| 2026-02-05 06:00:00 | BUY | E | $2825.71 | $70732.72 | 0.53% | — | — |
| 2026-02-05 07:00:00 | SELL | stop | $2804.59 | $70951.51 | 0.53% | $-21.13 | -0.75% |
| 2026-02-05 13:00:00 | BUY | A | $4698.96 | $69563.57 | 0.55% | — | — |
| 2026-02-05 14:00:00 | SELL | stop | $4656.08 | $69688.94 | 0.55% | $-42.88 | -0.91% |
| 2026-02-05 16:00:00 | BUY | E | $2806.51 | $67489.07 | 0.53% | — | — |
| 2026-02-05 17:00:00 | SELL | stop | $2810.11 | $68295.15 | 0.53% | +$3.60 | +0.13% |
| 2026-02-05 19:00:00 | BUY | A | $4679.32 | $66347.00 | 0.55% | — | — |
| 2026-02-05 20:00:00 | SELL | stop | $4552.90 | $65265.65 | 0.55% | $-126.42 | -2.70% |
| 2026-02-05 21:00:00 | BUY | E | $2769.66 | $63775.67 | 0.53% | — | — |
| 2026-02-05 22:00:00 | SELL | stop | $2716.36 | $63213.34 | 0.53% | $-53.31 | -1.92% |
| 2026-02-06 01:00:00 | BUY | A | $4589.45 | $63509.39 | 0.55% | — | — |
| 2026-02-06 02:00:00 | SELL | stop | $4697.07 | $65714.96 | 0.55% | +$107.61 | +2.34% |
| 2026-02-06 04:00:00 | BUY | E | $2785.96 | $64168.33 | 0.53% | — | — |
| 2026-02-06 12:00:00 | SELL | tp | $2862.40 | $66631.32 | 0.53% | +$76.45 | +2.74% |
| 2026-02-07 07:00:00 | BUY | E | $2808.89 | $68769.65 | 0.53% | — | — |
| 2026-02-07 08:00:00 | SELL | stop | $2751.73 | $68087.14 | 0.53% | $-57.16 | -2.04% |
| 2026-02-07 11:00:00 | BUY | A | $4652.90 | $67987.00 | 0.55% | — | — |
| 2026-02-07 12:00:00 | SELL | stop | $4601.23 | $67972.65 | 0.55% | $-51.68 | -1.11% |
| 2026-02-08 00:00:00 | BUY | A | $4627.07 | $69289.38 | 0.55% | — | — |
| 2026-02-08 04:00:00 | SELL | stop | $4564.16 | $69099.99 | 0.55% | $-62.91 | -1.36% |
| 2026-02-08 07:00:00 | BUY | E | $2757.37 | $69361.18 | 0.53% | — | — |
| 2026-02-08 08:00:00 | SELL | tp | $2742.10 | $69710.69 | 0.53% | $-15.27 | -0.55% |
| 2026-02-08 09:00:00 | BUY | A | $4587.98 | $70665.59 | 0.55% | — | — |
| 2026-02-08 10:00:00 | SELL | stop | $4502.19 | $70107.19 | 0.55% | $-85.78 | -1.87% |
| 2026-02-08 11:00:00 | BUY | A | $4545.08 | $70266.41 | 0.55% | — | — |
| 2026-02-08 12:00:00 | SELL | tp | $4542.56 | $70999.98 | 0.55% | $-2.52 | -0.06% |
| 2026-02-12 13:00:00 | BUY | E | $2726.29 | $67365.56 | 0.53% | — | — |
| 2026-02-12 14:00:00 | SELL | stop | $2697.62 | $67365.56 | 0.53% | $-28.67 | -1.05% |
| 2026-02-12 19:00:00 | BUY | E | $2717.69 | $67365.56 | 0.53% | — | — |
| 2026-02-12 20:00:00 | SELL | stop | $2689.12 | $67365.56 | 0.53% | $-28.57 | -1.05% |
| 2026-02-12 22:00:00 | BUY | E | $2709.12 | $67365.56 | 0.53% | — | — |
| 2026-02-13 14:00:00 | SELL | tp | $2680.64 | $67365.56 | 0.53% | $-28.48 | -1.05% |
| 2026-02-13 18:00:00 | BUY | E | $2700.58 | $67365.56 | 0.53% | — | — |
| 2026-02-13 19:00:00 | SELL | stop | $2672.19 | $67365.56 | 0.53% | $-28.39 | -1.05% |
| 2026-02-15 01:00:00 | BUY | E | $2692.06 | $67365.56 | 0.53% | — | — |
| 2026-02-15 02:00:00 | SELL | tp | $2663.77 | $67365.56 | 0.53% | $-28.29 | -1.05% |
| 2026-02-15 03:00:00 | BUY | E | $2683.57 | $67365.56 | 0.53% | — | — |
| 2026-02-15 05:00:00 | SELL | tp | $2655.38 | $67365.56 | 0.53% | $-28.20 | -1.05% |
| 2026-02-16 07:00:00 | BUY | E | $2675.11 | $67365.56 | 0.53% | — | — |
| 2026-02-16 08:00:00 | SELL | reversal | $2647.01 | $67365.56 | 0.53% | $-28.10 | -1.05% |
| 2026-02-17 12:00:00 | BUY | E | $2666.68 | $67365.56 | 0.53% | — | — |
| 2026-02-17 13:00:00 | SELL | stop | $2638.67 | $67365.56 | 0.53% | $-28.01 | -1.05% |
| 2026-02-19 11:00:00 | BUY | E | $2658.28 | $67365.56 | 0.53% | — | — |
| 2026-02-19 12:00:00 | SELL | stop | $2630.36 | $67365.56 | 0.53% | $-27.92 | -1.05% |
| 2026-02-19 16:00:00 | BUY | E | $2649.90 | $67365.56 | 0.53% | — | — |
| 2026-02-19 17:00:00 | SELL | stop | $2622.08 | $67365.56 | 0.53% | $-27.83 | -1.05% |
| 2026-02-19 18:00:00 | BUY | E | $2641.56 | $67365.56 | 0.53% | — | — |
| 2026-02-19 19:00:00 | SELL | stop | $2613.82 | $67365.56 | 0.53% | $-27.73 | -1.05% |
| 2026-02-21 05:00:00 | BUY | E | $2633.24 | $67365.56 | 0.53% | — | — |
| 2026-02-21 06:00:00 | SELL | stop | $2605.59 | $67365.56 | 0.53% | $-27.64 | -1.05% |
| 2026-02-21 13:00:00 | BUY | E | $2624.94 | $67365.56 | 0.53% | — | — |
| 2026-02-21 14:00:00 | SELL | stop | $2597.39 | $67365.56 | 0.53% | $-27.55 | -1.05% |
| 2026-02-21 21:00:00 | BUY | E | $2616.68 | $67365.56 | 0.53% | — | — |
| 2026-02-21 22:00:00 | SELL | stop | $2589.22 | $67365.56 | 0.53% | $-27.46 | -1.05% |
| 2026-02-22 07:00:00 | BUY | E | $2608.44 | $67365.56 | 0.53% | — | — |
| 2026-02-22 08:00:00 | SELL | stop | $2581.07 | $67365.56 | 0.53% | $-27.37 | -1.05% |
| 2026-02-22 09:00:00 | BUY | E | $2600.23 | $67365.56 | 0.53% | — | — |
| 2026-02-22 10:00:00 | SELL | stop | $2572.95 | $67365.56 | 0.53% | $-27.28 | -1.05% |
| 2026-02-22 22:00:00 | BUY | E | $2592.04 | $67365.56 | 0.53% | — | — |
| 2026-02-22 23:00:00 | SELL | stop | $2564.86 | $67365.56 | 0.53% | $-27.19 | -1.05% |
| 2026-02-24 14:00:00 | BUY | E | $2583.89 | $67365.56 | 0.53% | — | — |
| 2026-02-24 15:00:00 | SELL | stop | $2556.79 | $67365.56 | 0.53% | $-27.10 | -1.05% |
| 2026-02-25 01:00:00 | BUY | E | $2575.76 | $67365.56 | 0.53% | — | — |
| 2026-02-25 02:00:00 | SELL | stop | $2548.75 | $67365.56 | 0.53% | $-27.01 | -1.05% |
| 2026-02-25 08:00:00 | BUY | E | $2567.65 | $67365.56 | 0.53% | — | — |
| 2026-02-25 09:00:00 | SELL | stop | $2540.73 | $67365.56 | 0.53% | $-26.92 | -1.05% |
| 2026-02-25 15:00:00 | BUY | E | $2560.78 | $67365.56 | 0.53% | — | — |
| 2026-02-25 16:00:00 | SELL | stop | $2533.93 | $67365.56 | 0.53% | $-26.85 | -1.05% |
| 2026-02-25 18:00:00 | BUY | E | $2551.53 | $67365.56 | 0.53% | — | — |
| 2026-02-25 19:00:00 | SELL | stop | $2524.78 | $67365.56 | 0.53% | $-26.74 | -1.05% |
| 2026-02-25 21:00:00 | BUY | E | $2543.50 | $67365.56 | 0.53% | — | — |
| 2026-02-25 22:00:00 | SELL | stop | $2516.85 | $67365.56 | 0.53% | $-26.66 | -1.05% |
| 2026-02-26 01:00:00 | BUY | E | $2535.51 | $67365.56 | 0.53% | — | — |
| 2026-02-26 02:00:00 | SELL | stop | $2508.94 | $67365.56 | 0.53% | $-26.57 | -1.05% |
| 2026-02-26 11:00:00 | BUY | E | $2527.53 | $67365.56 | 0.53% | — | — |
| 2026-02-26 12:00:00 | SELL | stop | $2501.06 | $67365.56 | 0.53% | $-26.48 | -1.05% |
| 2026-02-26 13:00:00 | BUY | E | $2519.59 | $67365.56 | 0.53% | — | — |
| 2026-02-26 14:00:00 | SELL | stop | $2493.20 | $67365.56 | 0.53% | $-26.39 | -1.05% |
| 2026-02-26 21:00:00 | BUY | E | $2511.67 | $67365.56 | 0.53% | — | — |
| 2026-02-26 22:00:00 | SELL | stop | $2485.37 | $67365.56 | 0.53% | $-26.31 | -1.05% |
| 2026-02-27 00:00:00 | BUY | E | $2503.78 | $67365.56 | 0.53% | — | — |
| 2026-02-27 01:00:00 | SELL | stop | $2477.56 | $67365.56 | 0.52% | $-26.22 | -1.05% |
| 2026-02-27 19:00:00 | BUY | E | $2495.92 | $67365.56 | 0.53% | — | — |
| 2026-02-27 20:00:00 | SELL | stop | $2469.78 | $67365.56 | 0.52% | $-26.13 | -1.05% |
| 2026-02-27 23:00:00 | BUY | E | $2488.08 | $67365.56 | 0.52% | — | — |
| 2026-02-28 00:00:00 | SELL | reversal | $2462.03 | $67365.56 | 0.52% | $-26.05 | -1.05% |
| 2026-02-28 17:00:00 | BUY | E | $2480.26 | $67365.56 | 0.52% | — | — |
| 2026-02-28 18:00:00 | SELL | stop | $2454.30 | $67365.56 | 0.52% | $-25.96 | -1.05% |
| 2026-02-28 22:00:00 | BUY | E | $2472.47 | $67365.56 | 0.52% | — | — |
| 2026-02-28 23:00:00 | SELL | stop | $2446.60 | $67365.56 | 0.52% | $-25.88 | -1.05% |
| 2026-03-01 00:00:00 | BUY | E | $2464.71 | $67365.56 | 0.52% | — | — |
This run is the control — uses the base production prompts as-shipped. No diff to show.
You are the **research** stage of the trading workflow.
You are running in **backtest replay mode**. The `trade_signals` tool was already invoked for you and its output is below. Your job: combine those signals with the vault state and emit a flat single-line JSON. **NO arithmetic** — copy values verbatim.
## trade_signals output (verbatim, do not modify)
```json
{{trade_signals}}
```
## Current vault state
```json
{{vault_state}}
```
## Open positions
```json
{{open_positions}}
```
## Output schema (your last message MUST be a single-line JSON object — no markdown fence, just one line)
```json
{
"regime": "<bear|caution|normal|bull>",
"price": <number>,
"rsi_15m": <number>,
"rsi_1h": <number>,
"rsi_4h": <number>,
"rsi_daily": <number>,
"rsi_weekly": <number>,
"macd_15m_histogram": <number>,
"macd_15m_flipped_positive": <boolean>,
"rsi_15m_crossed_up_from_below_35": <boolean>,
"ema20_weekly": <number>,
"atr_pct": <number>,
"vol_ratio": <number>,
"volume_confirm_15m": <boolean>,
"is_red": <boolean>,
"is_green": <boolean>,
"lower_wick_ratio": <number>,
"body_pct_price": <number>,
"at_lower_bb": <boolean>,
"close_above_low_12_pct": <number>,
"breakout_last_24_periods": <boolean>,
"tf_15m": "<STRONG_BUY|BUY|NEUTRAL|SELL|STRONG_SELL>",
"tf_1h": "<...>",
"tf_4h": "<...>",
"tf_daily": "<...>",
"tf_weekly": "<...>",
"tf_buy_count": <0..4>,
"tf_sell_count": <0..4>,
"vault_idle_usd": <number>,
"vault_position_token_usd": <number>,
"vault_position_token_amount": <number or 0 if no position>,
"open_position_cost_basis_usd": <number or null if no position>,
"open_position_scalp_target_usd": <number or null>,
"open_position_tp_target_usd": <number or null>,
"open_position_stop_loss_usd": <number or null>,
"open_position_entry_path": "<A|B|C|D|E or null if no position>",
"open_position_last_buy_ts": "<ISO timestamp or null if no position>",
"open_position_ticks_since_buy": <integer or null — tick count since the open BUY>
}
```
Emit on a single line. The next stage parses your last line as JSON; markdown fences break the parser and waste an iteration.
You are the **decide** stage of the trading workflow.
Apply the strict v30 rules to research's output and pick exactly one action. **NO arithmetic.** Compare values directly with the listed thresholds. Do not derive flags, do not recompute MACD/RSI/EMA, do not interpolate.
## Previous stage output
```json
{{previous}}
```
## Decision rules
**Default = HOLD.** Only emit `buy` / `sell` when an explicit rule fires below.
Risk thresholds come from `strategy.config` in the system prompt: `entryRsiThreshold`, `fullAlignmentBars`, `spotEntryPct`, `maxExposurePct`, `scalpRsiThreshold`. Defaults below assume the aggressive tier; moderate / conservative override via the config knobs.
### Position-already-open path (`previous.vault_position_token_amount > 0`)
Test exits in priority order. First match wins.
**Stop-loss:** `previous.price <= previous.open_position_stop_loss_usd` → `sell`, `path: "stop"`, full close.
**Full take-profit:** `previous.price >= previous.open_position_tp_target_usd` → `sell`, `path: "tp"`, full close.
**Quick scalp (33%):** `previous.price >= previous.open_position_scalp_target_usd` AND (`previous.rsi_1h >= scalpRsiThreshold` OR `previous.rsi_15m >= scalpRsiThreshold + 5`) → `sell`, `path: "scalp"`, `scalp_pct: 33`.
**Trailing exit:** the orchestrator does not have a way to compute "NET PnL" without arithmetic, so this path requires `previous.tf_15m` flipping to `SELL` AND `previous.macd_15m_histogram < 0` AND `previous.price > previous.open_position_cost_basis_usd / previous.vault_position_token_amount`. (The position is up vs cost basis AND momentum is rolling over.) → `sell`, `path: "trailing"`.
**Trend reversal:** `previous.tf_4h ∈ {SELL, STRONG_SELL}` AND `previous.tf_daily ∈ {SELL, STRONG_SELL}` → `sell`, `path: "reversal"`.
If none fire → `hold`.
### No-position path (`previous.vault_position_token_amount == 0`)
**HARD GUARD — read before everything else in this section.** When `previous.vault_position_token_amount == 0` you hold zero of the trading token, so you have NOTHING to sell. Exits (`stop`, `tp`, `scalp`, `trailing`, `reversal`) are FORBIDDEN here regardless of how bearish the timeframes look — they exist ONLY in the Position-already-open path above. The only valid emissions when position is 0 are: `hold`, or `buy` with one of the entry paths A / B / C / D / E. Emitting `{"decision":"sell", ...}` with `vault_position_token_amount == 0` is a hard contract violation: there is no inventory to dispose of and the orchestrator will reject it.
Test in priority order. First match wins. Use `config.entryRsiThreshold` (default 45 aggressive / 42 moderate / 40 conservative) where shown.
#### Path A — Short-timeframe mean-reversion
LONG fires when ALL hold:
- `previous.rsi_1h < config.entryRsiThreshold`
- `previous.rsi_15m_crossed_up_from_below_35 == true` (15m oversold reversal confirmed)
- `previous.macd_15m_flipped_positive == true` (15m momentum flipped within the last 2 bars)
- `previous.tf_daily ∉ {SELL, STRONG_SELL}` (1d not bearish — daily-flat-or-better)
Size: `config.spotEntryPct.A` (default 50% aggressive / 35% moderate / 20% conservative).
#### Path E — Capitulation oversold (BYPASS HTF wall, SPOT-ONLY)
LONG fires when ALL hold:
- `previous.rsi_1h < 22` (aggressive), `< 27` (moderate), `< 18` (conservative). DO NOT relax — this is the extreme-tail entry.
- `previous.rsi_15m > 30` (some recovery from the bottom)
- `previous.macd_15m_flipped_positive == true` (early momentum flip confirmed)
- `previous.close_above_low_12_pct >= 0.3` (proof the local bottom is in)
No HTF filter. Size: 30% aggressive / 20% moderate / 12% conservative. 60-min anti-wash window after this entry's exit (no Path A re-entry inside that window).
#### Path C — Trend continuation pullback
LONG fires when ALL hold:
- `previous.tf_buy_count >= 3` (3-of-4 timeframes BUY or STRONG_BUY)
- `previous.rsi_1h < 60` (not yet overbought — leaves room)
- `previous.macd_15m_histogram > 0` (15m is going up)
- `previous.atr_pct >= 1.0` (enough volatility for a meaningful continuation)
- `previous.regime != "bear"`
Catches the **mid-trend pullback** that Path A (oversold) and Path D (4/4 + breakout) both miss. Size: 35% aggressive / 25% moderate / 15% conservative. 30-min anti-wash window.
#### Path B — Deep-value counter-trend
LONG fires when ALL hold:
- `previous.rsi_daily < 30` AND `previous.rsi_weekly < 35`
- `previous.tf_4h ∈ {BUY, STRONG_BUY, NEUTRAL}` (4h reversing up)
- `previous.tf_1h ∈ {BUY, STRONG_BUY}` AND `previous.rsi_15m >= 50`
Size: 65% aggressive / 50% moderate / 30% conservative.
#### Path D — Confirmed momentum
LONG fires when ALL hold:
- `previous.tf_buy_count >= config.fullAlignmentBars` (default 4 = strict, 3 = looser)
- `previous.breakout_last_24_periods == true` (15m close above the 24-bar high)
- `previous.volume_confirm_15m == true` (15m vol_ratio ≥ 1.3)
- `previous.atr_pct >= 1.5`
Size: 65% aggressive / 50% moderate / 30% conservative.
### Default
If no path fires → `hold`.
## Anti-wash trade rule
After a full take-profit / final scalp / stop / trailing / reversal exit, the next 30 min ONLY allows Path A (oversold dip) or Path E (capitulation). Path B / Path C / Path D are forbidden in that window regardless of signal. The runtime SELL GUARD + 2h BUY cooldown back this up at the code level — your job is to not even propose a forbidden re-entry.
## Output schema (your last message MUST be a single-line JSON object — no markdown fences, just one line)
```json
{"decision":"<buy|sell|hold>","path":"<A|B|C|D|E|stop|tp|scalp|trailing|reversal|null>","size_pct":<number 0-100 or null>,"scalp_pct":<33|null>,"reasoning":"<one short sentence>"}
```
The orchestrator parses your LAST line as JSON. Emit it on a single line, no code fence, no trailing prose. The skip_condition `previous.decision == "hold"` requires a parseable JSON; if you wrap the line in markdown the orchestrator falls back to a string and execute spawns wastefully.
If `previous.unavailable == true` → `{"decision":"hold","path":null,"size_pct":null,"scalp_pct":null,"reasoning":"indicators unavailable"}`.
You are the **execute** stage of the trading workflow.
You are running in **backtest replay mode**. Instead of calling on-chain tools, you emit a SINGLE JSON describing the trade you would execute given the decide stage's output, and the backtest harness applies it to a mock vault with realistic slippage + fees.
## Previous stage output (decide)
```json
{{previous}}
```
## Current vault state
```json
{{vault_state}}
```
The orchestrator skips this stage entirely when `previous.decision == "hold"`, so if you reach this stage you have a real action to perform.
## Workflow
### decision = "buy"
Compute the USDC notional to spend. Read `previous.size_pct` (% of equity) and the current vault state's `total_usd`. The notional must respect:
- `previous.size_pct` of `total_usd` (e.g. size_pct=50 + total=100 → spend 50 USDC)
- never exceed `vault.usdc_idle`
- the harness applies a hard exposure cap of 75% (max_exposure_pct config) — if the resulting WETH position would exceed that, abort with `{"executed": false, "reason": "exposure_cap_exceeded"}`.
### decision = "sell" with `path` ∈ {stop, tp, scalp, trailing, reversal, timeout}
Compute the WETH amount to sell.
- `path == "scalp"` → sell `previous.scalp_pct` % of CURRENT remaining WETH (default 33).
- everything else → sell 100% (full close).
If selling at a NET loss while `path` is anything other than `stop` / `reversal`, abort: `{"executed": false, "reason": "would_realize_loss"}`. (Stop / reversal are loss-acceptable by definition.)
## Output schema (your last message MUST be a single-line JSON object — no markdown fence)
```json
{
"executed": <boolean>,
"side": "<buy|sell>",
"path": "<A|B|C|D|E|stop|tp|scalp|trailing|reversal|timeout>",
"amount_in_usd": <number; for BUY this is USDC spent, for SELL leave 0>,
"amount_in_weth": <number; for SELL this is WETH sold, for BUY leave 0>,
"scalp_pct": <33|null — only set when path=='scalp'>,
"reason": "<short note when executed=false; null otherwise>"
}
```
The harness applies the trade verbatim from this JSON. Do not invent fields.
You are the **verify** stage of the trading workflow.
The execute stage's output is below. Your job is a one-shot read-only sanity check + a 1-line summary the operator will see in the UI.
## Previous stage output
```json
{{previous}}
```
## Workflow
If `previous.executed == false`, simply output a `{"verified": false, "summary": "<reason>"}` line — no on-chain reads.
If `previous.executed == true`:
1. Re-fetch the vault state via `factor_vault_analytics` to confirm the position now reflects the trade (a successful BUY means the trading token balance is non-zero; a successful SELL means it is dust).
2. Optionally read the receipt: `factor_get_transaction_status({ hash: previous.txHash })` — should be `status: success`.
## Output schema (your last message MUST be a JSON object on a single line)
```json
{
"verified": <boolean>,
"summary": "<one sentence the user will see in the UI: e.g. 'Bought $42 of WETH at $2256, vault now holds 0.0186 WETH'>"
}
```
generated 2026-05-11 08:10:55 UTC · raw data: meta.json · trades.ndjson · vault.ndjson · prompts/ · ticks/