gmgn-portfolio
gmgnai/gmgn-skills
솔라나(Solana), BSC, 베이스(Base) 또는 이더리움(Ethereum)에서 GMGN API를 통해 주소별로 모든 암호화폐 지갑을 분석할 수 있습니다. 보유 자산, 실현/미실현 손익, 승률, 거래 내역, 성과 통계, 특정 토큰 잔액, 개발자 지갑이 생성한 토큰(최고 시가총액(ATH) 및 DEX 졸업 상태 포함) 등을 확인할 수 있습니다. 사용자가 지갑의 보유 자산, 손익, 승률, 개발자가 출시한 토큰, 개발자가 생성한 토큰 중 사상 최고가(ATH)를 기록한 토큰에 대해 문의하거나, 복사 거래 또는 팔로우 여부를 결정하기 위해 지갑 보고서를 요청할 때 활용하세요.
...모든 것을 확장하십시오소개 gmgn-portfolio
gmgn-portfolio 는 특정 워크플로우에 초점을 맞춘 재사용 가능한 AI 스킬입니다. 설명: 솔라나(Solana), BSC, 베이스(Base) 또는 이더리움(Ethereum)의 GMGN API를 통해 주소 기반으로 암호화폐 지갑을 분석합니다. 보유 자산, 실현/미실현 손익, 승률, 거래 내역, 성과 통계, 특정 토큰 잔액, 개발자 지갑이 생성한 토큰(최고 시가총액(ATH) 및 DEX 졸업 상태 포함) 등을 확인할 수 있습니다. 사용자가 지갑의 보유 자산, 손익, 승률, 개발자가 출시한 토큰, 개발자가 생성한 토큰 중 역대 최고 시가총액(ATH)을 기록한 토큰에 대해 문의하거나, 카피 트레이딩 또는 팔로우 여부를 결정하기 위해 지갑 보고서를 요청할 때 사용합니다.
이 스킬은 에이전트가 업무를 보다 일관성 있게 수행할 수 있도록 지침, 규칙 및 작업별 안내를 제공합니다. argument-hint: "
실제로 이 스킬은 설정 단계가 적고 모호성이 적은 상태에서 반복적인 실행이 필요한 사용자에게 가장 적합합니다. **⚠️ IPv6 미지원: `401` 또는 `403` 오류가 발생하고 자격 증명이 올바른 것으로 보인다면, 즉시 IPv6 설정을 확인하십시오: (1) 모든 네트워크 인터페이스와 해당 IPv6 주소를 나열하세요 — `ifconfig | grep inet6`(macOS) 또는 `ip addr show | grep inet6`(Linux)를 실행하세요; (2) `https://ipv6.icanhazip.com`으로 테스트 요청을 보내세요 — 응답이 IPv6 주소라면, 아웃바운드 트래픽이 IPv6를 통해 전송되고 있는 것입니다. 사용자에게 즉시 다음과 같이 안내하십시오: "네트워크 인터페이스에서 IPv6를 비활성화해 주십시오. gmgn-cli 명령어는 IPv4에서만 작동합니다."** `gmgn-cli` 도구를 사용하여 사용자의 요청에 따라 지갑 포트폴리오 데이터를 조회하십시오. **전체 지갑 분석(보유 자산 + 통계 + 활동 + 평가)을 보려면 [`docs/workflow-wallet-analysis.md`](../../docs/workflow-wallet-analysis.md)를 참조하십시오.** - **`realized_profit` 대 `unrealized_profit`** — `realized_profit` = 완료된 매도 거래를 통해 확정된 이익(실제 현금). `unrealized_profit` = 현재 가격을 기준으로 계산된, 아직 보유 중인 포지션의 평가 이익입니다. 이 두 수치는 별개의 개념이므로, “미결제 포지션을 포함한 총 손익”에 대한 답변이 아닌 이상 합산하지 마십시오.
자주 묻는 질문
gmgn-portfolio 는 어떤 도움을 주나요?
gmgn-portfolio 에이전트가 소스 문서에 설명된 집중적인 워크플로를 따르도록 도와주어, 모호함을 줄이고 실행이 의도된 작업과 일치하도록 유지합니다.
이 스킬은 언제 사용해야 하나요?
작업이 스킬 문서에 설명된 워크플로우, 도메인 또는 운영 규칙과 일치할 때, 특히 일관된 실행이 중요한 경우에 사용하십시오.
주요 제한 사항은 무엇인가요?
이 스킬은 원본 지침의 품질과 범위에 제약을 받습니다. 기본 문서가 불완전한 경우, 상담원이 추가적인 맥락 정보나 수동 검증이 필요할 수 있습니다.
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.
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
Core Concepts
realized_profitvsunrealized_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 astotal_profit / cost. Do not display this as a raw decimal — convert to percentage for user-facing output.pnl— Profit/loss ratio fromportfolio stats:realized_profit / total_cost. Same multiplier format asprofit_change. Apnlof2.0means 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.costvsusd_value— In holdings:costis the historical amount spent buying this token (your cost basis);usd_valueis the current market value of the position. The difference is unrealized P&L.history_bought_costvscost—history_bought_costis the all-time cumulative spend on this token (including positions already sold).costis the cost basis of the current open position only.Pagination (
cursor) — Activity results are paginated. The response includes anextfield; pass it as--cursorto fetch the next page. An empty or missingnextmeans you are on the last page.
Sub-commands
| 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 token-balance | Token balance for a specific token |
portfolio created-tokens | Tokens created by a developer wallet, with market cap and ATH info |
Supported Chains
sol / bsc / base / eth
Prerequisites
gmgn-cliinstalled globally — if missing, run:npm install -g gmgn-cliGMGN_API_KEYconfigured 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):
| Command | Route | Weight |
|---|---|---|
portfolio holdings | GET /v1/user/wallet_holdings | 5 |
Exist auth (GMGN_API_KEY only):
| Command | Route | Weight |
|---|---|---|
portfolio info | GET /v1/user/info | 1 |
portfolio activity | GET /v1/user/wallet_activity | 3 |
portfolio stats | GET /v1/user/wallet_stats | 3 |
portfolio token-balance | GET /v1/user/wallet_token_balance | 1 |
portfolio created-tokens | GET /v1/user/created_tokens | 2 |
When a request returns 429:
- Read
X-RateLimit-Resetfrom 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}), extractreset_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_EXCEEDEDorRATE_LIMIT_BANNED, repeated requests during the cooldown can extend the ban by 5 seconds each time, up to 5 minutes. Do not spam retries.
First-time setup (if GMGN_API_KEY is not configured):
Generate key pair and show the public key to the user:
openssl genpkey -algorithm ed25519 -out /tmp/gmgn_private.pem 2>/dev/null && \ openssl pkey -in /tmp/gmgn_private.pem -pubout 2>/dev/null
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."
Wait for the user's API key, then configure:
mkdir -p ~/.config/gmgnecho 'GMGN_API_KEY=<key_from_user>' > ~/.config/gmgn/.envchmod 600 ~/.config/gmgn/.env
Usage Examples
# 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, descendinggmgn-cli portfolio holdings \ --chain sol --wallet <wallet_address> \ --order-by usd_value --direction desc --limit 20# Include sold-out positionsgmgn-cli portfolio holdings --chain sol --wallet <wallet_address> --sell-out# Transaction activitygmgn-cli portfolio activity --chain sol --wallet <wallet_address># Activity filtered by typegmgn-cli portfolio activity --chain sol --wallet <wallet_address> \ --type buy --type sell# Activity for a specific tokengmgn-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 daysgmgn-cli portfolio stats --chain sol --wallet <wallet_address> --period 30d# Batch stats for multiple walletsgmgn-cli portfolio stats --chain sol \ --wallet <wallet_1> --wallet <wallet_2># Token balancegmgn-cli portfolio token-balance \ --chain sol --wallet <wallet_address> --token <token_address># Tokens created by a developer walletgmgn-cli portfolio created-tokens --chain sol --wallet <wallet_address># Created tokens sorted by all-time high market capgmgn-cli portfolio created-tokens \ --chain sol --wallet <wallet_address> \ --order-by token_ath_mc --direction desc# Only migrated tokensgmgn-cli portfolio created-tokens \ --chain sol --wallet <wallet_address> --migrate-state migrated# ETH wallet holdingsgmgn-cli portfolio holdings --chain eth --wallet <0x_wallet_address># ETH wallet transaction activitygmgn-cli portfolio activity --chain eth --wallet <0x_wallet_address># ETH token balancegmgn-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) |
Response Field Reference
portfolio holdings — Key Fields
The response has a holdings array. Each item is one token position.
| Field | Description |
|---|---|
token.address | Token contract address |
token.symbol / token.name | Token ticker and full name |
token.price | Current token price in USD |
balance | Current token balance (human-readable units) |
usd_value | Current USD value of this position |
cost | Total amount spent buying this token (USD) |
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) |
profit_change | Total profit ratio = total_profit / cost (e.g. 1.5 = +150%) |
avg_cost | Average buy price per token (USD) |
buy_tx_count | Number of buy transactions |
sell_tx_count | Number of sell transactions |
last_active_timestamp | Unix timestamp of the most recent transaction |
history_bought_cost | Total USD spent buying (all-time) |
history_sold_income | Total USD received from selling (all-time) |
portfolio activity — Key Fields
The response has a activities array and a next cursor field for pagination.
| Field | Description |
|---|---|
transaction_hash | On-chain transaction hash |
type | Transaction type: buy / sell / add / remove / transfer |
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 Fields
The 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 created-tokens — Key Fields
The 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.
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 / SellsFlag 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 holdingsuses critical auth (GMGN_API_KEY+GMGN_PRIVATE_KEYrequired — CLI signs the request automatically). All other portfolio commands use exist auth (API Key only, no signature required).portfolio statssupports multiple--walletflags for batch queries- Use
--rawto 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-trackskill (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.mdStep 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 viatoken infoif only a token address is given.
gmgn-portfolio 설치
스킬 파일을 다운로드하여 .claude/skills/ 디렉터리에 압축을 풀어주세요.
ZIP 다운로드저장소를 클론하고 스킬 파일을 프로젝트에 복사하세요.
git clone https://github.com/GMGNAI/gmgn-skills/blob/main/skills/gmgn-portfolio/SKILL.md # Copy SKILL.md to your .claude/skills/ directory
복사





집
