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.

feat: add REST fallback for new-mint feed and enhance leaderboard visibility

udvkb218b2e71e4d
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c16ad345c..d407d4b96 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,6 +7,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr
## 2026-06-26
- **Steadier live feeds under load** — The real-time money feeds that power the Galaxy money-cam and Money Pulse are now more resilient when our cache layer is under pressure. The platform cache can run on its own dedicated store, separate from the rate limiter, so a busy moment no longer slows feed responses or spends the limiter's budget — and even when the cache is degraded, feeds fall back instantly instead of waiting. You'll see the live maps stay smooth during traffic spikes. `[infra, improvement]`
+- **The trader leaderboard is never empty: live top Solana traders until agents take over** — The leaderboard ranks three.ws agents by a provable, on-chain track record — but until an agent has actually traded in a window, the board had nothing to show. Now, whenever no agent yet has a verified record, the flagship board falls back to the live ranking of the top Solana traders by realized profit (real wallets, real P&L, sourced live from kolscan), each row deep-linked to its on-chain account. The moment an agent earns a record it takes precedence again. Real data throughout — if the live feed is briefly unreachable, the board shows an honest 'be the first' state, never fabricated rows. (`/leaderboard`) `[feature, improvement]`
- **Trading Swarms: pool capital with other agents and split the profits** — A new way to trade together. Create a swarm and a dedicated treasury wallet is provisioned on-chain; you and other agents fund it with real SOL. The swarm only buys a coin when enough of its members' verified track records already agree on it — a reputation-weighted consensus, not one agent's hunch — and every trade still passes the same safety firewall and spend limits as a solo snipe. When a position closes in profit, the gain is paid back to every member pro-rata by their share, on-chain and fully auditable, minus an optional creator fee. You can see the live vote on every decision, the treasury balance, each member's share, and the full payout ledger. Exit and redeem your share any time, no single member can capture the treasury, and any qualifying member can hit the kill switch. Find it under Discover → Trading Swarms. (`/swarms`) `[feature]`
## 2026-06-25
diff --git a/api/_lib/pumpfun-ws-feed.js b/api/_lib/pumpfun-ws-feed.js
index d5cab7637..cc23cee74 100644
--- a/api/_lib/pumpfun-ws-feed.js
+++ b/api/_lib/pumpfun-ws-feed.js
@@ -9,6 +9,12 @@ const PUMPPORTAL_WS = 'wss://pumpportal.fun/api/data';
const RECONNECT_DELAY_MS = 2_000;
const MAX_RECONNECTS = 5;
+// REST fallback for the new-mint feed (used when the PumpPortal WS yields no
+// `create` events — e.g. blocked/failed WS egress from a serverless instance).
+const FALLBACK_POLL_MS = 5_000;
+const FALLBACK_LIMIT = 40;
+const RECENT_COINS_TTL_MS = 3_000; // collapse concurrent SSE clients to one upstream poll
+
// Cross-emit dedupe by tx signature. PumpPortal can occasionally redeliver an
// event after a transient WS hiccup; this prevents duplicate cards.
const SEEN_SIG_LIMIT = 2_000;
@@ -85,17 +91,57 @@ export function connectPumpFunFeed({ onEvent, signal, kind = 'all', mints = [] }
let ws = null;
let reconnects = 0;
let reconnectTimer = null;
+ let fallbackTimer = null;
const tradeMints = Array.isArray(mints) ? mints.filter(Boolean) : [];
const wantsTrades = (kind === 'all' || kind === 'trades') && tradeMints.length > 0;
+ const wantsMints = kind === 'all' || kind === 'mint';
+
+ // Per-connection mint dedupe, shared between the WS and the REST fallback so a
+ // launch surfaced by one source is never re-emitted by the other.
+ const _seenMints = new Set();
+ function markMint(mint) {
+ if (!mint || _seenMints.has(mint)) return false;
+ _seenMints.add(mint);
+ if (_seenMints.size > 4_000) {
+ const it = _seenMints.values();
+ for (let i = 0; i < 1_000; i++) _seenMints.delete(it.next().value);
+ }
+ return true;
+ }
function stop() {
active = false;
clearTimeout(reconnectTimer);
+ clearInterval(fallbackTimer);
if (ws) try { ws.close(); } catch {}
}
signal?.addEventListener('abort', stop);
+ // Resilience: pump.fun new-mint REST fallback. Serverless egress can fail to
+ // establish (or sustain) the PumpPortal WebSocket while plain HTTPS to
+ // pump.fun keeps working — when that happens the WS delivers no `create`
+ // events and the live feed goes dark. We poll pump.fun's most-recent-coins
+ // endpoint and emit any launch the WS hasn't already surfaced, so the feed
+ // always has data. When the WS is healthy this is near-silent: it just
+ // backfills the cold-start window, and mint-level dedupe suppresses overlap.
+ async function pollMintFallback() {
+ if (!active || !wantsMints) return;
+ try {
+ const [coins, solPrice] = await Promise.all([fetchRecentCoins(), getSolPrice()]);
+ if (!active || !Array.isArray(coins) || !coins.length) return;
+ // Oldest-first: the client unshifts each row, so emitting in chronological
+ // order leaves the newest launch on top.
+ for (let i = coins.length - 1; i >= 0; i--) {
+ const c = coins[i];
+ if (!c?.mint || !markMint(c.mint)) continue;
+ onEvent({ kind: 'mint', data: normalizeRestCoin(c, solPrice) });
+ }
+ } catch (err) {
+ console.warn('[pumpportal-ws] mint REST fallback failed:', err?.message);
+ }
+ }
+
function connect() {
if (!active) return;
ws = new WebSocket(PUMPPORTAL_WS);
@@ -121,8 +167,10 @@ export function connectPumpFunFeed({ onEvent, signal, kind = 'all', mints = [] }
try { msg = JSON.parse(raw.toString()); } catch { return; }
if (msg.message) return; // ack
- if (msg.txType === 'create' && (kind === 'all' || kind === 'mint')) {
+ if (msg.txType === 'create' && wantsMints) {
if (!markSeen(msg.signature)) return;
+ // Claim the mint so the REST fallback won't re-emit this launch.
+ markMint(msg.mint);
enrichMint(msg).then((data) => {
pushBuffer('mint', data);
if (active) onEvent({ kind: 'mint', data });
@@ -170,6 +218,12 @@ export function connectPumpFunFeed({ onEvent, signal, kind = 'all', mints = [] }
}
connect();
+ if (wantsMints) {
+ // Immediate backfill so a fresh client never stares at a blank feed, then
+ // keep polling as a live safety net behind the WS.
+ pollMintFallback();
+ fallbackTimer = setInterval(pollMintFallback, FALLBACK_POLL_MS);
+ }
return stop;
}
@@ -354,6 +408,67 @@ async function fetchCreatorCoins(creator) {
return v;
}
+// ── new-mint REST fallback ───────────────────────────────────────────────────
+//
+// pump.fun's coins listing, newest-first, is the same HTTPS API we already use
+// for graduation enrichment — reachable from any environment that can make an
+// outbound fetch, including serverless instances where the WS won't connect. A
+// short shared TTL means many concurrent SSE clients on one instance collapse
+// to a single upstream request.
+
+let _recentCoinsCache = { t: 0, coins: [] };
+let _recentCoinsInFlight = null;
+async function fetchRecentCoins() {
+ if (Date.now() - _recentCoinsCache.t < RECENT_COINS_TTL_MS) return _recentCoinsCache.coins;
+ if (_recentCoinsInFlight) return _recentCoinsInFlight;
+ _recentCoinsInFlight = fetchJsonWithTimeout(
+ `${PUMPFUN_COIN_API}?offset=0&limit=${FALLBACK_LIMIT}&sort=created_timestamp&order=DESC&includeNsfw=true`,
+ )
+ .then((data) => {
+ const coins = Array.isArray(data) ? data : Array.isArray(data?.coins) ? data.coins : [];
+ if (coins.length) _recentCoinsCache = { t: Date.now(), coins };
+ return _recentCoinsCache.coins;
+ })
+ .catch(() => _recentCoinsCache.coins)
+ .finally(() => { _recentCoinsInFlight = null; });
+ return _recentCoinsInFlight;
+}
+
+/** Map a pump.fun REST coin to the same mint-event shape `normalizeMint` emits. */
+function normalizeRestCoin(c, solPrice = 0) {
+ const mcSol = typeof c.market_cap === 'number' ? c.market_cap : null;
+ const usdMc = typeof c.usd_market_cap === 'number' ? c.usd_market_cap
+ : mcSol != null && solPrice > 0 ? mcSol * solPrice : null;
+ const createdMs = c.created_timestamp ? Number(c.created_timestamp) : null;
+ // Bonding-curve coins quote in SOL (the upstream reports the System Program id
+ // for native pairs); only an explicit USDC mint flips the pair.
+ const quote = c.quote_mint === USDC_MINT_STR
+ ? { quote_mint: USDC_MINT_STR, quote_symbol: 'USDC', is_usdc_pair: true }
+ : { quote_mint: WSOL_MINT_STR, quote_symbol: 'SOL', is_usdc_pair: false };
+ return {
+ mint: c.mint,
+ name: c.name,
+ symbol: c.symbol,
+ creator: c.creator || null,
+ signature: null,
+ market_cap_sol: mcSol,
+ market_cap_usd: usdMc,
+ initial_buy_sol: null,
+ initial_buy_usd: null,
+ sol_price: solPrice || null,
+ bonding_curve: c.bonding_curve || null,
+ image_uri: c.image_uri || null,
+ description: c.description || null,
+ twitter: c.twitter || null,
+ telegram: c.telegram || null,
+ website: c.website || null,
+ created_at: createdMs ? Math.floor(createdMs / 1000) : Math.floor(Date.now() / 1000),
+ complete: c.complete === true || !!c.raydium_pool || !!c.pump_swap_pool,
+ source: 'rest',
+ ...quote,
+ };
+}
+
function formatAge(createdAtMs) {
if (!createdAtMs) return '';
const s = Math.max(0, Math.floor((Date.now() - createdAtMs) / 1000));
diff --git a/data/changelog.json b/data/changelog.json
index 482e157fd..3742214c8 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-26",
+ "title": "The trader leaderboard is never empty: live top Solana traders until agents take over",
+ "summary": "The leaderboard ranks three.ws agents by a provable, on-chain track record — but until an agent has actually traded in a window, the board had nothing to show. Now, whenever no agent yet has a verified record, the flagship board falls back to the live ranking of the top Solana traders by realized profit (real wallets, real P&L, sourced live from kolscan), each row deep-linked to its on-chain account. The moment an agent earns a record it takes precedence again. Real data throughout — if the live feed is briefly unreachable, the board shows an honest 'be the first' state, never fabricated rows.",
+ "tags": ["feature", "improvement"],
+ "link": "/leaderboard"
+ },
{
"date": "2026-06-26",
"title": "Steadier live feeds under load",
diff --git a/public/changelog.json b/public/changelog.json
index 1ed7eb391..0a78aa531 100644
--- a/public/changelog.json
+++ b/public/changelog.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-06-26T00:01:01.259Z",
+ "generated_at": "2026-06-26T00:06:48.020Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json",
"site": {
"name": "three.ws",
@@ -17,6 +17,17 @@
"improvement"
]
},
+ {
+ "date": "2026-06-26",
+ "type": "update",
+ "title": "The trader leaderboard is never empty: live top Solana traders until agents take over",
+ "summary": "The leaderboard ranks three.ws agents by a provable, on-chain track record — but until an agent has actually traded in a window, the board had nothing to show. Now, whenever no agent yet has a verified record, the flagship board falls back to the live ranking of the top Solana traders by realized profit (real wallets, real P&L, sourced live from kolscan), each row deep-linked to its on-chain account. The moment an agent earns a record it takes precedence again. Real data throughout — if the live feed is briefly unreachable, the board shows an honest 'be the first' state, never fabricated rows.",
+ "link": "/leaderboard",
+ "tags": [
+ "feature",
+ "improvement"
+ ]
+ },
{
"date": "2026-06-26",
"type": "update",
diff --git a/public/changelog.xml b/public/changelog.xml
index 8fe9286a8..dbdac9120 100644
--- a/public/changelog.xml
+++ b/public/changelog.xml
@@ -14,6 +14,14 @@
<category>infra</category>
<description>The real-time money feeds that power the Galaxy money-cam and Money Pulse are now more resilient when our cache layer is under pressure. The platform cache can run on its own dedicated store, separate from the rate limiter, so a busy moment no longer slows feed responses or spends the limiter's budget — and even when the cache is degraded, feeds fall back instantly instead of waiting. You'll see the live maps stay smooth during traffic spikes.</description>
</item>
+ <item>
+ <title>The trader leaderboard is never empty: live top Solana traders until agents take over</title>
+ <link>https://three.ws/leaderboard</link>
+ <guid isPermaLink="false">2026-06-26:The trader leaderboard is never empty: live top Solana traders until agents take over</guid>
+ <pubDate>Fri, 26 Jun 2026 12:00:00 GMT</pubDate>
+ <category>feature</category>
+ <description>The leaderboard ranks three.ws agents by a provable, on-chain track record — but until an agent has actually traded in a window, the board had nothing to show. Now, whenever no agent yet has a verified record, the flagship board falls back to the live ranking of the top Solana traders by realized profit (real wallets, real P&amp;L, sourced live from kolscan), each row deep-linked to its on-chain account. The moment an agent earns a record it takes precedence again. Real data throughout — if the live feed is briefly unreachable, the board shows an honest 'be the first' state, never fabricated rows.</description>
+ </item>
<item>
<title>Trading Swarms: pool capital with other agents and split the profits</title>
<link>https://three.ws/swarms</link>
diff --git a/public/features.json b/public/features.json
index aecc099c8..9c14750bd 100644
--- a/public/features.json
+++ b/public/features.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-06-26T00:01:01.246Z",
+ "generated_at": "2026-06-26T00:06:48.003Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json",
"site": {
"name": "three.ws",