crypto-quant-signal-mcp 1.19.1 → 1.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/README.md +32 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +123 -7
- package/dist/index.js.map +1 -1
- package/dist/lib/adapters/bitget.d.ts.map +1 -1
- package/dist/lib/adapters/bitget.js +19 -4
- package/dist/lib/adapters/bitget.js.map +1 -1
- package/dist/lib/candle-guard.d.ts +37 -0
- package/dist/lib/candle-guard.d.ts.map +1 -0
- package/dist/lib/candle-guard.js +78 -0
- package/dist/lib/candle-guard.js.map +1 -0
- package/dist/lib/chat-analytics.d.ts.map +1 -1
- package/dist/lib/chat-analytics.js +5 -9
- package/dist/lib/chat-analytics.js.map +1 -1
- package/dist/lib/equities/equity-bars-provider.d.ts +71 -0
- package/dist/lib/equities/equity-bars-provider.d.ts.map +1 -0
- package/dist/lib/equities/equity-bars-provider.js +275 -0
- package/dist/lib/equities/equity-bars-provider.js.map +1 -0
- package/dist/lib/equities/equity-constants.d.ts +39 -0
- package/dist/lib/equities/equity-constants.d.ts.map +1 -0
- package/dist/lib/equities/equity-constants.js +46 -0
- package/dist/lib/equities/equity-constants.js.map +1 -0
- package/dist/lib/equities/equity-indicators.d.ts +28 -0
- package/dist/lib/equities/equity-indicators.d.ts.map +1 -0
- package/dist/lib/equities/equity-indicators.js +86 -0
- package/dist/lib/equities/equity-indicators.js.map +1 -0
- package/dist/lib/equities/equity-misses.d.ts +11 -0
- package/dist/lib/equities/equity-misses.d.ts.map +1 -0
- package/dist/lib/equities/equity-misses.js +17 -0
- package/dist/lib/equities/equity-misses.js.map +1 -0
- package/dist/lib/equities/equity-outcomes.d.ts +25 -0
- package/dist/lib/equities/equity-outcomes.d.ts.map +1 -0
- package/dist/lib/equities/equity-outcomes.js +33 -0
- package/dist/lib/equities/equity-outcomes.js.map +1 -0
- package/dist/lib/equities/equity-performance.d.ts +33 -0
- package/dist/lib/equities/equity-performance.d.ts.map +1 -0
- package/dist/lib/equities/equity-performance.js +51 -0
- package/dist/lib/equities/equity-performance.js.map +1 -0
- package/dist/lib/equities/equity-store.d.ts +67 -0
- package/dist/lib/equities/equity-store.d.ts.map +1 -0
- package/dist/lib/equities/equity-store.js +165 -0
- package/dist/lib/equities/equity-store.js.map +1 -0
- package/dist/lib/equities/equity-symbols.d.ts +25 -0
- package/dist/lib/equities/equity-symbols.d.ts.map +1 -0
- package/dist/lib/equities/equity-symbols.js +44 -0
- package/dist/lib/equities/equity-symbols.js.map +1 -0
- package/dist/lib/equities/equity-tool-formatters.d.ts +51 -0
- package/dist/lib/equities/equity-tool-formatters.d.ts.map +1 -0
- package/dist/lib/equities/equity-tool-formatters.js +134 -0
- package/dist/lib/equities/equity-tool-formatters.js.map +1 -0
- package/dist/lib/equities/equity-universe-rank.d.ts +29 -0
- package/dist/lib/equities/equity-universe-rank.d.ts.map +1 -0
- package/dist/lib/equities/equity-universe-rank.js +65 -0
- package/dist/lib/equities/equity-universe-rank.js.map +1 -0
- package/dist/lib/equities/equity-verdict.d.ts +35 -0
- package/dist/lib/equities/equity-verdict.d.ts.map +1 -0
- package/dist/lib/equities/equity-verdict.js +128 -0
- package/dist/lib/equities/equity-verdict.js.map +1 -0
- package/dist/lib/errors.d.ts +45 -0
- package/dist/lib/errors.d.ts.map +1 -1
- package/dist/lib/errors.js +52 -1
- package/dist/lib/errors.js.map +1 -1
- package/dist/lib/geo-dashboard.d.ts +38 -0
- package/dist/lib/geo-dashboard.d.ts.map +1 -1
- package/dist/lib/geo-dashboard.js +116 -2
- package/dist/lib/geo-dashboard.js.map +1 -1
- package/dist/lib/geo-digest.d.ts +126 -0
- package/dist/lib/geo-digest.d.ts.map +1 -0
- package/dist/lib/geo-digest.js +265 -0
- package/dist/lib/geo-digest.js.map +1 -0
- package/dist/lib/geo-extractor.d.ts +28 -2
- package/dist/lib/geo-extractor.d.ts.map +1 -1
- package/dist/lib/geo-extractor.js +73 -4
- package/dist/lib/geo-extractor.js.map +1 -1
- package/dist/lib/geo-gap-list.d.ts +37 -0
- package/dist/lib/geo-gap-list.d.ts.map +1 -0
- package/dist/lib/geo-gap-list.js +161 -0
- package/dist/lib/geo-gap-list.js.map +1 -0
- package/dist/lib/geo-orchestrator.d.ts +33 -8
- package/dist/lib/geo-orchestrator.d.ts.map +1 -1
- package/dist/lib/geo-orchestrator.js +119 -27
- package/dist/lib/geo-orchestrator.js.map +1 -1
- package/dist/lib/geo-storage.d.ts +24 -2
- package/dist/lib/geo-storage.d.ts.map +1 -1
- package/dist/lib/geo-storage.js +99 -3
- package/dist/lib/geo-storage.js.map +1 -1
- package/dist/lib/indicator-buckets.d.ts +8 -2
- package/dist/lib/indicator-buckets.d.ts.map +1 -1
- package/dist/lib/indicator-buckets.js +1 -0
- package/dist/lib/indicator-buckets.js.map +1 -1
- package/dist/lib/license.d.ts +6 -2
- package/dist/lib/license.d.ts.map +1 -1
- package/dist/lib/license.js +15 -4
- package/dist/lib/license.js.map +1 -1
- package/dist/lib/llm-provider.d.ts +123 -1
- package/dist/lib/llm-provider.d.ts.map +1 -1
- package/dist/lib/llm-provider.js +495 -1
- package/dist/lib/llm-provider.js.map +1 -1
- package/dist/lib/market-sessions-constants.d.ts +90 -0
- package/dist/lib/market-sessions-constants.d.ts.map +1 -0
- package/dist/lib/market-sessions-constants.js +142 -0
- package/dist/lib/market-sessions-constants.js.map +1 -0
- package/dist/lib/market-sessions.d.ts +48 -0
- package/dist/lib/market-sessions.d.ts.map +1 -0
- package/dist/lib/market-sessions.js +94 -0
- package/dist/lib/market-sessions.js.map +1 -0
- package/dist/lib/question-hash.d.ts +3 -0
- package/dist/lib/question-hash.d.ts.map +1 -0
- package/dist/lib/question-hash.js +25 -0
- package/dist/lib/question-hash.js.map +1 -0
- package/dist/lib/trade-call-scanner.d.ts +70 -0
- package/dist/lib/trade-call-scanner.d.ts.map +1 -0
- package/dist/lib/trade-call-scanner.js +235 -0
- package/dist/lib/trade-call-scanner.js.map +1 -0
- package/dist/lib/tradfi-funding.d.ts +96 -0
- package/dist/lib/tradfi-funding.d.ts.map +1 -0
- package/dist/lib/tradfi-funding.js +197 -0
- package/dist/lib/tradfi-funding.js.map +1 -0
- package/dist/lib/underlying-type.d.ts +28 -0
- package/dist/lib/underlying-type.d.ts.map +1 -0
- package/dist/lib/underlying-type.js +161 -0
- package/dist/lib/underlying-type.js.map +1 -0
- package/dist/lib/venue-coverage.d.ts +1 -1
- package/dist/lib/venue-coverage.d.ts.map +1 -1
- package/dist/lib/venue-coverage.js +12 -9
- package/dist/lib/venue-coverage.js.map +1 -1
- package/dist/lib/venue-store.d.ts +13 -0
- package/dist/lib/venue-store.d.ts.map +1 -1
- package/dist/lib/venue-store.js +32 -0
- package/dist/lib/venue-store.js.map +1 -1
- package/dist/lib/webhook-api.d.ts +7 -0
- package/dist/lib/webhook-api.d.ts.map +1 -1
- package/dist/lib/webhook-api.js +22 -1
- package/dist/lib/webhook-api.js.map +1 -1
- package/dist/lib/webhook-events.d.ts +12 -4
- package/dist/lib/webhook-events.d.ts.map +1 -1
- package/dist/lib/webhook-events.js +64 -5
- package/dist/lib/webhook-events.js.map +1 -1
- package/dist/lib/x402-bazaar.d.ts +18 -0
- package/dist/lib/x402-bazaar.d.ts.map +1 -1
- package/dist/lib/x402-bazaar.js +37 -4
- package/dist/lib/x402-bazaar.js.map +1 -1
- package/dist/lib/x402-http-routes.d.ts +44 -0
- package/dist/lib/x402-http-routes.d.ts.map +1 -0
- package/dist/lib/x402-http-routes.js +203 -0
- package/dist/lib/x402-http-routes.js.map +1 -0
- package/dist/lib/x402.d.ts +5 -1
- package/dist/lib/x402.d.ts.map +1 -1
- package/dist/lib/x402.js +28 -13
- package/dist/lib/x402.js.map +1 -1
- package/dist/scripts/backfill-equity-bars.d.ts +5 -0
- package/dist/scripts/backfill-equity-bars.d.ts.map +1 -0
- package/dist/scripts/backfill-equity-bars.js +83 -0
- package/dist/scripts/backfill-equity-bars.js.map +1 -0
- package/dist/scripts/backfill-equity-outcomes.d.ts +6 -0
- package/dist/scripts/backfill-equity-outcomes.d.ts.map +1 -0
- package/dist/scripts/backfill-equity-outcomes.js +64 -0
- package/dist/scripts/backfill-equity-outcomes.js.map +1 -0
- package/dist/scripts/build-equity-universe.d.ts +4 -0
- package/dist/scripts/build-equity-universe.d.ts.map +1 -0
- package/dist/scripts/build-equity-universe.js +102 -0
- package/dist/scripts/build-equity-universe.js.map +1 -0
- package/dist/scripts/evaluate-venues.d.ts +1 -1
- package/dist/scripts/evaluate-venues.d.ts.map +1 -1
- package/dist/scripts/evaluate-venues.js +36 -18
- package/dist/scripts/evaluate-venues.js.map +1 -1
- package/dist/scripts/geo-demand-mining.d.ts +59 -0
- package/dist/scripts/geo-demand-mining.d.ts.map +1 -0
- package/dist/scripts/geo-demand-mining.js +272 -0
- package/dist/scripts/geo-demand-mining.js.map +1 -0
- package/dist/scripts/geo-weekly-cron.js +163 -64
- package/dist/scripts/geo-weekly-cron.js.map +1 -1
- package/dist/scripts/promote-venue.d.ts +3 -0
- package/dist/scripts/promote-venue.d.ts.map +1 -0
- package/dist/scripts/promote-venue.js +103 -0
- package/dist/scripts/promote-venue.js.map +1 -0
- package/dist/scripts/retire-venue.d.ts +3 -0
- package/dist/scripts/retire-venue.d.ts.map +1 -0
- package/dist/scripts/retire-venue.js +49 -0
- package/dist/scripts/retire-venue.js.map +1 -0
- package/dist/scripts/seed-equities.d.ts +7 -0
- package/dist/scripts/seed-equities.d.ts.map +1 -0
- package/dist/scripts/seed-equities.js +89 -0
- package/dist/scripts/seed-equities.js.map +1 -0
- package/dist/scripts/seed-signals.d.ts +27 -1
- package/dist/scripts/seed-signals.d.ts.map +1 -1
- package/dist/scripts/seed-signals.js +336 -94
- package/dist/scripts/seed-signals.js.map +1 -1
- package/dist/scripts/venue-readiness-report.d.ts +18 -0
- package/dist/scripts/venue-readiness-report.d.ts.map +1 -0
- package/dist/scripts/venue-readiness-report.js +108 -0
- package/dist/scripts/venue-readiness-report.js.map +1 -0
- package/dist/tool-annotations.d.ts +26 -0
- package/dist/tool-annotations.d.ts.map +1 -0
- package/dist/tool-annotations.js +32 -0
- package/dist/tool-annotations.js.map +1 -0
- package/dist/tool-descriptions.d.ts +7 -0
- package/dist/tool-descriptions.d.ts.map +1 -1
- package/dist/tool-descriptions.js +13 -1
- package/dist/tool-descriptions.js.map +1 -1
- package/dist/tools/get-market-regime.d.ts.map +1 -1
- package/dist/tools/get-market-regime.js +91 -5
- package/dist/tools/get-market-regime.js.map +1 -1
- package/dist/tools/get-trade-call.d.ts.map +1 -1
- package/dist/tools/get-trade-call.js +44 -4
- package/dist/tools/get-trade-call.js.map +1 -1
- package/dist/tools/scan-trade-calls.d.ts +58 -0
- package/dist/tools/scan-trade-calls.d.ts.map +1 -0
- package/dist/tools/scan-trade-calls.js +81 -0
- package/dist/tools/scan-trade-calls.js.map +1 -0
- package/dist/types.d.ts +35 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/server.json +1 -1
package/README.md
CHANGED
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
scripts/snapshot-landing-data.mjs at npm-publish + Hetzner-deploy. Do NOT hand-edit the
|
|
40
40
|
numbers; edit "What's new" by hand. Wired by OPS-NPM-README-SINGLE-SOT-W1 (2026-05-31). -->
|
|
41
41
|
<p align="center">
|
|
42
|
-
<strong><span data-tr-field="pfe_wr">91.
|
|
42
|
+
<strong><span data-tr-field="pfe_wr">91.7%</span>% PFE Win Rate</strong> · <strong><span data-tr-field="total_calls">151,968</span> trade calls</strong> · <strong><span data-tr-field="merkle_batches">55</span> on-chain batches</strong> · <strong><span data-tr-field="hold_rate">98.9%</span>% HOLD rate</strong> <!-- SNAPSHOT-LINE -->
|
|
43
43
|
</p>
|
|
44
44
|
|
|
45
45
|
<p align="center">
|
|
@@ -101,9 +101,18 @@ Each demo is runnable as `python examples/<framework>/demo.py BTC 4h` — gets a
|
|
|
101
101
|
|
|
102
102
|
---
|
|
103
103
|
|
|
104
|
-
## What's new in v1.
|
|
104
|
+
## What's new in v1.20.0
|
|
105
105
|
|
|
106
|
-
Live since 2026-
|
|
106
|
+
Live since 2026-06-04:
|
|
107
|
+
|
|
108
|
+
- **📡 `scan_trade_calls` — market-wide scanner.** One call scans the top-N perps (1–100, ranked by open interest) on your chosen venue and returns every actionable BUY/SELL with confidence and regime. HOLDs stay free — quota counts only actionable calls.
|
|
109
|
+
- **🔔 Webhooks: dynamic `top:N` watchlists.** Subscribe with `assets: ["top:25"]` and your webhook follows the venue's top perps automatically. No manual list upkeep.
|
|
110
|
+
- **🏛️ TradFi-aware analysis.** Both core tools now report the underlying market session (`underlying_session`, with weekend/holiday caveats), interpret fixed pre-IPO funding correctly, and aggregate cross-venue funding sentiment for stocks, indices, commodities, and FX across all 5 venues.
|
|
111
|
+
- **🧭 Smarter errors on young listings.** Insufficient history returns a structured `INSUFFICIENT_CANDLES` error with `suggested_timeframes` instead of a plain string.
|
|
112
|
+
|
|
113
|
+
> MCP clients cache `tools/list` at session start — toggle the connector off/on (or restart the MCP connection) to see `scan_trade_calls`.
|
|
114
|
+
|
|
115
|
+
### v1.19.0 highlights (recap)
|
|
107
116
|
|
|
108
117
|
- **🔔 Webhook Delivery Service.** Subscribe a URL; receive `trade_call` and `regime_shift` events as push, not poll. Payloads are HMAC-SHA256 signed, retried, and idempotent. Manage over HTTP: `POST` / `GET` / `DELETE /api/webhooks`, plus `POST /api/webhooks/:id/test` for a live test fire. API key required.
|
|
109
118
|
- **🔗 One-call signal verification.** Every webhook payload carries a `verify_url`. Resolve it at `GET /api/verify-signal?hash=<signal_hash>` for that call's public, on-chain-anchored record.
|
|
@@ -167,7 +176,7 @@ Live since 2026-05-30:
|
|
|
167
176
|
- **🪪 ERC-8004 Verified Agent on Base.** AlgoVault MCP is registered on the canonical ERC-8004 Identity Registry at [`0x8004A169...e539a432`](https://basescan.org/address/0x8004A169FB4a3325136EB29fA0ceB6D2e539a432). Each call traces back to a portable, censorship-resistant agent identity on Base L2. agentId [`44544`](https://basescan.org/token/0x8004A169FB4a3325136EB29fA0ceB6D2e539a432?a=44544) on Basescan. Same on-chain track record; new verified agent handle that AI orchestrators can resolve.
|
|
168
177
|
- **🔌 `/api/erc-8004-reputation` endpoint.** Read-only JSON aggregator exposing agentId, identity registry address, registration timestamp, and Basescan link. Cached 5 minutes. `curl -s api.algovault.com/api/erc-8004-reputation | jq`.
|
|
169
178
|
|
|
170
|
-
> **Upgrading from v1.
|
|
179
|
+
> **Upgrading from v1.19.x or earlier?** The six original tools — `get_trade_call`, `get_trade_signal`, `scan_funding_arb`, `get_market_regime`, `search_knowledge`, `chat_knowledge` — keep their parameter shapes unchanged. v1.20.0 adds ONE new tool, `scan_trade_calls` (top-N market scanner), and additive output fields on the core tools (`underlying_session`, `session_note`, `metrics.funding_by_venue`) plus a structured `INSUFFICIENT_CANDLES` error — all backward-compatible. Because MCP clients (Claude Desktop, Cursor, Cline) cache `tools/list` at session start, reconnect (toggle the connector off/on) once to see `scan_trade_calls`; existing integrations keep working without changes.
|
|
171
180
|
|
|
172
181
|
---
|
|
173
182
|
|
|
@@ -186,7 +195,7 @@ AlgoVault is different. We give your agent **one answer**: a directional verdict
|
|
|
186
195
|
- **ERC-8004 verified agent.** AlgoVault MCP holds a registered agentId on the Base L2 Identity Registry. The agent identity is portable and on-chain.
|
|
187
196
|
- **Drop-in for every major agent framework.** First-party tutorials + runnable demos for LangChain, LlamaIndex, Microsoft Agent Framework, CrewAI. ≤5 minutes to first call. See the [Framework integrations](#framework-integrations) section.
|
|
188
197
|
- **Self-tuning model.** Indicator weights are tuned from live outcome data by our [Autonomous Optimization Engine](https://algovault.com/how-it-works). The model gets sharper with every signal.
|
|
189
|
-
- **Crypto + TradFi coverage.**
|
|
198
|
+
- **Crypto + TradFi coverage.** 760+ assets — standard crypto perps on all 5 CEX; TradFi perps (stocks, indices, commodities, FX); liquidity-filtered meme coins. <!-- SNAPSHOT-LINE -->
|
|
190
199
|
|
|
191
200
|
---
|
|
192
201
|
|
|
@@ -261,7 +270,7 @@ Responses also include optional `closest_tradeable` (on HOLD verdicts) and `also
|
|
|
261
270
|
{ "coin": "SOL", "timeframe": "15m", "confidence": 73 }
|
|
262
271
|
],
|
|
263
272
|
"_algovault": {
|
|
264
|
-
"version": "1.
|
|
273
|
+
"version": "1.20.0",
|
|
265
274
|
"tool": "get_trade_call",
|
|
266
275
|
"compatible_with": ["crypto-quant-risk-mcp", "crypto-quant-backtest-mcp"]
|
|
267
276
|
}
|
|
@@ -293,6 +302,22 @@ Combines directional strength measurement with ADX slope analysis (detecting tre
|
|
|
293
302
|
|
|
294
303
|
**Output includes:** regime label, confidence score, underlying metrics (trend strength, volatility interpretation, price structure), cross-venue funding sentiment, and a plain-English strategy suggestion.
|
|
295
304
|
|
|
305
|
+
### `scan_trade_calls`
|
|
306
|
+
|
|
307
|
+
Scans the **top-N perpetual futures by open interest** on a venue and returns composite BUY/SELL/HOLD verdicts for the whole set in one call — market-wide coverage for agents that would otherwise loop `get_trade_call` per coin.
|
|
308
|
+
|
|
309
|
+
Non-HOLD calls are ranked first by confidence; HOLDs are free and never consume quota (quota counts only the actionable BUY/SELL results returned).
|
|
310
|
+
|
|
311
|
+
**Parameters:**
|
|
312
|
+
- `topN` (integer 1–100, default `20`): How many top perps (by open interest) to scan
|
|
313
|
+
- `timeframe` (string, default `"15m"`): Candle timeframe for the scan — `1m`–`1d`
|
|
314
|
+
- `exchange` (string, default `"BINANCE"`): Venue — `BINANCE`, `HL`, `BYBIT`, `OKX`, `BITGET`
|
|
315
|
+
- `minConfidence` (number 0–100, optional): Drop non-HOLD calls below this confidence
|
|
316
|
+
- `includeHolds` (boolean, default `false`): Append HOLD calls after the non-HOLD results
|
|
317
|
+
- `limit` (integer 1–100, default `10`): Max ranked calls returned (non-HOLD first)
|
|
318
|
+
|
|
319
|
+
**Output includes:** an array of `{ coin, timeframe, exchange, call, confidence, regime }` entries, ranked non-HOLD first, plus the scan's venue and timeframe.
|
|
320
|
+
|
|
296
321
|
---
|
|
297
322
|
|
|
298
323
|
## When You Hit the Free Limit
|
|
@@ -322,7 +347,7 @@ or pay per call via x402.
|
|
|
322
347
|
| Feature | Free | Starter ($9.99/mo) | Pro ($49/mo) | Enterprise ($299/mo) | x402 (per call) |
|
|
323
348
|
|---------|------|-------------------|-------------|---------------------|-----------------|
|
|
324
349
|
| Exchanges | All 5 | All 5 | All 5 | All 5 | All 5 | <!-- SNAPSHOT-LINE-TABLE -->
|
|
325
|
-
| Assets | All
|
|
350
|
+
| Assets | All 760+ | All 760+ | All 760+ | All 760+ | All 760+ | <!-- SNAPSHOT-LINE-TABLE -->
|
|
326
351
|
| Asset classes | Crypto + TradFi | Crypto + TradFi | Crypto + TradFi | Crypto + TradFi | Crypto + TradFi |
|
|
327
352
|
| Timeframes | All 11 | All 11 | All 11 | All 11 | All 11 |
|
|
328
353
|
| Funding arb results | Top 5 | Unlimited | Unlimited | Unlimited | Unlimited |
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAWA,OAAO,EAAE,SAAS,EAAoB,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAWA,OAAO,EAAE,SAAS,EAAoB,MAAM,yCAAyC,CAAC;AA+xGtF,wBAAgB,mBAAmB,cAElC"}
|
package/dist/index.js
CHANGED
|
@@ -54,6 +54,7 @@ const zod_1 = require("zod");
|
|
|
54
54
|
const get_trade_call_js_1 = require("./tools/get-trade-call.js");
|
|
55
55
|
const scan_funding_arb_js_1 = require("./tools/scan-funding-arb.js");
|
|
56
56
|
const get_market_regime_js_1 = require("./tools/get-market-regime.js");
|
|
57
|
+
const scan_trade_calls_js_1 = require("./tools/scan-trade-calls.js");
|
|
57
58
|
const signal_performance_js_1 = require("./resources/signal-performance.js");
|
|
58
59
|
const cross_asset_grid_js_1 = require("./lib/cross-asset-grid.js");
|
|
59
60
|
const performance_db_js_1 = require("./lib/performance-db.js");
|
|
@@ -66,6 +67,11 @@ const asset_tiers_js_1 = require("./lib/asset-tiers.js");
|
|
|
66
67
|
const capabilities_js_1 = require("./lib/capabilities.js");
|
|
67
68
|
const license_js_1 = require("./lib/license.js");
|
|
68
69
|
const x402_js_1 = require("./lib/x402.js");
|
|
70
|
+
const x402_http_routes_js_1 = require("./lib/x402-http-routes.js");
|
|
71
|
+
const tool_annotations_js_1 = require("./tool-annotations.js");
|
|
72
|
+
const equity_tool_formatters_js_1 = require("./lib/equities/equity-tool-formatters.js");
|
|
73
|
+
const equity_performance_js_1 = require("./lib/equities/equity-performance.js");
|
|
74
|
+
const equity_store_js_1 = require("./lib/equities/equity-store.js");
|
|
69
75
|
const analytics_js_1 = require("./lib/analytics.js");
|
|
70
76
|
const stripe_events_store_js_1 = require("./lib/stripe-events-store.js");
|
|
71
77
|
const signup_emails_store_js_1 = require("./lib/signup-emails-store.js");
|
|
@@ -157,6 +163,10 @@ function toolErrorContent(err) {
|
|
|
157
163
|
};
|
|
158
164
|
return { content: [{ type: 'text', text: JSON.stringify(payload) }], isError: true };
|
|
159
165
|
}
|
|
166
|
+
if (err instanceof errors_js_1.InsufficientCandlesError) {
|
|
167
|
+
const payload = (0, errors_js_1.buildInsufficientCandlesPayload)(err);
|
|
168
|
+
return { content: [{ type: 'text', text: JSON.stringify(payload) }], isError: true };
|
|
169
|
+
}
|
|
160
170
|
const message = err instanceof Error ? err.message : String(err);
|
|
161
171
|
return { content: [{ type: 'text', text: JSON.stringify({ error: message }) }], isError: true };
|
|
162
172
|
}
|
|
@@ -295,8 +305,8 @@ function createServer() {
|
|
|
295
305
|
}
|
|
296
306
|
};
|
|
297
307
|
}
|
|
298
|
-
server.tool('get_trade_call', tool_descriptions_js_1.TRADE_CALL_DESCRIPTION, TRADE_CALL_SCHEMA, {
|
|
299
|
-
server.tool('get_trade_signal', tool_descriptions_js_1.TRADE_CALL_DESCRIPTION + tool_descriptions_js_1.TRADE_CALL_ALIAS_SUFFIX, TRADE_CALL_SCHEMA, {
|
|
308
|
+
server.tool('get_trade_call', tool_descriptions_js_1.TRADE_CALL_DESCRIPTION, TRADE_CALL_SCHEMA, { title: 'Composite Trade Call', ...tool_annotations_js_1.PUBLIC_READONLY_TOOL_ANNOTATIONS }, makeTradeCallHandler('get_trade_call'));
|
|
309
|
+
server.tool('get_trade_signal', tool_descriptions_js_1.TRADE_CALL_DESCRIPTION + tool_descriptions_js_1.TRADE_CALL_ALIAS_SUFFIX, TRADE_CALL_SCHEMA, { title: 'Trade Signal', ...tool_annotations_js_1.PUBLIC_READONLY_TOOL_ANNOTATIONS }, makeTradeCallHandler('get_trade_signal'));
|
|
300
310
|
// ── Tool 2: scan_funding_arb ──
|
|
301
311
|
server.tool('scan_funding_arb', tool_descriptions_js_1.SCAN_FUNDING_ARB_DESCRIPTION, {
|
|
302
312
|
// DoS-prevention bounds (delta audit 2026-04-15): minSpreadBps clamped to
|
|
@@ -305,7 +315,7 @@ function createServer() {
|
|
|
305
315
|
// hard boundary validation at the handler edge.
|
|
306
316
|
minSpreadBps: zod_1.z.number().min(0).max(10_000).default(5).describe(tool_descriptions_js_1.PARAM_DESC_FUNDING_MIN_SPREAD_BPS),
|
|
307
317
|
limit: zod_1.z.number().int().min(1).max(200).default(10).describe(tool_descriptions_js_1.PARAM_DESC_FUNDING_LIMIT),
|
|
308
|
-
}, {
|
|
318
|
+
}, { title: 'Funding Arbitrage Scanner', ...tool_annotations_js_1.PUBLIC_READONLY_TOOL_ANNOTATIONS }, async ({ minSpreadBps, limit }) => {
|
|
309
319
|
const startMs = Date.now();
|
|
310
320
|
try {
|
|
311
321
|
const license = (0, license_js_1.getRequestLicense)();
|
|
@@ -339,7 +349,7 @@ function createServer() {
|
|
|
339
349
|
coin: zod_1.z.string().max(20).describe(tool_descriptions_js_1.PARAM_DESC_REGIME_COIN),
|
|
340
350
|
timeframe: zod_1.z.enum(['1h', '4h', '1d']).default('4h').describe(tool_descriptions_js_1.PARAM_DESC_REGIME_TIMEFRAME),
|
|
341
351
|
exchange: zod_1.z.enum(['HL', 'BINANCE', 'BYBIT', 'OKX', 'BITGET', 'ASTER', 'EDGEX', 'GATE', 'MEXC', 'KUCOIN', 'PHEMEX', 'BINGX', 'HTX', 'WEEX', 'BITMART', 'XT', 'WHITEBIT']).default('HL').describe(tool_descriptions_js_1.PARAM_DESC_REGIME_EXCHANGE),
|
|
342
|
-
}, {
|
|
352
|
+
}, { title: 'Market Regime Classifier', ...tool_annotations_js_1.PUBLIC_READONLY_TOOL_ANNOTATIONS }, async ({ coin, timeframe, exchange }) => {
|
|
343
353
|
const startMs = Date.now();
|
|
344
354
|
try {
|
|
345
355
|
const license = (0, license_js_1.getRequestLicense)();
|
|
@@ -370,6 +380,90 @@ function createServer() {
|
|
|
370
380
|
return toolErrorContent(err);
|
|
371
381
|
}
|
|
372
382
|
});
|
|
383
|
+
// ── Tools: get_equity_call + get_equity_regime (EQUITIES-ENGINE-W1) ──
|
|
384
|
+
// US equities daily-bar verdict engine (Databento EQUS.MINI). Free-tier quota
|
|
385
|
+
// wiring identical to the crypto free tools (handled inside getEquityCall via
|
|
386
|
+
// trackCall). Verdicts are precomputed nightly; the handler is a DB read.
|
|
387
|
+
const GET_EQUITY_CALL_DESCRIPTION = 'Composite daily-bar trade call (BUY/SELL/HOLD) for a US equity or ETF, with confidence, ' +
|
|
388
|
+
'market regime, and the technical factors that drove it. Universe = top US equities by ' +
|
|
389
|
+
'dollar-volume plus index and crypto-proxy ETFs (SPY, QQQ, IBIT, …). Verdicts are computed ' +
|
|
390
|
+
'once per session from Databento EQUS.MINI daily bars. Out-of-universe tickers return a ' +
|
|
391
|
+
'structured SYMBOL_NOT_IN_UNIVERSE error with nearest-symbol suggestions. Accepts BRK-B or BRK.B.';
|
|
392
|
+
const GET_EQUITY_REGIME_DESCRIPTION = 'Market regime for a US equity or ETF (defaults to SPY): trending_up, trending_down, ' +
|
|
393
|
+
'compression, or ranging, with a confidence score. Derived from daily-bar trend strength ' +
|
|
394
|
+
'(ADX/DI), persistence (Hurst), and volatility compression.';
|
|
395
|
+
server.tool('get_equity_call', GET_EQUITY_CALL_DESCRIPTION, { symbol: zod_1.z.string().max(12).describe('US equity/ETF ticker, e.g. AAPL, SPY, BRK.B (BRK-B also accepted).') }, { title: 'Equity Trade Call', ...tool_annotations_js_1.PUBLIC_READONLY_TOOL_ANNOTATIONS }, async ({ symbol }) => {
|
|
396
|
+
const startMs = Date.now();
|
|
397
|
+
try {
|
|
398
|
+
const license = (0, license_js_1.getRequestLicense)();
|
|
399
|
+
const result = await (0, equity_tool_formatters_js_1.getEquityCall)({ symbol, license });
|
|
400
|
+
(0, analytics_js_1.logRequest)({
|
|
401
|
+
sessionId: (0, license_js_1.getRequestSessionId)(),
|
|
402
|
+
toolName: 'get_equity_call',
|
|
403
|
+
asset: symbol,
|
|
404
|
+
licenseTier: license.tier,
|
|
405
|
+
responseTimeMs: Date.now() - startMs,
|
|
406
|
+
ipHash: (0, license_js_1.getRequestIpHash)(),
|
|
407
|
+
isBotInternal: license.tier === 'internal',
|
|
408
|
+
});
|
|
409
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
410
|
+
}
|
|
411
|
+
catch (err) {
|
|
412
|
+
return toolErrorContent(err);
|
|
413
|
+
}
|
|
414
|
+
});
|
|
415
|
+
server.tool('get_equity_regime', GET_EQUITY_REGIME_DESCRIPTION, { symbol: zod_1.z.string().max(12).optional().describe('US equity/ETF ticker; defaults to SPY.') }, { title: 'Equity Market Regime', ...tool_annotations_js_1.PUBLIC_READONLY_TOOL_ANNOTATIONS }, async ({ symbol }) => {
|
|
416
|
+
const startMs = Date.now();
|
|
417
|
+
try {
|
|
418
|
+
const license = (0, license_js_1.getRequestLicense)();
|
|
419
|
+
const result = await (0, equity_tool_formatters_js_1.getEquityRegime)({ symbol, license });
|
|
420
|
+
(0, analytics_js_1.logRequest)({
|
|
421
|
+
sessionId: (0, license_js_1.getRequestSessionId)(),
|
|
422
|
+
toolName: 'get_equity_regime',
|
|
423
|
+
asset: symbol ?? 'SPY',
|
|
424
|
+
licenseTier: license.tier,
|
|
425
|
+
responseTimeMs: Date.now() - startMs,
|
|
426
|
+
ipHash: (0, license_js_1.getRequestIpHash)(),
|
|
427
|
+
isBotInternal: license.tier === 'internal',
|
|
428
|
+
});
|
|
429
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
430
|
+
}
|
|
431
|
+
catch (err) {
|
|
432
|
+
return toolErrorContent(err);
|
|
433
|
+
}
|
|
434
|
+
});
|
|
435
|
+
// ── Tool: scan_trade_calls (SCAN-TRADE-CALLS-W1) — cross-asset market scanner ──
|
|
436
|
+
// Thin handler: quota gate + envelope live in src/tools/scan-trade-calls.ts
|
|
437
|
+
// (runScanTradeCall); the scanner compute is src/lib/trade-call-scanner.ts.
|
|
438
|
+
server.tool('scan_trade_calls', scan_trade_calls_js_1.SCAN_TRADE_CALLS_DESCRIPTION, scan_trade_calls_js_1.SCAN_TRADE_CALLS_SCHEMA, { title: 'Market Scanner', ...tool_annotations_js_1.PUBLIC_READONLY_TOOL_ANNOTATIONS }, async ({ topN, timeframe, exchange, minConfidence, includeHolds, limit }) => {
|
|
439
|
+
const startMs = Date.now();
|
|
440
|
+
try {
|
|
441
|
+
const license = (0, license_js_1.getRequestLicense)();
|
|
442
|
+
const result = await (0, scan_trade_calls_js_1.runScanTradeCall)({ topN, timeframe, exchange, minConfidence, includeHolds, limit }, license);
|
|
443
|
+
(0, analytics_js_1.logRequest)({
|
|
444
|
+
sessionId: (0, license_js_1.getRequestSessionId)(),
|
|
445
|
+
toolName: 'scan_trade_calls',
|
|
446
|
+
timeframe,
|
|
447
|
+
licenseTier: license.tier,
|
|
448
|
+
responseTimeMs: Date.now() - startMs,
|
|
449
|
+
ipHash: (0, license_js_1.getRequestIpHash)(),
|
|
450
|
+
isBotInternal: license.tier === 'internal',
|
|
451
|
+
});
|
|
452
|
+
const sessionIdForCohort = (0, license_js_1.getRequestSessionId)() ?? null;
|
|
453
|
+
if (sessionIdForCohort !== null) {
|
|
454
|
+
(0, performance_db_js_1.upsertAgentSession)({
|
|
455
|
+
sessionId: sessionIdForCohort,
|
|
456
|
+
tool: 'scan_trade_calls',
|
|
457
|
+
tier: license.tier,
|
|
458
|
+
ipHash: (0, license_js_1.getRequestIpHash)() ?? null,
|
|
459
|
+
}).catch((e) => console.debug('upsertAgentSession failed:', e instanceof Error ? e.message : e));
|
|
460
|
+
}
|
|
461
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
462
|
+
}
|
|
463
|
+
catch (err) {
|
|
464
|
+
return toolErrorContent(err);
|
|
465
|
+
}
|
|
466
|
+
});
|
|
373
467
|
// ── Tool 4: search_knowledge ──
|
|
374
468
|
// AV-CHAT-MCP-W1 (C2, 2026-05-18). BM25 lexical retrieval over the auto-
|
|
375
469
|
// generated KnowledgeBundle (dist/knowledge/latest.json). Free, fast, no
|
|
@@ -379,7 +473,7 @@ function createServer() {
|
|
|
379
473
|
server.tool('search_knowledge', tool_descriptions_js_1.SEARCH_KNOWLEDGE_DESCRIPTION, {
|
|
380
474
|
query: zod_1.z.string().min(3).max(500).describe('Natural-language search query (3-500 chars).'),
|
|
381
475
|
limit: zod_1.z.number().int().min(1).max(50).optional().describe('Max ranked results (1-50, default 10).'),
|
|
382
|
-
}, {
|
|
476
|
+
}, { title: 'Knowledge Search', ...tool_annotations_js_1.PUBLIC_READONLY_TOOL_ANNOTATIONS }, async ({ query, limit }) => {
|
|
383
477
|
const startMs = Date.now();
|
|
384
478
|
try {
|
|
385
479
|
const license = (0, license_js_1.getRequestLicense)();
|
|
@@ -410,7 +504,7 @@ function createServer() {
|
|
|
410
504
|
server.tool('chat_knowledge', tool_descriptions_js_1.CHAT_KNOWLEDGE_DESCRIPTION, {
|
|
411
505
|
question: zod_1.z.string().min(5).max(500).describe('Natural-language question (5-500 chars).'),
|
|
412
506
|
model: zod_1.z.enum(['claude-haiku-4-5-20251001', 'claude-sonnet-4-6']).optional().describe('Optional model override (default claude-haiku-4-5-20251001).'),
|
|
413
|
-
}, {
|
|
507
|
+
}, { title: 'Knowledge Q&A', ...tool_annotations_js_1.PUBLIC_READONLY_TOOL_ANNOTATIONS }, async ({ question, model }) => {
|
|
414
508
|
const startMs = Date.now();
|
|
415
509
|
try {
|
|
416
510
|
const license = (0, license_js_1.getRequestLicense)();
|
|
@@ -492,10 +586,20 @@ function createServer() {
|
|
|
492
586
|
// AlgoVault's quant engine — never exposed via MCP or any public surface.
|
|
493
587
|
server.resource('signal-performance', 'performance://signal-performance', { description: 'Signal track record — PFE win rates by timeframe, asset, tier, and signal type. Measures whether price moved in the signal direction during the evaluation window.' }, async () => {
|
|
494
588
|
const stats = await (0, signal_performance_js_1.getSignalPerformance)();
|
|
589
|
+
// EQUITIES-ENGINE-W1 E6: ADDITIVE `equities` key (PFE-only). Crypto keys
|
|
590
|
+
// byte-unchanged. Fail-open — equity DB issues must never break the crypto
|
|
591
|
+
// resource (graceful pre-data shape on error).
|
|
592
|
+
let equities;
|
|
593
|
+
try {
|
|
594
|
+
equities = await (0, equity_performance_js_1.getEquityPerformance)((0, equity_store_js_1.getEquityPool)());
|
|
595
|
+
}
|
|
596
|
+
catch {
|
|
597
|
+
equities = { state: 'pre_data', overall: { totalCalls: 0, totalEvaluated: 0, pfeWinRate: null } };
|
|
598
|
+
}
|
|
495
599
|
return {
|
|
496
600
|
contents: [{
|
|
497
601
|
uri: 'performance://signal-performance',
|
|
498
|
-
text: JSON.stringify(stats, null, 2),
|
|
602
|
+
text: JSON.stringify({ ...stats, equities }, null, 2),
|
|
499
603
|
mimeType: 'application/json',
|
|
500
604
|
}],
|
|
501
605
|
};
|
|
@@ -1669,6 +1773,10 @@ async function startHttp() {
|
|
|
1669
1773
|
let _analyticsQuestion = '';
|
|
1670
1774
|
let _analyticsApiKey = null;
|
|
1671
1775
|
let _analyticsTier = 'free';
|
|
1776
|
+
// GEO-MEASUREMENT-W2 (C1) enum-widening cascade: LLMProviderName widened
|
|
1777
|
+
// with 'perplexity' (architect-ratified). Annotate with the canonical type
|
|
1778
|
+
// (not a stale 4-literal) so future engines need zero touch here. Behavior
|
|
1779
|
+
// unchanged — type annotation only.
|
|
1672
1780
|
let _analyticsProvider = 'anthropic';
|
|
1673
1781
|
let _analyticsModel = 'claude-haiku-4-5-20251001';
|
|
1674
1782
|
try {
|
|
@@ -1923,6 +2031,13 @@ async function startHttp() {
|
|
|
1923
2031
|
}
|
|
1924
2032
|
});
|
|
1925
2033
|
});
|
|
2034
|
+
// X402-BAZAAR-HTTP-REDECLARE-W1: mount the HTTP x402 resource routes (the CDP Bazaar
|
|
2035
|
+
// discovery surface) — ONLY when X402_FACILITATOR=cdp AND BAZAAR_DISCOVERABLE=true.
|
|
2036
|
+
// Defaults (legacy/false) → nothing mounted → /x402/* returns 404 (byte-identical prod).
|
|
2037
|
+
const x402HttpRoutes = (0, x402_http_routes_js_1.mountX402HttpRoutes)(app);
|
|
2038
|
+
if (x402HttpRoutes.length > 0) {
|
|
2039
|
+
console.log(`x402 HTTP resource routes mounted (CDP Bazaar discovery): ${x402HttpRoutes.join(', ')}`);
|
|
2040
|
+
}
|
|
1926
2041
|
const httpServer = app.listen(port, () => {
|
|
1927
2042
|
console.log(`crypto-quant-signal-mcp running on http://0.0.0.0:${port}/mcp`);
|
|
1928
2043
|
console.log(`Health check: http://0.0.0.0:${port}/health`);
|
|
@@ -2166,6 +2281,7 @@ function getPerformanceDashboardHtml(opts) {
|
|
|
2166
2281
|
<meta charset="utf-8">
|
|
2167
2282
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
2168
2283
|
<title>Live Track Record — AlgoVault Labs</title>
|
|
2284
|
+
<meta name="description" content="AlgoVault's live trade-call track record. Every signal is Merkle-anchored on Base L2 for independent on-chain verification. Don't trust; verify.">
|
|
2169
2285
|
<!-- BEGIN: AlgoVault canonical design loader (DESIGN-W3 / C4, cross-origin) -->
|
|
2170
2286
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
2171
2287
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|