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: include remaining pump-fun changes and test files

nirholas9e5df246c64c
diff --git a/api/pump-fun-mcp.js b/api/pump-fun-mcp.js
index 7cc3b0b63..dee96eea8 100644
--- a/api/pump-fun-mcp.js
+++ b/api/pump-fun-mcp.js
@@ -337,6 +337,12 @@ async function handleWatchClaims({ creator, durationMs = 300_000, network = 'mai
return { creator, network, windowMs: window, claims };
}
+
+async function handleSocialCashtagSentiment({ posts }) {
+ if (!Array.isArray(posts) || posts.length === 0) throw rpcError(-32602, 'posts must be a non-empty array');
+ const { scoreSentiment } = await import('../src/social/sentiment.js');
+ return scoreSentiment(posts);
+}
// ── Dispatch ───────────────────────────────────────────────────────────────
const HANDLERS = {
@@ -351,10 +357,13 @@ const HANDLERS = {
getNewTokens: indexerOrUnavailable('getNewTokens'),
getGraduatedTokens: indexerOrUnavailable('getGraduatedTokens'),
getKingOfTheHill: indexerOrUnavailable('getKingOfTheHill'),
+ social_cashtag_sentiment: handleSocialCashtagSentiment,
getCreatorProfile: indexerOrUnavailable('getCreatorProfile'),
pumpfun_list_claims: handleListClaims,
pumpfun_watch_claims: handleWatchClaims,
pumpfun_vanity_mint: handleVanityMint,
+ sns_resolve: handleSnsResolve,
+ sns_reverseLookup: handleSnsReverseLookup,
};
// ── HTTP entrypoint ────────────────────────────────────────────────────────
diff --git a/public/studio/index.html b/public/studio/index.html
index b4b75760e..fc9164048 100644
--- a/public/studio/index.html
+++ b/public/studio/index.html
@@ -174,6 +174,11 @@
<div id="type-fields" class="type-fields"></div>
</form>
+ </div><!-- #panel-brand -->
+
+ <div id="panel-launch" role="tabpanel" hidden>
+ <!-- Mounted by studio.js via mountLaunchPanel -->
+ </div>
</div>
<div class="action-row">
diff --git a/public/studio/studio.js b/public/studio/studio.js
index 8bfb0c849..c1c296bb7 100644
--- a/public/studio/studio.js
+++ b/public/studio/studio.js
@@ -5,6 +5,8 @@
// /public/* is served verbatim by Vercel — the build doesn't transform it.
// Keep this list in sync with src/widget-types.js as new types light up.
+import { mountLaunchPanel } from './launch-panel.js';
+
const WIDGET_TYPES = {
turntable: {
label: 'Turntable Showcase',
@@ -502,6 +504,30 @@ function wireButtons() {
$('#embed-modal').hidden = true;
});
+ // Right-column tab switching: Brand ↔ Launch
+ const tabBrand = $('#tab-brand');
+ const tabLaunch = $('#tab-launch');
+ const panelBrand = $('#panel-brand');
+ const panelLaunch = $('#panel-launch');
+ const actionRow = $('.action-row');
+ const formError = $('#form-error');
+
+ mountLaunchPanel(panelLaunch);
+
+ function switchTab(active) {
+ const toBrand = active === 'brand';
+ tabBrand.setAttribute('aria-selected', String(toBrand));
+ tabLaunch.setAttribute('aria-selected', String(!toBrand));
+ panelBrand.hidden = !toBrand;
+ panelLaunch.hidden = toBrand;
+ // Hide save/generate buttons and errors when on Launch tab
+ if (actionRow) actionRow.hidden = !toBrand;
+ if (formError) formError.hidden = true;
+ }
+
+ tabBrand.addEventListener('click', () => switchTab('brand'));
+ tabLaunch.addEventListener('click', () => switchTab('launch'));
+
document.addEventListener('keydown', (e) => {
if (e.key === 'Escape' && !$('#embed-modal').hidden) {
$('#embed-modal').hidden = true;
diff --git a/services/pump-graduations/index.js b/services/pump-graduations/index.js
index 6d6f06ab4..dbd17a5b8 100644
--- a/services/pump-graduations/index.js
+++ b/services/pump-graduations/index.js
@@ -15,11 +15,15 @@
* UPSTASH_REDIS_REST_TOKEN
* GRADUATIONS_LIST_KEY default: pf:graduations
* GRADUATIONS_MAX_LEN default: 500
+ * PUMP_GRADUATIONS_SOURCE "legacy" (default) | "carbon"
+ * Selects the graduation event source at startup.
+ * Both sources emit the same events to Redis.
*/
import { Connection, PublicKey } from '@solana/web3.js';
import { Redis } from '@upstash/redis';
import bs58 from 'bs58';
+import { CarbonGraduationSource } from './carbon-source.js';
const PUMP_PROGRAM_ID = new PublicKey('6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P');
@@ -31,6 +35,7 @@ const RPC = required('SOLANA_RPC_URL');
const WS = required('SOLANA_WS_URL');
const LIST_KEY = process.env.GRADUATIONS_LIST_KEY || 'pf:graduations';
const MAX_LEN = Number(process.env.GRADUATIONS_MAX_LEN || 500);
+const SOURCE = process.env.PUMP_GRADUATIONS_SOURCE || 'legacy';
const redis = new Redis({
url: required('UPSTASH_REDIS_REST_URL'),
@@ -40,31 +45,47 @@ const redis = new Redis({
const conn = new Connection(RPC, { wsEndpoint: WS, commitment: 'confirmed' });
const seen = new Set();
-console.log('[pump-graduations] starting; program=%s', PUMP_PROGRAM_ID.toBase58());
+console.log('[pump-graduations] starting; program=%s source=%s', PUMP_PROGRAM_ID.toBase58(), SOURCE);
-conn.onLogs(
- PUMP_PROGRAM_ID,
- async (entry) => {
+if (SOURCE === 'carbon') {
+ const src = new CarbonGraduationSource({ connection: conn });
+ src.start(async ({ mint, signature, ts }) => {
try {
- if (entry.err) return;
- const sig = entry.signature;
- if (seen.has(sig)) return;
- if (!entry.logs?.some((l) => l.includes('Program data:'))) return;
-
- const ev = await tryParseGraduation(sig, entry.logs);
- if (!ev) return;
- seen.add(sig);
+ if (seen.has(signature)) return;
+ seen.add(signature);
if (seen.size > 5000) seen.clear();
-
- const enriched = await enrichToken(ev);
+ const enriched = await enrichToken({ signature, mint, timestamp: ts });
await pushGraduation(enriched);
- console.log('[pump-graduations] pushed', enriched.symbol || enriched.mint, sig);
+ console.log('[pump-graduations] pushed (carbon)', enriched.mint, signature);
} catch (err) {
- console.error('[pump-graduations] handler error:', err?.message || err);
+ console.error('[pump-graduations] handler error (carbon):', err?.message || err);
}
- },
- 'confirmed',
-);
+ });
+} else {
+ conn.onLogs(
+ PUMP_PROGRAM_ID,
+ async (entry) => {
+ try {
+ if (entry.err) return;
+ const sig = entry.signature;
+ if (seen.has(sig)) return;
+ if (!entry.logs?.some((l) => l.includes('Program data:'))) return;
+
+ const ev = await tryParseGraduation(sig, entry.logs);
+ if (!ev) return;
+ seen.add(sig);
+ if (seen.size > 5000) seen.clear();
+
+ const enriched = await enrichToken(ev);
+ await pushGraduation(enriched);
+ console.log('[pump-graduations] pushed', enriched.symbol || enriched.mint, sig);
+ } catch (err) {
+ console.error('[pump-graduations] handler error:', err?.message || err);
+ }
+ },
+ 'confirmed',
+ );
+}
async function tryParseGraduation(sig, logs) {
for (const line of logs) {
diff --git a/src/kol/wallets.js b/src/kol/wallets.js
new file mode 100644
index 000000000..19e9ad8da
--- /dev/null
+++ b/src/kol/wallets.js
@@ -0,0 +1,21 @@
+// Smart-money / KOL wallet list.
+//
+// Minimum P&L threshold rule: wallets here must have realised ≥$10 000
+// cumulative profit on Solana meme-token trades.
+// TODO: replace stub with a dynamic source (on-chain P&L indexer, Dune, Birdeye)
+
+export const KOL_WALLETS = [
+ { address: 'Hxk8X7rXhWoJfhbJL8C6kA3mZVJH6P2n5hpwJzE9K1s', label: 'kol-alpha', tags: ['kol'] },
+ { address: '5Q544fKrFoe6tsEbD7S8EmxGTJYAKtTVhAW5Q5pge4j1', label: 'smart-money-1', tags: ['smart-money'] },
+ { address: 'ART5dr4bDic2sQVZoFheEmUxwQq5VyaSuwY4aiNXMxdA', label: 'whale-desk', tags: ['whale'] },
+];
+
+const _index = new Map(KOL_WALLETS.map((w) => [w.address, w]));
+
+export function isSmartMoney(address) {
+ return _index.has(address);
+}
+
+export function getWalletMeta(address) {
+ return _index.get(address) || null;
+}
diff --git a/src/kol/wallets.json b/src/kol/wallets.json
index fe51488c7..7a80be928 100644
--- a/src/kol/wallets.json
+++ b/src/kol/wallets.json
@@ -1 +1,22 @@
-[]
+[
+ {
+ "wallet": "So11111111111111111111111111111111111111112",
+ "source": "gmgn",
+ "label": "SmartTrader1",
+ "pnlUsd": 12345.67,
+ "winRate": 0.75
+ },
+ {
+ "wallet": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",
+ "source": "gmgn",
+ "label": "KolTrader2",
+ "pnlUsd": 8901.23,
+ "winRate": 0.62
+ },
+ {
+ "wallet": "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263",
+ "source": "gmgn",
+ "pnlUsd": 3200,
+ "winRate": 0.55
+ }
+]
diff --git a/src/pump/agent-token-widget.js b/src/pump/agent-token-widget.js
index afced2fb4..fe27bfc25 100644
--- a/src/pump/agent-token-widget.js
+++ b/src/pump/agent-token-widget.js
@@ -672,6 +672,17 @@ export class AgentTokenWidget {
this._wireActions();
this._updateMobileStrip(symbol, priceText);
+
+ // Mount bonding curve SVG into the wrapper (replaces old progress bar).
+ if (this._curve) { this._curve.destroy(); this._curve = null; }
+ const curveWrap = this.mount.querySelector('.atok-curve-wrap');
+ if (curveWrap && progressPct != null) {
+ this._curve = mountBondingCurve(curveWrap, {
+ progressPct,
+ marketCapUsd: q.bonding_curve?.market_cap_usd ?? 0,
+ graduationCapUsd: 69_000,
+ });
+ }
}
_tickClassFor(name, newBal) {
diff --git a/src/pump/mcp-tools.js b/src/pump/mcp-tools.js
index 04be97347..f9ba4d3c1 100644
--- a/src/pump/mcp-tools.js
+++ b/src/pump/mcp-tools.js
@@ -201,20 +201,6 @@ export const TOOLS = [
required: ['address'],
},
},
- {
- name: 'kol_leaderboard',
- description:
- 'Top KOL traders ranked by P&L for a given time window. Returns wallet, pnlUsd, winRate, trades, rank.',
- inputSchema: {
- type: 'object',
- properties: {
- window: { type: 'string', enum: ['24h', '7d', '30d'], default: '7d' },
- limit: { type: 'integer', minimum: 1, maximum: 100, default: 25 },
- },
- },
- },
-];
-
{
name: 'social_cashtag_sentiment',
description:
@@ -240,6 +226,19 @@ export const TOOLS = [
required: ['posts'],
},
},
+ {
+ name: 'kol_leaderboard',
+ description:
+ 'Top KOL traders ranked by P&L for a given time window. Returns wallet, pnlUsd, winRate, trades, rank.',
+ inputSchema: {
+ type: 'object',
+ properties: {
+ window: { type: 'string', enum: ['24h', '7d', '30d'], default: '7d' },
+ limit: { type: 'integer', minimum: 1, maximum: 100, default: 25 },
+ },
+ },
+ },
+];
export function rpcError(code, message) {
const err = new Error(message);