Compare commits

..
Author SHA1 Message Date
David LauandClaude Sonnet 4.6 2073b5fdaf docs(token): document dev object in token info response
- Add dev nested object table to Response Field Reference with all 21 fields
  (creator wallet, DEXScreener activity, CTO flag, funding source, etc.)
- Update nested objects description to include dev as the 5th object

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-08 16:09:17 +08:00
deepfeatureandGitHub fce314b9ab Merge pull request #81 from GMGNAI/feat/condition-order-trace-types
docs(swap): require group_tag in order strategy list; add list examples
2026-04-08 15:26:55 +08:00
David LauandClaude Sonnet 4.6 dbe3eec697 docs(swap): require group_tag in order strategy list; add list examples
- Mark --group-tag as required (LimitOrder or STMix)
- Add usage examples: STMix for condition orders, LimitOrder for limit orders

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-08 15:05:01 +08:00
gumponchain a9979f9dd3 1.2.2 2026-04-08 11:58:55 +08:00
GMGN.AIandGitHub 83aee6e759 Merge pull request #79 from GumpOnchain/docs/swap-group-tag-order-type
docs(swap): clarify group-tag and order-type descriptions
2026-04-08 11:50:45 +08:00
gumponchainandClaude Sonnet 4.6 567c5f92d1 docs(swap): clarify group-tag and order-type descriptions
- --group-tag: LimitOrder fetches limit orders only; STMix fetches mixed strategy orders (take-profit, stop-loss, trailing variants)
- order cancel --order-type: clarify limit_order vs smart_trade meanings

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-08 11:47:35 +08:00
GMGN.AIandGitHub 25b9da3fdf Merge pull request #78 from GMGNAI/feat/condition-order-trace-types
feat(swap): support profit_stop_trace and loss_stop_trace in condition orders
2026-04-08 11:09:29 +08:00
David LauandClaude Sonnet 4.6 7445c970bc feat(swap): support profit_stop_trace and loss_stop_trace in condition orders
- Add drawdown_rate optional field to StrategyConditionOrder interface
- Make price_scale optional (required only for fixed-price types)
- Update --condition-orders help text with trace type example
- Document all 4 condition order types in SKILL.md with field requirements,
  drawdown_rate semantics, and usage examples
- Sync order strategy create params: replace --side / auto-inference with
  explicit --order-type and --sub-order-type required options
- Add --group-tag to order strategy list params
- Add --order-type to order strategy cancel params
- Fix --gas-price description: gwei (not wei); CLI converts internally

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-08 11:02:31 +08:00
GMGN.AIandGitHub c525fba661 Merge pull request #77 from prodev-nova/feat/cooking
docs(cooking): improve guided launch flow and clarify env credential lookup
2026-04-07 15:46:15 +08:00
prodev-nova 0ce0051e60 docs(cooking): improve guided launch flow and clarify env credential lookup
- Rewrite Guided Launch Flow: required fields collected one at a time,
  optional fields grouped into a single question for faster UX
- Add env lookup warning: document that a local .env in the workspace
  overrides ~/.config/gmgn/.env, with a check command
2026-04-07 15:08:06 +08:00
GMGN.AIandGitHub 49397c2b62 Merge pull request #75 from GumpOnchain/order-fix
docs(swap): fix price_scale definition and update all skills
2026-04-03 17:14:16 +08:00
gumponchainandClaude Sonnet 4.6 8999d36d1d docs(swap): fix price_scale definition and update all skills
- Redefine price_scale: profit_stop uses gain % from entry (e.g. "100" = +100% / 2×), loss_stop uses drop % from entry (e.g. "65" = drops 65%)
- Update all condition-order examples in SKILL.md and both READMEs accordingly
- Add is_anti_mev recommended note and anti-mev flag to swap examples
- Add order strategy create to Financial Risk Notice
- Fix response section heading format (bold → ###) for order strategy create/list
- Add reset_at field extraction guidance to Rate Limit Handling in all 6 skills

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-03 17:11:16 +08:00
GMGN.AIandGitHub 013a6c867c Merge pull request #74 from GumpOnchain/order-fix
docs(swap): add condition-orders, ConditionOrder fields, and sell-ratio-type descriptions
2026-04-03 16:03:43 +08:00
gumponchainandClaude Sonnet 4.6 29eeb723e4 docs(swap): add swap with TP/SL examples to readmes and update SKILL.md
- Add "Swap with Take-Profit / Stop-Loss Orders" section to Readme.md and Readme.zh.md
  with hold_amount and buy_amount mode examples (TP at +100%/+300%, SL at -65%)
- Reorder CLI Reference section: basic Swap moved before TP/SL examples
- Update SKILL.md condition-orders examples: add stop-loss at -65%, bump slippage to 0.3,
  add note that hold_amount includes any added positions at trigger time

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-03 15:52:40 +08:00
gumponchainandClaude Sonnet 4.6 60a199cb80 docs(swap): add condition-orders params, ConditionOrder fields, and sell-ratio-type descriptions
- Add --condition-orders parameter with max-10-sub-orders note and best-effort strategy behavior
- Add --sell-ratio-type with detailed explanation of buy_amount vs hold_amount semantics
- Add ConditionOrder sub-table (order_type, side, price_scale, sell_ratio) with supported types
- Add two full CLI examples: hold_amount (sell 50% at 2x, remaining 50% at 4x) and buy_amount (fixed ratio each trigger)
- Add strategy_order_id to swap response fields
- Update --sell-ratio-type description in order strategy create section

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-03 15:32:50 +08:00
deepfeatureandGitHub e4bc94c625 Merge pull request #73 from GMGNAI/codex-issue-72-strategy-list-auth
[codex] Fix strategy list signature auth
2026-04-03 14:23:58 +08:00
deepfeature ed27705826 fix strategy list signature auth 2026-04-03 14:21:59 +08:00
13 changed files with 341 additions and 140 deletions
+87 -46
View File
@@ -500,52 +500,6 @@ gmgn-cli track smartmoney --limit 100 --raw
gmgn-cli track smartmoney --chain sol --side sell --limit 50 --raw gmgn-cli track smartmoney --chain sol --side sell --limit 50 --raw
``` ```
### Limit Orders (requires private key)
```bash
# Create a take-profit order
gmgn-cli order strategy create \
--chain sol \
--from <wallet_address> \
--base-token <token_address> \
--quote-token <sol_address> \
--sub-order-type take_profit \
--check-price 0.002 \
--amount-in-percent 100 \
--slippage 0.01
# Create a stop-loss order
gmgn-cli order strategy create \
--chain sol \
--from <wallet_address> \
--base-token <token_address> \
--quote-token <sol_address> \
--sub-order-type stop_loss \
--check-price 0.0005 \
--amount-in-percent 100 \
--slippage 0.01
# List open strategy orders
gmgn-cli order strategy list --chain sol
# Cancel a strategy order
gmgn-cli order strategy cancel --chain sol --from <wallet_address> --order-id <order_id>
```
### Cooking (requires private key)
```bash
# Buy token and automatically attach take-profit + stop-loss condition orders
gmgn-cli cooking \
--chain sol \
--from <wallet_address> \
--input-token So11111111111111111111111111111111111111112 \
--output-token <token_address> \
--amount 1000000000 \
--slippage 0.1 \
--condition-orders '[{"order_type":"profit_stop","side":"sell","price_scale":"200","sell_ratio":"100"},{"order_type":"loss_stop","side":"sell","price_scale":"50","sell_ratio":"100"}]'
```
### Swap (requires private key) ### Swap (requires private key)
```bash ```bash
@@ -589,6 +543,93 @@ gmgn-cli order quote \
gmgn-cli order get --chain sol --order-id <order-id> gmgn-cli order get --chain sol --order-id <order-id>
``` ```
### Swap with Take-Profit / Stop-Loss Orders (requires private key)
**`hold_amount` mode** — each condition order fires based on current holdings at trigger time:
```bash
# Buy token A with 0.01 SOL; take-profit 50% at +100%, take-profit remaining 50% at +300%, stop-loss 100% at -65%
gmgn-cli swap \
--chain sol \
--from <wallet_address> \
--input-token So11111111111111111111111111111111111111112 \
--output-token <token_A_address> \
--amount 10000000 \
--slippage 0.3 \
--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
```
> `price_scale` for `profit_stop`: gain % from entry (`"100"` = +100% / 2×, `"300"` = +300% / 4×). For `loss_stop`: drop % from entry (`"65"` = drops 65%, triggers at 35% of entry).
> `hold_amount`: the second take-profit fires on whatever is held at that point (the remaining 50%). If you added to your position in between, those additional tokens will be included as well.
**`buy_amount` mode** — each condition order fires based on the original bought amount:
```bash
# Same strategy using fixed percentages of the original bought amount
gmgn-cli swap \
--chain sol \
--from <wallet_address> \
--input-token So11111111111111111111111111111111111111112 \
--output-token <token_A_address> \
--amount 10000000 \
--slippage 0.3 \
--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
```
> `buy_amount`: each take-profit sells 50% of the **original** bought amount. Stop-loss sells 100% of the original bought amount.
---
### Limit Orders (requires private key)
```bash
# Create a take-profit order
gmgn-cli order strategy create \
--chain sol \
--from <wallet_address> \
--base-token <token_address> \
--quote-token <sol_address> \
--sub-order-type take_profit \
--check-price 0.002 \
--amount-in-percent 100 \
--slippage 0.01
# Create a stop-loss order
gmgn-cli order strategy create \
--chain sol \
--from <wallet_address> \
--base-token <token_address> \
--quote-token <sol_address> \
--sub-order-type stop_loss \
--check-price 0.0005 \
--amount-in-percent 100 \
--slippage 0.01
# List open strategy orders (requires private key)
gmgn-cli order strategy list --chain sol
# Cancel a strategy order
gmgn-cli order strategy cancel --chain sol --from <wallet_address> --order-id <order_id>
```
### Cooking (requires private key)
```bash
# Buy token and automatically attach take-profit + stop-loss condition orders
gmgn-cli cooking \
--chain sol \
--from <wallet_address> \
--input-token So11111111111111111111111111111111111111112 \
--output-token <token_address> \
--amount 1000000000 \
--slippage 0.3 \
--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"}]'
```
## 9. Supported Chains ## 9. Supported Chains
| Commands | Chains | Chain Currencies | | Commands | Chains | Chain Currencies |
+87 -46
View File
@@ -532,52 +532,6 @@ gmgn-cli track smartmoney --limit 100 --raw
gmgn-cli track smartmoney --chain sol --side sell --limit 50 --raw gmgn-cli track smartmoney --chain sol --side sell --limit 50 --raw
``` ```
### 限价单(需要私钥)
```bash
# 创建止盈单
gmgn-cli order strategy create \
--chain sol \
--from <wallet_address> \
--base-token <token_address> \
--quote-token <sol_address> \
--sub-order-type take_profit \
--check-price 0.002 \
--amount-in-percent 100 \
--slippage 0.01
# 创建止损单
gmgn-cli order strategy create \
--chain sol \
--from <wallet_address> \
--base-token <token_address> \
--quote-token <sol_address> \
--sub-order-type stop_loss \
--check-price 0.0005 \
--amount-in-percent 100 \
--slippage 0.01
# 查看当前挂单
gmgn-cli order strategy list --chain sol
# 撤销策略单
gmgn-cli order strategy cancel --chain sol --from <wallet_address> --order-id <order_id>
```
### Cooking 一键策略单(需要私钥)
```bash
# 买入代币,同时自动挂止盈 + 止损条件单
gmgn-cli cooking \
--chain sol \
--from <wallet_address> \
--input-token So11111111111111111111111111111111111111112 \
--output-token <token_address> \
--amount 1000000000 \
--slippage 0.1 \
--condition-orders '[{"order_type":"profit_stop","side":"sell","price_scale":"200","sell_ratio":"100"},{"order_type":"loss_stop","side":"sell","price_scale":"50","sell_ratio":"100"}]'
```
### Swap(需要私钥) ### Swap(需要私钥)
```bash ```bash
@@ -621,6 +575,93 @@ gmgn-cli order quote \
gmgn-cli order get --chain sol --order-id <order-id> gmgn-cli order get --chain sol --order-id <order-id>
``` ```
### 带止盈止损的 Swap(需要私钥)
**`hold_amount` 模式** — 按触发时的实际持仓比例卖出:
```bash
# 用 0.01 SOL 买入代币 A;涨 100% 卖 50%,涨 300% 卖剩余 50%,跌 65% 全卖
gmgn-cli swap \
--chain sol \
--from <wallet_address> \
--input-token So11111111111111111111111111111111111111112 \
--output-token <token_A_address> \
--amount 10000000 \
--slippage 0.3 \
--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
```
> `price_scale` 止盈时为涨幅百分比(`"100"` = 涨 100% / 2×,`"300"` = 涨 300% / 4×);止损时为跌幅百分比(`"65"` = 跌 65%,触发价为入场价的 35%)。
> `hold_amount`:第二个止盈单触发时,按触发时持仓(剩余 50%)的 100% 卖出。如果中间有加仓,加仓的部分也会一同被卖掉。
**`buy_amount` 模式** — 按原始买入量的固定百分比卖出:
```bash
# 相同策略,使用原始买入量的固定百分比
gmgn-cli swap \
--chain sol \
--from <wallet_address> \
--input-token So11111111111111111111111111111111111111112 \
--output-token <token_A_address> \
--amount 10000000 \
--slippage 0.3 \
--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
```
> `buy_amount`:每个止盈单各卖原始买入量的 50%,止损单卖原始买入量的 100%。
---
### 限价单(需要私钥)
```bash
# 创建止盈单
gmgn-cli order strategy create \
--chain sol \
--from <wallet_address> \
--base-token <token_address> \
--quote-token <sol_address> \
--sub-order-type take_profit \
--check-price 0.002 \
--amount-in-percent 100 \
--slippage 0.01
# 创建止损单
gmgn-cli order strategy create \
--chain sol \
--from <wallet_address> \
--base-token <token_address> \
--quote-token <sol_address> \
--sub-order-type stop_loss \
--check-price 0.0005 \
--amount-in-percent 100 \
--slippage 0.01
# 查看当前挂单(需要私钥)
gmgn-cli order strategy list --chain sol
# 撤销策略单
gmgn-cli order strategy cancel --chain sol --from <wallet_address> --order-id <order_id>
```
### Cooking 一键策略单(需要私钥)
```bash
# 买入代币,同时自动挂止盈 + 止损条件单
gmgn-cli cooking \
--chain sol \
--from <wallet_address> \
--input-token So11111111111111111111111111111111111111112 \
--output-token <token_address> \
--amount 1000000000 \
--slippage 0.3 \
--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"}]'
```
## 9. 支持的链 ## 9. 支持的链
| 接口类型 | 支持的链 | 链原生货币 | | 接口类型 | 支持的链 | 链原生货币 |
+1 -1
View File
@@ -532,7 +532,7 @@ gmgn-cli order strategy create \
## order strategy list ## order strategy list
List strategy orders. Uses normal auth. List strategy orders. **Requires `GMGN_PRIVATE_KEY` configured in `.env`.**
```bash ```bash
gmgn-cli order strategy list --chain <chain> [--type <open|history>] [--from <address>] [--group-tag <tag>] [--base-token <address>] [--page-token <token>] [--limit <n>] [--raw] gmgn-cli order strategy list --chain <chain> [--type <open|history>] [--from <address>] [--group-tag <tag>] [--base-token <address>] [--page-token <token>] [--limit <n>] [--raw]
+2 -2
View File
@@ -1,12 +1,12 @@
{ {
"name": "gmgn-cli", "name": "gmgn-cli",
"version": "1.2.1", "version": "1.2.2",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "gmgn-cli", "name": "gmgn-cli",
"version": "1.2.1", "version": "1.2.2",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"commander": "^12.1.0", "commander": "^12.1.0",
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "gmgn-cli", "name": "gmgn-cli",
"version": "1.2.1", "version": "1.2.2",
"description": "GMGN OpenAPI CLI — call GMGN market, token, portfolio and swap APIs from the command line", "description": "GMGN OpenAPI CLI — call GMGN market, token, portfolio and swap APIs from the command line",
"type": "module", "type": "module",
"bin": { "bin": {
+39 -22
View File
@@ -66,6 +66,12 @@ When the user names a platform colloquially (e.g. "pump.fun", "four.meme", "Panc
- `cooking create`: Both `GMGN_API_KEY` and `GMGN_PRIVATE_KEY` must be configured in `~/.config/gmgn/.env`. The private key must correspond to the wallet bound to the API Key. - `cooking create`: Both `GMGN_API_KEY` and `GMGN_PRIVATE_KEY` must be configured in `~/.config/gmgn/.env`. The private key must correspond to the wallet bound to the API Key.
- `gmgn-cli` installed globally — if missing, run: `npm install -g gmgn-cli` - `gmgn-cli` installed globally — if missing, run: `npm install -g gmgn-cli`
**IMPORTANT — Credential lookup order:** `gmgn-cli` loads `~/.config/gmgn/.env` first, then overlays any `.env` found in the **current working directory** (project-level overrides global). If credentials appear missing or wrong, check whether a `.env` in the workspace directory is shadowing the global config:
```bash
ls -la .env 2>/dev/null && echo "WARNING: local .env is overriding ~/.config/gmgn/.env"
```
If a local `.env` exists but lacks `GMGN_API_KEY` / `GMGN_PRIVATE_KEY`, either add them to that file or remove it so the global config is used.
## Rate Limit Handling ## Rate Limit Handling
All cooking routes go through GMGN's leaky-bucket limiter with `rate=10` and `capacity=10`. Sustained throughput is roughly `10 ÷ weight` requests/second. All cooking routes go through GMGN's leaky-bucket limiter with `rate=10` and `capacity=10`. Sustained throughput is roughly `10 ÷ weight` requests/second.
@@ -78,6 +84,7 @@ All cooking routes go through GMGN's leaky-bucket limiter with `rate=10` and `ca
When a request returns `429`: When a request returns `429`:
- Read `X-RateLimit-Reset` from the response headers — Unix timestamp for when the limit resets. - Read `X-RateLimit-Reset` from the response headers — Unix timestamp for when the limit resets.
- If the response body contains `reset_at` (e.g., `{"code":429,"error":"RATE_LIMIT_BANNED","message":"...","reset_at":1775184222}`), extract `reset_at` — it is the Unix timestamp when the ban lifts (typically 5 minutes). Convert to local time and tell the user exactly when they can retry.
- `cooking create` is a real transaction: **never loop or auto-resubmit** after a `429`. Wait until the reset time, then ask for confirmation again before retrying. - `cooking create` is a real transaction: **never loop or auto-resubmit** after a `429`. Wait until the reset time, then ask for confirmation again before retrying.
- For `RATE_LIMIT_EXCEEDED` or `RATE_LIMIT_BANNED`, repeated requests during cooldown extend the ban by 5 seconds each time, up to 5 minutes. - For `RATE_LIMIT_EXCEEDED` or `RATE_LIMIT_BANNED`, repeated requests during cooldown extend the ban by 5 seconds each time, up to 5 minutes.
@@ -270,13 +277,15 @@ Block explorer links:
## Guided Launch Flow ## Guided Launch Flow
When a user says they want to launch / create / deploy a token but has not provided all required information, do NOT ask for everything at once. Collect information in this order, one step at a time: When a user says they want to launch / create / deploy a token but has not provided all required information, collect information **one required field at a time** — never bundle multiple required fields into a single question. The user should be able to reply with a single value, not a labeled list.
Ask each required field as a short, direct question. Wait for the answer before moving to the next. Optional fields are grouped into one question after all required fields are collected.
### Step 1 — Chain & Platform ### Step 1 — Chain & Platform
Ask: *"Which chain and platform do you want to launch on?"* Ask: *"Which chain and platform?"*
Show the available options: Show the options concisely:
| Chain | Platform | `--dex` | | Chain | Platform | `--dex` |
|-------|----------|---------| |-------|----------|---------|
@@ -294,39 +303,47 @@ Show the available options:
| Base | Flaunch | `flaunch` | | Base | Flaunch | `flaunch` |
| Base | Virtuals | `virtuals_v2` | | Base | Virtuals | `virtuals_v2` |
If the user is unsure, recommend: **Pump.fun (SOL)** or **FourMeme (BSC)** — the two most active launchpads. If the user is unsure, recommend: **Pump.fun (SOL)** or **FourMeme (BSC)**.
### Step 2 — Token Identity ### Step 2 — Token Name
Ask for name, symbol, and description together: Ask: *"Token name?"*
*"What is your token's name, ticker symbol, and a short description?"* Wait for the user's reply (e.g. `Doge Killer`).
- Name: the full display name (e.g. `Doge Killer`) ### Step 3 — Token Symbol
- Symbol: short uppercase ticker, typically 38 characters (e.g. `DOGEK`)
- Description: optional but recommended — a one-line pitch shown on the launchpad
### Step 3 — Logo Ask: *"Ticker symbol?"*
Ask: *"Do you have a logo image? You can share a file path (e.g. `/Users/you/logo.png`) or an image URL."* Wait for the user's reply (e.g. `DOGEK`). Typically 38 uppercase characters.
- If the user provides a **file path**: silently run `base64 -i <path>` and pass the result to `--image`. Do not mention "base64" to the user. ### Step 4 — Logo
- If the user provides a **URL**: use `--image-url` directly.
- If the user has no logo: note that most platforms accept a launch without one, but it significantly reduces visibility. Ask if they want to proceed without it.
### Step 4 — Social Links (optional) Ask: *"Logo image? (file path or URL — skip to launch without one)"*
Ask: *"Do you have a Twitter, Telegram, or website to attach to the token? You can skip this."* - **File path** → silently run `base64 -i <path>` and pass the result to `--image`. Do not mention "base64" to the user.
- **URL** → use `--image-url` directly.
Collect any combination of `--twitter`, `--telegram`, `--website`. If the user skips, proceed to the next step. - **Skip / none** → proceed without a logo. Note that most platforms accept this, but it reduces visibility.
### Step 5 — Initial Buy Amount ### Step 5 — Initial Buy Amount
Ask: *"How much {SOL / BNB / ETH} do you want to spend on the initial buy?"* Ask: *"How much {SOL / BNB / ETH} for the initial buy?"*
Pass the user's answer directly to `--buy-amt` — this is already in full token units (e.g. `0.01` = 0.01 SOL), do NOT convert to lamports or wei. Pass the user's answer directly to `--buy-amt` — already in full token units (e.g. `0.01` = 0.01 SOL). Do NOT convert to lamports or wei.
### Step 6 — Confirmation & Execute ### Step 6 — Optional Details (single question)
Ask all optional fields together in one message:
*"Any optional extras? (skip any you don't need)"*
- *Description* — one-line pitch shown on the launchpad
- *Twitter* — Twitter / X URL
- *Telegram* — Telegram group URL
- *Website* — project website URL
The user can reply with just the ones they have, or say "skip" / "none" to proceed.
### Step 7 — 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. 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.
+1
View File
@@ -71,6 +71,7 @@ All market routes used by this skill go through GMGN's leaky-bucket limiter with
When a request returns `429`: When a request returns `429`:
- Read `X-RateLimit-Reset` from the response headers. It is a Unix timestamp in seconds that marks when the limit is expected to reset. - Read `X-RateLimit-Reset` from the response headers. It is a Unix timestamp in seconds that marks when the limit is expected to reset.
- If the response body contains `reset_at` (e.g., `{"code":429,"error":"RATE_LIMIT_BANNED","message":"...","reset_at":1775184222}`), extract `reset_at` — it is the Unix timestamp when the ban lifts (typically 5 minutes). Convert to local time and tell the user exactly when they can retry.
- The CLI may wait and retry once automatically when the remaining cooldown is short. If it still fails, stop and tell the user the exact retry time instead of sending more requests. - The CLI may wait and retry once automatically when the remaining cooldown is short. If it still fails, stop and tell the user the exact retry time instead of sending more requests.
- For `RATE_LIMIT_EXCEEDED` or `RATE_LIMIT_BANNED`, repeated requests during the cooldown can extend the ban by 5 seconds each time, up to 5 minutes. Do not spam retries. - For `RATE_LIMIT_EXCEEDED` or `RATE_LIMIT_BANNED`, repeated requests during the cooldown can extend the ban by 5 seconds each time, up to 5 minutes. Do not spam retries.
+1
View File
@@ -64,6 +64,7 @@ All portfolio routes used by this skill go through GMGN's leaky-bucket limiter w
When a request returns `429`: When a request returns `429`:
- Read `X-RateLimit-Reset` from the response headers. It is a Unix timestamp in seconds that marks when the limit is expected to reset. - Read `X-RateLimit-Reset` from the response headers. It is a Unix timestamp in seconds that marks when the limit is expected to reset.
- If the response body contains `reset_at` (e.g., `{"code":429,"error":"RATE_LIMIT_BANNED","message":"...","reset_at":1775184222}`), extract `reset_at` — it is the Unix timestamp when the ban lifts (typically 5 minutes). Convert to local time and tell the user exactly when they can retry.
- The CLI may wait and retry once automatically when the remaining cooldown is short. If it still fails, stop and tell the user the exact retry time instead of sending more requests. - The CLI may wait and retry once automatically when the remaining cooldown is short. If it still fails, stop and tell the user the exact retry time instead of sending more requests.
- For `RATE_LIMIT_EXCEEDED` or `RATE_LIMIT_BANNED`, repeated requests during the cooldown can extend the ban by 5 seconds each time, up to 5 minutes. Do not spam retries. - For `RATE_LIMIT_EXCEEDED` or `RATE_LIMIT_BANNED`, repeated requests during the cooldown can extend the ban by 5 seconds each time, up to 5 minutes. Do not spam retries.
+85 -14
View File
@@ -24,7 +24,7 @@ Use the `gmgn-cli` tool to submit a token swap or query an existing order. **Req
- **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. - **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. Enabled by default. - **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.
- **Critical auth**`swap` requires 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. Normal commands (like `order quote`) use API Key alone. - **Critical auth**`swap` requires 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. Normal commands (like `order quote`) use API Key alone.
@@ -36,7 +36,7 @@ Use the `gmgn-cli` tool to submit a token swap or query an existing order. **Req
**This skill executes REAL, IRREVERSIBLE blockchain transactions.** **This skill executes REAL, IRREVERSIBLE blockchain transactions.**
- Every `swap` command submits an on-chain transaction that moves real funds. - Every `swap` and `order strategy create` command submits an on-chain transaction that moves real funds.
- Transactions cannot be undone once confirmed on-chain. - Transactions cannot be undone once confirmed on-chain.
- The AI agent must **never auto-execute a swap** — explicit user confirmation is required every time, without exception. - The AI agent must **never auto-execute a swap** — explicit user confirmation is required every time, without exception.
- Only use this skill with funds you are willing to trade. Start with small amounts when testing. - Only use this skill with funds you are willing to trade. Start with small amounts when testing.
@@ -49,7 +49,7 @@ Use the `gmgn-cli` tool to submit a token swap or query an existing order. **Req
| `order quote` | Get a swap quote (no transaction submitted) | | `order quote` | Get a swap quote (no transaction submitted) |
| `order get` | Query order status | | `order get` | Query order status |
| `order strategy create` | Create a limit/strategy order (requires private key) | | `order strategy create` | Create a limit/strategy order (requires private key) |
| `order strategy list` | List strategy orders (normal auth) | | `order strategy list` | List strategy orders (requires private key) |
| `order strategy cancel` | Cancel a strategy order (requires private key) | | `order strategy cancel` | Cancel a strategy order (requires private key) |
## Supported Chains ## Supported Chains
@@ -87,6 +87,7 @@ All swap-related routes used by this skill go through GMGN's leaky-bucket limite
When a request returns `429`: When a request returns `429`:
- Read `X-RateLimit-Reset` from the response headers. It is a Unix timestamp in seconds that marks when the limit is expected to reset. - Read `X-RateLimit-Reset` from the response headers. It is a Unix timestamp in seconds that marks when the limit is expected to reset.
- If the response body contains `reset_at` (e.g., `{"code":429,"error":"RATE_LIMIT_BANNED","message":"...","reset_at":1775184222}`), extract `reset_at` — it is the Unix timestamp when the ban lifts (typically 5 minutes). Convert to local time and tell the user exactly when they can retry.
- `swap` is a real transaction: never loop or auto-submit repeated swap attempts after a `429`. Wait until the reset time, then ask for confirmation again before retrying. - `swap` is a real transaction: never loop or auto-submit repeated swap attempts after a `429`. Wait until the reset time, then ask for confirmation again before retrying.
- The CLI may wait and retry once automatically for short cooldowns on read-only commands such as `order quote` and `order get`. If it still fails, stop and tell the user the exact retry time instead of sending more requests. - The CLI may wait and retry once automatically for short cooldowns on read-only commands such as `order quote` and `order get`. If it still fails, stop and tell the user the exact retry time instead of sending more requests.
- For `RATE_LIMIT_EXCEEDED` or `RATE_LIMIT_BANNED`, repeated requests during the cooldown can extend the ban by 5 seconds each time, up to 5 minutes. - For `RATE_LIMIT_EXCEEDED` or `RATE_LIMIT_BANNED`, repeated requests during the cooldown can extend the ban by 5 seconds each time, up to 5 minutes.
@@ -206,13 +207,71 @@ gmgn-cli order get --chain sol --order-id <order_id>
| `--slippage <n>` | No | Slippage tolerance, e.g. `0.01` = 1%. **Mutually exclusive with `--auto-slippage`** — use one or the other. | | `--slippage <n>` | No | Slippage tolerance, e.g. `0.01` = 1%. **Mutually exclusive with `--auto-slippage`** — use one or the other. |
| `--auto-slippage` | No | Enable automatic slippage. **Mutually exclusive with `--slippage`.** | | `--auto-slippage` | No | Enable automatic slippage. **Mutually exclusive with `--slippage`.** |
| `--min-output <n>` | No | Minimum output amount | | `--min-output <n>` | No | Minimum output amount |
| `--anti-mev` | No | Enable anti-MEV protection (default true) | | `--anti-mev` | No | Enable anti-MEV protection **recommended**; protects against frontrunning and sandwich attacks. Default: on |
| `--priority-fee <sol>` | No | Priority fee in SOL (≥ 0.00001, SOL only) | | `--priority-fee <sol>` | No | Priority fee in SOL (≥ 0.00001, SOL only) |
| `--tip-fee <n>` | No | Tip fee (SOL ≥ 0.00001 / BSC ≥ 0.000001 BNB) | | `--tip-fee <n>` | No | Tip fee (SOL ≥ 0.00001 / BSC ≥ 0.000001 BNB) |
| `--max-auto-fee <n>` | No | Max automatic fee cap | | `--max-auto-fee <n>` | No | Max automatic fee cap |
| `--gas-price <gwei>` | No | Gas price in gwei (BSC ≥ 0.05 / BASE/ETH ≥ 0.01) | | `--gas-price <gwei>` | No | Gas price in gwei (BSC ≥ 0.05 / BASE/ETH ≥ 0.01) |
| `--max-fee-per-gas <n>` | No | EIP-1559 max fee per gas (Base only) | | `--max-fee-per-gas <n>` | No | EIP-1559 max fee per gas (Base only) |
| `--max-priority-fee-per-gas <n>` | No | EIP-1559 max priority fee per gas (Base only) | | `--max-priority-fee-per-gas <n>` | No | EIP-1559 max priority fee per gas (Base only) |
| `--condition-orders <json>` | No | JSON array of condition sub-orders (take-profit / stop-loss) to attach after a successful swap. **Max 10 sub-orders.** Strategy creation is best-effort: if the swap succeeds but strategy creation fails, the swap result is still returned. See ConditionOrder fields below. |
| `--sell-ratio-type <type>` | No | Sell ratio basis for `--condition-orders`: `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 |
### ConditionOrder Fields (for `--condition-orders`)
Each element in the `--condition-orders` JSON array supports:
| Field | Required | Type | Description |
|-------|----------|------|-------------|
| `order_type` | Yes | string | Sub-order type: `profit_stop` (fixed take-profit), `loss_stop` (fixed stop-loss), `profit_stop_trace` (trailing take-profit), `loss_stop_trace` (trailing stop-loss) |
| `side` | Yes | string | Always `"sell"` |
| `price_scale` | Conditional | string | Gain/drop % from entry. Required for `profit_stop` / `loss_stop` / `profit_stop_trace`; optional for `loss_stop_trace`. For `profit_stop` / `profit_stop_trace`: gain % (e.g. `"100"` = +100% / 2× entry). For `loss_stop` / `loss_stop_trace`: drop % (e.g. `"65"` = drops 65%, triggers at 35% of entry). |
| `sell_ratio` | Yes | string | Percentage of position to sell when triggered, e.g. `"100"` = 100% |
| `drawdown_rate` | Conditional | string | Required for `profit_stop_trace` and `loss_stop_trace`. Trailing callback %: after price peaks, how far it must fall before the order fires. E.g. `"50"` = 50% drawdown from peak. |
**Example — attach take-profit at 2× (+100%) and stop-loss at -60%:**
```json
[
{"order_type": "profit_stop", "side": "sell", "price_scale": "100", "sell_ratio": "100"},
{"order_type": "loss_stop", "side": "sell", "price_scale": "60", "sell_ratio": "100"}
]
```
**Example — buy token A with 0.01 SOL, take-profit 50% at +100%, take-profit remaining 50% at +300%, stop-loss 100% at -65% (trigger at 35% entry price) (`hold_amount` mode):**
```bash
gmgn-cli swap \
--chain sol \
--from <wallet_address> \
--input-token So11111111111111111111111111111111111111112 \
--output-token <token_A_address> \
--amount 10000000 \
--slippage 0.3 \
--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
```
> `price_scale` for `profit_stop`: gain % from entry (`"100"` = +100% / 2×, `"300"` = +300% / 4×). For `loss_stop`: drop % from entry (`"65"` = drops 65%, triggers at 35% of entry).
> `hold_amount`: the second take-profit fires on whatever is held at trigger time (the remaining 50%). If you added to your position in between, those additional tokens will be included as well.
**Same strategy using `buy_amount` mode — fixed percentage of the original bought amount at each trigger:**
```bash
gmgn-cli swap \
--chain sol \
--from <wallet_address> \
--input-token So11111111111111111111111111111111111111112 \
--output-token <token_A_address> \
--amount 10000000 \
--slippage 0.3 \
--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
```
> `buy_amount`: each take-profit sells 50% of the **original** bought amount. Stop-loss sells 100% of the original bought amount.
## `swap` Response Fields ## `swap` Response Fields
@@ -227,6 +286,7 @@ gmgn-cli order get --chain sol --order-id <order_id>
| `output_token` | string | Output token contract address | | `output_token` | string | Output token contract address |
| `filled_input_amount` | string | Actual input consumed (smallest unit); empty if not filled | | `filled_input_amount` | string | Actual input consumed (smallest unit); empty if not filled |
| `filled_output_amount` | string | Actual output received (smallest unit); empty if not filled | | `filled_output_amount` | string | Actual output received (smallest unit); empty if not filled |
| `strategy_order_id` | string | Strategy order ID; only present when `--condition-orders` was passed and strategy creation succeeded (best-effort) |
## Output Format ## Output Format
@@ -290,22 +350,23 @@ Convert `filled_input_amount` and `filled_output_amount` from smallest unit usin
| `--from` | Yes | Wallet address (must match API Key binding) | | `--from` | Yes | Wallet address (must match API Key binding) |
| `--base-token` | Yes | Base token contract address | | `--base-token` | Yes | Base token contract address |
| `--quote-token` | Yes | Quote token contract address | | `--quote-token` | Yes | Quote token contract address |
| `--side` | Yes | Direction: `buy` / `sell` | | `--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 | | `--check-price` | Yes | Trigger check price |
| `--amount-in` | No* | Input amount (smallest unit). Mutually exclusive with `--amount-in-percent` | | `--amount-in` | No* | Input amount (smallest unit). Mutually exclusive with `--amount-in-percent` |
| `--amount-in-percent` | No* | Input as percentage (e.g. `50` = 50%). Mutually exclusive with `--amount-in` | | `--amount-in-percent` | No* | Input as percentage (e.g. `50` = 50%). Mutually exclusive with `--amount-in` |
| `--limit-price-mode` | No | `exact` / `slippage` (default: `slippage`) | | `--limit-price-mode` | No | `exact` / `slippage` (default: `slippage`) |
| `--expire-in` | No | Order expiry in seconds | | `--expire-in` | No | Order expiry in seconds |
| `--sell-ratio-type` | No | `buy_amount` (default) / `hold_amount` | | `--sell-ratio-type` | No | `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 | Slippage tolerance, e.g. `0.01` = 1%. Mutually exclusive with `--auto-slippage` | | `--slippage` | No | Slippage tolerance, e.g. `0.01` = 1%. Mutually exclusive with `--auto-slippage` |
| `--auto-slippage` | No | Enable automatic slippage | | `--auto-slippage` | No | Enable automatic slippage |
| `--priority-fee` | No | Priority fee in SOL (SOL only) | | `--priority-fee` | No | Priority fee in SOL (SOL only) |
| `--tip-fee` | No | Tip fee | | `--tip-fee` | No | Tip fee |
| `--gas-price` | No | Gas price in wei (EVM chains) | | `--gas-price` | No | Gas price in gwei (BSC ≥ 0.05 gwei / BASE/ETH ≥ 0.01 gwei) |
| `--anti-mev` | No | Enable anti-MEV protection | | `--anti-mev` | No | Enable anti-MEV protection |
**`order strategy create` Response Fields:** ### `order strategy create` Response Fields
| Field | Type | Description | | Field | Type | Description |
|-------|------|-------------| |-------|------|-------------|
@@ -319,11 +380,12 @@ Convert `filled_input_amount` and `filled_output_amount` from smallest unit usin
| `--chain` | Yes | `sol` / `bsc` / `base` | | `--chain` | Yes | `sol` / `bsc` / `base` |
| `--type` | No | `open` (default) / `history` | | `--type` | No | `open` (default) / `history` |
| `--from` | No | Filter by wallet address | | `--from` | No | Filter by wallet address |
| `--group-tag` | Yes | Filter by order group: `LimitOrder` (limit orders only) / `STMix` (mixed strategy orders: take-profit, stop-loss, trailing take-profit, trailing stop-loss) |
| `--base-token` | No | Filter by token address | | `--base-token` | No | Filter by token address |
| `--page-token` | No | Pagination cursor from previous response | | `--page-token` | No | Pagination cursor from previous response |
| `--limit` | No | Results per page (default 10 for history) | | `--limit` | No | Results per page (default 10 for history) |
**`order strategy list` Response Fields:** ### `order strategy list` Response Fields
| Field | Type | Description | | Field | Type | Description |
|-------|------|-------------| |-------|------|-------------|
@@ -338,6 +400,7 @@ Convert `filled_input_amount` and `filled_output_amount` from smallest unit usin
| `--chain` | Yes | `sol` / `bsc` / `base` | | `--chain` | Yes | `sol` / `bsc` / `base` |
| `--from` | Yes | Wallet address (must match API Key binding) | | `--from` | Yes | Wallet address (must match API Key binding) |
| `--order-id` | Yes | Order ID to cancel | | `--order-id` | Yes | Order ID to cancel |
| `--order-type` | No | Order type: `limit_order` (limit order) / `smart_trade` (mixed strategy order: take-profit, stop-loss, trailing take-profit, trailing stop-loss) |
| `--close-sell-model` | No | Sell model when closing the order | | `--close-sell-model` | No | Sell model when closing the order |
## `order strategy` Usage Examples ## `order strategy` Usage Examples
@@ -349,6 +412,7 @@ gmgn-cli order strategy create \
--from <wallet_address> \ --from <wallet_address> \
--base-token <token_address> \ --base-token <token_address> \
--quote-token <sol_address> \ --quote-token <sol_address> \
--order-type limit_order \
--sub-order-type take_profit \ --sub-order-type take_profit \
--check-price 0.002 \ --check-price 0.002 \
--amount-in 1000000 \ --amount-in 1000000 \
@@ -360,16 +424,23 @@ gmgn-cli order strategy create \
--from <wallet_address> \ --from <wallet_address> \
--base-token <token_address> \ --base-token <token_address> \
--quote-token <sol_address> \ --quote-token <sol_address> \
--order-type limit_order \
--sub-order-type stop_loss \ --sub-order-type stop_loss \
--check-price 0.0005 \ --check-price 0.0005 \
--amount-in-percent 100 \ --amount-in-percent 100 \
--slippage 0.01 --slippage 0.01
# List open strategy orders # List open condition orders (profit_stop / loss_stop / trace types) — use STMix
gmgn-cli order strategy list --chain sol gmgn-cli order strategy list --chain sol --group-tag STMix
# List history orders with pagination # List open limit orders (buy_low / buy_high / stop_loss / take_profit) — use LimitOrder
gmgn-cli order strategy list --chain sol --type history --limit 20 gmgn-cli order strategy list --chain sol --group-tag LimitOrder
# List condition order history with pagination
gmgn-cli order strategy list --chain sol --group-tag STMix --type history --limit 20
# Filter by token
gmgn-cli order strategy list --chain sol --group-tag STMix --base-token <token_address>
# Cancel a strategy order # Cancel a strategy order
gmgn-cli order strategy cancel \ gmgn-cli order strategy cancel \
@@ -383,7 +454,7 @@ gmgn-cli order strategy cancel \
- Swap uses **critical auth** (API Key + signature) — CLI handles signing automatically, no manual processing needed - Swap uses **critical auth** (API Key + signature) — CLI handles signing automatically, no manual processing needed
- After submitting a swap, use `order get` to poll for confirmation - After submitting a swap, use `order get` to poll for confirmation
- `--amount` is in the **smallest unit** (e.g., lamports for SOL) - `--amount` is in the **smallest unit** (e.g., lamports for SOL)
- `order strategy create` and `order strategy cancel` use critical auth (require `GMGN_PRIVATE_KEY`); `order strategy list` uses normal auth - `order strategy create`, `order strategy list`, and `order strategy cancel` use critical auth (require `GMGN_PRIVATE_KEY`)
- Use `--raw` to get single-line JSON for further processing - Use `--raw` to get single-line JSON for further processing
## Input Validation ## Input Validation
+27 -1
View File
@@ -64,6 +64,7 @@ All token routes used by this skill go through GMGN's leaky-bucket limiter with
When a request returns `429`: When a request returns `429`:
- Read `X-RateLimit-Reset` from the response headers. It is a Unix timestamp in seconds that marks when the limit is expected to reset. - Read `X-RateLimit-Reset` from the response headers. It is a Unix timestamp in seconds that marks when the limit is expected to reset.
- If the response body contains `reset_at` (e.g., `{"code":429,"error":"RATE_LIMIT_BANNED","message":"...","reset_at":1775184222}`), extract `reset_at` — it is the Unix timestamp when the ban lifts (typically 5 minutes). Convert to local time and tell the user exactly when they can retry.
- The CLI may wait and retry once automatically when the remaining cooldown is short. If it still fails, stop and tell the user the exact retry time instead of sending more requests. - The CLI may wait and retry once automatically when the remaining cooldown is short. If it still fails, stop and tell the user the exact retry time instead of sending more requests.
- For `RATE_LIMIT_EXCEEDED` or `RATE_LIMIT_BANNED`, repeated requests during the cooldown can extend the ban by 5 seconds each time, up to 5 minutes. Do not spam retries. - For `RATE_LIMIT_EXCEEDED` or `RATE_LIMIT_BANNED`, repeated requests during the cooldown can extend the ban by 5 seconds each time, up to 5 minutes. Do not spam retries.
@@ -141,7 +142,7 @@ Recommended combinations for common use cases:
### `token info` — Key Fields ### `token info` — Key Fields
The response has four nested objects: `pool`, `link`, `stat`, `wallet_tags_stat`. Access fields with dot notation when parsing (e.g. `link.website`, `stat.top_10_holder_rate`). The response has five nested objects: `pool`, `dev`, `link`, `stat`, `wallet_tags_stat`. Access fields with dot notation when parsing (e.g. `link.website`, `stat.top_10_holder_rate`, `dev.creator_address`).
**Top-level Fields** **Top-level Fields**
@@ -178,6 +179,31 @@ The response has four nested objects: `pool`, `link`, `stat`, `wallet_tags_stat`
| `pool.fee_ratio` | Pool trading fee ratio (e.g. `0.1` = 0.1%) | | `pool.fee_ratio` | Pool trading fee ratio (e.g. `0.1` = 0.1%) |
| `pool.creation_timestamp` | Pool creation time (Unix seconds) | | `pool.creation_timestamp` | Pool creation time (Unix seconds) |
**`dev` Object** — Token creator / developer info
| Field | Description |
|-------|-------------|
| `dev.creator_address` | Creator wallet address |
| `dev.creator_token_balance` | Creator's current token balance |
| `dev.creator_token_status` | Creator holding status: `hold` (still holding) / `sell` (sold/exited) |
| `dev.top_10_holder_rate` | Ratio of supply held by top 10 wallets (01) |
| `dev.twitter_name_change_history` | Array of past Twitter username changes (each entry has `twitter_username`, `rename_timestamp`) |
| `dev.dexscr_ad` | Creator bought a DEXScreener ad: `1` = yes, `0` = no |
| `dev.dexscr_update_link` | Creator updated DEXScreener socials/links: `1` = yes, `0` = no |
| `dev.dexscr_boost_fee` | Creator used DEXScreener Boost: `1` = yes, `0` = no |
| `dev.dexscr_trending_bar` | Token appeared in DEXScreener trending bar: `1` = yes, `0` = no |
| `dev.dexscr_ad_ts` | Timestamp of DEXScreener ad purchase (Unix seconds) |
| `dev.dexscr_update_link_ts` | Timestamp of DEXScreener link update (Unix seconds) |
| `dev.dexscr_boost_ts` | Timestamp of DEXScreener Boost (Unix seconds) |
| `dev.dexscr_trending_bar_ts` | Timestamp of DEXScreener trending bar appearance (Unix seconds) |
| `dev.cto_flag` | Token has been Community Takeover'd (original dev abandoned): `1` = yes, `0` = no |
| `dev.fund_from` | Address that funded the creator wallet |
| `dev.fund_from_ts` | Timestamp of that funding event (Unix seconds) |
| `dev.creator_open_count` | Number of tokens this creator has previously launched |
| `dev.twitter_del_post_token_count` | Number of posts the creator deleted from Twitter |
| `dev.twitter_create_token_count` | Number of tokens the creator has promoted on Twitter |
| `dev.offchain` | Whether the token is an offchain token |
**`link` Object** — Social and explorer links **`link` Object** — Social and explorer links
| Field | Description | | Field | Description |
+1
View File
@@ -76,6 +76,7 @@ All tracking routes used by this skill go through GMGN's leaky-bucket limiter wi
When a request returns `429`: When a request returns `429`:
- Read `X-RateLimit-Reset` from the response headers. It is a Unix timestamp in seconds that marks when the limit is expected to reset. - Read `X-RateLimit-Reset` from the response headers. It is a Unix timestamp in seconds that marks when the limit is expected to reset.
- If the response body contains `reset_at` (e.g., `{"code":429,"error":"RATE_LIMIT_BANNED","message":"...","reset_at":1775184222}`), extract `reset_at` — it is the Unix timestamp when the ban lifts (typically 5 minutes). Convert to local time and tell the user exactly when they can retry.
- The CLI may wait and retry once automatically when the remaining cooldown is short. If it still fails, stop and tell the user the exact retry time instead of sending more requests. - The CLI may wait and retry once automatically when the remaining cooldown is short. If it still fails, stop and tell the user the exact retry time instead of sending more requests.
- For `RATE_LIMIT_EXCEEDED` or `RATE_LIMIT_BANNED`, repeated requests during the cooldown can extend the ban by 5 seconds each time, up to 5 minutes. Do not spam retries. - For `RATE_LIMIT_EXCEEDED` or `RATE_LIMIT_BANNED`, repeated requests during the cooldown can extend the ban by 5 seconds each time, up to 5 minutes. Do not spam retries.
+6 -4
View File
@@ -90,10 +90,11 @@ export interface SwapParams {
} }
export interface StrategyConditionOrder { export interface StrategyConditionOrder {
order_type: string; // "profit_stop" | "loss_stop" order_type: string; // "profit_stop" | "loss_stop" | "profit_stop_trace" | "loss_stop_trace"
side: string; // "sell" side: string; // "sell"
price_scale: string; price_scale?: string;
sell_ratio: string; sell_ratio: string;
drawdown_rate?: string;
} }
export interface StrategyCreateParams { export interface StrategyCreateParams {
@@ -104,6 +105,7 @@ export interface StrategyCreateParams {
order_type: string; order_type: string;
sub_order_type: string; sub_order_type: string;
check_price: string; check_price: string;
open_price?: string;
amount_in?: string; amount_in?: string;
amount_in_percent?: string; amount_in_percent?: string;
limit_price_mode?: string; limit_price_mode?: string;
@@ -306,14 +308,14 @@ export class OpenApiClient {
return this.criticalRequest("GET", "/v1/trade/query_order", { order_id: orderId, chain }, null); return this.criticalRequest("GET", "/v1/trade/query_order", { order_id: orderId, chain }, null);
} }
// ---- Strategy order endpoints ---- // ---- Strategy order endpoints (critical auth) ----
async createStrategyOrder(params: StrategyCreateParams): Promise<unknown> { async createStrategyOrder(params: StrategyCreateParams): Promise<unknown> {
return this.criticalRequest("POST", "/v1/trade/strategy/create", {}, params); return this.criticalRequest("POST", "/v1/trade/strategy/create", {}, params);
} }
async getStrategyOrders(chain: string, extra: Record<string, string | number> = {}): Promise<unknown> { async getStrategyOrders(chain: string, extra: Record<string, string | number> = {}): Promise<unknown> {
return this.normalRequest("GET", "/v1/trade/strategy/orders", { chain, ...extra }); return this.criticalRequest("GET", "/v1/trade/strategy/orders", { chain, ...extra }, null);
} }
async cancelStrategyOrder(params: StrategyCancelParams): Promise<unknown> { async cancelStrategyOrder(params: StrategyCancelParams): Promise<unknown> {
+3 -3
View File
@@ -24,7 +24,7 @@ export function registerSwapCommands(program: Command): void {
.option("--gas-price <gwei>", "Gas price in gwei (BSC ≥ 0.05 / BASE/ETH ≥ 0.01)") .option("--gas-price <gwei>", "Gas price in gwei (BSC ≥ 0.05 / BASE/ETH ≥ 0.01)")
.option("--max-fee-per-gas <amount>", "EIP-1559 max fee per gas (Base)") .option("--max-fee-per-gas <amount>", "EIP-1559 max fee per gas (Base)")
.option("--max-priority-fee-per-gas <amount>", "EIP-1559 max priority fee per gas (Base)") .option("--max-priority-fee-per-gas <amount>", "EIP-1559 max priority fee per gas (Base)")
.option("--condition-orders <json>", 'JSON array of take-profit/stop-loss conditions, e.g. \'[{"order_type":"profit_stop","side":"sell","price_scale":"150","sell_ratio":"100"}]\'') .option("--condition-orders <json>", 'JSON array of take-profit/stop-loss conditions, e.g. \'[{"order_type":"profit_stop","side":"sell","price_scale":"150","sell_ratio":"100"}]\'; trace types: \'[{"order_type":"profit_stop_trace","side":"sell","price_scale":"150","sell_ratio":"100","drawdown_rate":"50"}]\'')
.option("--sell-ratio-type <type>", "Sell ratio base: buy_amount (default) / hold_amount; only used with --condition-orders") .option("--sell-ratio-type <type>", "Sell ratio base: buy_amount (default) / hold_amount; only used with --condition-orders")
.option("--raw", "Output raw JSON") .option("--raw", "Output raw JSON")
.action(async (opts) => { .action(async (opts) => {
@@ -170,7 +170,7 @@ export function registerSwapCommands(program: Command): void {
strategy strategy
.command("list") .command("list")
.description("List strategy orders (normal auth)") .description("List strategy orders (requires private key)")
.requiredOption("--chain <chain>", "Chain: sol / bsc / base") .requiredOption("--chain <chain>", "Chain: sol / bsc / base")
.option("--type <type>", "open (default) / history") .option("--type <type>", "open (default) / history")
.option("--from <address>", "Filter by wallet address") .option("--from <address>", "Filter by wallet address")
@@ -188,7 +188,7 @@ export function registerSwapCommands(program: Command): void {
if (opts.baseToken) extra["base_token"] = opts.baseToken; if (opts.baseToken) extra["base_token"] = opts.baseToken;
if (opts.pageToken) extra["page_token"] = opts.pageToken; if (opts.pageToken) extra["page_token"] = opts.pageToken;
if (opts.limit != null) extra["limit"] = opts.limit; if (opts.limit != null) extra["limit"] = opts.limit;
const client = new OpenApiClient(getConfig()); const client = new OpenApiClient(getConfig(true));
const data = await client.getStrategyOrders(opts.chain, extra).catch(exitOnError); const data = await client.getStrategyOrders(opts.chain, extra).catch(exitOnError);
printResult(data, opts.raw); printResult(data, opts.raw);
}); });