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.
JavaScript 3d-generationai-agentsanimationavatardigital-humangenerative-aiglbgltfimage-to-3dllmmcpmcp-servermodel-context-protocolsolanatext-to-3dthreejsweb-componentswebglwebxrx402
docs(x402): document intraday fee pacing, and cover its shape in the lab
nirholas13efbfa6dbff
diff --git a/docs/x402-ring-economy.md b/docs/x402-ring-economy.mdindex 5264bbd83..037b9b148 100644--- a/docs/x402-ring-economy.md+++ b/docs/x402-ring-economy.md@@ -110,6 +110,25 @@ decision logic in- **Kill switch:** `X402_WALLET_FEE_GOVERNOR_ENABLED=false`. Cache freshness:`X402_WALLET_FEE_SPENT_CACHE_MS` (default 20s; bounds multi-instanceundercount to one window per instance).+- **Intraday pacing (opt-in):** `X402_WALLET_FEE_PACE_DAY=true` releases the+ daily budget gradually across the UTC day instead of making all of it+ spendable at 00:00. Without it, a wallet whose budget is the heartbeat floor+ can burn the whole allowance in a morning burst and then refuse every settle+ until the next reset: production on 2026-08-01 paid 1,002 settles before+ midday, then rejected roughly 3,500 per hour for the rest of the day with+ `fee_runway_exhausted`. Pacing spreads the same total over 24 hours, so the+ rail keeps a pulse all day. It grants **no** extra spend, and+ `X402_WALLET_FEE_PACE_MIN_SLICE_LAMPORTS` (default 200,000) keeps a wallet+ alive in the first minutes after the reset.++ It is **off by default on purpose.** Pacing changes which gate refuses a+ starved wallet first: the governor starts refusing early instead of the hard+ SOL floor refusing later. That floor-vs-governor distinction is exactly what+ `/economy-lab` exists to make visible, and it is how you tell "out of SOL"+ apart from "throttled". Turn pacing on when you want the smoother shape and+ are willing to read the limiter from the lab rather than from the reject+ reason. `simulateRunway({ paceDay: true })` models both shapes before you+ commit to either.## Burning the least SOL — two leversdiff --git a/package.json b/package.jsonindex e7502b0be..d4e2820fd 100644--- a/package.json+++ b/package.json@@ -295,7 +295,6 @@"worker:okx-bot": "node workers/okx-chat-bot/index.js","worker:mm": "node workers/agent-mm/index.js","worker:mm:live": "MM_MODE=live node workers/agent-mm/index.js",- "worker:okx-bot": "node workers/okx-chat-bot/index.js","deploy:sniper": "node scripts/deploy-sniper.mjs","pump:smoke": "node scripts/pumpfun-lifecycle-smoke.js","pump:refresh-idls": "node scripts/refresh-pump-idls.mjs",diff --git a/tests/x402-runway-sim.test.js b/tests/x402-runway-sim.test.jsindex 570b0c14c..a531e594a 100644--- a/tests/x402-runway-sim.test.js+++ b/tests/x402-runway-sim.test.js@@ -115,6 +115,38 @@ describe('simulateRunway — the 2026-07-31 starvation shape', () => {expect(summary.firstRefusalHour).toBe(3);});+ it('pacing is off unless asked for, so the floor stays the visible limiter', () => {+ const unpaced = simulateRunway({ ...STARVED, demandPerHour: 500, hours: 24 });+ const explicitlyOff = simulateRunway({ ...STARVED, demandPerHour: 500, hours: 24, paceDay: false });+ expect(explicitlyOff.summary.admitted).toBe(unpaced.summary.admitted);+ expect(explicitlyOff.summary.limiter).toBe('floor');+ });++ it('pacing spreads the same day of budget instead of front-loading it', () => {+ // A wallet with real spendable SOL, so the governor (not the floor) is the+ // binding gate and pacing is the only thing under test.+ const FUNDED = {+ startLamports: 2_000_000_000, // 2 SOL+ floorLamports: 10_000_000,+ runwayDays: 3,+ minBudgetLamports: 10_000_000,+ feeLamports: 5_000,+ };+ const burst = simulateRunway({ ...FUNDED, demandPerHour: 5_000, hours: 24, startHourOfDay: 0 });+ const paced = simulateRunway({+ ...FUNDED, demandPerHour: 5_000, hours: 24, startHourOfDay: 0, paceDay: true,+ });++ // Same day, same wallet: pacing must not hand out extra throughput.+ expect(paced.summary.admitted).toBeLessThanOrEqual(burst.summary.admitted);++ // The point of pacing: budget still available late in the day. Unpaced, the+ // last hour is dead because the whole allowance went early.+ const lastHour = (r) => r.series[r.series.length - 1].admitted;+ expect(lastHour(burst)).toBe(0);+ expect(lastHour(paced)).toBeGreaterThan(0);+ });+it('a heartbeat raise cannot rescue a wallet that has no spendable SOL', () => {const wider = simulateRunway({ ...STARVED, minBudgetLamports: 50_000_000, demandPerHour: 500, hours: 24 });// Same 1,741: widening the governor changes nothing once the hard floor is