solana-traderclaw 1.0.134 → 1.0.136

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.
@@ -127,7 +127,7 @@ async function rawFetch(url, method, body, bearerToken, timeout = 15e3) {
127
127
  clearTimeout(timer);
128
128
  }
129
129
  }
130
- var SessionManager = class {
130
+ var SessionManager = class _SessionManager {
131
131
  baseUrl;
132
132
  apiKey;
133
133
  accessToken = null;
@@ -150,6 +150,8 @@ var SessionManager = class {
150
150
  tokenGeneration = 0;
151
151
  proactiveRefreshTimer = null;
152
152
  proactiveRefreshRunning = false;
153
+ lastChallengeAttemptAt = 0;
154
+ static CHALLENGE_COOLDOWN_MS = 5 * 60 * 1e3;
153
155
  constructor(config) {
154
156
  this.baseUrl = config.baseUrl.replace(/\/+$/, "");
155
157
  this.apiKey = config.apiKey;
@@ -339,6 +341,15 @@ var SessionManager = class {
339
341
  }
340
342
  }
341
343
  this.log.info("[session] Starting challenge flow...");
344
+ const nowMs = Date.now();
345
+ const sinceLastChallenge = nowMs - this.lastChallengeAttemptAt;
346
+ if (this.lastChallengeAttemptAt > 0 && sinceLastChallenge < _SessionManager.CHALLENGE_COOLDOWN_MS) {
347
+ const waitSec = Math.ceil((_SessionManager.CHALLENGE_COOLDOWN_MS - sinceLastChallenge) / 1e3);
348
+ throw new Error(
349
+ `[session] Challenge cooldown active \u2014 skipping to prevent server flood. Retry in ${waitSec}s. Last attempt: ${new Date(this.lastChallengeAttemptAt).toISOString()}`
350
+ );
351
+ }
352
+ this.lastChallengeAttemptAt = nowMs;
342
353
  const challenge = await this.requestChallenge();
343
354
  let walletPubKey;
344
355
  let walletSig;
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  } from "./chunk-IAQC34O7.js";
6
6
  import {
7
7
  SessionManager
8
- } from "./chunk-6IS5XPDB.js";
8
+ } from "./chunk-NEMH5KB5.js";
9
9
  import {
10
10
  looksLikeTelegramChatId,
11
11
  resolveTelegramRecipientToChatId
@@ -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(
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  SessionManager
3
- } from "../chunk-6IS5XPDB.js";
3
+ } from "../chunk-NEMH5KB5.js";
4
4
  export {
5
5
  SessionManager
6
6
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "solana-traderclaw",
3
- "version": "1.0.134",
3
+ "version": "1.0.136",
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 |
@@ -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 |
@@ -160,7 +160,7 @@ Use `solana_alpha_history` for:
160
160
 
161
161
  ## Alpha Submission (Cron → Heartbeat Pipeline)
162
162
 
163
- 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.
164
164
 
165
165
  ## Firehose Configuration
166
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
 
@@ -37,24 +37,6 @@ At start of every cron job, check whether sufficient new data exists since last
37
37
 
38
38
  ---
39
39
 
40
- ## Job: `alpha_scan`
41
-
42
- **Schedule:** Every 3 hours (`0 */3 * * *`) — 8 runs/day
43
-
44
- **Purpose:** Scan new token launches, filter candidates, score quality, log alpha signals.
45
-
46
- **Tools:** `solana_scan_launches`, `solana_token_snapshot`, `solana_token_holders`, `solana_token_risk`, `solana_alpha_log`, `solana_memory_write`
47
-
48
- **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.
49
-
50
- **Configuration:**
51
- - Model: Sonnet (judgment — scoring candidates, filtering quality signals)
52
- - Thinking: off
53
- - lightContext: on
54
- - Delivery: announce/last/bestEffort
55
-
56
- ---
57
-
58
40
  ## Job: `portfolio_health`
59
41
 
60
42
  **Schedule:** Every 4 hours (`0 */4 * * *`) — 6 runs/day