PlugWiki

gmgn-swap skill for Claude: buy and sell crypto tokens through GMGN

Lets your agent buy and sell crypto tokens and set limit and stop-loss orders through GMGN. It submits real, irreversible on-chain trades.

Installs
17.7K
on skills.sh
Stars
636
on GitHub
Updated
Oct 2026
last repo commit

gmgn-swap makes your agent submit token swaps through the gmgn-cli command line. It can swap tokens, sell a percentage of a holding, trade from up to 100 wallets in one request, create limit, stop-loss, take-profit and trailing orders, check order status and read gas prices. The skill states that it executes real, irreversible blockchain transactions.

It needs gmgn-cli installed with npm, a GMGN API key and, for swaps and orders, a signing key, both in ~/.config/gmgn/.env. The trading wallet is the one bound to your GMGN API key (--from must match it). The README says the signing key only authenticates API requests and is not a wallet key, while SKILL.md says the two keys together can directly execute trades on the linked wallet. Treat both as trading access. Its safety check only reads two flags, honeypot and rug ratio, and it does not resolve token names, so a copycat token with the same name is not caught.

Good for

  • Active meme-coin traders on Solana, BNB Chain, Base or Ethereum who accept the risk
  • Traders who want stop-loss, take-profit or trailing orders set by prompt
  • Users who trade from several wallets at once

Install gmgn-swap

Claude Code

  1. 1

    Copy this prompt.

    Install the gmgn-swap skill in Claude Code. Run this command:
    
    npm install -g gmgn-cli
    npx skills add GMGNAI/gmgn-skills --agent claude-code --skill gmgn-swap
    
    Then check that it loaded and tell me how to use it.
  2. 2

    Paste it into Claude Code. It shows the change and asks before running it.

Requires Node.js.

The README's general install is npx skills add GMGNAI/gmgn-skills, which adds every GMGN skill. The commands above install only this one. The README also says gmgn-cli works only over IPv4. Its setup flow has the agent run openssl to write a key file to /tmp/gmgn_private.pem and append the keys to ~/.config/gmgn/.env.

From the project README. Source.

What's in the skill

When it loads

[FINANCIAL EXECUTION] Buy and sell meme coins and crypto tokens on Solana, BSC, Base, or Ethereum — single swap, multi-wallet batch trading, limit orders, stop loss, take profit, trailing stop loss, trailing take profit via GMGN API. Use when user asks to buy, sell, or swap a token, trade from multiple wallets, set a limit order, stop loss, take profit, or check order status. This skill SUBMITS the trade — it is the only skill holding a private key, and every buy still ends here. It is not the entry point for a buy that has not been vetted yet: 「帮我买 200u 的 PENGU」, "buy me $500 of BONK", 「帮我买点 dogwifhat」, 「XX 能不能买」 start at gmgn-token-buy, which resolves the name to the one right contract among its copycats, gates volume / depth / security, sizes slippage and gas, then hands the confirmed parameters back here to execute. Come straight here for a buy only once the contract is settled AND the user says they do not want a pre-buy check ("skip the security check", "I already checked", 「直接买」, 「不用尽调」, 「我很急」). Two facts make the split unavoidable rather than a preference: the pre-swap check here reads only `is_honeypot` and `rug_ratio`, and there is no name resolution at all — `--output-token` takes a contract address and the only names resolved here are the SOL/BNB/ETH/USDC currencies — so a same-name copycat is a total loss this skill has no way to catch. Everything else is unchanged and unconditionally this skill's: selling, percentage sells, swaps, multi-wallet batch trading, limit orders, stop loss, take profit, trailing orders, order status, gas prices.

Sections in SKILL.md

  1. Core Concepts
  2. Financial Risk Notice
  3. Sub-commands
  4. Supported Chains
  5. Chain Currencies
  6. Prerequisites
  7. Rate Limit Handling
  8. swap Usage
  9. swap Parameters
  10. ConditionOrder Fields (for --condition-orders)
  11. swap / order get Response Fields
  12. Report Fields (present only when status = "successful")
  13. Output Format
  14. Post-swap Receipt
  15. multi-swap Usage
  16. multi-swap Parameters

Key facts

Author
GMGN
License
MIT
Installs on skills.sh
17,652 (Nov 2, 2026)
Last commit
Oct 29, 2026

What it includes

  • Run gmgn-cli config --check first

    If no key is set, the agent runs gmgn-cli config and asks you for your API key.

    Runs code · Config check

  • Read honeypot and rug ratio before a swap

    Runs gmgn-cli token security. It aborts if is_honeypot is yes and warns if rug_ratio is above 0.3. You can tell it to skip the check.

    Network · Pre-swap check

  • Submit a token swap

    Buys or sells a token from the wallet bound to your API key. Amounts are in the smallest unit, and --percent works only when the input is not SOL, BNB, ETH or USDC. It then polls order status up to 3 times at 5-second intervals.

    Try: “Sell 50% of this token for SOL on Solana.”

    Runs code · swap

  • The same swap from many wallets

    Runs the swap from up to 100 wallets at once. Each wallet runs independently, so one failure does not stop the others.

    Runs code · multi-swap

  • Get an estimated output before swapping

    Gets an estimated output and submits no transaction. SKILL.md says it needs only the API key; the README says quotes use signed auth and need the private key.

    Network · order quote

  • Limit, stop-loss, take-profit and trailing orders

    Creates strategy orders such as buy_low, stop_loss, take_profit and mixed trades, including trailing take-profit and stop-loss. They fire later on price moves, until you cancel them.

    Runs code · order strategy create

  • See and cancel open strategy orders

    Lists orders and cancels a live one.

    Delete · order strategy list / cancel

  • Check an order's status

    Reads status from pending to confirmed, failed or expired.

    Network · order get

  • Low, average and high gas tiers

    Reads recommended gas prices for a chain.

    Network · gas-price

From the official docs

Permissions

High risk

What it can do

Watch out for

  • It submits real trades that cannot be undone

    Every swap, multi-swap and strategy order moves real funds, and the skill says confirmed transactions cannot be reversed. Use a dedicated wallet with small funds and approve each command by hand. github.com

  • The two keys together can trade from the bound wallet

    SKILL.md says the API key and private key can directly execute trades on the linked wallet. The README says the private key only signs API requests and is not a wallet key, and tells you to rotate it in the GMGN dashboard if exposed. Never paste either into chat, and bind a wallet you can afford to lose. github.com

  • No approval step is built in

    Neither file requires a confirmation prompt before a swap. The README only advises reviewing the trade summary and confirming. Strategy orders keep running on GMGN after the session ends, until cancelled. The wallet bound to the API key pays the amounts and fees. github.com

  • Setup has the agent create and store keys

    The README's setup flow has the agent run openssl to write a private key to /tmp/gmgn_private.pem, asks you to send the API key back in chat, and appends both keys to ~/.config/gmgn/.env (chmod 600 on that file). Delete the temporary key file afterward. github.com

  • The token check is shallow and can be skipped

    It reads only honeypot and rug ratio, has no name resolution, and the user can tell it to skip the check. Copycat tokens are not caught, so vet the contract address yourself. github.com

  • One command can trade from up to 100 wallets

    multi-swap runs the same trade across every wallet you list. Double-check the wallet list and amount before you approve. github.com

  • Installs a global npm program

    You install gmgn-cli with npm install -g, and the README has you whitelist your IP for swaps. Review the package before installing. github.com

Technical details
Turning on read-onlygas-price needs only the API key. order get and order quote are listed in SKILL.md as API key only, but the README says order quote needs the private key. swap, multi-swap and strategy orders need the private key.
Talks toGMGN OpenAPI via gmgn-cli
Sign-in and keysAPI key and private key in plaintext in ~/.config/gmgn/.env; the README says to chmod 600 it and keep it out of version control. SKILL.md says the CLI uses the private key only for local signing and sends the signature; the API key is sent in an X-APIKEY header over HTTPS.
Scopes
  • GMGN_API_KEY (bound to the trading wallet)

  • GMGN_PRIVATE_KEY (request-signing key for swaps and orders)

Questions

What does gmgn-swap do?

It lets your agent submit token trades through GMGN: swaps, percentage sells, multi-wallet batches, and limit, stop-loss, take-profit and trailing orders. It also checks order status and gas prices.

How do I install it in Claude Code, the Claude app or Codex?

Use the install box above. It also installs the gmgn-cli command line, which the skill calls for everything. The README documents the skills CLI and a Codex git clone, and does not document a Claude app upload.

Does it need an API key?

Yes. It needs a GMGN API key for every command, plus a signing key for swaps and strategy orders, both in ~/.config/gmgn/.env. The README says to whitelist your IP on the API key when you enable swap, and that gmgn-cli works only over IPv4.

Is it safe to install?

It can move real money, so install it only if you accept that. SKILL.md says it executes real, irreversible transactions and that the API key and signing key together can directly execute trades on the linked wallet. The README warns about model hallucination, prompt injection and uncontrolled execution. Our advice: bind a dedicated wallet with small funds, and keep your agent set to ask before each command.

Can it lose my money?

Yes. Swaps cannot be undone once confirmed on-chain. SKILL.md says to use only funds you are willing to trade and to start with small amounts. The README disclaimer says GMGN is not liable for losses from hallucination, prompt injection or confirmation errors.

Who pays, and does it ask me before trading?

The wallet bound to your API key pays: it supplies the input tokens and the priority, tip or gas fees you pass to the command. SKILL.md does not say whether GMGN charges a trade fee. It has no built-in approval step: the README only tells you to review the trade summary (chain, wallet, token addresses, amount) and confirm when it matches. So approval depends on your agent's permission prompts. Strategy orders you create keep running after the session ends, until cancelled.

Is GMGN_PRIVATE_KEY my wallet's private key?

The README says no: it is a request-signing key (Ed25519) for GMGN's API and does not directly control on-chain assets, and you rotate it in the GMGN dashboard if exposed. SKILL.md still says the API key and private key can directly execute trades on the linked wallet, so anyone holding both can trade from it. The key is used for local signing and only the signature is sent.

Does it protect me from scam tokens?

Only partly. Before a swap it reads two flags, honeypot and rug ratio, and the skill says it has no name resolution, so a copycat token with the same name is a total loss it cannot catch. The description sends vetted buys through gmgn-token-buy first.

What is gmgn-swap vs gmgn-track?

gmgn-swap submits trades and needs the signing key. gmgn-track reads follow-wallet, KOL and Smart Money trade activity. They install separately.

Information

updated Nov 2, 2026

Folder
skills/gmgn-swap

gmgnai/gmgn-skillsskills.sh

Sources

Docs, issue trackers and discussions this page is built from.

Show all 3
  1. gmgn-skills Readme · github.com
  2. gmgn-skills .codex/INSTALL.md · github.com
  3. gmgn-swap SKILL.md · github.com

Updated Nov 2, 2026.