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