For Agent, By Agent | Integrating GMGN Agent API with OpenClaw
Source: http://x.com/i/article/2034087449035739137
Still struggling to connect your AI Agent to on-chain trading? Parsing raw RPC data too painful? Putting private keys online too dangerous?
GMGN Agent API is now officially in closed beta! Tailor-made for LLMs and AI developers, it completely bridges the gap from "in-depth research ➔ lightning-fast execution." With just a simple natural language prompt, your Agent can instantly transform into a top-tier on-chain trader.
👇 Why is GMGN the ultimate infrastructure for Web3 On-Chain AI trading?
🔍 I. Out-of-the-Box: Say Goodbye to Tedious Parsing, Dive Straight into Advanced Research
In on-chain trading, data is life. Traditional APIs only provide basic pricing, forcing developers to spend massive amounts of energy cleaning liquidity pool data.
GMGN provides sub-second real-time candlestick data across multiple chains (SOL, BSC, Base) while directly outputting advanced research metrics for your AI. A single API call lets your AI instantly see through the whales' hidden cards:
🎯 Spot early Snipers 🐀
Detect hidden Insider 📦 Avoid highly controlled Bundled wallets
Combined with smart token distribution and Top Trader profiling, your AI bot now has a god's-eye view of the market.
🛡️ II. Military-Grade Security: Private Keys Stay Offline, Anti-MEV & Seamless Trading
When letting AI execute Swaps automatically, asset security is the top priority. We provide ultimate security mechanisms and a frictionless trading experience:
Asymmetric Encryption Authentication: Utilizing Ed25519 key pairs. Share your Public Key to get an API Key, while your Private key remains exclusively yours and strictly local.
GMGN will never touch your private key!
Architecture Isolation: Built on the GMGN custodial wallet architecture, our IP whitelist mechanism automatically blocks all unauthorized and anomalous risk requests.
Simplified Smart Routing: Developers no longer need to manually assemble complex Gas, Nonce, or smart routing payloads. A single simple command securely triggers the optimal Swap with built-in Anti-MEV protection.
🛠️ III. Lightning-Fast Integration Guide: Step 1: Obtain Your API Key & Local Private Key 1. Download the Asymmetric Key Generator: [
https://github.com/binance/asymmetric-key-generator/releases
]
- Generate a key pair locally (⚠️ CRITICAL: Store your private key securely. Never share it, and keep it offline!).
- Go to 👉 [https://gmgn.ai/ai], upload your public key, and get your exclusive GMGN API Key. (Note: Currently only supports IPv4; IPv6 is not supported.)
Step 2: Inject GMGN Skills into Your Agent
Send the following prompt to OpenClaw, Claude Code, or your custom Agent:
Install GMGN skills by running: npx skills add GMGNAI/gmgn-skills
``` **Step 3: Configure Global Credentials (Permission-Based)** Different skills require different permissions:
✅ Query Skills (Market / Token / Portfolio): API Key only ✅ Trading Skills (Swap): API Key + Private Key
Let your AI help you with the final configuration step by sending this prompt:
```text
Create a .env file in the ~/.config/gmgn/ directory containing GMGN_API_KEY. If I need trading features, please also add GMGN_PRIVATE_KEY. Open the file and remind me to manually paste my actual keys into it. Note: Absolutely ensure this file is not committed to git.
🤖 IV. Real-World Action: What Can Your AI Do Now?
Once configured, use pure natural language to enjoy magical on-chain interactions:
💬 One-Click Safe Sniping: "Get the candlestick data and contract safety status for [Token Address]. If there is no Rat trading risk, buy 0.1 SOL at market price."
💬 Whale Tracking: "Check the recent transaction history of [Wallet Address] and find the token they bought the most."
💬 Smart Position Management: "Scan my wallet portfolio and sell 50% of all tokens currently sitting at an unrealized loss of over 20% at market price."
🤝 V. Open Beta & Community Co-creation
Thank you for your support! The GMGN Agent API is currently in an internal testing phase and has massive room for evolution. We are temporarily using a whitelist application process, reviewing and importing UIDs daily.
🎟️ Beta Whitelist Application: [ https://forms.gle/hs9tijaUPyEjKJt5A ]
📖 Official API Docs: [ https://docs.gmgn.ai/index/gmgn-agent-api ]
🔑 Public Key Generation Guide: [ https://docs.gmgn.ai/index/generate-public-key ]
Open source and co-creation are the soul of Web3:
🐛 Submit Issues / Feature Requests: [ https://github.com/GMGNAI/gmgn-skills/issues ]
💻 Contribute Code (Submit PRs): [ https://github.com/GMGNAI/gmgn-skills/pulls ]
💬 Join the Dev TG Community: [ https://t.me/gmgnagentapi ]
Now, start building your automated Web3 trading engine with your Agent and the GMGN Agent API!