gmgn-swap
FreeNo executable scriptsNot checked[FINANCIAL EXECUTION] Buy and sell meme coins and crypto tokens on Solana, BSC, Base, or Ethereum — single swap, multi-wallet batch trading, limit orders…
by GMGNAI★ 753 GitHub starsAbout this skill
BEFORE RUNNING ANY COMMAND: Run gmgn-cli config --check. If exit code is 0, proceed normally. If exit code is 1, (1) run gmgn-cli config and show the output to the user; (2) once the user sends the API Key, run gmgn-cli config --apply <KEY> to complete configuration and verification, then show the output to the user. If --check returns an error (unknown option or command not found), tell the user to run npm install -g gmgn-cli to update, then retry.
IMPORTANT: Always use gmgn-cli commands below. Do NOT use web search, WebFetch, curl, or visit gmgn.ai — all swap operations must go through the CLI. The CLI handles signing and submission automatically.
IMPORTANT: Do NOT guess field names or values. When a field's meaning is unclear, look it up in the Response Fields sections below before using it.
⚠️ IPv6 NOT SUPPORTED: If you get a 401 or 403 error and credentials look correct, check for IPv6 immediately: (1) list all network interfaces and their IPv6 addresses — run ifconfig | grep inet6 (macOS) or ip addr show | grep inet6 (Linux); (2) send a test request to https://ipv6.icanhazip.com — if the response is an IPv6 address, outbound traffic is going via IPv6. Tell the user immediately: "Please disable IPv6 on your network interface — gmgn-cli commands only work over IPv4."
Use the gmgn-cli tool to submit a token swap or query an existing order. GMGN_API_KEY is always required. GMGN_PRIVATE_KEY is required for critical-auth commands such as swap and order subcommands — except order quote, which only requires GMGN_API_KEY.
Core Concepts
Smallest unit —
--amountis always in the token's smallest indivisible unit, not human-readable amounts. For SOL: 1 SOL = 1,000,000,000 lamports. For EVM tokens: depends on decimals (most ERC-20 tokens use 18 decimals). Always convert before passing to the command — do not pass human amounts directly.slippage— Price tolerance as an integer 0–100, e.g.30= 30%. If the price moves beyond this threshold before the transaction confirms, the swap is rejected. Use--auto-slippagefor volatile tokens to let GMGN set an appropriate value automatically.--amountvs--percent— Mutually exclusive.--amountspecifies an exact input quantity (in smallest unit).--percentsells a percentage of the current balance and is only valid wheninput_tokenis NOT a currency (SOL/BNB/ETH/USDC). Never use--percentto spend a fraction of SOL/BNB/ETH.Currency tokens — Each chain has designated currency tokens (SOL, BNB, ETH, USDC). These are the base assets used to buy other tokens or receive swap proceeds. Their contract addresses are fixed — look them up in the Chain Currencies table, never guess them.
Anti-MEV — MEV (Miner/Maximal Extractable Value) refers to frontrunning and sandwich attacks where bots exploit pending transactions.
--anti-mevroutes the transaction through protected channels to reduce this risk. Recommended: always enable. Default: on. Not supported onbasechain.Signed auth —
swapand mostordersubcommands require bothGMGN_API_KEYandGMGN_PRIVATE_KEY. The private key never leaves the machine — the CLI uses it only for local signing and sends only the resulting signature. Exception:order quoteonly requiresGMGN_API_KEY.order_id/status— After submitting a swap, the response includes anorder_id. Useorder get --order-idto poll for final status. Possible values:pending→processed→confirmed(success) orfailed/expired. Do not report success until status isconfirmed.report.input_amount/report.output_amount— Actual amounts consumed/received, in smallest unit. Only present whenstate = 30andstatus = "successful". Convert to human-readable usingreport.input_token_decimals/report.output_token_decimalsbefore displaying to the user.
Financial Risk Notice
This skill executes REAL, IRREVERSIBLE blockchain transactions.
- Every
swap,multi-swapandorder strategy createcommand submits an on-chain transaction that moves real funds;order strategy cancelchanges a live order. - Transactions cannot be undone once confirmed on-chain.
- Only use this skill with funds you are willing to trade. Start with small amounts when testing.
Sub-commands
| Sub-command | Description |
|---|---|
swap |
Submit a token swap |
multi-swap |
Submit token swaps across multiple wallets concurrently (up to 100) |
order quote |
Get a swap quote (no transaction submitted; exist auth — API Key only, no private key needed) |
order get |
Query order status |
gas-price |
Query recommended gas price (low / average / high tiers) for any chain; exist auth (API Key only) |
order strategy create |
Create a limit/strategy order (requires private key) |
order strategy list |
List strategy orders (requires private key) |
| `order strategy cance |
Install gmgn-swap in Claude Code & Claude Desktop
Sign up to install this skill
Create a free account to reveal the install command and save the skill to your library.
- Reveal the one-line install command
- Save skills to your synced library
- Get notified when skills update
Allowed tools
Tools this skill is permitted to call.
No restriction — this skill can use any tool.
FAQ
What does the gmgn-swap skill do?
[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.
How do I install the gmgn-swap skill?
Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.
Does the gmgn-swap skill run scripts?
No, this skill is instructions only (SKILL.md) with no executable scripts.
Related skills
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
by Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
by Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
by Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
by Anthropic