solana-traderclaw 1.0.91 → 1.0.92
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,7 +1,7 @@
|
|
|
1
1
|
// OpenClaw Gateway Configuration — TraderClaw V1-Upgraded (Single Agent)
|
|
2
|
-
// Single "main" agent with 5-minute heartbeat + cron jobs
|
|
3
|
-
//
|
|
4
|
-
//
|
|
2
|
+
// Single "main" agent with 5-minute heartbeat + 10 consolidated cron jobs.
|
|
3
|
+
// Consolidated from 13 → 10: portfolio-health (dead-money+whale+risk-audit),
|
|
4
|
+
// trust-refresh (source-reputation+deployer-trust). Shortened prompts.
|
|
5
5
|
{
|
|
6
6
|
agents: {
|
|
7
7
|
list: [
|
|
@@ -22,6 +22,9 @@
|
|
|
22
22
|
keepLines: 2000
|
|
23
23
|
},
|
|
24
24
|
jobs: [
|
|
25
|
+
<<<<<<< feat/cron-jobs-upgrade
|
|
26
|
+
// ── Alpha Scanning ──────────────────────────────────────────────
|
|
27
|
+
=======
|
|
25
28
|
// ── Strategy & Learning ───────────────────────────────────────
|
|
26
29
|
{
|
|
27
30
|
id: "strategy-evolution",
|
|
@@ -32,119 +35,113 @@
|
|
|
32
35
|
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.",
|
|
33
36
|
enabled: true
|
|
34
37
|
},
|
|
38
|
+
>>>>>>> main
|
|
35
39
|
{
|
|
36
|
-
id: "
|
|
40
|
+
id: "alpha-scan",
|
|
37
41
|
schedule: "0 */3 * * *",
|
|
38
42
|
agentId: "main",
|
|
39
43
|
sessionTarget: "isolated",
|
|
40
|
-
delivery: { mode: "
|
|
41
|
-
message: "CRON_JOB:
|
|
44
|
+
delivery: { mode: "announce", channel: "last", bestEffort: true },
|
|
45
|
+
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
46
|
enabled: true
|
|
43
47
|
},
|
|
44
48
|
|
|
45
|
-
// ──
|
|
49
|
+
// ── Portfolio Health (combined dead-money + whale + risk audit) ──
|
|
46
50
|
{
|
|
47
|
-
id: "
|
|
48
|
-
schedule: "0 */
|
|
51
|
+
id: "portfolio-health",
|
|
52
|
+
schedule: "0 */4 * * *",
|
|
49
53
|
agentId: "main",
|
|
50
54
|
sessionTarget: "isolated",
|
|
51
|
-
delivery: { mode: "
|
|
52
|
-
message: "CRON_JOB:
|
|
55
|
+
delivery: { mode: "announce", channel: "last", bestEffort: true },
|
|
56
|
+
message: "CRON_JOB: portfolio_health\n\nCombined dead-money + whale + risk audit. solana_capital_status + solana_positions → solana_token_snapshot per position → dead money exit (loss>40% or 90min+down+low vol) → whale flags (>5% supply moves) → risk checks (concentration/drawdown/exposure) → sell if CRITICAL → solana_memory_write tag 'portfolio_health'.",
|
|
53
57
|
enabled: true
|
|
54
58
|
},
|
|
55
59
|
|
|
56
|
-
// ──
|
|
60
|
+
// ── Trust Refresh (combined source + deployer trust) ────────────
|
|
57
61
|
{
|
|
58
|
-
id: "
|
|
59
|
-
schedule: "
|
|
62
|
+
id: "trust-refresh",
|
|
63
|
+
schedule: "0 */8 * * *",
|
|
60
64
|
agentId: "main",
|
|
61
65
|
sessionTarget: "isolated",
|
|
62
66
|
delivery: { mode: "none" },
|
|
63
|
-
message: "CRON_JOB:
|
|
67
|
+
message: "CRON_JOB: trust_refresh\n\nCombined source + deployer trust. solana_source_trust_refresh + solana_deployer_trust_refresh → solana_alpha_sources + solana_trades for win rates → solana_source_trust_get + solana_deployer_trust_get, flag <30 → solana_memory_write tag 'trust_refresh'.",
|
|
64
68
|
enabled: true
|
|
65
69
|
},
|
|
66
70
|
|
|
67
|
-
// ──
|
|
68
|
-
{
|
|
69
|
-
id: "dead-money-sweep",
|
|
70
|
-
schedule: "0 */2 * * *",
|
|
71
|
-
agentId: "main",
|
|
72
|
-
sessionTarget: "isolated",
|
|
73
|
-
delivery: { mode: "none" },
|
|
74
|
-
message: "CRON_JOB: dead_money_sweep\n\nStep 1: Call solana_positions to get all open LOCAL_MANAGED positions.\n\nStep 2: For each position, call solana_token_snapshot for current price and 24h volume.\n\nStep 3: Apply dead money criteria (ALL four must be true):\n- Loss > 40%\n- Held 90+ min AND still down 5%+\n- 24h volume < $5,000\n- Price flat (±5%) for 4+ hours\n\nStep 4: For flagged positions, execute exit via solana_trade_execute with side 'sell', max slippage 2000bps.\n\nStep 5: Call solana_trade_review for each exit.\n\nStep 6: Write sweep report via solana_memory_write with tag 'dead_money'.\n\nFORMATTING RULES:\n- Every token reference MUST use SYMBOL (full_CA) format.\n- Every TX MUST include solscan link.",
|
|
75
|
-
enabled: true
|
|
76
|
-
},
|
|
71
|
+
// ── On-Chain Intelligence ───────────────────────────────────────
|
|
77
72
|
{
|
|
78
|
-
id: "
|
|
79
|
-
schedule: "
|
|
73
|
+
id: "meta-rotation",
|
|
74
|
+
schedule: "30 */8 * * *",
|
|
80
75
|
agentId: "main",
|
|
81
76
|
sessionTarget: "isolated",
|
|
82
|
-
delivery: { mode: "
|
|
83
|
-
message: "CRON_JOB:
|
|
77
|
+
delivery: { mode: "announce", channel: "last", bestEffort: true },
|
|
78
|
+
message: "CRON_JOB: meta_rotation_analysis\n\nx_search_tweets trending topics → solana_scan_launches → categorize by narrative cluster → per-cluster metrics → compare vs solana_memory_search tag 'meta_rotation' → declare hot/fading clusters → solana_memory_write tag 'meta_rotation'.",
|
|
84
79
|
enabled: true
|
|
85
80
|
},
|
|
86
81
|
|
|
87
|
-
// ──
|
|
82
|
+
// ── Strategy & Learning ─────────────────────────────────────────
|
|
88
83
|
{
|
|
89
|
-
id: "
|
|
90
|
-
schedule: "0
|
|
84
|
+
id: "strategy-evolution",
|
|
85
|
+
schedule: "0 6 * * *",
|
|
91
86
|
agentId: "main",
|
|
92
87
|
sessionTarget: "isolated",
|
|
93
|
-
delivery: { mode: "
|
|
94
|
-
message: "CRON_JOB:
|
|
88
|
+
delivery: { mode: "announce", channel: "last", bestEffort: true },
|
|
89
|
+
message: "CRON_JOB: strategy_evolution\n\nDaily strategy review. solana_journal_summary — if <10 closed trades since last evolution, log 'insufficient data' and stop. Otherwise: solana_trades to bucket by confidence tier → solana_strategy_state for current weights → analyze tier performance → solana_strategy_update with conservative adjustments (max 10% per weight per cycle) → solana_memory_write tag 'strategy_evolution'.",
|
|
95
90
|
enabled: true
|
|
96
91
|
},
|
|
97
92
|
|
|
98
|
-
// ──
|
|
93
|
+
// ── Portfolio Maintenance ───────────────────────────────────────
|
|
99
94
|
{
|
|
100
|
-
id: "
|
|
101
|
-
schedule: "
|
|
95
|
+
id: "subscription-cleanup",
|
|
96
|
+
schedule: "15 */8 * * *",
|
|
102
97
|
agentId: "main",
|
|
103
98
|
sessionTarget: "isolated",
|
|
104
|
-
delivery: { mode: "
|
|
105
|
-
message: "CRON_JOB:
|
|
99
|
+
delivery: { mode: "announce", channel: "last", bestEffort: true },
|
|
100
|
+
message: "CRON_JOB: subscription_cleanup\n\nsolana_positions for open CAs → solana_bitquery_subscriptions for active subs (if AUTH_SCOPE_MISSING, log and stop) → match subs to positions → solana_bitquery_unsubscribe orphaned subs → solana_memory_write tag 'subscription_cleanup'. Summarize before/after counts.",
|
|
106
101
|
enabled: true
|
|
107
102
|
},
|
|
108
103
|
|
|
109
|
-
// ──
|
|
104
|
+
// ── Reporting ───────────────────────────────────────────────────
|
|
110
105
|
{
|
|
111
|
-
id: "
|
|
112
|
-
schedule: "0
|
|
106
|
+
id: "daily-performance-report",
|
|
107
|
+
schedule: "0 4 * * *",
|
|
113
108
|
agentId: "main",
|
|
114
109
|
sessionTarget: "isolated",
|
|
115
|
-
delivery: { mode: "
|
|
116
|
-
message: "CRON_JOB:
|
|
110
|
+
delivery: { mode: "announce", channel: "telegram" },
|
|
111
|
+
message: "CRON_JOB: daily_performance_report\n\nCompile 24h report. solana_journal_summary + solana_capital_status + solana_positions + solana_trades + solana_strategy_state → sections: Portfolio Summary, Trading Activity (count/win rate/PnL), Best/Worst Trades, Strategy State, Risk Metrics, Recommendations → solana_memory_write tag 'daily_report'. Deliver full report.",
|
|
117
112
|
enabled: true
|
|
118
113
|
},
|
|
119
114
|
|
|
120
|
-
// ── Intelligence Lab
|
|
115
|
+
// ── Intelligence Lab ────────────────────────────────────────────
|
|
121
116
|
{
|
|
122
117
|
id: "intelligence-lab-eval",
|
|
123
|
-
schedule: "0
|
|
118
|
+
schedule: "0 16 * * *",
|
|
124
119
|
agentId: "main",
|
|
125
120
|
sessionTarget: "isolated",
|
|
126
121
|
delivery: { mode: "none" },
|
|
127
|
-
message: "CRON_JOB: intelligence_lab_eval\n\
|
|
122
|
+
message: "CRON_JOB: intelligence_lab_eval\n\nsolana_candidate_get — if <20 labeled candidates, log 'insufficient data' and exit. Otherwise: solana_evaluation_report → solana_model_registry for challengers → solana_replay_eval if challenger exists → solana_model_promote if challenger beats champion by >5% F1 → solana_memory_write tag 'intelligence_lab'.",
|
|
128
123
|
enabled: true
|
|
129
124
|
},
|
|
125
|
+
|
|
126
|
+
// ── Memory Maintenance ──────────────────────────────────────────
|
|
130
127
|
{
|
|
131
|
-
id: "
|
|
132
|
-
schedule: "0
|
|
128
|
+
id: "memory-trim",
|
|
129
|
+
schedule: "0 3 * * *",
|
|
133
130
|
agentId: "main",
|
|
134
131
|
sessionTarget: "isolated",
|
|
135
132
|
delivery: { mode: "none" },
|
|
136
|
-
message: "CRON_JOB:
|
|
133
|
+
message: "CRON_JOB: memory_trim\n\nsolana_memory_trim dryRun:true first → review → solana_memory_trim retentionDays:2 → solana_memory_write tag 'memory_trim' with summary.",
|
|
137
134
|
enabled: true
|
|
138
135
|
},
|
|
139
136
|
|
|
140
|
-
// ──
|
|
137
|
+
// ── Balance Watchdog ────────────────────────────────────────────
|
|
141
138
|
{
|
|
142
|
-
id: "
|
|
143
|
-
schedule: "0
|
|
139
|
+
id: "balance-watchdog",
|
|
140
|
+
schedule: "0 */2 * * *",
|
|
144
141
|
agentId: "main",
|
|
145
142
|
sessionTarget: "isolated",
|
|
146
|
-
delivery: { mode: "
|
|
147
|
-
message: "
|
|
143
|
+
delivery: { mode: "announce", channel: "telegram" },
|
|
144
|
+
message: "Balance watchdog. 1) solana_capital_status 2) solana_positions 3) solana_context_snapshot_read 4) Compare real vs believed. If mismatch: solana_context_snapshot_write with corrected state, summarize changes. If match: reply WATCHDOG_OK.",
|
|
148
145
|
enabled: true
|
|
149
146
|
}
|
|
150
147
|
]
|
package/config/gateway-v1.json5
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
// OpenClaw Gateway Configuration — TraderClaw V1
|
|
2
|
-
// Single "main" agent with 5-minute heartbeat + cron jobs
|
|
3
|
-
//
|
|
4
|
-
//
|
|
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),
|
|
4
|
+
// trust-refresh (source-reputation+deployer-trust). Shortened prompts.
|
|
5
5
|
{
|
|
6
6
|
agents: {
|
|
7
7
|
list: [
|
|
@@ -22,118 +22,113 @@
|
|
|
22
22
|
keepLines: 2000
|
|
23
23
|
},
|
|
24
24
|
jobs: [
|
|
25
|
-
// ──
|
|
25
|
+
// ── Alpha Scanning ──────────────────────────────────────────────
|
|
26
26
|
{
|
|
27
|
-
id: "
|
|
28
|
-
schedule: "0 */
|
|
27
|
+
id: "alpha-scan",
|
|
28
|
+
schedule: "0 */3 * * *",
|
|
29
29
|
agentId: "main",
|
|
30
30
|
sessionTarget: "isolated",
|
|
31
|
-
delivery: { mode: "
|
|
32
|
-
message: "CRON_JOB:
|
|
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.",
|
|
33
33
|
enabled: true
|
|
34
34
|
},
|
|
35
|
+
|
|
36
|
+
// ── Portfolio Health (combined dead-money + whale + risk audit) ──
|
|
35
37
|
{
|
|
36
|
-
id: "
|
|
37
|
-
schedule: "0 */
|
|
38
|
+
id: "portfolio-health",
|
|
39
|
+
schedule: "0 */4 * * *",
|
|
38
40
|
agentId: "main",
|
|
39
41
|
sessionTarget: "isolated",
|
|
40
|
-
delivery: { mode: "
|
|
41
|
-
message: "CRON_JOB:
|
|
42
|
+
delivery: { mode: "announce", channel: "last", bestEffort: true },
|
|
43
|
+
message: "CRON_JOB: portfolio_health\n\nCombined dead-money + whale + risk audit. solana_capital_status + solana_positions → solana_token_snapshot per position → dead money exit (loss>40% or 90min+down+low vol) → whale flags (>5% supply moves) → risk checks (concentration/drawdown/exposure) → sell if CRITICAL → solana_memory_write tag 'portfolio_health'.",
|
|
42
44
|
enabled: true
|
|
43
45
|
},
|
|
44
46
|
|
|
45
|
-
// ──
|
|
47
|
+
// ── Trust Refresh (combined source + deployer trust) ────────────
|
|
46
48
|
{
|
|
47
|
-
id: "
|
|
48
|
-
schedule: "0 */
|
|
49
|
+
id: "trust-refresh",
|
|
50
|
+
schedule: "0 */8 * * *",
|
|
49
51
|
agentId: "main",
|
|
50
52
|
sessionTarget: "isolated",
|
|
51
53
|
delivery: { mode: "none" },
|
|
52
|
-
message: "CRON_JOB:
|
|
54
|
+
message: "CRON_JOB: trust_refresh\n\nCombined source + deployer trust. solana_source_trust_refresh + solana_deployer_trust_refresh → solana_alpha_sources + solana_trades for win rates → solana_source_trust_get + solana_deployer_trust_get, flag <30 → solana_memory_write tag 'trust_refresh'.",
|
|
53
55
|
enabled: true
|
|
54
56
|
},
|
|
55
57
|
|
|
56
|
-
// ── On-Chain Intelligence
|
|
58
|
+
// ── On-Chain Intelligence ───────────────────────────────────────
|
|
57
59
|
{
|
|
58
60
|
id: "meta-rotation",
|
|
59
|
-
schedule: "30 */
|
|
61
|
+
schedule: "30 */8 * * *",
|
|
60
62
|
agentId: "main",
|
|
61
63
|
sessionTarget: "isolated",
|
|
62
|
-
delivery: { mode: "
|
|
63
|
-
message: "CRON_JOB: meta_rotation_analysis\n\
|
|
64
|
+
delivery: { mode: "announce", channel: "last", bestEffort: true },
|
|
65
|
+
message: "CRON_JOB: meta_rotation_analysis\n\nx_search_tweets trending topics → solana_scan_launches → categorize by narrative cluster → per-cluster metrics → compare vs solana_memory_search tag 'meta_rotation' → declare hot/fading clusters → solana_memory_write tag 'meta_rotation'.",
|
|
64
66
|
enabled: true
|
|
65
67
|
},
|
|
66
68
|
|
|
67
|
-
// ──
|
|
69
|
+
// ── Strategy & Learning ─────────────────────────────────────────
|
|
68
70
|
{
|
|
69
|
-
id: "
|
|
70
|
-
schedule: "0
|
|
71
|
+
id: "strategy-evolution",
|
|
72
|
+
schedule: "0 6 * * *",
|
|
71
73
|
agentId: "main",
|
|
72
74
|
sessionTarget: "isolated",
|
|
73
|
-
delivery: { mode: "
|
|
74
|
-
message: "CRON_JOB:
|
|
75
|
+
delivery: { mode: "announce", channel: "last", bestEffort: true },
|
|
76
|
+
message: "CRON_JOB: strategy_evolution\n\nDaily strategy review. solana_journal_summary — if <10 closed trades since last evolution, log 'insufficient data' and stop. Otherwise: solana_trades to bucket by confidence tier → solana_strategy_state for current weights → analyze tier performance → solana_strategy_update with conservative adjustments (max 10% per weight per cycle) → solana_memory_write tag 'strategy_evolution'.",
|
|
75
77
|
enabled: true
|
|
76
78
|
},
|
|
79
|
+
|
|
80
|
+
// ── Portfolio Maintenance ───────────────────────────────────────
|
|
77
81
|
{
|
|
78
82
|
id: "subscription-cleanup",
|
|
79
|
-
schedule: "
|
|
83
|
+
schedule: "15 */8 * * *",
|
|
80
84
|
agentId: "main",
|
|
81
85
|
sessionTarget: "isolated",
|
|
82
|
-
delivery: { mode: "
|
|
83
|
-
message: "CRON_JOB: subscription_cleanup\n\
|
|
86
|
+
delivery: { mode: "announce", channel: "last", bestEffort: true },
|
|
87
|
+
message: "CRON_JOB: subscription_cleanup\n\nsolana_positions for open CAs → solana_bitquery_subscriptions for active subs (if AUTH_SCOPE_MISSING, log and stop) → match subs to positions → solana_bitquery_unsubscribe orphaned subs → solana_memory_write tag 'subscription_cleanup'. Summarize before/after counts.",
|
|
84
88
|
enabled: true
|
|
85
89
|
},
|
|
86
90
|
|
|
87
|
-
// ── Reporting
|
|
91
|
+
// ── Reporting ───────────────────────────────────────────────────
|
|
88
92
|
{
|
|
89
|
-
id: "daily-report",
|
|
93
|
+
id: "daily-performance-report",
|
|
90
94
|
schedule: "0 4 * * *",
|
|
91
95
|
agentId: "main",
|
|
92
96
|
sessionTarget: "isolated",
|
|
93
|
-
delivery: { mode: "
|
|
94
|
-
message: "CRON_JOB: daily_performance_report\n\
|
|
97
|
+
delivery: { mode: "announce", channel: "telegram" },
|
|
98
|
+
message: "CRON_JOB: daily_performance_report\n\nCompile 24h report. solana_journal_summary + solana_capital_status + solana_positions + solana_trades + solana_strategy_state → sections: Portfolio Summary, Trading Activity (count/win rate/PnL), Best/Worst Trades, Strategy State, Risk Metrics, Recommendations → solana_memory_write tag 'daily_report'. Deliver full report.",
|
|
95
99
|
enabled: true
|
|
96
100
|
},
|
|
97
101
|
|
|
98
|
-
// ──
|
|
102
|
+
// ── Intelligence Lab ────────────────────────────────────────────
|
|
99
103
|
{
|
|
100
|
-
id: "
|
|
101
|
-
schedule: "0
|
|
104
|
+
id: "intelligence-lab-eval",
|
|
105
|
+
schedule: "0 16 * * *",
|
|
102
106
|
agentId: "main",
|
|
103
107
|
sessionTarget: "isolated",
|
|
104
108
|
delivery: { mode: "none" },
|
|
105
|
-
message: "CRON_JOB:
|
|
109
|
+
message: "CRON_JOB: intelligence_lab_eval\n\nsolana_candidate_get — if <20 labeled candidates, log 'insufficient data' and exit. Otherwise: solana_evaluation_report → solana_model_registry for challengers → solana_replay_eval if challenger exists → solana_model_promote if challenger beats champion by >5% F1 → solana_memory_write tag 'intelligence_lab'.",
|
|
106
110
|
enabled: true
|
|
107
111
|
},
|
|
108
112
|
|
|
109
|
-
// ──
|
|
113
|
+
// ── Memory Maintenance ──────────────────────────────────────────
|
|
110
114
|
{
|
|
111
|
-
id: "
|
|
112
|
-
schedule: "0
|
|
115
|
+
id: "memory-trim",
|
|
116
|
+
schedule: "0 3 * * *",
|
|
113
117
|
agentId: "main",
|
|
114
118
|
sessionTarget: "isolated",
|
|
115
119
|
delivery: { mode: "none" },
|
|
116
|
-
message: "CRON_JOB:
|
|
120
|
+
message: "CRON_JOB: memory_trim\n\nsolana_memory_trim dryRun:true first → review → solana_memory_trim retentionDays:2 → solana_memory_write tag 'memory_trim' with summary.",
|
|
117
121
|
enabled: true
|
|
118
122
|
},
|
|
119
123
|
|
|
120
|
-
// ──
|
|
124
|
+
// ── Balance Watchdog ────────────────────────────────────────────
|
|
121
125
|
{
|
|
122
|
-
id: "
|
|
123
|
-
schedule: "0 */
|
|
124
|
-
agentId: "main",
|
|
125
|
-
sessionTarget: "isolated",
|
|
126
|
-
delivery: { mode: "none" },
|
|
127
|
-
message: "CRON_JOB: intelligence_lab_eval\n\nStep 1: Check candidate dataset size via solana_candidate_get. If fewer than 20 labeled candidates, log 'insufficient data for evaluation' and exit.\n\nStep 2: Run evaluation report via solana_evaluation_report — get confusion matrix, accuracy, precision, recall, F1 for current champion model.\n\nStep 3: Check model registry via solana_model_registry for any challenger models.\n\nStep 4: If challenger exists, run replay via solana_replay_run comparing champion vs challenger on recent candidates.\n\nStep 5: Generate replay report via solana_replay_report.\n\nStep 6: If challenger outperforms champion (higher F1 AND accuracy), promote via solana_model_promote.\n\nStep 7: Log evaluation results via solana_memory_write with tag 'intelligence_lab_eval'. Include: model accuracy, F1, promotion decision, dataset size.\n\nDo not execute trades. Do not ask questions.",
|
|
128
|
-
enabled: true
|
|
129
|
-
},
|
|
130
|
-
{
|
|
131
|
-
id: "source-trust-refresh",
|
|
132
|
-
schedule: "0 */6 * * *",
|
|
126
|
+
id: "balance-watchdog",
|
|
127
|
+
schedule: "0 */2 * * *",
|
|
133
128
|
agentId: "main",
|
|
134
129
|
sessionTarget: "isolated",
|
|
135
|
-
delivery: { mode: "
|
|
136
|
-
message: "
|
|
130
|
+
delivery: { mode: "announce", channel: "telegram" },
|
|
131
|
+
message: "Balance watchdog. 1) solana_capital_status 2) solana_positions 3) solana_context_snapshot_read 4) Compare real vs believed. If mismatch: solana_context_snapshot_write with corrected state, summarize changes. If match: reply WATCHDOG_OK.",
|
|
137
132
|
enabled: true
|
|
138
133
|
}
|
|
139
134
|
]
|
package/dist/index.js
CHANGED
|
@@ -1088,7 +1088,7 @@ var solanaTraderPlugin = {
|
|
|
1088
1088
|
const logsDir = path.join(dataDir, "logs");
|
|
1089
1089
|
const sharedLogsDir = path.join(logsDir, "shared");
|
|
1090
1090
|
const memoryDir = resolveMemoryDir(workspaceRoot);
|
|
1091
|
-
const memoryMdPath = path.join(workspaceRoot, "
|
|
1091
|
+
const memoryMdPath = path.join(workspaceRoot, "MEMORY.md");
|
|
1092
1092
|
const intelligenceLab = new IntelligenceLab(workspaceRoot);
|
|
1093
1093
|
const ensureDir = (dirPath) => {
|
|
1094
1094
|
if (!fs.existsSync(dirPath)) fs.mkdirSync(dirPath, { recursive: true });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "solana-traderclaw",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.92",
|
|
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",
|
|
@@ -10,7 +10,9 @@ Read MEMORY.md (auto-loaded). If empty or missing wallet/tier/strategy → run M
|
|
|
10
10
|
|
|
11
11
|
1. **MEMORY.md** (already in context): tier, wallet, mode, strategy version, watchlist, regime canary
|
|
12
12
|
2. **Daily log** (`memory/YYYY-MM-DD.md`, auto-loaded): what already happened today — don't repeat work
|
|
13
|
-
3. **
|
|
13
|
+
3. **Context engine** (automatic): `[TraderClaw Trading Context]` is injected into your system prompt at session start with current state, last 3 decisions, and entitlement limits. You do not need to call anything — just read it when present.
|
|
14
|
+
4. **Server-side memory** — call `solana_memory_search` for: `"source_reputation"`, `"strategy_drift_warning"`, `"pre_trade_rationale"`, `"meta_rotation"`
|
|
15
|
+
5. **QMD recall** — before analyzing any candidate, call `memory_search` with the token symbol or contract address. If you've seen this token before, use prior analysis to: skip repeat work, apply re-entry penalties, catch repeat rug patterns, and reference prior confidence scores.
|
|
14
16
|
|
|
15
17
|
## User Preferences Override (apply before any other step)
|
|
16
18
|
|
|
@@ -430,5 +432,5 @@ NEXT CYCLE: [1 sentence — what you're watching for]
|
|
|
430
432
|
| API endpoint reference | refs/api-reference.md |
|
|
431
433
|
| Wallet proof vs signup | SKILL.md § Wallet proof vs signup |
|
|
432
434
|
| Strategy evolution details | refs/strategy-evolution.md |
|
|
433
|
-
| Cron job definitions | refs/cron-jobs.md |
|
|
435
|
+
| Cron job definitions | refs/cron-jobs.md (10 consolidated jobs, ~39 sessions/day) |
|
|
434
436
|
| Position management details | refs/position-management.md |
|
|
@@ -19,131 +19,157 @@ At start of every cron job, check whether sufficient new data exists since last
|
|
|
19
19
|
|
|
20
20
|
---
|
|
21
21
|
|
|
22
|
-
## Job: `
|
|
22
|
+
## Job: `alpha_scan`
|
|
23
23
|
|
|
24
|
-
**Schedule:** Every
|
|
24
|
+
**Schedule:** Every 3 hours (`0 */3 * * *`) — 8 runs/day
|
|
25
25
|
|
|
26
|
-
**Purpose:**
|
|
26
|
+
**Purpose:** Scan new token launches, filter candidates, score quality, log alpha signals.
|
|
27
27
|
|
|
28
|
-
**
|
|
28
|
+
**Tools:** `solana_scan_launches`, `solana_token_snapshot`, `solana_token_holders`, `solana_token_risk`, `solana_alpha_log`, `solana_memory_write`
|
|
29
29
|
|
|
30
|
-
**
|
|
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.
|
|
31
31
|
|
|
32
|
-
**
|
|
32
|
+
**Configuration:**
|
|
33
|
+
- Model: Sonnet (judgment — scoring candidates, filtering quality signals)
|
|
34
|
+
- Thinking: off
|
|
35
|
+
- lightContext: on
|
|
36
|
+
- Delivery: announce/last/bestEffort
|
|
33
37
|
|
|
34
38
|
---
|
|
35
39
|
|
|
36
|
-
## Job: `
|
|
40
|
+
## Job: `portfolio_health`
|
|
37
41
|
|
|
38
|
-
**Schedule:**
|
|
42
|
+
**Schedule:** Every 4 hours (`0 */4 * * *`) — 6 runs/day
|
|
39
43
|
|
|
40
|
-
**Purpose:**
|
|
44
|
+
**Purpose:** Combined dead-money sweep + whale activity scan + portfolio risk audit. Replaces the old separate `dead_money_sweep`, `whale_watch`, and `risk_audit` jobs.
|
|
41
45
|
|
|
42
|
-
**
|
|
46
|
+
**Tools:** `solana_capital_status`, `solana_positions`, `solana_token_snapshot`, `solana_token_holders`, `solana_trade_execute` (defensive exits), `solana_trade_review`, `solana_memory_write`, `solana_killswitch_status`
|
|
43
47
|
|
|
44
|
-
**
|
|
45
|
-
- `solana_memory_search` with `"daily_report"` — yesterday's report for comparison
|
|
46
|
-
- `solana_memory_search` with `"strategy_evolution"` — most recent evolution cycle
|
|
48
|
+
**Workflow:** Capital + positions → per-position snapshot → dead money exit (loss>40% or 90min+down+low vol) → whale flags (>5% supply moves) → risk checks (concentration/drawdown/exposure) → sell if CRITICAL → write tag 'portfolio_health'.
|
|
47
49
|
|
|
48
|
-
**
|
|
50
|
+
**Configuration:**
|
|
51
|
+
- Model: Sonnet (judgment — dead money exits, whale flags, risk assessment)
|
|
52
|
+
- Thinking: off
|
|
53
|
+
- lightContext: on
|
|
54
|
+
- Delivery: announce/last/bestEffort
|
|
49
55
|
|
|
50
|
-
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## Job: `trust_refresh`
|
|
59
|
+
|
|
60
|
+
**Schedule:** Every 8 hours (`0 */8 * * *`) — 3 runs/day
|
|
61
|
+
|
|
62
|
+
**Purpose:** Combined source reputation recalculation + deployer trust refresh. Replaces the old separate `source_reputation_recalc` and `source_trust_refresh` jobs.
|
|
63
|
+
|
|
64
|
+
**Tools:** `solana_source_trust_refresh`, `solana_deployer_trust_refresh`, `solana_alpha_sources`, `solana_trades`, `solana_source_trust_get`, `solana_deployer_trust_get`, `solana_memory_write`
|
|
65
|
+
|
|
66
|
+
**Workflow:** Run both refresh functions → read source/deployer scores → flag any below 30 → write tag 'trust_refresh'.
|
|
67
|
+
|
|
68
|
+
**Configuration:**
|
|
69
|
+
- Model: Haiku (mechanical — run refresh functions, read/flag scores)
|
|
70
|
+
- Thinking: off
|
|
71
|
+
- lightContext: on
|
|
72
|
+
- Delivery: none
|
|
51
73
|
|
|
52
74
|
---
|
|
53
75
|
|
|
54
|
-
## Job: `
|
|
76
|
+
## Job: `meta_rotation_analysis`
|
|
55
77
|
|
|
56
|
-
**Schedule:** Every
|
|
78
|
+
**Schedule:** Every 8 hours, offset by 30 min (`30 */8 * * *`) — 3 runs/day
|
|
57
79
|
|
|
58
|
-
**Purpose:** Analyze which
|
|
80
|
+
**Purpose:** Analyze which narrative metas are hot, cooling, or dead.
|
|
59
81
|
|
|
60
|
-
**
|
|
82
|
+
**Tools:** `x_search_tweets`, `solana_scan_launches`, `solana_memory_search`, `solana_memory_write`
|
|
61
83
|
|
|
62
|
-
**Workflow:**
|
|
63
|
-
1. Retrieve last recalc state from memory
|
|
64
|
-
2. Query recent alpha-sourced trade outcomes
|
|
65
|
-
3. Calculate per-source metrics (win rate, avg PnL, conversion rate)
|
|
66
|
-
4. Compute reputation score (0-100)
|
|
67
|
-
5. Historical analysis via `solana_alpha_history`
|
|
68
|
-
6. Store updated scores with tag `source_reputation`
|
|
84
|
+
**Workflow:** Search X/Twitter trending → scan launches → categorize by narrative cluster → per-cluster metrics → compare vs prior rotation → declare hot/fading → write tag 'meta_rotation'.
|
|
69
85
|
|
|
70
|
-
**
|
|
86
|
+
**Configuration:**
|
|
87
|
+
- Model: Sonnet (judgment — categorize narratives, detect rotation)
|
|
88
|
+
- Thinking: off
|
|
89
|
+
- lightContext: on
|
|
90
|
+
- Delivery: announce/last/bestEffort
|
|
71
91
|
|
|
72
92
|
---
|
|
73
93
|
|
|
74
|
-
## Job: `
|
|
94
|
+
## Job: `strategy_evolution`
|
|
75
95
|
|
|
76
|
-
**Schedule:**
|
|
96
|
+
**Schedule:** Daily at 06:00 UTC (`0 6 * * *`) — 1 run/day
|
|
77
97
|
|
|
78
|
-
**Purpose:**
|
|
98
|
+
**Purpose:** Full self-improvement cycle — recurring pattern detection, drift investigation, ADL/VFM-validated weight adjustments, named pattern recognition, discovery filter evolution.
|
|
79
99
|
|
|
80
|
-
**
|
|
81
|
-
1. Loss > 40%
|
|
82
|
-
2. Held 90+ minutes AND still down 5%+
|
|
83
|
-
3. 24h volume < $5,000
|
|
84
|
-
4. Price flat (±5%) for 4+ hours
|
|
100
|
+
**Full details:** → refs/strategy-evolution.md
|
|
85
101
|
|
|
86
|
-
**Tools:** `
|
|
102
|
+
**Tools:** `solana_journal_summary`, `solana_strategy_state`, `solana_memory_search`, `solana_trades`, `solana_strategy_update`, `solana_memory_write`
|
|
87
103
|
|
|
88
|
-
**
|
|
104
|
+
**Workflow:** Journal summary → gate on 10+ closed trades → bucket by confidence tier → current weights → analyze tier performance → conservative adjustments (max 10% per weight per cycle) → write tag 'strategy_evolution'.
|
|
89
105
|
|
|
90
|
-
**
|
|
106
|
+
**Configuration:**
|
|
107
|
+
- Model: Sonnet (deep reasoning — weight adjustments, pattern detection)
|
|
108
|
+
- Thinking: **on** (multi-step reasoning chain benefits from extended thinking)
|
|
109
|
+
- lightContext: **off** (needs full strategy state, historical patterns, workspace context)
|
|
110
|
+
- Delivery: announce/last/bestEffort
|
|
91
111
|
|
|
92
112
|
---
|
|
93
113
|
|
|
94
114
|
## Job: `subscription_cleanup`
|
|
95
115
|
|
|
96
|
-
**Schedule:** Every
|
|
116
|
+
**Schedule:** Every 8 hours, offset by 15 min (`15 */8 * * *`) — 3 runs/day
|
|
97
117
|
|
|
98
|
-
**Purpose:** Manage Bitquery subscription lifecycle.
|
|
118
|
+
**Purpose:** Manage Bitquery subscription lifecycle — remove orphaned subscriptions, reopen expiring ones.
|
|
99
119
|
|
|
100
|
-
**
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
3. Unsubscribe from tokens no longer held or monitored
|
|
104
|
-
4. Verify critical subscriptions (discovery streams) are healthy
|
|
120
|
+
**Tools:** `solana_positions`, `solana_bitquery_subscriptions`, `solana_bitquery_unsubscribe`, `solana_bitquery_subscription_reopen`, `solana_memory_write`
|
|
121
|
+
|
|
122
|
+
**Workflow:** List open position CAs → list active subs (if AUTH_SCOPE_MISSING, log and stop) → match subs to positions → unsubscribe orphans → write tag 'subscription_cleanup'.
|
|
105
123
|
|
|
106
|
-
**
|
|
124
|
+
**Configuration:**
|
|
125
|
+
- Model: Haiku (mechanical — match subs to positions, unsubscribe orphans)
|
|
126
|
+
- Thinking: off
|
|
127
|
+
- lightContext: on
|
|
128
|
+
- Delivery: announce/last/bestEffort
|
|
107
129
|
|
|
108
130
|
---
|
|
109
131
|
|
|
110
|
-
## Job: `
|
|
132
|
+
## Job: `daily_performance_report`
|
|
111
133
|
|
|
112
|
-
**Schedule:**
|
|
134
|
+
**Schedule:** Daily at 04:00 UTC (`0 4 * * *`) — 1 run/day
|
|
113
135
|
|
|
114
|
-
**Purpose:**
|
|
136
|
+
**Purpose:** Comprehensive daily performance summary.
|
|
115
137
|
|
|
116
|
-
**
|
|
117
|
-
1. Review recent scan results and alpha signals for narrative patterns
|
|
118
|
-
2. Group tokens by narrative cluster (AI, animals, political, culture, etc.)
|
|
119
|
-
3. Compare volume/momentum trends across clusters
|
|
120
|
-
4. Identify hot metas (rising volume) and cooling metas (declining volume)
|
|
121
|
-
5. Log observations with tag `meta_rotation`
|
|
138
|
+
**Gating:** Only if trading activity in past 24 hours. Check via `solana_journal_summary`.
|
|
122
139
|
|
|
123
|
-
**Tools:** `
|
|
140
|
+
**Tools:** `solana_journal_summary`, `solana_positions`, `solana_capital_status`, `solana_trades`, `solana_strategy_state`, `solana_memory_search`, `solana_memory_write`
|
|
141
|
+
|
|
142
|
+
**Outputs:** Memory entry with: daily PnL, win/loss count, win rate, best/worst trades, avg hold time, capital utilization, regime summary, lessons. Tag: `daily_report`.
|
|
143
|
+
|
|
144
|
+
**Configuration:**
|
|
145
|
+
- Model: Sonnet (judgment — compile narrative report with recommendations)
|
|
146
|
+
- Thinking: off
|
|
147
|
+
- lightContext: **off** (needs complete workspace context for comprehensive report)
|
|
148
|
+
- Delivery: announce/**telegram**
|
|
124
149
|
|
|
125
150
|
---
|
|
126
151
|
|
|
127
152
|
## Job: `intelligence_lab_eval`
|
|
128
153
|
|
|
129
|
-
**Schedule:**
|
|
154
|
+
**Schedule:** Daily at 16:00 UTC (`0 16 * * *`) — 1 run/day
|
|
130
155
|
|
|
131
156
|
**Purpose:** Run intelligence lab evaluation — compute model accuracy, compare champion vs challenger, generate replay reports.
|
|
132
157
|
|
|
133
|
-
**
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
3. If challenger model exists, run replay: `solana_replay_run` + `solana_replay_report`
|
|
137
|
-
4. If challenger outperforms champion, promote: `solana_model_promote`
|
|
138
|
-
5. Refresh source/deployer trust scores: `solana_source_trust_refresh`, `solana_deployer_trust_refresh`
|
|
158
|
+
**Tools:** `solana_candidate_get`, `solana_evaluation_report`, `solana_model_registry`, `solana_replay_run`, `solana_replay_report`, `solana_model_promote`, `solana_memory_write`
|
|
159
|
+
|
|
160
|
+
**Workflow:** Check candidate count (gate on 20+) → evaluation report → check for challengers → replay eval if challenger exists → promote if >5% F1 improvement → write tag 'intelligence_lab'.
|
|
139
161
|
|
|
140
|
-
**
|
|
162
|
+
**Configuration:**
|
|
163
|
+
- Model: Sonnet (deep reasoning — model comparison, promotion decisions)
|
|
164
|
+
- Thinking: **on** (requires careful reasoning about statistical significance)
|
|
165
|
+
- lightContext: **off** (needs full model registry context and evaluation history)
|
|
166
|
+
- Delivery: none
|
|
141
167
|
|
|
142
168
|
---
|
|
143
169
|
|
|
144
170
|
## Job: `memory_trim`
|
|
145
171
|
|
|
146
|
-
**Schedule:** Daily at 03:00 UTC (`0 3 * * *`)
|
|
172
|
+
**Schedule:** Daily at 03:00 UTC (`0 3 * * *`) — 1 run/day
|
|
147
173
|
|
|
148
174
|
**Purpose:** Smart memory compaction — trims local memory footprint to the last 2 days while preserving all critical data (positions, rules, identity, strategy weights, permanent learnings).
|
|
149
175
|
|
|
@@ -166,3 +192,45 @@ At start of every cron job, check whether sufficient new data exists since last
|
|
|
166
192
|
4. Log results via `solana_memory_write` with tag `memory_trim`
|
|
167
193
|
|
|
168
194
|
**Tools:** `solana_memory_trim`, `solana_memory_write`
|
|
195
|
+
|
|
196
|
+
**Configuration:**
|
|
197
|
+
- Model: Haiku (mechanical — prune old entries, simple retention logic)
|
|
198
|
+
- Thinking: off
|
|
199
|
+
- lightContext: on
|
|
200
|
+
- Delivery: none
|
|
201
|
+
|
|
202
|
+
---
|
|
203
|
+
|
|
204
|
+
## Job: `balance_watchdog`
|
|
205
|
+
|
|
206
|
+
**Schedule:** Every 2 hours (`0 */2 * * *`) — 12 runs/day
|
|
207
|
+
|
|
208
|
+
**Purpose:** Context snapshot drift correction — compare real wallet/position state against believed state, correct mismatches.
|
|
209
|
+
|
|
210
|
+
**Tools:** `solana_capital_status`, `solana_positions`, `solana_context_snapshot_read`, `solana_context_snapshot_write`
|
|
211
|
+
|
|
212
|
+
**Workflow:** Read real state (capital + positions) → read believed state (context snapshot) → compare → if mismatch: write corrected snapshot, summarize changes → if match: reply WATCHDOG_OK.
|
|
213
|
+
|
|
214
|
+
**Configuration:**
|
|
215
|
+
- Model: Haiku (mechanical — compare real vs believed state, correct drift)
|
|
216
|
+
- Thinking: off
|
|
217
|
+
- lightContext: on
|
|
218
|
+
- Delivery: announce/**telegram**
|
|
219
|
+
|
|
220
|
+
---
|
|
221
|
+
|
|
222
|
+
## Schedule Summary
|
|
223
|
+
|
|
224
|
+
| # | Job ID | Cron Expression | Runs/Day | Model | Thinking | lightContext | Delivery |
|
|
225
|
+
|---|--------|----------------|----------|-------|----------|-------------|----------|
|
|
226
|
+
| 1 | `alpha-scan` | `0 */3 * * *` | 8 | Sonnet | off | on | announce/last |
|
|
227
|
+
| 2 | `portfolio-health` | `0 */4 * * *` | 6 | Sonnet | off | on | announce/last |
|
|
228
|
+
| 3 | `trust-refresh` | `0 */8 * * *` | 3 | Haiku | off | on | none |
|
|
229
|
+
| 4 | `meta-rotation` | `30 */8 * * *` | 3 | Sonnet | off | on | announce/last |
|
|
230
|
+
| 5 | `strategy-evolution` | `0 6 * * *` | 1 | Sonnet | **on** | **off** | announce/last |
|
|
231
|
+
| 6 | `subscription-cleanup` | `15 */8 * * *` | 3 | Haiku | off | on | announce/last |
|
|
232
|
+
| 7 | `daily-performance-report` | `0 4 * * *` | 1 | Sonnet | off | **off** | announce/telegram |
|
|
233
|
+
| 8 | `intelligence-lab-eval` | `0 16 * * *` | 1 | Sonnet | **on** | **off** | none |
|
|
234
|
+
| 9 | `memory-trim` | `0 3 * * *` | 1 | Haiku | off | on | none |
|
|
235
|
+
| 10 | `balance-watchdog` | `0 */2 * * *` | 12 | Haiku | off | on | announce/telegram |
|
|
236
|
+
| | **Total** | | **39** | | | | |
|