gmgn-cli 1.5.1 → 1.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +8 -4
- package/.claude-plugin/plugin.json +2 -2
- package/Readme.md +6 -3
- package/Readme.zh.md +6 -3
- package/dist/client/OpenApiClient.js +14 -2
- package/dist/client/OpenApiClient.js.map +1 -1
- package/dist/commands/cooking.d.ts.map +1 -1
- package/dist/commands/cooking.js +27 -14
- package/dist/commands/cooking.js.map +1 -1
- package/dist/commands/market.js +3 -3
- package/dist/commands/market.js.map +1 -1
- package/dist/commands/swap.d.ts.map +1 -1
- package/dist/commands/swap.js +38 -0
- package/dist/commands/swap.js.map +1 -1
- package/dist/commands/track.d.ts.map +1 -1
- package/dist/commands/track.js +2 -10
- package/dist/commands/track.js.map +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +24 -1
- package/dist/config.js.map +1 -1
- package/dist/confirm.d.ts +35 -0
- package/dist/confirm.d.ts.map +1 -0
- package/dist/confirm.js +111 -0
- package/dist/confirm.js.map +1 -0
- package/dist/output.d.ts.map +1 -1
- package/dist/output.js +15 -2
- package/dist/output.js.map +1 -1
- package/dist/sanitize.d.ts +56 -0
- package/dist/sanitize.d.ts.map +1 -0
- package/dist/sanitize.js +0 -0
- package/dist/sanitize.js.map +1 -0
- package/package.json +1 -1
- package/skills/gmgn-cooking/SKILL.md +24 -12
- package/skills/gmgn-holder-analysis/SKILL.md +808 -0
- package/skills/gmgn-holder-analysis/analyze.py +674 -0
- package/skills/gmgn-market/SKILL.md +4 -4
- package/skills/gmgn-swap/SKILL.md +13 -0
- package/skills/gmgn-token/SKILL.md +2 -0
- package/skills/gmgn-track/SKILL.md +1 -3
- package/skills/gmgn-wallet-score/SKILL.md +552 -0
|
@@ -0,0 +1,552 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gmgn-wallet-score
|
|
3
|
+
description: Score any wallet address across three angles — profitability (a real track-record score: is this trader actually good?), copy-tradeability (can YOU actually capture what it makes, plus a latency/slippage/gas backtest), and Dev reputation (if it's mostly a token launcher, how trustworthy are its launches) — plus trading-style tags, all computed deterministically from GMGN portfolio data. Use when the user asks about a wallet's profitability ("这个钱包盈利能力怎么样", "钱包战绩怎么样", "is this wallet profitable"), copy-trade worthiness ("is this wallet worth following", "跟单评分", "钱包评分", "值不值得跟单", "if I copy this wallet what's my real return"), or token-launch/Dev reputation ("这个钱包发盘情况怎么样", "是不是发币方钱包", "dev 信誉怎么样", "is this a token-creator wallet"), or gives a wallet address and wants any of these judgments.
|
|
4
|
+
argument-hint: "--chain <sol|bsc|base|eth|robinhood> --wallet <wallet_address> [--latency <seconds>] [--slippage <pct>] [--gas <usd>] [--sample <n>]"
|
|
5
|
+
metadata:
|
|
6
|
+
cliHelp: "gmgn-cli portfolio stats --help && gmgn-cli portfolio activity --help && gmgn-cli portfolio created-tokens --help && gmgn-cli token security --help"
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
**BEFORE RUNNING ANY COMMAND: Run `gmgn-cli config --check`. If exit code is 0, proceed normally. If exit code is 1, (1) run `gmgn-cli config` and show the output to the user; (2) once the user sends the API Key, run `gmgn-cli config --apply <KEY>` to complete configuration and verification, then show the output to the user. If `--check` returns an error (unknown option or command not found), tell the user to run `npm install -g gmgn-cli` to update, then retry.**
|
|
10
|
+
|
|
11
|
+
**IMPORTANT: Always use `gmgn-cli` commands. Do NOT use web search, WebFetch, curl, or visit gmgn.ai — the website requires login and does not expose structured data.**
|
|
12
|
+
|
|
13
|
+
**IMPORTANT: Do NOT guess field names or values. Fields not listed in [Field Reference](#field-reference) below have not been confirmed against the live API — if the script's defensive lookups come back empty for them, degrade gracefully (see [Notes](#notes)) rather than inventing a value.**
|
|
14
|
+
|
|
15
|
+
**⚠️ IPv6 NOT SUPPORTED: If you get a `401` or `403` error and credentials look correct, check for IPv6 immediately: (1) list all network interfaces and their IPv6 addresses — run `ifconfig | grep inet6` (macOS) or `ip addr show | grep inet6` (Linux); (2) send a test request to `https://ipv6.icanhazip.com` — if the response is an IPv6 address, outbound traffic is going via IPv6. Tell the user immediately: "Please disable IPv6 on your network interface — gmgn-cli commands only work over IPv4."**
|
|
16
|
+
|
|
17
|
+
When the user gives a wallet address, extract `--chain` and `--wallet` from their message, then run the analysis script below — it computes all three angles (profitability, copy-tradeability, Dev reputation) from a single shared data pull, regardless of which one the user actually asked about. Also detect the user's language: set `LANG` to `'zh'` if the user wrote in Chinese, `'en'` if in English (default `'zh'`). Ask for `--latency` / `--slippage` / `--gas` only if the user wants a customized backtest — otherwise use the defaults baked into the script. Once the script runs, decide which section to lead with in your reply — see [Framing the Report by Question](#framing-the-report-by-question) below.
|
|
18
|
+
|
|
19
|
+
## Core Concepts
|
|
20
|
+
|
|
21
|
+
This skill deliberately splits "is this trader good?" from "can you copy it?" — a wallet can be great at trading and terrible to copy, or mediocre at trading but easy to ride along with:
|
|
22
|
+
|
|
23
|
+
- **Track-record score (0–100)** — Is this trader actually good, judged by outcome distribution, not just win rate. A wallet with a 30% win rate can still score high here if it cuts losses hard and the 30% that win pay for the rest — that's disciplined risk management, not luck.
|
|
24
|
+
- **Copy-tradeability score (0–100)** — Even if the wallet is genuinely skilled, can *you* capture that edge? A wallet that snipes sub-$100k market caps or round-trips in 5 seconds is not copyable — by the time your transaction lands, the wallet has already exited and you're the exit liquidity. This score penalizes early entries, thin per-trade margins, ultra-short holds, and bot-tier trade frequency.
|
|
25
|
+
- **Backtest estimate** — A concrete "what you'd actually keep" number: the wallet's raw return minus your entry-latency price drift, minus round-trip slippage, minus gas — using the latency/slippage/gas the user specifies (or sane defaults).
|
|
26
|
+
- **Dev-reputation score** — Only computed when the wallet is itself a token creator (its `created_token_count` exceeds half its traded-token count — i.e. it's mostly launching, not trading). Judges the wallet as a *developer*: survival rate of tokens it created, how many are stuck on the bonding curve and never graduated, and whether its recent launches passed a basic security check. When this applies, entry-timing / win-rate factors are unreliable (the wallet controls its own token's price and holder list) — the track-record and copy-tradeability scores are shown at a steep discount, and the verdict pivots to Dev reputation instead.
|
|
27
|
+
- **No trading history** — If the wallet has zero buy/sell transactions in the sampled period (only transfers/airdrops), none of the above can be computed honestly. The script detects this and reports it plainly instead of forcing a score onto empty data.
|
|
28
|
+
|
|
29
|
+
## Framing the Report by Question
|
|
30
|
+
|
|
31
|
+
This skill answers three related but distinct questions from **one shared data pull** — always run the full [Analysis Script](#analysis-script) regardless of which angle the user asked about; the underlying `portfolio stats` / `activity` / `created-tokens` / `token security` calls don't change, only what you lead with in your reply does. Never re-run the script per angle — that just burns extra rate-limit budget for data you already have.
|
|
32
|
+
|
|
33
|
+
| User's question | Lead with | Still mention, briefer |
|
|
34
|
+
|---|---|---|
|
|
35
|
+
| Profitability — "这个钱包盈利能力怎么样", "钱包战绩怎么样", "is this wallet profitable" | 🎯 Track-Record Score + factors | Style tags. Skip the backtest and Dev section unless the wallet turns out to be a Dev (see below) |
|
|
36
|
+
| Copy-trade worthiness — "值不值得跟单", "is this wallet worth copying", "if I copy this wallet what's my real return" | 🚀 Copy-Tradeability Score + 🧮 Backtest | Track-Record score as context, and the final Verdict |
|
|
37
|
+
| Dev/launch reputation — "这个钱包发盘情况怎么样", "是不是发币方钱包", "dev 信誉怎么样", "is this a token-creator wallet" | 👨💻 Dev-Reputation section | That this discounts the other two scores (self-dealing) — no need to walk through their factors in detail |
|
|
38
|
+
| Generic — "帮我看看这个钱包", "钱包评分", an address with no specific angle | The full report, all sections | — |
|
|
39
|
+
|
|
40
|
+
**Safety override**: if the user asked a Profitability or Copy-tradeability question but the wallet turns out to be classified as a Dev wallet (`dev is not None`), still surface the Dev-Reputation section and the self-dealing discount notice up front — a wallet that mostly launches tokens needs that caveat regardless of which angle was asked, since it changes how much the other two scores can be trusted.
|
|
41
|
+
|
|
42
|
+
## Analysis Script
|
|
43
|
+
|
|
44
|
+
Run this Python script inline, replacing the `<FILL_IN_*>` placeholders with the actual values. `LATENCY_S` / `SLIPPAGE_PCT` / `GAS_USD` / `SAMPLE` default to `3.0` / `0.05` / `0.2` / `200` if the user didn't specify — pass those literals when unspecified.
|
|
45
|
+
|
|
46
|
+
```python
|
|
47
|
+
python3 << 'PYEOF'
|
|
48
|
+
import json, math, subprocess
|
|
49
|
+
|
|
50
|
+
CHAIN = "<FILL_IN_CHAIN>"
|
|
51
|
+
WALLET = "<FILL_IN_WALLET_ADDRESS>"
|
|
52
|
+
LANG = "<FILL_IN_LANG>" # 'zh' or 'en'
|
|
53
|
+
LATENCY_S = <FILL_IN_LATENCY> # seconds you'd lag entering after this wallet (default 3.0)
|
|
54
|
+
SLIPPAGE_PCT = <FILL_IN_SLIPPAGE> # one-sided slippage fraction, e.g. 0.05 = 5% (default 0.05)
|
|
55
|
+
GAS_USD = <FILL_IN_GAS> # your cost per trade in USD (default 0.2)
|
|
56
|
+
SAMPLE = <FILL_IN_SAMPLE> # activity rows to sample, max 400 (default 200)
|
|
57
|
+
|
|
58
|
+
ZH = (LANG == 'zh')
|
|
59
|
+
def _(zh, en): return zh if ZH else en
|
|
60
|
+
|
|
61
|
+
def run_cli(args, timeout=30):
|
|
62
|
+
r = subprocess.run(['gmgn-cli'] + args + ['--raw'], capture_output=True, text=True, timeout=timeout)
|
|
63
|
+
if r.returncode != 0:
|
|
64
|
+
raise RuntimeError(r.stderr)
|
|
65
|
+
return json.loads(r.stdout)
|
|
66
|
+
|
|
67
|
+
def unwrap(resp):
|
|
68
|
+
# gmgn-cli --raw already unwraps to the data object; tolerate either shape.
|
|
69
|
+
return resp.get('data', resp) if isinstance(resp, dict) and 'data' in resp else resp
|
|
70
|
+
|
|
71
|
+
def _f(v, default=0.0):
|
|
72
|
+
try: return float(v)
|
|
73
|
+
except (TypeError, ValueError): return default
|
|
74
|
+
|
|
75
|
+
def _clamp(x, lo=0.0, hi=1.0):
|
|
76
|
+
return lo if x < lo else hi if x > hi else x
|
|
77
|
+
|
|
78
|
+
def _b(v):
|
|
79
|
+
if isinstance(v, bool): return v
|
|
80
|
+
if isinstance(v, (int, float)): return v != 0
|
|
81
|
+
if isinstance(v, str): return v.strip().lower() in ('1', 'true', 'yes')
|
|
82
|
+
return False
|
|
83
|
+
|
|
84
|
+
def fmt_dur(sec):
|
|
85
|
+
sec = _f(sec)
|
|
86
|
+
if sec < 60: return f"{int(sec)}{_(' 秒','s')}"
|
|
87
|
+
if sec < 3600: return f"{round(sec/60)}{_(' 分','m')}"
|
|
88
|
+
if sec < 86400: return f"{round(sec/3600,1)}{_(' 小时','h')}"
|
|
89
|
+
return f"{round(sec/86400,1)}{_(' 天','d')}"
|
|
90
|
+
|
|
91
|
+
def usd(v):
|
|
92
|
+
v = _f(v)
|
|
93
|
+
if abs(v) >= 1_000_000: return f"${v/1_000_000:.2f}M"
|
|
94
|
+
if abs(v) >= 1_000: return f"${v/1_000:.1f}K"
|
|
95
|
+
return f"${v:.2f}"
|
|
96
|
+
|
|
97
|
+
# ── 1. Trading stats (7D) ─────────────────────────────────
|
|
98
|
+
stats_raw = unwrap(run_cli(['portfolio', 'stats', '--chain', CHAIN, '--wallet', WALLET, '--period', '7d']))
|
|
99
|
+
pnl = stats_raw.get('pnl_stat') or {}
|
|
100
|
+
common = stats_raw.get('common') or {}
|
|
101
|
+
|
|
102
|
+
buy = int(_f(stats_raw.get('buy', stats_raw.get('buy_count'))))
|
|
103
|
+
sell = int(_f(stats_raw.get('sell', stats_raw.get('sell_count'))))
|
|
104
|
+
trades = buy + sell
|
|
105
|
+
token_num = int(_f(pnl.get('token_num')))
|
|
106
|
+
dist = dict(
|
|
107
|
+
gt_5 = int(_f(pnl.get('pnl_gt_5x_num'))),
|
|
108
|
+
x2_5 = int(_f(pnl.get('pnl_2x_5x_num'))),
|
|
109
|
+
x0_2 = int(_f(pnl.get('pnl_0x_2x_num'))),
|
|
110
|
+
n50_0 = int(_f(pnl.get('pnl_nd5_0x_num'))),
|
|
111
|
+
lt_n50 = int(_f(pnl.get('pnl_lt_nd5_num'))),
|
|
112
|
+
)
|
|
113
|
+
realized_profit = _f(stats_raw.get('realized_profit'))
|
|
114
|
+
bought_cost = _f(stats_raw.get('bought_cost', stats_raw.get('total_cost')))
|
|
115
|
+
created_token_count = int(_f(common.get('created_token_count')))
|
|
116
|
+
|
|
117
|
+
w = dict(
|
|
118
|
+
realized_profit=realized_profit,
|
|
119
|
+
roi=_f(stats_raw.get('realized_profit_pnl', stats_raw.get('pnl'))),
|
|
120
|
+
buy=buy, sell=sell, trades=trades,
|
|
121
|
+
bought_cost=bought_cost,
|
|
122
|
+
avg_buy_usd=(bought_cost / buy if buy else 0.0),
|
|
123
|
+
avg_trade_usd=(realized_profit / sell if sell else 0.0),
|
|
124
|
+
token_num=token_num, winrate=_f(pnl.get('winrate')), dist=dist,
|
|
125
|
+
avg_hold_s=_f(pnl.get('avg_holding_period')),
|
|
126
|
+
created_token_count=created_token_count,
|
|
127
|
+
identity=common.get('twitter_name') or common.get('name') or common.get('ens') or '',
|
|
128
|
+
)
|
|
129
|
+
|
|
130
|
+
if trades == 0:
|
|
131
|
+
print(_( "该地址近 7 天没有真实买卖记录(可能是新钱包,或持有的代币是转入/空投所得)——无法评估战绩,跳过打分。",
|
|
132
|
+
"This address has no real buy/sell activity in the last 7 days (may be a new wallet, or its holdings were transferred/airdropped in) — not enough data to score, skipping."))
|
|
133
|
+
raise SystemExit(0)
|
|
134
|
+
|
|
135
|
+
# ── 2. Activity sample (paginated, most-recent-first) ─────
|
|
136
|
+
def sample_activity(target):
|
|
137
|
+
target = max(20, min(int(target or 200), 400))
|
|
138
|
+
acts, cursor = [], None
|
|
139
|
+
for _try in range(4):
|
|
140
|
+
args = ['portfolio', 'activity', '--chain', CHAIN, '--wallet', WALLET,
|
|
141
|
+
'--limit', str(min(100, target - len(acts)))]
|
|
142
|
+
if cursor: args += ['--cursor', str(cursor)]
|
|
143
|
+
raw = unwrap(run_cli(args))
|
|
144
|
+
page = raw.get('activities') or []
|
|
145
|
+
acts.extend(page)
|
|
146
|
+
cursor = raw.get('next')
|
|
147
|
+
if not cursor or not page or len(acts) >= target:
|
|
148
|
+
break
|
|
149
|
+
return acts[:target]
|
|
150
|
+
|
|
151
|
+
acts = sample_activity(SAMPLE)
|
|
152
|
+
|
|
153
|
+
def ev_type(a):
|
|
154
|
+
return (a.get('event_type') or a.get('type') or '').lower()
|
|
155
|
+
|
|
156
|
+
mcaps = []
|
|
157
|
+
for a in acts:
|
|
158
|
+
if ev_type(a) != 'buy':
|
|
159
|
+
continue
|
|
160
|
+
tok = a.get('token') or {}
|
|
161
|
+
supply = _f(tok.get('total_supply'))
|
|
162
|
+
px = _f(a.get('price_usd'))
|
|
163
|
+
if supply > 0 and px > 0:
|
|
164
|
+
mcaps.append(px * supply)
|
|
165
|
+
mcaps.sort()
|
|
166
|
+
has_mcap_data = bool(mcaps)
|
|
167
|
+
entry_under_100k = (sum(1 for m in mcaps if m < 100_000) / len(mcaps)) if mcaps else 0.0
|
|
168
|
+
median_entry_mcap = mcaps[len(mcaps) // 2] if mcaps else 0.0
|
|
169
|
+
|
|
170
|
+
by_tok = {}
|
|
171
|
+
for a in acts:
|
|
172
|
+
addr = (a.get('token') or {}).get('address')
|
|
173
|
+
by_tok.setdefault(addr, []).append(a)
|
|
174
|
+
pairs = fast = 0
|
|
175
|
+
for evs in by_tok.values():
|
|
176
|
+
evs = sorted(evs, key=lambda e: _f(e.get('timestamp')))
|
|
177
|
+
last_buy = None
|
|
178
|
+
for e in evs:
|
|
179
|
+
et = ev_type(e)
|
|
180
|
+
if et == 'buy':
|
|
181
|
+
last_buy = _f(e.get('timestamp'))
|
|
182
|
+
elif et == 'sell' and last_buy is not None:
|
|
183
|
+
pairs += 1
|
|
184
|
+
if _f(e.get('timestamp')) - last_buy <= 5:
|
|
185
|
+
fast += 1
|
|
186
|
+
last_buy = None
|
|
187
|
+
fast_flip_rate = round(fast / pairs, 4) if pairs else 0.0
|
|
188
|
+
|
|
189
|
+
gas_vals = [_f(a.get('gas_usd')) for a in acts if _f(a.get('gas_usd')) > 0]
|
|
190
|
+
has_gas_data = bool(gas_vals)
|
|
191
|
+
avg_gas_usd = round(sum(gas_vals) / len(gas_vals), 4) if gas_vals else 0.0
|
|
192
|
+
|
|
193
|
+
summ = dict(sampled=len(acts), entry_under_100k=round(entry_under_100k, 4),
|
|
194
|
+
median_entry_mcap=round(median_entry_mcap, 2),
|
|
195
|
+
fast_flip_rate=fast_flip_rate, avg_gas_usd=avg_gas_usd)
|
|
196
|
+
|
|
197
|
+
# ── 3. Dev-reputation (only if this wallet mostly launches, not trades) ──
|
|
198
|
+
DEV_SEC_SCAN_N = 3 # how many of its most recent launches to security-scan
|
|
199
|
+
is_dev_wallet = created_token_count > 0 and created_token_count > 0.5 * max(1, token_num)
|
|
200
|
+
|
|
201
|
+
dev = None
|
|
202
|
+
if is_dev_wallet:
|
|
203
|
+
try:
|
|
204
|
+
ct = unwrap(run_cli(['portfolio', 'created-tokens', '--chain', CHAIN, '--wallet', WALLET]))
|
|
205
|
+
toks = ct.get('tokens') or []
|
|
206
|
+
open_count = int(_f(ct.get('open_count')))
|
|
207
|
+
inner_count = int(_f(ct.get('inner_count')))
|
|
208
|
+
if toks or open_count or inner_count:
|
|
209
|
+
# alive = graduated to DEX AND still has real liquidity (not drained)
|
|
210
|
+
alive = sum(1 for t in toks if t.get('is_open') and _f(t.get('pool_liquidity')) >= 4000)
|
|
211
|
+
total = len(toks)
|
|
212
|
+
rug_rate = round((total - alive) / total, 3) if total else 0.0
|
|
213
|
+
ath_mc = _f((ct.get('creator_ath_info') or {}).get('ath_mc'))
|
|
214
|
+
|
|
215
|
+
recent = sorted(toks, key=lambda t: -_f(t.get('create_timestamp')))[:DEV_SEC_SCAN_N]
|
|
216
|
+
checked = unsafe = 0
|
|
217
|
+
for t in recent:
|
|
218
|
+
addr = t.get('token_address')
|
|
219
|
+
if not addr:
|
|
220
|
+
continue
|
|
221
|
+
try:
|
|
222
|
+
sec = unwrap(run_cli(['token', 'security', '--chain', CHAIN, '--address', addr]))
|
|
223
|
+
except Exception:
|
|
224
|
+
continue
|
|
225
|
+
checked += 1
|
|
226
|
+
bad = False
|
|
227
|
+
if str(sec.get('is_honeypot', '')).lower() == 'yes':
|
|
228
|
+
bad = True
|
|
229
|
+
elif CHAIN == 'sol':
|
|
230
|
+
if not _b(sec.get('renounced_mint')) or not _b(sec.get('renounced_freeze_account')):
|
|
231
|
+
bad = True
|
|
232
|
+
else:
|
|
233
|
+
if str(sec.get('open_source', '')).lower() == 'no':
|
|
234
|
+
bad = True
|
|
235
|
+
if bad:
|
|
236
|
+
unsafe += 1
|
|
237
|
+
sec_risk_rate = round(unsafe / checked, 3) if checked else 0.0
|
|
238
|
+
|
|
239
|
+
surv = (1.0 - rug_rate) if total else _clamp(_f(ct.get('open_ratio')))
|
|
240
|
+
ath_track = _clamp((math.log10(max(1.0, ath_mc)) - 5.0) / 2.0) # $100k→0, $10M→1
|
|
241
|
+
s = 0.25 + 0.55 * surv
|
|
242
|
+
s -= 0.30 * _clamp((inner_count - 50) / 950.0) # heavy bonding-curve pileup = factory
|
|
243
|
+
s += 0.15 * ath_track * surv # best-ever launch, gated by survival
|
|
244
|
+
s -= 0.35 * sec_risk_rate # recent launches failed a security check
|
|
245
|
+
dev = dict(open_count=open_count, inner_count=inner_count,
|
|
246
|
+
analyzed=total, alive=alive, rugged=max(0, total - alive),
|
|
247
|
+
rug_rate=rug_rate, ath_mc=ath_mc,
|
|
248
|
+
sec_checked=checked, sec_unsafe=unsafe, sec_risk_rate=sec_risk_rate,
|
|
249
|
+
score=round(_clamp(s), 3))
|
|
250
|
+
except Exception:
|
|
251
|
+
dev = None
|
|
252
|
+
|
|
253
|
+
# ── 4. Style tags ──────────────────────────────────────────
|
|
254
|
+
tags = []
|
|
255
|
+
def add_tag(emoji, zh, en):
|
|
256
|
+
tags.append(dict(emoji=emoji, text=_(zh, en)))
|
|
257
|
+
|
|
258
|
+
tn = max(1, token_num)
|
|
259
|
+
big_win = (dist['gt_5'] + dist['x2_5']) / tn
|
|
260
|
+
big_loss = dist['lt_n50'] / tn
|
|
261
|
+
early, flip = summ['entry_under_100k'], summ['fast_flip_rate']
|
|
262
|
+
|
|
263
|
+
if dev is not None:
|
|
264
|
+
pct_created = round(created_token_count / tn * 100)
|
|
265
|
+
cnt = created_token_count or dev.get('analyzed', 0)
|
|
266
|
+
rug = dev.get('rug_rate', 0.0)
|
|
267
|
+
if rug >= 0.5:
|
|
268
|
+
add_tag("🏭", f"发币方/Dev:发过 {cnt} 个币(占交易{min(pct_created,100)}%+),rug 率 {round(rug*100)}%(工厂号嫌疑)",
|
|
269
|
+
f"Token creator/Dev: launched {cnt} tokens (≥{min(pct_created,100)}% of traded tokens), rug rate {round(rug*100)}% (factory suspect)")
|
|
270
|
+
else:
|
|
271
|
+
add_tag("🏭", f"发币方/Dev:发过 {cnt} 个币(占交易{min(pct_created,100)}%+),看 Dev 信誉分",
|
|
272
|
+
f"Token creator/Dev: launched {cnt} tokens (≥{min(pct_created,100)}% of traded tokens) — check the Dev-reputation score")
|
|
273
|
+
add_tag("🏗️", f"自产自销:交易的币里 {min(pct_created,100)}%+ 是自己发的——进场时机/胜率对这类币没意义",
|
|
274
|
+
f"Self-dealer: ≥{min(pct_created,100)}% of traded tokens are its own launches — entry-timing/win-rate tags are meaningless here")
|
|
275
|
+
if trades >= 2000:
|
|
276
|
+
add_tag("🤖", f"机器人/科学家:7D {trades} 笔,只能机器跟", f"Bot/Quant: {trades} trades in 7D — only a bot can keep up")
|
|
277
|
+
if flip >= 0.3:
|
|
278
|
+
add_tag("⚡", f"闪电手:{round(flip*100)}% 的仓位 5 秒内买卖", f"Flash flipper: {round(flip*100)}% of positions bought & sold within 5s")
|
|
279
|
+
if dev is None and early >= 0.8:
|
|
280
|
+
add_tag("🎯", f"狙击手:{round(early*100)}% 进场市值 <$100k", f"Sniper: {round(early*100)}% of entries are <$100k mcap")
|
|
281
|
+
if w['avg_hold_s'] >= 5*86400 and trades < 200:
|
|
282
|
+
add_tag("💎", "钻石手:持仓久、下手少", "Diamond hands: holds long, trades rarely")
|
|
283
|
+
if w['avg_buy_usd'] >= 5000:
|
|
284
|
+
add_tag("🐋", f"巨鲸:单笔平均建仓 {usd(w['avg_buy_usd'])}", f"Whale: avg position size {usd(w['avg_buy_usd'])}")
|
|
285
|
+
if dev is None and w['winrate'] >= 0.65 and trades >= 15:
|
|
286
|
+
add_tag("🏆", f"高胜率:{round(w['winrate']*100)}% 的币最终是赚的", f"High win-rate: {round(w['winrate']*100)}% of tokens ended up profitable")
|
|
287
|
+
if 0 < w['avg_hold_s'] < 3600 and flip < 0.3 and trades >= 30:
|
|
288
|
+
add_tag("🐇", f"快枪手:平均持仓 {fmt_dur(w['avg_hold_s'])}", f"Quick-draw: avg hold {fmt_dur(w['avg_hold_s'])}")
|
|
289
|
+
if dev is None and 0 < summ['median_entry_mcap'] < 30000:
|
|
290
|
+
add_tag("🔦", f"冷门捡漏:中位进场市值仅 {usd(summ['median_entry_mcap'])}", f"Obscure hunter: median entry mcap only {usd(summ['median_entry_mcap'])}")
|
|
291
|
+
if w['realized_profit'] > 20000 and big_loss <= 0.05:
|
|
292
|
+
add_tag("📈", "真高手:净赚且极少大亏,止损纪律好", "True skill: net profitable with very few big losses")
|
|
293
|
+
elif big_loss >= 0.3 and w['realized_profit'] < 0:
|
|
294
|
+
add_tag("🩸", f"亏损韭菜:{round(big_loss*100)}% 的币亏超 50%,长期净亏", f"Bag holder: {round(big_loss*100)}% of tokens lost over 50%")
|
|
295
|
+
elif big_win >= 0.02 and w['winrate'] < 0.35 and w['realized_profit'] > 0:
|
|
296
|
+
add_tag("🎰", "赌狗打法:胜率低但靠少数暴击回本", "Gambler: low win-rate, carried by a few huge hits")
|
|
297
|
+
if trades < 60 and w['realized_profit'] > 0 and flip < 0.1:
|
|
298
|
+
add_tag("🐌", "慢工出细活:低频、可复制,最适合跟单", "Slow & steady: low frequency, repeatable — easiest to copy")
|
|
299
|
+
if not tags:
|
|
300
|
+
add_tag("🧭", "普通交易者:没有特别突出的风格标签", "Regular trader: no standout style tags")
|
|
301
|
+
|
|
302
|
+
# ── 5. Track-record score (is this trader actually good?) ──
|
|
303
|
+
TRACK_W = dict(tail=0.34, upside=0.28, roi=0.16, win=0.10, size=0.12)
|
|
304
|
+
tail_f = 1 - dist['lt_n50'] / tn
|
|
305
|
+
upside_f = (dist['gt_5'] + dist['x2_5'] + dist['x0_2']) / tn
|
|
306
|
+
roi_f = _clamp((w['roi'] + 0.05) / 0.35)
|
|
307
|
+
win_f = _clamp(w['winrate'] / 0.5)
|
|
308
|
+
size_f = _clamp((tn - 20) / 300)
|
|
309
|
+
track_facs = dict(tail=tail_f, upside=upside_f, roi=roi_f, win=win_f, size=size_f)
|
|
310
|
+
track_score = round(100 * sum(TRACK_W[k] * _clamp(v) for k, v in track_facs.items()))
|
|
311
|
+
TRACK_LABELS = dict(tail=_('止损纪律','Stop-loss discipline'), upside=_('盈利面','Profit share'),
|
|
312
|
+
roi=_('资金回报','Capital ROI'), win=_('胜率','Win rate'), size=_('样本量','Sample size'))
|
|
313
|
+
|
|
314
|
+
# ── 6. Copy-tradeability score (can YOU capture it?) ────────
|
|
315
|
+
COPY_W = dict(entry=0.22, profit=0.22, hold=0.20, feasible=0.18, edge=0.18)
|
|
316
|
+
entry_f = _clamp(0.12 + (1 - summ['entry_under_100k']))
|
|
317
|
+
profit_f = _clamp(w['avg_trade_usd'] / 80.0)
|
|
318
|
+
hold_f = _clamp((1 - summ['fast_flip_rate'] * 1.6) * _clamp(w['avg_hold_s'] / 172800 + 0.15))
|
|
319
|
+
feasible_f = _clamp(1 - w['trades'] / 2500.0)
|
|
320
|
+
edge_f = _clamp(1 - 0.6 * summ['entry_under_100k'] - 0.6 * summ['fast_flip_rate'])
|
|
321
|
+
copy_facs = dict(entry=entry_f, profit=profit_f, hold=hold_f, feasible=feasible_f, edge=edge_f)
|
|
322
|
+
copy_score = round(100 * sum(COPY_W[k] * v for k, v in copy_facs.items()))
|
|
323
|
+
COPY_LABELS = dict(entry=_('进场市值','Entry mcap'), profit=_('单笔利润空间','Profit per trade'),
|
|
324
|
+
hold=_('持仓 vs 延迟','Hold vs latency'), feasible=_('执行可行性','Execution feasibility'),
|
|
325
|
+
edge=_('优势类型','Edge type'))
|
|
326
|
+
|
|
327
|
+
# Self-dealing discount: for a dev wallet, entry-timing/win-rate factors are self-authored — steeply
|
|
328
|
+
# discount both display scores (not hidden, just flagged) rather than let them look falsely strong.
|
|
329
|
+
SELF_DEAL_DISCOUNT = 0.45
|
|
330
|
+
self_dealing = dev is not None
|
|
331
|
+
track_disp = round(track_score * SELF_DEAL_DISCOUNT) if self_dealing else track_score
|
|
332
|
+
copy_disp = round(copy_score * SELF_DEAL_DISCOUNT) if self_dealing else copy_score
|
|
333
|
+
|
|
334
|
+
# ── 7. Copy-trade backtest ───────────────────────────────────
|
|
335
|
+
wallet_pct = (w['realized_profit'] / w['bought_cost']) if w['bought_cost'] > 0 else w['roi']
|
|
336
|
+
wallet_pct = _clamp(wallet_pct or 0.0001, -0.9, 3.0) # clamp: dev wallets have near-zero bought_cost, ratio blows up
|
|
337
|
+
LOW_MCAP_DRIFT_PER_S = 0.015
|
|
338
|
+
drift_per_s = LOW_MCAP_DRIFT_PER_S * (0.3 + 0.7 * summ['entry_under_100k'])
|
|
339
|
+
drift = LATENCY_S * drift_per_s
|
|
340
|
+
slip = 2 * SLIPPAGE_PCT
|
|
341
|
+
gas_pct = (GAS_USD / w['avg_buy_usd']) if w['avg_buy_usd'] > 0 else 0.0
|
|
342
|
+
copy_pct = wallet_pct - drift - slip - gas_pct
|
|
343
|
+
copy_7d = w['realized_profit'] * (copy_pct / wallet_pct) if wallet_pct else 0.0
|
|
344
|
+
bt = dict(wallet_pct=round(wallet_pct,4), copy_pct=round(copy_pct,4), drift=round(drift,4),
|
|
345
|
+
slip=round(slip,4), gas_pct=round(gas_pct,4), wallet_7d=round(w['realized_profit'],1),
|
|
346
|
+
copy_7d=round(copy_7d,1), trap=round(w['realized_profit']-copy_7d,1))
|
|
347
|
+
|
|
348
|
+
# ── 8. Verdict ────────────────────────────────────────────────
|
|
349
|
+
ts, cs = track_disp, copy_disp
|
|
350
|
+
if dev is not None:
|
|
351
|
+
ds = round((dev.get('score') or 0) * 100)
|
|
352
|
+
if ds < 40:
|
|
353
|
+
v_emoji, v_text = "🔴", _( f"发币方钱包,Dev 信誉仅 {ds}/100(连环 rug / 存活率低)—— 别碰它发的新盘。",
|
|
354
|
+
f"Token-creator wallet, Dev reputation only {ds}/100 (serial-rug / low survival) — stay away from its new launches.")
|
|
355
|
+
else:
|
|
356
|
+
v_emoji, v_text = "🟡", _( f"发币方钱包,Dev 信誉 {ds}/100 —— 看它的存活率与安全记录再决定是否跟它的新盘。",
|
|
357
|
+
f"Token-creator wallet, Dev reputation {ds}/100 — check survival rate and security record before following its new launches.")
|
|
358
|
+
elif ts >= 65 and cs < 35:
|
|
359
|
+
v_emoji, v_text = "⚠️", _( "高战绩、低可跟单 —— 学它的止损纪律,别抄它的入场;延迟和滑点会把薄利吃成负。",
|
|
360
|
+
"High track record, low copy-tradeability — learn the stop-loss discipline, don't copy the entries; latency and slippage will turn thin profit negative.")
|
|
361
|
+
elif ts >= 60 and cs >= 55:
|
|
362
|
+
v_emoji, v_text = "🟢", _( "战绩真实且可跟单性高 —— 低频、进场不算太早,值得小额跟一跟验证。",
|
|
363
|
+
"Genuine track record and high copy-tradeability — low frequency, entries not too early, worth a small copy-trade to verify.")
|
|
364
|
+
elif ts < 40:
|
|
365
|
+
v_emoji, v_text = "🔴", _("战绩一般偏弱 —— 不建议作为跟单对象。", "Weak track record — not recommended as a copy-trade target.")
|
|
366
|
+
else:
|
|
367
|
+
v_emoji, v_text = "🟡", _( "战绩中等 —— 可观察,跟单前先小额验证延迟/滑点损耗。",
|
|
368
|
+
"Middling track record — worth watching; verify latency/slippage cost with a small trade before copying.")
|
|
369
|
+
|
|
370
|
+
# ══════════════════════════════════════════════════════════
|
|
371
|
+
# OUTPUT
|
|
372
|
+
# ══════════════════════════════════════════════════════════
|
|
373
|
+
title = _("跟单评分", "Copy-Trade Score")
|
|
374
|
+
print(f"┌{'─'*56}┐")
|
|
375
|
+
print(f"│{(' '+title):^56}│")
|
|
376
|
+
print(f"│{(' '+WALLET[:6]+'...'+WALLET[-4:]+' · '+CHAIN.upper()):^56}│")
|
|
377
|
+
if w['identity']:
|
|
378
|
+
print(f"│{(' '+w['identity']):^56}│")
|
|
379
|
+
print(f"└{'─'*56}┘")
|
|
380
|
+
print()
|
|
381
|
+
|
|
382
|
+
sec = _("📊 近7天战绩", "📊 7D Trading Stats")
|
|
383
|
+
print(f"━━ {sec} {'━'*(54-len(sec))}")
|
|
384
|
+
print(f" {_('已实现盈亏','Realized P&L')} {usd(w['realized_profit'])} ROI {w['roi']*100:+.1f}% "
|
|
385
|
+
f"{_('胜率','Win rate')} {w['winrate']*100:.0f}% {_('笔数','Trades')} {trades} ({buy}{_('买','buy')}/{sell}{_('卖','sell')})")
|
|
386
|
+
print(f" {_('交易币数','Tokens traded')} {token_num} {_('均持仓','Avg hold')} {fmt_dur(w['avg_hold_s'])} "
|
|
387
|
+
f"{_('均单笔建仓','Avg position')} {usd(w['avg_buy_usd'])}")
|
|
388
|
+
print()
|
|
389
|
+
|
|
390
|
+
sec = _("🏷️ 风格标签", "🏷️ Style Tags")
|
|
391
|
+
print(f"━━ {sec} {'━'*(54-len(sec))}")
|
|
392
|
+
for t in tags:
|
|
393
|
+
print(f" {t['emoji']} {t['text']}")
|
|
394
|
+
print()
|
|
395
|
+
|
|
396
|
+
if self_dealing:
|
|
397
|
+
print(f" ⚠️ {_('该钱包主要在发币而非交易——下面两个分已按 ×0.45 打折显示,仅供参考。','This wallet mostly launches tokens rather than trading — the two scores below are shown at a ×0.45 discount for reference only.')}")
|
|
398
|
+
print()
|
|
399
|
+
|
|
400
|
+
sec = _("🎯 真实战绩分(这交易员是不是真有本事)", "🎯 Track-Record Score (is this trader actually good?)")
|
|
401
|
+
print(f"━━ {sec} {'━'*(max(0,54-len(sec)))}")
|
|
402
|
+
print(f" {track_disp}/100")
|
|
403
|
+
for k, v in track_facs.items():
|
|
404
|
+
print(f" · {TRACK_LABELS[k]:14s} {round(100*_clamp(v)):3d}/100 ({_('权重','w')} {TRACK_W[k]:.0%})")
|
|
405
|
+
print()
|
|
406
|
+
|
|
407
|
+
sec = _("🚀 可跟单分(你跟进后能拿到多少)", "🚀 Copy-Tradeability Score (can YOU capture it?)")
|
|
408
|
+
print(f"━━ {sec} {'━'*(max(0,54-len(sec)))}")
|
|
409
|
+
print(f" {copy_disp}/100")
|
|
410
|
+
for k, v in copy_facs.items():
|
|
411
|
+
print(f" · {COPY_LABELS[k]:14s} {round(100*v):3d}/100 ({_('权重','w')} {COPY_W[k]:.0%})")
|
|
412
|
+
print()
|
|
413
|
+
|
|
414
|
+
sec = _("🧮 跟单回测", "🧮 Copy-Trade Backtest")
|
|
415
|
+
print(f"━━ {sec} {'━'*(max(0,54-len(sec)))}")
|
|
416
|
+
print(f" {_('假设','Assuming')}: {_('延迟','latency')} {LATENCY_S:.1f}s {_('单边滑点','one-sided slippage')} {SLIPPAGE_PCT:.1%} {_('每笔gas','gas/trade')} {usd(GAS_USD)}")
|
|
417
|
+
print(f" {_('钱包本人单笔收益率','Wallet per-trade return')} {bt['wallet_pct']*100:+.1f}%")
|
|
418
|
+
print(f" {_('- 延迟漂移','- latency drift')} {bt['drift']*100:.2f}pp {_('- 双边滑点','- round-trip slippage')} {bt['slip']*100:.2f}pp {_('- gas占比','- gas cost')} {bt['gas_pct']*100:.2f}pp")
|
|
419
|
+
print(f" {_('= 跟单后单笔收益率','= your per-trade return')} {bt['copy_pct']*100:+.1f}%")
|
|
420
|
+
print()
|
|
421
|
+
print(f" 7D {_('钱包本人','wallet')} {usd(bt['wallet_7d'])} → {_('跟单预估','copy estimate')} {usd(bt['copy_7d'])} ({_('抄单损耗','execution drag')} {usd(bt['trap'])})")
|
|
422
|
+
if not has_mcap_data:
|
|
423
|
+
print(f" ⚠️ {_('未取到进场市值数据,延迟漂移按中性假设估算,可能失真','Entry mcap data unavailable — latency drift uses a neutral assumption and may be inaccurate')}")
|
|
424
|
+
print()
|
|
425
|
+
|
|
426
|
+
if dev is not None:
|
|
427
|
+
sec = _("👨💻 Dev 信誉分(该钱包作为发币方)", "👨💻 Dev Reputation (as a token creator)")
|
|
428
|
+
print(f"━━ {sec} {'━'*(max(0,54-len(sec)))}")
|
|
429
|
+
ds = round((dev.get('score') or 0) * 100)
|
|
430
|
+
print(f" {ds}/100")
|
|
431
|
+
print(f" {_('已开外盘','Graduated')} {dev['open_count']} {_('卡在内盘','Stuck on curve')} {dev['inner_count']} "
|
|
432
|
+
f"{_('抽样存活率','Sampled survival')} {round((1-dev['rug_rate'])*100)}% ({dev['alive']}/{dev['analyzed']})")
|
|
433
|
+
print(f" {_('历史最高市值','All-time-high mcap')} {usd(dev['ath_mc'])}")
|
|
434
|
+
if dev['sec_checked']:
|
|
435
|
+
print(f" {_('最近发币安全扫描','Recent launches security scan')}: {dev['sec_unsafe']}/{dev['sec_checked']} {_('未过检','failed check')}")
|
|
436
|
+
print()
|
|
437
|
+
|
|
438
|
+
sec = _("✅ 结论", "✅ Verdict")
|
|
439
|
+
print(f"━━ {sec} {'━'*(max(0,54-len(sec)))}")
|
|
440
|
+
print(f" {v_emoji} {v_text}")
|
|
441
|
+
PYEOF
|
|
442
|
+
```
|
|
443
|
+
|
|
444
|
+
## Field Reference
|
|
445
|
+
|
|
446
|
+
Fields the script reads, confirmed against `portfolio stats` / `portfolio activity` / `portfolio created-tokens` / `token security` output (see [gmgn-portfolio](../gmgn-portfolio/SKILL.md) and [gmgn-token](../gmgn-token/SKILL.md) for the full reference):
|
|
447
|
+
|
|
448
|
+
| Source | Field | Meaning |
|
|
449
|
+
|--------|-------|---------|
|
|
450
|
+
| `portfolio stats` | `realized_profit`, `winrate`, `pnl_stat.token_num`, `pnl_stat.avg_holding_period` | Core outcome distribution |
|
|
451
|
+
| `portfolio stats` | `pnl_stat.pnl_gt_5x_num` / `pnl_2x_5x_num` / `pnl_0x_2x_num` / `pnl_nd5_0x_num` / `pnl_lt_nd5_num` | Bucketed P&L distribution: `>500%` / `200–500%` / `0–200%` / `-50–0%` / `<-50%` |
|
|
452
|
+
| `portfolio stats` | `common.created_token_count` | Used to detect a token-creator ("Dev") wallet |
|
|
453
|
+
| `portfolio activity` | `token.address`, `timestamp`, `price_usd` | Used for holding-duration and flip-rate detection |
|
|
454
|
+
| `portfolio created-tokens` | `open_count`, `inner_count`, `open_ratio`, `creator_ath_info.ath_mc` | Dev launch-history survival stats |
|
|
455
|
+
| `portfolio created-tokens` | `tokens[].is_open`, `tokens[].pool_liquidity`, `tokens[].create_timestamp`, `tokens[].token_address` | Per-launch alive/rugged classification |
|
|
456
|
+
| `token security` | `is_honeypot`, `renounced_mint`, `renounced_freeze_account` (SOL), `open_source` (EVM) | Recent-launch security scan for Dev reputation |
|
|
457
|
+
|
|
458
|
+
**Fields used defensively, not guaranteed present in every API response** — the script degrades gracefully (see [Notes](#notes)) rather than failing if these are absent:
|
|
459
|
+
|
|
460
|
+
| Field | Used for | Degrade behavior if missing |
|
|
461
|
+
|-------|----------|------------------------------|
|
|
462
|
+
| `token.total_supply` on activity rows | Entry market-cap estimate (`price_usd × total_supply`) | `entry_under_100k` / `median_entry_mcap` fall back to `0` — copy-tradeability's entry factor and backtest drift use a neutral assumption |
|
|
463
|
+
| `gas_usd` on activity rows | Average gas cost display | Falls back to `0`; the backtest still uses the user-specified `--gas` |
|
|
464
|
+
| `event_type` on activity rows | buy/sell classification | Falls back to the `type` field per the [gmgn-portfolio](../gmgn-portfolio/SKILL.md) reference |
|
|
465
|
+
|
|
466
|
+
## Scoring Rules Reference
|
|
467
|
+
|
|
468
|
+
**Track-record score** (0–100, weighted sum) — rewards disciplined risk management over raw win rate:
|
|
469
|
+
|
|
470
|
+
| Factor | Weight | What it measures |
|
|
471
|
+
|--------|--------|-------------------|
|
|
472
|
+
| Stop-loss discipline | 34% | `1 − (tokens down >50%) / total` |
|
|
473
|
+
| Profit share | 28% | Fraction of tokens that ended up net positive at any level |
|
|
474
|
+
| Capital ROI | 16% | `realized_profit / bought_cost`, normalized −5%→0, +30%→100 |
|
|
475
|
+
| Win rate | 10% | Normalized 0%→0, 50%→100 (low weight — a low win rate with great stop-loss discipline can still score well) |
|
|
476
|
+
| Sample size | 12% | Confidence discount for wallets with few distinct tokens traded (20→0, 320→100) |
|
|
477
|
+
|
|
478
|
+
**Copy-tradeability score** (0–100, weighted sum) — penalizes styles that can't survive real-world latency:
|
|
479
|
+
|
|
480
|
+
| Factor | Weight | What it measures |
|
|
481
|
+
|--------|--------|-------------------|
|
|
482
|
+
| Entry mcap | 22% | Later entries score higher — sub-$100k entries mean you'd be buying after the wallet already has its position |
|
|
483
|
+
| Profit per trade | 22% | Thin average per-trade profit (< ~$30–80) gets eaten by slippage and gas |
|
|
484
|
+
| Hold vs latency | 20% | Penalizes both high 5-second flip rates and very short average holds — you can't react that fast |
|
|
485
|
+
| Execution feasibility | 18% | Penalizes very high trade counts (bot-tier, > ~1000/week) — no human can keep pace |
|
|
486
|
+
| Edge type | 18% | Speed/scale-driven edges (early entries, fast flips) are not learnable/copyable; selection/timing edges are |
|
|
487
|
+
|
|
488
|
+
**Dev-reputation score** (0–100, applies only when the wallet is a token creator) — survival-rate driven:
|
|
489
|
+
|
|
490
|
+
- Base: `0.25 + 0.55 × survival_rate` (survival = tokens still open with ≥$4,000 liquidity, or `open_ratio` if no per-token data)
|
|
491
|
+
- `− 0.30 ×` penalty for heavy bonding-curve pileup (`inner_count` beyond 50, capping at 1000 — a hallmark of factory/serial-launch wallets)
|
|
492
|
+
- `+ 0.15 ×` bonus for a strong all-time-high launch, gated by survival rate (a factory wallet's one lucky moonshot doesn't count)
|
|
493
|
+
- `− 0.35 ×` penalty for the fraction of recently-scanned launches that failed a basic security check
|
|
494
|
+
- **Self-dealing discount**: when a wallet is classified as a Dev (its own launches make up more than half its traded tokens), the track-record and copy-tradeability scores are shown at `× 0.45` — its own entry timing and win rate are self-authored, not a market read.
|
|
495
|
+
|
|
496
|
+
## Verdict Rules
|
|
497
|
+
|
|
498
|
+
| Condition | Verdict |
|
|
499
|
+
|-----------|---------|
|
|
500
|
+
| Wallet is a Dev, Dev-reputation < 40 | 🔴 Stay away from its new launches |
|
|
501
|
+
| Wallet is a Dev, Dev-reputation ≥ 40 | 🟡 Check survival rate / security record before following new launches |
|
|
502
|
+
| Track ≥65, Copy <35 | ⚠️ Learn the discipline, don't copy the entries |
|
|
503
|
+
| Track ≥60, Copy ≥55 | 🟢 Worth a small copy-trade to verify |
|
|
504
|
+
| Track <40 | 🔴 Not recommended as a copy-trade target |
|
|
505
|
+
| Otherwise | 🟡 Worth watching; verify latency/slippage cost with a small trade first |
|
|
506
|
+
|
|
507
|
+
## Supported Chains
|
|
508
|
+
|
|
509
|
+
`sol` / `bsc` / `base` / `eth` / `robinhood`
|
|
510
|
+
|
|
511
|
+
## Prerequisites
|
|
512
|
+
|
|
513
|
+
- `gmgn-cli` installed globally — if missing, run: `npm install -g gmgn-cli`
|
|
514
|
+
- `GMGN_API_KEY` configured in `~/.config/gmgn/.env` (exist auth only — no private key required for this skill)
|
|
515
|
+
|
|
516
|
+
## Rate Limit Handling
|
|
517
|
+
|
|
518
|
+
All routes this skill calls go through GMGN's leaky-bucket limiter with `rate=20` and `capacity=20`. Sustained throughput is roughly `20 ÷ weight` requests/second, and the max burst is roughly `floor(20 ÷ weight)` when the bucket is full. All of them use **exist auth** (API Key only, no private key needed).
|
|
519
|
+
|
|
520
|
+
| Command | Route | Weight |
|
|
521
|
+
|---------|-------|--------|
|
|
522
|
+
| `portfolio stats` | `GET /v1/user/wallet_stats` | 3 |
|
|
523
|
+
| `portfolio activity` | `GET /v1/user/wallet_activity` | 3 |
|
|
524
|
+
| `portfolio created-tokens` | `GET /v1/user/created_tokens` | 2 |
|
|
525
|
+
| `token security` | `GET /v1/token/security` | 1 |
|
|
526
|
+
|
|
527
|
+
A single run of this skill's script can burn through several of these in sequence: 1× `portfolio stats` + up to 4× `portfolio activity` (pagination) + 1× `portfolio created-tokens` + up to 3× `token security` (Dev security scan) — only the last two fire when the wallet is classified as a Dev. Account for that combined weight before batch-scoring several wallets back to back.
|
|
528
|
+
|
|
529
|
+
**When a request returns `429`, stop and proactively tell the user exactly when they can retry — never fail silently, never keep retrying without saying anything.**
|
|
530
|
+
|
|
531
|
+
- Extract the reset time: read `X-RateLimit-Reset` from the response headers (Unix timestamp), or if the response body contains `reset_at` (e.g., `{"code":429,"error":"RATE_LIMIT_BANNED","message":"...","reset_at":1775184222}`), use that instead — it's the Unix timestamp when the ban lifts (typically 5 minutes for a ban).
|
|
532
|
+
- Convert whichever timestamp you got to the user's local time and state it plainly, e.g. *"Rate-limited — you can retry this wallet after 14:32:05 (in ~4 minutes)."* Do this even if the run partially succeeded (see below) — the user needs to know when the rest of the analysis can resume.
|
|
533
|
+
- **Resume, don't restart**: if the script is mid-run (e.g. the Dev security scan hits `429` after `portfolio stats` and `activity` already succeeded), report what you already have (stats/tags/track-record score can still be shown), state the reset time for the remaining calls, and re-run only those remaining calls after it passes — don't re-fetch data you already have.
|
|
534
|
+
- For `RATE_LIMIT_EXCEEDED` or `RATE_LIMIT_BANNED`, repeated requests during the cooldown extend the ban by 5 seconds each time, up to 5 minutes. Never loop retries — wait for the stated reset time before trying again.
|
|
535
|
+
- Scoring multiple wallets in one request (a leaderboard-style comparison): space the calls out or reduce `--sample` rather than firing all wallets' full analysis concurrently. If one wallet in the batch gets rate-limited, report the completed wallets immediately and tell the user when the rest will be ready, rather than holding the whole batch back silently.
|
|
536
|
+
|
|
537
|
+
## Notes
|
|
538
|
+
|
|
539
|
+
- This skill only reads data (`portfolio stats` / `activity` / `created-tokens`, `token security`) — it never executes a trade. For actually copy-trading, use [gmgn-swap](../gmgn-swap/SKILL.md) after this skill gives a 🟢 verdict.
|
|
540
|
+
- Scores over a 7-day window can be noisy for low-trade-count wallets — the sample-size factor in the track-record score already discounts this, but treat a score built on <10 trades as low-confidence and say so.
|
|
541
|
+
- The backtest (`--latency` / `--slippage` / `--gas`) is a rough estimate, not a precise simulation — actual slippage depends on the specific token's liquidity at the moment you'd have traded it.
|
|
542
|
+
- Dev-reputation is only computed when `created_token_count` exceeds half the wallet's traded-token count — a wallet that launched one token in passing while mostly trading normally will NOT be treated as a Dev, and its trading-style tags/scores apply as normal.
|
|
543
|
+
- Use `--raw` on any underlying `gmgn-cli` command to get single-line JSON if you want to inspect the raw response yourself before trusting a derived field.
|
|
544
|
+
|
|
545
|
+
## References
|
|
546
|
+
|
|
547
|
+
| Skill | Description |
|
|
548
|
+
|-------|--------------|
|
|
549
|
+
| [gmgn-portfolio](../gmgn-portfolio/SKILL.md) | Underlying `portfolio stats` / `activity` / `created-tokens` commands and full field reference |
|
|
550
|
+
| [gmgn-token](../gmgn-token/SKILL.md) | `token security` command used for the Dev-reputation security scan |
|
|
551
|
+
| [gmgn-track](../gmgn-track/SKILL.md) | Discover candidate wallets to score — Smart Money / KOL / followed-wallet trade feeds |
|
|
552
|
+
| [gmgn-swap](../gmgn-swap/SKILL.md) | Execute an actual copy-trade once this skill's verdict is 🟢 |
|