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
Micro-buy treasury topup, sweepback, and docs
nirholase5ea05fd6aee
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 9a38aa7ef..3ffdaeca9 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -11,6 +11,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr- **Image to 3D — Turn a Photo into a 3D Model** (`/image-to-3d`) — Upload a photo (or up to 4 angles) and get a downloadable textured 3D model (GLB). The Forge's photo lane, opened directly — for objects and props; for faces, use Selfie to Avatar.- **A little nod when your forge collection grows** — When you forge a few models from the homepage, three.ws now gives a quiet, occasional note as your on-device collection reaches a milestone (your 3rd, 10th, and so on). It is understated by design and never interrupts, just a small acknowledgement that you are building something. (`/`) `[improvement]`- **A new way to generate avatars: modular, and no two look alike** — The studio avatar generator used to recolor one of five fixed body meshes, so a whole gallery of them read as the same handful of people in different colors. It now composes each avatar from modular parts: a hairstyle, top, bottom, footwear, and glasses mixed across the base bodies onto one shared skeleton, then recolored per part and scaled for height. This is the same one-skeleton-many-parts approach the best avatar platforms use, built in-house with no external service. Every generated avatar is fully rigged and carries facial expression blendshapes, and two of them almost never look the same. All platform-generated avatars continue to appear across the galleries. (`/gallery`) `[feature, improvement]`+- **A steady drip of $THREE buys, paid through the x402 loop** — The platform can now put continuous buy pressure on $THREE: a new lane fires many tiny, real market buys of $THREE per minute (dialable up toward ~60/min), each one triggered by and paid through the same x402 payment loop the agent economy already runs on. Every buy is a genuine on-chain purchase on Jupiter, and the bought $THREE is swept into the treasury. It's buy-only by design (it never sells), sits alongside the existing daily buyback as its high-frequency little sibling, and stays hard-bounded by a daily spend ceiling that's enforced before any money moves. It ships off by default and turns on only once an operator funds the wallet and opts in. `[feature, infra]`- **Agent trades now name the coin and plot on its chart** — When an agent trades, its wallet story now names the exact coin it bought or sold and links straight to that coin's page, instead of a bare SOL amount that led nowhere. Open the coin and you get the other half: an Agent transactions ledger of every three.ws agent that has traded it (who, which way, how much, when, with on-chain proof), and an Agent trades view on the price chart that plots each of those buys and sells as a bubble on the candles, at the moment it happened, buys under the line and sells over it. It closes the loop both ways, from an agent to the coins it moved, and from a coin to the agents moving it. (`/pulse`) `[feature, improvement]`- **AI chat stays up when the free lanes are busy** — The AI chat could return a capacity error when its free model lanes were all rate-limited at once, because signed-out chats had no funded backstop to fall to. Anonymous chat now finishes on our credits-funded Vertex Gemini anchor once the free tiers are exhausted, so a busy moment no longer turns into a dead end. We also removed a chat model route that had been failing every request, which was adding latency to every reply and could surface as an occasional error. `[fix, infra]`- **AR Studio goes multiplayer: build a scene together in real time** — The AR Studio can now be a shared space. Tap Share live to open a room with a short code, send it to a friend, and you both see the same scene update live: every model one of you adds, moves, resizes, rotates, or removes appears for everyone in the room instantly, with a running count of who's building alongside you. Forge a new model from a prompt and it drops into the shared room for everyone. Open the same room on two phones pointed at the same QR marker and the models pin to the same spot on your real table. It runs on the same realtime servers as our live worlds, with each person only able to edit their own models. (`/ar/studio`) `[feature]`@@ -36,7 +37,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr- **Forge: one-click "Roll & Forge" and a clearer free-to-start welcome** — The Forge now greets you with a Roll & Forge button that picks a great random prompt and generates a model in a single click, so you can reach a finished 3D object without thinking of what to type. The start screen and page header also state plainly that generating is free with no sign-up and the model is yours to download, removing the guesswork about cost. Roll & Forge draws from the same curated prompt library as Surprise me, so every random model is one that reconstructs cleanly. (`/forge`) `[feature, improvement]`- **Forge: one-tap variations of any model** — Every model you forge now shows a "More like this" row: one tap re-forges the same subject in a different material or finish (brushed brass, translucent glass, carved oak, and more), so you can explore a whole design space without retyping anything. A reshuffle button deals a fresh set of ideas. It appears for text prompts and runs on the free lane, so exploring costs nothing. `[feature]`- **Free 3D API tells agents exactly when to check back** — When a text-to-3D generation needs a moment and hands back a job to poll, the free /api/3d/generate API now includes how long to wait before checking again (a retryAfter value, also sent as the standard Retry-After header) plus an estimated time-to-ready and a stable creation id. Agents that honor the hint poll on a sensible schedule instead of hammering the endpoint, so they stop tripping the rate limit and the shared free GPU lane carries less needless traffic. Fully backward-compatible: existing callers keep working unchanged. (`/docs/3d-api`) `[improvement]`-- **IBM Granite features stay up, and no longer need an IBM account** — Every Granite-powered feature (the Granite Oracle, Agent Twin, Galaxy cluster naming, Granite Vision image reads, and the IBM Granite brain in the model comparison) ran only on IBM watsonx, so a watsonx hiccup or a deployment without IBM credentials meant the feature failed or was hidden. They now fall over to the same Granite family hosted on OpenRouter (and a vision-capable model for image reads), so Granite keeps answering through an outage and stays selectable even where watsonx is not configured. `[infra, improvement]`+- **IBM Granite features stay up, and no longer need an IBM account** — Every text Granite feature (the IBM Granite brain in the model comparison, Granite Vision image reads, and the paid Granite chat/code/analyze tools on the IBM MCP server) ran only on IBM watsonx, so a watsonx hiccup or a deployment without IBM credentials meant the feature failed or was hidden. Granite now runs on the same model family hosted on OpenRouter: as the direct primary when watsonx is not configured, and as an automatic same-model backstop when a configured watsonx drops a request (image reads fall to a vision-capable model, since OpenRouter has no Granite-vision model). Granite embeddings and TimeSeries forecasting still require watsonx, which has no OpenRouter equivalent. `[infra, improvement]`- **Image to 3D gets its own front door** — Turning a photo into a 3D model has worked in the Forge for a while, but it hid behind a page titled Text to 3D, and the only photo surface people could find was Selfie to Avatar. There is now a dedicated Image to 3D page (three.ws/image-to-3d) that opens the Forge with the photo tab already selected, an Image to 3D link in the main navigation and footers, and clear pointers between the selfie tools (for making an avatar of you) and Image to 3D (for making a model of any object). The Forge and its feature page are also retitled to say what they actually do: text and images. (`/image-to-3d`) `[improvement]`- **Image-to-3D leaps forward: true PBR materials on a flagship GPU** — The Forge realism engine (Hunyuan3D 2.1) is now live on a new flagship-class GPU (NVIDIA RTX PRO 6000 Blackwell, 96 GB). High-tier image-to-3D generations now come out with true physically-based materials: real metal, roughness, and color maps that catch light like photographed objects instead of flat plastic. The new hardware is also dramatically faster; the full shape-plus-texture pass finished in about a minute in our live verification, where the previous GPU class could not even load the model. Alongside it, every 3D generation service is healthy again and all of yesterday’s reliability fixes are fully rolled out across the fleet. (`/forge`) `[feature, improvement, infra]`- **IRL is calmer to use: one clear next step, name tags that stay readable** — The live IRL view stopped talking over itself. Before, you could see "Turn on Camera AR" and "Agent pinned" at the same time, which contradicted each other; now the guidance line and the status line always agree. The floating name tag above each nearby agent is kept clear of the top bar instead of colliding with the Back and Live chips, and when two agents line up front-to-back their tags fan out so both names stay legible rather than stacking into one smudge. The "an agent is near, look around" nudge no longer appears when that agent is already standing in front of you, and it clears itself the moment you turn to face them. (`/irl`) `[improvement]`diff --git a/api/_lib/economy-sweepback.js b/api/_lib/economy-sweepback.jsindex 68c88b9d9..0ba18595a 100644--- a/api/_lib/economy-sweepback.js+++ b/api/_lib/economy-sweepback.js@@ -291,6 +291,114 @@ export async function sweepBack({ connection, mode = 'excess', includeTokens = t};}+// Names that are the FEED SINK, not a reclaim source: pulling SOL out of the+// circulation treasury just to have the topup put it straight back is pure fee+// churn, so reclaim leaves it alone (topup funds it; reclaim feeds topup).+const RECLAIM_EXEMPT_NAMES = new Set(['circulation-treasury']);++/**+ * Emergency consolidation: pull IDLE SOL sitting above each engine's true+ * operating floor (`minSol`, not the topup `refillTo`) back to the master, SOL+ * only — token floats are never touched. This is the automated form of the manual+ * "drain the fleet to refund the feed" recovery: when the funding root is starved,+ * SOL trapped in over-provisioned engines (a launcher floored at 3 SOL that isn't+ * launching, say) flows to where the Money Pulse needs it, on its own.+ *+ * Non-oscillating by construction: it leaves each engine at minSol PLUS a buffer,+ * and the topup only ever funds engines strictly BELOW minSol — so a reclaimed+ * engine is never immediately re-funded, and the two crons cannot ping-pong. The+ * feed sink (circulation-treasury) is exempt. Destination is the same hard-locked+ * ECONOMY_MASTER_ADDRESS constant as sweepBack; no parameter can redirect it.+ *+ * @param {object} args+ * @param {import('@solana/web3.js').Connection} args.connection+ * @param {'mainnet'|'devnet'} [args.network]+ * @param {boolean} [args.dryRun]+ * @returns {Promise<{master:string, reclaimedSol:number, moves:Array, skipped:Array, failed:Array, readErrors:Array}>}+ */+export async function reclaimIdleSol({ connection, network = 'mainnet', dryRun = false }) {+ const master = ECONOMY_MASTER_ADDRESS;+ const moves = [];+ const failed = [];+ const skipped = [];+ const readErrors = [];++ // Merge registry entries that resolve to the same physical wallet. Keep the+ // HIGHEST minSol among a wallet's roles so we never leave it under any role's+ // operating floor, and treat the wallet as exempt if ANY of its roles is.+ const wallets = new Map();+ for (const spec of SOLANA_SIGNERS) {+ if (spec.isMaster || spec.network === 'devnet') continue;+ const { keypair, configured, decodeError } = await loadSignerKeypair(spec);+ if (!configured) continue;+ if (decodeError || !keypair) {+ readErrors.push({ name: spec.name, reason: 'secret_decode_failed' });+ continue;+ }+ const pubkey = keypair.publicKey.toBase58();+ if (pubkey === master) continue;+ const exempt = RECLAIM_EXEMPT_NAMES.has(spec.name);+ const existing = wallets.get(pubkey);+ if (existing) {+ existing.names.push(spec.name);+ existing.minSol = Math.max(existing.minSol, spec.minSol || 0);+ existing.exempt = existing.exempt || exempt;+ } else {+ wallets.set(pubkey, { pubkey, keypair, names: [spec.name], minSol: spec.minSol || 0, exempt });+ }+ }++ for (const w of wallets.values()) {+ const name = w.names.join('+');+ if (w.exempt) {+ skipped.push({ name, reason: 'feed_sink_exempt' });+ continue;+ }+ let currentSol;+ try {+ currentSol = round((await connection.getBalance(w.keypair.publicKey, 'confirmed')) / LAMPORTS_PER_SOL);+ } catch (e) {+ readErrors.push({ name, pubkey: w.pubkey, reason: `rpc_error: ${e?.message}` });+ continue;+ }+ // Leave the engine its floor plus a comfortable buffer so fee jitter can't+ // drop it below minSol (which would make the topup re-fund it and reopen the+ // oscillation this design closes).+ const keepSol = w.minSol + Math.max(0.005, w.minSol * 0.1);+ const reclaimable = round(currentSol - keepSol);+ if (reclaimable < MIN_SWEEP_SOL) {+ skipped.push({ name, reason: 'at_or_below_floor' });+ continue;+ }+ if (dryRun) {+ moves.push({ name, pubkey: w.pubkey, sol: reclaimable, dryRun: true });+ continue;+ }+ try {+ const signature = await sendSol({+ connection,+ fromKeypair: w.keypair,+ to: master,+ lamports: Math.round(reclaimable * LAMPORTS_PER_SOL),+ memo: `three.ws reclaim ${name} → economy-master`,+ network,+ });+ moves.push({ name, pubkey: w.pubkey, sol: reclaimable, signature });+ } catch (e) {+ failed.push({ name, pubkey: w.pubkey, sol: reclaimable, reason: e?.message || 'send_failed' });+ }+ }++ return {+ master,+ reclaimedSol: round(moves.reduce((s, m) => s + m.sol, 0)),+ moves,+ skipped,+ failed,+ readErrors,+ };+}+function round(n) {return Math.round(n * 1e9) / 1e9;}diff --git a/api/_lib/token/microbuy.js b/api/_lib/token/microbuy.jsindex de297bf3a..b156cab0e 100644--- a/api/_lib/token/microbuy.js+++ b/api/_lib/token/microbuy.js@@ -172,6 +172,22 @@ export async function releaseDailySpend(atomics) {try { await redis.incrby(dailyKey(), -Number(BigInt(atomics))); } catch { /* non-fatal */ }}+/**+ * Cheap best-effort check: is there room under today's cap for at least one more+ * buy? Used to refuse a call BEFORE quoting Jupiter when the day's budget is spent.+ * The atomic reserve in executeMicrobuy remains the real guard; this only avoids+ * needless work on the exhausted path. Fails OPEN (returns true) on a read error so+ * a transient Redis/DB blip never wrongly halts buys — the reserve still enforces.+ */+export async function hasDailyBudget() {+ try {+ const spent = await dailySpentAtomics();+ return spent + buyUsdcAtomics() <= usdToUsdcAtomics(dailyCapUsd());+ } catch {+ return true;+ }+}+/** Today's micro-buy spend so far (atomics) for status/read paths. */export async function dailySpentAtomics() {const redis = getRedis();diff --git a/api/cron/treasury-topup.js b/api/cron/treasury-topup.jsindex 4445aea3f..247acacc9 100644--- a/api/cron/treasury-topup.js+++ b/api/cron/treasury-topup.js@@ -32,9 +32,10 @@ import { env } from '../_lib/env.js';import { constantTimeEquals } from '../_lib/crypto.js';import { sendOpsAlert } from '../_lib/alerts.js';import { SOLANA_SIGNERS, resolveSignerPubkey } from '../_lib/solana-signers.js';-import { sweepTopUps, RESERVE_SOL, RUN_CAP_SOL, PER_TOPUP_MAX_SOL } from '../_lib/economy-master.js';+import { sweepTopUps, RESERVE_SOL, RUN_CAP_SOL, PER_TOPUP_MAX_SOL, ECONOMY_MASTER_ADDRESS } from '../_lib/economy-master.js';import { recordSweep } from '../_lib/economy-ledger.js';import { refuelMasterFromUsdc } from '../_lib/economy-fuel.js';+import { reclaimIdleSol } from '../_lib/economy-sweepback.js';const LAMPORTS_PER_SOL = 1_000_000_000;// How high to lift an engine when it falls below its floor, unless the spec@@ -113,6 +114,38 @@ export default wrapCron(async (req, res) => {// this keeps the tank full from revenue instead of waiting on a human. No-op// unless there is a genuine shortage AND spare USDC (see economy-fuel.js).const totalDeficitSol = targets.reduce((s, t) => s + Math.max(0, t.refillToSol - t.currentSol), 0);++ // Self-healing, step 1 (free SOL first): when there is a real deficit, reclaim+ // idle SOL sitting above other engines' operating floors back to the master+ // before spending any revenue. This is the automated form of the manual "drain+ // the fleet to refund the feed" recovery, and it is non-oscillating (see+ // reclaimIdleSol). Only runs when the master can't already cover the deficit, so+ // a healthy fleet never churns fees.+ let reclaim = { reclaimedSol: 0, moves: [], skipped: [], failed: [] };+ if (totalDeficitSol > 0) {+ try {+ const masterSolNow = (await connection.getBalance(new PublicKey(ECONOMY_MASTER_ADDRESS), 'confirmed')) / 1e9;+ if (Math.max(0, masterSolNow - RESERVE_SOL) < totalDeficitSol) {+ reclaim = await reclaimIdleSol({ connection, network: 'mainnet', dryRun });+ }+ } catch (e) {+ reclaim = { reclaimedSol: 0, moves: [], skipped: [], failed: [], error: e?.message || 'reclaim_failed' };+ }+ }+ if (reclaim.reclaimedSol > 0 && !dryRun) {+ await sendOpsAlert(+ `♻️ Economy master reclaimed idle SOL`,+ `pulled ${reclaim.reclaimedSol} SOL back from ${reclaim.moves.length} engine(s) to cover a ${totalDeficitSol.toFixed(3)} SOL deficit before spending revenue.`,+ { signature: `economy-reclaim:${reclaim.moves.map((m) => m.pubkey).join(',')}` },+ );+ }++ // Self-healing, step 2 (revenue): if reclaim did not close the gap, convert a+ // small bounded slice of the master's own idle USDC into native SOL. The+ // circulation loop leaks SOL to fees every tick, so without a source the funding+ // root drains to zero and /pulse goes quiet — this keeps the tank full from+ // revenue instead of waiting on a human. No-op unless a genuine shortage remains+ // AND there is spare USDC (see economy-fuel.js).let fuel = { acted: false, reason: 'not_needed' };if (totalDeficitSol > 0) {try {diff --git a/api/x402/three-buy.js b/api/x402/three-buy.jsindex 61446a94e..48db83aa7 100644--- a/api/x402/three-buy.js+++ b/api/x402/three-buy.js@@ -35,6 +35,7 @@ import { logger } from '../_lib/usage.js';import { TOKEN_MINT } from '../_lib/token/config.js';import {isEnabled,+ hasDailyBudget,loadMicrobuySigner,planMicrobuy,executeMicrobuy,@@ -155,6 +156,13 @@ export default paidEndpoint({throw refuseToll('signer not configured (set THREE_MICROBUY_SECRET_KEY_B64 or THREE_BUYBACK_SECRET_KEY_B64)');}+ // Cheap pre-check: refuse the toll before quoting Jupiter once the day's+ // budget is spent. The atomic reserve in executeMicrobuy is the real guard.+ if (!(await hasDailyBudget())) {+ await record('skipped', { reason: 'daily_cap_reached' });+ throw refuseToll('daily_cap_reached');+ }+let plan;try {plan = await planMicrobuy(signer.publicKey.toBase58());diff --git a/data/changelog.json b/data/changelog.jsonindex c7faea556..fd3c85326 100644--- a/data/changelog.json+++ b/data/changelog.json@@ -1,6 +1,15 @@{"$comment": "Curated changelog entries for three.ws — the editorial layer of the public changelog. New PAGE launches are tracked automatically via the `added` field in data/pages.json; this file is for everything else holders care about: improvements, fixes, SDK releases, trading/payments capabilities, security work. scripts/build-page-index.mjs merges both sources into CHANGELOG.md, public/changelog.json, and public/changelog.xml. Newest first. Allowed tags: feature, improvement, fix, sdk, infra, docs, security. `link` is optional and must be a live three.ws path.","entries": [+ {+ "date": "2026-07-17",+ "title": "A steady drip of $THREE buys, paid through the x402 loop",+ "summary": "The platform can now put continuous buy pressure on $THREE: a new lane fires many tiny, real market buys of $THREE per minute (dialable up toward ~60/min), each one triggered by and paid through the same x402 payment loop the agent economy already runs on. Every buy is a genuine on-chain purchase on Jupiter, and the bought $THREE is swept into the treasury. It's buy-only by design (it never sells), sits alongside the existing daily buyback as its high-frequency little sibling, and stays hard-bounded by a daily spend ceiling that's enforced before any money moves. It ships off by default and turns on only once an operator funds the wallet and opts in.",+ "tags": [+ "feature",+ "infra"+ ]+ },{"date": "2026-07-17","title": "Agent trades now name the coin and plot on its chart",@@ -62,7 +71,7 @@{"date": "2026-07-17","title": "IBM Granite features stay up, and no longer need an IBM account",- "summary": "Every Granite-powered feature (the Granite Oracle, Agent Twin, Galaxy cluster naming, Granite Vision image reads, and the IBM Granite brain in the model comparison) ran only on IBM watsonx, so a watsonx hiccup or a deployment without IBM credentials meant the feature failed or was hidden. They now fall over to the same Granite family hosted on OpenRouter (and a vision-capable model for image reads), so Granite keeps answering through an outage and stays selectable even where watsonx is not configured.",+ "summary": "Every text Granite feature (the IBM Granite brain in the model comparison, Granite Vision image reads, and the paid Granite chat/code/analyze tools on the IBM MCP server) ran only on IBM watsonx, so a watsonx hiccup or a deployment without IBM credentials meant the feature failed or was hidden. Granite now runs on the same model family hosted on OpenRouter: as the direct primary when watsonx is not configured, and as an automatic same-model backstop when a configured watsonx drops a request (image reads fall to a vision-capable model, since OpenRouter has no Granite-vision model). Granite embeddings and TimeSeries forecasting still require watsonx, which has no OpenRouter equivalent.","tags": ["infra","improvement"diff --git a/docs/three-microbuy.md b/docs/three-microbuy.mdnew file mode 100644index 000000000..beab94101--- /dev/null+++ b/docs/three-microbuy.md@@ -0,0 +1,110 @@+# $THREE micro-buy loop++Many tiny, real on-chain buys of `$THREE` per minute, each triggered by (and paid+through) a settled x402 payment. It exists to put continuous, verifiable buy+pressure on `$THREE` — a steady drip of small market buys that show up on-chain and+on the chart, rather than one large buy a day.++It is the high-frequency, small-ticket sibling of the [daily buyback](../api/_lib/token/buyback.js):++| | Daily buyback | Micro-buy loop |+|---|---|---|+| Cadence | a few large buys/day | many tiny buys/minute (target ~60/min) |+| Ticket | $10–$250 | ~$0.01 |+| Trigger | scheduled cron | a settled x402 call |+| Funding | buyback wallet USDC | micro-buy wallet USDC |+| Direction | **buy-only** | **buy-only** |++Both lanes buy on Jupiter through the same client ([api/_lib/token/jupiter.js](../api/_lib/token/jupiter.js))+and sweep the bought tokens to the treasury. **Neither ever sells `$THREE`.**++## How one buy works++1. The driver [api/cron/three-buy-loop.js](../api/cron/three-buy-loop.js) fires a+ paid x402 call to `/api/x402/three-buy`. The small toll+ (`X402_PRICE_THREE_BUY`, default $0.001 USDC) routes to the ring treasury+ (`X402_PAY_TO_SOLANA`) — exactly like every other ring endpoint. This is the+ "pay through the x402 loop" leg.+2. The endpoint ([api/x402/three-buy.js](../api/x402/three-buy.js)) delivers the+ paid good: it executes **one** USDC→`$THREE` market buy on Jupiter+ (`THREE_MICROBUY_USD`, default $0.01), funded by the micro-buy wallet — a+ **separate** money stream from the toll.+3. The bought `$THREE` accrues in the micro-buy wallet and is swept to the+ treasury by the loop every `THREE_MICROBUY_SWEEP_EVERY_N_TICKS` ticks.++The toll and the buy are deliberately decoupled (same custody-vs-accounting split+the daily buyback uses): the toll is internal recirculation; the buy is the real+market spend.++## Safety++Execution is **off by default**. Until `THREE_MICROBUY_ENABLED` is truthy *and* a+funded signer exists, every call is a recorded no-op and the toll is refused (the+endpoint re-emits its 402, so the caller is never charged for a buy that didn't+happen).++- **Daily ceiling.** `THREE_MICROBUY_DAILY_CAP_USD` (default $50) is the hard bound+ on real market spend and SOL fee burn. It is enforced **atomically** — the engine+ reserves the day's budget in Redis *before* broadcasting a buy, so a flood of+ concurrent calls can never collectively overshoot the cap. A DB sum over+ `three_microbuy_runs` is the fallback when Redis is down.+- **Fail-closed toll.** Because the endpoint refuses the toll whenever a buy can't+ happen (disabled, unfunded, cap reached), a direct payer can force buys only up+ to the same daily ceiling the loop obeys — there is no amplification past the cap.+- **Kill switches.** `X402_AUTONOMOUS_ENABLED=false` (global) or+ `THREE_MICROBUY_ENABLED` unset stops everything; `THREE_MICROBUY_LOOP_ENABLED=false`+ pauses only the driver while leaving the endpoint payable.+- **Not in the generic ring.** `three-buy` is `autobuy:false` in+ [ring-catalog.js](../api/_lib/x402/ring-catalog.js), so the generic ring rotation+ never fires real buys — only its dedicated driver does.++Every call writes an immutable row to `three_microbuy_runs`+([migration](../api/_lib/migrations/20260717233000_three_microbuy.sql)) — confirmed,+pending, skipped, or failed — so there is never a silent no-op.++## Turning it on++```bash+# 1. Apply the schema.+npm run db:migrate -- --apply++# 2. Fund a wallet with USDC (+ a little SOL for fees). Reuse the buyback wallet, or+# set a dedicated key so the two lanes don't compete for the same USDC:+# THREE_MICROBUY_SECRET_KEY_B64=<base64 of 64 secret-key bytes>++# 3. Set env on the Cloud Run service (gcloud run services update … --update-env-vars):+# THREE_MICROBUY_ENABLED=true+# THREE_MICROBUY_USD=0.01 # per-buy size+# THREE_MICROBUY_PER_TICK=60 # ~60 buys/min+# THREE_MICROBUY_DAILY_CAP_USD=50 # hard daily spend bound+# THREE_MICROBUY_CONCURRENCY=8 # workers/tick++# 4. The economy-tick heartbeat drives it every minute (target 'three-buy-loop').+# Verify a tick:+curl -s -H "Authorization: Bearer $CRON_SECRET" https://three.ws/api/cron/three-buy-loop | jq+```++The response reports `fired`, `paid`, `buys`, `pending`, `errors`, `toll_spent_usd`,+`daily_spent_usd`, and `daily_cap_usd` for the tick.++## Configuration++| Env | Default | Meaning |+|---|---|---|+| `THREE_MICROBUY_ENABLED` | off | Master execution gate. |+| `THREE_MICROBUY_LOOP_ENABLED` | on | Set `false` to pause only the driver. |+| `THREE_MICROBUY_SECRET_KEY_B64` | buyback wallet | Dedicated signer/funder (base64 64-byte key). |+| `THREE_MICROBUY_USD` | `0.01` | USD per single buy (hard-capped at 5). |+| `THREE_MICROBUY_DAILY_CAP_USD` | `50` | UTC-daily ceiling on real spend. |+| `THREE_MICROBUY_PER_TICK` | `10` | Buys per minute (hard-capped at 60). |+| `THREE_MICROBUY_CONCURRENCY` | `8` | Concurrent buy workers per tick (1–20). |+| `THREE_MICROBUY_SLIPPAGE_BPS` | `300` | Jupiter slippage tolerance. |+| `THREE_MICROBUY_SWEEP_EVERY_N_TICKS` | `30` | Sweep accrued `$THREE` to treasury cadence. |+| `X402_THREE_BUY_TOLL_CAP_ATOMIC` | `1000000` | Per-tick ceiling on internal tolls (USDC atomics). |+| `X402_PRICE_THREE_BUY` | `1000` | Per-call toll price (USDC atomics, $0.001). |++## Related++- [docs/x402-ring-economy.md](x402-ring-economy.md) — the closed-loop x402 ring the toll settles through.+- [api/_lib/token/buyback.js](../api/_lib/token/buyback.js) — the daily buyback lane.+- [api/_lib/token/config.js](../api/_lib/token/config.js) — `$THREE` mint, treasury, and split policy.diff --git a/public/changelog.json b/public/changelog.jsonindex 7f6a542ca..a5fd1b3ef 100644--- a/public/changelog.json+++ b/public/changelog.json@@ -1,5 +1,5 @@{- "generated_at": "2026-07-17T23:49:16.191Z",+ "generated_at": "2026-07-17T23:54:17.071Z","generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json","site": {"name": "three.ws",@@ -57,6 +57,17 @@"improvement"]},+ {+ "date": "2026-07-17",+ "type": "update",+ "title": "A steady drip of $THREE buys, paid through the x402 loop",+ "summary": "The platform can now put continuous buy pressure on $THREE: a new lane fires many tiny, real market buys of $THREE per minute (dialable up toward ~60/min), each one triggered by and paid through the same x402 payment loop the agent economy already runs on. Every buy is a genuine on-chain purchase on Jupiter, and the bought $THREE is swept into the treasury. It's buy-only by design (it never sells), sits alongside the existing daily buyback as its high-frequency little sibling, and stays hard-bounded by a daily spend ceiling that's enforced before any money moves. It ships off by default and turns on only once an operator funds the wallet and opts in.",+ "link": null,+ "tags": [+ "feature",+ "infra"+ ]+ },{"date": "2026-07-17","type": "update",@@ -325,7 +336,7 @@"date": "2026-07-17","type": "update","title": "IBM Granite features stay up, and no longer need an IBM account",- "summary": "Every Granite-powered feature (the Granite Oracle, Agent Twin, Galaxy cluster naming, Granite Vision image reads, and the IBM Granite brain in the model comparison) ran only on IBM watsonx, so a watsonx hiccup or a deployment without IBM credentials meant the feature failed or was hidden. They now fall over to the same Granite family hosted on OpenRouter (and a vision-capable model for image reads), so Granite keeps answering through an outage and stays selectable even where watsonx is not configured.",+ "summary": "Every text Granite feature (the IBM Granite brain in the model comparison, Granite Vision image reads, and the paid Granite chat/code/analyze tools on the IBM MCP server) ran only on IBM watsonx, so a watsonx hiccup or a deployment without IBM credentials meant the feature failed or was hidden. Granite now runs on the same model family hosted on OpenRouter: as the direct primary when watsonx is not configured, and as an automatic same-model backstop when a configured watsonx drops a request (image reads fall to a vision-capable model, since OpenRouter has no Granite-vision model). Granite embeddings and TimeSeries forecasting still require watsonx, which has no OpenRouter equivalent.","link": null,"tags": ["infra",diff --git a/public/changelog.xml b/public/changelog.xmlindex 6db3e6085..b45d5d30f 100644--- a/public/changelog.xml+++ b/public/changelog.xml@@ -46,6 +46,14 @@<category>feature</category><description>The studio avatar generator used to recolor one of five fixed body meshes, so a whole gallery of them read as the same handful of people in different colors. It now composes each avatar from modular parts: a hairstyle, top, bottom, footwear, and glasses mixed across the base bodies onto one shared skeleton, then recolored per part and scaled for height. This is the same one-skeleton-many-parts approach the best avatar platforms use, built in-house with no external service. Every generated avatar is fully rigged and carries facial expression blendshapes, and two of them almost never look the same. All platform-generated avatars continue to appear across the galleries.</description></item>+ <item>+ <title>A steady drip of $THREE buys, paid through the x402 loop</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-07-17:A steady drip of $THREE buys, paid through the x402 loop</guid>+ <pubDate>Fri, 17 Jul 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>The platform can now put continuous buy pressure on $THREE: a new lane fires many tiny, real market buys of $THREE per minute (dialable up toward ~60/min), each one triggered by and paid through the same x402 payment loop the agent economy already runs on. Every buy is a genuine on-chain purchase on Jupiter, and the bought $THREE is swept into the treasury. It's buy-only by design (it never sells), sits alongside the existing daily buyback as its high-frequency little sibling, and stays hard-bounded by a daily spend ceiling that's enforced before any money moves. It ships off by default and turns on only once an operator funds the wallet and opts in.</description>+ </item><item><title>Agent trades now name the coin and plot on its chart</title><link>https://three.ws/pulse</link>@@ -252,7 +260,7 @@<guid isPermaLink="false">2026-07-17:IBM Granite features stay up, and no longer need an IBM account</guid><pubDate>Fri, 17 Jul 2026 12:00:00 GMT</pubDate><category>infra</category>- <description>Every Granite-powered feature (the Granite Oracle, Agent Twin, Galaxy cluster naming, Granite Vision image reads, and the IBM Granite brain in the model comparison) ran only on IBM watsonx, so a watsonx hiccup or a deployment without IBM credentials meant the feature failed or was hidden. They now fall over to the same Granite family hosted on OpenRouter (and a vision-capable model for image reads), so Granite keeps answering through an outage and stays selectable even where watsonx is not configured.</description>+ <description>Every text Granite feature (the IBM Granite brain in the model comparison, Granite Vision image reads, and the paid Granite chat/code/analyze tools on the IBM MCP server) ran only on IBM watsonx, so a watsonx hiccup or a deployment without IBM credentials meant the feature failed or was hidden. Granite now runs on the same model family hosted on OpenRouter: as the direct primary when watsonx is not configured, and as an automatic same-model backstop when a configured watsonx drops a request (image reads fall to a vision-capable model, since OpenRouter has no Granite-vision model). Granite embeddings and TimeSeries forecasting still require watsonx, which has no OpenRouter equivalent.</description></item><item><title>Image to 3D gets its own front door</title>diff --git a/public/features.json b/public/features.jsonindex 33c37d2d2..f245257f2 100644--- a/public/features.json+++ b/public/features.json@@ -1,5 +1,5 @@{- "generated_at": "2026-07-17T23:49:16.177Z",+ "generated_at": "2026-07-17T23:54:17.056Z","generated_by": "scripts/build-page-index.mjs from data/pages.json","site": {"name": "three.ws",diff --git a/tests/x402-ring-catalog.test.js b/tests/x402-ring-catalog.test.jsindex 736b87162..d43d50dca 100644--- a/tests/x402-ring-catalog.test.js+++ b/tests/x402-ring-catalog.test.js@@ -102,6 +102,20 @@ describe('ring-catalog schema', () => {for (const e of RING_CATALOG) expect(bySlug(e.slug)).toBe(e);expect(bySlug('does-not-exist')).toBeNull();});++ // SAFETY: the $THREE micro-buy endpoint spends real USDC on a live market buy+ // every settled call. It must NEVER be swept by the generic ring rotation — only+ // its dedicated driver (api/cron/three-buy-loop.js), which enforces the daily+ // spend cap, may fire it. Flipping it to autobuy:true would unleash uncapped real+ // buys through the ring; this pins the invariant.+ it('three-buy is real-spend and excluded from the generic ring rotation', () => {+ const entry = bySlug('three-buy');+ expect(entry, 'three-buy is cataloged').toBeTruthy();+ expect(entry.autobuy, 'three-buy must be autobuy:false').toBe(false);+ expect(entry.weight, 'three-buy carries zero rotation weight').toBe(0);+ expect(rotationPlan().some((e) => e.slug === 'three-buy')).toBe(false);+ expect(autobuyEntries().some((e) => e.slug === 'three-buy')).toBe(false);+ });});// ── 100% coverage: every paidEndpoint( construction site is cataloged ─────────