crypto-quant-signal-mcp 1.6.0 → 1.7.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 +15 -13
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +157 -103
- package/dist/index.js.map +1 -1
- package/dist/lib/adapters/hyperliquid.d.ts +9 -0
- package/dist/lib/adapters/hyperliquid.d.ts.map +1 -1
- package/dist/lib/adapters/hyperliquid.js +31 -2
- package/dist/lib/adapters/hyperliquid.js.map +1 -1
- package/dist/lib/asset-tiers.d.ts +1 -0
- package/dist/lib/asset-tiers.d.ts.map +1 -1
- package/dist/lib/asset-tiers.js +1 -0
- package/dist/lib/asset-tiers.js.map +1 -1
- package/dist/lib/indicators.d.ts +25 -6
- package/dist/lib/indicators.d.ts.map +1 -1
- package/dist/lib/indicators.js +168 -21
- package/dist/lib/indicators.js.map +1 -1
- package/dist/lib/license.d.ts.map +1 -1
- package/dist/lib/license.js +3 -2
- package/dist/lib/license.js.map +1 -1
- package/dist/lib/oi-ranking.d.ts.map +1 -1
- package/dist/lib/oi-ranking.js +2 -1
- package/dist/lib/oi-ranking.js.map +1 -1
- package/dist/lib/performance-db.d.ts +11 -0
- package/dist/lib/performance-db.d.ts.map +1 -1
- package/dist/lib/performance-db.js +72 -89
- package/dist/lib/performance-db.js.map +1 -1
- package/dist/lib/stripe.d.ts +2 -2
- package/dist/lib/stripe.d.ts.map +1 -1
- package/dist/lib/stripe.js +12 -2
- package/dist/lib/stripe.js.map +1 -1
- package/dist/scripts/seed-signals.js +12 -2
- package/dist/scripts/seed-signals.js.map +1 -1
- package/dist/tools/get-market-regime.d.ts.map +1 -1
- package/dist/tools/get-market-regime.js +139 -46
- package/dist/tools/get-market-regime.js.map +1 -1
- package/dist/tools/get-trade-signal.js +1 -1
- package/dist/tools/scan-funding-arb.d.ts.map +1 -1
- package/dist/tools/scan-funding-arb.js +148 -17
- package/dist/tools/scan-funding-arb.js.map +1 -1
- package/dist/types.d.ts +28 -21
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -1
- package/server.json +19 -45
package/README.md
CHANGED
|
@@ -10,6 +10,8 @@ The signal intelligence layer for AI trading agents — composite quant signals
|
|
|
10
10
|
[](https://www.npmjs.com/package/crypto-quant-signal-mcp)
|
|
11
11
|
[](https://opensource.org/licenses/MIT)
|
|
12
12
|
|
|
13
|
+
**[Live Track Record](https://algovault.com/track-record)** — 90%+ directional accuracy across 900+ trade calls. Public, no login required.
|
|
14
|
+
|
|
13
15
|
---
|
|
14
16
|
|
|
15
17
|
## Why AlgoVault
|
|
@@ -73,7 +75,7 @@ Only high-conviction signals are generated. The engine is designed to stay silen
|
|
|
73
75
|
|
|
74
76
|
### `scan_funding_arb`
|
|
75
77
|
|
|
76
|
-
Scans cross-venue funding rate differentials across Hyperliquid, Binance, and Bybit. Normalizes hourly vs 8-hour rate conventions, computes basis-point spreads, and ranks opportunities by
|
|
78
|
+
Scans cross-venue funding rate differentials across Hyperliquid, Binance, and Bybit. Normalizes hourly vs 8-hour rate conventions, computes basis-point spreads, and ranks opportunities by composite score (spread magnitude, time urgency, and funding conviction from 24h history).
|
|
77
79
|
|
|
78
80
|
This is the only MCP server that provides cross-venue funding arbitrage intelligence — long one exchange, short another, capture the spread.
|
|
79
81
|
|
|
@@ -87,7 +89,7 @@ This is the only MCP server that provides cross-venue funding arbitrage intellig
|
|
|
87
89
|
|
|
88
90
|
Classifies the current market environment into one of four regimes: **TRENDING_UP**, **TRENDING_DOWN**, **RANGING**, or **VOLATILE**.
|
|
89
91
|
|
|
90
|
-
Uses a multi-dimensional classification approach combining directional strength measurement
|
|
92
|
+
Uses a multi-dimensional classification approach combining directional strength measurement with ADX slope analysis (detecting trend strengthening vs exhaustion), volume-weighted pivot detection, ATR-adaptive funding thresholds, and cross-venue funding sentiment divergence. The regime classification directly informs how `get_trade_signal` filters its output — agents can also use it independently for strategy selection and position sizing.
|
|
91
93
|
|
|
92
94
|
**Parameters:**
|
|
93
95
|
- `coin` (string, required): Asset symbol
|
|
@@ -118,20 +120,20 @@ Every signal is tracked from emission to outcome. No exceptions.
|
|
|
118
120
|
|
|
119
121
|
## Pricing
|
|
120
122
|
|
|
121
|
-
| Feature | Free | Pro ($49/mo) | Enterprise ($299/mo) | x402 (per call) |
|
|
122
|
-
|
|
123
|
-
| Assets | BTC, ETH | All 290+
|
|
124
|
-
| Asset classes | Crypto only | Crypto + TradFi | Crypto + TradFi | Crypto + TradFi |
|
|
125
|
-
| Timeframes | 15m, 1h | All 11 | All 11 | All 11 |
|
|
126
|
-
| Funding arb results | Top 5 | Unlimited | Unlimited | Unlimited |
|
|
127
|
-
| Track record | Full access | Full access | Full access | Full access |
|
|
128
|
-
| Monthly calls | ~100/day | 15,000/mo |
|
|
129
|
-
| Support | Community | Email | Priority | — |
|
|
130
|
-
| Price | $0 | $49/mo | $299/mo | $0.01–0.05/call |
|
|
123
|
+
| Feature | Free | Starter ($9.99/mo) | Pro ($49/mo) | Enterprise ($299/mo) | x402 (per call) |
|
|
124
|
+
|---------|------|-------------------|-------------|---------------------|-----------------|
|
|
125
|
+
| Assets | BTC, ETH | All 290+ | All 290+ | All 290+ | All 290+ |
|
|
126
|
+
| Asset classes | Crypto only | Crypto + TradFi | Crypto + TradFi | Crypto + TradFi | Crypto + TradFi |
|
|
127
|
+
| Timeframes | 15m, 1h | All 11 | All 11 | All 11 | All 11 |
|
|
128
|
+
| Funding arb results | Top 5 | Unlimited | Unlimited | Unlimited | Unlimited |
|
|
129
|
+
| Track record | Full access | Full access | Full access | Full access | Full access |
|
|
130
|
+
| Monthly calls | ~100/day | 3,000/mo | 15,000/mo | 100,000/mo | Unlimited |
|
|
131
|
+
| Support | Community | Email | Priority | Dedicated | — |
|
|
132
|
+
| Price | $0 | $9.99/mo | $49/mo | $299/mo | $0.01–0.05/call |
|
|
131
133
|
|
|
132
134
|
**x402 micropayments:** AI agents pay per HTTP call with USDC on Base — no signup, no API key, no billing. The payment receipt is the credential. See [x402.org](https://x402.org).
|
|
133
135
|
|
|
134
|
-
**Subscriptions:** Sign up at [api.algovault.com/signup](https://api.algovault.com/signup). API key delivered instantly after checkout.
|
|
136
|
+
**Subscriptions:** Sign up at [api.algovault.com/signup](https://api.algovault.com/signup). Starter ($9.99/mo) unlocks all assets and timeframes. API key delivered instantly after checkout.
|
|
135
137
|
|
|
136
138
|
---
|
|
137
139
|
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AASA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AASA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAk7BpE,wBAAgB,mBAAmB,cAElC"}
|
package/dist/index.js
CHANGED
|
@@ -31,7 +31,7 @@ const oi_ranking_js_1 = require("./lib/oi-ranking.js");
|
|
|
31
31
|
function createServer() {
|
|
32
32
|
const server = new mcp_js_1.McpServer({
|
|
33
33
|
name: 'crypto-quant-signal-mcp',
|
|
34
|
-
version: '1.
|
|
34
|
+
version: '1.7.0',
|
|
35
35
|
});
|
|
36
36
|
// ── Tool 1: get_trade_signal ──
|
|
37
37
|
server.tool('get_trade_signal', "Returns a composite BUY/SELL/HOLD signal for a Hyperliquid perp. Combines RSI(14), EMA(9/21) crossover, funding rate, OI momentum, and volume into a weighted score with confidence percentage.", {
|
|
@@ -151,7 +151,7 @@ async function startHttp() {
|
|
|
151
151
|
const transports = new Map();
|
|
152
152
|
// Health check
|
|
153
153
|
app.get('/health', (_req, res) => {
|
|
154
|
-
res.json({ status: 'ok', server: 'crypto-quant-signal-mcp', version: '1.
|
|
154
|
+
res.json({ status: 'ok', server: 'crypto-quant-signal-mcp', version: '1.7.0', stripe: (0, stripe_js_1.isStripeConfigured)() });
|
|
155
155
|
});
|
|
156
156
|
// ── Stripe Webhook (raw body required — must be before express.json()) ──
|
|
157
157
|
app.post('/webhooks/stripe', express.raw({ type: 'application/json' }), async (req, res) => {
|
|
@@ -182,7 +182,7 @@ async function startHttp() {
|
|
|
182
182
|
// ── Signup (redirects to Stripe Checkout) ──
|
|
183
183
|
app.get('/signup', async (req, res) => {
|
|
184
184
|
const plan = req.query.plan;
|
|
185
|
-
if (plan !== 'pro' && plan !== 'enterprise') {
|
|
185
|
+
if (plan !== 'starter' && plan !== 'pro' && plan !== 'enterprise') {
|
|
186
186
|
return res.status(400).send(getSignupPageHtml());
|
|
187
187
|
}
|
|
188
188
|
try {
|
|
@@ -276,7 +276,44 @@ async function startHttp() {
|
|
|
276
276
|
res.status(500).json({ error: 'Failed to fetch OI ranking' });
|
|
277
277
|
}
|
|
278
278
|
});
|
|
279
|
+
// Confidence band analysis (admin-only)
|
|
280
|
+
app.get('/api/confidence-bands', async (req, res) => {
|
|
281
|
+
const token = (req.headers['authorization'] || '').replace(/^Bearer\s+/i, '')
|
|
282
|
+
|| req.query.key;
|
|
283
|
+
if (token !== adminKey) {
|
|
284
|
+
return res.status(401).json({ error: 'Unauthorized' });
|
|
285
|
+
}
|
|
286
|
+
try {
|
|
287
|
+
const bands = await (0, performance_db_js_1.getConfidenceBands)();
|
|
288
|
+
res.json({ bands, generatedAt: new Date().toISOString() });
|
|
289
|
+
}
|
|
290
|
+
catch (err) {
|
|
291
|
+
res.status(500).json({ error: 'Failed to fetch confidence bands' });
|
|
292
|
+
}
|
|
293
|
+
});
|
|
279
294
|
}
|
|
295
|
+
// ── Public track record (no auth) ──
|
|
296
|
+
app.get('/api/performance-public', async (_req, res) => {
|
|
297
|
+
try {
|
|
298
|
+
const stats = await (0, signal_performance_js_1.getSignalPerformance)();
|
|
299
|
+
res.json(stats);
|
|
300
|
+
}
|
|
301
|
+
catch (err) {
|
|
302
|
+
res.status(500).json({ error: 'Failed to fetch performance stats' });
|
|
303
|
+
}
|
|
304
|
+
});
|
|
305
|
+
app.get('/api/confidence-bands-public', async (_req, res) => {
|
|
306
|
+
try {
|
|
307
|
+
const bands = await (0, performance_db_js_1.getConfidenceBands)();
|
|
308
|
+
res.json({ bands, generatedAt: new Date().toISOString() });
|
|
309
|
+
}
|
|
310
|
+
catch (err) {
|
|
311
|
+
res.status(500).json({ error: 'Failed to fetch confidence bands' });
|
|
312
|
+
}
|
|
313
|
+
});
|
|
314
|
+
app.get('/track-record', (_req, res) => {
|
|
315
|
+
res.send(getPerformanceDashboardHtml('', { isPublic: true }));
|
|
316
|
+
});
|
|
280
317
|
// MCP endpoint
|
|
281
318
|
app.all('/mcp', express.json(), async (req, res) => {
|
|
282
319
|
// Resolve license per-request using 3-tier gate: x402 → API key → free
|
|
@@ -469,13 +506,16 @@ setInterval(load, 30000);
|
|
|
469
506
|
</body>
|
|
470
507
|
</html>`;
|
|
471
508
|
}
|
|
472
|
-
function getPerformanceDashboardHtml(apiKey) {
|
|
509
|
+
function getPerformanceDashboardHtml(apiKey, opts) {
|
|
510
|
+
const isPublic = opts?.isPublic ?? false;
|
|
511
|
+
const perfEndpoint = isPublic ? '/api/performance-public' : '/performance?key=' + apiKey;
|
|
512
|
+
const cbEndpoint = isPublic ? '/api/confidence-bands-public' : '/api/confidence-bands?key=' + apiKey;
|
|
473
513
|
return `<!DOCTYPE html>
|
|
474
514
|
<html lang="en">
|
|
475
515
|
<head>
|
|
476
516
|
<meta charset="utf-8">
|
|
477
517
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
478
|
-
<title>AlgoVault
|
|
518
|
+
<title>Live Track Record — AlgoVault Labs</title>
|
|
479
519
|
<style>
|
|
480
520
|
* { margin: 0; padding: 0; box-sizing: border-box; }
|
|
481
521
|
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: #0f1117; color: #e1e4e8; padding: 24px; max-width: 1400px; margin: 0 auto; }
|
|
@@ -492,12 +532,10 @@ function getPerformanceDashboardHtml(apiKey) {
|
|
|
492
532
|
.green { color: #3fb950 !important; } .red { color: #f85149 !important; } .gold { color: #d29922 !important; } .muted { color: #8b949e !important; }
|
|
493
533
|
.section { margin-bottom: 28px; }
|
|
494
534
|
.section h2 { font-size: 14px; color: #8b949e; margin-bottom: 10px; text-transform: uppercase; letter-spacing: 1px; }
|
|
495
|
-
table { width: 100%; border-collapse: collapse; background: #161b22; border-radius: 12px; overflow: hidden; border: 1px solid #30363d; }
|
|
496
|
-
th, td {
|
|
535
|
+
table { width: 100%; max-width: 800px; border-collapse: collapse; background: #161b22; border-radius: 12px; overflow: hidden; border: 1px solid #30363d; }
|
|
536
|
+
th, td { padding: 12px 16px; border-bottom: 1px solid #21262d; font-size: 13px; text-align: center; font-variant-numeric: tabular-nums; }
|
|
537
|
+
td:first-child, th:first-child { text-align: left; }
|
|
497
538
|
th { color: #8b949e; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; background: #0d1117; }
|
|
498
|
-
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; }
|
|
499
|
-
.bar-wrap { width: 80px; display: inline-block; } .bar { height: 6px; border-radius: 3px; min-width: 2px; }
|
|
500
|
-
.bar.g { background: #3fb950; } .bar.r { background: #f85149; } .bar.b { background: #58a6ff; }
|
|
501
539
|
.badge { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 600; }
|
|
502
540
|
.badge-buy { background: #0d2818; color: #3fb950; } .badge-sell { background: #2d0b0e; color: #f85149; } .badge-hold { background: #1c1c1c; color: #8b949e; }
|
|
503
541
|
.tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
|
|
@@ -508,8 +546,6 @@ function getPerformanceDashboardHtml(apiKey) {
|
|
|
508
546
|
.tier-tab:hover { border-color: #58a6ff80; } .tier-tab.active { border-width: 2px; }
|
|
509
547
|
.tier-badge { display: inline-block; padding: 2px 6px; border-radius: 4px; font-size: 10px; font-weight: 700; letter-spacing: 0.5px; }
|
|
510
548
|
.tradfi-badge { background: linear-gradient(135deg, #bc8cff20, #8957e520); border: 1px solid #bc8cff40; color: #bc8cff; font-size: 11px; padding: 4px 10px; border-radius: 6px; font-weight: 600; }
|
|
511
|
-
.vol-bar { display: flex; height: 28px; border-radius: 8px; overflow: hidden; margin-bottom: 24px; border: 1px solid #30363d; }
|
|
512
|
-
.vol-segment { display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; transition: width 0.3s; min-width: 0; }
|
|
513
549
|
.tier-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 28px; }
|
|
514
550
|
@media (max-width: 768px) { .tier-grid { grid-template-columns: 1fr; } }
|
|
515
551
|
.tier-card { background: #161b22; border: 1px solid #30363d; border-radius: 12px; padding: 16px; }
|
|
@@ -529,12 +565,19 @@ function getPerformanceDashboardHtml(apiKey) {
|
|
|
529
565
|
.methodology table th { border: none; padding: 4px 24px 4px 0; color: #8b949e; font-weight: 600; text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; background: transparent; }
|
|
530
566
|
.methodology table td { border: none; padding: 3px 24px 3px 0; color: #c9d1d9; }
|
|
531
567
|
.methodology code { background: #21262d; padding: 1px 5px; border-radius: 4px; font-size: 12px; }
|
|
568
|
+
.recent-table { table-layout: fixed; }
|
|
569
|
+
.recent-table th:nth-child(1), .recent-table td:nth-child(1) { width: 90px; }
|
|
570
|
+
.recent-table th:nth-child(2), .recent-table td:nth-child(2) { width: 50px; }
|
|
571
|
+
.recent-table th:nth-child(3), .recent-table td:nth-child(3) { width: 100px; }
|
|
572
|
+
.recent-table th:nth-child(4), .recent-table td:nth-child(4) { width: 70px; }
|
|
573
|
+
.recent-table th:nth-child(5), .recent-table td:nth-child(5) { width: 100px; }
|
|
574
|
+
.recent-table th:nth-child(6), .recent-table td:nth-child(6) { width: 90px; }
|
|
532
575
|
</style>
|
|
533
576
|
</head>
|
|
534
577
|
<body>
|
|
535
578
|
<div class="logo">
|
|
536
579
|
<img src="/logo.png" width="36" height="36" style="border-radius:8px" onerror="this.style.display='none'">
|
|
537
|
-
<div><h1>
|
|
580
|
+
<div><h1>Live Track Record</h1><div class="subtitle">v1.7.0</div></div>
|
|
538
581
|
</div>
|
|
539
582
|
<div id="loading">Loading performance data...</div>
|
|
540
583
|
<div id="content" style="display:none">
|
|
@@ -543,21 +586,16 @@ function getPerformanceDashboardHtml(apiKey) {
|
|
|
543
586
|
|
|
544
587
|
<!-- KPI Cards (4) -->
|
|
545
588
|
<div class="grid">
|
|
589
|
+
<div class="card"><div class="label">Total Trade Calls</div><div class="value" id="total"></div><div class="sub" id="period"></div></div>
|
|
546
590
|
<div class="card"><div class="label">PFE Win Rate</div><div class="value hero" id="pfe-wr"></div><div class="sub">Directional Accuracy</div></div>
|
|
547
|
-
<div class="card"><div class="label">Profit Factor</div><div class="value" id="pf"></div><div class="sub">Gross Profit / Loss</div></div>
|
|
548
|
-
<div class="card"><div class="label">Expected Value</div><div class="value" id="ev"></div><div class="sub">Edge per Signal</div></div>
|
|
549
|
-
<div class="card"><div class="label">Total Signals</div><div class="value" id="total"></div><div class="sub" id="period"></div></div>
|
|
550
591
|
</div>
|
|
551
592
|
|
|
552
|
-
<!-- Volume Distribution Bar -->
|
|
553
|
-
<div class="section"><h2>Volume Distribution</h2><div class="vol-bar" id="vol-bar"></div></div>
|
|
554
|
-
|
|
555
593
|
<!-- Tier Performance Cards -->
|
|
556
594
|
<div class="section"><h2>Performance by Tier</h2><div class="tier-grid" id="tier-cards"></div></div>
|
|
557
595
|
|
|
558
596
|
<!-- Signal type breakdown -->
|
|
559
|
-
<div class="section"><h2>By
|
|
560
|
-
<table><thead><tr><th>Type</th><th
|
|
597
|
+
<div class="section"><h2>By Call Type</h2>
|
|
598
|
+
<table><thead><tr><th>Type</th><th>Count</th><th>PFE Win Rate</th></tr></thead>
|
|
561
599
|
<tbody id="by-type"></tbody></table>
|
|
562
600
|
</div>
|
|
563
601
|
|
|
@@ -565,33 +603,39 @@ function getPerformanceDashboardHtml(apiKey) {
|
|
|
565
603
|
<div class="section">
|
|
566
604
|
<h2>Performance by Timeframe</h2>
|
|
567
605
|
<div class="tabs" id="tf-tabs"></div>
|
|
568
|
-
<table><thead><tr><th>Timeframe</th><th
|
|
606
|
+
<table><thead><tr><th>Timeframe</th><th>Trade Calls</th><th>PFE Win Rate</th><th>Avg PFE %</th><th>BUY / SELL</th></tr></thead>
|
|
569
607
|
<tbody id="by-timeframe"></tbody></table>
|
|
570
608
|
</div>
|
|
571
609
|
|
|
610
|
+
<!-- Confidence Band Analysis -->
|
|
611
|
+
<div class="section" id="cb-section" style="display:none">
|
|
612
|
+
<h2>Performance by Confidence Band</h2>
|
|
613
|
+
<table><thead><tr><th>Band</th><th>Trade Calls</th><th>PFE Win Rate</th><th>Avg PFE %</th><th>BUY / SELL</th></tr></thead>
|
|
614
|
+
<tbody id="cb-body"></tbody></table>
|
|
615
|
+
</div>
|
|
616
|
+
|
|
572
617
|
<div class="grid-2">
|
|
573
618
|
<div class="section"><h2>Top Performing Assets</h2>
|
|
574
|
-
<table><thead><tr><th></th><th>Asset</th><th class="num">
|
|
619
|
+
<table><thead><tr><th></th><th>Asset</th><th class="num">Trade Calls</th><th class="num">PFE WR</th></tr></thead>
|
|
575
620
|
<tbody id="top-assets"></tbody></table>
|
|
576
621
|
</div>
|
|
577
622
|
<div class="section"><h2>Worst Performing Assets</h2>
|
|
578
|
-
<table><thead><tr><th></th><th>Asset</th><th class="num">
|
|
623
|
+
<table><thead><tr><th></th><th>Asset</th><th class="num">Trade Calls</th><th class="num">PFE WR</th></tr></thead>
|
|
579
624
|
<tbody id="worst-assets"></tbody></table>
|
|
580
625
|
</div>
|
|
581
626
|
</div>
|
|
582
627
|
|
|
583
628
|
<!-- Recent signals -->
|
|
584
|
-
<div class="section"><h2>Recent
|
|
585
|
-
<table><thead><tr><th>Time</th><th
|
|
629
|
+
<div class="section"><h2>Recent Trade Calls</h2>
|
|
630
|
+
<table class="recent-table"><thead><tr><th>Time</th><th>Tier</th><th>Asset</th><th>Call</th><th class="num">Confidence</th><th class="num">Timeframe</th></tr></thead>
|
|
586
631
|
<tbody id="recent"></tbody></table>
|
|
587
632
|
</div>
|
|
588
633
|
|
|
589
634
|
<!-- Methodology -->
|
|
590
635
|
<div class="section"><h2>Methodology</h2>
|
|
591
636
|
<div class="methodology">
|
|
592
|
-
<p><strong>PFE Win Rate</strong> = Percentage of
|
|
593
|
-
<p><strong>
|
|
594
|
-
<p><strong>Profit Factor</strong> = Sum of positive returns / |Sum of negative returns| at evaluation window close. >1.0 = net profitable, >2.0 = strong.</p>
|
|
637
|
+
<p><strong>PFE Win Rate</strong> = Percentage of trade calls where price moved in the called direction at any point during the evaluation window.</p>
|
|
638
|
+
<p><strong>Note</strong>: AlgoVault provides directional entry calls. Exit timing is determined by your agent or strategy — PFE Win Rate measures whether the direction was correct, independent of exit.</p>
|
|
595
639
|
<p style="margin-top:16px"><strong>Evaluation Windows</strong></p>
|
|
596
640
|
<table><thead><tr><th>Timeframe</th><th>Candles</th><th>Total Time</th></tr></thead><tbody>
|
|
597
641
|
<tr><td>5m</td><td>12</td><td>1 hour</td></tr><tr><td>15m</td><td>12</td><td>3 hours</td></tr>
|
|
@@ -607,7 +651,7 @@ function getPerformanceDashboardHtml(apiKey) {
|
|
|
607
651
|
<tr><td style="color:#bc8cff">Tier 3</td><td>TradFi</td><td>Stocks, indices, commodities, FX via HL xyz perps</td></tr>
|
|
608
652
|
<tr><td style="color:#d29922">Tier 4</td><td>Meme & Micro</td><td>Meme & micro-caps (liquidity-filtered: top 50 OI or >$10M vol)</td></tr>
|
|
609
653
|
</tbody></table>
|
|
610
|
-
<p style="margin-top:16px"><strong>
|
|
654
|
+
<p style="margin-top:16px"><strong>Call Filter</strong> = Only confidence ≥ 60% trade calls recorded. HOLDs excluded.</p>
|
|
611
655
|
<p><strong>Default view</strong> shows Tier 1-2 + TradFi only. Full coverage via “All Assets” tab.</p>
|
|
612
656
|
</div>
|
|
613
657
|
</div>
|
|
@@ -616,7 +660,8 @@ function getPerformanceDashboardHtml(apiKey) {
|
|
|
616
660
|
</div>
|
|
617
661
|
|
|
618
662
|
<script>
|
|
619
|
-
var
|
|
663
|
+
var PERF_URL = '${perfEndpoint}';
|
|
664
|
+
var CB_URL = '${cbEndpoint}';
|
|
620
665
|
var TF_ORDER = ['1m','3m','5m','15m','30m','1h','2h','4h','8h','12h','1d'];
|
|
621
666
|
var TIER_COLORS = {1:'#58a6ff',2:'#3fb950',3:'#bc8cff',4:'#d29922'};
|
|
622
667
|
var TIER_NAMES = {1:'Blue Chip',2:'Major Alts',3:'TradFi',4:'Meme & Micro'};
|
|
@@ -625,8 +670,6 @@ var activeTierFilter = 'tier12tf'; // default: Tier 1-2 + TradFi
|
|
|
625
670
|
var cachedData = null;
|
|
626
671
|
|
|
627
672
|
function pct(v) { return v != null ? (v * 100).toFixed(1) + '%' : '\\u2014'; }
|
|
628
|
-
function retPct(v) { return v != null ? (v >= 0 ? '+' : '') + v.toFixed(2) + '%' : '\\u2014'; }
|
|
629
|
-
function retClass(v) { return v != null ? (v >= 0 ? 'green' : 'red') : 'muted'; }
|
|
630
673
|
function wrClass(v) { return v != null ? (v >= 0.5 ? 'green' : v >= 0.3 ? 'gold' : 'red') : 'muted'; }
|
|
631
674
|
function pfeClass(v) { return v != null ? (v >= 0.6 ? 'green' : v >= 0.45 ? 'gold' : 'red') : 'muted'; }
|
|
632
675
|
function pfClass(v) { return v != null ? (v >= 1.5 ? 'green' : v >= 1.0 ? 'gold' : 'red') : 'muted'; }
|
|
@@ -646,28 +689,14 @@ function getFilteredSignals() {
|
|
|
646
689
|
return all.filter(function(s) { return tierMatch(s.tier); });
|
|
647
690
|
}
|
|
648
691
|
|
|
649
|
-
function pnlDir(s) { var r = s.outcome_return_pct || 0; return Math.max(s.signal === 'SELL' ? -r : r, -100); }
|
|
650
692
|
function pfeWin(s) { var p = s.pfe_return_pct; if (p == null) return false; return s.signal === 'BUY' ? p > 0 : p < 0; }
|
|
651
693
|
|
|
652
694
|
function recomputeOverall(signals) {
|
|
653
695
|
var nh = signals.filter(function(s){return s.signal!=='HOLD';});
|
|
654
|
-
var e1c = nh.filter(function(s){return s.return_1candle!=null;});
|
|
655
|
-
var w1c = e1c.filter(function(s){return s.return_1candle>0;});
|
|
656
|
-
var eEW = nh.filter(function(s){return s.outcome_return_pct!=null;});
|
|
657
|
-
var rets = eEW.map(pnlDir);
|
|
658
|
-
var gp = rets.filter(function(r){return r>0;}).reduce(function(a,b){return a+b;},0);
|
|
659
|
-
var gl = Math.abs(rets.filter(function(r){return r<0;}).reduce(function(a,b){return a+b;},0));
|
|
660
|
-
var pf = gl>0 ? gp/gl : (gp>0 ? Infinity : null);
|
|
661
696
|
var ePFE = nh.filter(function(s){return s.pfe_return_pct!=null;});
|
|
662
697
|
var pfeW = ePFE.filter(pfeWin);
|
|
663
698
|
var pfeWR = ePFE.length>0 ? pfeW.length/ePFE.length : null;
|
|
664
|
-
|
|
665
|
-
var lr = rets.filter(function(r){return r<0;});
|
|
666
|
-
var aw = wr.length>0 ? wr.reduce(function(a,b){return a+b;},0)/wr.length : 0;
|
|
667
|
-
var al = lr.length>0 ? Math.abs(lr.reduce(function(a,b){return a+b;},0)/lr.length) : 0;
|
|
668
|
-
var wrPct = eEW.length>0 ? wr.length/eEW.length : 0;
|
|
669
|
-
var ev = eEW.length>0 ? (wrPct*aw)-((1-wrPct)*al) : null;
|
|
670
|
-
return { totalEvaluated: e1c.length, total: signals.length, winRate: e1c.length>0?w1c.length/e1c.length:null, profitFactor: pf, pfeWinRate: pfeWR, expectedValue: ev };
|
|
699
|
+
return { totalEvaluated: ePFE.length, total: signals.length, pfeWinRate: pfeWR };
|
|
671
700
|
}
|
|
672
701
|
|
|
673
702
|
function recomputeTF(signals) {
|
|
@@ -676,13 +705,15 @@ function recomputeTF(signals) {
|
|
|
676
705
|
nh.forEach(function(s){if(!tfs[s.timeframe]) tfs[s.timeframe]=[];tfs[s.timeframe].push(s);});
|
|
677
706
|
var result = {};
|
|
678
707
|
Object.keys(tfs).forEach(function(tf){
|
|
679
|
-
var g=tfs[tf]
|
|
680
|
-
var
|
|
681
|
-
var
|
|
682
|
-
var
|
|
683
|
-
var
|
|
684
|
-
var
|
|
685
|
-
|
|
708
|
+
var g=tfs[tf];
|
|
709
|
+
var ePFE=g.filter(function(s){return s.pfe_return_pct!=null;});
|
|
710
|
+
var pfeW=ePFE.filter(pfeWin);
|
|
711
|
+
var pfeWR=ePFE.length>0?pfeW.length/ePFE.length:null;
|
|
712
|
+
var buyC=g.filter(function(s){return s.signal==='BUY';}).length;
|
|
713
|
+
var sellC=g.filter(function(s){return s.signal==='SELL';}).length;
|
|
714
|
+
var wins=pfeW.map(function(s){var p=Math.abs(s.pfe_return_pct);return p;});
|
|
715
|
+
var avgPfe=wins.length>0?wins.reduce(function(a,b){return a+b;},0)/wins.length:null;
|
|
716
|
+
result[tf]={count:ePFE.length,pfeWinRate:pfeWR,avgPfePct:avgPfe,buyCount:buyC,sellCount:sellC};
|
|
686
717
|
});
|
|
687
718
|
return result;
|
|
688
719
|
}
|
|
@@ -714,54 +745,46 @@ function renderAll() {
|
|
|
714
745
|
if (activeTfFilter === 'all') {
|
|
715
746
|
var pfeEl = document.getElementById('pfe-wr');
|
|
716
747
|
pfeEl.textContent = pct(stats.pfeWinRate); pfeEl.className = 'value hero ' + pfeClass(stats.pfeWinRate);
|
|
717
|
-
var pfEl = document.getElementById('pf');
|
|
718
|
-
pfEl.textContent = stats.profitFactor != null ? stats.profitFactor.toFixed(2) : '\\u2014'; pfEl.className = 'value ' + pfClass(stats.profitFactor);
|
|
719
|
-
var evEl = document.getElementById('ev');
|
|
720
|
-
evEl.textContent = stats.expectedValue != null ? retPct(stats.expectedValue) : '\\u2014'; evEl.className = 'value ' + evClass(stats.expectedValue);
|
|
721
748
|
document.getElementById('total').textContent = (stats.totalEvaluated || stats.total || 0).toLocaleString();
|
|
722
749
|
document.getElementById('period').textContent = d.period ? d.period.from + ' \\u2192 ' + d.period.to : 'Tracked & Evaluated';
|
|
723
750
|
} else {
|
|
724
751
|
var v = (tfStats || {})[activeTfFilter];
|
|
725
752
|
if (v) {
|
|
726
753
|
document.getElementById('pfe-wr').textContent = '\\u2014'; document.getElementById('pfe-wr').className = 'value hero muted';
|
|
727
|
-
var pfEl2 = document.getElementById('pf'); pfEl2.textContent = v.profitFactor != null ? v.profitFactor.toFixed(2) : '\\u2014'; pfEl2.className = 'value ' + pfClass(v.profitFactor);
|
|
728
|
-
document.getElementById('ev').textContent = '\\u2014'; document.getElementById('ev').className = 'value muted';
|
|
729
754
|
document.getElementById('total').textContent = (v.count || 0).toLocaleString();
|
|
730
755
|
document.getElementById('period').textContent = activeTfFilter + ' timeframe';
|
|
731
756
|
}
|
|
732
757
|
}
|
|
733
758
|
|
|
734
|
-
// Volume bar
|
|
735
|
-
var volEl = document.getElementById('vol-bar');
|
|
736
|
-
var allSigs = cachedData.recentSignals || [];
|
|
737
|
-
var tierCounts = {1:0,2:0,3:0,4:0};
|
|
738
|
-
allSigs.forEach(function(s){tierCounts[s.tier]=(tierCounts[s.tier]||0)+1;});
|
|
739
|
-
var totalVol = allSigs.length || 1;
|
|
740
|
-
volEl.innerHTML = [1,2,3,4].map(function(t){
|
|
741
|
-
var p = Math.round(100*tierCounts[t]/totalVol);
|
|
742
|
-
if (p < 1 && tierCounts[t] > 0) p = 1;
|
|
743
|
-
if (p === 0) return '';
|
|
744
|
-
var label = p >= 5 ? (TIER_NAMES[t]+' '+p+'%') : (p >= 3 ? p+'%' : '');
|
|
745
|
-
return '<div class="vol-segment" style="width:'+p+'%;background:'+TIER_COLORS[t]+'" title="'+TIER_NAMES[t]+': '+tierCounts[t]+' signals ('+p+'%)"><span>'+label+'</span></div>';
|
|
746
|
-
}).join('');
|
|
747
|
-
|
|
748
759
|
// Tier cards
|
|
749
760
|
var tcEl = document.getElementById('tier-cards');
|
|
750
761
|
var bt = d.byTier || {};
|
|
762
|
+
function tierAssetLabel(tier, assets) {
|
|
763
|
+
if (tier === 1) return (assets||[]).join(', ') || 'BTC, ETH';
|
|
764
|
+
if (tier === 2) {
|
|
765
|
+
var s2 = (assets||[]).slice(0,5).join(', ');
|
|
766
|
+
return '<span style="color:#58a6ff">Top 20 by Open Interest</span><br>' + s2 + (assets && assets.length > 5 ? ' +' + (assets.length-5) + ' more' : '');
|
|
767
|
+
}
|
|
768
|
+
if (tier === 3) {
|
|
769
|
+
var s3 = (assets||[]).slice(0,4).join(', ');
|
|
770
|
+
return '<span style="color:#8b949e">Stocks \\u00b7 Indices \\u00b7 Commodities \\u00b7 FX</span>' + (s3 ? '<br>' + s3 + (assets.length > 4 ? ' +' + (assets.length-4) + ' more' : '') : '');
|
|
771
|
+
}
|
|
772
|
+
if (tier === 4) {
|
|
773
|
+
return '<span style="color:#8b949e">Liquidity Filtered (Top 50 OI)</span><br>' + (assets ? assets.length : 0) + ' assets tracked';
|
|
774
|
+
}
|
|
775
|
+
return (assets||[]).join(', ');
|
|
776
|
+
}
|
|
751
777
|
tcEl.innerHTML = ['tier1','tier2','tier3','tier4'].map(function(k){
|
|
752
778
|
var t = bt[k]; if (!t) return '';
|
|
753
|
-
var assets = (t.assets||[]).slice(0,8).join(', ') + (t.assets && t.assets.length > 8 ? ' +' + (t.assets.length-8) + ' more' : '');
|
|
754
779
|
var isTF = t.tier === 3;
|
|
755
780
|
return '<div class="tier-card" style="border-color:'+t.color+'40">' +
|
|
756
781
|
'<div class="tc-header">' + tierBadge(t.tier) + ' <span class="tc-name" style="color:'+t.color+'">' + t.name + '</span>' +
|
|
757
782
|
(isTF ? ' <span class="tradfi-badge">Only on AlgoVault \\u2726</span>' : '') + '</div>' +
|
|
758
|
-
'<div class="tc-assets">' + (assets
|
|
783
|
+
'<div class="tc-assets">' + tierAssetLabel(t.tier, t.assets) + '</div>' +
|
|
759
784
|
(t.count > 0 ? '<div class="tc-stats">' +
|
|
760
|
-
'<div class="tc-stat"><div class="tc-label">
|
|
761
|
-
'<div class="tc-stat"><div class="tc-label">
|
|
762
|
-
|
|
763
|
-
'<div class="tc-stat"><div class="tc-label">Signals</div><div class="tc-val muted">' + t.count + '</div></div>' +
|
|
764
|
-
'</div>' : '<div style="color:#6e7681;font-size:12px">No signals yet</div>') +
|
|
785
|
+
'<div class="tc-stat"><div class="tc-label">Trade Calls</div><div class="tc-val muted">' + t.count + '</div></div>' +
|
|
786
|
+
'<div class="tc-stat"><div class="tc-label">PFE Win Rate</div><div class="tc-val ' + pfeClass(t.pfeWinRate) + '">' + pct(t.pfeWinRate) + '</div></div>' +
|
|
787
|
+
'</div>' : '<div style="color:#6e7681;font-size:12px">No trade calls yet</div>') +
|
|
765
788
|
'</div>';
|
|
766
789
|
}).join('');
|
|
767
790
|
|
|
@@ -770,14 +793,12 @@ function renderAll() {
|
|
|
770
793
|
var typeCounts = {};
|
|
771
794
|
['BUY','SELL','HOLD'].forEach(function(type){
|
|
772
795
|
var g=allSignals.filter(function(s){return s.signal===type;});
|
|
773
|
-
var
|
|
774
|
-
var
|
|
775
|
-
|
|
776
|
-
typeCounts[type]={count:type==='HOLD'?g.length:eg.length,winRate:type==='HOLD'?null:(eg.length>0?wg.length/eg.length:null),avgReturnPct:type==='HOLD'?null:(rg.length>0?rg.reduce(function(a,b){return a+b;},0)/rg.length:null)};
|
|
796
|
+
var ePFE=g.filter(function(s){return s.pfe_return_pct!=null&&type!=='HOLD';});
|
|
797
|
+
var pfeW=ePFE.filter(pfeWin);
|
|
798
|
+
typeCounts[type]={count:type==='HOLD'?g.length:ePFE.length,pfeWinRate:type==='HOLD'?null:(ePFE.length>0?pfeW.length/ePFE.length:null)};
|
|
777
799
|
});
|
|
778
800
|
var types=Object.entries(typeCounts);
|
|
779
|
-
|
|
780
|
-
typeEl.innerHTML = types.length ? types.map(function(e){var tp=e[0],v=e[1];return '<tr><td>'+badge(tp)+'</td><td class="num">'+v.count+'</td><td class="num '+wrClass(v.winRate)+'">'+pct(v.winRate)+'</td><td class="num '+retClass(v.avgReturnPct)+'">'+retPct(v.avgReturnPct)+'</td><td><div class="bar-wrap"><div class="bar b" style="width:'+(maxC>0?Math.round(v.count/maxC*100):0)+'%"></div></div></td></tr>';}).join('') : '<tr><td colspan="5" class="empty">No signals yet</td></tr>';
|
|
801
|
+
typeEl.innerHTML = types.length ? types.map(function(e){var tp=e[0],v=e[1];return '<tr><td>'+badge(tp)+'</td><td>'+v.count+'</td><td class="'+pfeClass(v.pfeWinRate)+'">'+pct(v.pfeWinRate)+'</td></tr>';}).join('') : '<tr><td colspan="3" class="empty">No trade calls yet</td></tr>';
|
|
781
802
|
|
|
782
803
|
// TF table
|
|
783
804
|
var tfEl = document.getElementById('by-timeframe');
|
|
@@ -785,25 +806,24 @@ function renderAll() {
|
|
|
785
806
|
var filtered = activeTfFilter === 'all' ? tfe : tfe.filter(function(e){return e[0]===activeTfFilter;});
|
|
786
807
|
if (filtered.length) {
|
|
787
808
|
filtered.sort(function(a,b){return TF_ORDER.indexOf(a[0])-TF_ORDER.indexOf(b[0]);});
|
|
788
|
-
tfEl.innerHTML = filtered.map(function(e){var tf=e[0],v=e[1];return '<tr><td><strong>'+tf+'</strong></td><td
|
|
809
|
+
tfEl.innerHTML = filtered.map(function(e){var tf=e[0],v=e[1];var ap=v.avgPfePct!=null?v.avgPfePct.toFixed(2)+'%':'\\u2014';return '<tr><td><strong>'+tf+'</strong></td><td>'+v.count+'</td><td class="'+pfeClass(v.pfeWinRate)+'">'+pct(v.pfeWinRate)+'</td><td>'+ap+'</td><td>'+v.buyCount+' / '+v.sellCount+'</td></tr>';}).join('');
|
|
789
810
|
} else { tfEl.innerHTML = '<tr><td colspan="5" class="empty">No data for this timeframe</td></tr>'; }
|
|
790
811
|
|
|
791
812
|
// Asset tables
|
|
792
813
|
var tfSigs = activeTfFilter === 'all' ? allSignals : allSignals.filter(function(s){return s.timeframe===activeTfFilter;});
|
|
793
814
|
var nhSigs = tfSigs.filter(function(s){return s.signal!=='HOLD';});
|
|
794
815
|
function computeAst(sigs){
|
|
795
|
-
var m={};sigs.forEach(function(s){if(!m[s.coin])m[s.coin]={coin:s.coin,tier:s.tier,count:0,pfeEval:0,pfeWins:0
|
|
796
|
-
if(s.pfe_return_pct!=null){a.pfeEval++;if(pfeWin(s))a.pfeWins++;}
|
|
797
|
-
|
|
798
|
-
return Object.values(m).filter(function(a){return a.count>=5;}).map(function(a){var avg=a.returns.reduce(function(x,y){return x+y;},0)/a.returns.length;return{coin:a.coin,tier:a.tier,count:a.count,pfeWinRate:a.pfeEval>0?a.pfeWins/a.pfeEval:null,avgReturnPct:avg};});
|
|
816
|
+
var m={};sigs.forEach(function(s){if(!m[s.coin])m[s.coin]={coin:s.coin,tier:s.tier,count:0,pfeEval:0,pfeWins:0};var a=m[s.coin];a.count++;
|
|
817
|
+
if(s.pfe_return_pct!=null){a.pfeEval++;if(pfeWin(s))a.pfeWins++;}});
|
|
818
|
+
return Object.values(m).filter(function(a){return a.count>=5;}).map(function(a){return{coin:a.coin,tier:a.tier,count:a.count,pfeWinRate:a.pfeEval>0?a.pfeWins/a.pfeEval:null};});
|
|
799
819
|
}
|
|
800
820
|
var assets = computeAst(nhSigs);
|
|
801
821
|
var topA = assets.slice().sort(function(a,b){return (b.pfeWinRate||0)-(a.pfeWinRate||0);}).slice(0,15);
|
|
802
822
|
var worstA = assets.slice().sort(function(a,b){return (a.pfeWinRate||0)-(b.pfeWinRate||0);}).slice(0,15);
|
|
803
823
|
function renderAT(id,list){
|
|
804
824
|
var el=document.getElementById(id);
|
|
805
|
-
if(!list.length){el.innerHTML='<tr><td colspan="
|
|
806
|
-
el.innerHTML=list.map(function(a){return '<tr><td>'+tierBadge(a.tier)+'</td><td><strong>'+a.coin+'</strong></td><td class="num">'+a.count+'</td><td class="num '+pfeClass(a.pfeWinRate)+'">'+pct(a.pfeWinRate)+'</td
|
|
825
|
+
if(!list.length){el.innerHTML='<tr><td colspan="4" class="empty">Waiting for outcome data (min 5 trade calls)...</td></tr>';return;}
|
|
826
|
+
el.innerHTML=list.map(function(a){return '<tr><td>'+tierBadge(a.tier)+'</td><td><strong>'+a.coin+'</strong></td><td class="num">'+a.count+'</td><td class="num '+pfeClass(a.pfeWinRate)+'">'+pct(a.pfeWinRate)+'</td></tr>';}).join('');
|
|
807
827
|
}
|
|
808
828
|
renderAT('top-assets',topA); renderAT('worst-assets',worstA);
|
|
809
829
|
|
|
@@ -811,13 +831,13 @@ function renderAll() {
|
|
|
811
831
|
var recentEl = document.getElementById('recent');
|
|
812
832
|
var recent = tfSigs.slice(0,20);
|
|
813
833
|
if (recent.length) {
|
|
814
|
-
recentEl.innerHTML = recent.map(function(s){return '<tr><td class="muted">'+timeAgo(s.created_at)+'</td><td>'+tierBadge(s.tier)+'</td><td><strong>'+s.coin+'</strong></td><td>'+badge(s.signal)+'</td><td class="num">'+s.confidence+'%</td><td class="num
|
|
815
|
-
} else { recentEl.innerHTML='<tr><td colspan="6" class="empty">No
|
|
834
|
+
recentEl.innerHTML = recent.map(function(s){return '<tr><td class="muted">'+timeAgo(s.created_at)+'</td><td>'+tierBadge(s.tier)+'</td><td><strong>'+s.coin+'</strong></td><td>'+badge(s.signal)+'</td><td class="num">'+s.confidence+'%</td><td class="num">'+s.timeframe+'</td></tr>';}).join('');
|
|
835
|
+
} else { recentEl.innerHTML='<tr><td colspan="6" class="empty">No trade calls'+(activeTfFilter!=='all'?' for '+activeTfFilter:'')+' yet.</td></tr>'; }
|
|
816
836
|
}
|
|
817
837
|
|
|
818
838
|
async function load() {
|
|
819
839
|
try {
|
|
820
|
-
var r = await fetch(
|
|
840
|
+
var r = await fetch(PERF_URL);
|
|
821
841
|
var d = await r.json();
|
|
822
842
|
cachedData = d;
|
|
823
843
|
|
|
@@ -845,6 +865,26 @@ async function load() {
|
|
|
845
865
|
availTfs.map(function(tf){return '<div class="tab'+(activeTfFilter===tf?' active':'')+'" data-tf="'+tf+'" onclick="setTfFilter(\\''+tf+'\\')">'+tf+'</div>';}).join('');
|
|
846
866
|
|
|
847
867
|
renderAll();
|
|
868
|
+
|
|
869
|
+
// Confidence bands (separate fetch — Postgres only)
|
|
870
|
+
try {
|
|
871
|
+
var cbRes = await fetch(CB_URL);
|
|
872
|
+
if (cbRes.ok) {
|
|
873
|
+
var cbData = await cbRes.json();
|
|
874
|
+
var bands = cbData.bands || [];
|
|
875
|
+
if (bands.length > 0) {
|
|
876
|
+
var cbEl = document.getElementById('cb-body');
|
|
877
|
+
cbEl.innerHTML = bands.map(function(b) {
|
|
878
|
+
var wr = b.pfeWinRate != null ? (b.pfeWinRate * 100).toFixed(1) + '%' : '\\u2014';
|
|
879
|
+
var wrC = b.pfeWinRate != null ? (b.pfeWinRate >= 0.6 ? 'green' : b.pfeWinRate >= 0.45 ? 'gold' : 'red') : 'muted';
|
|
880
|
+
var avgP = b.avgPfePct != null ? b.avgPfePct.toFixed(2) + '%' : '\\u2014';
|
|
881
|
+
return '<tr><td><strong>' + b.band + '%</strong></td><td>' + b.evaluated + '</td><td class="' + wrC + '">' + wr + '</td><td>' + avgP + '</td><td>' + b.buyCount + ' / ' + b.sellCount + '</td></tr>';
|
|
882
|
+
}).join('');
|
|
883
|
+
document.getElementById('cb-section').style.display = 'block';
|
|
884
|
+
}
|
|
885
|
+
}
|
|
886
|
+
} catch(e) { /* confidence bands are best-effort */ }
|
|
887
|
+
|
|
848
888
|
document.getElementById('updated').textContent = 'Updated: ' + new Date().toLocaleString();
|
|
849
889
|
document.getElementById('loading').style.display = 'none';
|
|
850
890
|
document.getElementById('content').style.display = 'block';
|
|
@@ -873,12 +913,13 @@ function getSignupPageHtml() {
|
|
|
873
913
|
<style>
|
|
874
914
|
* { margin: 0; padding: 0; box-sizing: border-box; }
|
|
875
915
|
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: #0f1117; color: #e1e4e8; display: flex; justify-content: center; align-items: center; min-height: 100vh; padding: 24px; }
|
|
876
|
-
.container { max-width:
|
|
916
|
+
.container { max-width: 960px; width: 100%; }
|
|
877
917
|
h1 { font-size: 28px; margin-bottom: 8px; }
|
|
878
918
|
.subtitle { color: #8b949e; margin-bottom: 32px; font-size: 14px; }
|
|
879
|
-
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
|
|
880
|
-
@media (max-width:
|
|
881
|
-
.plan { background: #161b22; border: 1px solid #30363d; border-radius: 12px; padding: 28px; }
|
|
919
|
+
.plans { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
|
|
920
|
+
@media (max-width: 768px) { .plans { grid-template-columns: 1fr; } }
|
|
921
|
+
.plan { background: #161b22; border: 1px solid #30363d; border-radius: 12px; padding: 28px; position: relative; }
|
|
922
|
+
.plan.popular { border-color: #d4a017; }
|
|
882
923
|
.plan h2 { font-size: 20px; margin-bottom: 4px; }
|
|
883
924
|
.plan .price { font-size: 36px; font-weight: 700; color: #58a6ff; margin: 12px 0; }
|
|
884
925
|
.plan .price span { font-size: 16px; font-weight: 400; color: #8b949e; }
|
|
@@ -889,6 +930,7 @@ function getSignupPageHtml() {
|
|
|
889
930
|
.btn:hover { background: #2ea043; }
|
|
890
931
|
.btn.ent { background: #8957e5; }
|
|
891
932
|
.btn.ent:hover { background: #a371f7; }
|
|
933
|
+
.pop-badge { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); background: #d4a017; color: #0f1117; font-size: 11px; font-weight: 700; padding: 3px 12px; border-radius: 20px; letter-spacing: 0.5px; }
|
|
892
934
|
</style>
|
|
893
935
|
</head>
|
|
894
936
|
<body>
|
|
@@ -897,11 +939,23 @@ function getSignupPageHtml() {
|
|
|
897
939
|
<div class="subtitle">Unlock all assets, all timeframes, and higher call limits.</div>
|
|
898
940
|
<div class="plans">
|
|
899
941
|
<div class="plan">
|
|
942
|
+
<h2>Starter</h2>
|
|
943
|
+
<div class="price">$9.99<span>/mo</span></div>
|
|
944
|
+
<ul>
|
|
945
|
+
<li>3,000 calls/month</li>
|
|
946
|
+
<li>All assets (crypto + TradFi)</li>
|
|
947
|
+
<li>All timeframes (1m to 1d)</li>
|
|
948
|
+
<li>Email support</li>
|
|
949
|
+
</ul>
|
|
950
|
+
<a class="btn" href="/signup?plan=starter">Subscribe to Starter</a>
|
|
951
|
+
</div>
|
|
952
|
+
<div class="plan popular">
|
|
953
|
+
<div class="pop-badge">MOST POPULAR</div>
|
|
900
954
|
<h2>Pro</h2>
|
|
901
955
|
<div class="price">$49<span>/mo</span></div>
|
|
902
956
|
<ul>
|
|
903
957
|
<li>15,000 calls/month</li>
|
|
904
|
-
<li>All assets (
|
|
958
|
+
<li>All assets (crypto + TradFi)</li>
|
|
905
959
|
<li>All timeframes (1m to 1d)</li>
|
|
906
960
|
<li>Priority support</li>
|
|
907
961
|
</ul>
|