Safety
Three guards designed to keep an off-script command from doing damage. All three are state that lives in the CLI, not the exchange.
| Guard | Scope | Persistence |
|---|---|---|
| Simulation | All write-ops on every account | Persistent (per CLI install) |
| Fatfinger | Single-order size cap, per symbol | Persistent |
| Whitelist | Symbols that survive close longs/shorts/all | Persistent |
Simulation
Aliases: sim, dry-run.
simulation # show status
simulation on # enable
simulation off # disable
simulation status # same as bare form
sim on
dry-run off
When ON, every write-op (place / cancel / close / move / bump) short-circuits
at simulationGate(ctx) before any exchange call. Reads (positions,
orders, margin, etc.) are unaffected.
Persisted to ~/.tealstreet/simulation.json. Source: SimulationCommand.ts.
Use simulation when porting a new alias or recipe. Confirm the chain prints the right intent before you flip simulation off.
Fatfinger
A per-symbol cap on individual order size, in contracts. Checked just
before placeOrder on:
buy,sellscale,swarmchasetwap
Reduce-only orders are skipped — closing a position cannot blow it up.
| Form | Effect |
|---|---|
fatfinger | List all configured limits |
fatfinger <contracts> | Set on focused symbol |
fatfinger 0.5 BTCUSDT | Set on named symbol |
unfatfinger <symbol> | Remove for one symbol |
unfatfinger all | Remove every limit |
Persisted to ~/.tealstreet/fatfingers.json. Source: FatfingerCommand.ts,
TradingBaseCommand.ts:enforceFatfinger.
Whitelist
Symbols you don't want a global "close all" to touch. Applies to:
close longsclose shortsclose allpos/close all
Per-symbol close calls (close BTCUSDT, close long) ignore the
whitelist — the guard is only for the global variants.
| Form | Effect |
|---|---|
whitelist | List |
whitelist BTCUSDT | Add (uppercased before store) |
unwhitelist BTCUSDT | Remove |
unwhitelist all | Remove every entry |
Persisted to ~/.tealstreet/whitelist.json. Source: WhitelistCommand.ts.
Combining guards
These layer. Simulation short-circuits before fatfinger checks; fatfinger fires before the exchange call.
simulation on
buy 99999 BTCUSDT # blocked by simulation — no fatfinger needed
simulation off
fatfinger 0.5 BTCUSDT
buy $5000000 BTCUSDT # blocked by fatfinger
whitelist BTCUSDT
close longs # touches every long except BTCUSDT