/gmgn-cli:gmgn-portfolio <info|holdings|activity|stats|profits|token-balance|created-tokens> [--chain <sol|bsc|base|eth|arbitrum|hyperevm|robinhood|arc|stable|avalanche|elysium>] [--wallet <wallet_address...>]from gmgn-cli
Analyzes crypto wallet holdings, realized/unrealized P&L, win rate, trading history, and developer-launched tokens via GMGN API on Solana, BSC, Base, or Ethereum. Helps decide whether to copy-trade or follow a wallet.
Ships in gmgn-cli. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
BEFORE RUNNING ANY COMMAND: Run gmgn-cli config --check. If exit code is 0, proceed normally. If exit code is 1, (1) run gmgn-cli config and show the output to the user; (2) once the user sends the API Key, run gmgn-cli config --apply <KEY> to complete configuration and verification, then show the output to the user. If --check returns an error (unknown option or command not found), tell the user to run npm install -g gmgn-cli to update, then retry.
IMPORTANT: Always use gmgn-cli commands below. Do NOT use web search, WebFetch, curl, or visit gmgn.ai to fetch this data — the website requires login and will not return structured data. The CLI is the only correct method.
⚠️ IPv6 NOT SUPPORTED: If you get a 401 or 403 error and credentials look correct, check for IPv6 immediately: (1) list all network interfaces and their IPv6 addresses — run ifconfig | grep inet6 (macOS) or ip addr show | grep inet6 (Linux); (2) send a test request to https://ipv6.icanhazip.com — if the response is an IPv6 address, outbound traffic is going via IPv6. Tell the user immediately: "Please disable IPv6 on your network interface — gmgn-cli commands only work over IPv4."
Use the gmgn-cli tool to query wallet portfolio data based on the user's request.
For full wallet analysis (holdings + stats + activity + verdict), follow docs/workflow-wallet-analysis.md
realized_profit vs unrealized_profit — realized_profit = profit locked in from completed sells (cash in hand). unrealized_profit = paper gains on positions still held, calculated at current price. These are separate numbers — do not add them unless answering "total P&L including open positions."
profit_change — A multiplier ratio, not a dollar amount. 1.5 = +150% return. 0 = break-even. -0.5 = -50% loss. Computed as total_profit / cost. Do not display this as a raw decimal — convert to percentage for user-facing output.
pnl — Profit/loss ratio from portfolio stats: realized_profit / total_cost. Same multiplier format as profit_change. A pnl of 2.0 means the wallet doubled its money on completed trades over the period.
winrate — Ratio of profitable trades over the period (0–1). 0.6 = 60% of trades were profitable. Does not reflect the size of wins vs losses — a wallet can have high winrate but net negative if losses are large.
cost vs usd_value — In holdings: cost is the historical amount spent buying this token (your cost basis); usd_value is the current market value of the position. The difference is unrealized P&L.
history_bought_cost vs cost — history_bought_cost is the all-time cumulative spend on this token (including positions already sold). cost is the cost basis of the current open position only.
Pagination (cursor) — Activity results are paginated. The response includes a next field; pass it as --cursor to fetch the next page. An empty or missing next means you are on the last page.
| Sub-command | Description |
|---|---|
portfolio info | Wallets and main currency balances bound to the API Key |
portfolio holdings | Wallet token holdings with P&L |
portfolio activity | Transaction history |
portfolio stats | Trading statistics (supports batch) |
portfolio profits | Batch wallet P&L for 1–100 wallets |
portfolio token-balance | Token balance for a specific token |
portfolio created-tokens | Tokens created by a developer wallet, with market cap and ATH info |
sol / bsc / base / eth / arbitrum / hyperevm / robinhood / arc / stable / avalanche / elysium
gmgn-cli installed globally — if missing, run: npm install -g gmgn-cliGMGN_API_KEY configured in ~/.config/gmgn/.envAll portfolio routes used by this skill use GMGN's plan-based leaky bucket: Free 5/5, Plus 20/20, Pro 50/50 (rate/capacity). Sustained throughput is roughly tier rate ÷ weight requests/second, and the max burst is roughly floor(tier capacity ÷ weight).
Critical auth (GMGN_API_KEY + GMGN_PRIVATE_KEY required):
| Command | Route | Weight |
|---|---|---|
portfolio holdings | GET /v1/user/wallet_holdings | 2 |
Exist auth (GMGN_API_KEY only):
| Command | Route | Weight |
|---|---|---|
portfolio info | GET /v1/user/info | 2 |
portfolio activity | GET /v1/user/wallet_activity | 3 |
portfolio stats | GET /v1/user/wallet_stats | 3 |
portfolio profits | POST /v1/user/wallet_profits | 3 |
portfolio token-balance | GET /v1/user/wallet_token_balance | 2 |
portfolio created-tokens | GET /v1/user/created_tokens | 2 |
When a request returns 429:
On RATE_LIMIT_EXCEEDED, tell the user exactly: 已达到当前套餐的限频上限,点击 https://gmgn.ai/ai?chain=bsc&tab=paid_plans 升级套餐,获得更高速率限制. Show this upgrade guidance at most once per user task. Do not repeat it for subsequent RATE_LIMIT_BANNED responses during the same cooldown.
Read X-RateLimit-Reset from the response headers. It is a Unix timestamp in seconds that marks when the limit is expected to reset.
If the response body contains reset_at (e.g., {"code":429,"error":"RATE_LIMIT_BANNED","message":"...","reset_at":1775184222}), extract reset_at — it is the Unix timestamp when the ban lifts (typically 5 minutes). Convert to local time and tell the user exactly when they can retry.
The CLI may wait and retry once automatically when the remaining cooldown is short. If it still fails, stop and tell the user the exact retry time instead of sending more requests.
For RATE_LIMIT_EXCEEDED or RATE_LIMIT_BANNED, repeated requests during the cooldown can extend the ban by 5 seconds each time, up to 5 minutes. Do not spam retries.
On RATE_LIMIT_BANNED_MAX, the ban has hit the 5-minute ceiling because requests kept arriving during the cooldown. Stop all GMGN calls for this task (not just the failing one) and tell the user the exact reset time; any request before reset_at resets the ban to 5 minutes again.
On 403 PLAN_UPGRADE_REQUIRED, the endpoint costs more rate-limit weight than the user's plan capacity, so it can never succeed on this plan — do not retry or wait. Tell the user the endpoint is unavailable on their current plan and show the upgrade_message from the response (it contains the upgrade link https://gmgn.ai/ai?chain=bsc&tab=paid_plans).
# API Key wallet info (no --chain or --wallet needed)
gmgn-cli portfolio info
# Wallet holdings (default sort)
gmgn-cli portfolio holdings --chain sol --wallet <wallet_address>
# Holdings sorted by USD value, descending
gmgn-cli portfolio holdings \
--chain sol --wallet <wallet_address> \
--order-by usd_value --direction desc --limit 20
# Include sold-out positions
gmgn-cli portfolio holdings --chain sol --wallet <wallet_address> --sell-out
# Transaction activity
gmgn-cli portfolio activity --chain sol --wallet <wallet_address>
# Activity filtered by type
gmgn-cli portfolio activity --chain sol --wallet <wallet_address> \
--type buy --type sell
# Activity for a specific token
gmgn-cli portfolio activity --chain sol --wallet <wallet_address> \
--token <token_address>
# Trading stats (default 7d)
gmgn-cli portfolio stats --chain sol --wallet <wallet_address>
# Trading stats for 30 days
gmgn-cli portfolio stats --chain sol --wallet <wallet_address> --period 30d
# Batch stats for multiple wallets
gmgn-cli portfolio stats --chain sol \
--wallet <wallet_1> --wallet <wallet_2>
# Batch P&L for multiple wallets (default 7d)
gmgn-cli portfolio profits --chain sol \
--wallet <wallet_1> --wallet <wallet_2>
# All-time P&L for up to 100 wallets
gmgn-cli portfolio profits --chain sol \
--wallet <wallet_1> --wallet <wallet_2> --period all
# Token balance
gmgn-cli portfolio token-balance \
--chain sol --wallet <wallet_address> --token <token_address>
# Tokens created by a developer wallet
gmgn-cli portfolio created-tokens --chain sol --wallet <wallet_address>
# Created tokens sorted by all-time high market cap
gmgn-cli portfolio created-tokens \
--chain sol --wallet <wallet_address> \
--order-by token_ath_mc --direction desc
# Only migrated tokens
gmgn-cli portfolio created-tokens \
--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| Option | Description |
|---|---|
--order-by <field> | Sort field: market_cap / token_ath_mc |
--direction <asc|desc> | Sort direction (default desc) |
--migrate-state <state> | Filter by migration status: migrated (graduated to DEX) / non_migrated (still on bonding curve) |
portfolio holdings Options| Option | Description |
|---|---|
--limit <n> | Page size (default 20, max 50) |
--cursor <cursor> | Pagination cursor |
--order-by <field> | Sort field: usd_value / last_active_timestamp / realized_profit / unrealized_profit / total_profit / history_bought_cost / history_sold_income (default usd_value) |
--direction <asc|desc> | Sort direction (default desc) |
--hide-abnormal <bool> | Hide abnormal positions: true / false (default: false) |
--hide-airdrop <bool> | Hide airdrop positions: true / false (default: true) |
--hide-closed <bool> | Hide closed positions: true / false (default: true) |
--hide-open | Hide open positions |
portfolio activity Options| Option | Description |
|---|---|
--token <address> | Filter by token |
--limit <n> | Page size |
--cursor <cursor> | Pagination cursor (pass the next value from the previous response) |
--type <type> | Repeatable: buy / sell / transferIn / transferOut / add / remove |
The activity response includes a next field. Pass it to --cursor to fetch the next page.
portfolio stats Options| Option | Description |
|---|---|
--period <period> | Stats period: 7d / 30d (default 7d) |
portfolio profits Options| Option | Description |
|---|---|
--wallet <address...> | One or more wallet addresses (required, max 100) |
--period <period> | P&L period: 1d / 7d / 30d / all (default 7d) |
Check the envelope before reaching for a field name. Reading a field off the wrong level returns
undefined, which becomes 0, which reads as a real answer ("this wallet made nothing") rather
than as an error.
| Route | Top-level shape | Where the rows are |
|---|---|---|
portfolio stats | bare object (array for batch) | the object itself |
portfolio profits | {"list": [ {…} ]} | list[0] — a single row, still inside an array |
portfolio activity | {"activities": [...], "next": …} | activities — not list |
portfolio holdings | {"list": [...], "next": …} | list — not holdings |
portfolio created-tokens | bare object | tokens, plus aggregate counts at the top level |
Some deployments additionally wrap the whole body in {"data": …}.
portfolio holdings — Key FieldsRows come back under list, with a next cursor. Confirmed against gmgn-cli 1.5.8 live
responses — several names differ from what earlier versions of this doc claimed, and the old
names are not accepted as aliases.
| Field | Description |
|---|---|
token.token_address | Token contract address (not token.address — that name is activity's) |
token.symbol / token.name | Token ticker and full name |
token.price | Current token price in USD |
token.is_honeypot | Ships inline — no gmgn-token security call needed. A true here is contradicted by history_total_sells > 0 on the same row: a honeypot cannot be sold, and transfer-restricted RWA / tokenised-stock contracts trip naive simulators |
token.launchpad_platform / token.launchpad | Where the token came from — the basis for "where does this wallet hunt" |
token.liquidity, token.max_supply, token.total_supply, token.creation_timestamp | Also inline |
balance | Current token balance (human-readable units) |
usd_value | Current USD value of this position |
accu_cost | Cost basis of the position still held (not cost) |
history_bought_cost / history_sold_income | All-time buy cost / sell proceeds |
realized_profit | Profit from completed sells (USD) |
unrealized_profit | Profit on current unsold holdings at current price (USD) |
total_profit | realized_profit + unrealized_profit (USD) |
total_profit_pnl | Total profit ratio (not profit_change); realized_profit_pnl / unrealized_profit_pnl are the split |
history_total_buys / history_total_sells | Buy / sell transaction counts (not buy_tx_count / sell_tx_count) |
history_total_transfer_ins / _outs | Transfer counts — airdrops and internal moves, not trades |
start_holding_at / end_holding_at / last_active_timestamp | Position lifetime |
wallet_token_tags | Per-position tags |
There is no --sell-out flag — gmgn-cli 1.5.8 rejects it as an unknown option. avg_cost
is not returned; derive it from accu_cost / balance.
portfolio activity — Key FieldsRows come back under activities, with a next cursor for pagination.
| Field | Description |
|---|---|
tx_hash | On-chain transaction hash (not transaction_hash) |
event_type | Transaction type: buy / sell / transferIn / transferOut. Some chains return type instead — read event_type ?? type. Transfer rows are airdrops and internal moves, not trades — exclude them from any ratio |
buy_cost_usd | On a sell row, the cost basis of what was sold — cost_usd - buy_cost_usd is that exit's realized P&L |
gas_usd / priority_fee / tip_fee | Friction. Compare gas_usd against per-trade net, not against nothing |
launchpad_platform | Where the token came from |
token.address | Token contract address |
token.symbol | Token ticker |
token_amount | Token quantity in this transaction |
cost_usd | USD value of this transaction |
price | Token price denominated in the quote token of the trading pair at time of transaction |
price_usd | Token price in USD at time of transaction |
timestamp | Unix timestamp of the transaction |
next | Pagination cursor — pass to --cursor to fetch the next page |
portfolio stats — Key FieldsThe response is an object (or array for batch). Key fields:
| Field | Description |
|---|---|
realized_profit | Total realized profit over the period (USD) |
unrealized_profit | Total unrealized profit on open positions (USD) |
winrate | Win rate — ratio of profitable trades (0–1) |
total_cost | Total amount spent buying in the period (USD) |
buy_count | Number of buy transactions |
sell_count | Number of sell transactions |
pnl | Profit/loss ratio = realized_profit / total_cost |
The response also includes a common object when available (absent if the upstream identity service is unavailable):
| Field | Description |
|---|---|
common.avatar | Wallet avatar URL |
common.name | Display name |
common.ens | ENS domain (EVM chains only) |
common.tag | Primary wallet tag |
common.tags | All wallet tags (e.g. ["smart_money"]) |
common.twitter_username | Twitter handle |
common.twitter_name | Twitter display name |
common.followers_count | Twitter follower count |
common.is_blue_verified | Twitter blue-verified badge |
common.follow_count | Number of GMGN users following this wallet |
common.remark_count | Number of GMGN users who have remarked this wallet |
common.created_token_count | Tokens created by this wallet |
common.created_at | Wallet creation time (Unix seconds) — records when the first funding transaction arrived; use this as the wallet's age indicator |
common.fund_from | Funding source label |
common.fund_from_address | Address that funded this wallet |
common.fund_amount | Funding amount |
Use common.tags and common.twitter_username when building a wallet profile narrative. If common is absent in the response, omit identity fields silently — do not report it as an error.
portfolio profits — Key FieldsThe response has a list array with one item per wallet. Monetary values are decimal strings; parse them with decimal arithmetic rather than binary floating point when exact calculations matter.
| Field | Description |
|---|---|
wallet_address | Wallet address |
realized_profit | Realized profit in the selected period |
realized_profit_cost | Cost basis associated with selected-period realized profit |
buy / sell | Buy and sell counts in the selected period |
unrealized_profit | Unrealized profit on current holdings |
total_realized_profit | All-time realized profit |
total_realized_profit_cost | Cost basis associated with all-time realized profit |
total_profit | Total profit |
total_cost | Total cost basis |
portfolio created-tokens — Key FieldsThe response data object has a tokens array plus aggregate stats.
Top-level fields:
| Field | Description |
|---|---|
last_create_timestamp | Unix timestamp of the most recent token creation |
inner_count | Number of tokens still on the bonding curve (NOT graduated) |
open_count | Number of tokens that have graduated to DEX |
open_ratio | Graduation rate (string, e.g. "0.25") |
Total created =
inner_count + open_count. Do NOT uselen(tokens)as the total — thetokensarray is capped at 100 entries and may be truncated. |creator_ath_info| Best-performing token created by this wallet (ATH market cap) | |tokens| Array of created tokens — see below |
creator_ath_info fields:
| Field | Description |
|---|---|
creator | Wallet address |
ath_token | Token address with highest ATH market cap |
ath_mc | ATH market cap (USD string) |
token_symbol / token_name | Token ticker and name |
token_logo | Logo URL |
Per-token fields (tokens[*]):
| Field | Description |
|---|---|
token_address | Token contract address |
symbol | Token ticker |
chain | Chain name |
create_timestamp | Unix timestamp of creation |
is_open | true if graduated to DEX |
market_cap | Current market cap (USD string) |
token_ath_mc | All-time high market cap (USD string) |
pool_liquidity | Current liquidity (USD string) |
holders | Current holder count |
swap_1h | Swap count in the last hour |
volume_1h | Trading volume in the last hour (USD string) |
launchpad_platform | Launch platform name (e.g. Pump.fun) |
is_pump | true if launched on Pump.fun |
bundler_rate | Bundler participation rate (0–1) |
cto_flag | true if community-takeover token |
Do NOT guess field names not listed here. If a field appears in the response but is not in this table, do not interpret it without reading the raw output first.
Do NOT dump raw JSON. Always parse and present data in the structured formats below. Use --raw only when piping to jq or further processing.
portfolio holdings — Holdings TablePresent a table sorted by usd_value (descending). Show total portfolio value at the top.
Wallet: {wallet} | Chain: {chain}
Total value: ~${sum of usd_value across all positions}
# | Token | Balance | USD Value | Total P&L | P&L% | Avg Cost | Buys / Sells
Flag positions where profit_change is strongly negative (e.g. < -50%) or positive (e.g. > 200%) with a brief note.
portfolio activity — Activity FeedPresent as a chronological list (newest first). Use human-readable timestamps.
{type} {token.symbol} | {token_amount} tokens | ${cost_usd} | {timestamp} | tx: {short hash}
Group by token if the user asks about a specific token.
portfolio stats — Stats SummaryWallet: {wallet} | Period: {period}
Realized P&L: ${realized_profit}
Unrealized P&L: ${unrealized_profit}
Win Rate: {winrate × 100}%
Total Spent: ${total_cost}
Buys / Sells: {buy_count} / {sell_count}
PnL Ratio: {pnl}x
[Identity: {common.name or common.twitter_username} | Tags: {common.tags}]
Show the [Identity: ...] line only if common is present in the response. For batch queries (multiple wallets), present one summary block per wallet.
portfolio holdings uses critical auth (GMGN_API_KEY + GMGN_PRIVATE_KEY required — CLI signs the request automatically). All other portfolio commands use exist auth (API Key only, no signature required).portfolio stats supports multiple --wallet flags for batch queries--raw to get single-line JSON for further processing0x + 40 hex digits). The CLI exits with an error on invalid input.gmgn-track skill (track follow-wallet / track kol / track smartmoney)For full wallet analysis including trade history and follow-through on top holdings, see docs/workflow-wallet-analysis.md
For in-depth trading style analysis, copy-trade ROI estimation, and smart money leaderboard comparison, see docs/workflow-smart-money-profile.md
When to use which:
docs/workflow-wallet-analysis.mddocs/workflow-smart-money-profile.mddocs/workflow-smart-money-profile.md Step 5 (leaderboard)portfolio created-tokens --chain <chain> --wallet <creator_address> directly. Get the creator address first via token info if only a token address is given.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub gmgnai/gmgn-skills --plugin gmgn-cli19 skills in this plugin
/gmgn-calloutRead GMGN call-outs (喊单) — public token calls that wallets publish on GMGN, with call price, call market cap, multiplier since the call, thesis text and the caller's current holding. Use when user asks who is calling a token, what a wallet has called, a wallet's call-out track record (hit rate, best multiplier), or wants the latest call-out feed (KOL-only, paid declarations, safe tokens). Read-only; publishing a call-out is not supported./gmgn-callout-scoreDecide whether to act on a caller's (喊单人) calls. Scores one call-out wallet on two axes — SELECTION (do the coins he calls actually run) and POST-CALL CONDUCT (does he sell into the attention his own call created) — then returns a follow / don't-follow verdict. The conduct axis is proved from the caller's own per-trade ledger, not from any self-reported field: for each sampled coin it compares the first buy, the call timestamp, and every sell after it, so "he dumped on his followers" is a measured sequence rather than an inference. USE THIS SKILL WHEN the user asks whether a caller is worth following: 这个喊单的能不能跟, 这个喊单号靠不靠谱, 喊单信誉分, 喊单评分, 他喊完会不会砸盘, 他是不是喊完就卖, 跟他的单能不能吃到, caller 评分, is this caller trustworthy, can I follow this caller's calls, does he dump after calling, call-out credibility score, score this caller. Accepts either a GMGN profile handle (twitter_username, e.g. the last path segment of a gmgn.ai/profile/<handle> link) or a wallet address; a handle is resolved to one (chain, wallet) pair in Step 0 and the resolution is always echoed. The same questions in any other language route here — match on meaning, not wording. DO NOT USE THIS SKILL for raw call-out data — "这个钱包 喊过什么单", "最新喊单", "谁在喊这个币", "KOL 在喊什么", the feed, the field dump, the 30d summary card — that is gmgn-callout, which owns every read of the callout endpoints and returns them untouched; this skill calls it and adds a verdict. Nor for a caller judged as a trader rather than as a caller ("这个钱包能不能跟单", "跟单评分", copy-trade backtest) — that is gmgn-wallet-analysis / gmgn-wallet-score, which read his trades and know nothing about his calls. Nor for a token the caller mentioned ("他喊的那个币安全吗", 尽调, rug check) — that is gmgn-contract-dd. Nor for a token creator's next launch ("这个 dev 的新盘能不能买") — that is gmgn-dev-score. A bare wallet address with no call-out intent stays with gmgn-wallet-analysis; a bare token address stays with gmgn-contract-dd. This skill needs the word 喊单 / caller / call-out in the ask to own it. TIE-BREAKS, because three words are shared with neighbouring skills: 喊单 paired with 能不能跟 / 信誉 / 砸盘 / 评分 routes HERE, while 喊单 paired with 喊过什么 / 最新 / 谁在喊 / 列表 routes to gmgn-callout — the first group asks for a judgement, the second for rows. 能不能跟 without 喊单 is about a wallet as a trader and stays with gmgn-wallet-analysis / gmgn-wallet-review. 信誉 without 喊单 is a launcher question and stays with gmgn-dev-score. PRESET PHRASES this skill is written to answer, each carrying the call-out intent word: 「帮我看看 [喊单人ID或地址] 这个喊单的能 不能跟」「[喊单人ID] 喊的币能跟吗」「查一下 [钱包地址] 的喊单信誉」「这个喊单号喊完会不会 砸盘:[地址]」. WHAT IT CANNOT ANSWER, so the ask goes elsewhere: whether any one called coin is safe to buy (gmgn-contract-dd); what he is calling right now (gmgn-callout global); whether he is a good trader to copy (gmgn-wallet-score); who else called the same coin or whether he called it first (no per-token caller list exists in the CLI, so it is not computable at all); how much he staked on a call (readable only in the unfilterable global feed); anything older than 30 days (callout record covers 30d only).Other plugins' skills for the same job