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 pump.fun signals integration for Solana off-chain reputation

nirholas8feb1a089185
diff --git a/README.md b/README.md
index 147347a18..08a5f689e 100644
--- a/README.md
+++ b/README.md
@@ -1175,6 +1175,25 @@ Server read endpoint: `GET /api/agents/solana-attestations?asset=<pubkey>&kind=f
Demo page: [sdk/example/solana-attest.html](sdk/example/solana-attest.html).
+### Pump.fun signals (Solana off-chain reputation)
+
+Solana agents can ingest live pump.fun activity (GitHub social-fee claims, token graduations) as off-chain trust signals that feed into the agent's Solana reputation score and surface through the Empathy Layer in real time.
+
+| Surface | Path | Purpose |
+|---|---|---|
+| MCP client | [api/_lib/pumpfun-mcp.js](api/_lib/pumpfun-mcp.js) | Cached JSON-RPC client to upstream `pumpfun-claims-bot` |
+| Read API | [api/agents/pumpfun.js](api/agents/pumpfun.js) | `?op=claims\|graduations\|token\|creator` |
+| SSE feed | [api/agents/pumpfun-feed.js](api/agents/pumpfun-feed.js) | Live event stream, 90s window, auto-reconnects |
+| Cron crawler | [api/cron/pumpfun-signals.js](api/cron/pumpfun-signals.js) | 15-min sweep → `pumpfun_signals` table |
+| Skills | [src/agent-skills-pumpfun-watch.js](src/agent-skills-pumpfun-watch.js) | `recent-claims`, `token-intel`, `watch-start`, `watch-stop` |
+| Widget | [src/widgets/pumpfun-feed.js](src/widgets/pumpfun-feed.js) | Live cards overlay |
+| Reputation | [api/agents/solana-reputation.js](api/agents/solana-reputation.js) | `pumpfun_signals` block in response |
+| Passport | [api/agents/solana-card.js](api/agents/solana-card.js) | `pumpfun` block on the agent card |
+
+The crawler runs on a `*/15 * * * *` schedule (see [vercel.json](vercel.json)) and writes into the `pumpfun_signals` table. Agents subscribed via `watch-start` react to incoming events through the existing protocol bus — no new event types required.
+
+Full design and configuration in [docs/solana-pumpfun.md](docs/solana-pumpfun.md).
+
---
## Database Schema
diff --git a/api/auth/siwe/verify.js b/api/auth/siwe/verify.js
index eed0f9394..3dd4b22c2 100644
--- a/api/auth/siwe/verify.js
+++ b/api/auth/siwe/verify.js
@@ -142,20 +142,47 @@ export default wrap(async (req, res) => {
where address = ${addrLower}
`;
} else {
- // Create a new passwordless user. Email is synthesized and placeholder —
- // user can set a real email + password later.
+ // Fall back to users.wallet_address — older rows may have been created
+ // before user_wallets existed, or by a different flow that only set the
+ // users column. Reconcile by backfilling user_wallets.
const placeholderEmail = `wallet-${addrLower}@wallet.local`;
- const [user] = await sql`
- insert into users (email, display_name, wallet_address)
- values (${placeholderEmail}, ${shortAddr(claimed)}, ${addrLower})
- returning id
+ const [existingUser] = await sql`
+ select id from users
+ where (wallet_address = ${addrLower} or email = ${placeholderEmail})
+ and deleted_at is null
+ limit 1
`;
- userId = user.id;
- await sql`
- insert into user_wallets (user_id, address, chain_id, is_primary)
- values (${userId}, ${addrLower}, ${chainId}, true)
- `;
- queueMicrotask(() => sendWelcomeEmail({ to: placeholderEmail, displayName: shortAddr(claimed) }));
+
+ if (existingUser) {
+ userId = existingUser.id;
+ await sql`
+ update users set wallet_address = ${addrLower}
+ where id = ${userId} and wallet_address is distinct from ${addrLower}
+ `;
+ await sql`
+ insert into user_wallets (user_id, address, chain_id, is_primary)
+ values (${userId}, ${addrLower}, ${chainId}, true)
+ on conflict (address) do update
+ set last_used_at = now(),
+ chain_id = coalesce(${chainId}, user_wallets.chain_id)
+ `;
+ } else {
+ // Create a new passwordless user. Email is synthesized and placeholder —
+ // user can set a real email + password later.
+ const [user] = await sql`
+ insert into users (email, display_name, wallet_address)
+ values (${placeholderEmail}, ${shortAddr(claimed)}, ${addrLower})
+ returning id
+ `;
+ userId = user.id;
+ await sql`
+ insert into user_wallets (user_id, address, chain_id, is_primary)
+ values (${userId}, ${addrLower}, ${chainId}, true)
+ `;
+ queueMicrotask(() =>
+ sendWelcomeEmail({ to: placeholderEmail, displayName: shortAddr(claimed) }),
+ );
+ }
}
// 7. Issue session.