Compare commits

...

30 Commits

Author SHA1 Message Date
GMGN.AI f5442f6247 1.4.2 2026-06-04 20:55:31 +08:00
GMGN.AI 0dabd4b93b Merge pull request #153 from GMGNAI/fix/strategy-slippage-and-sell-param-docs
fix(docs): update strategy examples slippage to integer and add sell-param
2026-06-04 20:54:53 +08:00
David Lau 73d81fa0b2 fix(docs): align slippage to integer 0–100 in all remaining files
Update Readme.md, Readme.zh.md, src/commands/swap.ts and cooking.ts
with integer 0–100 slippage examples (e.g. 30 = 30%) to match the
updated API validation and skill docs.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-04 20:09:27 +08:00
David Lau 4ef54b0bcc fix(docs): update strategy examples slippage to integer and add sell-param
- Change example slippage values from 0.01 to 30 (integer 0-100 scale)
- Add --sell-param option doc (required for smart_trade)
- Add --buy-param option doc
- Clarify --slippage description as integer 0-100

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-04 19:40:37 +08:00
GMGN.AI 2d0cb7348d 1.4.1 2026-06-04 17:12:00 +08:00
GMGN.AI ddc025bb97 Merge pull request #152 from prodev-nova/feat/cooking
docs(cooking): worked examples, platform matrix, TradeParam, anti-mev-mode fix
2026-06-04 17:11:17 +08:00
GMGN.AI e9b08214a2 1.4.0 2026-06-04 17:08:55 +08:00
GMGN.AI f96519941e Merge pull request #151 from GMGNAI/feat/smart-trade-order-strategy
feat(swap): add smart_trade order type to order strategy create
2026-06-04 17:04:37 +08:00
prodev-nova fd8a1c4d2a fix(cooking): anti-mev-mode values off / normal / secure
Correct the --anti-mev-mode enum to off / normal / secure
(across cooking.ts, SKILL.md, cli-usage.md, and the TradeParam examples).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 17:00:23 +08:00
prodev-nova 0282a9a09b docs(cooking): add worked examples, platform matrix, TradeParam; fix anti-mev-mode values
- Fix --anti-mev-mode values: off / jito / 0slot (was normal / secure)
- Add platform capability matrix (per-platform fields, bundle/sniper
  wallet limits, cashback/mayhem support)
- Add Quote Token conversion guidance for --raised-token launches
- Add full TradeParam field table for --buy/sell-trade-config
- Add two full worked CLI examples (Pump bundle+sniper+autosell+buyback,
  FourMeme fee-split + USDT raise token)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 16:34:27 +08:00
David Lau 17d7de841e feat(swap): add smart_trade order type to order strategy create
- Add --order-type smart_trade and --sub-order-type mix_trade support
- Make --check-price optional (required for limit_order, omitted for smart_trade)
- Add --open-price, --quote-investment, --condition-orders options
- Update StrategyCreateParams interface: check_price optional, add condition_orders/quote_investment
- Update SKILL.md and cli-usage.md docs with smart_trade examples and parameter table

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-04 14:27:01 +08:00
davidsx bc64360e80 Merge pull request #150 from prodev-nova/fix/pump-fee-share-provider
fix(cooking): correct pump fee-share provider values
2026-06-03 21:00:53 +08:00
prodev-nova 134a11593c fix(cooking): correct pump fee-share provider values
The pump_fee_share_list `provider` field rejected "wallet" with
"unknown provider: wallet". Valid values are solana / twitter / github.

- OpenApiClient: update PumpFeeShareInfo provider comment
- SKILL.md / cli-usage.md: provider enum solana / twitter / github,
  username is a SOL address when provider = solana

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-03 20:50:54 +08:00
GMGN.AI 32d2fd2aac 1.3.9 2026-06-03 19:25:23 +08:00
GMGN.AI 8ed53df6d7 Merge pull request #149 from GMGNAI/fix/activity-type-camelcase
fix(portfolio): rename activity type values to camelCase
2026-06-03 16:50:32 +08:00
David Lau a161bd733d fix(portfolio): rename activity type values to camelCase
- Rename transfer_in/transfer_out → transferIn/transferOut in portfolio activity --type filter
- Update SKILL.md and portfolio.ts help text to reflect new enum values

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-03 16:27:53 +08:00
GMGN.AI f172b1922d 1.3.8 2026-06-02 17:18:54 +08:00
GMGN.AI 31f5b9f5b6 Merge pull request #148 from prodev-nova/feat/cooking
feat(cooking): complete create_token params, auto-sell, and fixes
2026-06-02 15:15:48 +08:00
prodev-nova c6fae6afe7 docs(cooking): use "exist auth" not "normal auth" for cooking stats
Address review feedback on PR #148: cooking stats uses exist auth
(authExistRequest), matching the CLI client and project terminology.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-02 14:50:49 +08:00
prodev-nova ec5719ce12 feat(cooking): complete create params, fix Flap split & pump provider
- Add advanced create_token params: description, fee, dev_max_fee_per_gas,
  raised_token, anti_mev_mode, dev_wallet_bps, source, approve_vision
- Add fee-share configs: pump_fee_share_list, bags_fee_share_list,
  flap_rate_conf (+ V6 buy/sell_tax_rate), fourmeme_rate_conf
- Add multi-wallet buy: buy_wallets, snip_buy_wallets, interval_seconds
- Add CondMarket TradeParam (buy/sell_trade_config) and auto-sell sell_configs
- Pump modes: --is-mayhem / --is-cashback / --is-buy-back (Agent Auto Buyback)
- Fix Flap split_conf field: split_bps -> bps
- Pump fee-share provider: github / wallet only (drop twitter)
- Drop is_revoke_fee_auth and is_agent/agent_bps
- Sync SKILL.md and cli-usage.md with all flags, JSON schemas,
  guided launch flow (platform-aware advanced options) and percentage-based
  fee-share UX

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-02 14:04:35 +08:00
GMGN.AI aebe509f29 1.3.7 2026-05-29 19:37:00 +08:00
GMGN.AI 26ebfe6843 Merge pull request #146 from GMGNAI/fix/signer-encode-query-params
fix(signer): percent-encode query params in buildMessage to match server
2026-05-29 19:34:22 +08:00
David Lau 412531f04e fix(signer): percent-encode query params in buildMessage to match server
Server's CanonicalQueryString uses url.QueryEscape on all keys and values,
but buildMessage was using raw string interpolation. Cursor values (base64)
contain +, =, / which diverge under encoding — causing 401 on all paginated
signed requests (e.g. portfolio holdings page 2+).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-29 19:32:54 +08:00
GMGN.AI b0b25118aa Merge pull request #143 from GMGNAI/docs/swap-ratelimit-weights
docs(swap): add rate limit weights for strategy and multi_swap routes
2026-05-29 17:25:39 +08:00
David Lau 0a12f0615d docs(swap): add rate limit weights for strategy and multi_swap routes
- order strategy create: POST /v1/trade/strategy/create — weight 1
- order strategy cancel: POST /v1/trade/strategy/cancel — weight 1
- order strategy list:   GET  /v1/trade/strategy/orders — weight 1
- multi-swap already listed; confirms weight 5 (same as swap)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-29 17:15:25 +08:00
GMGN.AI 0979d14d6a Merge pull request #142 from GMGNAI/docs/strategy-order-list-response-fields
docs(swap): expand order strategy list response fields
2026-05-29 12:05:09 +08:00
GMGN.AI 0cf2e514e6 Merge pull request #141 from gina888666/fix/portfolio-activity-price-fields-and-strategy-check-price
docs: clarify price/price_usd in portfolio activity and check-price unit in strategy create
2026-05-29 12:03:13 +08:00
gina888666 693a63c723 docs(gmgn-portfolio): remove example from price field description
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-29 10:53:20 +08:00
gina888666 81d67808fa docs(gmgn-portfolio): fix price field description to mention quote token may vary (SOL or USDC)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-29 10:51:34 +08:00
gina888666 8a095a99a8 docs: clarify price/price_usd in portfolio activity and check-price unit in strategy create
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-29 10:47:39 +08:00
13 changed files with 675 additions and 143 deletions
+11 -11
View File
@@ -528,7 +528,7 @@ gmgn-cli swap \
--input-token <input-token-addr> \
--output-token <output-token-addr> \
--amount 1000000 \
--slippage 0.01
--slippage 30
# Submit swap with automatic slippage
gmgn-cli swap \
@@ -555,7 +555,7 @@ gmgn-cli order quote \
--input-token <input-token-addr> \
--output-token <output-token-addr> \
--amount 1000000 \
--slippage 0.01
--slippage 30
# Quotes use signed auth and require GMGN_PRIVATE_KEY on every chain
gmgn-cli order quote \
@@ -564,7 +564,7 @@ gmgn-cli order quote \
--input-token <input-token-addr> \
--output-token <output-token-addr> \
--amount 1000000000000000000 \
--slippage 0.01
--slippage 30
# Query order
gmgn-cli order get --chain sol --order-id <order-id>
@@ -582,7 +582,7 @@ gmgn-cli multi-swap \
--input-token <input-token-addr> \
--output-token <output-token-addr> \
--input-amount '{"<addr1>":"1000000","<addr2>":"2000000"}' \
--slippage 0.01
--slippage 30
```
> `order quote` uses signed auth on `sol` / `bsc` / `base` / `eth` and requires `GMGN_PRIVATE_KEY`.
@@ -597,7 +597,7 @@ gmgn-cli swap \
--input-token <input-token-addr> \
--output-token <output-token-addr> \
--amount <amount> \
--slippage 0.01 \
--slippage 30 \
--gas-level high
# Let GMGN auto-select the optimal gas fee for condition orders
@@ -607,7 +607,7 @@ gmgn-cli swap \
--input-token <input-token-addr> \
--output-token <output-token-addr> \
--amount <amount> \
--slippage 0.01 \
--slippage 30 \
--condition-orders '[...]' \
--auto-fee
```
@@ -627,7 +627,7 @@ gmgn-cli swap \
--input-token So11111111111111111111111111111111111111112 \
--output-token <token_A_address> \
--amount 10000000 \
--slippage 0.3 \
--slippage 30 \
--anti-mev \
--condition-orders '[{"order_type":"profit_stop","side":"sell","price_scale":"100","sell_ratio":"50"},{"order_type":"profit_stop","side":"sell","price_scale":"300","sell_ratio":"100"},{"order_type":"loss_stop","side":"sell","price_scale":"65","sell_ratio":"100"}]' \
--sell-ratio-type hold_amount
@@ -646,7 +646,7 @@ gmgn-cli swap \
--input-token So11111111111111111111111111111111111111112 \
--output-token <token_A_address> \
--amount 10000000 \
--slippage 0.3 \
--slippage 30 \
--anti-mev \
--condition-orders '[{"order_type":"profit_stop","side":"sell","price_scale":"100","sell_ratio":"50"},{"order_type":"profit_stop","side":"sell","price_scale":"300","sell_ratio":"50"},{"order_type":"loss_stop","side":"sell","price_scale":"65","sell_ratio":"100"}]' \
--sell-ratio-type buy_amount
@@ -668,7 +668,7 @@ gmgn-cli order strategy create \
--sub-order-type take_profit \
--check-price 0.002 \
--amount-in-percent 100 \
--slippage 0.01
--slippage 30
# Create a stop-loss order
gmgn-cli order strategy create \
@@ -679,7 +679,7 @@ gmgn-cli order strategy create \
--sub-order-type stop_loss \
--check-price 0.0005 \
--amount-in-percent 100 \
--slippage 0.01
--slippage 30
# List open strategy orders (requires private key)
gmgn-cli order strategy list --chain sol
@@ -698,7 +698,7 @@ gmgn-cli cooking \
--input-token So11111111111111111111111111111111111111112 \
--output-token <token_address> \
--amount 1000000000 \
--slippage 0.3 \
--slippage 30 \
--condition-orders '[{"order_type":"profit_stop","side":"sell","price_scale":"100","sell_ratio":"100"},{"order_type":"loss_stop","side":"sell","price_scale":"50","sell_ratio":"100"}]'
```
+11 -11
View File
@@ -552,7 +552,7 @@ gmgn-cli swap \
--input-token <input-token-addr> \
--output-token <output-token-addr> \
--amount 1000000 \
--slippage 0.01
--slippage 30
# 提交兑换(自动滑点)
gmgn-cli swap \
@@ -579,7 +579,7 @@ gmgn-cli order quote \
--input-token <input-token-addr> \
--output-token <output-token-addr> \
--amount 1000000 \
--slippage 0.01
--slippage 30
# 所有链上的 quote 都走关键鉴权,需要 GMGN_PRIVATE_KEY
gmgn-cli order quote \
@@ -588,7 +588,7 @@ gmgn-cli order quote \
--input-token <input-token-addr> \
--output-token <output-token-addr> \
--amount 1000000000000000000 \
--slippage 0.01
--slippage 30
# 查询订单状态
gmgn-cli order get --chain sol --order-id <order-id>
@@ -606,7 +606,7 @@ gmgn-cli multi-swap \
--input-token <input-token-addr> \
--output-token <output-token-addr> \
--input-amount '{"<addr1>":"1000000","<addr2>":"2000000"}' \
--slippage 0.01
--slippage 30
```
> `order quote` 在 `sol` / `bsc` / `base` / `eth` 上都走关键鉴权,必须配置 `GMGN_PRIVATE_KEY`。
@@ -621,7 +621,7 @@ gmgn-cli swap \
--input-token <input-token-addr> \
--output-token <output-token-addr> \
--amount <amount> \
--slippage 0.01 \
--slippage 30 \
--gas-level high
# 策略单(condition-orders)由 GMGN 自动选择最优 Gas Fee
@@ -631,7 +631,7 @@ gmgn-cli swap \
--input-token <input-token-addr> \
--output-token <output-token-addr> \
--amount <amount> \
--slippage 0.01 \
--slippage 30 \
--condition-orders '[...]' \
--auto-fee
```
@@ -651,7 +651,7 @@ gmgn-cli swap \
--input-token So11111111111111111111111111111111111111112 \
--output-token <token_A_address> \
--amount 10000000 \
--slippage 0.3 \
--slippage 30 \
--anti-mev \
--condition-orders '[{"order_type":"profit_stop","side":"sell","price_scale":"100","sell_ratio":"50"},{"order_type":"profit_stop","side":"sell","price_scale":"300","sell_ratio":"100"},{"order_type":"loss_stop","side":"sell","price_scale":"65","sell_ratio":"100"}]' \
--sell-ratio-type hold_amount
@@ -670,7 +670,7 @@ gmgn-cli swap \
--input-token So11111111111111111111111111111111111111112 \
--output-token <token_A_address> \
--amount 10000000 \
--slippage 0.3 \
--slippage 30 \
--anti-mev \
--condition-orders '[{"order_type":"profit_stop","side":"sell","price_scale":"100","sell_ratio":"50"},{"order_type":"profit_stop","side":"sell","price_scale":"300","sell_ratio":"50"},{"order_type":"loss_stop","side":"sell","price_scale":"65","sell_ratio":"100"}]' \
--sell-ratio-type buy_amount
@@ -692,7 +692,7 @@ gmgn-cli order strategy create \
--sub-order-type take_profit \
--check-price 0.002 \
--amount-in-percent 100 \
--slippage 0.01
--slippage 30
# 创建止损单
gmgn-cli order strategy create \
@@ -703,7 +703,7 @@ gmgn-cli order strategy create \
--sub-order-type stop_loss \
--check-price 0.0005 \
--amount-in-percent 100 \
--slippage 0.01
--slippage 30
# 查看当前挂单(需要私钥)
gmgn-cli order strategy list --chain sol
@@ -722,7 +722,7 @@ gmgn-cli cooking \
--input-token So11111111111111111111111111111111111111112 \
--output-token <token_address> \
--amount 1000000000 \
--slippage 0.3 \
--slippage 30 \
--condition-orders '[{"order_type":"profit_stop","side":"sell","price_scale":"100","sell_ratio":"100"},{"order_type":"loss_stop","side":"sell","price_scale":"50","sell_ratio":"100"}]'
```
+65 -21
View File
@@ -431,7 +431,7 @@ npx gmgn-cli order quote \
| `--input-token` | Yes | Input token contract address |
| `--output-token` | Yes | Output token contract address |
| `--amount` | Yes | Input amount (smallest unit) |
| `--slippage` | Yes | Slippage tolerance, e.g. `0.01` = 1% |
| `--slippage` | Yes | Slippage tolerance as an integer 0100, e.g. `30` = 30% |
**Response fields (data):**
@@ -479,7 +479,7 @@ npx gmgn-cli swap \
| `--output-token` | Yes | all | Output token contract address |
| `--amount` | No* | all | Input raw amount in minimal unit (e.g., lamports for SOL); required unless `--percent` is used |
| `--percent` | No* | all | Input amount as a percentage, e.g. `50` = 50%; required unless `--amount` is used; only valid when input token is not a currency (not SOL/BNB/ETH/USDC) |
| `--slippage` | No | all | Slippage tolerance, e.g. `0.01` = 1% |
| `--slippage` | No | all | Slippage tolerance as an integer 0100, e.g. `30` = 30% |
| `--auto-slippage` | No | all | Enable automatic slippage |
| `--min-output` | No | all | Minimum output amount (raw amount) |
| `--anti-mev` | No | all | Enable anti-MEV protection (default true) |
@@ -557,7 +557,7 @@ gmgn-cli multi-swap \
| `--input-amount` | No* | all | JSON map `{"addr":"amount"}` in smallest unit; one of the three amount fields is required |
| `--input-amount-bps` | No* | all | JSON map `{"addr":"bps"}` where 5000 = 50%; only valid when input token is not a currency |
| `--output-amount` | No* | all | JSON map `{"addr":"amount"}` target output in smallest unit |
| `--slippage` | No | all | Slippage tolerance, e.g. `0.01` = 1% |
| `--slippage` | No | all | Slippage tolerance as an integer 0100, e.g. `30` = 30% |
| `--auto-slippage` | No | all | Enable automatic slippage |
| `--anti-mev` | No | all | Enable anti-MEV protection |
| `--priority-fee` | No | `sol` | Priority fee in SOL (≥ 0.00001) |
@@ -608,14 +608,17 @@ gmgn-cli order strategy create \
--from <wallet_address> \
--base-token <base_token_address> \
--quote-token <quote_token_address> \
--order-type <limit_order> \
--sub-order-type <buy_low|buy_high|stop_loss|take_profit> \
--check-price <price> \
--order-type <limit_order|smart_trade> \
--sub-order-type <buy_low|buy_high|stop_loss|take_profit|mix_trade> \
[--check-price <price>] \
[--open-price <price>] \
[--amount-in <amount> | --amount-in-percent <pct>] \
[--slippage <n> | --auto-slippage] \
[--limit-price-mode <exact|slippage>] \
[--expire-in <seconds>] \
[--sell-ratio-type <buy_amount|hold_amount>] \
[--quote-investment <amount>] \
[--condition-orders <json>] \
[--priority-fee <sol>] \
[--tip-fee <amount>] \
[--gas-price <gwei>] \
@@ -625,19 +628,22 @@ gmgn-cli order strategy create \
| Option | Required | Description |
|--------|----------|-------------|
| `--chain` | Yes | `sol` / `bsc` / `base` |
| `--chain` | Yes | `sol` / `bsc` / `base` / `eth` |
| `--from` | Yes | Wallet address (must match API Key binding) |
| `--base-token` | Yes | Base token contract address |
| `--quote-token` | Yes | Quote token contract address |
| `--order-type` | Yes | Order type: `limit_order` |
| `--sub-order-type` | Yes | Sub-order type: `buy_low` / `buy_high` / `stop_loss` / `take_profit` |
| `--check-price` | Yes | Trigger check price |
| `--order-type` | Yes | Order type: `limit_order` / `smart_trade` |
| `--sub-order-type` | Yes | `limit_order`: `buy_low` / `buy_high` / `stop_loss` / `take_profit`; `smart_trade` with condition_orders: `mix_trade` |
| `--check-price` | No* | Trigger check price — required for `limit_order`; omit for `smart_trade` (trigger is in the `buy_low` condition order) |
| `--open-price` | No | Open price of the position |
| `--amount-in` | No* | Input amount (smallest unit); required unless `--amount-in-percent` is used |
| `--amount-in-percent` | No* | Input as percentage (e.g. `50` = 50%); required unless `--amount-in` is used |
| `--limit-price-mode` | No | `exact` / `slippage` (default: `slippage`) |
| `--expire-in` | No | Order expiry in seconds |
| `--sell-ratio-type` | No | `buy_amount` (default) / `hold_amount` |
| `--slippage` | No | Slippage tolerance, e.g. `0.01` = 1% |
| `--quote-investment` | No | Quote token investment amount (`smart_trade`) |
| `--condition-orders` | No | JSON array of condition sub-orders for `smart_trade`. Must include one `buy_low` entry (with `check_price` lower than `open_price`) plus at least one TP/SL entry |
| `--slippage` | No | Slippage tolerance as an integer 0100, e.g. `30` = 30% |
| `--auto-slippage` | No | Enable automatic slippage |
| `--priority-fee` | No | Priority fee in SOL (**required for SOL chain**) |
| `--tip-fee` | No | Tip fee (**required for SOL chain**) |
@@ -731,30 +737,68 @@ gmgn-cli cooking create \
[--image <base64> | --image-url <url>] \
[--slippage <n> | --auto-slippage] \
[--website <url>] [--twitter <url>] [--telegram <url>] \
[--priority-fee <sol>] [--tip-fee <amount>] [--gas-price <amount>] \
[--anti-mev] \
[--fee <amount>] [--priority-fee <sol>] [--tip-fee <amount>] [--gas-price <amount>] \
[--max-fee-per-gas <amount>] [--max-priority-fee-per-gas <amount>] \
[--anti-mev] [--anti-mev-mode <off|normal|secure>] \
[--raised-token <symbol>] \
[--dev-wallet-bps <n>] [--dev-gas <amount>] [--dev-priority <amount>] [--dev-tip <amount>] [--dev-max-fee-per-gas <amount>] \
[--approve-vision <v1|v2>] [--source <source>] \
[--is-mayhem] [--is-cashback] [--is-buy-back] \
[--pump-fee-share-list <json>] \
[--flap-rate-conf <json>] \
[--fourmeme-rate-conf <json>] \
[--bags-fee-share-list <json>] \
[--bonk-model <model>] \
[--buy-wallets <json>] [--snip-buy-wallets <json>] [--interval-seconds <n>] \
[--buy-trade-config <json>] [--sell-trade-config <json>] [--sell-configs <json>] \
[--raw]
```
| Option | Required | Description |
|--------|----------|-------------|
| `--chain` | Yes | `sol` / `bsc` / `base` / `eth` / `ton` |
| `--dex` | Yes | Launchpad: `pump` / `raydium` / `pancakeswap` / `flap` / `fourmeme` / `bonk` / `bags` / ... |
| `--chain` | Yes | `sol` / `bsc` / `base` |
| `--dex` | Yes | Launchpad per chain: `pump` / `bonk` / `bags` (sol), `fourmeme` / `flap` (bsc), `klik` / `clanker` (base) |
| `--from` | Yes | Wallet address (must match API Key binding) |
| `--name` | Yes | Token name |
| `--symbol` | Yes | Token symbol |
| `--buy-amt` | Yes | Initial buy amount in native token (e.g. `0.01` SOL) |
| `--image` | No* | Token logo as base64-encoded data (max 2MB decoded); required unless `--image-url` is used |
| `--image-url` | No* | Token logo URL; required unless `--image` is used |
| `--slippage` | No* | Slippage tolerance as an integer 0100, e.g. `30` = 30%; required unless `--auto-slippage` is used |
| `--auto-slippage` | No* | Enable automatic slippage; required unless `--slippage` is used |
| `--website` | No | Website URL |
| `--twitter` | No | Twitter link |
| `--telegram` | No | Telegram link |
| `--slippage` | No | Slippage tolerance, e.g. `0.01` = 1% |
| `--auto-slippage` | No | Enable automatic slippage |
| `--priority-fee` | No | Priority fee in SOL (SOL only) |
| `--tip-fee` | No | Tip fee |
| `--gas-price` | No | Gas price in wei (EVM chains) |
| `--anti-mev` | No | Enable anti-MEV protection |
| `--fee` | No | Base gas / fee |
| `--priority-fee` | No | Priority fee in SOL (**SOL only**, ≥ 0.0001 SOL) |
| `--tip-fee` | No | Tip fee (SOL ≥ 0.00001 / BSC ≥ 0.000001 BNB; ignored on BASE) |
| `--gas-price` | No | Gas price in wei (**EVM only**) |
| `--max-fee-per-gas` | No | Max fee per gas in wei (**EVM only**) |
| `--max-priority-fee-per-gas` | No | Max priority fee per gas in wei (**EVM only**) |
| `--anti-mev` | No | Enable anti-MEV protection (**SOL only**) |
| `--anti-mev-mode` | No | Anti-MEV mode: `off` / `normal` / `secure` (**SOL only**) |
| `--raised-token` | No | Raise token symbol: `pump``USDC`; `bonk``USD1`; `fourmeme``USDT`/`USD1`; omit for native |
| `--dev-wallet-bps` | No | Dev wallet fee share in basis points (100 = 1%) |
| `--dev-gas` | No | Dev gas amount |
| `--dev-priority` | No | Dev priority fee |
| `--dev-tip` | No | Dev tip fee |
| `--dev-max-fee-per-gas` | No | Dev tx feeCap in wei (**EVM EIP-1559**) |
| `--approve-vision` | No | Approve vision version: `v1` / `v2` (default: `v2`) |
| `--source` | No | Traffic source identifier |
| `--is-mayhem` | No | Enable Mayhem mode (**Pump.fun only**) |
| `--is-cashback` | No | Enable Cashback (**Pump.fun only**) |
| `--is-buy-back` | No | Enable Agent Auto Buyback (**Pump.fun only**) |
| `--pump-fee-share-list` | No | Fee share list as JSON array: `[{"provider":"twitter","username":"<handle>","basic_points":<n>}]` (**Pump.fun only**) |
| `--flap-rate-conf` | No | Rate config as JSON object (**Flap only**) |
| `--fourmeme-rate-conf` | No | Rate config as JSON object (**FourMeme only**) |
| `--bags-fee-share-list` | No | Fee share list as JSON array: `[{"provider":"twitter","username":"<handle>","basic_points":<n>}]` (**BAGS only**) |
| `--bonk-model` | No | Bonk model identifier (**bonk DEX only**) |
| `--buy-wallets` | No | Multi-wallet buy config as JSON array: `[{"from_address":"<addr>","buy_amt":"<n>"}]` |
| `--snip-buy-wallets` | No | Snipe-buy wallet config as JSON array: `[{"from_address":"<addr>","buy_amt":"<n>"}]` |
| `--interval-seconds` | No | Interval between multi-wallet buys in seconds |
| `--buy-trade-config` | No | Buy-side trade config for CondMarket orders as JSON (TradeParam) |
| `--sell-trade-config` | No | Sell-side trade config for auto-sell / pending_sell as JSON (TradeParam) |
| `--sell-configs` | No | Auto-sell strategy list as JSON array (CookingSellConfig[]): `[{"sell_type":"delay_sell","delay_sec":<n>,"sell_ratio":"0.5","wallet_addresses":["<addr>"]}]` |
**Response fields (data):**
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "gmgn-cli",
"version": "1.3.6",
"version": "1.4.2",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "gmgn-cli",
"version": "1.3.6",
"version": "1.4.2",
"license": "MIT",
"dependencies": {
"commander": "^12.1.0",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "gmgn-cli",
"version": "1.3.6",
"version": "1.4.2",
"description": "GMGN OpenAPI CLI — call GMGN market, token, portfolio and swap APIs from the command line",
"type": "module",
"bin": {
+331 -59
View File
@@ -1,6 +1,6 @@
---
name: gmgn-cooking
description: "[FINANCIAL EXECUTION] Create and launch meme coins and crypto tokens on launchpads (Pump.fun, PancakeSwap, FourMeme, Bonk, BAGS, Flap, Raydium, etc.) via bonding curve fair launch, or query token creation stats by launchpad via GMGN API. Requires explicit user confirmation. Use when user asks to create a token, launch a meme coin, cook a coin, deploy on a launchpad, or check launchpad creation stats on Solana, BSC, Base, ETH, or TON."
description: "[FINANCIAL EXECUTION] Create and launch meme coins and crypto tokens on launchpads (Pump.fun, FourMeme, Bonk, BAGS, Flap, Klik, Clanker, etc.) via bonding curve fair launch, or query token creation stats by launchpad via GMGN API. Requires explicit user confirmation. Use when user asks to create a token, launch a meme coin, cook a coin, deploy on a launchpad, or check launchpad creation stats on Solana, BSC, or Base."
argument-hint: "stats | [create --chain <chain> --dex <dex> --from <addr> --name <name> --symbol <sym> --buy-amt <n> (--image <base64> | --image-url <url>)]"
metadata:
cliHelp: "gmgn-cli cooking --help"
@@ -24,11 +24,11 @@ Use the `gmgn-cli` tool to create a token on a launchpad platform or query token
- **Image input** — Token logo can be provided as base64-encoded data (`--image`, max 2MB decoded) or a publicly accessible URL (`--image-url`). Provide one or the other — not both. If the user gives a file path, read and base64-encode it before passing to `--image`. If they give a URL, use `--image-url` directly.
- **Status polling via `order get`** — `cooking create` is asynchronous. The immediate response may show `pending`. Poll with `gmgn-cli order get --chain <chain> --order-id <order_id>` until `confirmed`. The new token's contract address is in the `output_token` field of the `order get` response, not in the initial create response.
- **Status polling via `order get`** — `cooking create` is asynchronous. The immediate response may show `pending`. Poll with `gmgn-cli order get --chain <chain> --order-id <order_id>` until `confirmed`. The new token's contract address is in the `report.output_token` field of the `order get` response, not in the initial create response.
- **Signed auth** — `cooking create` requires both `GMGN_API_KEY` and `GMGN_PRIVATE_KEY`. The private key never leaves the machine — the CLI uses it only for local signing. `cooking stats` uses exist auth (API Key only).
- **Slippage** — The initial buy is executed as part of the same transaction as token creation. Slippage applies to that buy. Use `--slippage` (decimal, e.g. `0.01` = 1%) or `--auto-slippage`. One of the two is required when `--buy-amt` is set.
- **Slippage** — The initial buy is executed as part of the same transaction as token creation. Slippage applies to that buy. Use `--slippage` (integer 0100, e.g. `30` = 30%) or `--auto-slippage`. One of the two is required when `--buy-amt` is set.
## Financial Risk Notice
@@ -48,17 +48,29 @@ Use the `gmgn-cli` tool to create a token on a launchpad platform or query token
## Supported Chains
`sol` / `bsc` / `base` / `eth` / `ton`
`sol` / `bsc` / `base`
## Supported Launchpads by Chain
| Chain | `--dex` values |
|-------|----------------|
| `sol` | `pump` / `raydium` / `bonk` / `bags` / `memoo` / `letsbonk` / `bonkers` |
| `bsc` | `pancakeswap` / `flap` / `fourmeme` |
| `base` | `clanker` / `flaunch` / `baseapp` / `basememe` / `zora` / `virtuals_v2` |
| Chain | `--dex` values | Raise token (`--raised-token`) |
| ------ | ---------------------- | ------------------------------ |
| `sol` | `pump`, `bonk`, `bags` | `pump`: `""` (SOL) or `USDC`; `bonk`: `""` (SOL) or `USD1`; `bags`: `""` (SOL only) |
| `bsc` | `fourmeme`, `flap` | `fourmeme`: `""` (BNB), `USD1`, `USDT`; `flap`: `""` (BNB only) |
| `base` | `klik`, `clanker` | `""` only (quote token fixed to WETH) |
When the user names a platform colloquially (e.g. "pump.fun", "four.meme", "PancakeSwap"), map it to the correct `--dex` identifier from this table before running the command.
When the user names a platform colloquially (e.g. "pump.fun", "four.meme"), map it to the correct `--dex` identifier from this table before running the command.
**Anti-MEV** (`--anti-mev`) is only supported on `sol`. Passing it on `bsc` or `base` will return a 400 error.
### Quote Token conversion (when `--raised-token` is set)
`--buy-amt` is **always in native token units** (SOL / BNB / ETH), even when raising with a quote token like USDC / USD1 / USDT. If the user states the amount in the quote token, convert it to native yourself before passing it:
```
buy_amt_in_native = quote_amount × quote_price / native_price
```
This conversion applies to **`--buy-amt`, and the `buy_amt` field inside `--buy-wallets` and `--snip-buy-wallets`**. It does **not** apply to `--sell-configs` (`check_price` there is always a USD market cap, not a token amount). Round to the chain's native decimals. When `--raised-token` is empty/native, no conversion is needed.
## Prerequisites
@@ -121,34 +133,221 @@ gmgn-cli cooking stats [--raw]
| Field | Type | Description |
|-------|------|-------------|
| `launchpad` | string | Launchpad identifier (e.g. `pump`, `raydium`, `pancakeswap`) |
| `launchpad` | string | Launchpad identifier (e.g. `pump`, `bonk`, `fourmeme`) |
| `token_count` | int | Number of tokens created via GMGN on that launchpad |
## `cooking create` Parameters
| Parameter | Required | Description |
|-----------|----------|-------------|
| `--chain` | Yes | Chain: `sol` / `bsc` / `base` / `eth` / `ton` |
| `--chain` | Yes | Chain: `sol` / `bsc` / `base` |
| `--dex` | Yes | Launchpad platform identifier — see Supported Launchpads table. Never guess this value. |
| `--from` | Yes | Wallet address (must match API Key binding) |
| `--name` | Yes | Token full name (e.g. `Doge Killer`) |
| `--symbol` | Yes | Token ticker symbol (e.g. `DOGEK`) |
| `--description` | No | Token description / project pitch |
| `--buy-amt` | Yes | Initial buy amount in **human-readable native token units** (e.g. `0.01` = 0.01 SOL). This is NOT in smallest unit. |
| `--image` | No* | Token logo as **base64-encoded** data (max 2MB decoded). Mutually exclusive with `--image-url`. One of the two is required. |
| `--image-url` | No* | Token logo as a publicly accessible URL. Mutually exclusive with `--image`. One of the two is required. |
| `--slippage` | No* | Slippage tolerance, e.g. `0.01` = 1%. **Mutually exclusive with `--auto-slippage`** — provide one or the other. |
| `--slippage` | No* | Slippage tolerance as an integer 0100, e.g. `30` = 30%. **Mutually exclusive with `--auto-slippage`** — provide one or the other. |
| `--auto-slippage` | No* | Enable automatic slippage. **Mutually exclusive with `--slippage`.** |
| `--description` | No | Token description / project pitch |
| `--website` | No | Project website URL |
| `--twitter` | No | Twitter / X URL |
| `--telegram` | No | Telegram group URL |
| `--priority-fee` | No | Priority fee in SOL (SOL only, ≥ 0.0001 SOL) |
| `--tip-fee` | No | Tip fee (SOL ≥ 0.00001 / BSC ≥ 0.000001 BNB; ignored on ETH/BASE) |
| `--gas-price` | No | Gas price in wei (EVM chains) |
| `--anti-mev` | No | Enable anti-MEV protection |
| `--fee` | No | Base gas / fee |
| `--priority-fee` | No | Priority fee in SOL (**SOL only**, ≥ 0.0001 SOL) |
| `--tip-fee` | No | Tip fee (SOL ≥ 0.00001 / BSC ≥ 0.000001 BNB; ignored on BASE) |
| `--gas-price` | No | Gas price in wei (EVM chains: BSC / BASE) |
| `--max-fee-per-gas` | No | Max fee per gas in wei (**EVM only**) |
| `--max-priority-fee-per-gas` | No | Max priority fee per gas in wei (**EVM only**) |
| `--anti-mev` | No | Enable anti-MEV protection (**SOL only**; rejected on BSC / BASE) |
| `--anti-mev-mode` | No | Anti-MEV mode: `off` / `normal` / `secure` (**SOL only**) |
| `--raised-token` | No | Raise token symbol. `pump`: `USDC`; `bonk`: `USD1`; `fourmeme`: `USDT` / `USD1`; omit or `""` for native |
| `--dev-wallet-bps` | No | Dev wallet fee share in basis points (100 = 1%) |
| `--dev-gas` | No | Dev gas amount |
| `--dev-priority` | No | Dev priority fee |
| `--dev-tip` | No | Dev tip fee |
| `--dev-max-fee-per-gas` | No | Dev tx feeCap in wei (**EVM EIP-1559**) |
| `--approve-vision` | No | Approve vision version: `v1` / `v2` (default: `v2`) |
| `--source` | No | Traffic source identifier |
| `--is-mayhem` | No | Enable Mayhem mode (**Pump.fun only**) |
| `--is-cashback` | No | Enable Cashback (**Pump.fun only**) |
| `--is-buy-back` | No | Enable Agent Auto Buyback (**Pump.fun only**) |
| `--pump-fee-share-list` | No | Pump.fun fee share list as JSON array: `[{"provider":"twitter","username":"<handle>","basic_points":<n>}]` (**Pump.fun only**) |
| `--flap-rate-conf` | No | Flap rate config as JSON object (**Flap only**) |
| `--fourmeme-rate-conf` | No | FourMeme rate config as JSON object (**FourMeme only**) |
| `--bags-fee-share-list` | No | BAGS fee share list as JSON array: `[{"provider":"twitter","username":"<handle>","basic_points":<n>}]` (**BAGS only**) |
| `--bonk-model` | No | Bonk model identifier (**bonk DEX only**) |
| `--buy-wallets` | No | Multi-wallet buy config as JSON array: `[{"from_address":"<addr>","buy_amt":"<n>"}]` |
| `--snip-buy-wallets` | No | Snipe-buy wallet config as JSON array: `[{"from_address":"<addr>","buy_amt":"<n>"}]` |
| `--interval-seconds` | No | Interval between multi-wallet buys in seconds |
| `--buy-trade-config` | No | Buy-side trade config for CondMarket orders as JSON (TradeParam) — see Advanced API Fields |
| `--sell-trade-config` | No | Sell-side trade config for auto-sell / pending_sell as JSON (TradeParam) — see Advanced API Fields |
| `--sell-configs` | No | Auto-sell strategy list as JSON array (CookingSellConfig[]) — see Auto-Sell Configuration |
\* `--image` or `--image-url`: provide exactly one. `--slippage` or `--auto-slippage`: provide exactly one.
## Advanced API Fields
The structured flags (`--pump-fee-share-list`, `--bags-fee-share-list`, `--flap-rate-conf`, `--fourmeme-rate-conf`, `--buy-wallets`, `--snip-buy-wallets`, `--buy-trade-config`, `--sell-trade-config`, `--sell-configs`) each accept a **JSON string**. This section documents the exact JSON schema for each.
### Platform capability matrix
Which advanced features each platform supports. Do not send a field a platform does not support.
| Platform | `--dex` | Chain | Platform-specific fields | Bundle (`--buy-wallets`) | Sniper (`--snip-buy-wallets`) | Cashback | Mayhem |
|---|---|---|---|---|---|---|---|
| Pump.fun | `pump` | SOL | `--pump-fee-share-list` / `--dev-wallet-bps` / `--is-buy-back` | ✅ up to 12 wallets | ✅ up to 10 | ✅ | ✅ |
| Bonk | `bonk` | SOL | `--bonk-model` | ❌ | ✅ up to 10 | ❌ | ❌ |
| BAGS | `bags` | SOL | `--bags-fee-share-list` / `--dev-wallet-bps` | ❌ | ✅ up to 10 | ❌ | ❌ |
| FourMeme | `fourmeme` | BSC | `--fourmeme-rate-conf` | ✅ up to 3 wallets | ✅ up to 10 | ❌ | ❌ |
| Flap | `flap` | BSC | `--flap-rate-conf` | ❌ | ✅ up to 10 | ❌ | ❌ |
| Klik | `klik` | Base | — | ❌ | ✅ up to 10 | ❌ | ❌ |
| Clanker | `clanker` | Base | — | ❌ | ✅ up to 10 | ❌ | ❌ |
- `--is-cashback` / `--is-mayhem` are **Pump.fun only** — other platforms reject them.
- Bundle/auto-sell (`--sell-configs`) and sniper (`--snip-buy-wallets`) are available where the matrix shows ✅.
**Basis-points rule:** any field named `*_bps` / `basic_points` is in basis points (`100` = 1%). Where a section says the shares must sum, all entries must add up to exactly **10000** (FourMeme uses whole percents summing to **100** instead — see below).
**Always talk to the user in percentages, never basis points.** When asking for or confirming any share, fee, or split, phrase it as a percentage (e.g. *"What % goes to this wallet?"* → user says `"50%"`). Convert to the field's unit yourself when building the JSON — never ask the user for a raw bps number:
| User says | `*_bps` field (×100) | FourMeme `*_rate` field (×1) |
|---|---|---|
| `5%` | `500` | `5` |
| `50%` | `5000` | `50` |
| `100%` | `10000` | `100` |
Never set a fee-share split without the user's explicit instruction — it permanently routes token revenue to the listed accounts.
### Pump.fun (`--dex pump`)
> `is_mayhem`, `is_cashback`, `is_buy_back` use their matching CLI flags (`--is-mayhem`, `--is-cashback`, `--is-buy-back`). `pump_fee_share_list` is passed via `--pump-fee-share-list`.
| Field | CLI flag | Description |
|---|---|---|
| `pump_fee_share_list` | `--pump-fee-share-list <json>` | Fee-share list — see JSON schema below |
| `is_buy_back` | `--is-buy-back` | Enable Agent Auto Buyback |
**JSON schema for `--pump-fee-share-list`** — array of objects:
| Field | Type | Required | Description |
|---|---|---|---|
| `provider` | string | Yes | `solana` / `twitter` / `github` |
| `username` | string | Yes | Platform username; a SOL address when `provider` = `solana` |
| `basic_points` | int | Yes | Share in bps — all entries must sum to **10000** |
Example: `--pump-fee-share-list '[{"provider":"twitter","username":"handle","basic_points":10000}]'`
### Bonk (`--dex bonk`)
`dev_wallet_bps` → `--dev-wallet-bps`, `bonk_model` → `--bonk-model`. No additional structured fields.
### BAGS (`--dex bags`)
`dev_wallet_bps` → `--dev-wallet-bps`. `bags_fee_share_list` is passed via `--bags-fee-share-list`.
**JSON schema for `--bags-fee-share-list`** — array of objects:
| Field | Type | Required | Description |
|---|---|---|---|
| `provider` | string | Yes | `twitter` / `solana` / `kick` / `github` |
| `username` | string | Yes | Platform username |
| `basic_points` | int | Yes | Share in bps — combined with `dev_wallet_bps`, all must sum to **10000** |
### Flap (`--dex flap`)
`flap_rate_conf` is passed via `--flap-rate-conf`.
**JSON schema for `--flap-rate-conf`** — single object:
| Field | Type | Required | Description |
|---|---|---|---|
| `beneficiary` | string | Yes | Fee recipient address |
| `tax_rate` | int | Conditional | V5 unified tax rate in bps, e.g. 5% → `500` |
| `buy_tax_rate` | int | Conditional | V6 separate buy tax rate in bps |
| `sell_tax_rate` | int | Conditional | V6 separate sell tax rate in bps |
| `mkt_bps` | int | Yes | Marketing / donation fund share |
| `deflation_bps` | int | Yes | Burn (supply-reduction) share |
| `dividend_bps` | int | Yes | Dividend (holder-reward) share |
| `lp_bps` | int | Yes | Liquidity share |
| `minimum_share_balance` | int | Yes | Min holding to qualify for dividends — minimum **10000** tokens |
| `recipient_type` | string | Yes | `split` (proportional) / `gift` |
| `twitter_account` | string | Yes | Twitter username |
| `split_conf` | array | Yes | Split list — see below |
`split_conf` entries: `{ "recipient": "<address>", "bps": <n> }` — all `bps` must sum to **10000**.
> - Use `tax_rate` for V5 (unified rate); use `buy_tax_rate` + `sell_tax_rate` for V6 (separate rates).
> - When the tax rate > 0: `mkt_bps + deflation_bps + dividend_bps + lp_bps` must sum to **10000**. When `lp_bps > 0`: `minimum_share_balance` must be > 0.
### FourMeme (`--dex fourmeme`)
`fourmeme_rate_conf` is passed via `--fourmeme-rate-conf`.
> `fourmeme_user_login_sign`, `is_approve_allowance`, `is_raised_swap` are broker/jobs **internal** fields — the public API does not accept them, so there is no flag. The multi-quote raise-token retry is handled server-side automatically (poll `order get`); the caller never sets these.
**JSON schema for `--fourmeme-rate-conf`** — single object:
| Field | Type | Required | Description |
|---|---|---|---|
| `fee_plan` | bool | No | Enable the fee plan |
| `recipient_address` | string | Yes | Fee recipient address |
| `fee_rate` | int | Yes | Fee rate, e.g. 5% → `5` (whole percent, not bps) |
| `burn_rate` | int | Yes | Burn share |
| `divide_rate` | int | Yes | Dividend share |
| `liquidity_rate` | int | Yes | Liquidity share |
| `recipient_rate` | int | Yes | Recipient share |
| `min_sharing` | int | Yes | Minimum sharing threshold |
> When `fee_rate > 0`: `burn_rate + divide_rate + liquidity_rate + recipient_rate` must sum to **100**. When `recipient_rate > 0`: `min_sharing` must be > 0.
## Auto-Sell Configuration
`sell_configs` is passed via `--sell-configs` as a JSON array. It schedules conditional sell orders to execute automatically once the token launch succeeds. Omit entirely for a standard launch with no auto-sell.
`--sell-configs` is a JSON array of `CookingSellConfig` objects:
| Field | Type | Required | Description |
|---|---|---|---|
| `sell_type` | string | Yes | `delay_sell` / `limit_order` |
| `delay_sec` | int64 | Conditional | Seconds after buy to trigger; required when `sell_type = delay_sell` |
| `delay_mili_sec` | int64 | No | Milliseconds after buy to trigger; takes precedence over `delay_sec` |
| `sell_ratio` | string | Yes | Fraction to sell — `"1"` = 100%, `"0.5"` = 50% |
| `check_price` | string | Conditional | Market cap in USD to trigger sell; required when `sell_type = limit_order` |
| `wallet_addresses` | []string | Yes | Wallets this strategy applies to (empty array = inert) |
Example: `--sell-configs '[{"sell_type":"delay_sell","delay_sec":60,"sell_ratio":"0.5","wallet_addresses":["<addr>"]}]'`
The buy/sell execution params for these CondMarket orders (slippage, fees, anti-MEV) can be tuned separately via `--buy-trade-config` / `--sell-trade-config` (TradeParam JSON). They do **not** affect the main creation tx, and fall back to the outer-level transaction flags when omitted.
> - **`check_price` is total market cap in USD** — e.g. `"50000"` triggers at a $50,000 market cap.
> - `wallet_addresses` may mix `from_address` and `buy_wallets` entries. The server creates `signal_cooking` for snipe wallets and `pending_sell` for main/bundle wallets automatically.
> - A wallet can carry multiple strategies (e.g. delay-sell 50%, then limit-sell the rest); each applies independently.
### TradeParam (`--buy-trade-config` / `--sell-trade-config`)
These tune the **execution params for the CondMarket buy/sell orders** (bundle buys, sniper buys, and auto-sell). They do **not** affect the main creation transaction (the dev tx uses the outer-level `--dev-*` flags). When omitted, they fall back to the outer-level transaction flags.
`--buy-trade-config` / `--sell-trade-config` each accept a single JSON object:
| Field | Type | Description |
|---|---|---|
| `slippage` | number | Slippage; only sent when truthy |
| `fee` | string | Base gas / fee; only sent when truthy |
| `priority_fee` | string | Priority fee; only sent when truthy |
| `tip_fee` | string | SOL Jito tip; only sent when truthy |
| `gas_price` | string | Gas price in wei (EVM); only sent when truthy |
| `max_priority_fee_per_gas` | string | EVM EIP-1559; only sent when truthy |
| `max_fee_per_gas` | string | EVM EIP-1559; only sent when truthy |
| `auto_slippage` | bool | Always sent |
| `is_anti_mev` | bool | Always sent |
| `anti_mev_mode` | string | `off` / `normal` / `secure`; always sent |
Example: `--buy-trade-config '{"slippage":50,"auto_slippage":false,"priority_fee":"0.0005","tip_fee":"0.0001","is_anti_mev":true,"anti_mev_mode":"secure"}'`
> A standard launch with no `buyConfig` sends `{"is_anti_mev":false,"anti_mev_mode":"off"}` and an empty `buy_wallets` list.
## `cooking create` Response Fields
| Field | Type | Description |
@@ -187,24 +386,10 @@ gmgn-cli cooking create \
--symbol MAT \
--buy-amt 0.01 \
--image-url https://example.com/logo.png \
--slippage 0.01 \
--slippage 30 \
--priority-fee 0.001
# Create a token on PancakeSwap (BSC) — with URL image and social links
gmgn-cli cooking create \
--chain bsc \
--dex pancakeswap \
--from <wallet_address> \
--name "BSC Token" \
--symbol BSCT \
--buy-amt 0.05 \
--image-url https://example.com/logo.png \
--slippage 0.02 \
--gas-price 5000000000 \
--website https://mytoken.io \
--twitter https://twitter.com/mytoken
# Create a token on FourMeme (BSC) — using base64 image from local file
# Create a token on FourMeme (BSC) — base64 image + USD1 raise token
gmgn-cli cooking create \
--chain bsc \
--dex fourmeme \
@@ -213,12 +398,13 @@ gmgn-cli cooking create \
--symbol FOUR \
--buy-amt 0.05 \
--image "$(base64 -i /path/to/logo.png)" \
--auto-slippage
--auto-slippage \
--raised-token USD1
# Create a token on letsbonk (SOL)
# Create a token on Bonk (SOL) with anti-MEV
gmgn-cli cooking create \
--chain sol \
--dex letsbonk \
--dex bonk \
--from <wallet_address> \
--name "Bonk Token" \
--symbol BNKT \
@@ -227,8 +413,70 @@ gmgn-cli cooking create \
--auto-slippage \
--anti-mev
# Create on Pump.fun with auto-sell: sell 50% 60s after buy
gmgn-cli cooking create \
--chain sol \
--dex pump \
--from <wallet_address> \
--name "My Token" \
--symbol MAT \
--buy-amt 0.01 \
--image-url https://example.com/logo.png \
--auto-slippage \
--sell-configs '[{"sell_type":"delay_sell","delay_sec":60,"sell_ratio":"0.5","wallet_addresses":["<wallet_address>"]}]'
```
### Full worked examples
These mirror real launch configurations end-to-end. Copy and adapt — every JSON flag below is a valid payload shape.
**Pump.fun (SOL) — Bundle + Sniper + Auto-Sell + Agent Auto Buyback**
```bash
gmgn-cli cooking create \
--chain sol \
--dex pump \
--from DevWallet... \
--name "Demo Coin" \
--symbol DEMO \
--buy-amt 0.5 \
--image-url https://cdn.example.com/coin.png \
--twitter https://x.com/handle/status/123 \
--priority-fee 0.0005 \
--tip-fee 0.0001 \
--is-buy-back \
--buy-trade-config '{"slippage":50,"auto_slippage":false,"priority_fee":"0.0005","tip_fee":"0.0001","is_anti_mev":true,"anti_mev_mode":"secure"}' \
--buy-wallets '[{"from_address":"Wallet1...","buy_amt":"0.1"},{"from_address":"Wallet2...","buy_amt":"0.1"}]' \
--snip-buy-wallets '[{"from_address":"Sniper1...","buy_amt":"0.05"}]' \
--sell-configs '[{"sell_type":"delay_sell","sell_ratio":"1","wallet_addresses":["Wallet1..."],"delay_mili_sec":5000}]'
```
- `--is-buy-back` is the Agent Auto Buyback mode (the backend also sets the agent fee internally).
- `buy_amt` values in `--buy-wallets` / `--snip-buy-wallets` are in native SOL.
- Bundle wallets ≤ 12, sniper wallets ≤ 10 on Pump.fun (see capability matrix).
**FourMeme (BSC) — user fee split + raise token USDT**
```bash
gmgn-cli cooking create \
--chain bsc \
--dex fourmeme \
--from 0xDev... \
--name "Demo BSC" \
--symbol DBSC \
--buy-amt 0.0123 \
--image-url https://cdn.example.com/coin.png \
--raised-token USDT \
--website https://demo.com \
--gas-price 1000000000 \
--auto-slippage \
--fourmeme-rate-conf '{"fee_rate":1,"recipient_rate":50,"burn_rate":20,"divide_rate":20,"liquidity_rate":10,"min_sharing":100000,"recipient_address":"0xDev..."}'
```
- `--buy-amt 0.0123` is **already converted to native BNB** from the USDT amount the user wanted (see Quote Token conversion). Do the conversion before building the command.
- `--gas-price 1000000000` is wei (1 Gwei).
- In `--fourmeme-rate-conf`, `recipient_rate + burn_rate + divide_rate + liquidity_rate` must sum to **100**.
## Output Format
### Pre-create Confirmation
@@ -247,10 +495,15 @@ Initial Buy: {--buy-amt} {native currency} (e.g. 0.01 SOL)
Slippage: {--slippage}% (or "auto")
Image: {--image-url or "base64 provided"}
Social: {twitter / telegram / website if provided}
Modes: {Mayhem / Cashback / Agent Auto Buyback if set, else "none"}
Fee Share: {recipient → % list if set, else "none"}
Auto-Sell: {sell_configs summary if set, else "none"}
Reply "confirm" to deploy this token. This action is IRREVERSIBLE.
```
Omit the Modes / Fee Share / Auto-Sell lines if none were configured — or show them as `none` — but if any **are** set, they MUST appear here so the user re-confirms them explicitly.
### Post-create Receipt
After polling confirms a successful deployment:
@@ -259,7 +512,7 @@ After polling confirms a successful deployment:
✅ Token Created
Token: {--name} ({--symbol})
Address: {output_token from order get}
Address: {report.output_token from order get}
Chain: {chain}
Platform: {--dex}
Tx: {explorer link for hash}
@@ -273,7 +526,6 @@ Block explorer links:
| sol | `https://solscan.io/tx/<hash>` |
| bsc | `https://bscscan.com/tx/<hash>` |
| base | `https://basescan.org/tx/<hash>` |
| eth | `https://etherscan.io/tx/<hash>` |
## Guided Launch Flow
@@ -287,24 +539,20 @@ Ask: *"Which chain and platform?"*
Show the options concisely:
| Chain | Platform | `--dex` |
|-------|----------|---------|
| Solana | Pump.fun | `pump` |
| Solana | letsbonk | `letsbonk` |
| Solana | Raydium | `raydium` |
| Solana | BAGS | `bags` |
| Solana | Memoo | `memoo` |
| Solana | Bonkers | `bonkers` |
| BSC | FourMeme | `fourmeme` |
| BSC | PancakeSwap | `pancakeswap` |
| BSC | Flap | `flap` |
| Base | Clanker | `clanker` |
| Base | Zora | `zora` |
| Base | Flaunch | `flaunch` |
| Base | Virtuals | `virtuals_v2` |
| Chain | Platform | `--dex` |
| ------ | ---------- | ---------- |
| Solana | Pump.fun | `pump` |
| Solana | Bonk | `bonk` |
| Solana | BAGS | `bags` |
| BSC | FourMeme | `fourmeme` |
| BSC | Flap | `flap` |
| Base | Klik | `klik` |
| Base | Clanker | `clanker` |
If the user is unsure, recommend: **Pump.fun (SOL)** or **FourMeme (BSC)**.
The chosen platform determines which advanced options are available later in Step 7 (e.g. Mayhem/Cashback/Agent Auto Buyback on Pump.fun, fee-share splits on BAGS/Flap/FourMeme). Note the platform now; do not ask about advanced options yet.
### Step 2 — Token Name
Ask: *"Token name?"*
@@ -343,9 +591,32 @@ Ask all optional fields together in one message:
The user can reply with just the ones they have, or say "skip" / "none" to proceed.
### Step 7 — Confirmation & Execute
### Step 7 — Platform Modes, Fees & Auto-Sell (platform-dependent)
Once all information is collected, present the pre-create confirmation summary (see Output Format section) and wait for the user to reply "confirm" before executing.
After the basics are collected, ask **once** whether the user wants any advanced options for the platform they chose. Default everyone to a plain fair launch — only configure these when the user explicitly asks. Tailor the question to the selected platform; do not list options that don't apply to it.
Ask: *"Want any advanced options, or launch with defaults? (reply 'defaults' to skip)"* — then offer the relevant subset.
**Phrase the question around the platform the user picked — only ask about modes that exist on that platform.** For example, on **Pump.fun** ask specifically:
- *"Enable Cashback mode?"* (`--is-cashback`)
- *"Enable Agent Auto Buyback mode?"* (`--is-buy-back`)
- *"Enable Mayhem mode?"* (`--is-mayhem`)
- *"Set up a fee-share split?"* (`--pump-fee-share-list`)
- *"Want me to remember these advanced settings for your next launch?"* — if yes, save them to memory so future launches can pre-fill the same choices.
Bonk / BAGS / Flap / FourMeme have **no mode toggles** — for those, skip the mode questions and only ask about fee-share split and auto-sell.
The relevant options per platform:
- **Pump.fun modes** — Mayhem (`--is-mayhem`), Cashback (`--is-cashback`), Agent Auto Buyback (`--is-buy-back`).
- **Fee-share split** — Pump.fun (`--pump-fee-share-list`), BAGS (`--dev-wallet-bps` + `--bags-fee-share-list`), Bonk (`--dev-wallet-bps`), Flap (`--flap-rate-conf`), FourMeme (`--fourmeme-rate-conf`). See [Advanced API Fields](#advanced-api-fields) for JSON schemas. **Warn the user this permanently routes token revenue to the listed accounts.** Always ask the user for shares as percentages — convert to bps yourself. Shares must add up to 100%.
- **Auto-sell** — `--sell-configs` (JSON): delay-sell (sell a fraction N seconds after the buy) and/or limit-sell (sell once market cap hits a USD target). See [Auto-Sell Configuration](#auto-sell-configuration). Confirm the sell ratio and trigger before setting it.
If the user says "defaults" / "skip" / "none", proceed with none of these set.
### Step 8 — Confirmation & Execute
Once all information is collected, present the pre-create confirmation summary (see Output Format section) and wait for the user to reply "confirm" before executing. If any advanced options from Step 7 were set, they MUST appear in the summary so the user re-confirms them explicitly.
---
@@ -355,18 +626,19 @@ Once all information is collected, present the pre-create confirmation summary (
- **[REQUIRED] `--dex` validation** — Before running, look up the user's named platform in the Supported Launchpads table and resolve to the correct `--dex` identifier. Never guess or pass a freeform platform name. If the chain/platform combination is not in the table, tell the user it is unsupported.
- **Slippage requirement** — Either `--slippage` or `--auto-slippage` must be provided. If the user did not specify, suggest `--auto-slippage` for volatile new tokens or ask for a preference.
- **Image handling** — If the user provides a file path, run `base64 -i <path>` and pass the result to `--image`. If they provide a URL, use `--image-url`. If neither is provided, ask before building the confirmation — most platforms require a logo.
- **Fee-share / bps inputs** — Always collect and confirm shares as percentages with the user; convert to basis points yourself (50% → `5000`). Never ask for a raw bps value.
- **Address validation** — Validate `--from` wallet address format before submitting:
- `sol`: base58, 3244 characters
- `bsc` / `base` / `eth`: `0x` + 40 hex digits
- `bsc` / `base`: `0x` + 40 hex digits
- **Chain-wallet compatibility** — SOL addresses are incompatible with EVM chains and vice versa. Warn the user and abort if the address format does not match the chain.
- **Order polling** — After `cooking create`, if `status` is `pending`, poll `order get` every 2 seconds up to 30 seconds. The token address is in `output_token`. Do not report success until `status` is `confirmed`.
- **Order polling** — After `cooking create`, if `status` is `pending`, poll `order get` every 2 seconds up to 30 seconds. The token address is in `report.output_token`. Do not report success until `status` is `confirmed`.
- **Credential sensitivity** — `GMGN_API_KEY` and `GMGN_PRIVATE_KEY` can execute real transactions. Never log, display, or expose these values.
## Notes
- `cooking create` uses **signed auth** (API Key + signature) — CLI handles signing automatically.
- `cooking stats` uses exist auth (API Key only — no private key needed).
- The new token's mint address is in `output_token` from `gmgn-cli order get`, not in the initial `cooking create` response.
- The new token's mint address is in `report.output_token` from `gmgn-cli order get`, not in the initial `cooking create` response.
- Use `--raw` on any command to get single-line JSON for further processing.
## References
+3 -2
View File
@@ -186,7 +186,7 @@ gmgn-cli portfolio token-balance \
| `--token <address>` | Filter by token |
| `--limit <n>` | Page size |
| `--cursor <cursor>` | Pagination cursor (pass the `next` value from the previous response) |
| `--type <type>` | Repeatable: `buy` / `sell` / `add` / `remove` / `transfer` |
| `--type <type>` | Repeatable: `buy` / `sell` / `transferIn` / `transferOut` / `add` / `remove` |
The activity response includes a `next` field. Pass it to `--cursor` to fetch the next page.
@@ -233,7 +233,8 @@ The response has a `activities` array and a `next` cursor field for pagination.
| `token.symbol` | Token ticker |
| `token_amount` | Token quantity in this transaction |
| `cost_usd` | USD value of this transaction |
| `price` | Token price in USD at time of transaction |
| `price` | Token price denominated in the quote token of the trading pair at time of transaction |
| `price_usd` | Token price in USD at time of transaction |
| `timestamp` | Unix timestamp of the transaction |
| `next` | Pagination cursor — pass to `--cursor` to fetch the next page |
+42 -20
View File
@@ -1,7 +1,7 @@
---
name: gmgn-swap
description: "[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. Requires explicit user confirmation. 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."
argument-hint: "[--chain <chain> --from <wallet> --input-token <addr> --output-token <addr> --amount <n>] | [order get --chain <chain> --order-id <id>] | [gas-price --chain <eth|bsc|base|sol>] | [order strategy list --chain <chain> --group-tag <LimitOrder|STMix>] | [order strategy create --chain <chain> --order-type limit_order --sub-order-type <buy_low|buy_high|stop_loss|take_profit> ...]"
argument-hint: "[--chain <chain> --from <wallet> --input-token <addr> --output-token <addr> --amount <n>] | [order get --chain <chain> --order-id <id>] | [gas-price --chain <eth|bsc|base|sol>] | [order strategy list --chain <chain> --group-tag <LimitOrder|STMix>] | [order strategy create --chain <chain> --order-type <limit_order|smart_trade> --sub-order-type <buy_low|buy_high|stop_loss|take_profit|mix_trade> ...]"
metadata:
cliHelp: "gmgn-cli swap --help"
---
@@ -18,7 +18,7 @@ Use the `gmgn-cli` tool to submit a token swap or query an existing order. `GMGN
- **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 expressed as a decimal, not a percentage. `0.01` = 1% slippage. `0.5` = 50% slippage. 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.
- **`slippage`** — Price tolerance as an integer 0100, 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.
@@ -88,6 +88,9 @@ All swap-related routes used by this skill go through GMGN's leaky-bucket limite
| `multi-swap` | `POST /v1/trade/multi_swap` | 5 |
| `order quote` | `GET /v1/trade/quote` | 2 |
| `order get` | `GET /v1/trade/query_order` | 1 |
| `order strategy create` | `POST /v1/trade/strategy/create` | 5 |
| `order strategy cancel` | `POST /v1/trade/strategy/cancel` | 2 |
| `order strategy list` | `GET /v1/trade/strategy/orders` | 1 |
| `gas-price` | `GET /v1/trade/gas_price` | 1 |
When a request returns `429`:
@@ -142,7 +145,7 @@ gmgn-cli swap \
--input-token <input_token_address> \
--output-token <output_token_address> \
--amount 1000000 \
--slippage 0.01
--slippage 30
# With automatic slippage
gmgn-cli swap \
@@ -181,7 +184,7 @@ gmgn-cli swap \
| `--output-token` | Yes | all | Output token contract address |
| `--amount` | No* | all | Input amount in smallest unit. **Mutually exclusive with `--percent`** — provide one or the other, never both. Required unless `--percent` is used. |
| `--percent <pct>` | No* | all | Sell percentage of `input_token`, e.g. `50` = 50%, `1` = 1%. Sets `input_amount` to `0` automatically. **Mutually exclusive with `--amount`. Only valid when `input_token` is NOT a currency (SOL/BNB/ETH/USDC).** |
| `--slippage <n>` | No | all | Slippage tolerance, e.g. `0.01` = 1%. **Mutually exclusive with `--auto-slippage`** — use one or the other. |
| `--slippage <n>` | No | all | Slippage tolerance as an integer 0100, e.g. `30` = 30%. **Mutually exclusive with `--auto-slippage`** — use one or the other. |
| `--auto-slippage` | No | all | Enable automatic slippage. **Mutually exclusive with `--slippage`.** |
| `--min-output <n>` | No | all | Minimum output amount |
| `--anti-mev` | No | sol / bsc / eth | Enable anti-MEV protection — **recommended**; protects against frontrunning and sandwich attacks. Default: on. **Not supported on `base`.** |
@@ -225,7 +228,7 @@ gmgn-cli swap \
--input-token So11111111111111111111111111111111111111112 \
--output-token <token_A_address> \
--amount 10000000 \
--slippage 0.3 \
--slippage 30 \
--anti-mev \
--condition-orders '[{"order_type":"profit_stop","side":"sell","price_scale":"100","sell_ratio":"50"},{"order_type":"profit_stop","side":"sell","price_scale":"300","sell_ratio":"100"},{"order_type":"loss_stop","side":"sell","price_scale":"65","sell_ratio":"100"}]' \
--sell-ratio-type hold_amount
@@ -243,7 +246,7 @@ gmgn-cli swap \
--input-token So11111111111111111111111111111111111111112 \
--output-token <token_A_address> \
--amount 10000000 \
--slippage 0.3 \
--slippage 30 \
--anti-mev \
--condition-orders '[{"order_type":"profit_stop","side":"sell","price_scale":"100","sell_ratio":"50"},{"order_type":"profit_stop","side":"sell","price_scale":"300","sell_ratio":"50"},{"order_type":"loss_stop","side":"sell","price_scale":"65","sell_ratio":"100"}]' \
--sell-ratio-type buy_amount
@@ -355,7 +358,7 @@ gmgn-cli multi-swap \
--input-token <input_token_address> \
--output-token <output_token_address> \
--input-amount '{"<addr1>":"1000000","<addr2>":"2000000"}' \
--slippage 0.01
--slippage 30
# Sell a percentage of each wallet's balance (use --input-amount-bps)
gmgn-cli multi-swap \
@@ -364,7 +367,7 @@ gmgn-cli multi-swap \
--input-token <token_address> \
--output-token <sol_address> \
--input-amount-bps '{"<addr1>":"5000","<addr2>":"10000"}' \
--slippage 0.01
--slippage 30
# With per-wallet take-profit / stop-loss (condition_orders)
gmgn-cli multi-swap \
@@ -373,7 +376,7 @@ gmgn-cli multi-swap \
--input-token So11111111111111111111111111111111111111112 \
--output-token <token_address> \
--input-amount '{"<addr1>":"1000000","<addr2>":"2000000"}' \
--slippage 0.3 \
--slippage 30 \
--priority-fee 0.00001 \
--tip-fee 0.00001 \
--condition-orders '[{"order_type":"profit_stop","side":"sell","price_scale":"100","sell_ratio":"100"},{"order_type":"loss_stop","side":"sell","price_scale":"50","sell_ratio":"100"}]'
@@ -385,7 +388,7 @@ gmgn-cli multi-swap \
--input-token 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 \
--output-token <token_address> \
--input-amount '{"<0xaddr1>":"1000000","<0xaddr2>":"2000000"}' \
--slippage 0.01 \
--slippage 30 \
--gas-price 5
```
@@ -400,7 +403,7 @@ gmgn-cli multi-swap \
| `--input-amount` | No* | all | JSON map of `wallet_address → input amount` (smallest unit). One of `--input-amount`, `--input-amount-bps`, or `--output-amount` is required. |
| `--input-amount-bps` | No* | all | JSON map of `wallet_address → percent in bps` (110000; 5000 = 50%). Only valid when `input_token` is NOT a currency. |
| `--output-amount` | No* | all | JSON map of `wallet_address → target output amount` (smallest unit). |
| `--slippage <n>` | No | all | Slippage tolerance, e.g. `0.01` = 1%. Mutually exclusive with `--auto-slippage`. |
| `--slippage <n>` | No | all | Slippage tolerance as an integer 0100, e.g. `30` = 30%. Mutually exclusive with `--auto-slippage`. |
| `--auto-slippage` | No | all | Enable automatic slippage. |
| `--anti-mev` | No | sol / bsc / eth | Enable anti-MEV protection. Not supported on `base`. |
| `--priority-fee <sol>` | No | `sol` | Priority fee in SOL (≥ 0.00001). Required when using `--condition-orders` on SOL. |
@@ -439,7 +442,7 @@ gmgn-cli order quote \
--input-token <input_token_address> \
--output-token <output_token_address> \
--amount <input_amount_smallest_unit> \
--slippage 0.01
--slippage 30
```
### `order quote` Response Fields
@@ -509,7 +512,7 @@ All fields are omitempty — fields unsupported by a chain are omitted. Units ar
## `order strategy create` Usage
```bash
# Create a take-profit order: sell when price rises to target
# Create a take-profit order: sell when price rises to target (limit_order)
gmgn-cli order strategy create \
--chain sol \
--from <wallet_address> \
@@ -519,9 +522,9 @@ gmgn-cli order strategy create \
--sub-order-type take_profit \
--check-price 0.002 \
--amount-in 1000000 \
--slippage 0.01
--slippage 30
# Create a stop-loss order: sell when price drops to target
# Create a stop-loss order: sell when price drops to target (limit_order)
gmgn-cli order strategy create \
--chain sol \
--from <wallet_address> \
@@ -531,7 +534,21 @@ gmgn-cli order strategy create \
--sub-order-type stop_loss \
--check-price 0.0005 \
--amount-in-percent 100 \
--slippage 0.01
--slippage 30
# Create a smart_trade with buy_low entry + take-profit + stop-loss (smart_trade)
gmgn-cli order strategy create \
--chain sol \
--from <wallet_address> \
--base-token <token_address> \
--quote-token <sol_address> \
--order-type smart_trade \
--sub-order-type mix_trade \
--open-price 0.000082 \
--amount-in 1000000 \
--slippage 30 \
--sell-param '{"slippage":30,"priority_fee":"0.00001","tip_fee":"0.00001"}' \
--condition-orders '[{"order_type":"buy_low","side":"buy","check_price":"0.00008"},{"order_type":"profit_stop","side":"sell","price_scale":"100","sell_ratio":"50"},{"order_type":"loss_stop","side":"sell","price_scale":"50","sell_ratio":"100"}]'
```
## `order strategy create` Parameters
@@ -542,15 +559,19 @@ gmgn-cli order strategy create \
| `--from` | Yes | all | Wallet address (must match API Key binding) |
| `--base-token` | Yes | all | Base token contract address |
| `--quote-token` | Yes | all | Quote token contract address |
| `--order-type` | Yes | all | Order type: `limit_order` |
| `--sub-order-type` | Yes | all | Sub-order type: `buy_low` / `buy_high` / `stop_loss` / `take_profit` |
| `--check-price` | Yes | all | Trigger check price |
| `--order-type` | Yes | all | Order type: `limit_order` / `smart_trade` |
| `--sub-order-type` | Yes | all | `limit_order`: `buy_low` / `buy_high` / `stop_loss` / `take_profit`; `smart_trade` with condition_orders: `mix_trade` |
| `--check-price` | No* | all | Trigger price — required for `limit_order`; omit for `smart_trade` (trigger is in the `buy_low` condition order) |
| `--open-price` | No | all | Open price of the position |
| `--amount-in` | No* | all | Input amount (smallest unit). Mutually exclusive with `--amount-in-percent` |
| `--amount-in-percent` | No* | all | Input as percentage (e.g. `50` = 50%). Mutually exclusive with `--amount-in` |
| `--limit-price-mode` | No | all | `exact` / `slippage` (default: `slippage`) |
| `--expire-in` | No | all | Order expiry in seconds |
| `--sell-ratio-type` | No | all | `buy_amount` (default) — when triggered, sells a fixed token amount stored at strategy creation time; `hold_amount` — when triggered, sells a fixed percentage of the position held at trigger time |
| `--slippage` | No | all | Slippage tolerance, e.g. `0.01` = 1%. Mutually exclusive with `--auto-slippage` |
| `--quote-investment` | No | all | Quote token investment amount (`smart_trade`) |
| `--sell-param` | Yes (`smart_trade`) | all | JSON object of sell-side trade params (slippage, fee, gas, etc.) used when a TP/SL condition fires. **Required for `smart_trade`.** Same fields as the root TradeParam; `slippage` is 0100 integer. |
| `--buy-param` | No | all | JSON object of buy-side trade params override for `smart_trade`. Same fields as root TradeParam; `slippage` is 0100 integer. |
| `--slippage` | No | all | Slippage tolerance as an integer 0100, e.g. `30` = 30%. Mutually exclusive with `--auto-slippage`. Defaults to auto-slippage if neither is set. |
| `--auto-slippage` | No | all | Enable automatic slippage |
| `--priority-fee` | No | `sol` | Priority fee in SOL (≥ 0.00001). **Required** for SOL. |
| `--tip-fee` | No | `sol` / `bsc` | Tip fee (SOL ≥ 0.00001 / BSC ≥ 0.000001 BNB). **Required** for SOL. |
@@ -560,6 +581,7 @@ gmgn-cli order strategy create \
| `--max-fee-per-gas` | No | `bsc` / `base` / `eth` | EIP-1559 max fee per gas. Clamped per chain minimums. |
| `--max-priority-fee-per-gas` | No | `bsc` / `base` / `eth` | EIP-1559 max priority fee per gas. Clamped per chain minimums; capped to `--max-fee-per-gas`. |
| `--anti-mev` | No | sol / bsc / eth | Enable anti-MEV protection. Not supported on `base`. |
| `--condition-orders` | No | all | JSON array of condition sub-orders for `smart_trade`. Must include one `buy_low` entry (with `check_price` lower than `open_price`) plus at least one TP/SL entry. |
### `order strategy create` Response Fields
+123 -1
View File
@@ -127,7 +127,7 @@ export interface StrategyCreateParams {
quote_token: string;
order_type: string;
sub_order_type: string;
check_price: string;
check_price?: string;
open_price?: string;
amount_in?: string;
amount_in_percent?: string;
@@ -148,6 +148,8 @@ export interface StrategyCreateParams {
priority_fee?: string;
tip_fee?: string;
custom_rpc?: string;
condition_orders?: StrategyConditionOrder[];
quote_investment?: string;
}
export interface StrategyCancelParams {
@@ -170,27 +172,147 @@ export interface TokenSignalGroup {
max_create_or_open_ts?: string;
}
export interface PumpFeeShareInfo {
provider: string; // "solana" | "twitter" | "github"
username: string; // platform username; a SOL address when provider = "solana"
basic_points: number;
}
export interface BAGSFeeShareInfo {
provider: string; // "twitter" | "solana" | "kick" | "github"
username: string;
basic_points: number;
}
export interface FlapRateConf {
tax_rate?: number; // V5 unified tax rate, e.g. 5% -> 500
buy_tax_rate?: number; // V6 separate buy tax rate
sell_tax_rate?: number; // V6 separate sell tax rate
mkt_bps?: number;
deflation_bps?: number;
dividend_bps?: number;
lp_bps?: number;
minimum_share_balance?: number;
recipient_type?: string;
beneficiary?: string;
twitter_account?: string;
split_conf?: Array<{ recipient: string; bps: number }>;
}
export interface FourmemeRateConf {
fee_plan?: boolean;
fee_rate?: number;
burn_rate?: number;
divide_rate?: number;
liquidity_rate?: number;
recipient_rate?: number;
recipient_address?: string;
min_sharing?: number;
}
export interface BuyWalletInfo {
from_address: string;
buy_amt: string;
}
// Buy/sell execution config for CondMarket orders (snipe buy, auto-sell, pending_sell).
// Does NOT affect the main creation tx. Falls back to outer-level fields when omitted.
export interface TradeParam {
slippage?: number;
auto_slippage?: boolean;
fee?: string;
priority_fee?: string;
tip_fee?: string;
gas_price?: string;
max_priority_fee_per_gas?: string;
max_fee_per_gas?: string;
is_anti_mev?: boolean; // backend currently forces true; passing has no effect
anti_mev_mode?: string; // backend currently forces "secure"; passing has no effect
}
export interface CookingSellConfig {
sell_type: string; // "delay_sell" | "limit_order"
delay_sec?: number; // required when sell_type = "delay_sell"
delay_mili_sec?: number; // optional; takes precedence over delay_sec
sell_ratio: string; // "1" = 100%, "0.5" = 50%
check_price?: string; // trigger market cap in USD; required when sell_type = "limit_order"
wallet_addresses: string[]; // empty array means the strategy is inert
}
export interface CreateTokenParams {
// Required
chain: string;
dex: string;
from_address: string;
name: string;
symbol: string;
buy_amt: string;
// Image (one required)
image?: string;
image_url?: string;
// Social
description?: string;
website?: string;
twitter?: string;
telegram?: string;
// Transaction
slippage?: number;
auto_slippage?: boolean;
// Fees
fee?: string;
priority_fee?: string;
tip_fee?: string;
gas_price?: string;
max_priority_fee_per_gas?: string;
max_fee_per_gas?: string;
// Anti-MEV (SOL only)
is_anti_mev?: boolean;
anti_mev_mode?: string;
// Advanced
raised_token?: string;
dev_gas?: string;
dev_priority?: string;
dev_tip?: string;
dev_max_fee_per_gas?: string;
approve_vision?: string;
source?: string;
dev_wallet_bps?: number;
// CondMarket buy/sell execution config (snipe / bundle / auto-sell)
buy_trade_config?: TradeParam;
sell_trade_config?: TradeParam;
// Auto-sell strategies created after a successful launch
sell_configs?: CookingSellConfig[];
// Pump.fun specific
is_mayhem?: boolean;
is_cashback?: boolean;
is_buy_back?: boolean;
pump_fee_share_list?: PumpFeeShareInfo[];
// Flap specific
flap_rate_conf?: FlapRateConf;
// FourMeme specific
fourmeme_rate_conf?: FourmemeRateConf;
// BAGS specific
bags_fee_share_list?: BAGSFeeShareInfo[];
// Bonk specific
bonk_model?: string;
// Multi-wallet buy
buy_wallets?: BuyWalletInfo[];
snip_buy_wallets?: BuyWalletInfo[];
interval_seconds?: number;
}
export class OpenApiClient {
+3 -2
View File
@@ -44,11 +44,12 @@ export function buildMessage(
const sortedQs = Object.keys(queryParams)
.sort()
.flatMap((k) => {
const ek = encodeURIComponent(k);
const v = queryParams[k];
if (Array.isArray(v)) {
return [...v].sort().map((item) => `${k}=${item}`);
return [...v].sort().map((item) => `${ek}=${encodeURIComponent(item)}`);
}
return [`${k}=${v}`];
return [`${ek}=${encodeURIComponent(String(v))}`];
})
.join("&");
return `${subPath}:${sortedQs}:${body}:${timestamp}`;
+65 -4
View File
@@ -20,23 +20,57 @@ export function registerCookingCommands(program: Command): void {
cooking
.command("create")
.description("Create a token on a launchpad platform (requires private key)")
.requiredOption("--chain <chain>", "Chain: sol / bsc / base / eth / ton")
.requiredOption("--dex <dex>", "Launchpad: pump / raydium / pancakeswap / flap / fourmeme / bonk / bags / ...")
.requiredOption("--chain <chain>", "Chain: sol / bsc / base")
.requiredOption("--dex <dex>", "Launchpad: pump / bonk / bags (sol) / fourmeme / flap (bsc) / klik / clanker (base)")
.requiredOption("--from <address>", "Wallet address (must match API Key binding)")
.requiredOption("--name <name>", "Token name")
.requiredOption("--symbol <symbol>", "Token symbol")
.requiredOption("--buy-amt <amount>", "Initial buy amount in native token (e.g. 0.01 SOL)")
.option("--image <base64>", "Token logo as base64-encoded data (max 2MB decoded)")
.option("--image-url <url>", "Token logo URL")
.option("--description <text>", "Token description / project pitch")
.option("--website <url>", "Website URL")
.option("--twitter <url>", "Twitter link")
.option("--telegram <url>", "Telegram link")
.option("--slippage <n>", "Slippage tolerance (e.g. 0.01 = 1%)", parseFloat)
.option("--slippage <n>", "Slippage tolerance (e.g. 30 = 30%)", parseFloat)
.option("--auto-slippage", "Enable automatic slippage")
.option("--fee <amount>", "Base gas / fee")
.option("--priority-fee <sol>", "Priority fee in SOL (SOL only)")
.option("--tip-fee <amount>", "Tip fee")
.option("--gas-price <amount>", "Gas price in wei (EVM chains)")
.option("--anti-mev", "Enable anti-MEV protection")
.option("--max-fee-per-gas <amount>", "Max fee per gas in wei (EVM only)")
.option("--max-priority-fee-per-gas <amount>", "Max priority fee per gas in wei (EVM only)")
.option("--anti-mev", "Enable anti-MEV protection (SOL only)")
.option("--anti-mev-mode <mode>", "Anti-MEV mode: off / normal / secure (SOL only)")
.option("--raised-token <symbol>", "Raise token symbol: pump→USDC; bonk→USD1; fourmeme→USDT/USD1; leave empty for native")
.option("--dev-wallet-bps <n>", "Dev wallet fee in basis points (100 = 1%)", parseInt)
.option("--dev-gas <amount>", "Dev gas amount")
.option("--dev-priority <amount>", "Dev priority fee")
.option("--dev-tip <amount>", "Dev tip fee")
.option("--dev-max-fee-per-gas <amount>", "Dev tx feeCap in wei (EVM EIP-1559)")
.option("--approve-vision <version>", "Approve vision version: v1 / v2 (default: v2)")
.option("--source <source>", "Traffic source identifier")
// Pump.fun specific
.option("--is-mayhem", "Enable Mayhem mode (Pump.fun only)")
.option("--is-cashback", "Enable Cashback (Pump.fun only)")
.option("--is-buy-back", "Enable Agent Auto Buyback (Pump.fun only)")
.option("--pump-fee-share-list <json>", "Pump.fun fee share list as JSON array (Pump.fun only)")
// Flap specific
.option("--flap-rate-conf <json>", "Flap rate config as JSON object (Flap only)")
// FourMeme specific
.option("--fourmeme-rate-conf <json>", "FourMeme rate config as JSON object (FourMeme only)")
// BAGS specific
.option("--bags-fee-share-list <json>", "BAGS fee share list as JSON array (BAGS only)")
// Bonk specific
.option("--bonk-model <model>", "Bonk model identifier (bonk DEX only)")
// Multi-wallet buy
.option("--buy-wallets <json>", "Multi-wallet buy config as JSON array [{from_address, buy_amt}]")
.option("--snip-buy-wallets <json>", "Snipe-buy wallet config as JSON array [{from_address, buy_amt}]")
.option("--interval-seconds <n>", "Interval between multi-wallet buys in seconds", parseInt)
// CondMarket execution config + auto-sell (JSON)
.option("--buy-trade-config <json>", "Buy-side trade config for CondMarket orders as JSON (TradeParam)")
.option("--sell-trade-config <json>", "Sell-side trade config for auto-sell / pending_sell as JSON (TradeParam)")
.option("--sell-configs <json>", "Auto-sell strategy list as JSON array (CookingSellConfig[])")
.option("--raw", "Output raw JSON")
.action(async (opts) => {
if (!opts.image && !opts.imageUrl) {
@@ -58,15 +92,42 @@ export function registerCookingCommands(program: Command): void {
};
if (opts.image) params.image = opts.image;
if (opts.imageUrl) params.image_url = opts.imageUrl;
if (opts.description) params.description = opts.description;
if (opts.website) params.website = opts.website;
if (opts.twitter) params.twitter = opts.twitter;
if (opts.telegram) params.telegram = opts.telegram;
if (opts.slippage != null) params.slippage = opts.slippage;
if (opts.autoSlippage) params.auto_slippage = true;
if (opts.fee) params.fee = opts.fee;
if (opts.priorityFee) params.priority_fee = opts.priorityFee;
if (opts.tipFee) params.tip_fee = opts.tipFee;
if (opts.gasPrice) params.gas_price = opts.gasPrice;
if (opts.maxFeePerGas) params.max_fee_per_gas = opts.maxFeePerGas;
if (opts.maxPriorityFeePerGas) params.max_priority_fee_per_gas = opts.maxPriorityFeePerGas;
if (opts.antiMev) params.is_anti_mev = true;
if (opts.antiMevMode) params.anti_mev_mode = opts.antiMevMode;
if (opts.raisedToken != null) params.raised_token = opts.raisedToken;
if (opts.devWalletBps != null) params.dev_wallet_bps = opts.devWalletBps;
if (opts.devGas) params.dev_gas = opts.devGas;
if (opts.devPriority) params.dev_priority = opts.devPriority;
if (opts.devTip) params.dev_tip = opts.devTip;
if (opts.devMaxFeePerGas) params.dev_max_fee_per_gas = opts.devMaxFeePerGas;
if (opts.approveVision) params.approve_vision = opts.approveVision;
if (opts.source) params.source = opts.source;
if (opts.isMayhem) params.is_mayhem = true;
if (opts.isCashback) params.is_cashback = true;
if (opts.isBuyBack) params.is_buy_back = true;
if (opts.pumpFeeShareList) params.pump_fee_share_list = JSON.parse(opts.pumpFeeShareList);
if (opts.flapRateConf) params.flap_rate_conf = JSON.parse(opts.flapRateConf);
if (opts.fourmemeRateConf) params.fourmeme_rate_conf = JSON.parse(opts.fourmemeRateConf);
if (opts.bagsFeeShareList) params.bags_fee_share_list = JSON.parse(opts.bagsFeeShareList);
if (opts.bonkModel) params.bonk_model = opts.bonkModel;
if (opts.buyWallets) params.buy_wallets = JSON.parse(opts.buyWallets);
if (opts.snipBuyWallets) params.snip_buy_wallets = JSON.parse(opts.snipBuyWallets);
if (opts.intervalSeconds != null) params.interval_seconds = opts.intervalSeconds;
if (opts.buyTradeConfig) params.buy_trade_config = JSON.parse(opts.buyTradeConfig);
if (opts.sellTradeConfig) params.sell_trade_config = JSON.parse(opts.sellTradeConfig);
if (opts.sellConfigs) params.sell_configs = JSON.parse(opts.sellConfigs);
const client = new OpenApiClient(getConfig(true));
const data = await client.createToken(params).catch(exitOnError);
printResult(data, opts.raw);
+1 -1
View File
@@ -51,7 +51,7 @@ export function registerPortfolioCommands(program: Command): void {
.option("--token <address>", "Filter by token contract address")
.option("--limit <n>", "Page size", parseInt)
.option("--cursor <cursor>", "Pagination cursor")
.option("--type <type...>", "Activity type filter, repeatable: buy / sell / add / remove / transfer")
.option("--type <type...>", "Activity type filter, repeatable: buy / sell / transferIn / transferOut / add / remove")
.option("--raw", "Output raw JSON")
.action(async (opts) => {
validateChain(opts.chain);
+17 -8
View File
@@ -14,7 +14,7 @@ export function registerSwapCommands(program: Command): void {
.requiredOption("--output-token <address>", "Output token contract address")
.option("--amount <amount>", "Input raw amount (smallest unit)")
.option("--percent <pct>", "Input amount as a percentage, e.g. 50 = 50%, 1 = 1%; only valid when input_token is NOT a currency", parseFloat)
.option("--slippage <n>", "Slippage tolerance (e.g. 0.01 = 1%)", parseFloat)
.option("--slippage <n>", "Slippage tolerance (e.g. 30 = 30%)", parseFloat)
.option("--auto-slippage", "Enable automatic slippage")
.option("--min-output <amount>", "Minimum output amount")
.option("--anti-mev", "Enable anti-MEV protection, default true")
@@ -83,7 +83,7 @@ export function registerSwapCommands(program: Command): void {
.option("--input-amount <json>", 'JSON map of wallet→amount (smallest unit), e.g. \'{"addr1":"1000000","addr2":"2000000"}\'')
.option("--input-amount-bps <json>", 'JSON map of wallet→percent in bps (110000, e.g. 5000=50%), e.g. \'{"addr1":"5000"}\'')
.option("--output-amount <json>", "JSON map of wallet→target output amount")
.option("--slippage <n>", "Slippage tolerance (e.g. 0.01 = 1%)", parseFloat)
.option("--slippage <n>", "Slippage tolerance (e.g. 30 = 30%)", parseFloat)
.option("--auto-slippage", "Enable automatic slippage")
.option("--anti-mev", "Enable anti-MEV protection")
.option("--priority-fee <sol>", "Priority fee in SOL (SOL only, ≥ 0.00001)")
@@ -155,7 +155,7 @@ export function registerSwapCommands(program: Command): void {
.requiredOption("--input-token <address>", "Input token contract address")
.requiredOption("--output-token <address>", "Output token contract address")
.requiredOption("--amount <amount>", "Input amount (smallest unit)")
.requiredOption("--slippage <n>", "Slippage tolerance (e.g. 0.01 = 1%)", parseFloat)
.requiredOption("--slippage <n>", "Slippage tolerance (e.g. 30 = 30%)", parseFloat)
.option("--raw", "Output raw JSON")
.action(async (opts) => {
validateChain(opts.chain);
@@ -203,15 +203,17 @@ export function registerSwapCommands(program: Command): void {
.requiredOption("--from <address>", "Wallet address (must match API Key binding)")
.requiredOption("--base-token <address>", "Base token contract address")
.requiredOption("--quote-token <address>", "Quote token contract address")
.requiredOption("--order-type <type>", "Order type: limit_order")
.requiredOption("--sub-order-type <type>", "Sub-order type: buy_low / buy_high / stop_loss / take_profit")
.requiredOption("--check-price <price>", "Trigger check price")
.requiredOption("--order-type <type>", "Order type: limit_order / smart_trade")
.requiredOption("--sub-order-type <type>", "Sub-order type: buy_low / buy_high / stop_loss / take_profit (limit_order); mix_trade (smart_trade with condition_orders)")
.option("--check-price <price>", "Trigger check price (required for limit_order; omit for smart_trade)")
.option("--open-price <price>", "Open price of the position")
.option("--amount-in <amount>", "Input amount (smallest unit)")
.option("--amount-in-percent <pct>", "Input amount as a percentage (e.g. 50 = 50%)")
.option("--limit-price-mode <mode>", "Price mode: exact / slippage (default: slippage)")
.option("--expire-in <seconds>", "Order expiry in seconds", parseInt)
.option("--sell-ratio-type <type>", "Sell ratio basis: buy_amount (default) / hold_amount")
.option("--slippage <n>", "Slippage tolerance (e.g. 0.01 = 1%)", parseFloat)
.option("--quote-investment <amount>", "Quote token investment amount (smart_trade)")
.option("--slippage <n>", "Slippage tolerance (e.g. 30 = 30%)", parseFloat)
.option("--auto-slippage", "Enable automatic slippage")
.option("--priority-fee <sol>", "Priority fee in SOL (required for SOL chain)")
.option("--tip-fee <amount>", "Tip fee (required for SOL chain)")
@@ -221,6 +223,7 @@ export function registerSwapCommands(program: Command): void {
.option("--max-fee-per-gas <amount>", "EIP-1559 max fee per gas (BSC / BASE / ETH)")
.option("--max-priority-fee-per-gas <amount>", "EIP-1559 max priority fee per gas (BSC / BASE / ETH)")
.option("--anti-mev", "Enable anti-MEV protection")
.option("--condition-orders <json>", "JSON array of condition sub-orders for smart_trade (must include a buy_low entry + TP/SL entries)")
.option("--raw", "Output raw JSON")
.action(async (opts) => {
if (!opts.amountIn && !opts.amountInPercent) {
@@ -239,13 +242,15 @@ export function registerSwapCommands(program: Command): void {
quote_token: opts.quoteToken,
order_type: opts.orderType,
sub_order_type: opts.subOrderType,
check_price: opts.checkPrice,
};
if (opts.checkPrice) params.check_price = opts.checkPrice;
if (opts.openPrice) params.open_price = opts.openPrice;
if (opts.amountIn) params.amount_in = opts.amountIn;
if (opts.amountInPercent) params.amount_in_percent = opts.amountInPercent;
if (opts.limitPriceMode) params.limit_price_mode = opts.limitPriceMode;
if (opts.expireIn != null) params.expire_in = opts.expireIn;
if (opts.sellRatioType) params.sell_ratio_type = opts.sellRatioType;
if (opts.quoteInvestment) params.quote_investment = opts.quoteInvestment;
if (opts.slippage != null) params.slippage = opts.slippage;
if (opts.autoSlippage) params.auto_slippage = true;
if (opts.priorityFee) params.priority_fee = opts.priorityFee;
@@ -256,6 +261,10 @@ export function registerSwapCommands(program: Command): void {
if (opts.maxFeePerGas) params.max_fee_per_gas = opts.maxFeePerGas;
if (opts.maxPriorityFeePerGas) params.max_priority_fee_per_gas = opts.maxPriorityFeePerGas;
if (opts.antiMev) params.is_anti_mev = true;
if (opts.conditionOrders) {
try { params.condition_orders = JSON.parse(opts.conditionOrders); }
catch { console.error("[gmgn-cli] --condition-orders must be valid JSON"); process.exit(1); }
}
const client = new OpenApiClient(getConfig(true));
const data = await client.createStrategyOrder(params).catch(exitOnError);
printResult(data, opts.raw);