gmgnai/gmgn-skills

gmgn-portfolio

Analyze one or many crypto wallets by address — holdings, batch 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…

Vedi sorgente
Documento Skill originale

Contenuto dal repository con titoli, esempi, codice, tabelle, link e immagini preservati.

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`](../../docs/workflow-wallet-analysis.md)

Core Concepts

  • `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-commands

Sub-commandDescription
portfolio infoWallets and main currency balances bound to the API Key
portfolio holdingsWallet token holdings with P&L
portfolio activityTransaction history
portfolio statsTrading statistics (supports batch)
portfolio profitsBatch wallet P&L for 1–100 wallets
portfolio token-balanceToken balance for a specific token
portfolio created-tokensTokens created by a developer wallet, with market cap and ATH info

Supported Chains

sol / bsc / base / eth / robinhood / arc / stable

Prerequisites

  • gmgn-cli installed globally — if missing, run: npm install -g gmgn-cli
  • GMGN_API_KEY configured in ~/.config/gmgn/.env

Rate Limit Handling

All portfolio routes used by this skill go through GMGN's leaky-bucket limiter with rate=20 and capacity=20. Sustained throughput is roughly 20 ÷ weight requests/second, and the max burst is roughly floor(20 ÷ weight) when the bucket is full.

Critical auth (GMGN_API_KEY + GMGN_PRIVATE_KEY required):

CommandRouteWeight
portfolio holdingsGET /v1/user/wallet_holdings5

Exist auth (GMGN_API_KEY only):

CommandRouteWeight
portfolio infoGET /v1/user/info1
portfolio activityGET /v1/user/wallet_activity3
portfolio statsGET /v1/user/wallet_stats3
portfolio profitsPOST /v1/user/wallet_profits3
portfolio token-balanceGET /v1/user/wallet_token_balance1
portfolio created-tokensGET /v1/user/created_tokens2

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.

Usage Examples

bash
# 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

OptionDescription
--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

OptionDescription
--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-openHide open positions

portfolio activity Options

OptionDescription
--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

OptionDescription
--period <period>Stats period: 7d / 30d (default 7d)

portfolio profits Options

OptionDescription
--wallet <address...>One or more wallet addresses (required, max 100)
--period <period>P&L period: 1d / 7d / 30d / all (default 7d)

Response Field Reference

Response envelopes — each route wraps differently

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.

RouteTop-level shapeWhere the rows are
portfolio statsbare object (array for batch)the object itself
portfolio profits{"list": [ {…} ]}list[0] — a single row, still inside an array
portfolio activity{"activities": [...], "next": …}activitiesnot list
portfolio holdings{"list": [...], "next": …}listnot holdings
portfolio created-tokensbare objecttokens, plus aggregate counts at the top level

Some deployments additionally wrap the whole body in {"data": …}.

portfolio holdings — Key Fields

Rows 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.

FieldDescription
token.token_addressToken contract address (not token.address — that name is activity's)
token.symbol / token.nameToken ticker and full name
token.priceCurrent token price in USD
token.is_honeypotShips 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.launchpadWhere the token came from — the basis for "where does this wallet hunt"
token.liquidity, token.max_supply, token.total_supply, token.creation_timestampAlso inline
balanceCurrent token balance (human-readable units)
usd_valueCurrent USD value of this position
accu_costCost basis of the position still held (not cost)
history_bought_cost / history_sold_incomeAll-time buy cost / sell proceeds
realized_profitProfit from completed sells (USD)
unrealized_profitProfit on current unsold holdings at current price (USD)
total_profitrealized_profit + unrealized_profit (USD)
total_profit_pnlTotal profit ratio (not profit_change); realized_profit_pnl / unrealized_profit_pnl are the split
history_total_buys / history_total_sellsBuy / sell transaction counts (not buy_tx_count / sell_tx_count)
history_total_transfer_ins / _outsTransfer counts — airdrops and internal moves, not trades
start_holding_at / end_holding_at / last_active_timestampPosition lifetime
wallet_token_tagsPer-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 Fields

Rows come back under `activities`, with a next cursor for pagination.

FieldDescription
tx_hashOn-chain transaction hash (not transaction_hash)
event_typeTransaction 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_usdOn 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_feeFriction. Compare gas_usd against per-trade net, not against nothing
launchpad_platformWhere the token came from
token.addressToken contract address
token.symbolToken ticker
token_amountToken quantity in this transaction
cost_usdUSD value of this transaction
priceToken price denominated in the quote token of the trading pair at time of transaction
price_usdToken price in USD at time of transaction
timestampUnix timestamp of the transaction
nextPagination cursor — pass to --cursor to fetch the next page

portfolio stats — Key Fields

The response is an object (or array for batch). Key fields:

FieldDescription
realized_profitTotal realized profit over the period (USD)
unrealized_profitTotal unrealized profit on open positions (USD)
winrateWin rate — ratio of profitable trades (0–1)
total_costTotal amount spent buying in the period (USD)
buy_countNumber of buy transactions
sell_countNumber of sell transactions
pnlProfit/loss ratio = realized_profit / total_cost

The response also includes a common object when available (absent if the upstream identity service is unavailable):

FieldDescription
common.avatarWallet avatar URL
common.nameDisplay name
common.ensENS domain (EVM chains only)
common.tagPrimary wallet tag
common.tagsAll wallet tags (e.g. ["smart_money"])
common.twitter_usernameTwitter handle
common.twitter_nameTwitter display name
common.followers_countTwitter follower count
common.is_blue_verifiedTwitter blue-verified badge
common.follow_countNumber of GMGN users following this wallet
common.remark_countNumber of GMGN users who have remarked this wallet
common.created_token_countTokens created by this wallet
common.created_atWallet creation time (Unix seconds) — records when the first funding transaction arrived; use this as the wallet's age indicator
common.fund_fromFunding source label
common.fund_from_addressAddress that funded this wallet
common.fund_amountFunding 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 Fields

The 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.

FieldDescription
wallet_addressWallet address
realized_profitRealized profit in the selected period
realized_profit_costCost basis associated with selected-period realized profit
buy / sellBuy and sell counts in the selected period
unrealized_profitUnrealized profit on current holdings
total_realized_profitAll-time realized profit
total_realized_profit_costCost basis associated with all-time realized profit
total_profitTotal profit
total_costTotal cost basis

portfolio created-tokens — Key Fields

The response data object has a tokens array plus aggregate stats.

Top-level fields:

FieldDescription
last_create_timestampUnix timestamp of the most recent token creation
inner_countNumber of tokens still on the bonding curve (NOT graduated)
open_countNumber of tokens that have graduated to DEX
open_ratioGraduation 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) | | tokens | Array of created tokens — see below |

creator_ath_info fields:

FieldDescription
creatorWallet address
ath_tokenToken address with highest ATH market cap
ath_mcATH market cap (USD string)
token_symbol / token_nameToken ticker and name
token_logoLogo URL

Per-token fields (tokens[*]):

FieldDescription
token_addressToken contract address
symbolToken ticker
chainChain name
create_timestampUnix timestamp of creation
is_opentrue if graduated to DEX
market_capCurrent market cap (USD string)
token_ath_mcAll-time high market cap (USD string)
pool_liquidityCurrent liquidity (USD string)
holdersCurrent holder count
swap_1hSwap count in the last hour
volume_1hTrading volume in the last hour (USD string)
launchpad_platformLaunch platform name (e.g. Pump.fun)
is_pumptrue if launched on Pump.fun
bundler_rateBundler participation rate (0–1)
cto_flagtrue 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.

Output Format

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 Table

Present 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 Feed

Present 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 Summary

Wallet: {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.

Notes

  • 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
  • Use --raw to get single-line JSON for further processing
  • Input validation — Wallet and token addresses are validated against the expected chain format at runtime (sol: base58 32–44 chars; bsc/base/eth: 0x + 40 hex digits). The CLI exits with an error on invalid input.
  • For follow-wallet, KOL, and Smart Money trade records, use the gmgn-track skill (track follow-wallet / track kol / track smartmoney)

Workflow

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:

  • User asks "is this wallet worth following" → `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`
  • User wants to compare multiple smart money wallets by winrate/PnL → `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.
dallo stesso repository

Altri Skills

Tutti gli Skills
gmgnai
Community

gmgn-market

Get crypto and meme token price charts (K-line, candlestick, OHLCV), trending meme coin rankings by volume, newly launched tokens on launchpads (pump.fun, fourmeme, letsbonk, Raydium, etc.), the hot-search ranking (most-searched tokens), and search for a specific token or wallet by name, symbol, contract address, wallet address, or ENS via GMGN API on Solana, BSC, Base, or Ethereum. Use when user asks for price chart, trending tokens, what's pumping, hot coins, most searched tokens, new launches, token signals, wants to look up / find / search a specific token or wallet by name or address, or wants to discover early-stage opportunities.

installazioni
12
GitHub Stars
514
Aggiornato
4 set
gmgnai
Community

gmgn-contract-dd

Contract due-diligence score for one token address — contract safety, holder structure and price action combined into a single 0-100 composite, capped by GMGN's own rug label, where every deduction names the field it read and an absent field is never a passing check. Use when the user wants one verdict number rather than fields: 尽调, CA 尽调, 给这个币打个分, 这个币安全吗, 能不能买, 有没有貔貅, is this token safe, rug check, honeypot check, due-diligence score, score this contract, or pastes a bare token contract address. A bare address may equally be a wallet — Step 0 resolves which and hands wallets to gmgn-wallet-analysis. Prefer this over gmgn-token whenever the ask is a verdict rather than a field dump; the raw fields themselves — price, market cap, liquidity, holder and trader lists, the unscored security fields — are gmgn-token, chip structure is gmgn-holder-analysis, chart-pattern naming is gmgn-kline-pattern. Buy intent narrows to this skill only when the ask is a bare address: the input is --address, and no name is ever resolved here. When the user names the token instead — 帮我买 200u 的 PENGU, XX 能不能买, 能不能冲, 我想梭, buy me $500 of BONK — or wants a position size, gmgn-token-buy owns it, because picking the one right contract out of the same-name copycats and sizing slippage and gas are both outside this skill's input. That skill calls this one for the safety verdict rather than replacing it, so a bare address with no name and no amount still scores here exactly as before.

installazioni
11
GitHub Stars
514
Aggiornato
4 set
gmgnai
Community

gmgn-cooking

[FINANCIAL EXECUTION] Create and launch meme coins and crypto tokens on launchpads (Pump.fun, FourMeme, Bonk, BAGS, Flap, Klik, Clanker, 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, or Base.

installazioni
11
GitHub Stars
514
Aggiornato
4 set
gmgnai
Community

gmgn-dev-score

- Decide whether a token creator's NEXT launch is safe to buy. Scores a dev address 0-100 on two separate axes — CONDUCT (will he dump on you at open) and POWER (has he ever actually built anything big) — from his full launch history and every trade he made in his own coins, then returns a buy / don't-buy call with a timing window. USE THIS SKILL WHEN the user asks a buy-decision question about a launcher: "can I buy this dev's new launch", "should I buy his next launch", "will this dev rug", "will he dump at open", "is his launch safe to snipe", "is it safe to buy at his open", "dev score", "creator score", "launch score", "is this launcher trustworthy enough to buy"; OR when the user gives a TOKEN address plus a team-trust question ("is this token's team trustworthy", "does this project's dev have a record", "has this creator rugged before") — resolve the creator with gmgn-cli token info - dev.creatoraddress first, then score that address; OR when the user gives a WALLET address plus an explicit launch-history question ("what tokens has this address launched", "how did his previous launches do", "did all his coins go to zero"). The same questions asked in any other language route here too — match on meaning, not on wording. DO NOT USE THIS SKILL for a bare wallet address with no question attached: a bare address is a copy-trade question by default and belongs to gmgn-wallet-analysis, which declares itself the default for it. Also do not use it for copy-trade questions ("is this wallet worth copying", "should I copy this wallet", "copy-trade score"), wallet profitability ("is this wallet profitable", "what is this wallet's track record"), or wallet-profile phrasings ("is this a token-creator wallet", "how is this dev's reputation") — those belong to gmgn-wallet-score. The split is by question type, not by address type: those skills answer "who is this wallet" (a profile), this skill answers "should I buy his launch" (a decision, with a timing window). Note how close "how is this dev's reputation" (profile → gmgn-wallet-score) sits to "dev score" (decision → here): the deciding factor is whether a buy is on the table. If it is genuinely ambiguous, ask one short question instead of guessing — the two produce different reports and there is no cheap hedge.

installazioni
11
GitHub Stars
514
Aggiornato
4 set