Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

Oracle: personal Telegram conviction alerts

nirholas3d5f8a7315d9
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8d8131bdc..c381b43e7 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -39,6 +39,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr
- **Oracle: Activity feed and Agent leaderboard** — Two new tabs on the Oracle page. Activity shows a live trading floor — every Oracle-armed agent action (buy/outcome/PnL) in real time, filterable by mode, tier, and outcome. Agents ranks every conviction agent by their real track record: win rate, realized PnL, and ROI across all graded calls. Subscribe to copy the top performers directly from the leaderboard. (`/oracle`) `[feature]`
- **Oracle: Conviction-weighted position sizing** — Oracle agents can now scale their position size by conviction strength. Enable 'Scale by conviction' in the Arm your agent panel to have the engine buy up to 1.5× the base size for the highest-scoring coins (score 100) and 1.0× at the minimum threshold. Positions are still capped by the daily SOL budget — this rewards the highest-conviction calls without increasing risk on lower-scoring entries. (`/oracle`) `[feature, improvement]`
- **Oracle: New / Top sort toggle on conviction feed** — The live conviction feed now has a Top / New toggle. Top (default) ranks coins by conviction score so the highest-confidence plays surface first. New sorts by when the coin was scored — useful for catching fresh launches the moment Oracle processes them before the wider market. No extra network request: the sort switches client-side from the already-loaded feed. (`/oracle`) `[improvement]`
+- **Oracle: Personal Telegram conviction alerts** — Oracle agents now support personal Telegram alerts. Add your Telegram chat ID in the Arm your agent panel to receive a direct message every time a coin crosses your conviction threshold — no more checking the feed. Entry alerts fire when your agent takes an action (simulate or live mode). Chat @three_ws_bot on Telegram and send /start to get your chat ID. (`/oracle`) `[feature]`
- **Portfolio: Oracle conviction for every token you hold** — The portfolio dashboard now shows Oracle conviction scores on Solana tokens. Each row gets a live badge showing the Oracle score and tier (prime / strong / lean). The pump.fun tokens table adds an Oracle column. And when you open any token's detail drawer, a conviction breakdown appears — score dial, pillar bars, and a link to the full Oracle analysis. Helps you make informed hold / sell decisions from the portfolio view. (`/dashboard/portfolio`) `[improvement]`
- **Pump Dashboard: live Oracle conviction panel on the main trading desk** — The Pump Dashboard now has a High Conviction panel alongside the live feed — showing the top 5 Oracle-scored coins (score ≥ 60) with their tier badge, 4-pillar bars, and a link to the Oracle drawer. The panel auto-refreshes every 90 seconds and pulses with a live indicator. Clicking any coin opens the full conviction breakdown. (`/pump-dashboard`) `[improvement]`
- **Radar drawer: Oracle conviction scores now inline with coin intelligence** — When you open a coin in the /radar drawer, it now shows the Oracle conviction score alongside the coin intelligence analysis — score, tier badge, and four pillar bars (pedigree/structure/narrative/momentum), with a link to the full Oracle breakdown. Data loads asynchronously so the drawer opens instantly. (`/radar`) `[improvement]`
diff --git a/api/_lib/migrations/20260616210000_oracle_watch_telegram.sql b/api/_lib/migrations/20260616210000_oracle_watch_telegram.sql
new file mode 100644
index 000000000..f216e006b
--- /dev/null
+++ b/api/_lib/migrations/20260616210000_oracle_watch_telegram.sql
@@ -0,0 +1,9 @@
+begin;
+
+alter table oracle_agent_watch
+ add column if not exists telegram_chat_id text;
+
+comment on column oracle_agent_watch.telegram_chat_id is
+ 'Optional personal Telegram chat ID. When set, the owner receives a direct message whenever a coin clears their min_score threshold and whenever their agent takes an action.';
+
+commit;
diff --git a/api/_lib/oracle/alerts.js b/api/_lib/oracle/alerts.js
index 7b897189e..8c8c0d06d 100644
--- a/api/_lib/oracle/alerts.js
+++ b/api/_lib/oracle/alerts.js
@@ -211,3 +211,76 @@ export async function alertNewHighConviction(coins, network = 'mainnet') {
}
return sent;
}
+
+/**
+ * Send a personal entry alert directly to one subscriber's Telegram chat.
+ * Called by the agent-loop for every watch that has a telegram_chat_id, whether
+ * simulate or live (marked clearly in the message).
+ *
+ * @param {string} chatId
+ * @param {{agent_name?:string, symbol:string, mint:string, tier:string, conviction:number, size_sol:number, mode:string, network:string}} entry
+ * @returns {Promise<void>}
+ */
+export async function alertPersonalEntry(chatId, entry) {
+ const token = process.env.TELEGRAM_BOT_TOKEN;
+ if (!token || !chatId) return;
+
+ const tierE = tierEmoji(entry.tier);
+ const sym = escHtml((entry.symbol || entry.mint.slice(0, 6)).toUpperCase());
+ const sizeStr = entry.size_sol != null ? `${Number(entry.size_sol).toFixed(3)} SOL` : '?';
+ const convStr = entry.conviction != null ? ` (score ${entry.conviction})` : '';
+ const modeLabel = entry.mode === 'simulate' ? ' <i>[simulated]</i>' : '';
+ const agentName = escHtml(entry.agent_name || 'Your agent');
+
+ const text = [
+ `${tierE} <b>${agentName}</b> entered <b>$${sym}</b>${modeLabel}`,
+ `${escHtml(entry.tier)} conviction${convStr} · ${escHtml(sizeStr)}`,
+ `<a href="https://pump.fun/coin/${encodeURIComponent(entry.mint)}">pump.fun</a> · <a href="https://three.ws/oracle?mint=${encodeURIComponent(entry.mint)}">Oracle ↗</a>`,
+ ].join('\n');
+
+ await sendTo(chatId, text);
+}
+
+/**
+ * Send a personal conviction signal to one subscriber when a coin crosses their
+ * agent's min_score threshold. Only fires for coins the platform hasn't already
+ * alerted in this run — the platform channel gets one alert per coin, but the
+ * personal alert fires for every subscriber whose threshold the coin crosses.
+ *
+ * @param {string} chatId
+ * @param {object} coin oracle_conviction row (score, tier, symbol, mint, pillars, …)
+ * @param {number} minScore subscriber's personal threshold
+ * @returns {Promise<void>}
+ */
+export async function alertPersonalSignal(chatId, coin, minScore) {
+ const token = process.env.TELEGRAM_BOT_TOKEN;
+ if (!token || !chatId) return;
+ if ((Number(coin.score) || 0) < minScore) return;
+
+ const text = format(coin) + `\n<i>Your agent threshold: ${minScore}</i>`;
+ await sendTo(chatId, text);
+}
+
+/** Send to a specific chat ID (not the platform channel). */
+async function sendTo(chatId, text) {
+ const token = process.env.TELEGRAM_BOT_TOKEN;
+ if (!token) return;
+
+ const ctrl = new AbortController();
+ const timer = setTimeout(() => ctrl.abort(), ALERT_TIMEOUT_MS);
+ try {
+ await fetch(`https://api.telegram.org/bot${token}/sendMessage`, {
+ method: 'POST',
+ headers: { 'content-type': 'application/json' },
+ body: JSON.stringify({
+ chat_id: chatId,
+ text: text.slice(0, 4000),
+ parse_mode: 'HTML',
+ disable_web_page_preview: true,
+ }),
+ signal: ctrl.signal,
+ });
+ } catch { /* fire-and-forget */ } finally {
+ clearTimeout(timer);
+ }
+}
diff --git a/api/_lib/oracle/store.js b/api/_lib/oracle/store.js
index 5790617cc..116a03b75 100644
--- a/api/_lib/oracle/store.js
+++ b/api/_lib/oracle/store.js
@@ -256,12 +256,14 @@ export async function upsertWatch(agentId, userId, network, cfg) {
const row = await sql`
insert into oracle_agent_watch (
agent_id, user_id, network, armed, mode, min_score, min_tier, categories,
- per_trade_sol, max_daily_sol, max_open, require_smart_money, size_scaling, updated_at
+ per_trade_sol, max_daily_sol, max_open, require_smart_money, size_scaling,
+ telegram_chat_id, updated_at
) values (
${agentId}, ${userId || null}, ${network}, ${!!cfg.armed}, ${cfg.mode || 'simulate'},
${cfg.min_score ?? 80}, ${cfg.min_tier || 'strong'}, ${JSON.stringify(cfg.categories || [])}::jsonb,
${cfg.per_trade_sol ?? 0.05}, ${cfg.max_daily_sol ?? 0.5}, ${cfg.max_open ?? 5},
- ${cfg.require_smart_money !== false}, ${!!cfg.size_scaling}, now()
+ ${cfg.require_smart_money !== false}, ${!!cfg.size_scaling},
+ ${cfg.telegram_chat_id || null}, now()
)
on conflict (agent_id, network) do update set
user_id = coalesce(excluded.user_id, oracle_agent_watch.user_id),
@@ -269,7 +271,8 @@ export async function upsertWatch(agentId, userId, network, cfg) {
min_tier = excluded.min_tier, categories = excluded.categories,
per_trade_sol = excluded.per_trade_sol, max_daily_sol = excluded.max_daily_sol,
max_open = excluded.max_open, require_smart_money = excluded.require_smart_money,
- size_scaling = excluded.size_scaling, updated_at = now()
+ size_scaling = excluded.size_scaling, telegram_chat_id = excluded.telegram_chat_id,
+ updated_at = now()
returning *
`;
return row[0];
diff --git a/api/oracle/watch.js b/api/oracle/watch.js
index 00fef956c..16cdf37d0 100644
--- a/api/oracle/watch.js
+++ b/api/oracle/watch.js
@@ -39,6 +39,7 @@ const WATCH_SCHEMA = z.object({
max_open: numish.optional(),
require_smart_money: z.boolean().optional(),
size_scaling: z.boolean().optional(),
+ telegram_chat_id: z.string().max(64).optional().nullable(),
});
async function resolveUserId(req) {
@@ -105,6 +106,12 @@ export default wrap(async (req, res) => {
return error(res, 400, 'validation_error', 'set a per-trade size before arming a live agent');
}
+ // Sanitize telegram_chat_id: allow numeric IDs (positive or negative) and
+ // @handle-style strings. Strip anything that looks like a URL or injection.
+ const rawTg = (cfg.telegram_chat_id || '').trim();
+ const telegramChatId = /^-?\d{1,20}$/.test(rawTg) || /^@[A-Za-z0-9_]{3,32}$/.test(rawTg)
+ ? rawTg : null;
+
const saved = await upsertWatch(cfg.agent_id, userId, network, {
armed: !!cfg.armed,
mode: cfg.mode || 'simulate',
@@ -116,6 +123,7 @@ export default wrap(async (req, res) => {
max_open: maxOpen,
require_smart_money: cfg.require_smart_money !== false,
size_scaling: !!cfg.size_scaling,
+ telegram_chat_id: telegramChatId || null,
});
return json(res, 200, { agent_id: cfg.agent_id, network, watch: saved });
@@ -126,7 +134,7 @@ function defaultWatch(agentId, network) {
agent_id: agentId, network, armed: false, mode: 'simulate',
min_score: 80, min_tier: 'strong', categories: [],
per_trade_sol: 0.05, max_daily_sol: 0.5, max_open: 5,
- require_smart_money: true, size_scaling: false,
+ require_smart_money: true, size_scaling: false, telegram_chat_id: null,
};
}
diff --git a/data/changelog.json b/data/changelog.json
index a3b4bbc73..9deb160ce 100644
--- a/data/changelog.json
+++ b/data/changelog.json
@@ -1,6 +1,13 @@
{
"$comment": "Curated changelog entries for three.ws — the editorial layer of the public changelog. New PAGE launches are tracked automatically via the `added` field in data/pages.json; this file is for everything else holders care about: improvements, fixes, SDK releases, trading/payments capabilities, security work. scripts/build-page-index.mjs merges both sources into CHANGELOG.md, public/changelog.json, and public/changelog.xml. Newest first. Allowed tags: feature, improvement, fix, sdk, infra, docs, security. `link` is optional and must be a live three.ws path.",
"entries": [
+ {
+ "date": "2026-06-16",
+ "title": "Oracle: Personal Telegram conviction alerts",
+ "summary": "Oracle agents now support personal Telegram alerts. Add your Telegram chat ID in the Arm your agent panel to receive a direct message every time a coin crosses your conviction threshold — no more checking the feed. Entry alerts fire when your agent takes an action (simulate or live mode). Chat @three_ws_bot on Telegram and send /start to get your chat ID.",
+ "tags": ["feature"],
+ "link": "/oracle"
+ },
{
"date": "2026-06-16",
"title": "Oracle: New / Top sort toggle on conviction feed",
diff --git a/pages/oracle.html b/pages/oracle.html
index 6df0362e5..d5a50df3e 100644
--- a/pages/oracle.html
+++ b/pages/oracle.html
@@ -186,6 +186,7 @@
.field label { display: block; font: 600 10.5px/1 var(--mono); text-transform: uppercase; letter-spacing: .07em; color: var(--faint); margin-bottom: 7px; }
.field input, .field select { width: 100%; background: rgba(255,255,255,0.03); border: 1px solid var(--line); border-radius: var(--r-sm); color: var(--ink); padding: 10px 12px; font: 600 14px/1 var(--mono); }
.field input:focus, .field select:focus { outline: 2px solid color-mix(in srgb, var(--cyan) 60%, transparent); outline-offset: 1px; }
+ .field-hint { margin-top: 6px; font-size: 11.5px; color: var(--muted); line-height: 1.5; } .field-hint a { color: var(--cyan); } .field-hint code { background: rgba(255,255,255,.06); padding: 1px 4px; border-radius: 3px; font-size: 11px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.toggle .t-lab b { display: block; font-size: 14px; }
diff --git a/public/changelog.json b/public/changelog.json
index bdec85201..c4386fb97 100644
--- a/public/changelog.json
+++ b/public/changelog.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-06-16T07:11:06.000Z",
+ "generated_at": "2026-06-16T07:15:23.582Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json",
"site": {
"name": "three.ws",
@@ -342,6 +342,16 @@
"improvement"
]
},
+ {
+ "date": "2026-06-16",
+ "type": "update",
+ "title": "Oracle: Personal Telegram conviction alerts",
+ "summary": "Oracle agents now support personal Telegram alerts. Add your Telegram chat ID in the Arm your agent panel to receive a direct message every time a coin crosses your conviction threshold — no more checking the feed. Entry alerts fire when your agent takes an action (simulate or live mode). Chat @three_ws_bot on Telegram and send /start to get your chat ID.",
+ "link": "/oracle",
+ "tags": [
+ "feature"
+ ]
+ },
{
"date": "2026-06-16",
"type": "update",
diff --git a/public/changelog.xml b/public/changelog.xml
index f41aab665..28e1e527a 100644
--- a/public/changelog.xml
+++ b/public/changelog.xml
@@ -270,6 +270,14 @@
<category>improvement</category>
<description>The live conviction feed now has a Top / New toggle. Top (default) ranks coins by conviction score so the highest-confidence plays surface first. New sorts by when the coin was scored — useful for catching fresh launches the moment Oracle processes them before the wider market. No extra network request: the sort switches client-side from the already-loaded feed.</description>
</item>
+ <item>
+ <title>Oracle: Personal Telegram conviction alerts</title>
+ <link>https://three.ws/oracle</link>
+ <guid isPermaLink="false">2026-06-16:Oracle: Personal Telegram conviction alerts</guid>
+ <pubDate>Tue, 16 Jun 2026 12:00:00 GMT</pubDate>
+ <category>feature</category>
+ <description>Oracle agents now support personal Telegram alerts. Add your Telegram chat ID in the Arm your agent panel to receive a direct message every time a coin crosses your conviction threshold — no more checking the feed. Entry alerts fire when your agent takes an action (simulate or live mode). Chat @three_ws_bot on Telegram and send /start to get your chat ID.</description>
+ </item>
<item>
<title>Portfolio: Oracle conviction for every token you hold</title>
<link>https://three.ws/dashboard/portfolio</link>
diff --git a/public/features.json b/public/features.json
index 6d36cea3f..fb80e74f6 100644
--- a/public/features.json
+++ b/public/features.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-06-16T07:11:05.988Z",
+ "generated_at": "2026-06-16T07:15:23.571Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json",
"site": {
"name": "three.ws",
diff --git a/src/oracle.js b/src/oracle.js
index 0fd6ae26c..184c27c04 100644
--- a/src/oracle.js
+++ b/src/oracle.js
@@ -998,6 +998,11 @@ function renderArmForm() {
<div class="t-lab"><b id="agArmLab">Armed</b><span>Master switch for this agent</span></div>
<div class="sw" id="agArm" role="switch" aria-checked="false"></div>
</div>
+ <div class="field" style="margin-top:12px">
+ <label>Personal Telegram alerts <span class="chip sm" style="background:rgba(139,92,246,.15);color:#c084fc;border-color:rgba(139,92,246,.35)">optional</span></label>
+ <input id="agTelegram" type="text" placeholder="Your chat ID or @channel" autocomplete="off" style="font-size:12px;font-family:var(--mono,monospace)">
+ <div class="field-hint">Chat <a href="https://t.me/three_ws_bot" target="_blank" rel="noopener">@three_ws_bot</a> on Telegram and send <code>/start</code> to get your chat ID. You'll receive a signal whenever a coin crosses your threshold.</div>
+ </div>
<button class="btn primary" id="agSave" style="margin-top:8px">Save configuration</button>
<div class="note" id="agNote"></div>`;
@@ -1050,6 +1055,7 @@ async function loadWatch(agentId) {
: '1.0× at min score → up to 1.5× at score 100';
const cats = new Set(w.categories || []);
$$('#agCats .cchip').forEach((b) => b.classList.toggle('on', cats.has(b.dataset.cat)));
+ $('#agTelegram').value = w.telegram_chat_id || '';
}
loadActions(agentId);
}
@@ -1071,6 +1077,7 @@ async function saveWatch() {
max_open: Number($('#agOpen').value) || 5,
require_smart_money: $('#agSmart').classList.contains('on'),
size_scaling: $('#agScale').classList.contains('on'),
+ telegram_chat_id: ($('#agTelegram').value || '').trim() || null,
};
const { ok, data } = await api('/api/oracle/watch', {
method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(payload),
@@ -1078,7 +1085,8 @@ async function saveWatch() {
btn.disabled = false; btn.textContent = 'Save configuration';
const note = $('#agNote');
if (ok && data?.watch) {
- note.className = 'note'; note.textContent = data.watch.armed ? `Armed in ${data.watch.mode} mode. Your agent is watching the stream.` : 'Saved. Toggle "Armed" to start watching.';
+ const tgNote = data.watch.telegram_chat_id ? ' Telegram alerts active.' : '';
+ note.className = 'note'; note.textContent = data.watch.armed ? `Armed in ${data.watch.mode} mode. Your agent is watching the stream.${tgNote}` : `Saved. Toggle "Armed" to start watching.${tgNote}`;
loadActions(state.agentId);
} else {
note.className = 'note warn';
diff --git a/workers/oracle/agent-loop.js b/workers/oracle/agent-loop.js
index d48674b26..94b35ac00 100644
--- a/workers/oracle/agent-loop.js
+++ b/workers/oracle/agent-loop.js
@@ -9,7 +9,7 @@ import { sql } from '../../api/_lib/db.js';
import { log } from './log.js';
import { evaluateWatch } from '../../api/_lib/oracle/agent-eval.js';
import { executeAction, agentBudget } from './executor.js';
-import { alertAgentEntry } from '../../api/_lib/oracle/alerts.js';
+import { alertAgentEntry, alertPersonalEntry, alertPersonalSignal } from '../../api/_lib/oracle/alerts.js';
// Module cursor — only consider verdicts scored since the last pass.
let cursor = new Date(Date.now() - 60_000).toISOString();
@@ -18,7 +18,7 @@ async function armedWatches(network) {
return sql`
select w.agent_id, w.user_id, w.network, w.armed, w.mode, w.min_score, w.min_tier,
w.categories, w.per_trade_sol, w.max_daily_sol, w.max_open, w.require_smart_money,
- w.size_scaling, a.name as agent_name
+ w.size_scaling, w.telegram_chat_id, a.name as agent_name
from oracle_agent_watch w
join agent_identities a on a.id = w.agent_id and a.deleted_at is null
where w.armed = true and w.network = ${network}
@@ -68,6 +68,17 @@ export async function actOnFreshCoins(cfg, coins) {
for (const watch of watches) {
const { openCount, spentTodaySol } = await agentBudget(watch.agent_id, cfg.network);
let open = openCount, spent = spentTodaySol;
+
+ // Personal signal alerts: fire once per watch for coins that clear its threshold
+ // even if the agent doesn't end up acting (budget full, already acted, etc.).
+ if (watch.telegram_chat_id) {
+ for (const coin of coins) {
+ if ((Number(coin.score) || 0) >= (Number(watch.min_score) || 0)) {
+ alertPersonalSignal(watch.telegram_chat_id, coin, Number(watch.min_score) || 0).catch(() => {});
+ }
+ }
+ }
+
for (const coin of coins) {
const decision = evaluateWatch({ watch, coin, openCount: open, spentTodaySol: spent });
if (!decision.act) continue;
@@ -75,7 +86,7 @@ export async function actOnFreshCoins(cfg, coins) {
const res = await executeAction({ cfg, watch, coin, size: decision.size, reason: decision.reason });
if (res.status === 'filled') {
acted += 1; open += 1; spent += decision.size;
- // Collect live entries for the Telegram entry alert.
+ // Platform channel: live-mode entries only (too much noise for sim).
if (watch.mode === 'live' && cfg.mode === 'live') {
liveEntries.push({
agent_id: watch.agent_id,
@@ -88,6 +99,19 @@ export async function actOnFreshCoins(cfg, coins) {
network: cfg.network,
});
}
+ // Personal entry alert: always fires if the subscriber has a chat ID.
+ if (watch.telegram_chat_id) {
+ alertPersonalEntry(watch.telegram_chat_id, {
+ agent_name: watch.agent_name || null,
+ symbol: coin.symbol,
+ mint: coin.mint,
+ tier: coin.tier,
+ conviction: coin.score,
+ size_sol: decision.size,
+ mode: watch.mode,
+ network: cfg.network,
+ }).catch(() => {});
+ }
}
}
}