@vike-io/cli 0.18.0 → 0.20.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 +12 -0
- package/README.md +8 -5
- package/package.json +1 -1
- package/skills/vike/SKILL.md +23 -5
- package/skills/vike-core/SKILL.md +1 -1
- package/skills/vike-predictfun-leaderboard/SKILL.md +47 -0
- package/skills/vike-predictfun-market-detail/SKILL.md +55 -0
- package/skills/vike-predictfun-markets/SKILL.md +52 -0
- package/skills/vike-predictfun-trader/SKILL.md +49 -0
- package/skills.sh.json +10 -0
- package/src/commands/predictfun.js +90 -0
- package/src/index.js +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.20.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- `predictfun wallet-flows <address>`: one Predict.fun wallet's USDT deposits and withdrawals on BNB Chain (MCP tool `predictfun_wallet_flows`), newest first, with whole-history totals and the first funder.
|
|
8
|
+
|
|
9
|
+
## 0.19.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- 0f67764: `predictfun` (alias `pf`): Predict.fun prediction markets on BNB Chain. `overview`, `markets` (`--status open|closed|resolved`, `--query`, `--sort volume_24h|newest`, `--limit`, `--cursor`), `market <market_id>`, `orderbook <market_id>`, `market-trades <market_id>` and `wallet-trades <address>` (`--limit`, `--cursor`), `wallet <address>` (positions and P&L) and `leaderboard` (`--window all|1d|7d|30d`, `--sort realized|volume|fills|unrealized`, `--limit`, `--offset`). Calls the MCP tools `predictfun_*`. New skills `vike-predictfun-markets`, `vike-predictfun-market-detail`, `vike-predictfun-trader` and `vike-predictfun-leaderboard`; the `vike` skill routes Predict.fun questions to them.
|
|
14
|
+
|
|
3
15
|
## 0.18.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -12,7 +12,8 @@
|
|
|
12
12
|
positions, fills, funding, liquidations, candles, and hourly long/short positioning by wallet
|
|
13
13
|
cohort), **Polymarket** (markets, the trade and event tape, order-book snapshots, candles and
|
|
14
14
|
on-chain settlements, plus a daily Parquet archive of the full L2 order book since 2026-07-25,
|
|
15
|
-
for personal use),
|
|
15
|
+
for personal use), **Predict.fun** (prediction markets on BNB Chain: markets, order books, every on-chain fill
|
|
16
|
+
with its wallet, per-wallet positions and P&L, and a wallet leaderboard), and **labelled EVM wallets** on Ethereum and BNB Chain, with Base and HyperEVM
|
|
16
17
|
for the wallet and token tools. The same data is served three ways: an **MCP server** at `https://data.vike.io/mcp` (the one
|
|
17
18
|
this CLI calls), a **REST API** at `https://data.vike.io/v1/`, and the **Parquet archive** at
|
|
18
19
|
`https://data.vike.io/archive/`. A key allows 20,000 requests an hour, and an account can hold up
|
|
@@ -56,6 +57,7 @@ The key is read from `VIKE_API_KEY` first, then from `~/.vike/config.json`
|
|
|
56
57
|
| **Polymarket API** `/v1/polymarket` | Markets, the raw event and trade tape (about 30 days back), order-book snapshots, candles, on-chain settlements | free key | [polymarket](https://vike.io/data/polymarket) |
|
|
57
58
|
| **Hyperliquid cohorts** `/v1/hyperliquid/coins/{coin}/cohort-metrics` | Long vs short per cohort, hourly, up to 8,760 hours in one request. Axes: `size` (account value, shrimp to 4x whale), `tier` (position notional), `pnl` (realized-PnL percentile), `pnl_abs` (PnL in dollars). `labelBasis=point_in_time` grades each hour with the label it had then (from 2026-04-07). | free key | [hl-cohorts](https://vike.io/data/hl-cohorts) |
|
|
58
59
|
| **Hyperliquid API** `/v1/hyperliquid` | Trader rankings and leaderboards, 5-minute position snapshots kept for a year, wallet fills, funding and ledger, liquidations (inferred from snapshots), builders, candles since the start of 2026; closed bars also stream live as the `hl.candles` channel of `wss://stream.vike.io/v1/stream/hl` | free key | [hyperliquid](https://vike.io/data/hyperliquid) |
|
|
60
|
+
| **Predict.fun API** `/v1/predictfun` | Prediction markets on BNB Chain: a venue overview, the market catalog with 24h volume, one market's outcomes and stats, the newest recorded order book (the ~1,000 most active open markets), every on-chain fill with the wallet behind it, per-wallet positions and P&L, and a leaderboard of every wallet by realized and unrealized P&L, volume and fills | free key | [predictfun](https://vike.io/predictfun) |
|
|
59
61
|
| **Event streams** `wss://stream.vike.io/v1/stream/<path>` | Live events with a resume cursor on four paths: `hl` (fills, liquidations, positions, top-10 positions per coin, closed trades, liquidation risk, order walls, candles, TWAPs, ledger, leverage changes, funding), `hl-cohorts` (cohort flow, indices, cohort bias, cohort leverage), `onchain` (transfers on eth, bsc, base, hyperevm), `polymarket` (trades, wallet position changes, resolutions, price moves, new markets). `vike-data stream` reads them; `vike-data stream info` lists every channel and filter. Connections are not counted against the hourly limit. | free key | [stream channels](https://vike.io/docs/data/reference/stream-channels) |
|
|
60
62
|
| **On-chain API** `/v1/onchain` | Wallet summaries, transactions, counterparties, PnL, address labels with per-source provenance, token holders and transfers. Ethereum on every route, BNB Chain on the wallet and token-flow routes, Base on token transfers. | free key | [onchain](https://vike.io/data/onchain) |
|
|
61
63
|
|
|
@@ -145,6 +147,7 @@ Every data command is one `tools/call` to the MCP server. `vike-data <group> --h
|
|
|
145
147
|
| `vike-data hl` | `cohort-metrics <symbol>`, `segments`, `wallet <address>`, `wallet-activity <address>`, `wallet-trades <address>`, `leaderboard`, `liquidations`, `market`, `orders`, `twaps`, `ledger`, `leverage-changes`, `stats`, `hype-holders`, `builders`, `vaults`, `vault <vault>`, `archive`; a tool with several views takes `--view` | `hl_cohort_metrics`, `hl_segments`, `hl_wallet`, `hl_wallet_activity`, `hl_wallet_trades`, `hl_leaderboard`, `hl_liquidations`, `hl_market`, `hl_orders`, `hl_twaps`, `hl_ledger`, `hl_leverage_changes`, `hl_stats`, `hl_hype_holders`, `hl_builders`, `hl_vaults`, `hl_vault`, `hl_archive` |
|
|
146
148
|
| `vike-data candles` | `hl <symbol>` (Hyperliquid perp or spot, from executed fills; `--view export`, or `--view latest` for the newest bar of every symbol), `polymarket <token_id>` (one outcome token); live bars: `stream hl --channel hl.candles` | `hl_ohlcv`, `polymarket_ohlcv` |
|
|
147
149
|
| `vike-data polymarket` (`pm`) | `markets`, `market <condition_id>`, `wallet <address>`, `smart-money`, `leaderboard`, `market-trades <condition_id>`, `tape`, `orderbook <token_id>`, `market-stats <token_id>`, `settlement <condition_id>`, `settlements`, `chainlink-prices <symbol>` (the Chainlink prices the crypto up/down markets resolve on), `archive` | `polymarket_markets`, `polymarket_market_detail`, `polymarket_wallet`, `polymarket_smart_money`, `polymarket_leaderboard`, `polymarket_market_trades`, `polymarket_tape`, `polymarket_orderbook`, `polymarket_market_stats`, `polymarket_settlement`, `polymarket_settlements_bulk`, `polymarket_chainlink_prices`, `polymarket_archive` |
|
|
150
|
+
| `vike-data predictfun` (`pf`) | `overview`, `markets`, `market <market_id>`, `orderbook <market_id>`, `market-trades <market_id>`, `wallet <address>` (positions and P&L), `wallet-trades <address>`, `wallet-flows <address>` (USDT deposits and withdrawals), `leaderboard` | `predictfun_overview`, `predictfun_markets`, `predictfun_market_detail`, `predictfun_market_book`, `predictfun_market_trades`, `predictfun_wallet_positions`, `predictfun_wallet_trades`, `predictfun_leaderboard` |
|
|
148
151
|
| `vike-data alerts` | `list`, `channels`, `create`, `edit`, `delete`, `events`, `resend`, `register-webhook`, `test-webhook`, `rotate-secret`: transfer alerts (a token or one wallet, on eth, bsc, base, hyperevm) Hyperliquid alerts (`--type hl_wallet`, `hl_cohort_fill`, `hl_liquidation`, `hl_cohort_bias`, `hl_liq_proximity`) and Polymarket alerts (`--type pm_wallet_trade`, `pm_market_trade`, `pm_price_move`, `pm_resolution`), by email or an HTTPS webhook, HMAC-signed; at most 200 active alerts per account | `alerts_*` |
|
|
149
152
|
| `vike-data stream <path>` | live events from `wss://stream.vike.io/v1/stream/<path>` (`hl`, `hl-cohorts`, `onchain`, `polymarket`) as NDJSON: `--channel` (one or more), `--filter key=value`, `--cursor` | WebSocket, not MCP |
|
|
150
153
|
| `vike-data stream` | `info`, `check <channel>` (the server's validator), `events <channel>` (stored events, 3 days), `connections` (yours) | `stream_info`, `stream_check_filter`, `stream_events`, `stream_connections` |
|
|
@@ -190,14 +193,14 @@ Downloads go to `./vike-archive/`.
|
|
|
190
193
|
|
|
191
194
|
## For AI agents
|
|
192
195
|
|
|
193
|
-
This package ships **
|
|
196
|
+
This package ships **51 skill playbooks** under [`skills/`](skills/): markdown files an AI coding
|
|
194
197
|
agent loads so it knows when and how to call each command. [`skills.sh.json`](skills.sh.json) groups
|
|
195
|
-
them by domain (Quick start, Tokens, Wallets, CEX perps, Hyperliquid perps, Candles, Polymarket, Alerts, Live streams). The
|
|
198
|
+
them by domain (Quick start, Tokens, Wallets, CEX perps, Hyperliquid perps, Candles, Polymarket, Predict.fun, Alerts, Live streams). The
|
|
196
199
|
entry point is the umbrella skill `vike`, which routes a question to the specialised skill. Per-tool
|
|
197
200
|
skills read one command; the workflow playbooks chain several: who a wallet is, where its money went,
|
|
198
201
|
whether two wallets are related, token holder diligence and the smart-money trend, Hyperliquid cohort
|
|
199
202
|
positioning and how to backtest it, one trader's profile, a symbol briefing, liquidation risk, builder
|
|
200
|
-
codes, perp crowding, a Polymarket market's due diligence, the free L2 archive, a cross-market daily brief.
|
|
203
|
+
codes, perp crowding, a Polymarket market's due diligence, Predict.fun markets, wallets and leaderboard, the free L2 archive, a cross-market daily brief.
|
|
201
204
|
|
|
202
205
|
```bash
|
|
203
206
|
npx skills add vike-io/vike-data-cli --list # see them first
|
|
@@ -236,7 +239,7 @@ server, the CLI and the Parquet files) is covered by the [Terms of Service](http
|
|
|
236
239
|
|
|
237
240
|
- you can research and trade your own capital, keep the data on your own machine, run private backtests,
|
|
238
241
|
and publish charts, tables, screenshots, backtest and research results and up to 100 rows per publication
|
|
239
|
-
from on-chain, Hyperliquid and
|
|
242
|
+
from on-chain, Hyperliquid, Polymarket and Predict.fun data, credited "© Vike (vike.io)";
|
|
240
243
|
- you cannot publish bulk data or full datasets;
|
|
241
244
|
- commercial use (signals or a service for others, use on behalf of a company, fund or prop firm, resale)
|
|
242
245
|
needs a written agreement: info@vike.io.
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "0.
|
|
6
|
+
"version": "0.20.0",
|
|
7
7
|
"description": "CLI, agent skills and MCP client for the free Vike Data API: a Polymarket full-L2 order-book archive in Parquet, Hyperliquid positions, fills and cohorts, and labelled Ethereum/BNB wallets",
|
|
8
8
|
"type": "module",
|
|
9
9
|
"main": "src/index.js",
|
package/skills/vike/SKILL.md
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: vike
|
|
3
|
-
description: "Use this skill whenever the user asks any question about on-chain crypto data, wallet behavior, token transfers, smart money, CEX perpetual futures, Hyperliquid perps, prediction markets (Polymarket), ENS, or on-chain flows — and live data from vike.io would improve the answer. This includes questions like \"who is buying X token\", \"what is wallet 0x... doing\", \"top wallets by PnL\", \"funding rate spread across Binance/Bybit/OKX\", \"largest HL perp traders this week\", \"who is winning on Polymarket\", \"what is the ENS name of this address\", \"label this wallet\", \"trace this transfer\", \"top tokens by smart-money inflow\". It is also the entry point that decides which vike-* skill answers a question (tokens, wallets, labels, perps, Hyperliquid, Polymarket, candles, alerts). Always use this skill proactively when the user's query could benefit from real-time or historical on-chain data — don't wait for the user to explicitly ask to \"use vike\". If the user asks a general on-chain question that requires synthesis across wallets/tokens/venues, route to vike first."
|
|
3
|
+
description: "Use this skill whenever the user asks any question about on-chain crypto data, wallet behavior, token transfers, smart money, CEX perpetual futures, Hyperliquid perps, prediction markets (Polymarket, Predict.fun), ENS, or on-chain flows — and live data from vike.io would improve the answer. This includes questions like \"who is buying X token\", \"what is wallet 0x... doing\", \"top wallets by PnL\", \"funding rate spread across Binance/Bybit/OKX\", \"largest HL perp traders this week\", \"who is winning on Polymarket\", \"what is the ENS name of this address\", \"label this wallet\", \"trace this transfer\", \"top tokens by smart-money inflow\". It is also the entry point that decides which vike-* skill answers a question (tokens, wallets, labels, perps, Hyperliquid, Polymarket, Predict.fun, candles, alerts). Always use this skill proactively when the user's query could benefit from real-time or historical on-chain data — don't wait for the user to explicitly ask to \"use vike\". If the user asks a general on-chain question that requires synthesis across wallets/tokens/venues, route to vike first."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# vike — on-chain, perps and prediction-market data
|
|
7
7
|
|
|
8
8
|
This skill is for anyone who asks an AI agent about crypto data: who is buying a token, what a wallet holds, what Hyperliquid or Polymarket traders are doing right now. It tells the agent which vike tool answers which question and how to read the result, so it does not guess or invent numbers. It reads its data from vike.io and needs a free vike API key.
|
|
9
9
|
|
|
10
|
-
What the platform has: wallet and token analytics on Ethereum, BSC, Base and HyperEVM (each tool's chain list is under "What each tool really returns"), multi-source wallet labels, CEX perpetual funding and cross-venue spreads, Hyperliquid wallets, cohorts, leaderboards, liquidations, markets, builders, vaults and candles, Polymarket markets, traders, tape, order books, settlements and the Parquet archive, transfer, Hyperliquid and Polymarket alerts, and live event streams over WebSocket.
|
|
10
|
+
What the platform has: wallet and token analytics on Ethereum, BSC, Base and HyperEVM (each tool's chain list is under "What each tool really returns"), multi-source wallet labels, CEX perpetual funding and cross-venue spreads, Hyperliquid wallets, cohorts, leaderboards, liquidations, markets, builders, vaults and candles, Polymarket markets, traders, tape, order books, settlements and the Parquet archive, Predict.fun (BNB Chain) markets, order books, on-chain fills, wallet positions and P&L, USDT deposits and withdrawals and its leaderboard, transfer, Hyperliquid and Polymarket alerts, and live event streams over WebSocket. 83 tools in one MCP server.
|
|
11
11
|
|
|
12
12
|
**MCP endpoint for all calls:** `https://data.vike.io/mcp` (JSON-RPC 2.0)
|
|
13
13
|
**Or use the CLI:** `npm install -g @vike-io/cli` → `vike-data <command>`
|
|
@@ -25,7 +25,7 @@ Hard rules — agents that violate these produce wrong answers. Read once, apply
|
|
|
25
25
|
1. **Addresses are always full 0x-hex (42 chars).** Never truncate when querying. Never display truncated when the user asks for the address — they'll copy-paste it.
|
|
26
26
|
2. **Perp and Hyperliquid symbols are upper-cased by the server.** Echo back what the user wrote.
|
|
27
27
|
3. **Windows are counted in UTC calendar days, not a rolling 24 hours.** On the token screener `24h` spans yesterday and today; on Hyperliquid `30d` is today plus the previous 30 days.
|
|
28
|
-
4. **Page sizes are small and differ per tool; these have no paging.** Max 20: `wallet_discover` (`size`), `polymarket_smart_money`. Max 30: `polymarket_markets`. Max 50: `token_holders`, `wallet_counterparties`, `wallet_compare`. Max 100: `token_screener`, `hl_perp_top_traders` (`size`), and 100 addresses for `wallet_batch_labels`. Max 500: `wallet_transactions`, `hl_position_match`. `token_transfers` has no limit: it always returns 10 rows. To go deeper, narrow the filter or the window instead of asking for more rows. The `hl` commands, `polymarket market-trades`, `tape`, `settlements`, `chainlink-prices` and `alerts events` DO page: pass the answer's next cursor back with `--cursor
|
|
28
|
+
4. **Page sizes are small and differ per tool; these have no paging.** Max 20: `wallet_discover` (`size`), `polymarket_smart_money`. Max 30: `polymarket_markets`. Max 50: `token_holders`, `wallet_counterparties`, `wallet_compare`. Max 100: `token_screener`, `hl_perp_top_traders` (`size`), and 100 addresses for `wallet_batch_labels`. Max 500: `wallet_transactions`, `hl_position_match`. `token_transfers` has no limit: it always returns 10 rows. To go deeper, narrow the filter or the window instead of asking for more rows. The `hl` commands, `polymarket market-trades`, `tape`, `settlements`, `chainlink-prices`, `predictfun markets` (max 100), `market-trades` and `wallet-trades` (max 10000) and `alerts events` DO page: pass the answer's next cursor back with `--cursor` (on `predictfun`, until `next_cursor` is `null`); `predictfun leaderboard` (max 50) pages by `--offset`, at most 1000. Page while `has_more` is true, not by page size: a `chainlink-prices` page can be shorter than `--limit` with more to come, and near now an empty page with `has_more` false means caught up: ask again later with `--from-ms` = the last row's `ts_ms` + 1.
|
|
29
29
|
5. **Refresh differs per tool; never promise "minutes".** `wallet_discover` and `wallet_summary` are rebuilt nightly, so a wallet active an hour ago may not show. Transfers are synced block by block. `hl_position_match` only matches positions seen within 15 minutes of the newest snapshot batch. For events as they happen use `vike-data stream` (`vike-stream`).
|
|
30
30
|
6. **USD amounts are floats in dollars.** `--min-usd 10000` = ten thousand dollars, not micro-USD.
|
|
31
31
|
7. **`--json` is always available** on CLI commands and gives stable machine-readable output. The default (human) format may change; `--json` will not.
|
|
@@ -118,6 +118,10 @@ Pick by the question, then read the named skill for the recipe and the traps. If
|
|
|
118
118
|
| Polymarket wallet leaderboard | `vike-data polymarket leaderboard` / `polymarket_leaderboard` | this skill |
|
|
119
119
|
| One market's liquidity, trades with wallets, raw tape, order book, tape stats, on-chain resolution | `vike-data polymarket market-trades`, `tape`, `orderbook`, `market-stats`, `settlement` | `vike-pm-market-diligence` |
|
|
120
120
|
| Many resolutions; the Parquet L2 archive | `vike-data polymarket settlements`, `archive` | `vike-pm-l2-archive` |
|
|
121
|
+
| Predict.fun at a glance; its markets by 24h volume or newest, by status or a title substring | `vike-data predictfun overview`, `predictfun markets` / `predictfun_overview`, `predictfun_markets` | `vike-predictfun-markets` |
|
|
122
|
+
| One Predict.fun market: outcomes, stats, order book, fills with wallets | `vike-data predictfun market <market_id>`, `orderbook`, `market-trades` / `predictfun_market_detail`, `predictfun_market_book`, `predictfun_market_trades` | `vike-predictfun-market-detail` |
|
|
123
|
+
| One Predict.fun wallet: positions, P&L, fills, deposits and withdrawals | `vike-data predictfun wallet <address>`, `wallet-trades`, `wallet-flows` / `predictfun_wallet_positions`, `predictfun_wallet_trades`, `predictfun_wallet_flows` | `vike-predictfun-trader` |
|
|
124
|
+
| Predict.fun wallet leaderboard (realized / unrealized P&L, volume, fills) | `vike-data predictfun leaderboard` / `predictfun_leaderboard` | `vike-predictfun-leaderboard` |
|
|
121
125
|
| The Chainlink price a crypto up/down market resolves on, at its window start and end (btc, eth, sol, xrp, doge, bnb, hype, zec; since 2026-11-06 09:24 UTC) | `vike-data polymarket chainlink-prices btc --interval <the market's tenor: 5m\|15m\|1h> --from-ms <window start> --to-ms <window end + 1>` / `polymarket_chainlink_prices`: two rows, the price at the start and at the end (`--to-ms` is exclusive). 4h and daily windows follow US Eastern time while buckets are UTC-aligned: ask `--interval 1m --from-ms <start> --to-ms <start + 60000>`, then again with `<end>` and `<end + 60000>` | this skill |
|
|
122
126
|
| Who funded a wallet; which exchanges it uses | `vike-data wallet first-funder`, `wallet exchange-usage` | `vike-wallet-who-is` |
|
|
123
127
|
| A daily brief across perps, Hyperliquid, Polymarket and on-chain | several calls, cheap first | `vike-daily-brief` |
|
|
@@ -161,7 +165,7 @@ Any MCP tool, including one with no command of its own, is one `call` away; it p
|
|
|
161
165
|
vike-data call hl_wallet --args '{"address":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045","view":"summary"}'
|
|
162
166
|
```
|
|
163
167
|
|
|
164
|
-
**B) Via an MCP connector (recommended when your client has one).** All
|
|
168
|
+
**B) Via an MCP connector (recommended when your client has one).** All 83 tools live at `https://data.vike.io/mcp`. Connect the client to that address with the `X-API-KEY` header above, then call a tool by name with its arguments, for example `wallet_summary` with `address` set to a full 0x address.
|
|
165
169
|
|
|
166
170
|
Run `vike-data schema --pretty` (or call MCP `tools/list`) to see the live arg shape for every tool. Always read the schema before constructing arguments — defaults and enum values change.
|
|
167
171
|
|
|
@@ -235,6 +239,20 @@ Every `hl` command takes `--view` (the first view is the default) and only the f
|
|
|
235
239
|
| `polymarket_wallet` | one trader: realized PnL, volume-weighted `hit_rate`, `resolved_markets`, positions |
|
|
236
240
|
| `polymarket_smart_money` | MARKETS where the profitable-wallet cohort is flowing (`flows`) or bought below the mid (`mispricings`); not a list of top traders |
|
|
237
241
|
|
|
242
|
+
### Predict.fun
|
|
243
|
+
Prediction markets on BNB Chain; USD is BSC USDT, prices are probabilities 0 to 1. A market is named by `market_id` (an integer), never its `condition_id`. The 24h figures are whole fill hours ending with the newest hour built, up to ~1.5 h behind the live tape.
|
|
244
|
+
|
|
245
|
+
| Tool | Returns |
|
|
246
|
+
|---|---|
|
|
247
|
+
| `predictfun_overview` | `markets_open`, `volume_24h_usd`, `trades_24h` (matches), `traders_24h`, `newest_trade_ts` |
|
|
248
|
+
| `predictfun_markets` | `{markets, next_cursor, as_of_ts}`: `market_id`, `title`, `status`, `trading_status`, `volume_24h_usd`, ...; `--status open\|closed\|resolved`, `--query`, `--sort volume_24h\|newest` |
|
|
249
|
+
| `predictfun_market_detail` | one market with Predict.fun's own `details`, `outcomes` (`token_id`, WON/LOST, `last_price`) and `stats` (24h and total volume); an unknown id is an error |
|
|
250
|
+
| `predictfun_market_book` | the newest recorded book, priced on the first outcome (Yes): `bids`, `asks` as `[price, quantity]`, `pending_*`, `last_settled`; only the ~1,000 most active open markets, none in 30 days is an error |
|
|
251
|
+
| `predictfun_market_trades`, `predictfun_wallet_trades` | `{trades, next_cursor}`, newest first, with `wallet`, `counterparty`, `role`, `side`, `size`, `price`, `usd`, `fee`. One row is one ORDER's fill: add `usd` over one `role`, never both. No time filter |
|
|
252
|
+
| `predictfun_wallet_flows` | `{flows, totals, next_cursor, as_of_ts}`: USDT in/out with anyone outside Predict.fun's contracts, newest first; `totals` (deposited, withdrawn, net, `first_funder`) cover the whole history. The wallet's WHOLE USDT traffic, so a market maker's totals include its exchange and lending activity. |
|
|
253
|
+
| `predictfun_wallet_positions` | per outcome token: `net`, `cost`, `proceeds`, `mark`, `value`, `pnl`, `state`; `totals` with `realized_pnl` and `unrealized_pnl`. Exchange fills only: splits, merges, redemptions and transfers are not seen |
|
|
254
|
+
| `predictfun_leaderboard` | every wallet ranked by realized P&L, volume or fills over `all`/`1d`/`7d`/`30d`, or `unrealized` (window `all` only); each row carries every window. Rebuilt hourly |
|
|
255
|
+
|
|
238
256
|
### Alerts
|
|
239
257
|
Create + manage on-chain transfer alerts, Hyperliquid alerts and Polymarket alerts, delivered by email or an HTTPS webhook.
|
|
240
258
|
|
|
@@ -254,7 +272,7 @@ A token-wide transfer alert fires on ANY transfer of the token above the USD thr
|
|
|
254
272
|
Credits are an accounting figure only; they never block a call. The one limit is 20,000 requests per rolling hour per key, shared by MCP and REST.
|
|
255
273
|
|
|
256
274
|
- **0 credits:** `token_search`, `alerts_list`, `alerts_list_channels`.
|
|
257
|
-
- **1:** `wallet_ens`, `wallet_label_provenance`, `perp_funding`, `perp_spreads`, `perp_open_interest`, `perp_long_short`, `search`, every `hl` command, `hl_ohlcv`, `polymarket_markets`, `polymarket_ohlcv`, the Polymarket tape, order book, stats, trades, settlement, Chainlink prices and archive calls.
|
|
275
|
+
- **1:** `wallet_ens`, `wallet_label_provenance`, `perp_funding`, `perp_spreads`, `perp_open_interest`, `perp_long_short`, `search`, every `hl` command, `hl_ohlcv`, `polymarket_markets`, `polymarket_ohlcv`, the Polymarket tape, order book, stats, trades, settlement, Chainlink prices and archive calls, every `predictfun` tool.
|
|
258
276
|
- **2:** most others, `wallet_summary` among them.
|
|
259
277
|
- **3:** `token_screener`, `wallet_compare`, `wallet_token_balances`, `alerts_create`.
|
|
260
278
|
- **4:** `wallet_trace`.
|
|
@@ -62,7 +62,7 @@ vike-data --help # command list; add --help to any comman
|
|
|
62
62
|
|
|
63
63
|
## Cost awareness
|
|
64
64
|
|
|
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`. Every `hl` command, `search`, and the Polymarket tape, order book, stats, trades, settlement and archive commands are 1 credit. Heaviest: `wallet trace` (4), then `token screener`, `wallet compare`, `wallet balances` (3).
|
|
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`. Every `hl` command, every `predictfun` command, `search`, and the Polymarket tape, order book, stats, trades, settlement and archive commands are 1 credit. Heaviest: `wallet trace` (4), then `token screener`, `wallet compare`, `wallet balances` (3).
|
|
66
66
|
|
|
67
67
|
## Which skill to use
|
|
68
68
|
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: vike-predictfun-leaderboard
|
|
3
|
+
description: Rank every Predict.fun wallet by realized P&L, volume or fills over all time, 1d, 7d or 30d, or by unrealized P&L today, each row with every window's figures, open value and position counts. Use when the user asks "who is winning on Predict.fun" / "top Predict.fun traders" / "biggest Predict.fun wallets by volume".
|
|
4
|
+
allowed-tools: Bash(vike-data:*)
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# vike-predictfun-leaderboard
|
|
8
|
+
|
|
9
|
+
## Command
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
vike-data predictfun leaderboard [--window all|1d|7d|30d] [--sort realized|volume|fills|unrealized] \
|
|
13
|
+
[--limit N] [--offset N] [--json] # limit default 20, max 50; offset 0-1000; 1 credit
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
`--sort unrealized` is today's open P&L and takes `--window all` only (any other window is an error).
|
|
17
|
+
|
|
18
|
+
## Examples
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
vike-data predictfun leaderboard --json # realized P&L, all time
|
|
22
|
+
vike-data predictfun leaderboard --window 7d --sort realized --limit 50 --json
|
|
23
|
+
vike-data pf leaderboard --window 30d --sort volume --offset 50 --json # second page
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Output
|
|
27
|
+
|
|
28
|
+
`{rows, window, sort, label_basis, as_of_ts}`; `label_basis` is `current` (today's standing, not a point in time), `as_of_ts` the board's last rebuild (hourly). Each row:
|
|
29
|
+
|
|
30
|
+
`rank`, `wallet`, `realized_pnl_usd` and `realized_pnl_1d_usd`, `realized_pnl_7d_usd`, `realized_pnl_30d_usd`, `unrealized_pnl_usd`, `open_value_usd`, `open_positions` (outcome tokens held in markets not resolved yet), `resolved_positions` (outcome tokens traded in resolved markets), `volume_usd`, `volume_1d_usd`, `volume_7d_usd`, `volume_30d_usd`, `fills`, `fills_1d`, `fills_7d`, `fills_30d`, `first_ts`, `last_ts` (epoch ms).
|
|
31
|
+
|
|
32
|
+
## Reading
|
|
33
|
+
|
|
34
|
+
- **A market counts in a realized window by when it resolved**, not when it was traded; volume and fills windows are whole fill hours back from the rebuild.
|
|
35
|
+
- Rows are ranked largest first; ties break on the wallet address. Page by `--offset` (at most 1000); a rebuild between two pages can move a wallet across them.
|
|
36
|
+
- P&L counts exchange fills only (see `vike-predictfun-trader`). USD is BSC USDT.
|
|
37
|
+
|
|
38
|
+
## Anti-patterns
|
|
39
|
+
|
|
40
|
+
- Don't rank skill on a handful of `resolved_positions`: a large `realized_pnl_usd` from two positions is one bet.
|
|
41
|
+
- Don't read `volume_usd` as profit, or `fills` as matches: one fill is one order's fill.
|
|
42
|
+
- An error saying the leaderboard is not built yet means try later, not "no traders".
|
|
43
|
+
|
|
44
|
+
## Pairs well with
|
|
45
|
+
|
|
46
|
+
- `vike-predictfun-trader` — open one wallet's positions and fills
|
|
47
|
+
- `vike-predictfun-markets` — the venue's volume and markets
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: vike-predictfun-market-detail
|
|
3
|
+
description: Read one Predict.fun market by market_id - its outcomes and token ids, WON/LOST once resolved, last prices, 24h and total USD volume, the newest recorded order book, and its on-chain fills with the wallet behind each. Use after vike-predictfun-markets when the user asks about one specific Predict.fun market, its price, its liquidity or who traded it.
|
|
4
|
+
allowed-tools: Bash(vike-data:*)
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# vike-predictfun-market-detail
|
|
8
|
+
|
|
9
|
+
## Commands
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
vike-data predictfun market <market_id> [--json] # 1 credit
|
|
13
|
+
vike-data predictfun orderbook <market_id> [--json] # 1 credit
|
|
14
|
+
vike-data predictfun market-trades <market_id> [--limit N] [--cursor C] [--json] # limit default 100, max 10000; 1 credit
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
`market_id` is a positive integer from `vike-data predictfun markets`. It is NOT the `condition_id`.
|
|
18
|
+
|
|
19
|
+
## Example
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
vike-data predictfun markets --query bitcoin --limit 5 --json
|
|
23
|
+
# → pick a market_id from the output, then:
|
|
24
|
+
vike-data predictfun market 1234 --json
|
|
25
|
+
vike-data predictfun orderbook 1234 --json
|
|
26
|
+
vike-data predictfun market-trades 1234 --limit 1000 --json
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## What it returns
|
|
30
|
+
|
|
31
|
+
- `market`: `{market, outcomes, stats, as_of_ts}`.
|
|
32
|
+
- `market`: the list fields (`title`, `question`, `status`, `trading_status`, `category_slug`, `fee_rate_bps`, ...) plus `details`, Predict.fun's own record of the market (description, outcomes, resolution).
|
|
33
|
+
- `outcomes`: `token_id`, `index_set`, `name`, `status` (`WON`, `LOST`, or empty while unresolved), `last_price` and `last_trade_ts` of its newest fill.
|
|
34
|
+
- `stats`: `volume_24h_usd`, `volume_total_usd`, `trades_24h` (matches), `traders_24h`, `last_price` (the first outcome's, Yes).
|
|
35
|
+
- `orderbook`: priced on the FIRST outcome (Yes). `bids` highest first and `asks` lowest first as `[price, quantity]`; `pending_bids` / `pending_asks` (matched, not yet settled on chain); `last_settled` (the last settled order Predict.fun reported, or `null`); `order_count`, `version`; `ts` (Predict.fun's time) and `recorded_ts` (ours), epoch ms.
|
|
36
|
+
- `market-trades`: `{trades, next_cursor}`, newest first, every outcome. Each row: `ts` (block time, epoch ms), `block_number`, `tx_hash`, `log_index`, `exchange` (the contract), `wallet` (whose order filled), `counterparty`, `role` (`maker` / `taker`), `side` (`BUY` / `SELL` of `token_id`), `token_id`, `outcome`, `size` (shares), `price` (0 to 1), `usd`, `fee`. Page with `--cursor` while `next_cursor` is not `null`; a page boundary neither repeats nor skips a fill.
|
|
37
|
+
|
|
38
|
+
## Reading the data
|
|
39
|
+
|
|
40
|
+
- **One trade row is one ORDER's fill, not one match.** A match is one `maker` row per resting order hit plus one `taker` row for the order that took them, whose amounts are theirs added up. Add `usd` over the `taker` rows (what `volume_24h_usd` does) or the `maker` rows, never both.
|
|
41
|
+
- Prices are probabilities 0 to 1: `0.42` = "42% chance". USD is BSC USDT.
|
|
42
|
+
- The 24h stats are whole fill hours ending with the newest hour built, up to ~1.5 h behind the live tape; `market-trades` reads the tape itself.
|
|
43
|
+
|
|
44
|
+
## Anti-patterns
|
|
45
|
+
|
|
46
|
+
- An unknown `market_id` is an error (exit 1), not an empty answer.
|
|
47
|
+
- Books are recorded for the ~1,000 most active open markets: `orderbook` on a quiet or closed market is an error ("no order book recorded ... in the last 30 days"). Say so; don't call the market illiquid from that alone.
|
|
48
|
+
- `market-trades` has no time filter: it pages back from the newest fill. Stop paging once `ts` is older than the window you need.
|
|
49
|
+
- Don't claim manipulation or insiders from trades alone.
|
|
50
|
+
|
|
51
|
+
## Pairs well with
|
|
52
|
+
|
|
53
|
+
- `vike-predictfun-markets` — find the `market_id`
|
|
54
|
+
- `vike-predictfun-trader` — profile any `wallet` from the fills
|
|
55
|
+
- `vike-predictfun-leaderboard` — is that wallet among the top earners
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: vike-predictfun-markets
|
|
3
|
+
description: Predict.fun (prediction markets on BNB Chain) at a glance and its market list - open markets, 24h USD volume, matches and wallets for the venue and per market, ranked by 24h volume or newest, filterable by status and a title substring. Use when the user asks "what's hot on Predict.fun" / "biggest Predict.fun markets" / "how much volume does Predict.fun do" / "find the Predict.fun market about X".
|
|
4
|
+
allowed-tools: Bash(vike-data:*)
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# vike-predictfun-markets
|
|
8
|
+
|
|
9
|
+
## Command
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
vike-data predictfun overview [--json] # the whole venue, 1 credit
|
|
13
|
+
vike-data predictfun markets [--status open|closed|resolved] [--query TEXT] \
|
|
14
|
+
[--sort volume_24h|newest] [--limit N] [--cursor C] [--json] # limit default 20, max 100; 1 credit
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
`--query` is a case-insensitive substring of the market's title or question. `vike-data search` does not cover Predict.fun: find a market here.
|
|
18
|
+
|
|
19
|
+
## Examples
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
vike-data predictfun overview --json
|
|
23
|
+
vike-data predictfun markets --status open --limit 20 --json
|
|
24
|
+
vike-data pf markets --query bitcoin --json # `pf` alias
|
|
25
|
+
vike-data predictfun markets --sort newest --cursor <next_cursor> --json
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Output
|
|
29
|
+
|
|
30
|
+
- `overview`: `markets_open`, `volume_24h_usd`, `trades_24h` (matches), `traders_24h` (wallets on either side), `newest_trade_ts` (epoch ms, the newest fill counted).
|
|
31
|
+
- `markets`: `{markets, next_cursor, as_of_ts}`. Each market: `market_id` (an integer: what every other `predictfun` command takes), `condition_id`, `title`, `question`, `status` (`REGISTERED` or `RESOLVED`), `trading_status` (`OPEN` or `CLOSED`), `category_slug`, `is_neg_risk`, `is_yield_bearing`, `fee_rate_bps`, `created_at` (epoch ms), `volume_24h_usd`, `trades_24h`, `traders_24h`.
|
|
32
|
+
|
|
33
|
+
Page while `next_cursor` is not `null`; a cursor works only with the `--sort` that issued it.
|
|
34
|
+
|
|
35
|
+
## Reading the data
|
|
36
|
+
|
|
37
|
+
- **The 24 hours are whole fill hours ending with the newest hour built**, rebuilt hourly, so the figures trail the live tape by up to ~1.5 h. `as_of_ts` / `newest_trade_ts` is the newest fill counted.
|
|
38
|
+
- `volume_24h_usd` counts each match once, on the side that took liquidity. USD is BSC USDT.
|
|
39
|
+
- `--status open` = trading and not resolved; `closed` = no longer trading, not resolved yet; `resolved` = settled.
|
|
40
|
+
- The catalog is refreshed hourly: a market listed in the last hour may be missing.
|
|
41
|
+
|
|
42
|
+
## Anti-patterns
|
|
43
|
+
|
|
44
|
+
- Don't pass `condition_id` to the other commands: they take `market_id`.
|
|
45
|
+
- Don't quote the 24h figures as "live": they are up to ~1.5 h old.
|
|
46
|
+
- Don't call a list of markets "what smart money is doing": there is no smart-money tool for Predict.fun; the closest is `vike-data predictfun leaderboard` (see `vike-predictfun-leaderboard`).
|
|
47
|
+
|
|
48
|
+
## Pairs well with
|
|
49
|
+
|
|
50
|
+
- `vike-predictfun-market-detail` — one market's outcomes, order book and fills with wallets
|
|
51
|
+
- `vike-predictfun-leaderboard` — who is winning on Predict.fun
|
|
52
|
+
- `vike-polymarket-markets` — the same question on Polymarket
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: vike-predictfun-trader
|
|
3
|
+
description: Profile a Predict.fun wallet - its positions per outcome token with cost, proceeds, mark, value and P&L, realized and unrealized totals, and its on-chain fills with market and outcome. Use when the user gives a wallet address and asks about its Predict.fun bets, positions, P&L or trades.
|
|
4
|
+
allowed-tools: Bash(vike-data:*)
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# vike-predictfun-trader
|
|
8
|
+
|
|
9
|
+
## Commands
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
vike-data predictfun wallet <address> [--json] # positions and P&L, 1 credit
|
|
13
|
+
vike-data predictfun wallet-trades <address> [--limit N] [--cursor C] [--json] # fills, limit default 100, max 10000; 1 credit
|
|
14
|
+
vike-data predictfun wallet-flows <address> [--limit N] [--cursor C] [--json] # USDT deposits / withdrawals; 1 credit
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
`address` is `0x` + 40 hex digits; anything else is an error.
|
|
18
|
+
|
|
19
|
+
## Example
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
vike-data predictfun wallet 0xabcdef1234... --json
|
|
23
|
+
vike-data pf wallet-trades 0xabcdef1234... --limit 500 --json # `pf` alias
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Output
|
|
27
|
+
|
|
28
|
+
- `wallet`: `{positions, totals, as_of_ts}`. One position per outcome token, most recently traded first: `market_id`, `market_title`, `token_id`, `outcome`, `state` (`open`, `won`, `lost`, or `uncatalogued` for a market not in the catalog yet), `net` (shares bought minus sold minus fees taken in shares), `cost` (USD paid), `proceeds` (USD received, net of fees), `mark` (the token's last price) and `mark_ts`, `value` (`net` x 1 won, x 0 lost, x `mark` while open), `pnl` (`proceeds - cost + value`; `null` for an open token with no price yet), `fills`, `first_ts`, `last_ts`.
|
|
29
|
+
`totals`: `positions`, `open_positions`, `cost`, `proceeds`, `value` (open positions), `pnl`, `realized_pnl` (won and lost positions), `unrealized_pnl` (open ones), `unpriced` (positions with `pnl` `null`). `as_of_ts` is when the positions were last rebuilt.
|
|
30
|
+
- `wallet-trades`: `{trades, next_cursor}`, newest first, each with `market_id`, `market_title` and `outcome` (`null` for a market the catalog does not hold yet), otherwise the rows of `predictfun market-trades`. An address with no fills is an empty page.
|
|
31
|
+
- `wallet-flows`: `{flows, totals, next_cursor, as_of_ts}`: the wallet's USDT transfers on BNB Chain with anyone outside Predict.fun's own contracts (`direction` in/out, `counterparty` and its label such as `cex/binance`, `amount_usd`), newest first; `totals` over the whole history: deposited, withdrawn, net and `first_funder`. It is the wallet's WHOLE USDT traffic: a market maker that also uses Binance or a lending pool shows that activity too, so don't read `deposited_usd` as money put into Predict.fun for such a wallet. Dust under one cent is left out.
|
|
32
|
+
|
|
33
|
+
## Reading
|
|
34
|
+
|
|
35
|
+
- **Exchange fills only.** Shares split, merged, redeemed or transferred are not seen: a negative `net` means shares that came from outside the exchange, and a won position stays at its `value` after it is redeemed.
|
|
36
|
+
- `realized_pnl` is resolved markets only; an open position counts in `unrealized_pnl` at its last price, so it moves with the market.
|
|
37
|
+
- **One trade row is one order's fill**: the wallet's own volume is the sum of `usd` over its rows; for a market's volume add one role only (see `vike-predictfun-market-detail`).
|
|
38
|
+
- USD is BSC USDT; prices are probabilities 0 to 1.
|
|
39
|
+
|
|
40
|
+
## Anti-patterns
|
|
41
|
+
|
|
42
|
+
- Don't call a wallet skilled from a few resolved positions: count `won` + `lost` positions before quoting `realized_pnl` as a track record.
|
|
43
|
+
- `pnl` `null` is "no price yet", not zero: read `totals.unpriced`.
|
|
44
|
+
- The same address on Polymarket is a different account history: use `vike-polymarket-trader` for that.
|
|
45
|
+
|
|
46
|
+
## Pairs well with
|
|
47
|
+
|
|
48
|
+
- `vike-predictfun-leaderboard` — where the wallet ranks, by window
|
|
49
|
+
- `vike-predictfun-market-detail` — the markets it holds
|
package/skills.sh.json
CHANGED
|
@@ -88,6 +88,16 @@
|
|
|
88
88
|
"vike-pm-l2-archive"
|
|
89
89
|
]
|
|
90
90
|
},
|
|
91
|
+
{
|
|
92
|
+
"title": "Predict.fun",
|
|
93
|
+
"description": "Prediction markets on BNB Chain: the venue at a glance, markets by 24h volume, one market's outcomes, order book and on-chain fills with wallets, a wallet's positions and P&L, and the wallet leaderboard.",
|
|
94
|
+
"skills": [
|
|
95
|
+
"vike-predictfun-markets",
|
|
96
|
+
"vike-predictfun-market-detail",
|
|
97
|
+
"vike-predictfun-trader",
|
|
98
|
+
"vike-predictfun-leaderboard"
|
|
99
|
+
]
|
|
100
|
+
},
|
|
91
101
|
{
|
|
92
102
|
"title": "Alerts",
|
|
93
103
|
"description": "Create, list, edit, delete transfer alerts (a token or one wallet, USD thresholds) and Hyperliquid alerts; read what fired; HTTPS webhooks with HMAC delivery.",
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { callTool } from '../mcp-client.js';
|
|
2
|
+
import { emit, emitError } from '../format.js';
|
|
3
|
+
import { addTool } from './tool-command.js';
|
|
4
|
+
|
|
5
|
+
export function registerPredictfun(program) {
|
|
6
|
+
const cmd = program
|
|
7
|
+
.command('predictfun')
|
|
8
|
+
.alias('pf')
|
|
9
|
+
.description('Predict.fun prediction markets on BNB Chain (overview, markets, order books, on-chain fills, wallet positions and P&L, leaderboard)');
|
|
10
|
+
|
|
11
|
+
addTool(cmd, 'overview', {
|
|
12
|
+
tool: 'predictfun_overview',
|
|
13
|
+
desc: 'Open markets, and 24h USD volume, matches and wallets (whole fill hours, rebuilt hourly)',
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
cmd
|
|
17
|
+
.command('markets')
|
|
18
|
+
.description('Predict.fun markets with 24h volume, matches and wallets, largest volume first (or newest)')
|
|
19
|
+
.option('--status <s>', 'open | closed | resolved (default all)')
|
|
20
|
+
.option('--query <q>', 'Case-insensitive substring of the title or question')
|
|
21
|
+
.option('--sort <s>', 'volume_24h (default) | newest; a cursor works only with its own sort')
|
|
22
|
+
.option('--limit <n>', 'Rows per page (default 20, max 100)')
|
|
23
|
+
.option('--cursor <c>', 'next_cursor from the previous page')
|
|
24
|
+
.option('--json', 'Emit JSON')
|
|
25
|
+
.action(async (opts) => {
|
|
26
|
+
try {
|
|
27
|
+
const r = await callTool('predictfun_markets', {
|
|
28
|
+
status: opts.status,
|
|
29
|
+
q: opts.query,
|
|
30
|
+
sort: opts.sort,
|
|
31
|
+
limit: opts.limit,
|
|
32
|
+
cursor: opts.cursor,
|
|
33
|
+
});
|
|
34
|
+
emit(r, opts);
|
|
35
|
+
} catch (err) { emitError(err, opts); }
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
addTool(cmd, 'market <market_id>', {
|
|
39
|
+
tool: 'predictfun_market_detail',
|
|
40
|
+
args: ['market_id'],
|
|
41
|
+
desc: 'One market by market_id: the market, its outcomes (token ids, WON/LOST, last price) and 24h and total stats',
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
addTool(cmd, 'orderbook <market_id>', {
|
|
45
|
+
tool: 'predictfun_market_book',
|
|
46
|
+
args: ['market_id'],
|
|
47
|
+
desc: 'Newest recorded order book of one market, priced on its first outcome (Yes); an error when none in 30 days',
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
const CURSOR = ['--cursor <c>', 'next_cursor from the previous page'];
|
|
51
|
+
const LIMIT = ['--limit <n>', 'Rows per page (default 100, max 10000)'];
|
|
52
|
+
|
|
53
|
+
addTool(cmd, 'market-trades <market_id>', {
|
|
54
|
+
tool: 'predictfun_market_trades',
|
|
55
|
+
args: ['market_id'],
|
|
56
|
+
desc: 'One market\'s on-chain fills with the wallet behind each, newest first (one row = one order\'s fill)',
|
|
57
|
+
options: [LIMIT, CURSOR],
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
addTool(cmd, 'wallet <address>', {
|
|
61
|
+
tool: 'predictfun_wallet_positions',
|
|
62
|
+
args: ['address'],
|
|
63
|
+
desc: 'One wallet\'s positions and P&L per outcome token, with realized and unrealized totals (exchange fills only)',
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
addTool(cmd, 'wallet-trades <address>', {
|
|
67
|
+
tool: 'predictfun_wallet_trades',
|
|
68
|
+
args: ['address'],
|
|
69
|
+
desc: 'One wallet\'s on-chain fills with their market and outcome, newest first (one row = one order\'s fill)',
|
|
70
|
+
options: [LIMIT, CURSOR],
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
addTool(cmd, 'wallet-flows <address>', {
|
|
74
|
+
tool: 'predictfun_wallet_flows',
|
|
75
|
+
args: ['address'],
|
|
76
|
+
desc: 'One wallet\'s USDT deposits and withdrawals on BNB Chain, newest first, with whole-history totals and the first funder',
|
|
77
|
+
options: [LIMIT, CURSOR],
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
addTool(cmd, 'leaderboard', {
|
|
81
|
+
tool: 'predictfun_leaderboard',
|
|
82
|
+
desc: 'Every wallet ranked by realized P&L, volume or fills over a window, or by unrealized P&L (rebuilt hourly)',
|
|
83
|
+
options: [
|
|
84
|
+
['--window <w>', 'all (default) | 1d | 7d | 30d'],
|
|
85
|
+
['--sort <s>', 'realized (default) | volume | fills | unrealized (--window all only)'],
|
|
86
|
+
['--limit <n>', 'Rows per page (default 20, max 50)'],
|
|
87
|
+
['--offset <n>', 'Rows to skip, 0-1000'],
|
|
88
|
+
],
|
|
89
|
+
});
|
|
90
|
+
}
|
package/src/index.js
CHANGED
|
@@ -5,6 +5,7 @@ import { registerWallet } from './commands/wallet.js';
|
|
|
5
5
|
import { registerPerp } from './commands/perp.js';
|
|
6
6
|
import { registerAlerts } from './commands/alerts.js';
|
|
7
7
|
import { registerPolymarket } from './commands/polymarket.js';
|
|
8
|
+
import { registerPredictfun } from './commands/predictfun.js';
|
|
8
9
|
import { registerLabels } from './commands/labels.js';
|
|
9
10
|
import { registerCandles } from './commands/candles.js';
|
|
10
11
|
// New wallet subcommands (counterparties, pnl-history, balances, ens) are
|
|
@@ -67,6 +68,7 @@ registerWallet(program);
|
|
|
67
68
|
registerPerp(program);
|
|
68
69
|
registerAlerts(program);
|
|
69
70
|
registerPolymarket(program);
|
|
71
|
+
registerPredictfun(program);
|
|
70
72
|
registerLabels(program);
|
|
71
73
|
registerCandles(program);
|
|
72
74
|
registerHl(program);
|