Compare commits

...

7 Commits

Author SHA1 Message Date
yangzhenhui c6d55356a1 1.1.3 2026-03-26 19:10:15 +08:00
yangzhenhui 2c1c0210e7 1.1.2 2026-03-26 19:09:11 +08:00
yangzhenhui 71c239da39 Normalize GitHub repository URLs 2026-03-26 19:06:03 +08:00
yangzhenhui 0e5e5f8684 1.1.1 2026-03-26 17:42:42 +08:00
deepfeature b8bc81d915 Merge pull request #41 from GumpOnchain/feat/trenches-custom-body
feat(market): add structured options for trenches command
2026-03-26 17:09:48 +08:00
gumponchain 08b48c8e24 feat(market): add structured --type/--launchpad-platform/--limit options for trenches command
Replace raw --body JSON parameter with structured CLI flags for better AI agent readability.
Add full response key reference and SOL/BSC/Base examples to SKILL.md and docs.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 17:02:24 +08:00
deepfeature 5a8879c6d2 Merge pull request #40 from GMGNAI/codex-add-github-actions-workflows
Add GitHub Actions CI and release workflows
2026-03-26 16:51:31 +08:00
13 changed files with 215 additions and 29 deletions
+1 -1
View File
@@ -15,7 +15,7 @@
"name": "GMGN"
},
"homepage": "https://gmgn.ai",
"repository": "https://github.com/gmgn-ai/gmgn-skills",
"repository": "https://github.com/GMGNAI/gmgn-skills",
"license": "MIT",
"keywords": [
"gmgn",
+1 -1
View File
@@ -6,7 +6,7 @@
"name": "GMGN",
"url": "https://gmgn.ai"
},
"repository": "https://github.com/gmgn-ai/gmgn-skills",
"repository": "https://github.com/GMGNAI/gmgn-skills",
"license": "MIT",
"keywords": ["gmgn", "crypto", "solana", "token", "defi", "swap"],
"skills": "./skills/"
+1 -1
View File
@@ -12,7 +12,7 @@ Enable GMGN skills in Codex via native skill discovery. Just clone and symlink.
1. **Clone the repository:**
```bash
git clone https://github.com/gmgn-ai/gmgn-skills ~/.codex/gmgn-cli
git clone https://github.com/GMGNAI/gmgn-skills ~/.codex/gmgn-cli
```
2. **Create the skills symlink:**
+1 -1
View File
@@ -6,7 +6,7 @@
"name": "GMGN"
},
"homepage": "https://gmgn.ai",
"repository": "https://github.com/gmgn-ai/gmgn-skills",
"repository": "https://github.com/GMGNAI/gmgn-skills",
"license": "MIT",
"keywords": [
"gmgn",
+1 -1
View File
@@ -12,7 +12,7 @@ Enable GMGN skills in OpenCode via native skill discovery. Just clone and symlin
1. **Clone the repository:**
```bash
git clone https://github.com/gmgn-ai/gmgn-skills ~/.opencode/gmgn-cli
git clone https://github.com/GMGNAI/gmgn-skills ~/.opencode/gmgn-cli
```
2. **Register the plugin:**
+8 -2
View File
@@ -199,7 +199,7 @@ Skills are automatically discovered via the `.cursor-plugin/` configuration.
#### Codex CLI
```bash
git clone https://github.com/gmgn-ai/gmgn-skills ~/.codex/gmgn-cli
git clone https://github.com/GMGNAI/gmgn-skills ~/.codex/gmgn-cli
mkdir -p ~/.agents/skills
ln -s ~/.codex/gmgn-cli/skills ~/.agents/skills/gmgn-cli
```
@@ -209,7 +209,7 @@ See [.codex/INSTALL.md](.codex/INSTALL.md) for full instructions.
#### OpenCode
```bash
git clone https://github.com/gmgn-ai/gmgn-skills ~/.opencode/gmgn-cli
git clone https://github.com/GMGNAI/gmgn-skills ~/.opencode/gmgn-cli
mkdir -p ~/.agents/skills
ln -s ~/.opencode/gmgn-cli/skills ~/.agents/skills/gmgn-cli
```
@@ -277,6 +277,12 @@ npx gmgn-cli market trending \
--interval 1h \
--order-by volume --limit 20 \
--filter not_risk --filter not_honeypot
npx gmgn-cli market trenches \
--chain sol \
--type new_creation --type near_completion --type completed \
--launchpad-platform Pump.fun --launchpad-platform pump_mayhem --launchpad-platform letsbonk \
--limit 80
```
### Portfolio
+8 -2
View File
@@ -199,7 +199,7 @@ cp .env.example .env
#### Codex CLI
```bash
git clone https://github.com/gmgn-ai/gmgn-skills ~/.codex/gmgn-cli
git clone https://github.com/GMGNAI/gmgn-skills ~/.codex/gmgn-cli
mkdir -p ~/.agents/skills
ln -s ~/.codex/gmgn-cli/skills ~/.agents/skills/gmgn-cli
```
@@ -209,7 +209,7 @@ ln -s ~/.codex/gmgn-cli/skills ~/.agents/skills/gmgn-cli
#### OpenCode
```bash
git clone https://github.com/gmgn-ai/gmgn-skills ~/.opencode/gmgn-cli
git clone https://github.com/GMGNAI/gmgn-skills ~/.opencode/gmgn-cli
mkdir -p ~/.agents/skills
ln -s ~/.opencode/gmgn-cli/skills ~/.agents/skills/gmgn-cli
```
@@ -277,6 +277,12 @@ npx gmgn-cli market trending \
--interval 1h \
--order-by volume --limit 20 \
--filter not_risk --filter not_honeypot
npx gmgn-cli market trenches \
--chain sol \
--type new_creation --type near_completion --type completed \
--launchpad-platform Pump.fun --launchpad-platform pump_mayhem --launchpad-platform letsbonk \
--limit 80
```
### Portfolio
+5 -2
View File
@@ -260,14 +260,17 @@ npx gmgn-cli portfolio token-balance \
Query Trenches token lists (new creation, near completion, completed).
```bash
npx gmgn-cli market trenches --chain <chain> [--raw]
npx gmgn-cli market trenches --chain <chain> [--type <type...>] [--launchpad-platform <platform...>] [--limit <n>] [--raw]
```
| Option | Required | Description |
|--------|----------|-------------|
| `--chain` | Yes | `sol` / `bsc` / `base` |
| `--type` | No | Categories to query, repeatable: `new_creation` / `near_completion` / `completed` (default: all three) |
| `--launchpad-platform` | No | Launchpad platform filter, repeatable (default: all platforms for the chain) |
| `--limit` | No | Max results per category, max 80 (default: 80) |
**Response:** `data.new_creation`, `data.pump`, `data.completed` — each is an array of `RankItem` (same structure as `market trending` rank items).
**Response:** `data.new_creation`, `data.pump`, `data.completed` — each is an array of `RankItem` (same structure as `market trending` rank items). **Note: `data.pump` in the response corresponds to `--type near_completion` in the request. The API always returns this category under the key `pump`, not `near_completion`.**
---
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "gmgn-cli",
"version": "1.1.0",
"version": "1.1.3",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "gmgn-cli",
"version": "1.1.0",
"version": "1.1.3",
"license": "MIT",
"dependencies": {
"commander": "^12.1.0",
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "gmgn-cli",
"version": "1.1.0",
"version": "1.1.3",
"description": "GMGN OpenAPI CLI — call GMGN market, token, portfolio and swap APIs from the command line",
"type": "module",
"bin": {
@@ -36,7 +36,7 @@
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/gmgn-ai/gmgn-skills"
"url": "https://github.com/GMGNAI/gmgn-skills"
},
"keywords": [
"gmgn",
+169 -3
View File
@@ -141,12 +141,178 @@ For each token, offer:
| Parameter | Required | Description |
|-----------|----------|-------------|
| `--chain` | Yes | `sol` / `bsc` / `base` |
| `--type` | No | Categories to query, repeatable: `new_creation` / `near_completion` / `completed` (default: all three) |
| `--launchpad-platform` | No | Launchpad platform filter, repeatable (default: all platforms for the chain) |
| `--limit` | No | Max results per category, max 80 (default: 80) |
Response fields: `data.new_creation`, `data.pump`, `data.completed` — each is an array of `RankItem` (same fields as `market trending` rank items).
Response fields: `data.new_creation`, `data.pump`, `data.completed` — each is an array of `RankItem` (same fields as `market trending` rank items). **Important: `data.pump` in the response corresponds to `--type near_completion` in the request. The API always returns this category under the key `pump`, not `near_completion`.**
### Response Item Key Reference
**Basic Info**
| Field | Description |
|-------|-------------|
| `address` | Token contract address |
| `symbol` / `name` | Token symbol and name |
| `launchpad_platform` | Launch platform (e.g. `Pump.fun`, `letsbonk`) |
| `exchange` | Current exchange (e.g. `pump_amm`, `raydium`) |
| `usd_market_cap` | Market cap in USD |
| `liquidity` | Liquidity in USD |
| `total_supply` | Total token supply |
| `created_timestamp` | Creation time (Unix seconds) |
| `open_timestamp` | Open market listing time (Unix seconds, `completed` only) |
| `complete_timestamp` | Bonding curve completion time (Unix seconds) |
| `complete_cost_time` | Time from creation to completion in seconds |
**Trading Data**
| Field | Description |
|-------|-------------|
| `swaps_1m` / `swaps_1h` / `swaps_24h` | Swap count per time window |
| `volume_1h` / `volume_24h` | Trading volume in USD |
| `buys_24h` / `sells_24h` | Buy / sell count in 24h |
| `net_buy_24h` | Net buy volume in 24h |
| `holder_count` | Number of token holders |
**Security & Risk**
| Field | Chains | Description |
|-------|--------|-------------|
| `renounced_mint` | SOL | Whether mint authority is renounced (SOL-specific concept; always `false` on EVM chains) |
| `renounced_freeze_account` | SOL | Whether freeze authority is renounced (SOL-specific concept; always `false` on EVM chains) |
| `burn_status` | all | Liquidity burn status |
| `rug_ratio` | all | Rug pull risk ratio |
| `top_10_holder_rate` | all | Top 10 holders concentration ratio |
| `rat_trader_amount_rate` | all | Insider / sneak trading volume ratio |
| `bundler_trader_amount_rate` | all | Bundle trading volume ratio |
| `is_wash_trading` | all | Whether wash trading is detected |
| `sniper_count` | all | Number of sniper wallets |
| `suspected_insider_hold_rate` | all | Suspected insider holding ratio |
| `open_source` | all | Whether contract source code is verified (`"yes"` / `"no"` / `"unknown"`) |
| `owner_renounced` | all | Whether contract ownership is renounced (`"yes"` / `"no"` / `"unknown"`) |
| `is_honeypot` | BSC / Base | Whether token is a honeypot (`"yes"` / `"no"`); returns empty string on SOL (not applicable) |
| `buy_tax` | all | Buy tax ratio (e.g. `0.03` = 3%) |
| `dev_team_hold_rate` | all | Dev team holding ratio |
**Dev Holdings**
| Field | Description |
|-------|-------------|
| `creator_token_status` | Dev holding status (e.g. `creator_hold`, `creator_close`) |
| `creator_balance_rate` | Dev holding ratio as a proportion of total supply |
**Smart Money**
| Field | Description |
|-------|-------------|
| `smart_degen_count` | Number of smart money holders |
| `renowned_count` | Number of renowned wallet holders (KOL) |
**Social Media**
| Field | Description |
|-------|-------------|
| `twitter` | Twitter / X link |
| `telegram` | Telegram link |
| `website` | Website link |
| `instagram` | Instagram link |
| `tiktok` | TikTok link |
| `has_at_least_one_social` | Whether any social media link exists |
| `x_user_follower` | Twitter follower count |
| `cto_flag` | Whether community takeover (CTO) has occurred |
**Dexscreener Marketing**
| Field | Description |
|-------|-------------|
| `dexscr_ad` | Whether a Dexscreener ad has been placed |
| `dexscr_update_link` | Whether social links have been updated on Dexscreener |
| `dexscr_trending_bar` | Whether paid for Dexscreener trending bar placement |
| `dexscr_boost_fee` | Amount paid for Dexscreener boost (0 = none) |
### Solana Trenches Examples
```bash
# Trenches token lists on SOL
gmgn-cli market trenches --chain sol --raw
# All three categories at once
gmgn-cli market trenches --chain sol --raw \
--type new_creation --type near_completion --type completed \
--launchpad-platform Pump.fun --launchpad-platform pump_mayhem --launchpad-platform pump_mayhem_agent --launchpad-platform pump_agent --launchpad-platform letsbonk --launchpad-platform bonkers --launchpad-platform bags \
--limit 80
# New creation only
gmgn-cli market trenches --chain sol --raw \
--type new_creation \
--launchpad-platform Pump.fun --launchpad-platform pump_mayhem --launchpad-platform pump_mayhem_agent --launchpad-platform pump_agent --launchpad-platform letsbonk --launchpad-platform bonkers --launchpad-platform bags \
--limit 80
# Near completion only
gmgn-cli market trenches --chain sol --raw \
--type near_completion \
--launchpad-platform Pump.fun --launchpad-platform pump_mayhem --launchpad-platform pump_mayhem_agent --launchpad-platform pump_agent --launchpad-platform letsbonk --launchpad-platform bonkers --launchpad-platform bags \
--limit 80
# Completed (open market) only
gmgn-cli market trenches --chain sol --raw \
--type completed \
--launchpad-platform Pump.fun --launchpad-platform pump_mayhem --launchpad-platform pump_mayhem_agent --launchpad-platform pump_agent --launchpad-platform letsbonk --launchpad-platform bonkers --launchpad-platform bags \
--limit 80
```
### BSC Trenches Examples
```bash
# All three categories at once
gmgn-cli market trenches --chain bsc --raw \
--type new_creation --type near_completion --type completed \
--launchpad-platform fourmeme --launchpad-platform fourmeme_agent --launchpad-platform bn_fourmeme --launchpad-platform four_xmode_agent --launchpad-platform flap --launchpad-platform clanker --launchpad-platform lunafun \
--limit 80
# New creation only
gmgn-cli market trenches --chain bsc --raw \
--type new_creation \
--launchpad-platform fourmeme --launchpad-platform fourmeme_agent --launchpad-platform bn_fourmeme --launchpad-platform four_xmode_agent --launchpad-platform flap --launchpad-platform clanker --launchpad-platform lunafun \
--limit 80
# Near completion only
gmgn-cli market trenches --chain bsc --raw \
--type near_completion \
--launchpad-platform fourmeme --launchpad-platform fourmeme_agent --launchpad-platform bn_fourmeme --launchpad-platform four_xmode_agent --launchpad-platform flap --launchpad-platform clanker --launchpad-platform lunafun \
--limit 80
# Completed (open market) only
gmgn-cli market trenches --chain bsc --raw \
--type completed \
--launchpad-platform fourmeme --launchpad-platform fourmeme_agent --launchpad-platform bn_fourmeme --launchpad-platform four_xmode_agent --launchpad-platform flap --launchpad-platform clanker --launchpad-platform lunafun \
--limit 80
```
### Base Trenches Examples
```bash
# All three categories at once
gmgn-cli market trenches --chain base --raw \
--type new_creation --type near_completion --type completed \
--launchpad-platform clanker --launchpad-platform bankr --launchpad-platform flaunch --launchpad-platform zora --launchpad-platform zora_creator --launchpad-platform baseapp --launchpad-platform basememe --launchpad-platform virtuals_v2 --launchpad-platform klik \
--limit 80
# New creation only
gmgn-cli market trenches --chain base --raw \
--type new_creation \
--launchpad-platform clanker --launchpad-platform bankr --launchpad-platform flaunch --launchpad-platform zora --launchpad-platform zora_creator --launchpad-platform baseapp --launchpad-platform basememe --launchpad-platform virtuals_v2 --launchpad-platform klik \
--limit 80
# Near completion only
gmgn-cli market trenches --chain base --raw \
--type near_completion \
--launchpad-platform clanker --launchpad-platform bankr --launchpad-platform flaunch --launchpad-platform zora --launchpad-platform zora_creator --launchpad-platform baseapp --launchpad-platform basememe --launchpad-platform virtuals_v2 --launchpad-platform klik \
--limit 80
# Completed (open market) only
gmgn-cli market trenches --chain base --raw \
--type completed \
--launchpad-platform clanker --launchpad-platform bankr --launchpad-platform flaunch --launchpad-platform zora --launchpad-platform zora_creator --launchpad-platform baseapp --launchpad-platform basememe --launchpad-platform virtuals_v2 --launchpad-platform klik \
--limit 80
```
## Notes
+12 -10
View File
@@ -126,8 +126,8 @@ export class OpenApiClient {
return this.normalRequest("GET", "/v1/user/wallet_token_balance", { chain, wallet_address: walletAddress, token_address: tokenAddress });
}
async getTrenches(chain: string): Promise<unknown> {
const body = buildTrenchesBody(chain);
async getTrenches(chain: string, types?: string[], platforms?: string[], limit?: number): Promise<unknown> {
const body = buildTrenchesBody(chain, types, platforms, limit);
return this.normalRequest("POST", "/v1/trenches", { chain }, body);
}
@@ -330,21 +330,23 @@ const TRENCHES_QUOTE_ADDRESS_TYPES: Record<string, number[]> = {
base: [11, 3, 12, 13, 0],
};
function buildTrenchesBody(chain: string): Record<string, unknown> {
const launchpad_platform = TRENCHES_PLATFORMS[chain] ?? [];
function buildTrenchesBody(chain: string, types?: string[], platforms?: string[], limit?: number): Record<string, unknown> {
const selectedTypes = types?.length ? types : ["new_creation", "near_completion", "completed"];
const launchpad_platform = platforms?.length ? platforms : (TRENCHES_PLATFORMS[chain] ?? []);
const quote_address_type = TRENCHES_QUOTE_ADDRESS_TYPES[chain] ?? [];
const actualLimit = limit ?? 80;
const section = {
filters: ["offchain", "onchain"],
launchpad_platform,
quote_address_type,
launchpad_platform_v2: true,
limit: actualLimit,
};
return {
new_creation: { ...section, limit: 60 },
near_completion: { ...section, limit: 120 },
completed: { ...section, limit: 60 },
version: "v2",
};
const body: Record<string, unknown> = { version: "v2" };
for (const type of selectedTypes) {
body[type] = { ...section };
}
return body;
}
function buildUrl(base: string, query: Record<string, string | number | string[]>): string {
+4 -1
View File
@@ -61,11 +61,14 @@ export function registerMarketCommands(program: Command): void {
.command("trenches")
.description("Get Trenches token data (new creation, near completion, completed)")
.requiredOption("--chain <chain>", "Chain: sol / bsc / base")
.option("--type <type...>", "Categories to query, repeatable: new_creation / near_completion / completed (default: all three)")
.option("--launchpad-platform <platform...>", "Launchpad platform filter, repeatable (default: all platforms for the chain)")
.option("--limit <n>", "Max results per category, max 80 (default: 80)", parseInt)
.option("--raw", "Output raw JSON")
.action(async (opts) => {
validateChain(opts.chain);
const client = new OpenApiClient(getConfig());
const data = await client.getTrenches(opts.chain).catch(exitOnError);
const data = await client.getTrenches(opts.chain, opts.type, opts.launchpadPlatform, opts.limit).catch(exitOnError);
printResult(data, opts.raw);
});
}