mirror of
https://github.com/GMGNAI/gmgn-skills.git
synced 2026-07-27 16:57:44 +00:00
feat: add gas-level/auto-fee/gas-price endpoint; remove auto_tip_fee/max_auto_fee
- Add --gas-level (eth only), --auto-fee (eth only) to swap, multi-swap, and strategy create commands - Add order gas-price subcommand (GET /v1/trade/gas_price, normal auth) - Add --max-fee-per-gas / --max-priority-fee-per-gas to strategy create - Remove --auto-tip-fee and --max-auto-fee from swap and multi-swap - Update token SKILL.md: price field is now a nested object (price.price), add price window fields and fee_distribution object docs - Update EIP-1559 chain coverage from Base-only to BSC/BASE/ETH Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -463,7 +463,6 @@ npx gmgn-cli swap \
|
||||
[--anti-mev] \
|
||||
[--priority-fee <sol>] \
|
||||
[--tip-fee <amount>] \
|
||||
[--max-auto-fee <amount>] \
|
||||
[--gas-price <gwei>] \
|
||||
[--max-fee-per-gas <amount>] \
|
||||
[--max-priority-fee-per-gas <amount>] \
|
||||
@@ -486,7 +485,6 @@ npx gmgn-cli swap \
|
||||
| `--anti-mev` | No | Enable anti-MEV protection (default true) |
|
||||
| `--priority-fee` | No | Priority fee in SOL (≥ 0.00001 SOL, SOL only) |
|
||||
| `--tip-fee` | No | Tip fee (SOL ≥ 0.00001 SOL / BSC ≥ 0.000001 BNB) |
|
||||
| `--max-auto-fee` | No | Max automatic fee cap |
|
||||
| `--gas-price` | No | Gas price in gwei (BSC ≥ 0.05 gwei / BASE/ETH ≥ 0.01 gwei) |
|
||||
| `--max-fee-per-gas` | No | EIP-1559 max fee per gas (Base/ETH only) |
|
||||
| `--max-priority-fee-per-gas` | No | EIP-1559 max priority fee per gas (Base/ETH only) |
|
||||
@@ -540,8 +538,6 @@ gmgn-cli multi-swap \
|
||||
[--anti-mev] \
|
||||
[--priority-fee <sol>] \
|
||||
[--tip-fee <amount>] \
|
||||
[--auto-tip-fee] \
|
||||
[--max-auto-fee <amount>] \
|
||||
[--gas-price <gwei>] \
|
||||
[--max-fee-per-gas <amount>] \
|
||||
[--max-priority-fee-per-gas <amount>] \
|
||||
@@ -564,8 +560,6 @@ gmgn-cli multi-swap \
|
||||
| `--anti-mev` | No | Enable anti-MEV protection |
|
||||
| `--priority-fee` | No | Priority fee in SOL (≥ 0.00001, SOL only) |
|
||||
| `--tip-fee` | No | Tip fee (SOL ≥ 0.00001 / BSC ≥ 0.000001 BNB) |
|
||||
| `--auto-tip-fee` | No | Enable automatic tip fee |
|
||||
| `--max-auto-fee` | No | Max automatic fee cap |
|
||||
| `--gas-price` | No | Gas price in gwei (BSC ≥ 0.05 / BASE/ETH ≥ 0.01) |
|
||||
| `--max-fee-per-gas` | No | EIP-1559 max fee per gas (Base only) |
|
||||
| `--max-priority-fee-per-gas` | No | EIP-1559 max priority fee per gas (Base only) |
|
||||
|
||||
+44
-11
@@ -1,7 +1,7 @@
|
||||
---
|
||||
name: gmgn-swap
|
||||
description: "[FINANCIAL EXECUTION] Buy and sell meme coins and crypto tokens on Solana, BSC, Base, or Ethereum — single swap, multi-wallet batch trading, limit orders, stop loss, take profit, trailing stop loss, trailing take profit via GMGN API. Requires explicit user confirmation. Use when user asks to buy, sell, or swap a token, trade from multiple wallets, set a limit order, stop loss, take profit, or check order status."
|
||||
argument-hint: "[--chain <chain> --from <wallet> --input-token <addr> --output-token <addr> --amount <n>] | [order get --chain <chain> --order-id <id>] | [order strategy list --chain <chain> --group-tag <LimitOrder|STMix>] | [order strategy create --chain <chain> --order-type limit_order --sub-order-type <buy_low|buy_high|stop_loss|take_profit> ...]"
|
||||
argument-hint: "[--chain <chain> --from <wallet> --input-token <addr> --output-token <addr> --amount <n>] | [order get --chain <chain> --order-id <id>] | [order gas-price --chain <eth|bsc|base>] | [order strategy list --chain <chain> --group-tag <LimitOrder|STMix>] | [order strategy create --chain <chain> --order-type limit_order --sub-order-type <buy_low|buy_high|stop_loss|take_profit> ...]"
|
||||
metadata:
|
||||
cliHelp: "gmgn-cli swap --help"
|
||||
---
|
||||
@@ -49,6 +49,7 @@ Use the `gmgn-cli` tool to submit a token swap or query an existing order. `GMGN
|
||||
| `multi-swap` | Submit token swaps across multiple wallets concurrently (up to 100) |
|
||||
| `order quote` | Get a swap quote (no transaction submitted; requires critical auth) |
|
||||
| `order get` | Query order status |
|
||||
| `order gas-price` | Query recommended EVM gas price (low / average / high tiers); normal auth |
|
||||
| `order strategy create` | Create a limit/strategy order (requires private key) |
|
||||
| `order strategy list` | List strategy orders (requires private key) |
|
||||
| `order strategy cancel` | Cancel a strategy order (requires private key) |
|
||||
@@ -87,6 +88,7 @@ All swap-related routes used by this skill go through GMGN's leaky-bucket limite
|
||||
| `multi-swap` | `POST /v1/trade/multi_swap` | 5 |
|
||||
| `order quote` | `GET /v1/trade/quote` | 2 |
|
||||
| `order get` | `GET /v1/trade/query_order` | 1 |
|
||||
| `order gas-price` | `GET /v1/trade/gas_price` | 1 |
|
||||
|
||||
When a request returns `429`:
|
||||
|
||||
@@ -229,11 +231,11 @@ gmgn-cli multi-swap \
|
||||
| `--anti-mev` | No | Enable anti-MEV protection. |
|
||||
| `--priority-fee <sol>` | No | Priority fee in SOL (≥ 0.00001, SOL only). Required when using `--condition-orders` on SOL. |
|
||||
| `--tip-fee <amount>` | No | Tip fee (SOL ≥ 0.00001 / BSC ≥ 0.000001 BNB). Required when using `--condition-orders` on SOL. |
|
||||
| `--auto-tip-fee` | No | Enable automatic tip fee. |
|
||||
| `--max-auto-fee <amount>` | No | Max automatic fee cap. |
|
||||
| `--gas-price <gwei>` | No | Gas price in gwei (BSC: 0.05–10 / BASE: 0.01–10 / ETH: 2–20). Required when using `--condition-orders` on BSC. |
|
||||
| `--max-fee-per-gas <amount>` | No | EIP-1559 max fee per gas (Base / ETH). Defaults to `--gas-price` if omitted. |
|
||||
| `--max-priority-fee-per-gas <amount>` | No | EIP-1559 max priority fee per gas (Base / ETH). Defaults to `--gas-price` if omitted. |
|
||||
| `--gas-price <gwei>` | No | Gas price in gwei (BSC: 0.05–10 / BASE: 0.01–10 / ETH: 2–20). Required when using `--condition-orders` on BSC. Mutually exclusive with `--gas-level`. |
|
||||
| `--gas-level <level>` | No | Gas price tier **eth only**: `low` / `average` / `high`. Mutually exclusive with `--gas-price`. |
|
||||
| `--auto-fee` | No | Auto fee mode; **eth only** — delegates fee selection to the trading bot for `--condition-orders` strategy. |
|
||||
| `--max-fee-per-gas <amount>` | No | EIP-1559 max fee per gas (BSC / BASE / ETH). Clamped per chain minimums. Defaults to `--gas-price` if omitted (BASE/ETH). |
|
||||
| `--max-priority-fee-per-gas <amount>` | No | EIP-1559 max priority fee per gas (BSC / BASE / ETH). Clamped per chain minimums; capped to `--max-fee-per-gas`. |
|
||||
| `--condition-orders <json>` | No | JSON array of condition sub-orders (take-profit / stop-loss) attached to each successful wallet's swap. Same structure as `swap --condition-orders`. Strategy creation is best-effort per wallet. |
|
||||
| `--sell-ratio-type <type>` | No | Sell ratio base for `--condition-orders`: `buy_amount` (default) / `hold_amount`. |
|
||||
|
||||
@@ -281,6 +283,26 @@ gmgn-cli order quote \
|
||||
gmgn-cli order get --chain sol --order-id <order_id>
|
||||
```
|
||||
|
||||
## `order gas-price` Usage
|
||||
|
||||
Query recommended EVM gas price tiers. Uses normal auth (API Key only — no private key required).
|
||||
|
||||
```bash
|
||||
gmgn-cli order gas-price --chain eth
|
||||
gmgn-cli order gas-price --chain bsc
|
||||
gmgn-cli order gas-price --chain base
|
||||
```
|
||||
|
||||
### `order gas-price` Response Fields
|
||||
|
||||
| Field | Type | Description |
|
||||
| ------------------ | ------ | ---- |
|
||||
| `chain` | string | Chain identifier |
|
||||
| `suggest_base_fee` | string | Suggested base fee (gwei) |
|
||||
| `low` | string | Low-priority gas price (gwei) |
|
||||
| `average` | string | Average-priority gas price (gwei) |
|
||||
| `high` | string | High-priority gas price (gwei) |
|
||||
|
||||
## `swap` Parameters
|
||||
|
||||
| Parameter | Required | Description |
|
||||
@@ -297,10 +319,11 @@ gmgn-cli order get --chain sol --order-id <order_id>
|
||||
| `--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) |
|
||||
| `--tip-fee <n>` | No | Tip fee (SOL ≥ 0.00001 / BSC ≥ 0.000001 BNB) |
|
||||
| `--max-auto-fee <n>` | No | Max automatic fee cap |
|
||||
| `--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-priority-fee-per-gas <n>` | No | EIP-1559 max priority fee per gas (Base only) |
|
||||
| `--gas-price <gwei>` | No | Gas price in gwei (BSC ≥ 0.05 / BASE/ETH ≥ 0.01). Mutually exclusive with `--gas-level`. |
|
||||
| `--gas-level <level>` | No | Gas price tier **eth only**: `low` / `average` / `high`. Mutually exclusive with `--gas-price`. |
|
||||
| `--auto-fee` | No | Auto fee mode; **eth only** — delegates fee selection to the trading bot for `--condition-orders` strategy. |
|
||||
| `--max-fee-per-gas <n>` | No | EIP-1559 max fee per gas (BSC / BASE / ETH). Clamped per chain minimums. Defaults to `--gas-price` if omitted (BASE/ETH). |
|
||||
| `--max-priority-fee-per-gas <n>` | No | EIP-1559 max priority fee per gas (BSC / BASE / ETH). Clamped per chain minimums; capped to `--max-fee-per-gas`. |
|
||||
| `--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 |
|
||||
|
||||
@@ -470,7 +493,11 @@ Convert `report.input_amount` and `report.output_amount` from smallest unit usin
|
||||
| `--auto-slippage` | No | Enable automatic slippage |
|
||||
| `--priority-fee` | No | Priority fee in SOL (SOL only) |
|
||||
| `--tip-fee` | No | Tip fee |
|
||||
| `--gas-price` | No | Gas price in gwei (BSC ≥ 0.05 gwei / BASE/ETH ≥ 0.01 gwei) |
|
||||
| `--auto-fee` | No | Auto fee mode; **eth only** — delegates fee selection to the trading bot. |
|
||||
| `--gas-price` | No | Gas price in gwei (BSC ≥ 0.05 / BASE/ETH ≥ 0.01 gwei). Mutually exclusive with `--gas-level`. |
|
||||
| `--gas-level` | No | Gas price tier **eth only**: `low` / `average` / `high`. Mutually exclusive with `--gas-price`. |
|
||||
| `--max-fee-per-gas` | No | EIP-1559 max fee per gas (BSC / BASE / ETH). Clamped per chain minimums. |
|
||||
| `--max-priority-fee-per-gas` | No | EIP-1559 max priority fee per gas (BSC / BASE / ETH). Clamped per chain minimums; capped to `--max-fee-per-gas`. |
|
||||
| `--anti-mev` | No | Enable anti-MEV protection |
|
||||
|
||||
|
||||
@@ -564,6 +591,12 @@ gmgn-cli order strategy cancel \
|
||||
- `--amount` is in the **smallest unit** (e.g., lamports for SOL)
|
||||
- `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
|
||||
- **`--auto-fee` is eth-only** — passing it on BSC/BASE/SOL is silently ignored by the server or rejected
|
||||
- **`--gas-level` is eth-only** — the server rejects non-eth chains with 400 for `--gas-level`
|
||||
- **EIP-1559 minimum values per chain:**
|
||||
- BSC: `max_fee_per_gas` and `max_priority_fee_per_gas` min 50 000 000 wei (≈ 0.05 gwei); passing `"0"` returns 400
|
||||
- BASE / ETH: `max_fee_per_gas` and `max_priority_fee_per_gas` min 200 000 wei
|
||||
- EIP-1559 clamping applies only when `--condition-orders` is present (swap / multi-swap) or on every request (strategy/create)
|
||||
|
||||
## Input Validation
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ Use the `gmgn-cli` tool to query token information based on the user's request.
|
||||
|
||||
- **Token address** — The on-chain contract address that uniquely identifies a token on its chain. Required for all token sub-commands. Format: base58 (SOL) or `0x...` hex (BSC/Base).
|
||||
- **Chain** — The blockchain network: `sol` = Solana, `bsc` = BNB Smart Chain, `base` = Base (Coinbase L2), `eth` = Ethereum mainnet.
|
||||
- **Market cap** — Not returned directly by `token info`. Calculate as `price × circulating_supply` (both are top-level fields in the response, already in human-readable units).
|
||||
- **Market cap** — Not returned directly by `token info`. Calculate as `price.price × circulating_supply` (`price` is a nested object; use `price.price` for the current USD price string).
|
||||
- **Liquidity** — USD value of token reserves in the main trading pool. Low liquidity (< $10k) means high price impact / slippage when buying or selling.
|
||||
- **Holder** — A wallet that currently holds the token. `token holders` returns wallets ranked by current balance.
|
||||
- **Trader** — Any wallet that has transacted with the token (bought or sold), regardless of current holdings. `token traders` covers both current holders and past traders.
|
||||
@@ -34,7 +34,7 @@ Use the `gmgn-cli` tool to query token information based on the user's request.
|
||||
|
||||
| Sub-command | Description |
|
||||
|-------------|-------------|
|
||||
| `token info` | Basic info + realtime price, liquidity, market cap, total supply, holder count, social links (market cap = price × circulating_supply) |
|
||||
| `token info` | Basic info + realtime price, liquidity, market cap, total supply, holder count, social links (market cap = price.price × circulating_supply) |
|
||||
| `token security` | Security metrics (honeypot, taxes, holder concentration, contract risks) |
|
||||
| `token pool` | Liquidity pool info (DEX, reserves, liquidity depth) |
|
||||
| `token holders` | Top token holders list with profit/loss breakdown |
|
||||
@@ -162,7 +162,7 @@ The response has five nested objects: `pool`, `dev`, `link`, `stat`, `wallet_tag
|
||||
| `total_supply` | Total token supply (same as `circulating_supply` for most tokens) |
|
||||
| `circulating_supply` | Circulating supply |
|
||||
| `max_supply` | Maximum supply |
|
||||
| `price` | Current price in USD |
|
||||
| `price` | **Object** — price and trading stats (see `price` Object below). Access current price as `price.price`. |
|
||||
| `liquidity` | Total liquidity in USD (from biggest pool) |
|
||||
| `holder_count` | Number of unique token holders |
|
||||
| `logo` | Token logo image URL |
|
||||
@@ -274,6 +274,57 @@ The response has five nested objects: `pool`, `dev`, `link`, `stat`, `wallet_tag
|
||||
| `wallet_tags_stat.fresh_wallets` | Number of fresh wallets |
|
||||
| `wallet_tags_stat.top_wallets` | Number of top-ranked wallets |
|
||||
|
||||
**`price` Object** — Price and trading statistics (access current price via `price.price`)
|
||||
|
||||
| Field | Description |
|
||||
|-------|-------------|
|
||||
| `price.price` | Current price in USD (string) |
|
||||
| `price.price_{window}` | Price at the start of the window; windows: `1m`, `5m`, `1h`, `6h`, `24h` |
|
||||
| `price.buys_{window}` | Buy transaction count in the window |
|
||||
| `price.sells_{window}` | Sell transaction count in the window |
|
||||
| `price.volume_{window}` | Total trading volume in USD for the window |
|
||||
| `price.buy_volume_{window}` | Buy volume in USD for the window |
|
||||
| `price.sell_volume_{window}` | Sell volume in USD for the window |
|
||||
| `price.swaps_{window}` | Total swap count for the window |
|
||||
| `price.hot_level` | Heat level integer |
|
||||
|
||||
**`fee_distribution` Object** — Launchpad fee-sharing config (optional; present for `pump` / `bankr` tokens)
|
||||
|
||||
| Field | Description |
|
||||
|-------|-------------|
|
||||
| `fee_distribution.launchpad` | Launchpad identifier: `"pump"`, `"bankr"`, or `""` (unknown) |
|
||||
| `fee_distribution.platform_data` | Platform-specific fee config; structure varies by `launchpad` (see below) |
|
||||
|
||||
When `fee_distribution.launchpad = "pump"`:
|
||||
|
||||
| Field | Description |
|
||||
|-------|-------------|
|
||||
| `platform_data.fee_authority` | Fee authority wallet address |
|
||||
| `platform_data.is_locked` | Whether the fee config is locked |
|
||||
| `platform_data.show` | Whether fee distribution is displayed in the UI |
|
||||
| `platform_data.list` | Array of fee-share holders (see FeeShareHolder below) |
|
||||
| `platform_data.bonus_category` | Bonus category list (e.g. `creator_reward`, `cashback`) |
|
||||
|
||||
When `fee_distribution.launchpad = "bankr"`:
|
||||
|
||||
| Field | Description |
|
||||
|-------|-------------|
|
||||
| `platform_data.deployer` | Original deployer wallet address |
|
||||
| `platform_data.fee_recipient` | Fee recipient wallet address |
|
||||
| `platform_data.list` | Array of fee-share holders (see FeeShareHolder below) |
|
||||
|
||||
FeeShareHolder fields (each item in `platform_data.list`):
|
||||
|
||||
| Field | Description |
|
||||
|-------|-------------|
|
||||
| `wallet` | Wallet address |
|
||||
| `royalty_bps` | Royalty share in basis points (10000 = 100%) |
|
||||
| `is_creator` | Whether this is the original creator |
|
||||
| `has_claimed_fee` | Whether fees have been claimed |
|
||||
| `username` | Display name |
|
||||
| `pfp` | Avatar URL |
|
||||
| `twitter_username` | Twitter / X username |
|
||||
|
||||
---
|
||||
|
||||
### `token security` — Key Fields
|
||||
@@ -624,7 +675,7 @@ Present as a concise card. Do not dump raw JSON.
|
||||
|
||||
```
|
||||
{symbol} ({name})
|
||||
Price: ${price} | Market Cap: ~${price × circulating_supply} | Liquidity: ${liquidity}
|
||||
Price: ${price.price} | Market Cap: ~${price.price × circulating_supply} | Liquidity: ${liquidity}
|
||||
Holders: {holder_count} | Smart Money: {wallet_tags_stat.smart_wallets} | KOLs: {wallet_tags_stat.renowned_wallets}
|
||||
Social: @{link.twitter_username} | {link.website} | {link.telegram}
|
||||
```
|
||||
@@ -667,7 +718,7 @@ Show top rows only. Highlight wallets tagged `kol`, `smart_degen`, or flagged `b
|
||||
|
||||
## Notes
|
||||
|
||||
- **Market cap is not returned directly** — calculate it as `price × circulating_supply` (both fields are top-level; `circulating_supply` is already in human-readable token units, no decimal adjustment needed). Example: `price=3.11` × `circulating_supply=999999151` ≈ $3.11B market cap.
|
||||
- **Market cap is not returned directly** — calculate it as `price.price × circulating_supply` (`price` is now a nested object; use `price.price` for the current USD price string, and `circulating_supply` is a top-level field already in human-readable token units). Example: `price.price="3.11"` × `circulating_supply=999999151` ≈ $3.11B market cap.
|
||||
- **Trading volume (1h, 24h, etc.) is not included in `token info`** — to get volume or OHLCV data, use the `gmgn-market` skill and query K-line data: `gmgn-cli market kline --chain <chain> --address <token_address> --resolution <1m|5m|15m|1h|4h|1d>`. See the `gmgn-market` SKILL.md for full details.
|
||||
- All token commands use normal auth (API Key only, no signature required)
|
||||
- Use `--raw` to get single-line JSON for further processing
|
||||
|
||||
@@ -80,9 +80,9 @@ export interface SwapParams {
|
||||
is_anti_mev?: boolean;
|
||||
priority_fee?: string;
|
||||
tip_fee?: string;
|
||||
auto_tip_fee?: boolean;
|
||||
max_auto_fee?: string;
|
||||
gas_price?: string;
|
||||
gas_level?: string;
|
||||
auto_fee?: boolean;
|
||||
max_fee_per_gas?: string;
|
||||
max_priority_fee_per_gas?: string;
|
||||
condition_orders?: StrategyConditionOrder[];
|
||||
@@ -111,9 +111,9 @@ export interface MultiSwapParams {
|
||||
is_anti_mev?: boolean;
|
||||
priority_fee?: string;
|
||||
tip_fee?: string;
|
||||
auto_tip_fee?: boolean;
|
||||
max_auto_fee?: string;
|
||||
gas_price?: string;
|
||||
gas_level?: string;
|
||||
auto_fee?: boolean;
|
||||
max_fee_per_gas?: string;
|
||||
max_priority_fee_per_gas?: string;
|
||||
condition_orders?: StrategyConditionOrder[];
|
||||
@@ -138,7 +138,9 @@ export interface StrategyCreateParams {
|
||||
slippage?: number;
|
||||
auto_slippage?: boolean;
|
||||
fee?: string;
|
||||
auto_fee?: boolean;
|
||||
gas_price?: string;
|
||||
gas_level?: string;
|
||||
max_fee_per_gas?: string;
|
||||
max_priority_fee_per_gas?: string;
|
||||
is_anti_mev?: boolean;
|
||||
@@ -354,6 +356,10 @@ export class OpenApiClient {
|
||||
return this.criticalRequest("GET", "/v1/trade/query_order", { order_id: orderId, chain }, null);
|
||||
}
|
||||
|
||||
async getGasPrice(chain: string): Promise<unknown> {
|
||||
return this.normalRequest("GET", "/v1/trade/gas_price", { chain });
|
||||
}
|
||||
|
||||
// ---- Strategy order endpoints (critical auth) ----
|
||||
|
||||
async createStrategyOrder(params: StrategyCreateParams): Promise<unknown> {
|
||||
|
||||
+34
-13
@@ -20,10 +20,11 @@ export function registerSwapCommands(program: Command): void {
|
||||
.option("--anti-mev", "Enable anti-MEV protection, default true")
|
||||
.option("--priority-fee <sol>", "Priority fee in SOL (≥ 0.00001, SOL only)")
|
||||
.option("--tip-fee <amount>", "Tip fee (SOL ≥ 0.00001 SOL / BSC ≥ 0.000001 BNB)")
|
||||
.option("--max-auto-fee <amount>", "Max auto fee cap")
|
||||
.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-priority-fee-per-gas <amount>", "EIP-1559 max priority fee per gas (Base)")
|
||||
.option("--gas-price <gwei>", "Gas price in gwei (BSC ≥ 0.05 / BASE/ETH ≥ 0.01); mutually exclusive with --gas-level")
|
||||
.option("--gas-level <level>", "Gas price tier (eth only): low / average / high; mutually exclusive with --gas-price")
|
||||
.option("--auto-fee", "Auto fee mode (eth only); delegates fee selection to trading bot for condition_orders strategy")
|
||||
.option("--max-fee-per-gas <amount>", "EIP-1559 max fee per gas (BSC / BASE / ETH)")
|
||||
.option("--max-priority-fee-per-gas <amount>", "EIP-1559 max priority fee per gas (BSC / BASE / ETH)")
|
||||
.option("--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("--raw", "Output raw JSON")
|
||||
@@ -52,8 +53,9 @@ export function registerSwapCommands(program: Command): void {
|
||||
if (opts.antiMev) params.is_anti_mev = true;
|
||||
if (opts.priorityFee) params.priority_fee = opts.priorityFee;
|
||||
if (opts.tipFee) params.tip_fee = opts.tipFee;
|
||||
if (opts.maxAutoFee) params.max_auto_fee = opts.maxAutoFee;
|
||||
if (opts.autoFee) params.auto_fee = true;
|
||||
if (opts.gasPrice) params.gas_price = String(Math.round(parseFloat(opts.gasPrice) * 1e9));
|
||||
if (opts.gasLevel) params.gas_level = opts.gasLevel;
|
||||
if (opts.maxFeePerGas) params.max_fee_per_gas = opts.maxFeePerGas;
|
||||
if (opts.maxPriorityFeePerGas) params.max_priority_fee_per_gas = opts.maxPriorityFeePerGas;
|
||||
if (opts.conditionOrders) {
|
||||
@@ -109,6 +111,17 @@ export function registerSwapCommands(program: Command): void {
|
||||
printResult(data, opts.raw);
|
||||
});
|
||||
|
||||
order
|
||||
.command("gas-price")
|
||||
.description("Query recommended EVM gas price (normal auth; eth / bsc / base)")
|
||||
.requiredOption("--chain <chain>", "EVM chain: eth / bsc / base")
|
||||
.option("--raw", "Output raw JSON")
|
||||
.action(async (opts) => {
|
||||
const client = new OpenApiClient(getConfig(false));
|
||||
const data = await client.getGasPrice(opts.chain).catch(exitOnError);
|
||||
printResult(data, opts.raw);
|
||||
});
|
||||
|
||||
program
|
||||
.command("multi-swap")
|
||||
.description("Submit token swaps across multiple wallets concurrently (up to 100 wallets)")
|
||||
@@ -124,11 +137,11 @@ export function registerSwapCommands(program: Command): void {
|
||||
.option("--anti-mev", "Enable anti-MEV protection")
|
||||
.option("--priority-fee <sol>", "Priority fee in SOL (SOL only, ≥ 0.00001)")
|
||||
.option("--tip-fee <amount>", "Tip fee (SOL ≥ 0.00001 / BSC ≥ 0.000001 BNB)")
|
||||
.option("--auto-tip-fee", "Enable automatic tip fee")
|
||||
.option("--max-auto-fee <amount>", "Max auto fee cap")
|
||||
.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 only)")
|
||||
.option("--max-priority-fee-per-gas <amount>", "EIP-1559 max priority fee per gas (Base only)")
|
||||
.option("--gas-price <gwei>", "Gas price in gwei (BSC ≥ 0.05 / BASE/ETH ≥ 0.01); mutually exclusive with --gas-level")
|
||||
.option("--gas-level <level>", "Gas price tier (eth only): low / average / high; mutually exclusive with --gas-price")
|
||||
.option("--auto-fee", "Auto fee mode (eth only); delegates fee selection to trading bot for condition_orders strategy")
|
||||
.option("--max-fee-per-gas <amount>", "EIP-1559 max fee per gas (BSC / BASE / ETH)")
|
||||
.option("--max-priority-fee-per-gas <amount>", "EIP-1559 max priority fee per gas (BSC / BASE / ETH)")
|
||||
.option("--condition-orders <json>", "JSON array of take-profit/stop-loss conditions attached to each successful wallet's swap")
|
||||
.option("--sell-ratio-type <type>", "Sell ratio base: buy_amount (default) / hold_amount; only used with --condition-orders")
|
||||
.option("--raw", "Output raw JSON")
|
||||
@@ -166,9 +179,9 @@ export function registerSwapCommands(program: Command): void {
|
||||
if (opts.antiMev) params.is_anti_mev = true;
|
||||
if (opts.priorityFee) params.priority_fee = opts.priorityFee;
|
||||
if (opts.tipFee) params.tip_fee = opts.tipFee;
|
||||
if (opts.autoTipFee) params.auto_tip_fee = true;
|
||||
if (opts.maxAutoFee) params.max_auto_fee = opts.maxAutoFee;
|
||||
if (opts.autoFee) params.auto_fee = true;
|
||||
if (opts.gasPrice) params.gas_price = String(Math.round(parseFloat(opts.gasPrice) * 1e9));
|
||||
if (opts.gasLevel) params.gas_level = opts.gasLevel;
|
||||
if (opts.maxFeePerGas) params.max_fee_per_gas = opts.maxFeePerGas;
|
||||
if (opts.maxPriorityFeePerGas) params.max_priority_fee_per_gas = opts.maxPriorityFeePerGas;
|
||||
if (opts.conditionOrders) {
|
||||
@@ -202,7 +215,11 @@ export function registerSwapCommands(program: Command): void {
|
||||
.option("--auto-slippage", "Enable automatic slippage")
|
||||
.option("--priority-fee <sol>", "Priority fee in SOL (required for SOL chain)")
|
||||
.option("--tip-fee <amount>", "Tip fee (required for SOL chain)")
|
||||
.option("--gas-price <gwei>", "Gas price in gwei (required for BSC; ≥ 0.05 gwei / BASE/ETH ≥ 0.01 gwei)")
|
||||
.option("--auto-fee", "Auto fee mode (eth only); delegates fee selection to trading bot")
|
||||
.option("--gas-price <gwei>", "Gas price in gwei (BSC ≥ 0.05 / BASE/ETH ≥ 0.01 gwei); mutually exclusive with --gas-level")
|
||||
.option("--gas-level <level>", "Gas price tier (eth only): low / average / high; mutually exclusive with --gas-price")
|
||||
.option("--max-fee-per-gas <amount>", "EIP-1559 max fee per gas (BSC / BASE / ETH)")
|
||||
.option("--max-priority-fee-per-gas <amount>", "EIP-1559 max priority fee per gas (BSC / BASE / ETH)")
|
||||
.option("--anti-mev", "Enable anti-MEV protection")
|
||||
.option("--raw", "Output raw JSON")
|
||||
.action(async (opts) => {
|
||||
@@ -233,7 +250,11 @@ export function registerSwapCommands(program: Command): void {
|
||||
if (opts.autoSlippage) params.auto_slippage = true;
|
||||
if (opts.priorityFee) params.priority_fee = opts.priorityFee;
|
||||
if (opts.tipFee) params.tip_fee = opts.tipFee;
|
||||
if (opts.autoFee) params.auto_fee = true;
|
||||
if (opts.gasPrice) params.gas_price = String(Math.round(parseFloat(opts.gasPrice) * 1e9));
|
||||
if (opts.gasLevel) params.gas_level = opts.gasLevel;
|
||||
if (opts.maxFeePerGas) params.max_fee_per_gas = opts.maxFeePerGas;
|
||||
if (opts.maxPriorityFeePerGas) params.max_priority_fee_per_gas = opts.maxPriorityFeePerGas;
|
||||
if (opts.antiMev) params.is_anti_mev = true;
|
||||
const client = new OpenApiClient(getConfig(true));
|
||||
const data = await client.createStrategyOrder(params).catch(exitOnError);
|
||||
|
||||
Reference in New Issue
Block a user