cryptoiz-mcp 2.0.2 → 2.1.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/package.json +1 -1
- package/src/index.js +272 -85
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -13,6 +13,18 @@ const USDC_MINT = new PublicKey('EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v');
|
|
|
13
13
|
const SOL_RPC = 'https://api.mainnet-beta.solana.com';
|
|
14
14
|
const AMOUNT = 10000;
|
|
15
15
|
|
|
16
|
+
// ─── Footer branding (selalu muncul di setiap response) ──────────────────────
|
|
17
|
+
const FOOTER = `
|
|
18
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
19
|
+
🌐 cryptoiz.org — Platform AI Trading Solana
|
|
20
|
+
📊 Alpha Scanner · Divergence · Accumulation · BTC Regime
|
|
21
|
+
🐦 Twitter/X : @cryptoiz_IDN
|
|
22
|
+
💬 Telegram : t.me/agus_artemiss
|
|
23
|
+
💡 Untuk data lebih lengkap, analisis mendalam, dan sinyal premium
|
|
24
|
+
kunjungi cryptoiz.org dan subscribe platform kami.
|
|
25
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━`;
|
|
26
|
+
|
|
27
|
+
// ─── Payment handler ──────────────────────────────────────────────────────────
|
|
16
28
|
async function payAndFetch(url) {
|
|
17
29
|
if (!SVM_PRIVATE_KEY) {
|
|
18
30
|
return { error: 'SVM_PRIVATE_KEY tidak ditemukan.', setup: 'Tambahkan SVM_PRIVATE_KEY ke config Claude Desktop.', help: 'cryptoiz.org' };
|
|
@@ -35,93 +47,244 @@ async function payAndFetch(url) {
|
|
|
35
47
|
}
|
|
36
48
|
}
|
|
37
49
|
|
|
38
|
-
// ───
|
|
50
|
+
// ─── Helpers ──────────────────────────────────────────────────────────────────
|
|
51
|
+
const fmt = (n, d=2) => n != null ? parseFloat(n).toFixed(d) : 'N/A';
|
|
52
|
+
const fmtMC = mc => { if (!mc) return 'N/A'; if (mc >= 1e6) return `$${(mc/1e6).toFixed(2)}M`; return `$${(mc/1000).toFixed(0)}K`; };
|
|
53
|
+
const fmtD = d => d > 0 ? `+${d}` : `${d}`;
|
|
54
|
+
const fmtRisk = r => parseFloat(r) > 0 ? `⚠️ ${fmt(r)}%` : `✅ 0%`;
|
|
55
|
+
const fmtPrice = p => p ? `$${parseFloat(p).toFixed(6)}` : 'N/A';
|
|
56
|
+
|
|
57
|
+
function entryAdvice(s) {
|
|
58
|
+
const lines = [];
|
|
59
|
+
if (s.entry_class === 'ALPHA_EARLY' && s.phase?.includes('ACCUM')) {
|
|
60
|
+
lines.push('💡 SINYAL KUAT: Fase akumulasi awal dengan smart money masuk. Potensi entry terbaik sebelum harga naik.');
|
|
61
|
+
} else if (s.entry_class === 'ALPHA_BUILDING') {
|
|
62
|
+
lines.push('💡 MEMBANGUN: Akumulasi sedang berlanjut. Timing masih baik namun hati-hati dengan risiko.');
|
|
63
|
+
} else {
|
|
64
|
+
lines.push('👁️ WATCHLIST: Belum memenuhi semua kriteria entry. Monitor terus untuk konfirmasi.');
|
|
65
|
+
}
|
|
66
|
+
if (s.whale_delta > 0 && s.dolphin_delta > 0) lines.push('✅ Whale & Dolphin sama-sama masuk — sinyal kuat smart money akumulasi.');
|
|
67
|
+
if (s.smart_money_trap_risk > 30) lines.push('⚠️ Trap Risk tinggi — waspadai jebakan sebelum entry.');
|
|
68
|
+
if (s.liquidity_drain_risk > 30) lines.push('⚠️ Liquidity Risk tinggi — pastikan ada likuiditas cukup saat exit.');
|
|
69
|
+
if (s.safety_score >= 80) lines.push('🛡️ Safety score tinggi — risiko manipulasi rendah.');
|
|
70
|
+
return lines.join('\n ');
|
|
71
|
+
}
|
|
39
72
|
|
|
40
|
-
function
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
73
|
+
function divergenceAdvice(s) {
|
|
74
|
+
if (s.divergence_type === 'bullish') return '💡 BULLISH DIVERGENCE: Harga turun tapi whale/dolphin masuk. Potensi reversal ke atas — perhatikan untuk entry.';
|
|
75
|
+
if (s.divergence_type === 'bearish') return '⚠️ BEARISH DIVERGENCE: Harga naik tapi whale/dolphin keluar. Potensi reversal ke bawah — hati-hati jika sudah hold.';
|
|
76
|
+
return '📊 Divergence terdeteksi — analisa lebih lanjut diperlukan.';
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function accumAdvice(s) {
|
|
80
|
+
if (s.strength_label?.includes('VERY_STRONG')) return '💡 VERY STRONG: Smart money sangat aktif akumulasi. Kandidat entry terkuat.';
|
|
81
|
+
if (s.strength_label?.includes('STRONG')) return '💡 STRONG: Akumulasi kuat terdeteksi. Perhatikan untuk entry opportunity.';
|
|
82
|
+
return '👁️ FORMING: Akumulasi mulai terbentuk. Monitor untuk konfirmasi lebih lanjut.';
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// ─── Formatters ───────────────────────────────────────────────────────────────
|
|
44
86
|
|
|
45
87
|
function formatAlpha(data) {
|
|
46
|
-
if (data.error) return `❌
|
|
47
|
-
if (!data.signals?.length) return
|
|
88
|
+
if (data.error) return `❌ ${data.error}\n${data.setup||''}\n📱 Setup: cryptoiz.org`;
|
|
89
|
+
if (!data.signals?.length) return `Tidak ada sinyal Alpha Scanner saat ini.\n${FOOTER}`;
|
|
90
|
+
|
|
48
91
|
const lines = [
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
92
|
+
`╔══════════════════════════════════════╗`,
|
|
93
|
+
`║ CRYPTOIZ ALPHA ENTRY SCANNER ║`,
|
|
94
|
+
`╚══════════════════════════════════════╝`,
|
|
95
|
+
`📅 ${data.fetched_at?.split('T')[0]} | Total Sinyal: ${data.total}`,
|
|
96
|
+
``,
|
|
97
|
+
`📖 APA INI?`,
|
|
98
|
+
`Alpha Scanner menggunakan AI untuk mendeteksi token Solana`,
|
|
99
|
+
`yang sedang diakumulasi oleh whale & dolphin (smart money)`,
|
|
100
|
+
`sebelum harga bergerak. Score 0-100 berdasarkan:`,
|
|
101
|
+
`• Accumulation Score — seberapa aktif smart money masuk`,
|
|
102
|
+
`• Timing Score — seberapa tepat timing entry`,
|
|
103
|
+
`• Safety Score — seberapa aman dari manipulasi`,
|
|
104
|
+
``,
|
|
105
|
+
`━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━`,
|
|
54
106
|
...data.signals.map((s, i) => [
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
`
|
|
58
|
-
`
|
|
59
|
-
`
|
|
60
|
-
`
|
|
61
|
-
|
|
62
|
-
`
|
|
63
|
-
`
|
|
64
|
-
`
|
|
65
|
-
`
|
|
66
|
-
|
|
67
|
-
`
|
|
107
|
+
``,
|
|
108
|
+
`${i+1}. ━━━ ${s.name} ━━━━━━━━━━━━━━━━━━━`,
|
|
109
|
+
` 🔗 Address : ${s.token_address}`,
|
|
110
|
+
` 📊 Alpha Score: ${fmt(s.alpha_score)} / 100 | Kelas: ${s.entry_class}`,
|
|
111
|
+
` 📍 Phase : ${s.phase} | Regime: ${s.regime}`,
|
|
112
|
+
` 🎯 Keyakinan : ${fmt(s.phase_confidence)}% | Umur Phase: ${s.phase_age_bars} bars`,
|
|
113
|
+
``,
|
|
114
|
+
` HOLDER SIGNALS:`,
|
|
115
|
+
` 🐋 Whale : ${fmtD(s.whale_delta)} (${fmt(s.whale_pct)}% supply)`,
|
|
116
|
+
` 🐬 Dolphin : ${fmtD(s.dolphin_delta)} (${fmt(s.dolphin_pct)}% supply)`,
|
|
117
|
+
` 🦐 Shrimp : ${fmtD(s.shrimp_delta)} (keluar = bullish)`,
|
|
118
|
+
``,
|
|
119
|
+
` SUB-SCORES:`,
|
|
120
|
+
` 📈 Accum : ${fmt(s.accumulation_score)} | Timing: ${fmt(s.timing_score)} | Safety: ${fmt(s.safety_score)}`,
|
|
121
|
+
``,
|
|
122
|
+
` RISIKO:`,
|
|
123
|
+
` 💧 Liquidity : ${fmtRisk(s.liquidity_drain_risk)}`,
|
|
124
|
+
` 🪤 Trap Risk : ${fmtRisk(s.smart_money_trap_risk)}`,
|
|
125
|
+
``,
|
|
126
|
+
` MARKET DATA:`,
|
|
127
|
+
` 💰 Market Cap : ${fmtMC(s.market_cap_usd)}`,
|
|
128
|
+
` 💵 Price : ${fmtPrice(s.price_usd)}`,
|
|
129
|
+
` 📉 Drop Peak : ${s.price_drop_pct != null ? fmt(s.price_drop_pct)+'%' : 'N/A'}`,
|
|
130
|
+
``,
|
|
131
|
+
` REKOMENDASI:`,
|
|
132
|
+
` ${entryAdvice(s)}`,
|
|
133
|
+
`━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━`,
|
|
68
134
|
].join('\n')),
|
|
69
|
-
|
|
70
|
-
'📊 Data by CryptoIZ — cryptoiz.org | @cryptoiz_IDN',
|
|
135
|
+
FOOTER,
|
|
71
136
|
];
|
|
72
137
|
return lines.join('\n');
|
|
73
138
|
}
|
|
74
139
|
|
|
75
140
|
function formatDivergence(data) {
|
|
76
|
-
if (data.error) return `❌
|
|
77
|
-
if (!data.signals?.length) return `Tidak ada divergence signal (${data.timeframe})
|
|
141
|
+
if (data.error) return `❌ ${data.error}\n${FOOTER}`;
|
|
142
|
+
if (!data.signals?.length) return `Tidak ada divergence signal (${data.timeframe}).\n${FOOTER}`;
|
|
143
|
+
|
|
78
144
|
const lines = [
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
145
|
+
`╔══════════════════════════════════════╗`,
|
|
146
|
+
`║ CRYPTOIZ DIVERGENCE SCANNER ║`,
|
|
147
|
+
`╚══════════════════════════════════════╝`,
|
|
148
|
+
`📅 ${data.fetched_at?.split('T')[0]} | Timeframe: ${data.timeframe?.toUpperCase()} | Total: ${data.total}`,
|
|
149
|
+
``,
|
|
150
|
+
`📖 APA INI?`,
|
|
151
|
+
`Divergence terjadi ketika harga bergerak berlawanan dengan`,
|
|
152
|
+
`aktivitas smart money (whale/dolphin). Ini adalah sinyal awal`,
|
|
153
|
+
`sebelum harga berbalik arah:`,
|
|
154
|
+
`• BULLISH: Harga turun tapi smart money masuk → potensi naik`,
|
|
155
|
+
`• BEARISH: Harga naik tapi smart money keluar → potensi turun`,
|
|
156
|
+
``,
|
|
157
|
+
`━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━`,
|
|
84
158
|
...data.signals.map((s, i) => {
|
|
85
|
-
const type = s.divergence_type === 'bullish' ? '🟢 BULLISH' : s.divergence_type === 'bearish' ? '🔴 BEARISH' : (s.divergence_type||'').toUpperCase()
|
|
159
|
+
const type = s.divergence_type === 'bullish' ? '🟢 BULLISH' : s.divergence_type === 'bearish' ? '🔴 BEARISH' : `⚪ ${(s.divergence_type||'').toUpperCase()}`;
|
|
86
160
|
return [
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
`
|
|
90
|
-
`
|
|
91
|
-
`
|
|
92
|
-
|
|
93
|
-
`
|
|
94
|
-
`
|
|
95
|
-
`
|
|
96
|
-
|
|
161
|
+
``,
|
|
162
|
+
`${i+1}. ━━━ ${s.name||s.symbol} [${type}] ━━━`,
|
|
163
|
+
` 🔗 Address : ${s.token_address}`,
|
|
164
|
+
` 📊 Div. Score : ${fmt(s.divergence_score)} | Confidence: ${fmt(s.confidence_score)}%`,
|
|
165
|
+
` 📍 Phase : ${s.phase_label}`,
|
|
166
|
+
``,
|
|
167
|
+
` HOLDER SIGNALS:`,
|
|
168
|
+
` 🐋 Whale : ${fmtD(s.whale_delta)}`,
|
|
169
|
+
` 🐬 Dolphin : ${fmtD(s.dolphin_delta)}`,
|
|
170
|
+
``,
|
|
171
|
+
` MARKET DATA:`,
|
|
172
|
+
` 💰 Market Cap : ${fmtMC(s.market_cap_usd)}`,
|
|
173
|
+
` 💵 Price Now : ${fmtPrice(s.price_usd)}`,
|
|
174
|
+
` 📉 Price Chg : ${s.price_change_pct ? fmt(s.price_change_pct)+'%' : 'N/A'}`,
|
|
175
|
+
` 🕐 Detected : ${s.detected_at ? new Date(s.detected_at).toLocaleString('id-ID') : 'N/A'}`,
|
|
176
|
+
``,
|
|
177
|
+
` REKOMENDASI:`,
|
|
178
|
+
` ${divergenceAdvice(s)}`,
|
|
179
|
+
`━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━`,
|
|
97
180
|
].join('\n');
|
|
98
181
|
}),
|
|
99
|
-
|
|
100
|
-
'📊 Data by CryptoIZ — cryptoiz.org | @cryptoiz_IDN',
|
|
182
|
+
FOOTER,
|
|
101
183
|
];
|
|
102
184
|
return lines.join('\n');
|
|
103
185
|
}
|
|
104
186
|
|
|
105
|
-
function
|
|
106
|
-
if (data.error) return `❌
|
|
107
|
-
if (!data.tokens?.length) return
|
|
187
|
+
function formatAccumulation(data) {
|
|
188
|
+
if (data.error) return `❌ ${data.error}\n${FOOTER}`;
|
|
189
|
+
if (!data.tokens?.length) return `Tidak ada token dalam fase akumulasi.\n${FOOTER}`;
|
|
190
|
+
|
|
108
191
|
const lines = [
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
192
|
+
`╔══════════════════════════════════════╗`,
|
|
193
|
+
`║ CRYPTOIZ ACCUMULATION SCANNER ║`,
|
|
194
|
+
`╚══════════════════════════════════════╝`,
|
|
195
|
+
`📅 ${data.fetched_at?.split('T')[0]} | Total: ${data.total} token akumulasi`,
|
|
196
|
+
``,
|
|
197
|
+
`📖 APA INI?`,
|
|
198
|
+
`Accumulation Dashboard mendeteksi token yang sedang dalam`,
|
|
199
|
+
`fase akumulasi berdasarkan 4 dimensi analisis:`,
|
|
200
|
+
`• Structure Score — pola price action & holder tier`,
|
|
201
|
+
`• AccDist Score — distribusi akumulasi vs distribusi`,
|
|
202
|
+
`• Holder Score — kualitas & konsistensi holder`,
|
|
203
|
+
`• Market Score — kondisi pasar & volume`,
|
|
204
|
+
`Composite Score = gabungan keempat dimensi di atas.`,
|
|
205
|
+
``,
|
|
206
|
+
`━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━`,
|
|
114
207
|
...data.tokens.map((t, i) => [
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
`
|
|
118
|
-
`
|
|
119
|
-
`
|
|
120
|
-
`
|
|
121
|
-
|
|
208
|
+
``,
|
|
209
|
+
`${i+1}. ━━━ ${t.name} ━━━━━━━━━━━━━━━━━━━`,
|
|
210
|
+
` 🔗 Address : ${t.token_address}`,
|
|
211
|
+
` 📊 Composite : ${fmt(t.composite_score)} / 100`,
|
|
212
|
+
` 💪 Strength : ${t.strength_label}`,
|
|
213
|
+
` 🔄 AccDist : ${t.accdist_label} (Score: ${fmt(t.accdist_score)})`,
|
|
214
|
+
``,
|
|
215
|
+
` SUB-SCORES:`,
|
|
216
|
+
` 📐 Structure : ${fmt(t.structure_score)}`,
|
|
217
|
+
` 👥 Holder : ${fmt(t.holder_score)}`,
|
|
218
|
+
` 📉 Market : ${fmt(t.market_score)}`,
|
|
219
|
+
``,
|
|
220
|
+
` REKOMENDASI:`,
|
|
221
|
+
` ${accumAdvice(t)}`,
|
|
222
|
+
`━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━`,
|
|
122
223
|
].join('\n')),
|
|
123
|
-
|
|
124
|
-
|
|
224
|
+
FOOTER,
|
|
225
|
+
];
|
|
226
|
+
return lines.join('\n');
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
function formatBTC(data) {
|
|
230
|
+
if (data.error) return `❌ ${data.error}\n${FOOTER}`;
|
|
231
|
+
const s = data.btc_signal || {};
|
|
232
|
+
const f = data.futures_signal || {};
|
|
233
|
+
const ind = data.indicators || {};
|
|
234
|
+
|
|
235
|
+
const stateEmoji = s.state === 'bull' ? '🟢' : s.state === 'bear' ? '🔴' : '🟡';
|
|
236
|
+
const signalEmoji = f.signal === 'LONG' ? '🟢' : f.signal === 'SHORT' ? '🔴' : '🟡';
|
|
237
|
+
|
|
238
|
+
const lines = [
|
|
239
|
+
`╔══════════════════════════════════════╗`,
|
|
240
|
+
`║ CRYPTOIZ BTC REGIME MONITOR ║`,
|
|
241
|
+
`╚══════════════════════════════════════╝`,
|
|
242
|
+
`📅 ${data.fetched_at?.split('T')[0]}`,
|
|
243
|
+
``,
|
|
244
|
+
`📖 APA INI?`,
|
|
245
|
+
`BTC Regime Monitor menganalisis kondisi makro Bitcoin`,
|
|
246
|
+
`untuk membantu kamu memahami apakah pasar sedang bullish,`,
|
|
247
|
+
`bearish, atau neutral. Ini penting karena kondisi BTC`,
|
|
248
|
+
`sangat mempengaruhi pergerakan altcoin di Solana.`,
|
|
249
|
+
``,
|
|
250
|
+
`━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━`,
|
|
251
|
+
``,
|
|
252
|
+
`${stateEmoji} KONDISI BTC SAAT INI: ${(s.state||'').toUpperCase()}`,
|
|
253
|
+
` 💵 Harga BTC : $${s.last_price ? parseFloat(s.last_price).toLocaleString() : 'N/A'}`,
|
|
254
|
+
` 📊 BTC Score : ${s.score || 'N/A'} (0=sangat bear, 10=sangat bull)`,
|
|
255
|
+
` 📈 Trend : ${s.trend || 'N/A'}`,
|
|
256
|
+
``,
|
|
257
|
+
`SENTIMENT:`,
|
|
258
|
+
` 😱 Fear & Greed: ${s.fear_label || 'N/A'} (${s.fear_value || 'N/A'}/100)`,
|
|
259
|
+
` 💡 ${s.fear_value <= 25 ? 'Extreme Fear = peluang beli sering muncul di level ini' : s.fear_value >= 75 ? 'Extreme Greed = hati-hati, pasar bisa reversal' : 'Sentimen netral — ikuti sinyal teknikal'}`,
|
|
260
|
+
``,
|
|
261
|
+
`FUTURES DATA:`,
|
|
262
|
+
` ${signalEmoji} Signal Futures : ${f.signal || 'N/A'}`,
|
|
263
|
+
` 📊 OI Regime : ${f.oi_regime || 'N/A'}`,
|
|
264
|
+
` 💸 Funding : ${f.funding_regime || 'N/A'}`,
|
|
265
|
+
` 💵 Perp Price : $${f.perp_price ? parseFloat(f.perp_price).toLocaleString() : 'N/A'}`,
|
|
266
|
+
` 📝 Alasan : ${f.reason || 'N/A'}`,
|
|
267
|
+
``,
|
|
268
|
+
ind.rsi ? [
|
|
269
|
+
`INDIKATOR TEKNIKAL (1H):`,
|
|
270
|
+
` RSI : ${fmt(ind.rsi)} ${parseFloat(ind.rsi) < 30 ? '(Oversold ✅)' : parseFloat(ind.rsi) > 70 ? '(Overbought ⚠️)' : '(Normal)'}`,
|
|
271
|
+
` EMA 20 : $${ind.ema_20 ? parseFloat(ind.ema_20).toLocaleString() : 'N/A'}`,
|
|
272
|
+
` EMA 50 : $${ind.ema_50 ? parseFloat(ind.ema_50).toLocaleString() : 'N/A'}`,
|
|
273
|
+
` MACD : ${fmt(ind.macd)} | Signal: ${fmt(ind.macd_signal)}`,
|
|
274
|
+
``,
|
|
275
|
+
].join('\n') : '',
|
|
276
|
+
`REKOMENDASI UNTUK ALTCOIN SOLANA:`,
|
|
277
|
+
s.state === 'bull' ? ` 🟢 BTC bullish → kondisi BAGUS untuk cari entry altcoin Solana.
|
|
278
|
+
Fokus pada token dengan Alpha Score tinggi di cryptoiz.org.` :
|
|
279
|
+
s.state === 'bear' ? ` 🔴 BTC bearish → HATI-HATI entry altcoin.
|
|
280
|
+
Prioritaskan token dengan Safety Score tinggi dan liq risk rendah.` :
|
|
281
|
+
` 🟡 BTC neutral → Selektif dalam memilih entry.
|
|
282
|
+
Tunggu konfirmasi signal sebelum masuk posisi besar.`,
|
|
283
|
+
` 📊 Cek kondisi terkini di: cryptoiz.org/BTC`,
|
|
284
|
+
``,
|
|
285
|
+
`━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━`,
|
|
286
|
+
`⚠️ Bukan financial advice. Selalu DYOR.`,
|
|
287
|
+
FOOTER,
|
|
125
288
|
];
|
|
126
289
|
return lines.join('\n');
|
|
127
290
|
}
|
|
@@ -129,33 +292,52 @@ function formatAccum(data) {
|
|
|
129
292
|
function formatStatus() {
|
|
130
293
|
const hasKey = !!SVM_PRIVATE_KEY;
|
|
131
294
|
return [
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
`
|
|
139
|
-
`
|
|
140
|
-
`
|
|
141
|
-
|
|
142
|
-
`
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
295
|
+
`╔══════════════════════════════════════╗`,
|
|
296
|
+
`║ CryptoIZ MCP Server v2.1.0 ║`,
|
|
297
|
+
`╚══════════════════════════════════════╝`,
|
|
298
|
+
``,
|
|
299
|
+
`STATUS KONEKSI:`,
|
|
300
|
+
` ✅ CONNECTED ke CryptoIZ Data Engine`,
|
|
301
|
+
` ${hasKey ? '✅ PAYMENT READY — x402 Solana USDC' : '❌ PAYMENT NOT SET — tambahkan SVM_PRIVATE_KEY'}`,
|
|
302
|
+
` 💰 Harga : $0.01 USDC per call`,
|
|
303
|
+
` 🏦 Wallet CRZ : DsKmdkYx49Xc1WhqMUAztwhdYPTqieyC98VmnnJdgpXX`,
|
|
304
|
+
``,
|
|
305
|
+
`TOOLS TERSEDIA:`,
|
|
306
|
+
` 1. get_alpha_scanner — Token Solana dengan akumulasi terkuat`,
|
|
307
|
+
` Termasuk: address, MC, price, holder signals, sub-scores, risks`,
|
|
308
|
+
``,
|
|
309
|
+
` 2. get_divergence — Divergence bullish/bearish`,
|
|
310
|
+
` Termasuk: address, MC, price, confidence, waktu deteksi`,
|
|
311
|
+
``,
|
|
312
|
+
` 3. get_accumulation — Token fase akumulasi (composite score)`,
|
|
313
|
+
` Termasuk: address, 4 sub-scores, strength label`,
|
|
314
|
+
``,
|
|
315
|
+
` 4. get_btc_regime — Kondisi makro Bitcoin`,
|
|
316
|
+
` Termasuk: price, fear & greed, OI regime, funding, indikator`,
|
|
317
|
+
``,
|
|
318
|
+
` 5. get_status — Info server ini`,
|
|
319
|
+
``,
|
|
320
|
+
`CARA PAKAI:`,
|
|
321
|
+
` • Tanya: "Sinyal Solana hari ini?"`,
|
|
322
|
+
` • Tanya: "Ada divergence bullish?"`,
|
|
323
|
+
` • Tanya: "Token mana yang diakumulasi whale?"`,
|
|
324
|
+
` • Tanya: "Kondisi BTC sekarang?"`,
|
|
325
|
+
FOOTER,
|
|
146
326
|
].join('\n');
|
|
147
327
|
}
|
|
148
328
|
|
|
329
|
+
// ─── Tool definitions ─────────────────────────────────────────────────────────
|
|
149
330
|
const TOOLS = [
|
|
150
|
-
{ name: 'get_alpha_scanner', description: '
|
|
151
|
-
{ name: 'get_divergence', description: '
|
|
152
|
-
{ name: 'get_accumulation', description: '
|
|
153
|
-
{ name: '
|
|
331
|
+
{ name: 'get_alpha_scanner', description: 'Ambil sinyal token Solana terkuat dari CryptoIZ Alpha Scanner. Termasuk contract address, market cap, price, holder signals (whale/dolphin/shrimp), sub-scores (accum/timing/safety), dan risiko. Biaya $0.01 USDC via Solana.', inputSchema: { type: 'object', properties: { min_score: { type: 'number', description: 'Minimum alpha score (0-100).' }, entry_class: { type: 'string', enum: ['ALPHA_EARLY','ALPHA_BUILDING','WATCHLIST_ONLY'], description: 'Filter entry class.' } }, required: [] } },
|
|
332
|
+
{ name: 'get_divergence', description: 'Ambil divergence signals dari CryptoIZ — deteksi bullish/bearish divergence antara harga dan aktivitas whale/dolphin. Termasuk address, MC, price, confidence score, waktu deteksi. Biaya $0.01 USDC.', inputSchema: { type: 'object', properties: { timeframe: { type: 'string', enum: ['4h','1d'], description: 'Timeframe. Default: 4h.' }, limit: { type: 'number', description: 'Max hasil (1-50). Default: 20.' } }, required: [] } },
|
|
333
|
+
{ name: 'get_accumulation', description: 'Ambil token dalam fase akumulasi dari CryptoIZ Accumulation Dashboard. Composite score dari 4 dimensi: Structure, AccDist, Holder, Market. Termasuk address. Biaya $0.01 USDC.', inputSchema: { type: 'object', properties: { min_composite: { type: 'number', description: 'Minimum composite score (0-100).' } }, required: [] } },
|
|
334
|
+
{ name: 'get_btc_regime', description: 'Ambil kondisi makro Bitcoin dari CryptoIZ BTC Monitor. Termasuk: state (bull/bear/neutral), Fear & Greed Index, OI regime, funding rate, sinyal futures, dan indikator teknikal. Penting untuk konteks altcoin Solana. Biaya $0.01 USDC.', inputSchema: { type: 'object', properties: {}, required: [] } },
|
|
335
|
+
{ name: 'get_status', description: 'Cek status koneksi CryptoIZ MCP, info payment, dan daftar tools tersedia.', inputSchema: { type: 'object', properties: {}, required: [] } },
|
|
154
336
|
];
|
|
155
337
|
|
|
156
|
-
|
|
338
|
+
// ─── Server ───────────────────────────────────────────────────────────────────
|
|
339
|
+
const server = new Server({ name: 'cryptoiz-mcp', version: '2.1.0' }, { capabilities: { tools: {} } });
|
|
157
340
|
server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS }));
|
|
158
|
-
|
|
159
341
|
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
160
342
|
const { name, arguments: args } = request.params;
|
|
161
343
|
try {
|
|
@@ -179,7 +361,12 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
179
361
|
if (name === 'get_accumulation') {
|
|
180
362
|
const data = await payAndFetch(`${GATEWAY_URL}?tool=get_accumulation`);
|
|
181
363
|
if (args?.min_composite && data.tokens) { data.tokens = data.tokens.filter(t => t.composite_score >= args.min_composite); data.total = data.tokens.length; }
|
|
182
|
-
return { content: [{ type: 'text', text:
|
|
364
|
+
return { content: [{ type: 'text', text: formatAccumulation(data) }] };
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
if (name === 'get_btc_regime') {
|
|
368
|
+
const data = await payAndFetch(`${GATEWAY_URL}?tool=get_btc_regime`);
|
|
369
|
+
return { content: [{ type: 'text', text: formatBTC(data) }] };
|
|
183
370
|
}
|
|
184
371
|
|
|
185
372
|
return { content: [{ type: 'text', text: `Tool tidak dikenal: ${name}` }], isError: true };
|