π¦GMGN Agent API
I. Why choose GMGN AI Agent?
β‘οΈ Real-time On-chain Data Β· Provides multi-chain real-time market quotes and liquidity pool status, enabling your AI Agent to capture market opportunities with zero latency
π Comprehensive Exclusive Data Β· The out-of-the-box API eliminates the need for tedious low-level data parsing. It directly outputs advanced research metrics, instantly identifying Snipers, Insiders, Bundled wallets, and more
π‘οΈ Secure and Convenient Trading Β· Adopts the GMGN hosted wallet architecture where private keys are not stored locally, eliminating leakage risks at the source. IP whitelist automatically intercepts abnormal trading requests, and developers no longer need to manually construct complex on-chain transactions
Here is the English translation, perfectly formatted for your GitBook documentation. I have also cleaned up the random drag-and-drop text from your copy-paste.
II. Run Your First GMGN AI Agent
Empower your AI Agent with on-chain capabilities β query quotes, fetch market data, and execute Swap transactions, all entirely through natural language.
Quick Start: Get API Key and Key Pair
Before using, please complete the following preparations:
Generate a Key Pair: Use an asymmetric key generator to locally generate a key pair (Public & Private Key). Generation tutorial: π Generate Public Key
Create an API Key: Go to π https://gmgn.ai/ai, upload your public key, and create your exclusive GMGN API Key. (Note: Only IPv4 requests are supported; IPv6 is currently not supported.)
The permissions required for using Skills are as follows:
Query (gmgn-market / token / portfolio)
β API Key
Trading (gmgn-swap)
β API Key + Private Key
1. Add GMGN Skills to Your Agent
Copy and send the following prompt to OpenClaw, Claude Code, or other AI Agent tools:
2. Configure API Key and Private Key
Send the following prompt to your AI for global configuration. Once the Agent replies, fill in your API Key and Private Key as needed:
β οΈ Note: Never commit your
.envfile to git (please add it to.gitignore), and absolutely never expose your private key in chats, logs, or screenshots. The private key used when executing a Swap must belong to the exact same key pair as the public key you uploaded when creating the API Key
3. Try It!
Once configured, send the following prompt directly to test the query capabilities:
Usage:
Once set up, you can execute tasks using just natural language:
"Buy 0.1 SOL of <token_address>"
"Sell 50% of <token_address> "
"Get the candlestick data for <token_address> and analyze if it's worth buying"
"Check the contract security and pool status for <token_address>"
"Check the recent trading activity of <wallet_address>"
"Show the holders of <token_address> "
III. What are GMGN MCP & Skills?
Introduction
GMGN MCP & Skills is an on-chain development suite built specifically for AI Agents. It enables Agents to natively read multi-chain market data, analyze tokens across multiple dimensions, manage wallet portfolios, and execute Swap transactions directly
Flexible Integration Methods
AI Skills β Built-in system-level commands like
/gmgn-tokenand/gmgn-market. Agents can call them directly via natural language with zero API integration costCLI Toolkit β Provides the ready-to-use
npx gmgn-cliterminal command, supporting formatted JSON or single-line JSON (--raw) output, perfectly suited for script processing
Core Capabilities
GMGN's underlying capabilities cover the most essential on-chain interaction scenarios:
πͺ Token: Query basic info, real-time prices, contract security, liquidity pool status, and profiles of Top Holders and Traders
π Market: Fetch precise candlestick data, supporting multiple resolutions from
1mto1dπ₯ Trending: Fetch the current trending tokens list
π° Portfolio: Query wallet holdings and token balances, and track historical transaction activity and PnL data
π Swap: Submit token exchange transactions via optimal routing, support custom slippage, and poll on-chain order status in real-time (requires private key configuration)
IV. Supported Chains
Integration for ETH and other new chains is currently in progress...
SOL
SOL, USDC
BSC
BNB, USDC
Base
ETH, USDC
β οΈ Security & Disclaimer:
While using GMGN Skills, your AI Agent may make mistakes. Therefore, before authorizing the AI Agent to execute queries or on-chain asset trading commands (such as a
swap), please ensure you manually verify key parameters like the token contract, amount, and slippage. Any unexpected risks caused by the AI model must be evaluated and borne solely by the user
Last updated