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.

fix(crypto-holders): cap holder reads at 20 a minute per IP so one poller cannot throttle the shared Solana lanes

nirholasbc7c8b845337
diff --git a/api/_lib/rate-limit.js b/api/_lib/rate-limit.js
index 804945e70..8018e2383 100644
--- a/api/_lib/rate-limit.js
+++ b/api/_lib/rate-limit.js
@@ -1526,6 +1526,10 @@ export const limits = {
// a real answer from the keyless lane.
cryptoHoldersHeliusIp: (ip) =>
getLimiter('crypto-holders:helius:ip', { limit: 30, window: '1 h' }).limit(ip),
+ // The holders read costs three RPC calls even on the keyless lane, against
+ // free nodes the whole platform shares, so it gets a tighter per-IP burst
+ // than the family's 60/min.
+ cryptoHoldersIp: (ip) => getLimiter('crypto-holders:ip', { limit: 20, window: '1 m' }).limit(ip),
// Free Crypto Data API family (api/crypto/*). Keyless, no-account reads an agent
// makes mid-task (wallet portfolio, token snapshots). Some paths fan out to the
// keyed Helius/public-RPC upstreams, so a generous-but-bounded per-IP burst keeps
diff --git a/api/crypto/holders.js b/api/crypto/holders.js
index ff21d17ff..63b218456 100644
--- a/api/crypto/holders.js
+++ b/api/crypto/holders.js
@@ -46,8 +46,13 @@ export default wrap(async (req, res) => {
if (!method(req, res, ['GET'])) return;
const ip = clientIp(req);
- const [ipRl, globalRl] = await Promise.all([limits.cryptoDataIp(ip), limits.cryptoDataGlobal()]);
+ const [ipRl, holdersRl, globalRl] = await Promise.all([
+ limits.cryptoDataIp(ip),
+ limits.cryptoHoldersIp(ip),
+ limits.cryptoDataGlobal(),
+ ]);
if (!ipRl.success) return rateLimited(res, ipRl);
+ if (!holdersRl.success) return rateLimited(res, holdersRl);
if (!globalRl.success) return rateLimited(res, globalRl);
const url = new URL(req.url, 'http://localhost');
diff --git a/docs/crypto-api.md b/docs/crypto-api.md
index bf6d6a851..a0e6d978d 100644
--- a/docs/crypto-api.md
+++ b/docs/crypto-api.md
@@ -841,7 +841,9 @@ surfaces can never contradict each other.
`as_of` (when it was computed), and an `x-holders-stale: 1` header; with no
last good copy, `503` + `Retry-After`. A throttled RPC is never reported as
"no holders". Never `500`.
-- **Rate-limited** → `429` with `RateLimit-*` + `Retry-After` headers.
+- **Rate-limited** → `429` with `RateLimit-*` + `Retry-After` headers. This
+ endpoint allows 20 reads per minute per IP (inside the family's 60), because
+ every read costs several Solana RPC calls.
### Examples