mirror of
https://github.com/GMGNAI/gmgn-skills.git
synced 2026-08-22 12:38:08 +00:00
Compare commits
38
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
56a3a60352 | ||
|
|
211f7d6fd0 | ||
|
|
5e1560188e | ||
|
|
08f7b66251 | ||
|
|
48c596ab10 | ||
|
|
ec099ea399 | ||
|
|
1012cfffb8 | ||
|
|
f6f1d56b82 | ||
|
|
b83422769f | ||
|
|
8922811e04 | ||
|
|
cc1cb48db9 | ||
|
|
981600f170 | ||
|
|
1f49d61363 | ||
|
|
3046c6d6cd | ||
|
|
ee4838d565 | ||
|
|
f19a1919da | ||
|
|
4cfe0e0fb5 | ||
|
|
5755206b58 | ||
|
|
6ab9cb108b | ||
|
|
51d2214253 | ||
|
|
8d3541c2a3 | ||
|
|
39d80429f6 | ||
|
|
fd226c654b | ||
|
|
a08fc7b580 | ||
|
|
f49c89e609 | ||
|
|
ad4eab3852 | ||
|
|
6fd302af60 | ||
|
|
cdcf4e11d3 | ||
|
|
319c4bbf33 | ||
|
|
2b61eb807a | ||
|
|
46c56b7e5d | ||
|
|
b18738177c | ||
|
|
cfb4270816 | ||
|
|
932bf8c82c | ||
|
|
4143e07266 | ||
|
|
4f96fedbb1 | ||
|
|
eeb4a77cf7 | ||
|
|
f7c051e2d1 |
@@ -20,7 +20,7 @@ This includes: trending tokens, token info, security checks, K-line / price hist
|
|||||||
|
|
||||||
## Project Overview
|
## 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.
|
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 / eth.
|
||||||
|
|
||||||
## Available Skills
|
## Available Skills
|
||||||
|
|
||||||
@@ -93,8 +93,8 @@ EOF
|
|||||||
|
|
||||||
| Mode | Commands | Requirements |
|
| Mode | Commands | Requirements |
|
||||||
|------|----------|--------------|
|
|------|----------|--------------|
|
||||||
| Normal | token / market / portfolio | `GMGN_API_KEY` only, no signature |
|
| Normal | token / market / portfolio / track kol / track smartmoney | `GMGN_API_KEY` only, no signature |
|
||||||
| Critical | swap / order | `GMGN_API_KEY` + `GMGN_PRIVATE_KEY` — CLI handles signing automatically |
|
| Critical | swap / order / track follow-wallet | `GMGN_API_KEY` + `GMGN_PRIVATE_KEY` — CLI handles signing automatically |
|
||||||
|
|
||||||
## SKILL.md Authoring Rules
|
## SKILL.md Authoring Rules
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ With GMGN Agent Skills, you can use AI agents to query real-time trending token
|
|||||||
|
|
||||||
### 1. Real-time on-chain data — faster
|
### 1. Real-time on-chain data — faster
|
||||||
|
|
||||||
Data across SOL / BSC / Base is live on every query. Supports multi-parameter customization, no snapshot cache — built for AI agent real-time decision-making (including but not limited to):
|
Data across SOL / BSC / Base / ETH is live on every query. Supports multi-parameter customization, no snapshot cache — built for AI agent real-time decision-making (including but not limited to):
|
||||||
|
|
||||||
| Data | Granularity |
|
| Data | Granularity |
|
||||||
|------|-------------|
|
|------|-------------|
|
||||||
@@ -471,6 +471,13 @@ gmgn-cli market trenches \
|
|||||||
gmgn-cli market trenches \
|
gmgn-cli market trenches \
|
||||||
--chain sol --type new_creation \
|
--chain sol --type new_creation \
|
||||||
--filter-preset safe --min-smart-degen-count 1 --sort-by smart_degen_count
|
--filter-preset safe --min-smart-degen-count 1 --sort-by smart_degen_count
|
||||||
|
|
||||||
|
# Token signals — smart money buys on SOL (single group)
|
||||||
|
gmgn-cli market signal --chain sol --signal-type 12 --raw
|
||||||
|
|
||||||
|
# Token signals — multi-group: smart money OR large buys in parallel
|
||||||
|
gmgn-cli market signal --chain sol \
|
||||||
|
--groups '[{"signal_type":[12]},{"signal_type":[14,16]}]' --raw
|
||||||
```
|
```
|
||||||
|
|
||||||
### Portfolio
|
### Portfolio
|
||||||
@@ -572,7 +579,7 @@ gmgn-cli multi-swap \
|
|||||||
--slippage 0.01
|
--slippage 0.01
|
||||||
```
|
```
|
||||||
|
|
||||||
> `order quote` uses critical auth on `sol` / `bsc` / `base` and requires `GMGN_PRIVATE_KEY`.
|
> `order quote` uses critical auth on `sol` / `bsc` / `base` / `eth` and requires `GMGN_PRIVATE_KEY`.
|
||||||
|
|
||||||
### Swap with Take-Profit / Stop-Loss Orders (requires private key)
|
### Swap with Take-Profit / Stop-Loss Orders (requires private key)
|
||||||
|
|
||||||
@@ -665,8 +672,8 @@ gmgn-cli cooking \
|
|||||||
|
|
||||||
| Commands | Chains | Chain Currencies |
|
| Commands | Chains | Chain Currencies |
|
||||||
|----------|--------|-----------------|
|
|----------|--------|-----------------|
|
||||||
| token / market / portfolio / track | `sol` / `bsc` / `base` | — |
|
| token / market / portfolio / track | `sol` / `bsc` / `base` / `eth` | — |
|
||||||
| swap / order | `sol` / `bsc` / `base` | sol: SOL, USDC · bsc: BNB, USDC · base: ETH, USDC |
|
| swap / order | `sol` / `bsc` / `base` / `eth` | sol: SOL, USDC · bsc: BNB, USDC · base: ETH, USDC · eth: ETH |
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
+4
-4
@@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
### 1. 链上实时数据查询快
|
### 1. 链上实时数据查询快
|
||||||
|
|
||||||
SOL / BSC / Base 多链数据每次查询均为实时,支持多参数个性化调用,无快照缓存,方便AI Agent实时决策(包括不限于下表)。
|
SOL / BSC / Base / ETH 多链数据每次查询均为实时,支持多参数个性化调用,无快照缓存,方便AI Agent实时决策(包括不限于下表)。
|
||||||
|
|
||||||
| 数据类型 | 粒度 |
|
| 数据类型 | 粒度 |
|
||||||
|---------|------|
|
|---------|------|
|
||||||
@@ -603,7 +603,7 @@ gmgn-cli multi-swap \
|
|||||||
--slippage 0.01
|
--slippage 0.01
|
||||||
```
|
```
|
||||||
|
|
||||||
> `order quote` 在 `sol` / `bsc` / `base` 上都走关键鉴权,必须配置 `GMGN_PRIVATE_KEY`。
|
> `order quote` 在 `sol` / `bsc` / `base` / `eth` 上都走关键鉴权,必须配置 `GMGN_PRIVATE_KEY`。
|
||||||
|
|
||||||
### 带止盈止损的 Swap(需要私钥)
|
### 带止盈止损的 Swap(需要私钥)
|
||||||
|
|
||||||
@@ -696,8 +696,8 @@ gmgn-cli cooking \
|
|||||||
|
|
||||||
| 接口类型 | 支持的链 | 链原生货币 |
|
| 接口类型 | 支持的链 | 链原生货币 |
|
||||||
|----------|----------|-----------|
|
|----------|----------|-----------|
|
||||||
| token / market / portfolio / track | `sol` / `bsc` / `base` | — |
|
| token / market / portfolio / track | `sol` / `bsc` / `base` / `eth` | — |
|
||||||
| swap / order | `sol` / `bsc` / `base` | sol: SOL、USDC · bsc: BNB、USDC · base: ETH、USDC |
|
| swap / order | `sol` / `bsc` / `base` / `eth` | sol: SOL、USDC · bsc: BNB、USDC · base: ETH、USDC · eth: ETH |
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
@@ -298,6 +298,57 @@ npx gmgn-cli market trenches --chain <chain> [--type <type...>] [--launchpad-pla
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
## market signal
|
||||||
|
|
||||||
|
Query token signals — price spikes, smart money buys, large buys, Dex ads, CTO events, and more. Returns a list of `TokenSignalItem` sorted by `trigger_at` descending (most recent first). **Maximum 50 results per group.**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Single group (individual flags):
|
||||||
|
gmgn-cli market signal --chain sol [--signal-type <n>...] [--mc-min <usd>] [--mc-max <usd>] [--raw]
|
||||||
|
|
||||||
|
# Multi-group override (JSON array):
|
||||||
|
gmgn-cli market signal --chain sol --groups '<json_array>' [--raw]
|
||||||
|
```
|
||||||
|
|
||||||
|
| Option | Required | Description |
|
||||||
|
|--------|----------|-------------|
|
||||||
|
| `--chain` | Yes | `sol` / `bsc` |
|
||||||
|
| `--signal-type` | No | Signal type(s), repeatable (1–18, default: all). See Signal Types below. |
|
||||||
|
| `--mc-min` | No | Min market cap at trigger time (USD) |
|
||||||
|
| `--mc-max` | No | Max market cap at trigger time (USD) |
|
||||||
|
| `--trigger-mc-min` | No | Min market cap at signal trigger moment (USD) |
|
||||||
|
| `--trigger-mc-max` | No | Max market cap at signal trigger moment (USD) |
|
||||||
|
| `--total-fee-min` | No | Min total fees paid (USD) |
|
||||||
|
| `--total-fee-max` | No | Max total fees paid (USD) |
|
||||||
|
| `--min-create-or-open-ts` | No | Min token creation or open timestamp (Unix seconds string) |
|
||||||
|
| `--max-create-or-open-ts` | No | Max token creation or open timestamp (Unix seconds string) |
|
||||||
|
| `--groups` | No | Multi-group JSON array — overrides all individual flags when provided |
|
||||||
|
|
||||||
|
**Signal Types:**
|
||||||
|
|
||||||
|
| Value | Name | Description |
|
||||||
|
|-------|------|-------------|
|
||||||
|
| 1 | SignalType1 | General signal (K-line price spike) |
|
||||||
|
| 2 | SignalTypeDexAd | Dex ad placement |
|
||||||
|
| 3 | SignalTypeDexUpdateLink | Dex social link updated |
|
||||||
|
| 4 | SignalTypeDexTrendingBar | Dex trending bar |
|
||||||
|
| 5 | SignalTypeDexBoost | Dex Boost |
|
||||||
|
| 6 | SignalTypePriceUp | Price spike |
|
||||||
|
| 7 | SignalTypePriceATH | All-time high price |
|
||||||
|
| 8 | SignalTypeMcpKeyLevel | Market cap key level |
|
||||||
|
| 9 | SignalTypeLive | Live stream |
|
||||||
|
| 10 | SignalTypeBundlerSell | Bundler sell |
|
||||||
|
| 11 | SignalTypeCto | Community takeover (CTO) |
|
||||||
|
| 12 | SignalTypeSmartDegenBuy | Smart money buy |
|
||||||
|
| 13 | SignalTypePlatformCall | Platform call |
|
||||||
|
| 14 | SignalTypeLargeAmountBuy | Large amount buy |
|
||||||
|
| 15 | SignalTypeMultiBuy | Multiple buys |
|
||||||
|
| 16 | SignalTypeMultiLargeBuy | Multiple large buys |
|
||||||
|
| 17 | SignalTypeBagsClaims | Bags Claim |
|
||||||
|
| 18 | SignalTypePumpClaims | Pump Claim |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## portfolio follow-wallet
|
## portfolio follow-wallet
|
||||||
|
|
||||||
Query follow-wallet trade records. Returns trades from wallets you personally follow on the GMGN platform. The follow list is resolved automatically from the GMGN user account bound to the API Key — `--wallet` is optional. Normal auth (API Key only, no private key needed).
|
Query follow-wallet trade records. Returns trades from wallets you personally follow on the GMGN platform. The follow list is resolved automatically from the GMGN user account bound to the API Key — `--wallet` is optional. Normal auth (API Key only, no private key needed).
|
||||||
|
|||||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "gmgn-cli",
|
"name": "gmgn-cli",
|
||||||
"version": "1.2.4",
|
"version": "1.2.7",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "gmgn-cli",
|
"name": "gmgn-cli",
|
||||||
"version": "1.2.4",
|
"version": "1.2.7",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"commander": "^12.1.0",
|
"commander": "^12.1.0",
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "gmgn-cli",
|
"name": "gmgn-cli",
|
||||||
"version": "1.2.4",
|
"version": "1.2.7",
|
||||||
"description": "GMGN OpenAPI CLI — call GMGN market, token, portfolio and swap APIs from the command line",
|
"description": "GMGN OpenAPI CLI — call GMGN market, token, portfolio and swap APIs from the command line",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"bin": {
|
"bin": {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: gmgn-cooking
|
name: gmgn-cooking
|
||||||
description: "[FINANCIAL EXECUTION] Create tokens on launchpad platforms (Pump.fun, Raydium, PancakeSwap, Flap, FourMeme, Bonk, BAGS, etc.) or query token creation statistics by launchpad. Token creation executes irreversible on-chain transactions. Requires explicit user confirmation before every create. Supports sol / bsc / base / eth / ton."
|
description: "[FINANCIAL EXECUTION] Create and launch meme coins and crypto tokens on launchpads (Pump.fun, PancakeSwap, FourMeme, Bonk, BAGS, Flap, Raydium, etc.) via bonding curve fair launch, or query token creation stats by launchpad via GMGN API. Requires explicit user confirmation. Use when user asks to create a token, launch a meme coin, cook a coin, deploy on a launchpad, or check launchpad creation stats on Solana, BSC, Base, ETH, or TON."
|
||||||
argument-hint: "stats | [create --chain <chain> --dex <dex> --from <addr> --name <name> --symbol <sym> --buy-amt <n> (--image <base64> | --image-url <url>)]"
|
argument-hint: "stats | [create --chain <chain> --dex <dex> --from <addr> --name <name> --symbol <sym> --buy-amt <n> (--image <base64> | --image-url <url>)]"
|
||||||
metadata:
|
metadata:
|
||||||
cliHelp: "gmgn-cli cooking --help"
|
cliHelp: "gmgn-cli cooking --help"
|
||||||
|
|||||||
+146
-9
@@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
name: gmgn-market
|
name: gmgn-market
|
||||||
description: Query GMGN market data — token K-line (candlestick), trending token swap data, and Trenches token lists. Supports sol / bsc / base.
|
description: Get crypto and meme token price charts (K-line, candlestick, OHLCV), trending meme coin rankings by volume, and newly launched tokens on launchpads (pump.fun, fourmeme, letsbonk, Raydium, etc.) via GMGN API on Solana, BSC, Base, or Ethereum. Use when user asks for price chart, trending tokens, what's pumping, hot coins, new launches, token signals, or wants to discover early-stage opportunities.
|
||||||
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>"
|
argument-hint: "kline --chain <sol|bsc|base|eth> --address <token_address> --resolution <1m|5m|15m|1h|4h|1d> [--from <unix_ts>] [--to <unix_ts>] | trending --chain <sol|bsc|base|eth> --interval <1m|5m|1h|6h|24h> | trenches --chain <sol|bsc|base> | signal --chain <sol|bsc>"
|
||||||
metadata:
|
metadata:
|
||||||
cliHelp: "gmgn-cli market --help"
|
cliHelp: "gmgn-cli market --help"
|
||||||
---
|
---
|
||||||
@@ -18,7 +18,7 @@ Use the `gmgn-cli` tool to query K-line data for a token, browse trending tokens
|
|||||||
|
|
||||||
- **`--filter` chain defaults** — SOL and EVM chains have different default safety filters that are applied automatically when `--filter` is omitted. Do not assume the same defaults apply across chains:
|
- **`--filter` chain defaults** — SOL and EVM chains have different default safety filters that are applied automatically when `--filter` is omitted. Do not assume the same defaults apply across chains:
|
||||||
- **SOL**: defaults to `renounced frozen` (mint and freeze authority renounced)
|
- **SOL**: defaults to `renounced frozen` (mint and freeze authority renounced)
|
||||||
- **BSC / Base (EVM)**: defaults to `not_honeypot verified renounced`
|
- **BSC / Base / ETH (EVM)**: defaults to `not_honeypot verified renounced`
|
||||||
- Omitting `--filter` is NOT the same as "no filter" — the chain defaults are always applied. To use a custom filter set, explicitly specify all desired filter tags.
|
- Omitting `--filter` is NOT the same as "no filter" — the chain defaults are always applied. To use a custom filter set, explicitly specify all desired filter tags.
|
||||||
|
|
||||||
- **`volume` vs `amount` (kline)** — Naming is counterintuitive. `volume` = USD dollar value of trades; `amount` = token units traded. For a token priced at $0.0002, these differ by 5,000×. Always use `volume` for "how much USD was traded" and `amount` for "how many tokens changed hands."
|
- **`volume` vs `amount` (kline)** — Naming is counterintuitive. `volume` = USD dollar value of trades; `amount` = token units traded. For a token priced at $0.0002, these differ by 5,000×. Always use `volume` for "how much USD was traded" and `amount` for "how many tokens changed hands."
|
||||||
@@ -48,10 +48,11 @@ Use the `gmgn-cli` tool to query K-line data for a token, browse trending tokens
|
|||||||
| `market kline` | Token candlestick / OHLCV data and trading volume over a time range |
|
| `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 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 platform 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) |
|
| `market trenches` | Newly launched launchpad platform 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) |
|
||||||
|
| `market signal` | Real-time token signal feed — price spikes, smart money buys, large buys, Dex ads, CTO events, and more. Results sorted by `trigger_at` descending. **sol / bsc only. Max 50 results per group.** |
|
||||||
|
|
||||||
## Supported Chains
|
## Supported Chains
|
||||||
|
|
||||||
`sol` / `bsc` / `base`
|
`sol` / `bsc` / `base` / `eth` (kline / trending only; trenches: `sol` / `bsc` / `base`; signal: `sol` / `bsc` only)
|
||||||
|
|
||||||
## Prerequisites
|
## Prerequisites
|
||||||
|
|
||||||
@@ -67,6 +68,7 @@ All market routes used by this skill go through GMGN's leaky-bucket limiter with
|
|||||||
| `market kline` | `GET /v1/market/token_kline` | 2 |
|
| `market kline` | `GET /v1/market/token_kline` | 2 |
|
||||||
| `market trending` | `GET /v1/market/rank` | 1 |
|
| `market trending` | `GET /v1/market/rank` | 1 |
|
||||||
| `market trenches` | `POST /v1/trenches` | 3 |
|
| `market trenches` | `POST /v1/trenches` | 3 |
|
||||||
|
| `market signal` | `POST /v1/market/token_signal` | 3 |
|
||||||
|
|
||||||
When a request returns `429`:
|
When a request returns `429`:
|
||||||
|
|
||||||
@@ -95,7 +97,7 @@ When a request returns `429`:
|
|||||||
|
|
||||||
| Parameter | Required | Description |
|
| Parameter | Required | Description |
|
||||||
|-----------|----------|-------------|
|
|-----------|----------|-------------|
|
||||||
| `--chain` | Yes | `sol` / `bsc` / `base` |
|
| `--chain` | Yes | `sol` / `bsc` / `base` / `eth` |
|
||||||
| `--address` | Yes | Token contract address |
|
| `--address` | Yes | Token contract address |
|
||||||
| `--resolution` | Yes | Candlestick resolution: `1m` / `5m` / `15m` / `1h` / `4h` / `1d` |
|
| `--resolution` | Yes | Candlestick resolution: `1m` / `5m` / `15m` / `1h` / `4h` / `1d` |
|
||||||
| `--from` | No | Start time (Unix seconds) |
|
| `--from` | No | Start time (Unix seconds) |
|
||||||
@@ -138,13 +140,13 @@ The response is an object with a `list` array. Each element in `list` is one can
|
|||||||
|
|
||||||
| Option | Description |
|
| Option | Description |
|
||||||
|--------|-------------|
|
|--------|-------------|
|
||||||
| `--chain` | Required. `sol` / `bsc` / `base` |
|
| `--chain` | Required. `sol` / `bsc` / `base` / `eth` |
|
||||||
| `--interval` | Required. `1m` / `5m` / `1h` / `6h` / `24h` (default `1h`) |
|
| `--interval` | Required. `1m` / `5m` / `1h` / `6h` / `24h` (default `1h`) |
|
||||||
| `--limit <n>` | Number of results (default 100, max 100) |
|
| `--limit <n>` | Number of results (default 100, max 100) |
|
||||||
| `--order-by <field>` | Sort field: `default` / `swaps` / `marketcap` / `history_highest_market_cap` / `liquidity` / `volume` / `holder_count` / `smart_degen_count` / `renowned_count` / `gas_fee` / `price` / `change1m` / `change5m` / `change1h` / `creation_timestamp` |
|
| `--order-by <field>` | Sort field: `default` / `swaps` / `marketcap` / `history_highest_market_cap` / `liquidity` / `volume` / `holder_count` / `smart_degen_count` / `renowned_count` / `gas_fee` / `price` / `change1m` / `change5m` / `change1h` / `creation_timestamp` |
|
||||||
| `--direction <asc\|desc>` | Sort direction (default `desc`) |
|
| `--direction <asc\|desc>` | Sort direction (default `desc`) |
|
||||||
| `--filter <tag...>` | Repeatable filter tags (chain-specific). **⚠️ SOL defaults: `renounced frozen`; BSC/Base defaults: `not_honeypot verified renounced`.** Omitting `--filter` is NOT "no filter" — chain defaults always apply. **sol** tags: `renounced` / `frozen` / `burn` / `token_burnt` / `has_social` / `not_social_dup` / `not_image_dup` / `dexscr_update_link` / `not_wash_trading` / `is_internal_market` / `is_out_market`. **evm** tags: `not_honeypot` / `verified` / `renounced` / `locked` / `token_burnt` / `has_social` / `not_social_dup` / `not_image_dup` / `dexscr_update_link` / `is_internal_market` / `is_out_market` |
|
| `--filter <tag...>` | Repeatable filter tags (chain-specific). **⚠️ SOL defaults: `renounced frozen`; BSC/Base/ETH defaults: `not_honeypot verified renounced`.** Omitting `--filter` is NOT "no filter" — chain defaults always apply. **sol** tags: `renounced` / `frozen` / `burn` / `token_burnt` / `has_social` / `not_social_dup` / `not_image_dup` / `dexscr_update_link` / `not_wash_trading` / `is_internal_market` / `is_out_market`. **evm** tags: `not_honeypot` / `verified` / `renounced` / `locked` / `token_burnt` / `has_social` / `not_social_dup` / `not_image_dup` / `dexscr_update_link` / `is_internal_market` / `is_out_market` |
|
||||||
| `--platform <name...>` | Repeatable platform filter (chain-specific). **sol**: `Pump.fun` / `pump_mayhem` / `pump_mayhem_agent` / `pump_agent` / `letsbonk` / `bonkers` / `bags` / `memoo` / `liquid` / `bankr` / `zora` / `surge` / `anoncoin` / `moonshot_app` / `wendotdev` / `heaven` / `sugar` / `token_mill` / `believe` / `trendsfun` / `trends_fun` / `jup_studio` / `Moonshot` / `boop` / `xstocks` / `ray_launchpad` / `meteora_virtual_curve` / `pool_ray` / `pool_meteora` / `pool_pump_amm` / `pool_orca`. **bsc**: `fourmeme` / `fourmeme_agent` / `bn_fourmeme` / `flap` / `clanker` / `lunafun` / `pool_uniswap` / `pool_pancake`. **base**: `clanker` / `bankr` / `flaunch` / `zora` / `zora_creator` / `baseapp` / `basememe` / `virtuals_v2` / `klik` |
|
| `--platform <name...>` | Repeatable platform filter (chain-specific). **sol**: `Pump.fun` / `pump_mayhem` / `pump_mayhem_agent` / `pump_agent` / `letsbonk` / `bonkers` / `bags` / `memoo` / `liquid` / `bankr` / `zora` / `surge` / `anoncoin` / `moonshot_app` / `wendotdev` / `heaven` / `sugar` / `token_mill` / `believe` / `trendsfun` / `trends_fun` / `jup_studio` / `Moonshot` / `boop` / `xstocks` / `ray_launchpad` / `meteora_virtual_curve` / `pool_ray` / `pool_meteora` / `pool_pump_amm` / `pool_orca`. **bsc**: `fourmeme` / `fourmeme_agent` / `bn_fourmeme` / `flap` / `clanker` / `lunafun` / `pool_uniswap` / `pool_pancake`. **base**: `clanker` / `bankr` / `flaunch` / `zora` / `zora_creator` / `baseapp` / `basememe` / `virtuals_v2` / `klik`. **eth**: no platform filter (omit `--platform` for ETH) |
|
||||||
|
|
||||||
## Usage Examples
|
## Usage Examples
|
||||||
|
|
||||||
@@ -174,6 +176,14 @@ gmgn-cli market kline \
|
|||||||
# Raw output for further processing
|
# Raw output for further processing
|
||||||
gmgn-cli market kline --chain sol --address <addr> \
|
gmgn-cli market kline --chain sol --address <addr> \
|
||||||
--resolution 5m --from <ts> --to <ts> --raw | jq '.[]'
|
--resolution 5m --from <ts> --to <ts> --raw | jq '.[]'
|
||||||
|
|
||||||
|
# ETH token kline — last 24h, 1h candles (macOS)
|
||||||
|
gmgn-cli market kline \
|
||||||
|
--chain eth \
|
||||||
|
--address 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2 \
|
||||||
|
--resolution 1h \
|
||||||
|
--from $(date -v-24H +%s) \
|
||||||
|
--to $(date +%s)
|
||||||
```
|
```
|
||||||
|
|
||||||
### Trending — General
|
### Trending — General
|
||||||
@@ -246,6 +256,25 @@ gmgn-cli market trending \
|
|||||||
--order-by volume --limit 20 --raw
|
--order-by volume --limit 20 --raw
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Trending — ETH (No Platform Filter)
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# ETH 1h trending — all tokens, sorted by volume
|
||||||
|
gmgn-cli market trending --chain eth --interval 1h --order-by volume --limit 20
|
||||||
|
|
||||||
|
# ETH 1h trending — with safety filters
|
||||||
|
gmgn-cli market trending \
|
||||||
|
--chain eth --interval 1h \
|
||||||
|
--filter not_honeypot --filter verified \
|
||||||
|
--order-by volume --limit 20 --raw
|
||||||
|
|
||||||
|
# ETH 24h trending — sorted by smart money count
|
||||||
|
gmgn-cli market trending \
|
||||||
|
--chain eth --interval 24h \
|
||||||
|
--filter not_honeypot --filter verified \
|
||||||
|
--order-by smart_degen_count --limit 20 --raw
|
||||||
|
```
|
||||||
|
|
||||||
### Trending — Base by Launchpad Platform
|
### Trending — Base by Launchpad Platform
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
@@ -505,7 +534,7 @@ All filter flags are sent as part of the API request body — the server filters
|
|||||||
| `--min-progress` / `--max-progress` | float | Bonding curve progress (0–1) |
|
| `--min-progress` / `--max-progress` | float | Bonding curve progress (0–1) |
|
||||||
| `--min-marketcap` / `--max-marketcap` | float | Market cap (USD) |
|
| `--min-marketcap` / `--max-marketcap` | float | Market cap (USD) |
|
||||||
| `--min-liquidity` / `--max-liquidity` | float | Liquidity (USD) |
|
| `--min-liquidity` / `--max-liquidity` | float | Liquidity (USD) |
|
||||||
| `--min-created` / `--max-created` | string | Token age (e.g. `1m` / `5m` / `1h` / `24h`) |
|
| `--min-created` / `--max-created` | duration | Token age — unit suffix recommended: seconds (`30s`, `10s`) or minutes (`0.5m`, `1m`, `5m`, `30m`). Bare numbers (e.g. `5`) are treated as minutes with a warning. |
|
||||||
| `--min-holder-count` / `--max-holder-count` | int | Holder count |
|
| `--min-holder-count` / `--max-holder-count` | int | Holder count |
|
||||||
| `--min-top-holder-rate` / `--max-top-holder-rate` | float | Top-10 holder concentration (0–1) |
|
| `--min-top-holder-rate` / `--max-top-holder-rate` | float | Top-10 holder concentration (0–1) |
|
||||||
| `--min-rug-ratio` / `--max-rug-ratio` | float | Rug pull risk score (0–1) |
|
| `--min-rug-ratio` / `--max-rug-ratio` | float | Rug pull risk score (0–1) |
|
||||||
@@ -809,6 +838,114 @@ Present each category separately with a header:
|
|||||||
# | Symbol | Market Cap | Volume (1h) | Smart Degens | Social
|
# | Symbol | Market Cap | Volume (1h) | Smart Degens | Social
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## `market signal` Parameters
|
||||||
|
|
||||||
|
Chains: `sol` / `bsc` only. **Maximum 50 results per group** — use multiple groups via `--groups` to cover different signal types in a single request.
|
||||||
|
|
||||||
|
**Single-group (individual flags):**
|
||||||
|
|
||||||
|
Do **not** pass signal types **14, 15, or 16** in `signal_type` / `--signal-type` / `--groups` JSON — OpenAPI returns **400** if any group includes them. Omitting `--signal-type` (empty filter) still queries all types upstream; responses may still include 14–16 in that case.
|
||||||
|
|
||||||
|
| Option | Required | Description |
|
||||||
|
|--------|----------|-------------|
|
||||||
|
| `--chain` | Yes | `sol` / `bsc` |
|
||||||
|
| `--signal-type` | No | Signal type(s), repeatable (1–18, default: all). See Signal Types below. |
|
||||||
|
| `--mc-min` | No | Min market cap at trigger time (USD) |
|
||||||
|
| `--mc-max` | No | Max market cap at trigger time (USD) |
|
||||||
|
| `--trigger-mc-min` | No | Min market cap at signal trigger moment (USD) |
|
||||||
|
| `--trigger-mc-max` | No | Max market cap at signal trigger moment (USD) |
|
||||||
|
| `--total-fee-min` | No | Min total fees paid (USD) |
|
||||||
|
| `--total-fee-max` | No | Max total fees paid (USD) |
|
||||||
|
| `--min-create-or-open-ts` | No | Min token creation or open timestamp (Unix seconds string) |
|
||||||
|
| `--max-create-or-open-ts` | No | Max token creation or open timestamp (Unix seconds string) |
|
||||||
|
|
||||||
|
**Multi-group override:**
|
||||||
|
|
||||||
|
Pass `--groups '<json_array>'` to query multiple filter groups in a single request. The upstream executes all groups in parallel and merges results sorted by `trigger_at` descending. When `--groups` is present, all individual flags above are ignored.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
gmgn-cli market signal --chain sol \
|
||||||
|
--groups '[{"signal_type":[12,13]},{"signal_type":[6,7],"mc_min":50000}]'
|
||||||
|
```
|
||||||
|
|
||||||
|
### Signal Types
|
||||||
|
|
||||||
|
| Value | Name | Description |
|
||||||
|
|-------|------|-------------|
|
||||||
|
| 1 | SignalType1 | General signal (K-line price spike) |
|
||||||
|
| 2 | SignalTypeDexAd | Dex ad placement |
|
||||||
|
| 3 | SignalTypeDexUpdateLink | Dex social link updated |
|
||||||
|
| 4 | SignalTypeDexTrendingBar | Dex trending bar |
|
||||||
|
| 5 | SignalTypeDexBoost | Dex Boost |
|
||||||
|
| 6 | SignalTypePriceUp | Price spike |
|
||||||
|
| 7 | SignalTypePriceATH | All-time high price |
|
||||||
|
| 8 | SignalTypeMcpKeyLevel | Market cap key level |
|
||||||
|
| 9 | SignalTypeLive | Live stream |
|
||||||
|
| 10 | SignalTypeBundlerSell | Bundler sell |
|
||||||
|
| 11 | SignalTypeCto | Community takeover (CTO) |
|
||||||
|
| 12 | SignalTypeSmartDegenBuy | Smart money buy |
|
||||||
|
| 13 | SignalTypePlatformCall | Platform call |
|
||||||
|
| 14 | SignalTypeLargeAmountBuy | Large amount buy |
|
||||||
|
| 15 | SignalTypeMultiBuy | Multiple buys |
|
||||||
|
| 16 | SignalTypeMultiLargeBuy | Multiple large buys |
|
||||||
|
| 17 | SignalTypeBagsClaims | Bags Claim |
|
||||||
|
| 18 | SignalTypePumpClaims | Pump Claim |
|
||||||
|
|
||||||
|
### `market signal` Response Fields
|
||||||
|
|
||||||
|
Each item in the response array is one signal event:
|
||||||
|
|
||||||
|
| Field | Type | Description |
|
||||||
|
|-------|------|-------------|
|
||||||
|
| `id` | string | Signal event ID |
|
||||||
|
| `token_address` | string | Token contract address |
|
||||||
|
| `signal_type` | number | Signal type (1–18, see Signal Types above) |
|
||||||
|
| `trigger_at` | number | Unix timestamp (seconds) when the signal was triggered |
|
||||||
|
| `trigger_mc` | number | Market cap at signal trigger time (USD) |
|
||||||
|
| `first_trigger_mc` | number | Market cap at the very first trigger for this token (USD) |
|
||||||
|
| `market_cap` | number | Current market cap (USD) |
|
||||||
|
| `ath` | number | All-time high market cap (USD) |
|
||||||
|
| `signal_times` | number | Total number of times this signal has triggered for this token |
|
||||||
|
| `signal_times_by_type` | object | Signal trigger count broken down by type |
|
||||||
|
| `cur_data` | object | Real-time token stats at query time (see below) |
|
||||||
|
| `data` | object | Full upstream snapshot at trigger time (chain-specific, raw passthrough) |
|
||||||
|
|
||||||
|
**`cur_data` fields:**
|
||||||
|
|
||||||
|
| Field | Type | Description |
|
||||||
|
|-------|------|-------------|
|
||||||
|
| `top_10_holder_rate` | number | Top 10 holder concentration ratio (0–1) |
|
||||||
|
| `holder_count` | number | Current holder count |
|
||||||
|
| `liquidity` | number | Current liquidity (USD) |
|
||||||
|
|
||||||
|
### Usage Examples
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# All signals on SOL (no --signal-type: upstream returns all types, including 14–16 if present)
|
||||||
|
gmgn-cli market signal --chain sol --raw
|
||||||
|
|
||||||
|
# Smart money buys only (type 12)
|
||||||
|
gmgn-cli market signal --chain sol --signal-type 12 --raw
|
||||||
|
|
||||||
|
# Price spikes + ATH (types 6 and 7) with market cap filter
|
||||||
|
gmgn-cli market signal --chain sol \
|
||||||
|
--signal-type 6 --signal-type 7 \
|
||||||
|
--mc-min 50000 --mc-max 5000000 --raw
|
||||||
|
|
||||||
|
# Smart money buys on BSC
|
||||||
|
gmgn-cli market signal --chain bsc --signal-type 12 --raw
|
||||||
|
|
||||||
|
# Multi-group: parallel groups (do not use signal_type 14–16 — API returns 400)
|
||||||
|
gmgn-cli market signal --chain sol \
|
||||||
|
--groups '[{"signal_type":[12]},{"signal_type":[6,7]}]' --raw
|
||||||
|
|
||||||
|
# Multi-group: combine signal type filter with market cap range per group
|
||||||
|
gmgn-cli market signal --chain sol \
|
||||||
|
--groups '[{"signal_type":[12,13],"mc_min":100000},{"signal_type":[6,7],"mc_min":50000,"mc_max":1000000}]' --raw
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## Notes
|
## Notes
|
||||||
|
|
||||||
- `market kline`: `--from` and `--to` are Unix timestamps in **seconds** — CLI converts to milliseconds automatically
|
- `market kline`: `--from` and `--to` are Unix timestamps in **seconds** — CLI converts to milliseconds automatically
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
name: gmgn-portfolio
|
name: gmgn-portfolio
|
||||||
description: Query GMGN wallet portfolio — API Key wallet info, holdings, transaction activity, trading stats, token balance, and developer-created tokens. Supports sol / bsc / base.
|
description: Analyze any crypto wallet by address — holdings, realized/unrealized P&L, win rate, trading history, performance stats, specific token balance, and tokens created by a developer wallet (with ATH market cap and DEX graduation status) via GMGN API on Solana, BSC, Base, or Ethereum. Use when user asks about a wallet's holdings, P&L, win rate, what tokens a dev has launched, the highest ATH token a dev ever created, or wants a wallet report to decide whether to copy-trade or follow.
|
||||||
argument-hint: "<info|holdings|activity|stats|token-balance|created-tokens> [--chain <sol|bsc|base>] [--wallet <wallet_address>]"
|
argument-hint: "<info|holdings|activity|stats|token-balance|created-tokens> [--chain <sol|bsc|base|eth>] [--wallet <wallet_address>]"
|
||||||
metadata:
|
metadata:
|
||||||
cliHelp: "gmgn-cli portfolio --help"
|
cliHelp: "gmgn-cli portfolio --help"
|
||||||
---
|
---
|
||||||
@@ -43,7 +43,7 @@ Use the `gmgn-cli` tool to query wallet portfolio data based on the user's reque
|
|||||||
|
|
||||||
## Supported Chains
|
## Supported Chains
|
||||||
|
|
||||||
`sol` / `bsc` / `base`
|
`sol` / `bsc` / `base` / `eth`
|
||||||
|
|
||||||
## Prerequisites
|
## Prerequisites
|
||||||
|
|
||||||
@@ -139,6 +139,16 @@ gmgn-cli portfolio created-tokens \
|
|||||||
# Only migrated tokens
|
# Only migrated tokens
|
||||||
gmgn-cli portfolio created-tokens \
|
gmgn-cli portfolio created-tokens \
|
||||||
--chain sol --wallet <wallet_address> --migrate-state migrated
|
--chain sol --wallet <wallet_address> --migrate-state migrated
|
||||||
|
|
||||||
|
# ETH wallet holdings
|
||||||
|
gmgn-cli portfolio holdings --chain eth --wallet <0x_wallet_address>
|
||||||
|
|
||||||
|
# ETH wallet transaction activity
|
||||||
|
gmgn-cli portfolio activity --chain eth --wallet <0x_wallet_address>
|
||||||
|
|
||||||
|
# ETH token balance
|
||||||
|
gmgn-cli portfolio token-balance \
|
||||||
|
--chain eth --wallet <0x_wallet_address> --token <0x_token_address>
|
||||||
```
|
```
|
||||||
|
|
||||||
## `portfolio created-tokens` Options
|
## `portfolio created-tokens` Options
|
||||||
@@ -266,9 +276,11 @@ Top-level fields:
|
|||||||
| Field | Description |
|
| Field | Description |
|
||||||
|-------|-------------|
|
|-------|-------------|
|
||||||
| `last_create_timestamp` | Unix timestamp of the most recent token creation |
|
| `last_create_timestamp` | Unix timestamp of the most recent token creation |
|
||||||
| `inner_count` | Number of tokens still on the bonding curve |
|
| `inner_count` | Number of tokens still on the bonding curve (NOT graduated) |
|
||||||
| `open_count` | Number of tokens that have graduated to DEX |
|
| `open_count` | Number of tokens that have graduated to DEX |
|
||||||
| `open_ratio` | Graduation rate (string, e.g. `"0.25"`) |
|
| `open_ratio` | Graduation rate (string, e.g. `"0.25"`) |
|
||||||
|
|
||||||
|
> **Total created = `inner_count + open_count`**. Do NOT use `len(tokens)` as the total — the `tokens` array is capped at 100 entries and may be truncated.
|
||||||
| `creator_ath_info` | Best-performing token created by this wallet (ATH market cap) |
|
| `creator_ath_info` | Best-performing token created by this wallet (ATH market cap) |
|
||||||
| `tokens` | Array of created tokens — see below |
|
| `tokens` | Array of created tokens — see below |
|
||||||
|
|
||||||
@@ -364,3 +376,4 @@ For in-depth trading style analysis, copy-trade ROI estimation, and smart money
|
|||||||
- User asks "is this wallet worth following" → [`docs/workflow-wallet-analysis.md`](../../docs/workflow-wallet-analysis.md)
|
- User asks "is this wallet worth following" → [`docs/workflow-wallet-analysis.md`](../../docs/workflow-wallet-analysis.md)
|
||||||
- User asks "what's this wallet's trading style", "when does he take profit", "smart money profile", "if I copied this wallet what would my return be" → [`docs/workflow-smart-money-profile.md`](../../docs/workflow-smart-money-profile.md)
|
- User asks "what's this wallet's trading style", "when does he take profit", "smart money profile", "if I copied this wallet what would my return be" → [`docs/workflow-smart-money-profile.md`](../../docs/workflow-smart-money-profile.md)
|
||||||
- User wants to compare multiple smart money wallets by winrate/PnL → [`docs/workflow-smart-money-profile.md`](../../docs/workflow-smart-money-profile.md) Step 5 (leaderboard)
|
- User wants to compare multiple smart money wallets by winrate/PnL → [`docs/workflow-smart-money-profile.md`](../../docs/workflow-smart-money-profile.md) Step 5 (leaderboard)
|
||||||
|
- User asks "what tokens did this dev create", "dev 发过哪些币", "查一下这个 dev 的代币", "dev 创建记录" → use `portfolio created-tokens --chain <chain> --wallet <creator_address>` directly. Get the creator address first via `token info` if only a token address is given.
|
||||||
|
|||||||
+25
-15
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: gmgn-swap
|
name: gmgn-swap
|
||||||
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."
|
description: "[FINANCIAL EXECUTION] Buy and sell meme coins and crypto tokens on Solana, BSC, Base, or Ethereum — single swap, multi-wallet batch trading, limit orders, stop loss, take profit, trailing stop loss, trailing take profit via GMGN API. Requires explicit user confirmation. Use when user asks to buy, sell, or swap a token, trade from multiple wallets, set a limit order, stop loss, take profit, or check order status."
|
||||||
argument-hint: "[--chain <chain> --from <wallet> --input-token <addr> --output-token <addr> --amount <n>] | [order get --chain <chain> --order-id <id>] | [order strategy list --chain <chain> --group-tag <LimitOrder|STMix>] | [order strategy create --chain <chain> --order-type limit_order --sub-order-type <buy_low|buy_high|stop_loss|take_profit> ...]"
|
argument-hint: "[--chain <chain> --from <wallet> --input-token <addr> --output-token <addr> --amount <n>] | [order get --chain <chain> --order-id <id>] | [order strategy list --chain <chain> --group-tag <LimitOrder|STMix>] | [order strategy create --chain <chain> --order-type limit_order --sub-order-type <buy_low|buy_high|stop_loss|take_profit> ...]"
|
||||||
metadata:
|
metadata:
|
||||||
cliHelp: "gmgn-cli swap --help"
|
cliHelp: "gmgn-cli swap --help"
|
||||||
@@ -55,18 +55,18 @@ Use the `gmgn-cli` tool to submit a token swap or query an existing order. `GMGN
|
|||||||
|
|
||||||
## Supported Chains
|
## Supported Chains
|
||||||
|
|
||||||
`sol` / `bsc` / `base`
|
`sol` / `bsc` / `base` / `eth`
|
||||||
|
|
||||||
|
|
||||||
## Chain Currencies
|
## Chain Currencies
|
||||||
|
|
||||||
Currency tokens are the base/native assets of each chain. They are used to buy other tokens or receive proceeds from selling. Knowing which tokens are currencies is critical for `--percent` usage (see Swap Parameters below).
|
Currency tokens are the base/native assets of each chain. They are used to buy other tokens or receive proceeds from selling. Knowing which tokens are currencies is critical for `--percent` usage (see Swap Parameters below).
|
||||||
|
|
||||||
| Chain | Currency tokens |
|
| Chain | Currency tokens |
|
||||||
|-------|----------------|
|
| ------ | --------------- |
|
||||||
| `sol` | SOL (native, So11111111111111111111111111111111111111112), USDC (`EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v`) |
|
| `sol` | SOL (native, So11111111111111111111111111111111111111112), USDC (`EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v`) |
|
||||||
| `bsc` | BNB (native, 0x0000000000000000000000000000000000000000), USDC (`0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d`) |
|
| `bsc` | BNB (native, 0x0000000000000000000000000000000000000000), USDC (`0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d`) |
|
||||||
| `base` | ETH (native, 0x0000000000000000000000000000000000000000), USDC (`0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913`) |
|
| `base` | ETH (native, 0x0000000000000000000000000000000000000000), USDC (`0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913`) |
|
||||||
|
| `eth` | ETH (native, 0x0000000000000000000000000000000000000000) |
|
||||||
|
|
||||||
|
|
||||||
## Prerequisites
|
## Prerequisites
|
||||||
@@ -199,13 +199,23 @@ gmgn-cli multi-swap \
|
|||||||
--priority-fee 0.00001 \
|
--priority-fee 0.00001 \
|
||||||
--tip-fee 0.00001 \
|
--tip-fee 0.00001 \
|
||||||
--condition-orders '[{"order_type":"profit_stop","side":"sell","price_scale":"100","sell_ratio":"100"},{"order_type":"loss_stop","side":"sell","price_scale":"50","sell_ratio":"100"}]'
|
--condition-orders '[{"order_type":"profit_stop","side":"sell","price_scale":"100","sell_ratio":"100"},{"order_type":"loss_stop","side":"sell","price_scale":"50","sell_ratio":"100"}]'
|
||||||
|
|
||||||
|
# ETH multi-wallet swap (EIP-1559 gas)
|
||||||
|
gmgn-cli multi-swap \
|
||||||
|
--chain eth \
|
||||||
|
--accounts <0xaddr1>,<0xaddr2> \
|
||||||
|
--input-token 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 \
|
||||||
|
--output-token <token_address> \
|
||||||
|
--input-amount '{"<0xaddr1>":"1000000","<0xaddr2>":"2000000"}' \
|
||||||
|
--slippage 0.01 \
|
||||||
|
--gas-price 5
|
||||||
```
|
```
|
||||||
|
|
||||||
## `multi-swap` Parameters
|
## `multi-swap` Parameters
|
||||||
|
|
||||||
| Parameter | Required | Description |
|
| Parameter | Required | Description |
|
||||||
|-----------|----------|-------------|
|
|-----------|----------|-------------|
|
||||||
| `--chain` | Yes | `sol` / `bsc` / `base` |
|
| `--chain` | Yes | `sol` / `bsc` / `base` / `eth` |
|
||||||
| `--accounts` | Yes | Comma-separated wallet addresses (1–100, all must be bound to the API Key) |
|
| `--accounts` | Yes | Comma-separated wallet addresses (1–100, all must be bound to the API Key) |
|
||||||
| `--input-token` | Yes | Input token contract address |
|
| `--input-token` | Yes | Input token contract address |
|
||||||
| `--output-token` | Yes | Output token contract address |
|
| `--output-token` | Yes | Output token contract address |
|
||||||
@@ -219,9 +229,9 @@ gmgn-cli multi-swap \
|
|||||||
| `--tip-fee <amount>` | No | Tip fee (SOL ≥ 0.00001 / BSC ≥ 0.000001 BNB). Required when using `--condition-orders` on SOL. |
|
| `--tip-fee <amount>` | No | Tip fee (SOL ≥ 0.00001 / BSC ≥ 0.000001 BNB). Required when using `--condition-orders` on SOL. |
|
||||||
| `--auto-tip-fee` | No | Enable automatic tip fee. |
|
| `--auto-tip-fee` | No | Enable automatic tip fee. |
|
||||||
| `--max-auto-fee <amount>` | No | Max automatic fee cap. |
|
| `--max-auto-fee <amount>` | No | Max automatic fee cap. |
|
||||||
| `--gas-price <gwei>` | No | Gas price in gwei (BSC ≥ 0.05 / BASE/ETH ≥ 0.01). Required when using `--condition-orders` on BSC. |
|
| `--gas-price <gwei>` | No | Gas price in gwei (BSC: 0.05–10 / BASE: 0.01–10 / ETH: 2–20). Required when using `--condition-orders` on BSC. |
|
||||||
| `--max-fee-per-gas <amount>` | No | EIP-1559 max fee per gas (Base only). |
|
| `--max-fee-per-gas <amount>` | No | EIP-1559 max fee per gas (Base / ETH). Defaults to `--gas-price` if omitted. |
|
||||||
| `--max-priority-fee-per-gas <amount>` | No | EIP-1559 max priority fee per gas (Base only). |
|
| `--max-priority-fee-per-gas <amount>` | No | EIP-1559 max priority fee per gas (Base / ETH). Defaults to `--gas-price` if omitted. |
|
||||||
| `--condition-orders <json>` | No | JSON array of condition sub-orders (take-profit / stop-loss) attached to each successful wallet's swap. Same structure as `swap --condition-orders`. Strategy creation is best-effort per wallet. |
|
| `--condition-orders <json>` | No | JSON array of condition sub-orders (take-profit / stop-loss) attached to each successful wallet's swap. Same structure as `swap --condition-orders`. Strategy creation is best-effort per wallet. |
|
||||||
| `--sell-ratio-type <type>` | No | Sell ratio base for `--condition-orders`: `buy_amount` (default) / `hold_amount`. |
|
| `--sell-ratio-type <type>` | No | Sell ratio base for `--condition-orders`: `buy_amount` (default) / `hold_amount`. |
|
||||||
|
|
||||||
@@ -273,7 +283,7 @@ gmgn-cli order get --chain sol --order-id <order_id>
|
|||||||
|
|
||||||
| Parameter | Required | Description |
|
| Parameter | Required | Description |
|
||||||
|-----------|----------|-------------|
|
|-----------|----------|-------------|
|
||||||
| `--chain` | Yes | `sol` / `bsc` / `base` |
|
| `--chain` | Yes | `sol` / `bsc` / `base` / `eth` |
|
||||||
| `--from` | Yes | Wallet address (must match API Key binding) |
|
| `--from` | Yes | Wallet address (must match API Key binding) |
|
||||||
| `--input-token` | Yes | Input token contract address |
|
| `--input-token` | Yes | Input token contract address |
|
||||||
| `--output-token` | Yes | Output token contract address |
|
| `--output-token` | Yes | Output token contract address |
|
||||||
@@ -442,7 +452,7 @@ Convert `report.input_amount` and `report.output_amount` from smallest unit usin
|
|||||||
|
|
||||||
| Parameter | Required | Description |
|
| Parameter | Required | Description |
|
||||||
|-----------|----------|-------------|
|
|-----------|----------|-------------|
|
||||||
| `--chain` | Yes | `sol` / `bsc` / `base` |
|
| `--chain` | Yes | `sol` / `bsc` / `base` / `eth` |
|
||||||
| `--from` | Yes | Wallet address (must match API Key binding) |
|
| `--from` | Yes | Wallet address (must match API Key binding) |
|
||||||
| `--base-token` | Yes | Base token contract address |
|
| `--base-token` | Yes | Base token contract address |
|
||||||
| `--quote-token` | Yes | Quote token contract address |
|
| `--quote-token` | Yes | Quote token contract address |
|
||||||
@@ -473,7 +483,7 @@ Convert `report.input_amount` and `report.output_amount` from smallest unit usin
|
|||||||
|
|
||||||
| Parameter | Required | Description |
|
| Parameter | Required | Description |
|
||||||
|-----------|----------|-------------|
|
|-----------|----------|-------------|
|
||||||
| `--chain` | Yes | `sol` / `bsc` / `base` |
|
| `--chain` | Yes | `sol` / `bsc` / `base` / `eth` |
|
||||||
| `--type` | No | `open` (default) / `history` |
|
| `--type` | No | `open` (default) / `history` |
|
||||||
| `--from` | No | Filter by wallet address |
|
| `--from` | No | Filter by wallet address |
|
||||||
| `--group-tag` | Yes | Filter by order group: `LimitOrder` (limit orders only) / `STMix` (mixed strategy orders: take-profit, stop-loss, trailing take-profit, trailing stop-loss) |
|
| `--group-tag` | Yes | Filter by order group: `LimitOrder` (limit orders only) / `STMix` (mixed strategy orders: take-profit, stop-loss, trailing take-profit, trailing stop-loss) |
|
||||||
@@ -493,7 +503,7 @@ Convert `report.input_amount` and `report.output_amount` from smallest unit usin
|
|||||||
|
|
||||||
| Parameter | Required | Description |
|
| Parameter | Required | Description |
|
||||||
|-----------|----------|-------------|
|
|-----------|----------|-------------|
|
||||||
| `--chain` | Yes | `sol` / `bsc` / `base` |
|
| `--chain` | Yes | `sol` / `bsc` / `base` / `eth` |
|
||||||
| `--from` | Yes | Wallet address (must match API Key binding) |
|
| `--from` | Yes | Wallet address (must match API Key binding) |
|
||||||
| `--order-id` | Yes | Order ID to cancel |
|
| `--order-id` | Yes | Order ID to cancel |
|
||||||
| `--order-type` | No | Order type: `limit_order` (limit order) / `smart_trade` (mixed strategy order: take-profit, stop-loss, trailing take-profit, trailing stop-loss) |
|
| `--order-type` | No | Order type: `limit_order` (limit order) / `smart_trade` (mixed strategy order: take-profit, stop-loss, trailing take-profit, trailing stop-loss) |
|
||||||
|
|||||||
+37
-12
@@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
name: gmgn-token
|
name: gmgn-token
|
||||||
description: Query GMGN token information — basic info, security, pool, top holders and top traders. Supports sol / bsc / base.
|
description: Research any crypto or meme token by address — real-time price, market cap, liquidity, holder list, trader list, top Smart Money and KOL positions, security audit (honeypot, rug pull risk, dev wallet, renounced status), social links (Twitter/X, website) via GMGN API on Solana, BSC, Base, or Ethereum. Use when user asks about a token's price, safety, holders, traders, smart money exposure, or wants due diligence before buying.
|
||||||
argument-hint: "<sub-command> --chain <sol|bsc|base> --address <token_address>"
|
argument-hint: "<sub-command> --chain <sol|bsc|base|eth> --address <token_address>"
|
||||||
metadata:
|
metadata:
|
||||||
cliHelp: "gmgn-cli token --help"
|
cliHelp: "gmgn-cli token --help"
|
||||||
---
|
---
|
||||||
@@ -17,7 +17,7 @@ Use the `gmgn-cli` tool to query token information based on the user's request.
|
|||||||
## Core Concepts
|
## Core Concepts
|
||||||
|
|
||||||
- **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).
|
- **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).
|
||||||
- **Chain** — The blockchain network: `sol` = Solana, `bsc` = BNB Smart Chain, `base` = Base (Coinbase L2).
|
- **Chain** — The blockchain network: `sol` = Solana, `bsc` = BNB Smart Chain, `base` = Base (Coinbase L2), `eth` = Ethereum mainnet.
|
||||||
- **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).
|
- **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).
|
||||||
- **Liquidity** — USD value of token reserves in the main trading pool. Low liquidity (< $10k) means high price impact / slippage when buying or selling.
|
- **Liquidity** — USD value of token reserves in the main trading pool. Low liquidity (< $10k) means high price impact / slippage when buying or selling.
|
||||||
- **Holder** — A wallet that currently holds the token. `token holders` returns wallets ranked by current balance.
|
- **Holder** — A wallet that currently holds the token. `token holders` returns wallets ranked by current balance.
|
||||||
@@ -34,7 +34,7 @@ Use the `gmgn-cli` tool to query token information based on the user's request.
|
|||||||
|
|
||||||
| Sub-command | Description |
|
| Sub-command | Description |
|
||||||
|-------------|-------------|
|
|-------------|-------------|
|
||||||
| `token info` | Basic info + realtime price, liquidity, supply, holder count, social links (market cap = price × circulating_supply) |
|
| `token info` | Basic info + realtime price, liquidity, market cap, total supply, holder count, social links (market cap = price × circulating_supply) |
|
||||||
| `token security` | Security metrics (honeypot, taxes, holder concentration, contract risks) |
|
| `token security` | Security metrics (honeypot, taxes, holder concentration, contract risks) |
|
||||||
| `token pool` | Liquidity pool info (DEX, reserves, liquidity depth) |
|
| `token pool` | Liquidity pool info (DEX, reserves, liquidity depth) |
|
||||||
| `token holders` | Top token holders list with profit/loss breakdown |
|
| `token holders` | Top token holders list with profit/loss breakdown |
|
||||||
@@ -42,7 +42,7 @@ Use the `gmgn-cli` tool to query token information based on the user's request.
|
|||||||
|
|
||||||
## Supported Chains
|
## Supported Chains
|
||||||
|
|
||||||
`sol` / `bsc` / `base`
|
`sol` / `bsc` / `base` / `eth`
|
||||||
|
|
||||||
## Prerequisites
|
## Prerequisites
|
||||||
|
|
||||||
@@ -88,7 +88,7 @@ When a request returns `429`:
|
|||||||
|
|
||||||
| Parameter | Required | Description |
|
| Parameter | Required | Description |
|
||||||
|-----------|----------|-------------|
|
|-----------|----------|-------------|
|
||||||
| `--chain` | Yes | `sol` / `bsc` / `base` |
|
| `--chain` | Yes | `sol` / `bsc` / `base` / `eth` |
|
||||||
| `--address` | Yes | Token contract address |
|
| `--address` | Yes | Token contract address |
|
||||||
| `--raw` | No | Output raw single-line JSON (for piping or further processing) |
|
| `--raw` | No | Output raw single-line JSON (for piping or further processing) |
|
||||||
|
|
||||||
@@ -96,12 +96,12 @@ When a request returns `429`:
|
|||||||
|
|
||||||
| Parameter | Required | Default | Description |
|
| Parameter | Required | Default | Description |
|
||||||
|-----------|----------|---------|-------------|
|
|-----------|----------|---------|-------------|
|
||||||
| `--chain` | Yes | — | `sol` / `bsc` / `base` |
|
| `--chain` | Yes | — | `sol` / `bsc` / `base` / `eth` |
|
||||||
| `--address` | Yes | — | Token contract address |
|
| `--address` | Yes | — | Token contract address |
|
||||||
| `--limit` | No | `20` | Number of results, max `100` |
|
| `--limit` | No | `20` | Number of results, max `100` |
|
||||||
| `--order-by` | No | `amount_percentage` | Sort field — see table below |
|
| `--order-by` | No | `amount_percentage` | Sort field — see table below |
|
||||||
| `--direction` | No | `desc` | Sort direction: `asc` / `desc` |
|
| `--direction` | No | `desc` | Sort direction: `asc` / `desc` |
|
||||||
| `--tag` | No | — | Wallet filter: `renowned` (KOL wallets) / `smart_degen` (smart money). Omit to return all wallets. |
|
| `--tag` | No | — | Wallet filter: `smart_degen` / `renowned` / `fresh_wallet` / `dev` / `sniper` / `rat_trader` / `bundler` / `transfer_in` / `dex_bot` / `bluechip_owner`. Omit to return all wallets. |
|
||||||
| `--raw` | No | — | Output raw single-line JSON |
|
| `--raw` | No | — | Output raw single-line JSON |
|
||||||
|
|
||||||
### `--order-by` Values
|
### `--order-by` Values
|
||||||
@@ -116,10 +116,18 @@ When a request returns `429`:
|
|||||||
|
|
||||||
### `--tag` Values
|
### `--tag` Values
|
||||||
|
|
||||||
| Value | Description |
|
| Value | Description |
|
||||||
|-------|-------------|
|
| -------------- | ----------- |
|
||||||
| `renowned` | KOL / well-known wallets (influencers, funds, public figures) |
|
| `smart_degen` | Smart money wallets (historically high-performing traders) |
|
||||||
| `smart_degen` | Smart money wallets (historically high-performing traders) |
|
| `renowned` | KOL / well-known wallets (influencers, funds, public figures) |
|
||||||
|
| `fresh_wallet` | New wallets with no prior trading history |
|
||||||
|
| `dev` | Token developer / creator wallets |
|
||||||
|
| `sniper` | Wallets that sniped the token at launch |
|
||||||
|
| `rat_trader` | Insider / sneak-trading wallets |
|
||||||
|
| `bundler` | Bot-bundled buy wallets |
|
||||||
|
| `transfer_in` | Wallets with a transfer-in record for this token |
|
||||||
|
| `dex_bot` | DEX bot wallets (Axiom, Photon, BullX, Trojan, GMGN, Drops, PepeBoost, Padre) |
|
||||||
|
| `bluechip_owner` | Wallets holding established bluechip tokens |
|
||||||
|
|
||||||
### `--tag` + `--order-by` Combination Guide
|
### `--tag` + `--order-by` Combination Guide
|
||||||
|
|
||||||
@@ -439,6 +447,9 @@ gmgn-cli token info --chain bsc --address 0x2170Ed0880ac9A755fd29B2688956BD959F9
|
|||||||
# Get basic info for a Base token
|
# Get basic info for a Base token
|
||||||
gmgn-cli token info --chain base --address 0x4200000000000000000000000000000000000006
|
gmgn-cli token info --chain base --address 0x4200000000000000000000000000000000000006
|
||||||
|
|
||||||
|
# Get basic info for an ETH token
|
||||||
|
gmgn-cli token info --chain eth --address 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
|
||||||
|
|
||||||
# Raw JSON output for downstream processing
|
# Raw JSON output for downstream processing
|
||||||
gmgn-cli token info --chain sol --address EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v --raw
|
gmgn-cli token info --chain sol --address EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v --raw
|
||||||
```
|
```
|
||||||
@@ -455,6 +466,9 @@ gmgn-cli token security --chain bsc --address 0x2170Ed0880ac9A755fd29B2688956BD9
|
|||||||
# Check a Base token for tax, rug ratio, and insider concentration
|
# Check a Base token for tax, rug ratio, and insider concentration
|
||||||
gmgn-cli token security --chain base --address 0x4200000000000000000000000000000000000006
|
gmgn-cli token security --chain base --address 0x4200000000000000000000000000000000000006
|
||||||
|
|
||||||
|
# Check an ETH token for honeypot and contract risks
|
||||||
|
gmgn-cli token security --chain eth --address 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
|
||||||
|
|
||||||
# Raw output for parsing key fields (e.g. is_honeypot, buy_tax, rug_ratio)
|
# Raw output for parsing key fields (e.g. is_honeypot, buy_tax, rug_ratio)
|
||||||
gmgn-cli token security --chain bsc --address 0x2170Ed0880ac9A755fd29B2688956BD959F933F8 --raw
|
gmgn-cli token security --chain bsc --address 0x2170Ed0880ac9A755fd29B2688956BD959F933F8 --raw
|
||||||
```
|
```
|
||||||
@@ -467,6 +481,9 @@ gmgn-cli token pool --chain sol --address EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZw
|
|||||||
|
|
||||||
# Get pool info for a BSC token
|
# Get pool info for a BSC token
|
||||||
gmgn-cli token pool --chain bsc --address 0x2170Ed0880ac9A755fd29B2688956BD959F933F8
|
gmgn-cli token pool --chain bsc --address 0x2170Ed0880ac9A755fd29B2688956BD959F933F8
|
||||||
|
|
||||||
|
# Get pool info for an ETH token
|
||||||
|
gmgn-cli token pool --chain eth --address 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
|
||||||
```
|
```
|
||||||
|
|
||||||
### `token holders` — Analyze Holder Distribution
|
### `token holders` — Analyze Holder Distribution
|
||||||
@@ -503,6 +520,10 @@ gmgn-cli token holders --chain sol --address EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGG
|
|||||||
gmgn-cli token holders --chain bsc --address 0x2170Ed0880ac9A755fd29B2688956BD959F933F8 \
|
gmgn-cli token holders --chain bsc --address 0x2170Ed0880ac9A755fd29B2688956BD959F933F8 \
|
||||||
--tag renowned --order-by profit --direction desc --limit 50
|
--tag renowned --order-by profit --direction desc --limit 50
|
||||||
|
|
||||||
|
# ETH token holders — smart money by supply percentage
|
||||||
|
gmgn-cli token holders --chain eth --address 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2 \
|
||||||
|
--tag smart_degen --order-by amount_percentage --direction desc --limit 20
|
||||||
|
|
||||||
# Raw output for downstream analysis
|
# Raw output for downstream analysis
|
||||||
gmgn-cli token holders --chain sol --address EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v \
|
gmgn-cli token holders --chain sol --address EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v \
|
||||||
--limit 100 --raw
|
--limit 100 --raw
|
||||||
@@ -551,6 +572,10 @@ gmgn-cli token traders --chain sol --address EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGG
|
|||||||
# BSC token traders by profit
|
# BSC token traders by profit
|
||||||
gmgn-cli token traders --chain bsc --address 0x2170Ed0880ac9A755fd29B2688956BD959F933F8 \
|
gmgn-cli token traders --chain bsc --address 0x2170Ed0880ac9A755fd29B2688956BD959F933F8 \
|
||||||
--tag smart_degen --order-by profit --direction desc --limit 50
|
--tag smart_degen --order-by profit --direction desc --limit 50
|
||||||
|
|
||||||
|
# ETH token traders by profit
|
||||||
|
gmgn-cli token traders --chain eth --address 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2 \
|
||||||
|
--tag smart_degen --order-by profit --direction desc --limit 50
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
name: gmgn-track
|
name: gmgn-track
|
||||||
description: Query GMGN on-chain tracking data — follow-wallet trade records, KOL trades, and Smart Money trades. Supports sol / bsc / base.
|
description: Get real-time crypto buy/sell activity from Smart Money wallets, KOL influencer wallets, and personally followed wallets via GMGN API — alpha signals, whale tracking, meme token copy-trading ideas on Solana, BSC, Base, or Ethereum. Use when user asks what smart money or KOLs are buying, wants whale alerts, on-chain alpha, or copy-trade signals. (For a specific wallet address, use gmgn-portfolio.)
|
||||||
argument-hint: "<follow-wallet|kol|smartmoney> [--chain <sol|bsc|base>] [--wallet <wallet_address>]"
|
argument-hint: "<follow-wallet|kol|smartmoney> --chain <sol|bsc|base|eth> [--wallet <wallet_address>]"
|
||||||
metadata:
|
metadata:
|
||||||
cliHelp: "gmgn-cli track --help"
|
cliHelp: "gmgn-cli track --help"
|
||||||
---
|
---
|
||||||
@@ -55,12 +55,13 @@ Use the `gmgn-cli` tool to query on-chain tracking data based on the user's requ
|
|||||||
|
|
||||||
## Supported Chains
|
## Supported Chains
|
||||||
|
|
||||||
`sol` / `bsc` / `base`
|
`sol` / `bsc` / `base` / `eth`
|
||||||
|
|
||||||
## Prerequisites
|
## Prerequisites
|
||||||
|
|
||||||
- `gmgn-cli` installed globally — if missing, run: `npm install -g gmgn-cli`
|
- `gmgn-cli` installed globally — if missing, run: `npm install -g gmgn-cli`
|
||||||
- `GMGN_API_KEY` configured in `~/.config/gmgn/.env` — required for all sub-commands; no private key needed
|
- `GMGN_API_KEY` configured in `~/.config/gmgn/.env` — required for all sub-commands
|
||||||
|
- `GMGN_PRIVATE_KEY` — required for `track follow-wallet` only (critical auth); not needed for `kol` or `smartmoney`
|
||||||
|
|
||||||
## Rate Limit Handling
|
## Rate Limit Handling
|
||||||
|
|
||||||
@@ -88,11 +89,13 @@ When a request returns `429`:
|
|||||||
```
|
```
|
||||||
Tell the user: *"This is your Ed25519 public key. Go to **https://gmgn.ai/ai**, paste it into the API key creation form, then send me the API Key value shown on the page."*
|
Tell the user: *"This is your Ed25519 public key. Go to **https://gmgn.ai/ai**, paste it into the API key creation form, then send me the API Key value shown on the page."*
|
||||||
|
|
||||||
2. Wait for the user's API key, then configure:
|
2. Wait for the user's API key, then configure (saves both API key and private key — private key is required for `track follow-wallet`):
|
||||||
```bash
|
```bash
|
||||||
mkdir -p ~/.config/gmgn
|
mkdir -p ~/.config/gmgn
|
||||||
echo 'GMGN_API_KEY=<key_from_user>' > ~/.config/gmgn/.env
|
echo "GMGN_API_KEY=<key_from_user>" > ~/.config/gmgn/.env
|
||||||
|
echo "GMGN_PRIVATE_KEY=$(awk '{printf "%s\\n", $0}' /tmp/gmgn_private.pem)" >> ~/.config/gmgn/.env
|
||||||
chmod 600 ~/.config/gmgn/.env
|
chmod 600 ~/.config/gmgn/.env
|
||||||
|
rm /tmp/gmgn_private.pem
|
||||||
```
|
```
|
||||||
|
|
||||||
## Usage Examples
|
## Usage Examples
|
||||||
@@ -127,7 +130,7 @@ gmgn-cli track smartmoney --chain sol --side sell --limit 10 --raw
|
|||||||
|
|
||||||
| Option | Description |
|
| Option | Description |
|
||||||
|--------|-------------|
|
|--------|-------------|
|
||||||
| `--chain` | Required. `sol` / `bsc` / `base` |
|
| `--chain` | Required. `sol` / `bsc` / `base` / `eth` |
|
||||||
| `--wallet <address>` | Filter by wallet address |
|
| `--wallet <address>` | Filter by wallet address |
|
||||||
| `--limit <n>` | Page size (1–100, default 10) |
|
| `--limit <n>` | Page size (1–100, default 10) |
|
||||||
| `--side <side>` | Trade direction: `buy` / `sell` |
|
| `--side <side>` | Trade direction: `buy` / `sell` |
|
||||||
@@ -139,7 +142,7 @@ gmgn-cli track smartmoney --chain sol --side sell --limit 10 --raw
|
|||||||
|
|
||||||
| Option | Description |
|
| Option | Description |
|
||||||
|--------|-------------|
|
|--------|-------------|
|
||||||
| `--chain <chain>` | Chain: `sol` / `bsc` / `base` (default `sol`) |
|
| `--chain <chain>` | Required. Chain: `sol` / `bsc` / `base` / `eth` |
|
||||||
| `--limit <n>` | Page size (1–200, default 100) |
|
| `--limit <n>` | Page size (1–200, default 100) |
|
||||||
| `--side <side>` | Filter by trade direction: `buy` / `sell` (client-side filter — applied locally after fetching results) |
|
| `--side <side>` | Filter by trade direction: `buy` / `sell` (client-side filter — applied locally after fetching results) |
|
||||||
|
|
||||||
@@ -308,7 +311,7 @@ To research any token surfaced by smart money activity, follow [`docs/workflow-t
|
|||||||
|
|
||||||
## Notes
|
## Notes
|
||||||
|
|
||||||
- All sub-commands use normal auth (API Key only, no signature required)
|
- `track follow-wallet` uses critical auth (API Key + private key signature); `track kol` and `track smartmoney` use normal auth (API Key only)
|
||||||
- `track follow-wallet` returns trades from wallets followed on the GMGN platform; the follow list is resolved automatically from the GMGN user account bound to the API Key — `--wallet` is optional
|
- `track follow-wallet` returns trades from wallets followed on the GMGN platform; the follow list is resolved automatically from the GMGN user account bound to the API Key — `--wallet` is optional
|
||||||
- Use `--raw` to get single-line JSON for further processing
|
- 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
|
- `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
|
||||||
|
|||||||
@@ -156,6 +156,18 @@ export interface StrategyCancelParams {
|
|||||||
close_sell_model?: string;
|
close_sell_model?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface TokenSignalGroup {
|
||||||
|
signal_type?: number[];
|
||||||
|
mc_min?: number;
|
||||||
|
mc_max?: number;
|
||||||
|
trigger_mc_min?: number;
|
||||||
|
trigger_mc_max?: number;
|
||||||
|
total_fee_min?: number;
|
||||||
|
total_fee_max?: number;
|
||||||
|
min_create_or_open_ts?: string;
|
||||||
|
max_create_or_open_ts?: string;
|
||||||
|
}
|
||||||
|
|
||||||
export interface CreateTokenParams {
|
export interface CreateTokenParams {
|
||||||
chain: string;
|
chain: string;
|
||||||
dex: string;
|
dex: string;
|
||||||
@@ -284,6 +296,10 @@ export class OpenApiClient {
|
|||||||
return this.normalRequest("GET", "/v1/market/rank", { chain, interval, ...extra });
|
return this.normalRequest("GET", "/v1/market/rank", { chain, interval, ...extra });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async getTokenSignalV2(chain: string, groups: TokenSignalGroup[]): Promise<unknown> {
|
||||||
|
return this.normalRequest("POST", "/v1/market/token_signal", {}, { chain, groups });
|
||||||
|
}
|
||||||
|
|
||||||
// ---- User endpoints (normal auth) ----
|
// ---- User endpoints (normal auth) ----
|
||||||
|
|
||||||
async getUserInfo(): Promise<unknown> {
|
async getUserInfo(): Promise<unknown> {
|
||||||
@@ -291,7 +307,7 @@ export class OpenApiClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getFollowWallet(chain: string, extra: Record<string, string | number | string[]> = {}): Promise<unknown> {
|
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(chain?: string, limit?: number): Promise<unknown> {
|
async getKol(chain?: string, limit?: number): Promise<unknown> {
|
||||||
@@ -393,16 +409,16 @@ export class OpenApiClient {
|
|||||||
private async criticalRequest(
|
private async criticalRequest(
|
||||||
method: string,
|
method: string,
|
||||||
subPath: string,
|
subPath: string,
|
||||||
queryExtra: Record<string, string | number>,
|
queryExtra: Record<string, string | number | string[]>,
|
||||||
body: unknown
|
body: unknown
|
||||||
): Promise<unknown> {
|
): Promise<unknown> {
|
||||||
if (!this.privateKeyPem) {
|
if (!this.privateKeyPem) {
|
||||||
throw new Error("GMGN_PRIVATE_KEY is required for critical-auth commands (swap and all order commands)");
|
throw new Error("GMGN_PRIVATE_KEY is required for critical-auth commands (swap, order, and follow-wallet commands)");
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.executePreparedRequest(() => {
|
return this.executePreparedRequest(() => {
|
||||||
const { timestamp, client_id } = buildAuthQuery();
|
const { timestamp, client_id } = buildAuthQuery();
|
||||||
const query: Record<string, string | number> = { ...queryExtra, timestamp, client_id };
|
const query: Record<string, string | number | string[]> = { ...queryExtra, timestamp, client_id };
|
||||||
const bodyStr = body !== null ? JSON.stringify(body) : "";
|
const bodyStr = body !== null ? JSON.stringify(body) : "";
|
||||||
const message = buildMessage(subPath, query, bodyStr, timestamp);
|
const message = buildMessage(subPath, query, bodyStr, timestamp);
|
||||||
const signature = sign(message, this.privateKeyPem!, detectAlgorithm(this.privateKeyPem!));
|
const signature = sign(message, this.privateKeyPem!, detectAlgorithm(this.privateKeyPem!));
|
||||||
|
|||||||
+10
-3
@@ -32,17 +32,24 @@ export function buildAuthQuery(): { timestamp: number; client_id: string } {
|
|||||||
/**
|
/**
|
||||||
* Build the signature message (critical auth)
|
* Build the signature message (critical auth)
|
||||||
* Format: {sub_path}:{sorted_query_string}:{request_body}:{timestamp}
|
* Format: {sub_path}:{sorted_query_string}:{request_body}:{timestamp}
|
||||||
* sorted_query_string: all query params (including timestamp, client_id) sorted alphabetically by key
|
* sorted_query_string: all query params (including timestamp, client_id) sorted alphabetically by key.
|
||||||
|
* Array values are serialized as repeated k=v pairs (same as buildUrl / URLSearchParams), sorted by value.
|
||||||
*/
|
*/
|
||||||
export function buildMessage(
|
export function buildMessage(
|
||||||
subPath: string,
|
subPath: string,
|
||||||
queryParams: Record<string, string | number>,
|
queryParams: Record<string, string | number | string[]>,
|
||||||
body: string,
|
body: string,
|
||||||
timestamp: number
|
timestamp: number
|
||||||
): string {
|
): string {
|
||||||
const sortedQs = Object.keys(queryParams)
|
const sortedQs = Object.keys(queryParams)
|
||||||
.sort()
|
.sort()
|
||||||
.map((k) => `${k}=${queryParams[k]}`)
|
.flatMap((k) => {
|
||||||
|
const v = queryParams[k];
|
||||||
|
if (Array.isArray(v)) {
|
||||||
|
return [...v].sort().map((item) => `${k}=${item}`);
|
||||||
|
}
|
||||||
|
return [`${k}=${v}`];
|
||||||
|
})
|
||||||
.join("&");
|
.join("&");
|
||||||
return `${subPath}:${sortedQs}:${body}:${timestamp}`;
|
return `${subPath}:${sortedQs}:${body}:${timestamp}`;
|
||||||
}
|
}
|
||||||
|
|||||||
+74
-6
@@ -1,16 +1,32 @@
|
|||||||
import { Command } from "commander";
|
import { Command } from "commander";
|
||||||
import { OpenApiClient } from "../client/OpenApiClient.js";
|
import { OpenApiClient, TokenSignalGroup } from "../client/OpenApiClient.js";
|
||||||
import { getConfig } from "../config.js";
|
import { getConfig } from "../config.js";
|
||||||
import { exitOnError, printResult } from "../output.js";
|
import { exitOnError, printResult } from "../output.js";
|
||||||
import { validateAddress, validateChain } from "../validate.js";
|
import { validateAddress, validateChain } from "../validate.js";
|
||||||
|
|
||||||
|
// Parse token age string. If a unit suffix is present (s/m), use it as-is.
|
||||||
|
// Bare numbers (no unit) are treated as minutes with a warning.
|
||||||
|
function parseDuration(value: string): string {
|
||||||
|
if (/^\d+(\.\d+)?[sm]$/.test(value)) return value;
|
||||||
|
if (/^\d+(\.\d+)?$/.test(value)) {
|
||||||
|
console.warn(
|
||||||
|
`[gmgn-cli] Warning: no unit specified for duration "${value}" — treating as minutes (${value}m). Use a suffix to be explicit: ${value}s for seconds or ${value}m for minutes.`
|
||||||
|
);
|
||||||
|
return `${value}m`;
|
||||||
|
}
|
||||||
|
console.error(
|
||||||
|
`[gmgn-cli] Invalid duration "${value}". Use seconds (e.g. 30s) or minutes (e.g. 0.5m / 1m / 5m).`
|
||||||
|
);
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
export function registerMarketCommands(program: Command): void {
|
export function registerMarketCommands(program: Command): void {
|
||||||
const market = program.command("market").description("Market data commands");
|
const market = program.command("market").description("Market data commands");
|
||||||
|
|
||||||
market
|
market
|
||||||
.command("kline")
|
.command("kline")
|
||||||
.description("Get token K-line (candlestick) data")
|
.description("Get token K-line (candlestick) data")
|
||||||
.requiredOption("--chain <chain>", "Chain: sol / bsc / base")
|
.requiredOption("--chain <chain>", "Chain: sol / bsc / base / eth")
|
||||||
.requiredOption("--address <address>", "Token contract address")
|
.requiredOption("--address <address>", "Token contract address")
|
||||||
.requiredOption("--resolution <resolution>", "Candlestick resolution: 1m / 5m / 15m / 1h / 4h / 1d")
|
.requiredOption("--resolution <resolution>", "Candlestick resolution: 1m / 5m / 15m / 1h / 4h / 1d")
|
||||||
.option("--from <timestamp>", "Start time (Unix seconds)", parseInt)
|
.option("--from <timestamp>", "Start time (Unix seconds)", parseInt)
|
||||||
@@ -35,7 +51,7 @@ export function registerMarketCommands(program: Command): void {
|
|||||||
market
|
market
|
||||||
.command("trending")
|
.command("trending")
|
||||||
.description("Get trending token swap data")
|
.description("Get trending token swap data")
|
||||||
.requiredOption("--chain <chain>", "Chain: sol / bsc / base")
|
.requiredOption("--chain <chain>", "Chain: sol / bsc / base / eth")
|
||||||
.requiredOption("--interval <interval>", "Time interval: 1m / 5m / 1h / 6h / 24h")
|
.requiredOption("--interval <interval>", "Time interval: 1m / 5m / 1h / 6h / 24h")
|
||||||
.option("--limit <n>", "Number of results (default 100, max 100)", parseInt)
|
.option("--limit <n>", "Number of results (default 100, max 100)", parseInt)
|
||||||
.option("--order-by <field>", "Sort field: default / volume / swaps / marketcap / holder_count / price / change1h / ... (see docs for full list)")
|
.option("--order-by <field>", "Sort field: default / volume / swaps / marketcap / holder_count / price / change1h / ... (see docs for full list)")
|
||||||
@@ -76,6 +92,8 @@ export function registerMarketCommands(program: Command): void {
|
|||||||
trenchesCmd.option(`--${flag} <${def.type}>`, def.desc, parseInt);
|
trenchesCmd.option(`--${flag} <${def.type}>`, def.desc, parseInt);
|
||||||
} else if (def.type === "float") {
|
} else if (def.type === "float") {
|
||||||
trenchesCmd.option(`--${flag} <${def.type}>`, def.desc, parseFloat);
|
trenchesCmd.option(`--${flag} <${def.type}>`, def.desc, parseFloat);
|
||||||
|
} else if (def.type === "duration") {
|
||||||
|
trenchesCmd.option(`--${flag} <duration>`, def.desc, parseDuration);
|
||||||
} else {
|
} else {
|
||||||
trenchesCmd.option(`--${flag} <value>`, def.desc);
|
trenchesCmd.option(`--${flag} <value>`, def.desc);
|
||||||
}
|
}
|
||||||
@@ -115,11 +133,61 @@ export function registerMarketCommands(program: Command): void {
|
|||||||
: data;
|
: data;
|
||||||
printResult(result, opts.raw);
|
printResult(result, opts.raw);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
market
|
||||||
|
.command("signal")
|
||||||
|
.description("Query token signals (price spikes, smart money buys, large buys, etc.) — max 50 results per group")
|
||||||
|
.requiredOption("--chain <chain>", "Chain: sol / bsc")
|
||||||
|
.option("--signal-type <n...>", "Signal type(s), repeatable: 1–18 (default: all types)", (v: string, acc: number[]) => { acc.push(parseInt(v, 10)); return acc; }, [] as number[])
|
||||||
|
.option("--mc-min <usd>", "Min market cap at trigger time (USD)", parseFloat)
|
||||||
|
.option("--mc-max <usd>", "Max market cap at trigger time (USD)", parseFloat)
|
||||||
|
.option("--trigger-mc-min <usd>", "Min market cap at signal trigger (USD)", parseFloat)
|
||||||
|
.option("--trigger-mc-max <usd>", "Max market cap at signal trigger (USD)", parseFloat)
|
||||||
|
.option("--total-fee-min <usd>", "Min total fees paid (USD)", parseFloat)
|
||||||
|
.option("--total-fee-max <usd>", "Max total fees paid (USD)", parseFloat)
|
||||||
|
.option("--min-create-or-open-ts <ts>", "Min token creation or open timestamp (Unix seconds string)")
|
||||||
|
.option("--max-create-or-open-ts <ts>", "Max token creation or open timestamp (Unix seconds string)")
|
||||||
|
.option("--groups <json>", "Multi-group override: JSON array of group objects — overrides all individual flags when provided")
|
||||||
|
.option("--raw", "Output raw JSON")
|
||||||
|
.action(async (opts: Record<string, unknown>) => {
|
||||||
|
validateChain(opts["chain"] as string);
|
||||||
|
if (!["sol", "bsc"].includes(opts["chain"] as string)) {
|
||||||
|
console.error(`[gmgn-cli] market signal only supports sol and bsc, got "${opts["chain"]}"`);
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
let groups: TokenSignalGroup[];
|
||||||
|
if (opts["groups"] != null) {
|
||||||
|
try {
|
||||||
|
groups = JSON.parse(opts["groups"] as string) as TokenSignalGroup[];
|
||||||
|
} catch {
|
||||||
|
console.error(`[gmgn-cli] --groups must be a valid JSON array, e.g. '[{"signal_type":[12,14]},{"signal_type":[6,7],"mc_min":50000}]'`);
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
const group: TokenSignalGroup = {};
|
||||||
|
const signalType = opts["signalType"] as number[] | undefined;
|
||||||
|
if (signalType?.length) group.signal_type = signalType;
|
||||||
|
if (opts["mcMin"] != null) group.mc_min = opts["mcMin"] as number;
|
||||||
|
if (opts["mcMax"] != null) group.mc_max = opts["mcMax"] as number;
|
||||||
|
if (opts["triggerMcMin"] != null) group.trigger_mc_min = opts["triggerMcMin"] as number;
|
||||||
|
if (opts["triggerMcMax"] != null) group.trigger_mc_max = opts["triggerMcMax"] as number;
|
||||||
|
if (opts["totalFeeMin"] != null) group.total_fee_min = opts["totalFeeMin"] as number;
|
||||||
|
if (opts["totalFeeMax"] != null) group.total_fee_max = opts["totalFeeMax"] as number;
|
||||||
|
if (opts["minCreateOrOpenTs"] != null) group.min_create_or_open_ts = opts["minCreateOrOpenTs"] as string;
|
||||||
|
if (opts["maxCreateOrOpenTs"] != null) group.max_create_or_open_ts = opts["maxCreateOrOpenTs"] as string;
|
||||||
|
groups = [group];
|
||||||
|
}
|
||||||
|
|
||||||
|
const client = new OpenApiClient(getConfig());
|
||||||
|
const data = await client.getTokenSignalV2(opts["chain"] as string, groups).catch(exitOnError);
|
||||||
|
printResult(data, opts["raw"] as boolean | undefined);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---- Trenches filter field definitions ----
|
// ---- Trenches filter field definitions ----
|
||||||
|
|
||||||
type TrenchesFieldType = "int" | "float" | "string";
|
type TrenchesFieldType = "int" | "float" | "string" | "duration";
|
||||||
|
|
||||||
interface TrenchesFilterField {
|
interface TrenchesFilterField {
|
||||||
api: string;
|
api: string;
|
||||||
@@ -151,8 +219,8 @@ const TRENCHES_FILTER_FIELDS: TrenchesFilterField[] = [
|
|||||||
{ api: "min_liquidity", type: "float", desc: "Min liquidity (USD)" },
|
{ api: "min_liquidity", type: "float", desc: "Min liquidity (USD)" },
|
||||||
{ api: "max_liquidity", type: "float", desc: "Max liquidity (USD)" },
|
{ api: "max_liquidity", type: "float", desc: "Max liquidity (USD)" },
|
||||||
// Token age
|
// Token age
|
||||||
{ api: "min_created", type: "string", desc: "Min token age (e.g. 1m / 5m / 30m / 1h / 6h / 24h)" },
|
{ api: "min_created", type: "duration", desc: "Min token age — unit recommended: seconds (e.g. 30s) or minutes (e.g. 0.5m / 1m / 5m / 30m). Bare numbers treated as minutes." },
|
||||||
{ api: "max_created", type: "string", desc: "Max token age (e.g. 1m / 5m / 30m / 1h / 6h / 24h)" },
|
{ api: "max_created", type: "duration", desc: "Max token age — unit recommended: seconds (e.g. 30s) or minutes (e.g. 0.5m / 1m / 5m / 30m). Bare numbers treated as minutes." },
|
||||||
// Holders
|
// Holders
|
||||||
{ api: "min_holder_count", type: "int", desc: "Min holder count" },
|
{ api: "min_holder_count", type: "int", desc: "Min holder count" },
|
||||||
{ api: "max_holder_count", type: "int", desc: "Max holder count" },
|
{ api: "max_holder_count", type: "int", desc: "Max holder count" },
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ export function registerPortfolioCommands(program: Command): void {
|
|||||||
portfolio
|
portfolio
|
||||||
.command("holdings")
|
.command("holdings")
|
||||||
.description("Get wallet token holdings")
|
.description("Get wallet token holdings")
|
||||||
.requiredOption("--chain <chain>", "Chain: sol / bsc / base")
|
.requiredOption("--chain <chain>", "Chain: sol / bsc / base / eth")
|
||||||
.requiredOption("--wallet <address>", "Wallet address")
|
.requiredOption("--wallet <address>", "Wallet address")
|
||||||
.option("--limit <n>", "Page size (default 20, max 50)", parseInt, 20)
|
.option("--limit <n>", "Page size (default 20, max 50)", parseInt, 20)
|
||||||
.option("--cursor <cursor>", "Pagination cursor")
|
.option("--cursor <cursor>", "Pagination cursor")
|
||||||
@@ -46,7 +46,7 @@ export function registerPortfolioCommands(program: Command): void {
|
|||||||
portfolio
|
portfolio
|
||||||
.command("activity")
|
.command("activity")
|
||||||
.description("Get wallet transaction activity")
|
.description("Get wallet transaction activity")
|
||||||
.requiredOption("--chain <chain>", "Chain: sol / bsc / base")
|
.requiredOption("--chain <chain>", "Chain: sol / bsc / base / eth")
|
||||||
.requiredOption("--wallet <address>", "Wallet address")
|
.requiredOption("--wallet <address>", "Wallet address")
|
||||||
.option("--token <address>", "Filter by token contract address")
|
.option("--token <address>", "Filter by token contract address")
|
||||||
.option("--limit <n>", "Page size", parseInt)
|
.option("--limit <n>", "Page size", parseInt)
|
||||||
@@ -71,7 +71,7 @@ export function registerPortfolioCommands(program: Command): void {
|
|||||||
portfolio
|
portfolio
|
||||||
.command("stats")
|
.command("stats")
|
||||||
.description("Get wallet trading statistics (supports multiple wallets)")
|
.description("Get wallet trading statistics (supports multiple wallets)")
|
||||||
.requiredOption("--chain <chain>", "Chain: sol / bsc / base")
|
.requiredOption("--chain <chain>", "Chain: sol / bsc / base / eth")
|
||||||
.requiredOption("--wallet <address...>", "Wallet address(es), repeatable")
|
.requiredOption("--wallet <address...>", "Wallet address(es), repeatable")
|
||||||
.option("--period <period>", "Stats period: 7d / 30d", "7d")
|
.option("--period <period>", "Stats period: 7d / 30d", "7d")
|
||||||
.option("--raw", "Output raw JSON")
|
.option("--raw", "Output raw JSON")
|
||||||
@@ -96,7 +96,7 @@ export function registerPortfolioCommands(program: Command): void {
|
|||||||
portfolio
|
portfolio
|
||||||
.command("token-balance")
|
.command("token-balance")
|
||||||
.description("Get wallet token balance for a single token")
|
.description("Get wallet token balance for a single token")
|
||||||
.requiredOption("--chain <chain>", "Chain: sol / bsc / base")
|
.requiredOption("--chain <chain>", "Chain: sol / bsc / base / eth")
|
||||||
.requiredOption("--wallet <address>", "Wallet address")
|
.requiredOption("--wallet <address>", "Wallet address")
|
||||||
.requiredOption("--token <address>", "Token contract address")
|
.requiredOption("--token <address>", "Token contract address")
|
||||||
.option("--raw", "Output raw JSON")
|
.option("--raw", "Output raw JSON")
|
||||||
@@ -112,7 +112,7 @@ export function registerPortfolioCommands(program: Command): void {
|
|||||||
portfolio
|
portfolio
|
||||||
.command("created-tokens")
|
.command("created-tokens")
|
||||||
.description("Get tokens created by a developer wallet")
|
.description("Get tokens created by a developer wallet")
|
||||||
.requiredOption("--chain <chain>", "Chain: sol / bsc / base")
|
.requiredOption("--chain <chain>", "Chain: sol / bsc / base / eth")
|
||||||
.requiredOption("--wallet <address>", "Developer wallet address")
|
.requiredOption("--wallet <address>", "Developer wallet address")
|
||||||
.option("--order-by <field>", "Sort field: market_cap / token_ath_mc")
|
.option("--order-by <field>", "Sort field: market_cap / token_ath_mc")
|
||||||
.option("--direction <dir>", "Sort direction: asc / desc")
|
.option("--direction <dir>", "Sort direction: asc / desc")
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ export function registerSwapCommands(program: Command): void {
|
|||||||
program
|
program
|
||||||
.command("swap")
|
.command("swap")
|
||||||
.description("Submit a token swap")
|
.description("Submit a token swap")
|
||||||
.requiredOption("--chain <chain>", "Chain: sol / bsc / base / eth ")
|
.requiredOption("--chain <chain>", "Chain: sol / bsc / base / eth")
|
||||||
.requiredOption("--from <address>", "Wallet address (must match API Key binding)")
|
.requiredOption("--from <address>", "Wallet address (must match API Key binding)")
|
||||||
.requiredOption("--input-token <address>", "Input token contract address")
|
.requiredOption("--input-token <address>", "Input token contract address")
|
||||||
.requiredOption("--output-token <address>", "Output token contract address")
|
.requiredOption("--output-token <address>", "Output token contract address")
|
||||||
@@ -76,7 +76,7 @@ export function registerSwapCommands(program: Command): void {
|
|||||||
order
|
order
|
||||||
.command("quote")
|
.command("quote")
|
||||||
.description("Get a swap quote without submitting a transaction (requires critical auth)")
|
.description("Get a swap quote without submitting a transaction (requires critical auth)")
|
||||||
.requiredOption("--chain <chain>", "Chain: sol / bsc / base (requires GMGN_PRIVATE_KEY)")
|
.requiredOption("--chain <chain>", "Chain: sol / bsc / base / eth (requires GMGN_PRIVATE_KEY)")
|
||||||
.requiredOption("--from <address>", "Wallet address (must match API Key binding)")
|
.requiredOption("--from <address>", "Wallet address (must match API Key binding)")
|
||||||
.requiredOption("--input-token <address>", "Input token contract address")
|
.requiredOption("--input-token <address>", "Input token contract address")
|
||||||
.requiredOption("--output-token <address>", "Output token contract address")
|
.requiredOption("--output-token <address>", "Output token contract address")
|
||||||
@@ -112,7 +112,7 @@ export function registerSwapCommands(program: Command): void {
|
|||||||
program
|
program
|
||||||
.command("multi-swap")
|
.command("multi-swap")
|
||||||
.description("Submit token swaps across multiple wallets concurrently (up to 100 wallets)")
|
.description("Submit token swaps across multiple wallets concurrently (up to 100 wallets)")
|
||||||
.requiredOption("--chain <chain>", "Chain: sol / bsc / base")
|
.requiredOption("--chain <chain>", "Chain: sol / bsc / base / eth")
|
||||||
.requiredOption("--accounts <addresses>", "Comma-separated wallet addresses (all must be bound to the API Key)")
|
.requiredOption("--accounts <addresses>", "Comma-separated wallet addresses (all must be bound to the API Key)")
|
||||||
.requiredOption("--input-token <address>", "Input token contract address")
|
.requiredOption("--input-token <address>", "Input token contract address")
|
||||||
.requiredOption("--output-token <address>", "Output token contract address")
|
.requiredOption("--output-token <address>", "Output token contract address")
|
||||||
@@ -186,7 +186,7 @@ export function registerSwapCommands(program: Command): void {
|
|||||||
strategy
|
strategy
|
||||||
.command("create")
|
.command("create")
|
||||||
.description("Create a limit/strategy order (requires private key)")
|
.description("Create a limit/strategy order (requires private key)")
|
||||||
.requiredOption("--chain <chain>", "Chain: sol / bsc / base")
|
.requiredOption("--chain <chain>", "Chain: sol / bsc / base / eth")
|
||||||
.requiredOption("--from <address>", "Wallet address (must match API Key binding)")
|
.requiredOption("--from <address>", "Wallet address (must match API Key binding)")
|
||||||
.requiredOption("--base-token <address>", "Base token contract address")
|
.requiredOption("--base-token <address>", "Base token contract address")
|
||||||
.requiredOption("--quote-token <address>", "Quote token contract address")
|
.requiredOption("--quote-token <address>", "Quote token contract address")
|
||||||
@@ -243,7 +243,7 @@ export function registerSwapCommands(program: Command): void {
|
|||||||
strategy
|
strategy
|
||||||
.command("list")
|
.command("list")
|
||||||
.description("List strategy orders (requires private key)")
|
.description("List strategy orders (requires private key)")
|
||||||
.requiredOption("--chain <chain>", "Chain: sol / bsc / base")
|
.requiredOption("--chain <chain>", "Chain: sol / bsc / base / eth")
|
||||||
.option("--type <type>", "open (default) / history")
|
.option("--type <type>", "open (default) / history")
|
||||||
.option("--from <address>", "Filter by wallet address")
|
.option("--from <address>", "Filter by wallet address")
|
||||||
.option("--group-tag <tag>", "Filter by group: LimitOrder / STMix")
|
.option("--group-tag <tag>", "Filter by group: LimitOrder / STMix")
|
||||||
@@ -268,7 +268,7 @@ export function registerSwapCommands(program: Command): void {
|
|||||||
strategy
|
strategy
|
||||||
.command("cancel")
|
.command("cancel")
|
||||||
.description("Cancel a strategy order (requires private key)")
|
.description("Cancel a strategy order (requires private key)")
|
||||||
.requiredOption("--chain <chain>", "Chain: sol / bsc / base")
|
.requiredOption("--chain <chain>", "Chain: sol / bsc / base / eth")
|
||||||
.requiredOption("--from <address>", "Wallet address (must match API Key binding)")
|
.requiredOption("--from <address>", "Wallet address (must match API Key binding)")
|
||||||
.requiredOption("--order-id <id>", "Order ID to cancel")
|
.requiredOption("--order-id <id>", "Order ID to cancel")
|
||||||
.option("--order-type <type>", "Order type: limit_order / smart_trade")
|
.option("--order-type <type>", "Order type: limit_order / smart_trade")
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ export function registerTokenCommands(program: Command): void {
|
|||||||
token
|
token
|
||||||
.command("info")
|
.command("info")
|
||||||
.description("Get token basic information and realtime price")
|
.description("Get token basic information and realtime price")
|
||||||
.requiredOption("--chain <chain>", "Chain: sol / bsc / base")
|
.requiredOption("--chain <chain>", "Chain: sol / bsc / base / eth")
|
||||||
.requiredOption("--address <address>", "Token contract address")
|
.requiredOption("--address <address>", "Token contract address")
|
||||||
.option("--raw", "Output raw JSON")
|
.option("--raw", "Output raw JSON")
|
||||||
.action(async (opts) => {
|
.action(async (opts) => {
|
||||||
@@ -24,7 +24,7 @@ export function registerTokenCommands(program: Command): void {
|
|||||||
token
|
token
|
||||||
.command("security")
|
.command("security")
|
||||||
.description("Get token security metrics")
|
.description("Get token security metrics")
|
||||||
.requiredOption("--chain <chain>", "Chain: sol / bsc / base")
|
.requiredOption("--chain <chain>", "Chain: sol / bsc / base / eth")
|
||||||
.requiredOption("--address <address>", "Token contract address")
|
.requiredOption("--address <address>", "Token contract address")
|
||||||
.option("--raw", "Output raw JSON")
|
.option("--raw", "Output raw JSON")
|
||||||
.action(async (opts) => {
|
.action(async (opts) => {
|
||||||
@@ -38,7 +38,7 @@ export function registerTokenCommands(program: Command): void {
|
|||||||
token
|
token
|
||||||
.command("pool")
|
.command("pool")
|
||||||
.description("Get token liquidity pool information")
|
.description("Get token liquidity pool information")
|
||||||
.requiredOption("--chain <chain>", "Chain: sol / bsc / base")
|
.requiredOption("--chain <chain>", "Chain: sol / bsc / base / eth")
|
||||||
.requiredOption("--address <address>", "Token contract address")
|
.requiredOption("--address <address>", "Token contract address")
|
||||||
.option("--raw", "Output raw JSON")
|
.option("--raw", "Output raw JSON")
|
||||||
.action(async (opts) => {
|
.action(async (opts) => {
|
||||||
@@ -52,12 +52,12 @@ export function registerTokenCommands(program: Command): void {
|
|||||||
token
|
token
|
||||||
.command("holders")
|
.command("holders")
|
||||||
.description("Get top token holders")
|
.description("Get top token holders")
|
||||||
.requiredOption("--chain <chain>", "Chain: sol / bsc / base")
|
.requiredOption("--chain <chain>", "Chain: sol / bsc / base / eth")
|
||||||
.requiredOption("--address <address>", "Token contract address")
|
.requiredOption("--address <address>", "Token contract address")
|
||||||
.option("--limit <n>", "Number of results (default 20, max 100)", parseInt)
|
.option("--limit <n>", "Number of results (default 20, max 100)", parseInt)
|
||||||
.option("--order-by <field>", "Sort field: amount_percentage / profit / unrealized_profit / buy_volume_cur / sell_volume_cur", "amount_percentage")
|
.option("--order-by <field>", "Sort field: amount_percentage / profit / unrealized_profit / buy_volume_cur / sell_volume_cur", "amount_percentage")
|
||||||
.option("--direction <dir>", "Sort direction: asc / desc", "desc")
|
.option("--direction <dir>", "Sort direction: asc / desc", "desc")
|
||||||
.option("--tag <tag>", "Wallet tag filter: renowned / smart_degen")
|
.option("--tag <tag>", "Wallet tag filter: smart_degen / renowned / fresh_wallet / dev / sniper / rat_trader / bundler / transfer_in / dex_bot / bluechip_owner")
|
||||||
.option("--raw", "Output raw JSON")
|
.option("--raw", "Output raw JSON")
|
||||||
.action(async (opts) => {
|
.action(async (opts) => {
|
||||||
validateChain(opts.chain);
|
validateChain(opts.chain);
|
||||||
@@ -75,12 +75,12 @@ export function registerTokenCommands(program: Command): void {
|
|||||||
token
|
token
|
||||||
.command("traders")
|
.command("traders")
|
||||||
.description("Get top token traders")
|
.description("Get top token traders")
|
||||||
.requiredOption("--chain <chain>", "Chain: sol / bsc / base")
|
.requiredOption("--chain <chain>", "Chain: sol / bsc / base / eth")
|
||||||
.requiredOption("--address <address>", "Token contract address")
|
.requiredOption("--address <address>", "Token contract address")
|
||||||
.option("--limit <n>", "Number of results (default 20, max 100)", parseInt)
|
.option("--limit <n>", "Number of results (default 20, max 100)", parseInt)
|
||||||
.option("--order-by <field>", "Sort field: amount_percentage / profit / unrealized_profit / buy_volume_cur / sell_volume_cur", "amount_percentage")
|
.option("--order-by <field>", "Sort field: amount_percentage / profit / unrealized_profit / buy_volume_cur / sell_volume_cur", "amount_percentage")
|
||||||
.option("--direction <dir>", "Sort direction: asc / desc", "desc")
|
.option("--direction <dir>", "Sort direction: asc / desc", "desc")
|
||||||
.option("--tag <tag>", "Wallet tag filter: renowned / smart_degen")
|
.option("--tag <tag>", "Wallet tag filter: smart_degen / renowned / fresh_wallet / dev / sniper / rat_trader / bundler / transfer_in / dex_bot / bluechip_owner")
|
||||||
.option("--raw", "Output raw JSON")
|
.option("--raw", "Output raw JSON")
|
||||||
.action(async (opts) => {
|
.action(async (opts) => {
|
||||||
validateChain(opts.chain);
|
validateChain(opts.chain);
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ export function registerTrackCommands(program: Command): void {
|
|||||||
track
|
track
|
||||||
.command("follow-wallet")
|
.command("follow-wallet")
|
||||||
.description("Get follow-wallet trade records")
|
.description("Get follow-wallet trade records")
|
||||||
.requiredOption("--chain <chain>", "Chain: sol / bsc / base")
|
.requiredOption("--chain <chain>", "Chain: sol / bsc / base / eth")
|
||||||
.option("--wallet <address>", "Filter by wallet address")
|
.option("--wallet <address>", "Filter by wallet address")
|
||||||
.option("--limit <n>", "Page size (1–100, default 10)", parseInt)
|
.option("--limit <n>", "Page size (1–100, default 10)", parseInt)
|
||||||
.option("--side <side>", "Trade direction filter: buy / sell")
|
.option("--side <side>", "Trade direction filter: buy / sell")
|
||||||
@@ -35,7 +35,7 @@ export function registerTrackCommands(program: Command): void {
|
|||||||
track
|
track
|
||||||
.command("kol")
|
.command("kol")
|
||||||
.description("Get KOL trade records")
|
.description("Get KOL trade records")
|
||||||
.option("--chain <chain>", "Chain: sol / bsc / base")
|
.requiredOption("--chain <chain>", "Chain: sol / bsc / base / eth")
|
||||||
.option("--limit <n>", "Page size (1–200, default 100)", parseInt)
|
.option("--limit <n>", "Page size (1–200, default 100)", parseInt)
|
||||||
.option("--side <side>", "Filter by trade direction: buy / sell (client-side filter)")
|
.option("--side <side>", "Filter by trade direction: buy / sell (client-side filter)")
|
||||||
.option("--raw", "Output raw JSON")
|
.option("--raw", "Output raw JSON")
|
||||||
@@ -52,7 +52,7 @@ export function registerTrackCommands(program: Command): void {
|
|||||||
track
|
track
|
||||||
.command("smartmoney")
|
.command("smartmoney")
|
||||||
.description("Get Smart Money trade records")
|
.description("Get Smart Money trade records")
|
||||||
.option("--chain <chain>", "Chain: sol / bsc / base")
|
.requiredOption("--chain <chain>", "Chain: sol / bsc / base / eth")
|
||||||
.option("--limit <n>", "Page size (1–200, default 100)", parseInt)
|
.option("--limit <n>", "Page size (1–200, default 100)", parseInt)
|
||||||
.option("--side <side>", "Filter by trade direction: buy / sell (client-side filter)")
|
.option("--side <side>", "Filter by trade direction: buy / sell (client-side filter)")
|
||||||
.option("--raw", "Output raw JSON")
|
.option("--raw", "Output raw JSON")
|
||||||
|
|||||||
+1
-1
@@ -15,7 +15,7 @@ export interface Config {
|
|||||||
|
|
||||||
let _config: Config | null = null;
|
let _config: Config | null = null;
|
||||||
const PRIVATE_KEY_REQUIRED_MSG =
|
const PRIVATE_KEY_REQUIRED_MSG =
|
||||||
"GMGN_PRIVATE_KEY is required for critical-auth commands (swap and all order commands)";
|
"GMGN_PRIVATE_KEY is required for critical-auth commands (swap, order, and follow-wallet commands)";
|
||||||
|
|
||||||
export function getConfig(requirePrivateKey = false): Config {
|
export function getConfig(requirePrivateKey = false): Config {
|
||||||
if (_config) {
|
if (_config) {
|
||||||
|
|||||||
Reference in New Issue
Block a user