solana-traderclaw 1.0.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,516 @@
1
+ # solana-traderclaw (TraderClaw V1)
2
+
3
+ TraderClaw V1 plugin for autonomous Solana memecoin trading. Connects OpenClaw to a trading orchestrator that handles market data, risk enforcement, and trade execution. Includes a full memory layer with local persistence, episodic logging, deterministic compute tools, and OpenClaw-native memory integration.
4
+
5
+ ## Architecture
6
+
7
+ ```
8
+ OpenClaw Agent (brain: reasoning, decisions, strategy evolution)
9
+
10
+ │ calls 66 typed tools
11
+
12
+ Plugin (this package)
13
+ ├── HTTP ──→ Orchestrator (data + risk + execution)
14
+ │ │ │
15
+ │ Bitquery SpyFly Bot
16
+ │ (market data) (on-chain execution)
17
+
18
+ ├── Local persistence (state, decisions, bulletin, patterns)
19
+ │ └── .traderclaw-v1-data/
20
+
21
+ └── OpenClaw native memory (auto-loaded every session)
22
+ ├── MEMORY.md (durable facts — always in context)
23
+ └── memory/YYYY-MM-DD.md (daily logs — today + yesterday)
24
+ ```
25
+
26
+ The plugin gives OpenClaw tools to interact with the Solana trading orchestrator. The orchestrator gathers market data, enforces risk rules, and proxies trades. OpenClaw does all reasoning, decision-making, and strategy evolution. The plugin also manages a 3-layer memory system that eliminates amnesia between sessions.
27
+
28
+ ## Prerequisites
29
+
30
+ - OpenClaw v2026.1+ with Node >= 22
31
+ - An API key from [traderclaw.ai/register](https://traderclaw.ai/register)
32
+
33
+ ## Quick Start
34
+
35
+ ### 1. Install the plugin
36
+
37
+ Install the **npm package** **`solana-traderclaw`**. The **OpenClaw plugin id** in `openclaw.json` stays **`solana-trader`** (same as `openclaw.plugin.json`). The global CLI binary is **`traderclaw`**.
38
+
39
+ ```bash
40
+ npm install -g solana-traderclaw@1.0.18
41
+ ```
42
+
43
+ Or install directly into OpenClaw:
44
+
45
+ ```bash
46
+ openclaw plugins install solana-traderclaw@1.0.18
47
+ ```
48
+
49
+ **Names:** `solana-traderclaw` is the canonical npm package. Older names (`solana-trader`, `solana-traderclaw-v1`) may still resolve on npm for a time; prefer **`solana-traderclaw`**. OpenClaw may log a benign id hint if the npm package name and manifest `id` differ — config keys remain **`plugins.entries.solana-trader`**.
50
+
51
+ ### 2. Run setup
52
+
53
+ ```bash
54
+ traderclaw setup
55
+ ```
56
+
57
+ The setup wizard will:
58
+ - Ask for your API key (from [traderclaw.ai/register](https://traderclaw.ai/register))
59
+ - Connect to the orchestrator and validate your key
60
+ - Create or select a trading wallet
61
+ - Write the plugin configuration automatically
62
+
63
+ That's it. Restart the gateway and start trading:
64
+
65
+ ```bash
66
+ openclaw gateway restart
67
+ ```
68
+
69
+ ### Optional: Simple localhost installer wizard (Linux-first)
70
+
71
+ ```bash
72
+ traderclaw install --wizard
73
+ ```
74
+
75
+ This opens a localhost UI that runs prechecks, lane-aware setup, gateway validation, optional Telegram setup, and final verification. It also installs **`HEARTBEAT.md` into your OpenClaw agent workspace root** (default `~/.openclaw/workspace/HEARTBEAT.md`) from the packaged skill so heartbeats load the TraderClaw checklist without manual `cp`. `traderclaw setup` does the same.
76
+
77
+ ### Optional: Run CLI prechecks directly
78
+
79
+ ```bash
80
+ traderclaw precheck --dry-run --output linux-qa-dryrun.log
81
+ traderclaw precheck --allow-install --output linux-qa-install.log
82
+ ```
83
+
84
+ Use `--dry-run` for non-mutating validation and `--allow-install` for guided dependency installs.
85
+
86
+ ### 3. Run the mandatory startup sequence
87
+
88
+ Send this prompt to your bot after startup:
89
+
90
+ ```text
91
+ Run mandatory startup sequence and report pass/fail for each:
92
+ 1) solana_system_status
93
+ 2) solana_gateway_credentials_get (set if missing)
94
+ 3) solana_alpha_subscribe(agentId: "main")
95
+ 4) solana_capital_status
96
+ 5) solana_positions
97
+ 6) solana_killswitch_status
98
+ ```
99
+
100
+ ### Non-interactive setup
101
+
102
+ ```bash
103
+ traderclaw setup --api-key sk_live_abc123 --url https://api.traderclaw.ai
104
+ ```
105
+
106
+ ## CLI Commands
107
+
108
+ ### `traderclaw setup`
109
+
110
+ Interactive setup wizard. Validates API key, connects to orchestrator, sets up wallet, writes config.
111
+
112
+ Options:
113
+ - `--api-key, -k` — API key (skip prompt)
114
+ - `--url, -u` — Orchestrator URL (skip prompt, default: `https://api.traderclaw.ai`)
115
+
116
+ ### `traderclaw status`
117
+
118
+ Check connection health and wallet status at a glance:
119
+
120
+ ```
121
+ OpenClaw Solana Trader - Status
122
+ =============================================
123
+ Orchestrator: CONNECTED
124
+ Execution mode: live
125
+ Upstream: configured
126
+ System status: OK
127
+ WS connections: 1
128
+
129
+ Wallet: ACTIVE
130
+ Wallet ID: 1
131
+ Balance: 5.0 SOL
132
+ Open positions: 3
133
+ Unrealized PnL: 0.062 SOL
134
+ Kill switch: disabled
135
+ Strategy version: v1.2.3
136
+ Mode: HARDENED
137
+ =============================================
138
+ ```
139
+
140
+ ### `traderclaw config`
141
+
142
+ View and manage configuration:
143
+
144
+ ```bash
145
+ traderclaw config show # View current config (API key masked)
146
+ traderclaw config set <key> <v> # Update a value
147
+ traderclaw config reset # Remove all plugin config
148
+ ```
149
+
150
+ Available config keys: `orchestratorUrl`, `walletId`, `apiKey`, `apiTimeout`, `refreshToken`, `walletPublicKey`, `gatewayBaseUrl`, `gatewayToken`, `agentId`
151
+
152
+ Wallet proof note: if login/session challenge requires wallet ownership proof, provide the key at runtime with `--wallet-private-key` or `TRADERCLAW_WALLET_PRIVATE_KEY`. It is used for local signing only and is not stored in `~/.openclaw/openclaw.json`.
153
+
154
+ **Gateway process:** Telegram and other channels talk to the **OpenClaw gateway** process. That process must be able to read `TRADERCLAW_WALLET_PRIVATE_KEY` when the session refresh fails and a new challenge runs. Exporting the variable only in your SSH session does **not** set it for **systemd** (or Docker, etc.). Configure it in the gateway unit’s environment per the troubleshooting guide below.
155
+
156
+ **`traderclaw login`:** Uses the saved refresh token when valid (no wallet key needed). Use `traderclaw login --force-reauth` when you intentionally want a full API challenge (e.g. after `traderclaw logout`).
157
+
158
+ **Session / auth / startup issues:** follow the official guide — [Installation → Troubleshooting (session expired, auth, logged out)](https://docs.traderclaw.ai/docs/installation#troubleshooting-session-expired-auth-errors-or-the-agent-logged-out).
159
+
160
+ ### `traderclaw --help`
161
+
162
+ Print all available commands and options.
163
+
164
+ ### `traderclaw --version`
165
+
166
+ Print plugin version.
167
+
168
+ ## Advanced: Manual Configuration
169
+
170
+ If you prefer to configure manually instead of using the CLI, add to `~/.openclaw/openclaw.json`:
171
+
172
+ ```json5
173
+ {
174
+ plugins: {
175
+ entries: {
176
+ "solana-trader": {
177
+ enabled: true,
178
+ config: {
179
+ orchestratorUrl: "https://api.traderclaw.ai",
180
+ walletId: 1,
181
+ apiKey: "sk_live_your_key_here",
182
+ apiTimeout: 80000, // optional, default 80s
183
+ dataDir: "/path/to/data" // optional, default: <cwd>/.traderclaw-v1-data
184
+ }
185
+ }
186
+ }
187
+ }
188
+ }
189
+ ```
190
+
191
+ Restart the gateway after configuration:
192
+
193
+ ```bash
194
+ openclaw gateway restart
195
+ ```
196
+
197
+ ## Memory & Context System
198
+
199
+ The plugin implements a 3-layer memory architecture that uses OpenClaw's native infrastructure plus custom tools to eliminate amnesia between sessions.
200
+
201
+ ### Layer 1: Durable Facts (`MEMORY.md`)
202
+
203
+ OpenClaw automatically loads `MEMORY.md` into agent context at every session start — zero tool calls needed. When `solana_state_save` is called, it writes both a JSON state file AND updates `MEMORY.md` with curated durable facts: tier, wallet, mode, strategy version, watchlist, permanent learnings, and regime canary.
204
+
205
+ ### Layer 2: Episodic Memory (Daily Logs + Bootstrap Injection)
206
+
207
+ Two auto-loaded sources:
208
+ - **Daily logs** (`memory/YYYY-MM-DD.md`) — OpenClaw auto-loads today + yesterday's files. Written via `solana_daily_log`.
209
+ - **Bootstrap injection** — The `agent:bootstrap` hook auto-injects durable state, last 50 decisions, team bulletin (last 6h), context snapshot, and entitlements into agent context at session start.
210
+
211
+ ### Layer 3: Deep Knowledge (Server-Side Memory)
212
+
213
+ Unlimited retention via the orchestrator API. `solana_memory_write` / `solana_memory_search` / `solana_memory_by_token` for storing and retrieving historical trades, lessons, and patterns.
214
+
215
+ ### Memory Flush Hook
216
+
217
+ The `memory:flush` hook fires automatically when OpenClaw is about to trim context. It syncs `MEMORY.md` from the last persisted state and writes a compaction marker to the daily log. This is an automatic safety net — no agent action needed.
218
+
219
+ ### Bootstrap Hook (`agent:bootstrap`)
220
+
221
+ Fires at every agent session start before the first prompt. Injects via `context.bootstrapFiles`:
222
+
223
+ | File Injected | Source | Content |
224
+ |---|---|---|
225
+ | `<agentId>-durable-state.json` | `state/<agentId>.json` | Full durable state from last session |
226
+ | `<agentId>-decision-log.jsonl` | `logs/<agentId>/decisions.jsonl` | Last 50 decision log entries |
227
+ | `team-bulletin.jsonl` | `logs/shared/team-bulletin.jsonl` | Bulletin entries from last 6 hours |
228
+ | `context-snapshot.json` | `state/context-snapshot.json` | Latest portfolio world-view snapshot |
229
+ | `active-entitlements.json` | 4-step fallback chain | Entitlement tier, limits, expiration |
230
+
231
+ Entitlement fallback chain: live API fetch → cached file → durable state → conservative defaults (starter tier).
232
+
233
+ ### Local Data Directory
234
+
235
+ ```
236
+ .traderclaw-v1-data/
237
+ ├── state/ # Durable agent state, snapshot, entitlement cache, patterns
238
+ ├── logs/
239
+ │ ├── <agentId>/ # Per-agent decision logs (JSONL)
240
+ │ └── shared/ # Team bulletin (JSONL)
241
+ ```
242
+
243
+ Plus OpenClaw-native paths at project root:
244
+ ```
245
+ MEMORY.md # Curated durable facts (auto-loaded by OpenClaw)
246
+ memory/
247
+ ├── 2026-03-19.md # Today's daily log (auto-loaded by OpenClaw)
248
+ ├── 2026-03-18.md # Yesterday's daily log (auto-loaded by OpenClaw)
249
+ └── ... # Auto-pruned after 7 days
250
+ ```
251
+
252
+ ## Available Tools (66)
253
+
254
+ ### Scanning
255
+ | Tool | Description |
256
+ |------|-------------|
257
+ | `solana_scan_launches` | Find new Solana token launches |
258
+ | `solana_scan_hot_pairs` | Find high-volume trading pairs |
259
+ | `solana_market_regime` | Get macro market state (bullish/bearish/neutral) |
260
+
261
+ ### Token Analysis
262
+ | Tool | Description |
263
+ |------|-------------|
264
+ | `solana_token_snapshot` | Price, volume, OHLC data |
265
+ | `solana_token_holders` | Holder concentration and distribution |
266
+ | `solana_token_flows` | Buy/sell pressure and flow data |
267
+ | `solana_token_liquidity` | Pool depth and liquidity profile |
268
+ | `solana_token_risk` | Composite risk assessment |
269
+
270
+ ### Intelligence
271
+ | Tool | Description |
272
+ |------|-------------|
273
+ | `solana_build_thesis` | Full context package: market data + strategy weights + memory + risk pre-screen |
274
+
275
+ ### Trading
276
+ | Tool | Description |
277
+ |------|-------------|
278
+ | `solana_trade_precheck` | Pre-trade risk validation |
279
+ | `solana_trade_execute` | Execute trade via SpyFly bot |
280
+
281
+ ### Reflection & Server-Side Memory
282
+ | Tool | Description |
283
+ |------|-------------|
284
+ | `solana_trade_review` | Post-trade outcome review |
285
+ | `solana_memory_write` | Write journal entry to server |
286
+ | `solana_memory_search` | Search trading memories on server |
287
+ | `solana_memory_by_token` | Token-specific trade history from server |
288
+ | `solana_journal_summary` | Performance stats summary |
289
+
290
+ ### Strategy
291
+ | Tool | Description |
292
+ |------|-------------|
293
+ | `solana_strategy_state` | Read current strategy weights |
294
+ | `solana_strategy_update` | Update weights after learning |
295
+
296
+ ### Safety
297
+ | Tool | Description |
298
+ |------|-------------|
299
+ | `solana_killswitch` | Toggle emergency kill switch |
300
+ | `solana_killswitch_status` | Check kill switch state |
301
+
302
+ ### Wallet
303
+ | Tool | Description |
304
+ |------|-------------|
305
+ | `solana_capital_status` | Balance, positions, PnL, limits |
306
+ | `solana_positions` | Current positions with PnL |
307
+ | `solana_funding_instructions` | Deposit instructions |
308
+ | `solana_wallets` | List all wallets |
309
+ | `solana_wallet_create` | Create a new wallet |
310
+
311
+ ### Entitlements
312
+ | Tool | Description |
313
+ |------|-------------|
314
+ | `solana_entitlement_plans` | Available limit upgrades |
315
+ | `solana_entitlement_purchase` | Purchase upgrade plan |
316
+ | `solana_entitlement_current` | Current tier, limits, and expiration (also caches for bootstrap) |
317
+ | `solana_entitlement_upgrade` | Upgrade entitlement tier |
318
+ | `solana_entitlement_costs` | View upgrade cost breakdown |
319
+
320
+ ### Trade History & Risk
321
+ | Tool | Description |
322
+ |------|-------------|
323
+ | `solana_trades` | Query trade history with filters |
324
+ | `solana_risk_denials` | View recent risk denial log |
325
+
326
+ ### Alpha Signal Processing
327
+ | Tool | Description |
328
+ |------|-------------|
329
+ | `solana_alpha_subscribe` | Subscribe to alpha signal WebSocket feed |
330
+ | `solana_alpha_unsubscribe` | Unsubscribe from alpha feed |
331
+ | `solana_alpha_signals` | Retrieve buffered alpha signals |
332
+ | `solana_alpha_history` | Query historical alpha signals |
333
+ | `solana_alpha_sources` | Get source reputation statistics |
334
+
335
+ ### Bitquery Deep Scans
336
+ | Tool | Description |
337
+ |------|-------------|
338
+ | `solana_bitquery_query` | Execute custom Bitquery GraphQL query |
339
+ | `solana_bitquery_catalog` | List available Bitquery datasets |
340
+ | `solana_bitquery_templates` | Pre-built query templates |
341
+ | `solana_bitquery_subscribe` | Create Bitquery streaming subscription |
342
+ | `solana_bitquery_unsubscribe` | Remove streaming subscription |
343
+ | `solana_bitquery_subscriptions` | List active subscriptions |
344
+ | `solana_bitquery_subscription_reopen` | Reopen a closed subscription |
345
+
346
+ ### Gateway & System
347
+ | Tool | Description |
348
+ |------|-------------|
349
+ | `solana_system_status` | Orchestrator health check |
350
+ | `solana_gateway_credentials_get` | Get gateway API credentials |
351
+ | `solana_gateway_credentials_set` | Set gateway API credentials |
352
+ | `solana_gateway_credentials_delete` | Delete gateway credentials |
353
+ | `solana_gateway_forward_probe` | Probe gateway forwarding connectivity |
354
+ | `solana_agent_sessions` | View agent session diagnostics |
355
+ | `solana_startup_gate` | Run startup gate sequence (includes `welcomeMessage` on full pass; may include it if only capital step fails — see tool output) |
356
+ | `solana_traderclaw_welcome` | Post-startup welcome for the user (includes API key when in config) |
357
+ | `solana_runtime_status` | Get runtime status diagnostics |
358
+
359
+ ### Local Durable State
360
+ | Tool | Description |
361
+ |------|-------------|
362
+ | `solana_state_save` | Save agent state to local JSON (also writes MEMORY.md) |
363
+ | `solana_state_read` | Read agent state from local JSON |
364
+
365
+ ### Episodic Decision Log
366
+ | Tool | Description |
367
+ |------|-------------|
368
+ | `solana_decision_log` | Log structured decision entry (FIFO capped at 50) |
369
+
370
+ ### Team Bulletin
371
+ | Tool | Description |
372
+ |------|-------------|
373
+ | `solana_team_bulletin_post` | Post discovery, alert, or status to shared bulletin |
374
+ | `solana_team_bulletin_read` | Read bulletin entries with time/type filters |
375
+
376
+ ### Context Snapshot
377
+ | Tool | Description |
378
+ |------|-------------|
379
+ | `solana_context_snapshot_write` | Write portfolio world-view snapshot |
380
+ | `solana_context_snapshot_read` | Read latest portfolio snapshot |
381
+
382
+ ### Deterministic Compute (Anti-Hallucination)
383
+ | Tool | Description |
384
+ |------|-------------|
385
+ | `solana_compute_confidence` | Weighted confidence score (on-chain, signal, social, smart money, risk penalty) |
386
+ | `solana_compute_freshness_decay` | Freshness decay factor by signal age |
387
+ | `solana_compute_position_limits` | Full position sizing ladder with reduction breakdown |
388
+ | `solana_classify_deployer_risk` | Deployer wallet risk classification (LOW/MODERATE/HIGH/CRITICAL) |
389
+
390
+ ### Deep Analysis
391
+ | Tool | Description |
392
+ |------|-------------|
393
+ | `solana_history_export` | Export decision logs + optionally server-side data (trades, memory, strategy) |
394
+ | `solana_pattern_store` | Read/write/list named trading patterns |
395
+
396
+ ### OpenClaw Native Memory
397
+ | Tool | Description |
398
+ |------|-------------|
399
+ | `solana_daily_log` | Append to today's daily log (auto-loaded by OpenClaw next session, 7-day prune) |
400
+
401
+ ## Hooks (2)
402
+
403
+ | Hook | Trigger | What It Does |
404
+ |------|---------|--------------|
405
+ | `agent:bootstrap` | Every session start | Injects durable state, decisions, bulletin, snapshot, and entitlements into context |
406
+ | `memory:flush` | Before OpenClaw context compaction | Syncs MEMORY.md from persisted state, writes compaction marker to daily log |
407
+
408
+ ## Skills
409
+
410
+ ### solana-trader (Trading Skill v5)
411
+ The primary skill that teaches OpenClaw the complete trading lifecycle:
412
+
413
+ 1. **SCAN** — Find opportunities with launch/hot-pair scanners
414
+ 2. **ANALYZE** — Deep dive with 5 token analysis tools
415
+ 3. **THESIS** — Assemble full context with build_thesis
416
+ 4. **DECIDE** — Agent reasons over data using confidence scoring
417
+ 5. **PRECHECK** — Validate against risk rules
418
+ 6. **EXECUTE** — Place trade via SpyFly
419
+ 7. **MONITOR** — Watch positions and capital
420
+ 8. **REVIEW** — Journal outcomes honestly
421
+ 9. **EVOLVE** — Update strategy weights based on performance
422
+
423
+ Includes: token lifecycle framework, anti-rug heuristics, volume pattern reading, FOMO detection, liquidity-relative sizing, house money exits, dead money rule, narrative awareness, 3-layer memory architecture, deterministic compute tools.
424
+
425
+ ### social-intel (Alpha Feed & Social Intelligence)
426
+ Standalone skill for SpyFly alpha feed integration and social intelligence:
427
+
428
+ - **SpyFly Alpha Feed** — Query recent alpha calls, historical accuracy, price milestone pings
429
+ - **Token Social Metadata** — Resolve on-chain metadata to find Twitter/Telegram/Discord links
430
+ - **Twitter Community Stats** — Follower count, engagement, growth trajectory, MC-relative benchmarking
431
+ - **Twitter Trending** — Narrative/meta detection from viral crypto topics
432
+
433
+ This skill is designed to merge into the trading skill when both are ready.
434
+
435
+ ## Example Conversation
436
+
437
+ ```
438
+ User: Start scanning for opportunities
439
+
440
+ Agent: Let me check the current market conditions and scan for new tokens.
441
+
442
+ [calls solana_market_regime]
443
+ Market is in a bullish regime with high DEX volume.
444
+
445
+ [calls solana_scan_launches]
446
+ Found 5 new launches in the last hour. POPCAT at 0x7a... looks interesting — high initial volume.
447
+
448
+ [calls solana_build_thesis with POPCAT address]
449
+ Thesis package shows:
450
+ - Strong buy pressure (68% buy ratio)
451
+ - Adequate liquidity ($180k)
452
+ - Holder concentration at 35% (acceptable)
453
+ - My strategy weights favor volume_momentum (0.28) — this token scores well there
454
+ - No prior trades on this token in my memory
455
+ - Risk pre-screen: approved, capped at 0.5 SOL
456
+
457
+ Based on the thesis data and my learned weights, I'll enter a small position.
458
+
459
+ [calls solana_trade_precheck]
460
+ Approved. Capped size: 0.5 SOL.
461
+
462
+ [calls solana_trade_execute]
463
+ Trade executed. TradeId: 15, PositionId: 4, TX: 5xK...
464
+
465
+ I'll monitor this position and review after exit.
466
+ ```
467
+
468
+ ## Troubleshooting
469
+
470
+ **Plugin won't load:**
471
+ - Run `traderclaw status` to check connectivity
472
+ - Check `openclaw plugins list` for errors
473
+ - Verify `openclaw.plugin.json` exists in the plugin directory
474
+
475
+ **"apiKey is required" error:**
476
+ - Run `traderclaw setup` to configure your API key
477
+ - Or manually add `apiKey` to your config: `traderclaw config set apiKey sk_live_...`
478
+
479
+ **"Could not reach orchestrator" warning:**
480
+ - Run `traderclaw status` to diagnose
481
+ - Check your internet connection
482
+ - Verify the orchestrator URL: `traderclaw config show`
483
+
484
+ **"Wallet not found" errors:**
485
+ - Run `traderclaw setup` to create or select a wallet
486
+ - Verify the wallet ID: `traderclaw config show`
487
+
488
+ **Heartbeat not sending messages to Telegram:**
489
+ - **Fresh `traderclaw setup`:** the installer runs `configureGatewayScheduling`, which sets a custom `heartbeat.prompt` on the `main` agent (no `HEARTBEAT_OK` escape). You only need the manual `openclaw config set` command below if you are on an older install or overwrote `agents.list`.
490
+ - **`HEARTBEAT.md` must live in the agent workspace root** (default `~/.openclaw/workspace/HEARTBEAT.md`, next to `AGENTS.md`). A copy under `workspace/.openclaw/` or only inside the plugin package is **not** loaded as the heartbeat checklist. Copy from `skills/solana-trader/HEARTBEAT.md` in the installed package if needed. See [OpenClaw agent workspace](https://docs.openclaw.ai/concepts/agent-workspace).
491
+ - OpenClaw's default heartbeat prompt tells the model "If nothing needs attention, reply HEARTBEAT_OK" — which is stripped and never delivered. Run `traderclaw setup` again (v1.0.16+) to set a custom prompt, or apply manually:
492
+
493
+ ```bash
494
+ openclaw config set agents.list '[{"id":"main","default":true,"heartbeat":{"every":"30m","target":"last","prompt":"Read HEARTBEAT.md (workspace context). Follow it strictly — execute the full trading cycle and report results to the user. Do NOT reply HEARTBEAT_OK. Always produce a visible summary of what you checked and did."}}]'
495
+ openclaw gateway restart
496
+ ```
497
+
498
+ - Verify with `openclaw config get agents` — the `main` agent should have a `heartbeat.prompt` field.
499
+ - Confirm Telegram is healthy: `openclaw channels status --probe`
500
+ - You must have messaged the bot at least once for `target: "last"` to have a delivery route.
501
+
502
+ **Scheduled cron jobs run but you never see Telegram/WhatsApp output:**
503
+ - TraderClaw templates merged into `~/.openclaw/cron/jobs.json` use **`delivery.mode: "announce"`** with **`channel: "last"`** so each completed isolated job posts a summary to the same channel you last used (see [OpenClaw cron delivery](https://docs.clawd.bot/automation/cron-jobs)).
504
+ - If you installed before this behavior: run **`traderclaw setup`** again so the installer re-merges cron jobs, or stop the gateway and edit managed job entries in `~/.openclaw/cron/jobs.json` — set **`delivery`** to `{ "mode": "announce", "channel": "last", "bestEffort": true }` for each TraderClaw job (or remove `delivery` entirely; isolated jobs default to announce when omitted).
505
+ - The same **`last`** requirement as heartbeat applies: message the bot at least once so the gateway knows where to deliver.
506
+
507
+ **Tools returning errors:**
508
+ - Run `traderclaw status` to check system health
509
+ - Check if kill switch is enabled
510
+ - Verify your wallet has sufficient SOL balance
511
+
512
+ **Memory/state not persisting:**
513
+ - Check that the `dataDir` config points to a writable location
514
+ - Default is `<cwd>/.traderclaw-v1-data` — verify permissions
515
+ - Check `MEMORY.md` exists at project root after first `solana_state_save` call
516
+ - Check `memory/` directory for daily log files