You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: add Pulse trader and enhance Threshold Guard documentation
- Introduced detailed documentation for the new Pulse trader feature, including setup, quick start instructions, and operational commands.
- Expanded the Threshold Guard section to clarify its role in single-pool trading and its relationship with the Pulse trader.
- Updated links in the overview to direct users to the new Pulse trader documentation for better navigation.
Copy file name to clipboardExpand all lines: docs/agents-and-bds/bds-agent-headless.md
+106-1Lines changed: 106 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -308,9 +308,114 @@ The key difference from the hosted server:
308
308
309
309
For laptop use in Cursor or Claude Code, the stdio path is adequate. For agents running in remote environments or frameworks that cannot spawn child processes, use the hosted server.
310
310
311
+
## Pulse trader (`bds-agent trade`)
312
+
313
+
**Pulse** is a self-contained momentum trader: it subscribes to the BDS **`/mpp/stream/allTrades`** SSE feed, scores each epoch with **price + volume + flow** confluence, and (when not in dry-run) swaps on **Ethereum mainnet** via Uniswap V3 SwapRouter. Production setups use **`--multi-pool`** and the **USD Price Feed** (`--price-source usd`, default) so alt USDC pairs are not drowned out by flat trade-implied prices on WETH/USDC.
314
+
315
+
**Prerequisites:** same as the rest of this guide — profile with `api_key`, `bds-agent config init`, and credits. Trading uses a **separate** wallet from billing.
316
+
317
+
| File (profile `pulse`) | Purpose |
318
+
|------------------------|---------|
319
+
|`profiles/pulse.json`| API key, `bds_base_url`, catalog URLs |
|`--price-source`|`usd`|`usd` = `/mpp/tokenPrices/...` per epoch; `trades` = swap-implied only |
363
+
|`--price-move`|`0.15`| Min price change % in the lookback window |
364
+
|`--volume-burst`|`2.0`| Short-window volume vs trailing baseline |
365
+
|`--flow-imbalance`|`30`| Directional flow as % of volume |
366
+
|`--window-minutes`|`5`| Signal lookback |
367
+
|`--size`| (required live) | USDC notional per entry |
368
+
|`--slippage`|`0.01`| Uniswap `amountOutMinimum` floor (no silent relax to zero) |
369
+
|`--max-open-positions`| auto |`0` = 5 with `--multi-pool`, else 1 |
370
+
|`--daily-loss-limit`|`50`| Block new entries if today realized P/L ≤ −$50 (UTC) |
371
+
|`--reentry-cooldown-minutes`|`0`| Optional: block all new entries N minutes after a **live** exit |
372
+
|`--signal-cooldown-minutes`|`0`| Optional: per-pool spacing after a LONG fires |
373
+
374
+
**Dry-run → live:** paper positions do not block live startup; starting **live** clears paper state. Use **`--verbose`** during validation — one heartbeat line per epoch (gates, `px=`, burst, imbalance, position state).
375
+
376
+
### Exit strategies (defaults on)
377
+
378
+
Disable any rule with `--no-exit-*`. First match wins: **stop-loss → take-profit → trailing-stop → time-based → signal-reversal**.
379
+
380
+
| Flag | Default | Role |
381
+
|------|---------|------|
382
+
|`--exit-stop-loss-pct`|`2.0`| Cut if price falls X% below entry |
383
+
|`--exit-take-profit-pct`|`1.0`| Take if price rises X% above entry |
384
+
|`--exit-trailing-pct`|`2.0`| Exit X% below peak since entry |
385
+
|`--exit-hold-minutes`|`10`| Max hold time |
386
+
|`--exit-signal-reversal`| on | Exit on Pulse SHORT on the entry pool |
387
+
388
+
### Metering (Pulse)
389
+
390
+
| Route | When |
391
+
|-------|------|
392
+
|`/mpp/stream/allTrades`| Once per `trade run` session (per SSE connection) |
393
+
|`/mpp/tokenPrices/...`| Each epoch per watched token when `--price-source usd`|
There is **no** separate “Pulse fee” — only catalog-priced BDS routes. See [Metering & API Keys → How much each call costs](./metering-and-api-keys.md#how-much-each-call-costs). On **HTTP 402** (credits exhausted), USD fetches fail fast with a top-up hint; the trader stops rather than using stale prices.
Bracket trading on **one** USDC-quoted Uniswap V3 pool using BDS **spot USD** prices (`GET /mpp/token/price/{token}/{pool}`). Complements the **Pulse**trader (`bds-agent trade run`), which uses the live trade stream and multi-pool confluence. Guard is for a singlepool with percent take-profit / stop-loss and optional dip re-entry.
418
+
Bracket trading on **one** USDC-quoted Uniswap V3 pool using BDS **spot USD** prices (`GET /mpp/token/price/{token}/{pool}`). Complements **Pulse**above: Guard is single-pool percent brackets and optional dip re-entry; Pulse is stream confluence across many pools.
314
419
315
420
**Setup:** same profile API key and swap wallet as Pulse — `bds-agent trade setup-evm --profile NAME` writes `profiles/<NAME>.trade.env`.
Copy file name to clipboardExpand all lines: docs/agents-and-bds/overview.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -80,7 +80,7 @@ This path is optimized for fast time-to-first-alert: the agent uses MCP tools ex
80
80
81
81
The **`bds-agent`** CLI (install: **`pip install bds-agent`** or **`uv tool install bds-agent`**, package [`bds-agent` on PyPI](https://pypi.org/project/bds-agent/), source [`powerloom/bds-agent-py`](https://github.com/powerloom/bds-agent-py)) does **not** require an MCP server. It translates natural-language queries to structured YAML recipes and executes them directly against the metered resolver routes. It supports wallet-funded automated signup and top-up, making it suitable for agent sandboxes and external orchestration frameworks (LangGraph, CrewAI, and others) where spawning an MCP subprocess is impractical.
82
82
83
-
Beyond **`run`** / **`query`**, the CLI includes a **Pulse** trader (`trade run` — stream confluence, multi-pool) and **Threshold Guard** (`guard run` — one pool, percent take-profit/stop-loss, optional idle exit in USDC for composed agent loops). See [`Headless CLI`](./bds-agent-headless.md#threshold-guard-bds-agent-guard).
83
+
Beyond **`run`** / **`query`**, the CLI includes a **Pulse** trader (`trade run` — stream confluence, multi-pool) and **Threshold Guard** (`guard run` — one pool, percent take-profit/stop-loss, optional idle exit in USDC for composed agent loops). See [`Headless CLI` → Pulse](./bds-agent-headless.md#pulse-trader-bds-agent-trade) and [`Threshold Guard`](./bds-agent-headless.md#threshold-guard-bds-agent-guard).
84
84
85
85
**Best fit:** headless agents, external orchestration, programmatic wallet-based signup, any environment where the MCP process model is not viable.
0 commit comments