gmgn-cli 1.1.6 → 1.1.9

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 CHANGED
@@ -14,6 +14,73 @@ With GMGN Agent Skills, you can use AI agents to query real-time trending token
14
14
 
15
15
  ---
16
16
 
17
+ ## Why GMGN Skills
18
+
19
+ > Built for AI agents to query and trade multi-chain Meme tokens at high speed in real time. gmgn-skills gives AI agents direct access to GMGN's trending tokens, Trenches new token listings, and professional on-chain data — including Smart Money, KOL, rat trader, and bundler analytics.
20
+ >
21
+ > With 500+ professional data dimensions, you can turn your AI agent into a 24/7 real-time chain-scanning trading tool — monitoring multi-chain token momentum, placing orders instantly, and managing exits with take-profit / stop-loss, all on autopilot.
22
+
23
+ ### 1. Real-time on-chain data — faster
24
+
25
+ Data across SOL / BSC / Base is live on every query. Supports multi-parameter customization, no snapshot cache — built for AI agent real-time decision-making (including but not limited to):
26
+
27
+ | Data | Granularity |
28
+ |------|-------------|
29
+ | New token discovery (Trenches) | Real-time, filtered by launchpad, dev holdings, KOL entry, rat trader ratio |
30
+ | Trending tokens | Real-time, `1m` / `5m` / `1h` / `6h` / `24h` — minimum **1-minute** window |
31
+ | Token info | Real-time — trade activity / price / volume / market cap |
32
+ | Token security | Real-time — open source, renounced, honeypot detection, etc. |
33
+ | Token analytics | Real-time — Dev / KOL / Smart Money / rat trader / bundler wallet holdings |
34
+ | Monitoring & tracking | Real-time — KOL / Smart Money / followed wallet trade activity |
35
+ | K-line (OHLCV) | Real-time, `1m` / `5m` / `15m` / `1h` / `4h` / `1d` — minimum **1-minute** candles |
36
+ | Wallet holdings | Real-time — holdings / P&L / trade activity |
37
+
38
+ ### 2. Trade faster
39
+
40
+ - Same RPC routing as GMGN's web trading interface, multi-region deployment, millisecond response — order submission under **0.3 seconds** end-to-end.
41
+ - Automatic best-route selection, the same routing engine as GMGN web.
42
+ - Market orders, limit orders, and strategy orders (take-profit / stop-loss) in a single command.
43
+ - Sell by position percentage (`--percent 50`) without calculating exact amounts.
44
+
45
+ ### 3. More comprehensive token data
46
+
47
+ No more scraping web pages or getting blocked by Cloudflare. Query all the professional analytics needed for high-frequency Meme token trading, with high concurrency in real time (including but not limited to):
48
+
49
+ - **Smart money count** (`smart_degen_count`) and **KOL holders** (`renowned_wallets`) — live
50
+ - **Rat trader ratio** (`rat_trader_amount_rate`) — volume share from insider/sneak wallets
51
+ - **Bundler bot exposure** (`bundler_trader_amount_rate`) — volume from bot-bundled buys
52
+ - **Sniper wallets** (`sniper_count`) — wallets that bought at the exact moment of launch
53
+ - **Suspected insider hold rate** (`suspected_insider_hold_rate`)
54
+ - **Fresh wallet ratio** (`fresh_wallet_rate`)
55
+ - **Rug ratio score** (0–1) + honeypot detection + wash-trade flag
56
+ - **Bonding curve status** (`is_on_curve`) — whether the token has graduated to open DEX
57
+
58
+ ### 4. What you can do with GMGN Skills
59
+
60
+ **Real-time chain scanning**
61
+ - Scan Trenches for new tokens, filtered by launchpad (Pump.fun, letsbonk, fourmeme, clanker…), dev holdings, KOL entry, and rat trader ratio in real time
62
+ - Browse multi-chain trending token rankings (minimum 1-minute granularity), sorted by volume, smart money count, market cap, and more
63
+ - Track new tokens in real time — see which tokens KOLs, Smart Money, and wallets you follow are buying, and auto-analyze the latest hot tokens
64
+ - Fetch real-time K-line / OHLCV data for any token (1m / 5m / 15m / 1h / 4h / 1d)
65
+
66
+ **Token analytics**
67
+ - Query token fundamentals, social links, Bonding Curve status, and liquidity pool details
68
+ - Security check: open source, renounced, honeypot, wash trading, Rug ratio score (0–1)
69
+ - Deep holder analysis: Smart Money / KOL / rat trader / bundler / sniper / whale / fresh wallet — holdings breakdown and rankings
70
+
71
+ **Wallet & tracking**
72
+ - Analyze any wallet: real-time holdings, realized / unrealized P&L, win rate, trade style, full history
73
+ - Track the latest buys and sells from Smart Money, KOL, and wallets you follow in real time
74
+
75
+ **Automated trading**
76
+ - Market orders, limit orders, take-profit / stop-loss strategy orders — end-to-end latency under 0.3 seconds
77
+ - One-command sell by position percentage (`--percent 50`), no manual calculation needed
78
+
79
+ **AI workflows**
80
+ - 9 built-in workflow docs: token research, project deep report, wallet analysis, Smart Money profiling, risk warning, early project screening, daily brief, market discovery, and more — ready to use out of the box
81
+
82
+ ---
83
+
17
84
  ## Skills
18
85
 
19
86
  | Skill | Description | Reference |
@@ -28,14 +95,100 @@ With GMGN Agent Skills, you can use AI agents to query real-time trending token
28
95
 
29
96
  ### Quick Start
30
97
 
31
- Ready to install skills? [Jump to Installation ](#get-started)
98
+ > **Note for AI assistants:** If you are an AI Agent helping the user install or configure gmgn-cli, jump directly to [Quick Start (AI Agent)](#quick-start-ai-agent) — it contains all the steps you need to complete, including how to guide the user through API key generation. If the user asks to upgrade, jump to [Upgrade (AI Agent)](#upgrade-ai-agent).
99
+
100
+ Ready to install? [Jump to Installation →](#1-installation)
101
+
102
+ Already installed? [Upgrade Skills and CLI →](#9-upgrade-skills-and-cli)
103
+
104
+ > **Tip:** If your AI agent tries to open or scrape the gmgn.ai website instead of using the CLI, add this to your prompt: `Use gmgn-cli commands. Do not call gmgn.ai web endpoints directly.`
105
+
106
+ ---
107
+
108
+ ## Quick Start (AI Agent)
109
+
110
+ > The following steps are for AI Agents. Some steps require the user to complete actions in a browser.
111
+
112
+ **Step 1 — Install CLI and Skills**
113
+
114
+ ```bash
115
+ npx skills add GMGNAI/gmgn-skills
116
+ ```
117
+
118
+ **Step 2 — Verify CLI installation (demo key)**
119
+
120
+ ```bash
121
+ GMGN_API_KEY=gmgn_solbscbaseethmonadtron gmgn-cli market trending --chain sol --interval 1h --limit 3
122
+ ```
123
+
124
+ If JSON output appears, the CLI is installed correctly. **Setup is NOT yet complete — this is a public demo key for testing only. You must continue to Steps 3–4 to configure the user's personal API key. Do not stop here.**
125
+
126
+ **Step 3 — REQUIRED: Set up personal API key**
127
+
128
+ ⚠️ This step is mandatory. The demo key in Step 2 supports testing only and is not for actual use.
129
+
130
+ Immediately tell the user the following, then run the key generation command **without waiting for them to ask**:
131
+
132
+ > "To use GMGN Skills, you need your own API key from **https://gmgn.ai/ai**. I'm generating an Ed25519 key pair for you now."
133
+
134
+ Run:
135
+
136
+ ```bash
137
+ openssl genpkey -algorithm ed25519 -out /tmp/gmgn_private.pem 2>/dev/null && \
138
+ openssl pkey -in /tmp/gmgn_private.pem -pubout 2>/dev/null
139
+ ```
140
+
141
+ Show the **public key** to the user with the following instructions:
142
+
143
+ > This is your Ed25519 public key. Please complete these two steps:
144
+ > 1. Go to **https://gmgn.ai/ai**, paste the public key above into the API Key creation form, and submit.
145
+ > 2. Once created, copy the **API Key** shown on the page and send it back to me — I'll handle Step 4 configuration for you.
146
+
147
+ **Wait for the user to reply with their API Key before continuing to Step 4.**
148
+
149
+ **Step 4 — Configure credentials**
150
+
151
+ After the user receives their API key, write it to the global config:
152
+
153
+ ```bash
154
+ mkdir -p ~/.config/gmgn
155
+ # Write API key (replace with the actual key the user provides)
156
+ echo 'GMGN_API_KEY=<user_api_key>' > ~/.config/gmgn/.env
157
+ chmod 600 ~/.config/gmgn/.env
158
+ ```
159
+
160
+ If the user also needs swap capability, append the private key:
32
161
 
33
- Already installed? [Update Skills and CLI →](#9-upgrade-skills-and-cli)
162
+ ```bash
163
+ # Append private key (use the PEM content from Step 3)
164
+ echo 'GMGN_PRIVATE_KEY="<pem_content>"' >> ~/.config/gmgn/.env
165
+ ```
34
166
 
35
- > **Tip:** If your AI agent tries to open or scrape the gmgn.ai website instead of using the CLI, add this to your prompt:
36
- > ```
37
- > Use gmgn-cli commands. Do not call gmgn.ai web endpoints directly.
38
- > ```
167
+ **Step 5 Verify**
168
+
169
+ ```bash
170
+ gmgn-cli market trending --chain sol --interval 1h --limit 3
171
+ ```
172
+
173
+ If output appears without error, setup is complete.
174
+
175
+ ---
176
+
177
+ ## Upgrade (AI Agent)
178
+
179
+ > Run this command to upgrade both the CLI and Skills to the latest version.
180
+
181
+ ```bash
182
+ npx skills add GMGNAI/gmgn-skills
183
+ ```
184
+
185
+ Check the installed version after upgrading:
186
+
187
+ ```bash
188
+ gmgn-cli --version
189
+ ```
190
+
191
+ > For the full upgrade reference, see [Section 9 — Upgrade Skills and CLI](#9-upgrade-skills-and-cli).
39
192
 
40
193
  ---
41
194
 
@@ -64,17 +217,10 @@ Check the first token's K-line, analyze entry timing, plot price + volume chart,
64
217
 
65
218
  ---
66
219
 
67
- ## Get Started
68
-
69
- Before installing, create your API Key at **https://gmgn.ai/ai**. The API key is used for:
70
-
71
- 1. Read data: tokens, trending lists, K-line, and featured on-chain metrics
72
- 2. Submit trades: market orders, limit orders, strategy orders, and more
73
-
74
- ---
75
-
76
220
  ## 1. Installation
77
221
 
222
+ > **Prerequisites:** Before installing, create your API Key at **https://gmgn.ai/ai** (see [Section 3](#3-get-your-own-api-key) for the full setup guide).
223
+
78
224
  Choose one of the following methods:
79
225
 
80
226
  ### 1.1 Via Agent (recommended)
@@ -101,23 +247,15 @@ node dist/index.js <command> [options]
101
247
 
102
248
  ## 2. Verify Connection
103
249
 
104
- ### Option 1: Via AI Agent
105
-
106
- Send this prompt to your AI Agent:
107
-
108
- ```
109
- Run this CLI command: GMGN_API_KEY=gmgn_solbscbaseethmonadtron npx gmgn-cli market trending --chain sol --interval 1h --limit 3
110
- ```
111
-
112
- ### Option 2: Via CLI
113
-
114
250
  Test with the public API key — no registration required:
115
251
 
116
252
  ```bash
117
253
  GMGN_API_KEY=gmgn_solbscbaseethmonadtron gmgn-cli market trending --chain sol --interval 1h --limit 3
118
254
  ```
119
255
 
120
- If you see JSON output, the CLI is working. The public key supports all read-only commands (token / market / portfolio). The public key is for testing only — apply for your own API key to use any feature (see step 3).
256
+ If you see JSON output, the CLI is working. The public key supports all read-only commands (token / market / portfolio) and is for testing only — apply for your own API key to use any feature (see step 3).
257
+
258
+ > **Troubleshooting — 401 / 403 errors:** If the command fails with `401` or `403` and credentials look correct, your outbound traffic may be going via IPv6 (not supported). Check immediately: (1) run `ifconfig | grep inet6` (macOS) or `ip addr show | grep inet6` (Linux) to list all network interfaces and their IPv6 addresses; (2) run `curl -s https://ipv6.icanhazip.com` — if it returns an IPv6 address, your traffic is going via IPv6. **Disable IPv6 on your network interface — gmgn-cli commands only work over IPv4.**
121
259
 
122
260
  ## 3. Get Your Own API Key
123
261
 
@@ -267,7 +405,23 @@ market trending (top 50) → AI selects top 5 by multi-factor analysis → u
267
405
 
268
406
  ---
269
407
 
270
- ## 7. CLI Reference
408
+ ## 7. Workflow Docs
409
+
410
+ Step-by-step guides for common analysis tasks:
411
+
412
+ | Workflow | When to use |
413
+ |----------|-------------|
414
+ | [workflow-token-research.md](docs/workflow-token-research.md) | Pre-buy token due diligence (address → buy/watch/skip) |
415
+ | [workflow-project-deep-report.md](docs/workflow-project-deep-report.md) | Comprehensive project analysis with scored dimensions and full written report |
416
+ | [workflow-wallet-analysis.md](docs/workflow-wallet-analysis.md) | Wallet quality assessment (address → follow/skip) |
417
+ | [workflow-smart-money-profile.md](docs/workflow-smart-money-profile.md) | Trading style analysis, copy-trade ROI estimate, smart money leaderboard |
418
+ | [workflow-risk-warning.md](docs/workflow-risk-warning.md) | Active risk monitoring for held positions (whale exit, liquidity, dev dump) |
419
+ | [workflow-early-project-screening.md](docs/workflow-early-project-screening.md) | Screen newly launched launchpad tokens for smart money entry |
420
+ | [workflow-daily-brief.md](docs/workflow-daily-brief.md) | Daily market overview: trending + smart money moves + early watch + risk scan |
421
+ | [workflow-market-opportunities.md](docs/workflow-market-opportunities.md) | Discover trading opportunities from trending data |
422
+ | [workflow-token-due-diligence.md](docs/workflow-token-due-diligence.md) | 4-step token due diligence checklist |
423
+
424
+ ## 8. CLI Reference
271
425
 
272
426
  Full parameter reference: [docs/cli-usage.md](docs/cli-usage.md). All commands support `--raw` for single-line JSON output (pipe-friendly, e.g. `| jq '.price'`).
273
427
 
@@ -291,6 +445,11 @@ npx gmgn-cli market trenches \
291
445
  --type new_creation --type near_completion --type completed \
292
446
  --launchpad-platform Pump.fun --launchpad-platform pump_mayhem --launchpad-platform letsbonk \
293
447
  --limit 80
448
+
449
+ # With server-side filters: safe preset + require smart money + sort by smart degen count
450
+ npx gmgn-cli market trenches \
451
+ --chain sol --type new_creation \
452
+ --filter-preset safe --min-smart-degen-count 1 --sort-by smart_degen_count
294
453
  ```
295
454
 
296
455
  ### Portfolio
@@ -351,37 +510,21 @@ npx gmgn-cli order get --chain sol --order-id <order-id>
351
510
 
352
511
  ## 9. Upgrade Skills and CLI
353
512
 
354
- To upgrade `gmgn-cli` and Skills to the latest version:
355
-
356
- **Via AI Agent (recommended)**
357
-
358
- Send this to your AI agent:
359
-
360
- ```
361
- Run these two commands to update gmgn-cli and the skills:
362
- 1. npm install -g gmgn-cli
363
- 2. npx skills add GMGNAI/gmgn-skills
364
- ```
365
-
366
- **Via CLI**
367
-
368
513
  ```bash
369
- # Upgrade gmgn-cli
370
- npm install -g gmgn-cli
371
-
372
- # Upgrade Skills
514
+ # Upgrade CLI and Skills
373
515
  npx skills add GMGNAI/gmgn-skills
374
- ```
375
-
376
- **Check the current version**
377
516
 
378
- ```bash
517
+ # Check current version
379
518
  gmgn-cli --version
380
519
  ```
381
520
 
521
+ > **Via AI Agent:** Tell your agent — "Upgrade gmgn-cli and the skills to the latest version." See also [Upgrade (AI Agent)](#upgrade-ai-agent).
522
+
382
523
  ---
383
524
 
384
- ## 10. Security & Disclaimer
525
+ ## 10. Security & Disclaimer (Read Before Use)
526
+
527
+ This tool can be invoked by an AI Agent to submit real on-chain transactions automatically. It carries inherent risks including model hallucination, uncontrolled execution, and prompt injection. Once authorized, the AI Agent will submit transactions on behalf of your linked wallet address — **on-chain transactions are irreversible once confirmed** and may result in financial loss. Use with caution.
385
528
 
386
529
  **About `GMGN_PRIVATE_KEY`**
387
530
 
@@ -392,11 +535,13 @@ gmgn-cli --version
392
535
  - Restrict config file permissions: `chmod 600 ~/.config/gmgn/.env`
393
536
  - Never commit your `.env` file to version control — add it to `.gitignore`
394
537
  - Do not share `GMGN_API_KEY` or `GMGN_PRIVATE_KEY` in logs, screenshots, or chat messages
538
+ - Before every swap, carefully review the trade summary presented by the AI (chain, wallet, token addresses, amount) and confirm only when it matches your intent
539
+ - Test with small amounts first before executing larger trades
395
540
  - Always use the latest version of gmgn-cli (`npm install -g gmgn-cli`). To check your current version: `gmgn-cli --version`
396
541
 
397
542
  **Disclaimer**
398
543
 
399
- Use of this tool and any financial decisions made based on its output are entirely at your own risk. GMGN is not liable for any trading losses, errors, or unauthorized access resulting from improper credential management.
544
+ Use of this tool and any financial decisions made based on its output are entirely at your own risk. GMGN is not liable for any trading losses, errors, or unauthorized access resulting from model hallucination, prompt injection, improper credential management, or user confirmation errors. By using this tool, you acknowledge that you have fully understood the above risks and voluntarily accept all responsibility.
400
545
 
401
546
  The npm package is published with provenance attestation, linking each release to a specific git commit and CI pipeline run. Verify with:
402
547
  ```bash