robinhood-chain-sdk 0.3.1 → 0.4.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/README.md +123 -16
- package/dist/index.d.ts +598 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +268 -4
- package/dist/index.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/llms.txt +26 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
[](package.json)
|
|
8
8
|
[](LICENSE)
|
|
9
9
|
|
|
10
|
-
> **Robinhood Chain API / SDK — EVM-native on-chain trading intelligence for Robinhood Chain (chain id 4663).** The official, fully-typed, zero-dependency TypeScript client for all
|
|
10
|
+
> **Robinhood Chain API / SDK — EVM-native on-chain trading intelligence for Robinhood Chain (chain id 4663).** The official, fully-typed, zero-dependency TypeScript client for all 52 endpoints: live KOL trades and coordination, token discovery, batch reads & launch-bundle detection, the Uniswap DEX trade tape, 1-minute OHLC candles, deployer reputation with alerts and trajectories, smart-money wallet rankings, and four **push rule engines** (copy-trade, price alerts, KOL coordination, first touches) — served from a self-hosted Robinhood Chain node.
|
|
11
11
|
|
|
12
12
|
> ⭐ **[Star on GitHub](https://github.com/madeonsol/robinhood-chain-sdk)** · 📂 **[Examples](./examples/)** · 🌐 **[Robinhood Chain](https://madeonsol.com/robinhood)** · 📚 **[API docs](https://madeonsol.com/api-docs)**
|
|
13
13
|
|
|
@@ -46,7 +46,7 @@ const client = new RobinhoodClient({
|
|
|
46
46
|
|
|
47
47
|
## Every endpoint → SDK method
|
|
48
48
|
|
|
49
|
-
All
|
|
49
|
+
All 52 Robinhood Chain operations live under `https://madeonsol.com/api/v1`. Bearer `msk_` auth on every call. Everything is a `GET` except the two batch reads and the four rule engines at the bottom, which are full CRUD.
|
|
50
50
|
|
|
51
51
|
| # | Endpoint | SDK method | Tier |
|
|
52
52
|
|---|---|---|---|
|
|
@@ -63,23 +63,51 @@ All 30 Robinhood Chain endpoints live under `https://madeonsol.com/api/v1`. Bear
|
|
|
63
63
|
| 11 | `GET /rhc/tokens/{address}/kol-consensus` | `client.tokens.kolConsensus(address)` | PRO+ |
|
|
64
64
|
| 12 | `GET /rhc/tokens/{address}/buyer-quality` | `client.tokens.buyerQuality(address)` | BASIC |
|
|
65
65
|
| 13 | `GET /rhc/tokens/{address}/bundle` | `client.tokens.bundle(address)` | BASIC |
|
|
66
|
-
| 14 | `
|
|
67
|
-
| 15 | `
|
|
68
|
-
| 16 | `GET /rhc/
|
|
69
|
-
| 17 | `GET /rhc/
|
|
70
|
-
| 18 | `GET /rhc/
|
|
71
|
-
| 19 | `
|
|
72
|
-
| 20 | `
|
|
73
|
-
| 21 | `GET /rhc/deployer-hunter/
|
|
74
|
-
| 22 | `GET /rhc/deployer-hunter/
|
|
75
|
-
| 23 | `GET /rhc/deployer-hunter/
|
|
76
|
-
| 24 | `GET /rhc/deployer-hunter/
|
|
77
|
-
| 25 | `GET /rhc/
|
|
66
|
+
| 14 | `GET /rhc/tokens/{address}/top-traders` | `client.tokens.topTraders(address, params?)` | PRO+ |
|
|
67
|
+
| 15 | `GET /rhc/tokens/{address}/flow` | `client.tokens.flow(address, window?)` | PRO+ |
|
|
68
|
+
| 16 | `GET /rhc/tokens/{address}/peak-history` | `client.tokens.peakHistory(address, params?)` | PRO+ |
|
|
69
|
+
| 17 | `GET /rhc/tokens/{address}/risk` | `client.tokens.risk(address)` | PRO+ |
|
|
70
|
+
| 18 | `GET /rhc/tokens/{address}/holders` | `client.tokens.holders(address, params?)` | PRO+ |
|
|
71
|
+
| 19 | `POST /rhc/token/batch` | `client.tokens.batch(addresses)` — max 50 | BASIC |
|
|
72
|
+
| 20 | `POST /rhc/tokens/batch/buyer-quality` | `client.tokens.batchBuyerQuality(addresses)` — **max 20** | BASIC |
|
|
73
|
+
| 21 | `GET /rhc/deployer-hunter/leaderboard` | `client.deployerHunter.leaderboard(params?)` | BASIC |
|
|
74
|
+
| 22 | `GET /rhc/deployer-hunter/best-tokens` | `client.deployerHunter.bestTokens(params?)` | BASIC |
|
|
75
|
+
| 23 | `GET /rhc/deployer-hunter/stats` | `client.deployerHunter.stats()` | BASIC |
|
|
76
|
+
| 24 | `GET /rhc/deployer-hunter/alerts` | `client.deployerHunter.alerts(params?)` | BASIC |
|
|
77
|
+
| 25 | `GET /rhc/deployer-hunter/recent-bonds` | `client.deployerHunter.recentBonds(params?)` | BASIC |
|
|
78
|
+
| 26 | `GET /rhc/deployer-hunter/{address}` | `client.deployerHunter.profile(address)` | BASIC |
|
|
79
|
+
| 27 | `GET /rhc/deployer-hunter/{address}/trajectory` | `client.deployerHunter.trajectory(address)` | BASIC |
|
|
80
|
+
| 28 | `GET /rhc/deployer-hunter/{address}/tokens` | `client.deployerHunter.tokens(address, params?)` | BASIC |
|
|
81
|
+
| 29 | `GET /rhc/deployer-hunter/{address}/history` | `client.deployerHunter.history(address, params?)` | PRO+ |
|
|
82
|
+
| 30 | `GET /rhc/alpha-wallets` | `client.alphaWallets(params?)` | PRO+ |
|
|
83
|
+
| 31 | `GET /rhc/copytrade/subscriptions` | `client.copyTrade.list()` | PRO+ |
|
|
84
|
+
| 32 | `POST /rhc/copytrade/subscriptions` | `client.copyTrade.create(params)` | PRO+ |
|
|
85
|
+
| 33 | `GET /rhc/copytrade/subscriptions/{id}` | `client.copyTrade.get(id)` | PRO+ |
|
|
86
|
+
| 34 | `PATCH /rhc/copytrade/subscriptions/{id}` | `client.copyTrade.update(id, params)` | PRO+ |
|
|
87
|
+
| 35 | `DELETE /rhc/copytrade/subscriptions/{id}` | `client.copyTrade.delete(id)` | PRO+ |
|
|
88
|
+
| 36 | `GET /rhc/copytrade/signals` | `client.copyTrade.signals(params?)` | PRO+ |
|
|
89
|
+
| 37 | `GET /rhc/price-alerts` | `client.priceAlerts.list()` | PRO+ |
|
|
90
|
+
| 38 | `POST /rhc/price-alerts` | `client.priceAlerts.create(params)` | PRO+ |
|
|
91
|
+
| 39 | `GET /rhc/price-alerts/{id}` | `client.priceAlerts.get(id)` | PRO+ |
|
|
92
|
+
| 40 | `PATCH /rhc/price-alerts/{id}` | `client.priceAlerts.update(id, params)` | PRO+ |
|
|
93
|
+
| 41 | `DELETE /rhc/price-alerts/{id}` | `client.priceAlerts.delete(id)` | PRO+ |
|
|
94
|
+
| 42 | `GET /rhc/price-alerts/events` | `client.priceAlerts.events(params?)` | PRO+ |
|
|
95
|
+
| 43 | `GET /rhc/kol/coordination/alerts` | `client.kol.coordinationAlerts.list()` | PRO+ |
|
|
96
|
+
| 44 | `POST /rhc/kol/coordination/alerts` | `client.kol.coordinationAlerts.create(params)` | PRO+ |
|
|
97
|
+
| 45 | `GET /rhc/kol/coordination/alerts/{id}` | `client.kol.coordinationAlerts.get(id)` | PRO+ |
|
|
98
|
+
| 46 | `PATCH /rhc/kol/coordination/alerts/{id}` | `client.kol.coordinationAlerts.update(id, params)` | PRO+ |
|
|
99
|
+
| 47 | `DELETE /rhc/kol/coordination/alerts/{id}` | `client.kol.coordinationAlerts.delete(id)` | PRO+ |
|
|
100
|
+
| 48 | `GET /rhc/kol/first-touches/subscriptions` | `client.kol.firstTouchSubscriptions.list()` | ULTRA+ |
|
|
101
|
+
| 49 | `POST /rhc/kol/first-touches/subscriptions` | `client.kol.firstTouchSubscriptions.create(params)` | ULTRA+ |
|
|
102
|
+
| 50 | `GET /rhc/kol/first-touches/subscriptions/{id}` | `client.kol.firstTouchSubscriptions.get(id)` | ULTRA+ |
|
|
103
|
+
| 51 | `PATCH /rhc/kol/first-touches/subscriptions/{id}` | `client.kol.firstTouchSubscriptions.update(id, params)` | ULTRA+ |
|
|
104
|
+
| 52 | `DELETE /rhc/kol/first-touches/subscriptions/{id}` | `client.kol.firstTouchSubscriptions.delete(id)` | ULTRA+ |
|
|
78
105
|
| + | `POST /stream/token` → WebSocket | `client.stream.connect()` | PRO+ |
|
|
79
106
|
|
|
80
107
|
## What you can build
|
|
81
108
|
|
|
82
|
-
- **KOL copy-trading on Robinhood Chain** — stream `client.kol.feed()` / the `rhc:kol_trades` channel and mirror verified-KOL buys, EVM-native.
|
|
109
|
+
- **KOL copy-trading on Robinhood Chain** — stream `client.kol.feed()` / the `rhc:kol_trades` channel and mirror verified-KOL buys, EVM-native. Or stop polling entirely: `client.copyTrade.create()` has the server watch the tape and push you a signal.
|
|
110
|
+
- **Push instead of poll** — four rule engines (`client.copyTrade`, `client.priceAlerts`, `client.kol.coordinationAlerts`, `client.kol.firstTouchSubscriptions`) deliver over webhook or WebSocket. **Quotas are per chain** — RHC rules never eat your Solana allowance.
|
|
83
111
|
- **Consensus scanner** — `client.kol.hotTokens()` surfaces tokens 2+ KOLs are accumulating; `client.kol.coordination()` adds the cohort composition behind it (per-KOL legs, accumulating vs distributing, exit state).
|
|
84
112
|
- **Discovery bot** — `client.kol.firstTouches()` gives the globally earliest KOL buy per token, filterable to tokens minutes old.
|
|
85
113
|
- **Launch-bundle / rug gate** — `client.tokens.bundle()` flags a same-block early-buyer bundle and how much of supply it still holds; `client.tokens.buyerQuality()` scores the first-20 cohort 0–100 with a dump-cluster ensemble.
|
|
@@ -414,6 +442,85 @@ const { wallets } = await client.alphaWallets({
|
|
|
414
442
|
});
|
|
415
443
|
```
|
|
416
444
|
|
|
445
|
+
## Rule engines — push, not polling
|
|
446
|
+
|
|
447
|
+
Four server-side rule engines watch the Robinhood Chain tape for you and deliver over **webhook**, **WebSocket**, or both. **Every quota is per chain** — configuring RHC rules never consumes your Solana budget, and a full set of Solana rules leaves your RHC capacity untouched. A `webhook_secret` is returned **exactly once** on create (null when `delivery_mode` is `"websocket"`); payloads are signed HMAC-SHA256 over `` `<timestamp>.<body>` `` in the `X-MadeOnSol-Signature` header.
|
|
448
|
+
|
|
449
|
+
### Copy-trade — `client.copyTrade` (PRO+)
|
|
450
|
+
|
|
451
|
+
```ts
|
|
452
|
+
const { subscription, webhook_secret } = await client.copyTrade.create({
|
|
453
|
+
name: "degen desk",
|
|
454
|
+
source_wallets: ["0xaaa…", "0xbbb…", "0xccc…"], // 1–250, per-tier cap enforced server-side
|
|
455
|
+
min_trade_eth: 0.01,
|
|
456
|
+
only_action: "buy", // buy | sell | both
|
|
457
|
+
sizing_mode: "fixed", // fixed | proportional | percent_source
|
|
458
|
+
sizing_amount: 0.05, // ETH when sizing_mode is "fixed"
|
|
459
|
+
delivery_mode: "websocket",
|
|
460
|
+
});
|
|
461
|
+
|
|
462
|
+
await client.copyTrade.update(subscription.id, { is_active: false });
|
|
463
|
+
await client.copyTrade.delete(subscription.id); // fired signals cascade
|
|
464
|
+
|
|
465
|
+
// Catch-up path for a missed webhook / dropped WS — fires retained 7 days
|
|
466
|
+
const since = new Date(Date.now() - 3_600_000).toISOString();
|
|
467
|
+
const { signals } = await client.copyTrade.signals({ subscription_id: subscription.id, since });
|
|
468
|
+
```
|
|
469
|
+
|
|
470
|
+
Sizes are **ETH, not SOL**, and there is deliberately **no market-cap band** — the RHC trade event carries no market cap, so a band could only be a per-event DB lookup in the hot path of a ~3.3M-trades/day chain. `update()` re-checks the per-tier wallet cap, so a rule cannot be PATCHed past its limit.
|
|
471
|
+
|
|
472
|
+
### Price alerts — `client.priceAlerts` (PRO+)
|
|
473
|
+
|
|
474
|
+
```ts
|
|
475
|
+
const { alert, evaluation } = await client.priceAlerts.create({
|
|
476
|
+
token_address: "0xdef…", // must already be tracked on RHC with a market cap
|
|
477
|
+
drop_pct: 30, // 0.01–99.99, measured from the MC captured RIGHT NOW
|
|
478
|
+
recovery_pct: 15, // omit for a dip-only, terminal alert
|
|
479
|
+
webhook_url: "https://example.com/hook",
|
|
480
|
+
});
|
|
481
|
+
console.log(evaluation.mode, evaluation.interval_seconds); // "polled", ~15
|
|
482
|
+
|
|
483
|
+
const { events } = await client.priceAlerts.events({ alert_id: alert.id, event_type: "dip" });
|
|
484
|
+
```
|
|
485
|
+
|
|
486
|
+
> **RHC price alerts are polled (~15s), not sub-second like the Solana ones.** `rhc_token_prices` is written by the RHC ingester on a separate box and emits no `pg_notify`, so there is nothing to react to — effective latency is that interval plus the token's own price-update cadence. Every create response spells this out in its `evaluation` block. The baseline MC is captured at creation, so an alert is a delta from the moment you set it; alerts self-expire after 30 days, and only `name`, `delivery_mode`, `webhook_url` and `is_active` are mutable (retuning a threshold mid-flight would make the recorded events uninterpretable).
|
|
487
|
+
|
|
488
|
+
### KOL coordination rules — `client.kol.coordinationAlerts` (PRO+)
|
|
489
|
+
|
|
490
|
+
```ts
|
|
491
|
+
const { rule, scoring } = await client.kol.coordinationAlerts.create({
|
|
492
|
+
min_kols: 3, // 2–50 distinct tracked KOL buyers
|
|
493
|
+
window_minutes: 15, // 1–60 rolling window
|
|
494
|
+
min_score: 40, // 0–100
|
|
495
|
+
cooldown_min: 30, // 1–1440 before the same token can fire again
|
|
496
|
+
score_jump_break: 20, // score jump that breaks the cooldown early
|
|
497
|
+
delivery_mode: "websocket",
|
|
498
|
+
});
|
|
499
|
+
await client.kol.coordinationAlerts.update(rule.id, { min_kols: 4 }); // UUID id
|
|
500
|
+
```
|
|
501
|
+
|
|
502
|
+
> **Coordination scoring is comparable to Solana, but not identical.** The shared v1 scorer runs, `quality` is a real KOL win-rate, and `earliness` is **defaulted** — RHC has no early-entry equivalent. The create response's `scoring` block records which components are real, and every fired signal repeats it in `score_inputs`.
|
|
503
|
+
|
|
504
|
+
### KOL first-touch subscriptions — `client.kol.firstTouchSubscriptions` (ULTRA+)
|
|
505
|
+
|
|
506
|
+
```ts
|
|
507
|
+
const { subscription } = await client.kol.firstTouchSubscriptions.create({
|
|
508
|
+
name: "early hands",
|
|
509
|
+
filters: {
|
|
510
|
+
min_first_buy_eth: 0.05,
|
|
511
|
+
min_kol_winrate: 0.5, // win-rate on CLOSED positions
|
|
512
|
+
strategy: "swing", // scalper | day_trader | swing | inactive | unscored
|
|
513
|
+
min_mc_usd: 10_000,
|
|
514
|
+
},
|
|
515
|
+
delivery_mode: "websocket",
|
|
516
|
+
});
|
|
517
|
+
|
|
518
|
+
// `filters` is a whole-object REPLACE, not a merge — {} clears every filter
|
|
519
|
+
await client.kol.firstTouchSubscriptions.update(subscription.id, { filters: {} });
|
|
520
|
+
```
|
|
521
|
+
|
|
522
|
+
> **First-touch filters are not the Solana set.** RHC has no scout score, so `min_scout_tier` and `min_n_touches` do not exist here rather than silently matching nothing; `min_kol_winrate` and `strategy` are the quality gates. Unknown filter keys are rejected with a **400**, not ignored.
|
|
523
|
+
|
|
417
524
|
## Streaming — `client.stream` (PRO+)
|
|
418
525
|
|
|
419
526
|
Managed WebSocket with token fetch + 24h refresh, auto-reconnect with backoff, heartbeat liveness, and typed events. Channels: **`rhc:kol_trades`** and **`rhc:trades`**.
|
|
@@ -453,7 +560,7 @@ try {
|
|
|
453
560
|
|
|
454
561
|
## Types & constants
|
|
455
562
|
|
|
456
|
-
Fully-typed responses and params for all
|
|
563
|
+
Fully-typed responses and params for all 52 endpoints are exported (`RhcKolFeedResponse`, `RhcKolCoordinationResponse`, `RhcKolFirstTouchesResponse`, `RhcTradesResponse`, `RhcTokenSnapshot`, `RhcTokenBatchResponse`, `RhcBatchBuyerQualityResponse`, `RhcBundleResponse`, `RhcTopTradersResponse`, `RhcFlowResponse`, `RhcPeakHistoryResponse`, `RhcRiskResponse`, `RhcHoldersResponse`, `RhcDeployerTrajectoryResponse`, `RhcDeployerTokensResponse`, `RhcDeployerHistoryResponse`, `RhcBestTokensResponse`, `RhcDeployerStatsResponse`, `RhcDeployerAlertsResponse`, `RhcRecentBondsResponse`, `RhcAlphaWalletsResponse`, plus the rule engines: `RhcCopyTradeSubscription`, `RhcCopyTradeCreateParams`, `RhcCopyTradeSignal`, `RhcPriceAlert`, `RhcPriceAlertEvaluation`, `RhcPriceAlertEvent`, `RhcCoordinationAlertRule`, `RhcCoordinationAlertScoring`, `RhcFirstTouchSubscription`, `RhcFirstTouchFilters`, `RhcDeletedResponse`, …), plus shared types (`DeployerTier`, `TradeAction`, `UniswapVersion`, `DeliveryMode`, `RhcBundleKind`, `RhcAlertType`, `RhcAlertPriority`, `RhcCoordinationSignal`) and the `CHAIN_ID` constant (`4663`).
|
|
457
564
|
|
|
458
565
|
## Links
|
|
459
566
|
|