Compare commits

...

13 Commits

Author SHA1 Message Date
gumponchain 918518999b 1.1.4 2026-03-27 15:20:51 +08:00
gumponchain 12804798df fix: remove pinned gmgn-cli version to always use latest
Replace `npm install -g gmgn-cli@1.1.0` with `npm install -g gmgn-cli`
across all SKILL.md files and CLAUDE.md, so users always install the
latest published version instead of a pinned one that may lack newer
commands (e.g. track).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 15:18:18 +08:00
gumponchain 28062887d8 feat: add track command group, split follow-wallet/kol/smartmoney from portfolio
- Add new `track` command group with three sub-commands:
  - `track follow-wallet`: monitor trade activity of followed wallets (critical auth)
  - `track kol`: KOL trade records with optional --chain and client-side --side filter
  - `track smartmoney`: Smart Money trade records with optional --chain and client-side --side filter
- Remove follow-wallet, kol, smartmoney sub-commands from portfolio
- Add getKol/getSmartMoney optional chain param in OpenApiClient
- Switch getFollowWallet to criticalRequest (signature auth required)
- Align track follow-wallet options to actual API params (remove unsupported flags)
- Add skills/gmgn-track/SKILL.md with sub-command guide, options, response fields
- Add IMPORTANT notice to all SKILL.md files to prevent AI from scraping gmgn.ai
- Add CRITICAL RULE section to CLAUDE.md to enforce CLI-only data access
- Update Readme.md and Readme.zh.md: add gmgn-track skill, Track CLI section, user tip

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 14:19:57 +08:00
gumponchain 58849a8c61 docs: add upgrade tutorial section to README (en + zh)
Add section 9 "Upgrade Skills and CLI" between Supported Chains and Security,
covering AI Agent prompt, CLI commands, and version check for both languages.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 22:10:58 +08:00
gumponchain 0239e42b50 docs: enrich all SKILL.md files with response fields, usage examples, and AI-agent guidance
- gmgn-token: full response field reference for all 5 sub-commands (token info nested objects pool/link/stat/wallet_tags_stat, security, pool, holders, traders); granular usage examples per scenario; full due diligence workflow with security threshold table; market cap calculation note; volume redirect to kline
- gmgn-market: verified kline/trending response fields from live API; trending + platform filter examples for SOL/BSC/Base major launchpads; interval selection guide; trenches intent→type mapping table; standardized section headings with sub-command names
- gmgn-portfolio/gmgn-swap: standardize section headings to include sub-command names
- CLAUDE.md: add newly-launched token triggers for gmgn-market skill routing
- Readme/Readme.zh: add missing portfolio sub-commands, kline examples, auto-slippage swap example; remove version pin; update install instructions

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 21:31:15 +08:00
deepfeature 12d3c358d8 Merge pull request #43 from GMGNAI/codex-update-github-repo-urls
update GitHub repo urls
2026-03-26 19:53:23 +08:00
yangzhenhui c6d55356a1 1.1.3 2026-03-26 19:10:15 +08:00
yangzhenhui 2c1c0210e7 1.1.2 2026-03-26 19:09:11 +08:00
yangzhenhui 71c239da39 Normalize GitHub repository URLs 2026-03-26 19:06:03 +08:00
yangzhenhui 0e5e5f8684 1.1.1 2026-03-26 17:42:42 +08:00
deepfeature b8bc81d915 Merge pull request #41 from GumpOnchain/feat/trenches-custom-body
feat(market): add structured options for trenches command
2026-03-26 17:09:48 +08:00
gumponchain 08b48c8e24 feat(market): add structured --type/--launchpad-platform/--limit options for trenches command
Replace raw --body JSON parameter with structured CLI flags for better AI agent readability.
Add full response key reference and SOL/BSC/Base examples to SKILL.md and docs.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 17:02:24 +08:00
deepfeature 5a8879c6d2 Merge pull request #40 from GMGNAI/codex-add-github-actions-workflows
Add GitHub Actions CI and release workflows
2026-03-26 16:51:31 +08:00
21 changed files with 1274 additions and 213 deletions
+1 -1
View File
@@ -15,7 +15,7 @@
"name": "GMGN"
},
"homepage": "https://gmgn.ai",
"repository": "https://github.com/gmgn-ai/gmgn-skills",
"repository": "https://github.com/GMGNAI/gmgn-skills",
"license": "MIT",
"keywords": [
"gmgn",
+1 -1
View File
@@ -6,7 +6,7 @@
"name": "GMGN",
"url": "https://gmgn.ai"
},
"repository": "https://github.com/gmgn-ai/gmgn-skills",
"repository": "https://github.com/GMGNAI/gmgn-skills",
"license": "MIT",
"keywords": ["gmgn", "crypto", "solana", "token", "defi", "swap"],
"skills": "./skills/"
+1 -1
View File
@@ -12,7 +12,7 @@ Enable GMGN skills in Codex via native skill discovery. Just clone and symlink.
1. **Clone the repository:**
```bash
git clone https://github.com/gmgn-ai/gmgn-skills ~/.codex/gmgn-cli
git clone https://github.com/GMGNAI/gmgn-skills ~/.codex/gmgn-cli
```
2. **Create the skills symlink:**
+1 -1
View File
@@ -6,7 +6,7 @@
"name": "GMGN"
},
"homepage": "https://gmgn.ai",
"repository": "https://github.com/gmgn-ai/gmgn-skills",
"repository": "https://github.com/GMGNAI/gmgn-skills",
"license": "MIT",
"keywords": [
"gmgn",
+1 -1
View File
@@ -12,7 +12,7 @@ Enable GMGN skills in OpenCode via native skill discovery. Just clone and symlin
1. **Clone the repository:**
```bash
git clone https://github.com/gmgn-ai/gmgn-skills ~/.opencode/gmgn-cli
git clone https://github.com/GMGNAI/gmgn-skills ~/.opencode/gmgn-cli
```
2. **Register the plugin:**
+20 -3
View File
@@ -2,6 +2,22 @@
This file provides guidance to Claude Code when working with the gmgn-cli plugin.
## CRITICAL RULE — Read This First
**ALL queries about GMGN data MUST use `gmgn-cli` via the skills below.**
This includes: trending tokens, token info, security checks, K-line / price history, wallet holdings, KOL trades, Smart Money trades, swaps, and any other on-chain data.
**NEVER do any of the following to fetch GMGN data:**
- Web search (e.g. searching "gmgn trending solana")
- WebFetch / curl to gmgn.ai or any gmgn domain
- Browser automation or scraping
- Any method other than `gmgn-cli`
**Why:** The gmgn.ai website requires login, uses dynamic rendering, and does not expose structured data. The CLI is the only correct and supported method. If you attempt to scrape the site, you will get no data or be blocked.
**When a user asks anything about GMGN data — always invoke the matching skill and run the CLI command. No exceptions.**
## Project Overview
This is a **Claude Code plugin** — a collection of GMGN OpenAPI skills for on-chain operations. It provides CLI tools and skills for token queries, market data, wallet portfolio analysis, and swap execution across sol / bsc / base.
@@ -11,14 +27,15 @@ This is a **Claude Code plugin** — a collection of GMGN OpenAPI skills for on-
| Skill | Purpose | When to Use |
|-------|---------|-------------|
| `gmgn-token` | Token info, security, pool, holders, traders | User asks about a token's price, market cap, security risk, liquidity pool, top holders, or top traders; user wants to research a token before buying; user asks "is this token safe", "who holds this token", "what's the liquidity" |
| `gmgn-market` | K-line / candlestick market data + trending tokens | User asks for price history, chart data, OHLCV candles; user wants to analyze price trends over time; user asks "show me the 1h chart", "what was the price last week", "give me kline data for this token"; user wants to discover hot or trending tokens; user asks "what tokens are trending", "show me top tokens by volume", "find hot tokens on SOL" |
| `gmgn-market` | K-line / candlestick market data + trending tokens + newly launched launchpad tokens | User asks for price history, chart data, OHLCV candles, trading volume over time; user wants to analyze price trends; user asks "show me the 1h chart", "what was the price last week", "give me kline data for this token"; user wants to discover hot or trending tokens; user asks "what tokens are trending", "show me top tokens by volume", "find hot tokens on SOL"; **user asks about newly launched tokens, fresh tokens, latest tokens on launchpads** — e.g. "show me new tokens on pump.fun", "what tokens just launched on SOL", "find newly created tokens", "latest tokens on letsbonk" → use `market trenches --type new_creation` |
| `gmgn-portfolio` | Wallet holdings, activity, trading stats, token balance | User asks about a wallet's holdings, P&L, transaction history, trading statistics, or token balance; user wants to analyze a wallet; user asks "what tokens does this wallet hold", "show me recent trades", "what's the win rate of this wallet" |
| `gmgn-track` | Track trade activity of wallets I follow, KOL trades, Smart Money trades across chains | User asks about trades from wallets they follow; user wants to see what KOLs or Smart Money are buying/selling; user asks "show me what wallets I follow have traded recently", "what are KOLs buying", "show me smart money moves on BSC" |
| `gmgn-swap` | Token swap execution + order status query | User wants to swap tokens, execute a trade, or check an order status; user asks "swap SOL for USDC", "buy this token", "check my order"; **requires private key configured in `.env`** |
## Architecture
- **`src/`** — TypeScript source (CLI commands, API client, signer)
- **`skills/`** — 4 SKILL.md files for Claude Code skill definitions
- **`skills/`** — 5 SKILL.md files for Claude Code skill definitions
- **`dist/`** — Compiled output (generated by `npm run build`)
- **`.claude-plugin/`** — Plugin metadata for Claude Code
@@ -53,7 +70,7 @@ EOF
When creating or updating any file in `skills/`:
- **Language**: English only — no bilingual content. SKILL.md files are read by AI, not humans.
- **Package runner**: Always use the pre-installed `gmgn-cli` binary (e.g. `gmgn-cli token info ...`). Never use `npx gmgn-cli` or `npx gmgn-cli@<version>` — npx downloads the package at runtime alongside live credentials. The package must be installed once with `npm install -g gmgn-cli@1.1.0`.
- **Package runner**: Always use the pre-installed `gmgn-cli` binary (e.g. `gmgn-cli token info ...`). Never use `npx gmgn-cli` or `npx gmgn-cli@<version>` — npx downloads the package at runtime alongside live credentials. The package must be installed once with `npm install -g gmgn-cli`.
- **Section order**: Sub-commands → Supported Chains → Prerequisites → Parameters/Options (if needed) → Usage Examples → Notes
- **`--raw` flag**: All commands support `--raw` for single-line JSON output. Always document it in the Notes section.
- **YAML frontmatter**: Quote `argument-hint` values that contain `|` characters to avoid YAML parsing errors.
+77 -8
View File
@@ -21,6 +21,7 @@ With GMGN Agent Skills, you can use AI agents to query real-time trending token
| [`/gmgn-token`](skills/gmgn-token/SKILL.md) | Token info, security, pool, holders, traders | [SKILL.md](skills/gmgn-token/SKILL.md) |
| [`/gmgn-market`](skills/gmgn-market/SKILL.md) | K-line market data, trending tokens | [SKILL.md](skills/gmgn-market/SKILL.md) |
| [`/gmgn-portfolio`](skills/gmgn-portfolio/SKILL.md) | Wallet holdings, activity, stats | [SKILL.md](skills/gmgn-portfolio/SKILL.md) |
| [`/gmgn-track`](skills/gmgn-track/SKILL.md) | Follow-wallet trades, KOL trades, Smart Money trades | [SKILL.md](skills/gmgn-track/SKILL.md) |
| [`/gmgn-swap`](skills/gmgn-swap/SKILL.md) | Swap submission + order query | [SKILL.md](skills/gmgn-swap/SKILL.md) |
> For detailed CLI commands, parameters, and recommended values, see the [Wiki documentation](https://github.com/GMGNAI/gmgn-skills/wiki).
@@ -29,6 +30,11 @@ With GMGN Agent Skills, you can use AI agents to query real-time trending token
Ready to install skills? [Jump to Installation →](#get-started)
> **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.
> ```
---
## Demo Cases
@@ -80,7 +86,7 @@ npx skills add GMGNAI/gmgn-skills
### 1.2 npm Global Install
```bash
npm install -g gmgn-cli@1.1.0
npm install -g gmgn-cli
```
### 1.3 Local Development
@@ -194,12 +200,12 @@ Skills are automatically discovered via the `.cursor-plugin/` configuration.
```bash
echo "$(npm root -g)/gmgn-skills/skills"
```
3. Restart Cline — `/gmgn-token`, `/gmgn-market`, `/gmgn-portfolio`, `/gmgn-swap` will be available
3. Restart Cline — `/gmgn-token`, `/gmgn-market`, `/gmgn-portfolio`, `/gmgn-track`, `/gmgn-swap` will be available
#### Codex CLI
```bash
git clone https://github.com/gmgn-ai/gmgn-skills ~/.codex/gmgn-cli
git clone https://github.com/GMGNAI/gmgn-skills ~/.codex/gmgn-cli
mkdir -p ~/.agents/skills
ln -s ~/.codex/gmgn-cli/skills ~/.agents/skills/gmgn-cli
```
@@ -209,7 +215,7 @@ See [.codex/INSTALL.md](.codex/INSTALL.md) for full instructions.
#### OpenCode
```bash
git clone https://github.com/gmgn-ai/gmgn-skills ~/.opencode/gmgn-cli
git clone https://github.com/GMGNAI/gmgn-skills ~/.opencode/gmgn-cli
mkdir -p ~/.agents/skills
ln -s ~/.opencode/gmgn-cli/skills ~/.agents/skills/gmgn-cli
```
@@ -277,6 +283,12 @@ npx gmgn-cli market trending \
--interval 1h \
--order-by volume --limit 20 \
--filter not_risk --filter not_honeypot
npx gmgn-cli market trenches \
--chain sol \
--type new_creation --type near_completion --type completed \
--launchpad-platform Pump.fun --launchpad-platform pump_mayhem --launchpad-platform letsbonk \
--limit 80
```
### Portfolio
@@ -285,10 +297,26 @@ npx gmgn-cli market trending \
npx gmgn-cli portfolio holdings --chain sol --wallet <addr>
```
### Track
```bash
# Follow-wallet trade records (requires GMGN_PRIVATE_KEY)
npx gmgn-cli track follow-wallet --chain sol
npx gmgn-cli track follow-wallet --chain sol --wallet <wallet_address> --side buy
# KOL trade records
npx gmgn-cli track kol --limit 100 --raw
npx gmgn-cli track kol --chain sol --side buy --limit 50 --raw
# Smart Money trade records
npx gmgn-cli track smartmoney --limit 100 --raw
npx gmgn-cli track smartmoney --chain sol --side sell --limit 50 --raw
```
### Swap (requires private key)
```bash
# Submit swap
# Submit swap with fixed slippage
npx gmgn-cli swap \
--chain sol \
--from <wallet-address> \
@@ -297,6 +325,15 @@ npx gmgn-cli swap \
--amount 1000000 \
--slippage 0.01
# Submit swap with automatic slippage
npx gmgn-cli swap \
--chain sol \
--from <wallet-address> \
--input-token <input-token-addr> \
--output-token <output-token-addr> \
--amount 1000000 \
--auto-slippage
# Query order
npx gmgn-cli order get --chain sol --order-id <order-id>
```
@@ -305,12 +342,44 @@ npx gmgn-cli order get --chain sol --order-id <order-id>
| Commands | Chains | Chain Currencies |
|----------|--------|-----------------|
| token / market / portfolio | `sol` / `bsc` / `base` | — |
| token / market / portfolio / track | `sol` / `bsc` / `base` | — |
| swap / order | `sol` / `bsc` / `base` | sol: SOL, USDC · bsc: BNB, USDC · base: ETH, USDC |
---
## 9. Security & Disclaimer
## 9. Upgrade Skills and CLI
To upgrade `gmgn-cli` and Skills to the latest version:
**Via AI Agent (recommended)**
Send this to your AI agent:
```
Run these two commands to update gmgn-cli and the skills:
1. npm install -g gmgn-cli
2. npx skills add GMGNAI/gmgn-skills
```
**Via CLI**
```bash
# Upgrade gmgn-cli
npm install -g gmgn-cli
# Upgrade Skills
npx skills add GMGNAI/gmgn-skills
```
**Check the current version**
```bash
gmgn-cli --version
```
---
## 10. Security & Disclaimer
**About `GMGN_PRIVATE_KEY`**
@@ -321,7 +390,7 @@ npx gmgn-cli order get --chain sol --order-id <order-id>
- Restrict config file permissions: `chmod 600 ~/.config/gmgn/.env`
- Never commit your `.env` file to version control — add it to `.gitignore`
- Do not share `GMGN_API_KEY` or `GMGN_PRIVATE_KEY` in logs, screenshots, or chat messages
- Use a pinned install (`npm install -g gmgn-cli@1.1.0`) rather than `npx gmgn-cli` to avoid executing unintended package updates alongside your credentials
- Always use the latest version of gmgn-cli (`npm install -g gmgn-cli`). To check your current version: `gmgn-cli --version`
**Disclaimer**
+149 -10
View File
@@ -21,6 +21,7 @@
| [`/gmgn-token`](skills/gmgn-token/SKILL.md) | Token 信息、安全、池子、持有者、交易者 | [SKILL.md](skills/gmgn-token/SKILL.md) |
| [`/gmgn-market`](skills/gmgn-market/SKILL.md) | K 线行情数据、热门代币 | [SKILL.md](skills/gmgn-market/SKILL.md) |
| [`/gmgn-portfolio`](skills/gmgn-portfolio/SKILL.md) | 钱包持仓、活动、统计 | [SKILL.md](skills/gmgn-portfolio/SKILL.md) |
| [`/gmgn-track`](skills/gmgn-track/SKILL.md) | 追踪关注钱包交易动态、KOL 交易动态、聪明钱交易动态 | [SKILL.md](skills/gmgn-track/SKILL.md) |
| [`/gmgn-swap`](skills/gmgn-swap/SKILL.md) | 兑换提交 + 订单查询 | [SKILL.md](skills/gmgn-swap/SKILL.md) |
> 如需查看详细的 CLI 接口说明、传参格式和推荐值,请参阅 [Wiki 文档](https://github.com/GMGNAI/gmgn-skills/wiki/Home-Chinese)。
@@ -29,6 +30,11 @@
已准备好?[点击这里开始安装 Skills →](#开始安装-skills)
> **提示:** 如果你的 AI Agent 尝试直接打开 gmgn.ai 网站而不是使用 CLI,请在提示词中加上:
> ```
> 用 gmgn-cli 命令,不要直接请求gmgn.ai网页接口。
> ```
---
## 使用案例
@@ -67,7 +73,7 @@
## 1. 安装
选择以下任意一种方式
选择以下任意一种方式
### 1.1 通过 Agent 安装(推荐)
@@ -80,7 +86,7 @@ npx skills add GMGNAI/gmgn-skills
### 1.2 npm 全局安装
```bash
npm install -g gmgn-cli@1.1.0
npm install -g gmgn-cli
```
### 1.3 本地开发
@@ -194,12 +200,12 @@ cp .env.example .env
```bash
echo "$(npm root -g)/gmgn-skills/skills"
```
3. 重启 Cline — `/gmgn-token`、`/gmgn-market`、`/gmgn-portfolio`、`/gmgn-swap` 即可使用
3. 重启 Cline — `/gmgn-token`、`/gmgn-market`、`/gmgn-portfolio`、`/gmgn-track`、`/gmgn-swap` 即可使用
#### Codex CLI
```bash
git clone https://github.com/gmgn-ai/gmgn-skills ~/.codex/gmgn-cli
git clone https://github.com/GMGNAI/gmgn-skills ~/.codex/gmgn-cli
mkdir -p ~/.agents/skills
ln -s ~/.codex/gmgn-cli/skills ~/.agents/skills/gmgn-cli
```
@@ -209,7 +215,7 @@ ln -s ~/.codex/gmgn-cli/skills ~/.agents/skills/gmgn-cli
#### OpenCode
```bash
git clone https://github.com/gmgn-ai/gmgn-skills ~/.opencode/gmgn-cli
git clone https://github.com/GMGNAI/gmgn-skills ~/.opencode/gmgn-cli
mkdir -p ~/.agents/skills
ln -s ~/.opencode/gmgn-cli/skills ~/.agents/skills/gmgn-cli
```
@@ -227,12 +233,23 @@ ln -s ~/.opencode/gmgn-cli/skills ~/.agents/skills/gmgn-cli
```
用 0.1 SOL 买入 <token_address>
卖出 BSC 上 <token_address> 的 50%
把我持有的 <token_address> 卖掉 30%
查询报价,我想用 1 SOL 换 <token_address>,能换多少
查询订单状态 <order_id>
solana 上的 <token_address> 安全吗,值得买入吗?
查看 <token_address> 的前十大持有者
查看 <token_address> 的聪明钱持仓,按买入量排序
查看 <token_address> 最近的 KOL 交易动态
查看我在 SOL 上的钱包持仓
查询 0x1234... 的代币详情
查看 <token_address> 过去 24 小时的 K 线和交易量
查看 BSC 上钱包 <wallet_address> 的交易统计
查看钱包 <wallet_address> 最近的交易记录
我的 API Key 绑定了哪些钱包,余额各是多少
查看 SOL 链上最新的聪明钱交易动态
查看 SOL 链上 KOL 最近在买什么
查询 Solana 上最新发布的代币
查询 Solana 1 分钟交易热门代币
```
### 典型使用场景
@@ -266,29 +283,92 @@ solana 上的 <token_address> 安全吗,值得买入吗?
### Token
```bash
# 基本信息 + 实时价格
npx gmgn-cli token info --chain sol --address <addr>
# 安全指标(蜜罐、税率、集中度、rug 风险)
npx gmgn-cli token security --chain sol --address <addr>
# 流动池信息(DEX、储备量、深度)
npx gmgn-cli token pool --chain sol --address <addr>
# 持仓大户(按持仓比例排序)
npx gmgn-cli token holders --chain sol --address <addr> --limit 50
# 聪明钱持仓大户(按买入量排序)
npx gmgn-cli token holders --chain sol --address <addr> \
--tag smart_degen --order-by buy_volume_cur --limit 20
# 交易大户(KOL,按已实现盈利排序)
npx gmgn-cli token traders --chain sol --address <addr> \
--tag renowned --order-by profit --limit 20
```
### Market
```bash
# K 线数据(1h 周期,最近 24 小时)
# macOS:
npx gmgn-cli market kline \
--chain sol --address <addr> \
--resolution 1h \
--from $(date -v-24H +%s) --to $(date +%s)
# Linux: $(date -d '24 hours ago' +%s)
# 热门代币榜(SOL,1h,按交易量排序)
npx gmgn-cli market trending \
--chain sol \
--interval 1h \
--order-by volume --limit 20 \
--filter not_risk --filter not_honeypot
# 战壕新币列表
npx gmgn-cli market trenches \
--chain sol \
--type new_creation --type near_completion --type completed \
--launchpad-platform Pump.fun --launchpad-platform pump_mayhem --launchpad-platform letsbonk \
--limit 80
```
### Portfolio
```bash
# 钱包持仓
npx gmgn-cli portfolio holdings --chain sol --wallet <addr>
# 交易记录
npx gmgn-cli portfolio activity --chain sol --wallet <addr>
# 交易统计(支持多钱包)
npx gmgn-cli portfolio stats --chain sol --wallet <addr1> --wallet <addr2>
# API Key 绑定的钱包及主币余额
npx gmgn-cli portfolio info
# 单个 token 余额
npx gmgn-cli portfolio token-balance --chain sol --wallet <addr> --token <token_addr>
```
### Track
```bash
# 追踪关注钱包的交易动态(需要 GMGN_PRIVATE_KEY
npx gmgn-cli track follow-wallet --chain sol
npx gmgn-cli track follow-wallet --chain sol --wallet <wallet_address> --side buy
# KOL 交易动态
npx gmgn-cli track kol --limit 100 --raw
npx gmgn-cli track kol --chain sol --side buy --limit 50 --raw
# 聪明钱交易动态
npx gmgn-cli track smartmoney --limit 100 --raw
npx gmgn-cli track smartmoney --chain sol --side sell --limit 50 --raw
```
### Swap(需要私钥)
```bash
# 提交兑换
# 提交兑换(固定滑点)
npx gmgn-cli swap \
--chain sol \
--from <wallet-address> \
@@ -297,7 +377,34 @@ npx gmgn-cli swap \
--amount 1000000 \
--slippage 0.01
# 查询订单
# 提交兑换(自动滑点)
npx gmgn-cli swap \
--chain sol \
--from <wallet-address> \
--input-token <input-token-addr> \
--output-token <output-token-addr> \
--amount 1000000 \
--auto-slippage
# 按持仓比例卖出(例:卖出 50%)
npx gmgn-cli swap \
--chain sol \
--from <wallet-address> \
--input-token <token-addr> \
--output-token <usdc-addr> \
--percent 50 \
--auto-slippage
# 获取报价(不提交交易)
npx gmgn-cli order quote \
--chain sol \
--from <wallet-address> \
--input-token <input-token-addr> \
--output-token <output-token-addr> \
--amount 1000000 \
--slippage 0.01
# 查询订单状态
npx gmgn-cli order get --chain sol --order-id <order-id>
```
@@ -305,12 +412,44 @@ npx gmgn-cli order get --chain sol --order-id <order-id>
| 接口类型 | 支持的链 | 链原生货币 |
|----------|----------|-----------|
| token / market / portfolio | `sol` / `bsc` / `base` | — |
| token / market / portfolio / track | `sol` / `bsc` / `base` | — |
| swap / order | `sol` / `bsc` / `base` | sol: SOL、USDC · bsc: BNB、USDC · base: ETH、USDC |
---
## 9. 安全与免责
## 9. 升级 Skills 和 CLI
将 `gmgn-cli` 和 Skills 升级到最新版本:
**方式一:通过 AI Agent(推荐)**
发送给你的 AI Agent
```
运行以下两条命令,更新 gmgn-cli 和 Skills 文档:
1. npm install -g gmgn-cli
2. npx skills add GMGNAI/gmgn-skills
```
**方式二:通过 CLI**
```bash
# 升级 gmgn-cli
npm install -g gmgn-cli
# 升级 Skills
npx skills add GMGNAI/gmgn-skills
```
**查看当前版本号**
```bash
gmgn-cli --version
```
---
## 10. 安全与免责
**关于 `GMGN_PRIVATE_KEY`**
@@ -321,7 +460,7 @@ npx gmgn-cli order get --chain sol --order-id <order-id>
- 限制配置文件权限:`chmod 600 ~/.config/gmgn/.env`
- 不要将 `.env` 文件提交到版本控制系统,请将其加入 `.gitignore`
- 不要在日志、截图或聊天中泄露 `GMGN_API_KEY` 或 `GMGN_PRIVATE_KEY`
- 使用固定版本安装`npm install -g gmgn-cli@1.1.0`),而非 `npx gmgn-cli`,以避免在持有凭证的环境中执行未预期的包更新
- 使用最新的 gmgn-cli`npm install -g gmgn-cli`),查看当前版本请使用 `gmgn-cli --version`。
**免责声明**
+5 -2
View File
@@ -260,14 +260,17 @@ npx gmgn-cli portfolio token-balance \
Query Trenches token lists (new creation, near completion, completed).
```bash
npx gmgn-cli market trenches --chain <chain> [--raw]
npx gmgn-cli market trenches --chain <chain> [--type <type...>] [--launchpad-platform <platform...>] [--limit <n>] [--raw]
```
| Option | Required | Description |
|--------|----------|-------------|
| `--chain` | Yes | `sol` / `bsc` / `base` |
| `--type` | No | Categories to query, repeatable: `new_creation` / `near_completion` / `completed` (default: all three) |
| `--launchpad-platform` | No | Launchpad platform filter, repeatable (default: all platforms for the chain) |
| `--limit` | No | Max results per category, max 80 (default: 80) |
**Response:** `data.new_creation`, `data.pump`, `data.completed` — each is an array of `RankItem` (same structure as `market trending` rank items).
**Response:** `data.new_creation`, `data.pump`, `data.completed` — each is an array of `RankItem` (same structure as `market trending` rank items). **Note: `data.pump` in the response corresponds to `--type near_completion` in the request. The API always returns this category under the key `pump`, not `near_completion`.**
---
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "gmgn-cli",
"version": "1.1.0",
"version": "1.1.4",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "gmgn-cli",
"version": "1.1.0",
"version": "1.1.4",
"license": "MIT",
"dependencies": {
"commander": "^12.1.0",
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "gmgn-cli",
"version": "1.1.0",
"version": "1.1.4",
"description": "GMGN OpenAPI CLI — call GMGN market, token, portfolio and swap APIs from the command line",
"type": "module",
"bin": {
@@ -36,7 +36,7 @@
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/gmgn-ai/gmgn-skills"
"url": "https://github.com/GMGNAI/gmgn-skills"
},
"keywords": [
"gmgn",
+416 -20
View File
@@ -4,15 +4,17 @@ description: Query GMGN market data — token K-line (candlestick), trending tok
argument-hint: "kline --chain <sol|bsc|base> --address <token_address> --resolution <1m|5m|15m|1h|4h|1d> [--from <unix_ts>] [--to <unix_ts>] | trending --chain <sol|bsc|base> --interval <1m|5m|1h|6h|24h> | trenches --chain <sol|bsc|base>"
---
**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.**
Use the `gmgn-cli` tool to query K-line data for a token, browse trending tokens, or view Trenches token lists.
## Sub-commands
| Sub-command | Description |
|-------------|-------------|
| `market kline` | Token candlestick data |
| `market trending` | Trending token swap data |
| `market trenches` | Trenches token lists (new creation, near completion, completed) |
| `market kline` | Token candlestick / OHLCV data and trading volume over a time range |
| `market trending` | Trending tokens ranked by swap activity — use `--interval` to specify the time window (e.g. `1m` for 1-minute hottest, `1h` for 1-hour trending) |
| `market trenches` | Newly launched launchpad paltform tokens — **use this when the user asks for "new tokens", "just launched tokens", "latest tokens on pump.fun/letsbonk"**. Three categories: `new_creation` (just created), `near_completion` (bonding curve almost full), `completed` (graduated to open market / DEX) |
## Supported Chains
@@ -22,23 +24,52 @@ Use the `gmgn-cli` tool to query K-line data for a token, browse trending tokens
- `.env` file with `GMGN_API_KEY` set
- Run from the directory where your `.env` file is located, or set `GMGN_HOST` in your environment
- `gmgn-cli` installed globally: `npm install -g gmgn-cli@1.1.0`
- `gmgn-cli` installed globally: `npm install -g gmgn-cli`
## Kline Parameters
## `market kline` Parameters
| Parameter | Required | Description |
|-----------|----------|-------------|
| `--chain` | Yes | `sol` / `bsc` / `base` |
| `--address` | Yes | Token contract address |
| `--resolution` | Yes | Candlestick resolution |
| `--resolution` | Yes | Candlestick resolution: `1m` / `5m` / `15m` / `1h` / `4h` / `1d` |
| `--from` | No | Start time (Unix seconds) |
| `--to` | No | End time (Unix seconds) |
## Resolutions
## `market kline` Response Fields
`1m` / `5m` / `15m` / `1h` / `4h` / `1d`
The response is an object with a `list` array. Each element in `list` is one candlestick:
## Trending Options
| Field | Type | Description |
|-------|------|-------------|
| `time` | number | Candle open time — Unix timestamp in **milliseconds** (divide by 1000 for seconds) |
| `open` | string | Opening price in USD at the start of the period |
| `close` | string | Closing price in USD at the end of the period |
| `high` | string | Highest price in USD during the period |
| `low` | string | Lowest price in USD during the period |
| `volume` | string | Trading volume in **USD** (dollar value of all trades in this period) |
| `amount` | string | Trading volume in **base token units** (number of tokens traded) |
**Important distinctions (naming is counterintuitive — do not guess):**
- `volume` = USD dollar value (e.g. `1214` means ~$1,214 traded) — use this for "how much was traded in USD"
- `amount` = token count (e.g. `5379110` means ~5.38M tokens changed hands) — use this for "how many tokens were traded"
- For tokens not priced at $1, `volume` and `amount` will differ by orders of magnitude (e.g. a $0.0002 token: $1,214 volume = 5,379,110 tokens)
- To get **total USD volume over a time range**, sum `volume` across all candles in the range
- To get **price trend**, read `close` values in chronological order (`time` ascending)
- To detect **volatility**, compare `high` vs `low` within each candle
- Candles are returned in chronological order (oldest first)
## `market trending` Options
**`--interval` selection guide — always match to the user's stated time window:**
| User says | `--interval` |
|-----------|-------------|
| "1分钟热门" / "1m trending" / "hottest right now" | `1m` |
| "5分钟" / "5m" | `5m` |
| "1小时" / "1h" / no time specified (default) | `1h` |
| "6小时" / "6h" | `6h` |
| "24小时" / "今日" / "daily" | `24h` |
| Option | Description |
|--------|-------------|
@@ -52,6 +83,8 @@ Use the `gmgn-cli` tool to query K-line data for a token, browse trending tokens
## Usage Examples
### Kline
```bash
# Last 1 hour of 1-minute candles
# macOS:
@@ -73,22 +106,210 @@ gmgn-cli market kline \
--to $(date +%s)
# Linux: use $(date -d '24 hours ago' +%s) instead of $(date -v-24H +%s)
# Raw output for further processing
gmgn-cli market kline --chain sol --address <addr> \
--resolution 5m --from <ts> --to <ts> --raw | jq '.[]'
```
### Trending — General
```bash
# Top 20 hot tokens on SOL in the last 1 hour, sorted by volume
gmgn-cli market trending --chain sol --interval 1h --order-by volume --limit 20
# Top 50 tokens on SOL, 5m window, sorted by volume
gmgn-cli market trending --chain sol --interval 5m --order-by volume --limit 50
# Hot tokens with social links only, verified and not honeypot, on BSC over 24h
gmgn-cli market trending \
--chain bsc --interval 24h \
--filter has_social --filter not_honeypot --filter verified
# Pump.fun platform tokens on SOL, last 6 hours
gmgn-cli market trending --chain sol --interval 6h --platform Pump.fun
# Raw output for further processing
gmgn-cli market kline --chain sol --address <addr> \
--resolution 5m --from <ts> --to <ts> --raw | jq '.[]'
```
### Trending — SOL by Launchpad Platform
Use `--platform` to filter trending results to tokens from specific launchpads only.
```bash
# SOL 1m hottest — Pump.fun + letsbonk only (most active launchpads), sorted by volume
gmgn-cli market trending \
--chain sol --interval 1m \
--platform Pump.fun --platform letsbonk \
--order-by volume --limit 50 --raw
# SOL 5m hottest — Pump.fun + letsbonk + Moonshot, sorted by volume
gmgn-cli market trending \
--chain sol --interval 5m \
--platform Pump.fun --platform letsbonk --platform moonshot_app \
--order-by volume --limit 50 --raw
# SOL 1h trending — Pump.fun only, with safety filters
gmgn-cli market trending \
--chain sol --interval 1h \
--platform Pump.fun \
--filter renounced --filter frozen --filter not_wash_trading \
--order-by volume --limit 20 --raw
# SOL 1h trending — all major launchpads combined
gmgn-cli market trending \
--chain sol --interval 1h \
--platform Pump.fun --platform letsbonk --platform moonshot_app \
--platform pump_mayhem --platform pump_mayhem_agent --platform bonkers \
--order-by volume --limit 50 --raw
```
### Trending — BSC by Launchpad Platform
```bash
# BSC 1m hottest — fourmeme (main BSC launchpad), sorted by volume
gmgn-cli market trending \
--chain bsc --interval 1m \
--platform fourmeme --platform four_xmode_agent \
--order-by volume --limit 50 --raw
# BSC 5m hottest — fourmeme family, sorted by volume
gmgn-cli market trending \
--chain bsc --interval 5m \
--platform fourmeme --platform fourmeme_agent --platform bn_fourmeme --platform four_xmode_agent \
--order-by volume --limit 50 --raw
# BSC 1h trending — fourmeme with safety filters
gmgn-cli market trending \
--chain bsc --interval 1h \
--platform fourmeme --platform fourmeme_agent --platform bn_fourmeme --platform four_xmode_agent \
--filter not_honeypot --filter verified \
--order-by volume --limit 20 --raw
```
### Trending — Base by Launchpad Platform
```bash
# Base 1m hottest — clanker + zora (main Base launchpads), sorted by volume
gmgn-cli market trending \
--chain base --interval 1m \
--platform clanker --platform zora --platform zora_creator \
--order-by volume --limit 50 --raw
# Base 5m hottest — clanker + zora + virtuals_v2 + flaunch, sorted by volume
gmgn-cli market trending \
--chain base --interval 5m \
--platform clanker --platform zora --platform zora_creator \
--platform virtuals_v2 --platform flaunch \
--order-by volume --limit 50 --raw
# Base 1h trending — all major launchpads with safety filters
gmgn-cli market trending \
--chain base --interval 1h \
--platform clanker --platform zora --platform zora_creator \
--platform virtuals_v2 --platform flaunch --platform baseapp \
--filter not_honeypot --filter verified \
--order-by volume --limit 20 --raw
```
## `market trending` Response Fields
The response is `data.rank` — an array of rank items. Each item represents one token.
**Basic Info**
| Field | Description |
|-------|-------------|
| `address` | Token contract address |
| `symbol` / `name` | Token ticker and full name |
| `logo` | Token logo image URL |
| `chain` | Chain identifier |
| `total_supply` | Total token supply |
| `creator` | Creator wallet address |
| `launchpad_platform` | Launch/pool platform (e.g. `Pump.fun`, `letsbonk`, `pool_meteora`, `fourmeme`) |
| `exchange` | Current DEX (e.g. `meteora_damm_v2`, `raydium`, `pump_amm`) |
| `open_timestamp` | Open market listing time (Unix seconds) |
| `creation_timestamp` | Token creation time (Unix seconds) |
| `rank` | Position in this trending list (lower = hotter) |
| `hot_level` | Trending intensity level (higher = hotter) |
**Price & Market**
| Field | Description |
|-------|-------------|
| `price` | Current price in USD |
| `market_cap` | Market cap in USD (directly available — no calculation needed) |
| `liquidity` | Current liquidity in USD |
| `volume` | Trading volume in USD for the queried interval |
| `history_highest_market_cap` | All-time highest market cap in USD |
| `initial_liquidity` | Initial liquidity at token launch |
| `price_change_percent` | Price change % for the queried interval |
| `price_change_percent1m` | Price change % in last 1 minute |
| `price_change_percent5m` | Price change % in last 5 minutes |
| `price_change_percent1h` | Price change % in last 1 hour |
**Trading Activity**
| Field | Description |
|-------|-------------|
| `swaps` | Total swap count in the queried interval |
| `buys` / `sells` | Buy / sell count in the interval |
| `holder_count` | Number of unique token holders |
| `gas_fee` | Average gas fee per transaction |
**Security & Risk**
| Field | Chains | Description |
|-------|--------|-------------|
| `renounced_mint` | SOL | Mint authority renounced (`1` = yes, `0` = no) |
| `renounced_freeze_account` | SOL | Freeze authority renounced (`1` = yes, `0` = no) |
| `is_honeypot` | BSC / Base | Honeypot flag (`1` = yes, `0` = no) |
| `is_open_source` | all | Contract verified (`1` = yes, `0` = no) |
| `is_renounced` | all | Ownership renounced (`1` = yes, `0` = no) |
| `buy_tax` / `sell_tax` | all | Tax rate — empty string means `0` (no tax) |
| `burn_status` | all | Liquidity burn status (e.g. `"none"`, `"burn"`) |
| `top_10_holder_rate` | all | Top 10 wallets concentration (01) |
| `rug_ratio` | all | Rug pull risk score (01) |
| `is_wash_trading` | all | Wash trading detected (`true` / `false`) |
| `rat_trader_amount_rate` | all | Ratio of insider/sneak trading volume |
| `bundler_rate` | all | Ratio of bundle bot trading volume |
| `entrapment_ratio` | all | Entrapment trading ratio |
| `sniper_count` | all | Number of sniper wallets at launch |
| `bot_degen_count` / `bot_degen_rate` | all | Bot degen wallet count / ratio |
| `dev_team_hold_rate` | all | Dev team holding ratio |
| `top70_sniper_hold_rate` | all | Top 70 sniper current holding ratio |
| `lock_percent` | all | Liquidity lock percentage |
**Dev Status**
| Field | Description |
|-------|-------------|
| `creator_token_status` | Dev holding status: `creator_hold` (still holding) / `creator_close` (sold/closed) |
| `creator_close` | Boolean shorthand for `creator_token_status == creator_close` |
| `dev_token_burn_ratio` | Ratio of dev's tokens that have been burned |
**Smart Money**
| Field | Description |
|-------|-------------|
| `smart_degen_count` | Number of smart money wallets holding the token |
| `renowned_count` | Number of renowned / KOL wallets holding the token |
| `bluechip_owner_percentage` | Ratio of holders that are bluechip wallets (01) |
**Social**
| Field | Description |
|-------|-------------|
| `twitter_username` | Twitter / X username (not a full URL — prepend `https://x.com/` to get the link) |
| `website` | Project website URL |
| `telegram` | Telegram URL |
| `cto_flag` | Community takeover flag (`1` = CTO has occurred) |
**Dexscreener Marketing**
| Field | Description |
|-------|-------------|
| `dexscr_ad` | Dexscreener ad placed (`1` = yes) |
| `dexscr_update_link` | Social links updated on Dexscreener (`1` = yes) |
| `dexscr_trending_bar` | Paid for Dexscreener trending bar (`1` = yes) |
| `dexscr_boost_fee` | Dexscreener boost amount paid (0 = none) |
---
## Workflow: Discover Trading Opportunities via Trending
### Step 1 — Fetch trending data
@@ -136,17 +357,192 @@ For each token, offer:
- **Deep dive**: `token info` + `token security` for full due diligence
- **Swap**: execute directly if the user is satisfied with the trending data alone
## Trenches Parameters
## `market trenches` Parameters
**Intent → `--type` mapping (always specify `--type` explicitly):**
| User intent | `--type` value |
|-------------|----------------|
| "new tokens", "just launched", "newly created", "latest tokens" | `new_creation` |
| "about to graduate", "near completion", "bonding curve almost full" | `near_completion` |
| "graduated tokens", "already on DEX", "open market tokens" | `completed` |
| No specific stage mentioned | omit `--type` (returns all three) |
| Parameter | Required | Description |
|-----------|----------|-------------|
| `--chain` | Yes | `sol` / `bsc` / `base` |
| `--type` | No | Categories to query, repeatable: `new_creation` / `near_completion` / `completed` (default: all three) |
| `--launchpad-platform` | No | Launchpad platform filter, repeatable (default: all platforms for the chain) |
| `--limit` | No | Max results per category, max 80 (default: 80) |
Response fields: `data.new_creation`, `data.pump`, `data.completed` — each is an array of `RankItem` (same fields as `market trending` rank items).
Response fields: `data.new_creation`, `data.pump`, `data.completed` — each is an array of `RankItem` (same fields as `market trending` rank items). **Important: `data.pump` in the response corresponds to `--type near_completion` in the request. The API always returns this category under the key `pump`, not `near_completion`.**
## `market trenches` Response Fields
**Basic Info**
| Field | Description |
|-------|-------------|
| `address` | Token contract address |
| `symbol` / `name` | Token symbol and name |
| `launchpad_platform` | Launch platform (e.g. `Pump.fun`, `letsbonk`) |
| `exchange` | Current exchange (e.g. `pump_amm`, `raydium`) |
| `usd_market_cap` | Market cap in USD |
| `liquidity` | Liquidity in USD |
| `total_supply` | Total token supply |
| `created_timestamp` | Creation time (Unix seconds) |
| `open_timestamp` | Open market listing time (Unix seconds, `completed` only) |
| `complete_timestamp` | Bonding curve completion time (Unix seconds) |
| `complete_cost_time` | Time from creation to completion in seconds |
**Trading Data**
| Field | Description |
|-------|-------------|
| `swaps_1m` / `swaps_1h` / `swaps_24h` | Swap count per time window |
| `volume_1h` / `volume_24h` | Trading volume in USD |
| `buys_24h` / `sells_24h` | Buy / sell count in 24h |
| `net_buy_24h` | Net buy volume in 24h |
| `holder_count` | Number of token holders |
**Security & Risk**
| Field | Chains | Description |
|-------|--------|-------------|
| `renounced_mint` | SOL | Whether mint authority is renounced (SOL-specific concept; always `false` on EVM chains) |
| `renounced_freeze_account` | SOL | Whether freeze authority is renounced (SOL-specific concept; always `false` on EVM chains) |
| `burn_status` | all | Liquidity burn status |
| `rug_ratio` | all | Rug pull risk ratio |
| `top_10_holder_rate` | all | Top 10 holders concentration ratio |
| `rat_trader_amount_rate` | all | Insider / sneak trading volume ratio |
| `bundler_trader_amount_rate` | all | Bundle trading volume ratio |
| `is_wash_trading` | all | Whether wash trading is detected |
| `sniper_count` | all | Number of sniper wallets |
| `suspected_insider_hold_rate` | all | Suspected insider holding ratio |
| `open_source` | all | Whether contract source code is verified (`"yes"` / `"no"` / `"unknown"`) |
| `owner_renounced` | all | Whether contract ownership is renounced (`"yes"` / `"no"` / `"unknown"`) |
| `is_honeypot` | BSC / Base | Whether token is a honeypot (`"yes"` / `"no"`); returns empty string on SOL (not applicable) |
| `buy_tax` | all | Buy tax ratio (e.g. `0.03` = 3%) |
| `dev_team_hold_rate` | all | Dev team holding ratio |
**Dev Holdings**
| Field | Description |
|-------|-------------|
| `creator_token_status` | Dev holding status (e.g. `creator_hold`, `creator_close`) |
| `creator_balance_rate` | Dev holding ratio as a proportion of total supply |
**Smart Money**
| Field | Description |
|-------|-------------|
| `smart_degen_count` | Number of smart money holders |
| `renowned_count` | Number of renowned wallet holders (KOL) |
**Social Media**
| Field | Description |
|-------|-------------|
| `twitter` | Twitter / X link |
| `telegram` | Telegram link |
| `website` | Website link |
| `instagram` | Instagram link |
| `tiktok` | TikTok link |
| `has_at_least_one_social` | Whether any social media link exists |
| `x_user_follower` | Twitter follower count |
| `cto_flag` | Whether community takeover (CTO) has occurred |
**Dexscreener Marketing**
| Field | Description |
|-------|-------------|
| `dexscr_ad` | Whether a Dexscreener ad has been placed |
| `dexscr_update_link` | Whether social links have been updated on Dexscreener |
| `dexscr_trending_bar` | Whether paid for Dexscreener trending bar placement |
| `dexscr_boost_fee` | Amount paid for Dexscreener boost (0 = none) |
### Solana Trenches Examples
```bash
# Trenches token lists on SOL
gmgn-cli market trenches --chain sol --raw
# All three categories at once
gmgn-cli market trenches --chain sol --raw \
--type new_creation --type near_completion --type completed \
--launchpad-platform Pump.fun --launchpad-platform pump_mayhem --launchpad-platform pump_mayhem_agent --launchpad-platform pump_agent --launchpad-platform letsbonk --launchpad-platform bonkers --launchpad-platform bags \
--limit 80
# New creation only
gmgn-cli market trenches --chain sol --raw \
--type new_creation \
--launchpad-platform Pump.fun --launchpad-platform pump_mayhem --launchpad-platform pump_mayhem_agent --launchpad-platform pump_agent --launchpad-platform letsbonk --launchpad-platform bonkers --launchpad-platform bags \
--limit 80
# Near completion only
gmgn-cli market trenches --chain sol --raw \
--type near_completion \
--launchpad-platform Pump.fun --launchpad-platform pump_mayhem --launchpad-platform pump_mayhem_agent --launchpad-platform pump_agent --launchpad-platform letsbonk --launchpad-platform bonkers --launchpad-platform bags \
--limit 80
# Completed (open market) only
gmgn-cli market trenches --chain sol --raw \
--type completed \
--launchpad-platform Pump.fun --launchpad-platform pump_mayhem --launchpad-platform pump_mayhem_agent --launchpad-platform pump_agent --launchpad-platform letsbonk --launchpad-platform bonkers --launchpad-platform bags \
--limit 80
```
### BSC Trenches Examples
```bash
# All three categories at once
gmgn-cli market trenches --chain bsc --raw \
--type new_creation --type near_completion --type completed \
--launchpad-platform fourmeme --launchpad-platform fourmeme_agent --launchpad-platform bn_fourmeme --launchpad-platform four_xmode_agent --launchpad-platform flap --launchpad-platform clanker --launchpad-platform lunafun \
--limit 80
# New creation only
gmgn-cli market trenches --chain bsc --raw \
--type new_creation \
--launchpad-platform fourmeme --launchpad-platform fourmeme_agent --launchpad-platform bn_fourmeme --launchpad-platform four_xmode_agent --launchpad-platform flap --launchpad-platform clanker --launchpad-platform lunafun \
--limit 80
# Near completion only
gmgn-cli market trenches --chain bsc --raw \
--type near_completion \
--launchpad-platform fourmeme --launchpad-platform fourmeme_agent --launchpad-platform bn_fourmeme --launchpad-platform four_xmode_agent --launchpad-platform flap --launchpad-platform clanker --launchpad-platform lunafun \
--limit 80
# Completed (open market) only
gmgn-cli market trenches --chain bsc --raw \
--type completed \
--launchpad-platform fourmeme --launchpad-platform fourmeme_agent --launchpad-platform bn_fourmeme --launchpad-platform four_xmode_agent --launchpad-platform flap --launchpad-platform clanker --launchpad-platform lunafun \
--limit 80
```
### Base Trenches Examples
```bash
# All three categories at once
gmgn-cli market trenches --chain base --raw \
--type new_creation --type near_completion --type completed \
--launchpad-platform clanker --launchpad-platform bankr --launchpad-platform flaunch --launchpad-platform zora --launchpad-platform zora_creator --launchpad-platform baseapp --launchpad-platform basememe --launchpad-platform virtuals_v2 --launchpad-platform klik \
--limit 80
# New creation only
gmgn-cli market trenches --chain base --raw \
--type new_creation \
--launchpad-platform clanker --launchpad-platform bankr --launchpad-platform flaunch --launchpad-platform zora --launchpad-platform zora_creator --launchpad-platform baseapp --launchpad-platform basememe --launchpad-platform virtuals_v2 --launchpad-platform klik \
--limit 80
# Near completion only
gmgn-cli market trenches --chain base --raw \
--type near_completion \
--launchpad-platform clanker --launchpad-platform bankr --launchpad-platform flaunch --launchpad-platform zora --launchpad-platform zora_creator --launchpad-platform baseapp --launchpad-platform basememe --launchpad-platform virtuals_v2 --launchpad-platform klik \
--limit 80
# Completed (open market) only
gmgn-cli market trenches --chain base --raw \
--type completed \
--launchpad-platform clanker --launchpad-platform bankr --launchpad-platform flaunch --launchpad-platform zora --launchpad-platform zora_creator --launchpad-platform baseapp --launchpad-platform basememe --launchpad-platform virtuals_v2 --launchpad-platform klik \
--limit 80
```
## Notes
+9 -49
View File
@@ -1,9 +1,11 @@
---
name: gmgn-portfolio
description: Query GMGN wallet portfolio — API Key wallet info, holdings, transaction activity, trading stats, token balance, follow-wallet trades, KOL trades, and Smart Money trades. Supports sol / bsc / base.
argument-hint: "<info|holdings|activity|stats|token-balance|follow-wallet|kol|smartmoney> [--chain <sol|bsc|base>] [--wallet <wallet_address>]"
description: Query GMGN wallet portfolio — API Key wallet info, holdings, transaction activity, trading stats, and token balance. Supports sol / bsc / base.
argument-hint: "<info|holdings|activity|stats|token-balance> [--chain <sol|bsc|base>] [--wallet <wallet_address>]"
---
**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.**
Use the `gmgn-cli` tool to query wallet portfolio data based on the user's request.
## Sub-commands
@@ -15,9 +17,6 @@ Use the `gmgn-cli` tool to query wallet portfolio data based on the user's reque
| `portfolio activity` | Transaction history |
| `portfolio stats` | Trading statistics (supports batch) |
| `portfolio token-balance` | Token balance for a specific token |
| `portfolio follow-wallet` | Follow-wallet trade records |
| `portfolio kol` | KOL trade records (SOL chain) |
| `portfolio smartmoney` | Smart Money trade records (SOL chain) |
## Supported Chains
@@ -27,7 +26,7 @@ Use the `gmgn-cli` tool to query wallet portfolio data based on the user's reque
- `.env` file with `GMGN_API_KEY` set
- Run from the directory where your `.env` file is located, or set `GMGN_HOST` in your environment
- `gmgn-cli` installed globally: `npm install -g gmgn-cli@1.1.0`
- `gmgn-cli` installed globally: `npm install -g gmgn-cli`
## Usage Examples
@@ -72,7 +71,7 @@ gmgn-cli portfolio token-balance \
--chain sol --wallet <wallet_address> --token <token_address>
```
## Holdings Options
## `portfolio holdings` Options
| Option | Description |
|--------|-------------|
@@ -87,7 +86,7 @@ gmgn-cli portfolio token-balance \
| `--hide-closed` | Hide closed positions |
| `--hide-open` | Hide open positions |
## Activity Options
## `portfolio activity` Options
| Option | Description |
|--------|-------------|
@@ -98,55 +97,16 @@ gmgn-cli portfolio token-balance \
The activity response includes a `next` field. Pass it to `--cursor` to fetch the next page.
## Stats Options
## `portfolio stats` Options
| Option | Description |
|--------|-------------|
| `--period <period>` | Stats period: `7d` / `30d` (default `7d`) |
## Follow-Wallet Options
| Option | Description |
|--------|-------------|
| `--chain` | Required. `sol` / `bsc` / `base` / `eth` |
| `--wallet <address>` | Filter by wallet address |
| `--base-token <address>` | Filter by base token address |
| `--page-token <cursor>` | Pagination cursor |
| `--limit <n>` | Page size (1200, default 100) |
| `--side <side>` | Trade direction filter |
| `--cost <cost>` | Cost filter |
| `--filter <tag...>` | Repeatable filter conditions |
| `--with-balance` | Include balance in response |
| `--with-security` | Include security info in response |
| `--min-amount-usd <n>` | Minimum trade amount (USD) |
| `--max-amount-usd <n>` | Maximum trade amount (USD) |
| `--is-gray` | Gray mode filter |
## KOL / Smart Money Options
| Option | Description |
|--------|-------------|
| `--limit <n>` | Page size (1200, default 100) |
Both `kol` and `smartmoney` return SOL chain data only — no `--chain` flag needed.
```bash
# Follow-wallet trades filtered by wallet
gmgn-cli portfolio follow-wallet --chain sol --wallet <wallet_address>
# Follow-wallet with balance info
gmgn-cli portfolio follow-wallet --chain sol --with-balance --limit 20
# KOL trade records
gmgn-cli portfolio kol --limit 10 --raw
# Smart Money trade records
gmgn-cli portfolio smartmoney --limit 10 --raw
```
## Notes
- All portfolio commands use normal auth (API Key only, no signature required)
- `portfolio stats` supports multiple `--wallet` flags for batch queries
- Use `--raw` to get single-line JSON for further processing
- **Input validation** — Wallet and token addresses are validated against the expected chain format at runtime (sol: base58 3244 chars; bsc/base/eth: `0x` + 40 hex digits). The CLI exits with an error on invalid input.
- For follow-wallet, KOL, and Smart Money trade records, use the `gmgn-track` skill (`track follow-wallet` / `track kol` / `track smartmoney`)
+9 -7
View File
@@ -4,6 +4,8 @@ description: "[FINANCIAL EXECUTION] Submit a real blockchain token swap or query
argument-hint: "[--chain <chain> --from <wallet> --input-token <addr> --output-token <addr> --amount <n>] | [order get --chain <chain> --order-id <id>]"
---
**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.**
Use the `gmgn-cli` tool to submit a token swap or query an existing order. **Requires private key** (`GMGN_PRIVATE_KEY` in `.env`).
## Financial Risk Notice
@@ -46,7 +48,7 @@ Both `GMGN_API_KEY` and `GMGN_PRIVATE_KEY` must be set in `.env`. The private ke
`gmgn-cli` must be installed globally before use (one-time setup):
```bash
npm install -g gmgn-cli@1.1.0
npm install -g gmgn-cli
```
### Credential Model
@@ -55,7 +57,7 @@ npm install -g gmgn-cli@1.1.0
- `GMGN_PRIVATE_KEY` is used exclusively for **local message signing** — the private key never leaves the machine. The CLI computes an Ed25519 or RSA-SHA256 signature in-process and transmits only the base64-encoded result in the `X-Signature` request header.
- `GMGN_API_KEY` is transmitted in the `X-APIKEY` request header to GMGN's servers over HTTPS.
## Swap Usage
## `swap` Usage
```bash
# Basic swap
@@ -102,7 +104,7 @@ gmgn-cli swap \
--percent 50
```
## Quote Usage
## `order quote` Usage
Get an estimated output amount before submitting a swap. Uses normal auth — no private key required.
@@ -116,7 +118,7 @@ gmgn-cli order quote \
--slippage 0.01
```
### Quote Response Fields
### `order quote` Response Fields
| Field | Type | Description |
|-------|------|-------------|
@@ -127,13 +129,13 @@ gmgn-cli order quote \
| `min_output_amount` | string | Minimum output after slippage |
| `slippage` | number | Actual slippage percentage |
## Order Query
## `order get` Usage
```bash
gmgn-cli order get --chain sol --order-id <order_id>
```
## Swap Parameters
## `swap` Parameters
| Parameter | Required | Description |
|-----------|----------|-------------|
@@ -154,7 +156,7 @@ gmgn-cli order get --chain sol --order-id <order_id>
| `--max-fee-per-gas <n>` | No | EIP-1559 max fee per gas (Base only) |
| `--max-priority-fee-per-gas <n>` | No | EIP-1559 max priority fee per gas (Base only) |
## Swap Response Fields
## `swap` Response Fields
| Field | Type | Description |
|-------|------|-------------|
+375 -33
View File
@@ -1,20 +1,22 @@
---
name: gmgn-token
description: Query GMGN token information — basic info, security, pool, top holders and top traders. Supports sol / bsc / base.
argument-hint: <sub-command> --chain <sol|bsc|base> --address <token_address>
argument-hint: "<sub-command> --chain <sol|bsc|base> --address <token_address>"
---
**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.**
Use the `gmgn-cli` tool to query token information based on the user's request.
## Sub-commands
| Sub-command | Description |
|-------------|-------------|
| `token info` | Basic info + realtime price |
| `token security` | Security metrics (holder concentration, contract risks) |
| `token pool` | Liquidity pool info |
| `token holders` | Top token holders list |
| `token traders` | Top token traders list |
| `token info` | Basic info + realtime price, liquidity, supply, holder count, social links (market cap = price × circulating_supply) |
| `token security` | Security metrics (honeypot, taxes, holder concentration, contract risks) |
| `token pool` | Liquidity pool info (DEX, reserves, liquidity depth) |
| `token holders` | Top token holders list with profit/loss breakdown |
| `token traders` | Top token traders list with profit/loss breakdown |
## Supported Chains
@@ -24,50 +26,390 @@ Use the `gmgn-cli` tool to query token information based on the user's request.
- `.env` file with `GMGN_API_KEY` set
- Run from the directory where your `.env` file is located, or set `GMGN_HOST` in your environment
- `gmgn-cli` installed globally: `npm install -g gmgn-cli@1.1.0`
- `gmgn-cli` installed globally: `npm install -g gmgn-cli`
## Info / Security / Pool Options
## Parameters — `token info` / `token security` / `token pool`
| Option | Description |
|--------|-------------|
| `--chain` | Required. `sol` / `bsc` / `base` |
| `--address` | Required. Token contract address |
| Parameter | Required | Description |
|-----------|----------|-------------|
| `--chain` | Yes | `sol` / `bsc` / `base` |
| `--address` | Yes | Token contract address |
| `--raw` | No | Output raw single-line JSON (for piping or further processing) |
## Holders / Traders Options
## Parameters — `token holders` / `token traders`
| Option | Description |
|--------|-------------|
| `--chain` | Required. `sol` / `bsc` / `base` |
| `--address` | Required. Token contract address |
| `--limit <n>` | Number of results (default `20`, max `100`) |
| `--order-by <field>` | Sort field: `amount_percentage` / `profit` / `unrealized_profit` / `buy_volume_cur` / `sell_volume_cur` (default `amount_percentage`) |
| `--direction <asc\|desc>` | Sort direction (default `desc`) |
| `--tag <tag>` | Wallet tag filter: `renowned` / `smart_degen` (default `renowned`) |
| Parameter | Required | Default | Description |
|-----------|----------|---------|-------------|
| `--chain` | Yes | — | `sol` / `bsc` / `base` |
| `--address` | Yes | — | Token contract address |
| `--limit` | No | `20` | Number of results, max `100` |
| `--order-by` | No | `amount_percentage` | Sort field — see table below |
| `--direction` | No | `desc` | Sort direction: `asc` / `desc` |
| `--tag` | No | `renowned` | Wallet filter: `renowned` (KOL wallets) / `smart_degen` (smart money) |
| `--raw` | No | — | Output raw single-line JSON |
### `--order-by` Values
| Value | Description |
|-------|-------------|
| `amount_percentage` | Sort by percentage of total supply held (default) |
| `profit` | Sort by realized profit in USD |
| `unrealized_profit` | Sort by unrealized profit in USD |
| `buy_volume_cur` | Sort by buy volume |
| `sell_volume_cur` | Sort by sell volume |
### `--tag` Values
| Value | Description |
|-------|-------------|
| `renowned` | KOL / well-known wallets (influencers, funds, public figures) |
| `smart_degen` | Smart money wallets (historically high-performing traders) |
## Response Field Reference
### `token info` — Key Fields
The response has four nested objects: `pool`, `link`, `stat`, `wallet_tags_stat`. Access fields with dot notation when parsing (e.g. `link.website`, `stat.top_10_holder_rate`).
**Top-level Fields**
| Field | Description |
|-------|-------------|
| `address` | Token contract address |
| `symbol` / `name` | Token ticker and full name |
| `decimals` | Token decimal places |
| `total_supply` | Total token supply (same as `circulating_supply` for most tokens) |
| `circulating_supply` | Circulating supply |
| `max_supply` | Maximum supply |
| `price` | Current price in USD |
| `liquidity` | Total liquidity in USD (from biggest pool) |
| `holder_count` | Number of unique token holders |
| `logo` | Token logo image URL |
| `creation_timestamp` | Token creation time (Unix seconds) |
| `open_timestamp` | Time the token opened for trading (Unix seconds) |
| `biggest_pool_address` | Address of the main liquidity pool |
| `og` | Whether the token is flagged as an OG token (`true` / `false`) |
**`pool` Object** — Main liquidity pool details
| Field | Description |
|-------|-------------|
| `pool.pool_address` | Pool contract address |
| `pool.quote_address` | Quote token address (e.g. USDC, SOL, WETH) |
| `pool.quote_symbol` | Quote token symbol (e.g. `USDC`, `SOL`) |
| `pool.exchange` | DEX name (e.g. `meteora_dlmm`, `raydium`, `pump_amm`, `uniswap_v3`) |
| `pool.liquidity` | Pool liquidity in USD |
| `pool.base_reserve` | Base token reserve amount |
| `pool.quote_reserve` | Quote token reserve amount |
| `pool.base_reserve_value` | Base reserve USD value |
| `pool.quote_reserve_value` | Quote reserve USD value |
| `pool.fee_ratio` | Pool trading fee ratio (e.g. `0.1` = 0.1%) |
| `pool.creation_timestamp` | Pool creation time (Unix seconds) |
**`link` Object** — Social and explorer links
| Field | Description |
|-------|-------------|
| `link.twitter_username` | Twitter / X username (not full URL) |
| `link.website` | Project website URL |
| `link.telegram` | Telegram URL |
| `link.discord` | Discord URL |
| `link.instagram` | Instagram URL |
| `link.tiktok` | TikTok URL |
| `link.youtube` | YouTube URL |
| `link.description` | Token description text |
| `link.gmgn` | GMGN token page URL |
| `link.geckoterminal` | GeckoTerminal page URL |
| `link.verify_status` | Social verification status (integer) |
**`stat` Object** — On-chain statistics
| Field | Description |
|-------|-------------|
| `stat.holder_count` | Number of holders (same as top-level `holder_count`) |
| `stat.bluechip_owner_count` | Number of bluechip wallet holders |
| `stat.bluechip_owner_percentage` | Ratio of holders that are bluechip wallets (01) |
| `stat.top_10_holder_rate` | Ratio of supply held by top 10 wallets (01) |
| `stat.dev_team_hold_rate` | Ratio held by dev team wallets |
| `stat.creator_hold_rate` | Ratio held by creator wallet |
| `stat.creator_token_balance` | Raw creator token balance |
| `stat.top_rat_trader_percentage` | Ratio of volume from rat/insider traders |
| `stat.top_bundler_trader_percentage` | Ratio of volume from bundler bots |
| `stat.top_entrapment_trader_percentage` | Ratio of volume from entrapment traders |
| `stat.bot_degen_count` | Number of bot degen wallets |
| `stat.bot_degen_rate` | Ratio of bot degen wallets |
| `stat.fresh_wallet_rate` | Ratio of fresh/new wallets among holders |
**`wallet_tags_stat` Object** — Wallet type breakdown
| Field | Description |
|-------|-------------|
| `wallet_tags_stat.smart_wallets` | Number of smart money wallets holding the token |
| `wallet_tags_stat.renowned_wallets` | Number of renowned / KOL wallets holding the token |
| `wallet_tags_stat.sniper_wallets` | Number of sniper wallets |
| `wallet_tags_stat.rat_trader_wallets` | Number of rat trader wallets |
| `wallet_tags_stat.bundler_wallets` | Number of bundler bot wallets |
| `wallet_tags_stat.whale_wallets` | Number of whale wallets |
| `wallet_tags_stat.fresh_wallets` | Number of fresh wallets |
| `wallet_tags_stat.top_wallets` | Number of top-ranked wallets |
---
### `token security` — Key Fields
**Contract Safety**
| Field | Chains | Description |
|-------|--------|-------------|
| `is_honeypot` | BSC / Base | Whether token is a honeypot (`"yes"` / `"no"`); empty string on SOL |
| `open_source` | all | Contract source code verified: `"yes"` / `"no"` / `"unknown"` |
| `owner_renounced` | all | Contract ownership renounced: `"yes"` / `"no"` / `"unknown"` |
| `renounced_mint` | SOL | Mint authority renounced (SOL-specific; always `false` on EVM) |
| `renounced_freeze_account` | SOL | Freeze authority renounced (SOL-specific; always `false` on EVM) |
| `buy_tax` / `sell_tax` | all | Tax ratio — e.g. `0.03` = 3%; `0` = no tax |
**Holder Concentration & Risk**
| Field | Description |
|-------|-------------|
| `top_10_holder_rate` | Ratio of supply held by top 10 wallets (01); higher = more concentrated |
| `dev_team_hold_rate` | Ratio held by dev team wallets |
| `creator_balance_rate` | Ratio held by the token creator wallet |
| `creator_token_status` | Dev holding status: `creator_hold` (still holding) / `creator_close` (sold/closed) |
| `suspected_insider_hold_rate` | Ratio held by suspected insider wallets |
**Trading Risk**
| Field | Description |
|-------|-------------|
| `rug_ratio` | Rug pull risk score (01); higher = more risky |
| `is_wash_trading` | Whether wash trading activity is detected (`true` / `false`) |
| `rat_trader_amount_rate` | Ratio of volume from sneak/insider trading |
| `bundler_trader_amount_rate` | Ratio of volume from bundle trading (bot-driven) |
| `sniper_count` | Number of sniper wallets that bought at launch |
| `burn_status` | Liquidity pool burn status (e.g. `"burn"` = burned, `""` = not burned) |
---
### `token pool` — Key Fields
| Field | Description |
|-------|-------------|
| `address` | Pool contract address |
| `base_address` | Base token address (the queried token) |
| `quote_address` | Quote token address (e.g. SOL, USDC, WETH) |
| `exchange` | DEX name (e.g. `raydium`, `pump_amm`, `uniswap_v3`, `pancakeswap`) |
| `liquidity` | Pool liquidity in USD |
| `base_reserve` | Base token reserve amount |
| `quote_reserve` | Quote token reserve amount |
| `price` | Current price in USD derived from pool reserves |
| `creation_timestamp` | Pool creation time (Unix seconds) |
---
### `token holders` / `token traders` — Item Fields
Each item in the result array:
| Field | Description |
|-------|-------------|
| `address` | Wallet address |
| `name` | Wallet label or alias (if known) |
| `tags` | Wallet tags (e.g. `["renowned"]`, `["smart_degen"]`) |
| `amount_percentage` | Percentage of total supply held (01); e.g. `0.05` = 5% |
| `amount` | Raw token amount held |
| `value` | USD value of holdings |
| `profit` | Realized profit in USD (positive = profit, negative = loss) |
| `unrealized_profit` | Unrealized profit in USD based on current price |
| `buy_volume_cur` | Total buy volume in USD for the current period |
| `sell_volume_cur` | Total sell volume in USD for the current period |
| `profit_change` | Profit change ratio |
---
## Usage Examples
### `token info` — Fetch Basic Info and Price
```bash
# Basic token info
gmgn-cli token info --chain sol --address <token_address>
# Get current price and market cap for a SOL token
gmgn-cli token info --chain sol --address EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
# Security metrics
gmgn-cli token security --chain sol --address <token_address>
# Get basic info for a BSC token
gmgn-cli token info --chain bsc --address 0x2170Ed0880ac9A755fd29B2688956BD959F933F8
# Liquidity pool
gmgn-cli token pool --chain sol --address <token_address>
# Get basic info for a Base token
gmgn-cli token info --chain base --address 0x4200000000000000000000000000000000000006
# Top holders
gmgn-cli token holders --chain sol --address <token_address> --limit 50
# Raw JSON output for downstream processing
gmgn-cli token info --chain sol --address EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v --raw
```
# Top traders
gmgn-cli token traders --chain sol --address <token_address> --limit 50
### `token security` — Check Safety Before Buying
# Raw JSON output (for piping)
```bash
# Check if a SOL token has renounced mint + freeze authority
gmgn-cli token security --chain sol --address EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
# Check if a BSC token is honeypot and whether contract is verified
gmgn-cli token security --chain bsc --address 0x2170Ed0880ac9A755fd29B2688956BD959F933F8
# Check a Base token for tax, rug ratio, and insider concentration
gmgn-cli token security --chain base --address 0x4200000000000000000000000000000000000006
# Raw output for parsing key fields (e.g. is_honeypot, buy_tax, rug_ratio)
gmgn-cli token security --chain bsc --address 0x2170Ed0880ac9A755fd29B2688956BD959F933F8 --raw
```
### `token pool` — Check Liquidity Depth
```bash
# Get pool info for a SOL token (liquidity, reserves, DEX)
gmgn-cli token pool --chain sol --address EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
# Get pool info for a BSC token
gmgn-cli token pool --chain bsc --address 0x2170Ed0880ac9A755fd29B2688956BD959F933F8
```
### `token holders` — Analyze Holder Distribution
```bash
# Top 20 holders by supply percentage (default)
gmgn-cli token holders --chain sol --address EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
# Top 50 holders sorted by percentage held
gmgn-cli token holders --chain sol --address EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v \
--limit 50 --order-by amount_percentage --direction desc
# Top 50 smart money holders (highest conviction wallets)
gmgn-cli token holders --chain sol --address EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v \
--limit 50 --tag smart_degen --order-by amount_percentage
# Top KOL wallets ranked by realized profit (who has already taken profit)
gmgn-cli token holders --chain sol --address EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v \
--tag renowned --order-by profit --direction desc --limit 20
# Smart money with most unrealized profit (who is sitting on biggest gains)
gmgn-cli token holders --chain sol --address EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v \
--tag smart_degen --order-by unrealized_profit --direction desc --limit 20
# Holders who have been buying the most recently (buy momentum signal)
gmgn-cli token holders --chain sol --address EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v \
--tag smart_degen --order-by buy_volume_cur --direction desc --limit 20
# Holders who are selling the most (exit signal / distribution warning)
gmgn-cli token holders --chain sol --address EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v \
--tag renowned --order-by sell_volume_cur --direction desc --limit 20
# BSC token holders — KOL wallets by profit
gmgn-cli token holders --chain bsc --address 0x2170Ed0880ac9A755fd29B2688956BD959F933F8 \
--tag renowned --order-by profit --direction desc --limit 50
# Raw output for downstream analysis
gmgn-cli token holders --chain sol --address EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v \
--limit 100 --raw
```
### `token traders` — Find Active Traders
```bash
# Top 20 active traders by supply held (default)
gmgn-cli token traders --chain sol --address EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
# Smart money traders ranked by realized profit
gmgn-cli token traders --chain sol --address EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v \
--tag smart_degen --order-by profit --direction desc --limit 50
# KOL traders ranked by unrealized profit (still holding with paper gains)
gmgn-cli token traders --chain sol --address EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v \
--tag renowned --order-by unrealized_profit --direction desc --limit 20
# Smart money traders with highest buy volume (aggressive accumulation)
gmgn-cli token traders --chain sol --address EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v \
--tag smart_degen --order-by buy_volume_cur --direction desc --limit 20
# Smart money traders ranked by sell volume (who is distributing)
gmgn-cli token traders --chain sol --address EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v \
--tag smart_degen --order-by sell_volume_cur --direction desc --limit 20
# Worst performing KOL traders (who lost the most — contrarian signal)
gmgn-cli token traders --chain sol --address EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v \
--tag renowned --order-by profit --direction asc --limit 20
# BSC token traders by profit
gmgn-cli token traders --chain bsc --address 0x2170Ed0880ac9A755fd29B2688956BD959F933F8 \
--tag smart_degen --order-by profit --direction desc --limit 50
```
---
## Workflow: Full Token Due Diligence
Use this workflow before deciding to buy a token.
### Step 1 — Get basic info
```bash
gmgn-cli token info --chain sol --address <token_address> --raw
```
Check: `price`, `liquidity`, `holder_count`, `wallet_tags_stat.smart_wallets`, `wallet_tags_stat.renowned_wallets`, `link.website` / `link.twitter_username` / `link.telegram`.
**Red flags**: all `link.*` social fields empty, very low liquidity (<$10k), zero `wallet_tags_stat.smart_wallets` and `renowned_wallets`.
### Step 2 — Check security
```bash
gmgn-cli token security --chain sol --address <token_address> --raw
```
Check these fields and their safe thresholds:
| Field | Safe | Warning | Danger |
|-------|------|---------|--------|
| `is_honeypot` | `"no"` | — | `"yes"` → Do not buy |
| `open_source` | `"yes"` | `"unknown"` | `"no"` |
| `owner_renounced` | `"yes"` | `"unknown"` | `"no"` |
| `renounced_mint` (SOL) | `true` | — | `false` → mint risk |
| `renounced_freeze_account` (SOL) | `true` | — | `false` → freeze risk |
| `buy_tax` / `sell_tax` | `0` | `0.010.05` | `>0.10` → high tax |
| `top_10_holder_rate` | `<0.20` | `0.200.40` | `>0.50` → whale risk |
| `rug_ratio` | `<0.10` | `0.100.30` | `>0.30` → high rug risk |
| `creator_token_status` | `creator_close` | — | `creator_hold` → dev not sold |
| `sniper_count` | `<5` | `520` | `>20` → heavily sniped |
### Step 3 — Check liquidity pool
```bash
gmgn-cli token pool --chain sol --address <token_address> --raw
```
Check: liquidity amount, which DEX (`exchange`), pool age (`creation_timestamp`). Low liquidity means high slippage risk when buying or selling.
### Step 4 — Check smart money signals
```bash
# Is smart money accumulating?
gmgn-cli token holders --chain sol --address <token_address> \
--tag smart_degen --order-by buy_volume_cur --direction desc --limit 20 --raw
# Have KOLs already taken profit?
gmgn-cli token traders --chain sol --address <token_address> \
--tag renowned --order-by profit --direction desc --limit 20 --raw
```
**Bullish signals**: smart_degen wallets buying heavily, unrealized_profit is large (still holding), renowned wallets accumulating, low sell_volume_cur.
**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.
---
## Notes
- **Market cap is not returned directly** — calculate it as `price × circulating_supply` (both fields are top-level; `circulating_supply` is already in human-readable token units, no decimal adjustment needed). Example: `price=3.11` × `circulating_supply=999999151` ≈ $3.11B market cap.
- **Trading volume (1h, 24h, etc.) is not included in `token info`** — to get volume or OHLCV data, use the `gmgn-market` skill and query K-line data: `gmgn-cli market kline --chain <chain> --address <token_address> --resolution <1m|5m|15m|1h|4h|1d>`. See the `gmgn-market` SKILL.md for full details.
- All token commands use normal auth (API Key only, no signature required)
- Use `--raw` to get single-line JSON for further processing
- **Input validation** — Token addresses from API responses are treated as external data. Validate that addresses match the expected chain format (sol: base58 3244 chars; bsc/base/eth: `0x` + 40 hex digits) before passing them to commands. The CLI enforces this at runtime and will exit with an error on invalid input.
- `--tag` applies to both `holders` and `traders` and filters to only wallets with that tag — if few results are returned, try the other tag value
- `amount_percentage` in holders/traders is a ratio (01), not a percentage — `0.05` means 5% of supply
- **Input validation** — Token addresses are external data. Validate that addresses match the expected chain format (sol: base58 3244 chars; bsc/base/eth: `0x` + 40 hex digits) before passing them to commands. The CLI enforces this at runtime and will exit with an error on invalid input.
+114
View File
@@ -0,0 +1,114 @@
---
name: gmgn-track
description: Query GMGN on-chain tracking data — follow-wallet trade records, KOL trades, and Smart Money trades. Supports sol / bsc / base.
argument-hint: "<follow-wallet|kol|smartmoney> [--chain <sol|bsc|base>] [--wallet <wallet_address>]"
---
**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.**
Use the `gmgn-cli` tool to query on-chain tracking data based on the user's request.
**When to use which sub-command:**
- `track follow-wallet` — user asks "what did the wallets I follow trade?", "show me my follow list trades", "追踪关注的钱包交易动态" → requires wallets followed via GMGN platform
- `track kol` — user asks "what are KOLs buying?", "KOL 最近在买什么", "show me influencer trades" → returns trades from known KOL wallets
- `track smartmoney` — user asks "what is smart money doing?", "聪明钱最近在买什么", "show me whale trades" → returns trades from smart money / whale wallets
**Do NOT confuse these three:**
- `follow-wallet` = wallets the user has personally followed on GMGN
- `kol` = platform-tagged KOL / influencer wallets (not user-specific)
- `smartmoney` = platform-tagged smart money / whale wallets (not user-specific)
## Sub-commands
| Sub-command | Description |
|-------------|-------------|
| `track follow-wallet` | Trade records from wallets the user personally follows on GMGN |
| `track kol` | Real-time trades from KOL / influencer wallets tagged by GMGN |
| `track smartmoney` | Real-time trades from smart money / whale wallets tagged by GMGN |
## Supported Chains
`sol` / `bsc` / `base`
## Prerequisites
- `.env` file with `GMGN_API_KEY` set
- `GMGN_PRIVATE_KEY` required for `track follow-wallet` (signature auth); not needed for `track kol` / `track smartmoney`
- Run from the directory where your `.env` file is located, or set `GMGN_HOST` in your environment
- `gmgn-cli` installed globally: `npm install -g gmgn-cli`
## Usage Examples
```bash
# Follow-wallet trades (all wallets you follow)
gmgn-cli track follow-wallet --chain sol
# Follow-wallet trades filtered by wallet
gmgn-cli track follow-wallet --chain sol --wallet <wallet_address>
# Follow-wallet filtered by trade direction
gmgn-cli track follow-wallet --chain sol --side buy
# Follow-wallet filtered by USD amount range
gmgn-cli track follow-wallet --chain sol --min-amount-usd 100 --max-amount-usd 10000
# KOL trade records (SOL, default)
gmgn-cli track kol --limit 10 --raw
# KOL trade records on SOL, buy only
gmgn-cli track kol --chain sol --side buy --limit 10 --raw
# Smart Money trade records (SOL, default)
gmgn-cli track smartmoney --limit 10 --raw
# Smart Money trade records, sell only
gmgn-cli track smartmoney --chain sol --side sell --limit 10 --raw
```
## `track follow-wallet` Options
| Option | Description |
|--------|-------------|
| `--chain` | Required. `sol` / `bsc` / `base` |
| `--wallet <address>` | Filter by wallet address |
| `--limit <n>` | Page size (1100, default 10) |
| `--side <side>` | Trade direction: `buy` / `sell` |
| `--filter <tag...>` | Repeatable filter conditions |
| `--min-amount-usd <n>` | Minimum trade amount (USD) |
| `--max-amount-usd <n>` | Maximum trade amount (USD) |
## `track kol` / `track smartmoney` Options
| Option | Description |
|--------|-------------|
| `--chain <chain>` | Chain: `sol` / `bsc` / `base` (default `sol`) |
| `--limit <n>` | Page size (1200, default 100) |
| `--side <side>` | Filter by trade direction: `buy` / `sell` (client-side filter — applied locally after fetching results) |
## `track kol` / `track smartmoney` Response Fields
Each item in `list` contains:
| Field | Description |
|-------|-------------|
| `transaction_hash` | On-chain transaction hash |
| `maker` | Wallet address of the trader (KOL / Smart Money) |
| `side` | Trade direction: `buy` or `sell` |
| `base_address` | Token contract address |
| `base_token.symbol` | Token ticker symbol |
| `base_token.launchpad` | Launchpad platform (e.g. `pump`) |
| `amount_usd` | Trade value in USD |
| `token_amount` | Token quantity traded |
| `price_usd` | Token price in USD at time of trade |
| `buy_cost_usd` | Original buy cost in USD (0 if this record is the buy) |
| `is_open_or_close` | `0` = position opened / added, `1` = position closed / reduced |
| `timestamp` | Unix timestamp of the trade |
| `maker_info.twitter_username` | KOL's Twitter username |
| `maker_info.tags` | Wallet tags (e.g. `kol`, `smart_degen`, `photon`) |
## Notes
- `track kol` / `track smartmoney` use normal auth (API Key only, no signature required)
- `track follow-wallet` requires `GMGN_PRIVATE_KEY` for signature auth — and wallets must be followed via the GMGN platform first
- Use `--raw` to get single-line JSON for further processing
- `track kol` / `track smartmoney` `--side` is a **client-side filter** — the CLI fetches all results then filters locally; it is NOT sent to the API
+17 -13
View File
@@ -126,8 +126,8 @@ export class OpenApiClient {
return this.normalRequest("GET", "/v1/user/wallet_token_balance", { chain, wallet_address: walletAddress, token_address: tokenAddress });
}
async getTrenches(chain: string): Promise<unknown> {
const body = buildTrenchesBody(chain);
async getTrenches(chain: string, types?: string[], platforms?: string[], limit?: number): Promise<unknown> {
const body = buildTrenchesBody(chain, types, platforms, limit);
return this.normalRequest("POST", "/v1/trenches", { chain }, body);
}
@@ -148,17 +148,19 @@ export class OpenApiClient {
}
async getFollowWallet(chain: string, extra: Record<string, string | number | string[]> = {}): Promise<unknown> {
return this.normalRequest("GET", "/v1/trade/follow_wallet", { chain, ...extra });
return this.criticalRequest("GET", "/v1/trade/follow_wallet", { chain, ...extra }, null);
}
async getKol(limit?: number): Promise<unknown> {
async getKol(chain?: string, limit?: number): Promise<unknown> {
const query: Record<string, string | number> = {};
if (chain) query["chain"] = chain;
if (limit != null) query["limit"] = limit;
return this.normalRequest("GET", "/v1/user/kol", query);
}
async getSmartMoney(limit?: number): Promise<unknown> {
async getSmartMoney(chain?: string, limit?: number): Promise<unknown> {
const query: Record<string, string | number> = {};
if (chain) query["chain"] = chain;
if (limit != null) query["limit"] = limit;
return this.normalRequest("GET", "/v1/user/smartmoney", query);
}
@@ -330,21 +332,23 @@ const TRENCHES_QUOTE_ADDRESS_TYPES: Record<string, number[]> = {
base: [11, 3, 12, 13, 0],
};
function buildTrenchesBody(chain: string): Record<string, unknown> {
const launchpad_platform = TRENCHES_PLATFORMS[chain] ?? [];
function buildTrenchesBody(chain: string, types?: string[], platforms?: string[], limit?: number): Record<string, unknown> {
const selectedTypes = types?.length ? types : ["new_creation", "near_completion", "completed"];
const launchpad_platform = platforms?.length ? platforms : (TRENCHES_PLATFORMS[chain] ?? []);
const quote_address_type = TRENCHES_QUOTE_ADDRESS_TYPES[chain] ?? [];
const actualLimit = limit ?? 80;
const section = {
filters: ["offchain", "onchain"],
launchpad_platform,
quote_address_type,
launchpad_platform_v2: true,
limit: actualLimit,
};
return {
new_creation: { ...section, limit: 60 },
near_completion: { ...section, limit: 120 },
completed: { ...section, limit: 60 },
version: "v2",
};
const body: Record<string, unknown> = { version: "v2" };
for (const type of selectedTypes) {
body[type] = { ...section };
}
return body;
}
function buildUrl(base: string, query: Record<string, string | number | string[]>): string {
+4 -1
View File
@@ -61,11 +61,14 @@ export function registerMarketCommands(program: Command): void {
.command("trenches")
.description("Get Trenches token data (new creation, near completion, completed)")
.requiredOption("--chain <chain>", "Chain: sol / bsc / base")
.option("--type <type...>", "Categories to query, repeatable: new_creation / near_completion / completed (default: all three)")
.option("--launchpad-platform <platform...>", "Launchpad platform filter, repeatable (default: all platforms for the chain)")
.option("--limit <n>", "Max results per category, max 80 (default: 80)", parseInt)
.option("--raw", "Output raw JSON")
.action(async (opts) => {
validateChain(opts.chain);
const client = new OpenApiClient(getConfig());
const data = await client.getTrenches(opts.chain).catch(exitOnError);
const data = await client.getTrenches(opts.chain, opts.type, opts.launchpadPlatform, opts.limit).catch(exitOnError);
printResult(data, opts.raw);
});
}
-58
View File
@@ -113,63 +113,5 @@ export function registerPortfolioCommands(program: Command): void {
printResult(data, opts.raw);
});
portfolio
.command("follow-wallet")
.description("Get follow-wallet trade records")
.requiredOption("--chain <chain>", "Chain: sol / bsc / base / eth")
.option("--wallet <address>", "Filter by wallet address")
.option("--base-token <address>", "Filter by base token address")
.option("--page-token <cursor>", "Pagination cursor")
.option("--limit <n>", "Page size (1200, default 100)", parseInt)
.option("--side <side>", "Trade direction filter")
.option("--cost <cost>", "Cost filter")
.option("--filter <tag...>", "Filter conditions, repeatable")
.option("--with-balance", "Include balance in response")
.option("--with-security", "Include security info in response")
.option("--min-amount-usd <n>", "Minimum trade amount (USD)", parseFloat)
.option("--max-amount-usd <n>", "Maximum trade amount (USD)", parseFloat)
.option("--is-gray", "Gray mode filter")
.option("--raw", "Output raw JSON")
.action(async (opts) => {
validateChain(opts.chain);
const extra: Record<string, string | number | string[]> = {};
if (opts.wallet) extra["wallet_address"] = opts.wallet;
if (opts.baseToken) extra["base_token"] = opts.baseToken;
if (opts.pageToken) extra["page_token"] = opts.pageToken;
if (opts.limit != null) extra["limit"] = opts.limit;
if (opts.side) extra["side"] = opts.side;
if (opts.cost) extra["cost"] = opts.cost;
if (opts.filter?.length) extra["filters"] = opts.filter;
if (opts.withBalance) extra["with_balance"] = "true";
if (opts.withSecurity) extra["with_security"] = "true";
if (opts.minAmountUsd != null) extra["min_amount_usd"] = opts.minAmountUsd;
if (opts.maxAmountUsd != null) extra["max_amount_usd"] = opts.maxAmountUsd;
if (opts.isGray) extra["is_gray"] = "true";
const client = new OpenApiClient(getConfig());
const data = await client.getFollowWallet(opts.chain, extra).catch(exitOnError);
printResult(data, opts.raw);
});
portfolio
.command("kol")
.description("Get KOL trade records (SOL chain)")
.option("--limit <n>", "Page size (1200, default 100)", parseInt)
.option("--raw", "Output raw JSON")
.action(async (opts) => {
const client = new OpenApiClient(getConfig());
const data = await client.getKol(opts.limit).catch(exitOnError);
printResult(data, opts.raw);
});
portfolio
.command("smartmoney")
.description("Get Smart Money trade records (SOL chain)")
.option("--limit <n>", "Page size (1200, default 100)", parseInt)
.option("--raw", "Output raw JSON")
.action(async (opts) => {
const client = new OpenApiClient(getConfig());
const data = await client.getSmartMoney(opts.limit).catch(exitOnError);
printResult(data, opts.raw);
});
}
+68
View File
@@ -0,0 +1,68 @@
import { Command } from "commander";
import { OpenApiClient } from "../client/OpenApiClient.js";
import { getConfig } from "../config.js";
import { exitOnError, printResult } from "../output.js";
import { validateChain } from "../validate.js";
export function registerTrackCommands(program: Command): void {
const track = program.command("track").description("On-chain tracking commands: follow-wallet trades, KOL trades, Smart Money trades");
track
.command("follow-wallet")
.description("Get follow-wallet trade records")
.requiredOption("--chain <chain>", "Chain: sol / bsc / base")
.option("--wallet <address>", "Filter by wallet address")
.option("--limit <n>", "Page size (1100, default 10)", parseInt)
.option("--side <side>", "Trade direction filter: buy / sell")
.option("--filter <tag...>", "Filter conditions, repeatable")
.option("--min-amount-usd <n>", "Minimum trade amount (USD)", parseFloat)
.option("--max-amount-usd <n>", "Maximum trade amount (USD)", parseFloat)
.option("--raw", "Output raw JSON")
.action(async (opts) => {
validateChain(opts.chain);
const extra: Record<string, string | number | string[]> = {};
if (opts.wallet) extra["wallet_address"] = opts.wallet;
if (opts.limit != null) extra["limit"] = opts.limit;
if (opts.side) extra["side"] = opts.side;
if (opts.filter?.length) extra["filters"] = opts.filter;
if (opts.minAmountUsd != null) extra["min_amount_usd"] = opts.minAmountUsd;
if (opts.maxAmountUsd != null) extra["max_amount_usd"] = opts.maxAmountUsd;
const client = new OpenApiClient(getConfig(true));
const data = await client.getFollowWallet(opts.chain, extra).catch(exitOnError);
printResult(data, opts.raw);
});
track
.command("kol")
.description("Get KOL trade records")
.option("--chain <chain>", "Chain: sol / bsc / base")
.option("--limit <n>", "Page size (1200, default 100)", parseInt)
.option("--side <side>", "Filter by trade direction: buy / sell (client-side filter)")
.option("--raw", "Output raw JSON")
.action(async (opts) => {
if (opts.chain) validateChain(opts.chain);
const client = new OpenApiClient(getConfig());
const data = await client.getKol(opts.chain, opts.limit).catch(exitOnError) as { list?: { side: string }[] };
if (opts.side && data?.list) {
data.list = data.list.filter((item) => item.side === opts.side);
}
printResult(data, opts.raw);
});
track
.command("smartmoney")
.description("Get Smart Money trade records")
.option("--chain <chain>", "Chain: sol / bsc / base")
.option("--limit <n>", "Page size (1200, default 100)", parseInt)
.option("--side <side>", "Filter by trade direction: buy / sell (client-side filter)")
.option("--raw", "Output raw JSON")
.action(async (opts) => {
if (opts.chain) validateChain(opts.chain);
const client = new OpenApiClient(getConfig());
const data = await client.getSmartMoney(opts.chain, opts.limit).catch(exitOnError) as { list?: { side: string }[] };
if (opts.side && data?.list) {
data.list = data.list.filter((item) => item.side === opts.side);
}
printResult(data, opts.raw);
});
}
+2
View File
@@ -8,6 +8,7 @@ import { Command } from "commander";
import { registerTokenCommands } from "./commands/token.js";
import { registerMarketCommands } from "./commands/market.js";
import { registerPortfolioCommands } from "./commands/portfolio.js";
import { registerTrackCommands } from "./commands/track.js";
import { registerSwapCommands } from "./commands/swap.js";
const proxy = process.env.HTTPS_PROXY ?? process.env.https_proxy
@@ -50,6 +51,7 @@ program
registerTokenCommands(program);
registerMarketCommands(program);
registerPortfolioCommands(program);
registerTrackCommands(program);
registerSwapCommands(program);
program.parseAsync().catch((err) => {