mirror of
https://github.com/GMGNAI/gmgn-skills.git
synced 2026-08-21 12:08:08 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f15e8271f9 | ||
|
|
eda0ac9f52 | ||
|
|
b940c66c00 | ||
|
|
1964e927cd | ||
|
|
0f3d550736 | ||
|
|
23ca9d8670 | ||
|
|
67d53cd3e4 | ||
|
|
ca51ee6a7a | ||
|
|
f5442f6247 | ||
|
|
0dabd4b93b | ||
|
|
73d81fa0b2 | ||
|
|
4ef54b0bcc | ||
|
|
dd41e38755 |
@@ -505,6 +505,9 @@ gmgn-cli portfolio created-tokens --chain sol --wallet <addr>
|
|||||||
### Track
|
### Track
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
# Followed token map for a wallet
|
||||||
|
gmgn-cli track follow-tokens --chain sol --wallet <wallet_address>
|
||||||
|
|
||||||
# Follow-wallet trade records
|
# Follow-wallet trade records
|
||||||
gmgn-cli track follow-wallet --chain sol
|
gmgn-cli track follow-wallet --chain sol
|
||||||
gmgn-cli track follow-wallet --chain sol --limit 20 --min-amount-usd 1000
|
gmgn-cli track follow-wallet --chain sol --limit 20 --min-amount-usd 1000
|
||||||
@@ -528,7 +531,7 @@ gmgn-cli swap \
|
|||||||
--input-token <input-token-addr> \
|
--input-token <input-token-addr> \
|
||||||
--output-token <output-token-addr> \
|
--output-token <output-token-addr> \
|
||||||
--amount 1000000 \
|
--amount 1000000 \
|
||||||
--slippage 0.01
|
--slippage 30
|
||||||
|
|
||||||
# Submit swap with automatic slippage
|
# Submit swap with automatic slippage
|
||||||
gmgn-cli swap \
|
gmgn-cli swap \
|
||||||
@@ -555,7 +558,7 @@ gmgn-cli order quote \
|
|||||||
--input-token <input-token-addr> \
|
--input-token <input-token-addr> \
|
||||||
--output-token <output-token-addr> \
|
--output-token <output-token-addr> \
|
||||||
--amount 1000000 \
|
--amount 1000000 \
|
||||||
--slippage 0.01
|
--slippage 30
|
||||||
|
|
||||||
# Quotes use signed auth and require GMGN_PRIVATE_KEY on every chain
|
# Quotes use signed auth and require GMGN_PRIVATE_KEY on every chain
|
||||||
gmgn-cli order quote \
|
gmgn-cli order quote \
|
||||||
@@ -564,7 +567,7 @@ gmgn-cli order quote \
|
|||||||
--input-token <input-token-addr> \
|
--input-token <input-token-addr> \
|
||||||
--output-token <output-token-addr> \
|
--output-token <output-token-addr> \
|
||||||
--amount 1000000000000000000 \
|
--amount 1000000000000000000 \
|
||||||
--slippage 0.01
|
--slippage 30
|
||||||
|
|
||||||
# Query order
|
# Query order
|
||||||
gmgn-cli order get --chain sol --order-id <order-id>
|
gmgn-cli order get --chain sol --order-id <order-id>
|
||||||
@@ -582,7 +585,7 @@ gmgn-cli multi-swap \
|
|||||||
--input-token <input-token-addr> \
|
--input-token <input-token-addr> \
|
||||||
--output-token <output-token-addr> \
|
--output-token <output-token-addr> \
|
||||||
--input-amount '{"<addr1>":"1000000","<addr2>":"2000000"}' \
|
--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`.
|
> `order quote` uses signed auth on `sol` / `bsc` / `base` / `eth` and requires `GMGN_PRIVATE_KEY`.
|
||||||
@@ -597,7 +600,7 @@ gmgn-cli swap \
|
|||||||
--input-token <input-token-addr> \
|
--input-token <input-token-addr> \
|
||||||
--output-token <output-token-addr> \
|
--output-token <output-token-addr> \
|
||||||
--amount <amount> \
|
--amount <amount> \
|
||||||
--slippage 0.01 \
|
--slippage 30 \
|
||||||
--gas-level high
|
--gas-level high
|
||||||
|
|
||||||
# Let GMGN auto-select the optimal gas fee for condition orders
|
# Let GMGN auto-select the optimal gas fee for condition orders
|
||||||
@@ -607,7 +610,7 @@ gmgn-cli swap \
|
|||||||
--input-token <input-token-addr> \
|
--input-token <input-token-addr> \
|
||||||
--output-token <output-token-addr> \
|
--output-token <output-token-addr> \
|
||||||
--amount <amount> \
|
--amount <amount> \
|
||||||
--slippage 0.01 \
|
--slippage 30 \
|
||||||
--condition-orders '[...]' \
|
--condition-orders '[...]' \
|
||||||
--auto-fee
|
--auto-fee
|
||||||
```
|
```
|
||||||
@@ -627,7 +630,7 @@ gmgn-cli swap \
|
|||||||
--input-token So11111111111111111111111111111111111111112 \
|
--input-token So11111111111111111111111111111111111111112 \
|
||||||
--output-token <token_A_address> \
|
--output-token <token_A_address> \
|
||||||
--amount 10000000 \
|
--amount 10000000 \
|
||||||
--slippage 0.3 \
|
--slippage 30 \
|
||||||
--anti-mev \
|
--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"}]' \
|
--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
|
--sell-ratio-type hold_amount
|
||||||
@@ -646,7 +649,7 @@ gmgn-cli swap \
|
|||||||
--input-token So11111111111111111111111111111111111111112 \
|
--input-token So11111111111111111111111111111111111111112 \
|
||||||
--output-token <token_A_address> \
|
--output-token <token_A_address> \
|
||||||
--amount 10000000 \
|
--amount 10000000 \
|
||||||
--slippage 0.3 \
|
--slippage 30 \
|
||||||
--anti-mev \
|
--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"}]' \
|
--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
|
--sell-ratio-type buy_amount
|
||||||
@@ -668,7 +671,7 @@ gmgn-cli order strategy create \
|
|||||||
--sub-order-type take_profit \
|
--sub-order-type take_profit \
|
||||||
--check-price 0.002 \
|
--check-price 0.002 \
|
||||||
--amount-in-percent 100 \
|
--amount-in-percent 100 \
|
||||||
--slippage 0.01
|
--slippage 30
|
||||||
|
|
||||||
# Create a stop-loss order
|
# Create a stop-loss order
|
||||||
gmgn-cli order strategy create \
|
gmgn-cli order strategy create \
|
||||||
@@ -679,7 +682,7 @@ gmgn-cli order strategy create \
|
|||||||
--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 30
|
||||||
|
|
||||||
# List open strategy orders (requires private key)
|
# List open strategy orders (requires private key)
|
||||||
gmgn-cli order strategy list --chain sol
|
gmgn-cli order strategy list --chain sol
|
||||||
@@ -698,7 +701,7 @@ gmgn-cli cooking \
|
|||||||
--input-token So11111111111111111111111111111111111111112 \
|
--input-token So11111111111111111111111111111111111111112 \
|
||||||
--output-token <token_address> \
|
--output-token <token_address> \
|
||||||
--amount 1000000000 \
|
--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"}]'
|
--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"}]'
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
+14
-11
@@ -529,6 +529,9 @@ gmgn-cli portfolio created-tokens --chain sol --wallet <addr>
|
|||||||
### Track
|
### Track
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
# 查询钱包收藏的代币列表
|
||||||
|
gmgn-cli track follow-tokens --chain sol --wallet <wallet_address>
|
||||||
|
|
||||||
# 追踪关注钱包的交易动态
|
# 追踪关注钱包的交易动态
|
||||||
gmgn-cli track follow-wallet --chain sol
|
gmgn-cli track follow-wallet --chain sol
|
||||||
gmgn-cli track follow-wallet --chain sol --limit 20 --min-amount-usd 1000
|
gmgn-cli track follow-wallet --chain sol --limit 20 --min-amount-usd 1000
|
||||||
@@ -552,7 +555,7 @@ gmgn-cli swap \
|
|||||||
--input-token <input-token-addr> \
|
--input-token <input-token-addr> \
|
||||||
--output-token <output-token-addr> \
|
--output-token <output-token-addr> \
|
||||||
--amount 1000000 \
|
--amount 1000000 \
|
||||||
--slippage 0.01
|
--slippage 30
|
||||||
|
|
||||||
# 提交兑换(自动滑点)
|
# 提交兑换(自动滑点)
|
||||||
gmgn-cli swap \
|
gmgn-cli swap \
|
||||||
@@ -579,7 +582,7 @@ gmgn-cli order quote \
|
|||||||
--input-token <input-token-addr> \
|
--input-token <input-token-addr> \
|
||||||
--output-token <output-token-addr> \
|
--output-token <output-token-addr> \
|
||||||
--amount 1000000 \
|
--amount 1000000 \
|
||||||
--slippage 0.01
|
--slippage 30
|
||||||
|
|
||||||
# 所有链上的 quote 都走关键鉴权,需要 GMGN_PRIVATE_KEY
|
# 所有链上的 quote 都走关键鉴权,需要 GMGN_PRIVATE_KEY
|
||||||
gmgn-cli order quote \
|
gmgn-cli order quote \
|
||||||
@@ -588,7 +591,7 @@ gmgn-cli order quote \
|
|||||||
--input-token <input-token-addr> \
|
--input-token <input-token-addr> \
|
||||||
--output-token <output-token-addr> \
|
--output-token <output-token-addr> \
|
||||||
--amount 1000000000000000000 \
|
--amount 1000000000000000000 \
|
||||||
--slippage 0.01
|
--slippage 30
|
||||||
|
|
||||||
# 查询订单状态
|
# 查询订单状态
|
||||||
gmgn-cli order get --chain sol --order-id <order-id>
|
gmgn-cli order get --chain sol --order-id <order-id>
|
||||||
@@ -606,7 +609,7 @@ gmgn-cli multi-swap \
|
|||||||
--input-token <input-token-addr> \
|
--input-token <input-token-addr> \
|
||||||
--output-token <output-token-addr> \
|
--output-token <output-token-addr> \
|
||||||
--input-amount '{"<addr1>":"1000000","<addr2>":"2000000"}' \
|
--input-amount '{"<addr1>":"1000000","<addr2>":"2000000"}' \
|
||||||
--slippage 0.01
|
--slippage 30
|
||||||
```
|
```
|
||||||
|
|
||||||
> `order quote` 在 `sol` / `bsc` / `base` / `eth` 上都走关键鉴权,必须配置 `GMGN_PRIVATE_KEY`。
|
> `order quote` 在 `sol` / `bsc` / `base` / `eth` 上都走关键鉴权,必须配置 `GMGN_PRIVATE_KEY`。
|
||||||
@@ -621,7 +624,7 @@ gmgn-cli swap \
|
|||||||
--input-token <input-token-addr> \
|
--input-token <input-token-addr> \
|
||||||
--output-token <output-token-addr> \
|
--output-token <output-token-addr> \
|
||||||
--amount <amount> \
|
--amount <amount> \
|
||||||
--slippage 0.01 \
|
--slippage 30 \
|
||||||
--gas-level high
|
--gas-level high
|
||||||
|
|
||||||
# 策略单(condition-orders)由 GMGN 自动选择最优 Gas Fee
|
# 策略单(condition-orders)由 GMGN 自动选择最优 Gas Fee
|
||||||
@@ -631,7 +634,7 @@ gmgn-cli swap \
|
|||||||
--input-token <input-token-addr> \
|
--input-token <input-token-addr> \
|
||||||
--output-token <output-token-addr> \
|
--output-token <output-token-addr> \
|
||||||
--amount <amount> \
|
--amount <amount> \
|
||||||
--slippage 0.01 \
|
--slippage 30 \
|
||||||
--condition-orders '[...]' \
|
--condition-orders '[...]' \
|
||||||
--auto-fee
|
--auto-fee
|
||||||
```
|
```
|
||||||
@@ -651,7 +654,7 @@ gmgn-cli swap \
|
|||||||
--input-token So11111111111111111111111111111111111111112 \
|
--input-token So11111111111111111111111111111111111111112 \
|
||||||
--output-token <token_A_address> \
|
--output-token <token_A_address> \
|
||||||
--amount 10000000 \
|
--amount 10000000 \
|
||||||
--slippage 0.3 \
|
--slippage 30 \
|
||||||
--anti-mev \
|
--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"}]' \
|
--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
|
--sell-ratio-type hold_amount
|
||||||
@@ -670,7 +673,7 @@ gmgn-cli swap \
|
|||||||
--input-token So11111111111111111111111111111111111111112 \
|
--input-token So11111111111111111111111111111111111111112 \
|
||||||
--output-token <token_A_address> \
|
--output-token <token_A_address> \
|
||||||
--amount 10000000 \
|
--amount 10000000 \
|
||||||
--slippage 0.3 \
|
--slippage 30 \
|
||||||
--anti-mev \
|
--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"}]' \
|
--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
|
--sell-ratio-type buy_amount
|
||||||
@@ -692,7 +695,7 @@ gmgn-cli order strategy create \
|
|||||||
--sub-order-type take_profit \
|
--sub-order-type take_profit \
|
||||||
--check-price 0.002 \
|
--check-price 0.002 \
|
||||||
--amount-in-percent 100 \
|
--amount-in-percent 100 \
|
||||||
--slippage 0.01
|
--slippage 30
|
||||||
|
|
||||||
# 创建止损单
|
# 创建止损单
|
||||||
gmgn-cli order strategy create \
|
gmgn-cli order strategy create \
|
||||||
@@ -703,7 +706,7 @@ gmgn-cli order strategy create \
|
|||||||
--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 30
|
||||||
|
|
||||||
# 查看当前挂单(需要私钥)
|
# 查看当前挂单(需要私钥)
|
||||||
gmgn-cli order strategy list --chain sol
|
gmgn-cli order strategy list --chain sol
|
||||||
@@ -722,7 +725,7 @@ gmgn-cli cooking \
|
|||||||
--input-token So11111111111111111111111111111111111111112 \
|
--input-token So11111111111111111111111111111111111111112 \
|
||||||
--output-token <token_address> \
|
--output-token <token_address> \
|
||||||
--amount 1000000000 \
|
--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"}]'
|
--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"}]'
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
+54
-7
@@ -349,6 +349,54 @@ gmgn-cli market signal --chain sol --groups '<json_array>' [--raw]
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
## track follow-tokens
|
||||||
|
|
||||||
|
Query the followed token list for a wallet. Returns a paginated list of tokens the wallet has bookmarked on GMGN, with full market data. API Key auth only.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
gmgn-cli track follow-tokens \
|
||||||
|
--chain <chain> \
|
||||||
|
--wallet <wallet_address> \
|
||||||
|
[--group-id <id>] \
|
||||||
|
[--order-by <field>] \
|
||||||
|
[--direction <asc|desc>] \
|
||||||
|
[--limit <n>] \
|
||||||
|
[--cursor <cursor>] \
|
||||||
|
[--raw]
|
||||||
|
```
|
||||||
|
|
||||||
|
| Option | Required | Description |
|
||||||
|
|--------|----------|-------------|
|
||||||
|
| `--chain` | Yes | `sol` / `bsc` / `base` / `eth` |
|
||||||
|
| `--wallet` | Yes | Wallet address |
|
||||||
|
| `--group-id` | No | `all_group` (all tokens), `default`, or a user-defined group ID |
|
||||||
|
| `--interval` | No | Time interval for price change stats: `1m` / `5m` / `1h` / `6h` / `24h` |
|
||||||
|
| `--order-by` | No | `created_at` / `swaps` / `volume` / `market_cap` / `liquidity` / `price` / `open_timestamp` |
|
||||||
|
| `--direction` | No | Sort direction: `asc` / `desc` |
|
||||||
|
| `--limit` | No | Page size |
|
||||||
|
| `--cursor` | No | Pagination cursor from previous response |
|
||||||
|
| `--search` | No | Search by token name or address |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## track follow-token-groups
|
||||||
|
|
||||||
|
Query the follow token group names for a wallet. Returns the groups a wallet uses to organise its followed tokens on GMGN. API Key auth only.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
gmgn-cli track follow-token-groups \
|
||||||
|
--chain <chain> \
|
||||||
|
--wallet <wallet_address> \
|
||||||
|
[--raw]
|
||||||
|
```
|
||||||
|
|
||||||
|
| Option | Required | Description |
|
||||||
|
|--------|----------|-------------|
|
||||||
|
| `--chain` | Yes | `sol` / `bsc` / `base` / `eth` |
|
||||||
|
| `--wallet` | Yes | Wallet address |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## portfolio follow-wallet
|
## portfolio follow-wallet
|
||||||
|
|
||||||
Query follow-wallet trade records. Returns trades from wallets you personally follow on the GMGN platform. The follow list is resolved automatically from the GMGN user account bound to the API Key — `--wallet` is optional. Signed auth (API Key + private key signature).
|
Query follow-wallet trade records. Returns trades from wallets you personally follow on the GMGN platform. The follow list is resolved automatically from the GMGN user account bound to the API Key — `--wallet` is optional. Signed auth (API Key + private key signature).
|
||||||
@@ -431,7 +479,7 @@ npx gmgn-cli order quote \
|
|||||||
| `--input-token` | Yes | Input token contract address |
|
| `--input-token` | Yes | Input token contract address |
|
||||||
| `--output-token` | Yes | Output token contract address |
|
| `--output-token` | Yes | Output token contract address |
|
||||||
| `--amount` | Yes | Input amount (smallest unit) |
|
| `--amount` | Yes | Input amount (smallest unit) |
|
||||||
| `--slippage` | Yes | Slippage tolerance, e.g. `0.01` = 1% |
|
| `--slippage` | Yes | Slippage tolerance as an integer 0–100, e.g. `30` = 30% |
|
||||||
|
|
||||||
**Response fields (data):**
|
**Response fields (data):**
|
||||||
|
|
||||||
@@ -479,7 +527,7 @@ npx gmgn-cli swap \
|
|||||||
| `--output-token` | Yes | all | Output token contract address |
|
| `--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 |
|
| `--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) |
|
| `--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 0–100, e.g. `30` = 30% |
|
||||||
| `--auto-slippage` | No | all | Enable automatic slippage |
|
| `--auto-slippage` | No | all | Enable automatic slippage |
|
||||||
| `--min-output` | No | all | Minimum output amount (raw amount) |
|
| `--min-output` | No | all | Minimum output amount (raw amount) |
|
||||||
| `--anti-mev` | No | all | Enable anti-MEV protection (default true) |
|
| `--anti-mev` | No | all | Enable anti-MEV protection (default true) |
|
||||||
@@ -557,7 +605,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` | 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 |
|
| `--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 |
|
| `--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 0–100, e.g. `30` = 30% |
|
||||||
| `--auto-slippage` | No | all | Enable automatic slippage |
|
| `--auto-slippage` | No | all | Enable automatic slippage |
|
||||||
| `--anti-mev` | No | all | Enable anti-MEV protection |
|
| `--anti-mev` | No | all | Enable anti-MEV protection |
|
||||||
| `--priority-fee` | No | `sol` | Priority fee in SOL (≥ 0.00001) |
|
| `--priority-fee` | No | `sol` | Priority fee in SOL (≥ 0.00001) |
|
||||||
@@ -643,7 +691,7 @@ gmgn-cli order strategy create \
|
|||||||
| `--sell-ratio-type` | No | `buy_amount` (default) / `hold_amount` |
|
| `--sell-ratio-type` | No | `buy_amount` (default) / `hold_amount` |
|
||||||
| `--quote-investment` | No | Quote token investment amount (`smart_trade`) |
|
| `--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 |
|
| `--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, e.g. `0.01` = 1% |
|
| `--slippage` | No | Slippage tolerance as an integer 0–100, e.g. `30` = 30% |
|
||||||
| `--auto-slippage` | No | Enable automatic slippage |
|
| `--auto-slippage` | No | Enable automatic slippage |
|
||||||
| `--priority-fee` | No | Priority fee in SOL (**required for SOL chain**) |
|
| `--priority-fee` | No | Priority fee in SOL (**required for SOL chain**) |
|
||||||
| `--tip-fee` | No | Tip fee (**required for SOL chain**) |
|
| `--tip-fee` | No | Tip fee (**required for SOL chain**) |
|
||||||
@@ -749,7 +797,7 @@ gmgn-cli cooking create \
|
|||||||
[--fourmeme-rate-conf <json>] \
|
[--fourmeme-rate-conf <json>] \
|
||||||
[--bags-fee-share-list <json>] \
|
[--bags-fee-share-list <json>] \
|
||||||
[--bonk-model <model>] \
|
[--bonk-model <model>] \
|
||||||
[--buy-wallets <json>] [--snip-buy-wallets <json>] [--interval-seconds <n>] \
|
[--buy-wallets <json>] [--snip-buy-wallets <json>] \
|
||||||
[--buy-trade-config <json>] [--sell-trade-config <json>] [--sell-configs <json>] \
|
[--buy-trade-config <json>] [--sell-trade-config <json>] [--sell-configs <json>] \
|
||||||
[--raw]
|
[--raw]
|
||||||
```
|
```
|
||||||
@@ -764,7 +812,7 @@ gmgn-cli cooking create \
|
|||||||
| `--buy-amt` | Yes | Initial buy amount in native token (e.g. `0.01` SOL) |
|
| `--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` | 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 |
|
| `--image-url` | No* | Token logo URL; required unless `--image` is used |
|
||||||
| `--slippage` | No* | Slippage tolerance, e.g. `0.01` = 1%; required unless `--auto-slippage` is used |
|
| `--slippage` | No* | Slippage tolerance as an integer 0–100, e.g. `30` = 30%; required unless `--auto-slippage` is used |
|
||||||
| `--auto-slippage` | No* | Enable automatic slippage; required unless `--slippage` is used |
|
| `--auto-slippage` | No* | Enable automatic slippage; required unless `--slippage` is used |
|
||||||
| `--website` | No | Website URL |
|
| `--website` | No | Website URL |
|
||||||
| `--twitter` | No | Twitter link |
|
| `--twitter` | No | Twitter link |
|
||||||
@@ -795,7 +843,6 @@ gmgn-cli cooking create \
|
|||||||
| `--bonk-model` | No | Bonk model identifier (**bonk DEX 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>"}]` |
|
| `--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>"}]` |
|
| `--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) |
|
| `--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-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>"]}]` |
|
| `--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>"]}]` |
|
||||||
|
|||||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "gmgn-cli",
|
"name": "gmgn-cli",
|
||||||
"version": "1.4.1",
|
"version": "1.4.4",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "gmgn-cli",
|
"name": "gmgn-cli",
|
||||||
"version": "1.4.1",
|
"version": "1.4.4",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"commander": "^12.1.0",
|
"commander": "^12.1.0",
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "gmgn-cli",
|
"name": "gmgn-cli",
|
||||||
"version": "1.4.1",
|
"version": "1.4.4",
|
||||||
"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": {
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ Use the `gmgn-cli` tool to create a token on a launchpad platform or query token
|
|||||||
|
|
||||||
- **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).
|
- **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 0–100, e.g. `30` = 30%) or `--auto-slippage`. One of the two is required when `--buy-amt` is set.
|
||||||
|
|
||||||
## Financial Risk Notice
|
## Financial Risk Notice
|
||||||
|
|
||||||
@@ -148,7 +148,7 @@ gmgn-cli cooking stats [--raw]
|
|||||||
| `--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. |
|
| `--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` | 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. |
|
| `--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 0–100, e.g. `30` = 30%. **Mutually exclusive with `--auto-slippage`** — provide one or the other. |
|
||||||
| `--auto-slippage` | No* | Enable automatic slippage. **Mutually exclusive with `--slippage`.** |
|
| `--auto-slippage` | No* | Enable automatic slippage. **Mutually exclusive with `--slippage`.** |
|
||||||
| `--description` | No | Token description / project pitch |
|
| `--description` | No | Token description / project pitch |
|
||||||
| `--website` | No | Project website URL |
|
| `--website` | No | Project website URL |
|
||||||
@@ -180,7 +180,6 @@ gmgn-cli cooking stats [--raw]
|
|||||||
| `--bonk-model` | No | Bonk model identifier (**bonk DEX 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>"}]` |
|
| `--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>"}]` |
|
| `--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 |
|
| `--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-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 |
|
| `--sell-configs` | No | Auto-sell strategy list as JSON array (CookingSellConfig[]) — see Auto-Sell Configuration |
|
||||||
@@ -386,7 +385,7 @@ gmgn-cli cooking create \
|
|||||||
--symbol MAT \
|
--symbol MAT \
|
||||||
--buy-amt 0.01 \
|
--buy-amt 0.01 \
|
||||||
--image-url https://example.com/logo.png \
|
--image-url https://example.com/logo.png \
|
||||||
--slippage 0.01 \
|
--slippage 30 \
|
||||||
--priority-fee 0.001
|
--priority-fee 0.001
|
||||||
|
|
||||||
# Create a token on FourMeme (BSC) — base64 image + USD1 raise token
|
# Create a token on FourMeme (BSC) — base64 image + USD1 raise token
|
||||||
|
|||||||
+18
-15
@@ -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.
|
- **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 0–100, e.g. `30` = 30%. If the price moves beyond this threshold before the transaction confirms, the swap is rejected. Use `--auto-slippage` for volatile tokens to let GMGN set an appropriate value automatically.
|
||||||
|
|
||||||
- **`--amount` vs `--percent`** — Mutually exclusive. `--amount` specifies an exact input quantity (in smallest unit). `--percent` sells a percentage of the current balance and is only valid when `input_token` is NOT a currency (SOL/BNB/ETH/USDC). Never use `--percent` to spend a fraction of SOL/BNB/ETH.
|
- **`--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.
|
||||||
|
|
||||||
@@ -145,7 +145,7 @@ gmgn-cli swap \
|
|||||||
--input-token <input_token_address> \
|
--input-token <input_token_address> \
|
||||||
--output-token <output_token_address> \
|
--output-token <output_token_address> \
|
||||||
--amount 1000000 \
|
--amount 1000000 \
|
||||||
--slippage 0.01
|
--slippage 30
|
||||||
|
|
||||||
# With automatic slippage
|
# With automatic slippage
|
||||||
gmgn-cli swap \
|
gmgn-cli swap \
|
||||||
@@ -184,7 +184,7 @@ gmgn-cli swap \
|
|||||||
| `--output-token` | Yes | all | Output token contract address |
|
| `--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. |
|
| `--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).** |
|
| `--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 0–100, 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`.** |
|
| `--auto-slippage` | No | all | Enable automatic slippage. **Mutually exclusive with `--slippage`.** |
|
||||||
| `--min-output <n>` | No | all | Minimum output amount |
|
| `--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`.** |
|
| `--anti-mev` | No | sol / bsc / eth | Enable anti-MEV protection — **recommended**; protects against frontrunning and sandwich attacks. Default: on. **Not supported on `base`.** |
|
||||||
@@ -228,7 +228,7 @@ gmgn-cli swap \
|
|||||||
--input-token So11111111111111111111111111111111111111112 \
|
--input-token So11111111111111111111111111111111111111112 \
|
||||||
--output-token <token_A_address> \
|
--output-token <token_A_address> \
|
||||||
--amount 10000000 \
|
--amount 10000000 \
|
||||||
--slippage 0.3 \
|
--slippage 30 \
|
||||||
--anti-mev \
|
--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"}]' \
|
--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
|
--sell-ratio-type hold_amount
|
||||||
@@ -246,7 +246,7 @@ gmgn-cli swap \
|
|||||||
--input-token So11111111111111111111111111111111111111112 \
|
--input-token So11111111111111111111111111111111111111112 \
|
||||||
--output-token <token_A_address> \
|
--output-token <token_A_address> \
|
||||||
--amount 10000000 \
|
--amount 10000000 \
|
||||||
--slippage 0.3 \
|
--slippage 30 \
|
||||||
--anti-mev \
|
--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"}]' \
|
--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
|
--sell-ratio-type buy_amount
|
||||||
@@ -358,7 +358,7 @@ gmgn-cli multi-swap \
|
|||||||
--input-token <input_token_address> \
|
--input-token <input_token_address> \
|
||||||
--output-token <output_token_address> \
|
--output-token <output_token_address> \
|
||||||
--input-amount '{"<addr1>":"1000000","<addr2>":"2000000"}' \
|
--input-amount '{"<addr1>":"1000000","<addr2>":"2000000"}' \
|
||||||
--slippage 0.01
|
--slippage 30
|
||||||
|
|
||||||
# Sell a percentage of each wallet's balance (use --input-amount-bps)
|
# Sell a percentage of each wallet's balance (use --input-amount-bps)
|
||||||
gmgn-cli multi-swap \
|
gmgn-cli multi-swap \
|
||||||
@@ -367,7 +367,7 @@ gmgn-cli multi-swap \
|
|||||||
--input-token <token_address> \
|
--input-token <token_address> \
|
||||||
--output-token <sol_address> \
|
--output-token <sol_address> \
|
||||||
--input-amount-bps '{"<addr1>":"5000","<addr2>":"10000"}' \
|
--input-amount-bps '{"<addr1>":"5000","<addr2>":"10000"}' \
|
||||||
--slippage 0.01
|
--slippage 30
|
||||||
|
|
||||||
# With per-wallet take-profit / stop-loss (condition_orders)
|
# With per-wallet take-profit / stop-loss (condition_orders)
|
||||||
gmgn-cli multi-swap \
|
gmgn-cli multi-swap \
|
||||||
@@ -376,7 +376,7 @@ gmgn-cli multi-swap \
|
|||||||
--input-token So11111111111111111111111111111111111111112 \
|
--input-token So11111111111111111111111111111111111111112 \
|
||||||
--output-token <token_address> \
|
--output-token <token_address> \
|
||||||
--input-amount '{"<addr1>":"1000000","<addr2>":"2000000"}' \
|
--input-amount '{"<addr1>":"1000000","<addr2>":"2000000"}' \
|
||||||
--slippage 0.3 \
|
--slippage 30 \
|
||||||
--priority-fee 0.00001 \
|
--priority-fee 0.00001 \
|
||||||
--tip-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"}]'
|
--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"}]'
|
||||||
@@ -388,7 +388,7 @@ gmgn-cli multi-swap \
|
|||||||
--input-token 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 \
|
--input-token 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 \
|
||||||
--output-token <token_address> \
|
--output-token <token_address> \
|
||||||
--input-amount '{"<0xaddr1>":"1000000","<0xaddr2>":"2000000"}' \
|
--input-amount '{"<0xaddr1>":"1000000","<0xaddr2>":"2000000"}' \
|
||||||
--slippage 0.01 \
|
--slippage 30 \
|
||||||
--gas-price 5
|
--gas-price 5
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -403,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` | 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` (1–10000; 5000 = 50%). Only valid when `input_token` is NOT a currency. |
|
| `--input-amount-bps` | No* | all | JSON map of `wallet_address → percent in bps` (1–10000; 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). |
|
| `--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 0–100, e.g. `30` = 30%. Mutually exclusive with `--auto-slippage`. |
|
||||||
| `--auto-slippage` | No | all | Enable automatic slippage. |
|
| `--auto-slippage` | No | all | Enable automatic slippage. |
|
||||||
| `--anti-mev` | No | sol / bsc / eth | Enable anti-MEV protection. Not supported on `base`. |
|
| `--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. |
|
| `--priority-fee <sol>` | No | `sol` | Priority fee in SOL (≥ 0.00001). Required when using `--condition-orders` on SOL. |
|
||||||
@@ -442,7 +442,7 @@ gmgn-cli order quote \
|
|||||||
--input-token <input_token_address> \
|
--input-token <input_token_address> \
|
||||||
--output-token <output_token_address> \
|
--output-token <output_token_address> \
|
||||||
--amount <input_amount_smallest_unit> \
|
--amount <input_amount_smallest_unit> \
|
||||||
--slippage 0.01
|
--slippage 30
|
||||||
```
|
```
|
||||||
|
|
||||||
### `order quote` Response Fields
|
### `order quote` Response Fields
|
||||||
@@ -522,7 +522,7 @@ gmgn-cli order strategy create \
|
|||||||
--sub-order-type take_profit \
|
--sub-order-type take_profit \
|
||||||
--check-price 0.002 \
|
--check-price 0.002 \
|
||||||
--amount-in 1000000 \
|
--amount-in 1000000 \
|
||||||
--slippage 0.01
|
--slippage 30
|
||||||
|
|
||||||
# Create a stop-loss order: sell when price drops to target (limit_order)
|
# Create a stop-loss order: sell when price drops to target (limit_order)
|
||||||
gmgn-cli order strategy create \
|
gmgn-cli order strategy create \
|
||||||
@@ -534,7 +534,7 @@ gmgn-cli order strategy create \
|
|||||||
--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 30
|
||||||
|
|
||||||
# Create a smart_trade with buy_low entry + take-profit + stop-loss (smart_trade)
|
# Create a smart_trade with buy_low entry + take-profit + stop-loss (smart_trade)
|
||||||
gmgn-cli order strategy create \
|
gmgn-cli order strategy create \
|
||||||
@@ -546,7 +546,8 @@ gmgn-cli order strategy create \
|
|||||||
--sub-order-type mix_trade \
|
--sub-order-type mix_trade \
|
||||||
--open-price 0.000082 \
|
--open-price 0.000082 \
|
||||||
--amount-in 1000000 \
|
--amount-in 1000000 \
|
||||||
--slippage 0.01 \
|
--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"}]'
|
--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"}]'
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -568,7 +569,9 @@ gmgn-cli order strategy create \
|
|||||||
| `--expire-in` | No | all | Order expiry in seconds |
|
| `--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 |
|
| `--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 |
|
||||||
| `--quote-investment` | No | all | Quote token investment amount (`smart_trade`) |
|
| `--quote-investment` | No | all | Quote token investment amount (`smart_trade`) |
|
||||||
| `--slippage` | No | all | Slippage tolerance, e.g. `0.01` = 1%. Mutually exclusive with `--auto-slippage` |
|
| `--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 0–100 integer. |
|
||||||
|
| `--buy-param` | No | all | JSON object of buy-side trade params override for `smart_trade`. Same fields as root TradeParam; `slippage` is 0–100 integer. |
|
||||||
|
| `--slippage` | No | all | Slippage tolerance as an integer 0–100, e.g. `30` = 30%. Mutually exclusive with `--auto-slippage`. Defaults to auto-slippage if neither is set. |
|
||||||
| `--auto-slippage` | No | all | Enable automatic slippage |
|
| `--auto-slippage` | No | all | Enable automatic slippage |
|
||||||
| `--priority-fee` | No | `sol` | Priority fee in SOL (≥ 0.00001). **Required** for SOL. |
|
| `--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. |
|
| `--tip-fee` | No | `sol` / `bsc` | Tip fee (SOL ≥ 0.00001 / BSC ≥ 0.000001 BNB). **Required** for SOL. |
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
name: gmgn-track
|
name: gmgn-track
|
||||||
description: Get real-time crypto buy/sell activity from Smart Money wallets, KOL influencer wallets, and personally followed wallets via GMGN API — alpha signals, whale tracking, meme token copy-trading ideas on Solana, BSC, Base, or Ethereum. Use when user asks what smart money or KOLs are buying, wants whale alerts, on-chain alpha, or copy-trade signals. (For a specific wallet address, use gmgn-portfolio.)
|
description: Get real-time crypto buy/sell activity from Smart Money wallets, KOL influencer wallets, and personally followed wallets via GMGN API — alpha signals, whale tracking, meme token copy-trading ideas on Solana, BSC, Base, or Ethereum. Also query which tokens a wallet has followed (bookmarked) on GMGN. Use when user asks what smart money or KOLs are buying, wants whale alerts, on-chain alpha, copy-trade signals, or wants to check a wallet's followed tokens. (For a specific wallet address's portfolio, use gmgn-portfolio.)
|
||||||
argument-hint: "<follow-wallet|kol|smartmoney> --chain <sol|bsc|base|eth> [--wallet <wallet_address>]"
|
argument-hint: "<follow-tokens|follow-wallet|kol|smartmoney> --chain <sol|bsc|base|eth> [--wallet <wallet_address>]"
|
||||||
metadata:
|
metadata:
|
||||||
cliHelp: "gmgn-cli track --help"
|
cliHelp: "gmgn-cli track --help"
|
||||||
---
|
---
|
||||||
@@ -49,6 +49,8 @@ Use the `gmgn-cli` tool to query on-chain tracking data based on the user's requ
|
|||||||
|
|
||||||
| Sub-command | Description |
|
| Sub-command | Description |
|
||||||
|-------------|-------------|
|
|-------------|-------------|
|
||||||
|
| `track follow-tokens` | Followed token list for a wallet — which tokens a wallet has bookmarked on GMGN, with full market data |
|
||||||
|
| `track follow-token-groups` | Follow token group names for a wallet — the group names and IDs the wallet uses to organise followed tokens |
|
||||||
| `track follow-wallet` | Trade records from wallets the user personally follows on GMGN |
|
| `track follow-wallet` | Trade records from wallets the user personally follows on GMGN |
|
||||||
| `track kol` | Real-time trades from KOL / influencer wallets tagged by GMGN |
|
| `track kol` | Real-time trades from KOL / influencer wallets tagged by GMGN |
|
||||||
| `track smartmoney` | Real-time trades from smart money / whale wallets tagged by GMGN |
|
| `track smartmoney` | Real-time trades from smart money / whale wallets tagged by GMGN |
|
||||||
@@ -61,7 +63,7 @@ Use the `gmgn-cli` tool to query on-chain tracking data based on the user's requ
|
|||||||
|
|
||||||
- `gmgn-cli` installed globally — if missing, run: `npm install -g gmgn-cli`
|
- `gmgn-cli` installed globally — if missing, run: `npm install -g gmgn-cli`
|
||||||
- `GMGN_API_KEY` configured in `~/.config/gmgn/.env` — required for all sub-commands
|
- `GMGN_API_KEY` configured in `~/.config/gmgn/.env` — required for all sub-commands
|
||||||
- `GMGN_PRIVATE_KEY` — required for `track follow-wallet` only (signed auth); not needed for `kol` or `smartmoney`
|
- `GMGN_PRIVATE_KEY` — required for `track follow-wallet` only (signed auth); not needed for `follow-tokens`, `kol`, or `smartmoney`
|
||||||
|
|
||||||
## Rate Limit Handling
|
## Rate Limit Handling
|
||||||
|
|
||||||
@@ -69,6 +71,8 @@ All tracking routes used by this skill go through GMGN's leaky-bucket limiter wi
|
|||||||
|
|
||||||
| Command | Route | Weight |
|
| Command | Route | Weight |
|
||||||
|---------|-------|--------|
|
|---------|-------|--------|
|
||||||
|
| `track follow-tokens` | `GET /v1/user/follow_tokens` | 3 |
|
||||||
|
| `track follow-token-groups` | `GET /v1/user/follow_token_groups` | 1 |
|
||||||
| `track follow-wallet` | `GET /v1/trade/follow_wallet` | 3 |
|
| `track follow-wallet` | `GET /v1/trade/follow_wallet` | 3 |
|
||||||
| `track kol` | `GET /v1/user/kol` | 1 |
|
| `track kol` | `GET /v1/user/kol` | 1 |
|
||||||
| `track smartmoney` | `GET /v1/user/smartmoney` | 1 |
|
| `track smartmoney` | `GET /v1/user/smartmoney` | 1 |
|
||||||
@@ -101,6 +105,18 @@ When a request returns `429`:
|
|||||||
## Usage Examples
|
## Usage Examples
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
# Followed token list for a wallet on SOL
|
||||||
|
gmgn-cli track follow-tokens --chain sol --wallet <wallet_address>
|
||||||
|
|
||||||
|
# Followed token list on BSC, raw JSON output
|
||||||
|
gmgn-cli track follow-tokens --chain bsc --wallet <wallet_address> --raw
|
||||||
|
|
||||||
|
# Follow token group names for a wallet on SOL
|
||||||
|
gmgn-cli track follow-token-groups --chain sol --wallet <wallet_address>
|
||||||
|
|
||||||
|
# Follow token group names, raw JSON output
|
||||||
|
gmgn-cli track follow-token-groups --chain sol --wallet <wallet_address> --raw
|
||||||
|
|
||||||
# Follow-wallet trades (all wallets you follow)
|
# Follow-wallet trades (all wallets you follow)
|
||||||
gmgn-cli track follow-wallet --chain sol
|
gmgn-cli track follow-wallet --chain sol
|
||||||
|
|
||||||
@@ -126,6 +142,66 @@ gmgn-cli track smartmoney --limit 10 --raw
|
|||||||
gmgn-cli track smartmoney --chain sol --side sell --limit 10 --raw
|
gmgn-cli track smartmoney --chain sol --side sell --limit 10 --raw
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## `track follow-tokens` Options
|
||||||
|
|
||||||
|
| Option | Description |
|
||||||
|
|--------|-------------|
|
||||||
|
| `--chain` | Required. `sol` / `bsc` / `base` / `eth` |
|
||||||
|
| `--wallet <address>` | Required. Wallet address to query |
|
||||||
|
| `--group-id <id>` | Filter by group: `all_group` (all tokens across groups), `default` (default group), or a user-defined group ID |
|
||||||
|
| `--interval <interval>` | Time interval for price change stats (e.g. `1m`, `5m`, `1h`, `6h`, `24h`) |
|
||||||
|
| `--order-by <field>` | Sort field: `created_at` / `swaps` / `volume` / `market_cap` / `liquidity` / `price` / `open_timestamp` |
|
||||||
|
| `--direction <dir>` | Required when `--order-by` is set. `asc` / `desc` |
|
||||||
|
| `--limit <n>` | Page size |
|
||||||
|
| `--cursor <cursor>` | Pagination cursor from previous response |
|
||||||
|
| `--search <text>` | Search by token name or address |
|
||||||
|
|
||||||
|
## `track follow-tokens` Response Fields
|
||||||
|
|
||||||
|
Top-level fields:
|
||||||
|
|
||||||
|
| Field | Description |
|
||||||
|
|-------|-------------|
|
||||||
|
| `cursor` | Opaque cursor for fetching the next page |
|
||||||
|
| `all_following` | Total number of followed tokens |
|
||||||
|
| `is_recommend` | Whether results include recommended tokens |
|
||||||
|
| `followings` | Array of followed token objects |
|
||||||
|
|
||||||
|
Each item in `followings` contains:
|
||||||
|
|
||||||
|
| Field | Description |
|
||||||
|
|-------|-------------|
|
||||||
|
| `address` | Token contract address |
|
||||||
|
| `symbol` | Token ticker symbol |
|
||||||
|
| `name` | Token name |
|
||||||
|
| `chain` | Chain the token is on |
|
||||||
|
| `price` | Current token price |
|
||||||
|
| `price_change_percent` | Price change percentage |
|
||||||
|
| `volume` | Trading volume |
|
||||||
|
| `liquidity` | Pool liquidity |
|
||||||
|
| `market_cap` | Market cap |
|
||||||
|
| `swaps` | Total swaps |
|
||||||
|
| `group_ids` | Follow groups this token belongs to |
|
||||||
|
| `open_timestamp` | Unix timestamp when trading opened |
|
||||||
|
|
||||||
|
## `track follow-token-groups` Options
|
||||||
|
|
||||||
|
| Option | Description |
|
||||||
|
|--------|-------------|
|
||||||
|
| `--chain` | Required. `sol` / `bsc` / `base` / `eth` |
|
||||||
|
| `--wallet <address>` | Required. Wallet address to query |
|
||||||
|
|
||||||
|
## `track follow-token-groups` Response Fields
|
||||||
|
|
||||||
|
`data` is an array. Each item contains:
|
||||||
|
|
||||||
|
| Field | Description |
|
||||||
|
|-------|-------------|
|
||||||
|
| `chain` | Chain the group is on |
|
||||||
|
| `group_id` | Group identifier (e.g. `default`, or a user-defined ID) |
|
||||||
|
| `group_name` | Human-readable group name |
|
||||||
|
| `rank` | Display order / sort rank |
|
||||||
|
|
||||||
## `track follow-wallet` Options
|
## `track follow-wallet` Options
|
||||||
|
|
||||||
| Option | Description |
|
| Option | Description |
|
||||||
@@ -311,6 +387,7 @@ To research any token surfaced by smart money activity, follow [`docs/workflow-t
|
|||||||
|
|
||||||
## Notes
|
## Notes
|
||||||
|
|
||||||
|
- `track follow-tokens` uses exist auth (API Key only); `--wallet` is required
|
||||||
- `track follow-wallet` uses signed auth (API Key + private key signature); `track kol` and `track smartmoney` use exist auth (API Key only)
|
- `track follow-wallet` uses signed auth (API Key + private key signature); `track kol` and `track smartmoney` use exist auth (API Key only)
|
||||||
- `track follow-wallet` returns trades from wallets followed on the GMGN platform; the follow list is resolved automatically from the GMGN user account bound to the API Key — `--wallet` is optional
|
- `track follow-wallet` returns trades from wallets followed on the GMGN platform; the follow list is resolved automatically from the GMGN user account bound to the API Key — `--wallet` is optional
|
||||||
- Use `--raw` to get single-line JSON for further processing
|
- Use `--raw` to get single-line JSON for further processing
|
||||||
|
|||||||
@@ -150,6 +150,8 @@ export interface StrategyCreateParams {
|
|||||||
custom_rpc?: string;
|
custom_rpc?: string;
|
||||||
condition_orders?: StrategyConditionOrder[];
|
condition_orders?: StrategyConditionOrder[];
|
||||||
quote_investment?: string;
|
quote_investment?: string;
|
||||||
|
sell_param?: TradeParam;
|
||||||
|
buy_param?: TradeParam;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface StrategyCancelParams {
|
export interface StrategyCancelParams {
|
||||||
@@ -312,7 +314,6 @@ export interface CreateTokenParams {
|
|||||||
// Multi-wallet buy
|
// Multi-wallet buy
|
||||||
buy_wallets?: BuyWalletInfo[];
|
buy_wallets?: BuyWalletInfo[];
|
||||||
snip_buy_wallets?: BuyWalletInfo[];
|
snip_buy_wallets?: BuyWalletInfo[];
|
||||||
interval_seconds?: number;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export class OpenApiClient {
|
export class OpenApiClient {
|
||||||
@@ -434,6 +435,14 @@ export class OpenApiClient {
|
|||||||
return this.authSignedRequest("GET", "/v1/trade/follow_wallet", { chain, ...extra }, null);
|
return this.authSignedRequest("GET", "/v1/trade/follow_wallet", { chain, ...extra }, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async getFollowTokens(chain: string, walletAddress: string, extra: Record<string, string | number> = {}): Promise<unknown> {
|
||||||
|
return this.authExistRequest("GET", "/v1/user/follow_tokens", { chain, wallet_address: walletAddress, ...extra });
|
||||||
|
}
|
||||||
|
|
||||||
|
async getFollowGroupNames(chain: string, walletAddress: string): Promise<unknown> {
|
||||||
|
return this.authExistRequest("GET", "/v1/user/follow_token_groups", { chain, wallet_address: walletAddress });
|
||||||
|
}
|
||||||
|
|
||||||
async getKol(chain?: string, limit?: number): Promise<unknown> {
|
async getKol(chain?: string, limit?: number): Promise<unknown> {
|
||||||
const query: Record<string, string | number> = {};
|
const query: Record<string, string | number> = {};
|
||||||
if (chain) query["chain"] = chain;
|
if (chain) query["chain"] = chain;
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ export function registerCookingCommands(program: Command): void {
|
|||||||
.option("--website <url>", "Website URL")
|
.option("--website <url>", "Website URL")
|
||||||
.option("--twitter <url>", "Twitter link")
|
.option("--twitter <url>", "Twitter link")
|
||||||
.option("--telegram <url>", "Telegram 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("--auto-slippage", "Enable automatic slippage")
|
||||||
.option("--fee <amount>", "Base gas / fee")
|
.option("--fee <amount>", "Base gas / fee")
|
||||||
.option("--priority-fee <sol>", "Priority fee in SOL (SOL only)")
|
.option("--priority-fee <sol>", "Priority fee in SOL (SOL only)")
|
||||||
@@ -66,7 +66,6 @@ export function registerCookingCommands(program: Command): void {
|
|||||||
// Multi-wallet buy
|
// Multi-wallet buy
|
||||||
.option("--buy-wallets <json>", "Multi-wallet buy config as JSON array [{from_address, buy_amt}]")
|
.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("--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)
|
// CondMarket execution config + auto-sell (JSON)
|
||||||
.option("--buy-trade-config <json>", "Buy-side trade config for CondMarket orders as JSON (TradeParam)")
|
.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-trade-config <json>", "Sell-side trade config for auto-sell / pending_sell as JSON (TradeParam)")
|
||||||
@@ -124,7 +123,6 @@ export function registerCookingCommands(program: Command): void {
|
|||||||
if (opts.bonkModel) params.bonk_model = opts.bonkModel;
|
if (opts.bonkModel) params.bonk_model = opts.bonkModel;
|
||||||
if (opts.buyWallets) params.buy_wallets = JSON.parse(opts.buyWallets);
|
if (opts.buyWallets) params.buy_wallets = JSON.parse(opts.buyWallets);
|
||||||
if (opts.snipBuyWallets) params.snip_buy_wallets = JSON.parse(opts.snipBuyWallets);
|
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.buyTradeConfig) params.buy_trade_config = JSON.parse(opts.buyTradeConfig);
|
||||||
if (opts.sellTradeConfig) params.sell_trade_config = JSON.parse(opts.sellTradeConfig);
|
if (opts.sellTradeConfig) params.sell_trade_config = JSON.parse(opts.sellTradeConfig);
|
||||||
if (opts.sellConfigs) params.sell_configs = JSON.parse(opts.sellConfigs);
|
if (opts.sellConfigs) params.sell_configs = JSON.parse(opts.sellConfigs);
|
||||||
|
|||||||
+14
-4
@@ -14,7 +14,7 @@ export function registerSwapCommands(program: Command): void {
|
|||||||
.requiredOption("--output-token <address>", "Output token contract address")
|
.requiredOption("--output-token <address>", "Output token contract address")
|
||||||
.option("--amount <amount>", "Input raw amount (smallest unit)")
|
.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("--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("--auto-slippage", "Enable automatic slippage")
|
||||||
.option("--min-output <amount>", "Minimum output amount")
|
.option("--min-output <amount>", "Minimum output amount")
|
||||||
.option("--anti-mev", "Enable anti-MEV protection, default true")
|
.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 <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 (1–10000, e.g. 5000=50%), e.g. \'{"addr1":"5000"}\'')
|
.option("--input-amount-bps <json>", 'JSON map of wallet→percent in bps (1–10000, e.g. 5000=50%), e.g. \'{"addr1":"5000"}\'')
|
||||||
.option("--output-amount <json>", "JSON map of wallet→target output amount")
|
.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("--auto-slippage", "Enable automatic slippage")
|
||||||
.option("--anti-mev", "Enable anti-MEV protection")
|
.option("--anti-mev", "Enable anti-MEV protection")
|
||||||
.option("--priority-fee <sol>", "Priority fee in SOL (SOL only, ≥ 0.00001)")
|
.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("--input-token <address>", "Input token contract address")
|
||||||
.requiredOption("--output-token <address>", "Output token contract address")
|
.requiredOption("--output-token <address>", "Output token contract address")
|
||||||
.requiredOption("--amount <amount>", "Input amount (smallest unit)")
|
.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")
|
.option("--raw", "Output raw JSON")
|
||||||
.action(async (opts) => {
|
.action(async (opts) => {
|
||||||
validateChain(opts.chain);
|
validateChain(opts.chain);
|
||||||
@@ -213,7 +213,7 @@ export function registerSwapCommands(program: Command): void {
|
|||||||
.option("--expire-in <seconds>", "Order expiry in seconds", parseInt)
|
.option("--expire-in <seconds>", "Order expiry in seconds", parseInt)
|
||||||
.option("--sell-ratio-type <type>", "Sell ratio basis: buy_amount (default) / hold_amount")
|
.option("--sell-ratio-type <type>", "Sell ratio basis: buy_amount (default) / hold_amount")
|
||||||
.option("--quote-investment <amount>", "Quote token investment amount (smart_trade)")
|
.option("--quote-investment <amount>", "Quote token investment amount (smart_trade)")
|
||||||
.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("--auto-slippage", "Enable automatic slippage")
|
||||||
.option("--priority-fee <sol>", "Priority fee in SOL (required for SOL chain)")
|
.option("--priority-fee <sol>", "Priority fee in SOL (required for SOL chain)")
|
||||||
.option("--tip-fee <amount>", "Tip fee (required for SOL chain)")
|
.option("--tip-fee <amount>", "Tip fee (required for SOL chain)")
|
||||||
@@ -224,6 +224,8 @@ export function registerSwapCommands(program: Command): void {
|
|||||||
.option("--max-priority-fee-per-gas <amount>", "EIP-1559 max priority 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("--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("--condition-orders <json>", "JSON array of condition sub-orders for smart_trade (must include a buy_low entry + TP/SL entries)")
|
||||||
|
.option("--sell-param <json>", "JSON object of sell-side trade params used when a TP/SL condition fires (required for smart_trade)")
|
||||||
|
.option("--buy-param <json>", "JSON object of buy-side trade params override for smart_trade")
|
||||||
.option("--raw", "Output raw JSON")
|
.option("--raw", "Output raw JSON")
|
||||||
.action(async (opts) => {
|
.action(async (opts) => {
|
||||||
if (!opts.amountIn && !opts.amountInPercent) {
|
if (!opts.amountIn && !opts.amountInPercent) {
|
||||||
@@ -265,6 +267,14 @@ export function registerSwapCommands(program: Command): void {
|
|||||||
try { params.condition_orders = JSON.parse(opts.conditionOrders); }
|
try { params.condition_orders = JSON.parse(opts.conditionOrders); }
|
||||||
catch { console.error("[gmgn-cli] --condition-orders must be valid JSON"); process.exit(1); }
|
catch { console.error("[gmgn-cli] --condition-orders must be valid JSON"); process.exit(1); }
|
||||||
}
|
}
|
||||||
|
if (opts.sellParam) {
|
||||||
|
try { params.sell_param = JSON.parse(opts.sellParam); }
|
||||||
|
catch { console.error("[gmgn-cli] --sell-param must be valid JSON"); process.exit(1); }
|
||||||
|
}
|
||||||
|
if (opts.buyParam) {
|
||||||
|
try { params.buy_param = JSON.parse(opts.buyParam); }
|
||||||
|
catch { console.error("[gmgn-cli] --buy-param must be valid JSON"); process.exit(1); }
|
||||||
|
}
|
||||||
const client = new OpenApiClient(getConfig(true));
|
const client = new OpenApiClient(getConfig(true));
|
||||||
const data = await client.createStrategyOrder(params).catch(exitOnError);
|
const data = await client.createStrategyOrder(params).catch(exitOnError);
|
||||||
printResult(data, opts.raw);
|
printResult(data, opts.raw);
|
||||||
|
|||||||
@@ -7,6 +7,47 @@ import { validateChain } from "../validate.js";
|
|||||||
export function registerTrackCommands(program: Command): void {
|
export function registerTrackCommands(program: Command): void {
|
||||||
const track = program.command("track").description("On-chain tracking commands: follow-wallet trades, KOL trades, Smart Money trades");
|
const track = program.command("track").description("On-chain tracking commands: follow-wallet trades, KOL trades, Smart Money trades");
|
||||||
|
|
||||||
|
track
|
||||||
|
.command("follow-tokens")
|
||||||
|
.description("Get the followed token list for a wallet on a given chain")
|
||||||
|
.requiredOption("--chain <chain>", "Chain: sol / bsc / base / eth")
|
||||||
|
.requiredOption("--wallet <address>", "Wallet address")
|
||||||
|
.option("--group-id <id>", "Filter by group: all_group (all), default, or a user-defined group ID")
|
||||||
|
.option("--interval <interval>", "Time interval for price change stats (e.g. 1m, 5m, 1h, 6h, 24h)")
|
||||||
|
.option("--order-by <field>", "Sort field: created_at / swaps / volume / market_cap / liquidity / price / open_timestamp")
|
||||||
|
.option("--direction <dir>", "Sort direction: asc / desc")
|
||||||
|
.option("--limit <n>", "Page size", parseInt)
|
||||||
|
.option("--cursor <cursor>", "Pagination cursor")
|
||||||
|
.option("--search <text>", "Search by token name or address")
|
||||||
|
.option("--raw", "Output raw JSON")
|
||||||
|
.action(async (opts) => {
|
||||||
|
validateChain(opts.chain);
|
||||||
|
const extra: Record<string, string | number> = {};
|
||||||
|
if (opts.groupId) extra["group_id"] = opts.groupId;
|
||||||
|
if (opts.interval) extra["interval"] = opts.interval;
|
||||||
|
if (opts.orderBy) extra["order_by"] = opts.orderBy;
|
||||||
|
if (opts.direction) extra["direction"] = opts.direction;
|
||||||
|
if (opts.limit != null) extra["limit"] = opts.limit;
|
||||||
|
if (opts.cursor) extra["cursor"] = opts.cursor;
|
||||||
|
if (opts.search) extra["search_text"] = opts.search;
|
||||||
|
const client = new OpenApiClient(getConfig());
|
||||||
|
const data = await client.getFollowTokens(opts.chain, opts.wallet, extra).catch(exitOnError);
|
||||||
|
printResult(data, opts.raw);
|
||||||
|
});
|
||||||
|
|
||||||
|
track
|
||||||
|
.command("follow-token-groups")
|
||||||
|
.description("Get the follow token group names for a wallet on a given chain")
|
||||||
|
.requiredOption("--chain <chain>", "Chain: sol / bsc / base / eth")
|
||||||
|
.requiredOption("--wallet <address>", "Wallet address")
|
||||||
|
.option("--raw", "Output raw JSON")
|
||||||
|
.action(async (opts) => {
|
||||||
|
validateChain(opts.chain);
|
||||||
|
const client = new OpenApiClient(getConfig());
|
||||||
|
const data = await client.getFollowGroupNames(opts.chain, opts.wallet).catch(exitOnError);
|
||||||
|
printResult(data, opts.raw);
|
||||||
|
});
|
||||||
|
|
||||||
track
|
track
|
||||||
.command("follow-wallet")
|
.command("follow-wallet")
|
||||||
.description("Get follow-wallet trade records")
|
.description("Get follow-wallet trade records")
|
||||||
|
|||||||
Reference in New Issue
Block a user