solana-traderclaw 1.0.30 → 1.0.31

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.
@@ -87,6 +87,7 @@ function ensureTelegramGroupPolicyOpenForWizard(configPath = CONFIG_FILE) {
87
87
  if (tg.groupPolicy === "open") return { changed: false };
88
88
 
89
89
  tg.groupPolicy = "open";
90
+ ensureAgentsDefaultsSchemaCompat(config);
90
91
  mkdirSync(CONFIG_DIR, { recursive: true });
91
92
  writeFileSync(configPath, JSON.stringify(config, null, 2) + "\n", "utf-8");
92
93
  return { changed: true };
@@ -583,8 +584,8 @@ function mergePluginsAllowlist(modeConfig, configPath = CONFIG_FILE) {
583
584
  }
584
585
 
585
586
  /**
586
- * Six managed cron jobs with prescriptive tool chains (VPS report 2026-03-24).
587
- * Replaces vague one-line templates so the agent actually invokes tools.
587
+ * Managed cron jobs with prescriptive tool chains (VPS report 2026-03-24).
588
+ * Schedules are staggered (minutes :00 / :15 / :30 / :45) where possible to avoid pile-ups.
588
589
  * @param {string} agentId
589
590
  * @returns {Array<{ id: string, schedule: string, agentId: string, message: string, enabled: boolean }>}
590
591
  */
@@ -606,6 +607,14 @@ function traderCronPrescriptiveJobs(agentId) {
606
607
  "CRON_JOB: dead_money_sweep. You are running the dead money sweep. Do these steps: 1) Call solana_state_load to get all open positions. 2) For each open position, call solana_token_snapshot to get current price and volume. 3) Identify dead money: positions where price has not moved >5% in either direction for 4+ hours, OR volume has dropped below $5K, OR the token is trending toward zero with no recovery signals. 4) For any dead money position, execute an exit via solana_trade (sell). 5) Call solana_daily_log with what you found and any exits executed. Do NOT just list positions — actually check each one and act on dead money.",
607
608
  enabled: true,
608
609
  },
610
+ {
611
+ id: "risk-audit",
612
+ schedule: "30 */2 * * *",
613
+ agentId,
614
+ message:
615
+ "CRON_JOB: portfolio_risk_audit. You are running a portfolio risk and exposure audit. Do these steps: 1) Call solana_killswitch_status and solana_capital_status to confirm trading is allowed and you know available capital and limits. 2) Call solana_positions (or solana_state_load) to list all open positions with PnL and size. 3) For each material position, call solana_token_risk and solana_token_liquidity to check stress: liquidity depth, concentration, rug/momentum flags. 4) Call solana_journal_summary and solana_trades (recent window) to estimate correlation risk (many positions in one narrative?) and drawdown context. 5) Call solana_risk_denials for recent blocks. 6) Call solana_memory_write with category 'portfolio_risk_audit' summarizing exposure, worst-case scenarios, and any recommended risk-off actions. 7) Call solana_daily_log with a short audit summary. Do not open new trades in this job — audit only.",
616
+ enabled: true,
617
+ },
609
618
  {
610
619
  id: "source-reputation-recalc",
611
620
  schedule: "0 */3 * * *",
@@ -630,6 +639,22 @@ function traderCronPrescriptiveJobs(agentId) {
630
639
  "CRON_JOB: strategy_evolution. You are running the strategy evolution cycle (SKILL.md Step 9). Do these steps: 1) Call solana_journal_summary to review recent trade performance, win rate, and patterns. 2) Call solana_strategy_state to see current feature weights and strategy version. 3) Call solana_memory_search for 'pre_trade_rationale' to review your recent decision reasoning. 4) Call solana_memory_search for patterns like 'momentum_win', 'bad_liquidity', 'late_entry' to find what features predicted wins vs losses. 5) Analyze which weights need adjustment based on evidence. 6) If you have 20+ closed trades since last evolution: call solana_strategy_update with adjusted weights (respect anti-drift guardrails: max delta ±0.10, floor 0.02, cap 0.40, sum 0.95-1.05). Increment strategy version. 7) Call solana_memory_write with category 'strategy_evolution' documenting your reasoning. 8) Call solana_daily_log with evolution results. Only update weights if evidence supports it.",
631
640
  enabled: true,
632
641
  },
642
+ {
643
+ id: "subscription-cleanup",
644
+ schedule: "15 * * * *",
645
+ agentId,
646
+ message:
647
+ "CRON_JOB: subscription_cleanup. You are reconciling Bitquery streaming subscriptions. Do these steps: 1) Call solana_bitquery_subscriptions to list all active streams and expiry/status. 2) Call solana_positions (or solana_state_load) to know which token mints you still hold or actively monitor. 3) For subscriptions tied to sold/closed tokens or obsolete discovery templates, call solana_bitquery_unsubscribe with the subscriptionId. 4) For streams you must keep but that are expired or near expiry, call solana_bitquery_subscription_reopen as needed. 5) Do NOT mass-resubscribe every run — only fix drift (stale or expired). 6) Call solana_daily_log with what you closed or renewed. Follow SKILL.md subscription lifecycle: avoid subscribe/unsubscribe churn.",
648
+ enabled: true,
649
+ },
650
+ {
651
+ id: "whale-watch",
652
+ schedule: "45 */2 * * *",
653
+ agentId,
654
+ message:
655
+ "CRON_JOB: whale_activity_scan. You are scanning for large-wallet and smart-money style activity on relevant tokens. Do these steps: 1) Call solana_scan_launches or solana_scan_hot_pairs (as appropriate) to pick a short list of high-attention mints. 2) For each candidate mint, call solana_token_flows and solana_token_holders to detect large buys/sells, top holder shifts, and unusual accumulation or distribution. 3) Optionally use solana_bitquery_catalog with a template suited to large transfers if raw flow data is insufficient. 4) Call solana_memory_write with category 'whale_watch' summarizing notable wallets, flows, and whether action is warranted. 5) Call solana_daily_log with findings. This is surveillance — do not trade unless your strategy and risk checks already justify it.",
656
+ enabled: true,
657
+ },
633
658
  {
634
659
  id: "daily-performance-report",
635
660
  schedule: "0 4 * * *",
@@ -760,6 +785,7 @@ function configureGatewayScheduling(modeConfig, configPath = CONFIG_FILE) {
760
785
  config.channels.defaults.heartbeat.showOk = true;
761
786
  }
762
787
 
788
+ ensureAgentsDefaultsSchemaCompat(config);
763
789
  mkdirSync(CONFIG_DIR, { recursive: true });
764
790
  writeFileSync(configPath, JSON.stringify(config, null, 2) + "\n", "utf-8");
765
791
 
@@ -795,6 +821,7 @@ function ensureOpenResponsesEnabled(configPath = CONFIG_FILE) {
795
821
  if (!config.gateway.http.endpoints.responses) config.gateway.http.endpoints.responses = {};
796
822
  config.gateway.http.endpoints.responses.enabled = true;
797
823
 
824
+ ensureAgentsDefaultsSchemaCompat(config);
798
825
  mkdirSync(CONFIG_DIR, { recursive: true });
799
826
  writeFileSync(configPath, JSON.stringify(config, null, 2) + "\n", "utf-8");
800
827
  return configPath;
@@ -954,6 +981,7 @@ function seedXConfig(modeConfig, configPath = CONFIG_FILE, wizardOpts = {}) {
954
981
  }
955
982
  }
956
983
 
984
+ ensureAgentsDefaultsSchemaCompat(config);
957
985
  mkdirSync(CONFIG_DIR, { recursive: true });
958
986
  writeFileSync(configPath, JSON.stringify(config, null, 2) + "\n", "utf-8");
959
987
  return { configured: true, consumerKey: "***", profilesFound, agentIds };
@@ -1019,6 +1047,7 @@ function persistXProfileIdentities(configPath, modeConfig, identities) {
1019
1047
  if (touched) profilesTouched++;
1020
1048
  }
1021
1049
  if (profilesTouched === 0) return { written: 0 };
1050
+ ensureAgentsDefaultsSchemaCompat(config);
1022
1051
  mkdirSync(CONFIG_DIR, { recursive: true });
1023
1052
  writeFileSync(configPath, JSON.stringify(config, null, 2) + "\n", "utf-8");
1024
1053
  return { written: profilesTouched };
@@ -1464,6 +1493,7 @@ export class InstallerStepEngine {
1464
1493
  return { attempted: true, success: false, reason: "no_missing_gateway_defaults" };
1465
1494
  }
1466
1495
 
1496
+ ensureAgentsDefaultsSchemaCompat(config);
1467
1497
  mkdirSync(CONFIG_DIR, { recursive: true });
1468
1498
  const backupPath = `${CONFIG_FILE}.bak.${Date.now()}`;
1469
1499
  writeFileSync(backupPath, rawOriginal, "utf-8");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "solana-traderclaw",
3
- "version": "1.0.30",
3
+ "version": "1.0.31",
4
4
  "description": "TraderClaw V1 — autonomous Solana memecoin trading for OpenClaw (team edition: X/Twitter journal and engagement tools)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",