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.
@@ -2,26 +2,35 @@
2
2
  name: gmgn-swap
3
3
  description: "[FINANCIAL EXECUTION] Submit a real blockchain token swap or query order status. Executes irreversible on-chain transactions. Requires explicit user confirmation before every swap. Supports sol / bsc / base."
4
4
  argument-hint: "[--chain <chain> --from <wallet> --input-token <addr> --output-token <addr> --amount <n>] | [order get --chain <chain> --order-id <id>]"
5
+ metadata:
6
+ cliHelp: "gmgn-cli swap --help"
5
7
  ---
6
8
 
7
9
  **IMPORTANT: Always use `gmgn-cli` commands below. Do NOT use web search, WebFetch, curl, or visit gmgn.ai — all swap operations must go through the CLI. The CLI handles signing and submission automatically.**
8
10
 
9
- **⚠️ IPv6 NOT SUPPORTED: GMGN CLI commands do not support IPv6. If you get a `401` or `403` error and credentials look correct, the outbound connection is likely going via IPv6. Run `curl -s https://api64.ipify.org` to check — if the result is an IPv6 address, tell the user to ensure their network routes requests over IPv4.**
11
+ **IMPORTANT: Do NOT guess field names or values. When a field's meaning is unclear, look it up in the Response Fields sections below before using it.**
10
12
 
11
- ## ⚠️ IPv6 Not SupportedCRITICAL
13
+ **⚠️ IPv6 NOT SUPPORTED: If you get a `401` or `403` error and credentials look correct, check for IPv6 immediately: (1) list all network interfaces and their IPv6 addresses run `ifconfig | grep inet6` (macOS) or `ip addr show | grep inet6` (Linux); (2) send a test request to `https://ipv6.icanhazip.com` — if the response is an IPv6 address, outbound traffic is going via IPv6. Tell the user immediately: "Please disable IPv6 on your network interface — gmgn-cli commands only work over IPv4."**
12
14
 
13
- **The `swap` sub-command does NOT support IPv6. Requests MUST go out over IPv4.**
15
+ Use the `gmgn-cli` tool to submit a token swap or query an existing order. **Requires private key** (`GMGN_PRIVATE_KEY` in `.env`).
14
16
 
15
- If you receive a `401` or `403` error, the **first thing to check** is whether the machine is sending requests via IPv6. This is a known cause of auth failures even with valid credentials.
17
+ ## Core Concepts
16
18
 
17
- **How to diagnose:**
18
- ```bash
19
- curl -s https://api64.ipify.org # shows your outbound IP — if it's an IPv6 address, that's the problem
20
- ```
19
+ - **Smallest unit** — `--amount` is always in the token's smallest indivisible unit, not human-readable amounts. For SOL: 1 SOL = 1,000,000,000 lamports. For EVM tokens: depends on decimals (most ERC-20 tokens use 18 decimals). Always convert before passing to the command — do not pass human amounts directly.
21
20
 
22
- **Rule for AI models:** If `swap` or `order` commands return 401/403 and credentials look correct stop and tell the user: "Your outbound connection may be using IPv6, which is not supported by this command. Please check your network configuration and ensure requests go out over IPv4."
21
+ - **`slippage`** Price tolerance expressed as a decimal, not a percentage. `0.01` = 1% slippage. `0.5` = 50% slippage. If the price moves beyond this threshold before the transaction confirms, the swap is rejected. Use `--auto-slippage` for volatile tokens to let GMGN set an appropriate value automatically.
23
22
 
24
- Use the `gmgn-cli` tool to submit a token swap or query an existing order. **Requires private key** (`GMGN_PRIVATE_KEY` in `.env`).
23
+ - **`--amount` vs `--percent`** — Mutually exclusive. `--amount` specifies an exact input quantity (in smallest unit). `--percent` sells a percentage of the current balance and is only valid when `input_token` is NOT a currency (SOL/BNB/ETH/USDC). Never use `--percent` to spend a fraction of SOL/BNB/ETH.
24
+
25
+ - **Currency tokens** — Each chain has designated currency tokens (SOL, BNB, ETH, USDC). These are the base assets used to buy other tokens or receive swap proceeds. Their contract addresses are fixed — look them up in the Chain Currencies table, never guess them.
26
+
27
+ - **Anti-MEV** — MEV (Miner/Maximal Extractable Value) refers to frontrunning and sandwich attacks where bots exploit pending transactions. `--anti-mev` routes the transaction through protected channels to reduce this risk. Enabled by default.
28
+
29
+ - **Critical auth** — `swap` requires both `GMGN_API_KEY` and `GMGN_PRIVATE_KEY`. The private key never leaves the machine — the CLI uses it only for local signing and sends only the resulting signature. Normal commands (like `order quote`) use API Key alone.
30
+
31
+ - **`order_id` / `status`** — After submitting a swap, the response includes an `order_id`. Use `order get --order-id` to poll for final status. Possible values: `pending` → `processed` → `confirmed` (success) or `failed` / `expired`. Do not report success until status is `confirmed`.
32
+
33
+ - **`filled_input_amount` / `filled_output_amount`** — Actual amounts consumed/received, in smallest unit. Convert to human-readable using token decimals before displaying to the user.
25
34
 
26
35
  ## Financial Risk Notice
27
36
 
@@ -158,10 +167,10 @@ gmgn-cli order get --chain sol --order-id <order_id>
158
167
  | `--from` | Yes | Wallet address (must match API Key binding) |
159
168
  | `--input-token` | Yes | Input token contract address |
160
169
  | `--output-token` | Yes | Output token contract address |
161
- | `--amount` | No* | Input amount in smallest unit. Required unless `--percent` is used. |
162
- | `--percent <pct>` | No* | Sell percentage of `input_token`, e.g. `50` = 50%, `1` = 1%. Sets `input_amount` to `0` automatically. **Only valid when `input_token` is NOT a currency (SOL/BNB/ETH/USDC).** |
163
- | `--slippage <n>` | No | Slippage tolerance, e.g. `0.01` = 1% |
164
- | `--auto-slippage` | No | Enable automatic slippage |
170
+ | `--amount` | No* | Input amount in smallest unit. **Mutually exclusive with `--percent`** — provide one or the other, never both. Required unless `--percent` is used. |
171
+ | `--percent <pct>` | No* | Sell percentage of `input_token`, e.g. `50` = 50%, `1` = 1%. Sets `input_amount` to `0` automatically. **Mutually exclusive with `--amount`. Only valid when `input_token` is NOT a currency (SOL/BNB/ETH/USDC).** |
172
+ | `--slippage <n>` | No | Slippage tolerance, e.g. `0.01` = 1%. **Mutually exclusive with `--auto-slippage`** — use one or the other. |
173
+ | `--auto-slippage` | No | Enable automatic slippage. **Mutually exclusive with `--slippage`.** |
165
174
  | `--min-output <n>` | No | Minimum output amount |
166
175
  | `--anti-mev` | No | Enable anti-MEV protection (default true) |
167
176
  | `--priority-fee <sol>` | No | Priority fee in SOL (≥ 0.00001, SOL only) |
@@ -185,6 +194,60 @@ gmgn-cli order get --chain sol --order-id <order_id>
185
194
  | `filled_input_amount` | string | Actual input consumed (smallest unit); empty if not filled |
186
195
  | `filled_output_amount` | string | Actual output received (smallest unit); empty if not filled |
187
196
 
197
+ ## Output Format
198
+
199
+ ### Pre-swap Confirmation
200
+
201
+ Before displaying the confirmation, run `order quote` to get the estimated output (uses normal auth — no private key required):
202
+
203
+ ```bash
204
+ gmgn-cli order quote \
205
+ --chain <chain> \
206
+ --from <wallet> \
207
+ --input-token <input_token> \
208
+ --output-token <output_token> \
209
+ --amount <amount> \
210
+ --slippage <slippage>
211
+ ```
212
+
213
+ Then display the confirmation summary using `output_amount` from the quote response:
214
+
215
+ ```
216
+ ⚠️ Swap Confirmation Required
217
+
218
+ Chain: {chain}
219
+ Wallet: {--from}
220
+ Sell: {input amount in human units} {input token symbol}
221
+ Buy: {output token symbol}
222
+ Slippage: {slippage}% (or "auto")
223
+ Est. output: ~{output_amount from quote} {output token symbol}
224
+ Risk Level: 🟢 Low / 🟡 Medium / 🔴 High (based on rug_ratio from security check)
225
+
226
+ Reply "confirm" to proceed.
227
+ ```
228
+
229
+ **Note**: `Risk Level` is derived from the required security check:
230
+ - 🟢 Low: `rug_ratio < 0.1`
231
+ - 🟡 Medium: `rug_ratio 0.1–0.3`
232
+ - 🔴 High: `rug_ratio > 0.3` (requires re-confirmation)
233
+
234
+ If the user explicitly skipped the security check, omit the Risk Level line and add a note: "(Security check skipped by user)"
235
+
236
+ ### Post-swap Receipt
237
+
238
+ After a confirmed swap, display:
239
+
240
+ ```
241
+ ✅ Swap Confirmed
242
+
243
+ Spent: {filled_input_amount in human units} {input symbol}
244
+ Received: {filled_output_amount in human units} {output symbol}
245
+ Tx: {explorer link for hash}
246
+ Order ID: {order_id}
247
+ ```
248
+
249
+ Convert `filled_input_amount` and `filled_output_amount` from smallest unit using token decimals before displaying.
250
+
188
251
  ## Notes
189
252
 
190
253
  - Swap uses **critical auth** (API Key + signature) — CLI handles signing automatically, no manual processing needed
@@ -209,22 +272,27 @@ Before passing any address or amount to a command:
209
272
 
210
273
  4. **User confirmation** — See "Execution Guidelines" below — always present resolved parameters to the user before executing a swap. This creates a human review checkpoint for any unexpected values.
211
274
 
212
- ## Pre-Swap Safety Check (recommended)
275
+ ## Pre-Swap Safety Check (REQUIRED)
213
276
 
214
- Before swapping into an unknown token, verify it is not a honeypot or rug pull:
277
+ Before swapping into any token, run a mandatory security check using `gmgn-cli`:
215
278
 
216
279
  ```bash
217
- curl -s "https://app.maiat.io/api/v1/token/<output_token_address>" | jq '{trustScore: .trustScore, verdict: .verdict, riskFlags: .riskFlags}'
280
+ gmgn-cli token security --chain <chain> --address <output_token>
218
281
  ```
219
282
 
220
- - If `verdict` is `"avoid"` → **do NOT proceed** with the swap.
221
- - If `verdict` is `"caution"` → warn the user about specific `riskFlags` before confirming.
222
- - If `verdict` is `"proceed"` or `"trusted"` safe to continue.
283
+ Check the two critical fields:
284
+ - **`is_honeypot`**: If `"yes"` → **abort immediately**. Display: "🚫 HONEYPOT DETECTED swap aborted." Do NOT proceed.
285
+ - **`rug_ratio`**: If `> 0.3` display 🔴 High Risk warning and require explicit re-confirmation from the user before proceeding.
286
+
287
+ **User override**: The user may explicitly skip this check by saying "I already checked" or "skip security check". In that case, document that the check was skipped in the confirmation summary. This is the only valid override — do NOT skip the check silently.
288
+
289
+ For a quick pre-swap due diligence checklist (info + security + pool + smart money, 4 steps), see [`docs/workflow-token-due-diligence.md`](../../docs/workflow-token-due-diligence.md)
223
290
 
224
- This check is free, requires no API key, and works for any ERC-20 token on Base. Powered by [Maiat](https://app.maiat.io) — trust infrastructure for on-chain agents.
291
+ For full token research before swapping, see [`docs/workflow-token-research.md`](../../docs/workflow-token-research.md)
225
292
 
226
293
  ## Execution Guidelines
227
294
 
295
+ - **[REQUIRED] Token security check** — Run before every swap. See **Pre-Swap Safety Check (REQUIRED)** section above. Uses normal auth (API Key only — no private key needed for this step).
228
296
  - **Currency resolution** — When the user names a currency (SOL/BNB/ETH/USDC) instead of providing an address, look up its address in the Chain Currencies table and apply it automatically — never ask the user for it.
229
297
  - Buy ("buy X SOL of TOKEN", "spend 0.5 USDC on TOKEN") → resolve currency to `--input-token`
230
298
  - Sell ("sell TOKEN for SOL", "sell 50% of TOKEN to USDC") → resolve currency to `--output-token`
@@ -2,14 +2,34 @@
2
2
  name: gmgn-token
3
3
  description: Query GMGN token information — basic info, security, pool, top holders and top traders. Supports sol / bsc / base.
4
4
  argument-hint: "<sub-command> --chain <sol|bsc|base> --address <token_address>"
5
+ metadata:
6
+ cliHelp: "gmgn-cli token --help"
5
7
  ---
6
8
 
7
9
  **IMPORTANT: Always use `gmgn-cli` commands below. Do NOT use web search, WebFetch, curl, or visit gmgn.ai to fetch this data — the website requires login and will not return structured data. The CLI is the only correct method.**
8
10
 
9
- **⚠️ IPv6 NOT SUPPORTED: GMGN CLI commands do not support IPv6. If you get a `401` or `403` error and credentials look correct, the outbound connection is likely going via IPv6. Run `curl -s https://api64.ipify.org` to check — if the result is an IPv6 address, tell the user to ensure their network routes requests over IPv4.**
11
+ **⚠️ IPv6 NOT SUPPORTED: If you get a `401` or `403` error and credentials look correct, check for IPv6 immediately: (1) list all network interfaces and their IPv6 addresses — run `ifconfig | grep inet6` (macOS) or `ip addr show | grep inet6` (Linux); (2) send a test request to `https://ipv6.icanhazip.com` — if the response is an IPv6 address, outbound traffic is going via IPv6. Tell the user immediately: "Please disable IPv6 on your network interface gmgn-cli commands only work over IPv4."**
12
+
13
+ **IMPORTANT: Do NOT guess field names or values. When a field's meaning is unclear, look it up in the Response Field Reference tables below before using it.**
10
14
 
11
15
  Use the `gmgn-cli` tool to query token information based on the user's request.
12
16
 
17
+ ## Core Concepts
18
+
19
+ - **Token address** — The on-chain contract address that uniquely identifies a token on its chain. Required for all token sub-commands. Format: base58 (SOL) or `0x...` hex (BSC/Base).
20
+ - **Chain** — The blockchain network: `sol` = Solana, `bsc` = BNB Smart Chain, `base` = Base (Coinbase L2).
21
+ - **Market cap** — Not returned directly by `token info`. Calculate as `price × circulating_supply` (both are top-level fields in the response, already in human-readable units).
22
+ - **Liquidity** — USD value of token reserves in the main trading pool. Low liquidity (< $10k) means high price impact / slippage when buying or selling.
23
+ - **Holder** — A wallet that currently holds the token. `token holders` returns wallets ranked by current balance.
24
+ - **Trader** — Any wallet that has transacted with the token (bought or sold), regardless of current holdings. `token traders` covers both current holders and past traders.
25
+ - **Smart money (`smart_degen`)** — Wallets with a proven track record of profitable trading, tagged by GMGN's algorithm. High `smart_degen_count` is a bullish signal.
26
+ - **KOL (`renowned`)** — Known influencer, fund, or public figure wallets, tagged by GMGN. Their positions are publicly tracked.
27
+ - **Honeypot** — A token where buy transactions succeed but sell transactions always fail. User funds become permanently trapped. Only detectable on BSC/Base (`is_honeypot`); not applicable on SOL.
28
+ - **Renounced (mint / freeze / ownership)** — The developer has permanently given up that authority. On SOL: `renounced_mint` (cannot create new supply) and `renounced_freeze_account` (cannot freeze wallets) both `true` is the safe baseline. On EVM: `owner_renounced` `"yes"` means no admin backdoors.
29
+ - **rug_ratio** — A 0–1 risk score estimating the likelihood of a rug pull. Values above `0.3` are high-risk. Do not treat as a binary safe/unsafe flag — use in combination with other signals.
30
+ - **Bonding curve** — Price discovery mechanism used by launchpads (e.g. Pump.fun, letsbonk). Token price rises as more is bought. When the curve fills, the token "graduates" to an open DEX pool. `is_on_curve: true` means the token has not graduated yet.
31
+ - **Wallet tags** — GMGN-assigned labels on wallets: `smart_degen` (smart money), `renowned` (KOL), `sniper` (launched at token open), `bundler` (bot-bundled buy), `rat_trader` (insider/sneak trading). Use `--tag` to filter `token holders` / `token traders` by these labels.
32
+
13
33
  ## Sub-commands
14
34
 
15
35
  | Sub-command | Description |
@@ -67,6 +87,23 @@ Use the `gmgn-cli` tool to query token information based on the user's request.
67
87
  | `renowned` | KOL / well-known wallets (influencers, funds, public figures) |
68
88
  | `smart_degen` | Smart money wallets (historically high-performing traders) |
69
89
 
90
+ ### `--tag` + `--order-by` Combination Guide
91
+
92
+ `--tag` and `--order-by` are independent — all `--order-by` values are valid with or without `--tag`. Omitting `--tag` returns all wallets (no filter).
93
+
94
+ Recommended combinations for common use cases:
95
+
96
+ | Goal | `--tag` | `--order-by` |
97
+ |------|---------|--------------|
98
+ | Largest smart money holders by supply | `smart_degen` | `amount_percentage` |
99
+ | Smart money with highest realized profit | `smart_degen` | `profit` |
100
+ | Smart money sitting on unrealized gains | `smart_degen` | `unrealized_profit` |
101
+ | Smart money aggressively accumulating | `smart_degen` | `buy_volume_cur` |
102
+ | Smart money distributing (exit signal) | `smart_degen` | `sell_volume_cur` |
103
+ | KOLs who already took profit | `renowned` | `profit` |
104
+ | KOLs still holding with paper gains | `renowned` | `unrealized_profit` |
105
+ | Largest holders overall (no filter) | *(omit)* | `amount_percentage` |
106
+
70
107
  ## Response Field Reference
71
108
 
72
109
  ### `token info` — Key Fields
@@ -209,23 +246,106 @@ The response has four nested objects: `pool`, `link`, `stat`, `wallet_tags_stat`
209
246
 
210
247
  ---
211
248
 
212
- ### `token holders` / `token traders` — Item Fields
249
+ ### `token holders` / `token traders` — Response Fields
250
+
251
+ The response is an object with a `list` array. Each item in `list` represents one wallet.
213
252
 
214
- Each item in the result array:
253
+ **Identity & Holdings**
215
254
 
216
255
  | Field | Description |
217
256
  |-------|-------------|
218
257
  | `address` | Wallet address |
219
- | `name` | Wallet label or alias (if known) |
220
- | `tags` | Wallet tags (e.g. `["renowned"]`, `["smart_degen"]`) |
221
- | `amount_percentage` | Percentage of total supply held (0–1); e.g. `0.05` = 5% |
222
- | `amount` | Raw token amount held |
223
- | `value` | USD value of holdings |
224
- | `profit` | Realized profit in USD (positive = profit, negative = loss) |
225
- | `unrealized_profit` | Unrealized profit in USD based on current price |
226
- | `buy_volume_cur` | Total buy volume in USD for the current period |
227
- | `sell_volume_cur` | Total sell volume in USD for the current period |
228
- | `profit_change` | Profit change ratio |
258
+ | `account_address` | Token account address (the on-chain account holding the token, distinct from the wallet address) |
259
+ | `addr_type` | Address type: `0` = regular wallet, `2` = exchange / liquidity pool |
260
+ | `exchange` | Exchange or pool name if `addr_type` is `2` (e.g. `pump_amm`, `raydium`) |
261
+ | `wallet_tag_v2` | Rank label in this list (e.g. `TOP1`, `TOP2`, ...) |
262
+ | `native_balance` | Native token balance in smallest unit (lamports for SOL) |
263
+ | `balance` | Current token balance (human-readable units) |
264
+ | `amount_cur` | Same as `balance` current token amount held |
265
+ | `usd_value` | USD value of current holdings at current price |
266
+ | `amount_percentage` | Ratio of total supply held (0–1); e.g. `0.05` = 5% |
267
+ | `is_on_curve` | `true` = still on bonding curve (pump.fun pre-graduation); `false` = open market |
268
+ | `is_new` | Whether this is a newly created wallet |
269
+ | `is_suspicious` | Whether this wallet is flagged as suspicious |
270
+ | `transfer_in` | Whether the current holding was received via transfer (not bought) |
271
+
272
+ **Trading Summary**
273
+
274
+ | Field | Description |
275
+ |-------|-------------|
276
+ | `buy_volume_cur` | Total buy volume in USD |
277
+ | `sell_volume_cur` | Total sell volume in USD |
278
+ | `buy_amount_cur` | Total tokens bought |
279
+ | `sell_amount_cur` | Total tokens sold |
280
+ | `sell_amount_percentage` | Ratio of bought tokens that have been sold (0–1); `1.0` = fully exited |
281
+ | `buy_tx_count_cur` | Number of buy transactions |
282
+ | `sell_tx_count_cur` | Number of sell transactions |
283
+ | `netflow_usd` | Net USD flow = sell income − buy cost (negative = net spent) |
284
+ | `netflow_amount` | Net token flow = bought − sold (positive = still holding net position) |
285
+
286
+ **Cost & P&L**
287
+
288
+ | Field | Description |
289
+ |-------|-------------|
290
+ | `avg_cost` | Average buy price in USD per token |
291
+ | `avg_sold` | Average sell price in USD per token |
292
+ | `history_bought_cost` | Total USD spent buying |
293
+ | `history_bought_fee` | Total fees paid on buys in USD |
294
+ | `history_sold_income` | Total USD received from selling |
295
+ | `history_sold_fee` | Total fees paid on sells in USD |
296
+ | `total_cost` | Total cost basis including fees |
297
+ | `profit` | Total profit in USD (realized + unrealized) |
298
+ | `profit_change` | Total profit ratio = profit / total_cost |
299
+ | `realized_profit` | Realized profit in USD from completed sells |
300
+ | `realized_pnl` | Realized profit ratio = realized_profit / buy_cost |
301
+ | `unrealized_profit` | Unrealized profit in USD on current holdings at current price |
302
+ | `unrealized_pnl` | Unrealized profit ratio; `null` if no current holdings |
303
+
304
+ **Transfer History**
305
+
306
+ | Field | Description |
307
+ |-------|-------------|
308
+ | `current_transfer_in_amount` | Tokens received via transfer (not bought) in current period |
309
+ | `current_transfer_out_amount` | Tokens sent out via transfer (not sold) in current period |
310
+ | `history_transfer_in_amount` | Historical total tokens received via transfer |
311
+ | `history_transfer_in_cost` | Estimated cost basis of transferred-in tokens |
312
+ | `history_transfer_out_amount` | Historical total tokens sent out via transfer |
313
+ | `history_transfer_out_income` | Estimated income from transferred-out tokens |
314
+ | `history_transfer_out_fee` | Fees paid on transfer-outs |
315
+ | `transfer_in_count` | Number of inbound transfers |
316
+ | `transfer_out_count` | Number of outbound transfers |
317
+
318
+ **Timing**
319
+
320
+ | Field | Description |
321
+ |-------|-------------|
322
+ | `start_holding_at` | Unix timestamp when wallet first acquired this token |
323
+ | `end_holding_at` | Unix timestamp when wallet fully exited; `null` if still holding |
324
+ | `last_active_timestamp` | Unix timestamp of most recent on-chain activity for this token |
325
+ | `last_block` | Block number of last activity |
326
+
327
+ **Wallet Identity**
328
+
329
+ | Field | Description |
330
+ |-------|-------------|
331
+ | `name` | Wallet display name (if known) |
332
+ | `twitter_username` | Twitter / X username |
333
+ | `twitter_name` | Twitter / X display name |
334
+ | `avatar` | Avatar image URL |
335
+ | `tags` | Platform-level wallet tags (e.g. `["kol"]`, `["smart_degen"]`, `["axiom"]`) |
336
+ | `maker_token_tags` | Token-specific behavior tags for this wallet (e.g. `["bundler"]`, `["paper_hands"]`, `["top_holder"]`) |
337
+ | `created_at` | Wallet creation timestamp (Unix seconds); `0` if unknown |
338
+
339
+ **Last Transaction Records**
340
+
341
+ Each of the following is an object with `name`, `address`, `timestamp`, `tx_hash`, `type`:
342
+
343
+ | Field | Description |
344
+ |-------|-------------|
345
+ | `native_transfer` | Most recent native token (SOL/BNB/ETH) transfer associated with this wallet |
346
+ | `token_transfer` | Most recent token transfer (buy or sell) |
347
+ | `token_transfer_in` | Most recent inbound token transfer |
348
+ | `token_transfer_out` | Most recent outbound token transfer |
229
349
 
230
350
  ---
231
351
 
@@ -312,6 +432,20 @@ gmgn-cli token holders --chain sol --address EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGG
312
432
  --limit 100 --raw
313
433
  ```
314
434
 
435
+ ### `token traders` — `--tag` + `--order-by` Combination Guide
436
+
437
+ Use this table to pick the right combination for common `token traders` use cases:
438
+
439
+ | Use case | `--tag` | `--order-by` |
440
+ |----------|---------|-------------|
441
+ | Smart money with highest buy volume | `smart_degen` | `buy_volume_cur` |
442
+ | Smart money with highest sell volume (exit signal) | `smart_degen` | `sell_volume_cur` |
443
+ | KOLs recently active | `renowned` | `last_active_timestamp` |
444
+ | Smart money most profitable traders | `smart_degen` | `profit` |
445
+ | Snipers still holding | `sniper` | `amount_percentage` |
446
+ | Smart money sitting on biggest unrealized gains | `smart_degen` | `unrealized_profit` |
447
+ | KOLs who already took profit | `renowned` | `profit` |
448
+
315
449
  ### `token traders` — Find Active Traders
316
450
 
317
451
  ```bash
@@ -345,66 +479,92 @@ gmgn-cli token traders --chain bsc --address 0x2170Ed0880ac9A755fd29B2688956BD95
345
479
 
346
480
  ---
347
481
 
348
- ## Workflow: Full Token Due Diligence
482
+ ## Token Quick Scoring Card
349
483
 
350
- Use this workflow before deciding to buy a token.
484
+ After fetching `token security` and `token info`, apply this scoring card to give a structured verdict. Do not skip this step when the user asks for a safety check or due diligence.
351
485
 
352
- ### Step 1 Get basic info
486
+ | Field | Safe | ⚠️ Warning | 🚫 Danger (Hard Stop) |
487
+ |-------|---------|-----------|----------------------|
488
+ | `is_honeypot` | `"no"` | — | `"yes"` → **stop immediately** |
489
+ | `open_source` | `"yes"` | `"unknown"` | `"no"` |
490
+ | `owner_renounced` | `"yes"` | `"unknown"` | `"no"` |
491
+ | `renounced_mint` (SOL) | `true` | — | `false` |
492
+ | `renounced_freeze_account` (SOL) | `true` | — | `false` |
493
+ | `rug_ratio` | `< 0.10` | `0.10–0.30` | `> 0.30` |
494
+ | `top_10_holder_rate` | `< 0.20` | `0.20–0.50` | `> 0.50` |
495
+ | `creator_token_status` | `creator_close` | — | `creator_hold` |
496
+ | `buy_tax` / `sell_tax` | `0` | `0.01–0.05` | `> 0.10` |
497
+ | `sniper_count` | `< 5` | `5–20` | `> 20` |
498
+ | `smart_wallets` (from `wallet_tags_stat`) | `≥ 3` | `1–2` | `0` (bearish, not a hard stop) |
499
+ | `renowned_wallets` (from `wallet_tags_stat`) | `≥ 1` | — | `0` (neutral, not a hard stop) |
500
+
501
+ **Final scoring logic:**
502
+ - If `is_honeypot = "yes"` → **hard stop immediately**, do not proceed regardless of other signals
503
+ - If other 🚫 fields present → **skip** (strong warning — present to user)
504
+ - `smart_wallets = 0` alone is NOT a hard stop — it means no smart money interest yet, which is bearish but not disqualifying for very new tokens
505
+ - If 3+ ⚠️ with no 🚫 → **needs more research** — present findings and ask user how to proceed
506
+ - If mostly ✅ with `smart_wallets ≥ 3` → **worth researching** — proceed to holders/traders analysis
353
507
 
354
- ```bash
355
- gmgn-cli token info --chain sol --address <token_address> --raw
356
- ```
508
+ ## Workflow: Full Token Due Diligence
357
509
 
358
- Check: `price`, `liquidity`, `holder_count`, `wallet_tags_stat.smart_wallets`, `wallet_tags_stat.renowned_wallets`, `link.website` / `link.twitter_username` / `link.telegram`.
510
+ When the user asks for a full token research / due diligence, follow the steps in [`docs/workflow-token-research.md`](../../docs/workflow-token-research.md).
359
511
 
360
- **Red flags**: all `link.*` social fields empty, very low liquidity (<$10k), zero `wallet_tags_stat.smart_wallets` and `renowned_wallets`.
512
+ Steps: `token info` `token security` `token pool` market heat check `token holders/traders` (smart money signals) → Decision Framework.
361
513
 
362
- ### Step 2 Check security
514
+ **For a more comprehensive report** (user asks for a "deep report", "full analysis", "is this worth a large position"), use the extended workflow: [`docs/workflow-project-deep-report.md`](../../docs/workflow-project-deep-report.md). This adds a scored multi-dimension analysis (fundamentals + security + liquidity + smart money conviction + price action) and produces a full written report.
363
515
 
364
- ```bash
365
- gmgn-cli token security --chain sol --address <token_address> --raw
366
- ```
516
+ **For active risk monitoring** on a held position (user asks "any risk warnings", "are whales dumping", "is liquidity still healthy"), follow: [`docs/workflow-risk-warning.md`](../../docs/workflow-risk-warning.md). Uses `token security` + `token pool` + `token holders` to flag whale exits, liquidity drain, and developer dumps.
367
517
 
368
- Check these fields and their safe thresholds:
518
+ ---
369
519
 
370
- | Field | Safe | Warning | Danger |
371
- |-------|------|---------|--------|
372
- | `is_honeypot` | `"no"` | — | `"yes"` → Do not buy |
373
- | `open_source` | `"yes"` | `"unknown"` | `"no"` |
374
- | `owner_renounced` | `"yes"` | `"unknown"` | `"no"` |
375
- | `renounced_mint` (SOL) | `true` | — | `false` → mint risk |
376
- | `renounced_freeze_account` (SOL) | `true` | — | `false` → freeze risk |
377
- | `buy_tax` / `sell_tax` | `0` | `0.01–0.05` | `>0.10` → high tax |
378
- | `top_10_holder_rate` | `<0.20` | `0.20–0.40` | `>0.50` → whale risk |
379
- | `rug_ratio` | `<0.10` | `0.10–0.30` | `>0.30` → high rug risk |
380
- | `creator_token_status` | `creator_close` | — | `creator_hold` → dev not sold |
381
- | `sniper_count` | `<5` | `5–20` | `>20` → heavily sniped |
520
+ ## Output Format
382
521
 
383
- ### Step 3Check liquidity pool
522
+ ### `token info`Summary Card
384
523
 
385
- ```bash
386
- gmgn-cli token pool --chain sol --address <token_address> --raw
524
+ Present as a concise card. Do not dump raw JSON.
525
+
526
+ ```
527
+ {symbol} ({name})
528
+ Price: ${price} | Market Cap: ~${price × circulating_supply} | Liquidity: ${liquidity}
529
+ Holders: {holder_count} | Smart Money: {wallet_tags_stat.smart_wallets} | KOLs: {wallet_tags_stat.renowned_wallets}
530
+ Social: @{link.twitter_username} | {link.website} | {link.telegram}
387
531
  ```
388
532
 
389
- Check: liquidity amount, which DEX (`exchange`), pool age (`creation_timestamp`). Low liquidity means high slippage risk when buying or selling.
533
+ If any social fields are empty, omit them rather than showing `null`.
390
534
 
391
- ### Step 4Check smart money signals
535
+ ### `token security`Risk Assessment Summary
392
536
 
393
- ```bash
394
- # Is smart money accumulating?
395
- gmgn-cli token holders --chain sol --address <token_address> \
396
- --tag smart_degen --order-by buy_volume_cur --direction desc --limit 20 --raw
537
+ After fetching security data, present a structured risk summary using this format:
397
538
 
398
- # Have KOLs already taken profit?
399
- gmgn-cli token traders --chain sol --address <token_address> \
400
- --tag renowned --order-by profit --direction desc --limit 20 --raw
539
+ ```
540
+ Token: {symbol} | Chain: {chain} | Address: {short address}
541
+ ─── Security ──────────────────────────────────────
542
+ Contract verified: ✅ yes / 🚫 no / ⚠️ unknown
543
+ Owner renounced: ✅ yes / 🚫 no / ⚠️ unknown
544
+ Honeypot: ✅ no / 🚫 YES — DO NOT BUY
545
+ Mint renounced (SOL): ✅ yes / ⚠️ no
546
+ Freeze renounced(SOL):✅ yes / ⚠️ no
547
+ Rug risk score: {rug_ratio} → ✅ <0.1 Low / ⚠️ 0.1–0.3 Med / 🚫 >0.3 High
548
+ Top-10 holder %: {top_10_holder_rate%} → ✅ <20% / ⚠️ 20–50% / 🚫 >50%
549
+ Dev still holding: ✅ sold (creator_close) / ⚠️ holding (creator_hold)
550
+ Sniper wallets: ✅ <5 / ⚠️ 5–20 / 🚫 >20
551
+ ─── Smart Money ───────────────────────────────────
552
+ SM holders: {smart_wallets} KOL holders: {renowned_wallets}
553
+ ─── Verdict ───────────────────────────────────────
554
+ 🟢 Clean — worth researching
555
+ 🟡 Mixed signals — proceed with caution
556
+ 🔴 Red flags present — skip or verify manually
401
557
  ```
402
558
 
403
- **Bullish signals**: smart_degen wallets buying heavily, unrealized_profit is large (still holding), renowned wallets accumulating, low sell_volume_cur.
559
+ **If `is_honeypot = "yes"`, stop immediately and display: "🚫 HONEYPOT DETECTED Do not buy this token." Do NOT proceed to further analysis steps.**
404
560
 
405
- **Bearish signals**: sell_volume_cur > buy_volume_cur for smart money, large realized profits already taken (they may be done), top holders with very high amount_percentage starting to sell.
561
+ ### `token holders` / `token traders` Ranked Table
406
562
 
407
- ---
563
+ ```
564
+ # | Wallet (name or short addr) | Hold% | Avg Buy | Realized P&L | Unrealized P&L | Tags
565
+ ```
566
+
567
+ Show top rows only. Highlight wallets tagged `kol`, `smart_degen`, or flagged `bundler` / `rat_trader` in `maker_token_tags`.
408
568
 
409
569
  ## Notes
410
570