solana-traderclaw-v1 1.0.0

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,327 @@
1
+ # 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.
4
+
5
+ ## Architecture
6
+
7
+ ```
8
+ OpenClaw Agent (brain: reasoning, decisions, strategy evolution)
9
+
10
+ │ calls 52 typed tools
11
+
12
+ Plugin (this package) ── HTTP ──→ Orchestrator (data + risk + execution)
13
+ │ │
14
+ Bitquery SpyFly Bot
15
+ (market data) (on-chain execution)
16
+ ```
17
+
18
+ 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.
19
+
20
+ ## Prerequisites
21
+
22
+ - OpenClaw v2026.1+ with Node >= 22
23
+ - An API key from [traderclaw.ai/register](https://traderclaw.ai/register)
24
+
25
+ ## Quick Start
26
+
27
+ ### 1. Install the plugin
28
+
29
+ ```bash
30
+ npm install -g traderclaw-v1
31
+ ```
32
+
33
+ Or install directly into OpenClaw:
34
+
35
+ ```bash
36
+ openclaw plugins install traderclaw-v1
37
+ ```
38
+
39
+ ### 2. Run setup
40
+
41
+ ```bash
42
+ traderclaw setup
43
+ ```
44
+
45
+ The setup wizard will:
46
+ - Ask for your API key (from [traderclaw.ai/register](https://traderclaw.ai/register))
47
+ - Connect to the orchestrator and validate your key
48
+ - Create or select a trading wallet
49
+ - Write the plugin configuration automatically
50
+
51
+ That's it. Restart the gateway and start trading:
52
+
53
+ ```bash
54
+ openclaw gateway restart
55
+ ```
56
+
57
+ ### Optional: Simple localhost installer wizard (Linux-first)
58
+
59
+ ```bash
60
+ traderclaw install --wizard
61
+ ```
62
+
63
+ This opens a localhost UI that runs prechecks, lane-aware setup, gateway validation, optional Telegram setup, and final verification.
64
+
65
+ ### Optional: Run CLI prechecks directly
66
+
67
+ ```bash
68
+ traderclaw precheck --dry-run --output linux-qa-dryrun.log
69
+ traderclaw precheck --allow-install --output linux-qa-install.log
70
+ ```
71
+
72
+ Use `--dry-run` for non-mutating validation and `--allow-install` for guided dependency installs.
73
+
74
+ ### 3. Run the mandatory startup sequence
75
+
76
+ Send this prompt to your bot after startup:
77
+
78
+ ```text
79
+ Run mandatory startup sequence and report pass/fail for each:
80
+ 1) solana_system_status
81
+ 2) solana_gateway_credentials_get (set if missing)
82
+ 3) solana_alpha_subscribe(agentId: "main")
83
+ 4) solana_capital_status
84
+ 5) solana_positions
85
+ 6) solana_killswitch_status
86
+ ```
87
+
88
+ ### Non-interactive setup
89
+
90
+ ```bash
91
+ traderclaw setup --api-key sk_live_abc123 --url https://api.traderclaw.ai
92
+ ```
93
+
94
+ ## CLI Commands
95
+
96
+ ### `traderclaw setup`
97
+
98
+ Interactive setup wizard. Validates API key, connects to orchestrator, sets up wallet, writes config.
99
+
100
+ Options:
101
+ - `--api-key, -k` — API key (skip prompt)
102
+ - `--url, -u` — Orchestrator URL (skip prompt, default: `https://api.traderclaw.ai`)
103
+
104
+ ### `traderclaw status`
105
+
106
+ Check connection health and wallet status at a glance:
107
+
108
+ ```
109
+ OpenClaw Solana Trader - Status
110
+ =============================================
111
+ Orchestrator: CONNECTED
112
+ Execution mode: live
113
+ Upstream: configured
114
+ System status: OK
115
+ WS connections: 1
116
+
117
+ Wallet: ACTIVE
118
+ Wallet ID: 1
119
+ Balance: 5.0 SOL
120
+ Open positions: 3
121
+ Unrealized PnL: 0.062 SOL
122
+ Kill switch: disabled
123
+ Strategy version: v1.2.3
124
+ Mode: HARDENED
125
+ =============================================
126
+ ```
127
+
128
+ ### `traderclaw config`
129
+
130
+ View and manage configuration:
131
+
132
+ ```bash
133
+ traderclaw config show # View current config (API key masked)
134
+ traderclaw config set <key> <v> # Update a value
135
+ traderclaw config reset # Remove all plugin config
136
+ ```
137
+
138
+ Available config keys: `orchestratorUrl`, `walletId`, `apiKey`, `apiTimeout`, `refreshToken`, `walletPublicKey`, `walletPrivateKey`, `gatewayBaseUrl`, `gatewayToken`, `agentId`
139
+
140
+ ### `traderclaw --help`
141
+
142
+ Print all available commands and options.
143
+
144
+ ### `traderclaw --version`
145
+
146
+ Print plugin version.
147
+
148
+ ## Advanced: Manual Configuration
149
+
150
+ If you prefer to configure manually instead of using the CLI, add to `~/.openclaw/openclaw.json`:
151
+
152
+ ```json5
153
+ {
154
+ plugins: {
155
+ entries: {
156
+ "solana-trader": {
157
+ enabled: true,
158
+ config: {
159
+ orchestratorUrl: "https://api.traderclaw.ai",
160
+ walletId: 1,
161
+ apiKey: "sk_live_your_key_here",
162
+ apiTimeout: 30000 // optional, default 30s
163
+ }
164
+ }
165
+ }
166
+ }
167
+ }
168
+ ```
169
+
170
+ Restart the gateway after configuration:
171
+
172
+ ```bash
173
+ openclaw gateway restart
174
+ ```
175
+
176
+ ## Available Tools (52)
177
+
178
+ ### Scanning
179
+ | Tool | Description |
180
+ |------|-------------|
181
+ | `solana_scan_launches` | Find new Solana token launches |
182
+ | `solana_scan_hot_pairs` | Find high-volume trading pairs |
183
+ | `solana_market_regime` | Get macro market state (bullish/bearish/neutral) |
184
+
185
+ ### Token Analysis
186
+ | Tool | Description |
187
+ |------|-------------|
188
+ | `solana_token_snapshot` | Price, volume, OHLC data |
189
+ | `solana_token_holders` | Holder concentration and distribution |
190
+ | `solana_token_flows` | Buy/sell pressure and flow data |
191
+ | `solana_token_liquidity` | Pool depth and liquidity profile |
192
+ | `solana_token_risk` | Composite risk assessment |
193
+
194
+ ### Intelligence
195
+ | Tool | Description |
196
+ |------|-------------|
197
+ | `solana_build_thesis` | Full context package: market data + strategy weights + memory + risk pre-screen |
198
+
199
+ ### Trading
200
+ | Tool | Description |
201
+ |------|-------------|
202
+ | `solana_trade_precheck` | Pre-trade risk validation |
203
+ | `solana_trade_execute` | Execute trade via SpyFly bot |
204
+
205
+ ### Reflection
206
+ | Tool | Description |
207
+ |------|-------------|
208
+ | `solana_trade_review` | Post-trade outcome review |
209
+ | `solana_memory_write` | Write journal entry |
210
+ | `solana_memory_search` | Search trading memories |
211
+ | `solana_memory_by_token` | Token-specific trade history |
212
+ | `solana_journal_summary` | Performance stats summary |
213
+
214
+ ### Strategy
215
+ | Tool | Description |
216
+ |------|-------------|
217
+ | `solana_strategy_state` | Read current strategy weights |
218
+ | `solana_strategy_update` | Update weights after learning |
219
+
220
+ ### Safety
221
+ | Tool | Description |
222
+ |------|-------------|
223
+ | `solana_killswitch` | Toggle emergency kill switch |
224
+ | `solana_killswitch_status` | Check kill switch state |
225
+
226
+ ### Wallet
227
+ | Tool | Description |
228
+ |------|-------------|
229
+ | `solana_capital_status` | Balance, positions, PnL, limits |
230
+ | `solana_positions` | Current positions with PnL |
231
+ | `solana_funding_instructions` | Deposit instructions |
232
+
233
+ ### Entitlements
234
+ | Tool | Description |
235
+ |------|-------------|
236
+ | `solana_entitlement_plans` | Available limit upgrades |
237
+ | `solana_entitlement_purchase` | Purchase upgrade plan |
238
+
239
+ ### System
240
+ | Tool | Description |
241
+ |------|-------------|
242
+ | `solana_system_status` | Orchestrator health check |
243
+
244
+ ## Skills
245
+
246
+ ### solana-trader (Trading Skill v5)
247
+ The primary skill that teaches OpenClaw the complete trading lifecycle:
248
+
249
+ 1. **SCAN** — Find opportunities with launch/hot-pair scanners
250
+ 2. **ANALYZE** — Deep dive with 5 token analysis tools
251
+ 3. **THESIS** — Assemble full context with build_thesis
252
+ 4. **DECIDE** — Agent reasons over data using confidence scoring
253
+ 5. **PRECHECK** — Validate against risk rules
254
+ 6. **EXECUTE** — Place trade via SpyFly
255
+ 7. **MONITOR** — Watch positions and capital
256
+ 8. **REVIEW** — Journal outcomes honestly
257
+ 9. **EVOLVE** — Update strategy weights based on performance
258
+
259
+ Includes: token lifecycle framework, anti-rug heuristics, volume pattern reading, FOMO detection, liquidity-relative sizing, house money exits, dead money rule, narrative awareness.
260
+
261
+ ### social-intel (Alpha Feed & Social Intelligence)
262
+ Standalone skill for SpyFly alpha feed integration and social intelligence:
263
+
264
+ - **SpyFly Alpha Feed** — Query recent alpha calls, historical accuracy, price milestone pings
265
+ - **Token Social Metadata** — Resolve on-chain metadata to find Twitter/Telegram/Discord links
266
+ - **Twitter Community Stats** — Follower count, engagement, growth trajectory, MC-relative benchmarking
267
+ - **Twitter Trending** — Narrative/meta detection from viral crypto topics
268
+
269
+ This skill is designed to merge into the trading skill when both are ready.
270
+
271
+ ## Example Conversation
272
+
273
+ ```
274
+ User: Start scanning for opportunities
275
+
276
+ Agent: Let me check the current market conditions and scan for new tokens.
277
+
278
+ [calls solana_market_regime]
279
+ Market is in a bullish regime with high DEX volume.
280
+
281
+ [calls solana_scan_launches]
282
+ Found 5 new launches in the last hour. POPCAT at 0x7a... looks interesting — high initial volume.
283
+
284
+ [calls solana_build_thesis with POPCAT address]
285
+ Thesis package shows:
286
+ - Strong buy pressure (68% buy ratio)
287
+ - Adequate liquidity ($180k)
288
+ - Holder concentration at 35% (acceptable)
289
+ - My strategy weights favor volume_momentum (0.28) — this token scores well there
290
+ - No prior trades on this token in my memory
291
+ - Risk pre-screen: approved, capped at 0.5 SOL
292
+
293
+ Based on the thesis data and my learned weights, I'll enter a small position.
294
+
295
+ [calls solana_trade_precheck]
296
+ Approved. Capped size: 0.5 SOL.
297
+
298
+ [calls solana_trade_execute]
299
+ Trade executed. TradeId: 15, PositionId: 4, TX: 5xK...
300
+
301
+ I'll monitor this position and review after exit.
302
+ ```
303
+
304
+ ## Troubleshooting
305
+
306
+ **Plugin won't load:**
307
+ - Run `traderclaw status` to check connectivity
308
+ - Check `openclaw plugins list` for errors
309
+ - Verify `openclaw.plugin.json` exists in the plugin directory
310
+
311
+ **"apiKey is required" error:**
312
+ - Run `traderclaw setup` to configure your API key
313
+ - Or manually add `apiKey` to your config: `traderclaw config set apiKey sk_live_...`
314
+
315
+ **"Could not reach orchestrator" warning:**
316
+ - Run `traderclaw status` to diagnose
317
+ - Check your internet connection
318
+ - Verify the orchestrator URL: `traderclaw config show`
319
+
320
+ **"Wallet not found" errors:**
321
+ - Run `traderclaw setup` to create or select a wallet
322
+ - Verify the wallet ID: `traderclaw config show`
323
+
324
+ **Tools returning errors:**
325
+ - Run `traderclaw status` to check system health
326
+ - Check if kill switch is enabled
327
+ - Verify your wallet has sufficient SOL balance