GMGN Agent Skills & CLI

repository·main·Indexed 18 days ago

https://github.com/gmgnai/gmgn-skills

A high-performance interface and CLI (v1.5.6) for AI agents to perform professional on-chain analytics and execute multi-chain Meme token trades across SOL, BSC, Base, and ETH. It provides tools for real-time data retrieval, security checks, K-line data, and advanced trading capabilities including limit orders, take-profit/stop-loss strategies, and deep holder analysis (Smart Money, KOL, and insider tracking).

Tokens
77.6K
Snippets
178
Records
289
Agent score
62%

What's inside gmgn-cli

  1. Overview of GMGN Agent Skills

    main

    GMGN Agent Skills is a suite of tools designed for AI agents to query real-time on-chain data and execute trades for multi-chain Meme tokens (SOL, BSC, Base, ETH). It provides access to professional analytics including trending tokens, 'Trenches' new listings, Smart Money, KOL holdings, and bundler/insider wallet exposure.

    Key capabilities include:

    • Real-time Data: Live token info, security checks (honeypot detection, rug ratio), and K-line (OHLCV) data.
    • High-Speed Trading: Market, limit, and strategy orders (take-profit/stop-loss) with sub-0.3s latency.
    • Advanced Analytics: Deep holder analysis (Smart Money, KOL, rat trader, bundler, sniper) and wallet tracking (P&L, win rate, trade history).
    • AI Workflows: Built-in support for token research, risk warning, and market discovery.
  2. Configure `--condition-orders` for automated trading strategies

    main

    The --condition-orders parameter allows you to attach up to 10 sub-orders (take-profit or stop-loss) to a successful swap. These orders are executed as a best-effort strategy.

    Sub-order Types (order_type)

    • profit_stop: Fixed take-profit.
    • loss_stop: Fixed stop-loss.
    • profit_stop_trace: Trailing take-profit.
    • loss_stop_trace: Trailing stop-loss.

    Key Fields

    • side: Always set to "sell".
    • price_scale:
      • For profit_stop / profit_stop_trace: The gain % from entry (e.g., "100" = +100% / 2x entry).
      • For loss_stop / loss_stop_trace: The drop % from entry (e.g., "65" = drops 65%, triggers at 35% of entry).
    • sell_ratio: Percentage of position to sell when triggered (e.g., "100" for 100%).
    • drawdown_rate: (Required for _trace types) The trailing callback %. E.g., "50" means the order fires if the price falls 50% from its peak.

    Sell Ratio Modes (--sell-ratio-type)

    • buy_amount (default): Sells a fixed percentage of the original amount bought. If you buy 100 tokens and set two 50% profit stops, each stop sells 50 tokens.
    • hold_amount: Sells a percentage of the current position held at trigger time. This includes any tokens added to the position since the initial swap.
    [
      {"order_type": "profit_stop", "side": "sell", "price_scale": "100", "sell_ratio": "100"},
      {"order_type": "loss_stop",   "side": "sell", "price_scale": "60",  "sell_ratio": "100"}
    ]
  3. Handle rate limits and cooldowns

    main

    GMGN uses a leaky-bucket limiter. If you receive a 429 response, it includes an X-RateLimit-Reset header (Unix timestamp in seconds) indicating when the cooldown ends.

    CLI Behavior:

    • Read-only commands: The CLI may automatically wait until the reset time and retry once.
    • Write/Swap commands: The CLI will stop and print the reset time.
    • Auto-retry threshold: Defaults to 5000ms. Override using GMGN_RATE_LIMIT_AUTO_RETRY_MAX_WAIT_MS=<milliseconds>.

    Warning: Repeatedly sending requests during a cooldown can extend a ban by 5 seconds each time, up to a maximum of 5 minutes.

  4. Understand gmgn-market core concepts and risk signals

    main

    The gmgn-market skill provides several key metrics and abstractions for analyzing tokens:

    Chain-specific Safety Filters

    When the --filter flag is omitted, default filters are applied automatically:

    • SOL: Defaults to renounced frozen (mint and freeze authority renounced).
    • EVM (BSC / Base / ETH): Defaults to not_honeypot verified renounced. Note: Omitting --filter is not the same as 'no filter'. To use a custom set, you must explicitly specify all desired tags.

    Key Risk and Bullish Metrics

    • rug_ratio: A 0–1 score (values > 0.3 are high-risk) estimating rug pull likelihood.
    • smart_degen_count / renowned_count: Number of GMGN-tagged smart money (smart_degen) or KOL (renowned) wallets holding/trading the token.
    • is_honeypot: (EVM only) Indicates if the contract prevents selling. On SOL, this field is always empty/null; do not interpret null as 'safe'.
    • cto_flag: 1 indicates a Community Takeover (original dev abandoned the project).
    • wash_trading / bundler_rate: High values (> 0.3) suggest artificial volume or bot manipulation.
    • creator_token_status: creator_hold (dev holds tokens, risk of sell pressure) vs creator_close (dev sold/burned, exit signal confirmed).

    Volume vs Amount (K-line)

    • volume: The USD dollar value of trades.
    • amount: The number of token units traded. Example: For a token at $0.0002, a $1,214 volume corresponds to 6,070,000 amount.
  5. How gmgn-swap works: Core Concepts

    main

    The gmgn-swap skill allows for executing real, irreversible blockchain transactions on Solana, BSC, Base, or Ethereum.

    Key Concepts:

    • Smallest Unit: The --amount flag always requires the token's smallest indivisible unit (e.g., lamports for SOL, or 18 decimals for most EVM tokens). Do not use human-readable amounts.
    • Slippage: An integer (0–100) representing price tolerance. Use --auto-slippage for volatile tokens to let GMGN set this automatically.
    • Amount vs Percent: --amount (exact quantity in smallest units) and --percent (percentage of balance) are mutually exclusive. Note: --percent cannot be used if the input_token is a currency token (SOL, BNB, ETH, USDC).
    • Anti-MEV: Protects against frontrunning/sandwich attacks. Enabled by default, but not supported on the base chain.
    • Authentication: swap and most order commands require both GMGN_API_KEY and GMGN_PRIVATE_KEY. The private key is used for local signing and never leaves your machine.
    • Order Status: After a swap, use order get --order-id to poll for status. A transaction is only successful when the status is confirmed.
  6. Interpret trade and position data in gmgn-track

    main

    When analyzing tracking results, use these specific interpretations for technical fields:

    • is_open_or_close:
      • For follow-wallet: 1 means a full position was opened or closed; 0 means a partial add or reduce.
      • For kol or smartmoney: 0 means a position was opened/added; 1 means a position was closed/reduced.
    • price_change: A ratio of price change since the trade. 6.66 means the token is currently 6.66x the price at the time of the trade (+566%). 0.5 means the price halved (-50%).
    • base_address vs quote_address: In a trading pair, base_address is the token being traded. Always use base_address to identify the token of interest.
    • maker_info.tags: An array of platform labels (e.g., ["smart_degen", "photon"]) assigned to a wallet.
  7. Understand gmgn-holder-analysis output metrics

    main

    The gmgn-holder-analysis skill produces a structured report to evaluate token holder behavior and risk. The output is categorized into three main sections:

    1. Holder Buying Power (💰 Holder Buying Power)

    Measures the remaining liquidity (ammo) available to current holders for adding to their positions. Wallets are classified by their native USD balance:

    • Zero balance (⚫): No buying power; likely sub-wallets used for distribution.
    • Low (<$200) (🟡): Minimal buying power.
    • Mid ($200~$1200) (🟠): Moderate buying power.
    • High ($1200+) (🔴): Significant buying power; can add to positions at any time.

    2. Chip Structure (📊 Chip Structure)

    Analyzes the distribution and health of token holdings:

    • Profit/Loss Distribution: Percentage of holders in profit, loss, or break-even.
    • Underwater (>20% loss): Number of holders and the total percentage of supply they hold who are currently down more than 20%.
    • Avg hold duration: The average number of days holders have maintained their positions.

    3. AI Advice (🤖 AI Advice)

    Provides a synthesized risk/reward assessment:

    • Rating: An overall sentiment rating (rating_em and rating_text).
    • Core Risks: Specific identified dangers.
    • Warnings: Signals to watch for.
    • Positives: Favorable factors.
    • Healthy chips: The percentage of 'healthy' supply (healthy_ratio) versus DEX-related supply excluded from evaluation.
    • Exit Signals: Specific conditions that suggest it may be time to sell.
  8. Security and Authentication for `track` commands

    main

    Authentication Types

    • track follow-tokens: Uses exist auth (API Key only). Requires the --wallet flag.
    • track follow-wallet: Uses signed auth (API Key + private key signature). The follow list is automatically resolved from the GMGN account bound to your API Key. The --wallet flag is optional.
    • track kol / track smartmoney: Uses exist auth (API Key only).

    Safety Constraints

    • follow-wallet: This command reveals your personal following list. Do not share raw output in public channels as it exposes which wallets you follow on GMGN.
    • track kol / track smartmoney: These return platform-tagged public wallet activity and contain no personal data. They are safe to share.
  9. Identify Token Lifecycle Stages

    main

    Use field combinations to determine the current lifecycle stage of a token to inform trading strategy.

    Stage 1 — Early (New Born)

    • Indicators: creation_timestamp < 1 hour ago, low hot_level, smart_degen_count = 0.
    • Strategy: High risk. Wait for Stage 2 confirmation.

    Stage 2 — Breakout

    • Indicators: smart_degen_count ≥ 3 (and rising), surging volume (compare swaps_1h vs swaps_24h / 24), price_change_percent1h > 20%.
    • Strategy: Strongest entry signal. Verify security before acting.

    Stage 3 — Distribution

    • Indicators: creator_token_status = creator_close, renowned_count buying, smart_degen_count plateauing/declining.
    • Strategy: Late stage. Smart money may be exiting into retail/KOL demand.

    Stage 4 — Decline

    • Indicators: Declining volume/holders, high rat_trader_amount_rate, smart_degen_count declining.
    • Strategy: Avoid new entries. Consider exiting existing positions.
  10. Understand gmgn-wallet-score core concepts

    main

    The gmgn-wallet-score skill evaluates wallet addresses across three distinct dimensions to provide a comprehensive profile. It is important to distinguish between a trader's skill and the feasibility of following them.

    • Track-record score (0–100): Measures actual profitability and risk management. It focuses on outcome distribution (e.g., how well a trader cuts losses) rather than just a simple win rate.
    • Copy-tradeability score (0–100): Measures how easy it is for another user to capture the same edge. It penalizes strategies that are hard to replicate due to high latency, low margins, ultra-short hold times, or bot-tier frequency (e.g., sniping sub-$100k market caps).
    • Backtest estimate: A projected return calculation: Raw Return - Entry-latency Price Drift - Round-trip Slippage - Gas.
    • Dev-reputation score: Specifically for wallets that are primarily token creators (where created_token_count > 50% of traded_token_count). It evaluates the survival rate of their launches and security of recent tokens. Note that for Dev wallets, track-record and copy-tradeability scores are heavily discounted due to potential self-dealing.
    • No trading history: If a wallet has no buy/sell transactions in the sampled period, the skill reports this explicitly instead of providing a score.
  11. Understand the Holder Analysis Rating Standard

    main

    The skill provides a qualitative rating based on risk indicators. Note that entry timing pressure (profit/selling) affects display but not the core rating.

    Rating (EN)EmojiCondition
    Not Recommended🔴Any: rat traders >10% / largest wallet >15% / dev sock puppet
    Caution⚠️≥2 of: Dev still holding / airdrop >15% / risk wallets >30% / linked >10%
    Light Position🟡Exactly 1 of the above warnings
    NormalNone of the above
  12. Understand the three tracking data sources

    main

    The gmgn-track skill provides three distinct types of real-time activity. It is critical to use the correct sub-command based on the user's intent:

    • follow-wallet: Returns trades from wallets the user has personally followed on the GMGN platform. This is user-specific and requires GMGN_PRIVATE_KEY for signed authentication. Use this when a user asks about "my followed wallets" or "wallets I follow".
    • kol: Returns trades from Key Opinion Leaders (influencers/well-known traders) tagged as renowned by the GMGN platform. This is a public list and not user-specific.
    • smartmoney: Returns trades from Smart Money (wallets with statistically proven profitable records) identified by GMGN's algorithms. This is a public list and not user-specific.

    Note: Never substitute one for another. smartmoney provides a stronger alpha signal than kol trades.