# Run, watch and stop

> Start a strategy on its own paper book or on a project's wallets, watch what it decides and why, change its knobs, and stop it.

## Start a run

A run (a **deployment**) starts from the next bar and keeps going on ftw.trade's servers.

- **On its own paper book**: press **Run on paper**. Nothing but the strategy's own book is touched. This is where every strategy should start.
- **On a project's wallets**: choose a project and its wallets. The run trades them, on paper or live as the project is.
  - On a pool, each buy spends a set amount of ETH from each wallet, and a sell sells each wallet's whole holding.
  - On a perp, each wallet sends the order's USD notional at the run's leverage. With matched sizing, each wallet holds the book's position as a share of its own equity, so it scales with deposits and withdrawals.
  - On a Polymarket outcome, each buy spends a set dollar amount from each wallet's Polygon account.

## Cap its loss

Give a run a **max loss** in USD, and it stops and closes out by itself once it is down that much. You don't have to watch its book to stop at, say, −$10.

- **Set it** when you start the run (the **Max loss** field, or `maxLoss: 10` with `run_strategy` or `start_preset`), or later from the run's card (**Adjust**, or **Set a max loss…** in the Running table's menu), or with `run_strategy { deployment, maxLoss }`. 0 takes it off.
- **What it measures** is the run's P&L in USD, the figure its card shows:
  - on a live project, its money now less everything put in, net of what was taken out, from its quarter-hour marks. A top-up isn't profit and a withdrawal isn't a loss;
  - on its own paper book or a paper project, its book's equity less its cash. A book in a token (a WETH pool, say) is priced in USD at the bar's close.
- **When it's checked**: as each bar steps the run, or as each quarter-hour mark of a live run is written. The check reads only what was just stepped or marked, so it adds no reads of a chain. A fast move between checks can take a run past its cap before it stops.
- **What happens** at a P&L of −max loss or below: the run stops, its card and Log say why (*Stopped: lost $10.02, past its $10 max loss*), and it closes out what it holds on the wallets, as **Close out** does: ranges withdrawn, perps closed, loans repaid, and a pool or Polymarket run's wallets sell its token. A run on its own paper book just stops.
- The card shows the cap and how much of it the run has used. A run the cap stopped stays stopped. Raise or take off the cap before you start it again, or it stops at its next check.

## Watch it

- **Strategies → Running** lists every run with its equity, stats, latest metrics and orders. Open one to watch it live: what it reads, each metric's line, its last decisions and fills.
- **Monitor** shows every running strategy at once, the data arriving for each, and whether the servers are keeping up.
- **Log** keeps every decision, order, fill and error, with the reason. Filter to one run or to problems only.
- **A dashboard** puts the run's P&L, signals, positions and trades on one shareable page. One click (or `add_strategy_dashboard`) builds it. See [Dashboards](https://docs.ftw.trade/projects/dashboards).

## Change it

- **Knobs**: a run's settings can be turned while it runs, or set to an optimization's best.
- **Code**: saving a new version doesn't change a run. Start a new run for new code, then stop the old one.

## Stop it

- **Stop** ends the decisions. Positions it holds stay open.
- **Close out** (on a hedged or multi-market run on wallets) unwinds what it holds, and brings funds it bridged back home.
- **Remove** stops and deletes the run. Its trades stay in the project's history.

> [!WARNING] Stopping is not closing
> Stopping a run leaves any open position where it is. Close perps from the project's perps panel, or use close out, before you walk away.

## When a run stops by itself

A run stops, with the reason in the Log, when:

- it reaches its **max loss** (see [Cap its loss](#cap-its-loss)), and then it also closes out;
- one of its **invariants** is breached (a drawdown, a daily loss, a trade count) and its `on_breach` says so;
- its **replay stops matching** the orders it sent;
- a source it reads is **deleted or retyped**;
- the market it trades is **delisted or resolved**.
