solana-traderclaw 1.0.133 → 1.0.135

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.
@@ -1,6 +1,6 @@
1
1
  // OpenClaw Gateway Configuration — TraderClaw V1-Upgraded (Single Agent)
2
- // Single "main" agent with 5-minute heartbeat + 10 consolidated cron jobs.
3
- // Consolidated from 13 10: portfolio-health (dead-money+whale+risk-audit),
2
+ // Single "main" agent with 5-minute heartbeat + 11 preset TraderClaw cron jobs.
3
+ // alpha-stream-resubscribe (every 20m WS keepalive); portfolio-health (dead-money+whale+risk-audit);
4
4
  // trust-refresh (source-reputation+deployer-trust). Shortened prompts.
5
5
  {
6
6
  agents: {
@@ -22,23 +22,25 @@
22
22
  keepLines: 2000
23
23
  },
24
24
  jobs: [
25
- // ── Strategy & Learning ───────────────────────────────────────
25
+ // ── Alpha stream keepalive ────────────────────────────────────────
26
26
  {
27
- id: "strategy-evolution",
28
- schedule: "0 */4 * * *",
27
+ id: "alpha-stream-resubscribe",
28
+ schedule: "*/20 * * * *",
29
29
  agentId: "main",
30
30
  sessionTarget: "isolated",
31
31
  delivery: { mode: "none" },
32
- message: "CRON_JOB: strategy_evolution\n\nStep 1: Call solana_journal_summary to get aggregate performance stats (win rate, avg PnL, trade count). If fewer than 10 closed trades since the last strategy evolution, skip weight updates but still run pattern detection.\n\nStep 2: Call solana_memory_search for 'strategy_evolution' — find last 3 evolution cycle results. Call solana_memory_search for 'strategy_drift_warning' — find drift warnings since last evolution. Call solana_memory_search for 'pre_trade_rationale' — recent decision patterns.\n\nStep 3: Run Recurring Pattern Detection — search for learning_entry tags, group by area, check linked chains (3+ = confirmed pattern), investigate drift warnings.\n\nStep 4: Call solana_strategy_state to read current feature weights.\n\nStep 5: Call solana_trades to get recent closed trades. Apply ADL checks (direction consistency, weight velocity, reversion check).\n\nStep 6: Compute proposed weight changes. Score each with VFM (Frequency + Failure Reduction + Self-Cost). Only apply changes scoring >= 3/5.\n\nStep 7: Verify guardrails: maxDeltaOk, sumWeightsOk, minTradesOk, floorCapOk. If all pass, call solana_strategy_update with incremented version.\n\nStep 8: Run Named Pattern Recognition — search for winning trade clusters, catalog new patterns, evolve existing ones.\n\nStep 9: Evaluate discovery filter performance. Log all results via solana_memory_write with tags: strategy_evolution, vfm_scorecard, pattern_detection, named_pattern.\n\nFORMATTING RULES:\n- Every token reference MUST use SYMBOL (full_CA) format.\n- Do not execute trades. Do not ask questions.",
32
+ message: "CRON_JOB: alpha_stream_resubscribe\n\nKeep alpha WebSocket subscription healthy. solana_runtime_status if subscribed is false: solana_alpha_subscribe. If subscribed but ingestionStale: solana_alpha_subscribe force:true (zombie heal). Else: reply ALPHA_KEEPALIVE_OK.",
33
33
  enabled: true
34
34
  },
35
+
36
+ // ── Strategy & Learning ───────────────────────────────────────
35
37
  {
36
- id: "alpha-scan",
37
- schedule: "0 */3 * * *",
38
+ id: "strategy-evolution",
39
+ schedule: "0 */4 * * *",
38
40
  agentId: "main",
39
41
  sessionTarget: "isolated",
40
- delivery: { mode: "announce", channel: "last", bestEffort: true },
41
- message: "CRON_JOB: alpha_scan\n\nScan new launches, filter, score, log alpha. Tools: solana_scan_launches filter (vol>30K, mcap>10K, liq>5K) solana_token_snapshot for survivors quality filter (top10 <50%, deployer <3 abandoned, has social) score 0-100 solana_alpha_log for 65+. Summarize results.",
42
+ delivery: { mode: "none" },
43
+ message: "CRON_JOB: strategy_evolution\n\nStep 1: Call solana_journal_summary to get aggregate performance stats (win rate, avg PnL, trade count). If fewer than 10 closed trades since the last strategy evolution, skip weight updates but still run pattern detection.\n\nStep 2: Call solana_memory_search for 'strategy_evolution' — find last 3 evolution cycle results. Call solana_memory_search for 'strategy_drift_warning' — find drift warnings since last evolution. Call solana_memory_search for 'pre_trade_rationale' — recent decision patterns.\n\nStep 3: Run Recurring Pattern Detection — search for learning_entry tags, group by area, check linked chains (3+ = confirmed pattern), investigate drift warnings.\n\nStep 4: Call solana_strategy_state to read current feature weights.\n\nStep 5: Call solana_trades to get recent closed trades. Apply ADL checks (direction consistency, weight velocity, reversion check).\n\nStep 6: Compute proposed weight changes. Score each with VFM (Frequency + Failure Reduction + Self-Cost). Only apply changes scoring >= 3/5.\n\nStep 7: Verify guardrails: maxDeltaOk, sumWeightsOk, minTradesOk, floorCapOk. If all pass, call solana_strategy_update with incremented version.\n\nStep 8: Run Named Pattern Recognition — search for winning trade clusters, catalog new patterns, evolve existing ones.\n\nStep 9: Evaluate discovery filter performance. Log all results via solana_memory_write with tags: strategy_evolution, vfm_scorecard, pattern_detection, named_pattern.\n\nFORMATTING RULES:\n- Every token reference MUST use SYMBOL (full_CA) format.\n- Do not execute trades. Do not ask questions.",
42
44
  enabled: true
43
45
  },
44
46
 
@@ -1,6 +1,6 @@
1
1
  // OpenClaw Gateway Configuration — TraderClaw V1 (Single Agent)
2
- // Single "main" agent with 5-minute heartbeat + 10 consolidated cron jobs.
3
- // Consolidated from 13 10: portfolio-health (dead-money+whale+risk-audit),
2
+ // Single "main" agent with 5-minute heartbeat + 11 preset TraderClaw cron jobs.
3
+ // alpha-stream-resubscribe (every 20m WS keepalive); portfolio-health (dead-money+whale+risk-audit);
4
4
  // trust-refresh (source-reputation+deployer-trust). Shortened prompts.
5
5
  {
6
6
  agents: {
@@ -22,14 +22,14 @@
22
22
  keepLines: 2000
23
23
  },
24
24
  jobs: [
25
- // ── Alpha Scanning ──────────────────────────────────────────────
25
+ // ── Alpha stream keepalive ────────────────────────────────────────
26
26
  {
27
- id: "alpha-scan",
28
- schedule: "0 */3 * * *",
27
+ id: "alpha-stream-resubscribe",
28
+ schedule: "*/20 * * * *",
29
29
  agentId: "main",
30
30
  sessionTarget: "isolated",
31
- delivery: { mode: "announce", channel: "last", bestEffort: true },
32
- message: "CRON_JOB: alpha_scan\n\nScan new launches, filter, score, log alpha. Tools: solana_scan_launches filter (vol>30K, mcap>10K, liq>5K) solana_token_snapshot for survivors quality filter (top10 <50%, deployer <3 abandoned, has social) score 0-100 → solana_alpha_log for 65+. Summarize results.",
31
+ delivery: { mode: "none" },
32
+ message: "CRON_JOB: alpha_stream_resubscribe\n\nKeep alpha WebSocket subscription healthy. solana_runtime_status if subscribed is false: solana_alpha_subscribe. If subscribed but ingestionStale: solana_alpha_subscribe force:true (zombie heal). Else: reply ALPHA_KEEPALIVE_OK.",
33
33
  enabled: true
34
34
  },
35
35
 
package/dist/index.js CHANGED
@@ -2831,12 +2831,12 @@ ${notes}
2831
2831
  });
2832
2832
  api.registerTool({
2833
2833
  name: "solana_alpha_submit",
2834
- description: "Submit a candidate token to the alpha buffer for evaluation in the next heartbeat cycle. Used by cron alpha_scan to queue discovered tokens with thesis data.",
2834
+ description: "Submit a candidate token to the alpha buffer for evaluation in the next heartbeat cycle. Use from isolated sessions or manual workflows to queue a token with thesis data (default install: discovery runs in heartbeat STEP 1, not a separate cron).",
2835
2835
  parameters: Type.Object({
2836
2836
  tokenAddress: Type.String({ description: "Solana token mint address" }),
2837
2837
  symbol: Type.Optional(Type.String({ description: "Token symbol" })),
2838
2838
  thesis: Type.Optional(Type.String({ description: "Thesis summary for why this token qualifies (volume, holders, risk flags, narrative)" })),
2839
- source: Type.Optional(Type.String({ description: "Signal source (e.g., cron_alpha_scan, manual)" })),
2839
+ source: Type.Optional(Type.String({ description: "Signal source label (e.g., alpha_submit, manual, isolated_session)" })),
2840
2840
  confidence: Type.Optional(Type.Number({ description: "Confidence score 0-100" }))
2841
2841
  }),
2842
2842
  execute: wrapExecute(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "solana-traderclaw",
3
- "version": "1.0.133",
3
+ "version": "1.0.135",
4
4
  "description": "TraderClaw V1-Upgraded — Solana trading for OpenClaw with intelligence lab, tool envelopes, prompt scrubbing, read-only X social intel, and split skill docs",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -20,7 +20,7 @@ If MEMORY.md contains a **User Preferences** section, those values override defa
20
20
 
21
21
  | Preference key | What it overrides |
22
22
  |---|---|
23
- | `volumeMinUsd` | Min 24h volume filter in STEP 1 SCAN and alpha_scan cron (default: 50000) |
23
+ | `volumeMinUsd` | Min 24h volume filter in STEP 1 SCAN (default: 50000) |
24
24
  | `marketCapMinUsd` | Min market cap filter (default: 10000) |
25
25
  | `maxPositionSizeSol` | Max position size in SOL (overrides entitlement cap if lower) |
26
26
  | `scanMode` | `"conservative"` / `"standard"` / `"aggressive"` — adjusts confidence thresholds |
@@ -316,7 +316,7 @@ Do NOT skip these. They feed the bootstrap digest that loads into your next sess
316
316
  HEARTBEAT REPORT — [timestamp UTC]
317
317
 
318
318
  Capital: X.XXX SOL | Positions: N open | Holdings verified: [yes/no via solana_wallet_token_balance]
319
- Scanned: N launches, N hot pairs | Alpha: N signals (top score: XX)
319
+ Alpha: N signals (top score: XX)
320
320
 
321
321
  DEEP ANALYSIS:
322
322
  Bitquery: [N templates run on N tokens | "none — no FRESH tokens"]
@@ -365,5 +365,5 @@ NEXT CYCLE: [1 sentence — what you're watching for]
365
365
  | API endpoint reference | refs/api-reference.md |
366
366
  | Wallet proof vs signup | SKILL.md § Wallet proof vs signup |
367
367
  | Strategy evolution details | refs/strategy-evolution.md |
368
- | Cron job definitions | refs/cron-jobs.md (10 consolidated jobs, ~39 sessions/day) |
368
+ | Cron job definitions | refs/cron-jobs.md (11 preset jobs; see Schedule Summary for runs/day) |
369
369
  | Position management details | refs/position-management.md |
@@ -22,6 +22,8 @@ Subsequent heartbeats:
22
22
  → Returns only new signals since last check
23
23
  ```
24
24
 
25
+ Installer / Gateway preset **`alpha_stream_resubscribe`** (every 20 minutes) calls `solana_runtime_status` and re-invokes `solana_alpha_subscribe` when the subscription dropped or ingestion is stale. See refs/cron-jobs.md.
26
+
25
27
  If buffered signals stay empty for multiple cycles:
26
28
  ```
27
29
  solana_gateway_forward_probe({ agentId: "main", source: "heartbeat_recovery" })
@@ -158,7 +160,7 @@ Use `solana_alpha_history` for:
158
160
 
159
161
  ## Alpha Submission (Cron → Heartbeat Pipeline)
160
162
 
161
- Use `solana_alpha_submit` to queue a candidate token into the alpha buffer after cron-based scanning (alpha_scan job). The heartbeat cycle then evaluates buffered candidates. Include: tokenAddress, symbol, thesis (volume, holders, risk, narrative), source, confidence.
163
+ Use `solana_alpha_submit` to queue a candidate token into the alpha buffer for evaluation on the next heartbeat (e.g. after deep research outside the fast loop). Launch and pair discovery runs in **STEP 1: SCAN** on each heartbeat there is no separate alpha_scan cron in the default presets. Include: tokenAddress, symbol, thesis (volume, holders, risk, narrative), source, confidence.
162
164
 
163
165
  ## Firehose Configuration
164
166
 
@@ -4,7 +4,7 @@ Cron jobs run in **isolated sessions** separate from the trading loop. Each job
4
4
 
5
5
  If a cron job fails, the fast loop continues unaffected — failures are retried on the next scheduled run.
6
6
 
7
- When you receive a `CRON_JOB:` message, execute ONLY the specified job. Do not run the trading loop.
7
+ When you receive a `CRON_JOB:` message, execute ONLY the specified job. Do not run the trading loop. **Launch and pair scanning** is heartbeat **STEP 1: SCAN**, not a cron — there is no default `alpha_scan` job.
8
8
 
9
9
  ## Memory Context Load (mandatory for every cron job)
10
10
 
@@ -19,21 +19,21 @@ At start of every cron job, check whether sufficient new data exists since last
19
19
 
20
20
  ---
21
21
 
22
- ## Job: `alpha_scan`
22
+ ## Job: `alpha_stream_resubscribe`
23
23
 
24
- **Schedule:** Every 3 hours (`0 */3 * * *`) — 8 runs/day
24
+ **Schedule:** Every 20 minutes (`*/20 * * * *`) — 72 runs/day
25
25
 
26
- **Purpose:** Scan new token launches, filter candidates, score quality, log alpha signals.
26
+ **Purpose:** Recover from dropped or zombie alpha WebSocket subscriptions (signals stop buffering). Complements plugin watchdog; explicit cron ensures reconnect even across process edge cases.
27
27
 
28
- **Tools:** `solana_scan_launches`, `solana_token_snapshot`, `solana_token_holders`, `solana_token_risk`, `solana_alpha_log`, `solana_memory_write`
28
+ **Tools:** `solana_runtime_status`, `solana_alpha_subscribe`
29
29
 
30
- **Workflow:** Scan launches filter (vol>30K, mcap>10K, liq>5K) snapshot survivors quality filter (top10 <50%, deployer <3 abandoned, has social) → score 0-100 → log 65+ via alpha_log.
30
+ **Workflow:** Call `solana_runtime_status`. If `alphaStream.subscribed` is false, call `solana_alpha_subscribe`. If subscribed but `alphaStream.ingestionStale`, call `solana_alpha_subscribe` with `force: true`. Otherwise reply `ALPHA_KEEPALIVE_OK`.
31
31
 
32
32
  **Configuration:**
33
- - Model: Sonnet (judgment scoring candidates, filtering quality signals)
33
+ - Model: Haiku (branch on flags, single tool calls)
34
34
  - Thinking: off
35
35
  - lightContext: on
36
- - Delivery: announce/last/bestEffort
36
+ - Delivery: none
37
37
 
38
38
  ---
39
39
 
@@ -222,8 +222,8 @@ At start of every cron job, check whether sufficient new data exists since last
222
222
  ## Schedule Summary
223
223
 
224
224
  | # | Job ID | Cron Expression | Runs/Day | Model | Thinking | lightContext | Delivery |
225
- |---|--------|----------------|----------|-------|----------|-------------|----------|
226
- | 1 | `alpha-scan` | `0 */3 * * *` | 8 | Sonnet | off | on | announce/last |
225
+ |---|--------|-----------------|----------|-------|----------|-------------|----------|
226
+ | 1 | `alpha-stream-resubscribe` | `*/20 * * * *` | 72 | Haiku | off | on | none |
227
227
  | 2 | `portfolio-health` | `0 */4 * * *` | 6 | Sonnet | off | on | announce/last |
228
228
  | 3 | `trust-refresh` | `0 */8 * * *` | 3 | Haiku | off | on | none |
229
229
  | 4 | `meta-rotation` | `30 */8 * * *` | 3 | Sonnet | off | on | announce/last |
@@ -233,4 +233,4 @@ At start of every cron job, check whether sufficient new data exists since last
233
233
  | 8 | `intelligence-lab-eval` | `0 16 * * *` | 1 | Sonnet | **on** | **off** | none |
234
234
  | 9 | `memory-trim` | `0 3 * * *` | 1 | Haiku | off | on | none |
235
235
  | 10 | `balance-watchdog` | `0 */2 * * *` | 12 | Haiku | off | on | announce/telegram |
236
- | | **Total** | | **39** | | | | |
236
+ | | **Total** | | **103** | | | | |
@@ -101,7 +101,7 @@ Every tool has a mandatory trigger — when the trigger condition is met, you MU
101
101
  ### Alpha Signals (5)
102
102
  | Tool | Purpose | When to Call |
103
103
  |---|---|---|
104
- | `solana_alpha_subscribe` | Subscribe to alpha stream (`force: true` forces reconnect) | Startup sequence; when stream disconnects or ingestion stalls |
104
+ | `solana_alpha_subscribe` | Subscribe to alpha stream (`force: true` forces reconnect) | Startup sequence; `alpha_stream_resubscribe` cron (every 20m); when stream disconnects or ingestion stalls |
105
105
  | `solana_alpha_signals` | Poll buffered signals | Step 1.5 every heartbeat |
106
106
  | `solana_alpha_history` | Historical signal data | Step 1.5 to check prior calls on a token; Step 7 to check source accuracy after exit |
107
107
  | `solana_alpha_sources` | Per-source performance stats | Step 1.5 to check source win rates; `source_reputation_recalc` cron |
@@ -191,7 +191,7 @@ Every tool has a mandatory trigger — when the trigger condition is met, you MU
191
191
  ### Runtime (3)
192
192
  | Tool | Purpose | When to Call |
193
193
  |---|---|---|
194
- | `solana_runtime_status` | Plugin runtime health | Diagnostics; when tools behave unexpectedly |
194
+ | `solana_runtime_status` | Plugin runtime health (startup gate cache, alpha stream subscription + ingestionStale) | `alpha_stream_resubscribe` cron; diagnostics when tools behave unexpectedly |
195
195
  | `solana_agent_sessions` | List agent sessions | Diagnostics; when checking session state |
196
196
  | `solana_classify_deployer_risk` | Deployer risk (alias) | Same as `solana_compute_deployer_risk` — use either |
197
197