$npx -y skills add draguris/dragonclaw --skill gmgnQuery real-time on-chain token data, analyze contract security, track wallets, fetch candlestick charts, check trending tokens, and execute swap trades via GMGN. Use when user asks about on-chain data, token security, wallet tracking, swap trading, trending tokens, snipers, insid
| 1 | # GMGN — On-Chain Trading & Analytics |
| 2 | |
| 3 | ## When to Use |
| 4 | |
| 5 | - User asks about on-chain token data, prices, or liquidity |
| 6 | - User wants to check contract security or detect scams |
| 7 | - User asks about snipers, insiders, or bundled wallets on a token |
| 8 | - User wants to swap/buy/sell tokens on Solana, BSC, or Base |
| 9 | - User asks about wallet holdings, PnL, or transaction history |
| 10 | - User wants candlestick data or technical analysis for a token |
| 11 | - User asks what tokens are trending on-chain right now |
| 12 | - User mentions GMGN, on-chain trading, DEX swap, or liquidity pool |
| 13 | |
| 14 | ## Overview |
| 15 | |
| 16 | GMGN provides real-time multi-chain on-chain data and trading capabilities. It covers token analysis, market data, trending discovery, wallet portfolio tracking, and swap execution across Solana, BSC, and Base chains. The API outputs advanced research metrics including sniper detection, insider identification, and bundled wallet analysis. |
| 17 | |
| 18 | ## API Key Setup |
| 19 | |
| 20 | GMGN requires an API key for all endpoints. Users can get one at https://gmgn.ai/ai |
| 21 | |
| 22 | The API key should be set as an environment variable: |
| 23 | |
| 24 | ``` |
| 25 | GMGN_API_KEY=your-api-key-here |
| 26 | ``` |
| 27 | |
| 28 | For swap trading, a private key is also required: |
| 29 | |
| 30 | ``` |
| 31 | GMGN_PRIVATE_KEY=your-wallet-private-key |
| 32 | ``` |
| 33 | |
| 34 | The private key must match the wallet bound to the API key. |
| 35 | |
| 36 | If the user has not configured GMGN credentials, tell them: |
| 37 | "需要配置 GMGN API Key。前往 https://gmgn.ai/ai 申请,然后设置环境变量 GMGN_API_KEY。" |
| 38 | |
| 39 | ## Supported Chains |
| 40 | |
| 41 | | Chain | Chain ID | Trading Base Tokens | |
| 42 | |-------|----------|-------------------| |
| 43 | | Solana | sol | SOL, USDC | |
| 44 | | BSC | bsc | BNB, USDC | |
| 45 | | Base | base | ETH, USDC | |
| 46 | |
| 47 | ## Endpoints |
| 48 | |
| 49 | ### Token Basic Info & Price |
| 50 | |
| 51 | Get token metadata, real-time price, market cap, and liquidity. |
| 52 | |
| 53 | ```tool |
| 54 | {"tool": "shell", "command": "curl -s 'https://api.gmgn.ai/v1/token/sol/TOKEN_ADDRESS' -H 'Authorization: Bearer $GMGN_API_KEY' 2>/dev/null | head -c 5000"} |
| 55 | ``` |
| 56 | |
| 57 | Replace `sol` with `bsc` or `base` for other chains. |
| 58 | |
| 59 | ### Contract Security Check |
| 60 | |
| 61 | Analyze contract for honeypot, rug pull mechanics, mint functions, blacklists, and tax rates. |
| 62 | |
| 63 | ```tool |
| 64 | {"tool": "shell", "command": "curl -s 'https://api.gmgn.ai/v1/token/sol/TOKEN_ADDRESS/security' -H 'Authorization: Bearer $GMGN_API_KEY' 2>/dev/null | head -c 5000"} |
| 65 | ``` |
| 66 | |
| 67 | ### Top Holders & Traders |
| 68 | |
| 69 | Get top holders with sniper, insider, and bundled wallet detection. |
| 70 | |
| 71 | ```tool |
| 72 | {"tool": "shell", "command": "curl -s 'https://api.gmgn.ai/v1/token/sol/TOKEN_ADDRESS/holders' -H 'Authorization: Bearer $GMGN_API_KEY' 2>/dev/null | head -c 5000"} |
| 73 | ``` |
| 74 | |
| 75 | ### Candlestick / K-Line Data |
| 76 | |
| 77 | Fetch OHLCV candlestick data. Resolutions: 1m, 5m, 15m, 1h, 4h, 1d. |
| 78 | |
| 79 | ```tool |
| 80 | {"tool": "shell", "command": "curl -s 'https://api.gmgn.ai/v1/market/sol/TOKEN_ADDRESS/candles?resolution=1h&limit=24' -H 'Authorization: Bearer $GMGN_API_KEY' 2>/dev/null | head -c 5000"} |
| 81 | ``` |
| 82 | |
| 83 | ### Trending Tokens |
| 84 | |
| 85 | Get the current trending tokens list for a chain. |
| 86 | |
| 87 | ```tool |
| 88 | {"tool": "shell", "command": "curl -s 'https://api.gmgn.ai/v1/trending/sol' -H 'Authorization: Bearer $GMGN_API_KEY' 2>/dev/null | head -c 5000"} |
| 89 | ``` |
| 90 | |
| 91 | ### Wallet Portfolio & Holdings |
| 92 | |
| 93 | Query wallet token balances and total portfolio value. |
| 94 | |
| 95 | ```tool |
| 96 | {"tool": "shell", "command": "curl -s 'https://api.gmgn.ai/v1/portfolio/sol/WALLET_ADDRESS' -H 'Authorization: Bearer $GMGN_API_KEY' 2>/dev/null | head -c 5000"} |
| 97 | ``` |
| 98 | |
| 99 | ### Wallet Transaction History & PnL |
| 100 | |
| 101 | Track historical trades and profit/loss data for a wallet. |
| 102 | |
| 103 | ```tool |
| 104 | {"tool": "shell", "command": "curl -s 'https://api.gmgn.ai/v1/portfolio/sol/WALLET_ADDRESS/trades' -H 'Authorization: Bearer $GMGN_API_KEY' 2>/dev/null | head -c 5000"} |
| 105 | ``` |
| 106 | |
| 107 | ### Swap / Trade Execution |
| 108 | |
| 109 | Execute a token swap via optimal routing. Requires GMGN_PRIVATE_KEY. |
| 110 | |
| 111 | Buy a token with SOL: |
| 112 | |
| 113 | ```tool |
| 114 | {"tool": "shell", "command": "curl -s -X POST 'https://api.gmgn.ai/v1/swap/sol' -H 'Authorization: Bearer $GMGN_API_KEY' -H 'Content-Type: application/json' -d '{\"privateKey\": \"$GMGN_PRIVATE_KEY\", \"tokenAddress\": \"TOKEN_ADDRESS\", \"side\": \"buy\", \"amount\": 0.1, \"slippage\": 10}' 2>/dev/null | head -c 3000"} |
| 115 | ``` |
| 116 | |
| 117 | Sell a token (percentage): |
| 118 | |
| 119 | ```tool |
| 120 | {"tool": "shell", "command": "curl -s -X POST 'https://api.gmgn.ai/v1/swap/sol' -H 'Authorization: Bearer $GMGN_API_KEY' -H 'Content-Type: application/json' -d '{\"privateKey\": \"$GMGN_PRIVATE_KEY\", \"tokenAddress\": \"TOKEN_ADDRESS\", \"side\": \"sell\", \"percentage\": 50, \"slippage\": 10}' 2>/dev/null | head -c 3000"} |
| 121 | ``` |
| 122 | |
| 123 | ### Check Swap Order Status |
| 124 | |
| 125 | Poll on-chain status of a submitted swap. |
| 126 | |
| 127 | ```tool |
| 128 | {"tool": "shell", "command": "curl -s 'https://api.gmgn.ai/v1/swap/s |