@vike-io/cli 0.13.1 → 0.15.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.
Files changed (59) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/README.md +33 -19
  3. package/package.json +4 -4
  4. package/skills/vike/SKILL.md +144 -192
  5. package/skills/vike-alerts-setup/SKILL.md +37 -6
  6. package/skills/vike-alerts-webhook/SKILL.md +15 -8
  7. package/skills/vike-candles/SKILL.md +9 -2
  8. package/skills/vike-core/SKILL.md +16 -12
  9. package/skills/vike-hl-position-match/SKILL.md +8 -8
  10. package/skills/vike-hl-top-traders/SKILL.md +46 -11
  11. package/skills/vike-perp-funding/SKILL.md +82 -0
  12. package/skills/vike-perp-overview/SKILL.md +69 -0
  13. package/skills/vike-polymarket-market-detail/SKILL.md +2 -1
  14. package/skills/vike-polymarket-markets/SKILL.md +12 -7
  15. package/skills/vike-polymarket-smart-money/SKILL.md +38 -13
  16. package/skills/vike-polymarket-trader/SKILL.md +23 -20
  17. package/skills/vike-smart-money-discovery/SKILL.md +26 -32
  18. package/skills/vike-stream/SKILL.md +98 -0
  19. package/skills/vike-token-holders/SKILL.md +2 -1
  20. package/skills/vike-token-research/SKILL.md +22 -14
  21. package/skills/vike-token-screener/SKILL.md +35 -28
  22. package/skills/vike-token-transfers/SKILL.md +21 -11
  23. package/skills/vike-wallet-balances/SKILL.md +19 -13
  24. package/skills/vike-wallet-batch/SKILL.md +18 -14
  25. package/skills/vike-wallet-compare/SKILL.md +2 -0
  26. package/skills/vike-wallet-counterparties/SKILL.md +5 -1
  27. package/skills/vike-wallet-discover/SKILL.md +17 -10
  28. package/skills/vike-wallet-ens/SKILL.md +8 -4
  29. package/skills/vike-wallet-label-provenance/SKILL.md +25 -16
  30. package/skills/vike-wallet-pnl-history/SKILL.md +4 -1
  31. package/skills/vike-wallet-portfolio/SKILL.md +23 -21
  32. package/skills/vike-wallet-summary/SKILL.md +22 -9
  33. package/skills/vike-wallet-trace/SKILL.md +15 -11
  34. package/skills/vike-wallet-transactions/SKILL.md +3 -1
  35. package/skills.sh.json +17 -15
  36. package/src/auth.js +1 -1
  37. package/src/commands/alerts.js +85 -15
  38. package/src/commands/call.js +32 -0
  39. package/src/commands/candles.js +11 -15
  40. package/src/commands/doctor.js +4 -4
  41. package/src/commands/hl.js +274 -0
  42. package/src/commands/init.js +1 -1
  43. package/src/commands/labels.js +1 -1
  44. package/src/commands/perp.js +10 -9
  45. package/src/commands/polymarket.js +105 -5
  46. package/src/commands/search.js +10 -0
  47. package/src/commands/stream.js +308 -0
  48. package/src/commands/token.js +2 -0
  49. package/src/commands/tool-command.js +27 -0
  50. package/src/commands/wallet.js +24 -3
  51. package/src/index.js +10 -1
  52. package/src/mcp-client.js +37 -16
  53. package/skills/vike-cross-venue-perps/SKILL.md +0 -52
  54. package/skills/vike-hl-trader-profile/SKILL.md +0 -65
  55. package/skills/vike-perp-funding-arb/SKILL.md +0 -53
  56. package/skills/vike-perp-screener/SKILL.md +0 -48
  57. package/skills/vike-perp-spread-arb/SKILL.md +0 -38
  58. package/skills/vike-polymarket-screener/SKILL.md +0 -59
  59. package/skills/vike-router/SKILL.md +0 -54
@@ -21,9 +21,16 @@ vike-data candles hl <symbol>
21
21
  [--dex <name>] # HIP-3 builder DEX; default HL (the core venue)
22
22
  [--start <iso|epoch-ms>] [--end <iso|epoch-ms>] # half-open [start, end)
23
23
  [--limit N] # default 500, max 5000
24
+ [--view export] # the same, limit defaults to 5000
24
25
  [--json]
26
+
27
+ vike-data candles hl --view latest [--market perp|spot] [--dex <name>] # the newest 1m bar of EVERY symbol
28
+ # that traded in the last hour (may still be forming)
25
29
  ```
26
30
 
31
+ Live closed bars as they happen: `vike-data stream hl --channel hl.candles --filter coin=BTC,ETH --filter interval=1m`
32
+ (also `market=perp|spot`, `dex=HL`; see `vike-stream`).
33
+
27
34
  Polymarket, ONE outcome token (a probability, 0-1):
28
35
 
29
36
  ```bash
@@ -41,7 +48,7 @@ vike-data candles polymarket <token_id>
41
48
  | "Hourly BTC perp candles, last week" | `vike-data candles hl BTC --interval 1h --limit 168` |
42
49
  | "HYPE spot daily candles" | `vike-data candles hl HYPE --market spot --interval 1d` |
43
50
  | "4h ETH, 200 bars" | `vike-data candles hl ETH --interval 4h --limit 200` |
44
- | "Price history of the YES outcome of market X" | get `clob_token_ids` from `vike-data polymarket market <condition_id>`, then `vike-data candles polymarket <token_id> --interval 1h` |
51
+ | "Price history of the YES outcome of market X" | take the leg's `token_id` from `outcomes[]` in `vike-data polymarket markets` (or `clob_token_ids` in `vike-data polymarket market <condition_id>`), then `vike-data candles polymarket <token_id> --interval 1h` |
45
52
 
46
53
  ## Output
47
54
 
@@ -50,7 +57,7 @@ Polymarket: `ts`, `open`, `high`, `low`, `close`, `volume`, `trades`, oldest fir
50
57
 
51
58
  ## Pitfalls
52
59
 
53
- - Polymarket takes an **outcome token id**, not a `condition_id`. A condition id returns nothing useful; read the token ids off `clob_token_ids` in `vike-data polymarket market`.
60
+ - Polymarket takes an **outcome token id**, not a `condition_id`. A condition id returns nothing useful; read the token ids off `outcomes[].token_id` in `vike-data polymarket markets` or `clob_token_ids` in `vike-data polymarket market`.
54
61
  - Polymarket has no cursor: a window wider than `--limit` is truncated at the **old** end. Raise `--from` to reach the recent end.
55
62
  - Polymarket `--from` / `--to` are epoch **milliseconds**; HL `--start` / `--end` also accept ISO-8601.
56
63
  - HL buckets are left-aligned UTC and the window is half-open.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: vike-core
3
- description: Install-first skill — authentication, setup, and CLI conventions for the vike toolkit. Use when you see any `vike-data <cmd>` reference or the user mentions on-chain analytics, Hyperliquid perps, options flow, or prediction markets.
3
+ description: Install-first skill — authentication, setup, and CLI conventions for the vike toolkit. Use when you see any `vike-data <cmd>` reference or the user mentions on-chain analytics, Hyperliquid perps, or prediction markets.
4
4
  metadata:
5
5
  openclaw:
6
6
  requires:
@@ -37,9 +37,9 @@ Get an API key at https://vike.io/account?tab=api-keys
37
37
  ## Verify
38
38
 
39
39
  ```bash
40
- vike-data doctor # Node version + API key + endpoint reachability + tool count
41
- vike-data whoami # which key is in use (masked)
42
- vike-data schema --pretty # full command list with flags
40
+ vike-data doctor # Node version + API key (masked, with its source) + endpoint reachability + tool count
41
+ vike-data schema --pretty # every MCP tool with its parameters
42
+ vike-data --help # command list; add --help to any command for its flags
43
43
  ```
44
44
 
45
45
  ## Conventions
@@ -47,21 +47,25 @@ vike-data schema --pretty # full command list with flags
47
47
  - All commands accept `--json` for pipe-friendly output. Without it, you get a human-readable table.
48
48
  - Addresses: pass full 0x-prefixed hex (42 chars). Never truncate when reporting back to the user.
49
49
  - USD amounts: integers/decimals (e.g. `--min-usd 10000`).
50
- - Chain identifiers: `eth`, `bsc`, `base`, `arb`, `hyper`, `btc`, `sol`, `tron`, `xmr`, `zec`, `dash` (depending on the command — some only support a subset).
51
- - Time windows: `24h`, `7d`, `30d`, `90d`, `all` (per command; check `vike-data <cmd> --help`).
50
+ - Chain identifiers: `ethereum`, `bsc`, `base` on the token and wallet commands (`wallet discover` and `wallet balances` serve ethereum and bsc only; `wallet first-funder` and `exchange-usage` also take `hyperevm`; `alerts` takes `eth`, `bsc`, `base` or `hyperevm`). Base coverage is narrower than the flag suggests: documented for token transfers and `wallet batch`, not for the per-wallet transfer commands, so an empty Base result means "not covered". Non-EVM chains and Arbitrum are not served. Check `vike-data <cmd> --help` for the exact list.
51
+ - Time windows: `24h`, `7d`, `30d`, `90d`, `all` (per command; check `vike-data <cmd> --help`). Windows are counted in UTC calendar days.
52
52
 
53
53
  ## Errors
54
54
 
55
55
  - `No API key` → run `vike-data init` or set `VIKE_API_KEY`.
56
- - `MCP error -32000: Hourly rate limit exceeded` → you hit the per-key cap; wait or upgrade your plan.
57
- - `Network error` / timeout → check `vike-data doctor`; the endpoint is `https://vike.io/mcp`.
56
+ - `MCP error -32000: Hourly rate limit exceeded` → you hit the per-key cap of 20,000 requests per rolling hour; the window slides, so capacity returns continuously.
57
+ - `Network error` / timeout → check `vike-data doctor`; the endpoint is `https://data.vike.io/mcp`.
58
58
  - `503` from a tool → upstream data source temporarily down; retry in 30s.
59
+ - A tool that refuses its input (`{"error": ...}`) exits 1 in every mode, `--json` included: read the message, it names the fix.
60
+ - A tool with no command of its own: `vike-data call <tool> --args '{"key":"value"}'` prints its raw result.
61
+ - `vike-data stream` exits 1 on `replaced (4410)`: another program took this key's connection on that address; give each program its own key. On `HTTP 401` or `4401` fix the key. Every other drop reconnects by itself.
59
62
 
60
63
  ## Cost awareness
61
64
 
62
- Each tool call consumes credits against your API key quota. Cheap calls: `token search`, `wallet summary`, `alerts list`. Heavier: `wallet discover`, `hl_perp_top_traders` (large result sets).
65
+ Credits are an accounting figure on each call and never block one. The limit is 20,000 requests per rolling hour per key, shared by the MCP server and the REST API. Free (0 credits): `token search`, `alerts list`, `alerts channels`. Heaviest: `wallet trace` (4), then `token screener`, `wallet compare`, `wallet balances` (3).
63
66
 
64
- ## When to use a router skill vs a task skill
67
+ ## Which skill to use
65
68
 
66
- - **Router skills** (`vike-router`, topic-level) — when the user is exploring or unsure which command they need.
67
- - **Task skills** (`vike-smart-money-discovery`, `vike-perp-funding-arb`, etc.) — when the user has a specific question that maps to a known workflow.
69
+ - The umbrella skill `vike` holds the routing table — use it when the user is exploring or unsure which command they need.
70
+ - Task skills (`vike-smart-money-discovery`, `vike-perp-funding`, etc.) — when the user has a specific question that maps to a known workflow.
71
+ - If unsure between two, prefer the task skill (a workflow) over the per-tool skill (one command). For raw data, use the per-tool skill with `--json`.
@@ -12,12 +12,12 @@ Find the wallet(s) holding an open Hyperliquid perp position that match a share
12
12
 
13
13
  ```bash
14
14
  vike-data perp find-position
15
- --coin <SYM> # e.g. BTC, ETH, SOL
15
+ --coin <SYM> # the asset symbol, e.g. BTC, ETH, SOL (sent to the tool as `symbol`)
16
16
  --side long|short
17
17
  --leverage <X> # e.g. 25
18
18
  --entry <PRICE> # entry price from the card
19
19
  [--mark <PRICE>] # current mark price — sharpens tie-break when multiple wallets share entry
20
- [--limit N] # max matches, default 10, max 50
20
+ [--limit N] # max matches, default 50, max 500
21
21
  [--json]
22
22
  ```
23
23
 
@@ -49,11 +49,11 @@ The response includes `tolerance_used` so the caller knows which band matched (`
49
49
  {
50
50
  "match_count": 3,
51
51
  "tolerance_used": "tight", // tight | loose | fallback | no_match
52
- "query": { "coin": "ETH", "side": "long", "leverage": 25, "entry_price": 3210, "mark_price_hint": 3215 },
52
+ "query": { "symbol": "ETH", "side": "long", "leverage": 25, "entry_price": 3210, "mark_price_hint": 3215 },
53
53
  "matches": [
54
54
  {
55
55
  "address": "0x...",
56
- "coin": "ETH", "side": "long",
56
+ "symbol": "ETH", "side": "long",
57
57
  "snapshot_ts": 1716700000, // unix seconds — how fresh the snapshot is
58
58
  "size_token": 12.5, "size_usd": 40250,
59
59
  "entry_price": 3209.8, "mark_price": 3215.3,
@@ -71,16 +71,16 @@ The response includes `tolerance_used` so the caller knows which band matched (`
71
71
  - **Multiple matches at the exact same entry** (e.g. five wallets long ETH at 3210.00) — popular round-number entries collide. Treat as ambiguous; surface all and let the user disambiguate by size or address. Don't claim "this is the wallet" when `match_count > 1` in the tight band.
72
72
  - **`tolerance_used: fallback`** — the closest match is >0.5% off the queried entry. The card might be from a previous fill that's since been added to (size-weighted entry moves on add) or from a different exchange. Treat as low-confidence.
73
73
  - **`tolerance_used: no_match`** — the position is closed, the entry was from a margin-changing event, or the wallet was outside our HL coverage. Don't suggest a wallet anyway.
74
- - **`snapshot_ts`** is the snapshot time of that position row. The pipeline refreshes <5 min behind live; older `snapshot_ts` doesn't mean the position is stale, just that the wallet hasn't transacted since.
74
+ - **`snapshot_ts`** is the snapshot time of that position row. Only positions seen within 15 minutes of the newest snapshot batch are matched (older rows are ghosts of closed positions), so a match is a position that was open in the last quarter hour; it does not mean the position is still open now.
75
+ - **Response keys:** each match and the `query` block name the asset `symbol`. Servers before 2026-10-19 called it `coin` (or `asset`) and renamed it on 2026-10-19, so read `symbol` and fall back to `coin` if it is missing.
75
76
 
76
77
  ## Anti-patterns
77
78
 
78
79
  - Don't fabricate matches when the tool returns `match_count: 0`. Say "no open position matches that share card" — closed positions, post-card adds, or non-HL cards all produce empty results.
79
80
  - Don't strip the address when displaying — share-card investigations always want the full 0x...40hex (users copy-paste it).
80
- - Don't infer trader skill from a single share-card match. Use `vike-data perp top-traders` or `vike-data wallet summary` for profile context.
81
+ - Don't infer trader skill from a single share-card match. Use `vike-data perp top-traders` for leaderboard context (see `vike-hl-top-traders` for what it can and cannot say about one address).
81
82
 
82
83
  ## Pairs well with
83
84
 
84
- - `vike-wallet-summary` — once you have the address, get the trader's HL profile + multi-chain identity.
85
- - `vike-hl-top-traders` — check if the matched wallet is on a leaderboard.
85
+ - `vike-hl-top-traders` — check if the matched wallet is on a leaderboard. (`vike-data wallet summary` has no Hyperliquid data: it shows on-chain transfer activity on one chain only.)
86
86
  - `vike-wallet-label-provenance` — find out if the wallet is a known CEX/fund/MM rather than a retail trader.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: vike-hl-top-traders
3
- description: Rank top Hyperliquid perp traders by PnL / ROI / win rate / volume / trade count / drawdown across a window. Use when the user asks "top HL traders" / "best Hyperliquid wallets" / "HL leaderboard".
3
+ description: Rank top Hyperliquid perp traders by PnL / ROI / win rate / volume / trade count / drawdown across a window, and check whether one HL address is on that leaderboard. Use when the user asks "top HL traders" / "best Hyperliquid wallets" / "HL leaderboard" / "is this trader any good" / "profile this address" / "what's this wallet's HL track record".
4
4
  allowed-tools: Bash(vike-data:*)
5
5
  ---
6
6
 
@@ -13,10 +13,10 @@ vike-data perp top-traders
13
13
  [--window 1d|7d|30d|all]
14
14
  [--sort pnl|roi|win_rate|volume|trade_count|drawdown]
15
15
  [--order asc|desc]
16
- [--min-trades N] # default 3
17
- [--min-win-rate P] # 0-100 percent
16
+ [--min-trades N] # default 3; 0-2 are treated as 3
17
+ [--min-win-rate P] # percent, 0-100
18
18
  [--min-volume USD]
19
- [--size N] # max 20
19
+ [--size N] # default 20, max 100
20
20
  [--json]
21
21
  ```
22
22
 
@@ -30,23 +30,58 @@ vike-data perp top-traders
30
30
  | "Most active traders today" | `--window 1d --sort trade_count` |
31
31
  | "Smallest drawdown winners" | `--sort drawdown --order asc --min-trades 20` |
32
32
 
33
- ## Output columns
33
+ ## Output
34
34
 
35
- `address`, `pnl_usd`, `roi_pct`, `win_rate_pct`, `volume_usd`, `trade_count`, `max_drawdown_usd`.
35
+ An object `{ "traders": [...], "total": N }`; each trader:
36
+
37
+ `address`, `total_realized_pnl` (USD), `roi_pct`, `win_rate_pct`, `long_win_rate_pct`, `short_win_rate_pct`, `win_count`, `loss_count`, `trade_count`, `total_volume` (USD), `long_pnl`, `short_pnl`, `max_drawdown_pct`, `account_value` (USD), `avg_leverage`.
38
+
39
+ All `*_pct` fields are percents: `12.5` means 12.5%. (Before 2026-10-19 `roi_pct` and `max_drawdown_pct` came back 100× too large; a transcript showing a 1,750% ROI is from that period.) `avg_leverage` is not populated (reads 0): ignore it. There is no `pnl_usd` and no `max_drawdown_usd`.
36
40
 
37
41
  ## Reading
38
42
 
39
- - `roi_pct` here is **realized + unrealized** (uses live position marks).
43
+ - **`roi_pct` is realized only.** It is the window's realized PnL divided by the wallet's CURRENT account value. Open positions are not counted, and a wallet that has since withdrawn most of its equity looks better than it was (and a recent deposit makes it look worse).
44
+ - **`max_drawdown_pct` is account-level and all-time**, built from the account's hourly equity history. It does not change with `--window`.
45
+ - **Windows are UTC days:** `1d`, `7d`, `30d` mean today plus the previous 1, 7 or 30 days; `all` is the last 365 days.
46
+ - **`trade_count` counts completed trades only**, filed under the UTC day the position opened. A trade still open, or opened before the window and closed inside it, is not counted, so a wallet's count here differs from a per-wallet trade summary (which counts both).
40
47
  - A wallet with 90% win rate on 4 trades is statistical noise. Min trades 10–20 for any "skill" claim.
41
48
  - Top by PnL ≠ top by ROI. Whales win big in $ but small in % terms; ROI sort surfaces smaller-account discretionary skill.
42
- - `max_drawdown_usd` is peak-to-trough realized — does NOT include unrealized intra-position drawdown.
49
+ - The leaderboard rewards survivors: wallets that blew up don't appear, so the PnL distribution is right-skewed.
50
+
51
+ ## Is this specific address any good?
52
+
53
+ Ask the wallet directly: `vike-data hl wallet <address> --json` (equity, open positions, cohort labels, risk metrics, lifetime flow) and `vike-data hl wallet <address> --view trades_summary --window 30d --json` (closed-trade statistics). `top-traders` cannot filter by address; to see where it ranks, scan the leaderboard for it:
54
+
55
+ ```bash
56
+ vike-data perp top-traders --window 30d --sort pnl --size 20 --json
57
+ vike-data perp top-traders --window 7d --sort pnl --size 20 --json
58
+ vike-data perp top-traders --window 30d --sort roi --min-trades 10 --size 20 --json
59
+ vike-data perp top-traders --window 30d --sort win_rate --min-trades 10 --size 20 --json
60
+ ```
61
+
62
+ - **Found** → report that row for that window and sort (all columns above). That is the whole profile you can give.
63
+ - **Not found** → say "not in the top 20 for this window and sort". Only the top 20 of thousands of wallets ever shows, so absence says nothing about quality.
64
+ - `vike-data wallet summary` has **no Hyperliquid data** (it reads on-chain transfers on one chain): don't present it as the HL profile. `vike-data labels <addr>` shows whether the address is a known entity.
65
+ - The REST API has per-wallet Hyperliquid routes (`/v1/hyperliquid/wallets/{address}`, `.../trades/summary`), but no CLI command or MCP tool exposes them yet. Say so if the user needs fills, funding or per-trade history.
66
+
67
+ Classification of a found wallet:
68
+
69
+ | Pattern | Label |
70
+ |---|---|
71
+ | Top-20 PnL + high ROI + many trades + low drawdown | **Sharp** |
72
+ | Top-20 PnL + low ROI + huge volume | **Whale** (size matters more than skill) |
73
+ | High win rate on <10 trades | **Unverified — too few data points** |
74
+ | One big trade dominates PnL (`win_count` small, PnL large) | **One-shot** (lucky directional bet) |
43
75
 
44
76
  ## Anti-patterns
45
77
 
46
78
  - Don't claim a wallet is "the best HL trader" from a 1d window. Anything < 30d is short-term.
47
- - The leaderboard rewards survivors — wallets that blew up don't appear, so PnL distribution is right-skewed survivorship bias.
79
+ - Don't claim "this is one of the best HL traders" from win rate alone — need volume + trade count for context.
80
+ - Pass an exact `--sort` value: a typo is not rejected, it silently falls back to a PnL ranking.
81
+ - Don't describe a wallet outside the top 20 as bad.
48
82
 
49
83
  ## Pairs well with
50
84
 
51
- - `vike-hl-trader-profile` to drill into a specific address from the leaderboard
52
- - `vike-perp-funding-arb` to see if leaders are positioned against funding
85
+ - `vike-hl-position-match` to find the wallet behind a share card first
86
+ - `vike-perp-funding` to see whether the leaders are positioned against funding
87
+ - `vike-candles` for the price action behind a period of PnL
@@ -0,0 +1,82 @@
1
+ ---
2
+ name: vike-perp-funding
3
+ description: Perpetual-futures funding rates across CEX venues and Hyperliquid — the top cross-venue funding-arb opportunities, and the per-venue funding of one symbol. Use when the user asks "any funding arb today" / "where to long-short X for funding" / "highest funding rates" / "where to trade X" / "compare BTC perp across exchanges" / "best venue for ETH long".
4
+ allowed-tools: Bash(vike-data:*)
5
+ ---
6
+
7
+ # vike-perp-funding
8
+
9
+ Funding rates across the CEX venues and Hyperliquid, from one tool (`perp funding`) in two modes. The rows name the exchange; there is no mark price and no bid/ask in either mode.
10
+
11
+ ## Commands
12
+
13
+ ### A. Arb opportunities (no symbol)
14
+
15
+ ```bash
16
+ vike-data perp funding --json
17
+ ```
18
+
19
+ Returns **at most 5** pre-ranked rows where the spread between the highest-funding and the lowest-funding venue is ≥ 0.3% per day (spreads of more than ~10% per day are dropped as artifacts). Each row:
20
+ - `symbol`
21
+ - `long_exchange`, `long_daily_pct` (the venue to be long: lowest funding)
22
+ - `short_exchange`, `short_daily_pct` (the venue to be short: highest funding)
23
+ - `spread_daily_pct`
24
+
25
+ **These are pre-ranked and already normalised to daily % — cite the rows directly.** The list is a short top-5, not a full-market scan.
26
+
27
+ ### B. One symbol, every venue
28
+
29
+ ```bash
30
+ vike-data perp funding --symbol BTC --json
31
+ ```
32
+
33
+ One row per venue: `exchange`, `symbol`, `funding_rate`, `interval_h`, `next_ts`, `vol_24h_usd`.
34
+
35
+ `funding_rate` is the **raw per-interval rate as a fraction** (0.0001 = 0.01% per interval) and venues use different intervals (`interval_h`: Hyperliquid 1h, most CEXs 8h). **Normalise yourself before comparing venues:**
36
+
37
+ ```
38
+ daily_pct = funding_rate × (24 / interval_h) × 100
39
+ annualised_pct = daily_pct × 365
40
+ ```
41
+
42
+ `vol_24h_usd` is the venue's 24h perp notional: use it as the liquidity check.
43
+
44
+ ## Venue comparison (one symbol)
45
+
46
+ Run B, normalise, then report:
47
+
48
+ > **`<SYM>` perp — funding by venue**
49
+ >
50
+ > | Venue | Funding per interval | Interval | Daily % | 24h volume |
51
+ > |---|---|---|---|---|
52
+ > | ... | ... | ... | ... | ... |
53
+ >
54
+ > **Best venue to long**: `<X>` (lowest daily funding, i.e. longs pay least or receive)
55
+ > **Best venue to short**: `<Y>` (highest daily funding, i.e. shorts receive most)
56
+ > **Funding edge**: long-short = X%/day, gross
57
+
58
+ - Positive funding → longs pay shorts: a good place to be short. Negative → shorts pay longs: a good place to be long.
59
+ - A divergence above 0.5%/day between two venues with similar liquidity is an edge worth quantifying.
60
+
61
+ ## Reading the arb
62
+
63
+ ```
64
+ spread_daily_pct = 0.42% → ~$420/day per $100k notional per leg, gross
65
+ (before fees, slippage, margin and transfer costs)
66
+ ```
67
+
68
+ A funding arb at 0.4–1% daily is real. Anything much higher on a liquid pair is usually a halted market or a venue artifact: check `vol_24h_usd` in mode B for both venues before calling it a trade.
69
+
70
+ ## Anti-patterns
71
+
72
+ - Don't quote a daily funding rate as "annualized" without converting (× 365). Be explicit about the unit.
73
+ - Funding flips every 1–8 hours depending on the venue. The number is the current rate, not a forecast — don't extrapolate without saying so.
74
+ - Spread < 0.3% daily is filtered out at the source (not enough to cover fees + execution). Don't try to lower the filter.
75
+ - Don't blindly pick the lowest-funding venue without checking `vol_24h_usd` — Hyperliquid funding looks great on small alts but the book can be thin.
76
+ - Don't read `funding_rate` of an 8h venue against a 1h venue without normalising.
77
+ - Don't promise a price comparison from this tool: for price gaps across venues use `vike-perp-overview` (`perp spreads`).
78
+
79
+ ## Pairs well with
80
+
81
+ - `vike-perp-overview` for cross-venue price gaps and the market snapshot
82
+ - `vike-hl-top-traders` to see how Hyperliquid's best traders are doing
@@ -0,0 +1,69 @@
1
+ ---
2
+ name: vike-perp-overview
3
+ description: Perp-market snapshot and cross-venue price spreads — the top funding arbs, the widest perp price gaps between venues, and the Hyperliquid leaderboard in one read. Use when the user asks "what's happening in perps today" / "perp market overview" / "any perp arb today" / "price differences across exchanges" / "where's X cheapest".
4
+ allowed-tools: Bash(vike-data:*)
5
+ ---
6
+
7
+ # vike-perp-overview
8
+
9
+ One-shot market overview for perpetuals, plus the cross-venue price-gap tool. The overview is exactly what these three tools return: funding arbs, price gaps and the HL leaderboard. There is **no CEX open-interest, market-wide volume or per-venue mark-price command** in the CLI; say so if asked (Hyperliquid open interest is `vike-data hl market --json`).
10
+
11
+ ## Price spreads
12
+
13
+ ```bash
14
+ vike-data perp spreads --json # up to 10 symbols with a cross-venue price gap >= 0.5%
15
+ vike-data perp spreads --symbol BTC --json # the same list, filtered to one symbol
16
+ ```
17
+
18
+ Rows: `symbol`, `buy_exchange`, `buy_price`, `sell_exchange`, `sell_price`, `spread_pct`. Pre-ranked: cite the rows directly.
19
+
20
+ - **"Spread" is perp vs perp across venues, not spot vs perp.** `buy_exchange` is the cheapest venue and `sell_exchange` the dearest for that symbol.
21
+ - **`--symbol` only filters the global top 10.** An empty answer means the symbol is not among today's widest gaps, not that its venues agree. Don't answer "where's X cheapest" from an empty result; say the tool only lists the 10 widest gaps.
22
+ - Outliers (> 400 bps off the cross-venue median) are filtered upstream — typically unit-mismatch listings like `1000SHIB` vs `SHIB`, or stale prices.
23
+ - It reads the latest ticker snapshots: a row is a current snapshot, not a forecast.
24
+
25
+ `spread_pct = 0.7%` on a liquid pair is an opportunity **before** taker fees, slippage and the time to move inventory between venues. For the funding side of the same trade use `vike-perp-funding`.
26
+
27
+ ## Market snapshot (3 parallel calls)
28
+
29
+ ```bash
30
+ vike-data perp funding --json & # top funding-arb opportunities (max 5)
31
+ vike-data perp spreads --json & # widest cross-venue price gaps (max 10)
32
+ vike-data perp top-traders --window 1d --sort pnl --size 10 --json & # HL leaderboard
33
+ wait
34
+ ```
35
+
36
+ ### Report template
37
+
38
+ > **Perp market snapshot (HL leaderboard: today and yesterday, UTC)**
39
+ >
40
+ > **Top funding arbs (>0.3% daily spread)**
41
+ > - `BTC`: long Bybit @ -0.5%/d, short Hyperliquid @ +0.8%/d → spread 1.3%/d
42
+ > - ...
43
+ >
44
+ > **Widest cross-venue price gaps (>0.5%)**
45
+ > - `SOL`: buy Aster @ 138.20, sell OKX @ 139.05 → 0.61%
46
+ > - ...
47
+ >
48
+ > **Top HL traders, last 1d (by realized PnL)**
49
+ > - `0xabc...` +$X (`total_realized_pnl`), ROI Y%, rank #1 — ...
50
+ > - ...
51
+
52
+ ## When to skip the 3-call snapshot
53
+
54
+ - User asked about one symbol's funding or venues → `vike-perp-funding`.
55
+ - User asked about one HL trader → `vike-hl-top-traders`.
56
+ - User only wants price gaps → run `perp spreads` alone.
57
+
58
+ ## Anti-patterns
59
+
60
+ - Don't quote funding rates in 8h chunks when the tool returns daily % — be consistent (daily %).
61
+ - Don't present a price gap as "free money" without fees / transfer time.
62
+ - Trading 1000-token-suffix pairs without normalizing — `1000PEPE` on Binance ≠ `PEPE` on Bybit; if the spread looks insane it's probably this.
63
+ - "Top by PnL today" is noise for swing-trader narratives; only useful for "who's hot right now". Use 7d or 30d for skill claims, and remember `1d` covers today plus the previous UTC day, not a rolling 24 hours.
64
+ - Don't present the top-traders list as "the best traders": the leaderboard rewards survivors.
65
+
66
+ ## Pairs well with
67
+
68
+ - `vike-perp-funding` for the funding deep dive and one-symbol venue comparison
69
+ - `vike-hl-top-traders` for the leaderboard filters and how to read its columns
@@ -39,4 +39,5 @@ vike-data polymarket market 0x1234abcd...
39
39
  ## Pairs well with
40
40
 
41
41
  - `vike-polymarket-trader` — profile any interesting wallet you find in the top-wallets list
42
- - `vike-polymarket-smart-money mode=mispricings` — markets where cohort bought below current mid
42
+ - `vike-polymarket-smart-money` (`--mode mispricings`) — markets where cohort bought below current mid
43
+ - `vike-candles` — probability history: the market's `clob_token_ids` are the `token_id` values
@@ -9,10 +9,10 @@ allowed-tools: Bash(vike-data:*)
9
9
  ## Command
10
10
 
11
11
  ```bash
12
- vike-data polymarket markets [--category C] [--limit N] [--json]
12
+ vike-data polymarket markets [--category C] [--limit N] [--json] # limit default 10, max 30
13
13
  ```
14
14
 
15
- `C` is one of: `Crypto`, `Sports`, `Politics`, `Pop-Culture`, `Tech`, `all` (default).
15
+ `C` is one of: `Crypto`, `Sports`, `Politics`, `Pop-Culture`, `Tech`, `all` (default). Names are exact.
16
16
 
17
17
  ## Examples
18
18
 
@@ -22,23 +22,28 @@ vike-data polymarket markets --category Politics --limit 20
22
22
  vike-data pm markets --json # `pm` alias
23
23
  ```
24
24
 
25
- ## Output columns
25
+ ## Output
26
26
 
27
- `condition_id`, `slug`, `question`, `end_date`, `market_vol_24h` (USD), `liquidity`, plus per-outcome `outcome` / `mid` / `bid` / `ask` for both Yes and No legs.
27
+ One row per market, ranked by **24h volume only** (there is no liquidity or volatility ranking):
28
+
29
+ `condition_id`, `slug`, `question`, `end_date`, `ended` (true once `end_date` has passed), `volume_24h` (USD), `liquidity`, `latest_ts`, and `outcomes`: a list with one entry per outcome leg, each with `token_id`, `outcome` (Yes / No or the leg's name), `mid`, `bid`, `ask`, `snap_vol_24h`.
30
+
31
+ The `token_id` of each leg is what `vike-data candles polymarket <token_id>` needs, so candles need no extra detail call.
28
32
 
29
33
  ## Reading the data
30
34
 
31
35
  - `mid` is the midpoint price as a probability (0.0 to 1.0). `0.42` means "the market thinks 42% chance".
32
36
  - A bid/ask spread > 0.05 (5 cents) = thin liquidity; the price is noisier.
33
- - `end_date` is when the market resolves. Sort priority for action-oriented users: markets ending in the next 7 days.
37
+ - `end_date` is when the market resolves. Sort priority for action-oriented users: markets ending in the next 7 days. Check `ended`: a market that closed earlier today can still rank by its 24h volume.
34
38
 
35
39
  ## Anti-patterns
36
40
 
37
41
  - Don't quote `mid` as a percentage without saying so. "Yes is 0.42" is the raw probability; "42% chance" is the user-friendly translation.
38
42
  - For tiny markets (<$50k 24h volume) the quotes are often stale or one-sided. Skip them unless explicitly asked.
43
+ - Don't call a list of markets "what smart money is doing": for that use `polymarket smart-money`.
39
44
 
40
45
  ## Pairs well with
41
46
 
42
47
  - `vike-polymarket-market-detail` — deep-dive on one market once you have its condition_id
43
- - `vike-polymarket-smart-money` — see which markets cohort wallets are buying/selling
44
- - `vike-polymarket-screener` — composite multi-call screener
48
+ - `vike-polymarket-smart-money` — which markets cohort wallets are buying, and a full market overview
49
+ - `vike-candles` — probability history for a leg's `token_id`
@@ -1,20 +1,18 @@
1
1
  ---
2
2
  name: vike-polymarket-smart-money
3
- description: Smart-money signals on Polymarket. Two modes — flows (markets with largest net cohort inflow) or mispricings (markets where cohort bought meaningfully below current mid). Use when the user asks "what is smart money buying on Polymarket" or "any prediction-market alpha".
3
+ description: Smart-money signals on Polymarket, plus a one-pass market overview. Two modes — flows (markets with largest net cohort inflow) or mispricings (markets where the cohort bought meaningfully below the current mid); the overview combines them with trending markets. Use when the user asks "what is smart money buying on Polymarket", "any prediction-market alpha", "give me a Polymarket overview" or "what's happening in prediction markets today".
4
4
  allowed-tools: Bash(vike-data:*)
5
5
  ---
6
6
 
7
7
  # vike-polymarket-smart-money
8
8
 
9
- The "smart-money cohort" is wallets meeting all three criteria:
10
- - ≥ $1,000 lifetime realized PnL
11
- - ≥ 5 resolved markets (so hit-rate is meaningful)
12
- - ≥ $5,000 lifetime volume
9
+ The "smart-money cohort" is the set of wallets with at least $1,000 of realized PnL, at least 5 resolved markets and at least $5,000 of volume. The tool reports what that cohort is doing **in markets**. It does not return a list of top traders: for one trader use `vike-polymarket-trader`.
13
10
 
14
11
  ## Command
15
12
 
16
13
  ```bash
17
14
  vike-data polymarket smart-money --mode flows|mispricings [--hours N] [--category C] [--limit N] [--json]
15
+ # --hours 1-720 (default 24); --limit default 10, max 20; category names are exact
18
16
  ```
19
17
 
20
18
  ## Mode A — flows (default)
@@ -23,10 +21,9 @@ vike-data polymarket smart-money --mode flows|mispricings [--hours N] [--categor
23
21
  vike-data polymarket smart-money --mode flows --hours 24 --category all
24
22
  ```
25
23
 
26
- Markets with the largest **net buy** from cohort wallets in the last N hours.
27
- `net_flow = buy_inflow - sell_outflow`. Useful for "where is smart money concentrating today".
24
+ Markets with the largest **net buy** from cohort wallets in the last N hours. `net_inflow = buy_inflow − sell_outflow`, in dollars (not shares). Useful for "where is smart money concentrating today".
28
25
 
29
- Output: `condition_id`, `title`, `slug`, `smart_wallets` (cohort count), `buy_inflow_usd`, `sell_outflow_usd`, `trades`, `latest_yes_mid`.
26
+ Output: `condition_id`, `title`, `slug`, `smart_wallets` (cohort count), `buy_inflow`, `sell_outflow`, `net_inflow`, `trades`, `last_ts`, `yes_mid` (null when the market has no recorded mid: absent data, not zero). Best first by `net_inflow`.
30
27
 
31
28
  ## Mode B — mispricings
32
29
 
@@ -34,25 +31,53 @@ Output: `condition_id`, `title`, `slug`, `smart_wallets` (cohort count), `buy_in
34
31
  vike-data polymarket smart-money --mode mispricings --hours 24 --category Crypto
35
32
  ```
36
33
 
37
- Markets where cohort wallets recently bought meaningfully **below** the current mid — i.e. the market has moved away from where cohort got their fills.
34
+ Markets where cohort wallets recently bought meaningfully **below** the current mid — the market has since moved toward the cohort's entry. A market appears only if the cohort put in at least $500 and the mid is at least 0.03 in their favour.
38
35
 
39
- Output: `condition_id`, `title`, `slug`, `side` (Yes or No), `smart_avg_buy`, `current_mid`, `delta_pct`, `smart_buy_usd`.
36
+ Output: `condition_id`, `title`, `slug`, `smart_wallets`, `last_buy_ts`, `total_buy_value`, `side`, `avg_buy_price`, `current_mid`, `delta`, `buy_value`. Best first by `delta`.
40
37
 
41
- `delta_pct > 5` = cohort got in 5+ cents better than current. Potential edge if you think cohort was right.
38
+ - `delta = current_mid − avg_buy_price` for the side they bought, as a probability difference (0.05 = 5 cents). It records where the cohort was early; it is not a forecast.
39
+ - `side` is `YES` (the first outcome) or `NO` (the second), not literally Yes/No: on a two-team or Over/Under market take the names from the market.
40
+
41
+ ## Market overview (3 parallel calls)
42
+
43
+ For "give me a Polymarket overview" / "what's happening in prediction markets today":
44
+
45
+ ```bash
46
+ vike-data polymarket markets --category all --limit 10 --json &
47
+ vike-data polymarket smart-money --mode flows --hours 24 --json &
48
+ vike-data polymarket smart-money --mode mispricings --hours 24 --json &
49
+ wait
50
+ ```
51
+
52
+ > **Polymarket snapshot (last 24h)**
53
+ >
54
+ > **Top 5 trending markets by volume**
55
+ > - `<question>` — Yes mid `<m>` (from `outcomes[]`), `volume_24h` `$X` — ends `<end_date>`
56
+ >
57
+ > **Top 5 smart-money inflows**
58
+ > - `<title>` (`<slug>`) — `<smart_wallets>` cohort wallets, `net_inflow` `$X`, `yes_mid` `<m>`
59
+ >
60
+ > **Top 5 mispricings**
61
+ > - `<title>` (`<side>`) — cohort `avg_buy_price` `<p>`, `current_mid` `<m>`, `delta` `<d>`, `buy_value` `$X`
62
+
63
+ Trim aggressively if the user asked a narrower question. About 5 credits for the three calls.
42
64
 
43
65
  ## Reading
44
66
 
45
67
  - **Flows**: high net inflow + low `smart_wallets` count = concentrated bet (few wallets, big size). Higher conviction signal than diffuse inflow across 50 wallets.
46
- - **Mispricings**: high `delta_pct` is interesting only when paired with cohort that has a history in that category. Cross-check with `vike-polymarket-trader` on the top wallets.
68
+ - **Mispricings**: a large `delta` is interesting only when paired with a cohort that has a history in that category. Cross-check with `vike-polymarket-trader` on the top wallets.
69
+ - **Short-dated markets dominate.** Five-minute "up or down" markets resolve fast and show huge deltas: pass `--category` (or skip those slugs) when you want slower markets. Very short `--hours` windows (an hour or two) are noisy for the mispricing read.
70
+ - The category also scopes the cohort. An unknown category spelling returns an empty list, not an error.
47
71
 
48
72
  ## Anti-patterns
49
73
 
50
74
  - Don't treat "smart-money cohort" as omniscient. They're filtered for past performance — survivorship bias applies, especially in fast-moving political markets.
51
75
  - Mispricings can be slow-to-resolve. A 5% mispricing on a market resolving in 3 months might be efficient pricing for tail risk, not edge.
52
76
  - Don't combine the cohort definition with strict ROI filters — the cohort is built on realized PnL, not Sharpe.
77
+ - Don't report all three overview sections if the user asked a narrower question; trending markets that closed earlier today still rank by 24h volume, so check `ended` / `end_date` before recommending a position.
53
78
 
54
79
  ## Pairs well with
55
80
 
81
+ - `vike-polymarket-markets` — the trending list without the cohort view
56
82
  - `vike-polymarket-market-detail` — drill into a flagged market
57
83
  - `vike-polymarket-trader` — profile the top wallets active in flagged markets
58
- - `vike-polymarket-screener` — full multi-call market scan
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: vike-polymarket-trader
3
- description: Profile a Polymarket wallet — realized PnL across 24h / 7d / 30d / all, hit-rate on resolved markets, total volume, top categories traded, recent positions. Use when the user gives a Polymarket wallet address.
3
+ description: Profile a Polymarket wallet — realized PnL over a window, hit-rate on resolved markets, total volume, top categories traded, recent trades and open positions. Use when the user gives a Polymarket wallet address.
4
4
  allowed-tools: Bash(vike-data:*)
5
5
  ---
6
6
 
@@ -21,35 +21,38 @@ vike-data pm wallet 0xabcdef1234... --json # `pm` alias
21
21
 
22
22
  ## Output
23
23
 
24
- Per-wallet summary:
25
- - `realized_pnl_usd` (lifetime + windowed)
26
- - `hit_rate_pct` (resolved markets only)
27
- - `resolved_markets` (count — denominator for hit_rate)
28
- - `volume_all_usd`, `volume_<window>_usd`
29
- - `trades_all`, `trades_<window>`
30
- - Category breakdown (Crypto/Sports/Politics/etc.)
31
- - Last seen timestamp
24
+ Per-wallet profile (`--window` defaults to `all`):
25
+
26
+ - `realized_pnl_usd`, `resolved_markets`, `hit_rate`, `hit_rate_ci`: scoped to the window, cut by **resolution** time (only markets that resolved inside the window count)
27
+ - `trades_window`, `volume_window_usd`: scoped to the window, cut by trade time
28
+ - `trades_all`, `volume_all_usd`, `avg_trade_usd`, `markets_count`, `first_seen`, `last_seen`: lifetime
29
+ - `markets` (max 30), `trades` (max 100), `open_positions` (max 30), `open_exposure_usd`, `equity_curve`, `category_breakdown`, `daily_activity`, `correlated`, `tags`, `streak`: not window-scoped
30
+
31
+ There is no `hit_rate_pct`, `volume_<window>_usd` or `trades_<window>` field.
32
32
 
33
33
  ## Reading
34
34
 
35
+ - **`hit_rate` is a fraction (0.41 = 41%) and volume-weighted, not a count of wins.** It is the share of the wallet's resolved dollar volume that sat in markets where it made money, so an integer number of won markets will not reproduce it. `hit_rate_ci` is its confidence half-width: with few resolved markets it is wide, so don't rank on the point value.
36
+ - **`realized_pnl_usd` is realized only.** An open position adds nothing until its market resolves; markets resolved invalid are excluded.
37
+ - `open_positions` and `open_exposure_usd` understate: positions without a recent quote are left out.
38
+ - Zeros in a window (`trades_window: 0`, `realized_pnl_usd: 0`) mean "nothing resolved in this window", not "no activity".
39
+
35
40
  | Pattern | Read |
36
41
  |---|---|
37
- | `hit_rate_pct > 60` with `resolved_markets > 20` | **Skilled** — consistent over a real sample |
38
- | `hit_rate_pct > 80` with `resolved_markets < 10` | **Lucky — too few data points** |
39
- | Positive PnL but `hit_rate_pct < 50` | **Asymmetric bettor** — wins big when right, loses small |
42
+ | `hit_rate` > 0.60 with `resolved_markets` > 20 | **Skilled** — consistent over a real sample |
43
+ | `hit_rate` > 0.80 with `resolved_markets` < 10 | **Lucky — too few data points** |
44
+ | Positive PnL but `hit_rate` < 0.50 | **Asymmetric bettor** — wins big when right, loses small |
40
45
  | Negative PnL with high volume | **Volume trader / MM-style** — pays the spread |
41
- | One category dominates >80% of activity | **Specialist** — only trust their reads in that category |
42
-
43
- ## Hit-rate caveat
44
-
45
- `hit_rate_pct` is computed only on **resolved** markets. A wallet with 100 trades but only 5 resolved has a hit_rate based on those 5. Always inspect `resolved_markets` before quoting hit_rate.
46
+ | One category dominates >80% of `category_breakdown` | **Specialist** — only trust their reads in that category |
46
47
 
47
48
  ## Anti-patterns
48
49
 
49
- - Don't claim "this trader is good at predictions" from <10 resolved markets. Below that, hit_rate is noise.
50
- - Multi-category specialists are rare. If the wallet trades 5+ categories, treat hit_rate as a generic "good at probabilities" signal, not "deep edge".
50
+ - Don't claim "this trader is good at predictions" from <10 resolved markets. Below that, `hit_rate` is noise.
51
+ - Always read `resolved_markets` before quoting `hit_rate`: a wallet with 100 trades but only 5 resolved has a hit rate based on those 5.
52
+ - Multi-category specialists are rare. If the wallet trades 5+ categories, treat `hit_rate` as a generic "good at probabilities" signal, not "deep edge".
53
+ - A wallet with no recorded trades is refused with an error, not an empty profile.
51
54
 
52
55
  ## Pairs well with
53
56
 
54
57
  - `vike-polymarket-market-detail` — see which markets they're currently in
55
- - `vike-polymarket-smart-money` — confirm they're in the smart-money cohort
58
+ - `vike-polymarket-smart-money` — whether the profitable-wallet cohort is moving in the same markets