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.

pump-agent-stats: fix chronic 504s on Vercel

nirholas4216a0c012af
diff --git a/api/cron/[name].js b/api/cron/[name].js
index 5be79913e..5bec93639 100644
--- a/api/cron/[name].js
+++ b/api/cron/[name].js
@@ -35,6 +35,7 @@ import {
getPumpAgent,
getPumpAgentOffline,
getConnection,
+ getRpcFallback,
getPumpSdk,
getAmmPoolState,
buildUnsignedTxBase64,
@@ -342,8 +343,13 @@ const DISABLED_TOPIC = dmIface.getEvent('DisabledDelegation').topicHash;
const REDEEMED_TOPIC = dmIface.getEvent('RedeemedDelegation').topicHash;
// Max blocks per eth_getLogs call. Public RPCs 429 above ~2000.
+// Ethereum mainnet (chainId 1) nodes cap eth_getLogs at 50 blocks; use 25 to
+// stay safely under the limit and avoid 504s.
const IDX_BLOCK_CAP = 2000;
+const IDX_MAINNET_BLOCK_CAP = 25; // ETH mainnet is far more restrictive
const IDX_RPC_TIMEOUT_MS = 10_000;
+// Hard time budget per cron invocation — leave 8 s headroom before Vercel's 30 s limit.
+const IDX_TIME_BUDGET_MS = 22_000;
// Approximate blocks per day, used only to seed the cursor on first run.
const BLOCKS_PER_DAY = {