diff --git a/Readme.md b/Readme.md index 5cb3f3d..da6bc1f 100644 --- a/Readme.md +++ b/Readme.md @@ -528,7 +528,7 @@ gmgn-cli swap \ --input-token \ --output-token \ --amount 1000000 \ - --slippage 0.01 + --slippage 30 # Submit swap with automatic slippage gmgn-cli swap \ @@ -555,7 +555,7 @@ gmgn-cli order quote \ --input-token \ --output-token \ --amount 1000000 \ - --slippage 0.01 + --slippage 30 # Quotes use signed auth and require GMGN_PRIVATE_KEY on every chain gmgn-cli order quote \ @@ -564,7 +564,7 @@ gmgn-cli order quote \ --input-token \ --output-token \ --amount 1000000000000000000 \ - --slippage 0.01 + --slippage 30 # Query order gmgn-cli order get --chain sol --order-id @@ -582,7 +582,7 @@ gmgn-cli multi-swap \ --input-token \ --output-token \ --input-amount '{"":"1000000","":"2000000"}' \ - --slippage 0.01 + --slippage 30 ``` > `order quote` uses signed auth on `sol` / `bsc` / `base` / `eth` and requires `GMGN_PRIVATE_KEY`. @@ -597,7 +597,7 @@ gmgn-cli swap \ --input-token \ --output-token \ --amount \ - --slippage 0.01 \ + --slippage 30 \ --gas-level high # Let GMGN auto-select the optimal gas fee for condition orders @@ -607,7 +607,7 @@ gmgn-cli swap \ --input-token \ --output-token \ --amount \ - --slippage 0.01 \ + --slippage 30 \ --condition-orders '[...]' \ --auto-fee ``` @@ -627,7 +627,7 @@ gmgn-cli swap \ --input-token So11111111111111111111111111111111111111112 \ --output-token \ --amount 10000000 \ - --slippage 0.3 \ + --slippage 30 \ --anti-mev \ --condition-orders '[{"order_type":"profit_stop","side":"sell","price_scale":"100","sell_ratio":"50"},{"order_type":"profit_stop","side":"sell","price_scale":"300","sell_ratio":"100"},{"order_type":"loss_stop","side":"sell","price_scale":"65","sell_ratio":"100"}]' \ --sell-ratio-type hold_amount @@ -646,7 +646,7 @@ gmgn-cli swap \ --input-token So11111111111111111111111111111111111111112 \ --output-token \ --amount 10000000 \ - --slippage 0.3 \ + --slippage 30 \ --anti-mev \ --condition-orders '[{"order_type":"profit_stop","side":"sell","price_scale":"100","sell_ratio":"50"},{"order_type":"profit_stop","side":"sell","price_scale":"300","sell_ratio":"50"},{"order_type":"loss_stop","side":"sell","price_scale":"65","sell_ratio":"100"}]' \ --sell-ratio-type buy_amount @@ -668,7 +668,7 @@ gmgn-cli order strategy create \ --sub-order-type take_profit \ --check-price 0.002 \ --amount-in-percent 100 \ - --slippage 0.01 + --slippage 30 # Create a stop-loss order gmgn-cli order strategy create \ @@ -679,7 +679,7 @@ gmgn-cli order strategy create \ --sub-order-type stop_loss \ --check-price 0.0005 \ --amount-in-percent 100 \ - --slippage 0.01 + --slippage 30 # List open strategy orders (requires private key) gmgn-cli order strategy list --chain sol @@ -698,7 +698,7 @@ gmgn-cli cooking \ --input-token So11111111111111111111111111111111111111112 \ --output-token \ --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"}]' ``` diff --git a/Readme.zh.md b/Readme.zh.md index dd3f8c7..dcadb7c 100644 --- a/Readme.zh.md +++ b/Readme.zh.md @@ -552,7 +552,7 @@ gmgn-cli swap \ --input-token \ --output-token \ --amount 1000000 \ - --slippage 0.01 + --slippage 30 # 提交兑换(自动滑点) gmgn-cli swap \ @@ -579,7 +579,7 @@ gmgn-cli order quote \ --input-token \ --output-token \ --amount 1000000 \ - --slippage 0.01 + --slippage 30 # 所有链上的 quote 都走关键鉴权,需要 GMGN_PRIVATE_KEY gmgn-cli order quote \ @@ -588,7 +588,7 @@ gmgn-cli order quote \ --input-token \ --output-token \ --amount 1000000000000000000 \ - --slippage 0.01 + --slippage 30 # 查询订单状态 gmgn-cli order get --chain sol --order-id @@ -606,7 +606,7 @@ gmgn-cli multi-swap \ --input-token \ --output-token \ --input-amount '{"":"1000000","":"2000000"}' \ - --slippage 0.01 + --slippage 30 ``` > `order quote` 在 `sol` / `bsc` / `base` / `eth` 上都走关键鉴权,必须配置 `GMGN_PRIVATE_KEY`。 @@ -621,7 +621,7 @@ gmgn-cli swap \ --input-token \ --output-token \ --amount \ - --slippage 0.01 \ + --slippage 30 \ --gas-level high # 策略单(condition-orders)由 GMGN 自动选择最优 Gas Fee @@ -631,7 +631,7 @@ gmgn-cli swap \ --input-token \ --output-token \ --amount \ - --slippage 0.01 \ + --slippage 30 \ --condition-orders '[...]' \ --auto-fee ``` @@ -651,7 +651,7 @@ gmgn-cli swap \ --input-token So11111111111111111111111111111111111111112 \ --output-token \ --amount 10000000 \ - --slippage 0.3 \ + --slippage 30 \ --anti-mev \ --condition-orders '[{"order_type":"profit_stop","side":"sell","price_scale":"100","sell_ratio":"50"},{"order_type":"profit_stop","side":"sell","price_scale":"300","sell_ratio":"100"},{"order_type":"loss_stop","side":"sell","price_scale":"65","sell_ratio":"100"}]' \ --sell-ratio-type hold_amount @@ -670,7 +670,7 @@ gmgn-cli swap \ --input-token So11111111111111111111111111111111111111112 \ --output-token \ --amount 10000000 \ - --slippage 0.3 \ + --slippage 30 \ --anti-mev \ --condition-orders '[{"order_type":"profit_stop","side":"sell","price_scale":"100","sell_ratio":"50"},{"order_type":"profit_stop","side":"sell","price_scale":"300","sell_ratio":"50"},{"order_type":"loss_stop","side":"sell","price_scale":"65","sell_ratio":"100"}]' \ --sell-ratio-type buy_amount @@ -692,7 +692,7 @@ gmgn-cli order strategy create \ --sub-order-type take_profit \ --check-price 0.002 \ --amount-in-percent 100 \ - --slippage 0.01 + --slippage 30 # 创建止损单 gmgn-cli order strategy create \ @@ -703,7 +703,7 @@ gmgn-cli order strategy create \ --sub-order-type stop_loss \ --check-price 0.0005 \ --amount-in-percent 100 \ - --slippage 0.01 + --slippage 30 # 查看当前挂单(需要私钥) gmgn-cli order strategy list --chain sol @@ -722,7 +722,7 @@ gmgn-cli cooking \ --input-token So11111111111111111111111111111111111111112 \ --output-token \ --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"}]' ``` diff --git a/docs/cli-usage.md b/docs/cli-usage.md index de56a0c..7bf9a2e 100644 --- a/docs/cli-usage.md +++ b/docs/cli-usage.md @@ -431,7 +431,7 @@ npx gmgn-cli order quote \ | `--input-token` | Yes | Input token contract address | | `--output-token` | Yes | Output token contract address | | `--amount` | Yes | Input amount (smallest unit) | -| `--slippage` | Yes | Slippage tolerance, e.g. `0.01` = 1% | +| `--slippage` | Yes | Slippage tolerance as an integer 0–100, e.g. `30` = 30% | **Response fields (data):** @@ -479,7 +479,7 @@ npx gmgn-cli swap \ | `--output-token` | Yes | all | Output token contract address | | `--amount` | No* | all | Input raw amount in minimal unit (e.g., lamports for SOL); required unless `--percent` is used | | `--percent` | No* | all | Input amount as a percentage, e.g. `50` = 50%; required unless `--amount` is used; only valid when input token is not a currency (not SOL/BNB/ETH/USDC) | -| `--slippage` | No | all | Slippage tolerance, e.g. `0.01` = 1% | +| `--slippage` | No | all | Slippage tolerance as an integer 0–100, e.g. `30` = 30% | | `--auto-slippage` | No | all | Enable automatic slippage | | `--min-output` | No | all | Minimum output amount (raw amount) | | `--anti-mev` | No | all | Enable anti-MEV protection (default true) | @@ -557,7 +557,7 @@ gmgn-cli multi-swap \ | `--input-amount` | No* | all | JSON map `{"addr":"amount"}` in smallest unit; one of the three amount fields is required | | `--input-amount-bps` | No* | all | JSON map `{"addr":"bps"}` where 5000 = 50%; only valid when input token is not a currency | | `--output-amount` | No* | all | JSON map `{"addr":"amount"}` target output in smallest unit | -| `--slippage` | No | all | Slippage tolerance, e.g. `0.01` = 1% | +| `--slippage` | No | all | Slippage tolerance as an integer 0–100, e.g. `30` = 30% | | `--auto-slippage` | No | all | Enable automatic slippage | | `--anti-mev` | No | all | Enable anti-MEV protection | | `--priority-fee` | No | `sol` | Priority fee in SOL (≥ 0.00001) | @@ -643,7 +643,7 @@ gmgn-cli order strategy create \ | `--sell-ratio-type` | No | `buy_amount` (default) / `hold_amount` | | `--quote-investment` | No | Quote token investment amount (`smart_trade`) | | `--condition-orders` | No | JSON array of condition sub-orders for `smart_trade`. Must include one `buy_low` entry (with `check_price` lower than `open_price`) plus at least one TP/SL entry | -| `--slippage` | No | Slippage tolerance, e.g. `0.01` = 1% | +| `--slippage` | No | Slippage tolerance as an integer 0–100, e.g. `30` = 30% | | `--auto-slippage` | No | Enable automatic slippage | | `--priority-fee` | No | Priority fee in SOL (**required for SOL chain**) | | `--tip-fee` | No | Tip fee (**required for SOL chain**) | @@ -764,7 +764,7 @@ gmgn-cli cooking create \ | `--buy-amt` | Yes | Initial buy amount in native token (e.g. `0.01` SOL) | | `--image` | No* | Token logo as base64-encoded data (max 2MB decoded); required unless `--image-url` is used | | `--image-url` | No* | Token logo URL; required unless `--image` is used | -| `--slippage` | No* | Slippage tolerance, 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 | | `--website` | No | Website URL | | `--twitter` | No | Twitter link | diff --git a/skills/gmgn-cooking/SKILL.md b/skills/gmgn-cooking/SKILL.md index 0ac419e..ee5f4be 100644 --- a/skills/gmgn-cooking/SKILL.md +++ b/skills/gmgn-cooking/SKILL.md @@ -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). -- **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 @@ -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. | | `--image` | No* | Token logo as **base64-encoded** data (max 2MB decoded). Mutually exclusive with `--image-url`. One of the two is required. | | `--image-url` | No* | Token logo as a publicly accessible URL. Mutually exclusive with `--image`. One of the two is required. | -| `--slippage` | No* | Slippage tolerance, e.g. `0.01` = 1%. **Mutually exclusive with `--auto-slippage`** — provide one or the other. | +| `--slippage` | No* | Slippage tolerance as an integer 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`.** | | `--description` | No | Token description / project pitch | | `--website` | No | Project website URL | @@ -386,7 +386,7 @@ gmgn-cli cooking create \ --symbol MAT \ --buy-amt 0.01 \ --image-url https://example.com/logo.png \ - --slippage 0.01 \ + --slippage 30 \ --priority-fee 0.001 # Create a token on FourMeme (BSC) — base64 image + USD1 raise token diff --git a/skills/gmgn-swap/SKILL.md b/skills/gmgn-swap/SKILL.md index 46f8066..fec5594 100644 --- a/skills/gmgn-swap/SKILL.md +++ b/skills/gmgn-swap/SKILL.md @@ -18,7 +18,7 @@ Use the `gmgn-cli` tool to submit a token swap or query an existing order. `GMGN - **Smallest unit** — `--amount` is always in the token's smallest indivisible unit, not human-readable amounts. For SOL: 1 SOL = 1,000,000,000 lamports. For EVM tokens: depends on decimals (most ERC-20 tokens use 18 decimals). Always convert before passing to the command — do not pass human amounts directly. -- **`slippage`** — Price tolerance expressed as a decimal, not a percentage. `0.01` = 1% slippage. `0.5` = 50% slippage. If the price moves beyond this threshold before the transaction confirms, the swap is rejected. Use `--auto-slippage` for volatile tokens to let GMGN set an appropriate value automatically. +- **`slippage`** — Price tolerance as an integer 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. @@ -145,7 +145,7 @@ gmgn-cli swap \ --input-token \ --output-token \ --amount 1000000 \ - --slippage 0.01 + --slippage 30 # With automatic slippage gmgn-cli swap \ @@ -184,7 +184,7 @@ gmgn-cli swap \ | `--output-token` | Yes | all | Output token contract address | | `--amount` | No* | all | Input amount in smallest unit. **Mutually exclusive with `--percent`** — provide one or the other, never both. Required unless `--percent` is used. | | `--percent ` | 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 ` | No | all | Slippage tolerance, e.g. `0.01` = 1%. **Mutually exclusive with `--auto-slippage`** — use one or the other. | +| `--slippage ` | 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`.** | | `--min-output ` | 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`.** | @@ -228,7 +228,7 @@ gmgn-cli swap \ --input-token So11111111111111111111111111111111111111112 \ --output-token \ --amount 10000000 \ - --slippage 0.3 \ + --slippage 30 \ --anti-mev \ --condition-orders '[{"order_type":"profit_stop","side":"sell","price_scale":"100","sell_ratio":"50"},{"order_type":"profit_stop","side":"sell","price_scale":"300","sell_ratio":"100"},{"order_type":"loss_stop","side":"sell","price_scale":"65","sell_ratio":"100"}]' \ --sell-ratio-type hold_amount @@ -246,7 +246,7 @@ gmgn-cli swap \ --input-token So11111111111111111111111111111111111111112 \ --output-token \ --amount 10000000 \ - --slippage 0.3 \ + --slippage 30 \ --anti-mev \ --condition-orders '[{"order_type":"profit_stop","side":"sell","price_scale":"100","sell_ratio":"50"},{"order_type":"profit_stop","side":"sell","price_scale":"300","sell_ratio":"50"},{"order_type":"loss_stop","side":"sell","price_scale":"65","sell_ratio":"100"}]' \ --sell-ratio-type buy_amount @@ -358,7 +358,7 @@ gmgn-cli multi-swap \ --input-token \ --output-token \ --input-amount '{"":"1000000","":"2000000"}' \ - --slippage 0.01 + --slippage 30 # Sell a percentage of each wallet's balance (use --input-amount-bps) gmgn-cli multi-swap \ @@ -367,7 +367,7 @@ gmgn-cli multi-swap \ --input-token \ --output-token \ --input-amount-bps '{"":"5000","":"10000"}' \ - --slippage 0.01 + --slippage 30 # With per-wallet take-profit / stop-loss (condition_orders) gmgn-cli multi-swap \ @@ -376,7 +376,7 @@ gmgn-cli multi-swap \ --input-token So11111111111111111111111111111111111111112 \ --output-token \ --input-amount '{"":"1000000","":"2000000"}' \ - --slippage 0.3 \ + --slippage 30 \ --priority-fee 0.00001 \ --tip-fee 0.00001 \ --condition-orders '[{"order_type":"profit_stop","side":"sell","price_scale":"100","sell_ratio":"100"},{"order_type":"loss_stop","side":"sell","price_scale":"50","sell_ratio":"100"}]' @@ -388,7 +388,7 @@ gmgn-cli multi-swap \ --input-token 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 \ --output-token \ --input-amount '{"<0xaddr1>":"1000000","<0xaddr2>":"2000000"}' \ - --slippage 0.01 \ + --slippage 30 \ --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-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). | -| `--slippage ` | No | all | Slippage tolerance, e.g. `0.01` = 1%. Mutually exclusive with `--auto-slippage`. | +| `--slippage ` | 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. | | `--anti-mev` | No | sol / bsc / eth | Enable anti-MEV protection. Not supported on `base`. | | `--priority-fee ` | 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 \ --output-token \ --amount \ - --slippage 0.01 + --slippage 30 ``` ### `order quote` Response Fields diff --git a/src/commands/cooking.ts b/src/commands/cooking.ts index f800c8e..b58d0c1 100644 --- a/src/commands/cooking.ts +++ b/src/commands/cooking.ts @@ -32,7 +32,7 @@ export function registerCookingCommands(program: Command): void { .option("--website ", "Website URL") .option("--twitter ", "Twitter link") .option("--telegram ", "Telegram link") - .option("--slippage ", "Slippage tolerance (e.g. 0.01 = 1%)", parseFloat) + .option("--slippage ", "Slippage tolerance (e.g. 30 = 30%)", parseFloat) .option("--auto-slippage", "Enable automatic slippage") .option("--fee ", "Base gas / fee") .option("--priority-fee ", "Priority fee in SOL (SOL only)") diff --git a/src/commands/swap.ts b/src/commands/swap.ts index a4f9179..b711323 100644 --- a/src/commands/swap.ts +++ b/src/commands/swap.ts @@ -14,7 +14,7 @@ export function registerSwapCommands(program: Command): void { .requiredOption("--output-token
", "Output token contract address") .option("--amount ", "Input raw amount (smallest unit)") .option("--percent ", "Input amount as a percentage, e.g. 50 = 50%, 1 = 1%; only valid when input_token is NOT a currency", parseFloat) - .option("--slippage ", "Slippage tolerance (e.g. 0.01 = 1%)", parseFloat) + .option("--slippage ", "Slippage tolerance (e.g. 30 = 30%)", parseFloat) .option("--auto-slippage", "Enable automatic slippage") .option("--min-output ", "Minimum output amount") .option("--anti-mev", "Enable anti-MEV protection, default true") @@ -83,7 +83,7 @@ export function registerSwapCommands(program: Command): void { .option("--input-amount ", 'JSON map of wallet→amount (smallest unit), e.g. \'{"addr1":"1000000","addr2":"2000000"}\'') .option("--input-amount-bps ", 'JSON map of wallet→percent in bps (1–10000, e.g. 5000=50%), e.g. \'{"addr1":"5000"}\'') .option("--output-amount ", "JSON map of wallet→target output amount") - .option("--slippage ", "Slippage tolerance (e.g. 0.01 = 1%)", parseFloat) + .option("--slippage ", "Slippage tolerance (e.g. 30 = 30%)", parseFloat) .option("--auto-slippage", "Enable automatic slippage") .option("--anti-mev", "Enable anti-MEV protection") .option("--priority-fee ", "Priority fee in SOL (SOL only, ≥ 0.00001)") @@ -155,7 +155,7 @@ export function registerSwapCommands(program: Command): void { .requiredOption("--input-token
", "Input token contract address") .requiredOption("--output-token
", "Output token contract address") .requiredOption("--amount ", "Input amount (smallest unit)") - .requiredOption("--slippage ", "Slippage tolerance (e.g. 0.01 = 1%)", parseFloat) + .requiredOption("--slippage ", "Slippage tolerance (e.g. 30 = 30%)", parseFloat) .option("--raw", "Output raw JSON") .action(async (opts) => { validateChain(opts.chain); @@ -213,7 +213,7 @@ export function registerSwapCommands(program: Command): void { .option("--expire-in ", "Order expiry in seconds", parseInt) .option("--sell-ratio-type ", "Sell ratio basis: buy_amount (default) / hold_amount") .option("--quote-investment ", "Quote token investment amount (smart_trade)") - .option("--slippage ", "Slippage tolerance (e.g. 0.01 = 1%)", parseFloat) + .option("--slippage ", "Slippage tolerance (e.g. 30 = 30%)", parseFloat) .option("--auto-slippage", "Enable automatic slippage") .option("--priority-fee ", "Priority fee in SOL (required for SOL chain)") .option("--tip-fee ", "Tip fee (required for SOL chain)")