
{"id":158835,"date":"2026-04-30T16:45:36","date_gmt":"2026-04-30T16:45:36","guid":{"rendered":"https:\/\/mycryptomania.com\/?p=158835"},"modified":"2026-04-30T16:45:36","modified_gmt":"2026-04-30T16:45:36","slug":"how-i-connected-solana-trading-to-openclaw-10-minute-setup","status":"publish","type":"post","link":"https:\/\/mycryptomania.com\/?p=158835","title":{"rendered":"How I Connected Solana Trading to OpenClaw (10-Minute Setup)"},"content":{"rendered":"<h4>Buy, sell, and read on-chain data in plain English. No dashboards. No DEX UIs. One npx\u00a0command.<\/h4>\n<p><em>\u26a0\ufe0f <\/em><strong><em>Disclosure &amp; risk:<\/em><\/strong><em> This is an editorial write-up based on the official GMGN docs and my own setup notes. AI agents can misread prompts and execute the wrong trade. Verify every contract address, amount, and slippage before authorizing a swap. Crypto is high-risk\u200a\u2014\u200aonly ever risk what you can lose. In addition, some links contain affiliate, if you use those links to sign up, we will earn\u00a0money.<\/em><\/p>\n<p>I have eight tabs open right now. <a href=\"https:\/\/gmgn.ai\/r\/NdGvsXdB\">GMGN\u2019s web app<\/a>, Photon, <a href=\"https:\/\/t.me\/BullxBetaBot?start=access_ZH5O9XEG5XQ\">BullX<\/a>, Phantom, DEXRabbit, Solscan, X, and a half-broken spreadsheet pretending to track P&amp;L. If you trade Solana memecoins seriously, this is probably your setup\u00a0too.<\/p>\n<p>Last week I replaced about six of those tabs with one\u00a0prompt:<\/p>\n<p><em>\u201cShow me the smart money holdings for X token and tell me if it\u2019s safe to buy 0.5\u00a0SOL.\u201d<\/em><\/p>\n<p>That prompt runs through OpenClaw, a local-first AI agent, using something called the <a href=\"https:\/\/gmgn.ai\/ai?ref=NdGvsXdB&amp;chain=sol\"><strong>GMGN AI Skills<\/strong><\/a>. The agent reads GMGN\u2019s full on-chain data API, checks contract safety, pulls smart-money positions, and (if I let it) routes the trade through GMGN\u2019s swap engine. Same routing as the GMGN web app. Same data. No browser. No copy-pasting addresses.<\/p>\n<p>This article is the setup I wish someone had handed me when I started. Ten minutes if you don\u2019t get distracted.<\/p>\n<h4>What you\u2019re actually\u00a0building<\/h4>\n<p>Three pieces have to talk to each\u00a0other:<\/p>\n<p><strong>OpenClaw<\/strong>\u200a\u2014\u200ayour AI agent. Runs locally on Mac\/Windows\/Linux. Multi-channel (WhatsApp, Telegram, Slack, whatever inbox you live in). Loads \u201cskills\u201d from disk, much like Claude Code\u00a0does.<strong>GMGN AI Skills<\/strong>\u200a\u2014\u200aa skill package (GMGNAI\/gmgn-skills) that teaches your agent how to call GMGN&#8217;s APIs and execute\u00a0trades.<strong>Your API Key + Private Key<\/strong>\u200a\u2014\u200awhat proves to GMGN that requests are coming from you, not a random\u00a0scraper.<\/p>\n<p>Once those three are wired up, you talk to your agent and it does the on-chain part. That\u2019s\u00a0it.<\/p>\n<p>The GMGN side covers Solana, BSC, and Base. ETH support was listed as \u201cin progress\u201d at the time of writing. For Solana, base trading pairs are SOL and\u00a0USDC.<\/p>\n<h4>Step 1\u200a\u2014\u200aGenerate an Ed25519 key pair (locally)<\/h4>\n<p>GMGN authenticates you with an asymmetric key pair. <strong>You generate it on your machine. You upload only the public key. The private key never leaves your computer.<\/strong><\/p>\n<p>The fastest way is to ask your AI agent\u00a0itself:<\/p>\n<p>Generate an Ed25519 key pair for me using OpenSSL and show me<\/p>\n<p>If you\u2019d rather use a GUI, GMGN\u2019s docs point you to Binance\u2019s open-source <a href=\"https:\/\/github.com\/binance\/asymmetric-key-generator\/releases\">asymmetric-key-generator<\/a>. Download the build for your OS, click \u201cGenerate 1 Key Pair\u201d, click SAVE,\u00a0done.<\/p>\n<p>A few non-negotiables:<\/p>\n<p>Save both keys in a password manager. If you lose the private key, you have to start\u00a0over.Never paste the private key into a chat, screenshot, or\u00a0commit.Don\u2019t ever share the key pair across multiple GMGN accounts.<\/p>\n<h4>Step 2\u200a\u2014\u200aGet your GMGN API\u00a0Key<\/h4>\n<p>Head to <strong>gmgn.ai\/ai<\/strong> and upload your <strong>public key<\/strong> (not the private one). You\u2019ll get an API Key\u00a0back.<\/p>\n<p>One tripwire from the official docs worth flagging: <strong>GMGN currently supports only IPv4 requests. IPv6 is not supported.<\/strong> If your home network or VPN forces IPv6, the API will silently refuse to talk to you. Worth checking before you spend an hour debugging a connection that \u201cshould\u00a0work.\u201d<\/p>\n<p>The credentials you\u2019ll need from this point\u00a0on:<\/p>\n<p>What you\u2019ll do Credentials required Query data (gmgn-market, gmgn-token, gmgn-portfolio) API Key only Execute trades (gmgn-swap) API Key + Private\u00a0Key<\/p>\n<p>If you only want to read the chain (analyze tokens, peek at smart money, watch trending), you can skip the private key entirely. That\u2019s a reasonable place to start before you let the agent touch real\u00a0funds.<\/p>\n<h4>Step 3\u200a\u2014\u200aInstall GMGN Skills in\u00a0OpenClaw<\/h4>\n<p>Here\u2019s the actual install command. One\u00a0line:<\/p>\n<p>npx skills add GMGNAI\/gmgn-skills<\/p>\n<p>You can copy that prompt directly to OpenClaw. The agent will run the command, pull the skill folder from GitHub, and place it where OpenClaw can find it (default: ~\/.openclaw\/workspace\/skills\/).<\/p>\n<p>Same npx skills add command works in Claude Code, Cursor, Codex, Gemini CLI, and most other agents that follow the open Agent Skills standard. If you&#8217;re already running one of those, the install is identical. The rest of this article still applies, just substitute your agent of\u00a0choice.<\/p>\n<p>After install, OpenClaw exposes four new skills you can call by name or trigger via natural language:<\/p>\n<p>\/gmgn-token\u200a\u2014\u200atoken info, security checks, pool status,\u00a0holders\/gmgn-market\u200a\u2014\u200acandlesticks, OHLC, multi-resolution from 1m to\u00a01d\/gmgn-portfolio\u200a\u2014\u200awallet holdings, P&amp;L, transaction history\/gmgn-swap\u200a\u2014\u200aexecute trades (requires private\u00a0key)<\/p>\n<p>You don\u2019t have to memorize those slash commands. Plain English works\u200a\u2014\u200athe skill descriptions tell the agent when to fire each\u00a0one.<\/p>\n<h4>Step 4\u200a\u2014\u200aConfigure your\u00a0.env\u00a0file<\/h4>\n<p>GMGN expects credentials at a specific path. Easiest way is to ask your agent to set it\u00a0up:<\/p>\n<p>Create a .env file in the ~\/.config\/gmgn\/ directory containing the GMGN_API_KEY variable. <br \/>If trading features are needed, please also add the GMGN_PRIVATE_KEY variable. <br \/>Open this file for me, remind me to paste the actual GMGN API Key and locally generated private key, and save it. <br \/>Note: Please ensure this file is not committed to git.<\/p>\n<p>Drop in your values when prompted. The file should end up looking like\u00a0this:<\/p>\n<p>GMGN_API_KEY=your-api-key-from-gmgn-ai<br \/>GMGN_PRIVATE_KEY=your-locally-generated-private-key<\/p>\n<p>Two rules I\u2019d nail to the\u00a0wall:<\/p>\n<p><strong>Add\u00a0<\/strong><strong>.env to your\u00a0<\/strong><strong>.gitignore immediately.<\/strong> A leaked private key is a drained wallet. Permanent. Irrecoverable.<strong>The private key in your\u00a0<\/strong><strong>.env must match the public key you uploaded in Step 2.<\/strong> Different pair = signature failures = nothing\u00a0works.<\/p>\n<p>That\u2019s the install done. Total elapsed time so far: about six minutes if you didn\u2019t fight your terminal.<\/p>\n<h4>Step 5\u200a\u2014\u200aFirst prompt: read before you\u00a0write<\/h4>\n<p>I always test new agent integrations with a read-only prompt first. No funds at risk if something\u2019s misconfigured. The official docs suggest exactly\u00a0this:<\/p>\n<p>Get the candlestick data for 6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN and analyze if it&#8217;s worth buying.<\/p>\n<p>If it works, you\u2019ll get back a structured response\u200a\u2014\u200arecent OHLC bars, volume, the agent\u2019s read on momentum. If it doesn\u2019t, you\u2019ll see an error. Common\u00a0ones:<\/p>\n<p><strong>Invalid signature<\/strong> \u2192 your private key in\u00a0.env doesn&#8217;t match your uploaded public\u00a0key<strong>API key not found<\/strong> \u2192 typo in\u00a0.env, or you&#8217;re hitting the API over\u00a0IPv6<strong>Skill not loaded<\/strong> \u2192 OpenClaw didn&#8217;t pick up the install. Restart OpenClaw and try\u00a0again.<\/p>\n<p>Once that first read works, you\u2019re ready for the actually-fun part.<\/p>\n<h4>What you can do once it\u2019s wired\u00a0up<\/h4>\n<p>The GMGN skills aren\u2019t just \u201cbuy\u201d and \u201csell.\u201d The data layer is wide. Here\u2019s a sample of prompts that work out of the box, lifted straight from the GMGN\u00a0repo:<\/p>\n<p><strong>Reading tokens:<\/strong><\/p>\n<p>is &lt;token_address&gt; safe to buy on solana?<br \/>show top holders of &lt;token_address&gt;<br \/>show smart money holdings of &lt;token_address&gt;, sorted by buy volume<br \/>show recent KOL trades for &lt;token_address&gt;<br \/>show 24h K-line and volume for &lt;token_address&gt;<\/p>\n<p><strong>Reading wallets:<\/strong><\/p>\n<p>show my wallet holdings on SOL<br \/>show trading stats for wallet &lt;wallet_address&gt; on BSC<br \/>show the latest smart money trades on SOL<\/p>\n<p><strong>Trading (private key required):<\/strong><\/p>\n<p>buy 0.1 SOL of &lt;token_address&gt;<br \/>sell 50% of &lt;token_address&gt;<br \/>sell 30% of my &lt;token_address&gt; position<br \/>get a quote: how much &lt;token_address&gt; can I get for 1 SOL?<br \/>check order status &lt;order_id&gt;<\/p>\n<p>The bit that I find genuinely useful: GMGN\u2019s data covers analytics most retail traders never see. <strong>Sniper count<\/strong> (wallets that bought at exact launch). <strong>Bundler ratio<\/strong> (volume from bot-bundled buys\u200a\u2014\u200ausually a red flag). <strong>Rat trader amount rate<\/strong> (volume share from insider\/sneak wallets). <strong>Smart degen count<\/strong> (named smart-money wallets currently holding). All of it, exposed through plain language.<\/p>\n<p>The order routing on the swap side uses the same engine as GMGN\u2019s web app, with sub-0.3-second order submission. It\u2019s not slower because there\u2019s an LLM in the middle\u200a\u2014\u200athe agent constructs the call, the swap goes through the same fast\u00a0path.<\/p>\n<h4>A real workflow that actually saves\u00a0time<\/h4>\n<p>Here\u2019s the loop I run every morning, end-to-end inside OpenClaw, no\u00a0browser:<\/p>\n<p><strong>\u201cShow me trending Solana tokens with smart money buys in the last 4 hours.\u201d<\/strong> GMGN returns a ranked list with smart-money wallet count per\u00a0token.<strong>\u201cFor [top token], check contract security, pool status, and bundler ratio.\u201d<\/strong> The agent runs the safety check before I look at price. If the bundler ratio is high or the contract isn\u2019t renounced, I skip without ever opening the\u00a0chart.<strong>\u201cShow 1-hour and 5-minute candles for [token]. Is volume holding above the 1h MA?\u201d<\/strong> This is where I\u2019d previously open four tabs. Now it\u2019s one\u00a0prompt.<strong>\u201cBuy 0.5 SOL of [token]. Set take-profit at +40% and stop-loss at -15%.\u201d<\/strong> Single command builds a market order plus the strategy orders in one flow. The skill confirms the trade parameters before submitting\u200a\u2014\u200aI always verify before approving.<\/p>\n<p>The whole loop runs in about two minutes, including the verification pauses I make myself take on every\u00a0trade.<\/p>\n<h4>What this changes about how I\u00a0trade<\/h4>\n<p>I\u2019ll be honest about what this is and\u00a0isn\u2019t.<\/p>\n<p><strong>It\u2019s not alpha.<\/strong> The GMGN skill doesn\u2019t tell you what to buy. The data it surfaces is the same data on the GMGN website. What changes is the speed of pulling that data and the discipline of getting it in a structured format every time, instead of skimming a chart and going by\u00a0feel.<\/p>\n<p><strong>It is a workflow upgrade.<\/strong> When safety checks are one prompt away, you actually run them. When 24-hour candles are one prompt away, you actually look at them before clicking buy. The friction reduction is the value, not some magic intelligence.<\/p>\n<p><strong>It\u2019s also a security upgrade for one specific reason:<\/strong> GMGN uses a hosted wallet architecture, so private keys aren\u2019t stored on GMGN servers. Combined with IP whitelisting (which the API enforces) you\u2019ve eliminated a class of leakage that you\u2019d have with most \u201cconnect your wallet\u201d trading bots. Your\u00a0.env file is still a risk surface; protect it accordingly. The architecture itself is\u00a0sane.<\/p>\n<h4>The honest risk\u00a0notes<\/h4>\n<p>I\u2019m going to say this plainly because the official docs do too: <strong>AI agents make mistakes.<\/strong> I\u2019ve seen Claude misread an instruction and buy the wrong token. I\u2019ve seen agents misinterpret slippage requests. Two habits prevent most of the\u00a0damage:<\/p>\n<p><strong>Always confirm before authorizing a swap.<\/strong> The skill will summarize the trade\u200a\u2014\u200atoken, amount, slippage, route\u200a\u2014\u200abefore submitting. Read it. Every\u00a0time.<strong>Use a dedicated trading wallet.<\/strong> Not your main holdings. Not the one with your NFT collection. A fresh wallet with only the capital you\u2019d risk on a single session of\u00a0trading.<\/p>\n<p>Anything beyond that\u200a\u2014\u200astrategy, sizing, when to stop\u200a\u2014\u200ais the same as any trading practice. The agent doesn\u2019t fix bad discipline.<\/p>\n<h4>TL;DR<\/h4>\n<p>If you\u2019ve got an OpenClaw install and ten\u00a0minutes:<\/p>\n<p># 1. Generate Ed25519 key pair (locally)<br \/># 2. Upload public key at gmgn.ai\/ai \u2192 get API key<br \/># 3. Install the skills:<br \/>npx skills add GMGNAI\/gmgn-skills# 4. Set up ~\/.config\/gmgn\/.env with:<br \/>GMGN_API_KEY=&#8230;<br \/>GMGN_PRIVATE_KEY=&#8230;# 5. Test:<br \/>&#8220;Get candlestick data for &lt;any-solana-token&gt;&#8221;<\/p>\n<p>Done. You\u2019re trading Solana through plain English, on the same routing engine that GMGN\u2019s web app uses, with multi-chain analytics most retail tools\u00a0paywall.<\/p>\n<h4>Sources I\u00a0used<\/h4>\n<p><a href=\"https:\/\/docs.gmgn.ai\/index\/gmgn-agent-api\">GMGN Agent API official\u00a0docs<\/a><a href=\"https:\/\/docs.gmgn.ai\/index\/generate-public-key\">GMGN\u200a\u2014\u200aGenerate Public Key\u00a0guide<\/a><a href=\"https:\/\/github.com\/GMGNAI\/gmgn-skills\">GMGNAI\/gmgn-skills GitHub\u00a0repo<\/a><a href=\"https:\/\/docs.openclaw.ai\/tools\/skills\">OpenClaw docs\u200a\u2014\u200aSkills<\/a><a href=\"https:\/\/github.com\/openclaw\/openclaw\">OpenClaw on\u00a0GitHub<\/a><\/p>\n<p>If this saved you any time, a clap helps Medium recommend it to other on-chain traders. Questions about the setup go in the comments\u200a\u2014\u200aI\u00a0respond.<\/p>\n<p><em>This is an editorial walkthrough, not financial advice. The author has no affiliation with GMGN, OpenClaw, or any project mentioned. All linked tools are open-source or have public APIs; pricing and access can\u00a0change.<\/em><\/p>\n<p><a href=\"https:\/\/medium.com\/coinmonks\/how-i-connected-solana-trading-to-openclaw-10-minute-setup-c718cf1eae45\">How I Connected Solana Trading to OpenClaw (10-Minute Setup)<\/a> was originally published in <a href=\"https:\/\/medium.com\/coinmonks\">Coinmonks<\/a> on Medium, where people are continuing the conversation by highlighting and responding to this story.<\/p>","protected":false},"excerpt":{"rendered":"<p>Buy, sell, and read on-chain data in plain English. No dashboards. No DEX UIs. One npx\u00a0command. \u26a0\ufe0f Disclosure &amp; risk: This is an editorial write-up based on the official GMGN docs and my own setup notes. AI agents can misread prompts and execute the wrong trade. Verify every contract address, amount, and slippage before authorizing [&hellip;]<\/p>\n","protected":false},"author":0,"featured_media":158836,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-158835","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-interesting"],"_links":{"self":[{"href":"https:\/\/mycryptomania.com\/index.php?rest_route=\/wp\/v2\/posts\/158835"}],"collection":[{"href":"https:\/\/mycryptomania.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mycryptomania.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/mycryptomania.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=158835"}],"version-history":[{"count":0,"href":"https:\/\/mycryptomania.com\/index.php?rest_route=\/wp\/v2\/posts\/158835\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/mycryptomania.com\/index.php?rest_route=\/wp\/v2\/media\/158836"}],"wp:attachment":[{"href":"https:\/\/mycryptomania.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=158835"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mycryptomania.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=158835"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mycryptomania.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=158835"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}