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.

Use int*interval over make_interval(=>param) in smart-money queries

nirholas1a835b2d020a
diff --git a/api/cron/smart-money-rollup.js b/api/cron/smart-money-rollup.js
index 1dfe23fa7..633906ce4 100644
--- a/api/cron/smart-money-rollup.js
+++ b/api/cron/smart-money-rollup.js
@@ -76,8 +76,8 @@ async function judgeAndFold() {
SELECT i.mint, extract(epoch from i.first_seen_at)::bigint AS first_ts
FROM pump_coin_intel i
WHERE i.network = ${NETWORK}
- AND i.first_seen_at < now() - make_interval(hours => ${JUDGE_AFTER_HOURS})
- AND i.first_seen_at > now() - make_interval(days => ${MAX_AGE_DAYS})
+ AND i.first_seen_at < now() - ${JUDGE_AFTER_HOURS} * interval '1 hour'
+ AND i.first_seen_at > now() - ${MAX_AGE_DAYS} * interval '1 day'
AND NOT EXISTS (
SELECT 1 FROM smart_money_scored s
WHERE s.mint = i.mint AND s.network = ${NETWORK}
@@ -176,8 +176,8 @@ async function judgeAndFold() {
SELECT count(*)::int AS remaining
FROM pump_coin_intel i
WHERE i.network = ${NETWORK}
- AND i.first_seen_at < now() - make_interval(hours => ${JUDGE_AFTER_HOURS})
- AND i.first_seen_at > now() - make_interval(days => ${MAX_AGE_DAYS})
+ AND i.first_seen_at < now() - ${JUDGE_AFTER_HOURS} * interval '1 hour'
+ AND i.first_seen_at > now() - ${MAX_AGE_DAYS} * interval '1 day'
AND NOT EXISTS (SELECT 1 FROM smart_money_scored s WHERE s.mint = i.mint AND s.network = ${NETWORK})
`;
@@ -241,7 +241,7 @@ async function scoreLiveCoins() {
const coins = await sql`
SELECT mint, symbol, name, image_uri, category, first_seen_at
FROM pump_coin_intel
- WHERE network = ${NETWORK} AND first_seen_at > now() - make_interval(hours => ${LIVE_WINDOW_HOURS})
+ WHERE network = ${NETWORK} AND first_seen_at > now() - ${LIVE_WINDOW_HOURS} * interval '1 hour'
ORDER BY first_seen_at DESC
LIMIT ${LIVE_COINS}
`;
diff --git a/api/pump/smart-money.js b/api/pump/smart-money.js
index ccdfef698..27f4d842f 100644
--- a/api/pump/smart-money.js
+++ b/api/pump/smart-money.js
@@ -53,7 +53,7 @@ async function feed(res, url) {
WHERE network = ${NETWORK}
AND smart_money_score >= ${minScore}
AND (${includeGraduated} OR graduated = false)
- AND scored_at > now() - make_interval(hours => 6)
+ AND scored_at > now() - interval '6 hours'
ORDER BY smart_money_score DESC, scored_at DESC
LIMIT ${limit}
`;