Buy, sell, and read on-chain data in plain English. No dashboards. No DEX UIs. One npx command. I have eight tabs open right now. GMGN’s web app, Photon, BBuy, sell, and read on-chain data in plain English. No dashboards. No DEX UIs. One npx command. I have eight tabs open right now. GMGN’s web app, Photon, B

How I Connected Solana Trading to OpenClaw (10-Minute Setup)

2026/05/01 00:45
10 min read
For feedback or concerns regarding this content, please contact us at [email protected]

Buy, sell, and read on-chain data in plain English. No dashboards. No DEX UIs. One npx command.

I have eight tabs open right now. GMGN’s web app, Photon, BullX, Phantom, DEXRabbit, Solscan, X, and a half-broken spreadsheet pretending to track P&L. If you trade Solana memecoins seriously, this is probably your setup too.

Last week I replaced about six of those tabs with one prompt:

That prompt runs through OpenClaw, a local-first AI agent, using something called the GMGN AI Skills. The agent reads GMGN’s full on-chain data API, checks contract safety, pulls smart-money positions, and (if I let it) routes the trade through GMGN’s swap engine. Same routing as the GMGN web app. Same data. No browser. No copy-pasting addresses.

This article is the setup I wish someone had handed me when I started. Ten minutes if you don’t get distracted.

What you’re actually building

Three pieces have to talk to each other:

  1. OpenClaw — your AI agent. Runs locally on Mac/Windows/Linux. Multi-channel (WhatsApp, Telegram, Slack, whatever inbox you live in). Loads “skills” from disk, much like Claude Code does.
  2. GMGN AI Skills — a skill package (GMGNAI/gmgn-skills) that teaches your agent how to call GMGN's APIs and execute trades.
  3. Your API Key + Private Key — what proves to GMGN that requests are coming from you, not a random scraper.

Once those three are wired up, you talk to your agent and it does the on-chain part. That’s it.

The GMGN side covers Solana, BSC, and Base. ETH support was listed as “in progress” at the time of writing. For Solana, base trading pairs are SOL and USDC.

Step 1 — Generate an Ed25519 key pair (locally)

GMGN authenticates you with an asymmetric key pair. You generate it on your machine. You upload only the public key. The private key never leaves your computer.

The fastest way is to ask your AI agent itself:

Generate an Ed25519 key pair for me using OpenSSL and show me

If you’d rather use a GUI, GMGN’s docs point you to Binance’s open-source asymmetric-key-generator. Download the build for your OS, click “Generate 1 Key Pair”, click SAVE, done.

A few non-negotiables:

  • Save both keys in a password manager. If you lose the private key, you have to start over.
  • Never paste the private key into a chat, screenshot, or commit.
  • Don’t ever share the key pair across multiple GMGN accounts.

Step 2 — Get your GMGN API Key

Head to gmgn.ai/ai and upload your public key (not the private one). You’ll get an API Key back.

One tripwire from the official docs worth flagging: GMGN currently supports only IPv4 requests. IPv6 is not supported. 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 “should work.”

The credentials you’ll need from this point on:

What you’ll do Credentials required Query data (gmgn-market, gmgn-token, gmgn-portfolio) API Key only Execute trades (gmgn-swap) API Key + Private Key

If you only want to read the chain (analyze tokens, peek at smart money, watch trending), you can skip the private key entirely. That’s a reasonable place to start before you let the agent touch real funds.

Step 3 — Install GMGN Skills in OpenClaw

Here’s the actual install command. One line:

npx skills add GMGNAI/gmgn-skills

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/).

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're already running one of those, the install is identical. The rest of this article still applies, just substitute your agent of choice.

After install, OpenClaw exposes four new skills you can call by name or trigger via natural language:

  • /gmgn-token — token info, security checks, pool status, holders
  • /gmgn-market — candlesticks, OHLC, multi-resolution from 1m to 1d
  • /gmgn-portfolio — wallet holdings, P&L, transaction history
  • /gmgn-swap — execute trades (requires private key)

You don’t have to memorize those slash commands. Plain English works — the skill descriptions tell the agent when to fire each one.

Step 4 — Configure your .env file

GMGN expects credentials at a specific path. Easiest way is to ask your agent to set it up:

Create a .env file in the ~/.config/gmgn/ directory containing the GMGN_API_KEY variable.
If trading features are needed, please also add the GMGN_PRIVATE_KEY variable.
Open this file for me, remind me to paste the actual GMGN API Key and locally generated private key, and save it.
Note: Please ensure this file is not committed to git.

Drop in your values when prompted. The file should end up looking like this:

GMGN_API_KEY=your-api-key-from-gmgn-ai
GMGN_PRIVATE_KEY=your-locally-generated-private-key

Two rules I’d nail to the wall:

  1. Add .env to your .gitignore immediately. A leaked private key is a drained wallet. Permanent. Irrecoverable.
  2. The private key in your .env must match the public key you uploaded in Step 2. Different pair = signature failures = nothing works.

That’s the install done. Total elapsed time so far: about six minutes if you didn’t fight your terminal.

Step 5 — First prompt: read before you write

I always test new agent integrations with a read-only prompt first. No funds at risk if something’s misconfigured. The official docs suggest exactly this:

Get the candlestick data for 6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN and analyze if it's worth buying.

If it works, you’ll get back a structured response — recent OHLC bars, volume, the agent’s read on momentum. If it doesn’t, you’ll see an error. Common ones:

  • Invalid signature → your private key in .env doesn't match your uploaded public key
  • API key not found → typo in .env, or you're hitting the API over IPv6
  • Skill not loaded → OpenClaw didn't pick up the install. Restart OpenClaw and try again.

Once that first read works, you’re ready for the actually-fun part.

What you can do once it’s wired up

The GMGN skills aren’t just “buy” and “sell.” The data layer is wide. Here’s a sample of prompts that work out of the box, lifted straight from the GMGN repo:

Reading tokens:

is <token_address> safe to buy on solana?
show top holders of <token_address>
show smart money holdings of <token_address>, sorted by buy volume
show recent KOL trades for <token_address>
show 24h K-line and volume for <token_address>

Reading wallets:

show my wallet holdings on SOL
show trading stats for wallet <wallet_address> on BSC
show the latest smart money trades on SOL

Trading (private key required):

buy 0.1 SOL of <token_address>
sell 50% of <token_address>
sell 30% of my <token_address> position
get a quote: how much <token_address> can I get for 1 SOL?
check order status <order_id>

The bit that I find genuinely useful: GMGN’s data covers analytics most retail traders never see. Sniper count (wallets that bought at exact launch). Bundler ratio (volume from bot-bundled buys — usually a red flag). Rat trader amount rate (volume share from insider/sneak wallets). Smart degen count (named smart-money wallets currently holding). All of it, exposed through plain language.

The order routing on the swap side uses the same engine as GMGN’s web app, with sub-0.3-second order submission. It’s not slower because there’s an LLM in the middle — the agent constructs the call, the swap goes through the same fast path.

A real workflow that actually saves time

Here’s the loop I run every morning, end-to-end inside OpenClaw, no browser:

  1. “Show me trending Solana tokens with smart money buys in the last 4 hours.” GMGN returns a ranked list with smart-money wallet count per token.
  2. “For [top token], check contract security, pool status, and bundler ratio.” The agent runs the safety check before I look at price. If the bundler ratio is high or the contract isn’t renounced, I skip without ever opening the chart.
  3. “Show 1-hour and 5-minute candles for [token]. Is volume holding above the 1h MA?” This is where I’d previously open four tabs. Now it’s one prompt.
  4. “Buy 0.5 SOL of [token]. Set take-profit at +40% and stop-loss at -15%.” Single command builds a market order plus the strategy orders in one flow. The skill confirms the trade parameters before submitting — I always verify before approving.

The whole loop runs in about two minutes, including the verification pauses I make myself take on every trade.

What this changes about how I trade

I’ll be honest about what this is and isn’t.

It’s not alpha. The GMGN skill doesn’t 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 feel.

It is a workflow upgrade. 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.

It’s also a security upgrade for one specific reason: GMGN uses a hosted wallet architecture, so private keys aren’t stored on GMGN servers. Combined with IP whitelisting (which the API enforces) you’ve eliminated a class of leakage that you’d have with most “connect your wallet” trading bots. Your .env file is still a risk surface; protect it accordingly. The architecture itself is sane.

The honest risk notes

I’m going to say this plainly because the official docs do too: AI agents make mistakes. I’ve seen Claude misread an instruction and buy the wrong token. I’ve seen agents misinterpret slippage requests. Two habits prevent most of the damage:

  1. Always confirm before authorizing a swap. The skill will summarize the trade — token, amount, slippage, route — before submitting. Read it. Every time.
  2. Use a dedicated trading wallet. Not your main holdings. Not the one with your NFT collection. A fresh wallet with only the capital you’d risk on a single session of trading.

Anything beyond that — strategy, sizing, when to stop — is the same as any trading practice. The agent doesn’t fix bad discipline.

TL;DR

If you’ve got an OpenClaw install and ten minutes:

# 1. Generate Ed25519 key pair (locally)
# 2. Upload public key at gmgn.ai/ai → get API key
# 3. Install the skills:
npx skills add GMGNAI/gmgn-skills

# 4. Set up ~/.config/gmgn/.env with:
GMGN_API_KEY=...
GMGN_PRIVATE_KEY=...

# 5. Test:
"Get candlestick data for <any-solana-token>"

Done. You’re trading Solana through plain English, on the same routing engine that GMGN’s web app uses, with multi-chain analytics most retail tools paywall.

Sources I used

  • GMGN Agent API official docs
  • GMGN — Generate Public Key guide
  • GMGNAI/gmgn-skills GitHub repo
  • OpenClaw docs — Skills
  • OpenClaw on GitHub

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 — I respond.

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 change.


How I Connected Solana Trading to OpenClaw (10-Minute Setup) was originally published in Coinmonks on Medium, where people are continuing the conversation by highlighting and responding to this story.

Disclaimer: The articles reposted on this site are sourced from public platforms and are provided for informational purposes only. They do not necessarily reflect the views of MEXC. All rights remain with the original authors. If you believe any content infringes on third-party rights, please contact [email protected] for removal. MEXC makes no guarantees regarding the accuracy, completeness, or timeliness of the content and is not responsible for any actions taken based on the information provided. The content does not constitute financial, legal, or other professional advice, nor should it be considered a recommendation or endorsement by MEXC.