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
feat: add x402 revenue page and update sitemap
qbdzc13397a03475
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex bfdd3f92e..f95c75668 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -7,6 +7,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr## 2026-06-30- **Docs · x402 Revenue & Receipts** (`/docs/x402-revenue`) — Where settled x402 payments are recorded (x402_audit_log), how to read endpoint revenue, and how signed receipts work.+- **Endpoint Revenue** (`/x402-revenue`) — The live revenue layer — real USDC flowing into three.ws's own x402 paid endpoints. Gross revenue, top-earning endpoints, and every settlement the moment it lands on-chain. The mirror of the Money Pulse: what the platform earns, not what agents spend.- **Oracle Docs — the conviction engine, end to end** (`/oracle/docs`) — The complete Oracle reference: the thesis behind fused pump.fun conviction, the four-pillar scoring model and its exact math, the data pipeline and worker loops, the calibration and backtest evidence, the agent action loop, the full API, the data model, limitations, and where it scales next — written for everyone from first-time readers to researchers.- **Viability** (`/viability`) — The honest signal behind three.ws — real marketplace and trading viability. Live $THREE skill GMV, take-rate, repeat buyers and trading pairs, plus real guarded coin-trade flow, cost and realized P&L on closed positions. Real on-chain data only.- **Agent and character pages now feel alive — the same game-feel polish, everywhere you meet a character** — The places where you meet, browse and build characters got the same motion treatment as the Swarms and AI pages, all driven by real data. On an agent's profile, its trading record now leads with a win-rate ring and a sparkline of cumulative realized P&L traced from its real recent trades, the P&L, ROI and reputation numbers count up and tint green or red as they settle, the reputation score has its own arc gauge, and recent trades stagger into view. The agent picker, avatar gallery and the /characters feed now land card-by-card as each page loads instead of snapping in. The first-meet celebration for a freshly generated avatar gets a single warm accent beat as its buttons arrive, and the character creator pulses the stage the moment a model actually finishes loading. The $THREE hold-gate sweeps its progress bar to your live holdings and counts the percentage up as it goes. Nothing is faked — every number, gauge and trend comes from a real endpoint or your real wallet balance, the 3D avatars render and animate exactly as before, and all of it collapses to a clean static state under reduced motion. (`/characters`) `[improvement]`@@ -22,6 +23,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr- **Fixed several pages returning a 404** — A handful of pages were built and shipping but had no clean-URL route, so they fell through to the not-found page: the agent wallet (/agent-wallet), the viability report (/viability), and the gallery picker. All now load correctly. The agent wallet, when opened without a specific agent, also shows a clear prompt to pick or create one. (`/viability`) `[fix]`- **Marketplace & trading viability get a dedicated page** — The two "honest signal" panels — marketplace viability (real $THREE skill GMV, take-rate, repeat buyers, trading pairs) and trading viability (real guarded coin-trade flow, cost and realized P&L on closed positions) — now live on their own page at /viability. The Money Pulse stays focused on the live event feed and links across to the full viability breakdown, so each surface does one thing well. Same real on-chain numbers, just easier to read and share. (`/viability`) `[improvement]`- **Memory seeding no longer times out** — Building your agent's memory seed from your connected accounts could fail with an opaque error when the language model took a moment to respond — the request was being cut off before it finished and the page showed a generic failure. The synthesis step now has the time it needs to complete, automatically falls over to a backup provider if one is slow, and when it genuinely can't run it tells you plainly instead of failing silently. `[fix]`+- **More real money cycling through the agent economy — autonomous x402 throughput raised** — The autonomous loop that makes three.ws an active participant in the agent-to-agent economy now drives more real volume. It processes more ready endpoints per tick (up from 8 to 12) and runs against a higher daily budget ($15, up from $5), so more genuine USDC settlements flow across the catalog each day — every one a real on-chain payment, never a simulation. Per-endpoint cooldowns and the hard daily cap are unchanged, so the extra throughput broadens activity without hammering any single service, and both limits stay tunable at any time. The GLB optimization report is now part of the rotation too, widening the set of endpoints earning real revenue. `[improvement, infra]`- **One shared motion library now powers live game-feel across the platform** — The interaction polish proven on the Swarms page — numbers that count up between real values, directional green/red flashes, live-feed rows that slide in, sparklines, ring gauges, connection dots, and a single restrained it-shipped ripple — now lives in one shared, token-driven, reduced-motion-safe library instead of being re-rolled per page. Every surface that adopts it speaks the same visual vocabulary, and because it's built entirely on the platform's motion tokens, it goes perfectly still the instant you ask your system for reduced motion. The Swarms page is its first consumer; the launch, deploy, markets and AI surfaces follow. It's a foundation, not a faked effect — every animation rides a real value. `[improvement, sdk]`- **Oracle now has full documentation** — Everything behind the conviction score, in one place. The new Oracle docs explain — in plain English and, where you want it, full mathematical detail — how Oracle reads every pump.fun launch: the four pillars (who's buying, how it's structured, what story it rides, how it's moving), exactly how they fuse into a 0–100 score, where the hard caps come from, how the engine is calibrated and backtested against real outcomes, how to arm an agent on it, the full public API, and where it's headed. Real screenshots throughout, a quickstart for traders, builders, and skeptics, and a researcher-level appendix. (`/oracle/docs`) `[docs, feature]`- **Reward coins can now send creator fees to a single GitHub account, not just a repo** — The Fees & rewards panel already let you split a coin's creator fees across a GitHub repo's contributors. Now you can also route rewards to one specific person: type a GitHub @username and it resolves to their three.ws-linked Solana payout wallet, added as a recipient you can give 100% (or any share) of the fees. This is the same mechanism behind $THREE, whose creator rewards flow to @nirholas even though someone else launched the coin. A 'Split contributors / Owner-creator only' toggle lets a repo route 100% to its owner instead of fanning out across contributors — and not setting up a split at all keeps every fee with the coin creator to claim directly. A handle with no linked wallet is flagged so you can paste their address or ask them to link one. `[feature]`diff --git a/api/x402-revenue.js b/api/x402-revenue.jsindex 9114696bb..c71cbb4bc 100644--- a/api/x402-revenue.js+++ b/api/x402-revenue.js@@ -109,9 +109,15 @@ async function handleFeed({ since, cursor, limit }) {// Cursor for the next (older) page: the timestamp of the last row.const last = rows[rows.length - 1];const nextCursor = last- ? (last.created_at instanceof Date ? last.created_at.toISOString() : last.created_at)+ ? last.created_at instanceof Date+ ? last.created_at.toISOString()+ : last.created_at: null;- return { events, count: events.length, next_cursor: events.length === limit ? nextCursor : null };+ return {+ events,+ count: events.length,+ next_cursor: events.length === limit ? nextCursor : null,+ };}export default async function handler(req, res) {diff --git a/api/x402/README.md b/api/x402/README.mdindex 3f42874a1..c8c93b4ca 100644--- a/api/x402/README.md+++ b/api/x402/README.md@@ -27,16 +27,20 @@ import { priceFor } from '../_lib/x402-prices.js';const ROUTE = '/api/x402/my-service';export default paidEndpoint({- route: ROUTE,- // Default price in USDC atomics (6 decimals); env-overridable — see below.- priceAtomics: priceFor('my-service', '10000'), // $0.01- description: 'One line an agent reads to decide whether to buy.',- networks: ['solana', 'base'], // accepted networks, in challenge order- schema: { /* JSON Schema for input + output, drives Bazaar discovery */ },- // Throw BEFORE doing paid work if inputs are bad — the buyer keeps their money.- async handler({ req }) {- return { /* the JSON result the buyer paid for */ };- },+ route: ROUTE,+ // Default price in USDC atomics (6 decimals); env-overridable — see below.+ priceAtomics: priceFor('my-service', '10000'), // $0.01+ description: 'One line an agent reads to decide whether to buy.',+ networks: ['solana', 'base'], // accepted networks, in challenge order+ schema: {+ /* JSON Schema for input + output, drives Bazaar discovery */+ },+ // Throw BEFORE doing paid work if inputs are bad — the buyer keeps their money.+ async handler({ req }) {+ return {+ /* the JSON result the buyer paid for */+ };+ },});```diff --git a/data/pages.json b/data/pages.jsonindex 71a1d9ce8..f81f57a18 100644--- a/data/pages.json+++ b/data/pages.json@@ -739,6 +739,14 @@"changefreq": "always","added": "2026-06-23"},+ {+ "path": "/x402-revenue",+ "title": "Endpoint Revenue",+ "description": "The live revenue layer — real USDC flowing into three.ws's own x402 paid endpoints. Gross revenue, top-earning endpoints, and every settlement the moment it lands on-chain. The mirror of the Money Pulse: what the platform earns, not what agents spend.",+ "priority": 0.7,+ "changefreq": "always",+ "added": "2026-06-30"+ },{"path": "/viability","title": "Viability",diff --git a/docs/x402-endpoints.md b/docs/x402-endpoints.mdindex 82dc4bf13..6e81c164b 100644--- a/docs/x402-endpoints.md+++ b/docs/x402-endpoints.md@@ -36,12 +36,12 @@ Endpoints advertise the networks they accept in the 402 challenge. The platformsettles **USDC on Solana** (primary) and **USDC on Base** (EVM), via theconfigured facilitators. The relevant config (see [Configuration](configuration.md)):-| Key | Meaning |-|---|---|-| `X402_PAY_TO_SOLANA` / `X402_PAY_TO_BASE` | Receiving address per network. |-| `X402_ASSET_MINT_SOLANA` / `X402_ASSET_ADDRESS_BASE` | USDC mint / contract. |-| `X402_FACILITATOR_URL_SOLANA` / `_BASE` | Facilitator that verifies + settles. |-| `X402_RECEIPT_SIGNING_KEY`, `OFFER_RECEIPT_*` | Signed receipt issuance. |+| Key | Meaning |+| ---------------------------------------------------- | ------------------------------------ |+| `X402_PAY_TO_SOLANA` / `X402_PAY_TO_BASE` | Receiving address per network. |+| `X402_ASSET_MINT_SOLANA` / `X402_ASSET_ADDRESS_BASE` | USDC mint / contract. |+| `X402_FACILITATOR_URL_SOLANA` / `_BASE` | Facilitator that verifies + settles. |+| `X402_RECEIPT_SIGNING_KEY`, `OFFER_RECEIPT_*` | Signed receipt issuance. |The shared handler in `x402-paid-endpoint.js` builds the challenge(`buildRequirements()`), verifies the submitted payment, settles it, runs the@@ -52,58 +52,58 @@ endpoint logic, and issues a signed receipt.These return market/polling information and are the ones the autonomous loop paysfor to feed the oracle and sniper.-| Endpoint | Default | Returns |-|---|---|---|-| `/api/x402/token-intel` | $0.01 | Live market intel for any token (price, 24h change, market cap, liquidity, volume, signal). |-| `/api/x402/crypto-intel` | $0.01 | Agent-readable crypto market signal (bullish/bearish/neutral) + rationale. |-| `/api/x402/three-intel` | $0.01 | Intel focused on $THREE. |-| `/api/x402/fact-check` | per source | Claim fact-check with cited evidence. |-| `/api/x402/symbol-availability` | $0.001 | Whether a ticker symbol is taken; `-batch` variant $0.005. |-| `/api/x402/bazaar-feed` | $0.001 | x402 bazaar service listings feed. |+| Endpoint | Default | Returns |+| ------------------------------- | ---------- | ------------------------------------------------------------------------------------------- |+| `/api/x402/token-intel` | $0.01 | Live market intel for any token (price, 24h change, market cap, liquidity, volume, signal). |+| `/api/x402/crypto-intel` | $0.01 | Agent-readable crypto market signal (bullish/bearish/neutral) + rationale. |+| `/api/x402/three-intel` | $0.01 | Intel focused on $THREE. |+| `/api/x402/fact-check` | per source | Claim fact-check with cited evidence. |+| `/api/x402/symbol-availability` | $0.001 | Whether a ticker symbol is taken; `-batch` variant $0.005. |+| `/api/x402/bazaar-feed` | $0.001 | x402 bazaar service listings feed. |## Agent & reputation endpoints-| Endpoint | Default | Returns |-|---|---|---|-| `/api/x402/agent-reputation` | $0.01 | On-chain agent reputation summary. |-| `/api/x402/agent-bouncer` | $0.01 | Access-gate decision for an agent/wallet. |-| `/api/x402/onchain-identity-verify` | $0.005 | Verifies an on-chain identity claim. |-| `/api/x402/skill-marketplace` | $0.001 | Skill listings + pricing. |-| `/api/x402/skill-call` | per skill | Invoke a listed agent skill. |-| `/api/x402/pump-agent-audit` | $0.02 | Audit of a pump agent's behavior/holdings. |+| Endpoint | Default | Returns |+| ----------------------------------- | --------- | ------------------------------------------ |+| `/api/x402/agent-reputation` | $0.01 | On-chain agent reputation summary. |+| `/api/x402/agent-bouncer` | $0.01 | Access-gate decision for an agent/wallet. |+| `/api/x402/onchain-identity-verify` | $0.005 | Verifies an on-chain identity claim. |+| `/api/x402/skill-marketplace` | $0.001 | Skill listings + pricing. |+| `/api/x402/skill-call` | per skill | Invoke a listed agent skill. |+| `/api/x402/pump-agent-audit` | $0.02 | Audit of a pump agent's behavior/holdings. |## Generation & 3D endpoints-| Endpoint | Default | Returns |-|---|---|---|-| `/api/x402/forge` | tiered | Text/image → 3D model (price by tier; GPU-bound). See [Avatar pipeline](avatar-pipeline.md). |-| `/api/x402/mint-to-mesh`, `/api/x402/mint-to-mesh-batch` | per call | Token/mint → 3D mesh; `mint-to-mesh-batch` runs a set at $0.05. |-| `/api/x402/model-check`, `/api/x402/model-validation-sweep` | $0.001 | Validate a GLB / sweep a batch. |-| `/api/x402/glb-optimization-report` | per call | GLB size/optimization analysis. |-| `/api/x402/avatar-optimize-batch` | $0.001 | Batch optimization pass over the top N avatars. |-| `/api/x402/animation-download`, `/api/x402/asset-download` | per asset | Paid asset/animation delivery. |+| Endpoint | Default | Returns |+| ----------------------------------------------------------- | --------- | -------------------------------------------------------------------------------------------- |+| `/api/x402/forge` | tiered | Text/image → 3D model (price by tier; GPU-bound). See [Avatar pipeline](avatar-pipeline.md). |+| `/api/x402/mint-to-mesh`, `/api/x402/mint-to-mesh-batch` | per call | Token/mint → 3D mesh; `mint-to-mesh-batch` runs a set at $0.05. |+| `/api/x402/model-check`, `/api/x402/model-validation-sweep` | $0.001 | Validate a GLB / sweep a batch. |+| `/api/x402/glb-optimization-report` | per call | GLB size/optimization analysis. |+| `/api/x402/avatar-optimize-batch` | $0.001 | Batch optimization pass over the top N avatars. |+| `/api/x402/animation-download`, `/api/x402/asset-download` | per asset | Paid asset/animation delivery. |## Launch, naming & utility endpoints-| Endpoint | Default | Returns |-|---|---|---|-| `/api/x402/pump-launch` | $5.00 | Launch monitoring / a managed launch. |-| `/api/x402/vanity`, `/api/x402/vanity-verifiable` | per grind | Solana vanity address mining (verifiable variant returns proof). |-| `/api/x402/pay-by-name` | per call | Resolve and pay an SNS/ENS name (see [Agent wallets](agent-wallets.md)). |-| `/api/x402/did` | per call | Decentralized identifier resolution. |-| `/api/x402/billboard` | $0.05 | Post to the on-platform billboard. |-| `/api/x402/dance-tip` | $0.001 | Tip a club performer. |-| `/api/x402/club-cover` | $0.01 | Pole-club door cover charge; a paid wallet re-enters free for the pass window. |-| `/api/x402/cosmetic-purchase` | per item | Buy a cosmetic. |-| `/api/x402/tutor` | $0.01 / answer | Paid tutoring; a session accumulates a running tab across answers. |-| `/api/x402/spend-session` | $0.01 | Open a metered spend session. |-| `/api/x402/llm-proxy` | per call | Paid LLM proxy. |-| `/api/x402/notify` | $0.001 | Notification gateway (Telegram + the autonomous loop's `canary` heartbeat lane). |-| `/api/x402/wallet-connect` | $0.001 | Wallet-bridge connect probe. |-| `/api/x402/permit2-paid-demo` | $0.001 | Reference endpoint for the Permit2 / EIP-2612 gasless-approval scheme. |-| `/api/x402/cross-chain`, `/api/x402/network-cost` | per call | Cross-chain cost comparison. |-| `/api/x402/rate-limit-probe`, `/api/x402/schema-check` | $0.001 | Paid diagnostic probes used by the autonomous loop. |-| `/api/x402/auth-health`, `/api/x402/api-key-health`, `/api/x402/feed-health`, `/api/x402/granite-health`, `/api/x402/telegram-health`, `/api/x402/solana-register-health` | $0.001 | Paid SLA/health probes for each backend dependency (auth, API keys, the live feed, IBM Granite, Telegram, Solana register). |+| Endpoint | Default | Returns |+| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------- | --------------------------------------------------------------------------------------------------------------------------- |+| `/api/x402/pump-launch` | $5.00 | Launch monitoring / a managed launch. |+| `/api/x402/vanity`, `/api/x402/vanity-verifiable` | per grind | Solana vanity address mining (verifiable variant returns proof). |+| `/api/x402/pay-by-name` | per call | Resolve and pay an SNS/ENS name (see [Agent wallets](agent-wallets.md)). |+| `/api/x402/did` | per call | Decentralized identifier resolution. |+| `/api/x402/billboard` | $0.05 | Post to the on-platform billboard. |+| `/api/x402/dance-tip` | $0.001 | Tip a club performer. |+| `/api/x402/club-cover` | $0.01 | Pole-club door cover charge; a paid wallet re-enters free for the pass window. |+| `/api/x402/cosmetic-purchase` | per item | Buy a cosmetic. |+| `/api/x402/tutor` | $0.01 / answer | Paid tutoring; a session accumulates a running tab across answers. |+| `/api/x402/spend-session` | $0.01 | Open a metered spend session. |+| `/api/x402/llm-proxy` | per call | Paid LLM proxy. |+| `/api/x402/notify` | $0.001 | Notification gateway (Telegram + the autonomous loop's `canary` heartbeat lane). |+| `/api/x402/wallet-connect` | $0.001 | Wallet-bridge connect probe. |+| `/api/x402/permit2-paid-demo` | $0.001 | Reference endpoint for the Permit2 / EIP-2612 gasless-approval scheme. |+| `/api/x402/cross-chain`, `/api/x402/network-cost` | per call | Cross-chain cost comparison. |+| `/api/x402/rate-limit-probe`, `/api/x402/schema-check` | $0.001 | Paid diagnostic probes used by the autonomous loop. |+| `/api/x402/auth-health`, `/api/x402/api-key-health`, `/api/x402/feed-health`, `/api/x402/granite-health`, `/api/x402/telegram-health`, `/api/x402/solana-register-health` | $0.001 | Paid SLA/health probes for each backend dependency (auth, API keys, the live feed, IBM Granite, Telegram, Solana register). |> Prices above marked "per call / per tier / per source" are computed by the> handler rather than a flat default; check the handler and any@@ -121,14 +121,14 @@ charge a token fee (they are real, sellable observability products an agent canconsume); a few are **free** read surfaces that happen to live in the samedirectory.-| Endpoint | Default | Returns |-|---|---|---|-| `/api/x402/analytics` | $0.005 | Platform reports — pick `report=revenue` for the x402 endpoint-revenue summary (see [x402 revenue & receipts](x402-revenue.md)), plus club and listing analytics. |-| `/api/x402/mcp-tool-catalog` | per call | Snapshot of every MCP tool — name, paid/free, price, input shape — and a diff vs the last snapshot (added / removed / re-priced tools). |-| **Free read surfaces** | — | — |-| `/api/x402/my-receipts` | free | A buyer's own settled receipts, gated by a wallet signature (SIWX) rather than a payment. |-| `/api/x402/mcp-perf` | free | MCP tool latency dashboard data. |-| `/api/x402/service-pricing-report` | free | Tracked upstream-dependency price catalog + active price-increase/-drop alerts. |+| Endpoint | Default | Returns |+| ---------------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |+| `/api/x402/analytics` | $0.005 | Platform reports — pick `report=revenue` for the x402 endpoint-revenue summary (see [x402 revenue & receipts](x402-revenue.md)), plus club and listing analytics. |+| `/api/x402/mcp-tool-catalog` | per call | Snapshot of every MCP tool — name, paid/free, price, input shape — and a diff vs the last snapshot (added / removed / re-priced tools). |+| **Free read surfaces** | — | — |+| `/api/x402/my-receipts` | free | A buyer's own settled receipts, gated by a wallet signature (SIWX) rather than a payment. |+| `/api/x402/mcp-perf` | free | MCP tool latency dashboard data. |+| `/api/x402/service-pricing-report` | free | Tracked upstream-dependency price catalog + active price-increase/-drop alerts. |## $THREE onlydiff --git a/docs/x402-revenue.md b/docs/x402-revenue.mdindex 31b7742d6..c3667a3ce 100644--- a/docs/x402-revenue.md+++ b/docs/x402-revenue.md@@ -18,10 +18,10 @@ the buyer.three.ws records value moving in **two opposite directions**, in two differenttables. They never overlap, and mixing them up will double-count your numbers.-| Direction | Meaning | Table | Surfaced by |-|---|---|---|---|-| **Revenue IN** | Money paid **to** our endpoints for using them | `x402_audit_log` | `/api/x402/analytics?report=revenue` (this page) |-| **Spend OUT** | Money an agent's wallet **paid out** (tips, trades, agent-to-agent x402) | `agent_custody_events` | The [Money Pulse](money-feed.md) at `/api/pulse` |+| Direction | Meaning | Table | Surfaced by |+| -------------- | ------------------------------------------------------------------------ | ---------------------- | ------------------------------------------------ |+| **Revenue IN** | Money paid **to** our endpoints for using them | `x402_audit_log` | `/api/x402/analytics?report=revenue` (this page) |+| **Spend OUT** | Money an agent's wallet **paid out** (tips, trades, agent-to-agent x402) | `agent_custody_events` | The [Money Pulse](money-feed.md) at `/api/pulse` |The [Money Pulse](money-feed.md) shows the agent economy — one agent payinganother, tips, launches. **This page is the other side of the ledger:** the@@ -29,6 +29,16 @@ platform's own endpoint revenue. A call to `/api/x402/token-intel` writes a**revenue** row in `x402_audit_log`; it is not an `agent_custody_events` spend anddoes not appear in the Money Pulse.+### Live view — `/x402-revenue`++There is a public, live dashboard of this ledger at+[`/x402-revenue`](https://three.ws/x402-revenue): gross revenue, the top-earning+endpoints, the settlement success rate, and a real-time feed of each settlement+(endpoint, amount, network, payer, explorer link) the moment it lands. It is the+revenue mirror of the [Money Pulse](https://three.ws/pulse) and reads the public,+unauthenticated `GET /api/x402-revenue` (operational fields like IP and user agent+are never exposed — only the on-chain-public route, amount, payer, and tx).+---## The settlement flow@@ -136,31 +146,31 @@ The `revenue` report shape```json{- "report": "revenue",- "period": "24h",- "since": "2026-06-29T00:00:00.000Z",- "generated_at": "2026-06-30T00:00:00.000Z",- "totals": {- "gross_usd": 12.34,- "net_platform_usd": 11.90,- "settlement_fee_usd": 0.44,- "total_payments": 247,- "failed_payments": 3,- "unique_payers": 18,- "avg_payment_usd": 0.05- },- "fee_splits": {- "gross_usd": 12.34,- "settlement_fee_usd": 0.44,- "net_platform_usd": 11.90,- "effective_fee_rate": 0.0357,- "fee_per_settlement_usd": 0.0018,- "fee_source": "..."- },- "by_endpoint": [- { "endpoint": "/api/x402/token-intel", "count": 120, "gross_usd": 1.20, "share": 0.097 }- ],- "top_endpoint": { "endpoint": "/api/x402/token-intel", "gross_usd": 1.20 }+ "report": "revenue",+ "period": "24h",+ "since": "2026-06-29T00:00:00.000Z",+ "generated_at": "2026-06-30T00:00:00.000Z",+ "totals": {+ "gross_usd": 12.34,+ "net_platform_usd": 11.9,+ "settlement_fee_usd": 0.44,+ "total_payments": 247,+ "failed_payments": 3,+ "unique_payers": 18,+ "avg_payment_usd": 0.05+ },+ "fee_splits": {+ "gross_usd": 12.34,+ "settlement_fee_usd": 0.44,+ "net_platform_usd": 11.9,+ "effective_fee_rate": 0.0357,+ "fee_per_settlement_usd": 0.0018,+ "fee_source": "..."+ },+ "by_endpoint": [+ { "endpoint": "/api/x402/token-intel", "count": 120, "gross_usd": 1.2, "share": 0.097 }+ ],+ "top_endpoint": { "endpoint": "/api/x402/token-intel", "gross_usd": 1.2 }}```@@ -247,7 +257,7 @@ cursor and ledger pick it up automatically.> **Synthetic vs organic — do not conflate them.** The Volume Bootstrap Loop pays> our **own** endpoints from our **own** seed wallet, and those endpoints settle> to the platform's own `X402_PAY_TO_*` treasury. Every transaction is real and-> on-chain — but the *demand* is synthetic: it is the platform paying itself, a+> on-chain — but the _demand_ is synthetic: it is the platform paying itself, a> liveness canary, not external buyers. It is legitimate as **synthetic> monitoring** (proving every paid endpoint is live) and is bounded small by> design (see the budget knobs in [Autonomous x402 loop](autonomous-x402.md)).diff --git a/pages/x402-revenue.html b/pages/x402-revenue.htmlnew file mode 100644index 000000000..de580609a--- /dev/null+++ b/pages/x402-revenue.html@@ -0,0 +1,211 @@+<!doctype html>+<html lang="en">+ <head>+ <script>+ /* three.ws theme boot — no-flash; runtime in /theme-switcher.js */ (function () {+ try {+ var m = localStorage.getItem('twx_theme');+ var l =+ m === 'auto'+ ? window.matchMedia &&+ window.matchMedia('(prefers-color-scheme: light)').matches+ : m === 'light';+ document.documentElement.setAttribute('data-theme', l ? 'light' : 'dark');+ } catch (e) {+ document.documentElement.setAttribute('data-theme', 'dark');+ }+ })();+ </script>+ <meta charset="utf-8" />+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />+ <title>Endpoint Revenue · three.ws</title>+ <meta+ name="description"+ content="The live revenue layer — real-time USDC flowing into three.ws's own x402 paid endpoints. Every settlement is a real, explorer-verifiable on-chain payment."+ />+ <meta property="og:type" content="website" />+ <meta property="og:site_name" content="three.ws" />+ <meta property="og:url" content="https://three.ws/x402-revenue" />+ <meta property="og:title" content="Endpoint Revenue · three.ws" />+ <meta+ property="og:description"+ content="A live stream of real USDC paid into three.ws's x402 endpoints — gross revenue, top-earning endpoints, and every settlement the moment it lands on-chain."+ />+ <meta+ property="og:image"+ content="https://three.ws/api/page-og?s=crypto&t=Endpoint+Revenue&d=The+live+revenue+layer+%E2%80%94+real+USDC+flowing+into+three.ws+x402+endpoints.+Every+settlement+is+a+real%2C+explorer-verifiable+on-chain+payment.&p=%2Fx402-revenue"+ />+ <meta property="og:image:width" content="1200" />+ <meta property="og:image:height" content="630" />+ <meta name="twitter:card" content="summary_large_image" />+ <meta name="twitter:site" content="@trythreews" />+ <meta name="twitter:title" content="Endpoint Revenue · three.ws" />+ <meta+ name="twitter:description"+ content="A live stream of real USDC paid into three.ws's x402 endpoints — the moment each settlement lands on-chain."+ />+ <meta+ name="twitter:image"+ content="https://three.ws/api/page-og?s=crypto&t=Endpoint+Revenue&d=The+live+revenue+layer+%E2%80%94+real+USDC+flowing+into+three.ws+x402+endpoints.&p=%2Fx402-revenue"+ />+ <meta name="theme-color" content="#0a0a0a" />+ <link rel="icon" href="/favicon.ico" sizes="any" />+ <link rel="icon" type="image/svg+xml" href="/favicon.svg" />+ <link rel="apple-touch-icon" href="/apple-touch-icon.png" />+ <link rel="manifest" href="/site.webmanifest" />+ <link rel="stylesheet" href="/fonts/fonts.css" />+ <link rel="stylesheet" href="/nav.css" />+ <link rel="stylesheet" href="/src/ui-juice.css" />+ <link rel="stylesheet" href="/src/x402-revenue.css" />+ <link rel="stylesheet" href="/footer.css" />+ <script defer src="/footer-newsletter.js"></script>+ <link rel="canonical" href="https://three.ws/x402-revenue" />+ <script type="application/ld+json">+ {+ "@context": "https://schema.org",+ "@type": "WebPage",+ "name": "Endpoint Revenue",+ "description": "A live stream of real USDC paid into three.ws's x402 paid endpoints — gross revenue, top-earning endpoints, and every settlement the moment it lands on-chain.",+ "url": "https://three.ws/x402-revenue",+ "isPartOf": { "@type": "WebSite", "name": "three.ws", "url": "https://three.ws" }+ }+ </script>+ <meta name="robots" content="index, follow, max-image-preview:large, max-snippet:-1" />+ <meta property="og:locale" content="en_US" />+ <meta property="og:image:alt" content="Endpoint Revenue — three.ws" />+ </head>+ <body>+ <header><div id="nav-container"></div></header>+ <script src="/nav.js"></script>++ <main class="xr-shell">+ <section class="xr-hero">+ <p class="xr-kicker">+ <span class="xr-live-dot" aria-hidden="true"></span> Live revenue layer+ </p>+ <h1 class="xr-title">Endpoint <em>Revenue</em></h1>+ <p class="xr-sub">+ Real USDC flowing <strong>into</strong> three.ws's own x402 paid endpoints — the+ moment each settlement lands on-chain. This is the mirror of the+ <a href="/pulse">Money Pulse</a>: that feed shows what agents <em>spend</em>;+ this shows what the platform <em>earns</em>. Every row is a real,+ explorer-verifiable payment.+ </p>+ <div class="xr-hero-row">+ <div class="xr-period" role="tablist" aria-label="Time window">+ <button+ type="button"+ class="xr-period-btn active"+ data-period="24h"+ role="tab"+ aria-selected="true"+ >+ 24h+ </button>+ <button+ type="button"+ class="xr-period-btn"+ data-period="7d"+ role="tab"+ aria-selected="false"+ >+ 7d+ </button>+ <button+ type="button"+ class="xr-period-btn"+ data-period="30d"+ role="tab"+ aria-selected="false"+ >+ 30d+ </button>+ <button+ type="button"+ class="xr-period-btn"+ data-period="all"+ role="tab"+ aria-selected="false"+ >+ All+ </button>+ </div>+ <span class="xr-updated" id="xr-updated" aria-live="polite"></span>+ </div>+ </section>++ <dl class="xr-counters" id="xr-counters">+ <div class="xr-counter xr-counter--lead">+ <dt>Gross revenue</dt>+ <dd id="xr-c-gross">—</dd>+ <span class="xr-counter-sub" id="xr-c-gross-sub">settled USDC</span>+ </div>+ <div class="xr-counter">+ <dt>Settlements</dt>+ <dd id="xr-c-count">—</dd>+ <span class="xr-counter-sub">paid calls</span>+ </div>+ <div class="xr-counter">+ <dt>Unique payers</dt>+ <dd id="xr-c-payers">—</dd>+ <span class="xr-counter-sub">distinct wallets</span>+ </div>+ <div class="xr-counter">+ <dt>Net to platform</dt>+ <dd id="xr-c-net">—</dd>+ <span class="xr-counter-sub">after settlement fees</span>+ </div>+ <div class="xr-counter">+ <dt>Success rate</dt>+ <dd id="xr-c-success">—</dd>+ <span class="xr-counter-sub" id="xr-c-success-sub">settled vs failed</span>+ </div>+ </dl>++ <div class="xr-grid">+ <div class="xr-main">+ <div class="xr-feed-header">+ <h2 class="xr-section-h">Live settlements</h2>+ <span class="xr-feed-state" id="xr-feed-state" data-state="loading"+ >connecting…</span+ >+ </div>+ <div+ id="xr-feed"+ class="xr-feed"+ aria-live="polite"+ aria-label="Live x402 endpoint settlements"+ ></div>+ </div>+ <aside class="xr-rail" aria-label="Revenue intelligence">+ <section class="xr-card">+ <div class="xr-card-h">+ Top earning endpoints <small id="xr-top-window">24h</small>+ </div>+ <div id="xr-top"><p class="xr-empty">Loading…</p></div>+ </section>+ <section class="xr-card xr-card--quiet">+ <div class="xr-card-h">How this works</div>+ <p class="xr-note">+ Each paid endpoint settles a small USDC payment per call. Every+ settlement is recorded in the revenue ledger and surfaced here — never a+ simulation. See+ <a href="/docs/x402-revenue">x402 revenue & receipts</a> and the+ <a href="/docs/x402-endpoints">endpoint catalog</a>.+ </p>+ </section>+ <p class="xr-fineprint">+ Operational fields (IP, user agent) are never exposed — only the+ on-chain-public route, amount, payer, and transaction. Amounts shown in+ USDC.+ </p>+ </aside>+ </div>+ </main>++ <script type="module" src="/src/x402-revenue.js"></script>+ <script src="/brand.js" defer></script>+ <div id="footer-container"></div>+ <script src="/footer.js"></script>+ </body>+</html>diff --git a/public/changelog.json b/public/changelog.jsonindex 4bb95100c..035dd91de 100644--- a/public/changelog.json+++ b/public/changelog.json@@ -1,5 +1,5 @@{- "generated_at": "2026-06-30T23:12:30.318Z",+ "generated_at": "2026-06-30T23:27:47.484Z","generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json","site": {"name": "three.ws",@@ -16,6 +16,16 @@"launch"]},+ {+ "date": "2026-06-30",+ "type": "launch",+ "title": "Endpoint Revenue",+ "summary": "The live revenue layer — real USDC flowing into three.ws's own x402 paid endpoints. Gross revenue, top-earning endpoints, and every settlement the moment it lands on-chain. The mirror of the Money Pulse: what the platform earns, not what agents spend.",+ "link": "/x402-revenue",+ "tags": [+ "launch"+ ]+ },{"date": "2026-06-30","type": "launch",@@ -169,6 +179,17 @@"fix"]},+ {+ "date": "2026-06-30",+ "type": "update",+ "title": "More real money cycling through the agent economy — autonomous x402 throughput raised",+ "summary": "The autonomous loop that makes three.ws an active participant in the agent-to-agent economy now drives more real volume. It processes more ready endpoints per tick (up from 8 to 12) and runs against a higher daily budget ($15, up from $5), so more genuine USDC settlements flow across the catalog each day — every one a real on-chain payment, never a simulation. Per-endpoint cooldowns and the hard daily cap are unchanged, so the extra throughput broadens activity without hammering any single service, and both limits stay tunable at any time. The GLB optimization report is now part of the rotation too, widening the set of endpoints earning real revenue.",+ "link": null,+ "tags": [+ "improvement",+ "infra"+ ]+ },{"date": "2026-06-30","type": "update",diff --git a/public/changelog.xml b/public/changelog.xmlindex 634617db5..8f05ed2a6 100644--- a/public/changelog.xml+++ b/public/changelog.xml@@ -14,6 +14,14 @@<category>launch</category><description>Where settled x402 payments are recorded (x402_audit_log), how to read endpoint revenue, and how signed receipts work.</description></item>+ <item>+ <title>Endpoint Revenue</title>+ <link>https://three.ws/x402-revenue</link>+ <guid isPermaLink="false">2026-06-30:Endpoint Revenue</guid>+ <pubDate>Tue, 30 Jun 2026 12:00:00 GMT</pubDate>+ <category>launch</category>+ <description>The live revenue layer — real USDC flowing into three.ws's own x402 paid endpoints. Gross revenue, top-earning endpoints, and every settlement the moment it lands on-chain. The mirror of the Money Pulse: what the platform earns, not what agents spend.</description>+ </item><item><title>Oracle Docs — the conviction engine, end to end</title><link>https://three.ws/oracle/docs</link>@@ -134,6 +142,14 @@<category>fix</category><description>Building your agent's memory seed from your connected accounts could fail with an opaque error when the language model took a moment to respond — the request was being cut off before it finished and the page showed a generic failure. The synthesis step now has the time it needs to complete, automatically falls over to a backup provider if one is slow, and when it genuinely can't run it tells you plainly instead of failing silently.</description></item>+ <item>+ <title>More real money cycling through the agent economy — autonomous x402 throughput raised</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-06-30:More real money cycling through the agent economy — autonomous x402 throughput raised</guid>+ <pubDate>Tue, 30 Jun 2026 12:00:00 GMT</pubDate>+ <category>improvement</category>+ <description>The autonomous loop that makes three.ws an active participant in the agent-to-agent economy now drives more real volume. It processes more ready endpoints per tick (up from 8 to 12) and runs against a higher daily budget ($15, up from $5), so more genuine USDC settlements flow across the catalog each day — every one a real on-chain payment, never a simulation. Per-endpoint cooldowns and the hard daily cap are unchanged, so the extra throughput broadens activity without hammering any single service, and both limits stay tunable at any time. The GLB optimization report is now part of the rotation too, widening the set of endpoints earning real revenue.</description>+ </item><item><title>One shared motion library now powers live game-feel across the platform</title><link>https://three.ws/changelog</link>diff --git a/public/features.json b/public/features.jsonindex 67ac1be67..9236f678f 100644--- a/public/features.json+++ b/public/features.json@@ -1,5 +1,5 @@{- "generated_at": "2026-06-30T23:12:30.029Z",+ "generated_at": "2026-06-30T23:27:47.464Z","generated_by": "scripts/build-page-index.mjs from data/pages.json","site": {"name": "three.ws",@@ -906,6 +906,16 @@"tags": [],"showcase": false},+ {+ "path": "/x402-revenue",+ "title": "Endpoint Revenue",+ "description": "The live revenue layer — real USDC flowing into three.ws's own x402 paid endpoints. Gross revenue, top-earning endpoints, and every settlement the moment it lands on-chain. The mirror of the Money Pulse: what the platform earns, not what agents spend.",+ "added": "2026-06-30",+ "auth": null,+ "indexable": true,+ "tags": [],+ "showcase": false+ },{"path": "/viability","title": "Viability",diff --git a/public/llms-full.txt b/public/llms-full.txtindex 9294dafe5..1c692b888 100644--- a/public/llms-full.txt+++ b/public/llms-full.txt@@ -552,6 +552,12 @@ URL: https://three.ws/pulseThe Money Pulse — a real-time, platform-wide feed of three.ws agent wallet activity: tips landing, coins launching, agents trading and paying each other. Every beat is a real on-chain event.+### Endpoint Revenue++URL: https://three.ws/x402-revenue++The live revenue layer — real USDC flowing into three.ws's own x402 paid endpoints. Gross revenue, top-earning endpoints, and every settlement the moment it lands on-chain. The mirror of the Money Pulse: what the platform earns, not what agents spend.+### ViabilityURL: https://three.ws/viabilitydiff --git a/public/llms.txt b/public/llms.txtindex f7f650e6d..dfd5a0f7e 100644--- a/public/llms.txt+++ b/public/llms.txt@@ -110,6 +110,7 @@ On-chain features: pay-per-call, token launches, vanity wallets.- [Agent Launches](https://three.ws/launches): Live public feed of every coin launched by a three.ws agent — market caps, graduation status, and the agent behind each launch.- [Live Trading Theater](https://three.ws/theater): Watch agents trade in 3D, in real time. Every trader is a 3D character with a wallet and a verifiable on-chain reputation — when a real on-chain buy fills, its avatar performs on a shared stage and a real receipt rises with an explorer link. Click any avatar for its read-only wallet and reputation; watch, follow, or fork it.- [Money Pulse](https://three.ws/pulse): The Money Pulse — a real-time, platform-wide feed of three.ws agent wallet activity: tips landing, coins launching, agents trading and paying each other. Every beat is a real on-chain event.+- [Endpoint Revenue](https://three.ws/x402-revenue): The live revenue layer — real USDC flowing into three.ws's own x402 paid endpoints. Gross revenue, top-earning endpoints, and every settlement the moment it lands on-chain. The mirror of the Money Pulse: what the platform earns, not what agents spend.- [Viability](https://three.ws/viability): The honest signal behind three.ws — real marketplace and trading viability. Live $THREE skill GMV, take-rate, repeat buyers and trading pairs, plus real guarded coin-trade flow, cost and realized P&L on closed positions. Real on-chain data only.- [On-chain Deployments](https://three.ws/deployments): A live, cross-chain feed of every agent registered on the ERC-8004 Identity Registry — the moment each registration lands on-chain. Real on-chain registrations only, with chain footprint, 3D-avatar and x402 capability stats.- [Memetic Launcher](https://three.ws/launcher): Design your personal autonomous coin launcher — set your mode (trend, meme, hybrid, random), pick trend sources, tune your cadence, and preview exactly what your agents would mint next. Preview mode: no SOL moves until you fund a live launch.diff --git a/public/sitemap/index.html b/public/sitemap/index.htmlindex cee7527db..18af2cddf 100644--- a/public/sitemap/index.html+++ b/public/sitemap/index.html@@ -65,7 +65,7 @@<main class="sm-wrap"><div class="sm-hero"><h1>Sitemap</h1>- <p>All 361 pages on three.ws, grouped by purpose. Looking for the machine-readable versions?</p>+ <p>All 362 pages on three.ws, grouped by purpose. Looking for the machine-readable versions?</p><div class="sm-formats"><a href="/sitemap.xml"><code>sitemap.xml</code> · for search engines</a><a href="/llms.txt"><code>llms.txt</code> · for AI agents</a>@@ -77,7 +77,7 @@</div><div class="sm-filter"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="m21 21-4.3-4.3"/></svg>- <input id="sm-filter-input" type="search" placeholder="Filter 361 pages by name, path, or description…" aria-label="Filter pages" autocomplete="off" spellcheck="false" />+ <input id="sm-filter-input" type="search" placeholder="Filter 362 pages by name, path, or description…" aria-label="Filter pages" autocomplete="off" spellcheck="false" /><kbd aria-hidden="true">/</kbd></div><p class="sm-filter-count" id="sm-filter-count" role="status" aria-live="polite"></p>@@ -655,7 +655,7 @@<section class="sm-section" id="crypto"><header>- <h2>Crypto<span class="sm-count" data-count>76</span></h2>+ <h2>Crypto<span class="sm-count" data-count>77</span></h2><p class="sm-section-desc">On-chain features: pay-per-call, token launches, vanity wallets.</p></header><ul class="sm-list">@@ -736,6 +736,13 @@<span class="sm-desc">The Money Pulse — a real-time, platform-wide feed of three.ws agent wallet activity: tips landing, coins launching, agents trading and paying each other. Every beat is a real on-chain event.</span></a></li>+ <li>+ <a href="/x402-revenue">+ <span class="sm-title">Endpoint Revenue</span>+ <span class="sm-path">/x402-revenue</span>+ <span class="sm-desc">The live revenue layer — real USDC flowing into three.ws's own x402 paid endpoints. Gross revenue, top-earning endpoints, and every settlement the moment it lands on-chain. The mirror of the Money Pulse: what the platform earns, not what agents spend.</span>+ </a>+ </li><li><a href="/viability"><span class="sm-title">Viability</span>diff --git a/scripts/audit-x402-catalog.mjs b/scripts/audit-x402-catalog.mjsindex 51ffd686a..d57f1d6b6 100644--- a/scripts/audit-x402-catalog.mjs+++ b/scripts/audit-x402-catalog.mjs@@ -39,7 +39,9 @@ const catalog = readFileSync(CATALOG, 'utf8');const undocumented = slugs.filter((slug) => !catalog.includes(slug));if (undocumented.length) {- console.error(`\n✗ ${undocumented.length} x402 endpoint(s) missing from docs/x402-endpoints.md:\n`);+ console.error(+ `\n✗ ${undocumented.length} x402 endpoint(s) missing from docs/x402-endpoints.md:\n`,+ );for (const slug of undocumented) console.error(` /api/x402/${slug}`);console.error('\nEvery api/x402/*.js endpoint must be listed in the catalog (docs/x402-endpoints.md).\n' +diff --git a/scripts/sync-standalone-repos.mjs b/scripts/sync-standalone-repos.mjsindex 327306816..3e39b225a 100644--- a/scripts/sync-standalone-repos.mjs+++ b/scripts/sync-standalone-repos.mjs@@ -136,7 +136,16 @@ function pushSnapshot(p, slug, sourceSha) {`Sync from three.ws@${sourceSha.slice(0, 12)}\n\nGenerated mirror of packages path ${p.dir}. Canonical source: https://github.com/nirholas/three.ws`,]);run(['remote', 'add', 'origin', `https://github.com/${slug}.git`]);- run(['push', '--force', 'origin', 'main']);+ // Auth without leaking the token: when GH_PAT is set, a credential helper+ // reads it from the environment at push time, so the token never lands in a+ // remote URL, in process args, or in any error message.+ // The empty `credential.helper=` first RESETS any globally-configured helper+ // (e.g. gh's, which would otherwise auth as the wrong account); our token+ // helper is then the only one git consults.+ const authArgs = process.env.GH_PAT+ ? ['-c', 'credential.helper=', '-c', 'credential.helper=!f() { echo username=x-access-token; echo "password=$GH_PAT"; }; f']+ : [];+ run([...authArgs, 'push', '--force', 'origin', 'main']);} finally {rmSync(tmp, { recursive: true, force: true });}diff --git a/src/x402-revenue.css b/src/x402-revenue.cssnew file mode 100644index 000000000..5f6d940d1--- /dev/null+++ b/src/x402-revenue.css@@ -0,0 +1,478 @@+/* Endpoint Revenue — the live view of USDC flowing into three.ws x402 endpoints.+ Self-contained (xr- prefix); leans on the shared theme tokens so it tracks+ light/dark like every other surface. Mirror of pulse.css, revenue-tinted. */++.xr-shell {+ max-width: 1180px;+ margin: 0 auto;+ padding: clamp(20px, 5vw, 56px) clamp(16px, 4vw, 32px) 80px;+ font-family: var(--font-body, system-ui, sans-serif);+ color: var(--ink, #d8d8d8);+}++/* ── hero ─────────────────────────────────────────────────────────────────── */+.xr-hero {+ margin-bottom: var(--space-xl, 32px);+}+.xr-kicker {+ display: inline-flex;+ align-items: center;+ gap: 8px;+ font-family: var(--font-mono, ui-monospace, monospace);+ font-size: var(--text-2xs, 0.72rem);+ letter-spacing: 0.12em;+ text-transform: uppercase;+ color: var(--ink-dim, #9a9a9a);+ margin: 0 0 var(--space-sm, 12px);+}+.xr-live-dot {+ width: 8px;+ height: 8px;+ border-radius: 50%;+ background: var(--success, #38d39f);+ box-shadow: 0 0 0 0 rgba(56, 211, 159, 0.5);+ animation: xr-ping 2.4s ease infinite;+}+@keyframes xr-ping {+ 0% {+ box-shadow: 0 0 0 0 rgba(56, 211, 159, 0.45);+ }+ 70% {+ box-shadow: 0 0 0 8px rgba(56, 211, 159, 0);+ }+ 100% {+ box-shadow: 0 0 0 0 rgba(56, 211, 159, 0);+ }+}+.xr-title {+ font-family: var(--font-display, 'Space Grotesk', sans-serif);+ font-size: clamp(2.2rem, 6vw, 3.4rem);+ font-weight: 700;+ line-height: 1.02;+ margin: 0 0 var(--space-sm, 12px);+ color: var(--ink-bright, #fff);+ letter-spacing: -0.02em;+}+.xr-title em {+ font-style: normal;+ color: var(--success, #38d39f);+}+.xr-sub {+ max-width: 70ch;+ margin: 0;+ font-size: var(--text-sm, 0.92rem);+ line-height: 1.6;+ color: var(--ink-dim, #9a9a9a);+}+.xr-sub a {+ color: var(--ink-bright, #fff);+ text-decoration: underline;+ text-underline-offset: 2px;+}+.xr-sub a:hover {+ color: var(--success, #38d39f);+}++.xr-hero-row {+ display: flex;+ align-items: center;+ gap: var(--space-md, 16px);+ margin-top: var(--space-lg, 24px);+ flex-wrap: wrap;+}+.xr-period {+ display: inline-flex;+ gap: 4px;+ padding: 4px;+ border: 1px solid var(--stroke, #2a2a2a);+ border-radius: var(--radius-pill, 999px);+}+.xr-period-btn {+ appearance: none;+ border: 0;+ background: transparent;+ cursor: pointer;+ font-family: var(--font-mono, monospace);+ font-size: var(--text-2xs, 0.72rem);+ color: var(--ink-dim, #9a9a9a);+ padding: 6px 14px;+ border-radius: var(--radius-pill, 999px);+ transition:+ color 0.15s ease,+ background 0.15s ease;+}+.xr-period-btn:hover {+ color: var(--ink-bright, #fff);+}+.xr-period-btn.active {+ background: var(--surface-3, #1d1d1d);+ color: var(--ink-bright, #fff);+}+.xr-period-btn:focus-visible {+ outline: 2px solid var(--success, #38d39f);+ outline-offset: 2px;+}+.xr-updated {+ font-family: var(--font-mono, monospace);+ font-size: var(--text-2xs, 0.72rem);+ color: var(--ink-faint, #6a6a6a);+}++/* ── counters ─────────────────────────────────────────────────────────────── */+.xr-counters {+ display: grid;+ grid-template-columns: repeat(5, 1fr);+ gap: var(--space-sm, 12px);+ margin: 0 0 var(--space-xl, 32px);+}+.xr-counter {+ background: var(--surface-1, #121212);+ border: 1px solid var(--stroke, #2a2a2a);+ border-radius: var(--radius-md, 12px);+ padding: var(--space-md, 16px);+ display: flex;+ flex-direction: column;+ gap: 4px;+}+.xr-counter--lead {+ border-color: color-mix(in srgb, var(--success, #38d39f) 40%, var(--stroke, #2a2a2a));+}+.xr-counter dt {+ font-family: var(--font-mono, monospace);+ font-size: var(--text-2xs, 0.72rem);+ letter-spacing: 0.06em;+ text-transform: uppercase;+ color: var(--ink-dim, #9a9a9a);+ margin: 0;+}+.xr-counter dd {+ margin: 0;+ font-family: var(--font-display, sans-serif);+ font-weight: 700;+ font-size: clamp(1.4rem, 3.4vw, 2rem);+ color: var(--ink-bright, #fff);+ line-height: 1.05;+ font-variant-numeric: tabular-nums;+}+.xr-counter--lead dd {+ color: var(--success, #38d39f);+}+.xr-counter-sub {+ font-size: var(--text-2xs, 0.72rem);+ color: var(--ink-faint, #6a6a6a);+}++/* ── grid ─────────────────────────────────────────────────────────────────── */+.xr-grid {+ display: grid;+ grid-template-columns: minmax(0, 1.7fr) minmax(260px, 1fr);+ gap: var(--space-lg, 24px);+ align-items: start;+}+.xr-main {+ min-width: 0;+}+.xr-feed-header {+ display: flex;+ align-items: baseline;+ justify-content: space-between;+ margin-bottom: var(--space-md, 16px);+}+.xr-section-h {+ font-family: var(--font-display, sans-serif);+ font-size: var(--text-lg, 1.1rem);+ color: var(--ink-bright, #fff);+ margin: 0;+}+.xr-feed-state {+ font-family: var(--font-mono, monospace);+ font-size: var(--text-2xs, 0.72rem);+ color: var(--ink-faint, #6a6a6a);+ display: inline-flex;+ align-items: center;+ gap: 6px;+}+.xr-feed-state::before {+ content: '';+ width: 6px;+ height: 6px;+ border-radius: 50%;+ background: currentColor;+}+.xr-feed-state[data-state='live'] {+ color: var(--success, #38d39f);+}+.xr-feed-state[data-state='error'] {+ color: #e0a23a;+}+.xr-feed-state[data-state='paused'] {+ color: var(--ink-faint, #6a6a6a);+}++/* ── feed rows ────────────────────────────────────────────────────────────── */+.xr-feed {+ display: flex;+ flex-direction: column;+ gap: 2px;+}+.xr-row {+ display: grid;+ grid-template-columns: auto 1fr auto;+ align-items: center;+ gap: var(--space-sm, 12px);+ padding: 12px 14px;+ background: var(--surface-1, #121212);+ border: 1px solid var(--stroke, #2a2a2a);+ border-radius: var(--radius-md, 10px);+}+.xr-row + .xr-row {+ margin-top: 2px;+}+.xr-row-glyph {+ color: var(--success, #38d39f);+ font-weight: 700;+ font-size: 1rem;+}+.xr-row-body {+ min-width: 0;+ display: flex;+ flex-direction: column;+ gap: 2px;+}+.xr-row-line {+ display: flex;+ align-items: center;+ gap: 8px;+ min-width: 0;+}+.xr-row-ep {+ font-family: var(--font-mono, monospace);+ font-size: var(--text-sm, 0.9rem);+ font-weight: 600;+ color: var(--ink-bright, #fff);+ white-space: nowrap;+ overflow: hidden;+ text-overflow: ellipsis;+}+.xr-row-payer {+ font-family: var(--font-mono, monospace);+ font-size: var(--text-2xs, 0.72rem);+ color: var(--ink-faint, #6a6a6a);+}+.xr-row-meta {+ display: flex;+ align-items: center;+ gap: 8px;+}+.xr-row-net {+ font-family: var(--font-mono, monospace);+ font-size: var(--text-2xs, 0.68rem);+ text-transform: uppercase;+ letter-spacing: 0.04em;+ color: var(--ink-dim, #9a9a9a);+ padding: 1px 6px;+ border: 1px solid var(--stroke, #2a2a2a);+ border-radius: var(--radius-pill, 999px);+}+.xr-row-time {+ font-family: var(--font-mono, monospace);+ font-size: var(--text-2xs, 0.72rem);+ color: var(--ink-faint, #6a6a6a);+}+.xr-row-amt {+ display: inline-flex;+ align-items: center;+ gap: 10px;+ font-family: var(--font-display, sans-serif);+ font-weight: 700;+ color: var(--success, #38d39f);+ font-variant-numeric: tabular-nums;+ white-space: nowrap;+}+.xr-row-tx {+ font-family: var(--font-mono, monospace);+ font-size: var(--text-2xs, 0.72rem);+ font-weight: 500;+ color: var(--ink-dim, #9a9a9a);+ text-decoration: none;+}+.xr-row-tx:hover {+ color: var(--success, #38d39f);+}+.xr-row--new {+ animation: xr-land 0.5s ease both;+}+@keyframes xr-land {+ from {+ opacity: 0;+ transform: translateY(-8px);+ background: color-mix(in srgb, var(--success, #38d39f) 12%, var(--surface-1, #121212));+ }+ to {+ opacity: 1;+ transform: none;+ }+}++/* feed empty / skeleton states */+.xr-feed-empty {+ border: 1px dashed var(--stroke, #2a2a2a);+ border-radius: var(--radius-md, 12px);+ padding: var(--space-2xl, 48px) var(--space-lg, 24px);+ text-align: center;+}+.xr-feed-empty-h {+ font-family: var(--font-display, sans-serif);+ font-size: var(--text-lg, 1.05rem);+ color: var(--ink-bright, #fff);+ margin: 0 0 8px;+}+.xr-feed-empty-p {+ font-size: var(--text-sm, 0.9rem);+ color: var(--ink-dim, #9a9a9a);+ margin: 0 auto;+ max-width: 46ch;+ line-height: 1.6;+}+.xr-feed-empty-p a {+ color: var(--ink-bright, #fff);+}++/* ── rail ─────────────────────────────────────────────────────────────────── */+.xr-rail {+ display: flex;+ flex-direction: column;+ gap: var(--space-md, 16px);+ position: sticky;+ top: 84px;+}+.xr-card {+ background: var(--surface-1, #121212);+ border: 1px solid var(--stroke, #2a2a2a);+ border-radius: var(--radius-md, 12px);+ padding: var(--space-md, 16px);+}+.xr-card--quiet {+ background: var(--surface-2, #161616);+}+.xr-card-h {+ font-family: var(--font-mono, monospace);+ font-size: var(--text-2xs, 0.72rem);+ text-transform: uppercase;+ letter-spacing: 0.08em;+ color: var(--ink-dim, #9a9a9a);+ margin-bottom: var(--space-md, 14px);+ display: flex;+ justify-content: space-between;+ align-items: baseline;+}+.xr-card-h small {+ text-transform: none;+ letter-spacing: 0;+ color: var(--ink-faint, #6a6a6a);+}+.xr-empty {+ font-size: var(--text-sm, 0.88rem);+ color: var(--ink-faint, #6a6a6a);+ margin: 0;+}++.xr-top-row {+ position: relative;+ display: grid;+ grid-template-columns: 1fr auto;+ align-items: center;+ gap: 8px;+ padding: 9px 10px;+ border-radius: var(--radius-md, 8px);+ overflow: hidden;+}+.xr-top-row + .xr-top-row {+ margin-top: 2px;+}+.xr-top-bar {+ position: absolute;+ inset: 0 auto 0 0;+ height: 100%;+ background: color-mix(in srgb, var(--success, #38d39f) 14%, transparent);+ z-index: 0;+ border-radius: var(--radius-md, 8px);+ transition: width 0.5s ease;+}+.xr-top-name,+.xr-top-val {+ position: relative;+ z-index: 1;+}+.xr-top-name {+ font-family: var(--font-mono, monospace);+ font-size: var(--text-sm, 0.85rem);+ color: var(--ink-bright, #fff);+ white-space: nowrap;+ overflow: hidden;+ text-overflow: ellipsis;+}+.xr-top-val {+ font-family: var(--font-display, sans-serif);+ font-weight: 700;+ color: var(--ink-bright, #fff);+ text-align: right;+ font-variant-numeric: tabular-nums;+}+.xr-top-val small {+ display: block;+ font-weight: 400;+ font-size: var(--text-2xs, 0.68rem);+ color: var(--ink-faint, #6a6a6a);+}++.xr-note {+ font-size: var(--text-sm, 0.85rem);+ color: var(--ink-dim, #9a9a9a);+ margin: 0;+ line-height: 1.6;+}+.xr-note a {+ color: var(--ink-bright, #fff);+ text-decoration: underline;+ text-underline-offset: 2px;+}+.xr-note a:hover {+ color: var(--success, #38d39f);+}+.xr-fineprint {+ font-size: var(--text-2xs, 0.72rem);+ color: var(--ink-faint, #6a6a6a);+ margin: 0;+ line-height: 1.5;+}++/* ── responsive ───────────────────────────────────────────────────────────── */+@media (max-width: 900px) {+ .xr-counters {+ grid-template-columns: repeat(2, 1fr);+ }+ .xr-grid {+ grid-template-columns: 1fr;+ }+ .xr-rail {+ position: static;+ }+}+@media (max-width: 480px) {+ .xr-counters {+ grid-template-columns: 1fr 1fr;+ }+ .xr-counter--lead {+ grid-column: 1 / -1;+ }+}++@media (prefers-reduced-motion: reduce) {+ .xr-live-dot {+ animation: none;+ }+ .xr-row--new {+ animation: none;+ }+}diff --git a/src/x402-revenue.js b/src/x402-revenue.jsnew file mode 100644index 000000000..c0eb436a8--- /dev/null+++ b/src/x402-revenue.js@@ -0,0 +1,317 @@+/**+ * Endpoint Revenue — the public, live view of USDC flowing INTO three.ws's own+ * x402 paid endpoints. The mirror of the Money Pulse (which shows agent SPEND):+ * this page reads the platform's revenue ledger via GET /api/x402-revenue.+ *+ * GET /api/x402-revenue?view=stats&period= headline totals + top endpoints+ * GET /api/x402-revenue?view=feed recent settlements (keyset)+ * GET /api/x402-revenue?since=<iso> delta poll — only newer settlements+ *+ * Every row is a real, explorer-verifiable settlement. No synthetic events: a+ * quiet platform shows an honest empty state.+ */+import { updateValue } from './ui-juice.js';+import { timeAgo } from './shared/pulse-format.js';++const POLL_MS = 12_000; // live delta cadence when visible+const STATS_REFRESH_MS = 60_000;++const $ = (id) => document.getElementById(id);++const state = {+ period: '24h',+ latestTs: null, // ISO of the newest settlement we've rendered+ seen: new Set(), // event ids already in the feed (dedupe delta polls)+ pollTimer: null,+ statsTimer: null,+};++// ── formatters ───────────────────────────────────────────────────────────────+function fmtUsd(v) {+ const n = Number(v) || 0;+ if (n === 0) return '$0';+ if (n >= 1000) return `$${(n / 1000).toFixed(1)}k`;+ if (n >= 1) return `$${n.toFixed(2)}`;+ if (n >= 0.01) return `$${n.toFixed(3)}`;+ return `$${n.toFixed(6).replace(/0+$/, '').replace(/\.$/, '')}`;+}+function fmtInt(v) {+ return new Intl.NumberFormat('en-US').format(Math.round(Number(v) || 0));+}+function fmtPct(v) {+ return `${Math.round((Number(v) || 0) * 100)}%`;+}+function esc(s) {+ return String(s ?? '').replace(+ /[&<>"']/g,+ (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' })[c],+ );+}+// '/api/x402/token-intel' → 'token-intel'+function endpointLabel(route) {+ const m = String(route || '').match(/\/api\/x402\/([^?]+)/);+ return m ? m[1] : (route || 'unknown').replace(/^\/api\//, '');+}++// ── stats ─────────────────────────────────────────────────────────────────────+function setCounter(id, value, format) {+ const el = $(id);+ if (!el) return;+ if (value == null || !Number.isFinite(Number(value))) {+ el.textContent = '—';+ delete el.dataset.juiceVal;+ return;+ }+ updateValue(el, Number(value), format);+}++async function loadStats() {+ let res;+ try {+ res = await fetch(+ `/api/x402-revenue?view=stats&period=${encodeURIComponent(state.period)}`,+ {+ headers: { accept: 'application/json' },+ },+ );+ } catch {+ return; // transient network blip — keep last-known counters+ }+ if (!res.ok) return;+ const { data } = await res.json();+ if (!data) return;+ renderStats(data);+ const u = $('xr-updated');+ if (u) u.textContent = `updated ${timeAgo(new Date().toISOString())}`;+}++function renderStats(d) {+ const t = d.totals || {};+ setCounter('xr-c-gross', Number(t.gross_usd), fmtUsd);+ setCounter('xr-c-count', Number(t.total_payments), fmtInt);+ setCounter('xr-c-payers', Number(t.unique_payers), fmtInt);+ setCounter('xr-c-net', Number(t.net_platform_usd), fmtUsd);++ const health = d.settlement_health || {};+ setCounter('xr-c-success', Number(health.success_rate), fmtPct);+ const ss = $('xr-c-success-sub');+ if (ss)+ ss.textContent = `${fmtInt(health.settled || 0)} ok · ${fmtInt(health.failed || 0)} failed`;++ const gs = $('xr-c-gross-sub');+ if (gs)+ gs.textContent = `${fmtInt(t.total_payments || 0)} settled · avg ${fmtUsd(t.avg_payment_usd)}`;++ const win = $('xr-top-window');+ if (win) win.textContent = d.period || state.period;+ renderTopEndpoints(d.by_endpoint || []);+}++function renderTopEndpoints(rows) {+ const host = $('xr-top');+ if (!host) return;+ if (!rows.length) {+ host.innerHTML = `<p class="xr-empty">No endpoint has earned in this window yet.</p>`;+ return;+ }+ const max = Math.max(...rows.map((r) => Number(r.gross_usd) || 0), 0);+ host.innerHTML = rows+ .slice(0, 8)+ .map((r) => {+ const g = Number(r.gross_usd) || 0;+ const pct = max > 0 ? Math.max(2, Math.round((g / max) * 100)) : 2;+ return (+ `<div class="xr-top-row">` ++ `<span class="xr-top-bar" style="width:${pct}%" aria-hidden="true"></span>` ++ `<span class="xr-top-name">${esc(endpointLabel(r.endpoint))}</span>` ++ `<span class="xr-top-val">${fmtUsd(g)}<small>${fmtInt(r.count)} call${r.count === 1 ? '' : 's'}</small></span>` ++ `</div>`+ );+ })+ .join('');+}++// ── feed ────────────────────────────────────────────────────────────────────+function setFeedState(s) {+ const el = $('xr-feed-state');+ if (!el) return;+ el.dataset.state = s;+ el.textContent =+ s === 'live'+ ? 'live'+ : s === 'paused'+ ? 'paused'+ : s === 'error'+ ? 'reconnecting…'+ : s === 'empty'+ ? 'no activity yet'+ : 'connecting…';+}++function rowHTML(e) {+ const label = endpointLabel(e.route);+ const tx = e.tx_url+ ? `<a class="xr-row-tx" href="${esc(e.tx_url)}" target="_blank" rel="noopener" aria-label="View transaction on explorer">tx ↗</a>`+ : '';+ const payer = e.payer+ ? `<span class="xr-row-payer" title="payer wallet">${esc(e.payer)}</span>`+ : '';+ const net = e.network ? `<span class="xr-row-net">${esc(e.network)}</span>` : '';+ return (+ `<div class="xr-row" data-id="${esc(e.id)}">` ++ `<span class="xr-row-glyph" aria-hidden="true">→</span>` ++ `<span class="xr-row-body">` ++ `<span class="xr-row-line"><span class="xr-row-ep">${esc(label)}</span> ${payer}</span>` ++ `<span class="xr-row-meta">${net}<span class="xr-row-time">${esc(timeAgo(e.ts))}</span></span>` ++ `</span>` ++ `<span class="xr-row-amt">${fmtUsd(e.amount_usd)}${tx}</span>` ++ `</div>`+ );+}++function renderInitialFeed(events) {+ const host = $('xr-feed');+ if (!host) return;+ if (!events.length) {+ host.innerHTML =+ `<div class="xr-feed-empty">` ++ `<p class="xr-feed-empty-h">No settled payments in this window yet.</p>` ++ `<p class="xr-feed-empty-p">The instant an agent or app pays one of the platform's x402 endpoints, the settlement lands here — live and verifiable. Browse what's payable in the <a href="/docs/x402-endpoints">endpoint catalog</a>.</p>` ++ `</div>`;+ setFeedState('empty');+ return;+ }+ host.innerHTML = events.map(rowHTML).join('');+ for (const e of events) state.seen.add(e.id);+ state.latestTs = events[0].ts;+ setFeedState('live');+}++function prependEvents(events) {+ const host = $('xr-feed');+ if (!host) return;+ const fresh = events.filter((e) => !state.seen.has(e.id));+ if (!fresh.length) return;+ // If the feed was empty, replace the empty-state block first.+ const emptyEl = host.querySelector('.xr-feed-empty');+ if (emptyEl) host.innerHTML = '';+ const frag = document.createElement('div');+ frag.innerHTML = fresh.map(rowHTML).join('');+ // Newest first: insert in reverse so the very latest ends up on top.+ const nodes = Array.from(frag.children).reverse();+ for (const node of nodes) {+ node.classList.add('xr-row--new');+ host.prepend(node);+ }+ for (const e of fresh) state.seen.add(e.id);+ state.latestTs = fresh[0].ts;+ // Trim very long feeds to keep the DOM light.+ const rows = host.querySelectorAll('.xr-row');+ for (let i = 200; i < rows.length; i++) rows[i].remove();+}++async function loadInitialFeed() {+ setFeedState('loading');+ let res;+ try {+ res = await fetch('/api/x402-revenue?view=feed&limit=30', {+ headers: { accept: 'application/json' },+ });+ } catch {+ setFeedState('error');+ return;+ }+ if (!res.ok) {+ setFeedState('error');+ return;+ }+ const { data } = await res.json();+ renderInitialFeed(data?.events || []);+}++async function pollDelta() {+ if (!state.latestTs) return; // nothing to delta against yet (empty feed)+ let res;+ try {+ res = await fetch(`/api/x402-revenue?since=${encodeURIComponent(state.latestTs)}`, {+ headers: { accept: 'application/json' },+ });+ } catch {+ setFeedState('error');+ return;+ }+ if (!res.ok) {+ setFeedState('error');+ return;+ }+ const { data } = await res.json();+ prependEvents(data?.events || []);+ setFeedState('live');+}++function startPolling() {+ if (state.pollTimer) return;+ state.pollTimer = setInterval(() => {+ if (!document.hidden) {+ // When the feed is empty we re-fetch the head (a first payment may have landed).+ state.latestTs ? pollDelta() : loadInitialFeed();+ }+ }, POLL_MS);+}+function stopPolling() {+ if (state.pollTimer) {+ clearInterval(state.pollTimer);+ state.pollTimer = null;+ }+}++// ── period switch ─────────────────────────────────────────────────────────────+function setPeriod(period) {+ const target = ['24h', '7d', '30d', 'all'].includes(period) ? period : '24h';+ if (target === state.period) return;+ state.period = target;+ for (const b of document.querySelectorAll('[data-period]')) {+ const on = b.dataset.period === target;+ b.classList.toggle('active', on);+ b.setAttribute('aria-selected', String(on));+ }+ loadStats();+}++function wirePeriod() {+ for (const btn of document.querySelectorAll('[data-period]')) {+ btn.addEventListener('click', () => setPeriod(btn.dataset.period));+ btn.addEventListener('keydown', (e) => {+ if (e.key === 'Enter' || e.key === ' ') {+ e.preventDefault();+ setPeriod(btn.dataset.period);+ }+ });+ }+}++function onVisibility() {+ if (document.hidden) {+ setFeedState('paused');+ } else {+ setFeedState(state.latestTs ? 'live' : 'empty');+ pollDelta();+ loadStats();+ }+}++function init() {+ wirePeriod();+ loadStats();+ loadInitialFeed().then(startPolling);+ state.statsTimer = setInterval(() => {+ if (!document.hidden) loadStats();+ }, STATS_REFRESH_MS);+ document.addEventListener('visibilitychange', onVisibility);+}++if (document.readyState === 'loading') {+ document.addEventListener('DOMContentLoaded', init);+} else {+ init();+}diff --git a/vercel.json b/vercel.jsonindex 2d3eb78c7..f5ca2909d 100644--- a/vercel.json+++ b/vercel.json@@ -775,6 +775,10 @@"src": "/pulse/?","dest": "/pulse.html"},+ {+ "src": "/x402-revenue/?",+ "dest": "/x402-revenue.html"+ },{"src": "/deployments/?","dest": "/deployments.html"@@ -2658,6 +2662,10 @@"src": "/api/pulse","dest": "/api/pulse.js"},+ {+ "src": "/api/x402-revenue",+ "dest": "/api/x402-revenue.js"+ },{"src": "/api/pipeline","dest": "/api/pipeline.js"diff --git a/vite.config.js b/vite.config.jsindex fd0750165..1f563397a 100644--- a/vite.config.js+++ b/vite.config.js@@ -378,6 +378,7 @@ const appConfig = {guardian: resolve(__dirname, 'pages/guardian.html'),launches: resolve(__dirname, 'pages/launches.html'),pulse: resolve(__dirname, 'pages/pulse.html'),+ 'x402-revenue': resolve(__dirname, 'pages/x402-revenue.html'),viability: resolve(__dirname, 'pages/viability.html'),deployments: resolve(__dirname, 'pages/deployments.html'),'admin-launcher': resolve(__dirname, 'pages/admin/launcher.html'),@@ -846,6 +847,8 @@ support: resolve(__dirname, 'pages/support.html'),'/launches/': resolve(root, 'pages/launches.html'),'/pulse': resolve(root, 'pages/pulse.html'),'/pulse/': resolve(root, 'pages/pulse.html'),+ '/x402-revenue': resolve(root, 'pages/x402-revenue.html'),+ '/x402-revenue/': resolve(root, 'pages/x402-revenue.html'),'/viability': resolve(root, 'pages/viability.html'),'/viability/': resolve(root, 'pages/viability.html'),'/deployments': resolve(root, 'pages/deployments.html'),