@vike-io/cli 0.14.0 → 0.16.0
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/CHANGELOG.md +30 -0
- package/README.md +32 -14
- package/package.json +4 -4
- package/skills/vike/SKILL.md +75 -37
- package/skills/vike-alerts-setup/SKILL.md +42 -10
- package/skills/vike-alerts-webhook/SKILL.md +18 -10
- package/skills/vike-candles/SKILL.md +10 -2
- package/skills/vike-core/SKILL.md +6 -3
- package/skills/vike-daily-brief/SKILL.md +68 -0
- package/skills/vike-follow-the-money/SKILL.md +60 -0
- package/skills/vike-hl-asset-briefing/SKILL.md +48 -0
- package/skills/vike-hl-builder-intel/SKILL.md +39 -0
- package/skills/vike-hl-cohort-backtest/SKILL.md +61 -0
- package/skills/vike-hl-cohort-positioning/SKILL.md +58 -0
- package/skills/vike-hl-liquidation-radar/SKILL.md +49 -0
- package/skills/vike-hl-position-match/SKILL.md +4 -3
- package/skills/vike-hl-top-traders/SKILL.md +22 -9
- package/skills/vike-hl-trader-profile/SKILL.md +65 -0
- package/skills/vike-perp-crowding/SKILL.md +49 -0
- package/skills/vike-perp-funding/SKILL.md +4 -1
- package/skills/vike-perp-overview/SKILL.md +23 -3
- package/skills/vike-pm-l2-archive/SKILL.md +50 -0
- package/skills/vike-pm-market-diligence/SKILL.md +60 -0
- package/skills/vike-polymarket-market-detail/SKILL.md +20 -15
- package/skills/vike-polymarket-markets/SKILL.md +2 -1
- package/skills/vike-polymarket-smart-money/SKILL.md +1 -0
- package/skills/vike-polymarket-trader/SKILL.md +2 -1
- package/skills/vike-smart-money-discovery/SKILL.md +4 -3
- package/skills/vike-stream/SKILL.md +99 -0
- package/skills/vike-token-holder-diligence/SKILL.md +58 -0
- package/skills/vike-token-holders/SKILL.md +6 -4
- package/skills/vike-token-research/SKILL.md +6 -6
- package/skills/vike-token-screener/SKILL.md +3 -3
- package/skills/vike-token-search/SKILL.md +2 -1
- package/skills/vike-token-smart-money-trend/SKILL.md +57 -0
- package/skills/vike-token-transfers/SKILL.md +8 -6
- package/skills/vike-wallet-balances/SKILL.md +9 -7
- package/skills/vike-wallet-batch/SKILL.md +3 -3
- package/skills/vike-wallet-compare/SKILL.md +2 -2
- package/skills/vike-wallet-counterparties/SKILL.md +2 -2
- package/skills/vike-wallet-discover/SKILL.md +3 -1
- package/skills/vike-wallet-ens/SKILL.md +2 -2
- package/skills/vike-wallet-label-provenance/SKILL.md +5 -4
- package/skills/vike-wallet-pnl-history/SKILL.md +2 -2
- package/skills/vike-wallet-portfolio/SKILL.md +10 -8
- package/skills/vike-wallet-summary/SKILL.md +6 -6
- package/skills/vike-wallet-trace/SKILL.md +4 -3
- package/skills/vike-wallet-transactions/SKILL.md +2 -2
- package/skills/vike-wallet-who-is/SKILL.md +50 -0
- package/skills/vike-wallets-related/SKILL.md +52 -0
- package/skills.sh.json +34 -12
- package/src/commands/alerts.js +85 -15
- package/src/commands/call.js +32 -0
- package/src/commands/candles.js +11 -15
- package/src/commands/doctor.js +4 -4
- package/src/commands/hl.js +274 -0
- package/src/commands/perp.js +5 -5
- package/src/commands/polymarket.js +105 -5
- package/src/commands/search.js +10 -0
- package/src/commands/stream.js +308 -0
- package/src/commands/token.js +2 -0
- package/src/commands/tool-command.js +27 -0
- package/src/commands/wallet.js +21 -0
- package/src/index.js +10 -1
- package/src/mcp-client.js +37 -16
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
import { addTool } from './tool-command.js';
|
|
2
|
+
|
|
3
|
+
// One subcommand per Hyperliquid MCP tool; each takes `--view` (the first view is the default).
|
|
4
|
+
// `hl_perp_top_traders` and `hl_position_match` stay under `perp`, candles under `candles`.
|
|
5
|
+
// Flags carry the tool's own parameter names (--opened-within -> opened_within).
|
|
6
|
+
const view = (views) => ['--view <v>', `${views.join(' | ')} (default ${views[0]})`];
|
|
7
|
+
const SYMBOL = ['--symbol <s>', 'Instrument, e.g. BTC; a HIP-3 market is dex:TICKER (xyz:TSLA)'];
|
|
8
|
+
const START = ['--start <t>', 'ISO-8601 UTC lower bound, e.g. 2026-10-01T00:00:00Z'];
|
|
9
|
+
const END = ['--end <t>', 'ISO-8601 UTC upper bound'];
|
|
10
|
+
const CURSOR = ['--cursor <c>', 'nextCursor from the previous page, verbatim'];
|
|
11
|
+
const LIMIT = ['--limit <n>', 'Rows per page'];
|
|
12
|
+
const OPENED = ['--opened-within <w>', 'Only positions opened within: 24h | 7d | 30d | all'];
|
|
13
|
+
const AXIS = ['--axis <a>', 'Cohort ladder: size | pnl | pnl_abs'];
|
|
14
|
+
const COHORT = ['--cohort <c>', 'One cohort label on --axis, e.g. whale or "3x smart" (`hl segments --view cohorts` lists them)'];
|
|
15
|
+
const WINDOW = ['--window <w>', '1d | 7d | 30d | all'];
|
|
16
|
+
const VAULT_WINDOW = ['--window <w>', '7d | 30d | 90d | 365d | all'];
|
|
17
|
+
const ORDER = ['--order <o>', 'desc | asc'];
|
|
18
|
+
const SIDE = ['--side <s>', 'buy | sell'];
|
|
19
|
+
const WALLET = ['--wallet <a>', 'One wallet (0x + 40 hex)'];
|
|
20
|
+
|
|
21
|
+
export function registerHl(program) {
|
|
22
|
+
const hl = program
|
|
23
|
+
.command('hl')
|
|
24
|
+
.description('Hyperliquid: cohort positioning, wallets, leaderboards, liquidations, markets, builders, vaults');
|
|
25
|
+
|
|
26
|
+
addTool(hl, 'cohort-metrics <symbol>', {
|
|
27
|
+
tool: 'hl_cohort_metrics',
|
|
28
|
+
args: ['symbol'],
|
|
29
|
+
desc: 'Hourly long/short positioning of one perp split by cohort (are whales / smart money long or short)',
|
|
30
|
+
options: [
|
|
31
|
+
['--axis <a>', 'size | pnl | pnl_abs | tier | trade_size | pnl_unrealized (default size)'],
|
|
32
|
+
['--hours <n>', 'Hourly buckets, newest first, max 8760 (default 168; 1-24 for a current read)'],
|
|
33
|
+
START, END, OPENED,
|
|
34
|
+
['--label-basis <b>', 'current | point_in_time (point_in_time for any backtest)'],
|
|
35
|
+
['--grading <g>', 'realized | realized-pit | unrealized (pnl axes only)'],
|
|
36
|
+
['--include <list>', 'Comma list: volume, median_pnl (newest hour only)'],
|
|
37
|
+
CURSOR,
|
|
38
|
+
],
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
addTool(hl, 'segments', {
|
|
42
|
+
tool: 'hl_segments',
|
|
43
|
+
desc: 'Cohort vocabulary, one cohort now, the symbol x cohort board, or one cohort hour by hour',
|
|
44
|
+
options: [
|
|
45
|
+
view(['segments', 'cohorts', 'summary', 'heatmap', 'history']),
|
|
46
|
+
['--cohort <c>', 'One label (required by summary and history)'],
|
|
47
|
+
['--axis <a>', 'size | pnl | pnl_abs (history: size or pnl, required)'],
|
|
48
|
+
OPENED, START, END,
|
|
49
|
+
['--hours <n>', 'history: window length in hours (default 168)'],
|
|
50
|
+
['--limit <n>', 'history: max hourly rows (default 5000)'],
|
|
51
|
+
['--include <list>', 'history: leverage'],
|
|
52
|
+
],
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
addTool(hl, 'wallet <address>', {
|
|
56
|
+
tool: 'hl_wallet',
|
|
57
|
+
args: ['address'],
|
|
58
|
+
desc: 'One wallet: equity, open positions, cohort labels, risk metrics and lifetime flow (or closed-trade stats)',
|
|
59
|
+
options: [view(['summary', 'trades_summary']), WINDOW, OPENED],
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
addTool(hl, 'wallet-activity <address>', {
|
|
63
|
+
tool: 'hl_wallet_activity',
|
|
64
|
+
args: ['address'],
|
|
65
|
+
desc: 'One wallet\'s fills, funding, ledger (deposits, withdrawals, transfers, vault events) or builder routing',
|
|
66
|
+
options: [
|
|
67
|
+
view(['fills', 'funding', 'ledger', 'builders']),
|
|
68
|
+
SYMBOL, START, END, SIDE,
|
|
69
|
+
['--event-type <t>', 'ledger: one event type, e.g. deposit, withdraw, vaultDeposit'],
|
|
70
|
+
['--window <w>', 'builders: 1d | 7d | 30d | all'],
|
|
71
|
+
['--limit <n>', 'Rows per page (default 100, max 5000; builders 50, max 500)'],
|
|
72
|
+
CURSOR,
|
|
73
|
+
],
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
addTool(hl, 'leaderboard', {
|
|
77
|
+
tool: 'hl_leaderboard',
|
|
78
|
+
desc: 'Traders ranked on any of 20 metrics with the full risk set, or on fills-derived trading PnL',
|
|
79
|
+
options: [
|
|
80
|
+
view(['ranking', 'flow_adjusted']),
|
|
81
|
+
['--window <w>', '1d | 7d | 30d | all (default 30d)'],
|
|
82
|
+
['--sort <s>', 'pnl | realized_pnl | roi | volume | trades | win_rate | profit_factor | calmar | max_drawdown | ... (default pnl)'],
|
|
83
|
+
ORDER, COHORT, AXIS,
|
|
84
|
+
['--min-trades <n>', 'Minimum closed trades (default 3; 0 = no floor)'],
|
|
85
|
+
['--min-win-rate <f>', 'FRACTION 0-1 (0.6 = 60%), unlike `perp top-traders`'],
|
|
86
|
+
['--min-volume <usd>', 'Minimum total volume in USD'],
|
|
87
|
+
['--limit <n>', 'Rows per page (default 25, max 500)'],
|
|
88
|
+
CURSOR,
|
|
89
|
+
],
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
addTool(hl, 'liquidations', {
|
|
93
|
+
tool: 'hl_liquidations',
|
|
94
|
+
desc: 'Liquidation events, the share of open notional near liquidation per symbol, or one symbol\'s liquidation heatmap',
|
|
95
|
+
options: [
|
|
96
|
+
view(['fills', 'risk', 'heatmap']),
|
|
97
|
+
['--symbol <s>', 'One symbol (required by heatmap)'],
|
|
98
|
+
['--wallet <a>', 'fills: has this wallet been liquidated'],
|
|
99
|
+
START, END,
|
|
100
|
+
['--direction <d>', 'fills: long | short, the side that was closed'],
|
|
101
|
+
AXIS, COHORT,
|
|
102
|
+
['--min-value-usd <usd>', 'risk: smallest open notional a symbol needs to be ranked'],
|
|
103
|
+
['--bins <n>', 'heatmap: price bins, 5-500 (default 50)'],
|
|
104
|
+
['--limit <n>', 'Rows per page (fills max 5000, risk max 500)'],
|
|
105
|
+
CURSOR,
|
|
106
|
+
],
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
addTool(hl, 'market', {
|
|
110
|
+
tool: 'hl_market',
|
|
111
|
+
desc: 'Open interest per symbol, one symbol\'s hourly series, size breakdown, positions, indices or large fills',
|
|
112
|
+
options: [
|
|
113
|
+
view(['open_interest', 'symbol_metrics', 'size_breakdown', 'positions', 'indices', 'large_fills', 'hourly']),
|
|
114
|
+
['--symbol <s>', 'One symbol (required by every view but open_interest, positions and hourly)'],
|
|
115
|
+
['--symbols <list>', 'hourly: comma-separated perps, at most 64 (close, open interest, funding, premium)'],
|
|
116
|
+
['--days <n>', 'hourly: days back from --end, 1-400 (default 120)'],
|
|
117
|
+
WALLET, AXIS, COHORT, OPENED, START, END,
|
|
118
|
+
['--open-only <bool>', 'positions: true (default) = latest open; false needs --start'],
|
|
119
|
+
['--sort <s>', 'positions: size = biggest positions of one --symbol first'],
|
|
120
|
+
['--resolution <r>', 'positions history: 5m | 1h'],
|
|
121
|
+
['--label-basis <b>', 'symbol_metrics: current'],
|
|
122
|
+
['--hours <n>', 'indices: window in hours; large_fills: look-back, max 24'],
|
|
123
|
+
['--min-usd <usd>', 'large_fills: smallest fill, at least 50000'],
|
|
124
|
+
LIMIT, CURSOR,
|
|
125
|
+
],
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
addTool(hl, 'builders', {
|
|
129
|
+
tool: 'hl_builders',
|
|
130
|
+
desc: 'Builder codes: leaderboard, venue-wide stats, one builder\'s profile, users, fills or series',
|
|
131
|
+
options: [
|
|
132
|
+
view(['leaderboard', 'stats', 'profile', 'users', 'fills', 'series']),
|
|
133
|
+
['--builder <a>', 'Builder address (required by profile, users, fills, series)'],
|
|
134
|
+
['--window <w>', '1d | 7d | 30d | all (default 30d)'],
|
|
135
|
+
['--sort <s>', 'leaderboard: fee | volume | users | fills; users: volume | fees | pnl'],
|
|
136
|
+
ORDER, SYMBOL, SIDE, START, END,
|
|
137
|
+
['--bucket <b>', 'series: 1h | 1d'],
|
|
138
|
+
['--breakdown-limit <n>', 'profile: rows per breakdown, max 1000'],
|
|
139
|
+
LIMIT, CURSOR,
|
|
140
|
+
],
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
addTool(hl, 'vaults', {
|
|
144
|
+
tool: 'hl_vaults',
|
|
145
|
+
desc: 'Every vault with TVL, APR, PnL and flows, platform vault stats, or deposits and withdrawals across vaults',
|
|
146
|
+
options: [
|
|
147
|
+
view(['list', 'stats', 'flows']),
|
|
148
|
+
VAULT_WINDOW,
|
|
149
|
+
['--sort <s>', 'list: tvl | apr | pnl | return | net_flow | volume | age | leverage | top5_share'],
|
|
150
|
+
ORDER,
|
|
151
|
+
['--status <s>', 'list: open | closed | all'],
|
|
152
|
+
['--deposits <d>', 'list: any | open | closed'],
|
|
153
|
+
['--min-tvl <usd>', 'list: minimum TVL in USD'],
|
|
154
|
+
['--q <text>', 'list: part of a vault name, or an address prefix'],
|
|
155
|
+
['--min-usd <usd>', 'flows: smallest flow in USD (default 10000)'],
|
|
156
|
+
['--type <t>', 'flows: all | deposit | withdraw | distribution | commission'],
|
|
157
|
+
['--smart-only <bool>', 'flows: only top-1000 all-time PnL depositors'],
|
|
158
|
+
LIMIT, CURSOR,
|
|
159
|
+
],
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
addTool(hl, 'vault <vault>', {
|
|
163
|
+
tool: 'hl_vault',
|
|
164
|
+
args: ['vault'],
|
|
165
|
+
desc: 'One vault: profile, depositors, its own flows, or an equity / PnL series',
|
|
166
|
+
options: [
|
|
167
|
+
view(['profile', 'depositors', 'flows', 'series']),
|
|
168
|
+
['--sort <s>', 'depositors: share | pnl | all_time_pnl | entered'],
|
|
169
|
+
ORDER,
|
|
170
|
+
['--smart-only <bool>', 'depositors: only top-1000 all-time PnL wallets'],
|
|
171
|
+
['--min-equity-usd <usd>', 'depositors: smallest equity, at least 1'],
|
|
172
|
+
VAULT_WINDOW,
|
|
173
|
+
['--type <t>', 'flows: all | deposit | withdraw | distribution | commission'],
|
|
174
|
+
['--bucket <b>', 'series: 1h | 1d'],
|
|
175
|
+
START, END, LIMIT, CURSOR,
|
|
176
|
+
],
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
// The cross-wallet feeds (twaps, ledger, leverage-changes): `--order asc` follows a feed; resend the same
|
|
180
|
+
// filters with each nextCursor and stop on an empty page.
|
|
181
|
+
const FEED_ORDER = ['--order <o>', 'desc (default) | asc (to follow the feed)'];
|
|
182
|
+
const FEED_WINDOW = ['--start <t>', 'ISO-8601 UTC lower bound (default: 24 hours before --end, unless --wallet)'];
|
|
183
|
+
|
|
184
|
+
addTool(hl, 'orders', {
|
|
185
|
+
tool: 'hl_orders',
|
|
186
|
+
desc: 'Standing orders: resting at one instant, one wallet\'s orders over a window, or one symbol\'s order clusters',
|
|
187
|
+
options: [
|
|
188
|
+
view(['open', 'wallet', 'clusters']),
|
|
189
|
+
['--symbol <s>', 'open: symbol and/or --wallet required; clusters: required'],
|
|
190
|
+
['--wallet <a>', 'open: one wallet\'s resting orders'],
|
|
191
|
+
['--address <a>', 'wallet: the wallet (required)'],
|
|
192
|
+
['--at <t>', 'open, clusters: ISO-8601 UTC instant (default the newest snapshot)'],
|
|
193
|
+
['--oid <n>', 'open: one order id'],
|
|
194
|
+
['--order-type <t>', 'open: Limit | Stop Market | Stop Limit | Take Profit Market | Take Profit Limit | Trailing Stop Market'],
|
|
195
|
+
['--created-from <t>', 'open: placed at or after (ISO-8601 UTC)'],
|
|
196
|
+
['--created-to <t>', 'open: placed at or before (ISO-8601 UTC)'],
|
|
197
|
+
['--from <t>', 'wallet: window start (default 7 days before --to)'],
|
|
198
|
+
['--to <t>', 'wallet: window end (default the newest snapshot; at most 30 days)'],
|
|
199
|
+
['--status <s>', 'wallet: open | filled | partially_filled | canceled_or_expired'],
|
|
200
|
+
['--step-bps <n>', 'clusters: bucket width in basis points (default 10)'],
|
|
201
|
+
['--range-pct <n>', 'clusters: half-width around the mid in percent (default 10)'],
|
|
202
|
+
['--cohort-axis <a>', 'clusters: size | pnl | pnl_abs'],
|
|
203
|
+
['--cohort <c>', 'clusters: one cohort label (current labels; not with --at)'],
|
|
204
|
+
LIMIT, CURSOR,
|
|
205
|
+
],
|
|
206
|
+
});
|
|
207
|
+
|
|
208
|
+
addTool(hl, 'twaps', {
|
|
209
|
+
tool: 'hl_twaps',
|
|
210
|
+
desc: 'TWAP status lines across wallets, or one wallet\'s or one TWAP\'s',
|
|
211
|
+
options: [
|
|
212
|
+
WALLET,
|
|
213
|
+
['--twap-id <n>', 'One TWAP: every status line of it'],
|
|
214
|
+
SYMBOL,
|
|
215
|
+
['--status <s>', 'activated | waitingForTrigger | finished | terminated | stopped | error'],
|
|
216
|
+
FEED_WINDOW, END, FEED_ORDER, LIMIT, CURSOR,
|
|
217
|
+
],
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
addTool(hl, 'ledger', {
|
|
221
|
+
tool: 'hl_ledger',
|
|
222
|
+
desc: 'Deposits, withdrawals, transfers and vault events across wallets',
|
|
223
|
+
options: [
|
|
224
|
+
WALLET,
|
|
225
|
+
['--event-type <t>', 'One event type, e.g. deposit, withdraw, send, vaultDeposit'],
|
|
226
|
+
['--min-usd <usd>', 'Smallest absolute amount_usd'],
|
|
227
|
+
FEED_WINDOW, END, FEED_ORDER, LIMIT, CURSOR,
|
|
228
|
+
],
|
|
229
|
+
});
|
|
230
|
+
|
|
231
|
+
addTool(hl, 'leverage-changes', {
|
|
232
|
+
tool: 'hl_leverage_changes',
|
|
233
|
+
desc: 'Positions whose leverage or margin mode changed between two snapshots',
|
|
234
|
+
options: [
|
|
235
|
+
WALLET, SYMBOL,
|
|
236
|
+
['--change <c>', 'up | down | mode'],
|
|
237
|
+
['--min-leverage <x>', 'Smallest new leverage'],
|
|
238
|
+
FEED_WINDOW, END, FEED_ORDER, LIMIT, CURSOR,
|
|
239
|
+
],
|
|
240
|
+
});
|
|
241
|
+
|
|
242
|
+
addTool(hl, 'wallet-trades <address>', {
|
|
243
|
+
tool: 'hl_wallet_trades',
|
|
244
|
+
args: ['address'],
|
|
245
|
+
desc: 'One wallet\'s closed round-trip trades, newest close first',
|
|
246
|
+
options: [SYMBOL, START, END, LIMIT, CURSOR],
|
|
247
|
+
});
|
|
248
|
+
|
|
249
|
+
addTool(hl, 'stats', {
|
|
250
|
+
tool: 'hl_stats',
|
|
251
|
+
desc: 'Hourly venue-wide perp equity, open interest and positions, or hourly perp volume',
|
|
252
|
+
options: [
|
|
253
|
+
view(['ecosystem', 'volume']),
|
|
254
|
+
['--symbol <s>', 'volume: one symbol (omit for the whole venue)'],
|
|
255
|
+
START, END, LIMIT, CURSOR,
|
|
256
|
+
],
|
|
257
|
+
});
|
|
258
|
+
|
|
259
|
+
addTool(hl, 'hype-holders', {
|
|
260
|
+
tool: 'hl_hype_holders',
|
|
261
|
+
desc: 'HYPE holders ranked by spot balance plus staked',
|
|
262
|
+
options: [['--order <o>', 'desc (default) | asc'], LIMIT, CURSOR],
|
|
263
|
+
});
|
|
264
|
+
|
|
265
|
+
addTool(hl, 'archive', {
|
|
266
|
+
tool: 'hl_archive',
|
|
267
|
+
desc: 'Index of the Hyperliquid Parquet archive (fills, positions), or a 7-day download link for one file (--view url)',
|
|
268
|
+
options: [
|
|
269
|
+
view(['datasets', 'url']),
|
|
270
|
+
['--dataset <d>', 'url: fills | positions'],
|
|
271
|
+
['--date <d>', 'url: the UTC day, YYYY-MM-DD, or latest (positions only)'],
|
|
272
|
+
],
|
|
273
|
+
});
|
|
274
|
+
}
|
package/src/commands/perp.js
CHANGED
|
@@ -39,7 +39,7 @@ export function registerPerp(program) {
|
|
|
39
39
|
.requiredOption('--leverage <x>', 'Leverage from the share card (e.g. 25)')
|
|
40
40
|
.requiredOption('--entry <p>', 'Entry price from the share card')
|
|
41
41
|
.option('--mark <p>', 'Optional current mark price (sharpens tie-break)')
|
|
42
|
-
.option('--limit <n>', 'Max matches (default
|
|
42
|
+
.option('--limit <n>', 'Max matches (default 50, max 500)', '50')
|
|
43
43
|
.option('--json', 'Emit JSON')
|
|
44
44
|
.action(async (opts) => {
|
|
45
45
|
try {
|
|
@@ -50,7 +50,7 @@ export function registerPerp(program) {
|
|
|
50
50
|
leverage: Number(opts.leverage),
|
|
51
51
|
entry_price: Number(opts.entry),
|
|
52
52
|
mark_price: opts.mark != null ? Number(opts.mark) : undefined,
|
|
53
|
-
limit: parseInt10(opts.limit,
|
|
53
|
+
limit: parseInt10(opts.limit, 50),
|
|
54
54
|
});
|
|
55
55
|
emit(r, opts);
|
|
56
56
|
} catch (err) { emitError(err, opts); }
|
|
@@ -60,12 +60,12 @@ export function registerPerp(program) {
|
|
|
60
60
|
.command('top-traders')
|
|
61
61
|
.description('Top Hyperliquid perp wallets by PnL / ROI / win rate / volume')
|
|
62
62
|
.option('--window <w>', '1d | 7d | 30d | all', '30d')
|
|
63
|
-
.option('--sort <s>', 'pnl | roi | win_rate | volume | trade_count | drawdown', 'pnl')
|
|
63
|
+
.option('--sort <s>', 'pnl | roi | win_rate | volume | trade_count | drawdown | account_value | long_pnl | short_pnl', 'pnl')
|
|
64
64
|
.option('--order <o>', 'asc | desc', 'desc')
|
|
65
65
|
.option('--min-trades <n>', 'Minimum trade count', '3')
|
|
66
66
|
.option('--min-win-rate <p>', 'Minimum win rate percent (0-100)', '0')
|
|
67
67
|
.option('--min-volume <usd>', 'Minimum volume USD', '0')
|
|
68
|
-
.option('--size <n>', 'Page size (max
|
|
68
|
+
.option('--size <n>', 'Page size (default 20, max 100)', '20')
|
|
69
69
|
.option('--json', 'Emit JSON')
|
|
70
70
|
.action(async (opts) => {
|
|
71
71
|
try {
|
|
@@ -76,7 +76,7 @@ export function registerPerp(program) {
|
|
|
76
76
|
min_trades: parseInt10(opts.minTrades, 3),
|
|
77
77
|
min_win_rate: opts.minWinRate,
|
|
78
78
|
min_volume: opts.minVolume,
|
|
79
|
-
size: parseInt10(opts.size,
|
|
79
|
+
size: parseInt10(opts.size, 20),
|
|
80
80
|
});
|
|
81
81
|
emit(r, opts);
|
|
82
82
|
} catch (err) { emitError(err, opts); }
|
|
@@ -1,24 +1,35 @@
|
|
|
1
1
|
import { callTool } from '../mcp-client.js';
|
|
2
2
|
import { emit, emitError } from '../format.js';
|
|
3
3
|
import { parseInt10 } from '../util.js';
|
|
4
|
+
import { addTool } from './tool-command.js';
|
|
4
5
|
|
|
5
6
|
export function registerPolymarket(program) {
|
|
6
7
|
const cmd = program
|
|
7
8
|
.command('polymarket')
|
|
8
9
|
.alias('pm')
|
|
9
|
-
.description('Polymarket prediction-market analytics (markets, traders, smart money)');
|
|
10
|
+
.description('Polymarket prediction-market analytics (markets, traders, smart money, tape, order book, settlements, archive)');
|
|
10
11
|
|
|
11
12
|
cmd
|
|
12
13
|
.command('markets')
|
|
13
|
-
.description('Trending Polymarket markets ranked by 24h volume')
|
|
14
|
-
.option('--
|
|
15
|
-
.option('--
|
|
14
|
+
.description('Trending Polymarket markets ranked by 24h volume (or --view search / market)')
|
|
15
|
+
.option('--view <v>', 'trending (default) | search (by slug) | market (one by --condition-id)')
|
|
16
|
+
.option('--category <c>', 'trending: Crypto | Sports | Politics | Pop-Culture | Tech | all (default all)')
|
|
17
|
+
.option('--query <q>', 'search: part of the market slug')
|
|
18
|
+
.option('--active <bool>', 'search: true = only active, false = only closed')
|
|
19
|
+
.option('--offset <n>', 'search: rows to skip')
|
|
20
|
+
.option('--condition-id <id>', 'market: the condition id')
|
|
21
|
+
.option('--limit <n>', 'Max markets (trending default 10, max 30; search default 50, max 100)')
|
|
16
22
|
.option('--json', 'Emit JSON')
|
|
17
23
|
.action(async (opts) => {
|
|
18
24
|
try {
|
|
19
25
|
const r = await callTool('polymarket_markets', {
|
|
26
|
+
view: opts.view,
|
|
20
27
|
category: opts.category,
|
|
21
|
-
|
|
28
|
+
query: opts.query,
|
|
29
|
+
active: opts.active,
|
|
30
|
+
offset: opts.offset,
|
|
31
|
+
condition_id: opts.conditionId,
|
|
32
|
+
limit: opts.limit,
|
|
22
33
|
});
|
|
23
34
|
emit(r, opts);
|
|
24
35
|
} catch (err) { emitError(err, opts); }
|
|
@@ -71,4 +82,93 @@ export function registerPolymarket(program) {
|
|
|
71
82
|
emit(r, opts);
|
|
72
83
|
} catch (err) { emitError(err, opts); }
|
|
73
84
|
});
|
|
85
|
+
|
|
86
|
+
const FROM = ['--from-ms <ms>', 'Epoch milliseconds, inclusive'];
|
|
87
|
+
const TO = ['--to-ms <ms>', 'Epoch milliseconds, EXCLUSIVE'];
|
|
88
|
+
const CURSOR = ['--cursor <c>', 'next_cursor from the previous page'];
|
|
89
|
+
|
|
90
|
+
addTool(cmd, 'market-trades <condition_id>', {
|
|
91
|
+
tool: 'polymarket_market_trades',
|
|
92
|
+
args: ['condition_id'],
|
|
93
|
+
desc: 'One market\'s trades with the wallet behind each, newest first (one row = one order\'s fill)',
|
|
94
|
+
options: [FROM, TO, CURSOR, ['--limit <n>', 'Rows per page (default 100)']],
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
addTool(cmd, 'tape', {
|
|
98
|
+
tool: 'polymarket_tape',
|
|
99
|
+
desc: 'Raw L2 event tape of outcome tokens over one window of at most 24 hours, oldest first',
|
|
100
|
+
options: [
|
|
101
|
+
['--token-id <id>', 'One outcome token id (decimal), not a condition_id'],
|
|
102
|
+
['--token-ids <list>', 'Comma-separated outcome token ids, at most 100'],
|
|
103
|
+
['--from-ms <ms>', 'Required. Window start, epoch ms, inclusive'],
|
|
104
|
+
['--to-ms <ms>', 'Required. Window end, epoch ms, exclusive, at most 24h after --from-ms'],
|
|
105
|
+
['--event-type <t>', 'book | price_change | trade | tick_size_change | status (strongly recommended)'],
|
|
106
|
+
CURSOR,
|
|
107
|
+
['--limit <n>', 'Events per page (default 100)'],
|
|
108
|
+
],
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
addTool(cmd, 'orderbook <token_id>', {
|
|
112
|
+
tool: 'polymarket_orderbook',
|
|
113
|
+
args: ['token_id'],
|
|
114
|
+
desc: 'Order-book snapshot of one outcome token at or before --ts (latest when omitted)',
|
|
115
|
+
options: [
|
|
116
|
+
['--ts <ms>', 'As-of epoch milliseconds'],
|
|
117
|
+
['--depth <n>', 'Levels per side, 1-25 (default 25)'],
|
|
118
|
+
],
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
addTool(cmd, 'market-stats <token_id>', {
|
|
122
|
+
tool: 'polymarket_market_stats',
|
|
123
|
+
args: ['token_id'],
|
|
124
|
+
desc: 'Tape summary of one outcome token: events, trades, volume in shares, first and last recorded time',
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
addTool(cmd, 'settlement <condition_id>', {
|
|
128
|
+
tool: 'polymarket_settlement',
|
|
129
|
+
args: ['condition_id'],
|
|
130
|
+
desc: 'On-chain resolution of one market ([] = the chain has not resolved it)',
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
addTool(cmd, 'settlements', {
|
|
134
|
+
tool: 'polymarket_settlements_bulk',
|
|
135
|
+
desc: 'On-chain resolutions of many markets, oldest resolution first',
|
|
136
|
+
options: [
|
|
137
|
+
FROM, TO,
|
|
138
|
+
['--slug-prefix <p>', 'Only markets whose slug starts with this, e.g. btc-updown-5m-'],
|
|
139
|
+
CURSOR,
|
|
140
|
+
['--limit <n>', 'Rows per page (default 100)'],
|
|
141
|
+
],
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
addTool(cmd, 'archive', {
|
|
145
|
+
tool: 'polymarket_archive',
|
|
146
|
+
desc: 'Index of the Parquet L2 archive, or a 7-day download link for one file (--view url)',
|
|
147
|
+
options: [
|
|
148
|
+
['--view <v>', 'datasets | url (default datasets)'],
|
|
149
|
+
['--stream <s>', 'book_events | trades | l1_quotes (required for url)'],
|
|
150
|
+
['--date <d>', 'url: the UTC day, YYYY-MM-DD'],
|
|
151
|
+
['--date-from <d>', 'datasets: first UTC day, inclusive'],
|
|
152
|
+
['--date-to <d>', 'datasets: last UTC day, inclusive'],
|
|
153
|
+
['--asset <a>', 'Family files only, e.g. btc (with --tenor)'],
|
|
154
|
+
['--tenor <t>', 'Family files only, e.g. 5m (with --asset)'],
|
|
155
|
+
['--limit <n>', 'datasets: files per page (default 50)'],
|
|
156
|
+
['--offset <n>', 'datasets: skip this many files'],
|
|
157
|
+
],
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
addTool(cmd, 'leaderboard', {
|
|
161
|
+
tool: 'polymarket_leaderboard',
|
|
162
|
+
desc: 'Wallets ranked by realized P&L, hit rate, volume or trade count',
|
|
163
|
+
options: [
|
|
164
|
+
['--category <c>', 'all | Crypto | Sports | Politics | Pop-Culture | Tech (default all)'],
|
|
165
|
+
['--window <w>', '24h | 7d | 30d | all (default all)'],
|
|
166
|
+
['--sort <s>', 'realized_pnl | realized_pnl_window | hit_rate | resolved | volume_all | trades_all | last_seen | markets | ...'],
|
|
167
|
+
['--min-resolved <n>', 'Minimum resolved markets (default 20)'],
|
|
168
|
+
['--min-volume-usd <usd>', 'Minimum lifetime volume in USD'],
|
|
169
|
+
['--min-avg-usd <usd>', 'Minimum average trade in USD (20 drops bots)'],
|
|
170
|
+
['--limit <n>', 'Rows per page (default 20, max 50)'],
|
|
171
|
+
['--offset <n>', 'Rows to skip, 0-1000'],
|
|
172
|
+
],
|
|
173
|
+
});
|
|
74
174
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { addTool } from './tool-command.js';
|
|
2
|
+
|
|
3
|
+
export function registerSearch(program) {
|
|
4
|
+
addTool(program, 'search <q>', {
|
|
5
|
+
tool: 'search',
|
|
6
|
+
args: ['q'],
|
|
7
|
+
desc: 'Search everything by name, symbol, address, ENS name or polymarket.com link: tokens, wallets and entities, HL traders, vaults, builders, Polymarket wallets and markets',
|
|
8
|
+
options: [['--limit <n>', 'Rows per section, 1-20 (default 5)']],
|
|
9
|
+
});
|
|
10
|
+
}
|