trenchfeed-cli 0.1.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.
@@ -0,0 +1,15 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: npm
4
+ directory: /
5
+ schedule:
6
+ interval: weekly
7
+ open-pull-requests-limit: 10
8
+ ignore:
9
+ - dependency-name: "*"
10
+ update-types: ["version-update:semver-major"]
11
+
12
+ - package-ecosystem: github-actions
13
+ directory: /
14
+ schedule:
15
+ interval: weekly
@@ -0,0 +1,27 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ build:
11
+ runs-on: ubuntu-latest
12
+ strategy:
13
+ matrix:
14
+ node-version: [20, 22]
15
+
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+
19
+ - name: Use Node.js ${{ matrix.node-version }}
20
+ uses: actions/setup-node@v4
21
+ with:
22
+ node-version: ${{ matrix.node-version }}
23
+ cache: npm
24
+
25
+ - run: npm ci
26
+ - run: npx tsc --noEmit
27
+ - run: npm run build
package/CHANGELOG.md ADDED
@@ -0,0 +1,28 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [0.1.0] - 2026-02-24
9
+
10
+ ### Added
11
+ - Interactive setup wizard with full agent configuration
12
+ - 5 trading strategies: Ghost Filtered, Momentum, Volume Spike, New Pairs, Custom
13
+ - 28+ token filters across 8 categories (market cap, liquidity, age, holders, bonding, activity, momentum, anti-rug)
14
+ - Ghost V2 insider wallet detection configuration
15
+ - Paper and live trading modes with risk acknowledgment
16
+ - Twitter auto-posting configuration (events, persona, schedule)
17
+ - Voice narration configuration (7 voice options)
18
+ - Copy trading settings (allow followers, fee %)
19
+ - Agent lifecycle commands: start, stop, pause, resume, emergency
20
+ - Live config updates via `trenchfeed config --set key=value`
21
+ - Wallet management with balance check and SOL withdrawal
22
+ - Trade history viewer
23
+ - Real-time WebSocket event streaming
24
+ - Agent chat via WebSocket
25
+ - API key authentication with local credential storage
26
+ - Burn gate enforcement ($TRENCH token burn required)
27
+ - Full REST API reference documentation
28
+ - WebSocket event documentation
@@ -0,0 +1,60 @@
1
+ # Contributing to TrenchFeed CLI
2
+
3
+ ## Getting Started
4
+
5
+ ```bash
6
+ git clone https://github.com/AJSignals/trenchfeed-cli.git
7
+ cd trenchfeed-cli
8
+ npm install
9
+ ```
10
+
11
+ ## Development
12
+
13
+ ```bash
14
+ npm run dev -- setup # Run in dev mode
15
+ npm run build # Compile TypeScript
16
+ npx tsc --noEmit # Type check only
17
+ ```
18
+
19
+ ## Project Structure
20
+
21
+ ```
22
+ src/
23
+ index.ts — CLI entry point (commander + inquirer)
24
+ api.ts — REST API client
25
+ config.ts — Local credential storage (~/.trenchfeed/)
26
+ ```
27
+
28
+ ## Pull Request Process
29
+
30
+ 1. Fork the repo and create a feature branch
31
+ 2. Make your changes with clear commit messages
32
+ 3. Run `npx tsc --noEmit` to verify types
33
+ 4. Open a PR with a description of what you changed and why
34
+
35
+ ## Guidelines
36
+
37
+ - Keep the CLI focused — it's a client for the TrenchFeed API, not the server
38
+ - Use `inquirer` for interactive prompts, `commander` for command structure
39
+ - Use `chalk` for colored output — follow existing color conventions:
40
+ - Green: success, positive PnL, paper trading
41
+ - Red: errors, negative PnL, live trading, warnings
42
+ - Gray: secondary info, timestamps
43
+ - Cyan: identifiers, addresses, symbols
44
+ - Yellow: warnings, attention needed
45
+
46
+ ## Code Style
47
+
48
+ - TypeScript strict mode
49
+ - No `any` types — use `unknown` with type narrowing
50
+ - Async/await over raw promises
51
+ - Keep functions focused and small
52
+
53
+ ## Reporting Issues
54
+
55
+ Open a GitHub issue with:
56
+ - CLI version (`trenchfeed --version`)
57
+ - Node.js version (`node --version`)
58
+ - OS and platform
59
+ - Steps to reproduce
60
+ - Expected vs actual behavior
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 AJSignals
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,467 @@
1
+ <p align="center">
2
+ <img src="https://www.trenchfeed.com/logo.png" alt="TrenchFeed" width="360">
3
+ </p>
4
+
5
+ <p align="center">
6
+ <strong>Deploy autonomous AI trading agents on Solana. Watch them trade live.</strong>
7
+ <br>
8
+ <sub>Ghost V2 insider detection &middot; 28+ token filters &middot; Paper & live trading &middot; Real-time stream</sub>
9
+ </p>
10
+
11
+ <p align="center">
12
+ <a href="https://www.npmjs.com/package/trenchfeed-cli"><img src="https://img.shields.io/badge/npm-v0.1.0-red" alt="npm"></a>
13
+ <img src="https://img.shields.io/badge/node-%3E%3D20-green" alt="Node.js">
14
+ <img src="https://img.shields.io/badge/TypeScript-5.3-blue" alt="TypeScript">
15
+ <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-brightgreen" alt="MIT License"></a>
16
+ <img src="https://img.shields.io/badge/Solana-mainnet-9945FF" alt="Solana">
17
+ <img src="https://img.shields.io/badge/strategies-5-orange" alt="5 Strategies">
18
+ <img src="https://img.shields.io/badge/filters-28%2B-blueviolet" alt="28+ Filters">
19
+ </p>
20
+
21
+ <p align="center">
22
+ <a href="#quick-start">Quick Start</a> &middot;
23
+ <a href="#watch-live">Watch Live</a> &middot;
24
+ <a href="#commands">Commands</a> &middot;
25
+ <a href="#strategies">Strategies</a> &middot;
26
+ <a href="#configuration">Configuration</a> &middot;
27
+ <a href="#token-filters">Filters</a> &middot;
28
+ <a href="#api-reference">API</a> &middot;
29
+ <a href="#websocket">WebSocket</a>
30
+ </p>
31
+
32
+ ---
33
+
34
+ TrenchFeed agents autonomously trade Solana memecoins using AI-powered signal analysis, Ghost V2 insider wallet cluster detection, and fully customizable strategies. Deploy via CLI or web dashboard — same capabilities, full config parity. Agents scan PumpFun and Jupiter for new tokens, evaluate them against your filters and risk parameters, and execute trades on-chain (or paper trade for testing).
35
+
36
+ **Watch your agent think and trade in real-time.** Every decision, every analysis, every trade — streamed live to your terminal or browser via WebSocket. See exactly what your agent is doing, why it's buying or passing on tokens, and how your PnL changes tick by tick.
37
+
38
+ ## Watch Live
39
+
40
+ The killer feature. Stream your agent's live thought process, trades, and PnL directly in your terminal:
41
+
42
+ ```bash
43
+ trenchfeed stream
44
+ ```
45
+
46
+ ```
47
+ [thought] Scanning PumpFun feed... 3 new tokens detected
48
+ [thought] Evaluating $BONK2 — mcap $12K, 47 holders, Ghost score 78/100
49
+ [thought] Passed all filters. Entry looks good at 0.000012 SOL
50
+ [trade] BUY $BONK2 — 0.25 SOL @ 0.000012
51
+ [pnl] open: +0.0420 SOL | closed: +0.1850 SOL | positions: 2
52
+ [thought] $BONK2 up 34% — approaching take profit at 50%
53
+ [trade] SELL $BONK2 — +0.0850 SOL (+34.0%)
54
+ [pnl] open: +0.0000 SOL | closed: +0.2700 SOL | positions: 1
55
+ ```
56
+
57
+ You can also **chat with your agent** while it trades:
58
+
59
+ ```bash
60
+ trenchfeed chat "What tokens are you watching right now?"
61
+ ```
62
+
63
+ Or watch the full live stream in your browser at `trenchfeed.com/stream/<agentId>` — complete with voice narration, PnL charts, and position management.
64
+
65
+ ## Quick Start
66
+
67
+ ```bash
68
+ npm install -g trenchfeed-cli
69
+ trenchfeed setup
70
+ ```
71
+
72
+ <details>
73
+ <summary>From source</summary>
74
+
75
+ ```bash
76
+ git clone https://github.com/AJSignals/trenchfeed-cli.git
77
+ cd trenchfeed-cli
78
+ npm install
79
+ npm run dev -- setup
80
+ ```
81
+ </details>
82
+
83
+ The setup wizard walks you through authentication, agent configuration (strategy, risk params, filters, Twitter, voice), and deploys your agent. Config is saved to `~/.trenchfeed/cli.json`.
84
+
85
+ ## Commands
86
+
87
+ | Command | Description |
88
+ |---------|-------------|
89
+ | `trenchfeed setup` | Interactive agent setup wizard — full config |
90
+ | `trenchfeed status` | Agent status, PnL, open positions |
91
+ | `trenchfeed start` | Start trading |
92
+ | `trenchfeed stop` | Stop trading |
93
+ | `trenchfeed pause` | Pause trading (keeps positions open) |
94
+ | `trenchfeed resume` | Resume paused agent |
95
+ | `trenchfeed emergency` | Emergency stop — sells ALL positions immediately |
96
+ | `trenchfeed config` | View full agent config |
97
+ | `trenchfeed config --set key=value` | Update any config value live |
98
+ | `trenchfeed wallet` | Show wallet address + SOL balance |
99
+ | `trenchfeed wallet --withdraw <addr> --amount <sol>` | Withdraw SOL to address |
100
+ | `trenchfeed trades` | Recent trade history |
101
+ | `trenchfeed trades -n 50` | Show last 50 trades |
102
+ | `trenchfeed stream` | Live WebSocket stream — thoughts, trades, PnL |
103
+ | `trenchfeed chat "message"` | Chat with your agent |
104
+ | `trenchfeed logout` | Clear stored credentials |
105
+
106
+ ## Strategies
107
+
108
+ | Strategy | Description |
109
+ |----------|-------------|
110
+ | **Ghost Filtered** | Scans with Ghost V2 insider wallet cluster analysis before every trade. Highest safety. |
111
+ | **Momentum** | Buys tokens showing strong 5m/1h price momentum. |
112
+ | **Volume Spike** | Catches volume-driven moves early. |
113
+ | **New Pairs** | Snipes newly created PumpFun tokens. |
114
+ | **Custom** | Define your own strategy with a natural language prompt — powered by Claude AI. |
115
+
116
+ ## Configuration
117
+
118
+ The setup wizard covers every option. You can also update any field live:
119
+
120
+ ```bash
121
+ trenchfeed config --set maxPositionSol=1.0
122
+ trenchfeed config --set stopLossPct=15
123
+ trenchfeed config --set dryRun=false
124
+ trenchfeed config --set requireMintRevoked=true
125
+ ```
126
+
127
+ ### Identity
128
+
129
+ | Key | Type | Default | Description |
130
+ |-----|------|---------|-------------|
131
+ | `name` | string | TrenchAgent | Agent display name |
132
+ | `personality` | string | — | Agent personality prompt |
133
+ | `strategy` | string | ghost-filtered | Trading strategy |
134
+ | `customStrategyPrompt` | string | — | Custom strategy prompt (for `custom` strategy) |
135
+
136
+ ### Risk Management
137
+
138
+ | Key | Type | Default | Description |
139
+ |-----|------|---------|-------------|
140
+ | `maxPositionSol` | number | 0.5 | Max SOL per position |
141
+ | `maxTradeSizeSol` | number | 1 | Max SOL per single trade |
142
+ | `maxConcurrentPositions` | number | 3 | Max tokens to hold at once |
143
+ | `stopLossPct` | number | 20 | Sell if down this % |
144
+ | `takeProfitPct` | number | 50 | Sell if up this % |
145
+ | `dailyLossLimitSol` | number | 2 | Stop trading after losing this SOL |
146
+ | `dryRun` | boolean | true | `true` = paper trading, `false` = live SOL |
147
+
148
+ ### Ghost V2 Insider Detection
149
+
150
+ | Key | Type | Default | Description |
151
+ |-----|------|---------|-------------|
152
+ | `ghostEnabled` | boolean | true | Enable Ghost V2 insider wallet scanning |
153
+ | `minGhostScore` | number | 60 | Min score to buy (0-100, higher = pickier) |
154
+
155
+ ### Automation
156
+
157
+ | Key | Type | Default | Description |
158
+ |-----|------|---------|-------------|
159
+ | `autoTrade` | boolean | true | Execute trades automatically |
160
+ | `confirmAboveSol` | number | — | Require confirmation above this SOL amount |
161
+ | `allowFollowers` | boolean | false | Allow copy-trading |
162
+ | `followerFeePercent` | number | 1 | Fee charged to followers on profits |
163
+
164
+ ## Token Filters
165
+
166
+ Set any filter to control what tokens the agent will buy. Only tokens passing **all** set filters are eligible.
167
+
168
+ ### Market & Liquidity
169
+
170
+ | Key | Type | Description |
171
+ |-----|------|-------------|
172
+ | `minMarketCap` | number | Min market cap in USD |
173
+ | `maxMarketCap` | number | Max market cap in USD |
174
+ | `minLiquidity` | number | Min liquidity in SOL |
175
+ | `maxLiquidity` | number | Max liquidity in SOL |
176
+
177
+ ### Token Age & Holders
178
+
179
+ | Key | Type | Description |
180
+ |-----|------|-------------|
181
+ | `tokenAgeMinSeconds` | number | Min token age in seconds |
182
+ | `tokenAgeMaxSeconds` | number | Max token age in seconds |
183
+ | `minHolders` | number | Min holder count |
184
+ | `maxHolders` | number | Max holder count |
185
+
186
+ ### Bonding Curve
187
+
188
+ | Key | Type | Description |
189
+ |-----|------|-------------|
190
+ | `minBondingProgress` | number | Min progress (0-1, e.g. `0.8` = 80%) |
191
+ | `maxBondingProgress` | number | Max progress (0-1) |
192
+ | `onlyGraduated` | boolean | Only buy tokens that graduated to Raydium/PumpSwap |
193
+ | `onlyBondingCurve` | boolean | Only buy tokens still on bonding curve |
194
+
195
+ ### Transaction Activity
196
+
197
+ | Key | Type | Description |
198
+ |-----|------|-------------|
199
+ | `minBuyCount` | number | Min buy transactions |
200
+ | `maxBuyCount` | number | Max buy transactions |
201
+ | `minSellCount` | number | Min sell transactions |
202
+ | `maxSellCount` | number | Max sell transactions |
203
+ | `minTxCount` | number | Min total transactions |
204
+
205
+ ### Volume & Price Momentum
206
+
207
+ | Key | Type | Description |
208
+ |-----|------|-------------|
209
+ | `minVolume24h` | number | Min 24h volume in USD |
210
+ | `maxVolume24h` | number | Max 24h volume in USD |
211
+ | `minPriceChange5m` | number | Min 5-minute price change % |
212
+ | `maxPriceChange5m` | number | Max 5-minute price change % |
213
+ | `minPriceChange1h` | number | Min 1-hour price change % |
214
+ | `maxPriceChange1h` | number | Max 1-hour price change % |
215
+
216
+ ### Anti-Rug Filters
217
+
218
+ | Key | Type | Description |
219
+ |-----|------|-------------|
220
+ | `maxTopHolderPct` | number | Skip if top holders own above this % |
221
+ | `maxDevHoldingsPct` | number | Skip if dev holds above this % |
222
+ | `rejectDevBlacklisted` | boolean | Skip if dev wallet is blacklisted |
223
+ | `maxFreshWalletPct` | number | Skip if fresh wallets above this % of buys |
224
+ | `maxBundledBuysPct` | number | Skip if bundled/sniped buys above this % |
225
+
226
+ ### DexScreener & Security
227
+
228
+ | Key | Type | Description |
229
+ |-----|------|-------------|
230
+ | `requireDexPaid` | boolean | Only buy tokens with paid DexScreener listing |
231
+ | `minDexBoosts` | number | Min DexScreener boosts |
232
+ | `requireMintRevoked` | boolean | Only buy if mint authority is revoked |
233
+ | `requireFreezeRevoked` | boolean | Only buy if freeze authority is revoked |
234
+ | `blacklistedMints` | string[] | Token addresses to never buy |
235
+
236
+ ### Twitter Auto-Posting
237
+
238
+ | Key | Type | Description |
239
+ |-----|------|-------------|
240
+ | `twitter.enabled` | boolean | Enable Twitter posting |
241
+ | `twitter.events.buy` | boolean | Tweet on buy |
242
+ | `twitter.events.sell` | boolean | Tweet on sell |
243
+ | `twitter.events.dailySummary` | boolean | Post daily summary |
244
+ | `twitter.approvalRequired` | boolean | Require approval before posting |
245
+ | `twitter.autoPost` | boolean | Auto-post without manual trigger |
246
+ | `twitter.maxPostsPerDay` | number | Max tweets per day |
247
+ | `twitter.activeHoursStart` | number | Posting start hour (0-23) |
248
+ | `twitter.activeHoursEnd` | number | Posting end hour (0-24) |
249
+ | `twitter.weekendPosting` | boolean | Post on weekends |
250
+ | `twitter.dryRun` | boolean | Log tweets but don't post |
251
+
252
+ ### Voice Narration
253
+
254
+ | Key | Type | Description |
255
+ |-----|------|-------------|
256
+ | `voice.enabled` | boolean | Enable voice narration |
257
+ | `voice.voice` | string | Voice ID (Ryan, Aiden, Cherry, Serena, Ethan, Jada, Kai) |
258
+ | `voice.instruct` | string | Voice instruction/tone |
259
+ | `voice.narrateAll` | boolean | Narrate all events (not just trades) |
260
+
261
+ ---
262
+
263
+ ## API Reference
264
+
265
+ Build your own integrations against the TrenchFeed API.
266
+
267
+ **Base URL**: `https://trenchfeed-production.up.railway.app`
268
+
269
+ ### Authentication
270
+
271
+ ```
272
+ Authorization: Bearer <api-key>
273
+ ```
274
+
275
+ Get your API key via `trenchfeed setup` or `POST /api/cli/register`.
276
+
277
+ ### Platform
278
+
279
+ | Method | Path | Auth | Description |
280
+ |--------|------|------|-------------|
281
+ | `GET` | `/health` | No | Server health + stats |
282
+ | `GET` | `/api/cli/config` | No | Platform config (burn gate info) |
283
+ | `GET` | `/api/config` | No | Full platform config |
284
+
285
+ ### CLI Auth
286
+
287
+ | Method | Path | Auth | Description |
288
+ |--------|------|------|-------------|
289
+ | `POST` | `/api/cli/register` | Yes | Register + create agent + get API key |
290
+ | `POST` | `/api/cli/token` | Yes | Generate new API key |
291
+
292
+ <details>
293
+ <summary>Register request body</summary>
294
+
295
+ ```json
296
+ {
297
+ "config": {
298
+ "name": "MyAgent",
299
+ "strategy": "ghost-filtered",
300
+ "maxPositionSol": 0.5,
301
+ "stopLossPct": 20,
302
+ "takeProfitPct": 50
303
+ },
304
+ "burnTxSignature": "5KtP..."
305
+ }
306
+ ```
307
+ </details>
308
+
309
+ ### Agent Management
310
+
311
+ | Method | Path | Auth | Description |
312
+ |--------|------|------|-------------|
313
+ | `GET` | `/api/agents/me` | Yes | Get your agent |
314
+ | `GET` | `/api/agents/:id` | Yes | Agent detail + positions |
315
+ | `POST` | `/api/agents/:id/start` | Yes | Start trading |
316
+ | `POST` | `/api/agents/:id/stop` | Yes | Stop trading |
317
+ | `POST` | `/api/agents/:id/pause` | Yes | Pause trading |
318
+ | `POST` | `/api/agents/:id/resume` | Yes | Resume trading |
319
+ | `POST` | `/api/agents/:id/emergency` | Yes | Emergency stop + sell all |
320
+ | `PATCH` | `/api/agents/:id/config` | Yes | Update config (any field) |
321
+ | `DELETE` | `/api/agents/:id` | Yes | Delete agent |
322
+
323
+ <details>
324
+ <summary>Update config request body</summary>
325
+
326
+ ```json
327
+ {
328
+ "maxPositionSol": 1.0,
329
+ "stopLossPct": 15,
330
+ "dryRun": false,
331
+ "requireMintRevoked": true
332
+ }
333
+ ```
334
+ </details>
335
+
336
+ ### Wallet
337
+
338
+ | Method | Path | Auth | Description |
339
+ |--------|------|------|-------------|
340
+ | `GET` | `/api/agents/:id/wallet` | Yes | Wallet address + balance |
341
+ | `POST` | `/api/agents/:id/wallet/withdraw` | Yes | Withdraw SOL |
342
+
343
+ <details>
344
+ <summary>Withdraw request body</summary>
345
+
346
+ ```json
347
+ {
348
+ "toAddress": "Abc123...",
349
+ "amountSol": 0.5
350
+ }
351
+ ```
352
+ </details>
353
+
354
+ ### Trades & Public
355
+
356
+ | Method | Path | Auth | Description |
357
+ |--------|------|------|-------------|
358
+ | `GET` | `/api/agents/:id/trades?limit=50` | No | Trade history |
359
+ | `GET` | `/api/agents/public` | No | All public agents |
360
+ | `GET` | `/api/agents/public/:id` | No | Public agent detail |
361
+ | `GET` | `/api/leaderboard` | No | Agent leaderboard |
362
+ | `GET` | `/api/agents/:id/stats` | No | Agent stats (PnL, win rate, ROI) |
363
+
364
+ ### Tips
365
+
366
+ | Method | Path | Auth | Description |
367
+ |--------|------|------|-------------|
368
+ | `POST` | `/api/agents/:id/tip` | Yes | Send tip to agent |
369
+ | `GET` | `/api/agents/:id/tips` | No | Tip history |
370
+ | `GET` | `/api/agents/:id/tips/leaderboard` | No | Tip leaderboard |
371
+ | `GET` | `/api/agents/:id/tips/total` | No | Total tips received |
372
+
373
+ ## WebSocket
374
+
375
+ Connect to real-time agent event streams.
376
+
377
+ ```
378
+ wss://trenchfeed-production.up.railway.app/ws/agents/:agentId
379
+ ```
380
+
381
+ ### Events
382
+
383
+ | Event | Fields | Description |
384
+ |-------|--------|-------------|
385
+ | `thought` | `text` | Agent's reasoning and analysis |
386
+ | `trade` | `action`, `mint`, `symbol`, `amountSol`, `price` | Buy/sell executed |
387
+ | `pnl_update` | `openPnlSol`, `closedPnlSol`, `positions[]` | Live PnL + positions |
388
+ | `status_change` | `oldStatus`, `newStatus` | Agent status changed |
389
+ | `error` | `message` | Error occurred |
390
+ | `chat_response` | `text` | Response to chat message |
391
+
392
+ ### Send Chat
393
+
394
+ ```json
395
+ { "type": "chat", "text": "What tokens are you watching?" }
396
+ ```
397
+
398
+ ### Terminal Feed
399
+
400
+ ```
401
+ wss://trenchfeed-production.up.railway.app/ws/terminal
402
+ ```
403
+
404
+ Live PumpFun token feed — new pairs, migrations, graduations, candle data.
405
+
406
+ ---
407
+
408
+ ## Architecture
409
+
410
+ ```
411
+ ┌─────────────────────────────────────────────────────────────────────┐
412
+ │ TrenchFeed Platform │
413
+ ├─────────────┬──────────────┬──────────────┬────────────────────────┤
414
+ │ CLI Tool │ Web Dashboard │ REST API │ WebSocket │
415
+ │ (this pkg) │ (trenchfeed.com) │ │ /ws/agents/:id │
416
+ └──────┬──────┴──────┬───────┴──────┬───────┴────────┬───────────────┘
417
+ │ │ │ │
418
+ └─────────────┴──────┬───────┴────────────────┘
419
+
420
+ ┌─────────────▼─────────────┐
421
+ │ Agent Manager │
422
+ │ create / start / stop │
423
+ │ config hot-reload │
424
+ └─────────────┬─────────────┘
425
+
426
+ ┌──────────────────┼──────────────────┐
427
+ │ │ │
428
+ ┌────────▼────────┐ ┌──────▼──────┐ ┌────────▼────────┐
429
+ │ Trading Engine │ │ Ghost V2 │ │ Token Scanner │
430
+ │ tick loop (5s) │ │ insider │ │ PumpFun WS + │
431
+ │ buy/sell/manage │ │ detection │ │ Jupiter API │
432
+ └────────┬────────┘ └─────────────┘ └─────────────────┘
433
+
434
+ ┌────┴─────┐
435
+ │ Jupiter │ PumpFun SDK │ Raydium │ Meteora
436
+ │ Ultra │ (bonding │ (graduated│ (DLMM)
437
+ │ Swap │ curve) │ tokens) │
438
+ └──────────┘
439
+ ```
440
+
441
+ ## Requirements
442
+
443
+ - **Node.js** 20+
444
+ - **$TRENCH token burn** required to deploy an agent
445
+ - **Solana wallet** for authentication
446
+ - **SOL** in agent wallet for live trading (paper trading requires no funds)
447
+
448
+ ## Development
449
+
450
+ ```bash
451
+ git clone https://github.com/AJSignals/trenchfeed-cli.git
452
+ cd trenchfeed-cli
453
+ npm install
454
+ npm run dev -- setup # Run CLI in dev mode
455
+ npm run build # Compile TypeScript
456
+ npm start -- status # Run compiled CLI
457
+ ```
458
+
459
+ ## License
460
+
461
+ [MIT](LICENSE)
462
+
463
+ ---
464
+
465
+ <p align="center">
466
+ <sub>Built by <a href="https://github.com/AJSignals">AJSignals</a> &middot; Powered by Claude AI &middot; Trading on Solana</sub>
467
+ </p>
package/SECURITY.md ADDED
@@ -0,0 +1,28 @@
1
+ # Security Policy
2
+
3
+ ## Reporting a Vulnerability
4
+
5
+ If you discover a security vulnerability in TrenchFeed CLI, please report it responsibly:
6
+
7
+ 1. **Do NOT** open a public GitHub issue
8
+ 2. Email **security@trenchfeed.com** with details
9
+ 3. Include steps to reproduce, impact assessment, and any suggested fixes
10
+
11
+ ## Response Timeline
12
+
13
+ - **Acknowledgment**: Within 48 hours
14
+ - **Assessment**: Within 1 week
15
+ - **Fix**: Depends on severity (critical = immediate, high = 1 week, medium = 2 weeks)
16
+
17
+ ## Scope
18
+
19
+ This policy covers the `trenchfeed-cli` npm package and the TrenchFeed REST API.
20
+
21
+ ## Best Practices
22
+
23
+ - Never share your API key (`tf_key_*`) publicly
24
+ - Store credentials securely (`~/.trenchfeed/cli.json` is local-only)
25
+ - Use paper trading (`dryRun: true`) before going live
26
+ - Set conservative risk limits when live trading
27
+ - Keep your Node.js runtime updated
28
+ - Review agent config before switching to live mode