
Gmgn Swap
Execute guarded buy/sell/swap and advanced orders on Solana, BSC, Base, or Ethereum through gmgn-cli when a solo builder wants agent-driven meme-coin trading with mandatory confirmation.
Overview
gmgn-swap is an agent skill for the Build phase that executes GMGN-backed crypto swaps and orders on Solana, BSC, Base, and Ethereum only after explicit user confirmation.
Install
npx skills add https://github.com/gmgnai/gmgn-skills --skill gmgn-swapWhat is this skill?
- Routes all trading exclusively through gmgn-cli—no web search, WebFetch, curl, or gmgn.ai browsing; CLI signs and submit
- Supports four chains: Solana, BSC, Base, and Ethereum with chain-scoped swap, gas-price, and order commands
- Single swap plus multi-wallet batch trading with optional delay between wallet executions
- Limit orders and smart_trade strategies including stop loss, take profit, trailing variants, and mix_trade sub-order typ
- Mandatory financial-risk verbal acknowledgment plus explicit user confirmation before any buy/sell/swap execution
- Four supported chains: Solana, BSC, Base, and Ethereum
- Smart_trade sub-order types include buy_low, buy_high, stop_loss, take_profit, and mix_trade
- Mandatory two-step gate: financial-risk verbal acknowledgment plus explicit confirmation before execution
Adoption & trust: 5.3k installs on skills.sh; 324 GitHub stars; 1/3 security scanners passed (skills.sh audits).
What problem does it solve?
You need your coding agent to buy, sell, or schedule crypto trades without hand-rolling GMGN API calls, wrong field names, or unsafe one-click execution.
Who is it for?
Solo builders already using GMGN and gmgn-cli who want repeatable, confirmation-gated swap and order automation across Solana, BSC, Base, or Ethereum wallets.
Skip if: Non-crypto product work, unattended trading without human confirmation, or environments where you cannot run gmgn-cli with working IPv4 when GMGN rejects IPv6 clients.
When should I use this skill?
User asks to buy, sell, or swap a token, trade from multiple wallets, set a limit order, stop loss, take profit, trailing stop, or check order status—requires explicit user confirmation.
What do I get? / Deliverables
After risk acknowledgment and confirmation, gmgn-cli submits swaps, batch wallet trades, or limit/smart-trade orders and returns order IDs and status you can monitor with follow-up CLI commands.
- Executed swap or scheduled GMGN order with CLI-reported transaction or order identifiers
- Batch trade results across configured wallets when using multi-wallet mode
- Order or strategy status output from order get and strategy list/create commands
Recommended Skills
Journey fit
The skill is a GMGN API integration delivered as gmgn-cli workflows, which maps to the Build phase integrations shelf for wiring external financial execution into an agent stack. Integrations is the canonical home for third-party CLI/API connectors; every swap, batch, and order command is GMGN-specific integration surface area, not generic product planning or launch work.
How it compares
A confirmation-gated agent skill package around gmgn-cli—not a generic DeFi MCP server or ad-hoc gmgn.ai scraping.
Common Questions / FAQ
Who is gmgn-swap for?
It is for solo and indie builders who trade meme coins and tokens through GMGN and want their agent to use gmgn-cli for swaps, batch wallets, and order strategies with mandatory human confirmation.
When should I use gmgn-swap?
Use it when a user asks to buy, sell, or swap a token, trade from multiple wallets, create or list limit or smart_trade orders (stop loss, take profit, trailing), check order status, or fetch gas prices—always via gmgn-cli, never via web fetch to gmgn.ai.
Is gmgn-swap safe to install?
It handles real funds and private-key-backed execution, so treat it as high-risk financial tooling; review the Security Audits panel on this Prism page and only enable it with explicit confirmation workflows and credential hygiene.
SKILL.md
READMESKILL.md - Gmgn Swap
**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 all `order` subcommands, including `order quote`. ## Core Concepts - **Smallest unit** — `--amount` is 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-slippage` for volatile tokens to let GMGN set an appropriate value automatically. - **`--amount` vs `--percent`** — Mutually exclusive. `--amount` specifies an exact input quantity (in smallest unit). `--percent` sells a percentage of the current balance and is only valid when `input_token` is NOT a currency (SOL/BNB/ETH/USDC). Never use `--percent` to 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-mev` routes the transaction through protected channels to reduce this risk. **Recommended: always enable.** Default: on. **Not supported on `base` chain.** - **Signed auth** — `swap` and all `order` subcommands require both `GMGN_API_KEY` and `GMGN_PRIVATE_KEY`. The private key never leaves the machine — the CLI uses it only for local signing and sends only the resulting signature. - **`order_id` / `status`** — After submitting a swap, the response includes an `order_id`. Use `order get --order-id` to poll for final status. Possible values: `pending` → `processed` → `confirmed` (success) or `failed` / `expired`. Do not report success until status is `con