Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

feat(robinhood): launch coins on Robinhood Chain through Pons and browse paired-quote coins, with agent skills, MCP tools, pages and docs

nirholasac02ba415436
diff --git a/CHANGELOG.md b/CHANGELOG.md
index d3002df5c..e0d5dfc96 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,13 +7,26 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr
## 2026-10-08
- **Chart Companion** (`/chart-companion`): Paste any DEXTools pair and a 3D agent watches the live chart with you, reacting to every real swap: cheering whale buys, flinching at dumps, calling streaks and new highs, each reaction linked to its transaction. Turn on its voice, bring your own three.ws agent, embed it with one iframe, or add it to OBS as a transparent stream overlay.
+- **DEXTools integration guide** (`/docs/dextools`): How three.ws works with DEXTools: DEXTools charts on every coin page, any pair rendered as a live 3D scene, the embeddable Social Boost card, and how to paste a DEXTools link to get an embed snippet.
+- **Docs · Chart Companion** (`/docs/chart-companion`): How to watch a DEXTools chart with a 3D agent that reacts to every real swap: the URL parameters, streaming it as a transparent OBS overlay, embedding it with one iframe, bringing your own agent, and exactly how whale, streak and new-high reactions are decided.
+- **Docs · DEXTools integration** (`/docs/dextools`): How three.ws and DEXTools connect: the /dextools hub, the embed builder that turns any DEXTools pair link into a 3D scene or Social Boost card snippet, the framable Boost on DEXTools card, and the counted redirect and public totals behind every visit three.ws sends to a DEXTools pair page.
+- **Launch on Robinhood Chain** (`/launch/robinhood`): Launch a coin on Robinhood Chain through Pons, signed by your 3D AI agent's own wallet: a live cost quote, an atomic opening buy, and an API your bots can call.
- **three.ws x DEXTools** (`/dextools`): Every way three.ws works with DEXTools: DEXTools charts in every coin chart, any DEXTools pair rendered as a live 3D scene, a Social Boost card any project can embed, and a public count of the visits three.ws sends to DEXTools pair pages. Paste a DEXTools link to get the embed snippet.
+- **3D Studio results now hand every agent plain links to the model**: Every model the free 3D Studio MCP server hands back, whether freshly generated, picked from the asset catalog or saved as a persona, now comes with four plain links, both in the result data and in its first lines of text: a viewer page, the GLB file, a rendered PNG picture and a paste-ready embed snippet. Agents that cannot show a 3D widget, like Grok Bot and other browser agents, can now open, download, share and embed the model directly. A model that is still rendering comes with a viewer link that waits for the job and opens the model the moment it is ready. (`/docs/mcp-studio`) `[feature]`
- **Agent earnings are updating again**: pump.fun moved the service that reports creator fees, so the Earned figures on agent pages, agent profiles, coin pages and /analytics had stopped refreshing since the end of September. Earnings now read from pump.fun's current fees service, with a second source behind it if that one stumbles, and every agent coin is back on its 30-minute refresh. (`/analytics`) `[fix]`
+- **Chart Companion: a 3D agent that watches the chart with you**: Paste any DEXTools pair at /chart-companion and a 3D agent sits beside the live chart, reacting to every real swap as it lands: a superhero jump for a whale buy, a facepalm for a dump, a dance for a buy streak, applause for a new daily high. Each reaction comes with a line you can trace to its transaction, and it can read them aloud. Bring your own three.ws agent, embed it on your coin's site with one iframe, or add it to OBS as a transparent overlay for your stream. (`/chart-companion`) `[feature]`
- **Chat and agents stay up through more AI outages**: Every AI answer on three.ws, from chat to agent brains, the tutor and the fact-checker, now has five more free models to fall back on when the usual ones are busy. NVIDIA's largest open model, Nemotron 3 Ultra, now answers right behind Nemotron 3 Super, with the compact Nemotron 3.5 Lightning further down the line. A second, independent route to the same Nemotron models works with no account at all, and a Gemma 4 model is back in the mix as well. The free NVIDIA and gateway models are now checked against their providers every six hours too, so the team hears the moment one is switched off instead of finding out from a failed answer. (`/chat`) `[improvement]`
+- **Coin charts say plainly when a coin has no market yet**: A coin with no trading pool anywhere could show a price-history error on its chart when a market data source was busy. The chart now recognises the coin has no market and shows the no-price-history state, and it asks that source one question fewer per chart load. (`/terminal`) `[fix]`
+- **Coin Clash stays playable when community data is offline**: When the community roster behind Coin Clash is unavailable, the arena no longer goes dark. Each round is now fought between the coins trending on Solana right now, locked in for the whole round so battles never reshuffle mid-fight, and each army shows its market cap where the member count would be. Enlisting, rallying and war records work exactly as before. (`/clash`) `[improvement]`
- **Community sentiment readings are back on coin pages and the Oracle**: pump.fun moved the feed of community callouts that our sentiment pulse reads, so every reading had been failing with an unavailable error. The pulse now reads the new feed, so launch pages, the Oracle and the sentiment_pulse MCP tool score real community commentary again, up to 100 callouts per coin. (`/oracle`) `[fix]`
- **DEXTools is one click away on every coin, and every visit counts toward Social Boost**: DEXTools Social Boost ranks tokens by visits to their DEXTools page, and $THREE has already won three buybacks from it. Every coin on three.ws now carries a DEXTools link: it leads the trading terminal row and appears on coin and launch pages, the 3D coin view, the Oracle, agent and character pages, the live pump.fun feeds and your token dashboard. Each link opens the coin's busiest pair on DEXTools, so the visit lands on the page Social Boost actually counts. Launch pages, and the success screen right after you launch a coin, also get a Social Boost card that explains how the ranking works and sends your community there in one click. Visits are counted in daily totals per coin and per page that sent them. No visitor data is stored. (`/three-token`) `[feature]`
- **Event-attested reputation now requires the platform's own signature**: The event-attested tier in a Solana agent's reputation, which ranks above community feedback in the Passport grade, was granted on a label written inside the memo, so any signer could claim it. It now counts only attestations the platform's own attester minted and recorded, so a self-written label earns ordinary feedback weight and nothing more. (`/reputation/market`) `[fix, security]`
+- **Fewer failed 3D generations when the concept image comes back blank**: Text to 3D first paints a concept image, then sculpts it. When the painting service quietly returned a blank black frame instead of a picture, the studio used it anyway, and every 3D engine then failed because there was nothing in the image to sculpt. The studio now spots a blank or withheld frame and paints the concept with the next image service instead, so those prompts finish as real models. (`/forge`) `[fix]`
+- **Grok model menus now offer xAI's current models**: Every Grok picker on three.ws (the /brain menu, agent chat, the avatar page and the embed editor) now lists xAI's current line-up: Grok 4.7, xAI's flagship, Grok 4.3 with its 1M-token context at the lowest Grok price, Grok 4.20 Fast with no thinking pass, and Grok Build for coding. Agents and embeds that saved a Grok model xAI has since retired, such as Grok 4.1 Fast, keep working and answer on the model xAI recommends in its place. People who bring their own xAI key now get Grok 4.7 by default instead of an older flagship. (`/brain`) `[improvement]`
+- **Picking the free Hugging Face engine no longer leaves you stuck when its Spaces are down**: When every free Hugging Face Space is out of GPU quota, the Forge now pauses that engine for a few minutes, greys it out in the engine picker with the reason, and moves a generation you started on it to a working engine, showing you the switch, instead of retrying the same dead Spaces with a countdown. (`/forge`) `[fix]`
+- **Shared 3D models now explain themselves to X and Grok**: Every 3D model page now tells whoever reads the link exactly what it is. A model shared from three.ws unfurls on X as a large card showing a render of the model itself instead of a stock image, with its own title and description. Model, avatar and agent pages also describe themselves in a machine-readable form that search engines and AI assistants like Grok can read: the 3D file, a picture of it, who made it, when, and the terms it is shared under. So when someone asks Grok what a three.ws link is, it can answer from the model rather than guess. (`/creations`) `[improvement]`
- **The coin visualizer and communities keep loading when pump.fun throttles us**: The full coin board behind the pump.fun visualizer, the communities page and the home page's live coin now retries a rate-limited read once and falls back to the last board any server saw in the past 30 minutes, marked as slightly stale, instead of showing an error. (`/communities`) `[fix]`
+- **Your agent can launch its own coin on Robinhood Chain**: Agents can now launch a coin on Robinhood Chain through Pons, the chain's busiest launchpad, signed by the agent's own wallet. Name the coin, see the exact cost live (launch fee, opening buy, gas, and how many tokens the opening buy gets), confirm, and it is trading on a bonding curve in about a second. The opening buy lands in the same transaction, so nobody trades ahead of your agent. Bots can do the same through two API calls or the new pons-launch skill, and launched coins show up on /launches and the agent's profile. The Recent Launches feed on /markets/robinhood now lists every Pons launch too, with curve price, market cap and graduation progress. (`/launch/robinhood`) `[feature]`
## 2026-10-01
diff --git a/STRUCTURE.md b/STRUCTURE.md
index f84ad8155..b838ac538 100644
--- a/STRUCTURE.md
+++ b/STRUCTURE.md
@@ -285,6 +285,7 @@ bottom.
| Robinhood Chain markets + buy flow | Hub + detail pages [pages/markets-robinhood.html](pages/markets-robinhood.html) + [src/markets-robinhood.js](src/markets-robinhood.js) `→ /markets/robinhood`, [pages/robinhood-stock.html](pages/robinhood-stock.html) + [src/robinhood-stock.js](src/robinhood-stock.js) `→ /markets/robinhood/stock/:symbol`, [pages/robinhood-coin.html](pages/robinhood-coin.html) + [src/robinhood-coin.js](src/robinhood-coin.js) `→ /markets/robinhood/coin/:address`, buy flow [src/robinhood-purchase.js](src/robinhood-purchase.js), wallet desk [pages/hood-desk.html](pages/hood-desk.html) + [src/hood-desk.js](src/hood-desk.js) + [src/hood-desk.css](src/hood-desk.css) `→ /markets/robinhood/desk`; backend [api/_lib/robinhood.js](api/_lib/robinhood.js) + `api/v1/robinhood/{chain,stocks,stocks-detail,coins,coins-detail,launches,desk,wallet}.js` (free, the last two composed for the desk over [api/_lib/robinhood-desk.js](api/_lib/robinhood-desk.js)) + [api/x402/robinhood-portfolio.js](api/x402/robinhood-portfolio.js) (x402 paid) | In-repo | The 24/7 tokenized-equity board for Robinhood Chain (4663): live Chainlink NAV vs. Uniswap DEX premium for every Stock Token (one multicall, never 95 RPC calls), a memecoin screener across NOXA/The Odyssey launchpads (CoinGecko categories + on-chain launch logs via Blockscout), and chain TVL/gas/block stats. Detail pages add NAV history, holders, transfers, and contract links. Coin pages carry a real buy panel: injected-wallet connect, chain-switch to 4663, live Uniswap v3 `QuoterV2` quote + `SwapRouter02` swap with slippage, LI.FI bridge deep-link; Stock Tokens are display-only (tokenized securities, not offered to US persons) with an eligibility-gated outbound DEX link instead. Paid `portfolio` endpoint returns ERC-8056 `uiMultiplier`-correct holdings. The Hood Desk (`/markets/robinhood/desk`) is the wallet-first view of the same chain: paste or connect any address and it loads that wallet's book (native + priced ERC-20 positions), its native balance curve rebuilt from Blockscout's daily and per-transaction feeds (the public RPC is not an archive node), an activity tape that folds token transfers onto the transaction that emitted them, the NAV premium ridge layered by liquidity floor, counterparty flow, and memecoin movers. Read-only and signature-free; the trade ticket reuses the coin pages' swap panel and the Stock Token eligibility gate. Tests: [tests/robinhood-desk.test.js](tests/robinhood-desk.test.js) (the derivations) and [tests/e2e/hood-desk.spec.js](tests/e2e/hood-desk.spec.js) (the panels, the empty states, the ladder collapse and the trade ticket). Docs: [docs/robinhood-chain-markets.md](docs/robinhood-chain-markets.md) |
| $THREE launchpad (native bonding curve) | Page [pages/three-launchpad.html](pages/three-launchpad.html) + [src/three-launchpad/](src/three-launchpad) `→ /three-launchpad`; backend [api/_lib/native-launch/](api/_lib/native-launch) + [api/native-launch/[action].js](api/native-launch/%5Baction%5D.js); lane toggle in [public/studio/launch-panel.js](public/studio/launch-panel.js); config + devnet scripts `scripts/native-launchpad-*.mjs` | In-repo · code-complete, mainnet config creation owner-gated (about 0.006 SOL) | Solana. Every coin launched on the lane is quoted in $THREE on Meteora's Dynamic Bonding Curve: buys are made with $THREE, creators earn 50% of the 1% fee in $THREE, and graduation (60M $THREE market cap, about 12.3M $THREE raised) locks 100% of LP in a DAMM v2 pool against $THREE. Public buy and sell via `swap-prep`, no session needed. Verified by a keyless mainnet simulation that creates the config and a $THREE-quoted pool against the live program. Docs: [docs/native-launchpad.md](docs/native-launchpad.md) |
| Uniswap v4 hooks (EVM) | [contracts/v4-hooks/](contracts/v4-hooks): `SkinHook` + `SkinToken` (wearable 3D items as coins), `AgentTierHook` (ERC-8004 reputation fee tiers), CREATE2 address mining and deploy scripts; hook census [scripts/uniswap-v4-hook-census.mjs](scripts/uniswap-v4-hook-census.mjs) | In-repo · contracts code-complete and tested against real v4-core and a live Base fork, not deployed (owner-gated) | Additional EVM surface, Solana stays the home chain. `SkinHook`: every wearable is a fixed-supply ERC-20 with its own ETH pool; equipping locks one whole token in the hook so each wearer shrinks the float, a 2% ETH-side fee is split creator / referrer (named in `hookData`, the embed that sold it) / treasury as ERC-6909 claims, and the whole supply is seeded as one permanent single-sided position. `AgentTierHook`: dynamic LP fee by ERC-8004 standing, read from the canonical registries with a pool-configured reviewer set, cached by a permissionless `refreshTier`, every registry failure resolving to the base fee. v4-core vendored at v4.0.0 under `contracts/v4-hooks/lib`. Docs: [contracts/v4-hooks/README.md](contracts/v4-hooks/README.md), [docs/uniswap-v4-hooks.md](docs/uniswap-v4-hooks.md) |
+| Robinhood Chain coin launches (Pons) | Page [pages/launch-robinhood.html](pages/launch-robinhood.html) + [src/launch-robinhood/page.js](src/launch-robinhood/page.js) `→ /launch/robinhood`; HTTP [api/agents/pons/[action].js](api/agents/pons/[action].js) (`POST /api/agents/:id/pons/{quote,launch}`); custodial launch [api/_lib/evm-leg/pons-launch.js](api/_lib/evm-leg/pons-launch.js); calldata, curve math and launch feed [api/_lib/pons.js](api/_lib/pons.js); agent skill [src/agent-skills-pons.js](src/agent-skills-pons.js) (`pons-launch`) | In-repo | An agent launches a coin on Pons V2 (ETH bonding curve graduating into a locked Uniswap V4 pool) from its own EVM wallet, with an atomic opening buy and the quoted economics pinned on chain. Same gates as every custodial spend: ownership, platform-signing mode, real-funds agreement, per-chain USD spend policy with a pending ledger row before send, audited key decrypt. Landed coins go to `fixed_supply_launches` (chain `robinhood`, venue `pons`) so /launches and agent profiles list them. The same module feeds Pons launches (curve price, market cap, graduation %) into `/api/v1/robinhood/launches`. Tests: [tests/pons.test.js](tests/pons.test.js) rebuilds real mainnet launches byte-for-byte. Docs: [docs/pons-launch.md](docs/pons-launch.md) |
| Robinhood Portfolios (generated index portfolios) | Generator [pages/hood-portfolios.html](pages/hood-portfolios.html) + [src/hood-portfolios.js](src/hood-portfolios.js) + [src/hood-portfolios.css](src/hood-portfolios.css) `→ /markets/robinhood/portfolios`, universe board [pages/hood-portfolios-universe.html](pages/hood-portfolios-universe.html) + [src/hood-portfolios-universe.js](src/hood-portfolios-universe.js) `→ /markets/robinhood/portfolios/universe`; backend [api/_lib/hood-portfolios.js](api/_lib/hood-portfolios.js) + `api/v1/hood-portfolios/{universe,generate,health}.js` (free, keyless); universe snapshot [data/hood-portfolios-universe.json](data/hood-portfolios-universe.json) built by [scripts/build-hood-portfolios-universe.mjs](scripts/build-hood-portfolios-universe.mjs) (`npm run hood:universe`); contracts [contracts/hood-portfolios/](contracts/hood-portfolios) | In-repo · contracts code-complete and fork-proven against live chain 4663, mainnet deploy owner-gated | Describe a portfolio in a sentence and get a real basket of Robinhood Chain assets. The screen ranks the whole holdable universe (727 assets: 167 tokenized equities, majors, and the chain-native long tail) through the platform free-first LLM chain, and every token it returns is validated back against that universe before it is shown. The result is committed as an immutable content-addressed manifest (`PortfolioRegistry`), held in kind by an ERC-20 share vault (`Portfolio`) whose backing is derived from balances rather than tracked, and rebalanced to published targets by a descending-price auction any address can fill: there is no function that lets a manager trade the fund. Needs no price oracle on any code path, which is what makes it work on a chain where only 34 of 95 registry equities have a Chainlink feed. Halt-aware: a paused tokenized equity stops issuance, redemption and rebalancing, and the UI says so. Ticker impersonation is resolved by contract address at build time (12 contracts on this chain call themselves USDG), so an impostor can never be selected. Backtests run the basket twice, on its schedule and never rebalanced, and report the difference: history comes from Chainlink round data (chunked into multicalls of 40, because this RPC silently drops calls out of a larger one) and a daily snapshot whose coverage compounds, with uncovered legs named rather than dropped. A generated portfolio shares as a deflate-compressed manifest in the URL, its hash re-derived server-side rather than trusted from the link. 38 offline contract tests incl. fuzz + 4 stateful invariants, 5 against a fork of live chain 4663, and 56 vitest across the screen, backtest engine, history reduction and SDK. Docs: [docs/robinhood-portfolios.md](docs/robinhood-portfolios.md), [contracts/hood-portfolios/README.md](contracts/hood-portfolios/README.md) |
| Premium Data API pass | [api/premium/](api/premium) + [api/_lib/premium.js](api/_lib/premium.js), dashboards [src/dashboard-next/pages/data-api.js](src/dashboard-next/pages/data-api.js) `→ /dashboard/data-api` + [src/dashboard-next/pages/billing.js](src/dashboard-next/pages/billing.js) `→ /dashboard/billing` | In-repo | Monthly pass in three tiers (Developer $19.99, Pro $99, Enterprise $499 per 30d, tiered rate limits) paid on Solana in $THREE (20% off), SOL, or USDC — replaces per-call x402 on the news archive with an `x402_live_` API key (existing access-control lane) + SIWX browser grants. Quote→sign→verify flow with on-chain balance-delta verification; tables `premium_passes`/`premium_quotes`. Docs: [docs/premium.md](docs/premium.md) |
| Liquidations pulse (/coins) | Collector [services/liquidation-collector/](services/liquidation-collector) (standalone always-on Node service, ported from SperaxOS), proxy [api/coin/liquidations.js](api/coin/liquidations.js) `→ GET /api/coin/liquidations`, UI strip in [src/coins-index.js](src/coins-index.js) `→ /coins` | Live — collector on Cloud Run (`liquidation-collector`, min-instances 1, unthrottled CPU) since 2026-07-10 | Real-time long/short liquidation pain across Binance, Bybit, and OKX public futures WebSocket streams: dominant-side badge (LONG PAIN / SHORT SQUEEZE / BALANCED), 1h long-vs-short bars, and the 3 largest recent liquidations, polled every 30s (pauses on hidden tab). The collector holds long-lived WebSockets so it can't run as a Vercel function — deploy it separately and point `LIQUIDATION_COLLECTOR_URL` at it. No fallback data: the proxy 503s `collector_offline` (never fabricated numbers) when unset or unreachable, and the strip degrades to a quiet single-line offline state. Docs: [docs/api-reference.md#liquidations](docs/api-reference.md#liquidations) |
diff --git a/api/_lib/evm-leg/paired-launch.js b/api/_lib/evm-leg/paired-launch.js
new file mode 100644
index 000000000..23ddc0c1c
--- /dev/null
+++ b/api/_lib/evm-leg/paired-launch.js
@@ -0,0 +1,579 @@
+// Launch a paired coin on Robinhood Chain from an agent's custodial EVM wallet.
+//
+// A paired coin trades against one to five quote assets at once (tokenized
+// stocks, WETH, stablecoins, chain coins), each in its own bonding curve on the
+// paired launchpad (api/_lib/paired-launchpad.js, contracts/paired-launchpad/).
+// The launch costs only the flat ETH fee plus gas: every curve starts from a
+// virtual reserve, so the agent never needs to hold the assets it pairs with.
+// An optional opening buy spends one of those assets in the same transaction.
+//
+// The gates match every other custodial spend on the EVM leg (see
+// pons-launch.js), in order: the agent belongs to the caller, the agent is in
+// platform-signing mode, the launch is priced in USD and checked against the
+// agent's spend policy on Robinhood Chain, the wallet covers fee, buy and gas,
+// and the transaction simulates. Only then is the key decrypted (with an audit
+// row). The spend is written to the custody ledger as pending before the send
+// and settled after the receipt.
+//
+// quote() and launch() share prepare(), and the coin's descriptor is stored
+// content-addressed (its URL is derived from the keccak256 of its bytes, the
+// same hash the contract commits on chain), so what the owner is quoted is
+// byte for byte what the agent signs.
+
+import { createHash } from 'node:crypto';
+import { encodeFunctionData, formatEther, formatUnits, getAddress, keccak256, parseEventLogs } from 'viem';
+import { privateKeyToAccount } from 'viem/accounts';
+
+import { sql } from '../db.js';
+import { headObject, publicUrl, putObject, thumbnailUrl } from '../r2.js';
+import { fetchUpstreamPublic } from '../upstream-fetch.js';
+import { getOrCreateAgentEvmWallet, recoverAgentKey } from '../agent-wallet.js';
+import { assertPlatformSigningAllowed } from '../custody/signing.js';
+import { recordCustodyEvent, updateCustodyEvent } from '../agent-trade-guards.js';
+import { fetchCoinPriceUsd } from '../market-fallbacks.js';
+import {
+ BPS,
+ TOTAL_SUPPLY,
+ TOKEN_DECIMALS,
+ NO_DEV_BUY,
+ claimableFees,
+ erc20Abi,
+ launchedEvent,
+ launchpadAbi,
+ launchpadAddress,
+ launchpadConfig,
+ quoteRegistry,
+} from '../paired-launchpad.js';
+import { PairedMarketError, parseQuoteAmount, resolveAllocations } from '../paired-markets.js';
+import { pairedCoinUrl } from '../paired-directory.js';
+import { EVM_LEG_CHAINS, EvmLegError, evmLegPublicClient, evmLegWalletClient, explorerAddress, explorerTx, nativePriceId } from './chains.js';
+import { enforceEvmSpend, getDailyEvmSpendUsd, getEvmSpendLimits, checkEvmSpend } from './guards.js';
+
+const CHAIN = EVM_LEG_CHAINS.robinhood;
+const LEDGER_CHAIN = { key: CHAIN.slug, name: CHAIN.name };
+export const PAIRED_VENUE = 'paired';
+
+// Gas the launchpad's launch() consumed on mainnet: 0.94M (2 markets) to 1.30M
+// (5 markets) across the first launches on 0x6a54...fa15. Used only when the
+// wallet cannot run eth_estimateGas (empty, or the opening buy is not yet
+// approved), so a quote can still say how much to fund.
+const MEASURED_LAUNCH_GAS = 1_450_000n;
+const MEASURED_APPROVE_GAS = 60_000n;
+const GAS_HEADROOM_BPS = 13_000n;
+// The launch carries a deadline so a transaction stuck in a mempool cannot
+// land long after the owner approved it.
+const DEADLINE_SECONDS = 600;
+
+export const LIMITS = Object.freeze({ name: 32, symbol: 10, description: 480, link: 200, image: 512 });
+
+const DESCRIPTOR_PREFIX = 'paired/meta';
+const IMAGE_PREFIX = 'paired/images';
+const MAX_IMAGE_BYTES = 4 * 1024 * 1024;
+const IMAGE_TYPES = { 'image/png': 'png', 'image/jpeg': 'jpg', 'image/webp': 'webp', 'image/gif': 'gif' };
+
+async function loadOwnedAgent(agentId, userId) {
+ const [row] = await sql`
+ SELECT ai.id, ai.user_id, ai.name, ai.wallet_address, ai.meta, a.thumbnail_key, a.visibility
+ FROM agent_identities ai
+ LEFT JOIN avatars a ON a.id = ai.avatar_id AND a.deleted_at IS NULL
+ WHERE ai.id = ${agentId} AND ai.deleted_at IS NULL
+ LIMIT 1
+ `;
+ if (!row) throw new EvmLegError('not_found', 'agent not found', 404);
+ if (row.user_id !== userId) throw new EvmLegError('forbidden', 'not your agent', 403);
+ if (!row.wallet_address || !row.meta?.encrypted_wallet_key) {
+ // Older agents predate the EVM leg; provision it now so the quote can
+ // name the address to fund instead of refusing.
+ const { address } = await getOrCreateAgentEvmWallet(agentId);
+ const [fresh] = await sql`SELECT meta FROM agent_identities WHERE id = ${agentId}`;
+ return { ...row, wallet_address: address, meta: fresh?.meta || row.meta };
+ }
+ return row;
+}
+
+export function sanitizeSymbol(raw) {
+ return String(raw ?? '').toUpperCase().replace(/[^A-Z0-9]/g, '').slice(0, LIMITS.symbol);
+}
+
+export function sanitizeName(raw) {
+ return String(raw ?? '').replace(/[\p{Cc}\p{Cf}]/gu, ' ').replace(/\s+/g, ' ').trim().slice(0, LIMITS.name);
+}
+
+function httpsOrNull(value, label) {
+ const text = String(value ?? '').trim();
+ if (!text) return null;
+ let url;
+ try {
+ url = new URL(text);
+ } catch {
+ throw new PairedMarketError(`${label} is not a valid URL.`);
+ }
+ if (url.protocol !== 'https:') throw new PairedMarketError(`${label} must use https.`);
+ return url.toString();
+}
+
+/** The agent's avatar thumbnail, when public, as a default coin logo. */
+function defaultLogo(agent) {
+ if (agent.visibility !== 'public' && agent.visibility !== 'unlisted') return null;
+ const url = agent.thumbnail_key ? thumbnailUrl(agent.thumbnail_key) : null;
+ return url && url.startsWith('https://') ? url : null;
+}
+
+/**
+ * Copy a logo onto our own storage under the sha256 of its bytes, so the
+ * artwork a coin commits to can never change or disappear, and so the same
+ * image always yields the same URL (which keeps the descriptor hash stable
+ * between quote and launch).
+ */
+async function hostImage(url) {
+ // The logo link is user-supplied and the bytes are republished from our
+ // bucket, so every redirect hop is SSRF-checked.
+ const resp = await fetchUpstreamPublic(url, {}, { name: 'paired:logo', timeoutMs: 15_000, attempts: 2, okWhen: (r) => r.ok });
+ const type = String(resp.headers.get('content-type') || '').split(';')[0].trim().toLowerCase();
+ const ext = IMAGE_TYPES[type];
+ if (!ext) throw new PairedMarketError('The logo must be a PNG, JPEG, WebP or GIF image.');
+ const bytes = Buffer.from(await resp.arrayBuffer());
+ if (bytes.byteLength > MAX_IMAGE_BYTES) throw new PairedMarketError('The logo must be under 4 MB.');
+ const key = `${IMAGE_PREFIX}/${createHash('sha256').update(bytes).digest('hex')}.${ext}`;
+ if (!(await headObject(key).catch(() => null))) await putObject({ key, body: bytes, contentType: type });
+ return publicUrl(key);
+}
+
+/**
+ * The coin's descriptor, as the exact bytes the launchpad commits to. No
+ * timestamps and a fixed key order, so identical inputs give identical bytes.
+ * `origin` binds the coin to the agent that launched it; the creator address
+ * the contract records is that agent's wallet, which is what makes it checkable.
+ */
+function buildDescriptor({ name, symbol, description, image, links, agent, wallet, allocations }) {
+ const descriptor = {
+ schemaVersion: '1.0.0',
+ name,
+ symbol,
+ description: description || undefined,
+ image: image || undefined,
+ links: {
+ website: links.website || undefined,
+ twitter: links.twitter || undefined,
+ telegram: links.telegram || undefined,
+ },
+ pairs: allocations.map((a) => ({ quoteToken: a.quoteToken, symbol: a.symbol, weightBps: a.weightBps })),
+ origin: {
+ platform: 'three.ws',
+ channel: 'agent',
+ agent: { id: agent.id, name: agent.name, url: `https://three.ws/agents/${agent.id}` },
+ wallet,
+ },
+ };
+ const bytes = Buffer.from(JSON.stringify(descriptor));
+ const hash = keccak256(bytes);
+ const key = `${DESCRIPTOR_PREFIX}/${hash.slice(2)}.json`;
+ return { descriptor, bytes, hash, key, url: publicUrl(key) };
+}
+
+async function storeDescriptor(d) {
+ if (await headObject(d.key).catch(() => null)) return;
+ await putObject({ key: d.key, body: d.bytes, contentType: 'application/json' });
+}
+
+/**
+ * Tokens an opening buy receives from a fresh pool: the contract's own math,
+ * fee first, then constant product with the remaining reserve rounded UP so the
+ * amount out rounds down, exactly as PairedLaunchpad._tokensOut does.
+ */
+export function openingBuyTokens({ virtualQuote, virtualToken, quoteIn, swapFeeBps }) {
+ const fee = (quoteIn * BigInt(swapFeeBps)) / BigInt(BPS);
+ const k = virtualQuote * virtualToken;
+ const newQuote = virtualQuote + quoteIn - fee;
+ return virtualToken - (k === 0n ? 0n : (k - 1n) / newQuote + 1n);
+}
+
+/**
+ * The allocation the last market receives absorbs the division dust, exactly as
+ * the contract assigns it, so the opening-buy math sees the real pool size.
+ */
+function poolSize(allocations, index) {
+ if (index < allocations.length - 1) return (TOTAL_SUPPLY * BigInt(allocations[index].weightBps)) / BigInt(BPS);
+ const assigned = allocations.slice(0, -1).reduce((sum, a) => sum + (TOTAL_SUPPLY * BigInt(a.weightBps)) / BigInt(BPS), 0n);
+ return TOTAL_SUPPLY - assigned;
+}
+
+async function ethUsd() {
+ const id = nativePriceId(CHAIN);
+ if (!id) return null;
+ try {
+ return await fetchCoinPriceUsd(id);
+ } catch {
+ return null;
+ }
+}
+
+const round2 = (n) => Math.round(n * 100) / 100;
+
+/**
+ * Everything a launch needs except the signature. Shared by quote and launch
+ * so the owner is shown exactly what is sent.
+ */
+async function prepare(agent, input) {
+ const name = sanitizeName(input.name);
+ const symbol = sanitizeSymbol(input.symbol);
+ if (!name) throw new PairedMarketError('The coin needs a name.');
+ if (symbol.length < 2) throw new PairedMarketError('The ticker needs at least two letters or digits.');
+ const description = String(input.description ?? '').trim();
+ if (description.length > LIMITS.description) throw new PairedMarketError(`The description must be ${LIMITS.description} characters or fewer.`);
+ const links = {
+ website: httpsOrNull(input.socials?.website, 'The website link'),
+ twitter: httpsOrNull(input.socials?.twitter, 'The X link'),
+ telegram: httpsOrNull(input.socials?.telegram, 'The Telegram link'),
+ };
+
+ const [allocations, config, registry] = await Promise.all([
+ resolveAllocations(input.markets, input.weights),
+ launchpadConfig(),
+ quoteRegistry(),
+ ]);
+ const launchFeeWei = BigInt(config.launchFeeWei);
+ const address = getAddress(agent.wallet_address);
+ const lp = launchpadAddress();
+ const client = evmLegPublicClient(CHAIN);
+
+ // Optional opening buy, in one of the coin's own markets.
+ let devBuy = null;
+ if (input.dev_buy && input.dev_buy.amount != null && String(input.dev_buy.amount).trim() !== '' && Number(input.dev_buy.amount) !== 0) {
+ const want = String(input.dev_buy.market ?? allocations[0].symbol).trim().replace(/^\$/, '').toLowerCase();
+ const index = allocations.findIndex((a) => a.symbol.toLowerCase() === want || a.quoteToken.toLowerCase() === want);
+ if (index === -1) throw new PairedMarketError('The opening buy must be in one of the markets the coin pairs with.');
+ const market = allocations[index];
+ const quoteIn = parseQuoteAmount(input.dev_buy.amount, market.decimals);
+ const full = registry.find((q) => q.address.toLowerCase() === market.quoteToken.toLowerCase());
+ const tokensOut = openingBuyTokens({
+ virtualQuote: (BigInt(full.virtualQuoteRaw) * BigInt(market.weightBps)) / BigInt(BPS),
+ virtualToken: poolSize(allocations, index),
+ quoteIn,
+ swapFeeBps: config.swapFeeBps,
+ });
+ const [balance, allowance] = await Promise.all([
+ client.readContract({ address: market.quoteToken, abi: erc20Abi, functionName: 'balanceOf', args: [address] }),
+ client.readContract({ address: market.quoteToken, abi: erc20Abi, functionName: 'allowance', args: [address, lp] }),
+ ]);
+ devBuy = { index, market, quoteIn, tokensOut, balance, needsApproval: allowance < quoteIn };
+ }
+
+ const image = input.image_url ? await hostImage(httpsOrNull(input.image_url, 'The logo link')) : defaultLogo(agent);
+ const descriptor = buildDescriptor({ name, symbol, description, image, links, agent, wallet: address, allocations });
+
+ const params = {
+ name,
+ symbol,
+ metadataURI: descriptor.url,
+ metadataHash: descriptor.hash,
+ allocations: allocations.map((a) => ({ quoteToken: a.quoteToken, weightBps: a.weightBps })),
+ creatorFeeRecipient: address,
+ devBuyMarket: devBuy ? devBuy.index : NO_DEV_BUY,
+ devBuyQuoteIn: devBuy ? devBuy.quoteIn : 0n,
+ // Atomic with the launch, so no one can trade the curve first: the
+ // exact fill is pinned, and a registry change between quote and send
+ // reverts the launch instead of silently filling worse.
+ devBuyMinTokensOut: devBuy ? devBuy.tokensOut : 0n,
+ deadline: BigInt(Math.floor(Date.now() / 1000) + DEADLINE_SECONDS),
+ };
+ const data = encodeFunctionData({ abi: launchpadAbi, functionName: 'launch', args: [params] });
+
+ const [balanceWei, gasPrice] = await Promise.all([client.getBalance({ address }), client.getGasPrice()]);
+ let gas = MEASURED_LAUNCH_GAS;
+ let estimated = false;
+ const canSimulate = balanceWei >= launchFeeWei && (!devBuy || (!devBuy.needsApproval && devBuy.balance >= devBuy.quoteIn));
+ if (canSimulate) {
+ try {
+ gas = await client.estimateGas({ account: address, to: lp, data, value: launchFeeWei });
+ estimated = true;
+ } catch (err) {
+ throw new PairedMarketError(`The launchpad would reject this launch: ${err.shortMessage || err.message}`, 422);
+ }
+ }
+ const gasLimit = (gas * GAS_HEADROOM_BPS) / 10_000n;
+ const approveGas = devBuy?.needsApproval ? (MEASURED_APPROVE_GAS * GAS_HEADROOM_BPS) / 10_000n : 0n;
+ const gasWei = (gasLimit + approveGas) * gasPrice;
+ const totalWei = launchFeeWei + gasWei;
+
+ const blockers = [];
+ if (balanceWei < totalWei) {
+ blockers.push(`Fund ${address} with at least ${formatEther(totalWei - balanceWei)} more ETH on Robinhood Chain.`);
+ }
+ if (devBuy && devBuy.balance < devBuy.quoteIn) {
+ blockers.push(
+ `The opening buy needs ${formatUnits(devBuy.quoteIn - devBuy.balance, devBuy.market.decimals)} more ${devBuy.market.symbol} in ${address}.`,
+ );
+ }
+ return {
+ name, symbol, description, image, links, allocations, config, address, descriptor, params, data,
+ launchFeeWei, devBuy, balanceWei, gasLimit, approveGas, gasPrice, gasWei, totalWei, estimated, blockers,
+ };
+}
+
+/** USD that leaves the agent's control: the fee and the opening buy. Gas is network cost. */
+function spendUsd(p, price) {
+ if (price == null) return null;
+ let usd = Number(formatEther(p.launchFeeWei)) * price;
+ if (p.devBuy) {
+ if (p.devBuy.market.priceUsd == null) return null;
+ usd += Number(formatUnits(p.devBuy.quoteIn, p.devBuy.market.decimals)) * p.devBuy.market.priceUsd;
+ }
+ return round2(usd);
+}
+
+function describe(agent, p, price) {
+ return {
+ chain: CHAIN.slug,
+ chain_id: CHAIN.chainId,
+ venue: PAIRED_VENUE,
+ launchpad: launchpadAddress(),
+ agent: { id: agent.id, name: agent.name },
+ wallet: { address: p.address, balance_eth: formatEther(p.balanceWei), explorer: explorerAddress(CHAIN, p.address) },
+ coin: {
+ name: p.name,
+ symbol: p.symbol,
+ description: p.description || null,
+ image_url: p.image || null,
+ socials: p.links,
+ total_supply: formatUnits(TOTAL_SUPPLY, TOKEN_DECIMALS),
+ metadata_uri: p.descriptor.url,
+ metadata_hash: p.descriptor.hash,
+ },
+ pairs: p.allocations.map((a) => ({
+ quote_token: a.quoteToken,
+ symbol: a.symbol,
+ asset_class: a.assetClass,
+ canonical: a.canonical,
+ weight_pct: a.weightBps / 100,
+ supply: formatUnits((TOTAL_SUPPLY * BigInt(a.weightBps)) / BigInt(BPS), TOKEN_DECIMALS),
+ opening_value_usd: a.openingValueUsd != null ? round2(a.openingValueUsd) : null,
+ })),
+ terms: {
+ launch_fee_eth: p.config.launchFeeEth,
+ swap_fee_bps: p.config.swapFeeBps,
+ creator_share_bps: p.config.creatorShareBps,
+ },
+ opening_buy: p.devBuy
+ ? {
+ market: p.devBuy.market.symbol,
+ amount: formatUnits(p.devBuy.quoteIn, p.devBuy.market.decimals),
+ tokens: formatUnits(p.devBuy.tokensOut, TOKEN_DECIMALS),
+ pct_of_supply: Number((p.devBuy.tokensOut * 1_000_000n) / TOTAL_SUPPLY) / 10_000,
+ needs_approval: p.devBuy.needsApproval,
+ }
+ : null,
+ cost: {
+ launch_fee_eth: formatEther(p.launchFeeWei),
+ gas_eth: formatEther(p.gasWei),
+ gas_estimated: p.estimated,
+ total_eth: formatEther(p.totalWei),
+ total_usd: spendUsd(p, price) != null && price != null ? round2(spendUsd(p, price) + Number(formatEther(p.gasWei)) * price) : null,
+ eth_usd: price,
+ },
+ ready: p.blockers.length === 0,
+ blockers: p.blockers,
+ };
+}
+
+/** Price, policy and funding check for a paired launch, without signing anything. */
+export async function quotePairedLaunch({ agentId, userId, input }) {
+ const agent = await loadOwnedAgent(agentId, userId);
+ const [p, price] = await Promise.all([prepare(agent, input), ethUsd()]);
+ const out = describe(agent, p, price);
+ const limits = getEvmSpendLimits(agent.meta);
+ const spentTodayUsd = await getDailyEvmSpendUsd(agentId, LEDGER_CHAIN.key);
+ const blocked = checkEvmSpend({ limits, usdValue: spendUsd(p, price), spentTodayUsd, category: 'launch', chainName: CHAIN.name });
+ if (blocked) {
+ out.blockers.push(blocked.message);
+ out.ready = false;
+ }
+ out.policy = { per_tx_usd: limits.per_tx_usd, daily_usd: limits.daily_usd, spent_today_usd: spentTodayUsd };
+ return out;
+}
+
+async function agentAccount(agent, userId, reason, meta) {
+ const pk = await recoverAgentKey(agent.meta.encrypted_wallet_key, { agentId: agent.id, userId, reason, meta: { chain: CHAIN.slug, ...meta } });
+ const account = privateKeyToAccount(pk);
+ if (getAddress(account.address) !== getAddress(agent.wallet_address)) {
+ throw new EvmLegError('wallet_mismatch', 'The stored key does not match this agent\'s wallet address.', 500);
+ }
+ return account;
+}
+
+/**
+ * Sign and send a paired launch from the agent's custodial wallet. Returns the
+ * new coin, its pairs, the transaction and the opening fill.
+ */
+export async function launchPaired({ agentId, userId, input, req = null }) {
+ await assertPlatformSigningAllowed(agentId);
+ const agent = await loadOwnedAgent(agentId, userId);
+ const [p, price] = await Promise.all([prepare(agent, input), ethUsd()]);
+ if (p.blockers.length) throw new EvmLegError('launch_blocked', p.blockers.join(' '), 409, { blockers: p.blockers });
+
+ const usd = spendUsd(p, price);
+ await enforceEvmSpend({ agentId, meta: agent.meta, chain: LEDGER_CHAIN, usdValue: usd, category: 'launch' });
+ await storeDescriptor(p.descriptor);
+
+ const custodyId = await recordCustodyEvent({
+ agentId,
+ userId,
+ eventType: 'spend',
+ category: 'launch',
+ chain: CHAIN.slug,
+ network: CHAIN.slug,
+ asset: 'ETH',
+ amountRaw: p.launchFeeWei.toString(),
+ usd,
+ destination: launchpadAddress(),
+ reason: 'paired.launch',
+ status: 'pending',
+ meta: {
+ venue: PAIRED_VENUE,
+ name: p.name,
+ symbol: p.symbol,
+ pairs: p.allocations.map((a) => `${a.symbol}:${a.weightBps}`),
+ opening_buy: p.devBuy ? { market: p.devBuy.market.quoteToken, raw: p.devBuy.quoteIn.toString() } : null,
+ },
+ });
+
+ let account;
+ try {
+ account = await agentAccount(agent, userId, 'paired.launch', { symbol: p.symbol });
+ } catch (err) {
+ await updateCustodyEvent(custodyId, { status: 'failed', meta: { error: err.code || 'key_recover_failed' } });
+ throw err;
+ }
+ const wallet = evmLegWalletClient(CHAIN, account);
+ const client = evmLegPublicClient(CHAIN);
+
+ let hash;
+ try {
+ if (p.devBuy?.needsApproval) {
+ // Exactly the opening buy, never an unlimited approval.
+ const approveHash = await wallet.writeContract({
+ address: p.devBuy.market.quoteToken,
+ abi: erc20Abi,
+ functionName: 'approve',
+ args: [launchpadAddress(), p.devBuy.quoteIn],
+ gas: p.approveGas,
+ });
+ const approval = await client.waitForTransactionReceipt({ hash: approveHash, timeout: 60_000 });
+ if (approval.status !== 'success') throw new Error(`the ${p.devBuy.market.symbol} approval reverted`);
+ }
+ hash = await wallet.sendTransaction({ to: launchpadAddress(), data: p.data, value: p.launchFeeWei, gas: p.gasLimit });
+ } catch (err) {
+ await updateCustodyEvent(custodyId, { status: 'failed', meta: { error: String(err.shortMessage || err.message).slice(0, 300) } });
+ throw new EvmLegError('send_failed', `The launch was not sent: ${err.shortMessage || err.message}`, 502);
+ }
+
+ const receipt = await client.waitForTransactionReceipt({ hash, timeout: 60_000 });
+ if (receipt.status !== 'success') {
+ await updateCustodyEvent(custodyId, { status: 'failed', signature: hash, meta: { error: 'reverted' } });
+ throw new EvmLegError('launch_reverted', 'The launch transaction reverted on chain. Only gas was spent.', 502, {
+ tx_hash: hash,
+ explorer: explorerTx(CHAIN, hash),
+ });
+ }
+ const [launched] = parseEventLogs({ abi: [launchedEvent], logs: receipt.logs, eventName: 'Launched' });
+ if (!launched) {
+ await updateCustodyEvent(custodyId, { status: 'failed', signature: hash, meta: { error: 'no_launch_event' } });
+ throw new EvmLegError('launch_unreadable', 'The transaction landed but emitted no launch.', 502, { tx_hash: hash });
+ }
+ const token = getAddress(launched.args.token);
+ await updateCustodyEvent(custodyId, { status: 'confirmed', signature: hash, meta: { token } });
+
+ const coinPath = pairedCoinUrl(token);
+ await sql`
+ INSERT INTO fixed_supply_launches
+ (agent_id, user_id, network, chain, venue, mint, name, symbol, image_url, description,
+ creator_address, token_allocation, signatures, venue_url)
+ VALUES
+ (${agentId}, ${userId}, 'mainnet', ${CHAIN.slug}, ${PAIRED_VENUE}, ${token},
+ ${p.name}, ${p.symbol}, ${p.image || null}, ${p.description || null},
+ ${p.address}, ${(TOTAL_SUPPLY / 10n ** 18n).toString()}, ${JSON.stringify([hash])}::jsonb,
+ ${`https://three.ws${coinPath}`})
+ ON CONFLICT (mint, network) DO NOTHING
+ `.catch((e) => console.error('[paired/launch] directory insert failed', e?.message));
+
+ import('../audit.js')
+ .then(({ logAudit }) => logAudit({ userId, action: 'agent.paired_launch', resourceId: agentId, meta: { token, tx: hash }, req }))
+ .catch(() => {});
+
+ return {
+ chain: CHAIN.slug,
+ chain_id: CHAIN.chainId,
+ venue: PAIRED_VENUE,
+ token,
+ name: p.name,
+ symbol: p.symbol,
+ pairs: p.allocations.map((a) => ({ quote_token: a.quoteToken, symbol: a.symbol, weight_pct: a.weightBps / 100 })),
+ tx_hash: hash,
+ block: Number(receipt.blockNumber),
+ gas_used: receipt.gasUsed.toString(),
+ spent_eth: formatEther(p.launchFeeWei + receipt.gasUsed * receipt.effectiveGasPrice),
+ spent_usd: usd,
+ opening_buy: p.devBuy
+ ? { market: p.devBuy.market.symbol, amount: formatUnits(p.devBuy.quoteIn, p.devBuy.market.decimals), tokens: formatUnits(p.devBuy.tokensOut, TOKEN_DECIMALS) }
+ : null,
+ urls: { coin: coinPath, explorer: explorerTx(CHAIN, hash), metadata: p.descriptor.url },
+ };
+}
+
+/** Swap fees this agent's wallet has earned as a paired-coin creator, per quote asset. */
+export async function pairedFeesFor({ agentId, userId }) {
+ const agent = await loadOwnedAgent(agentId, userId);
+ const address = getAddress(agent.wallet_address);
+ return { wallet: address, claimable: await claimableFees(address) };
+}
+
+/**
+ * Claim every quote asset the agent has earned in, in one transaction. Moves
+ * funds INTO the agent's wallet, so no spend ceiling applies; the signature is
+ * still custodial and audited.
+ */
+export async function claimPairedFees({ agentId, userId, req = null }) {
+ await assertPlatformSigningAllowed(agentId);
+ const agent = await loadOwnedAgent(agentId, userId);
+ const address = getAddress(agent.wallet_address);
+ const owed = await claimableFees(address);
+ if (!owed.length) throw new EvmLegError('nothing_to_claim', 'This agent has no paired-coin fees to claim yet.', 409);
+
+ const client = evmLegPublicClient(CHAIN);
+ const data = encodeFunctionData({ abi: launchpadAbi, functionName: 'claimFees', args: [owed.map((o) => o.quoteToken)] });
+ const [balanceWei, gasPrice, gas] = await Promise.all([
+ client.getBalance({ address }),
+ client.getGasPrice(),
+ client.estimateGas({ account: address, to: launchpadAddress(), data }).catch((err) => {
+ throw new EvmLegError('simulation_failed', `The claim would fail: ${err.shortMessage || err.message}`, 422);
+ }),
+ ]);
+ const gasLimit = (gas * GAS_HEADROOM_BPS) / 10_000n;
+ if (balanceWei < gasLimit * gasPrice) {
+ throw new EvmLegError('needs_gas', `Fund ${address} with at least ${formatEther(gasLimit * gasPrice - balanceWei)} ETH on Robinhood Chain to pay the claim's gas.`, 409);
+ }
+
+ const account = await agentAccount(agent, userId, 'paired.claim_fees', { assets: owed.length });
+ const hash = await evmLegWalletClient(CHAIN, account).sendTransaction({ to: launchpadAddress(), data, gas: gasLimit });
+ const receipt = await client.waitForTransactionReceipt({ hash, timeout: 60_000 });
+ if (receipt.status !== 'success') {
+ throw new EvmLegError('claim_reverted', 'The claim reverted on chain. Only gas was spent.', 502, { tx_hash: hash, explorer: explorerTx(CHAIN, hash) });
+ }
+ await recordCustodyEvent({
+ agentId,
+ userId,
+ eventType: 'receive',
+ category: 'fees',
+ chain: CHAIN.slug,
+ network: CHAIN.slug,
+ signature: hash,
+ reason: 'paired.claim_fees',
+ status: 'confirmed',
+ meta: { venue: PAIRED_VENUE, claimed: owed },
+ }).catch((e) => console.error('[paired/claim] custody row failed', e?.message));
+ import('../audit.js')
+ .then(({ logAudit }) => logAudit({ userId, action: 'agent.paired_claim_fees', resourceId: agentId, meta: { tx: hash, assets: owed.length }, req }))
+ .catch(() => {});
+
+ return { wallet: address, claimed: owed, tx_hash: hash, explorer: explorerTx(CHAIN, hash) };
+}
diff --git a/api/_lib/evm-leg/pons-launch.js b/api/_lib/evm-leg/pons-launch.js
new file mode 100644
index 000000000..4650f4ce5
--- /dev/null
+++ b/api/_lib/evm-leg/pons-launch.js
@@ -0,0 +1,338 @@
+// Launch a coin on Pons (Robinhood Chain) from an agent's custodial EVM wallet.
+//
+// The agent's one EVM address (agent_identities.wallet_address) is the same on
+// every EVM chain, so the wallet that already holds the agent's Base balance is
+// the deployer here. It needs native ETH on Robinhood Chain for the Pons launch
+// fee, the optional opening buy, and gas; quote() reports exactly how much, so
+// an owner or a bot knows what to fund before anything is signed.
+//
+// launch() runs the same gates as every other custodial spend, in order: the
+// agent belongs to the caller, the agent is still in platform-signing mode, the
+// launch is priced in USD and checked against the agent's spend policy on this
+// chain, the wallet can cover it, and the transaction simulates cleanly. Only
+// then is the key decrypted (with an audit row) and the transaction sent. The
+// spend is written to the custody ledger as pending before the send, so a
+// concurrent launch counts it against the daily ceiling, and settled after the
+// receipt. A landed coin is recorded in fixed_supply_launches (chain
+// 'robinhood', venue 'pons'), which is what /launches and agent profiles read.
+
+import { randomBytes } from 'node:crypto';
+import { formatEther, getAddress, parseEther } from 'viem';
+import { privateKeyToAccount } from 'viem/accounts';
+
+import { sql } from '../db.js';
+import { thumbnailUrl } from '../r2.js';
+import { getOrCreateAgentEvmWallet, recoverAgentKey } from '../agent-wallet.js';
+import { assertPlatformSigningAllowed } from '../custody/signing.js';
+import { recordCustodyEvent, updateCustodyEvent } from '../agent-trade-guards.js';
+import { fetchCoinPriceUsd } from '../market-fallbacks.js';
+import { EVM_LEG_CHAINS, EvmLegError, evmLegPublicClient, evmLegWalletClient, explorerTx, nativePriceId } from './chains.js';
+import { enforceEvmSpend, getDailyEvmSpendUsd, getEvmSpendLimits, checkEvmSpend } from './guards.js';
+import {
+ PONS_ABI,
+ PONS_V2_FACTORY,
+ PonsError,
+ buildLaunchTx,
+ buildTokenParams,
+ parseLaunchReceipt,
+ ponsCoinUrl,
+ quoteOpeningBuy,
+ readLaunchTerms,
+} from '../pons.js';
+
+const CHAIN = EVM_LEG_CHAINS.robinhood;
+const LEDGER_CHAIN = { key: CHAIN.slug, name: CHAIN.name };
+
+// Gas a Pons V2 launchAndBuy actually consumed on mainnet: 3.55M (bare launch)
+// to 3.87M (launch plus opening buy) across the launches in
+// tests/fixtures/pons-v2-launches.json. Used only when the wallet is too empty
+// for eth_estimateGas to run, so the quote can still say how much to fund.
+const MEASURED_LAUNCH_GAS = 3_900_000n;
+// Headroom on an estimate: gas price can tick up between quote and send.
+const GAS_HEADROOM_BPS = 13_000n;
+
+/** Opening-buy ceiling. The curve graduates at 4.2 ETH, so more than that buys nothing extra. */
+export const MAX_OPENING_BUY_ETH = 4;
+
+async function loadOwnedAgent(agentId, userId) {
+ const [row] = await sql`
+ SELECT ai.id, ai.user_id, ai.name, ai.wallet_address, ai.meta, a.thumbnail_key, a.visibility
+ FROM agent_identities ai
+ LEFT JOIN avatars a ON a.id = ai.avatar_id AND a.deleted_at IS NULL
+ WHERE ai.id = ${agentId} AND ai.deleted_at IS NULL
+ LIMIT 1
+ `;
+ if (!row) throw new EvmLegError('not_found', 'agent not found', 404);
+ if (row.user_id !== userId) throw new EvmLegError('forbidden', 'not your agent', 403);
+ if (!row.wallet_address || !row.meta?.encrypted_wallet_key) {
+ // Older agents predate the EVM leg; provision it now so the quote can
+ // name the address to fund instead of refusing.
+ const { address } = await getOrCreateAgentEvmWallet(agentId);
+ const [fresh] = await sql`SELECT meta FROM agent_identities WHERE id = ${agentId}`;
+ return { ...row, wallet_address: address, meta: fresh?.meta || row.meta };
+ }
+ return row;
+}
+
+/** The agent's avatar thumbnail, when public, as a default coin logo. */
+function defaultLogo(agent) {
+ if (agent.visibility !== 'public' && agent.visibility !== 'unlisted') return '';
+ const url = agent.thumbnail_key ? thumbnailUrl(agent.thumbnail_key) : null;
+ return url && url.startsWith('https://') && url.length <= 512 ? url : '';
+}
+
+function toWei(eth) {
+ const n = Number(eth || 0);
+ if (!Number.isFinite(n) || n < 0) throw new PonsError('buy_invalid', 'Opening buy must be a non-negative ETH amount.');
+ if (n > MAX_OPENING_BUY_ETH) {
+ throw new PonsError('buy_too_large', `Opening buy is capped at ${MAX_OPENING_BUY_ETH} ETH; the curve graduates at 4.2 ETH.`);
+ }
+ return parseEther(String(n));
+}
+
+async function ethUsd() {
+ const id = nativePriceId(CHAIN);
+ if (!id) return null;
+ try {
+ return await fetchCoinPriceUsd(id);
+ } catch {
+ return null;
+ }
+}
+
+function usdOf(wei, price) {
+ return price == null ? null : Math.round(Number(formatEther(wei)) * price * 100) / 100;
+}
+
+/**
+ * Everything a launch needs except the signature: the validated token
+ * params, the transaction, and its full cost. Shared by quote and launch so
+ * what the owner is shown is exactly what gets sent.
+ */
+async function prepare(agent, input) {
+ const terms = await readLaunchTerms();
+ const address = getAddress(agent.wallet_address);
+ const buyWei = toWei(input.buy_eth);
+ const params = buildTokenParams({
+ name: input.name,
+ symbol: input.symbol,
+ logo: input.image_url || defaultLogo(agent),
+ description: input.description || '',
+ socials: input.socials || {},
+ creatorFeeRecipient: address,
+ creatorTaxBps: input.creator_tax_bps ?? 0,
+ buybackEnabled: Boolean(input.buyback),
+ // Pin the terms the owner was quoted: an owner-side re-peg between
+ // quote and send reverts the launch instead of silently repricing it.
+ expectedEconomics: terms.expectedEconomics,
+ salt: `0x${randomBytes(32).toString('hex')}`,
+ });
+ const tx = buildLaunchTx({ params, terms, quoteIn: buyWei, recipient: address });
+ const client = evmLegPublicClient(CHAIN);
+ const [balanceWei, gasPrice, canLaunch] = await Promise.all([
+ client.getBalance({ address }),
+ client.getGasPrice(),
+ client.readContract({ address: PONS_V2_FACTORY, abi: PONS_ABI, functionName: 'canLaunch', args: [address] }),
+ ]);
+ let gas = MEASURED_LAUNCH_GAS;
+ let estimated = false;
+ if (balanceWei >= tx.value) {
+ try {
+ gas = await client.estimateGas({ account: address, to: tx.to, data: tx.data, value: tx.value });
+ estimated = true;
+ } catch (err) {
+ throw new PonsError('simulation_failed', `Pons would reject this launch: ${err.shortMessage || err.message}`, 422);
+ }
+ }
+ const gasLimit = (gas * GAS_HEADROOM_BPS) / 10_000n;
+ const gasWei = gasLimit * gasPrice;
+ const totalWei = tx.value + gasWei;
+ const blockers = [];
+ if (!terms.launchEnabled && !canLaunch) blockers.push('Pons has paused public launches.');
+ if (!terms.config.enabled) blockers.push('The Pons launch config is disabled.');
+ if (balanceWei < totalWei) {
+ blockers.push(
+ `Fund ${address} with at least ${formatEther(totalWei - balanceWei)} more ETH on Robinhood Chain.`,
+ );
+ }
+ return { terms, params, tx, address, buyWei, balanceWei, gasLimit, gasPrice, gasWei, totalWei, estimated, blockers };
+}
+
+function describe(agent, p, price) {
+ const tokensOut = p.buyWei > 0n
+ ? quoteOpeningBuy({ quoteIn: p.buyWei, config: p.terms.config, creatorTaxBps: p.params.creatorTaxBps })
+ : 0n;
+ const supply = p.terms.config.supply;
+ return {
+ chain: CHAIN.slug,
+ chain_id: CHAIN.chainId,
+ venue: 'pons',
+ agent: { id: agent.id, name: agent.name },
+ wallet: { address: p.address, balance_eth: formatEther(p.balanceWei) },
+ coin: {
+ name: p.params.name,
+ symbol: p.params.symbol,
+ image_url: p.params.logo || null,
+ description: p.params.description,
+ socials: p.params.socials,
+ creator_tax_bps: p.params.creatorTaxBps,
+ buyback: p.params.buybackEnabled,
+ },
+ terms: {
+ launch_fee_eth: formatEther(p.terms.launchFee),
+ curve_fee_bps: Number(p.terms.config.curveFeeBps),
+ max_creator_tax_bps: Number(p.terms.maxCreatorTaxBps),
+ graduation_threshold_eth: formatEther(p.terms.config.graduationThreshold),
+ total_supply: formatEther(supply),
+ },
+ cost: {
+ launch_fee_eth: formatEther(p.terms.launchFee),
+ opening_buy_eth: formatEther(p.buyWei),
+ gas_eth: formatEther(p.gasWei),
+ gas_estimated: p.estimated,
+ total_eth: formatEther(p.totalWei),
+ total_usd: usdOf(p.totalWei, price),
+ eth_usd: price,
+ },
+ opening_buy: {
+ tokens: formatEther(tokensOut),
+ pct_of_supply: supply > 0n ? Number((tokensOut * 1_000_000n) / supply) / 10_000 : 0,
+ },
+ ready: p.blockers.length === 0,
+ blockers: p.blockers,
+ };
+}
+
+/** Price, policy and funding check for a launch, without signing anything. */
+export async function quotePonsLaunch({ agentId, userId, input }) {
+ const agent = await loadOwnedAgent(agentId, userId);
+ const [p, price] = await Promise.all([prepare(agent, input), ethUsd()]);
+ const out = describe(agent, p, price);
+ const limits = getEvmSpendLimits(agent.meta);
+ const spentTodayUsd = await getDailyEvmSpendUsd(agentId, LEDGER_CHAIN.key);
+ const blocked = checkEvmSpend({
+ limits,
+ usdValue: usdOf(p.tx.value, price),
+ spentTodayUsd,
+ category: 'launch',
+ chainName: CHAIN.name,
+ });
+ if (blocked) {
+ out.blockers.push(blocked.message);
+ out.ready = false;
+ }
+ out.policy = { per_tx_usd: limits.per_tx_usd, daily_usd: limits.daily_usd, spent_today_usd: spentTodayUsd };
+ return out;
+}
+
+/**
+ * Sign and send a Pons launch from the agent's custodial wallet. Returns the
+ * new token, its curve, the transaction and the opening fill.
+ */
+export async function launchOnPons({ agentId, userId, input, req = null }) {
+ await assertPlatformSigningAllowed(agentId);
+ const agent = await loadOwnedAgent(agentId, userId);
+ const [p, price] = await Promise.all([prepare(agent, input), ethUsd()]);
+ if (p.blockers.length) throw new EvmLegError('launch_blocked', p.blockers.join(' '), 409, { blockers: p.blockers });
+
+ // The gas leg is network cost, not a spend the policy meters; the launch fee
+ // and opening buy are what leave the agent's control.
+ const usd = usdOf(p.tx.value, price);
+ await enforceEvmSpend({ agentId, meta: agent.meta, chain: LEDGER_CHAIN, usdValue: usd, category: 'launch' });
+
+ const custodyId = await recordCustodyEvent({
+ agentId,
+ userId,
+ eventType: 'spend',
+ category: 'launch',
+ network: CHAIN.slug,
+ asset: 'ETH',
+ amountRaw: p.tx.value.toString(),
+ usd,
+ destination: p.tx.to,
+ reason: 'pons.launch',
+ status: 'pending',
+ meta: { venue: 'pons', name: p.params.name, symbol: p.params.symbol, buy_wei: p.buyWei.toString() },
+ });
+
+ const pk = await recoverAgentKey(agent.meta.encrypted_wallet_key, {
+ agentId,
+ userId,
+ reason: 'pons.launch',
+ meta: { chain: CHAIN.slug, symbol: p.params.symbol },
+ });
+ const account = privateKeyToAccount(pk);
+ if (getAddress(account.address) !== p.address) {
+ await updateCustodyEvent(custodyId, { status: 'failed', meta: { error: 'key_address_mismatch' } });
+ throw new EvmLegError('wallet_mismatch', 'The stored key does not match this agent\'s wallet address.', 500);
+ }
+
+ let hash;
+ try {
+ hash = await evmLegWalletClient(CHAIN, account).sendTransaction({
+ to: p.tx.to,
+ data: p.tx.data,
+ value: p.tx.value,
+ gas: p.gasLimit,
+ });
+ } catch (err) {
+ await updateCustodyEvent(custodyId, { status: 'failed', meta: { error: String(err.shortMessage || err.message).slice(0, 300) } });
+ throw new EvmLegError('send_failed', `The launch was not sent: ${err.shortMessage || err.message}`, 502);
+ }
+
+ const receipt = await evmLegPublicClient(CHAIN).waitForTransactionReceipt({ hash, timeout: 60_000 });
+ if (receipt.status !== 'success') {
+ await updateCustodyEvent(custodyId, { status: 'failed', signature: hash, meta: { error: 'reverted' } });
+ throw new EvmLegError('launch_reverted', 'The launch transaction reverted on chain. Only gas was spent.', 502, {
+ tx_hash: hash,
+ explorer: explorerTx(CHAIN, hash),
+ });
+ }
+ const launched = parseLaunchReceipt(receipt);
+ if (!launched) {
+ await updateCustodyEvent(custodyId, { status: 'failed', signature: hash, meta: { error: 'no_launch_event' } });
+ throw new EvmLegError('launch_unreadable', 'The transaction landed but emitted no Pons launch.', 502, { tx_hash: hash });
+ }
+ await updateCustodyEvent(custodyId, { status: 'confirmed', signature: hash, meta: { token: launched.token, curve: launched.curve } });
+
+ const venueUrl = ponsCoinUrl(launched.token);
+ await sql`
+ INSERT INTO fixed_supply_launches
+ (agent_id, user_id, network, chain, venue, mint, genesis_account, name, symbol, image_url, description,
+ creator_address, token_allocation, signatures, venue_url)
+ VALUES
+ (${agentId}, ${userId}, 'mainnet', ${CHAIN.slug}, 'pons', ${launched.token}, ${launched.curve},
+ ${p.params.name}, ${p.params.symbol}, ${p.params.logo || null}, ${p.params.description || null},
+ ${p.address}, ${(p.terms.config.supply / 10n ** 18n).toString()}, ${JSON.stringify([hash])}::jsonb, ${venueUrl})
+ ON CONFLICT (mint, network) DO NOTHING
+ `.catch((e) => console.error('[pons/launch] directory insert failed', e?.message));
+
+ import('../audit.js')
+ .then(({ logAudit }) =>
+ logAudit({ userId, action: 'agent.pons_launch', resourceId: agentId, meta: { token: launched.token, tx: hash }, req }),
+ )
+ .catch(() => {});
+
+ return {
+ chain: CHAIN.slug,
+ chain_id: CHAIN.chainId,
+ venue: 'pons',
+ token: launched.token,
+ curve: launched.curve,
+ name: p.params.name,
+ symbol: p.params.symbol,
+ tx_hash: hash,
+ block: Number(receipt.blockNumber),
+ gas_used: receipt.gasUsed.toString(),
+ spent_eth: formatEther(p.tx.value + receipt.gasUsed * receipt.effectiveGasPrice),
+ spent_usd: usd,
+ opening_buy: launched.openingBuy
+ ? { eth: formatEther(launched.openingBuy.quoteIn), tokens: formatEther(launched.openingBuy.tokensOut) }
+ : null,
+ urls: {
+ pons: venueUrl,
+ explorer: explorerTx(CHAIN, hash),
+ coin: `/markets/robinhood/coin/${launched.token}`,
+ },
+ };
+}
diff --git a/api/_lib/paired-directory.js b/api/_lib/paired-directory.js
new file mode 100644
index 000000000..b1d46be09
--- /dev/null
+++ b/api/_lib/paired-directory.js
@@ -0,0 +1,188 @@
+// What a paired coin is beyond its curves: its descriptor (logo, description,
+// links) and, when a three.ws agent launched it, that agent.
+//
+// The descriptor lives off chain, but the coin commits keccak256 of its exact
+// bytes at launch (PairedToken.metadataHash), so a descriptor is only shown as
+// verified when the bytes fetched hash to that commitment. Content addressing
+// makes the host irrelevant: three.ws and paired.exchange descriptors read the
+// same way, and a fetched descriptor is cached for a day because it cannot
+// change without failing verification.
+
+import { keccak256 } from 'viem';
+import { sql } from './db.js';
+import { cacheWrap } from './cache.js';
+import { thumbnailUrl } from './r2.js';
+import { fetchUpstream } from './upstream-fetch.js';
+import { publicClient } from './robinhood.js';
+import { coinCached, erc20Abi, launchpadConfig, listCoins } from './paired-launchpad.js';
+import { pairedMarkets, withUsd } from './paired-markets.js';
+import { INTERVALS, coinTradesCached, launchBlockOf, toCandles } from './paired-trades.js';
+
+const MAX_DESCRIPTOR_BYTES = 64 * 1024;
+
+function httpsOrNull(v) {
+ try {
+ const u = new URL(String(v));
+ return u.protocol === 'https:' ? u.toString() : null;
+ } catch {
+ return null;
+ }
+}
+
+/** The descriptor at a metadata URI, with whether its bytes match the on-chain hash. */
+export async function coinDescriptor(token, metadataURI) {
+ const url = httpsOrNull(metadataURI);
+ if (!url) return null;
+ return cacheWrap(`paired:descriptor:${String(token).toLowerCase()}`, 86_400, async () => {
+ const [res, committed] = await Promise.all([
+ fetchUpstream(url, {}, { name: 'paired:descriptor', timeoutMs: 8_000, attempts: 2, okWhen: (r) => r.ok }).catch(() => null),
+ publicClient(false).readContract({ address: token, abi: erc20Abi, functionName: 'metadataHash' }).catch(() => null),
+ ]);
+ if (!res) return null;
+ const bytes = Buffer.from(await res.arrayBuffer());
+ if (bytes.byteLength > MAX_DESCRIPTOR_BYTES) return null;
+ let json;
+ try {
+ json = JSON.parse(bytes.toString('utf8'));
+ } catch {
+ return null;
+ }
+ const links = json.links && typeof json.links === 'object' ? json.links : {};
+ return {
+ description: typeof json.description === 'string' ? json.description.slice(0, 600) : null,
+ image: httpsOrNull(json.image),
+ links: { website: httpsOrNull(links.website), twitter: httpsOrNull(links.twitter), telegram: httpsOrNull(links.telegram) },
+ origin: json.origin && typeof json.origin === 'object' ? json.origin : null,
+ verified: committed != null && keccak256(bytes) === committed,
+ };
+ });
+}
+
+/**
+ * The three.ws agent behind each coin it launched, keyed by lower-case token
+ * address. Coins launched elsewhere (directly on paired.exchange) are absent.
+ */
+export async function launchingAgents(tokens) {
+ const list = [...new Set(tokens.map((t) => String(t)))];
+ if (!list.length) return new Map();
+ const rows = await sql`
+ select f.mint, f.created_at, ai.id as agent_id, ai.name as agent_name,
+ a.thumbnail_key, a.visibility
+ from fixed_supply_launches f
+ left join agent_identities ai on ai.id = f.agent_id and ai.deleted_at is null
+ left join avatars a on a.id = ai.avatar_id and a.deleted_at is null
+ where f.chain = 'robinhood' and f.venue = 'paired' and f.mint = any(${list})
+ `;
+ const out = new Map();
+ for (const r of rows) {
+ if (!r.agent_id) continue;
+ const shown = r.visibility === 'public' || r.visibility === 'unlisted';
+ out.set(String(r.mint).toLowerCase(), {
+ id: r.agent_id,
+ name: r.agent_name,
+ avatar: shown && r.thumbnail_key ? thumbnailUrl(r.thumbnail_key) : null,
+ url: `/agents/${r.agent_id}`,
+ launchedAt: r.created_at ? new Date(r.created_at).toISOString() : null,
+ });
+ }
+ return out;
+}
+
+export const pairedCoinUrl = (address) => `/markets/robinhood/paired/${address}`;
+
+/**
+ * Paired coins newest first, each with dollar prices, its verified descriptor
+ * and its launching agent. `agentId` narrows to coins one three.ws agent
+ * launched; otherwise the list is every coin on the launchpad.
+ */
+export async function pairedCoinList({ limit = 24, offset = 0, agentId = null } = {}) {
+ let coins;
+ let total;
+ if (agentId) {
+ const rows = await sql`
+ select mint from fixed_supply_launches
+ where chain = 'robinhood' and venue = 'paired' and agent_id = ${agentId}
+ order by created_at desc limit ${limit} offset ${offset}
+ `;
+ coins = (await Promise.all(rows.map((r) => coinCached(r.mint).catch(() => null)))).filter(Boolean);
+ const [{ n }] = await sql`
+ select count(*)::int as n from fixed_supply_launches
+ where chain = 'robinhood' and venue = 'paired' and agent_id = ${agentId}
+ `;
+ total = n;
+ } else {
+ ({ items: coins, total } = await listCoins({ limit, offset }));
+ }
+
+ const [markets, agents, descriptors] = await Promise.all([
+ pairedMarkets({ includeDisabled: true }),
+ launchingAgents(coins.map((c) => c.address)),
+ Promise.all(coins.map((c) => coinDescriptor(c.address, c.metadataURI).catch(() => null))),
+ ]);
+ const byQuote = new Map(markets.map((m) => [m.address.toLowerCase(), m]));
+ const priceByQuote = new Map(markets.map((m) => [m.address.toLowerCase(), m.priceUsd]));
+
+ const items = coins.map((c, i) => {
+ const priced = withUsd(c, priceByQuote);
+ return {
+ ...priced,
+ pairs: priced.pairs.map((p) => ({ ...p, quoteClass: byQuote.get(p.quoteToken.toLowerCase())?.assetClass ?? 'unlisted' })),
+ descriptor: descriptors[i],
+ agent: agents.get(c.address.toLowerCase()) ?? null,
+ url: pairedCoinUrl(c.address),
+ };
+ });
+ return { coins: items, total, limit, offset, hasMore: offset + items.length < total };
+}
+
+const RECENT_TRADES = 60;
+
+/**
+ * One paired coin in full: pools priced in dollars with per-pool candles in
+ * that pool's own quote units, the verified descriptor, the launching agent,
+ * and the latest trades. Null when the address is not a coin on the launchpad.
+ */
+export async function pairedCoinDetail(address, { interval = '1h' } = {}) {
+ const coin = await coinCached(address).catch(() => null);
+ if (!coin) return null;
+ const step = INTERVALS[interval] ? interval : '1h';
+
+ const [config, markets, agents, descriptor, trades, launch] = await Promise.all([
+ launchpadConfig(),
+ pairedMarkets({ includeDisabled: true }),
+ launchingAgents([coin.address]),
+ coinDescriptor(coin.address, coin.metadataURI).catch(() => null),
+ coinTradesCached(coin.address),
+ launchBlockOf(coin.address),
+ ]);
+ const byQuote = new Map(markets.map((m) => [m.address.toLowerCase(), m]));
+ const priced = withUsd(coin, new Map(markets.map((m) => [m.address.toLowerCase(), m.priceUsd])));
+
+ const pairs = priced.pairs.map((p) => {
+ const m = byQuote.get(p.quoteToken.toLowerCase());
+ const poolTrades = trades.filter((t) => t.quoteToken.toLowerCase() === p.quoteToken.toLowerCase());
+ return {
+ ...p,
+ quoteClass: m?.assetClass ?? 'unlisted',
+ quoteName: m?.name ?? p.quoteSymbol,
+ quotePriceUsd: m?.priceUsd ?? null,
+ trades: poolTrades.length,
+ volume: poolTrades.reduce((s, t) => s + t.quoteAmount, 0),
+ candles: toCandles(poolTrades, INTERVALS[step]),
+ };
+ });
+
+ return {
+ ...priced,
+ pairs,
+ descriptor,
+ agent: agents.get(coin.address.toLowerCase()) ?? null,
+ launch,
+ url: pairedCoinUrl(coin.address),
+ terms: { swapFeeBps: config.swapFeeBps, creatorShareBps: config.creatorShareBps, launchpad: config.launchpad },
+ interval: step,
+ intervals: Object.keys(INTERVALS),
+ trades: trades.slice(-RECENT_TRADES).reverse(),
+ tradeCount: trades.length,
+ };
+}
diff --git a/api/_lib/paired-launchpad.js b/api/_lib/paired-launchpad.js
new file mode 100644
index 000000000..070fff1b8
--- /dev/null
+++ b/api/_lib/paired-launchpad.js
@@ -0,0 +1,318 @@
+// Paired launchpad: coins on Robinhood Chain (4663) quoted in up to five assets.
+//
+// A paired coin has a fixed 1B supply split across one to five constant-product
+// curves, one per quote asset (a tokenized stock, WETH, a stablecoin, a chain
+// coin). Each curve starts from a virtual quote reserve, so launching costs only
+// the flat ETH fee and the creator never needs to hold the assets it pairs
+// against. Liquidity never migrates and nobody can withdraw it. The creator
+// earns 70% of every swap fee, in each quote asset it trades in.
+//
+// The contract is the paired.exchange launchpad, vendored at
+// contracts/paired-launchpad/ and proven byte-identical to the deployment below.
+// It is the only source of truth: which coins exist, which assets they pair
+// with, prices and reserves all come from it, so nothing here can show a coin
+// or a market the chain does not have.
+//
+// Quote assets do not share decimals (stock tokens and WETH are 18, USDG is 6,
+// cbBTC is 8), so every amount is formatted with the decimals of the asset it is
+// denominated in, never an assumed 18.
+
+import { formatUnits, parseAbiItem } from 'viem';
+import { cacheWrap } from './cache.js';
+import { BLOCKSCOUT_BASE, HOOD_MAINNET, erc20Metadata, publicClient } from './robinhood.js';
+
+export const PAIRED_CHAIN_ID = HOOD_MAINNET.id;
+export const DEFAULT_LAUNCHPAD = '0x6a546350f79DE0Fc83ADfCe99233183aA090fa15';
+/** First block the launchpad emitted anything; log scans never start earlier. */
+export const LAUNCHPAD_START_BLOCK = 48_325_951n;
+
+export const TOTAL_SUPPLY = 1_000_000_000n * 10n ** 18n;
+export const TOKEN_DECIMALS = 18;
+export const BPS = 10_000;
+export const MAX_MARKETS = 5;
+export const NO_DEV_BUY = 255;
+export const CREATOR_FEE_SHARE_BPS = 7_000;
+
+/** The deployed launchpad, overridable for a fresh deployment. */
+export function launchpadAddress() {
+ const configured = String(process.env.PAIRED_LAUNCHPAD || '').trim();
+ return /^0x[0-9a-fA-F]{40}$/.test(configured) ? configured : DEFAULT_LAUNCHPAD;
+}
+
+export const explorerAddress = (address) => `${BLOCKSCOUT_BASE}/address/${address}`;
+export const explorerTx = (hash) => `${BLOCKSCOUT_BASE}/tx/${hash}`;
+
+export const LAUNCHPAD_ERRORS = [
+ 'NotOwner', 'Reentrancy', 'Expired', 'BadFee', 'NoMarkets', 'TooManyMarkets', 'WeightsMustTotalBps',
+ 'DuplicateMarket', 'QuoteNotEnabled', 'UnknownMarket', 'ZeroAmount', 'SlippageExceeded', 'NothingToClaim',
+ 'BadDevBuy', 'NameOrSymbolEmpty', 'NotFeeRecipient', 'FeeTooHigh', 'TransferToTreasuryFailed',
+];
+
+const CURVE_TUPLE = {
+ type: 'tuple',
+ components: [
+ { name: 'virtualQuote', type: 'uint256' },
+ { name: 'virtualToken', type: 'uint256' },
+ { name: 'realQuote', type: 'uint256' },
+ { name: 'tokensLeft', type: 'uint256' },
+ { name: 'weightBps', type: 'uint16' },
+ { name: 'exists', type: 'bool' },
+ ],
+};
+
+const view = (name, inputs, outputs) => ({ name, type: 'function', stateMutability: 'view', inputs, outputs });
+const addr = { type: 'address' };
+const u256 = { type: 'uint256' };
+
+export const launchpadAbi = [
+ {
+ name: 'launch',
+ type: 'function',
+ stateMutability: 'payable',
+ inputs: [{
+ name: 'p',
+ type: 'tuple',
+ components: [
+ { name: 'name', type: 'string' },
+ { name: 'symbol', type: 'string' },
+ { name: 'metadataURI', type: 'string' },
+ { name: 'metadataHash', type: 'bytes32' },
+ {
+ name: 'allocations',
+ type: 'tuple[]',
+ components: [{ name: 'quoteToken', type: 'address' }, { name: 'weightBps', type: 'uint16' }],
+ },
+ { name: 'creatorFeeRecipient', type: 'address' },
+ { name: 'devBuyMarket', type: 'uint8' },
+ { name: 'devBuyQuoteIn', type: 'uint256' },
+ { name: 'devBuyMinTokensOut', type: 'uint256' },
+ { name: 'deadline', type: 'uint256' },
+ ],
+ }],
+ outputs: [{ name: 'token', type: 'address' }],
+ },
+ {
+ name: 'buy',
+ type: 'function',
+ stateMutability: 'nonpayable',
+ inputs: [{ name: 'token', ...addr }, { name: 'quoteToken', ...addr }, { name: 'quoteIn', ...u256 }, { name: 'minTokensOut', ...u256 }],
+ outputs: [{ name: 'tokensOut', ...u256 }],
+ },
+ {
+ name: 'sell',
+ type: 'function',
+ stateMutability: 'nonpayable',
+ inputs: [{ name: 'token', ...addr }, { name: 'quoteToken', ...addr }, { name: 'tokensIn', ...u256 }, { name: 'minQuoteOut', ...u256 }],
+ outputs: [{ name: 'quoteOut', ...u256 }],
+ },
+ { name: 'claimFees', type: 'function', stateMutability: 'nonpayable', inputs: [{ name: 'assets', type: 'address[]' }], outputs: [u256] },
+ { name: 'setFeeRecipient', type: 'function', stateMutability: 'nonpayable', inputs: [addr, addr], outputs: [] },
+ {
+ name: 'setQuoteConfig',
+ type: 'function',
+ stateMutability: 'nonpayable',
+ inputs: [{ name: 'quoteToken', ...addr }, { name: 'virtualQuote', type: 'uint128' }, { name: 'enabled', type: 'bool' }],
+ outputs: [],
+ },
+ view('owner', [], [addr]),
+ view('treasury', [], [addr]),
+ view('launchFeeWei', [], [u256]),
+ view('swapFeeBps', [], [{ type: 'uint16' }]),
+ view('tokenCount', [], [u256]),
+ view('tokenAt', [u256], [addr]),
+ view('quoteTokens', [], [{ type: 'address[]' }]),
+ view('quoteConfig', [addr], [{ name: 'virtualQuote', type: 'uint128' }, { name: 'enabled', type: 'bool' }]),
+ view('marketsOf', [addr], [{ type: 'address[]' }]),
+ view('curveOf', [addr, addr], [CURVE_TUPLE]),
+ view('creatorOf', [addr], [addr]),
+ view('feeRecipientOf', [addr], [addr]),
+ view('claimable', [addr, addr], [u256]),
+ view('priceOf', [addr, addr], [u256]),
+ view('quoteBuy', [addr, addr, u256], [{ name: 'tokensOut', ...u256 }, { name: 'fee', ...u256 }]),
+ view('quoteSell', [addr, addr, u256], [{ name: 'quoteOut', ...u256 }, { name: 'fee', ...u256 }]),
+ ...LAUNCHPAD_ERRORS.map((name) => ({ name, type: 'error', inputs: [] })),
+];
+
+export const erc20Abi = [
+ view('name', [], [{ type: 'string' }]),
+ view('symbol', [], [{ type: 'string' }]),
+ view('decimals', [], [{ type: 'uint8' }]),
+ view('totalSupply', [], [u256]),
+ view('balanceOf', [addr], [u256]),
+ view('allowance', [addr, addr], [u256]),
+ view('metadataURI', [], [{ type: 'string' }]),
+ view('metadataHash', [], [{ type: 'bytes32' }]),
+ { name: 'approve', type: 'function', stateMutability: 'nonpayable', inputs: [addr, u256], outputs: [{ type: 'bool' }] },
+];
+
+export const launchedEvent = parseAbiItem(
+ 'event Launched(address indexed token, address indexed creator, string name, string symbol, string metadataURI, (address quoteToken, uint16 weightBps)[] allocations)',
+);
+export const swapEvent = parseAbiItem(
+ 'event Swap(address indexed token, address indexed quoteToken, address indexed trader, bool isBuy, uint256 quoteAmount, uint256 tokenAmount, uint256 feeAmount)',
+);
+
+const read = (functionName, args = []) =>
+ publicClient(false).readContract({ address: launchpadAddress(), abi: launchpadAbi, functionName, args });
+
+/** Launch fee, swap fee and ownership as the contract has them right now. */
+export async function launchpadConfig() {
+ return cacheWrap(`paired:config:${launchpadAddress()}`, 60, async () => {
+ const [launchFeeWei, swapFeeBps, owner, treasury, tokenCount] = await Promise.all([
+ read('launchFeeWei'), read('swapFeeBps'), read('owner'), read('treasury'), read('tokenCount'),
+ ]);
+ return {
+ chainId: PAIRED_CHAIN_ID,
+ launchpad: launchpadAddress(),
+ launchFeeWei: launchFeeWei.toString(),
+ launchFeeEth: formatUnits(launchFeeWei, 18),
+ swapFeeBps: Number(swapFeeBps),
+ creatorShareBps: CREATOR_FEE_SHARE_BPS,
+ maxMarkets: MAX_MARKETS,
+ totalSupply: formatUnits(TOTAL_SUPPLY, TOKEN_DECIMALS),
+ owner,
+ treasury,
+ tokenCount: Number(tokenCount),
+ explorer: explorerAddress(launchpadAddress()),
+ };
+ });
+}
+
+/**
+ * Every quote asset the launchpad has ever registered, with its on-chain
+ * config and ERC-20 metadata, in one multicall per field. Disabled quotes are
+ * included (with `enabled: false`) so an existing coin's disabled pool still
+ * renders with the right symbol and decimals.
+ */
+export async function quoteRegistry() {
+ return cacheWrap(`paired:quotes:${launchpadAddress()}`, 300, async () => {
+ const quotes = await read('quoteTokens');
+ if (!quotes.length) return [];
+ const client = publicClient(false);
+ const configs = await client.multicall({
+ contracts: quotes.map((q) => ({ address: launchpadAddress(), abi: launchpadAbi, functionName: 'quoteConfig', args: [q] })),
+ allowFailure: true,
+ });
+ const meta = await erc20Metadata(quotes);
+ return quotes.map((address, i) => {
+ const cfg = configs[i]?.status === 'success' ? configs[i].result : [0n, false];
+ const m = meta[address.toLowerCase()] || {};
+ const decimals = m.decimals ?? 18;
+ return {
+ address,
+ symbol: m.symbol || '?',
+ name: m.name || m.symbol || address,
+ decimals,
+ enabled: Boolean(cfg[1]),
+ virtualQuote: formatUnits(cfg[0], decimals),
+ virtualQuoteRaw: cfg[0].toString(),
+ };
+ });
+ });
+}
+
+/** Token address → registry row, for formatting amounts in the right decimals. */
+export async function quoteIndex() {
+ const rows = await quoteRegistry();
+ return new Map(rows.map((r) => [r.address.toLowerCase(), r]));
+}
+
+/** Quote units per whole coin at the curve's current point. */
+export function curvePrice(virtualQuote, virtualToken, quoteDecimals) {
+ const vt = Number(formatUnits(BigInt(virtualToken), TOKEN_DECIMALS));
+ return vt > 0 ? Number(formatUnits(BigInt(virtualQuote), quoteDecimals)) / vt : 0;
+}
+
+/**
+ * A launched coin with every pool it trades in. Prices are quote units per
+ * whole coin; `raised` is the real quote a pool holds, the only number here
+ * that is a claim on something rather than a quote.
+ */
+export async function loadCoin(token) {
+ const client = publicClient(false);
+ const lp = launchpadAddress();
+ const [name, symbol, metadataURI, creator, feeRecipient, markets] = await Promise.all([
+ client.readContract({ address: token, abi: erc20Abi, functionName: 'name' }),
+ client.readContract({ address: token, abi: erc20Abi, functionName: 'symbol' }),
+ client.readContract({ address: token, abi: erc20Abi, functionName: 'metadataURI' }).catch(() => ''),
+ read('creatorOf', [token]),
+ read('feeRecipientOf', [token]),
+ read('marketsOf', [token]),
+ ]);
+ if (!markets.length) return null;
+
+ const quotes = await quoteIndex();
+ const curves = await client.multicall({
+ contracts: markets.map((q) => ({ address: lp, abi: launchpadAbi, functionName: 'curveOf', args: [token, q] })),
+ allowFailure: false,
+ });
+
+ const pairs = markets.map((quoteToken, i) => {
+ const curve = curves[i];
+ const q = quotes.get(quoteToken.toLowerCase()) || { symbol: '?', decimals: 18 };
+ const allocation = (TOTAL_SUPPLY * BigInt(curve.weightBps)) / BigInt(BPS);
+ const sold = allocation > curve.tokensLeft ? allocation - curve.tokensLeft : 0n;
+ // Price from the reserves rather than priceOf(), which rounds to whole
+ // quote base units: on a 6-decimal stablecoin that truncates a young
+ // coin's price to one or two significant digits.
+ const price = curvePrice(curve.virtualQuote, curve.virtualToken, q.decimals);
+ return {
+ quoteToken,
+ quoteSymbol: q.symbol,
+ quoteDecimals: q.decimals,
+ weightBps: Number(curve.weightBps),
+ price,
+ // Market cap in the quote asset: the whole supply at this pool's price.
+ marketCap: price * 1e9,
+ raised: formatUnits(curve.realQuote, q.decimals),
+ tokensLeft: formatUnits(curve.tokensLeft, TOKEN_DECIMALS),
+ soldPct: allocation === 0n ? 0 : Number((sold * 10_000n) / allocation) / 100,
+ virtualQuote: curve.virtualQuote.toString(),
+ virtualToken: curve.virtualToken.toString(),
+ };
+ });
+
+ return {
+ address: token,
+ chainId: PAIRED_CHAIN_ID,
+ name,
+ symbol,
+ metadataURI,
+ creator,
+ feeRecipient,
+ pairs,
+ explorer: explorerAddress(token),
+ };
+}
+
+export const coinCached = (token) => cacheWrap(`paired:coin:${String(token).toLowerCase()}`, 10, () => loadCoin(token));
+
+/** Coins newest first; the contract appends, so the tail is the front page. */
+export async function listCoins({ limit = 24, offset = 0 } = {}) {
+ const count = Number(await read('tokenCount'));
+ const indices = [];
+ for (let i = count - 1 - offset; i >= 0 && indices.length < limit; i--) indices.push(BigInt(i));
+ const client = publicClient(false);
+ const addresses = indices.length
+ ? await client.multicall({
+ contracts: indices.map((i) => ({ address: launchpadAddress(), abi: launchpadAbi, functionName: 'tokenAt', args: [i] })),
+ allowFailure: false,
+ })
+ : [];
+ const coins = await Promise.all(addresses.map((a) => coinCached(a).catch(() => null)));
+ return { items: coins.filter(Boolean), total: count };
+}
+
+/** Fees a wallet can claim right now, per quote asset it has earned in. */
+export async function claimableFees(wallet) {
+ const quotes = await quoteRegistry();
+ if (!quotes.length) return [];
+ const amounts = await publicClient(false).multicall({
+ contracts: quotes.map((q) => ({ address: launchpadAddress(), abi: launchpadAbi, functionName: 'claimable', args: [wallet, q.address] })),
+ allowFailure: true,
+ });
+ return quotes
+ .map((q, i) => ({ quoteToken: q.address, symbol: q.symbol, decimals: q.decimals, raw: amounts[i]?.status === 'success' ? amounts[i].result : 0n }))
+ .filter((r) => r.raw > 0n)
+ .map((r) => ({ quoteToken: r.quoteToken, symbol: r.symbol, amount: formatUnits(r.raw, r.decimals), raw: r.raw.toString() }));
+}
diff --git a/api/_lib/paired-markets.js b/api/_lib/paired-markets.js
new file mode 100644
index 000000000..316633a9a
--- /dev/null
+++ b/api/_lib/paired-markets.js
@@ -0,0 +1,204 @@
+// The markets a paired coin can trade in, and the rules for picking them.
+//
+// The launchpad's quote registry decides WHICH assets a coin may pair against.
+// This layer adds what the contract cannot know: what kind of asset each one is
+// (tokenized stock, stablecoin, major, chain-native coin), its live USD price,
+// and what a new pool in it opens at in dollars. Classification and prices come
+// from the Robinhood Chain universe (data/hood-portfolios-universe.json, re-priced
+// live), which also resolves ticker impersonation by contract address. Pairing is
+// always by address; a symbol is only ever a lookup key into the registry.
+
+import { formatUnits, parseUnits } from 'viem';
+import { BPS, MAX_MARKETS, quoteRegistry } from './paired-launchpad.js';
+import { liveUniverse } from './hood-portfolios.js';
+import { dexPairsForToken } from './robinhood.js';
+
+export const MARKET_CLASSES = ['rwa-equity', 'stablecoin', 'crypto-major', 'crypto-native'];
+
+export const CLASS_LABELS = {
+ 'rwa-equity': 'Stock',
+ stablecoin: 'Stablecoin',
+ 'crypto-major': 'Major',
+ 'crypto-native': 'Chain coin',
+ unlisted: 'Unlisted',
+};
+
+export class PairedMarketError extends Error {
+ constructor(message, status = 400) {
+ super(message);
+ this.name = 'PairedMarketError';
+ this.status = status;
+ }
+}
+
+/**
+ * Price and depth for an asset the universe could not see. Assets like USDG
+ * and the chain's own coins mostly sit on the QUOTE side of their pools, which
+ * a base-token lookup never sees, so the price is derived from the pool (base
+ * USD price divided by base-per-quote) and the depth is the sum of every pool
+ * it quotes. A classified stablecoin with no readable pool falls back to its
+ * peg for price.
+ */
+export async function dexFallback(address, assetClass) {
+ const want = String(address).toLowerCase();
+ const pairs = await dexPairsForToken(want).catch(() => []);
+ let priceUsd = null;
+ let liquidityUsd = 0;
+ for (const p of pairs) {
+ const pairUsd = Number(p.priceUsd);
+ const priceNative = Number(p.priceNative);
+ const isBase = String(p.baseToken?.address).toLowerCase() === want;
+ const isQuote = String(p.quoteToken?.address).toLowerCase() === want;
+ if (!isBase && !isQuote) continue;
+ liquidityUsd += Number(p.liquidity?.usd) || 0;
+ if (priceUsd != null || !(pairUsd > 0)) continue;
+ if (isBase) priceUsd = pairUsd;
+ else if (priceNative > 0) priceUsd = pairUsd / priceNative;
+ }
+ if (priceUsd == null && assetClass === 'stablecoin') priceUsd = 1;
+ return { priceUsd, liquidityUsd };
+}
+
+/**
+ * Every registered quote with its class and live price. `openingValueUsd` is
+ * the dollar market cap a coin opens at with 100% of its supply in this pool:
+ * the virtual reserve, which is the curve's starting market cap in the quote.
+ */
+export async function pairedMarkets({ includeDisabled = false } = {}) {
+ const [registry, universe] = await Promise.all([
+ quoteRegistry(),
+ liveUniverse().catch(() => ({ tokens: [] })),
+ ]);
+ const byAddress = new Map(universe.tokens.map((t) => [t.address.toLowerCase(), t]));
+
+ const rows = await Promise.all(registry.map(async (q) => {
+ const u = byAddress.get(q.address.toLowerCase());
+ const fallback = u?.priceUsd ? null : await dexFallback(q.address, u?.assetClass);
+ const priceUsd = u?.priceUsd ?? fallback?.priceUsd ?? null;
+ return {
+ address: q.address,
+ symbol: q.symbol,
+ name: q.name,
+ decimals: q.decimals,
+ enabled: q.enabled,
+ assetClass: u?.assetClass ?? 'unlisted',
+ classLabel: CLASS_LABELS[u?.assetClass] ?? CLASS_LABELS.unlisted,
+ // A registered quote the universe flags as a ticker squatter is still
+ // shown (the chain lets coins pair with it), but never unmarked.
+ canonical: u ? u.canonical : null,
+ priceUsd,
+ liquidityUsd: fallback ? fallback.liquidityUsd : (u?.liquidityUsd ?? null),
+ change24hPct: u?.change24hPct ?? null,
+ virtualQuote: q.virtualQuote,
+ openingValueUsd: priceUsd != null ? Number(q.virtualQuote) * priceUsd : null,
+ };
+ }));
+
+ const order = (r) => {
+ const i = MARKET_CLASSES.indexOf(r.assetClass);
+ return i === -1 ? MARKET_CLASSES.length : i;
+ };
+ return rows
+ .filter((r) => includeDisabled || r.enabled)
+ .sort((a, b) => order(a) - order(b) || (b.liquidityUsd ?? 0) - (a.liquidityUsd ?? 0) || a.symbol.localeCompare(b.symbol));
+}
+
+/** Split 100% evenly in basis points, handing the remainder to the first markets. */
+export function evenWeights(count) {
+ const base = Math.floor(BPS / count);
+ const weights = Array.from({ length: count }, () => base);
+ let remainder = BPS - base * count;
+ for (let i = 0; remainder > 0; i = (i + 1) % count, remainder--) weights[i] += 1;
+ return weights;
+}
+
+/** Accepts `NVDA`, `$nvda`, the tokenized `NVDAx`, or a 0x address. */
+function matchMarket(markets, raw) {
+ const text = String(raw ?? '').trim();
+ if (/^0x[0-9a-fA-F]{40}$/.test(text)) {
+ return markets.find((m) => m.address.toLowerCase() === text.toLowerCase()) ?? null;
+ }
+ const key = text.replace(/^\$/, '').toUpperCase();
+ if (!key) return null;
+ const exact = markets.filter((m) => m.symbol.toUpperCase() === key);
+ const found = exact.length ? exact : key.endsWith('X') ? markets.filter((m) => m.symbol.toUpperCase() === key.slice(0, -1)) : [];
+ if (found.length > 1) {
+ throw new PairedMarketError(`More than one market is called ${key}. Pass its contract address instead: ${found.map((m) => m.address).join(', ')}.`);
+ }
+ return found[0] ?? null;
+}
+
+/**
+ * Resolve what a caller asked to pair with into allocations the contract will
+ * accept: one to five distinct enabled quotes whose weights total exactly 100%.
+ * `weights` are percentages (e.g. [50, 30, 20]); omitted means an even split.
+ */
+export async function resolveAllocations(requested, weights) {
+ const list = Array.isArray(requested) ? requested : String(requested ?? '').split(',');
+ const wanted = list.map((s) => String(s).trim()).filter(Boolean);
+ if (!wanted.length) throw new PairedMarketError('Pick at least one market to pair against.');
+ if (wanted.length > MAX_MARKETS) throw new PairedMarketError(`A coin can pair with at most ${MAX_MARKETS} markets.`);
+
+ const markets = await pairedMarkets();
+ const picked = wanted.map((w) => {
+ const m = matchMarket(markets, w);
+ if (!m) throw new PairedMarketError(`${w} is not a market on the paired launchpad. List the markets to see what a coin can pair against.`);
+ return m;
+ });
+ if (new Set(picked.map((m) => m.address.toLowerCase())).size !== picked.length) {
+ throw new PairedMarketError('Each market can appear only once.');
+ }
+
+ let bps;
+ if (weights == null || (Array.isArray(weights) && weights.length === 0)) {
+ bps = evenWeights(picked.length);
+ } else {
+ if (!Array.isArray(weights) || weights.length !== picked.length) {
+ throw new PairedMarketError('Give one weight per market, as percentages that add up to 100.');
+ }
+ bps = weights.map((w) => Math.round(Number(w) * 100));
+ if (bps.some((w) => !Number.isFinite(w) || w <= 0)) throw new PairedMarketError('Every market weight must be above 0%.');
+ if (bps.reduce((a, b) => a + b, 0) !== BPS) throw new PairedMarketError('Market weights must add up to exactly 100%.');
+ }
+
+ return picked.map((m, i) => ({
+ quoteToken: m.address,
+ symbol: m.symbol,
+ decimals: m.decimals,
+ assetClass: m.assetClass,
+ canonical: m.canonical,
+ weightBps: bps[i],
+ priceUsd: m.priceUsd,
+ // What this pool opens at in dollars: its share of the full-weight reserve.
+ openingValueUsd: m.openingValueUsd != null ? (m.openingValueUsd * bps[i]) / BPS : null,
+ }));
+}
+
+/** Human amount in a quote's own decimals → base units, rejecting more precision than the asset has. */
+export function parseQuoteAmount(amount, decimals) {
+ const text = String(amount ?? '').trim();
+ const re = new RegExp(`^\\d+(\\.\\d{1,${decimals}})?$`);
+ if (!re.test(text)) throw new PairedMarketError(`Amounts in this asset take at most ${decimals} decimal places, like "0.5".`);
+ const raw = parseUnits(text, decimals);
+ if (raw === 0n) throw new PairedMarketError('The amount must be above zero.');
+ return raw;
+}
+
+export const formatQuote = (raw, decimals) => formatUnits(BigInt(raw), decimals);
+
+/**
+ * A coin with every pool priced in dollars from its quote asset's live USD
+ * price. The coin's own dollar market cap is the supply-weighted average of its
+ * pools: each pool prices the whole supply, and a pool holding more of it says
+ * more about what the coin trades at.
+ */
+export function withUsd(coin, priceByQuote) {
+ const pairs = coin.pairs.map((p) => {
+ const q = priceByQuote.get(p.quoteToken.toLowerCase());
+ return { ...p, priceUsd: q != null ? p.price * q : null, marketCapUsd: q != null ? p.marketCap * q : null };
+ });
+ const priced = pairs.filter((p) => p.marketCapUsd != null);
+ const weight = priced.reduce((s, p) => s + p.weightBps, 0);
+ const marketCapUsd = weight ? priced.reduce((s, p) => s + p.marketCapUsd * p.weightBps, 0) / weight : null;
+ return { ...coin, pairs, marketCapUsd };
+}
diff --git a/api/_lib/paired-trades.js b/api/_lib/paired-trades.js
new file mode 100644
index 000000000..32357e75d
--- /dev/null
+++ b/api/_lib/paired-trades.js
@@ -0,0 +1,162 @@
+// Trade history for paired coins, read from the launchpad's own events.
+//
+// Every buy and sell emits `Swap(token, quoteToken, trader, isBuy, quoteAmount,
+// tokenAmount, feeAmount)`, which is everything a trade feed and a candle need.
+// The chain is the log: there is no ingestion pipeline to fall behind.
+//
+// Robinhood Chain's RPC caps one eth_getLogs at 10,000,000 blocks (~11 days at
+// ~100ms blocks), so history is read in fixed 10M-block chunks counted from the
+// launchpad's first block. A chunk that ends well below the head can never
+// change, so it is cached for a day; only the newest chunk is re-read, briefly
+// cached. A coin's scan starts at the block it launched in, so a young coin
+// costs one call however long the launchpad has existed.
+
+import { createPublicClient, fallback, formatUnits, http } from 'viem';
+import { cacheWrap } from './cache.js';
+import { HOOD_MAINNET, publicClient, rpcUrls } from './robinhood.js';
+import { LAUNCHPAD_START_BLOCK, TOKEN_DECIMALS, launchedEvent, launchpadAddress, quoteIndex, swapEvent } from './paired-launchpad.js';
+
+export const LOG_CHUNK = 10_000_000n;
+// A chunk this far below the head is final for caching purposes.
+const FINALITY_BLOCKS = 2_000n;
+
+function chunkBounds(from, head) {
+ const chunks = [];
+ const first = (from - LAUNCHPAD_START_BLOCK) / LOG_CHUNK;
+ for (let i = first; LAUNCHPAD_START_BLOCK + i * LOG_CHUNK <= head; i++) {
+ const start = LAUNCHPAD_START_BLOCK + i * LOG_CHUNK;
+ const end = start + LOG_CHUNK - 1n;
+ chunks.push({ i, start: start < from ? from : start, end: end > head ? head : end, final: end + FINALITY_BLOCKS < head });
+ }
+ return chunks;
+}
+
+// Log scans get their own client with JSON-RPC batching off. The shared
+// client batches every concurrent call into one request, and this RPC drops
+// calls out of a large batch, which surfaces as a response with no entry for
+// the getLogs at all.
+let logClient = null;
+function logsClient() {
+ if (!logClient) {
+ const transports = rpcUrls(false).map((u) => http(u, { timeout: 15_000, retryCount: 2 }));
+ logClient = createPublicClient({
+ chain: HOOD_MAINNET,
+ transport: transports.length === 1 ? transports[0] : fallback(transports, { rank: false }),
+ });
+ }
+ return logClient;
+}
+
+const plain = (log) => ({
+ block: log.blockNumber.toString(),
+ txHash: log.transactionHash,
+ logIndex: log.logIndex,
+ args: Object.fromEntries(
+ Object.entries(log.args).map(([k, v]) => [k, typeof v === 'bigint' ? v.toString() : Array.isArray(v) ? v.map((x) => ({ ...x })) : v]),
+ ),
+});
+
+/** Every log of one launchpad event matching `args`, oldest first. */
+async function scanLaunchpad(event, eventName, args, from = LAUNCHPAD_START_BLOCK) {
+ const client = logsClient();
+ const head = await client.getBlockNumber();
+ const argKey = Object.entries(args).map(([k, v]) => `${k}=${String(v).toLowerCase()}`).join('&') || 'all';
+ const chunks = chunkBounds(from, head);
+ const batches = await Promise.all(
+ chunks.map(({ i, start, end, final }) =>
+ cacheWrap(`paired:logs:${launchpadAddress()}:${eventName}:${argKey}:${i}:${final ? 'f' : start}`, final ? 86_400 : 10, async () =>
+ (await client.getLogs({ address: launchpadAddress(), event, args, fromBlock: start, toBlock: end })).map(plain),
+ ),
+ ),
+ );
+ return batches.flat();
+}
+
+/** The block a coin launched in, from its own Launched event. Immutable, so cached long. */
+export async function launchBlockOf(token) {
+ return cacheWrap(`paired:launch-block:${String(token).toLowerCase()}`, 86_400, async () => {
+ const [log] = await scanLaunchpad(launchedEvent, 'Launched', { token });
+ return log ? { block: log.block, txHash: log.txHash } : null;
+ });
+}
+
+const blockTimes = new Map();
+
+async function timestampOf(block) {
+ if (blockTimes.has(block)) return blockTimes.get(block);
+ const b = await publicClient(false).getBlock({ blockNumber: BigInt(block) });
+ const seconds = Number(b.timestamp);
+ blockTimes.set(block, seconds);
+ return seconds;
+}
+
+/**
+ * Every swap of one coin, oldest first, with amounts in each pool's own
+ * decimals. `price` is quote units per whole coin for that fill.
+ */
+export async function coinTrades(token) {
+ const launch = await launchBlockOf(token);
+ if (!launch) return [];
+ const [logs, quotes] = await Promise.all([scanLaunchpad(swapEvent, 'Swap', { token }, BigInt(launch.block)), quoteIndex()]);
+ await Promise.all([...new Set(logs.map((l) => l.block))].map(timestampOf));
+ return logs
+ .map((l) => {
+ const q = quotes.get(String(l.args.quoteToken).toLowerCase()) || { symbol: '?', decimals: 18 };
+ const quoteAmount = Number(formatUnits(BigInt(l.args.quoteAmount), q.decimals));
+ const tokenAmount = Number(formatUnits(BigInt(l.args.tokenAmount), TOKEN_DECIMALS));
+ return {
+ txHash: l.txHash,
+ block: Number(l.block),
+ time: blockTimes.get(l.block) ?? 0,
+ trader: l.args.trader,
+ isBuy: l.args.isBuy,
+ quoteToken: l.args.quoteToken,
+ quoteSymbol: q.symbol,
+ quoteAmount,
+ tokenAmount,
+ fee: Number(formatUnits(BigInt(l.args.feeAmount), q.decimals)),
+ // A fill that rounds to zero tokens would poison every candle it
+ // touches with Infinity, so it carries no price.
+ price: tokenAmount > 0 ? quoteAmount / tokenAmount : null,
+ };
+ })
+ .sort((a, b) => a.block - b.block || a.time - b.time);
+}
+
+export const coinTradesCached = (token) => cacheWrap(`paired:trades:${String(token).toLowerCase()}`, 15, () => coinTrades(token));
+
+export const INTERVALS = { '1m': 60, '5m': 300, '15m': 900, '1h': 3_600, '4h': 14_400, '1d': 86_400 };
+
+/**
+ * OHLCV candles for one pool. Quiet intervals are filled forward with flat
+ * candles: a chart that skips the hours nobody traded compresses time and makes
+ * a quiet coin look busy.
+ */
+export function toCandles(trades, intervalSeconds) {
+ const buckets = new Map();
+ for (const t of trades) {
+ if (t.price == null) continue;
+ const time = Math.floor(t.time / intervalSeconds) * intervalSeconds;
+ const c = buckets.get(time);
+ if (!c) buckets.set(time, { time, open: t.price, high: t.price, low: t.price, close: t.price, volume: t.quoteAmount, trades: 1 });
+ else {
+ c.high = Math.max(c.high, t.price);
+ c.low = Math.min(c.low, t.price);
+ c.close = t.price;
+ c.volume += t.quoteAmount;
+ c.trades += 1;
+ }
+ }
+ const ordered = [...buckets.values()].sort((a, b) => a.time - b.time);
+ const filled = [];
+ for (const candle of ordered) {
+ const prev = filled[filled.length - 1];
+ if (prev) {
+ for (let t = prev.time + intervalSeconds; t < candle.time; t += intervalSeconds) {
+ filled.push({ time: t, open: prev.close, high: prev.close, low: prev.close, close: prev.close, volume: 0, trades: 0 });
+ }
+ }
+ filled.push(candle);
+ }
+ return filled;
+}
diff --git a/api/_lib/pons.js b/api/_lib/pons.js
new file mode 100644
index 000000000..df790358b
--- /dev/null
+++ b/api/_lib/pons.js
@@ -0,0 +1,517 @@
+// Pons V2 launchpad on Robinhood Chain (chain 4663): read terms, build the
+// launch transaction, quote the creator's opening buy, and read a launch back.
+//
+// Pons (ponsfamily.com) is the chain's busiest launchpad. Its V2 generation
+// mints the full supply onto a per-launch constant-product bonding curve
+// quoted in native ETH, then graduates into a permanently locked full-range
+// Uniswap V4 pool. Source is MIT and verified on chain:
+// https://github.com/ponsdotdev/pons-labs (contractsV2/src/v2).
+//
+// Every ABI fragment below is copied from that source, and the launch calldata
+// is proven against real mainnet launches in tests/pons.test.js: re-encoding a
+// decoded `launchAndBuy` / `launchToken` input reproduces the original bytes,
+// and the dev-buy quote reproduces the tokensOut the curve actually paid.
+//
+// A launch with an opening buy goes through PonsV2LaunchAndBuy (the factory's
+// trusted `launchForwarder`), the same router the Pons frontend uses: it
+// deploys the curve and token, records the signer as the real deployer, and
+// settles the creator's opening buy in the same transaction. Atomic matters on
+// a chain with 100ms blocks: a separate buy transaction would hand the first
+// fill to whichever sniper watches the factory. A launch with no buy calls the
+// factory directly, since the router refuses a zero buy.
+
+import { encodeFunctionData, getAddress, keccak256, parseEventLogs, toHex } from 'viem';
+import { erc20Metadata, publicClient } from './robinhood.js';
+import { cacheWrap } from './cache.js';
+
+export const PONS_CHAIN_ID = 4663;
+export const PONS_V2_FACTORY = '0x7eD598BcEf8bd9Edd8C97A195C6d13f40801EC7e';
+export const PONS_V2_LAUNCH_AND_BUY = '0xe33E9E479dF8802cb0866d5d05258bEc4cF62948';
+export const PONS_V2_MEME_HOOK = '0xE5e702641Ea86F4ae6cC3cDaeD2B886f976Be044';
+// Native ETH quote. Pons also approves ERC-20 quote assets, but the native
+// curve is the default launch on ponsfamily.com and the only one an agent
+// wallet can fund without an approval round trip.
+export const NATIVE_PAIR = '0x0000000000000000000000000000000000000000';
+export const DEFAULT_LAUNCH_CONFIG_ID = 0n;
+
+// On-chain caps enforced by PonsV2LaunchDeployer._requireMetadataWithinLimits.
+// Checked here first so an oversize field fails before any gas is spent.
+export const LIMITS = Object.freeze({
+ name: 64,
+ symbol: 16,
+ logo: 512,
+ description: 2048,
+ social: 256,
+});
+
+const BASIS_POINTS = 10_000n;
+const SOCIAL_KEYS = ['twitter', 'telegram', 'discord', 'website', 'farcaster'];
+
+const TOKEN_PARAMS = {
+ type: 'tuple',
+ name: 'params',
+ components: [
+ { type: 'string', name: 'name' },
+ { type: 'string', name: 'symbol' },
+ { type: 'string', name: 'logo' },
+ { type: 'string', name: 'description' },
+ {
+ type: 'tuple',
+ name: 'socials',
+ components: SOCIAL_KEYS.map((name) => ({ type: 'string', name })),
+ },
+ { type: 'address', name: 'creatorFeeRecipient' },
+ { type: 'uint16', name: 'creatorTaxBps' },
+ { type: 'bool', name: 'buybackEnabled' },
+ { type: 'bytes32', name: 'expectedEconomics' },
+ { type: 'bytes32', name: 'salt' },
+ ],
+};
+
+export const PONS_ABI = [
+ {
+ type: 'function',
+ name: 'launchAndBuy',
+ stateMutability: 'payable',
+ inputs: [
+ TOKEN_PARAMS,
+ { type: 'uint256', name: 'launchConfigId' },
+ { type: 'address', name: 'pairToken' },
+ { type: 'uint256', name: 'quoteIn' },
+ { type: 'uint256', name: 'minTokensOut' },
+ { type: 'address', name: 'recipient' },
+ { type: 'address[]', name: 'snipeTaxExemptions' },
+ ],
+ outputs: [{ type: 'address', name: 'token' }, { type: 'address', name: 'curve' }],
+ },
+ {
+ type: 'function',
+ name: 'launchToken',
+ stateMutability: 'payable',
+ inputs: [
+ TOKEN_PARAMS,
+ { type: 'uint256', name: 'launchConfigId' },
+ { type: 'address', name: 'pairToken' },
+ { type: 'address[]', name: 'snipeTaxExemptions' },
+ ],
+ outputs: [{ type: 'address', name: 'token' }, { type: 'address', name: 'curve' }],
+ },
+ { type: 'function', name: 'launchEnabled', stateMutability: 'view', inputs: [], outputs: [{ type: 'bool' }] },
+ { type: 'function', name: 'launchFee', stateMutability: 'view', inputs: [], outputs: [{ type: 'uint256' }] },
+ { type: 'function', name: 'maxCreatorTaxBps', stateMutability: 'view', inputs: [], outputs: [{ type: 'uint256' }] },
+ { type: 'function', name: 'launchForwarder', stateMutability: 'view', inputs: [], outputs: [{ type: 'address' }] },
+ {
+ type: 'function',
+ name: 'canLaunch',
+ stateMutability: 'view',
+ inputs: [{ type: 'address', name: 'launcher' }],
+ outputs: [{ type: 'bool' }],
+ },
+ {
+ type: 'function',
+ name: 'getLaunchConfig',
+ stateMutability: 'view',
+ inputs: [{ type: 'uint256', name: 'id' }],
+ outputs: [
+ {
+ type: 'tuple',
+ components: [
+ { type: 'uint256', name: 'supply' },
+ { type: 'uint256', name: 'curveFeeBps' },
+ { type: 'uint256', name: 'phantomQuote' },
+ { type: 'uint256', name: 'graduationThreshold' },
+ { type: 'uint24', name: 'poolFee' },
+ { type: 'int24', name: 'tickSpacing' },
+ { type: 'bool', name: 'enabled' },
+ ],
+ },
+ ],
+ },
+ {
+ type: 'function',
+ name: 'previewLaunchEconomics',
+ stateMutability: 'view',
+ inputs: [{ type: 'uint256', name: 'launchConfigId' }, { type: 'address', name: 'pairToken' }],
+ outputs: [{ type: 'bytes32' }],
+ },
+ {
+ type: 'event',
+ name: 'TokenLaunched',
+ inputs: [
+ { type: 'address', name: 'token', indexed: true },
+ { type: 'address', name: 'curve', indexed: true },
+ { type: 'address', name: 'deployer', indexed: true },
+ { type: 'address', name: 'pairToken', indexed: false },
+ { type: 'uint256', name: 'launchConfigId', indexed: false },
+ { type: 'uint256', name: 'graduationThreshold', indexed: false },
+ ],
+ },
+ {
+ type: 'event',
+ name: 'CurveBuy',
+ inputs: [
+ { type: 'address', name: 'buyer', indexed: true },
+ { type: 'address', name: 'recipient', indexed: true },
+ { type: 'uint256', name: 'quoteIn', indexed: false },
+ { type: 'uint256', name: 'tokensOut', indexed: false },
+ { type: 'uint256', name: 'fee', indexed: false },
+ { type: 'uint256', name: 'tax', indexed: false },
+ ],
+ },
+];
+
+export const PONS_CURVE_ABI = [
+ {
+ type: 'function',
+ name: 'getReserves',
+ stateMutability: 'view',
+ inputs: [],
+ outputs: [{ type: 'uint256', name: 'quoteReserve' }, { type: 'uint256', name: 'tokenReserve' }],
+ },
+ { type: 'function', name: 'realQuoteReserve', stateMutability: 'view', inputs: [], outputs: [{ type: 'uint256' }] },
+ { type: 'function', name: 'graduationThreshold', stateMutability: 'view', inputs: [], outputs: [{ type: 'uint256' }] },
+ { type: 'function', name: 'graduated', stateMutability: 'view', inputs: [], outputs: [{ type: 'bool' }] },
+ { type: 'function', name: 'token', stateMutability: 'view', inputs: [], outputs: [{ type: 'address' }] },
+];
+
+const ERC20_SUPPLY_ABI = [
+ { type: 'function', name: 'totalSupply', stateMutability: 'view', inputs: [], outputs: [{ type: 'uint256' }] },
+];
+
+/** keccak256 of the TokenLaunched signature: the factory-log filter topic. */
+export const TOKEN_LAUNCHED_TOPIC = keccak256(
+ toHex('TokenLaunched(address,address,address,address,uint256,uint256)'),
+);
+
+export class PonsError extends Error {
+ constructor(code, message, status = 400) {
+ super(message);
+ this.name = 'PonsError';
+ this.code = code;
+ this.status = status;
+ }
+}
+
+/**
+ * Live launch terms from the factory: whether public launching is open, the
+ * flat launch fee, the config the curve will be built from, the creator-tax
+ * ceiling, and the economics digest a launch pins so an owner re-peg between
+ * quote and send reverts instead of silently repricing.
+ */
+export async function readLaunchTerms({ launchConfigId = DEFAULT_LAUNCH_CONFIG_ID, pairToken = NATIVE_PAIR } = {}) {
+ const client = publicClient(false);
+ const read = (functionName, args = []) =>
+ client.readContract({ address: PONS_V2_FACTORY, abi: PONS_ABI, functionName, args });
+ const [launchEnabled, launchFee, maxCreatorTaxBps, forwarder, config, economics] = await Promise.all([
+ read('launchEnabled'),
+ read('launchFee'),
+ read('maxCreatorTaxBps'),
+ read('launchForwarder'),
+ read('getLaunchConfig', [launchConfigId]),
+ read('previewLaunchEconomics', [launchConfigId, pairToken]),
+ ]);
+ // The router address is hardcoded for calldata proofs; if Pons rotates its
+ // forwarder the factory would reject our launch with NotLaunchForwarder.
+ // Refuse up front with a clear reason instead of burning gas on a revert.
+ if (getAddress(forwarder) !== getAddress(PONS_V2_LAUNCH_AND_BUY)) {
+ throw new PonsError(
+ 'pons_router_rotated',
+ `Pons rotated its launch router to ${forwarder}; three.ws needs an update before launching.`,
+ 503,
+ );
+ }
+ return {
+ launchEnabled,
+ launchFee,
+ maxCreatorTaxBps,
+ launchConfigId,
+ pairToken,
+ config: {
+ supply: config.supply,
+ curveFeeBps: config.curveFeeBps,
+ phantomQuote: config.phantomQuote,
+ graduationThreshold: config.graduationThreshold,
+ poolFee: config.poolFee,
+ tickSpacing: config.tickSpacing,
+ enabled: config.enabled,
+ },
+ expectedEconomics: economics,
+ };
+}
+
+/**
+ * Tokens the creator's opening buy receives. The curve is brand new inside
+ * the launch transaction, so its reserves are exactly (phantomQuote, supply)
+ * and nobody can trade ahead of the buy: the quote is deterministic, and it is
+ * the same integer arithmetic PonsV2BondingCurve.buy runs, fee and creator tax
+ * taken off the quote leg first. Clamped to the sellable allocation the curve
+ * reserves for graduation.
+ */
+export function quoteOpeningBuy({ quoteIn, config, creatorTaxBps = 0 }) {
+ const spent = BigInt(quoteIn);
+ if (spent <= 0n) return 0n;
+ const fee = (spent * BigInt(config.curveFeeBps)) / BASIS_POINTS;
+ const tax = (spent * BigInt(creatorTaxBps)) / BASIS_POINTS;
+ const net = spent - fee - tax;
+ const reserveIn = BigInt(config.phantomQuote);
+ const reserveOut = BigInt(config.supply);
+ const out = (net * BASIS_POINTS * reserveOut) / (reserveIn * BASIS_POINTS + net * BASIS_POINTS);
+ const reserved = (reserveOut * reserveIn) / (reserveIn + BigInt(config.graduationThreshold));
+ const sellable = reserveOut - reserved;
+ return out > sellable ? sellable : out;
+}
+
+function cleanText(value, max, field) {
+ const text = String(value ?? '').trim();
+ if (Buffer.byteLength(text, 'utf8') > max) {
+ throw new PonsError('field_too_long', `${field} is longer than Pons allows (${max} bytes).`);
+ }
+ return text;
+}
+
+/**
+ * Validate and normalise the coin a caller wants to launch into the exact
+ * TokenParams struct the factory takes. Byte limits mirror the on-chain caps.
+ */
+export function buildTokenParams({
+ name,
+ symbol,
+ logo = '',
+ description = '',
+ socials = {},
+ creatorFeeRecipient,
+ creatorTaxBps = 0,
+ buybackEnabled = false,
+ expectedEconomics,
+ salt,
+}) {
+ const cleanName = cleanText(name, LIMITS.name, 'Name');
+ const cleanSymbol = cleanText(symbol, LIMITS.symbol, 'Symbol').replace(/^\$/, '').toUpperCase();
+ if (!cleanName) throw new PonsError('name_required', 'A coin name is required.');
+ if (!cleanSymbol) throw new PonsError('symbol_required', 'A ticker symbol is required.');
+ if (!/^[A-Z0-9]+$/.test(cleanSymbol)) {
+ throw new PonsError('symbol_invalid', 'Ticker may only use letters and digits.');
+ }
+ const cleanLogo = cleanText(logo, LIMITS.logo, 'Logo URL');
+ if (cleanLogo && !/^(https:\/\/|ipfs:\/\/|ar:\/\/)/i.test(cleanLogo)) {
+ throw new PonsError('logo_invalid', 'Logo must be an https://, ipfs:// or ar:// URL.');
+ }
+ const cleanSocials = {};
+ for (const key of SOCIAL_KEYS) {
+ const v = cleanText(socials?.[key], LIMITS.social, `${key} link`);
+ if (v && !/^https:\/\//i.test(v)) {
+ throw new PonsError('social_invalid', `The ${key} link must be an https:// URL.`);
+ }
+ cleanSocials[key] = v;
+ }
+ const tax = Number(creatorTaxBps);
+ if (!Number.isInteger(tax) || tax < 0) {
+ throw new PonsError('tax_invalid', 'Creator tax must be a whole number of basis points.');
+ }
+ if (!/^0x[0-9a-fA-F]{64}$/.test(String(salt || ''))) {
+ throw new PonsError('salt_invalid', 'Launch salt must be 32 bytes of hex.', 500);
+ }
+ return {
+ name: cleanName,
+ symbol: cleanSymbol,
+ logo: cleanLogo,
+ description: cleanText(description, LIMITS.description, 'Description'),
+ socials: cleanSocials,
+ creatorFeeRecipient: getAddress(creatorFeeRecipient),
+ creatorTaxBps: tax,
+ buybackEnabled: Boolean(buybackEnabled),
+ expectedEconomics: expectedEconomics || `0x${'0'.repeat(64)}`,
+ salt,
+ };
+}
+
+/**
+ * The launch transaction: target, calldata and value. With an opening buy it
+ * goes through PonsV2LaunchAndBuy, whose `msg.value` is the flat launch fee
+ * plus the buy, and the buy's recipient is the signer, so the creator's bag
+ * lands in the wallet that will later sell it. Without one it goes straight
+ * to the factory: the router reverts ZeroAmount() on a zero buy, and the
+ * factory's own launchToken is the path real bare launches take.
+ */
+export function buildLaunchTx({ params, terms, quoteIn = 0n, recipient }) {
+ if (params.creatorTaxBps > Number(terms.maxCreatorTaxBps)) {
+ throw new PonsError(
+ 'tax_too_high',
+ `Creator tax is capped at ${Number(terms.maxCreatorTaxBps) / 100}% on Pons.`,
+ );
+ }
+ const buy = BigInt(quoteIn);
+ if (buy <= 0n) {
+ return {
+ to: PONS_V2_FACTORY,
+ data: encodeFunctionData({
+ abi: PONS_ABI,
+ functionName: 'launchToken',
+ args: [params, terms.launchConfigId, terms.pairToken, []],
+ }),
+ value: BigInt(terms.launchFee),
+ minTokensOut: 0n,
+ };
+ }
+ const minTokensOut = quoteOpeningBuy({ quoteIn: buy, config: terms.config, creatorTaxBps: params.creatorTaxBps });
+ const data = encodeFunctionData({
+ abi: PONS_ABI,
+ functionName: 'launchAndBuy',
+ args: [
+ params,
+ terms.launchConfigId,
+ terms.pairToken,
+ buy,
+ minTokensOut,
+ getAddress(recipient),
+ [],
+ ],
+ });
+ return {
+ to: PONS_V2_LAUNCH_AND_BUY,
+ data,
+ value: BigInt(terms.launchFee) + buy,
+ minTokensOut,
+ };
+}
+
+/**
+ * Read the token, curve and opening fill out of a launch receipt. The factory
+ * emits TokenLaunched; the curve emits CurveBuy when there was an opening buy.
+ */
+export function parseLaunchReceipt(receipt) {
+ const events = parseEventLogs({ abi: PONS_ABI, logs: receipt.logs || [] });
+ const launched = events.find(
+ (e) => e.eventName === 'TokenLaunched' && getAddress(e.address) === getAddress(PONS_V2_FACTORY),
+ );
+ if (!launched) return null;
+ const curve = launched.args.curve;
+ const buy = events.find(
+ (e) => e.eventName === 'CurveBuy' && getAddress(e.address) === getAddress(curve),
+ );
+ return {
+ token: getAddress(launched.args.token),
+ curve: getAddress(curve),
+ deployer: getAddress(launched.args.deployer),
+ pairToken: launched.args.pairToken,
+ launchConfigId: launched.args.launchConfigId,
+ graduationThreshold: launched.args.graduationThreshold,
+ openingBuy: buy
+ ? { quoteIn: buy.args.quoteIn, tokensOut: buy.args.tokensOut, fee: buy.args.fee, tax: buy.args.tax }
+ : null,
+ };
+}
+
+/**
+ * Live bonding-curve progress for a launched coin: real ETH raised against the
+ * graduation threshold, and whether it has already moved to its V4 pool.
+ */
+export async function curveProgress(curve) {
+ const client = publicClient(false);
+ const read = (functionName) =>
+ client.readContract({ address: curve, abi: PONS_CURVE_ABI, functionName });
+ const [raised, threshold, graduated] = await Promise.all([
+ read('realQuoteReserve'),
+ read('graduationThreshold'),
+ read('graduated'),
+ ]);
+ const pct = threshold > 0n ? Number((raised * 10_000n) / threshold) / 100 : 0;
+ return { raisedWei: raised, thresholdWei: threshold, graduated, progressPct: graduated ? 100 : Math.min(100, pct) };
+}
+
+export function ponsCoinUrl(token) {
+ return `https://ponsfamily.com/launchpad/${getAddress(token)}`;
+}
+
+export function explorerTxUrl(hash) {
+ return `https://robinhoodchain.blockscout.com/tx/${hash}`;
+}
+
+// Pons launches roughly every two minutes, so an hour of 100ms blocks holds
+// dozens of them while staying inside the public RPC's eth_getLogs range cap.
+const RECENT_LAUNCH_BLOCKS = 36_000n;
+
+/**
+ * Spot price and graduation progress of a native-quoted curve from its
+ * multicall results: price is quote reserve over token reserve (the curve's
+ * marginal price, virtual reserve included), progress is real ETH raised over
+ * the threshold. Null fields when a read failed or the coin has graduated,
+ * since a graduated coin's price lives in its V4 pool, not here.
+ */
+export function curveState([reservesRes, raisedRes, graduatedRes] = [], threshold) {
+ const graduated = graduatedRes?.status === 'success' ? Boolean(graduatedRes.result) : null;
+ if (reservesRes?.status !== 'success' || graduated) {
+ return { graduated, priceEth: null, progressPct: graduated ? 100 : null };
+ }
+ const [quote, tokens] = reservesRes.result;
+ const priceEth = tokens > 0n ? Number(quote) / Number(tokens) : null;
+ const raised = raisedRes?.status === 'success' ? raisedRes.result : null;
+ const progressPct = raised != null && threshold > 0n
+ ? Math.min(100, Number((raised * 10_000n) / threshold) / 100)
+ : null;
+ return { graduated: graduated ?? false, priceEth, progressPct };
+}
+
+/**
+ * Newest Pons V2 launches, read straight from the factory's TokenLaunched logs
+ * over RPC (no indexer in the path), with each coin's name and symbol from one
+ * multicall and its launch time from its block. Cached 30s.
+ */
+export async function recentPonsLaunches({ limit = 40 } = {}) {
+ const rows = await cacheWrap('pons:v2:recent', 30, async () => {
+ const client = publicClient(false);
+ const head = await client.getBlockNumber();
+ const logs = await client.getLogs({
+ address: PONS_V2_FACTORY,
+ event: PONS_ABI.find((x) => x.type === 'event' && x.name === 'TokenLaunched'),
+ fromBlock: head > RECENT_LAUNCH_BLOCKS ? head - RECENT_LAUNCH_BLOCKS : 0n,
+ toBlock: head,
+ });
+ const newest = logs.slice(-60).reverse();
+ const blockNumbers = [...new Set(newest.map((l) => l.blockNumber))];
+ const [meta, blocks, reserves] = await Promise.all([
+ erc20Metadata(newest.map((l) => l.args.token)),
+ Promise.all(blockNumbers.map((n) => client.getBlock({ blockNumber: n }).catch(() => null))),
+ client
+ .multicall({
+ contracts: newest.flatMap((l) => [
+ { address: l.args.curve, abi: PONS_CURVE_ABI, functionName: 'getReserves' },
+ { address: l.args.curve, abi: PONS_CURVE_ABI, functionName: 'realQuoteReserve' },
+ { address: l.args.curve, abi: PONS_CURVE_ABI, functionName: 'graduated' },
+ { address: l.args.token, abi: ERC20_SUPPLY_ABI, functionName: 'totalSupply' },
+ ]),
+ allowFailure: true,
+ })
+ .catch(() => []),
+ ]);
+ const time = new Map(blockNumbers.map((n, i) => [n, blocks[i]?.timestamp ?? null]));
+ return newest.map((l, i) => {
+ const m = meta[l.args.token.toLowerCase()] || {};
+ const ts = time.get(l.blockNumber);
+ const curve = curveState(reserves.slice(i * 4, i * 4 + 3), l.args.graduationThreshold);
+ // An ERC-20-quoted curve (Pons approves Stock Tokens as quotes) prices
+ // in that token, so its reserve ratio is not an ETH price.
+ if (l.args.pairToken !== NATIVE_PAIR) curve.priceEth = null;
+ const supplyRes = reserves[i * 4 + 3];
+ const decimals = m.decimals ?? 18;
+ return {
+ launchpad: 'Pons',
+ type: 'bonding-curve',
+ token: getAddress(l.args.token),
+ curve: getAddress(l.args.curve),
+ deployer: getAddress(l.args.deployer),
+ quote: l.args.pairToken === NATIVE_PAIR ? 'ETH' : l.args.pairToken,
+ graduationThreshold: l.args.graduationThreshold.toString(),
+ block: Number(l.blockNumber),
+ txHash: l.transactionHash,
+ timestamp: ts != null ? new Date(Number(ts) * 1000).toISOString() : null,
+ symbol: m.symbol || null,
+ name: m.name || null,
+ url: ponsCoinUrl(l.args.token),
+ totalSupply: supplyRes?.status === 'success' ? Number(supplyRes.result) / 10 ** decimals : null,
+ ...curve,
+ };
+ });
+ });
+ return rows.slice(0, limit);
+}
diff --git a/api/_mcp/catalog.js b/api/_mcp/catalog.js
index 69a7946ae..d546ab363 100644
--- a/api/_mcp/catalog.js
+++ b/api/_mcp/catalog.js
@@ -22,6 +22,7 @@ import { toolDefs as feedbackDefs } from './tools/feedback.js';
import { toolDefs as homeDefs } from './tools/home.js';
import { toolDefs as libraryDefs } from './tools/library.js';
import { toolDefs as cardDefs } from './tools/cards.js';
+import { toolDefs as pairedDefs } from './tools/paired.js';
import { toolDefs as customSkillDefs } from './tools/custom-skills.js';
import { toolDefs as resourceDefs } from './tools/resources.js';
@@ -47,6 +48,7 @@ const baseDefs = [
...homeDefs,
...resourceDefs,
...cardDefs,
+ ...pairedDefs,
];
// Free, public entry point — listed first so discovery clients see it up top.
diff --git a/api/_mcp/dispatch.js b/api/_mcp/dispatch.js
index 3991bc135..9577d84e2 100644
--- a/api/_mcp/dispatch.js
+++ b/api/_mcp/dispatch.js
@@ -36,6 +36,11 @@ const PUBLIC_TOOLS = new Set([
// The community skills registry is a public, PR-reviewed catalog of
// instruction files. Browsing it reads nothing about the caller.
'list_available_skills',
+ // Paired coins on Robinhood Chain: the launchpad's quote registry and its
+ // coins, read from the chain. Public on-chain state, no caller data.
+ 'paired_markets',
+ 'paired_coins',
+ 'paired_coin',
]);
export function isPublicTool(name) {
diff --git a/api/_mcp/tools/paired.js b/api/_mcp/tools/paired.js
new file mode 100644
index 000000000..0262a07d4
--- /dev/null
+++ b/api/_mcp/tools/paired.js
@@ -0,0 +1,250 @@
+// Paired-coin MCP tools: browse what a coin on Robinhood Chain can pair with,
+// read paired coins, and have an agent launch one from its own EVM wallet.
+//
+// A paired coin trades against one to five assets at once (tokenized stocks,
+// WETH, stablecoins, chain coins), each in its own bonding curve. Every tool
+// calls the same libraries as the REST API (api/agents/paired/[action].js and
+// api/v1/robinhood/paired-*), so ownership, signer mode, spend ceilings and the
+// audit trail are identical on both surfaces.
+//
+// paired_launch_quote is the preview: the policy layer stamps a preview_id on
+// its result, and paired_launch refuses without that id, confirm_launch: true,
+// and the same launch arguments the quote priced. See docs/paired-coins.md.
+
+import { currentSignatureFor, agreementRequirement } from '../../_lib/real-funds-agreement.js';
+import { EvmLegError } from '../../_lib/evm-leg/chains.js';
+import { PairedMarketError } from '../../_lib/paired-markets.js';
+import { MAX_MARKETS, launchpadConfig } from '../../_lib/paired-launchpad.js';
+import { pairedMarkets } from '../../_lib/paired-markets.js';
+import { pairedCoinDetail, pairedCoinList } from '../../_lib/paired-directory.js';
+import { LIMITS, claimPairedFees, launchPaired, pairedFeesFor, quotePairedLaunch } from '../../_lib/evm-leg/paired-launch.js';
+
+const READ = { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true };
+const WRITE = { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true };
+const MONEY = { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: true };
+
+const AGENT_ID = { type: 'string', format: 'uuid', description: 'Agent UUID (from list_my_agents).' };
+const ADDRESS = { type: 'string', pattern: '^0x[0-9a-fA-F]{40}$' };
+
+// The launch arguments, shared by the quote and the launch so the policy layer
+// can bind every one of them between the two calls.
+const LAUNCH_PROPS = {
+ agent_id: AGENT_ID,
+ markets: {
+ type: 'array',
+ items: { type: 'string', minLength: 1, maxLength: 64 },
+ minItems: 1,
+ maxItems: MAX_MARKETS,
+ description: 'What the coin pairs with: tickers from paired_markets (NVDA, WETH, USDG, …) or 0x quote addresses.',
+ },
+ weights: {
+ type: 'array',
+ items: { type: 'number', exclusiveMinimum: 0, maximum: 100 },
+ maxItems: MAX_MARKETS,
+ description: 'Percent of supply per market, same order as markets, totalling 100. Omit for an even split.',
+ },
+ name: { type: 'string', minLength: 1, maxLength: LIMITS.name },
+ symbol: { type: 'string', minLength: 1, maxLength: LIMITS.symbol, description: 'Ticker, letters and digits.' },
+ description: { type: 'string', maxLength: LIMITS.description },
+ image_url: { type: 'string', maxLength: LIMITS.image, description: "https:// logo, copied onto three.ws storage. Defaults to the agent's public avatar." },
+ socials: {
+ type: 'object',
+ properties: { website: { type: 'string' }, twitter: { type: 'string' }, telegram: { type: 'string' } },
+ additionalProperties: false,
+ },
+ dev_buy: {
+ type: 'object',
+ properties: {
+ market: { type: 'string', description: 'Which of the markets the opening buy spends. Defaults to the first.' },
+ amount: { type: 'string', description: 'Amount of that asset, like "0.5". Settled atomically in the launch transaction.' },
+ },
+ required: ['amount'],
+ additionalProperties: false,
+ },
+};
+export const LAUNCH_ARGS = Object.keys(LAUNCH_PROPS);
+
+function ok(structured, text) {
+ return { content: [{ type: 'text', text: text || JSON.stringify(structured, null, 2) }], structuredContent: structured };
+}
+
+function failure(e) {
+ if (e instanceof PairedMarketError || e instanceof EvmLegError || (e?.status && e.status < 500 && e?.code)) {
+ const structured = { error: e.code || 'bad_request', message: e.message, ...(e.detail ? { detail: e.detail } : {}) };
+ return { content: [{ type: 'text', text: `Error (${structured.error}): ${e.message}` }], structuredContent: structured, isError: true };
+ }
+ throw e;
+}
+
+function needsAccount() {
+ return {
+ content: [{ type: 'text', text: 'Connect a three.ws account (OAuth or API key) to launch with an agent.' }],
+ structuredContent: { error: 'unauthorized' },
+ isError: true,
+ };
+}
+
+function launchInput(a) {
+ return {
+ name: a.name,
+ symbol: a.symbol,
+ description: a.description,
+ image_url: a.image_url,
+ socials: a.socials,
+ markets: a.markets,
+ weights: a.weights,
+ dev_buy: a.dev_buy,
+ };
+}
+
+export const toolDefs = [
+ {
+ name: 'paired_markets',
+ title: 'List paired-coin markets',
+ group: 'launch',
+ annotations: READ,
+ description:
+ 'Every asset a paired coin on Robinhood Chain can trade against, read live from the launchpad: tokenized stocks (NVDA, TSLA, SPY…), WETH, stablecoins and chain coins, each with its class, live USD price and the dollar market cap a pool in it opens at. Also returns the launch fee, swap fee and the creator\'s share of fees.',
+ inputSchema: {
+ type: 'object',
+ properties: { class: { type: 'string', enum: ['rwa-equity', 'stablecoin', 'crypto-major', 'crypto-native'] } },
+ additionalProperties: false,
+ },
+ async handler(args) {
+ const [config, all] = await Promise.all([launchpadConfig(), pairedMarkets()]);
+ const markets = args?.class ? all.filter((m) => m.assetClass === args.class) : all;
+ return ok({ config, markets, count: markets.length });
+ },
+ },
+ {
+ name: 'paired_coins',
+ title: 'List paired coins',
+ group: 'launch',
+ annotations: READ,
+ description:
+ 'Paired coins on Robinhood Chain, newest first, with every pool (quote asset, weight, price, dollar market cap, % sold), the verified descriptor and the three.ws agent that launched it. Pass agent_id for one agent\'s coins.',
+ inputSchema: {
+ type: 'object',
+ properties: {
+ agent_id: AGENT_ID,
+ limit: { type: 'integer', minimum: 1, maximum: 48, default: 12 },
+ offset: { type: 'integer', minimum: 0, default: 0 },
+ },
+ additionalProperties: false,
+ },
+ async handler(args) {
+ return ok(await pairedCoinList({ limit: args?.limit ?? 12, offset: args?.offset ?? 0, agentId: args?.agent_id ?? null }));
+ },
+ },
+ {
+ name: 'paired_coin',
+ title: 'Read a paired coin',
+ group: 'launch',
+ annotations: READ,
+ description: 'One paired coin in full: its pools priced in dollars, recent trades, per-pool candles, the verified descriptor and the launching agent.',
+ inputSchema: {
+ type: 'object',
+ properties: { address: ADDRESS, interval: { type: 'string', enum: ['1m', '5m', '15m', '1h', '4h', '1d'], default: '1h' } },
+ required: ['address'],
+ additionalProperties: false,
+ },
+ async handler(args) {
+ const coin = await pairedCoinDetail(args.address, { interval: args.interval });
+ if (!coin) return failure(new PairedMarketError('That address is not a coin on the paired launchpad.', 404));
+ return ok(coin);
+ },
+ },
+ {
+ name: 'paired_launch_quote',
+ title: 'Quote a paired-coin launch',
+ group: 'launch',
+ tier: 'write',
+ scope: 'wallet:read',
+ annotations: WRITE,
+ description:
+ "Price a paired-coin launch from an agent's own EVM wallet on Robinhood Chain without signing anything: the pools and their dollar opening values, the launch fee, gas, the optional opening buy and its fill, the USD total, and anything blocking it (an unfunded wallet, the agent's spend ceiling). Show the result to the owner; paired_launch needs the preview_id this returns.",
+ inputSchema: { type: 'object', properties: LAUNCH_PROPS, required: ['agent_id', 'markets', 'name', 'symbol'], additionalProperties: false },
+ async handler(args, auth) {
+ if (!auth?.userId) return needsAccount();
+ try {
+ return ok(await quotePairedLaunch({ agentId: args.agent_id, userId: auth.userId, input: launchInput(args) }));
+ } catch (e) {
+ return failure(e);
+ }
+ },
+ },
+ {
+ name: 'paired_launch',
+ title: 'Launch a paired coin from an agent wallet',
+ group: 'launch',
+ tier: 'financial',
+ confirmFlag: 'confirm_launch',
+ previewTool: 'paired_launch_quote',
+ scope: 'wallet:write',
+ annotations: MONEY,
+ description:
+ "Launch the coin paired_launch_quote priced, signed by the agent's custodial EVM wallet on Robinhood Chain under its spend ceilings. Requires the quote's preview_id, the same launch arguments, and confirm_launch: true, which you may only send after the owner explicitly approved the quote. Returns the coin address, transaction and coin page.",
+ inputSchema: {
+ type: 'object',
+ properties: {
+ ...LAUNCH_PROPS,
+ preview_id: { type: 'string', description: 'From paired_launch_quote.' },
+ confirm_launch: { type: 'boolean', description: 'Must be true, and only after the owner said yes to the quote.' },
+ },
+ required: ['agent_id', 'markets', 'name', 'symbol', 'preview_id', 'confirm_launch'],
+ additionalProperties: false,
+ },
+ async handler(args, auth) {
+ if (!auth?.userId) return needsAccount();
+ const signature = await currentSignatureFor(auth.userId);
+ if (!signature) {
+ const requirement = agreementRequirement();
+ return {
+ content: [{ type: 'text', text: `Sign the real-funds agreements before an agent can launch. Nothing was spent. Sign at ${requirement.sign_url}` }],
+ structuredContent: { launched: false, reason: 'risk_ack_required', ...requirement },
+ isError: true,
+ };
+ }
+ try {
+ return ok(await launchPaired({ agentId: args.agent_id, userId: auth.userId, input: launchInput(args) }));
+ } catch (e) {
+ return failure(e);
+ }
+ },
+ },
+ {
+ name: 'paired_fees',
+ title: 'Read paired-coin creator fees',
+ group: 'launch',
+ scope: 'wallet:read',
+ annotations: READ,
+ description: 'Swap fees an agent has earned as the creator of paired coins and can claim now, per quote asset.',
+ inputSchema: { type: 'object', properties: { agent_id: AGENT_ID }, required: ['agent_id'], additionalProperties: false },
+ async handler(args, auth) {
+ if (!auth?.userId) return needsAccount();
+ try {
+ return ok(await pairedFeesFor({ agentId: args.agent_id, userId: auth.userId }));
+ } catch (e) {
+ return failure(e);
+ }
+ },
+ },
+ {
+ name: 'paired_claim_fees',
+ title: 'Claim paired-coin creator fees',
+ group: 'launch',
+ tier: 'write',
+ scope: 'wallet:write',
+ annotations: WRITE,
+ description: "Collect every quote asset an agent has earned in paired-coin swap fees, in one transaction into the agent's own wallet. Costs a little ETH gas; moves nothing out of the agent's control.",
+ inputSchema: { type: 'object', properties: { agent_id: AGENT_ID }, required: ['agent_id'], additionalProperties: false },
+ async handler(args, auth) {
+ if (!auth?.userId) return needsAccount();
+ try {
+ return ok(await claimPairedFees({ agentId: args.agent_id, userId: auth.userId }));
+ } catch (e) {
+ return failure(e);
+ }
+ },
+ },
+];
diff --git a/api/agents/paired/[action].js b/api/agents/paired/[action].js
new file mode 100644
index 000000000..f8a069a45
--- /dev/null
+++ b/api/agents/paired/[action].js
@@ -0,0 +1,118 @@
+/**
+ * Paired-coin launches on Robinhood Chain, signed by the agent's custodial EVM wallet.
+ *
+ * Routes (via vercel.json rewrites):
+ * POST /api/agents/:id/paired/quote price, policy and funding check, signs nothing
+ * POST /api/agents/:id/paired/launch launch the coin from the agent's wallet
+ * GET /api/agents/:id/paired/fees swap fees the agent has earned, per quote asset
+ * POST /api/agents/:id/paired/claim claim every earned quote asset in one transaction
+ *
+ * quote and launch take the same body, so a bot can quote, show its owner the
+ * cost, and then send the identical request to launch. Auth is the owner's
+ * session or an API key allowed to spend, exactly like /api/agents/:id/pons/launch.
+ * See docs/paired-coins.md.
+ */
+
+import { z } from 'zod';
+import { getSessionUser, authenticateBearer, extractBearer, isSameSiteOrigin, assertBearerMaySpend } from '../../_lib/auth.js';
+import { cors, json, method, readJson, wrap, error, rateLimited, serverError } from '../../_lib/http.js';
+import { limits, clientIp } from '../../_lib/rate-limit.js';
+import { isUuid } from '../../_lib/validate.js';
+import { requireRealFundsAgreement } from '../../_lib/real-funds-agreement.js';
+import { EvmLegError } from '../../_lib/evm-leg/chains.js';
+import { PairedMarketError } from '../../_lib/paired-markets.js';
+import { MAX_MARKETS } from '../../_lib/paired-launchpad.js';
+import { LIMITS, claimPairedFees, launchPaired, pairedFeesFor, quotePairedLaunch } from '../../_lib/evm-leg/paired-launch.js';
+
+async function resolveAuth(req) {
+ const session = await getSessionUser(req);
+ if (session) {
+ // These handlers sign with a platform-held key, so a cross-site POST
+ // riding the session cookie must never reach them.
+ if (req.method !== 'GET' && !isSameSiteOrigin(req)) {
+ throw Object.assign(new Error('cross-site request blocked'), { status: 403, code: 'forbidden' });
+ }
+ return { userId: session.id };
+ }
+ const bearer = assertBearerMaySpend(await authenticateBearer(extractBearer(req)), req);
+ if (bearer) return { userId: bearer.userId };
+ return null;
+}
+
+const link = z.string().trim().max(LIMITS.link).optional();
+
+const bodySchema = z.object({
+ name: z.string().trim().min(1).max(LIMITS.name),
+ symbol: z.string().trim().min(1).max(LIMITS.symbol),
+ description: z.string().trim().max(LIMITS.description).optional(),
+ image_url: z.string().trim().max(LIMITS.image).optional(),
+ socials: z.object({ website: link, twitter: link, telegram: link }).optional(),
+ // Symbols ("NVDA", "WETH", "$USDG") or 0x quote addresses, 1 to MAX_MARKETS.
+ markets: z.array(z.string().trim().min(1).max(64)).min(1).max(MAX_MARKETS),
+ // Percentages, one per market, totalling 100. Omitted means an even split.
+ weights: z.array(z.number().positive().max(100)).max(MAX_MARKETS).optional(),
+ dev_buy: z
+ .object({
+ market: z.string().trim().max(64).optional(),
+ amount: z.union([z.string().trim().max(40), z.number().nonnegative()]),
+ })
+ .optional(),
+});
+
+function extractAgentId(req) {
+ const parts = new URL(req.url, 'http://x').pathname.split('/').filter(Boolean);
+ if (parts[1] === 'agents' && parts[3] === 'paired') return parts[2];
+ return req.query?.id || null;
+}
+
+function failure(res, err) {
+ if (err instanceof PairedMarketError || err instanceof EvmLegError || (err?.status && err?.code && err.status < 500) || err?.expose) {
+ return error(res, err.status || 400, err.code || 'bad_request', err.message, err.detail ? { detail: err.detail } : {});
+ }
+ return serverError(res, 500, 'internal', err);
+}
+
+async function handle(req, res, id, action) {
+ const verbs = action === 'fees' ? ['GET'] : ['POST'];
+ if (cors(req, res, { methods: `${verbs.join(',')},OPTIONS`, credentials: true })) return;
+ if (!method(req, res, verbs)) return;
+
+ const auth = await resolveAuth(req);
+ if (!auth) return error(res, 401, 'unauthorized', 'sign in or send an API key');
+ const rl = await limits.authIp(clientIp(req));
+ if (!rl.success) return rateLimited(res, rl);
+
+ try {
+ if (action === 'fees') return json(res, 200, { data: await pairedFeesFor({ agentId: id, userId: auth.userId }) });
+ if (action === 'claim') return json(res, 200, { data: await claimPairedFees({ agentId: id, userId: auth.userId, req }) });
+
+ let body;
+ try {
+ body = bodySchema.parse(await readJson(req));
+ } catch (e) {
+ return error(res, 400, 'validation_error', e.errors?.[0]?.message || 'invalid body');
+ }
+ if (action === 'quote') {
+ return json(res, 200, { data: await quotePairedLaunch({ agentId: id, userId: auth.userId, input: body }) });
+ }
+ if (!(await requireRealFundsAgreement(req, res, { userId: auth.userId, network: 'mainnet', context: 'paired-launch' }))) return;
+ return json(res, 201, { data: await launchPaired({ agentId: id, userId: auth.userId, input: body, req }) });
+ } catch (err) {
+ if (!(err instanceof PairedMarketError) && !(err instanceof EvmLegError)) console.error(`[paired/${action}]`, err);
+ return failure(res, err);
+ }
+}
+
+const ACTIONS = new Set(['quote', 'launch', 'fees', 'claim']);
+
+export default wrap(async (req, res) => {
+ const action = req.query?.action;
+ const id = extractAgentId(req);
+ if (!id || !isUuid(id)) {
+ if (cors(req, res)) return;
+ return error(res, 404, 'not_found', 'agent not found');
+ }
+ if (ACTIONS.has(action)) return handle(req, res, id, action);
+ if (cors(req, res)) return;
+ return error(res, 404, 'not_found', 'unknown paired action');
+});
diff --git a/api/agents/pons/[action].js b/api/agents/pons/[action].js
new file mode 100644
index 000000000..6b4dbe9bb
--- /dev/null
+++ b/api/agents/pons/[action].js
@@ -0,0 +1,105 @@
+/**
+ * Pons launches on Robinhood Chain, signed by the agent's custodial EVM wallet.
+ *
+ * Routes (via vercel.json rewrites):
+ * POST /api/agents/:id/pons/quote price, policy and funding check, signs nothing
+ * POST /api/agents/:id/pons/launch launch the coin from the agent's wallet
+ *
+ * Both take the same body, so a bot can quote, show its owner the cost, and
+ * then send the identical request to launch. Auth is the owner's session or an
+ * API key allowed to spend, exactly like /api/agents/:id/pumpfun/launch.
+ * See docs/pons-launch.md.
+ */
+
+import { z } from 'zod';
+import { getSessionUser, authenticateBearer, extractBearer, isSameSiteOrigin, assertBearerMaySpend } from '../../_lib/auth.js';
+import { cors, json, method, readJson, wrap, error, rateLimited, serverError } from '../../_lib/http.js';
+import { limits, clientIp } from '../../_lib/rate-limit.js';
+import { isUuid } from '../../_lib/validate.js';
+import { requireRealFundsAgreement } from '../../_lib/real-funds-agreement.js';
+import { EvmLegError } from '../../_lib/evm-leg/chains.js';
+import { PonsError, LIMITS } from '../../_lib/pons.js';
+import { MAX_OPENING_BUY_ETH, launchOnPons, quotePonsLaunch } from '../../_lib/evm-leg/pons-launch.js';
+
+async function resolveAuth(req) {
+ const session = await getSessionUser(req);
+ if (session) {
+ // These handlers sign with a platform-held key, so a cross-site POST
+ // riding the session cookie must never reach them.
+ if (!isSameSiteOrigin(req)) {
+ throw Object.assign(new Error('cross-site request blocked'), { status: 403, code: 'forbidden' });
+ }
+ return { userId: session.id };
+ }
+ const bearer = assertBearerMaySpend(await authenticateBearer(extractBearer(req)), req);
+ if (bearer) return { userId: bearer.userId };
+ return null;
+}
+
+const social = z.string().trim().max(LIMITS.social).optional();
+
+const bodySchema = z.object({
+ name: z.string().trim().min(1).max(LIMITS.name),
+ symbol: z.string().trim().min(1).max(LIMITS.symbol),
+ description: z.string().trim().max(LIMITS.description).optional(),
+ image_url: z.string().trim().max(LIMITS.logo).optional(),
+ socials: z
+ .object({ twitter: social, telegram: social, discord: social, website: social, farcaster: social })
+ .optional(),
+ buy_eth: z.number().min(0).max(MAX_OPENING_BUY_ETH).default(0),
+ creator_tax_bps: z.number().int().min(0).max(1000).default(0),
+ buyback: z.boolean().default(false),
+});
+
+function extractAgentId(req) {
+ const parts = new URL(req.url, 'http://x').pathname.split('/').filter(Boolean);
+ if (parts[1] === 'agents' && parts[3] === 'pons') return parts[2];
+ return req.query?.id || null;
+}
+
+function failure(res, err) {
+ if (err instanceof PonsError || err instanceof EvmLegError || (err?.status && err?.code && err.status < 500) || err?.expose) {
+ return error(res, err.status || 400, err.code || 'bad_request', err.message, err.detail ? { detail: err.detail } : {});
+ }
+ return serverError(res, 500, 'internal', err);
+}
+
+async function handle(req, res, id, action) {
+ if (cors(req, res, { methods: 'POST,OPTIONS', credentials: true })) return;
+ if (!method(req, res, ['POST'])) return;
+
+ const auth = await resolveAuth(req);
+ if (!auth) return error(res, 401, 'unauthorized', 'sign in or send an API key');
+ const rl = await limits.authIp(clientIp(req));
+ if (!rl.success) return rateLimited(res, rl);
+
+ let body;
+ try {
+ body = bodySchema.parse(await readJson(req));
+ } catch (e) {
+ return error(res, 400, 'validation_error', e.errors?.[0]?.message || 'invalid body');
+ }
+
+ try {
+ if (action === 'quote') {
+ return json(res, 200, { data: await quotePonsLaunch({ agentId: id, userId: auth.userId, input: body }) });
+ }
+ if (!(await requireRealFundsAgreement(req, res, { userId: auth.userId, network: 'mainnet', context: 'pons-launch' }))) return;
+ return json(res, 201, { data: await launchOnPons({ agentId: id, userId: auth.userId, input: body, req }) });
+ } catch (err) {
+ if (!(err instanceof PonsError) && !(err instanceof EvmLegError)) console.error(`[pons/${action}]`, err);
+ return failure(res, err);
+ }
+}
+
+export default wrap(async (req, res) => {
+ const action = req.query?.action;
+ const id = extractAgentId(req);
+ if (!id || !isUuid(id)) {
+ if (cors(req, res)) return;
+ return error(res, 404, 'not_found', 'agent not found');
+ }
+ if (action === 'quote' || action === 'launch') return handle(req, res, id, action);
+ if (cors(req, res)) return;
+ return error(res, 404, 'not_found', 'unknown pons action');
+});
diff --git a/api/pump/[action].js b/api/pump/[action].js
index e01d344d5..d28996aa5 100644
--- a/api/pump/[action].js
+++ b/api/pump/[action].js
@@ -3054,16 +3054,42 @@ async function handleByAgent(req, res) {
order by pam.created_at desc limit 50
`;
}
- const [row] = rows;
- if (!row) return json(res, 200, { data: null, coins: [] });
- const coins = rows.map((r) => ({
+ // Coins the agent launched on an EVM chain (Robinhood Chain through Pons)
+ // live in fixed_supply_launches. They join the history list, never `data`,
+ // whose payment and burn stats are pump.fun-mint specific.
+ const evmRows = await sql`
+ select f.mint, f.network, f.name, f.symbol, f.chain, f.venue, f.venue_url, f.image_url, f.created_at
+ from fixed_supply_launches f
+ ${agentId ? sql`where f.agent_id = ${agentId}` : sql`join agent_identities ai on ai.id = f.agent_id and ai.deleted_at is null where ai.avatar_id = ${avatarId}`}
+ and f.chain <> 'solana'
+ order by f.created_at desc limit 50
+ `;
+ const evmCoins = evmRows.map((r) => ({
mint: r.mint,
network: r.network,
name: r.name,
symbol: r.symbol,
- buyback_bps: r.buyback_bps,
+ buyback_bps: 0,
created_at: r.created_at,
+ chain: r.chain,
+ venue: r.venue,
+ venue_url: r.venue_url || null,
+ image_url: r.image_url || null,
}));
+ const [row] = rows;
+ if (!row) return json(res, 200, { data: null, coins: evmCoins });
+ const coins = rows
+ .map((r) => ({
+ mint: r.mint,
+ network: r.network,
+ name: r.name,
+ symbol: r.symbol,
+ buyback_bps: r.buyback_bps,
+ created_at: r.created_at,
+ chain: 'solana',
+ }))
+ .concat(evmCoins)
+ .sort((a, b) => new Date(b.created_at) - new Date(a.created_at));
const [stats] = await sql`
select
diff --git a/api/v1/robinhood/launches.js b/api/v1/robinhood/launches.js
index a0c5e3b5d..481b6d48b 100644
--- a/api/v1/robinhood/launches.js
+++ b/api/v1/robinhood/launches.js
@@ -1,14 +1,19 @@
// GET /api/v1/robinhood/launches — recent launchpad activity on Robinhood Chain.
//
-// Free, keyless. Newest token launches from the NOXA (instant Uniswap v3) and
-// The Odyssey (bonding-curve) launchpads, read from Blockscout's decoded-log
-// API (TokenLaunched / TokenCreated), then enriched with DexScreener market
-// data where a pool already exists. Newest first.
+// Free, keyless. Newest token launches from Pons V2 (the chain's busiest
+// launchpad: ETH bonding curve graduating into a locked Uniswap V4 pool), read
+// over RPC from its factory's TokenLaunched logs, plus NOXA (instant Uniswap
+// v3) and The Odyssey (bonding-curve) from Blockscout's decoded-log API. Each
+// launchpad source fails independently, so one indexer outage never empties
+// the board. Enriched with DexScreener market data where a pool already
+// exists. Newest first.
import { defineEndpoint } from '../../_lib/gateway.js';
import { rateLimited } from '../../_lib/http.js';
import { limits } from '../../_lib/rate-limit.js';
import { recentLaunches, dexSnapshot, BLOCKSCOUT_BASE, asOf } from '../../_lib/robinhood.js';
+import { recentPonsLaunches } from '../../_lib/pons.js';
+import { fetchCoinPriceUsdOrNull } from '../../_lib/market-fallbacks.js';
const CACHE_CONTROL = 'public, max-age=30, s-maxage=30, stale-while-revalidate=45';
@@ -21,11 +26,28 @@ export default defineEndpoint({
if (!rl.success) return rateLimited(res, rl, 'Robinhood Chain data is capped at 60 requests/min per IP');
const limit = Math.min(60, Math.max(1, Number(query.limit) || 40));
- const launches = await recentLaunches({ limit });
- const dex = await dexSnapshot(launches.map((l) => l.token));
+ const [pons, others] = await Promise.all([
+ recentPonsLaunches({ limit }).catch((err) => {
+ console.error('[v1/robinhood/launches] pons read failed', err?.shortMessage || err?.message);
+ return [];
+ }),
+ recentLaunches({ limit }).catch((err) => {
+ console.error('[v1/robinhood/launches] blockscout read failed', err?.message);
+ return [];
+ }),
+ ]);
+ const launches = [...pons, ...others].sort((a, b) => b.block - a.block).slice(0, limit);
+ const [dex, ethUsd] = await Promise.all([
+ dexSnapshot(launches.map((l) => l.token)),
+ launches.some((l) => l.priceEth != null) ? fetchCoinPriceUsdOrNull('ethereum') : null,
+ ]);
const enriched = launches.map((l) => {
const pair = dex[l.token.toLowerCase()] || null;
+ // A bonding-curve coin has no DEX pair until it graduates; its price is
+ // the curve's own marginal price, and its market cap prices the full
+ // fixed supply the token reports on chain.
+ const curveUsd = !pair && l.priceEth != null && ethUsd != null ? l.priceEth * ethUsd : null;
return {
launchpad: l.launchpad,
type: l.type,
@@ -34,16 +56,18 @@ export default defineEndpoint({
block: l.block,
txHash: l.txHash,
timestamp: l.timestamp,
- symbol: pair?.baseToken?.symbol || null,
- name: pair?.baseToken?.name || null,
- priceUsd: pair?.priceUsd != null ? Number(pair.priceUsd) : null,
- marketCapUsd: pair?.marketCap ?? null,
+ symbol: pair?.baseToken?.symbol || l.symbol || null,
+ name: pair?.baseToken?.name || l.name || null,
+ priceUsd: pair?.priceUsd != null ? Number(pair.priceUsd) : curveUsd,
+ marketCapUsd: pair?.marketCap ?? (curveUsd != null && l.totalSupply != null ? curveUsd * l.totalSupply : null),
+ graduationPct: l.progressPct ?? null,
liquidityUsd: pair?.liquidity?.usd ?? null,
volume24hUsd: pair?.volume?.h24 ?? null,
hasMarket: Boolean(pair),
links: {
token: `${BLOCKSCOUT_BASE}/token/${l.token}`,
tx: l.txHash ? `${BLOCKSCOUT_BASE}/tx/${l.txHash}` : null,
+ launchpad: l.url || null,
},
};
});
@@ -53,10 +77,11 @@ export default defineEndpoint({
launches: enriched,
count: enriched.length,
launchpads: [
+ { name: 'Pons', style: 'bonding-curve', url: 'https://ponsfamily.com' },
{ name: 'NOXA', style: 'instant', url: 'https://fun.noxa.fi' },
{ name: 'The Odyssey', style: 'bonding-curve', url: 'https://theodyssey.fun' },
],
- source: 'blockscout (on-chain logs) + dexscreener',
+ source: 'rpc (Pons factory logs) + blockscout (on-chain logs) + dexscreener',
asOf: asOf(),
};
},
diff --git a/api/v1/robinhood/paired-coins-detail.js b/api/v1/robinhood/paired-coins-detail.js
new file mode 100644
index 000000000..f5e16c48e
--- /dev/null
+++ b/api/v1/robinhood/paired-coins-detail.js
@@ -0,0 +1,33 @@
+// GET /api/v1/robinhood/paired-coins-detail?address=0x…[&interval=1h] — one paired coin.
+//
+// Free, keyless. The coin's pools read live from the launchpad and priced in
+// dollars, its verified descriptor, the three.ws agent that launched it (when
+// one did), the latest trades from the launchpad's Swap events, and OHLCV
+// candles per pool in that pool's own quote units.
+
+import { defineEndpoint, fail } from '../../_lib/gateway.js';
+import { rateLimited } from '../../_lib/http.js';
+import { limits } from '../../_lib/rate-limit.js';
+import { asOf } from '../../_lib/robinhood.js';
+import { pairedCoinDetail } from '../../_lib/paired-directory.js';
+
+const CACHE_CONTROL = 'public, max-age=10, s-maxage=10, stale-while-revalidate=20';
+const ADDR_RE = /^0x[0-9a-fA-F]{40}$/;
+
+export default defineEndpoint({
+ name: 'v1.robinhood.paired-coins-detail',
+ method: 'GET',
+ auth: 'public',
+ handler: async ({ res, query, ip }) => {
+ const rl = await limits.robinhoodRead(ip);
+ if (!rl.success) return rateLimited(res, rl, 'Robinhood Chain data is capped at 60 requests/min per IP');
+
+ const address = String(query.address || '').trim();
+ if (!ADDR_RE.test(address)) fail(400, 'validation_error', 'pass ?address=<0x… paired coin address>');
+ const coin = await pairedCoinDetail(address, { interval: String(query.interval || '1h') });
+ if (!coin) fail(404, 'not_found', 'that address is not a coin on the paired launchpad');
+
+ res.setHeader('cache-control', CACHE_CONTROL);
+ return { ...coin, asOf: asOf() };
+ },
+});
diff --git a/api/v1/robinhood/paired-coins.js b/api/v1/robinhood/paired-coins.js
new file mode 100644
index 000000000..1bd9957a0
--- /dev/null
+++ b/api/v1/robinhood/paired-coins.js
@@ -0,0 +1,38 @@
+// GET /api/v1/robinhood/paired-coins — every paired coin, newest first.
+//
+// Free, keyless. Read from the paired launchpad itself (tokenCount/tokenAt),
+// so the list is exactly the coins the chain has, whoever launched them. Each
+// coin carries its pools (quote asset, weight, price, raise, % sold) priced in
+// dollars, its descriptor when it hashes to the on-chain commitment, and the
+// three.ws agent that launched it when there is one. `?agent=<uuid>` narrows
+// to one agent's coins.
+
+import { defineEndpoint, fail } from '../../_lib/gateway.js';
+import { rateLimited } from '../../_lib/http.js';
+import { limits } from '../../_lib/rate-limit.js';
+import { isUuid } from '../../_lib/validate.js';
+import { asOf } from '../../_lib/robinhood.js';
+import { pairedCoinList } from '../../_lib/paired-directory.js';
+
+const CACHE_CONTROL = 'public, max-age=15, s-maxage=15, stale-while-revalidate=30';
+
+export default defineEndpoint({
+ name: 'v1.robinhood.paired-coins',
+ method: 'GET',
+ auth: 'public',
+ handler: async ({ res, query, ip }) => {
+ const rl = await limits.robinhoodRead(ip);
+ if (!rl.success) return rateLimited(res, rl, 'Robinhood Chain data is capped at 60 requests/min per IP');
+
+ const agentId = query.agent ? String(query.agent) : null;
+ if (agentId && !isUuid(agentId)) fail(400, 'validation_error', 'agent must be an agent id');
+ const list = await pairedCoinList({
+ limit: Math.min(48, Math.max(1, Number(query.limit) || 24)),
+ offset: Math.max(0, Number(query.offset) || 0),
+ agentId,
+ });
+
+ res.setHeader('cache-control', CACHE_CONTROL);
+ return { ...list, asOf: asOf() };
+ },
+});
diff --git a/api/v1/robinhood/paired-markets.js b/api/v1/robinhood/paired-markets.js
new file mode 100644
index 000000000..fb191433c
--- /dev/null
+++ b/api/v1/robinhood/paired-markets.js
@@ -0,0 +1,36 @@
+// GET /api/v1/robinhood/paired-markets — what a paired coin can trade against.
+//
+// Free, keyless. Every quote asset registered on the paired launchpad
+// (tokenized stocks, WETH, stablecoins, chain coins), read live from the
+// contract's quote registry, with its class, live USD price, and the dollar
+// market cap a pool in it opens at. Plus the launchpad's live terms.
+
+import { defineEndpoint } from '../../_lib/gateway.js';
+import { rateLimited } from '../../_lib/http.js';
+import { limits } from '../../_lib/rate-limit.js';
+import { asOf } from '../../_lib/robinhood.js';
+import { launchpadConfig } from '../../_lib/paired-launchpad.js';
+import { CLASS_LABELS, pairedMarkets } from '../../_lib/paired-markets.js';
+
+const CACHE_CONTROL = 'public, max-age=30, s-maxage=30, stale-while-revalidate=60';
+
+export default defineEndpoint({
+ name: 'v1.robinhood.paired-markets',
+ method: 'GET',
+ auth: 'public',
+ handler: async ({ res, ip }) => {
+ const rl = await limits.robinhoodRead(ip);
+ if (!rl.success) return rateLimited(res, rl, 'Robinhood Chain data is capped at 60 requests/min per IP');
+
+ const [config, markets] = await Promise.all([launchpadConfig(), pairedMarkets()]);
+ res.setHeader('cache-control', CACHE_CONTROL);
+ return {
+ config,
+ markets,
+ classes: CLASS_LABELS,
+ count: markets.length,
+ source: 'paired launchpad quote registry (on-chain) + dexscreener + chainlink',
+ asOf: asOf(),
+ };
+ },
+});
diff --git a/contracts/paired-launchpad/README.md b/contracts/paired-launchpad/README.md
new file mode 100644
index 000000000..5bfd81409
--- /dev/null
+++ b/contracts/paired-launchpad/README.md
@@ -0,0 +1,101 @@
+# Paired launchpad
+
+The contracts behind **paired coins** on three.ws: a coin launched on Robinhood
+Chain (4663) whose liquidity is quoted in one to five other assets at once
+instead of a single gas token. A coin paired with NVDA, WETH and USDG trades in
+three independent bonding curves, one per pairing, and its creator earns fees in
+all three.
+
+Two contracts, no dependencies, no proxy.
+
+| Contract | What it is |
+|---|---|
+| [`src/PairedLaunchpad.sol`](src/PairedLaunchpad.sol) | Factory, one constant-product curve per pairing, fee accounting, batched claims |
+| [`src/PairedToken.sol`](src/PairedToken.sol) | Fixed 1B supply ERC-20 with no admin surface: no mint, no owner, no pause |
+
+The source is the paired.exchange launchpad (originally built as clink.fun),
+vendored here so three.ws agents launch on the same audited-by-tests code the
+deployed contract runs.
+
+## Live deployment
+
+| | |
+|---|---|
+| Chain | Robinhood Chain, 4663 |
+| Launchpad | [`0x6a546350f79DE0Fc83ADfCe99233183aA090fa15`](https://robinhoodchain.blockscout.com/address/0x6a546350f79DE0Fc83ADfCe99233183aA090fa15) |
+| Launch fee | read live: `launchFeeWei()` |
+| Swap fee | read live: `swapFeeBps()`, capped at 5% in code |
+| Creator share of swap fees | 70%, a constant |
+
+three.ws reads the address from `PAIRED_LAUNCHPAD` and falls back to the
+deployment above. Every quote asset a coin can pair against is read live from
+`quoteTokens()` and `quoteConfig(address)`, so registering a new pairing on chain
+makes it available everywhere on three.ws with no code change.
+
+## Build and test
+
+```bash
+cd contracts/paired-launchpad
+forge test
+```
+
+30 tests, including fuzz coverage that a buy-then-sell round trip never
+profits, that every curve stays backed by its real reserve, and that supply is
+conserved across pools.
+
+## Verify the deployed bytecode
+
+`foundry.toml` pins the compiler settings the live contract was built with.
+The executable bytecode is identical. The only bytes that differ are the two
+CBOR metadata hashes (the launchpad's own and the one inside the embedded
+`PairedToken` creation code), because they encode source file paths:
+
+```bash
+forge build
+LOCAL=$(jq -r .deployedBytecode.object out/PairedLaunchpad.sol/PairedLaunchpad.json)
+CHAIN=$(cast code 0x6a546350f79DE0Fc83ADfCe99233183aA090fa15 --rpc-url https://rpc.mainnet.chain.robinhood.com)
+# Mask every IPFS metadata hash, then compare.
+node -e 'const m=h=>h.toLowerCase().replace(/a264697066735822[0-9a-f]{68}/g,"");process.exit(m(process.argv[1])===m(process.argv[2])?0:1)' "$LOCAL" "$CHAIN" && echo identical
+```
+
+## The design in one page
+
+**One curve per pairing.** A coin paired with NVDA and WETH gets two
+independent constant-product curves. They do not arbitrage each other and they
+are not a basket: the allocation only decides how the fixed supply is split.
+
+**Virtual quote reserves.** Each curve starts with a virtual quote balance set
+per quote asset (`quoteConfig.virtualQuote`, for a 100%-weight pool), so there
+is nothing to deposit on the quote side. A creator can launch against WETH or
+NVDA without holding either. The only mandatory cost is the flat launch fee in
+ETH. The virtual reserve is also the coin's opening market cap in that asset,
+which is why each quote is calibrated to a comparable USD value.
+
+**No migration, no ceiling.** Tokens leave the curve asymptotically, so there
+is no graduation event where liquidity moves and something can break.
+
+**Bounded admin.** The owner sets the launch fee, the swap fee and the quote
+registry. The swap fee is capped at 5% in code. The owner cannot touch a curve,
+a token, or accrued fees.
+
+**Fees claim in one transaction.** `claimFees(address[])` collects every quote
+asset a creator earned in at once, and `setFeeRecipient` lets the current
+recipient move future fees to a new wallet.
+
+## Adding a pairing
+
+A quote asset must be a plain ERC-20: no fee-on-transfer, no rebasing. The
+curve accounts in amounts it asked to move, so a token that delivers less than
+it was asked to would leave the pool under-backed.
+
+New pairings are registered by the launchpad owner with
+`setQuoteConfig(quote, virtualQuote, true)`. On three.ws,
+`npm run paired:quotes` prints the calibrated plan (opening value per pairing
+in USD, decimals-correct `virtualQuote`, and the exact calldata) for every
+asset you name, and only broadcasts with an owner key and `--apply`. See
+[docs/paired-coins.md](../../docs/paired-coins.md).
+
+## Status
+
+**Not audited.** The tests demonstrate the intended behaviour; they are not a
+substitute for someone trying to break it.
diff --git a/contracts/paired-launchpad/foundry.toml b/contracts/paired-launchpad/foundry.toml
new file mode 100644
index 000000000..ca1c3ddba
--- /dev/null
+++ b/contracts/paired-launchpad/foundry.toml
@@ -0,0 +1,24 @@
+# The paired launchpad reuses the vendored forge-std of the parent `contracts/`
+# project (`../lib`) for tests and scripts only. `src/` has no dependencies.
+#
+# Compiler settings are load-bearing: they reproduce the bytecode deployed on
+# Robinhood Chain at 0x6a546350f79DE0Fc83ADfCe99233183aA090fa15 byte for byte
+# (see README, "Verify the deployed bytecode"). Changing solc, the optimizer
+# or the metadata hash breaks that proof.
+[profile.default]
+src = "src"
+out = "out"
+test = "test"
+script = "script"
+libs = ["../lib"]
+solc = "0.8.28"
+optimizer = true
+optimizer_runs = 1000
+via_ir = false
+remappings = ["forge-std/=../lib/forge-std/src/"]
+
+[profile.default.fuzz]
+runs = 512
+
+[rpc_endpoints]
+robinhood = "${ROBINHOOD_RPC_URL}"
diff --git a/contracts/paired-launchpad/script/Deploy.s.sol b/contracts/paired-launchpad/script/Deploy.s.sol
new file mode 100644
index 000000000..c61baa513
--- /dev/null
+++ b/contracts/paired-launchpad/script/Deploy.s.sol
@@ -0,0 +1,73 @@
+// SPDX-License-Identifier: Apache-2.0
+pragma solidity 0.8.28;
+
+import {Script} from "forge-std/Script.sol";
+import {console} from "forge-std/console.sol";
+import {PairedLaunchpad} from "../src/PairedLaunchpad.sol";
+
+/// @notice Deploy the launchpad and register the stock tokens it can pair against.
+///
+/// @dev The quote registry is seeded in the same run as the deployment because
+/// a launchpad with no enabled quotes is a launchpad where every launch reverts,
+/// and discovering that in production is worse than a longer script.
+///
+/// forge script script/Deploy.s.sol:Deploy \
+/// --rpc-url https://rpc.mainnet.chain.robinhood.com \
+/// --private-key $PRIVATE_KEY --broadcast
+contract Deploy is Script {
+ /// @notice Starting virtual quote reserve for a full-weight pool, in whole
+ /// units of the stock token. Set per stock so a launch against a $100 share
+ /// and a $500 share open at a comparable valuation instead of one being 5x
+ /// the other purely because of the share price.
+ uint128 constant DEFAULT_VIRTUAL_QUOTE = 30e18;
+
+ uint256 constant LAUNCH_FEE = 0.0005 ether;
+ uint16 constant SWAP_FEE_BPS = 100; // 1%
+
+ function run() external {
+ address treasury = vm.envOr("PAIRED_TREASURY", msg.sender);
+ vm.startBroadcast();
+
+ PairedLaunchpad pad = new PairedLaunchpad(treasury, LAUNCH_FEE, SWAP_FEE_BPS);
+ console.log("PairedLaunchpad", address(pad));
+ console.log("treasury", treasury);
+
+ address[24] memory stocks = [
+ 0xaF3D76f1834A1d425780943C99Ea8A608f8a93f9, // AAPL
+ 0x86923f96303D656E4aa86D9d42D1e57ad2023fdC, // AMD
+ 0x12f190a9F9d7D37a250758b26824B97CE941bF54, // AMZN
+ 0xad25Ac6C84D497db898fa1E8387bf6Af3532a1c4, // BABA
+ 0x822CC93fFD030293E9842c30BBD678F530701867, // BE
+ 0x6330D8C3178a418788dF01a47479c0ce7CCF450b, // COIN
+ 0xdF0992E440dD0be65BD8439b609d6D4366bf1CB5, // CRCL
+ 0x5f10A1C971B69e47e059e1dC91901B59b3fB49C3, // CRWV
+ 0x2e0847E8910a9732eB3fb1bb4b70a580ADAD4FE3, // GOOGL
+ 0xc72b96e0E48ecd4DC75E1e45396e26300BC39681, // INTC
+ 0xc0D6457C16Cc70d6790Dd43521C899C87ce02f35, // META
+ 0xe93237C50D904957Cf27E7B1133b510C669c2e74, // MSFT
+ 0xfF080c8ce2E5feadaCa0Da81314Ae59D232d4afD, // MU
+ 0xd0601CE157Db5bdC3162BbaC2a2C8aF5320D9EEC, // NVDA
+ 0xb0992820E760d836549ba69BC7598b4af75dEE03, // ORCL
+ 0x894E1EC2D74FFE5AEF8Dc8A9e84686acCB964F2A, // PLTR
+ 0xD5f3879160bc7c32ebb4dC785F8a4F505888de68, // QQQ
+ 0x92FD66527192E3e61d4DDd13322Aa222DE86F9B5, // SGOV
+ 0x411eFb0E7f985935DAec3D4C3ebaEa0d0AD7D89f, // SLV
+ 0xB90A19fF0Af67f7779afF50A882A9CfF42446400, // SNDK
+ 0x4a0E65A3EcceC6dBe60AE065F2e7bb85Fae35eEa, // SPCX
+ 0x117cc2133c37B721F49dE2A7a74833232B3B4C0C, // SPY
+ 0x322F0929c4625eD5bAd873c95208D54E1c003b2d, // TSLA
+ 0xd917B029C761D264c6A312BBbcDA868658eF86a6 // USAR
+ ];
+
+ for (uint256 i; i < stocks.length; ++i) {
+ pad.setQuoteConfig(stocks[i], DEFAULT_VIRTUAL_QUOTE, true);
+ }
+ console.log("quote markets enabled", stocks.length);
+
+ vm.stopBroadcast();
+
+ console.log("");
+ console.log("Set these and redeploy the apps:");
+ console.log(" PAIRED_LAUNCHPAD / VITE_LAUNCHPAD =", address(pad));
+ }
+}
diff --git a/contracts/paired-launchpad/src/IERC20.sol b/contracts/paired-launchpad/src/IERC20.sol
new file mode 100644
index 000000000..026dc8640
--- /dev/null
+++ b/contracts/paired-launchpad/src/IERC20.sol
@@ -0,0 +1,36 @@
+// SPDX-License-Identifier: Apache-2.0
+pragma solidity 0.8.28;
+
+interface IERC20 {
+ function totalSupply() external view returns (uint256);
+ function balanceOf(address account) external view returns (uint256);
+ function transfer(address to, uint256 value) external returns (bool);
+ function transferFrom(address from, address to, uint256 value) external returns (bool);
+ function approve(address spender, uint256 value) external returns (bool);
+ function allowance(address owner, address spender) external view returns (uint256);
+ function decimals() external view returns (uint8);
+ function symbol() external view returns (string memory);
+}
+
+/// @notice Transfer helpers that tolerate the tokens which return nothing.
+/// @dev Some widely held ERC-20s predate the standard's return value and
+/// revert a strict `bool` decode. Stock tokens on this chain look compliant,
+/// but a launchpad that can be paired against an arbitrary quote asset should
+/// not break on one that is merely old.
+library SafeTransfer {
+ error TransferFailed();
+
+ function safeTransfer(IERC20 token, address to, uint256 value) internal {
+ (bool ok, bytes memory data) = address(token).call(
+ abi.encodeWithSelector(IERC20.transfer.selector, to, value)
+ );
+ if (!ok || (data.length != 0 && !abi.decode(data, (bool)))) revert TransferFailed();
+ }
+
+ function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
+ (bool ok, bytes memory data) = address(token).call(
+ abi.encodeWithSelector(IERC20.transferFrom.selector, from, to, value)
+ );
+ if (!ok || (data.length != 0 && !abi.decode(data, (bool)))) revert TransferFailed();
+ }
+}
diff --git a/contracts/paired-launchpad/src/PairedLaunchpad.sol b/contracts/paired-launchpad/src/PairedLaunchpad.sol
new file mode 100644
index 000000000..229b3d3ef
--- /dev/null
+++ b/contracts/paired-launchpad/src/PairedLaunchpad.sol
@@ -0,0 +1,471 @@
+// SPDX-License-Identifier: Apache-2.0
+pragma solidity 0.8.28;
+
+import {PairedToken} from "./PairedToken.sol";
+import {IERC20, SafeTransfer} from "./IERC20.sol";
+
+/// @title PairedLaunchpad
+/// @notice Launch a fixed-supply coin priced against one or more tokenized
+/// stocks, and trade it on a self-contained bonding curve per pairing.
+///
+/// @dev Design notes, because the choices here are the product:
+///
+/// One curve per pairing. A coin paired with NVDA and TSLA gets two
+/// independent curves. They do not arbitrage each other and they are not a
+/// basket: the allocation only decides how the fixed supply is divided between
+/// them. Each curve is a constant-product market with a virtual quote reserve,
+/// which is what lets a launch cost nothing but the flat fee. There is no
+/// quote-side liquidity to provide, so a creator never needs to hold the stock
+/// token to launch against it.
+///
+/// No migration and no ceiling. Tokens are sold from the curve asymptotically,
+/// so price rises without bound and there is no graduation event at which
+/// liquidity moves somewhere else and something can break. A curve that works
+/// on day one works the same way on day one thousand.
+///
+/// No external dependencies. No AMM, no router, no oracle, no upgradeable
+/// proxy. The contract someone reads is the contract that runs.
+contract PairedLaunchpad {
+ using SafeTransfer for IERC20;
+
+ // ── constants ────────────────────────────────────────────────────────────
+
+ uint256 public constant TOTAL_SUPPLY = 1_000_000_000e18;
+ uint16 public constant BPS = 10_000;
+ uint8 public constant MAX_MARKETS = 5;
+ /// @notice Creator's cut of swap fees, in bps of the fee.
+ uint16 public constant CREATOR_FEE_SHARE_BPS = 7_000;
+
+ // ── types ────────────────────────────────────────────────────────────────
+
+ struct Allocation {
+ address quoteToken;
+ uint16 weightBps;
+ }
+
+ struct LaunchParams {
+ string name;
+ string symbol;
+ string metadataURI;
+ bytes32 metadataHash;
+ Allocation[] allocations;
+ address creatorFeeRecipient;
+ /// @notice Index into `allocations` for an optional launch buy, or
+ /// NO_DEV_BUY. Unlike a zero-amount buy against index 0, this cannot be
+ /// confused with a real request.
+ uint8 devBuyMarket;
+ uint256 devBuyQuoteIn;
+ uint256 devBuyMinTokensOut;
+ uint256 deadline;
+ }
+
+ uint8 public constant NO_DEV_BUY = type(uint8).max;
+
+ struct Curve {
+ /// @dev Priced entirely in quote-token units. `virtualQuote` never
+ /// leaves the contract; it exists so the curve has a starting price
+ /// without anyone depositing the quote asset.
+ uint256 virtualQuote;
+ uint256 virtualToken;
+ uint256 realQuote;
+ uint256 tokensLeft;
+ uint16 weightBps;
+ bool exists;
+ }
+
+ struct QuoteConfig {
+ /// @notice Starting virtual quote reserve for a full-weight pool.
+ /// Set per stock so a $100 share and a $500 share start a launch at a
+ /// comparable valuation rather than one being 5x the other by accident.
+ uint128 virtualQuote;
+ bool enabled;
+ }
+
+ // ── storage ──────────────────────────────────────────────────────────────
+
+ address public owner;
+ address public treasury;
+ uint256 public launchFeeWei;
+ /// @notice Swap fee in bps, taken from the quote side of every trade.
+ uint16 public swapFeeBps;
+
+ mapping(address quoteToken => QuoteConfig) public quoteConfig;
+ address[] private _quoteList;
+
+ mapping(address token => address[] quoteTokens) private _markets;
+ mapping(address token => mapping(address quoteToken => Curve)) private _curves;
+ mapping(address token => address) public creatorOf;
+ mapping(address token => address) public feeRecipientOf;
+
+ /// @notice Fees waiting to be claimed, by recipient and quote asset.
+ mapping(address recipient => mapping(address quoteToken => uint256)) public claimable;
+
+ address[] private _allTokens;
+
+ bool private _entered;
+
+ // ── events ───────────────────────────────────────────────────────────────
+
+ event Launched(
+ address indexed token,
+ address indexed creator,
+ string name,
+ string symbol,
+ string metadataURI,
+ Allocation[] allocations
+ );
+ event Swap(
+ address indexed token,
+ address indexed quoteToken,
+ address indexed trader,
+ bool isBuy,
+ uint256 quoteAmount,
+ uint256 tokenAmount,
+ uint256 feeAmount
+ );
+ event FeesAccrued(address indexed recipient, address indexed quoteToken, uint256 amount);
+ event FeesClaimed(address indexed recipient, address indexed quoteToken, uint256 amount);
+ event FeeRecipientChanged(address indexed token, address indexed from, address indexed to);
+ event QuoteConfigured(address indexed quoteToken, uint128 virtualQuote, bool enabled);
+ event ParamsChanged(uint256 launchFeeWei, uint16 swapFeeBps, address treasury);
+ event OwnerChanged(address indexed from, address indexed to);
+
+ // ── errors ───────────────────────────────────────────────────────────────
+
+ error NotOwner();
+ error Reentrancy();
+ error Expired();
+ error BadFee();
+ error NoMarkets();
+ error TooManyMarkets();
+ error WeightsMustTotalBps();
+ error DuplicateMarket();
+ error QuoteNotEnabled();
+ error UnknownMarket();
+ error ZeroAmount();
+ error SlippageExceeded();
+ error NothingToClaim();
+ error BadDevBuy();
+ error NameOrSymbolEmpty();
+ error NotFeeRecipient();
+ error FeeTooHigh();
+
+ modifier onlyOwner() {
+ if (msg.sender != owner) revert NotOwner();
+ _;
+ }
+
+ /// @dev Quote assets are third-party contracts. Every path that moves them
+ /// is guarded rather than relying on any one token being well behaved.
+ modifier nonReentrant() {
+ if (_entered) revert Reentrancy();
+ _entered = true;
+ _;
+ _entered = false;
+ }
+
+ constructor(address _treasury, uint256 _launchFeeWei, uint16 _swapFeeBps) {
+ if (_swapFeeBps > 500) revert FeeTooHigh();
+ owner = msg.sender;
+ treasury = _treasury;
+ launchFeeWei = _launchFeeWei;
+ swapFeeBps = _swapFeeBps;
+ emit OwnerChanged(address(0), msg.sender);
+ emit ParamsChanged(_launchFeeWei, _swapFeeBps, _treasury);
+ }
+
+ // ── launching ────────────────────────────────────────────────────────────
+
+ /// @notice Deploy a coin and open its curves.
+ /// @dev The launch fee is the only mandatory cost. A dev buy is optional
+ /// and, when requested, pulls the quote asset from the caller, so it needs
+ /// a prior approval; skipping it needs nothing.
+ function launch(LaunchParams calldata p)
+ external
+ payable
+ nonReentrant
+ returns (address token)
+ {
+ if (block.timestamp > p.deadline) revert Expired();
+ if (msg.value != launchFeeWei) revert BadFee();
+ if (bytes(p.name).length == 0 || bytes(p.symbol).length == 0) revert NameOrSymbolEmpty();
+
+ uint256 n = p.allocations.length;
+ if (n == 0) revert NoMarkets();
+ if (n > MAX_MARKETS) revert TooManyMarkets();
+
+ uint256 weightTotal;
+ for (uint256 i; i < n; ++i) {
+ Allocation calldata a = p.allocations[i];
+ if (!quoteConfig[a.quoteToken].enabled) revert QuoteNotEnabled();
+ for (uint256 j; j < i; ++j) {
+ if (p.allocations[j].quoteToken == a.quoteToken) revert DuplicateMarket();
+ }
+ weightTotal += a.weightBps;
+ }
+ if (weightTotal != BPS) revert WeightsMustTotalBps();
+
+ token = address(
+ new PairedToken(p.name, p.symbol, TOTAL_SUPPLY, p.metadataURI, p.metadataHash, address(this))
+ );
+
+ creatorOf[token] = msg.sender;
+ feeRecipientOf[token] = p.creatorFeeRecipient == address(0) ? msg.sender : p.creatorFeeRecipient;
+ _allTokens.push(token);
+
+ uint256 assigned;
+ for (uint256 i; i < n; ++i) {
+ Allocation calldata a = p.allocations[i];
+ // The last market absorbs the integer-division dust so the sum of
+ // the pools is exactly the supply, never one wei short.
+ uint256 amount = i == n - 1
+ ? TOTAL_SUPPLY - assigned
+ : (TOTAL_SUPPLY * a.weightBps) / BPS;
+ assigned += amount;
+
+ uint256 vq = (uint256(quoteConfig[a.quoteToken].virtualQuote) * a.weightBps) / BPS;
+ _curves[token][a.quoteToken] = Curve({
+ virtualQuote: vq,
+ virtualToken: amount,
+ realQuote: 0,
+ tokensLeft: amount,
+ weightBps: a.weightBps,
+ exists: true
+ });
+ _markets[token].push(a.quoteToken);
+ }
+
+ emit Launched(token, msg.sender, p.name, p.symbol, p.metadataURI, p.allocations);
+
+ if (p.devBuyMarket != NO_DEV_BUY) {
+ if (p.devBuyMarket >= n || p.devBuyQuoteIn == 0) revert BadDevBuy();
+ _buy(
+ token,
+ p.allocations[p.devBuyMarket].quoteToken,
+ p.devBuyQuoteIn,
+ p.devBuyMinTokensOut,
+ msg.sender
+ );
+ }
+
+ if (msg.value != 0) {
+ (bool sent, ) = treasury.call{value: msg.value}("");
+ if (!sent) revert TransferToTreasuryFailed();
+ }
+ }
+
+ error TransferToTreasuryFailed();
+
+ // ── trading ──────────────────────────────────────────────────────────────
+
+ /// @notice Spend `quoteIn` of the paired stock to buy the coin.
+ function buy(
+ address token,
+ address quoteToken,
+ uint256 quoteIn,
+ uint256 minTokensOut
+ ) external nonReentrant returns (uint256 tokensOut) {
+ return _buy(token, quoteToken, quoteIn, minTokensOut, msg.sender);
+ }
+
+ /// @notice Sell the coin back into a curve for the paired stock.
+ function sell(
+ address token,
+ address quoteToken,
+ uint256 tokensIn,
+ uint256 minQuoteOut
+ ) external nonReentrant returns (uint256 quoteOut) {
+ Curve storage c = _curves[token][quoteToken];
+ if (!c.exists) revert UnknownMarket();
+ if (tokensIn == 0) revert ZeroAmount();
+
+ IERC20(token).safeTransferFrom(msg.sender, address(this), tokensIn);
+
+ uint256 grossQuote = _quoteOut(c, tokensIn);
+ uint256 fee = (grossQuote * swapFeeBps) / BPS;
+ quoteOut = grossQuote - fee;
+ if (quoteOut < minQuoteOut) revert SlippageExceeded();
+
+ c.virtualToken += tokensIn;
+ c.tokensLeft += tokensIn;
+ c.virtualQuote -= grossQuote;
+ c.realQuote -= grossQuote;
+
+ _accrue(token, quoteToken, fee);
+ IERC20(quoteToken).safeTransfer(msg.sender, quoteOut);
+
+ emit Swap(token, quoteToken, msg.sender, false, quoteOut, tokensIn, fee);
+ }
+
+ function _buy(
+ address token,
+ address quoteToken,
+ uint256 quoteIn,
+ uint256 minTokensOut,
+ address buyer
+ ) private returns (uint256 tokensOut) {
+ Curve storage c = _curves[token][quoteToken];
+ if (!c.exists) revert UnknownMarket();
+ if (quoteIn == 0) revert ZeroAmount();
+
+ IERC20(quoteToken).safeTransferFrom(buyer, address(this), quoteIn);
+
+ uint256 fee = (quoteIn * swapFeeBps) / BPS;
+ uint256 netIn = quoteIn - fee;
+
+ tokensOut = _tokensOut(c, netIn);
+ if (tokensOut < minTokensOut) revert SlippageExceeded();
+ if (tokensOut > c.tokensLeft) revert ZeroAmount();
+
+ c.virtualQuote += netIn;
+ c.realQuote += netIn;
+ c.virtualToken -= tokensOut;
+ c.tokensLeft -= tokensOut;
+
+ _accrue(token, quoteToken, fee);
+ IERC20(token).safeTransfer(buyer, tokensOut);
+
+ emit Swap(token, quoteToken, buyer, true, quoteIn, tokensOut, fee);
+ }
+
+ /// @dev Constant product against the virtual reserves. Tokens out
+ /// approaches, but never reaches, the reserve, so the curve has no final
+ /// token and therefore no price ceiling.
+ ///
+ /// Both sides round the remaining reserve UP, which rounds the amount out
+ /// DOWN. Rounding the other way lets a buy-then-sell round trip return one
+ /// wei more than it put in, and repeating that drains the pool a wei at a
+ /// time. Dust in the pool's favour is the only safe direction.
+ function _tokensOut(Curve storage c, uint256 netIn) private view returns (uint256) {
+ uint256 k = c.virtualQuote * c.virtualToken;
+ uint256 newQuote = c.virtualQuote + netIn;
+ return c.virtualToken - _ceilDiv(k, newQuote);
+ }
+
+ function _quoteOut(Curve storage c, uint256 tokensIn) private view returns (uint256) {
+ uint256 k = c.virtualQuote * c.virtualToken;
+ uint256 newToken = c.virtualToken + tokensIn;
+ return c.virtualQuote - _ceilDiv(k, newToken);
+ }
+
+ function _ceilDiv(uint256 a, uint256 b) private pure returns (uint256) {
+ return a == 0 ? 0 : ((a - 1) / b) + 1;
+ }
+
+ function _accrue(address token, address quoteToken, uint256 fee) private {
+ if (fee == 0) return;
+ uint256 creatorCut = (fee * CREATOR_FEE_SHARE_BPS) / BPS;
+ address recipient = feeRecipientOf[token];
+ claimable[recipient][quoteToken] += creatorCut;
+ claimable[treasury][quoteToken] += fee - creatorCut;
+ emit FeesAccrued(recipient, quoteToken, creatorCut);
+ }
+
+ // ── fees ─────────────────────────────────────────────────────────────────
+
+ /// @notice Claim every listed asset in one transaction.
+ /// @dev Batched on purpose. A creator paired against three stocks earns in
+ /// three assets, and making them send three transactions to collect one
+ /// day of fees is how fees go unclaimed.
+ function claimFees(address[] calldata assets) external nonReentrant returns (uint256 claimedCount) {
+ for (uint256 i; i < assets.length; ++i) {
+ address q = assets[i];
+ uint256 amount = claimable[msg.sender][q];
+ if (amount == 0) continue;
+ claimable[msg.sender][q] = 0;
+ IERC20(q).safeTransfer(msg.sender, amount);
+ emit FeesClaimed(msg.sender, q, amount);
+ unchecked {
+ ++claimedCount;
+ }
+ }
+ if (claimedCount == 0) revert NothingToClaim();
+ }
+
+ /// @notice Point a coin's future fees at a different address.
+ /// @dev PAIR fixes this at launch. Letting the current recipient move it
+ /// means a creator who rotates wallets, or hands a project to a DAO, does
+ /// not lose the revenue stream. Already-accrued fees stay with whoever
+ /// earned them.
+ function setFeeRecipient(address token, address to) external {
+ address current = feeRecipientOf[token];
+ if (msg.sender != current) revert NotFeeRecipient();
+ feeRecipientOf[token] = to;
+ emit FeeRecipientChanged(token, current, to);
+ }
+
+ // ── views ────────────────────────────────────────────────────────────────
+
+ function marketsOf(address token) external view returns (address[] memory) {
+ return _markets[token];
+ }
+
+ function curveOf(address token, address quoteToken) external view returns (Curve memory) {
+ return _curves[token][quoteToken];
+ }
+
+ function tokenCount() external view returns (uint256) {
+ return _allTokens.length;
+ }
+
+ function tokenAt(uint256 index) external view returns (address) {
+ return _allTokens[index];
+ }
+
+ function quoteTokens() external view returns (address[] memory) {
+ return _quoteList;
+ }
+
+ /// @notice Price of one whole coin in quote-token units, scaled by 1e18.
+ function priceOf(address token, address quoteToken) external view returns (uint256) {
+ Curve storage c = _curves[token][quoteToken];
+ if (!c.exists || c.virtualToken == 0) return 0;
+ return (c.virtualQuote * 1e18) / c.virtualToken;
+ }
+
+ function quoteBuy(address token, address quoteToken, uint256 quoteIn)
+ external
+ view
+ returns (uint256 tokensOut, uint256 fee)
+ {
+ Curve storage c = _curves[token][quoteToken];
+ if (!c.exists || quoteIn == 0) return (0, 0);
+ fee = (quoteIn * swapFeeBps) / BPS;
+ tokensOut = _tokensOut(c, quoteIn - fee);
+ }
+
+ function quoteSell(address token, address quoteToken, uint256 tokensIn)
+ external
+ view
+ returns (uint256 quoteOut, uint256 fee)
+ {
+ Curve storage c = _curves[token][quoteToken];
+ if (!c.exists || tokensIn == 0) return (0, 0);
+ uint256 gross = _quoteOut(c, tokensIn);
+ fee = (gross * swapFeeBps) / BPS;
+ quoteOut = gross - fee;
+ }
+
+ // ── administration ───────────────────────────────────────────────────────
+
+ function setQuoteConfig(address quoteToken, uint128 virtualQuote, bool enabled) external onlyOwner {
+ if (quoteConfig[quoteToken].virtualQuote == 0 && virtualQuote != 0) _quoteList.push(quoteToken);
+ quoteConfig[quoteToken] = QuoteConfig({virtualQuote: virtualQuote, enabled: enabled});
+ emit QuoteConfigured(quoteToken, virtualQuote, enabled);
+ }
+
+ function setParams(uint256 _launchFeeWei, uint16 _swapFeeBps, address _treasury) external onlyOwner {
+ // Capped in code, not just in policy: an owner key that can raise the
+ // swap fee without limit is an owner key that can expropriate traders.
+ if (_swapFeeBps > 500) revert FeeTooHigh();
+ launchFeeWei = _launchFeeWei;
+ swapFeeBps = _swapFeeBps;
+ treasury = _treasury;
+ emit ParamsChanged(_launchFeeWei, _swapFeeBps, _treasury);
+ }
+
+ function transferOwnership(address to) external onlyOwner {
+ emit OwnerChanged(owner, to);
+ owner = to;
+ }
+}
diff --git a/contracts/paired-launchpad/src/PairedToken.sol b/contracts/paired-launchpad/src/PairedToken.sol
new file mode 100644
index 000000000..9eb8f1b82
--- /dev/null
+++ b/contracts/paired-launchpad/src/PairedToken.sol
@@ -0,0 +1,93 @@
+// SPDX-License-Identifier: Apache-2.0
+pragma solidity 0.8.28;
+
+/// @title PairedToken
+/// @notice A fixed-supply ERC-20 minted once, in full, to the launchpad.
+///
+/// @dev Deliberately minimal. There is no mint function, no owner, no pause,
+/// no blacklist, and no upgrade path. Every one of those is a lever someone
+/// could pull on holders later, and a launchpad whose tokens carry them is
+/// asking buyers to trust the deployer. The supply that exists at construction
+/// is the supply that will ever exist.
+contract PairedToken {
+ string public name;
+ string public symbol;
+ uint8 public constant decimals = 18;
+
+ uint256 public immutable totalSupply;
+
+ /// @notice The launchpad that created this token. Informational only: it
+ /// holds no privileges over the token beyond the balance it was minted.
+ address public immutable launchpad;
+
+ /// @notice Off-chain descriptor (name, icon, links) for explorers and
+ /// aggregators, plus the keccak of its exact bytes so a rehosted document
+ /// cannot silently differ from what was committed at launch.
+ string public metadataURI;
+ bytes32 public immutable metadataHash;
+
+ mapping(address => uint256) public balanceOf;
+ mapping(address => mapping(address => uint256)) public allowance;
+
+ event Transfer(address indexed from, address indexed to, uint256 value);
+ event Approval(address indexed owner, address indexed spender, uint256 value);
+
+ error InsufficientBalance();
+ error InsufficientAllowance();
+ error TransferToZero();
+
+ constructor(
+ string memory _name,
+ string memory _symbol,
+ uint256 _supply,
+ string memory _metadataURI,
+ bytes32 _metadataHash,
+ address _mintTo
+ ) {
+ name = _name;
+ symbol = _symbol;
+ totalSupply = _supply;
+ metadataURI = _metadataURI;
+ metadataHash = _metadataHash;
+ launchpad = msg.sender;
+
+ balanceOf[_mintTo] = _supply;
+ emit Transfer(address(0), _mintTo, _supply);
+ }
+
+ function transfer(address to, uint256 value) external returns (bool) {
+ _transfer(msg.sender, to, value);
+ return true;
+ }
+
+ function transferFrom(address from, address to, uint256 value) external returns (bool) {
+ uint256 allowed = allowance[from][msg.sender];
+ // An allowance of max uint256 is treated as infinite and never
+ // decremented, which is the convention wallets and routers expect.
+ if (allowed != type(uint256).max) {
+ if (allowed < value) revert InsufficientAllowance();
+ unchecked {
+ allowance[from][msg.sender] = allowed - value;
+ }
+ }
+ _transfer(from, to, value);
+ return true;
+ }
+
+ function approve(address spender, uint256 value) external returns (bool) {
+ allowance[msg.sender][spender] = value;
+ emit Approval(msg.sender, spender, value);
+ return true;
+ }
+
+ function _transfer(address from, address to, uint256 value) private {
+ if (to == address(0)) revert TransferToZero();
+ uint256 balance = balanceOf[from];
+ if (balance < value) revert InsufficientBalance();
+ unchecked {
+ balanceOf[from] = balance - value;
+ balanceOf[to] += value;
+ }
+ emit Transfer(from, to, value);
+ }
+}
diff --git a/contracts/paired-launchpad/test/MockStock.sol b/contracts/paired-launchpad/test/MockStock.sol
new file mode 100644
index 000000000..3fccd6ae3
--- /dev/null
+++ b/contracts/paired-launchpad/test/MockStock.sol
@@ -0,0 +1,49 @@
+// SPDX-License-Identifier: Apache-2.0
+pragma solidity 0.8.28;
+
+/// @notice Stand-in for a tokenized stock: a plain 18-decimal ERC-20.
+contract MockStock {
+ string public name;
+ string public symbol;
+ uint8 public constant decimals = 18;
+ uint256 public totalSupply;
+ mapping(address => uint256) public balanceOf;
+ mapping(address => mapping(address => uint256)) public allowance;
+
+ event Transfer(address indexed from, address indexed to, uint256 value);
+ event Approval(address indexed owner, address indexed spender, uint256 value);
+
+ constructor(string memory _symbol) {
+ name = _symbol;
+ symbol = _symbol;
+ }
+
+ function mint(address to, uint256 amount) external {
+ totalSupply += amount;
+ balanceOf[to] += amount;
+ emit Transfer(address(0), to, amount);
+ }
+
+ function transfer(address to, uint256 value) external returns (bool) {
+ balanceOf[msg.sender] -= value;
+ balanceOf[to] += value;
+ emit Transfer(msg.sender, to, value);
+ return true;
+ }
+
+ function transferFrom(address from, address to, uint256 value) external returns (bool) {
+ if (allowance[from][msg.sender] != type(uint256).max) {
+ allowance[from][msg.sender] -= value;
+ }
+ balanceOf[from] -= value;
+ balanceOf[to] += value;
+ emit Transfer(from, to, value);
+ return true;
+ }
+
+ function approve(address spender, uint256 value) external returns (bool) {
+ allowance[msg.sender][spender] = value;
+ emit Approval(msg.sender, spender, value);
+ return true;
+ }
+}
diff --git a/contracts/paired-launchpad/test/PairedLaunchpad.t.sol b/contracts/paired-launchpad/test/PairedLaunchpad.t.sol
new file mode 100644
index 000000000..a6809405f
--- /dev/null
+++ b/contracts/paired-launchpad/test/PairedLaunchpad.t.sol
@@ -0,0 +1,449 @@
+// SPDX-License-Identifier: Apache-2.0
+pragma solidity 0.8.28;
+
+import {Test} from "forge-std/Test.sol";
+import {PairedLaunchpad} from "../src/PairedLaunchpad.sol";
+import {PairedToken} from "../src/PairedToken.sol";
+import {IERC20} from "../src/IERC20.sol";
+import {MockStock} from "./MockStock.sol";
+
+contract PairedLaunchpadTest is Test {
+ PairedLaunchpad pad;
+ MockStock nvda;
+ MockStock tsla;
+ MockStock aapl;
+
+ address treasury = makeAddr("treasury");
+ address creator = makeAddr("creator");
+ address trader = makeAddr("trader");
+
+ uint256 constant LAUNCH_FEE = 0.0005 ether;
+ uint16 constant SWAP_FEE_BPS = 100; // 1%
+ uint128 constant VIRTUAL_QUOTE = 30e18;
+ // A local copy, not pad.NO_DEV_BUY(). Reading it from the contract is an
+ // external call, and an external call inside an argument expression
+ // consumes the pending vm.prank before the call under test ever runs.
+ uint8 constant NO_DEV_BUY = type(uint8).max;
+
+ function setUp() public {
+ pad = new PairedLaunchpad(treasury, LAUNCH_FEE, SWAP_FEE_BPS);
+ nvda = new MockStock("NVDA");
+ tsla = new MockStock("TSLA");
+ aapl = new MockStock("AAPL");
+
+ pad.setQuoteConfig(address(nvda), VIRTUAL_QUOTE, true);
+ pad.setQuoteConfig(address(tsla), VIRTUAL_QUOTE, true);
+ pad.setQuoteConfig(address(aapl), VIRTUAL_QUOTE, true);
+
+ vm.deal(creator, 1 ether);
+ vm.deal(trader, 1 ether);
+ nvda.mint(trader, 1_000e18);
+ nvda.mint(creator, 1_000e18);
+ tsla.mint(trader, 1_000e18);
+ }
+
+ // ── helpers ──────────────────────────────────────────────────────────────
+
+ function _alloc(address q, uint16 w) internal pure returns (PairedLaunchpad.Allocation memory) {
+ return PairedLaunchpad.Allocation({quoteToken: q, weightBps: w});
+ }
+
+ function _params(PairedLaunchpad.Allocation[] memory allocs)
+ internal
+ view
+ returns (PairedLaunchpad.LaunchParams memory)
+ {
+ return PairedLaunchpad.LaunchParams({
+ name: "Test Coin",
+ symbol: "TEST",
+ metadataURI: "https://paired.exchange/m/abc",
+ metadataHash: keccak256("abc"),
+ allocations: allocs,
+ creatorFeeRecipient: address(0),
+ devBuyMarket: NO_DEV_BUY,
+ devBuyQuoteIn: 0,
+ devBuyMinTokensOut: 0,
+ deadline: block.timestamp + 600
+ });
+ }
+
+ function _oneMarket() internal view returns (PairedLaunchpad.LaunchParams memory) {
+ PairedLaunchpad.Allocation[] memory a = new PairedLaunchpad.Allocation[](1);
+ a[0] = _alloc(address(nvda), 10_000);
+ return _params(a);
+ }
+
+ function _launch() internal returns (address token) {
+ vm.prank(creator);
+ return pad.launch{value: LAUNCH_FEE}(_oneMarket());
+ }
+
+ // ── launching ────────────────────────────────────────────────────────────
+
+ function test_launch_mintsFixedSupplyIntoTheCurves() public {
+ address token = _launch();
+ assertEq(PairedToken(token).totalSupply(), pad.TOTAL_SUPPLY());
+ assertEq(IERC20(token).balanceOf(address(pad)), pad.TOTAL_SUPPLY());
+ assertEq(pad.creatorOf(token), creator);
+ assertEq(pad.feeRecipientOf(token), creator);
+ }
+
+ function test_launch_sendsTheFeeToTreasury() public {
+ uint256 before = treasury.balance;
+ _launch();
+ assertEq(treasury.balance - before, LAUNCH_FEE);
+ }
+
+ function test_launch_rejectsAWrongFee() public {
+ vm.prank(creator);
+ vm.expectRevert(PairedLaunchpad.BadFee.selector);
+ pad.launch{value: LAUNCH_FEE - 1}(_oneMarket());
+ }
+
+ function test_launch_splitsSupplyExactlyAcrossMarkets() public {
+ PairedLaunchpad.Allocation[] memory a = new PairedLaunchpad.Allocation[](3);
+ a[0] = _alloc(address(nvda), 3_334);
+ a[1] = _alloc(address(tsla), 3_333);
+ a[2] = _alloc(address(aapl), 3_333);
+
+ vm.prank(creator);
+ address token = pad.launch{value: LAUNCH_FEE}(_params(a));
+
+ uint256 sum;
+ address[] memory markets = pad.marketsOf(token);
+ assertEq(markets.length, 3);
+ for (uint256 i; i < markets.length; ++i) {
+ sum += pad.curveOf(token, markets[i]).tokensLeft;
+ }
+ // Every wei of supply is in a curve. Integer division must not lose any.
+ assertEq(sum, pad.TOTAL_SUPPLY());
+ }
+
+ function test_launch_requiresWeightsToTotalExactly() public {
+ PairedLaunchpad.Allocation[] memory a = new PairedLaunchpad.Allocation[](2);
+ a[0] = _alloc(address(nvda), 5_000);
+ a[1] = _alloc(address(tsla), 4_999);
+ vm.prank(creator);
+ vm.expectRevert(PairedLaunchpad.WeightsMustTotalBps.selector);
+ pad.launch{value: LAUNCH_FEE}(_params(a));
+ }
+
+ function test_launch_rejectsDuplicateMarkets() public {
+ PairedLaunchpad.Allocation[] memory a = new PairedLaunchpad.Allocation[](2);
+ a[0] = _alloc(address(nvda), 5_000);
+ a[1] = _alloc(address(nvda), 5_000);
+ vm.prank(creator);
+ vm.expectRevert(PairedLaunchpad.DuplicateMarket.selector);
+ pad.launch{value: LAUNCH_FEE}(_params(a));
+ }
+
+ function test_launch_rejectsADisabledQuote() public {
+ MockStock other = new MockStock("GME");
+ PairedLaunchpad.Allocation[] memory a = new PairedLaunchpad.Allocation[](1);
+ a[0] = _alloc(address(other), 10_000);
+ vm.prank(creator);
+ vm.expectRevert(PairedLaunchpad.QuoteNotEnabled.selector);
+ pad.launch{value: LAUNCH_FEE}(_params(a));
+ }
+
+ function test_launch_rejectsMoreThanFiveMarkets() public {
+ PairedLaunchpad.Allocation[] memory a = new PairedLaunchpad.Allocation[](6);
+ for (uint256 i; i < 6; ++i) {
+ MockStock s = new MockStock("X");
+ pad.setQuoteConfig(address(s), VIRTUAL_QUOTE, true);
+ a[i] = _alloc(address(s), i == 5 ? 1_668 : 1_666);
+ }
+ vm.prank(creator);
+ vm.expectRevert(PairedLaunchpad.TooManyMarkets.selector);
+ pad.launch{value: LAUNCH_FEE}(_params(a));
+ }
+
+ function test_launch_rejectsAnExpiredDeadline() public {
+ PairedLaunchpad.LaunchParams memory p = _oneMarket();
+ p.deadline = block.timestamp - 1;
+ vm.prank(creator);
+ vm.expectRevert(PairedLaunchpad.Expired.selector);
+ pad.launch{value: LAUNCH_FEE}(p);
+ }
+
+ /// @dev The bug this whole design avoids: on PAIR, "no dev buy" has to be
+ /// encoded as market index 255, and index 0 with a zero amount reverts.
+ function test_launch_withoutADevBuyNeedsNoApprovalOrStock() public {
+ address broke = makeAddr("broke");
+ vm.deal(broke, 1 ether);
+ vm.prank(broke);
+ address token = pad.launch{value: LAUNCH_FEE}(_oneMarket());
+ assertTrue(token != address(0));
+ assertEq(IERC20(address(nvda)).balanceOf(broke), 0);
+ }
+
+ function test_launch_withADevBuyGivesTheCreatorTokens() public {
+ PairedLaunchpad.LaunchParams memory p = _oneMarket();
+ p.devBuyMarket = 0;
+ p.devBuyQuoteIn = 10e18;
+
+ vm.startPrank(creator);
+ nvda.approve(address(pad), type(uint256).max);
+ address token = pad.launch{value: LAUNCH_FEE}(p);
+ vm.stopPrank();
+
+ assertGt(IERC20(token).balanceOf(creator), 0);
+ assertEq(nvda.balanceOf(creator), 1_000e18 - 10e18);
+ }
+
+ function test_launch_rejectsADevBuyOnAMarketItDidNotOpen() public {
+ PairedLaunchpad.LaunchParams memory p = _oneMarket();
+ p.devBuyMarket = 3;
+ p.devBuyQuoteIn = 1e18;
+ vm.prank(creator);
+ vm.expectRevert(PairedLaunchpad.BadDevBuy.selector);
+ pad.launch{value: LAUNCH_FEE}(p);
+ }
+
+ // ── trading ──────────────────────────────────────────────────────────────
+
+ function test_buy_movesPriceUp() public {
+ address token = _launch();
+ uint256 p0 = pad.priceOf(token, address(nvda));
+
+ vm.startPrank(trader);
+ nvda.approve(address(pad), type(uint256).max);
+ pad.buy(token, address(nvda), 10e18, 0);
+ vm.stopPrank();
+
+ assertGt(pad.priceOf(token, address(nvda)), p0);
+ assertGt(IERC20(token).balanceOf(trader), 0);
+ }
+
+ function test_buy_matchesItsQuote() public {
+ address token = _launch();
+ (uint256 expected, ) = pad.quoteBuy(token, address(nvda), 10e18);
+
+ vm.startPrank(trader);
+ nvda.approve(address(pad), type(uint256).max);
+ uint256 actual = pad.buy(token, address(nvda), 10e18, 0);
+ vm.stopPrank();
+
+ assertEq(actual, expected);
+ }
+
+ function test_buy_honoursSlippage() public {
+ address token = _launch();
+ vm.startPrank(trader);
+ nvda.approve(address(pad), type(uint256).max);
+ vm.expectRevert(PairedLaunchpad.SlippageExceeded.selector);
+ pad.buy(token, address(nvda), 10e18, type(uint256).max);
+ vm.stopPrank();
+ }
+
+ function test_sell_returnsQuoteAndLowersPrice() public {
+ address token = _launch();
+ vm.startPrank(trader);
+ nvda.approve(address(pad), type(uint256).max);
+ uint256 bought = pad.buy(token, address(nvda), 50e18, 0);
+ uint256 priceAfterBuy = pad.priceOf(token, address(nvda));
+
+ IERC20(token).approve(address(pad), type(uint256).max);
+ uint256 before = nvda.balanceOf(trader);
+ uint256 out = pad.sell(token, address(nvda), bought, 0);
+ vm.stopPrank();
+
+ assertGt(out, 0);
+ assertEq(nvda.balanceOf(trader) - before, out);
+ assertLt(pad.priceOf(token, address(nvda)), priceAfterBuy);
+ }
+
+ /// @dev A full round trip must lose money, and lose it only to fees. If it
+ /// ever returned more than it cost, the curve would be a faucet.
+ function test_roundTrip_costsExactlyTheFees() public {
+ address token = _launch();
+ vm.startPrank(trader);
+ nvda.approve(address(pad), type(uint256).max);
+ uint256 spent = 100e18;
+ uint256 bought = pad.buy(token, address(nvda), spent, 0);
+ IERC20(token).approve(address(pad), type(uint256).max);
+ uint256 returned = pad.sell(token, address(nvda), bought, 0);
+ vm.stopPrank();
+
+ assertLt(returned, spent);
+ // Two 1% fees, with rounding slack.
+ uint256 loss = spent - returned;
+ assertGe(loss, (spent * 195) / 10_000);
+ assertLe(loss, (spent * 205) / 10_000);
+ }
+
+ function test_trading_rejectsAnUnknownMarket() public {
+ address token = _launch();
+ vm.prank(trader);
+ vm.expectRevert(PairedLaunchpad.UnknownMarket.selector);
+ pad.buy(token, address(tsla), 1e18, 0);
+ }
+
+ // ── fees ─────────────────────────────────────────────────────────────────
+
+ function test_fees_splitSeventyThirty() public {
+ address token = _launch();
+ vm.startPrank(trader);
+ nvda.approve(address(pad), type(uint256).max);
+ pad.buy(token, address(nvda), 100e18, 0);
+ vm.stopPrank();
+
+ uint256 fee = (uint256(100e18) * uint256(SWAP_FEE_BPS)) / 10_000;
+ assertEq(pad.claimable(creator, address(nvda)), (fee * 7_000) / 10_000);
+ assertEq(pad.claimable(treasury, address(nvda)), fee - (fee * 7_000) / 10_000);
+ }
+
+ function test_claimFees_paysOutAndZeroes() public {
+ address token = _launch();
+ vm.startPrank(trader);
+ nvda.approve(address(pad), type(uint256).max);
+ pad.buy(token, address(nvda), 100e18, 0);
+ vm.stopPrank();
+
+ uint256 owed = pad.claimable(creator, address(nvda));
+ address[] memory assets = new address[](1);
+ assets[0] = address(nvda);
+
+ vm.prank(creator);
+ pad.claimFees(assets);
+
+ assertEq(nvda.balanceOf(creator), 1_000e18 + owed);
+ assertEq(pad.claimable(creator, address(nvda)), 0);
+ }
+
+ /// @dev The improvement over one-transaction-per-asset claiming.
+ function test_claimFees_batchesEveryAssetInOneTransaction() public {
+ PairedLaunchpad.Allocation[] memory a = new PairedLaunchpad.Allocation[](2);
+ a[0] = _alloc(address(nvda), 5_000);
+ a[1] = _alloc(address(tsla), 5_000);
+ vm.prank(creator);
+ address token = pad.launch{value: LAUNCH_FEE}(_params(a));
+
+ vm.startPrank(trader);
+ nvda.approve(address(pad), type(uint256).max);
+ tsla.approve(address(pad), type(uint256).max);
+ pad.buy(token, address(nvda), 100e18, 0);
+ pad.buy(token, address(tsla), 100e18, 0);
+ vm.stopPrank();
+
+ address[] memory assets = new address[](2);
+ assets[0] = address(nvda);
+ assets[1] = address(tsla);
+
+ vm.prank(creator);
+ uint256 claimed = pad.claimFees(assets);
+ assertEq(claimed, 2);
+ assertGt(nvda.balanceOf(creator), 1_000e18);
+ assertGt(tsla.balanceOf(creator), 0);
+ }
+
+ function test_claimFees_revertsWhenThereIsNothing() public {
+ address[] memory assets = new address[](1);
+ assets[0] = address(nvda);
+ vm.prank(creator);
+ vm.expectRevert(PairedLaunchpad.NothingToClaim.selector);
+ pad.claimFees(assets);
+ }
+
+ function test_setFeeRecipient_movesFutureFeesOnly() public {
+ address token = _launch();
+ address newRecipient = makeAddr("newRecipient");
+
+ vm.startPrank(trader);
+ nvda.approve(address(pad), type(uint256).max);
+ pad.buy(token, address(nvda), 100e18, 0);
+ vm.stopPrank();
+ uint256 earnedBefore = pad.claimable(creator, address(nvda));
+
+ vm.prank(creator);
+ pad.setFeeRecipient(token, newRecipient);
+
+ vm.prank(trader);
+ pad.buy(token, address(nvda), 100e18, 0);
+
+ // Already-earned fees stay with whoever earned them.
+ assertEq(pad.claimable(creator, address(nvda)), earnedBefore);
+ assertGt(pad.claimable(newRecipient, address(nvda)), 0);
+ }
+
+ function test_setFeeRecipient_onlyByTheCurrentRecipient() public {
+ address token = _launch();
+ vm.prank(trader);
+ vm.expectRevert(PairedLaunchpad.NotFeeRecipient.selector);
+ pad.setFeeRecipient(token, trader);
+ }
+
+ // ── administration ───────────────────────────────────────────────────────
+
+ function test_setParams_capsTheSwapFee() public {
+ vm.expectRevert(PairedLaunchpad.FeeTooHigh.selector);
+ pad.setParams(LAUNCH_FEE, 501, treasury);
+ }
+
+ function test_admin_isOwnerOnly() public {
+ vm.prank(trader);
+ vm.expectRevert(PairedLaunchpad.NotOwner.selector);
+ pad.setParams(0, 0, trader);
+ }
+
+ function test_theTokenHasNoAdminSurface() public {
+ address token = _launch();
+ // No mint, no owner, no pause. The supply is fixed at construction and
+ // nothing on the token can change it.
+ assertEq(PairedToken(token).totalSupply(), pad.TOTAL_SUPPLY());
+ assertEq(PairedToken(token).launchpad(), address(pad));
+ }
+
+ // ── fuzzing ──────────────────────────────────────────────────────────────
+
+ /// @dev The property that matters most: a buy followed by an immediate sell
+ /// must never return more than it cost, at any size. The first version of
+ /// the curve failed this by one wei because integer division rounded toward
+ /// the trader, and one wei repeated is a drain.
+ function testFuzz_roundTripNeverProfits(uint96 raw) public {
+ uint256 amount = bound(uint256(raw), 1e12, 500e18);
+ address token = _launch();
+
+ vm.startPrank(trader);
+ nvda.approve(address(pad), type(uint256).max);
+ uint256 bought = pad.buy(token, address(nvda), amount, 0);
+ IERC20(token).approve(address(pad), type(uint256).max);
+ uint256 returned = pad.sell(token, address(nvda), bought, 0);
+ vm.stopPrank();
+
+ assertLe(returned, amount);
+ }
+
+ /// @dev Whatever the curve believes it holds must actually be there, or a
+ /// later seller is paid with someone else's deposit.
+ function testFuzz_reserveIsAlwaysBacked(uint96 raw, uint8 trades) public {
+ uint256 amount = bound(uint256(raw), 1e12, 50e18);
+ uint256 count = bound(uint256(trades), 1, 10);
+ address token = _launch();
+
+ vm.startPrank(trader);
+ nvda.approve(address(pad), type(uint256).max);
+ for (uint256 i; i < count; ++i) {
+ pad.buy(token, address(nvda), amount, 0);
+ }
+ vm.stopPrank();
+
+ PairedLaunchpad.Curve memory c = pad.curveOf(token, address(nvda));
+ assertLe(c.realQuote, nvda.balanceOf(address(pad)));
+ assertEq(IERC20(token).balanceOf(address(pad)), c.tokensLeft);
+ }
+
+ /// @dev Supply is conserved: what the curves still hold plus what traders
+ /// hold is always exactly the fixed supply.
+ function testFuzz_supplyIsConserved(uint96 raw) public {
+ uint256 amount = bound(uint256(raw), 1e12, 200e18);
+ address token = _launch();
+
+ vm.startPrank(trader);
+ nvda.approve(address(pad), type(uint256).max);
+ uint256 bought = pad.buy(token, address(nvda), amount, 0);
+ vm.stopPrank();
+
+ assertEq(bought + pad.curveOf(token, address(nvda)).tokensLeft, pad.TOTAL_SUPPLY());
+ }
+}
diff --git a/data/changelog.json b/data/changelog.json
index f67436660..91bbc4502 100644
--- a/data/changelog.json
+++ b/data/changelog.json
@@ -3,12 +3,12 @@
"entries": [
{
"date": "2026-10-08",
- "title": "Grok model menus now offer xAI's current models",
- "summary": "Every Grok picker on three.ws (the /brain menu, agent chat, the avatar page and the embed editor) now lists xAI's current line-up: Grok 4.7, xAI's flagship, Grok 4.3 with its 1M-token context at the lowest Grok price, Grok 4.20 Fast with no thinking pass, and Grok Build for coding. Agents and embeds that saved a Grok model xAI has since retired, such as Grok 4.1 Fast, keep working and answer on the model xAI recommends in its place. People who bring their own xAI key now get Grok 4.7 by default instead of an older flagship.",
+ "title": "Signing in to the 3D Studio, wallet, Bazaar and IBM MCP servers works from any connector",
+ "summary": "Adding the 3D Studio, agent wallet, x402 Bazaar or IBM Granite MCP server to an AI client with sign-in (Grok Bot, claude.ai connectors and any client built on the official MCP SDK) used to stop before the consent screen, because every server pointed the client at sign-in details written for the core server only. Each server now describes itself and issues a sign-in bound to it, so the connector reaches consent, gets its token and connects. Existing connections keep working. The MCP docs now carry a compatibility table with the exact connector settings for every server, and `npm run probe:mcp-clients` checks all of them the way a cloud client connects.",
"tags": [
- "improvement"
+ "fix"
],
- "link": "/brain"
+ "link": "/docs/mcp"
},
{
"date": "2026-10-08",
@@ -19,6 +19,15 @@
],
"link": "/coins"
},
+ {
+ "date": "2026-10-08",
+ "title": "Coin charts say plainly when a coin has no market yet",
+ "summary": "A coin with no trading pool anywhere could show a price-history error on its chart when a market data source was busy. The chart now recognises the coin has no market and shows the no-price-history state, and it asks that source one question fewer per chart load.",
+ "tags": [
+ "fix"
+ ],
+ "link": "/terminal"
+ },
{
"date": "2026-10-08",
"title": "3D Studio results now hand every agent plain links to the model",
@@ -30,12 +39,30 @@
},
{
"date": "2026-10-08",
- "title": "Coin charts say plainly when a coin has no market yet",
- "summary": "A coin with no trading pool anywhere could show a price-history error on its chart when a market data source was busy. The chart now recognises the coin has no market and shows the no-price-history state, and it asks that source one question fewer per chart load.",
+ "title": "Coin Clash stays playable when community data is offline",
+ "summary": "When the community roster behind Coin Clash is unavailable, the arena no longer goes dark. Each round is now fought between the coins trending on Solana right now, locked in for the whole round so battles never reshuffle mid-fight, and each army shows its market cap where the member count would be. Enlisting, rallying and war records work exactly as before.",
"tags": [
- "fix"
+ "improvement"
],
- "link": "/terminal"
+ "link": "/clash"
+ },
+ {
+ "date": "2026-10-08",
+ "title": "Grok model menus now offer xAI's current models",
+ "summary": "Every Grok picker on three.ws (the /brain menu, agent chat, the avatar page and the embed editor) now lists xAI's current line-up: Grok 4.7, xAI's flagship, Grok 4.3 with its 1M-token context at the lowest Grok price, Grok 4.20 Fast with no thinking pass, and Grok Build for coding. Agents and embeds that saved a Grok model xAI has since retired, such as Grok 4.1 Fast, keep working and answer on the model xAI recommends in its place. People who bring their own xAI key now get Grok 4.7 by default instead of an older flagship.",
+ "tags": [
+ "improvement"
+ ],
+ "link": "/brain"
+ },
+ {
+ "date": "2026-10-08",
+ "title": "Your agent can launch its own coin on Robinhood Chain",
+ "summary": "Agents can now launch a coin on Robinhood Chain through Pons, the chain's busiest launchpad, signed by the agent's own wallet. Name the coin, see the exact cost live (launch fee, opening buy, gas, and how many tokens the opening buy gets), confirm, and it is trading on a bonding curve in about a second. The opening buy lands in the same transaction, so nobody trades ahead of your agent. Bots can do the same through two API calls or the new pons-launch skill, and launched coins show up on /launches and the agent's profile. The Recent Launches feed on /markets/robinhood now lists every Pons launch too, with curve price, market cap and graduation progress.",
+ "tags": [
+ "feature"
+ ],
+ "link": "/launch/robinhood"
},
{
"date": "2026-10-08",
@@ -29106,13 +29133,6 @@
"tags": ["improvement"],
"link": "/chat"
},
- {
- "date": "2026-10-08",
- "title": "Fewer failed 3D generations when the concept image comes back blank",
- "summary": "Text to 3D first paints a concept image, then sculpts it. When the painting service quietly returned a blank black frame instead of a picture, the studio used it anyway, and every 3D engine then failed because there was nothing in the image to sculpt. The studio now spots a blank or withheld frame and paints the concept with the next image service instead, so those prompts finish as real models.",
- "tags": ["fix"],
- "link": "/forge"
- },
{
"date": "2026-10-08",
"title": "Shared 3D models now explain themselves to X and Grok",
@@ -29121,6 +29141,13 @@
"improvement"
],
"link": "/creations"
+ },
+ {
+ "date": "2026-10-08",
+ "title": "Fewer failed 3D generations when the concept image comes back blank",
+ "summary": "Text to 3D first paints a concept image, then sculpts it. When the painting service quietly returned a blank black frame instead of a picture, the studio used it anyway, and every 3D engine then failed because there was nothing in the image to sculpt. The studio now spots a blank or withheld frame and paints the concept with the next image service instead, so those prompts finish as real models.",
+ "tags": ["fix"],
+ "link": "/forge"
}
]
}
diff --git a/data/pages.json b/data/pages.json
index b7f581ac0..7e9142753 100644
--- a/data/pages.json
+++ b/data/pages.json
@@ -1548,6 +1548,22 @@
"changefreq": "monthly",
"added": "2026-06-15"
},
+ {
+ "path": "/launch/paired",
+ "title": "Launch a Paired Coin",
+ "description": "Have your 3D AI agent launch a coin on Robinhood Chain paired with up to five assets at once (tokenized stocks, WETH, stablecoins, chain coins) from its own wallet: a live cost quote with each pool's opening value, an atomic opening buy, spend-policy checks, and the same launch as an API call and MCP tools.",
+ "priority": 0.7,
+ "changefreq": "monthly",
+ "added": "2026-10-08"
+ },
+ {
+ "path": "/launch/robinhood",
+ "title": "Launch on Robinhood Chain",
+ "description": "Launch a coin on Robinhood Chain through Pons, signed by your 3D AI agent's own wallet: a live cost quote, an atomic opening buy, and an API your bots can call.",
+ "priority": 0.7,
+ "changefreq": "monthly",
+ "added": "2026-10-08"
+ },
{
"path": "/launch-studio",
"title": "Launch Studio: 50 ways to mint a coin",
@@ -2583,6 +2599,14 @@
"changefreq": "hourly",
"added": "2026-09-07"
},
+ {
+ "path": "/markets/robinhood/paired",
+ "title": "Paired Coins",
+ "description": "Coins on Robinhood Chain that trade against up to five assets at once: tokenized stocks, WETH, stablecoins and chain coins, each in its own bonding curve with liquidity locked forever. Live pools priced in dollars, charts per pool, every trade, a buy and sell ticket, and the AI agents that launched them.",
+ "priority": 0.8,
+ "changefreq": "hourly",
+ "added": "2026-10-08"
+ },
{
"path": "/markets/news",
"title": "Crypto News",
diff --git a/docs/api-reference.md b/docs/api-reference.md
index 311cbe8d9..35bcc6c05 100644
--- a/docs/api-reference.md
+++ b/docs/api-reference.md
@@ -553,6 +553,54 @@ An agent with no coin answers `has_coins: false` with every figure at `0` and em
**Caching:** `public, max-age=60, s-maxage=120, stale-while-revalidate=300`.
+### Earnings leaderboard
+
+```
+GET /api/leaderboard/earnings?window=7d&limit=25&offset=0
+```
+
+Public agents ranked by what they earned in a window: pump.fun creator fees from their coins plus service income (x402 skill sales net of the platform fee, plus completed hires by other agents), each shown separately with the total in SOL and USD. No auth required. Only public agents that earned something in the window are ranked. This is the board behind the Earned tab on [`/leaderboard?tab=earned`](https://three.ws/leaderboard?tab=earned), and every row's figures come from the same computation as [Agent earnings](#agent-earnings), so a row always matches `GET /api/agents/:id/earnings` for the same window.
+
+| Query | Values | Default |
+|---|---|---|
+| `window` | `24h`, `7d`, `30d`, `all` | `7d` |
+| `limit` | `1` to `100` | `25` |
+| `offset` | `0` and up | `0` |
+
+```bash
+curl -s "https://three.ws/api/leaderboard/earnings?window=30d&limit=2"
+```
+
+**Response (abridged; the coin's fields are elided):**
+
+```json
+{
+ "window": "30d",
+ "sol_price_usd": 114.9,
+ "total": 9,
+ "limit": 2,
+ "offset": 0,
+ "refreshed_at": "2026-10-08T04:36:45.126Z",
+ "method": "Creator fees come from pump.fun's creator-fee index ...",
+ "rows": [
+ {
+ "rank": 1,
+ "previous_rank": null,
+ "movement": "new",
+ "agent": { "id": "34d88eda-...", "name": "Quill #22", "url": "/agents/34d88eda-...", "thumbnail_url": null },
+ "coin": { "mint": "...", "symbol": "...", "name": "...", "url": "/launches/..." },
+ "creator_fees": { "lamports": "104209", "sol": 0.000104209, "usd": 0.01 },
+ "service_income": { "skill_sales_usd": 0, "skill_sales_count": 0, "hires_usd": 0, "hires_count": 0, "usd": 0, "sol": 0 },
+ "total": { "sol": 0.000104209, "usd": 0.01 }
+ }
+ ]
+}
+```
+
+`total` is the number of ranked agents, for paging. `movement` compares the rank with the previous window of the same length (the 7 days before this 7, and so on): a positive number is places gained, a negative number places lost, `0` unchanged, `"new"` when the agent was not ranked then. It is `null` for `window=all`. Ranking is by `total.sol`, which converts service income at `sol_price_usd`. An empty window answers `total: 0` and `rows: []`. `method` and `refreshed_at` mean what they mean on [Agent earnings](#agent-earnings).
+
+**Caching:** `public, max-age=60, s-maxage=120, stale-while-revalidate=300`. The figures underneath refresh every 30 minutes.
+
---
## Widgets API
diff --git a/docs/nav.json b/docs/nav.json
index 17c40fc28..94519a5da 100644
--- a/docs/nav.json
+++ b/docs/nav.json
@@ -681,6 +681,10 @@
"label": "Pump Launcher (paid launch API)",
"path": "pump-launcher"
},
+ {
+ "label": "Launch on Robinhood Chain (Pons)",
+ "path": "pons-launch"
+ },
{
"label": "Launch Studio recipes",
"path": "launch-usecases"
@@ -947,6 +951,10 @@
"label": "3D Studio MCP (free)",
"path": "mcp-studio"
},
+ {
+ "label": "Grok and Grok Bot",
+ "path": "grok"
+ },
{
"label": "Agent manifest",
"path": "agent-manifest"
diff --git a/docs/pons-launch.md b/docs/pons-launch.md
new file mode 100644
index 000000000..e5f603068
--- /dev/null
+++ b/docs/pons-launch.md
@@ -0,0 +1,200 @@
+# Launch a coin on Robinhood Chain (Pons)
+
+A three.ws agent can launch its own coin on [Robinhood Chain](robinhood-chain-markets.md)
+through [Pons](https://ponsfamily.com), the chain's busiest launchpad. The agent's own wallet
+signs the launch, so the coin's creator is the agent. Creator fees go to the agent, and so does
+the opening buy.
+
+There are three ways in, and all of them run the same server path:
+
+| Who | How |
+| --- | --- |
+| An owner, by hand | [three.ws/launch/robinhood](https://three.ws/launch/robinhood) |
+| A bot or script | `POST /api/agents/:id/pons/quote`, then `POST /api/agents/:id/pons/launch` |
+| The agent itself | the `pons-launch` agent skill |
+
+## What a launch does
+
+Pons V2 mints a fixed 1,000,000,000 supply onto a bonding curve priced in ETH. Trading starts
+in the same block. When 4.2 ETH of real buys has gone into the curve, the coin graduates into a
+full-range Uniswap V4 pool whose liquidity is locked permanently. These figures are Pons's live
+launch config, and the quote reads them from the factory every time, so they are never stale.
+
+The launch is one transaction from the agent's wallet:
+
+- **With an opening buy:** the transaction goes to Pons's `PonsV2LaunchAndBuy` router. It deploys
+ the token and curve and buys in the same transaction, so no sniper can trade ahead of the agent.
+ The agent's address is recorded as the deployer and is exempt from Pons's anti-snipe tax.
+- **Without one:** it calls `PonsV2LaunchFactory.launchToken` directly.
+
+Either way, the transaction pins the economics it was quoted, so a change Pons makes to its
+fees or curve in between reverts the launch instead of silently repricing it.
+
+Contracts (MIT, verified source at
+[ponsdotdev/pons-labs](https://github.com/ponsdotdev/pons-labs)):
+
+| Contract | Address |
+| --- | --- |
+| `PonsV2LaunchFactory` | `0x7eD598BcEf8bd9Edd8C97A195C6d13f40801EC7e` |
+| `PonsV2LaunchAndBuy` | `0xe33E9E479dF8802cb0866d5d05258bEc4cF62948` |
+
+## Funding the agent wallet
+
+Every three.ws agent has one EVM address. It is the same address on Base and on Robinhood Chain.
+The quote names that address and its balance on Robinhood Chain. Send it native ETH on Robinhood
+Chain (chain ID 4663) to cover the following:
+
+- **Pons launch fee:** a flat fee, currently 0.0005 ETH.
+- **Opening buy:** whatever you choose, from 0 up to 4 ETH.
+- **Gas:** a launch uses about 3.5 to 3.7 million gas.
+
+The quote tells you exactly how much more the wallet needs.
+
+## API
+
+Both endpoints take the same JSON body. Authenticate either with the owner's session (from the
+browser, same origin) or with an API key that is allowed to spend:
+`Authorization: Bearer <key>`.
+
+| Field | Type | Notes |
+| --- | --- | --- |
+| `name` | string, required | Up to 64 bytes. |
+| `symbol` | string, required | Letters and digits, up to 16. A leading `$` is dropped. |
+| `description` | string | Up to 2048 bytes. |
+| `image_url` | string | `https://`, `ipfs://` or `ar://`, up to 512 bytes. Defaults to the agent's avatar when the avatar is public. |
+| `socials` | object | Any of `twitter`, `telegram`, `discord`, `website`, `farcaster`, each an `https://` URL. |
+| `buy_eth` | number | Opening buy in ETH, 0 to 4. Default 0. |
+| `creator_tax_bps` | integer | Extra trade tax paid to the agent, 0 to 1000 (10%). Default 0. |
+| `buyback` | boolean | Route the buyback share of fees into Pons's five-year locked buyback. Default false. |
+
+### `POST /api/agents/:id/pons/quote`
+
+Signs nothing. Returns the live terms, the full cost, the tokens the opening buy will receive,
+the agent wallet and its balance, the agent's spend policy, and `blockers`, which lists anything
+that would stop a launch right now (an unfunded wallet, a spend-limit breach, launches paused).
+`ready` is true when `blockers` is empty.
+
+```bash
+curl -X POST https://three.ws/api/agents/$AGENT_ID/pons/quote \
+ -H "authorization: Bearer $THREEWS_API_KEY" \
+ -H "content-type: application/json" \
+ -d '{"name":"My Coin","symbol":"MINE","buy_eth":0.01,"creator_tax_bps":100}'
+```
+
+```json
+{
+ "data": {
+ "chain": "robinhood",
+ "chain_id": 4663,
+ "venue": "pons",
+ "wallet": { "address": "0x694D1afeDbBb2C1aE6546641C604c5a7aF014EF0", "balance_eth": "0" },
+ "terms": {
+ "launch_fee_eth": "0.0005",
+ "curve_fee_bps": 100,
+ "max_creator_tax_bps": 1000,
+ "graduation_threshold_eth": "4.2",
+ "total_supply": "1000000000"
+ },
+ "cost": {
+ "launch_fee_eth": "0.0005",
+ "opening_buy_eth": "0.01",
+ "gas_eth": "0.00010171434",
+ "gas_estimated": false,
+ "total_eth": "0.01060171434",
+ "total_usd": 27.18,
+ "eth_usd": 2564.12
+ },
+ "opening_buy": { "tokens": "5799502.899751449875724937", "pct_of_supply": 0.5799 },
+ "ready": false,
+ "blockers": ["Fund 0x694D…4EF0 with at least 0.01060171434 more ETH on Robinhood Chain."],
+ "policy": { "per_tx_usd": null, "daily_usd": null, "spent_today_usd": 0 }
+ }
+}
+```
+
+`gas_estimated` is true when the wallet could cover the launch, so the node simulated the exact
+transaction. When it is false, the gas figure is the gas measured on real Pons launches.
+
+### `POST /api/agents/:id/pons/launch`
+
+Sends the same transaction the quote priced. The call answers once the transaction is mined,
+which takes about a second on Robinhood Chain.
+
+```json
+{
+ "data": {
+ "chain": "robinhood",
+ "venue": "pons",
+ "token": "0x…",
+ "curve": "0x…",
+ "name": "My Coin",
+ "symbol": "MINE",
+ "tx_hash": "0x…",
+ "block": 83042365,
+ "spent_eth": "0.0106",
+ "spent_usd": 26.92,
+ "opening_buy": { "eth": "0.01", "tokens": "5799502.89" },
+ "urls": {
+ "pons": "https://ponsfamily.com/launchpad/0x…",
+ "explorer": "https://robinhoodchain.blockscout.com/tx/0x…",
+ "coin": "/markets/robinhood/coin/0x…"
+ }
+ }
+}
+```
+
+### Errors
+
+| Status | `error` | Meaning |
+| --- | --- | --- |
+| 400 | `validation_error`, `symbol_invalid`, `logo_invalid`, `social_invalid`, `field_too_long`, `tax_too_high` | Fix the request. Nothing was sent. |
+| 401 | `unauthorized` | No session and no API key. |
+| 403 | `forbidden` | Not your agent, or a cross-site request. |
+| 403 | `risk_ack_required` | Sign the real-funds agreements at [/legal/agreements](https://three.ws/legal/agreements) first. |
+| 409 | `launch_blocked` | The wallet cannot cover the launch, or Pons has paused launches. `detail.blockers` says which. |
+| 409 | `platform_signing_disabled` | The agent is in external or session signing mode, so three.ws will not sign for it. |
+| 422 | `per_tx_limit`, `daily_limit`, `unpriced_spend` | The agent's spend policy refused the launch. |
+| 422 | `simulation_failed` | Pons would revert this exact transaction. The message carries the reason. |
+| 423 | `wallet_frozen` | The agent wallet is frozen. |
+| 502 | `send_failed`, `launch_reverted` | The node refused the transaction, or it reverted on chain (only gas was spent). |
+| 503 | `pons_router_rotated` | Pons moved its launch router. three.ws refuses rather than send to the old one. |
+
+## Safety rails
+
+A launch spends real ETH, so it runs through every rail a custodial spend on three.ws runs through:
+
+- The caller must own the agent.
+- The agent must be in platform-signing mode.
+- The owner must have signed the real-funds agreements.
+- The launch fee and opening buy are priced in USD and checked against the agent's per-transaction
+ and daily ceilings for Robinhood Chain. These are metered separately from Solana and Base (see
+ [custody](custody.md)).
+- The spend is written to the custody ledger as pending before the transaction is sent, so two
+ launches at once cannot both slip under the daily ceiling.
+- The key decrypt is audited.
+
+The owner page always shows a confirmation with the wallet, destination, chain and amount before
+it launches. The `pons-launch` skill quotes first, and only launches when it is called again with
+`confirm: true`.
+
+## Where launched coins show up
+
+A launched coin is recorded in three.ws's launch directory with chain `robinhood` and venue `pons`:
+
+- It appears on [/launches](https://three.ws/launches) with a Robinhood Chain badge, a Pons trade
+ link and an explorer link.
+- It appears in the agent's launch history on its profile.
+- It opens on its Robinhood coin page at `/markets/robinhood/coin/<address>`.
+
+Every Pons launch, from three.ws or anywhere else, also appears in the Recent Launches feed on
+[/markets/robinhood](https://three.ws/markets/robinhood) and in
+`GET /api/v1/robinhood/launches`. That feed shows curve price, market cap and graduation progress.
+
+## For developers
+
+- Calldata and curve math live in `api/_lib/pons.js`.
+- The custodial launch lives in `api/_lib/evm-leg/pons-launch.js`.
+- The HTTP door is `api/agents/pons/[action].js`.
+- `tests/pons.test.js` rebuilds real mainnet Pons launches byte-for-byte from
+ `tests/fixtures/pons-v2-launches.json`. It also checks that the opening-buy quote matches the
+ tokens the curve actually paid out.
diff --git a/docs/robinhood-chain-markets.md b/docs/robinhood-chain-markets.md
index 35a782825..e663639e9 100644
--- a/docs/robinhood-chain-markets.md
+++ b/docs/robinhood-chain-markets.md
@@ -14,10 +14,13 @@ actions). This page — and the API behind it — is that missing layer.
- **Stocks** — the 24/7 tokenized-equity board. For every Stock Token: the Chainlink NAV price
(read live on-chain), the deepest Uniswap DEX price, the premium/discount between them, 24h DEX
volume, and liquidity. Sortable and searchable.
-- **Coins** — a memecoin screener across the chain's two launchpads (**NOXA**, an instant
- Uniswap v3 launcher, and **The Odyssey**, a pump.fun-style bonding curve), split into CoinGecko's
- "Robinhood Chain Meme" / "Robinhood Chain Stocks Ecosystem" / "Robinhood Ecosystem" categories,
- plus a live feed of recent launches read directly from on-chain logs.
+- **Coins** — a memecoin screener split into CoinGecko's "Robinhood Chain Meme" / "Robinhood
+ Chain Stocks Ecosystem" / "Robinhood Ecosystem" categories, plus a live feed of recent launches
+ read directly from on-chain logs: **Pons** (the chain's busiest launchpad, an ETH bonding curve
+ that graduates into a locked Uniswap V4 pool), **NOXA** (instant Uniswap v3) and **The
+ Odyssey** (bonding curve). Pons coins still on their curve show the curve's price, market cap
+ and graduation progress. To launch one from your own agent, see
+ [Launch a coin on Robinhood Chain (Pons)](pons-launch.md).
- **Chain** — block height, gas, transaction/address counts, and 90 days of chain TVL (DefiLlama).
Every coin and Stock Token links to its own detail page —
@@ -91,7 +94,7 @@ Free, keyless, real data only:
| `GET /api/v1/robinhood/stocks-detail?symbol=AAPL` | One Stock Token in depth: NAV history, all DEX pairs, holders, transfers, links |
| `GET /api/v1/robinhood/coins?category=meme` | Memecoin screener (`category`: `meme` \| `stocks-ecosystem` \| `ecosystem`; `sort`: `market_cap` \| `volume` \| `gainers` \| `losers`) |
| `GET /api/v1/robinhood/coins-detail?address=0x…` | One coin: pools, market stats, holders, transfers, links |
-| `GET /api/v1/robinhood/launches` | Recent launches from NOXA + The Odyssey, newest first |
+| `GET /api/v1/robinhood/launches` | Recent launches from Pons, NOXA and The Odyssey, newest first. Pons curve-stage coins carry `priceUsd`, `marketCapUsd` and `graduationPct` read from the curve |
| `GET /api/v1/robinhood/desk` | The desk's market side in one read: chain vitals, the premium ridge (bins, liquidity layers, percentiles), the widest tradeable dislocations, memecoin movers, recent launches |
| `GET /api/v1/robinhood/wallet?address=0x…` | The desk's wallet side in one read: native balance, priced ERC-20 positions, book totals, balance history (daily + per-transaction, merged), the activity tape and counterparty flow |
@@ -125,9 +128,10 @@ math; Chainlink feed prices are already multiplier-adjusted, so they're never re
twice inside the cache callback, and only a persistent outage is ever cached).
- **Chain TVL** — [DefiLlama](https://defillama.com/chain/robinhood-chain).
- **Memecoin screener** — CoinGecko categories `robinhood-chain-meme`, `robinhood-chain-stocks-ecosystem`, `robinhood-ecosystem`.
-- **Recent launches** — decoded on-chain logs from the NOXA and Odyssey launchpad factories
- (Blockscout's log API, filtered by event topic — the public RPC's `eth_getLogs` caps at 10k
- matched logs and can't reliably answer "what's newest").
+- **Recent launches** — Pons V2 from its factory's `TokenLaunched` logs over RPC (the last hour
+ of blocks, inside the public RPC's range cap), with curve reserves, graduation progress and
+ supply from one multicall; NOXA and Odyssey from Blockscout's log API filtered by event topic.
+ Each source fails on its own, so one indexer outage never empties the feed.
## Related surfaces
diff --git a/docs/start-here.md b/docs/start-here.md
index fb978399b..8278d5c0b 100644
--- a/docs/start-here.md
+++ b/docs/start-here.md
@@ -107,7 +107,7 @@ Want the model in your hands rather than on a screen? [Materialize](./materializ
- **Wondering where the platform's money goes?** → [The autonomous economy](./autonomous-economy.md): how the on-chain treasury funds itself, the funding-root → engines → sweepback loop, the locks that keep every dollar inside platform-owned wallets, and the two leak scanners that audit every wallet on-chain every few minutes (as of 2026-07-12: 44,122 transactions scanned, zero leaks; the live totals stay re-derivable from each scanner's own cursor)
- **Publishing news, or wondering what we show of yours?** → [Publisher rights in the news reader](./news-rights.md) — three.ws quotes a capped lead excerpt and links out, never the article body; covers the enforced limits, how a withdrawn story is removed (410 + deindex + purge), and how to ask us to take something down
- **Your agent needs market data?** → [Market Data API](./market-data-api.md) — the live feeds behind every /markets page (prices, TVL, yields, stablecoins, gas, derivatives, exploits) as 17 pay-per-call x402 endpoints from $0.001 USDC, plus the one-call `market-pulse` bundle; start at the free index [/api/x402/market](https://three.ws/api/x402/market)
-- **Trading Robinhood Chain?** → [Robinhood Chain on three.ws](./robinhood-chain-markets.md) — the 24/7 tokenized-equity board (live Chainlink NAV vs. DEX premium), a memecoin screener, and a real wallet-connect buy flow at [/markets/robinhood](https://three.ws/markets/robinhood), backed by 6 free + 1 paid `/api/v1/robinhood/*` endpoints
+- **Trading Robinhood Chain?** → [Robinhood Chain on three.ws](./robinhood-chain-markets.md) — the 24/7 tokenized-equity board (live Chainlink NAV vs. DEX premium), a memecoin screener, and a real wallet-connect buy flow at [/markets/robinhood](https://three.ws/markets/robinhood), backed by 6 free + 1 paid `/api/v1/robinhood/*` endpoints. Your agent can also [launch its own coin there on Pons](./pons-launch.md)
- **Listing our services across the x402 ecosystem?** → [x402 distribution](./x402-distribution.md) — the operating playbook for x402scan, the CDP Bazaar, agentic.market, 402index, and every other directory: how each one indexes providers, what ranks us (settled tx + distinct buyers, trailing 30 days), what's automated, and what needs a human
- **Wondering why a payment says "pending"?** → [Pending settlement](./x402-settlement-pending.md): a Solana settle has three outcomes, not two: broadcast-but-unconfirmed is `settlement_pending`, not a failed payment. Covers what a buyer should do with it (retry once, keep the good, watch the signature), how our facilitator guarantees one authorization never produces two transactions, and the reconcile pass that closes the books either way
- **Debugging an x402 integration?** → [x402 developer tools](./x402-dev-tools.md) — a free test bench: echo your payment envelope (signatures redacted), debug a failed 402 exchange into an ordered fix list, and verify a receipt's attestation and on-chain settlement, all against a live server without spending anything
diff --git a/packages/mcp-policy/src/table.js b/packages/mcp-policy/src/table.js
index d1577eebc..839034d32 100644
--- a/packages/mcp-policy/src/table.js
+++ b/packages/mcp-policy/src/table.js
@@ -142,6 +142,15 @@ export const POLICY = {
agent_card_balance: r('cards'),
agent_card_data: w('cards'),
agent_card_reveal: own('cards', 'confirm_reveal', 'agent_card_data'),
+ paired_markets: r('launch'),
+ paired_coins: r('launch'),
+ paired_coin: r('launch'),
+ paired_launch_quote: w('launch'),
+ paired_launch: f('launch', 'confirm_launch', 'paired_launch_quote', [
+ 'agent_id', 'markets', 'weights', 'name', 'symbol', 'description', 'image_url', 'socials', 'dev_buy',
+ ]),
+ paired_fees: r('launch'),
+ paired_claim_fees: w('launch'),
agent_card_cancel: own('cards', 'confirm_cancel', 'agent_card_get'),
agent_card_withdraw: own('cards', 'confirm_withdraw', 'agent_card_balance'),
agent_card_connect: r('cards'),
diff --git a/pages/launch-paired.html b/pages/launch-paired.html
new file mode 100644
index 000000000..800ee4c99
--- /dev/null
+++ b/pages/launch-paired.html
@@ -0,0 +1,71 @@
+<!doctype html>
+<html lang="en" class="cv-page">
+ <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>Launch a Paired Coin with Your Agent · three.ws</title>
+ <meta
+ name="description"
+ content="Have your 3D AI agent launch a coin on Robinhood Chain paired with up to five assets at once: tokenized stocks, WETH, stablecoins and chain coins. Live cost quote, atomic opening buy, and an API and MCP tools for bots."
+ />
+ <meta name="robots" content="index, follow, max-image-preview:large" />
+ <link rel="canonical" href="https://three.ws/launch/paired" />
+ <meta property="og:type" content="website" />
+ <meta property="og:site_name" content="three.ws" />
+ <meta property="og:url" content="https://three.ws/launch/paired" />
+ <meta property="og:title" content="Launch a paired coin with your agent" />
+ <meta property="og:description" content="One coin, up to five markets: stocks, WETH, stablecoins and chain coins. Your agent launches it from its own wallet." />
+ <meta property="og:image" content="https://three.ws/api/page-og?s=crypto&amp;t=Launch+a+paired+coin&amp;d=Your+agent+launches+a+coin+on+Robinhood+Chain+paired+with+up+to+five+assets+at+once%2C+from+its+own+wallet.&amp;p=%2Flaunch%2Fpaired" />
+ <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" />
+ <link rel="icon" href="/favicon.ico" sizes="any" />
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
+ <link rel="stylesheet" href="/fonts/fonts.css" />
+ <link rel="stylesheet" href="/nav.css" />
+ <link rel="stylesheet" href="/src/coin-pages.css" />
+ <link rel="stylesheet" href="/src/chain-page.css" />
+ <link rel="stylesheet" href="/src/paired/paired.css" />
+ <link rel="stylesheet" href="/footer.css" />
+ <script type="application/ld+json">{"@context":"https://schema.org","@type":"WebPage","name":"Launch a paired coin","description":"Your agent launches a coin on Robinhood Chain paired with up to five assets at once.","url":"https://three.ws/launch/paired","isPartOf":{"@type":"WebSite","name":"three.ws","url":"https://three.ws"}}</script>
+ </head>
+ <body>
+ <header><div id="nav-container"></div></header>
+ <script src="/nav.js"></script>
+
+ <main class="cv-container" id="main-content">
+ <nav class="cv-crumbs" aria-label="Breadcrumb">
+ <a href="/launch">Launch</a>
+ <span class="sep" aria-hidden="true">/</span>
+ <span class="here">Paired coin</span>
+ </nav>
+ <section class="ch-hero">
+ <h1 class="ch-title">Launch a paired coin with your agent</h1>
+ <p class="pc-hero-lede">
+ A paired coin trades against up to five assets at once on Robinhood Chain: tokenized stocks like NVDA,
+ WETH, stablecoins and chain coins, each in its own bonding curve with liquidity locked forever. Your agent
+ launches it from its own wallet for the flat ETH fee, and earns 70% of every swap fee in every pool.
+ See <a href="/markets/robinhood/paired">every paired coin</a>, or <a href="/launch/robinhood">launch on Pons</a> for an ETH-only curve.
+ </p>
+ </section>
+ <div id="pl-app" aria-live="polite"></div>
+ </main>
+
+ <script type="module" src="/src/paired/launch.js"></script>
+ <script src="/brand.js" defer></script>
+ <div id="footer-container"></div>
+ <script src="/footer.js"></script>
+ </body>
+</html>
diff --git a/pages/launch-robinhood.html b/pages/launch-robinhood.html
new file mode 100644
index 000000000..f7d6191aa
--- /dev/null
+++ b/pages/launch-robinhood.html
@@ -0,0 +1,65 @@
+<!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>Launch Your Agent's Coin on Robinhood Chain · three.ws</title>
+ <meta
+ name="description"
+ content="Launch a coin on Robinhood Chain through Pons, signed by your 3D AI agent's own wallet. Live cost quote, an atomic opening buy, and an API your bots can call."
+ />
+ <meta name="robots" content="index, follow, max-image-preview:large" />
+ <link rel="canonical" href="https://three.ws/launch/robinhood" />
+
+ <meta property="og:type" content="website" />
+ <meta property="og:site_name" content="three.ws" />
+ <meta property="og:title" content="Launch your agent's coin on Robinhood Chain" />
+ <meta property="og:description" content="Your agent launches on Pons from its own wallet, with a live quote and an atomic opening buy." />
+ <meta property="og:url" content="https://three.ws/launch/robinhood" />
+ <meta property="og:image" content="https://three.ws/api/page-og?s=crypto&amp;t=Launch+on+Robinhood+Chain&amp;d=Launch+a+coin+on+Robinhood+Chain+through+Pons%2C+signed+by+your+3D+AI+agent%27s+own+wallet%3A+a+live+cost+quote%2C+an+atomic+opening+buy%2C+and+an+API+your+bots+can+call.&amp;p=%2Flaunch%2Frobinhood" />
+ <meta property="og:image:width" content="1200" />
+ <meta property="og:image:height" content="630" />
+ <meta property="og:image:alt" content="Launch on Robinhood Chain on three.ws" />
+ <meta name="twitter:card" content="summary_large_image" />
+ <meta name="twitter:site" content="@trythreews" />
+ <meta name="twitter:title" content="Launch your agent's coin on Robinhood Chain" />
+ <meta name="twitter:description" content="Your agent launches on Pons from its own wallet, with a live quote and an atomic opening buy." />
+ <meta name="twitter:image" content="https://three.ws/api/page-og?s=crypto&amp;t=Launch+on+Robinhood+Chain&amp;d=Launch+a+coin+on+Robinhood+Chain+through+Pons%2C+signed+by+your+3D+AI+agent%27s+own+wallet%3A+a+live+cost+quote%2C+an+atomic+opening+buy%2C+and+an+API+your+bots+can+call.&amp;p=%2Flaunch%2Frobinhood" />
+
+ <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="/manifest.webmanifest" />
+ <link rel="stylesheet" href="/style.css" />
+ <link rel="stylesheet" href="/nav.css" />
+ <link rel="stylesheet" href="/fonts/fonts.css" />
+ <link rel="stylesheet" href="/mobile.css" />
+
+ <script type="application/ld+json">{"@context":"https://schema.org","@type":"WebPage","name":"Launch on Robinhood Chain","description":"Launch a coin on Robinhood Chain through Pons, signed by your 3D AI agent's own wallet.","url":"https://three.ws/launch/robinhood","isPartOf":{"@type":"WebSite","name":"three.ws","url":"https://three.ws"}}</script>
+
+ <meta property="og:locale" content="en_US">
+</head>
+ <body>
+ <header><div id="nav-container"></div></header>
+ <script src="/nav.js"></script>
+
+ <main class="lr" id="main-content">
+ <div class="lr-head">
+ <p class="lr-eyebrow"><span class="lr-dot" aria-hidden="true"></span>Robinhood Chain · Pons</p>
+ <h1>Launch your agent's coin on Robinhood Chain</h1>
+ <p class="lr-sub">
+ Your agent deploys the coin on <a href="https://ponsfamily.com" target="_blank" rel="noopener noreferrer">Pons</a>
+ from its own wallet. It trades on an ETH bonding curve from the first block, then graduates into a locked
+ Uniswap V4 pool at 4.2 ETH raised. Prefer Solana? <a href="/launch">Launch on pump.fun</a>.
+ </p>
+ </div>
+ <div id="lr-app" aria-live="polite"></div>
+ </main>
+
+ <div id="footer-container"></div>
+ <script src="/footer.js"></script>
+ <script type="module" src="/src/launch-robinhood/page.js"></script>
+ <script src="/brand.js" defer></script>
+ </body>
+</html>
diff --git a/pages/launch.html b/pages/launch.html
index f715a1a30..7200c1ed5 100644
--- a/pages/launch.html
+++ b/pages/launch.html
@@ -53,6 +53,7 @@
<p class="lx-eyebrow" data-i18n-html="launch.eyebrow"><span class="lx-dot" aria-hidden="true"></span>pump.fun launchpad for 3D agents</p>
<h1 data-i18n="launch.title">Launch a coin for your agent</h1>
<p class="lx-sub" data-i18n="launch.sub">Pick one of your 3D AI agents, name the coin and launch it on pump.fun. Creator rewards stay claimable right here.</p>
+ <p class="lx-sub lx-alt-venue"><a href="/launch/robinhood">Launch on Robinhood Chain with Pons instead →</a></p>
</div>
<div class="lx-tabs" id="lx-tabs" role="tablist" aria-label="Launchpad" data-i18n-attr="aria-label:launch.tabs_aria">
<button type="button" class="lx-tab" role="tab" id="tab-create" data-tab="create" aria-controls="panel-create" aria-selected="true" data-i18n="launch.tab_create">Create</button>
diff --git a/pages/paired-coin.html b/pages/paired-coin.html
new file mode 100644
index 000000000..81634259a
--- /dev/null
+++ b/pages/paired-coin.html
@@ -0,0 +1,77 @@
+<!doctype html>
+<html lang="en" class="cv-page">
+ <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>Paired Coin on Robinhood Chain · three.ws</title>
+ <meta name="description" content="A coin on Robinhood Chain that trades against several assets at once: live pools, charts per pool, every trade, and a buy and sell ticket." />
+ <meta name="robots" content="index, follow, max-image-preview:large" />
+ <meta property="og:type" content="website" />
+ <meta property="og:site_name" content="three.ws" />
+ <meta property="og:title" content="Paired coin on Robinhood Chain" />
+ <meta property="og:description" content="One coin, several markets: live pools, charts and trades." />
+ <meta name="twitter:card" content="summary" />
+ <meta name="twitter:site" content="@trythreews" />
+ <link rel="icon" href="/favicon.ico" sizes="any" />
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
+ <link rel="stylesheet" href="/fonts/fonts.css" />
+ <link rel="stylesheet" href="/nav.css" />
+ <link rel="stylesheet" href="/src/coin-pages.css" />
+ <link rel="stylesheet" href="/src/chain-page.css" />
+ <link rel="stylesheet" href="/src/paired/paired.css" />
+ <link rel="stylesheet" href="/footer.css" />
+ </head>
+ <body>
+ <header><div id="nav-container"></div></header>
+ <script src="/nav.js"></script>
+
+ <main class="cv-container" id="main-content" aria-busy="true">
+ <nav class="cv-crumbs" aria-label="Breadcrumb">
+ <a href="/markets">Markets</a>
+ <span class="sep" aria-hidden="true">/</span>
+ <a href="/markets/robinhood">Robinhood Chain</a>
+ <span class="sep" aria-hidden="true">/</span>
+ <a href="/markets/robinhood/paired">Paired coins</a>
+ <span class="sep" aria-hidden="true">/</span>
+ <span class="here" id="pc-crumb">Coin</span>
+ </nav>
+
+ <section id="pc-head"></section>
+ <div class="mkt-cols">
+ <div>
+ <div class="pc-toolbar"><h2 class="cv-h2">Pools</h2></div>
+ <section id="pc-pools" aria-label="Pools"></section>
+
+ <div id="pc-chart-wrap">
+ <div class="pc-toolbar">
+ <h2 class="cv-h2" id="pc-chart-title">Chart</h2>
+ <div class="pc-tabs" id="pc-intervals" role="tablist" aria-label="Candle interval"></div>
+ </div>
+ <div class="pc-chart"><div id="pc-chart" style="position:absolute;inset:0"></div><div class="pc-chart-empty" id="pc-chart-empty" hidden></div></div>
+ </div>
+
+ <div class="pc-toolbar"><h2 class="cv-h2">Trades</h2></div>
+ <section id="pc-trades" aria-live="polite" aria-label="Trades"></section>
+ </div>
+ <aside class="mkt-rail" id="pc-rail" aria-label="Trade"></aside>
+ </div>
+ <p class="cv-src-note">Read live from the paired launchpad on Robinhood Chain (4663). Coins are speculative: a pairing is launch liquidity, not backing, and a coin is not a claim on the asset it pairs with.</p>
+ </main>
+
+ <script type="module" src="/src/paired/coin.js"></script>
+ <script src="/brand.js" defer></script>
+ <div id="footer-container"></div>
+ <script src="/footer.js"></script>
+ </body>
+</html>
diff --git a/pages/paired-coins.html b/pages/paired-coins.html
new file mode 100644
index 000000000..38dd9ba5f
--- /dev/null
+++ b/pages/paired-coins.html
@@ -0,0 +1,92 @@
+<!doctype html>
+<html lang="en" class="cv-page">
+ <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>Paired Coins on Robinhood Chain · three.ws</title>
+ <meta
+ name="description"
+ content="Coins on Robinhood Chain that trade against up to five assets at once: tokenized stocks, WETH, stablecoins and chain coins. Fixed supply, liquidity nobody can pull, and AI agents that launch them from their own wallets."
+ />
+ <meta name="robots" content="index, follow, max-image-preview:large" />
+ <link rel="canonical" href="https://three.ws/markets/robinhood/paired" />
+ <meta property="og:type" content="website" />
+ <meta property="og:site_name" content="three.ws" />
+ <meta property="og:url" content="https://three.ws/markets/robinhood/paired" />
+ <meta property="og:title" content="Paired coins on Robinhood Chain" />
+ <meta property="og:description" content="One coin, up to five markets: stocks, WETH, stablecoins and chain coins. Launched by AI agents from their own wallets." />
+ <meta property="og:image" content="https://three.ws/api/page-og?s=crypto&amp;t=Paired+coins&amp;d=One+coin%2C+up+to+five+markets%3A+stocks%2C+WETH%2C+stablecoins+and+chain+coins+on+Robinhood+Chain.&amp;p=%2Fmarkets%2Frobinhood%2Fpaired" />
+ <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" />
+ <link rel="icon" href="/favicon.ico" sizes="any" />
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
+ <link rel="stylesheet" href="/fonts/fonts.css" />
+ <link rel="stylesheet" href="/nav.css" />
+ <link rel="stylesheet" href="/src/coin-pages.css" />
+ <link rel="stylesheet" href="/src/chain-page.css" />
+ <link rel="stylesheet" href="/src/paired/paired.css" />
+ <link rel="stylesheet" href="/footer.css" />
+ <script type="application/ld+json">{"@context":"https://schema.org","@type":"CollectionPage","name":"Paired coins on Robinhood Chain","description":"Coins that trade against up to five assets at once on Robinhood Chain, launched by AI agents.","url":"https://three.ws/markets/robinhood/paired","isPartOf":{"@type":"WebSite","name":"three.ws","url":"https://three.ws"}}</script>
+ </head>
+ <body>
+ <header><div id="nav-container"></div></header>
+ <script src="/nav.js"></script>
+
+ <main class="cv-container" id="main-content">
+ <nav class="cv-crumbs" aria-label="Breadcrumb">
+ <a href="/markets">Markets</a>
+ <span class="sep" aria-hidden="true">/</span>
+ <a href="/markets/robinhood">Robinhood Chain</a>
+ <span class="sep" aria-hidden="true">/</span>
+ <span class="here">Paired coins</span>
+ </nav>
+
+ <section class="ch-hero">
+ <h1 class="ch-title">Paired coins</h1>
+ <p class="pc-hero-lede">
+ One coin, up to five markets. Each paired coin on Robinhood Chain trades against tokenized stocks, WETH,
+ stablecoins or chain coins at the same time, each in its own bonding curve with liquidity nobody can pull.
+ The supply is fixed at one billion, and the creator earns 70% of every swap fee in every asset it trades in.
+ Your three.ws agent can launch one from its own wallet for the flat ETH fee.
+ </p>
+ <div class="pc-hero-actions">
+ <a class="pc-btn pc-btn-primary" href="/launch/paired">Launch with your agent</a>
+ <a class="pc-btn" href="/docs/paired-coins">How it works · API · MCP</a>
+ </div>
+ </section>
+
+ <section id="pc-stats" aria-label="Launchpad stats"></section>
+
+ <div class="pc-toolbar"><h2 class="cv-h2">Coins</h2></div>
+ <section id="pc-coins" aria-live="polite" aria-label="Paired coins"></section>
+
+ <div class="pc-toolbar">
+ <h2 class="cv-h2">What a coin can pair with</h2>
+ <div style="display:flex;flex-wrap:wrap;gap:0.5rem;align-items:center">
+ <div class="pc-tabs" id="pc-market-tabs" role="tablist" aria-label="Asset class"></div>
+ <input class="pc-input" id="pc-market-search" type="search" placeholder="Search ticker or address" aria-label="Search markets" style="width:220px" />
+ </div>
+ </div>
+ <section id="pc-markets" aria-live="polite" aria-label="Markets"></section>
+ <p class="cv-src-note">Live from the paired launchpad's on-chain quote registry, priced from Robinhood Chain DEX pools and Chainlink. Coins are speculative: a pairing is launch liquidity, not backing, and a coin is not a claim on the asset it pairs with.</p>
+ </main>
+
+ <script type="module" src="/src/paired/hub.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-recent.json b/public/changelog-recent.json
index 96d56ac8f..e01a7900e 100644
--- a/public/changelog-recent.json
+++ b/public/changelog-recent.json
@@ -1,11 +1,11 @@
{
- "generated_at": "2026-10-08T04:39:10.614Z",
+ "generated_at": "2026-10-08T04:53:02.081Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json",
"site": {
"name": "three.ws",
"url": "https://three.ws"
},
- "total": 3818,
+ "total": 3831,
"complete": false,
"full_feed": "/changelog.json",
"entries": [
@@ -19,6 +19,46 @@
"launch"
]
},
+ {
+ "date": "2026-10-08",
+ "type": "launch",
+ "title": "DEXTools integration guide",
+ "summary": "How three.ws works with DEXTools: DEXTools charts on every coin page, any pair rendered as a live 3D scene, the embeddable Social Boost card, and how to paste a DEXTools link to get an embed snippet.",
+ "link": "/docs/dextools",
+ "tags": [
+ "launch"
+ ]
+ },
+ {
+ "date": "2026-10-08",
+ "type": "launch",
+ "title": "Docs · Chart Companion",
+ "summary": "How to watch a DEXTools chart with a 3D agent that reacts to every real swap: the URL parameters, streaming it as a transparent OBS overlay, embedding it with one iframe, bringing your own agent, and exactly how whale, streak and new-high reactions are decided.",
+ "link": "/docs/chart-companion",
+ "tags": [
+ "launch"
+ ]
+ },
+ {
+ "date": "2026-10-08",
+ "type": "launch",
+ "title": "Docs · DEXTools integration",
+ "summary": "How three.ws and DEXTools connect: the /dextools hub, the embed builder that turns any DEXTools pair link into a 3D scene or Social Boost card snippet, the framable Boost on DEXTools card, and the counted redirect and public totals behind every visit three.ws sends to a DEXTools pair page.",
+ "link": "/docs/dextools",
+ "tags": [
+ "launch"
+ ]
+ },
+ {
+ "date": "2026-10-08",
+ "type": "launch",
+ "title": "Launch on Robinhood Chain",
+ "summary": "Launch a coin on Robinhood Chain through Pons, signed by your 3D AI agent's own wallet: a live cost quote, an atomic opening buy, and an API your bots can call.",
+ "link": "/launch/robinhood",
+ "tags": [
+ "launch"
+ ]
+ },
{
"date": "2026-10-08",
"type": "launch",
@@ -29,6 +69,16 @@
"launch"
]
},
+ {
+ "date": "2026-10-08",
+ "type": "update",
+ "title": "3D Studio results now hand every agent plain links to the model",
+ "summary": "Every model the free 3D Studio MCP server hands back, whether freshly generated, picked from the asset catalog or saved as a persona, now comes with four plain links, both in the result data and in its first lines of text: a viewer page, the GLB file, a rendered PNG picture and a paste-ready embed snippet. Agents that cannot show a 3D widget, like Grok Bot and other browser agents, can now open, download, share and embed the model directly. A model that is still rendering comes with a viewer link that waits for the job and opens the model the moment it is ready.",
+ "link": "/docs/mcp-studio",
+ "tags": [
+ "feature"
+ ]
+ },
{
"date": "2026-10-08",
"type": "update",
@@ -39,6 +89,16 @@
"fix"
]
},
+ {
+ "date": "2026-10-08",
+ "type": "update",
+ "title": "Chart Companion: a 3D agent that watches the chart with you",
+ "summary": "Paste any DEXTools pair at /chart-companion and a 3D agent sits beside the live chart, reacting to every real swap as it lands: a superhero jump for a whale buy, a facepalm for a dump, a dance for a buy streak, applause for a new daily high. Each reaction comes with a line you can trace to its transaction, and it can read them aloud. Bring your own three.ws agent, embed it on your coin's site with one iframe, or add it to OBS as a transparent overlay for your stream.",
+ "link": "/chart-companion",
+ "tags": [
+ "feature"
+ ]
+ },
{
"date": "2026-10-08",
"type": "update",
@@ -49,6 +109,26 @@
"improvement"
]
},
+ {
+ "date": "2026-10-08",
+ "type": "update",
+ "title": "Coin charts say plainly when a coin has no market yet",
+ "summary": "A coin with no trading pool anywhere could show a price-history error on its chart when a market data source was busy. The chart now recognises the coin has no market and shows the no-price-history state, and it asks that source one question fewer per chart load.",
+ "link": "/terminal",
+ "tags": [
+ "fix"
+ ]
+ },
+ {
+ "date": "2026-10-08",
+ "type": "update",
+ "title": "Coin Clash stays playable when community data is offline",
+ "summary": "When the community roster behind Coin Clash is unavailable, the arena no longer goes dark. Each round is now fought between the coins trending on Solana right now, locked in for the whole round so battles never reshuffle mid-fight, and each army shows its market cap where the member count would be. Enlisting, rallying and war records work exactly as before.",
+ "link": "/clash",
+ "tags": [
+ "improvement"
+ ]
+ },
{
"date": "2026-10-08",
"type": "update",
@@ -80,6 +160,46 @@
"security"
]
},
+ {
+ "date": "2026-10-08",
+ "type": "update",
+ "title": "Fewer failed 3D generations when the concept image comes back blank",
+ "summary": "Text to 3D first paints a concept image, then sculpts it. When the painting service quietly returned a blank black frame instead of a picture, the studio used it anyway, and every 3D engine then failed because there was nothing in the image to sculpt. The studio now spots a blank or withheld frame and paints the concept with the next image service instead, so those prompts finish as real models.",
+ "link": "/forge",
+ "tags": [
+ "fix"
+ ]
+ },
+ {
+ "date": "2026-10-08",
+ "type": "update",
+ "title": "Grok model menus now offer xAI's current models",
+ "summary": "Every Grok picker on three.ws (the /brain menu, agent chat, the avatar page and the embed editor) now lists xAI's current line-up: Grok 4.7, xAI's flagship, Grok 4.3 with its 1M-token context at the lowest Grok price, Grok 4.20 Fast with no thinking pass, and Grok Build for coding. Agents and embeds that saved a Grok model xAI has since retired, such as Grok 4.1 Fast, keep working and answer on the model xAI recommends in its place. People who bring their own xAI key now get Grok 4.7 by default instead of an older flagship.",
+ "link": "/brain",
+ "tags": [
+ "improvement"
+ ]
+ },
+ {
+ "date": "2026-10-08",
+ "type": "update",
+ "title": "Picking the free Hugging Face engine no longer leaves you stuck when its Spaces are down",
+ "summary": "When every free Hugging Face Space is out of GPU quota, the Forge now pauses that engine for a few minutes, greys it out in the engine picker with the reason, and moves a generation you started on it to a working engine, showing you the switch, instead of retrying the same dead Spaces with a countdown.",
+ "link": "/forge",
+ "tags": [
+ "fix"
+ ]
+ },
+ {
+ "date": "2026-10-08",
+ "type": "update",
+ "title": "Shared 3D models now explain themselves to X and Grok",
+ "summary": "Every 3D model page now tells whoever reads the link exactly what it is. A model shared from three.ws unfurls on X as a large card showing a render of the model itself instead of a stock image, with its own title and description. Model, avatar and agent pages also describe themselves in a machine-readable form that search engines and AI assistants like Grok can read: the 3D file, a picture of it, who made it, when, and the terms it is shared under. So when someone asks Grok what a three.ws link is, it can answer from the model rather than guess.",
+ "link": "/creations",
+ "tags": [
+ "improvement"
+ ]
+ },
{
"date": "2026-10-08",
"type": "update",
@@ -90,6 +210,16 @@
"fix"
]
},
+ {
+ "date": "2026-10-08",
+ "type": "update",
+ "title": "Your agent can launch its own coin on Robinhood Chain",
+ "summary": "Agents can now launch a coin on Robinhood Chain through Pons, the chain's busiest launchpad, signed by the agent's own wallet. Name the coin, see the exact cost live (launch fee, opening buy, gas, and how many tokens the opening buy gets), confirm, and it is trading on a bonding curve in about a second. The opening buy lands in the same transaction, so nobody trades ahead of your agent. Bots can do the same through two API calls or the new pons-launch skill, and launched coins show up on /launches and the agent's profile. The Recent Launches feed on /markets/robinhood now lists every Pons launch too, with curve price, market cap and graduation progress.",
+ "link": "/launch/robinhood",
+ "tags": [
+ "feature"
+ ]
+ },
{
"date": "2026-10-01",
"type": "update",
@@ -1434,145 +1564,6 @@
"tags": [
"launch"
]
- },
- {
- "date": "2026-09-15",
- "type": "launch",
- "title": "Contributors",
- "summary": "A living thank-you to the developers, issue reporters, and community members improving the open-source three.ws platform.",
- "link": "/contributors",
- "tags": [
- "launch"
- ]
- },
- {
- "date": "2026-09-15",
- "type": "launch",
- "title": "Docs · Solana Memo Media MCP",
- "summary": "Decode validated image data embedded in Solana Memo transactions and return safe inline MCP images with provenance.",
- "link": "/docs/mcp-solana-memo-media",
- "tags": [
- "launch"
- ]
- },
- {
- "date": "2026-09-15",
- "type": "launch",
- "title": "Onchain Viewer",
- "summary": "Open an image or text written into a public Solana Memo. Paste a transaction signature or Solscan link to preview the signed data without copying a data URI.",
- "link": "/onchain",
- "tags": [
- "launch"
- ]
- },
- {
- "date": "2026-09-15",
- "type": "update",
- "title": "Show and tell now captures projects people can actually try",
- "summary": "The GitHub community showcase now asks builders for the outcome, live demo, source, three.ws surface used, one useful lesson, and visual proof. That structure makes each submission easier to understand, reproduce, feature, and turn into an honest adopter story. Two compact developer front doors are also fully built and exportable: a Codespaces starter that opens on a live animated agent, and a GLB pull-request quality gate powered by the same model-diff engine as three.ws.",
- "link": null,
- "tags": [
- "improvement",
- "docs"
- ]
- },
- {
- "date": "2026-09-15",
- "type": "update",
- "title": "three.ws is ready for Solana's new 4 KiB transactions",
- "summary": "Solana V1 transactions are live, with more than three times the wire room and a different place for execution limits. Every three.ws transaction reader now opts into V1, so a payment, registration, receipt, or agent action cannot disappear just because it uses the new format. The new Atomic inspector reads a confirmed signature or raw base64 handoff and shows the exact byte footprint, compute and account-data limits, priority fee, actual compute use, and the warning a fee sponsor needs before co-signing. It never signs or broadcasts anything.",
- "link": "/atomic",
- "tags": [
- "feature",
- "improvement",
- "security"
- ]
- },
- {
- "date": "2026-09-13",
- "type": "launch",
- "title": "Docs · x402 for VS Code",
- "summary": "Find, inspect, and pay x402 APIs from VS Code with $THREE or USDC on Solana, including wallet setup, token selection, safety controls, and the $THREE contract address.",
- "link": "/docs/x402-vscode",
- "tags": [
- "launch"
- ]
- },
- {
- "date": "2026-09-12",
- "type": "update",
- "title": "Corrected what the 3D Studio connector declares about checking a pending job",
- "summary": "The tool that collects a finished 3D generation was labelled a read-only status probe. It is not: the first check that finds a job done copies the model into permanent storage, records it, and scores it, and it can route failed work to another provider. Any AI client reading those labels to decide whether a call is safe to repeat was being told the wrong thing. The labels and the documentation now match the behaviour. Nothing about how the tool works changed.",
- "link": "/docs/mcp-studio",
- "tags": [
- "fix",
- "sdk"
- ]
- },
- {
- "date": "2026-09-12",
- "type": "update",
- "title": "The 3D viewer inside ChatGPT now loads everything through three.ws",
- "summary": "The interactive viewer that shows your 3D model inside ChatGPT now fetches every model and every preview image through three.ws itself, so the only places it is allowed to reach are three.ws and the 3D viewer library it runs on. Nothing about what you see changes: the model still renders, spins and downloads the same way. There is also a dedicated connection address for the ChatGPT plugin directory, https://three.ws/api/mcp-chatgpt, carrying the eight 3D creation tools. The existing connector at https://three.ws/api/mcp-studio keeps every tool, including the living agent body.",
- "link": "/docs/mcp-studio",
- "tags": [
- "improvement",
- "security"
- ]
- },
- {
- "date": "2026-09-11",
- "type": "update",
- "title": "Selfie to avatar is unstuck: a scan that used to wait forever now finishes in seconds",
- "summary": "Uploading a photo on the selfie page could sit on the same message indefinitely and never start the scan, with no error and nothing to retry. One copy of the face-tracking runtime held at our CDN was telling browsers to expect 11 MB and then sending a third of that, so the page waited for bytes that were never coming. That copy is gone, and three changes make the failure impossible to repeat silently: the face-tracking runtime now loads from three.ws first instead of a public CDN, any wait on it gives up after fifteen seconds and builds your avatar from the photo as it is, and a photo is never rejected for having no face in it just because the detector could not load. A new check also walks every large file on the site the way a browser asks for it and fails loudly when the bytes do not add up. Measured after the fix: a selfie became a rigged, animation-ready avatar in about fifteen seconds, and still finished in under a minute with the face-tracking runtime completely unreachable.",
- "link": "/create/selfie",
- "tags": [
- "fix",
- "infra"
- ]
- },
- {
- "date": "2026-09-11",
- "type": "update",
- "title": "The 3D creation skills are now a public download",
- "summary": "The skills that teach an AI agent when and how to generate, rig, and embed 3D models on three.ws used to live only inside this repo. Four of them are now published at three.ws/skills/3d-studio: read one straight from the web, or download the whole set as a zip and drop it into whatever agent you are building. Nothing there needs an account, an API key, or a payment. A skill is only included if every tool it tells an agent to call is actually served, so a downloaded skill cannot send an agent after something that does not exist.",
- "link": "/docs/agent-skills",
- "tags": [
- "feature",
- "sdk"
- ]
- },
- {
- "date": "2026-09-11",
- "type": "update",
- "title": "Your selfie avatar now survives a storage outage instead of vanishing at the last step",
- "summary": "For part of today, a selfie could finish building and then be thrown away. The 3D model was generated correctly, but the step that files it into your library could not reach our object storage, so the page said the avatar finished and could not be saved, and trying again hit the same wall. The avatar was never actually lost: a complete copy sits with the service that built it. The last step now recognises a storage outage for what it is and keeps your avatar, serving it from that copy and flagging it to be filed away properly once storage is back, so a problem on our side costs a housekeeping step instead of the model you waited for. Anything that is not a storage outage still fails loudly rather than quietly papering over a real bug. The image API for agents also now answers with a clear temporarily unavailable instead of a generic failure, so it no longer reads as a bad prompt when nothing was wrong with the prompt.",
- "link": "/create/selfie",
- "tags": [
- "fix",
- "infra"
- ]
- },
- {
- "date": "2026-09-10",
- "type": "launch",
- "title": "Sonar Control",
- "summary": "Control a 3D agent with your hands and no camera. three.ws plays an inaudible carrier tone through your speakers and reads the Doppler shift of your hand off the microphone, so a sweep, a push or a lift moves the avatar on screen.",
- "link": "/sonar",
- "tags": [
- "launch"
- ]
- },
- {
- "date": "2026-09-10",
- "type": "update",
- "title": "3D assets now load on any website, not just ours",
- "summary": "Files served straight from our asset storage carried a permission list that only named a handful of sites, so a browser on any other site quietly threw the file away after downloading it. Anyone embedding a three.ws avatar or model from its direct storage link saw an empty viewer with a cross-origin error, and the workarounds were our /cdn and /api/glb routes. Storage now allows reads from everywhere while keeping uploads locked to our own pages, so direct links work in any embed. This also fixed a first-party case: the www version of the site served every page correctly but had all of its 3D blocked.",
- "link": null,
- "tags": [
- "fix",
- "infra"
- ]
}
]
}
diff --git a/public/changelog.json b/public/changelog.json
index f875fe8f6..c4a519bec 100644
--- a/public/changelog.json
+++ b/public/changelog.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-10-08T04:39:10.573Z",
+ "generated_at": "2026-10-08T04:53:02.009Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json",
"site": {
"name": "three.ws",
@@ -16,6 +16,46 @@
"launch"
]
},
+ {
+ "date": "2026-10-08",
+ "type": "launch",
+ "title": "DEXTools integration guide",
+ "summary": "How three.ws works with DEXTools: DEXTools charts on every coin page, any pair rendered as a live 3D scene, the embeddable Social Boost card, and how to paste a DEXTools link to get an embed snippet.",
+ "link": "/docs/dextools",
+ "tags": [
+ "launch"
+ ]
+ },
+ {
+ "date": "2026-10-08",
+ "type": "launch",
+ "title": "Docs · Chart Companion",
+ "summary": "How to watch a DEXTools chart with a 3D agent that reacts to every real swap: the URL parameters, streaming it as a transparent OBS overlay, embedding it with one iframe, bringing your own agent, and exactly how whale, streak and new-high reactions are decided.",
+ "link": "/docs/chart-companion",
+ "tags": [
+ "launch"
+ ]
+ },
+ {
+ "date": "2026-10-08",
+ "type": "launch",
+ "title": "Docs · DEXTools integration",
+ "summary": "How three.ws and DEXTools connect: the /dextools hub, the embed builder that turns any DEXTools pair link into a 3D scene or Social Boost card snippet, the framable Boost on DEXTools card, and the counted redirect and public totals behind every visit three.ws sends to a DEXTools pair page.",
+ "link": "/docs/dextools",
+ "tags": [
+ "launch"
+ ]
+ },
+ {
+ "date": "2026-10-08",
+ "type": "launch",
+ "title": "Launch on Robinhood Chain",
+ "summary": "Launch a coin on Robinhood Chain through Pons, signed by your 3D AI agent's own wallet: a live cost quote, an atomic opening buy, and an API your bots can call.",
+ "link": "/launch/robinhood",
+ "tags": [
+ "launch"
+ ]
+ },
{
"date": "2026-10-08",
"type": "launch",
@@ -26,6 +66,16 @@
"launch"
]
},
+ {
+ "date": "2026-10-08",
+ "type": "update",
+ "title": "3D Studio results now hand every agent plain links to the model",
+ "summary": "Every model the free 3D Studio MCP server hands back, whether freshly generated, picked from the asset catalog or saved as a persona, now comes with four plain links, both in the result data and in its first lines of text: a viewer page, the GLB file, a rendered PNG picture and a paste-ready embed snippet. Agents that cannot show a 3D widget, like Grok Bot and other browser agents, can now open, download, share and embed the model directly. A model that is still rendering comes with a viewer link that waits for the job and opens the model the moment it is ready.",
+ "link": "/docs/mcp-studio",
+ "tags": [
+ "feature"
+ ]
+ },
{
"date": "2026-10-08",
"type": "update",
@@ -36,6 +86,16 @@
"fix"
]
},
+ {
+ "date": "2026-10-08",
+ "type": "update",
+ "title": "Chart Companion: a 3D agent that watches the chart with you",
+ "summary": "Paste any DEXTools pair at /chart-companion and a 3D agent sits beside the live chart, reacting to every real swap as it lands: a superhero jump for a whale buy, a facepalm for a dump, a dance for a buy streak, applause for a new daily high. Each reaction comes with a line you can trace to its transaction, and it can read them aloud. Bring your own three.ws agent, embed it on your coin's site with one iframe, or add it to OBS as a transparent overlay for your stream.",
+ "link": "/chart-companion",
+ "tags": [
+ "feature"
+ ]
+ },
{
"date": "2026-10-08",
"type": "update",
@@ -46,6 +106,26 @@
"improvement"
]
},
+ {
+ "date": "2026-10-08",
+ "type": "update",
+ "title": "Coin charts say plainly when a coin has no market yet",
+ "summary": "A coin with no trading pool anywhere could show a price-history error on its chart when a market data source was busy. The chart now recognises the coin has no market and shows the no-price-history state, and it asks that source one question fewer per chart load.",
+ "link": "/terminal",
+ "tags": [
+ "fix"
+ ]
+ },
+ {
+ "date": "2026-10-08",
+ "type": "update",
+ "title": "Coin Clash stays playable when community data is offline",
+ "summary": "When the community roster behind Coin Clash is unavailable, the arena no longer goes dark. Each round is now fought between the coins trending on Solana right now, locked in for the whole round so battles never reshuffle mid-fight, and each army shows its market cap where the member count would be. Enlisting, rallying and war records work exactly as before.",
+ "link": "/clash",
+ "tags": [
+ "improvement"
+ ]
+ },
{
"date": "2026-10-08",
"type": "update",
@@ -77,6 +157,46 @@
"security"
]
},
+ {
+ "date": "2026-10-08",
+ "type": "update",
+ "title": "Fewer failed 3D generations when the concept image comes back blank",
+ "summary": "Text to 3D first paints a concept image, then sculpts it. When the painting service quietly returned a blank black frame instead of a picture, the studio used it anyway, and every 3D engine then failed because there was nothing in the image to sculpt. The studio now spots a blank or withheld frame and paints the concept with the next image service instead, so those prompts finish as real models.",
+ "link": "/forge",
+ "tags": [
+ "fix"
+ ]
+ },
+ {
+ "date": "2026-10-08",
+ "type": "update",
+ "title": "Grok model menus now offer xAI's current models",
+ "summary": "Every Grok picker on three.ws (the /brain menu, agent chat, the avatar page and the embed editor) now lists xAI's current line-up: Grok 4.7, xAI's flagship, Grok 4.3 with its 1M-token context at the lowest Grok price, Grok 4.20 Fast with no thinking pass, and Grok Build for coding. Agents and embeds that saved a Grok model xAI has since retired, such as Grok 4.1 Fast, keep working and answer on the model xAI recommends in its place. People who bring their own xAI key now get Grok 4.7 by default instead of an older flagship.",
+ "link": "/brain",
+ "tags": [
+ "improvement"
+ ]
+ },
+ {
+ "date": "2026-10-08",
+ "type": "update",
+ "title": "Picking the free Hugging Face engine no longer leaves you stuck when its Spaces are down",
+ "summary": "When every free Hugging Face Space is out of GPU quota, the Forge now pauses that engine for a few minutes, greys it out in the engine picker with the reason, and moves a generation you started on it to a working engine, showing you the switch, instead of retrying the same dead Spaces with a countdown.",
+ "link": "/forge",
+ "tags": [
+ "fix"
+ ]
+ },
+ {
+ "date": "2026-10-08",
+ "type": "update",
+ "title": "Shared 3D models now explain themselves to X and Grok",
+ "summary": "Every 3D model page now tells whoever reads the link exactly what it is. A model shared from three.ws unfurls on X as a large card showing a render of the model itself instead of a stock image, with its own title and description. Model, avatar and agent pages also describe themselves in a machine-readable form that search engines and AI assistants like Grok can read: the 3D file, a picture of it, who made it, when, and the terms it is shared under. So when someone asks Grok what a three.ws link is, it can answer from the model rather than guess.",
+ "link": "/creations",
+ "tags": [
+ "improvement"
+ ]
+ },
{
"date": "2026-10-08",
"type": "update",
@@ -87,6 +207,16 @@
"fix"
]
},
+ {
+ "date": "2026-10-08",
+ "type": "update",
+ "title": "Your agent can launch its own coin on Robinhood Chain",
+ "summary": "Agents can now launch a coin on Robinhood Chain through Pons, the chain's busiest launchpad, signed by the agent's own wallet. Name the coin, see the exact cost live (launch fee, opening buy, gas, and how many tokens the opening buy gets), confirm, and it is trading on a bonding curve in about a second. The opening buy lands in the same transaction, so nobody trades ahead of your agent. Bots can do the same through two API calls or the new pons-launch skill, and launched coins show up on /launches and the agent's profile. The Recent Launches feed on /markets/robinhood now lists every Pons launch too, with curve price, market cap and graduation progress.",
+ "link": "/launch/robinhood",
+ "tags": [
+ "feature"
+ ]
+ },
{
"date": "2026-10-01",
"type": "update",
diff --git a/public/changelog.xml b/public/changelog.xml
index e13280fab..933e80c0a 100644
--- a/public/changelog.xml
+++ b/public/changelog.xml
@@ -14,6 +14,38 @@
<category>launch</category>
<description>Paste any DEXTools pair and a 3D agent watches the live chart with you, reacting to every real swap: cheering whale buys, flinching at dumps, calling streaks and new highs, each reaction linked to its transaction. Turn on its voice, bring your own three.ws agent, embed it with one iframe, or add it to OBS as a transparent stream overlay.</description>
</item>
+ <item>
+ <title>DEXTools integration guide</title>
+ <link>https://three.ws/docs/dextools</link>
+ <guid isPermaLink="false">2026-10-08:DEXTools integration guide</guid>
+ <pubDate>Thu, 08 Oct 2026 12:00:00 GMT</pubDate>
+ <category>launch</category>
+ <description>How three.ws works with DEXTools: DEXTools charts on every coin page, any pair rendered as a live 3D scene, the embeddable Social Boost card, and how to paste a DEXTools link to get an embed snippet.</description>
+ </item>
+ <item>
+ <title>Docs · Chart Companion</title>
+ <link>https://three.ws/docs/chart-companion</link>
+ <guid isPermaLink="false">2026-10-08:Docs · Chart Companion</guid>
+ <pubDate>Thu, 08 Oct 2026 12:00:00 GMT</pubDate>
+ <category>launch</category>
+ <description>How to watch a DEXTools chart with a 3D agent that reacts to every real swap: the URL parameters, streaming it as a transparent OBS overlay, embedding it with one iframe, bringing your own agent, and exactly how whale, streak and new-high reactions are decided.</description>
+ </item>
+ <item>
+ <title>Docs · DEXTools integration</title>
+ <link>https://three.ws/docs/dextools</link>
+ <guid isPermaLink="false">2026-10-08:Docs · DEXTools integration</guid>
+ <pubDate>Thu, 08 Oct 2026 12:00:00 GMT</pubDate>
+ <category>launch</category>
+ <description>How three.ws and DEXTools connect: the /dextools hub, the embed builder that turns any DEXTools pair link into a 3D scene or Social Boost card snippet, the framable Boost on DEXTools card, and the counted redirect and public totals behind every visit three.ws sends to a DEXTools pair page.</description>
+ </item>
+ <item>
+ <title>Launch on Robinhood Chain</title>
+ <link>https://three.ws/launch/robinhood</link>
+ <guid isPermaLink="false">2026-10-08:Launch on Robinhood Chain</guid>
+ <pubDate>Thu, 08 Oct 2026 12:00:00 GMT</pubDate>
+ <category>launch</category>
+ <description>Launch a coin on Robinhood Chain through Pons, signed by your 3D AI agent's own wallet: a live cost quote, an atomic opening buy, and an API your bots can call.</description>
+ </item>
<item>
<title>three.ws x DEXTools</title>
<link>https://three.ws/dextools</link>
@@ -22,6 +54,14 @@
<category>launch</category>
<description>Every way three.ws works with DEXTools: DEXTools charts in every coin chart, any DEXTools pair rendered as a live 3D scene, a Social Boost card any project can embed, and a public count of the visits three.ws sends to DEXTools pair pages. Paste a DEXTools link to get the embed snippet.</description>
</item>
+ <item>
+ <title>3D Studio results now hand every agent plain links to the model</title>
+ <link>https://three.ws/docs/mcp-studio</link>
+ <guid isPermaLink="false">2026-10-08:3D Studio results now hand every agent plain links to the model</guid>
+ <pubDate>Thu, 08 Oct 2026 12:00:00 GMT</pubDate>
+ <category>feature</category>
+ <description>Every model the free 3D Studio MCP server hands back, whether freshly generated, picked from the asset catalog or saved as a persona, now comes with four plain links, both in the result data and in its first lines of text: a viewer page, the GLB file, a rendered PNG picture and a paste-ready embed snippet. Agents that cannot show a 3D widget, like Grok Bot and other browser agents, can now open, download, share and embed the model directly. A model that is still rendering comes with a viewer link that waits for the job and opens the model the moment it is ready.</description>
+ </item>
<item>
<title>Agent earnings are updating again</title>
<link>https://three.ws/analytics</link>
@@ -30,6 +70,14 @@
<category>fix</category>
<description>pump.fun moved the service that reports creator fees, so the Earned figures on agent pages, agent profiles, coin pages and /analytics had stopped refreshing since the end of September. Earnings now read from pump.fun's current fees service, with a second source behind it if that one stumbles, and every agent coin is back on its 30-minute refresh.</description>
</item>
+ <item>
+ <title>Chart Companion: a 3D agent that watches the chart with you</title>
+ <link>https://three.ws/chart-companion</link>
+ <guid isPermaLink="false">2026-10-08:Chart Companion: a 3D agent that watches the chart with you</guid>
+ <pubDate>Thu, 08 Oct 2026 12:00:00 GMT</pubDate>
+ <category>feature</category>
+ <description>Paste any DEXTools pair at /chart-companion and a 3D agent sits beside the live chart, reacting to every real swap as it lands: a superhero jump for a whale buy, a facepalm for a dump, a dance for a buy streak, applause for a new daily high. Each reaction comes with a line you can trace to its transaction, and it can read them aloud. Bring your own three.ws agent, embed it on your coin's site with one iframe, or add it to OBS as a transparent overlay for your stream.</description>
+ </item>
<item>
<title>Chat and agents stay up through more AI outages</title>
<link>https://three.ws/chat</link>
@@ -38,6 +86,22 @@
<category>improvement</category>
<description>Every AI answer on three.ws, from chat to agent brains, the tutor and the fact-checker, now has five more free models to fall back on when the usual ones are busy. NVIDIA's largest open model, Nemotron 3 Ultra, now answers right behind Nemotron 3 Super, with the compact Nemotron 3.5 Lightning further down the line. A second, independent route to the same Nemotron models works with no account at all, and a Gemma 4 model is back in the mix as well. The free NVIDIA and gateway models are now checked against their providers every six hours too, so the team hears the moment one is switched off instead of finding out from a failed answer.</description>
</item>
+ <item>
+ <title>Coin charts say plainly when a coin has no market yet</title>
+ <link>https://three.ws/terminal</link>
+ <guid isPermaLink="false">2026-10-08:Coin charts say plainly when a coin has no market yet</guid>
+ <pubDate>Thu, 08 Oct 2026 12:00:00 GMT</pubDate>
+ <category>fix</category>
+ <description>A coin with no trading pool anywhere could show a price-history error on its chart when a market data source was busy. The chart now recognises the coin has no market and shows the no-price-history state, and it asks that source one question fewer per chart load.</description>
+ </item>
+ <item>
+ <title>Coin Clash stays playable when community data is offline</title>
+ <link>https://three.ws/clash</link>
+ <guid isPermaLink="false">2026-10-08:Coin Clash stays playable when community data is offline</guid>
+ <pubDate>Thu, 08 Oct 2026 12:00:00 GMT</pubDate>
+ <category>improvement</category>
+ <description>When the community roster behind Coin Clash is unavailable, the arena no longer goes dark. Each round is now fought between the coins trending on Solana right now, locked in for the whole round so battles never reshuffle mid-fight, and each army shows its market cap where the member count would be. Enlisting, rallying and war records work exactly as before.</description>
+ </item>
<item>
<title>Community sentiment readings are back on coin pages and the Oracle</title>
<link>https://three.ws/oracle</link>
@@ -62,6 +126,38 @@
<category>fix</category>
<description>The event-attested tier in a Solana agent's reputation, which ranks above community feedback in the Passport grade, was granted on a label written inside the memo, so any signer could claim it. It now counts only attestations the platform's own attester minted and recorded, so a self-written label earns ordinary feedback weight and nothing more.</description>
</item>
+ <item>
+ <title>Fewer failed 3D generations when the concept image comes back blank</title>
+ <link>https://three.ws/forge</link>
+ <guid isPermaLink="false">2026-10-08:Fewer failed 3D generations when the concept image comes back blank</guid>
+ <pubDate>Thu, 08 Oct 2026 12:00:00 GMT</pubDate>
+ <category>fix</category>
+ <description>Text to 3D first paints a concept image, then sculpts it. When the painting service quietly returned a blank black frame instead of a picture, the studio used it anyway, and every 3D engine then failed because there was nothing in the image to sculpt. The studio now spots a blank or withheld frame and paints the concept with the next image service instead, so those prompts finish as real models.</description>
+ </item>
+ <item>
+ <title>Grok model menus now offer xAI's current models</title>
+ <link>https://three.ws/brain</link>
+ <guid isPermaLink="false">2026-10-08:Grok model menus now offer xAI's current models</guid>
+ <pubDate>Thu, 08 Oct 2026 12:00:00 GMT</pubDate>
+ <category>improvement</category>
+ <description>Every Grok picker on three.ws (the /brain menu, agent chat, the avatar page and the embed editor) now lists xAI's current line-up: Grok 4.7, xAI's flagship, Grok 4.3 with its 1M-token context at the lowest Grok price, Grok 4.20 Fast with no thinking pass, and Grok Build for coding. Agents and embeds that saved a Grok model xAI has since retired, such as Grok 4.1 Fast, keep working and answer on the model xAI recommends in its place. People who bring their own xAI key now get Grok 4.7 by default instead of an older flagship.</description>
+ </item>
+ <item>
+ <title>Picking the free Hugging Face engine no longer leaves you stuck when its Spaces are down</title>
+ <link>https://three.ws/forge</link>
+ <guid isPermaLink="false">2026-10-08:Picking the free Hugging Face engine no longer leaves you stuck when its Spaces are down</guid>
+ <pubDate>Thu, 08 Oct 2026 12:00:00 GMT</pubDate>
+ <category>fix</category>
+ <description>When every free Hugging Face Space is out of GPU quota, the Forge now pauses that engine for a few minutes, greys it out in the engine picker with the reason, and moves a generation you started on it to a working engine, showing you the switch, instead of retrying the same dead Spaces with a countdown.</description>
+ </item>
+ <item>
+ <title>Shared 3D models now explain themselves to X and Grok</title>
+ <link>https://three.ws/creations</link>
+ <guid isPermaLink="false">2026-10-08:Shared 3D models now explain themselves to X and Grok</guid>
+ <pubDate>Thu, 08 Oct 2026 12:00:00 GMT</pubDate>
+ <category>improvement</category>
+ <description>Every 3D model page now tells whoever reads the link exactly what it is. A model shared from three.ws unfurls on X as a large card showing a render of the model itself instead of a stock image, with its own title and description. Model, avatar and agent pages also describe themselves in a machine-readable form that search engines and AI assistants like Grok can read: the 3D file, a picture of it, who made it, when, and the terms it is shared under. So when someone asks Grok what a three.ws link is, it can answer from the model rather than guess.</description>
+ </item>
<item>
<title>The coin visualizer and communities keep loading when pump.fun throttles us</title>
<link>https://three.ws/communities</link>
@@ -70,6 +166,14 @@
<category>fix</category>
<description>The full coin board behind the pump.fun visualizer, the communities page and the home page's live coin now retries a rate-limited read once and falls back to the last board any server saw in the past 30 minutes, marked as slightly stale, instead of showing an error.</description>
</item>
+ <item>
+ <title>Your agent can launch its own coin on Robinhood Chain</title>
+ <link>https://three.ws/launch/robinhood</link>
+ <guid isPermaLink="false">2026-10-08:Your agent can launch its own coin on Robinhood Chain</guid>
+ <pubDate>Thu, 08 Oct 2026 12:00:00 GMT</pubDate>
+ <category>feature</category>
+ <description>Agents can now launch a coin on Robinhood Chain through Pons, the chain's busiest launchpad, signed by the agent's own wallet. Name the coin, see the exact cost live (launch fee, opening buy, gas, and how many tokens the opening buy gets), confirm, and it is trading on a bonding curve in about a second. The opening buy lands in the same transaction, so nobody trades ahead of your agent. Bots can do the same through two API calls or the new pons-launch skill, and launched coins show up on /launches and the agent's profile. The Recent Launches feed on /markets/robinhood now lists every Pons launch too, with curve price, market cap and graduation progress.</description>
+ </item>
<item>
<title>Avatar pictures show a natural standing pose instead of a T-pose</title>
<link>https://three.ws/spotlight</link>
diff --git a/public/features.json b/public/features.json
index bc7f1108f..9a7a6e2f0 100644
--- a/public/features.json
+++ b/public/features.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-10-08T04:39:10.556Z",
+ "generated_at": "2026-10-08T04:53:01.983Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json",
"site": {
"name": "three.ws",
@@ -1083,6 +1083,16 @@
"tags": [],
"showcase": false
},
+ {
+ "path": "/docs/dextools",
+ "title": "DEXTools integration guide",
+ "description": "How three.ws works with DEXTools: DEXTools charts on every coin page, any pair rendered as a live 3D scene, the embeddable Social Boost card, and how to paste a DEXTools link to get an embed snippet.",
+ "added": "2026-10-08",
+ "auth": null,
+ "indexable": true,
+ "tags": [],
+ "showcase": false
+ },
{
"path": "/docs/portal",
"title": "How Portal builds a 3D world from a URL",
@@ -1907,6 +1917,16 @@
"tags": [],
"showcase": false
},
+ {
+ "path": "/launch/robinhood",
+ "title": "Launch on Robinhood Chain",
+ "description": "Launch a coin on Robinhood Chain through Pons, signed by your 3D AI agent's own wallet: a live cost quote, an atomic opening buy, and an API your bots can call.",
+ "added": "2026-10-08",
+ "auth": null,
+ "indexable": true,
+ "tags": [],
+ "showcase": false
+ },
{
"path": "/launch-studio",
"title": "Launch Studio: 50 ways to mint a coin",
@@ -3978,6 +3998,26 @@
"tags": [],
"showcase": false
},
+ {
+ "path": "/docs/dextools",
+ "title": "Docs · DEXTools integration",
+ "description": "How three.ws and DEXTools connect: the /dextools hub, the embed builder that turns any DEXTools pair link into a 3D scene or Social Boost card snippet, the framable Boost on DEXTools card, and the counted redirect and public totals behind every visit three.ws sends to a DEXTools pair page.",
+ "added": "2026-10-08",
+ "auth": null,
+ "indexable": true,
+ "tags": [],
+ "showcase": false
+ },
+ {
+ "path": "/docs/chart-companion",
+ "title": "Docs · Chart Companion",
+ "description": "How to watch a DEXTools chart with a 3D agent that reacts to every real swap: the URL parameters, streaming it as a transparent OBS overlay, embedding it with one iframe, bringing your own agent, and exactly how whale, streak and new-high reactions are decided.",
+ "added": "2026-10-08",
+ "auth": null,
+ "indexable": true,
+ "tags": [],
+ "showcase": false
+ },
{
"path": "/docs/coin3d-embed",
"title": "Docs · Token in 3D, as an embed",
diff --git a/public/llms-full.txt b/public/llms-full.txt
index 5c001e095..60dbb2591 100644
--- a/public/llms-full.txt
+++ b/public/llms-full.txt
@@ -624,6 +624,12 @@ URL: https://three.ws/docs/brownout
Every response says where its data came from and how fresh it is, and every fallback the API claims has been executed for real against a genuinely refusing provider, inside the request path a user hits.
+### DEXTools integration guide
+
+URL: https://three.ws/docs/dextools
+
+How three.ws works with DEXTools: DEXTools charts on every coin page, any pair rendered as a live 3D scene, the embeddable Social Boost card, and how to paste a DEXTools link to get an embed snippet.
+
### How Portal builds a 3D world from a URL
URL: https://three.ws/docs/portal
@@ -1125,6 +1131,12 @@ URL: https://three.ws/launch
The pump.fun launchpad for 3D AI agents: pick your agent, name the coin, launch it from your wallet or the agent's wallet, and claim creator rewards on three.ws.
+### Launch on Robinhood Chain
+
+URL: https://three.ws/launch/robinhood
+
+Launch a coin on Robinhood Chain through Pons, signed by your 3D AI agent's own wallet: a live cost quote, an atomic opening buy, and an API your bots can call.
+
### Launch Studio: 50 ways to mint a coin
URL: https://three.ws/launch-studio
@@ -2393,6 +2405,18 @@ URL: https://three.ws/docs/swarms
How a group of agents pools real SOL into one on-chain Solana treasury and trades it by weighted consensus: reputation-weighted voting, spend-guarded contribute and exit transfers, the shared kill switch, and why no balance is virtual.
+### Docs · DEXTools integration
+
+URL: https://three.ws/docs/dextools
+
+How three.ws and DEXTools connect: the /dextools hub, the embed builder that turns any DEXTools pair link into a 3D scene or Social Boost card snippet, the framable Boost on DEXTools card, and the counted redirect and public totals behind every visit three.ws sends to a DEXTools pair page.
+
+### Docs · Chart Companion
+
+URL: https://three.ws/docs/chart-companion
+
+How to watch a DEXTools chart with a 3D agent that reacts to every real swap: the URL parameters, streaming it as a transparent OBS overlay, embedding it with one iframe, bringing your own agent, and exactly how whale, streak and new-high reactions are decided.
+
### Docs · Token in 3D, as an embed
URL: https://three.ws/docs/coin3d-embed
diff --git a/public/llms.txt b/public/llms.txt
index 4777820db..2def2b7cd 100644
--- a/public/llms.txt
+++ b/public/llms.txt
@@ -96,6 +96,6 @@ Machine-readable entry points. Fetch these instead of scraping HTML.
## Optional
-- [llms-full.txt](https://three.ws/llms-full.txt): Every public page (925), grouped by section, with full descriptions.
+- [llms-full.txt](https://three.ws/llms-full.txt): Every public page (929), grouped by section, with full descriptions.
- [Sitemap](https://three.ws/sitemap): The same index for people, with search.
- [sitemap.xml](https://three.ws/sitemap.xml): XML sitemap for crawlers, including every agent and avatar page.
diff --git a/public/locales/localized-pages.json b/public/locales/localized-pages.json
index ccdd1c39b..6c3c58e10 100644
--- a/public/locales/localized-pages.json
+++ b/public/locales/localized-pages.json
@@ -1,6 +1,6 @@
{
"generated": true,
- "count": 318,
+ "count": 431,
"paths": [
"/",
"/3d",
@@ -200,6 +200,119 @@
"/monitor",
"/motion-swap",
"/my-agents",
+ "/news",
+ "/news/2045242891350814835",
+ "/news/2049397875935989970",
+ "/news/2049406826719137937",
+ "/news/2049412062837928202",
+ "/news/2049447738434339171",
+ "/news/2049458671139336613",
+ "/news/2049476546285740512",
+ "/news/2049557523330638269",
+ "/news/2049573582247022869",
+ "/news/2049576603324411933",
+ "/news/2049576641127682430",
+ "/news/2049577291957899336",
+ "/news/2049762836881301865",
+ "/news/2049765915575914834",
+ "/news/2049997615421649363",
+ "/news/2050016695897706885",
+ "/news/2050049239301165535",
+ "/news/2050221269732425928",
+ "/news/2050226678321102975",
+ "/news/2050229144676675999",
+ "/news/2050284562069266616",
+ "/news/2050585585191186781",
+ "/news/2050627547394916768",
+ "/news/2050753406109880576",
+ "/news/2050758788186353723",
+ "/news/2050800140295049308",
+ "/news/2050886334261391686",
+ "/news/2051140736201175323",
+ "/news/2051261108506558901",
+ "/news/2051616708482498843",
+ "/news/2051689230997618690",
+ "/news/2051690803203105230",
+ "/news/2051774915876098063",
+ "/news/2051858035862335505",
+ "/news/2051858503523066283",
+ "/news/2051893054584553680",
+ "/news/2052037977556287723",
+ "/news/2052167399399735476",
+ "/news/2052181307002929363",
+ "/news/2052189491801284690",
+ "/news/2052402481024667887",
+ "/news/2052402580266098813",
+ "/news/2052418108837781511",
+ "/news/2052418482269254040",
+ "/news/2052426446073983267",
+ "/news/2052588973466484922",
+ "/news/2052603250524967045",
+ "/news/2052685648377913671",
+ "/news/2052790746256920583",
+ "/news/2052791935585407403",
+ "/news/2053025259645981078",
+ "/news/2053698115203743922",
+ "/news/2053698387263008827",
+ "/news/2053730856339144932",
+ "/news/2053801703355629587",
+ "/news/2053804700609458214",
+ "/news/2053832201176027583",
+ "/news/2054404663802483072",
+ "/news/2054675701132132736",
+ "/news/2055140064070717618",
+ "/news/2055307440921702738",
+ "/news/2055309846556401735",
+ "/news/2055310365588922872",
+ "/news/2055517252964024561",
+ "/news/2055967730495586477",
+ "/news/2055985494606106821",
+ "/news/2056556899403997450",
+ "/news/2057721370310775223",
+ "/news/2057780453709648200",
+ "/news/2057782522994684413",
+ "/news/2057786164862730704",
+ "/news/2058076885805085111",
+ "/news/2058287578227577039",
+ "/news/2059456289789657537",
+ "/news/2059456294189498830",
+ "/news/2059456295825223723",
+ "/news/2059457822941978723",
+ "/news/2059675892981633179",
+ "/news/2059712761622675776",
+ "/news/2059821472156446844",
+ "/news/2059894004771418220",
+ "/news/2060178868305326413",
+ "/news/2060186881636422038",
+ "/news/2061418285896269952",
+ "/news/2061488909264040194",
+ "/news/2061523804405616642",
+ "/news/2061713039624405062",
+ "/news/aws-agentic-economy-three-ws",
+ "/news/aws-builder-center-3d-agents-onchain-payments",
+ "/news/aws-builder-center-blog",
+ "/news/aws-marketplace-live-may29",
+ "/news/bybit-alpha-listing",
+ "/news/cmc-mcp-registry-article",
+ "/news/cmc-memecoin-3d-world",
+ "/news/huggingface-bodies-and-wallets",
+ "/news/huggingface-building-3d-ai-agents",
+ "/news/ibm-collaboration-showcase",
+ "/news/ibm-showcase-may31",
+ "/news/joined-aws-partner-network",
+ "/news/listed-on-bnb-chain-dappbay",
+ "/news/live-on-alibaba-cloud-marketplace",
+ "/news/live-on-aws-marketplace",
+ "/news/mcp-servers-x402-bazaar-coinbase",
+ "/news/monetize-mcp-server-x402-paid-tools",
+ "/news/moonshot-verified",
+ "/news/partnered-with-hackernoon",
+ "/news/quicknode-startup-program",
+ "/news/text-to-3d-is-live",
+ "/news/three-ws-dextools-social-boost-buyback",
+ "/news/three-ws-featured-on-alibaba-cloud-marketplace-blog",
+ "/news/three-ws-first-month-3d-agent-layer",
+ "/news/threews-play-coin-communities",
"/nim-forge",
"/notifications",
"/nvidia",
diff --git a/public/mcp-catalog.json b/public/mcp-catalog.json
index 870a49f41..8f5a9d89a 100644
--- a/public/mcp-catalog.json
+++ b/public/mcp-catalog.json
@@ -2,15 +2,15 @@
"$comment": "Generated by scripts/build-mcp-catalog.mjs from the tool definitions and price maps in this repo. Do not edit by hand: npm run build:mcp-catalog regenerates it and npm run audit:mcp-catalog fails the build when it is stale.",
"docs": "https://three.ws/docs/mcp-safety",
"counts": {
- "tools": 360,
+ "tools": 368,
"servers": 42,
- "free": 332,
+ "free": 340,
"paid": 28,
- "read": 242,
- "write": 88,
- "irreversible": 30,
- "withSchema": 358,
- "withArguments": 332
+ "read": 247,
+ "write": 90,
+ "irreversible": 31,
+ "withSchema": 368,
+ "withArguments": 342
},
"servers": [
{
@@ -275,7 +275,7 @@
"endpoint": "/api/mcp",
"transport": "remote",
"auth": "oauth-or-x402",
- "tools": 79
+ "tools": 87
},
{
"id": "threews-3d-studio",
@@ -1736,9 +1736,78 @@
"usd": 0,
"free": true
},
- "inputSchema": null,
- "inputSchemaIsDynamic": true,
- "inputSchemaNote": "not a statically-declared object",
+ "inputSchema": {
+ "type": "object",
+ "properties": {
+ "handle": {
+ "type": "string",
+ "minLength": 1,
+ "maxLength": 64,
+ "description": "A handle/slug for your citizen (e.g. \"my-bot\"). Simplest identity; required unless you pass erc8004AgentId or mplCoreAsset."
+ },
+ "erc8004AgentId": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "number"
+ }
+ ],
+ "description": "Your ERC-8004 IdentityRegistry agentId (numeric or hex) to bind into the canonical AgenC id."
+ },
+ "mplCoreAsset": {
+ "type": "string",
+ "minLength": 32,
+ "maxLength": 44,
+ "description": "A Metaplex Core asset address (base58) backing your agent identity."
+ },
+ "professions": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": [
+ "fetcher",
+ "sculptor",
+ "scribe",
+ "cartographer",
+ "crier",
+ "appraiser",
+ "verifier",
+ "namekeeper"
+ ]
+ },
+ "minItems": 1,
+ "default": [
+ "fetcher"
+ ],
+ "description": "The professions you can work — OR-ed into your AgenC capability bitmap (default [\"fetcher\"])."
+ },
+ "endpoint": {
+ "type": "string",
+ "format": "uri",
+ "description": "Public endpoint where your agent can be reached (URL). Defaults to a three.ws agent URL for your id."
+ },
+ "stakeLamports": {
+ "type": "integer",
+ "minimum": 1000000,
+ "description": "On-chain stake in lamports the protocol holds against your reputation (min ${…})."
+ },
+ "cluster": {
+ "type": "string",
+ "enum": [
+ "mainnet",
+ "devnet"
+ ],
+ "description": "Solana cluster to register on (default from AGORA_CLUSTER, else devnet)."
+ },
+ "secret": {
+ "type": "string",
+ "description": "Base58 64-byte secret key of the signing wallet. Falls back to AGORA_SECRET_KEY. Never logged or transmitted."
+ }
+ },
+ "additionalProperties": false
+ },
"source": "packages/agora-mcp/src/tools/register.js"
},
{
@@ -8416,9 +8485,137 @@
"usd": 0,
"free": true
},
- "inputSchema": null,
- "inputSchemaIsDynamic": true,
- "inputSchemaNote": "not a statically-declared object",
+ "inputSchema": {
+ "type": "object",
+ "properties": {
+ "asset": {
+ "type": "string",
+ "minLength": 32,
+ "maxLength": 44,
+ "description": "The Core asset address to register."
+ },
+ "collection": {
+ "type": "string",
+ "minLength": 32,
+ "maxLength": 44,
+ "description": "The collection address, required for collection-bound assets."
+ },
+ "name": {
+ "type": "string",
+ "minLength": 1,
+ "maxLength": 60,
+ "description": "Agent name for the registration document."
+ },
+ "description": {
+ "type": "string",
+ "maxLength": 2000,
+ "description": "Agent description."
+ },
+ "image": {
+ "type": "string",
+ "format": "uri",
+ "description": "Thumbnail image URL."
+ },
+ "model_url": {
+ "type": "string",
+ "format": "uri",
+ "description": "3D model URL (GLB), written as model.uri."
+ },
+ "services": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "minLength": 1,
+ "maxLength": 64
+ },
+ "endpoint": {
+ "type": "string",
+ "format": "uri"
+ }
+ },
+ "required": [
+ "name",
+ "endpoint"
+ ],
+ "additionalProperties": false
+ },
+ "maxItems": 16,
+ "description": "Services the agent offers."
+ },
+ "x402_support": {
+ "type": "boolean",
+ "description": "Advertise x402 payment support. Default false."
+ },
+ "active": {
+ "type": "boolean",
+ "description": "Registration active flag. Default true."
+ },
+ "supported_trust": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "minLength": 1,
+ "maxLength": 64
+ },
+ "maxItems": 8,
+ "description": "Default ['reputation']."
+ },
+ "registrations": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "agent_id": {
+ "type": "string",
+ "minLength": 1,
+ "maxLength": 128
+ },
+ "agent_registry": {
+ "type": "string",
+ "minLength": 1,
+ "maxLength": 256
+ }
+ },
+ "required": [
+ "agent_id",
+ "agent_registry"
+ ],
+ "additionalProperties": false
+ },
+ "maxItems": 8,
+ "description": "External registry entries. Defaults to the chain registry entry."
+ },
+ "threews_agent_id": {
+ "type": "string",
+ "format": "uuid",
+ "description": "three.ws agent UUID for the Genesis-exact three.ws registration entry."
+ },
+ "registration_uri": {
+ "type": "string",
+ "description": "Full override for the registration URI (https or data:)."
+ },
+ "network": {
+ "type": "string",
+ "enum": [
+ "mainnet",
+ "devnet"
+ ],
+ "description": "Cluster. Defaults to the configured network."
+ },
+ "secret": {
+ "type": "string",
+ "description": "Per-call signing key. Overrides SOLANA_SECRET_KEY."
+ }
+ },
+ "required": [
+ "asset",
+ "name"
+ ],
+ "additionalProperties": false
+ },
"source": "packages/metaplex-agent-mcp/src/tools/register-agent-identity.js"
},
{
@@ -12797,7 +12994,7 @@
{
"name": "mint_3d_asset",
"title": "Mint a 3D asset as a Solana NFT",
- "description": "Mint a generated or owned GLB as a Metaplex Core NFT on Solana whose media is a LIVE, interactive 3D viewer (the rigged glTF model under animation_url, not a static image). Bakes provenance (creator, prompt, generation model, parent lineage, timestamp) into the metadata AND appends a signed, independently-verifiable record to the agent_actions provenance ledger; enforces capped creator royalties on secondary sales. Supply an owned avatar_id or a glb_url, and a recipient (owner_wallet, or your OAuth-linked Solana wallet). Devnet by default; pass network=\"mainnet\" for a real mainnet mint. Idempotent (a repeat call for the same asset returns the same mint). Royalty is capped at ${…}%. Naming parent_mint (a remix/derivative on mainnet) routes the parent creator's royalty slice out of THIS mint's fee as a real on-chain USDC transfer. Returns the mint address, explorer + viewer links, royalty terms, the provenance ledger reference, and (for a remix) the royalty settlement. Priced per call via x402 (USDC); an OAuth bearer token bypasses payment.",
+ "description": "Mint a generated or owned GLB as a Metaplex Core NFT on Solana whose media is a LIVE, interactive 3D viewer (the rigged glTF model under animation_url, not a static image). Bakes provenance (creator, prompt, generation model, parent lineage, timestamp) into the metadata AND appends a signed, independently-verifiable record to the agent_actions provenance ledger; enforces capped creator royalties on secondary sales. Supply an owned avatar_id or a glb_url, and a recipient (owner_wallet, or your OAuth-linked Solana wallet). Devnet by default; pass network=\"mainnet\" for a real mainnet mint. Idempotent (a repeat call for the same asset returns the same mint). Royalty is capped at ${…}%. Naming parent_mint (a remix/derivative on mainnet) routes the parent creator's royalty slice out of THIS mint's fee as a real on-chain USDC transfer. Returns the mint address, explorer + viewer links, royalty terms, the provenance ledger reference, and (for a remix) the royalty settlement. Priced per call via x402 (USDC); an OAuth bearer token bypasses payment within a small per-account mint budget (5 mainnet mints a day).",
"server": {
"id": "three.ws",
"title": "three.ws",
@@ -13191,9 +13388,47 @@
"source": "api/_mcp/tools/oracle.js"
},
{
- "name": "print_analyze",
- "title": "Check whether a 3D model can be printed",
- "description": "Measure a 3D model for real-world manufacturing: whether it is a closed solid, how many separate bodies it contains, how many holes it has, its thinnest wall, its exact volume, and a 0-100 printability score with named reasons. Also returns, per material, the smallest height the model can be printed at and still hold its detail. Free, keyless, and read-only: nothing is ordered. Pass a three.ws creation_id or any public glb_url.",
+ "name": "paired_claim_fees",
+ "title": "Claim paired-coin creator fees",
+ "description": "Collect every quote asset an agent has earned in paired-coin swap fees, in one transaction into the agent's own wallet. Costs a little ETH gas; moves nothing out of the agent's control.",
+ "server": {
+ "id": "three.ws",
+ "title": "three.ws",
+ "endpoint": "/api/mcp",
+ "transport": "remote",
+ "auth": "oauth-or-x402"
+ },
+ "safety": "write",
+ "annotations": {
+ "readOnlyHint": false,
+ "destructiveHint": false,
+ "idempotentHint": false,
+ "openWorldHint": true
+ },
+ "price": {
+ "usd": 0,
+ "free": true
+ },
+ "inputSchema": {
+ "type": "object",
+ "properties": {
+ "agent_id": {
+ "type": "string",
+ "format": "uuid",
+ "description": "Agent UUID (from list_my_agents)."
+ }
+ },
+ "required": [
+ "agent_id"
+ ],
+ "additionalProperties": false
+ },
+ "source": "api/_mcp/tools/paired.js"
+ },
+ {
+ "name": "paired_coin",
+ "title": "Read a paired coin",
+ "description": "One paired coin in full: its pools priced in dollars, recent trades, per-pool candles, the verified descriptor and the launching agent.",
"server": {
"id": "three.ws",
"title": "three.ws",
@@ -13215,24 +13450,434 @@
"inputSchema": {
"type": "object",
"properties": {
- "creation_id": {
+ "address": {
"type": "string",
- "description": "A three.ws forge creation id."
+ "pattern": "^0x[0-9a-fA-F]{40}$"
},
- "glb_url": {
+ "interval": {
"type": "string",
- "format": "uri",
- "description": "Public https URL of a .glb file, instead of a creation id."
+ "enum": [
+ "1m",
+ "5m",
+ "15m",
+ "1h",
+ "4h",
+ "1d"
+ ],
+ "default": "1h"
}
},
+ "required": [
+ "address"
+ ],
"additionalProperties": false
},
- "source": "api/_mcp/tools/print.js"
+ "source": "api/_mcp/tools/paired.js"
},
{
- "name": "print_quote",
- "title": "Price a real 3D print and get a signed quote",
- "description": "Price a physical print of a 3D model: an itemized quote in USDC (build setup, material with the exact volume it was computed from, finish, quantity break, shipping) plus a signed quote token valid for 24 hours. Materials, size limits and lead times come from GET /api/print/catalog. This tool does NOT place an order and moves no money: settle the token at POST /api/x402/print-order when you have a shipping address. Free and keyless.",
+ "name": "paired_coins",
+ "title": "List paired coins",
+ "description": "Paired coins on Robinhood Chain, newest first, with every pool (quote asset, weight, price, dollar market cap, % sold), the verified descriptor and the three.ws agent that launched it. Pass agent_id for one agent's coins.",
+ "server": {
+ "id": "three.ws",
+ "title": "three.ws",
+ "endpoint": "/api/mcp",
+ "transport": "remote",
+ "auth": "oauth-or-x402"
+ },
+ "safety": "read",
+ "annotations": {
+ "readOnlyHint": true,
+ "destructiveHint": false,
+ "idempotentHint": true,
+ "openWorldHint": true
+ },
+ "price": {
+ "usd": 0,
+ "free": true
+ },
+ "inputSchema": {
+ "type": "object",
+ "properties": {
+ "agent_id": {
+ "type": "string",
+ "format": "uuid",
+ "description": "Agent UUID (from list_my_agents)."
+ },
+ "limit": {
+ "type": "integer",
+ "minimum": 1,
+ "maximum": 48,
+ "default": 12
+ },
+ "offset": {
+ "type": "integer",
+ "minimum": 0,
+ "default": 0
+ }
+ },
+ "additionalProperties": false
+ },
+ "source": "api/_mcp/tools/paired.js"
+ },
+ {
+ "name": "paired_fees",
+ "title": "Read paired-coin creator fees",
+ "description": "Swap fees an agent has earned as the creator of paired coins and can claim now, per quote asset.",
+ "server": {
+ "id": "three.ws",
+ "title": "three.ws",
+ "endpoint": "/api/mcp",
+ "transport": "remote",
+ "auth": "oauth-or-x402"
+ },
+ "safety": "read",
+ "annotations": {
+ "readOnlyHint": true,
+ "destructiveHint": false,
+ "idempotentHint": true,
+ "openWorldHint": true
+ },
+ "price": {
+ "usd": 0,
+ "free": true
+ },
+ "inputSchema": {
+ "type": "object",
+ "properties": {
+ "agent_id": {
+ "type": "string",
+ "format": "uuid",
+ "description": "Agent UUID (from list_my_agents)."
+ }
+ },
+ "required": [
+ "agent_id"
+ ],
+ "additionalProperties": false
+ },
+ "source": "api/_mcp/tools/paired.js"
+ },
+ {
+ "name": "paired_launch",
+ "title": "Launch a paired coin from an agent wallet",
+ "description": "Launch the coin paired_launch_quote priced, signed by the agent's custodial EVM wallet on Robinhood Chain under its spend ceilings. Requires the quote's preview_id, the same launch arguments, and confirm_launch: true, which you may only send after the owner explicitly approved the quote. Returns the coin address, transaction and coin page.",
+ "server": {
+ "id": "three.ws",
+ "title": "three.ws",
+ "endpoint": "/api/mcp",
+ "transport": "remote",
+ "auth": "oauth-or-x402"
+ },
+ "safety": "irreversible",
+ "annotations": {
+ "readOnlyHint": false,
+ "destructiveHint": true,
+ "idempotentHint": false,
+ "openWorldHint": true
+ },
+ "price": {
+ "usd": 0,
+ "free": true
+ },
+ "inputSchema": {
+ "type": "object",
+ "properties": {
+ "agent_id": {
+ "type": "string",
+ "format": "uuid",
+ "description": "Agent UUID (from list_my_agents)."
+ },
+ "markets": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "minLength": 1,
+ "maxLength": 64
+ },
+ "minItems": 1,
+ "maxItems": 5,
+ "description": "What the coin pairs with: tickers from paired_markets (NVDA, WETH, USDG, …) or 0x quote addresses."
+ },
+ "weights": {
+ "type": "array",
+ "items": {
+ "type": "number",
+ "exclusiveMinimum": 0,
+ "maximum": 100
+ },
+ "maxItems": 5,
+ "description": "Percent of supply per market, same order as markets, totalling 100. Omit for an even split."
+ },
+ "name": {
+ "type": "string",
+ "minLength": 1,
+ "maxLength": 32
+ },
+ "symbol": {
+ "type": "string",
+ "minLength": 1,
+ "maxLength": 10,
+ "description": "Ticker, letters and digits."
+ },
+ "description": {
+ "type": "string",
+ "maxLength": 480
+ },
+ "image_url": {
+ "type": "string",
+ "maxLength": 512,
+ "description": "https:// logo, copied onto three.ws storage. Defaults to the agent's public avatar."
+ },
+ "socials": {
+ "type": "object",
+ "properties": {
+ "website": {
+ "type": "string"
+ },
+ "twitter": {
+ "type": "string"
+ },
+ "telegram": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "dev_buy": {
+ "type": "object",
+ "properties": {
+ "market": {
+ "type": "string",
+ "description": "Which of the markets the opening buy spends. Defaults to the first."
+ },
+ "amount": {
+ "type": "string",
+ "description": "Amount of that asset, like \"0.5\". Settled atomically in the launch transaction."
+ }
+ },
+ "required": [
+ "amount"
+ ],
+ "additionalProperties": false
+ },
+ "preview_id": {
+ "type": "string",
+ "description": "From paired_launch_quote."
+ },
+ "confirm_launch": {
+ "type": "boolean",
+ "description": "Must be true, and only after the owner said yes to the quote."
+ }
+ },
+ "required": [
+ "agent_id",
+ "markets",
+ "name",
+ "symbol",
+ "preview_id",
+ "confirm_launch"
+ ],
+ "additionalProperties": false
+ },
+ "source": "api/_mcp/tools/paired.js"
+ },
+ {
+ "name": "paired_launch_quote",
+ "title": "Quote a paired-coin launch",
+ "description": "Price a paired-coin launch from an agent's own EVM wallet on Robinhood Chain without signing anything: the pools and their dollar opening values, the launch fee, gas, the optional opening buy and its fill, the USD total, and anything blocking it (an unfunded wallet, the agent's spend ceiling). Show the result to the owner; paired_launch needs the preview_id this returns.",
+ "server": {
+ "id": "three.ws",
+ "title": "three.ws",
+ "endpoint": "/api/mcp",
+ "transport": "remote",
+ "auth": "oauth-or-x402"
+ },
+ "safety": "write",
+ "annotations": {
+ "readOnlyHint": false,
+ "destructiveHint": false,
+ "idempotentHint": false,
+ "openWorldHint": true
+ },
+ "price": {
+ "usd": 0,
+ "free": true
+ },
+ "inputSchema": {
+ "type": "object",
+ "properties": {
+ "agent_id": {
+ "type": "string",
+ "format": "uuid",
+ "description": "Agent UUID (from list_my_agents)."
+ },
+ "markets": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "minLength": 1,
+ "maxLength": 64
+ },
+ "minItems": 1,
+ "maxItems": 5,
+ "description": "What the coin pairs with: tickers from paired_markets (NVDA, WETH, USDG, …) or 0x quote addresses."
+ },
+ "weights": {
+ "type": "array",
+ "items": {
+ "type": "number",
+ "exclusiveMinimum": 0,
+ "maximum": 100
+ },
+ "maxItems": 5,
+ "description": "Percent of supply per market, same order as markets, totalling 100. Omit for an even split."
+ },
+ "name": {
+ "type": "string",
+ "minLength": 1,
+ "maxLength": 32
+ },
+ "symbol": {
+ "type": "string",
+ "minLength": 1,
+ "maxLength": 10,
+ "description": "Ticker, letters and digits."
+ },
+ "description": {
+ "type": "string",
+ "maxLength": 480
+ },
+ "image_url": {
+ "type": "string",
+ "maxLength": 512,
+ "description": "https:// logo, copied onto three.ws storage. Defaults to the agent's public avatar."
+ },
+ "socials": {
+ "type": "object",
+ "properties": {
+ "website": {
+ "type": "string"
+ },
+ "twitter": {
+ "type": "string"
+ },
+ "telegram": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "dev_buy": {
+ "type": "object",
+ "properties": {
+ "market": {
+ "type": "string",
+ "description": "Which of the markets the opening buy spends. Defaults to the first."
+ },
+ "amount": {
+ "type": "string",
+ "description": "Amount of that asset, like \"0.5\". Settled atomically in the launch transaction."
+ }
+ },
+ "required": [
+ "amount"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "agent_id",
+ "markets",
+ "name",
+ "symbol"
+ ],
+ "additionalProperties": false
+ },
+ "source": "api/_mcp/tools/paired.js"
+ },
+ {
+ "name": "paired_markets",
+ "title": "List paired-coin markets",
+ "description": "Every asset a paired coin on Robinhood Chain can trade against, read live from the launchpad: tokenized stocks (NVDA, TSLA, SPY…), WETH, stablecoins and chain coins, each with its class, live USD price and the dollar market cap a pool in it opens at. Also returns the launch fee, swap fee and the creator's share of fees.",
+ "server": {
+ "id": "three.ws",
+ "title": "three.ws",
+ "endpoint": "/api/mcp",
+ "transport": "remote",
+ "auth": "oauth-or-x402"
+ },
+ "safety": "read",
+ "annotations": {
+ "readOnlyHint": true,
+ "destructiveHint": false,
+ "idempotentHint": true,
+ "openWorldHint": true
+ },
+ "price": {
+ "usd": 0,
+ "free": true
+ },
+ "inputSchema": {
+ "type": "object",
+ "properties": {
+ "class": {
+ "type": "string",
+ "enum": [
+ "rwa-equity",
+ "stablecoin",
+ "crypto-major",
+ "crypto-native"
+ ]
+ }
+ },
+ "additionalProperties": false
+ },
+ "source": "api/_mcp/tools/paired.js"
+ },
+ {
+ "name": "print_analyze",
+ "title": "Check whether a 3D model can be printed",
+ "description": "Measure a 3D model for real-world manufacturing: whether it is a closed solid, how many separate bodies it contains, how many holes it has, its thinnest wall, its exact volume, and a 0-100 printability score with named reasons. Also returns, per material, the smallest height the model can be printed at and still hold its detail. Free, keyless, and read-only: nothing is ordered. Pass a three.ws creation_id or any public glb_url.",
+ "server": {
+ "id": "three.ws",
+ "title": "three.ws",
+ "endpoint": "/api/mcp",
+ "transport": "remote",
+ "auth": "oauth-or-x402"
+ },
+ "safety": "read",
+ "annotations": {
+ "readOnlyHint": true,
+ "destructiveHint": false,
+ "idempotentHint": true,
+ "openWorldHint": true
+ },
+ "price": {
+ "usd": 0,
+ "free": true
+ },
+ "inputSchema": {
+ "type": "object",
+ "properties": {
+ "creation_id": {
+ "type": "string",
+ "description": "A three.ws forge creation id."
+ },
+ "glb_url": {
+ "type": "string",
+ "format": "uri",
+ "description": "Public https URL of a .glb file, instead of a creation id."
+ }
+ },
+ "additionalProperties": false
+ },
+ "source": "api/_mcp/tools/print.js"
+ },
+ {
+ "name": "print_quote",
+ "title": "Price a real 3D print and get a signed quote",
+ "description": "Price a physical print of a 3D model: an itemized quote in USDC (build setup, material with the exact volume it was computed from, finish, quantity break, shipping) plus a signed quote token valid for 24 hours. Materials, size limits and lead times come from GET /api/print/catalog. This tool does NOT place an order and moves no money: settle the token at POST /api/x402/print-order when you have a shipping address. Free and keyless.",
"server": {
"id": "three.ws",
"title": "three.ws",
@@ -13453,7 +14098,7 @@
{
"name": "read_resource",
"title": "Read a three:// resource",
- "description": "Read a live three.ws resource by URI: three://me (account, scopes, quota), three://agents and three://agents/<id> (your agents), three://agents/<id>/wallet (balances, limits, freeze state), .../usage, .../chat, .../runs, .../orders, .../dca, .../intents, three://wallets, three://launches, three://marketplace, three://models and three://x402/services. Omit uri to list every resource you can read. Set format to markdown for a readable rendering.",
+ "description": "Read a live three.ws resource by URI: three://me (account, scopes, quota), three://agents and three://agents/<id> (your agents), three://agents/<id>/wallet (balances, limits, freeze state), .../usage, .../chat, .../runs, .../orders, .../dca, .../intents, .../earnings (public: creator fees, claims, service income), three://wallets, three://launches, three://marketplace, three://models and three://x402/services. Omit uri to list every resource you can read. Set format to markdown for a readable rendering.",
"server": {
"id": "three.ws",
"title": "three.ws",
@@ -13946,6 +14591,66 @@
},
"source": "api/_mcp/tools/avatars.js"
},
+ {
+ "name": "sentiment_scout",
+ "title": "Sourced momentum candidates (Sentiment Scout)",
+ "description": "Surface pump.fun momentum candidates with evidence you can cite. Each candidate returns a 0-100 momentum_score (with the parts that add up to it), evidence lines of type volume_spike, fresh_buyers, smart_money, graduation_approach, social_mention (X posts quoting the coin's exact contract address, or pump.fun callouts), paid_signal (x402 market reads with their payment transaction) and news_match, and one caution line naming the main risk. Every evidence line carries source (a URL that returns the fact), at (when it was true) and, for social or paid claims, checked_against (the on-chain facts read in the same run). Sources that could not be read are listed in unavailable, never estimated. Pass mint to read one coin even if it would not make the board. Pass track_record=true to include how the coins the Scout flagged over the last 14 days actually did against the base rate. This tool never trades and is not advice; cite the evidence, not the score.",
+ "server": {
+ "id": "three.ws",
+ "title": "three.ws",
+ "endpoint": "/api/mcp",
+ "transport": "remote",
+ "auth": "oauth-or-x402"
+ },
+ "safety": "read",
+ "annotations": {
+ "readOnlyHint": true,
+ "destructiveHint": false,
+ "idempotentHint": false,
+ "openWorldHint": true
+ },
+ "price": {
+ "usd": 0,
+ "free": true
+ },
+ "inputSchema": {
+ "type": "object",
+ "properties": {
+ "mint": {
+ "type": "string",
+ "description": "Optional pump.fun mint (base58). Omit for the board."
+ },
+ "network": {
+ "type": "string",
+ "enum": [
+ "mainnet",
+ "devnet"
+ ],
+ "default": "mainnet"
+ },
+ "window_minutes": {
+ "type": "integer",
+ "minimum": 15,
+ "maximum": 240,
+ "default": 60,
+ "description": "Minutes of launches to rank against."
+ },
+ "limit": {
+ "type": "integer",
+ "minimum": 1,
+ "maximum": 10,
+ "default": 5
+ },
+ "track_record": {
+ "type": "boolean",
+ "default": false,
+ "description": "Include the Scout's graded track record."
+ }
+ },
+ "additionalProperties": false
+ },
+ "source": "api/_mcp/tools/trader.js"
+ },
{
"name": "sign_text",
"title": "Sign text in ASL",
@@ -16334,6 +17039,35 @@
"minLength": 8,
"maxLength": 4096,
"description": "The job_id (or jobId) a pending generation returned."
+ },
+ "refine": {
+ "type": "object",
+ "additionalProperties": true,
+ "description": "Optional: the refine object a pending refine_model result carried. Pass it back unchanged so the finished model joins that version history.",
+ "properties": {
+ "lineage": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "instruction": {
+ "type": "string",
+ "maxLength": 500
+ },
+ "parentIndex": {
+ "type": "integer",
+ "minimum": 0
+ },
+ "refKind": {
+ "type": "string",
+ "enum": [
+ "text",
+ "image"
+ ]
+ }
+ }
}
},
"additionalProperties": false,
diff --git a/public/sitemap/index.html b/public/sitemap/index.html
index 2746a21c2..e612d305b 100644
--- a/public/sitemap/index.html
+++ b/public/sitemap/index.html
@@ -3,16 +3,16 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
-<title data-i18n="sitemap_index.meta_title">Sitemap · three.ws</title>
-<meta name="description" content="Human-readable index of every page on three.ws." data-i18n-attr="content:sitemap_index.meta_description"/>
+<title>Sitemap · three.ws</title>
+<meta name="description" content="Human-readable index of every page on three.ws." />
<meta name="robots" content="index, follow, max-image-preview:large, max-snippet:-1" />
<link rel="canonical" href="https://three.ws/sitemap" />
<meta property="og:type" content="website" />
<meta property="og:site_name" content="three.ws" />
<meta property="og:locale" content="en_US" />
<meta property="og:url" content="https://three.ws/sitemap" />
-<meta property="og:title" content="Sitemap · three.ws" data-i18n-attr="content:sitemap_index.meta_og_title"/>
-<meta property="og:description" content="Human-readable index of every page on three.ws." data-i18n-attr="content:sitemap_index.meta_og_description"/>
+<meta property="og:title" content="Sitemap · three.ws" />
+<meta property="og:description" content="Human-readable index of every page on three.ws." />
<meta property="og:image" content="https://three.ws/api/page-og?s=main&amp;t=Sitemap&amp;d=Human-readable+index+of+every+page+on+three.ws.&amp;p=%2Fsitemap" />
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
@@ -20,8 +20,8 @@
<meta property="og:image:alt" content="Sitemap - three.ws" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:site" content="@trythreews" />
-<meta name="twitter:title" content="Sitemap · three.ws" data-i18n-attr="content:sitemap_index.meta_twitter_title"/>
-<meta name="twitter:description" content="Human-readable index of every page on three.ws." data-i18n-attr="content:sitemap_index.meta_twitter_description"/>
+<meta name="twitter:title" content="Sitemap · three.ws" />
+<meta name="twitter:description" content="Human-readable index of every page on three.ws." />
<meta name="twitter:image" content="https://three.ws/api/page-og?s=main&amp;t=Sitemap&amp;d=Human-readable+index+of+every+page+on+three.ws.&amp;p=%2Fsitemap" />
<script type="application/ld+json">{"@context":"https://schema.org","@graph":[{"@type":"WebPage","name":"Sitemap","description":"Human-readable index of every page on three.ws.","url":"https://three.ws/sitemap","isPartOf":{"@type":"WebSite","name":"three.ws","url":"https://three.ws"},"primaryImageOfPage":"https://three.ws/api/page-og?s=main&t=Sitemap&d=Human-readable+index+of+every+page+on+three.ws.&p=%2Fsitemap"}]}</script>
<link rel="alternate" type="application/xml" title="XML sitemap" href="/sitemap.xml" />
@@ -95,27 +95,43 @@
<header><div id="nav-container"></div></header>
<main class="sm-wrap">
<div class="sm-hero">
- <h1 data-i18n="sitemap_index.sitemap">Sitemap</h1>
- <p><span>975</span> <span data-i18n="sitemap_index.pages_grouped">pages on three.ws, grouped by purpose. Looking for the machine-readable versions?</span></p>
+ <h1>Sitemap</h1>
+ <p><span>979</span> <span data-i18n="sitemap_index.pages_grouped">pages on three.ws, grouped by purpose. Looking for the machine-readable versions?</span></p>
<div class="sm-formats">
- <a href="/sitemap.xml" data-i18n-html="sitemap_index.for_search_engines"><code>sitemap.xml</code> · for search engines</a>
- <a href="/llms.txt" data-i18n-html="sitemap_index.for_ai_agents"><code>llms.txt</code> · for AI agents</a>
- <a href="/llms-full.txt" data-i18n-html="sitemap_index.long_form"><code>llms-full.txt</code> · long form</a>
- <a href="/api/features.json" data-i18n-html="sitemap_index.machine_manifest"><code>features.json</code> · machine manifest</a>
- <a href="/changelog" data-i18n-html="sitemap_index.what_s_new"><code>changelog</code> · what's new</a>
- <a href="/openapi.json" data-i18n-html="sitemap_index.http_api"><code>openapi.json</code> · HTTP API</a>
+ <a href="/sitemap.xml"><code>sitemap.xml</code> · for search engines</a>
+ <a href="/llms.txt"><code>llms.txt</code> · for AI agents</a>
+ <a href="/llms-full.txt"><code>llms-full.txt</code> · long form</a>
+ <a href="/api/features.json"><code>features.json</code> · machine manifest</a>
+ <a href="/changelog"><code>changelog</code> · what's new</a>
+ <a href="/openapi.json"><code>openapi.json</code> · HTTP API</a>
</div>
</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 975 pages by name, path, or description…" aria-label="Filter pages" autocomplete="off" spellcheck="false" />
+ <input id="sm-filter-input" type="search" placeholder="Filter 979 pages by name, path, or description…" aria-label="Filter pages" autocomplete="off" spellcheck="false" />
<kbd id="sm-filter-kbd" aria-hidden="true">/</kbd>
</div>
<p class="sm-filter-count" role="status" aria-live="polite"><span id="sm-filter-count"></span><span id="sm-filter-hint" aria-hidden="true"></span></p>
<section class="sm-new" id="sm-new" aria-labelledby="sm-new-title">
- <h2 id="sm-new-title" data-i18n-html="sitemap_index.newestfull_changelog">Newest<a class="sm-new-more" href="/changelog">full changelog &rarr;</a></h2>
- <p class="sm-section-desc" data-i18n="sitemap_index.the_9_most_recently_launched_pages_straight">The 9 most recently launched pages, straight to the live surface.</p>
+ <h2 id="sm-new-title">Newest<a class="sm-new-more" href="/changelog">full changelog &rarr;</a></h2>
+ <p class="sm-section-desc">The 9 most recently launched pages, straight to the live surface.</p>
<ul class="sm-list">
+ <li>
+ <a href="/docs/dextools">
+ <span class="sm-new-date" translate="no">Oct 8, 2026</span>
+ <span class="sm-title"><span data-i18n="sitemap_index.t_docs_dextools">DEXTools integration guide</span></span>
+ <span class="sm-path" translate="no">/docs/dextools</span>
+ <span class="sm-desc" data-i18n="sitemap_index.d_docs_dextools">How three.ws works with DEXTools: DEXTools charts on every coin page, any pair rendered as a live 3D scene, the embeddable Social Boost card, and how to paste a DEXTools link to get an embed snippet.</span>
+ </a>
+ </li>
+ <li>
+ <a href="/launch/robinhood">
+ <span class="sm-new-date" translate="no">Oct 8, 2026</span>
+ <span class="sm-title"><span data-i18n="sitemap_index.t_launch_robinhood">Launch on Robinhood Chain</span></span>
+ <span class="sm-path" translate="no">/launch/robinhood</span>
+ <span class="sm-desc" data-i18n="sitemap_index.d_launch_robinhood">Launch a coin on Robinhood Chain through Pons, signed by your 3D AI agent's own wallet: a live cost quote, an atomic opening buy, and an API your bots can call.</span>
+ </a>
+ </li>
<li>
<a href="/dextools">
<span class="sm-new-date" translate="no">Oct 8, 2026</span>
@@ -132,6 +148,22 @@
<span class="sm-desc" data-i18n="sitemap_index.d_chart_companion">Paste any DEXTools pair and a 3D agent watches the live chart with you, reacting to every real swap: cheering whale buys, flinching at dumps, calling streaks and new highs, each reaction linked to its transaction. Turn on its voice, bring your own three.ws agent, embed it with one iframe, or add it to OBS as a transparent stream overlay.</span>
</a>
</li>
+ <li>
+ <a href="/docs/dextools">
+ <span class="sm-new-date" translate="no">Oct 8, 2026</span>
+ <span class="sm-title"><span data-i18n="sitemap_index.t_docs_dextools">Docs · DEXTools integration</span></span>
+ <span class="sm-path" translate="no">/docs/dextools</span>
+ <span class="sm-desc" data-i18n="sitemap_index.d_docs_dextools">How three.ws and DEXTools connect: the /dextools hub, the embed builder that turns any DEXTools pair link into a 3D scene or Social Boost card snippet, the framable Boost on DEXTools card, and the counted redirect and public totals behind every visit three.ws sends to a DEXTools pair page.</span>
+ </a>
+ </li>
+ <li>
+ <a href="/docs/chart-companion">
+ <span class="sm-new-date" translate="no">Oct 8, 2026</span>
+ <span class="sm-title"><span data-i18n="sitemap_index.t_docs_chart_companion">Docs · Chart Companion</span></span>
+ <span class="sm-path" translate="no">/docs/chart-companion</span>
+ <span class="sm-desc" data-i18n="sitemap_index.d_docs_chart_companion">How to watch a DEXTools chart with a 3D agent that reacts to every real swap: the URL parameters, streaming it as a transparent OBS overlay, embedding it with one iframe, bringing your own agent, and exactly how whale, streak and new-high reactions are decided.</span>
+ </a>
+ </li>
<li>
<a href="/duels">
<span class="sm-new-date" translate="no">Sep 30, 2026</span>
@@ -156,57 +188,25 @@
<span class="sm-desc" data-i18n="sitemap_index.d_analytics">Every three.ws platform total on one page, read live: agents, agents with a wallet, coins launched, 3D models generated, LLM tokens processed, x402 settlements and volume, marketplace sales and agent-to-agent hire volume, each with a daily growth chart over 30 days, 90 days or all time and a note on exactly how it is counted.</span>
</a>
</li>
- <li>
- <a href="/stories">
- <span class="sm-new-date" translate="no">Sep 30, 2026</span>
- <span class="sm-title"><span data-i18n="sitemap_index.t_stories">Success Stories</span></span>
- <span class="sm-path" translate="no">/stories</span>
- <span class="sm-desc" data-i18n="sitemap_index.d_stories">Agents with results anyone can check: coins launched, creator fees and service income, computed by three.ws from launch records and settled payments and shown only when the agent's owner opts in. Grouped by category, each linking to the full Spotlight entry and the coin on Solscan.</span>
- </a>
- </li>
- <li>
- <a href="/docs/experiments">
- <span class="sm-new-date" translate="no">Sep 30, 2026</span>
- <span class="sm-title"><span data-i18n="sitemap_index.t_docs_experiments">Docs · How we run and publish experiments</span></span>
- <span class="sm-path" translate="no">/docs/experiments</span>
- <span class="sm-desc" data-i18n="sitemap_index.d_docs_experiments">The six-section write-up template every three.ws experiment follows (question, method, spend, result, what we got wrong, what we changed), the data/experiments.json entry format, and the build check that enforces both.</span>
- </a>
- </li>
- <li>
- <a href="/docs/experiments-agent-launch-funnel">
- <span class="sm-new-date" translate="no">Sep 30, 2026</span>
- <span class="sm-title"><span data-i18n="sitemap_index.t_docs_experiments_agent_launch_funnel">Experiment · How many new agents ever launch a coin?</span></span>
- <span class="sm-path" translate="no">/docs/experiments-agent-launch-funnel</span>
- <span class="sm-desc" data-i18n="sitemap_index.d_docs_experiments_agent_launch_funnel">Measured from production: of 788 agents created in the 30 days to 2026-09-30, 2 launched a coin, about three in four had no wallet, and no token plan has ever been saved. What we got wrong and what we changed, with every query.</span>
- </a>
- </li>
- <li>
- <a href="/docs/experiments-autonomous-trading">
- <span class="sm-new-date" translate="no">Sep 30, 2026</span>
- <span class="sm-title"><span data-i18n="sitemap_index.t_docs_experiments_autonomous_trading">Experiment · Can autonomous agents trade new coins at a profit?</span></span>
- <span class="sm-path" translate="no">/docs/experiments-autonomous-trading</span>
- <span class="sm-desc" data-i18n="sitemap_index.d_docs_experiments_autonomous_trading">1,296 real trades by AI agents on Solana: 16.4% winners and a net loss of 0.5402 SOL on 9.1444 SOL deployed. Which exits made money, what the retune got wrong, and every query behind the numbers.</span>
- </a>
- </li>
</ul>
</section>
<nav class="sm-toc" aria-label="Sections">
- <a href="#main" data-i18n="sitemap_index.main">Main</a>
- <a href="#build" data-i18n="sitemap_index.build">Build</a>
- <a href="#labs" data-i18n="sitemap_index.labs">Labs</a>
- <a href="#crypto" data-i18n="sitemap_index.crypto">Crypto</a>
- <a href="#agent-tools" data-i18n="sitemap_index.agent_tools">Agent Tools</a>
- <a href="#account" data-i18n="sitemap_index.account">Account</a>
- <a href="#learn" data-i18n="sitemap_index.learn">Learn</a>
- <a href="#blog" data-i18n="sitemap_index.blog">Blog</a>
- <a href="#legal" data-i18n="sitemap_index.legal">Legal</a>
- <a href="#machine" data-i18n="sitemap_index.machine_readable">Machine-readable</a>
- <a href="#news" data-i18n="sitemap_index.news">News</a>
+ <a href="#main">Main</a>
+ <a href="#build">Build</a>
+ <a href="#labs">Labs</a>
+ <a href="#crypto">Crypto</a>
+ <a href="#agent-tools">Agent Tools</a>
+ <a href="#account">Account</a>
+ <a href="#learn">Learn</a>
+ <a href="#blog">Blog</a>
+ <a href="#legal">Legal</a>
+ <a href="#machine">Machine-readable</a>
+ <a href="#news">News</a>
</nav>
<section class="sm-section" id="main">
<header>
<h2><span data-i18n="sitemap_index.section_main">Main</span><span class="sm-count" data-count>62</span></h2>
- <p class="sm-section-desc" data-i18n="sitemap_index.entry_points_into_the_product">Entry points into the product.</p>
+ <p class="sm-section-desc">Entry points into the product.</p>
</header>
<ul class="sm-list">
<li>
@@ -648,8 +648,8 @@
<section class="sm-section" id="build">
<header>
- <h2><span data-i18n="sitemap_index.section_build">Build</span><span class="sm-count" data-count>80</span></h2>
- <p class="sm-section-desc" data-i18n="sitemap_index.create_and_customize_an_agent">Create and customize an agent.</p>
+ <h2><span data-i18n="sitemap_index.section_build">Build</span><span class="sm-count" data-count>81</span></h2>
+ <p class="sm-section-desc">Create and customize an agent.</p>
</header>
<ul class="sm-list">
<li>
@@ -897,6 +897,13 @@
<span class="sm-desc" data-i18n="sitemap_index.d_docs_brownout">Every response says where its data came from and how fresh it is, and every fallback the API claims has been executed for real against a genuinely refusing provider, inside the request path a user hits.</span>
</a>
</li>
+ <li>
+ <a href="/docs/dextools">
+ <span class="sm-title"><span data-i18n="sitemap_index.t_docs_dextools">DEXTools integration guide</span></span>
+ <span class="sm-path" translate="no">/docs/dextools</span>
+ <span class="sm-desc" data-i18n="sitemap_index.d_docs_dextools">How three.ws works with DEXTools: DEXTools charts on every coin page, any pair rendered as a live 3D scene, the embeddable Social Boost card, and how to paste a DEXTools link to get an embed snippet.</span>
+ </a>
+ </li>
<li>
<a href="/docs/portal">
<span class="sm-title"><span data-i18n="sitemap_index.t_docs_portal">How Portal builds a 3D world from a URL</span></span>
@@ -1218,7 +1225,7 @@
<section class="sm-section" id="labs">
<header>
<h2><span data-i18n="sitemap_index.section_labs">Labs</span><span class="sm-count" data-count>25</span></h2>
- <p class="sm-section-desc" data-i18n="sitemap_index.experimental_features_actively_shipping_expe">Experimental features actively shipping. Expect fast iteration.</p>
+ <p class="sm-section-desc">Experimental features actively shipping. Expect fast iteration.</p>
</header>
<ul class="sm-list">
<li>
@@ -1401,8 +1408,8 @@
<section class="sm-section" id="crypto">
<header>
- <h2><span data-i18n="sitemap_index.section_crypto">Crypto</span><span class="sm-count" data-count>156</span></h2>
- <p class="sm-section-desc" data-i18n="sitemap_index.on_chain_features_pay_per_call_token">On-chain features: pay-per-call, token launches, vanity wallets.</p>
+ <h2><span data-i18n="sitemap_index.section_crypto">Crypto</span><span class="sm-count" data-count>157</span></h2>
+ <p class="sm-section-desc">On-chain features: pay-per-call, token launches, vanity wallets.</p>
</header>
<ul class="sm-list">
<li>
@@ -1482,6 +1489,13 @@
<span class="sm-desc" data-i18n="sitemap_index.d_launch">The pump.fun launchpad for 3D AI agents: pick your agent, name the coin, launch it from your wallet or the agent's wallet, and claim creator rewards on three.ws.</span>
</a>
</li>
+ <li>
+ <a href="/launch/robinhood">
+ <span class="sm-title"><span data-i18n="sitemap_index.t_launch_robinhood">Launch on Robinhood Chain</span></span>
+ <span class="sm-path" translate="no">/launch/robinhood</span>
+ <span class="sm-desc" data-i18n="sitemap_index.d_launch_robinhood">Launch a coin on Robinhood Chain through Pons, signed by your 3D AI agent's own wallet: a live cost quote, an atomic opening buy, and an API your bots can call.</span>
+ </a>
+ </li>
<li>
<a href="/launch-studio">
<span class="sm-title"><span data-i18n="sitemap_index.t_launch_studio">Launch Studio: 50 ways to mint a coin</span></span>
@@ -2503,7 +2517,7 @@
<section class="sm-section" id="agent-tools">
<header>
<h2><span data-i18n="sitemap_index.section_agent-tools">Agent Tools</span><span class="sm-count" data-count>10</span></h2>
- <p class="sm-section-desc" data-i18n="sitemap_index.manage_talk_to_and_deploy_individual_agents">Manage, talk to, and deploy individual agents.</p>
+ <p class="sm-section-desc">Manage, talk to, and deploy individual agents.</p>
</header>
<ul class="sm-list">
<li>
@@ -2582,7 +2596,7 @@
<section class="sm-section" id="account">
<header>
<h2><span data-i18n="sitemap_index.section_account">Account</span><span class="sm-count" data-count>14</span></h2>
- <p class="sm-section-desc" data-i18n="sitemap_index.sign_in_dashboard_billing">Sign-in, dashboard, billing.</p>
+ <p class="sm-section-desc">Sign-in, dashboard, billing.</p>
</header>
<ul class="sm-list">
<li>
@@ -2688,8 +2702,8 @@
<section class="sm-section" id="learn">
<header>
- <h2><span data-i18n="sitemap_index.section_learn">Learn</span><span class="sm-count" data-count>451</span></h2>
- <p class="sm-section-desc" data-i18n="sitemap_index.docs_tutorials_and_reference">Docs, tutorials, and reference.</p>
+ <h2><span data-i18n="sitemap_index.section_learn">Learn</span><span class="sm-count" data-count>453</span></h2>
+ <p class="sm-section-desc">Docs, tutorials, and reference.</p>
</header>
<ul class="sm-list">
<li>
@@ -2944,6 +2958,20 @@
<span class="sm-desc" data-i18n="sitemap_index.d_docs_swarms">How a group of agents pools real SOL into one on-chain Solana treasury and trades it by weighted consensus: reputation-weighted voting, spend-guarded contribute and exit transfers, the shared kill switch, and why no balance is virtual.</span>
</a>
</li>
+ <li>
+ <a href="/docs/dextools">
+ <span class="sm-title"><span data-i18n="sitemap_index.t_docs_dextools">Docs · DEXTools integration</span></span>
+ <span class="sm-path" translate="no">/docs/dextools</span>
+ <span class="sm-desc" data-i18n="sitemap_index.d_docs_dextools">How three.ws and DEXTools connect: the /dextools hub, the embed builder that turns any DEXTools pair link into a 3D scene or Social Boost card snippet, the framable Boost on DEXTools card, and the counted redirect and public totals behind every visit three.ws sends to a DEXTools pair page.</span>
+ </a>
+ </li>
+ <li>
+ <a href="/docs/chart-companion">
+ <span class="sm-title"><span data-i18n="sitemap_index.t_docs_chart_companion">Docs · Chart Companion</span></span>
+ <span class="sm-path" translate="no">/docs/chart-companion</span>
+ <span class="sm-desc" data-i18n="sitemap_index.d_docs_chart_companion">How to watch a DEXTools chart with a 3D agent that reacts to every real swap: the URL parameters, streaming it as a transparent OBS overlay, embedding it with one iframe, bringing your own agent, and exactly how whale, streak and new-high reactions are decided.</span>
+ </a>
+ </li>
<li>
<a href="/docs/coin3d-embed">
<span class="sm-title"><span data-i18n="sitemap_index.t_docs_coin3d_embed">Docs · Token in 3D, as an embed</span></span>
@@ -5855,7 +5883,7 @@
<section class="sm-section" id="blog">
<header>
<h2><span data-i18n="sitemap_index.section_blog">Blog</span><span class="sm-count" data-count>39</span></h2>
- <p class="sm-section-desc" data-i18n="sitemap_index.long_form_announcements_launches_and_writing">Long-form announcements, launches, and writing from three.ws.</p>
+ <p class="sm-section-desc">Long-form announcements, launches, and writing from three.ws.</p>
</header>
<ul class="sm-list">
<li>
@@ -6209,7 +6237,7 @@
<section class="sm-section" id="machine">
<header>
<h2><span data-i18n="sitemap_index.section_machine">Machine-readable</span><span class="sm-count" data-count>17</span></h2>
- <p class="sm-section-desc" data-i18n="sitemap_index.indexes_and_well_known_files_for_crawlers">Indexes and well-known files for crawlers and AI agents.</p>
+ <p class="sm-section-desc">Indexes and well-known files for crawlers and AI agents.</p>
</header>
<ul class="sm-list">
<li>
@@ -6337,7 +6365,7 @@
<section class="sm-section" id="news">
<header>
<h2><span data-i18n="sitemap_index.section_news">News</span><span class="sm-count" data-count>112</span></h2>
- <p class="sm-section-desc" data-i18n="sitemap_index.product_launches_integrations_and_announceme">Product launches, integrations, and announcements from three.ws.</p>
+ <p class="sm-section-desc">Product launches, integrations, and announcements from three.ws.</p>
</header>
<ul class="sm-list">
<li>
@@ -7128,10 +7156,10 @@
</section>
<div class="sm-empty" id="sm-empty" hidden>
<p><span data-i18n="sitemap_index.no_pages_match">No pages match</span> &ldquo;<span id="sm-empty-q"></span>&rdquo;.</p>
- <p class="sm-empty-hint" data-i18n="sitemap_index.try_a_shorter_word_or_search_everything">Try a shorter word, or search everything: global search covers agents, coins, and skills too.</p>
+ <p class="sm-empty-hint">Try a shorter word, or search everything: global search covers agents, coins, and skills too.</p>
<div class="sm-empty-actions">
- <button type="button" id="sm-empty-clear" data-i18n="sitemap_index.clear_filter">Clear filter</button>
- <a id="sm-empty-search" href="/search" data-i18n="sitemap_index.search_all_of_three_ws">Search all of three.ws</a>
+ <button type="button" id="sm-empty-clear">Clear filter</button>
+ <a id="sm-empty-search" href="/search">Search all of three.ws</a>
</div>
</div>
</main>
diff --git a/scripts/paired-register-quotes.mjs b/scripts/paired-register-quotes.mjs
new file mode 100644
index 000000000..a044002b5
--- /dev/null
+++ b/scripts/paired-register-quotes.mjs
@@ -0,0 +1,179 @@
+#!/usr/bin/env node
+// Register new quote assets on the paired launchpad, so coins can pair with them.
+//
+// npm run paired:quotes -- --assets WETH,USDG,0x... # plan only, sends nothing
+// npm run paired:quotes -- --assets WETH --target-usd 6000 # override the opening value
+// PAIRED_OWNER_KEY=0x... npm run paired:quotes -- --assets WETH,USDG --apply
+// PAIRED_OWNER_KEY=0x... npm run paired:quotes -- --assets 0x... --disable --apply
+//
+// What it does, per asset:
+// 1. Resolves it against the Robinhood Chain universe by contract address, so
+// a symbol always means the canonical token and never one of the contracts
+// squatting on its ticker. Unlisted or impersonating contracts are refused.
+// 2. Checks it is liquid enough to be a sane quote (default floor $100k), has a
+// live USD price, and that its on-chain decimals match the universe.
+// 3. Calibrates `virtualQuote`, the curve's opening reserve, so a coin with
+// 100% of its supply in this pool opens at the same dollar market cap as the
+// markets already on the launchpad (their live median, unless --target-usd).
+// The value is in the asset's own decimals: 6000 USD of USDG is 6000e6, of
+// WETH is ~2.3e18.
+// 4. Prints the exact setQuoteConfig calldata. Nothing is signed without
+// --apply AND an owner key whose address the contract reports as owner().
+//
+// Registering a quote is a permanent on-chain action by the launchpad owner. The
+// curve accounts in amounts it asked to move, so only plain ERC-20s qualify: no
+// fee-on-transfer, no rebasing. Every asset the universe classifies is a plain
+// Uniswap-traded ERC-20 or a Robinhood Stock Token.
+
+import { createWalletClient, encodeFunctionData, formatUnits, http, parseUnits } from 'viem';
+import { privateKeyToAccount } from 'viem/accounts';
+import { launchpadAbi, launchpadAddress, quoteRegistry } from '../api/_lib/paired-launchpad.js';
+import { dexFallback, pairedMarkets } from '../api/_lib/paired-markets.js';
+import { liveUniverse } from '../api/_lib/hood-portfolios.js';
+import { HOOD_MAINNET, erc20Metadata, publicClient, rpcUrls } from '../api/_lib/robinhood.js';
+
+const UINT128_MAX = (1n << 128n) - 1n;
+
+function parseArgs(argv) {
+ const args = { assets: [], targetUsd: null, minLiquidity: 100_000, disable: false, apply: false };
+ for (let i = 0; i < argv.length; i++) {
+ const a = argv[i];
+ const next = () => argv[++i];
+ if (a === '--assets') args.assets = String(next() ?? '').split(',').map((s) => s.trim()).filter(Boolean);
+ else if (a === '--target-usd') args.targetUsd = Number(next());
+ else if (a === '--min-liquidity') args.minLiquidity = Number(next());
+ else if (a === '--disable') args.disable = true;
+ else if (a === '--apply') args.apply = true;
+ else if (a === '--help' || a === '-h') args.help = true;
+ else throw new Error(`unknown argument ${a}`);
+ }
+ return args;
+}
+
+const usd = (n) => (n == null ? 'n/a' : `$${Math.round(n).toLocaleString('en-US')}`);
+
+function median(values) {
+ const v = values.filter((x) => Number.isFinite(x)).sort((a, b) => a - b);
+ if (!v.length) return null;
+ const mid = Math.floor(v.length / 2);
+ return v.length % 2 ? v[mid] : (v[mid - 1] + v[mid]) / 2;
+}
+
+/** Four significant figures, so the on-chain reserve reads as a deliberate number. */
+function roundSig(x, digits = 4) {
+ if (!(x > 0)) return 0;
+ const p = 10 ** (digits - 1 - Math.floor(Math.log10(x)));
+ return Math.round(x * p) / p;
+}
+
+function resolveAsset(universe, raw) {
+ const text = raw.replace(/^\$/, '');
+ if (/^0x[0-9a-fA-F]{40}$/.test(text)) {
+ return universe.tokens.find((t) => t.address.toLowerCase() === text.toLowerCase()) ?? { unlisted: text };
+ }
+ const canonical = universe.tokens.filter((t) => t.symbol.toUpperCase() === text.toUpperCase() && t.canonical);
+ if (canonical.length === 1) return canonical[0];
+ if (canonical.length > 1) return { ambiguous: text, candidates: canonical.map((t) => t.address) };
+ return { unknown: text };
+}
+
+async function main() {
+ const args = parseArgs(process.argv.slice(2));
+ if (args.help || !args.assets.length) {
+ console.log('usage: npm run paired:quotes -- --assets SYM|0x...[,..] [--target-usd N] [--min-liquidity N] [--disable] [--apply]');
+ process.exit(args.help ? 0 : 1);
+ }
+
+ const lp = launchpadAddress();
+ const client = publicClient(false);
+ const [owner, registry, markets, universe] = await Promise.all([
+ client.readContract({ address: lp, abi: launchpadAbi, functionName: 'owner' }),
+ quoteRegistry(),
+ pairedMarkets(),
+ liveUniverse(),
+ ]);
+ const registered = new Map(registry.map((q) => [q.address.toLowerCase(), q]));
+ const target = args.targetUsd ?? median(markets.map((m) => m.openingValueUsd));
+ if (!args.disable && !(target > 0)) throw new Error('could not price the existing markets; pass --target-usd');
+
+ console.log(`launchpad ${lp} on chain ${HOOD_MAINNET.id}, owner ${owner}`);
+ console.log(`${markets.length} enabled markets today; ${args.disable ? 'disabling' : `opening value target ${usd(target)} per full-weight pool`}\n`);
+
+ const plan = [];
+ const refused = [];
+ const resolved = args.assets.map((raw) => ({ raw, token: resolveAsset(universe, raw) }));
+ const meta = await erc20Metadata(resolved.map((r) => r.token.address).filter(Boolean));
+
+ for (const { raw, token } of resolved) {
+ if (token.unknown) { refused.push(`${raw}: no canonical token with that symbol on Robinhood Chain`); continue; }
+ if (token.ambiguous) { refused.push(`${raw}: ambiguous, pass one of ${token.candidates.join(', ')}`); continue; }
+ if (token.unlisted) { refused.push(`${raw}: not in the Robinhood Chain universe, so its class, price and canonicity are unknown`); continue; }
+ const existing = registered.get(token.address.toLowerCase());
+
+ if (args.disable) {
+ if (!existing) { refused.push(`${token.symbol}: not registered, nothing to disable`); continue; }
+ if (!existing.enabled) { refused.push(`${token.symbol}: already disabled`); continue; }
+ plan.push({ token, virtualQuote: BigInt(existing.virtualQuoteRaw), enabled: false, note: 'disable (existing coins keep trading)' });
+ continue;
+ }
+
+ if (!token.canonical) { refused.push(`${token.symbol} ${token.address}: impersonates the canonical ${token.symbol}`); continue; }
+ const onchain = meta[token.address.toLowerCase()];
+ if (onchain?.decimals == null) { refused.push(`${token.symbol}: decimals() did not answer on chain`); continue; }
+ if (onchain.decimals !== token.decimals) { refused.push(`${token.symbol}: on-chain decimals ${onchain.decimals} disagree with the universe (${token.decimals})`); continue; }
+ const fallback = token.priceUsd > 0 && token.liquidityUsd > 0 ? null : await dexFallback(token.address, token.assetClass);
+ const priceUsd = token.priceUsd > 0 ? token.priceUsd : fallback?.priceUsd;
+ const liquidityUsd = Math.max(token.liquidityUsd ?? 0, fallback?.liquidityUsd ?? 0);
+ if (!(priceUsd > 0)) { refused.push(`${token.symbol}: no live USD price`); continue; }
+ if (liquidityUsd < args.minLiquidity) { refused.push(`${token.symbol}: ${usd(liquidityUsd)} liquidity is under the ${usd(args.minLiquidity)} floor`); continue; }
+ if (existing?.enabled) { refused.push(`${token.symbol}: already enabled (opening reserve ${existing.virtualQuote} ${existing.symbol})`); continue; }
+
+ const units = roundSig(target / priceUsd);
+ const virtualQuote = parseUnits(String(units), token.decimals);
+ if (virtualQuote === 0n || virtualQuote > UINT128_MAX) { refused.push(`${token.symbol}: calibrated reserve ${units} does not fit uint128`); continue; }
+ plan.push({ token, virtualQuote, enabled: true, note: `priced ${priceUsd < 1 ? priceUsd.toPrecision(4) : priceUsd.toFixed(2)} USD, opens at ${usd(units * priceUsd)}` });
+ }
+
+ for (const r of refused) console.log(` refused ${r}`);
+ if (refused.length) console.log('');
+
+ const txs = plan.map((p) => ({
+ ...p,
+ data: encodeFunctionData({ abi: launchpadAbi, functionName: 'setQuoteConfig', args: [p.token.address, p.virtualQuote, p.enabled] }),
+ }));
+ for (const t of txs) {
+ console.log(` ${t.enabled ? 'enable ' : 'disable'} ${t.token.symbol.padEnd(8)} ${t.token.assetClass.padEnd(13)} ${t.token.address}`);
+ console.log(` virtualQuote ${formatUnits(t.virtualQuote, t.token.decimals)} ${t.token.symbol} (${t.virtualQuote} base units), ${t.note}`);
+ console.log(` to ${lp} data ${t.data}`);
+ }
+ if (!txs.length) { console.log('nothing to send'); process.exit(refused.length ? 1 : 0); }
+
+ if (!args.apply) {
+ console.log(`\nplan only: ${txs.length} setQuoteConfig transaction(s), each signed by the owner ${owner}. Re-run with PAIRED_OWNER_KEY and --apply to send.`);
+ return;
+ }
+
+ const key = String(process.env.PAIRED_OWNER_KEY || '').trim();
+ if (!/^0x[0-9a-fA-F]{64}$/.test(key)) throw new Error('--apply needs PAIRED_OWNER_KEY (the launchpad owner private key)');
+ const account = privateKeyToAccount(key);
+ if (account.address.toLowerCase() !== owner.toLowerCase()) {
+ throw new Error(`PAIRED_OWNER_KEY is ${account.address}, but the launchpad owner is ${owner}`);
+ }
+ const wallet = createWalletClient({ account, chain: HOOD_MAINNET, transport: http(rpcUrls(false)[0]) });
+
+ for (const t of txs) {
+ const hash = await wallet.sendTransaction({ to: lp, data: t.data });
+ const receipt = await client.waitForTransactionReceipt({ hash });
+ if (receipt.status !== 'success') throw new Error(`${t.token.symbol}: transaction ${hash} reverted`);
+ const [vq, enabled] = await client.readContract({ address: lp, abi: launchpadAbi, functionName: 'quoteConfig', args: [t.token.address] });
+ console.log(` sent ${t.token.symbol}: ${hash} (now ${enabled ? 'enabled' : 'disabled'}, reserve ${formatUnits(vq, t.token.decimals)})`);
+ }
+}
+
+main().then(
+ () => process.exit(0),
+ (err) => {
+ console.error(`paired:quotes: ${err.message}`);
+ process.exit(1);
+ },
+);
diff --git a/src/agent-detail.js b/src/agent-detail.js
index d19d914db..2e0703b9b 100644
--- a/src/agent-detail.js
+++ b/src/agent-detail.js
@@ -549,6 +549,27 @@ function launchTimeAgo(iso) {
return new Date(t).toLocaleDateString(undefined, { month: 'short', day: 'numeric' });
}
+// A coin the agent launched on Robinhood Chain (through Pons). There is no
+// pump.fun market to stream, so the row names the chain and venue and opens
+// the on-platform Robinhood coin page, which reads the chain directly.
+function robinhoodLaunchRow(coin) {
+ const venue = coin.venue === 'pons' ? 'Pons' : coin.venue || 'launchpad';
+ const label = coin.symbol ? `$${coin.symbol}` : coin.name || 'coin';
+ return el(
+ 'a',
+ {
+ class: 'ad-launch-row',
+ href: `/markets/robinhood/coin/${coin.mint}`,
+ 'aria-label': `${label} on Robinhood Chain`,
+ },
+ [
+ el('span', { class: 'ad-launch-symbol', text: label }),
+ el('span', { class: 'ad-launch-mint', text: `Robinhood Chain · ${venue}` }),
+ el('span', { class: 'ad-launch-time', text: coin.created_at ? launchTimeAgo(coin.created_at) : '' }),
+ ],
+ );
+}
+
export async function renderLaunchHistory(container, agent) {
if (!agent.id) return;
let coins = [];
@@ -584,6 +605,10 @@ export async function renderLaunchHistory(container, agent) {
el('div', { class: 'ad-launch-history-head', text: `Launched coins (${coins.length})` }),
);
for (const coin of coins) {
+ if (coin.chain === 'robinhood') {
+ box.appendChild(robinhoodLaunchRow(coin));
+ continue;
+ }
const isDevnet = coin.network === 'devnet';
// Keep traders on-platform: each launched coin links to its three.ws
// coin profile (/launches/<mint>), matching the launches-feed cards.
diff --git a/src/agent-skills-paired.js b/src/agent-skills-paired.js
new file mode 100644
index 000000000..cc0cfaee1
--- /dev/null
+++ b/src/agent-skills-paired.js
@@ -0,0 +1,180 @@
+/**
+ * Paired-coin skills: the agent launches a coin on Robinhood Chain that trades
+ * against up to five assets at once (tokenized stocks, WETH, stablecoins, chain
+ * coins), signed by its own custodial EVM wallet, and collects the swap fees it
+ * earns as the creator.
+ *
+ * Quote first, always. Without `confirm: true` the launch skill only prices it
+ * (launch fee, gas, opening buy, USD total, each pool's opening value) and
+ * lists anything blocking it, such as an unfunded wallet, so the agent can show
+ * its owner the cost before any money moves. Sending the same arguments again
+ * with `confirm: true` launches.
+ *
+ * The server checks ownership, the signer mode, the real-funds agreement and
+ * the agent's spend policy; this file holds no keys. See docs/paired-coins.md.
+ */
+
+const ENDPOINT = (id, leaf) => `/api/agents/${encodeURIComponent(id)}/paired/${leaf}`;
+
+async function call(url, body) {
+ const res = await fetch(url, {
+ method: body === undefined ? 'GET' : 'POST',
+ credentials: 'include',
+ headers: body === undefined ? {} : { 'content-type': 'application/json' },
+ body: body === undefined ? undefined : JSON.stringify(body),
+ });
+ const data = await res.json().catch(() => ({}));
+ if (!res.ok) {
+ const err = new Error(data?.error_description || `${url} returned ${res.status}`);
+ err.status = res.status;
+ err.code = data?.error;
+ throw err;
+ }
+ return data?.data || data;
+}
+
+function tickerFrom(name) {
+ return String(name || 'AGENT').toUpperCase().replace(/[^A-Z0-9]/g, '').slice(0, 10) || 'AGENT';
+}
+
+function list(value) {
+ if (Array.isArray(value)) return value.map((v) => String(v).trim()).filter(Boolean);
+ return String(value || '').split(',').map((v) => v.trim()).filter(Boolean);
+}
+
+/** The request body quote and launch both take, from skill args and the agent's identity. */
+export function pairedLaunchBody(args, identity) {
+ const name = String(args.name || identity?.name || '').trim();
+ const weights = list(args.weights).map(Number);
+ const body = {
+ name,
+ symbol: String(args.symbol || tickerFrom(name)).replace(/^\$/, ''),
+ description: args.description || identity?.description || undefined,
+ image_url: args.image_url || undefined,
+ socials: args.socials || undefined,
+ markets: list(args.markets),
+ weights: weights.length ? weights : undefined,
+ };
+ if (args.buy_amount != null && Number(args.buy_amount) > 0) {
+ body.dev_buy = { market: args.buy_market || undefined, amount: String(args.buy_amount) };
+ }
+ return body;
+}
+
+const usd = (n) => `$${Number(n).toLocaleString('en-US', { maximumFractionDigits: 0 })}`;
+
+/** One-line human summary of a quote, for the agent to say before launching. */
+export function describePairedQuote(q) {
+ const pairs = q.pairs.map((p) => `${p.symbol} ${p.weight_pct}%`).join(', ');
+ const cost = `${q.cost.total_eth} ETH${q.cost.total_usd != null ? ` (about $${q.cost.total_usd})` : ''}`;
+ const buy = q.opening_buy
+ ? ` plus a ${q.opening_buy.amount} ${q.opening_buy.market} opening buy for ${Number(q.opening_buy.tokens).toLocaleString('en-US', { maximumFractionDigits: 0 })} $${q.coin.symbol} (${q.opening_buy.pct_of_supply}% of supply)`
+ : '';
+ const opening = q.pairs.every((p) => p.opening_value_usd != null)
+ ? ` It opens at about ${usd(q.pairs.reduce((s, p) => s + p.opening_value_usd, 0))} across its pools.`
+ : '';
+ const head = `Launching $${q.coin.symbol} on Robinhood Chain paired with ${pairs} costs ${cost}${buy}.${opening}`;
+ return q.ready ? `${head} Confirm to launch.` : `${head} Not ready yet: ${q.blockers.join(' ')}`;
+}
+
+/**
+ * @param {import('./agent-skills.js').AgentSkills} skills
+ */
+export function registerPairedSkills(skills) {
+ skills.register({
+ name: 'paired-launch',
+ description:
+ "Launch a coin on Robinhood Chain paired with up to five assets at once (stocks like NVDA, WETH, stablecoins, chain coins), signed by the agent's own EVM wallet. Quotes first; pass confirm: true to launch.",
+ instruction:
+ 'Call without confirm to get the cost, pools and blockers, tell the owner, then call again with the same arguments and confirm: true. Never invent markets: list them with paired-markets first if unsure.',
+ animationHint: 'celebrate',
+ voicePattern: 'Launching {{symbol}} on Robinhood Chain…',
+ mcpExposed: true,
+ inputSchema: {
+ type: 'object',
+ required: ['markets'],
+ properties: {
+ markets: {
+ type: 'array',
+ items: { type: 'string' },
+ minItems: 1,
+ maxItems: 5,
+ description: 'What the coin pairs with: tickers like NVDA, WETH, USDG, or 0x quote addresses.',
+ },
+ weights: {
+ type: 'array',
+ items: { type: 'number' },
+ description: 'Percent of supply per market, same order, totalling 100. Omit for an even split.',
+ },
+ name: { type: 'string', maxLength: 32, description: "Coin name. Defaults to the agent's name." },
+ symbol: { type: 'string', maxLength: 10, description: 'Ticker, letters and digits.' },
+ description: { type: 'string', maxLength: 480 },
+ image_url: { type: 'string', description: "https:// logo. Defaults to the agent's public avatar." },
+ socials: {
+ type: 'object',
+ properties: { website: { type: 'string' }, twitter: { type: 'string' }, telegram: { type: 'string' } },
+ },
+ buy_amount: { type: 'string', description: 'Optional opening buy, in units of buy_market, settled in the launch transaction.' },
+ buy_market: { type: 'string', description: 'Which of the markets the opening buy spends. Defaults to the first.' },
+ confirm: { type: 'boolean', description: 'true launches; omitted or false only quotes.' },
+ },
+ },
+ handler: async (args, ctx) => {
+ const id = ctx?.identity?.id;
+ if (!id) throw new Error('No agent identity in context.');
+ const body = pairedLaunchBody(args, ctx.identity);
+ if (args.confirm !== true) {
+ const quote = await call(ENDPOINT(id, 'quote'), body);
+ return { success: true, output: describePairedQuote(quote), sentiment: 0.3, data: { quote, confirmed: false } };
+ }
+ const launched = await call(ENDPOINT(id, 'launch'), body);
+ return {
+ success: true,
+ output: `Launched $${launched.symbol} on Robinhood Chain, paired with ${launched.pairs.map((p) => p.symbol).join(', ')}. Token ${launched.token}.`,
+ sentiment: 0.9,
+ data: { ...launched, confirmed: true },
+ };
+ },
+ });
+
+ skills.register({
+ name: 'paired-markets',
+ description: 'List every asset a paired coin on Robinhood Chain can trade against, with its class, USD price and opening value.',
+ instruction: 'Use before paired-launch when the owner has not named exact markets.',
+ mcpExposed: true,
+ inputSchema: { type: 'object', properties: {} },
+ handler: async () => {
+ const data = await call('/api/v1/robinhood/paired-markets');
+ const byClass = {};
+ for (const m of data.markets) (byClass[m.classLabel] ||= []).push(m.symbol);
+ const summary = Object.entries(byClass).map(([k, v]) => `${k}: ${v.join(', ')}`).join('. ');
+ return { success: true, output: `${data.markets.length} markets. ${summary}.`, sentiment: 0.2, data };
+ },
+ });
+
+ skills.register({
+ name: 'paired-fees',
+ description: 'Show, and with claim: true collect, the swap fees the agent has earned from paired coins it launched.',
+ instruction: 'Without claim this only reads. Claiming moves fees into the agent wallet and costs a little ETH gas.',
+ mcpExposed: true,
+ inputSchema: { type: 'object', properties: { claim: { type: 'boolean' } } },
+ handler: async (args, ctx) => {
+ const id = ctx?.identity?.id;
+ if (!id) throw new Error('No agent identity in context.');
+ if (args.claim === true) {
+ const done = await call(ENDPOINT(id, 'claim'), {});
+ return {
+ success: true,
+ output: `Claimed ${done.claimed.map((c) => `${c.amount} ${c.symbol}`).join(', ')}.`,
+ sentiment: 0.8,
+ data: done,
+ };
+ }
+ const fees = await call(ENDPOINT(id, 'fees'));
+ const text = fees.claimable.length
+ ? `Claimable: ${fees.claimable.map((c) => `${c.amount} ${c.symbol}`).join(', ')}.`
+ : 'No paired-coin fees to claim yet.';
+ return { success: true, output: text, sentiment: 0.3, data: fees };
+ },
+ });
+}
diff --git a/src/agent-skills-pons.js b/src/agent-skills-pons.js
new file mode 100644
index 000000000..884b1ed0a
--- /dev/null
+++ b/src/agent-skills-pons.js
@@ -0,0 +1,116 @@
+/**
+ * Pons launch skill: the agent launches a coin on Robinhood Chain from its own
+ * custodial EVM wallet, through the Pons V2 launchpad (ponsfamily.com).
+ *
+ * Quote first, always. Without `confirm: true` the skill only prices the
+ * launch (launch fee, opening buy, gas, USD total, the tokens the opening buy
+ * receives) and lists anything blocking it, such as an unfunded wallet, so
+ * the agent can show its owner the cost before any money moves. Sending the
+ * same arguments again with `confirm: true` launches.
+ *
+ * The server checks ownership, the signer mode, the real-funds agreement and
+ * the agent's spend policy; this file holds no keys. See docs/pons-launch.md.
+ */
+
+const ENDPOINT = (id, leaf) => `/api/agents/${encodeURIComponent(id)}/pons/${leaf}`;
+
+async function postJson(url, body) {
+ const res = await fetch(url, {
+ method: 'POST',
+ credentials: 'include',
+ headers: { 'content-type': 'application/json' },
+ body: JSON.stringify(body || {}),
+ });
+ const data = await res.json().catch(() => ({}));
+ if (!res.ok) {
+ const err = new Error(data?.error_description || `${url} returned ${res.status}`);
+ err.status = res.status;
+ err.code = data?.error;
+ throw err;
+ }
+ return data?.data || data;
+}
+
+function tickerFrom(name) {
+ return String(name || 'AGENT').toUpperCase().replace(/[^A-Z0-9]/g, '').slice(0, 10) || 'AGENT';
+}
+
+/** The request body both endpoints take, from skill args and the agent's identity. */
+export function ponsLaunchBody(args, identity) {
+ const name = String(args.name || identity?.name || '').trim();
+ return {
+ name,
+ symbol: String(args.symbol || tickerFrom(name)).replace(/^\$/, ''),
+ description: args.description || identity?.description || undefined,
+ image_url: args.image_url || undefined,
+ socials: args.socials || undefined,
+ buy_eth: Number(args.buy_eth || 0),
+ creator_tax_bps: Number(args.creator_tax_bps || 0),
+ buyback: Boolean(args.buyback),
+ };
+}
+
+/** One-line human summary of a quote, for the agent to say before launching. */
+export function describePonsQuote(q) {
+ const cost = `${q.cost.total_eth} ETH${q.cost.total_usd != null ? ` (about $${q.cost.total_usd})` : ''}`;
+ const buy = Number(q.cost.opening_buy_eth) > 0
+ ? ` including a ${q.cost.opening_buy_eth} ETH opening buy for ${Number(q.opening_buy.tokens).toLocaleString('en-US', { maximumFractionDigits: 0 })} $${q.coin.symbol} (${q.opening_buy.pct_of_supply}% of supply)`
+ : '';
+ const head = `Launching $${q.coin.symbol} on Pons (Robinhood Chain) costs ${cost}${buy}.`;
+ return q.ready ? `${head} Confirm to launch.` : `${head} Not ready yet: ${q.blockers.join(' ')}`;
+}
+
+/**
+ * @param {import('./agent-skills.js').AgentSkills} skills
+ */
+export function registerPonsSkills(skills) {
+ skills.register({
+ name: 'pons-launch',
+ description:
+ "Launch a coin on Robinhood Chain through the Pons launchpad, signed by the agent's own EVM wallet. Quotes first; pass confirm: true to launch.",
+ instruction:
+ 'Call without confirm to get the cost and blockers, tell the owner, then call again with the same arguments and confirm: true.',
+ animationHint: 'celebrate',
+ voicePattern: 'Launching {{symbol}} on Robinhood Chain…',
+ mcpExposed: true,
+ inputSchema: {
+ type: 'object',
+ properties: {
+ name: { type: 'string', maxLength: 64, description: "Coin name. Defaults to the agent's name." },
+ symbol: { type: 'string', maxLength: 16, description: 'Ticker, letters and digits.' },
+ description: { type: 'string', maxLength: 2048 },
+ image_url: { type: 'string', description: "https:// or ipfs:// logo. Defaults to the agent's public avatar." },
+ socials: {
+ type: 'object',
+ properties: {
+ twitter: { type: 'string' },
+ telegram: { type: 'string' },
+ discord: { type: 'string' },
+ website: { type: 'string' },
+ farcaster: { type: 'string' },
+ },
+ },
+ buy_eth: { type: 'number', minimum: 0, maximum: 4, description: 'Opening buy in ETH, settled in the launch transaction.' },
+ creator_tax_bps: { type: 'integer', minimum: 0, maximum: 1000, description: 'Extra trade tax paid to the agent, in basis points.' },
+ buyback: { type: 'boolean', description: 'Route the buyback share of fees into a five-year locked buyback.' },
+ confirm: { type: 'boolean', description: 'true launches; omitted or false only quotes.' },
+ },
+ },
+ handler: async (args, ctx) => {
+ const id = ctx?.identity?.id;
+ if (!id) throw new Error('No agent identity in context.');
+ const body = ponsLaunchBody(args, ctx.identity);
+ if (args.confirm !== true) {
+ const quote = await postJson(ENDPOINT(id, 'quote'), body);
+ return { success: true, output: describePonsQuote(quote), sentiment: 0.3, data: { quote, confirmed: false } };
+ }
+ const launched = await postJson(ENDPOINT(id, 'launch'), body);
+ return {
+ success: true,
+ output: `Launched $${launched.symbol} on Robinhood Chain. Token ${launched.token}.`,
+ sentiment: 0.9,
+ data: { ...launched, confirmed: true },
+ };
+ },
+ });
+}
diff --git a/src/agent-skills.js b/src/agent-skills.js
index 94c44292c..496d187a8 100644
--- a/src/agent-skills.js
+++ b/src/agent-skills.js
@@ -25,6 +25,8 @@ import { registerSentimentSkills } from './agent-skills-sentiment.js';
import { registerAgentPaymentSkills } from './agent-skills-agent-payments.js';
import { registerA2APaymentSkills } from './agent-skills-a2a.js';
import { registerAixbtSkills } from './agent-skills-aixbt.js';
+import { registerPonsSkills } from './agent-skills-pons.js';
+import { registerPairedSkills } from './agent-skills-paired.js';
/**
* @typedef {Object} SkillContext
@@ -79,6 +81,8 @@ export class AgentSkills {
registerAgentPaymentSkills(this);
registerA2APaymentSkills(this);
registerAixbtSkills(this);
+ registerPonsSkills(this);
+ registerPairedSkills(this);
}
// ── Registry ──────────────────────────────────────────────────────────────
diff --git a/src/launch-robinhood/page.css b/src/launch-robinhood/page.css
new file mode 100644
index 000000000..098796dd2
--- /dev/null
+++ b/src/launch-robinhood/page.css
@@ -0,0 +1,525 @@
+/* /launch/robinhood: launch an agent's coin on Pons. Built on public/tokens.css
+ so it follows the light/dark theme. */
+
+.lr {
+ --lr-accent: #c4f07a;
+ --lr-accent-ink: #1a2a06;
+ --lr-accent-soft: rgba(196, 240, 122, 0.1);
+ --lr-accent-stroke: rgba(196, 240, 122, 0.36);
+ --lr-field: rgba(255, 255, 255, 0.035);
+ --lr-field-focus: rgba(255, 255, 255, 0.065);
+ width: 100%;
+ max-width: 1080px;
+ margin: 0 auto;
+ padding: 28px 20px 96px;
+ box-sizing: border-box;
+ color: var(--ink);
+ font-family: var(--font-body);
+}
+:root[data-theme='light'] .lr {
+ --lr-accent: #3f6212;
+ --lr-accent-ink: #ffffff;
+ --lr-accent-soft: rgba(63, 98, 18, 0.08);
+ --lr-accent-stroke: rgba(63, 98, 18, 0.35);
+ --lr-field: rgba(15, 18, 28, 0.03);
+ --lr-field-focus: rgba(15, 18, 28, 0.06);
+}
+.lr *,
+.lr *::before,
+.lr *::after {
+ box-sizing: border-box;
+}
+
+.lr-head {
+ margin-bottom: 24px;
+ max-width: 720px;
+}
+.lr-eyebrow {
+ display: inline-flex;
+ align-items: center;
+ gap: 8px;
+ margin: 0 0 10px;
+ font: 600 11px/1 var(--font-mono);
+ letter-spacing: 0.08em;
+ text-transform: uppercase;
+ color: var(--ink-dim);
+}
+.lr-dot {
+ width: 7px;
+ height: 7px;
+ border-radius: 50%;
+ background: var(--lr-accent);
+ box-shadow: 0 0 10px var(--lr-accent);
+}
+.lr-head h1 {
+ margin: 0 0 10px;
+ font: 700 clamp(26px, 4vw, 38px) / 1.1 var(--font-display);
+ letter-spacing: -0.02em;
+}
+.lr-sub {
+ margin: 0;
+ color: var(--ink-dim);
+ line-height: var(--leading-normal);
+}
+.lr-sub a,
+.lr-bots a {
+ color: var(--lr-accent);
+ text-underline-offset: 3px;
+}
+
+.lr-grid {
+ display: grid;
+ grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
+ gap: 20px;
+ align-items: start;
+}
+.lr-side {
+ position: sticky;
+ top: calc(var(--header-h, 64px) + 16px);
+}
+@media (max-width: 860px) {
+ .lr-grid {
+ grid-template-columns: minmax(0, 1fr);
+ }
+ .lr-side {
+ position: static;
+ }
+}
+
+.lr-card {
+ min-width: 0;
+ background: var(--surface-1);
+ border: 1px solid var(--stroke);
+ border-radius: var(--radius-card);
+ padding: 22px;
+ animation: lr-in var(--duration-slow) var(--ease-out) both;
+}
+@keyframes lr-in {
+ from {
+ opacity: 0;
+ transform: translateY(6px);
+ }
+}
+@media (prefers-reduced-motion: reduce) {
+ .lr-card {
+ animation: none;
+ }
+}
+.lr-card h2 {
+ margin: 0 0 14px;
+ font: 600 17px/1.3 var(--font-display);
+}
+
+.lr-form {
+ display: flex;
+ flex-direction: column;
+ gap: 16px;
+}
+.lr-row {
+ display: flex;
+ gap: 14px;
+ flex-wrap: wrap;
+}
+.lr-grow {
+ flex: 1 1 220px;
+}
+.lr-ticker {
+ flex: 0 1 150px;
+}
+.lr-tax {
+ flex: 0 1 170px;
+}
+.lr-field {
+ display: flex;
+ flex-direction: column;
+ gap: 6px;
+ min-width: 0;
+}
+.lr-field > span,
+.lr-socials legend {
+ font-size: 12.5px;
+ font-weight: 600;
+ color: var(--ink-dim);
+}
+.lr-field em,
+.lr-socials em {
+ font-style: normal;
+ font-weight: 400;
+ color: var(--ink-faint);
+}
+.lr-field small {
+ font-size: 12px;
+ color: var(--ink-faint);
+ line-height: 1.4;
+}
+.lr-input {
+ width: 100%;
+ padding: 10px 12px;
+ border-radius: var(--radius-control);
+ border: 1px solid var(--stroke);
+ background: var(--lr-field);
+ color: var(--ink);
+ font: 400 14px/1.4 var(--font-body);
+ transition:
+ border-color var(--duration-fast),
+ background var(--duration-fast),
+ box-shadow var(--duration-fast);
+}
+.lr-input:hover {
+ border-color: var(--stroke-strong);
+}
+.lr-input:focus {
+ outline: none;
+ border-color: var(--lr-accent-stroke);
+ background: var(--lr-field-focus);
+ box-shadow: 0 0 0 3px var(--lr-accent-soft);
+}
+textarea.lr-input {
+ resize: vertical;
+}
+.lr-mono {
+ font-family: var(--font-mono);
+}
+.lr-unit {
+ position: relative;
+}
+.lr-unit .lr-input {
+ padding-right: 52px;
+}
+.lr-unit span {
+ position: absolute;
+ right: 12px;
+ top: 50%;
+ transform: translateY(-50%);
+ font: 600 12px/1 var(--font-mono);
+ color: var(--ink-faint);
+ pointer-events: none;
+}
+.lr-socials {
+ display: grid;
+ grid-template-columns: repeat(3, minmax(0, 1fr));
+ gap: 8px;
+ border: 0;
+ padding: 0;
+ margin: 0;
+}
+.lr-socials legend {
+ margin-bottom: 6px;
+ padding: 0;
+}
+@media (max-width: 560px) {
+ .lr-socials {
+ grid-template-columns: 1fr;
+ }
+}
+
+.lr-toggle {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: 16px;
+ padding: 12px 14px;
+ border: 1px solid var(--stroke);
+ border-radius: var(--radius-md);
+}
+.lr-toggle strong {
+ display: block;
+ font-size: 14px;
+}
+.lr-toggle span {
+ font-size: 12.5px;
+ color: var(--ink-dim);
+}
+.lr-switch {
+ flex-shrink: 0;
+ width: 44px;
+ height: 24px;
+ border-radius: var(--radius-pill);
+ border: 1px solid var(--stroke-strong);
+ background: var(--surface-3);
+ position: relative;
+ cursor: pointer;
+ transition: background var(--duration-fast);
+}
+.lr-switch::after {
+ content: '';
+ position: absolute;
+ top: 3px;
+ left: 3px;
+ width: 16px;
+ height: 16px;
+ border-radius: 50%;
+ background: var(--ink-dim);
+ transition:
+ transform var(--duration-base) var(--ease-standard),
+ background var(--duration-fast);
+}
+.lr-switch[aria-checked='true'] {
+ background: var(--lr-accent-soft);
+ border-color: var(--lr-accent-stroke);
+}
+.lr-switch[aria-checked='true']::after {
+ transform: translateX(20px);
+ background: var(--lr-accent);
+}
+.lr-switch:focus-visible,
+.lr-btn:focus-visible,
+.lr-copy:focus-visible {
+ outline: var(--focus-ring-width, 2px) solid var(--lr-accent);
+ outline-offset: 2px;
+}
+
+.lr-summary {
+ transition: opacity var(--duration-base);
+}
+.lr-summary.is-updating .lr-cost,
+.lr-summary.is-updating .lr-receive {
+ opacity: 0.55;
+}
+.lr-cost {
+ margin: 0 0 14px;
+ display: flex;
+ flex-direction: column;
+ gap: 8px;
+ transition: opacity var(--duration-base);
+}
+.lr-cost div {
+ display: flex;
+ justify-content: space-between;
+ gap: 12px;
+ font-size: 14px;
+}
+.lr-cost dt {
+ color: var(--ink-dim);
+}
+.lr-cost dd {
+ margin: 0;
+ text-align: right;
+}
+.lr-cost small {
+ display: block;
+ font-size: 12px;
+ color: var(--ink-faint);
+}
+.lr-total {
+ padding-top: 10px;
+ border-top: 1px solid var(--stroke);
+ font-weight: 600;
+}
+.lr-receive {
+ margin: 0 0 14px;
+ padding: 10px 12px;
+ border-radius: var(--radius-md);
+ background: var(--lr-accent-soft);
+ font-size: 13.5px;
+ transition: opacity var(--duration-base);
+}
+.lr-wallet {
+ margin-bottom: 14px;
+ padding: 12px;
+ border: 1px solid var(--stroke);
+ border-radius: var(--radius-md);
+}
+.lr-wallet-label {
+ display: block;
+ margin-bottom: 6px;
+ font-size: 12px;
+ color: var(--ink-dim);
+}
+.lr-wallet-row {
+ display: flex;
+ align-items: center;
+ gap: 8px;
+}
+.lr-wallet-row code {
+ font-size: 13px;
+}
+.lr-balance {
+ margin-left: auto;
+ font-size: 13px;
+ color: var(--ink-dim);
+}
+.lr-copy {
+ padding: 3px 9px;
+ border-radius: var(--radius-pill);
+ border: 1px solid var(--stroke);
+ background: transparent;
+ color: var(--ink-dim);
+ font-size: 12px;
+ cursor: pointer;
+ transition:
+ color var(--duration-fast),
+ border-color var(--duration-fast);
+}
+.lr-copy:hover {
+ color: var(--ink);
+ border-color: var(--stroke-strong);
+}
+.lr-copy.is-done {
+ color: var(--lr-accent);
+ border-color: var(--lr-accent-stroke);
+}
+.lr-blockers {
+ margin: 0 0 14px;
+ overflow-wrap: anywhere;
+ padding: 10px 12px 10px 28px;
+ border-radius: var(--radius-md);
+ background: color-mix(in srgb, var(--warn) 10%, transparent);
+ color: var(--ink);
+ font-size: 13px;
+ line-height: 1.45;
+}
+.lr-error {
+ color: var(--danger);
+ font-size: 14px;
+ line-height: 1.45;
+}
+.lr-muted,
+.lr-fine {
+ color: var(--ink-dim);
+ font-size: 13px;
+ line-height: 1.45;
+}
+.lr-fine {
+ margin: 12px 0 0;
+ font-size: 12px;
+ color: var(--ink-faint);
+}
+
+.lr-btn {
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ gap: 6px;
+ padding: 10px 16px;
+ border-radius: var(--radius-control);
+ border: 1px solid var(--stroke-strong);
+ background: transparent;
+ color: var(--ink);
+ font: 600 14px/1 var(--font-body);
+ text-decoration: none;
+ cursor: pointer;
+ transition:
+ background var(--duration-fast),
+ border-color var(--duration-fast),
+ transform var(--duration-fast),
+ opacity var(--duration-fast);
+}
+.lr-btn:hover {
+ background: var(--surface-2);
+}
+.lr-btn:active {
+ transform: translateY(1px);
+}
+.lr-btn-primary {
+ background: var(--lr-accent);
+ border-color: var(--lr-accent);
+ color: var(--lr-accent-ink);
+}
+.lr-btn-primary:hover {
+ background: var(--lr-accent);
+ filter: brightness(1.08);
+}
+.lr-btn:disabled {
+ opacity: var(--disabled-opacity, 0.45);
+ cursor: not-allowed;
+ transform: none;
+ filter: none;
+}
+.lr-launch {
+ width: 100%;
+ padding: 13px 16px;
+}
+.lr-launch.is-busy {
+ cursor: progress;
+}
+
+.lr-skel {
+ background: linear-gradient(90deg, var(--skeleton-base) 25%, var(--skeleton-sheen) 37%, var(--skeleton-base) 63%);
+ background-size: 400% 100%;
+ animation: lr-sheen 1.4s ease infinite;
+ border-radius: var(--skeleton-radius, 8px);
+}
+.lr-skel-line {
+ height: 16px;
+ margin-bottom: 12px;
+}
+@keyframes lr-sheen {
+ from {
+ background-position: 100% 50%;
+ }
+ to {
+ background-position: 0 50%;
+ }
+}
+
+.lr-empty,
+.lr-success {
+ max-width: 640px;
+}
+.lr-empty p,
+.lr-success p {
+ color: var(--ink-dim);
+ line-height: var(--leading-normal);
+}
+.lr-success h2 {
+ font-size: 24px;
+}
+.lr-token {
+ display: block;
+ margin: 14px 0 18px;
+ padding: 10px 12px;
+ border-radius: var(--radius-md);
+ background: var(--surface-2);
+ font-size: 13px;
+ overflow-wrap: anywhere;
+}
+.lr-actions {
+ display: flex;
+ flex-wrap: wrap;
+ gap: 10px;
+}
+
+.lr-bots {
+ margin-top: 20px;
+}
+.lr-bots p {
+ color: var(--ink-dim);
+ line-height: var(--leading-normal);
+ margin: 0 0 12px;
+}
+.lr-bots pre {
+ margin: 0 0 12px;
+ padding: 14px;
+ border-radius: var(--radius-md);
+ background: var(--surface-2);
+ font-size: 12.5px;
+ line-height: 1.55;
+ overflow-x: auto;
+}
+
+.lr-dialog {
+ width: min(440px, calc(100vw - 32px));
+ padding: 22px;
+ border-radius: var(--radius-card);
+ border: 1px solid var(--stroke-strong);
+ background: var(--surface-1);
+ color: var(--ink);
+ font-family: var(--font-body);
+}
+.lr-dialog::backdrop {
+ background: var(--scrim-modal, rgba(0, 0, 0, 0.6));
+}
+.lr-dialog h2 {
+ margin: 0 0 8px;
+ font: 600 19px/1.3 var(--font-display);
+}
+.lr-dialog p {
+ margin: 0 0 16px;
+ color: var(--ink-dim);
+ font-size: 14px;
+ line-height: 1.5;
+}
+.lr-dialog .lr-actions {
+ justify-content: flex-end;
+}
diff --git a/src/launch-robinhood/page.js b/src/launch-robinhood/page.js
new file mode 100644
index 000000000..3c0e29fcd
--- /dev/null
+++ b/src/launch-robinhood/page.js
@@ -0,0 +1,462 @@
+// /launch/robinhood: an owner launches a coin on Pons (Robinhood Chain) from
+// one of their agents' own EVM wallets.
+//
+// Data flow: GET /api/agents lists the owner's agents. Every form change is
+// debounced into POST /api/agents/:id/pons/quote, which reads the live Pons
+// terms, the agent wallet's balance and the spend policy, and returns the
+// exact cost and anything blocking the launch. Launch confirms the quoted
+// amount in a dialog, then POSTs the identical body to /pons/launch, which
+// signs with the agent's custodial key and answers with the landed token.
+// Nothing is estimated here: every number on screen came from that quote.
+
+import './page.css';
+import { ensureRiskAck } from '../shared/risk-ack.js';
+
+const $ = (s, r = document) => r.querySelector(s);
+const esc = (v) =>
+ String(v ?? '').replace(/[&<>"']/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' })[c]);
+const short = (a) => (a ? `${a.slice(0, 6)}…${a.slice(-4)}` : '');
+const fmtEth = (v) => {
+ const n = Number(v);
+ if (!Number.isFinite(n)) return '0';
+ if (n === 0) return '0';
+ return n < 0.0001 ? n.toExponential(2) : n.toLocaleString('en-US', { maximumFractionDigits: 6 });
+};
+const fmtTokens = (v) => Number(v || 0).toLocaleString('en-US', { maximumFractionDigits: 0 });
+
+const state = {
+ user: undefined,
+ agents: null,
+ agentsError: '',
+ form: {
+ agentId: '',
+ name: '',
+ symbol: '',
+ symbolTouched: false,
+ description: '',
+ image: '',
+ twitter: '',
+ telegram: '',
+ website: '',
+ buyEth: '',
+ taxPct: '0',
+ buyback: false,
+ },
+ quote: null,
+ quoteError: '',
+ quoting: false,
+ quoteSeq: 0,
+ launching: false,
+ launched: null,
+};
+
+async function api(path, { method = 'GET', body } = {}) {
+ const res = await fetch(path, {
+ method,
+ credentials: 'include',
+ headers: body ? { 'content-type': 'application/json' } : { accept: 'application/json' },
+ body: body ? JSON.stringify(body) : undefined,
+ });
+ const data = await res.json().catch(() => ({}));
+ if (!res.ok) {
+ throw Object.assign(new Error(data?.error_description || data?.error || `Request failed (${res.status})`), {
+ code: data?.error,
+ status: res.status,
+ detail: data?.detail,
+ });
+ }
+ return data;
+}
+
+const selectedAgent = () => state.agents?.find((a) => a.id === state.form.agentId) || null;
+
+function suggestSymbol(name) {
+ return String(name || '').toUpperCase().replace(/[^A-Z0-9]/g, '').slice(0, 10);
+}
+
+/** The request body both /quote and /launch take, built only from the form. */
+function requestBody() {
+ const f = state.form;
+ const socials = {};
+ if (f.twitter.trim()) socials.twitter = f.twitter.trim();
+ if (f.telegram.trim()) socials.telegram = f.telegram.trim();
+ if (f.website.trim()) socials.website = f.website.trim();
+ const body = {
+ name: f.name.trim(),
+ symbol: f.symbol.trim(),
+ buy_eth: Math.max(0, Number(f.buyEth) || 0),
+ creator_tax_bps: Math.round(Math.min(10, Math.max(0, Number(f.taxPct) || 0)) * 100),
+ buyback: f.buyback,
+ };
+ if (f.description.trim()) body.description = f.description.trim();
+ if (f.image.trim()) body.image_url = f.image.trim();
+ if (Object.keys(socials).length) body.socials = socials;
+ return body;
+}
+
+// ── Boot ───────────────────────────────────────────────────────────────────
+
+async function boot() {
+ const params = new URL(location.href).searchParams;
+ state.form.name = (params.get('name') || '').slice(0, 64);
+ if (params.get('symbol')) {
+ state.form.symbol = suggestSymbol(params.get('symbol'));
+ state.form.symbolTouched = true;
+ } else state.form.symbol = suggestSymbol(state.form.name);
+ render();
+ try {
+ const me = await fetch('/api/auth/me', { credentials: 'include' });
+ state.user = me.ok ? (await me.json()).user || null : null;
+ if (state.user) {
+ const { agents = [] } = await api('/api/agents');
+ state.agents = agents;
+ const wanted = params.get('agent');
+ state.form.agentId = (agents.find((a) => a.id === wanted) || agents[0])?.id || '';
+ } else state.agents = [];
+ } catch (err) {
+ state.agentsError = /failed to fetch/i.test(err.message) ? 'three.ws could not be reached.' : err.message;
+ state.agents = [];
+ }
+ render();
+ scheduleQuote(0);
+}
+
+// ── Rendering ──────────────────────────────────────────────────────────────
+
+function render() {
+ const root = $('#lr-app');
+ if (state.agents === null) {
+ root.innerHTML = `<div class="lr-grid"><div class="lr-card lr-skel" style="height:520px"></div><div class="lr-card lr-skel" style="height:360px"></div></div>`;
+ return;
+ }
+ if (state.agentsError) {
+ root.innerHTML = emptyCard('Could not load your agents', esc(state.agentsError), '<button type="button" class="lr-btn" id="lr-retry">Try again</button>');
+ $('#lr-retry').addEventListener('click', () => location.reload());
+ return;
+ }
+ if (!state.user) {
+ const next = encodeURIComponent(location.pathname + location.search);
+ root.innerHTML = emptyCard(
+ 'Sign in to launch',
+ 'Your agent signs the launch with its own wallet, so you need to be signed in as its owner.',
+ `<a class="lr-btn lr-btn-primary" href="/login?next=${next}">Sign in</a>`,
+ ) + botsCard();
+ return;
+ }
+ if (!state.agents.length) {
+ root.innerHTML = emptyCard(
+ 'Create an agent first',
+ 'Coins launch from an agent\'s own wallet. Create a 3D agent and it gets a wallet that works on Robinhood Chain.',
+ '<a class="lr-btn lr-btn-primary" href="/create">Create an agent</a>',
+ ) + botsCard();
+ return;
+ }
+ if (state.launched) {
+ root.innerHTML = successCard(state.launched) + botsCard();
+ $('#lr-again').addEventListener('click', () => {
+ state.launched = null;
+ state.form.name = '';
+ state.form.symbol = '';
+ state.form.symbolTouched = false;
+ render();
+ scheduleQuote(0);
+ });
+ return;
+ }
+ root.innerHTML = `<div class="lr-grid">${formCard()}<aside class="lr-side">${summaryCard()}</aside></div>${botsCard()}`;
+ wireForm();
+}
+
+function emptyCard(title, text, action) {
+ return `<section class="lr-card lr-empty"><h2>${esc(title)}</h2><p>${text}</p><div>${action}</div></section>`;
+}
+
+function formCard() {
+ const f = state.form;
+ const agent = selectedAgent();
+ const options = state.agents
+ .map((a) => `<option value="${esc(a.id)}" ${a.id === f.agentId ? 'selected' : ''}>${esc(a.name || 'Agent')}</option>`)
+ .join('');
+ const logoHint = agent?.avatar_thumbnail_url
+ ? "Leave empty to use your agent's avatar."
+ : 'An https:// or ipfs:// image. Your agent\'s avatar is private, so add one here.';
+ return `
+ <form class="lr-card lr-form" id="lr-form" novalidate>
+ <label class="lr-field"><span>Agent</span>
+ <select class="lr-input" id="f-agent" name="agent">${options}</select>
+ </label>
+ <div class="lr-row">
+ <label class="lr-field lr-grow"><span>Coin name</span>
+ <input class="lr-input" id="f-name" maxlength="64" autocomplete="off" placeholder="${esc(agent?.name || 'My agent coin')}" value="${esc(f.name)}" required />
+ </label>
+ <label class="lr-field lr-ticker"><span>Ticker</span>
+ <input class="lr-input lr-mono" id="f-symbol" maxlength="16" autocomplete="off" placeholder="TICKER" value="${esc(f.symbol)}" required />
+ </label>
+ </div>
+ <label class="lr-field"><span>Description <em>optional</em></span>
+ <textarea class="lr-input" id="f-description" maxlength="2048" rows="3" placeholder="What is this coin about?">${esc(f.description)}</textarea>
+ </label>
+ <label class="lr-field"><span>Logo URL <em>optional</em></span>
+ <input class="lr-input" id="f-image" type="url" inputmode="url" maxlength="512" placeholder="https://" value="${esc(f.image)}" />
+ <small>${esc(logoHint)}</small>
+ </label>
+ <fieldset class="lr-socials"><legend>Links <em>optional</em></legend>
+ <input class="lr-input" id="f-twitter" type="url" inputmode="url" maxlength="256" placeholder="https://x.com/…" aria-label="X link" value="${esc(f.twitter)}" />
+ <input class="lr-input" id="f-telegram" type="url" inputmode="url" maxlength="256" placeholder="https://t.me/…" aria-label="Telegram link" value="${esc(f.telegram)}" />
+ <input class="lr-input" id="f-website" type="url" inputmode="url" maxlength="256" placeholder="https://your-site" aria-label="Website" value="${esc(f.website)}" />
+ </fieldset>
+ <div class="lr-row">
+ <label class="lr-field lr-grow"><span>Opening buy</span>
+ <div class="lr-unit"><input class="lr-input lr-mono" id="f-buy" inputmode="decimal" autocomplete="off" placeholder="0.0" value="${esc(f.buyEth)}" /><span>ETH</span></div>
+ <small>Bought in the launch transaction itself, before anyone else can trade.</small>
+ </label>
+ <label class="lr-field lr-tax"><span>Creator tax</span>
+ <div class="lr-unit"><input class="lr-input lr-mono" id="f-tax" inputmode="decimal" autocomplete="off" value="${esc(f.taxPct)}" /><span>%</span></div>
+ <small>Paid to your agent on every trade. Max 10%.</small>
+ </label>
+ </div>
+ <div class="lr-toggle">
+ <div><strong>Buyback and lock</strong><span>Route the buyback share of trading fees into a five-year locked buyback of your coin.</span></div>
+ <button type="button" class="lr-switch" role="switch" id="f-buyback" aria-checked="${f.buyback}" aria-label="Buyback and lock"></button>
+ </div>
+ </form>`;
+}
+
+function summaryCard() {
+ const q = state.quote;
+ if (state.quoteError) {
+ return `<section class="lr-card lr-summary"><h2>Cost</h2><p class="lr-error" role="alert">${esc(state.quoteError)}</p>
+ <button type="button" class="lr-btn" id="lr-requote">Try again</button></section>`;
+ }
+ if (!q) {
+ return `<section class="lr-card lr-summary"><h2>Cost</h2>
+ ${state.quoting ? '<div class="lr-skel lr-skel-line"></div><div class="lr-skel lr-skel-line"></div><div class="lr-skel lr-skel-line"></div>' : '<p class="lr-muted">Name the coin and pick a ticker to see the live cost.</p>'}
+ <button type="button" class="lr-btn lr-btn-primary lr-launch" disabled>Launch on Pons</button></section>`;
+ }
+ const rows = [
+ ['Pons launch fee', `${fmtEth(q.cost.launch_fee_eth)} ETH`],
+ ['Opening buy', `${fmtEth(q.cost.opening_buy_eth)} ETH`],
+ [q.cost.gas_estimated ? 'Network gas' : 'Network gas (typical)', `${fmtEth(q.cost.gas_eth)} ETH`],
+ ];
+ const blockers = q.blockers.length
+ ? `<ul class="lr-blockers" role="alert">${q.blockers.map((b) => `<li>${esc(b)}</li>`).join('')}</ul>`
+ : '';
+ return `
+ <section class="lr-card lr-summary${state.quoting ? ' is-updating' : ''}">
+ <h2>Cost</h2>
+ <dl class="lr-cost">
+ ${rows.map(([k, v]) => `<div><dt>${esc(k)}</dt><dd class="lr-mono">${esc(v)}</dd></div>`).join('')}
+ <div class="lr-total"><dt>Total</dt><dd class="lr-mono">${esc(fmtEth(q.cost.total_eth))} ETH${q.cost.total_usd != null ? `<small>≈ $${esc(q.cost.total_usd.toLocaleString('en-US'))}</small>` : ''}</dd></div>
+ </dl>
+ ${Number(q.cost.opening_buy_eth) > 0 ? `<p class="lr-receive">Your agent receives <strong class="lr-mono">${esc(fmtTokens(q.opening_buy.tokens))} $${esc(q.coin.symbol)}</strong>, ${esc(q.opening_buy.pct_of_supply)}% of supply.</p>` : ''}
+ <div class="lr-wallet">
+ <span class="lr-wallet-label">${esc(q.agent.name || 'Agent')} wallet on Robinhood Chain</span>
+ <div class="lr-wallet-row">
+ <code class="lr-mono" title="${esc(q.wallet.address)}">${esc(short(q.wallet.address))}</code>
+ <button type="button" class="lr-copy" id="lr-copy" data-copy="${esc(q.wallet.address)}" aria-label="Copy wallet address">Copy</button>
+ <span class="lr-balance lr-mono">${esc(fmtEth(q.wallet.balance_eth))} ETH</span>
+ </div>
+ </div>
+ ${blockers}
+ <button type="button" class="lr-btn lr-btn-primary lr-launch" id="lr-launch" ${q.ready && !state.quoting ? '' : 'disabled'}>Launch on Pons</button>
+ <p class="lr-fine">Fees: ${esc(q.terms.curve_fee_bps / 100)}% per trade on the curve, plus your creator tax. Graduates at ${esc(q.terms.graduation_threshold_eth)} ETH raised.</p>
+ </section>`;
+}
+
+function successCard(r) {
+ return `
+ <section class="lr-card lr-success">
+ <p class="lr-eyebrow"><span class="lr-dot" aria-hidden="true"></span>Live on Robinhood Chain</p>
+ <h2>$${esc(r.symbol)} is trading</h2>
+ <p>${esc(r.name)} launched from your agent's wallet in block ${esc(r.block.toLocaleString('en-US'))}.${r.opening_buy ? ` The opening buy of ${esc(fmtEth(r.opening_buy.eth))} ETH bought ${esc(fmtTokens(r.opening_buy.tokens))} $${esc(r.symbol)}.` : ''}</p>
+ <code class="lr-mono lr-token">${esc(r.token)}</code>
+ <div class="lr-actions">
+ <a class="lr-btn lr-btn-primary" href="${esc(r.urls.pons)}" target="_blank" rel="noopener noreferrer">Trade on Pons ↗</a>
+ <a class="lr-btn" href="${esc(r.urls.coin)}">Coin page</a>
+ <a class="lr-btn" href="${esc(r.urls.explorer)}" target="_blank" rel="noopener noreferrer">Transaction ↗</a>
+ <button type="button" class="lr-btn" id="lr-again">Launch another</button>
+ </div>
+ </section>`;
+}
+
+function botsCard() {
+ const id = state.form.agentId || '<agent-id>';
+ return `
+ <section class="lr-card lr-bots">
+ <h2>Let your bots launch</h2>
+ <p>The same launch is one API call, so a bot can quote, check with you, and launch. Use an API key with spend permission, or give your agent the <code>pons-launch</code> skill.</p>
+ <pre class="lr-mono"><code>curl -X POST https://three.ws/api/agents/${esc(id)}/pons/quote \\
+ -H "authorization: Bearer $THREEWS_API_KEY" \\
+ -H "content-type: application/json" \\
+ -d '{"name":"My Coin","symbol":"MINE","buy_eth":0.01}'
+
+# Same body to /pons/launch sends it.</code></pre>
+ <a href="/docs/pons-launch">Read the Pons launch guide →</a>
+ </section>`;
+}
+
+// ── Form wiring + live quote ───────────────────────────────────────────────
+
+function wireForm() {
+ const f = state.form;
+ const bind = (sel, key, after) => {
+ const input = $(sel);
+ input.addEventListener('input', () => {
+ f[key] = input.value;
+ after?.(input);
+ scheduleQuote();
+ });
+ };
+ $('#f-agent').addEventListener('change', (e) => {
+ f.agentId = e.target.value;
+ state.quote = null;
+ render();
+ scheduleQuote(0);
+ });
+ bind('#f-name', 'name', () => {
+ if (!f.symbolTouched) {
+ f.symbol = suggestSymbol(f.name);
+ $('#f-symbol').value = f.symbol;
+ }
+ });
+ bind('#f-symbol', 'symbol', (input) => {
+ f.symbolTouched = true;
+ const clean = input.value.toUpperCase().replace(/[^A-Z0-9]/g, '');
+ if (clean !== input.value) input.value = clean;
+ f.symbol = clean;
+ });
+ bind('#f-description', 'description');
+ bind('#f-image', 'image');
+ bind('#f-twitter', 'twitter');
+ bind('#f-telegram', 'telegram');
+ bind('#f-website', 'website');
+ bind('#f-buy', 'buyEth');
+ bind('#f-tax', 'taxPct');
+ $('#f-buyback').addEventListener('click', (e) => {
+ f.buyback = !f.buyback;
+ e.currentTarget.setAttribute('aria-checked', String(f.buyback));
+ scheduleQuote();
+ });
+ $('#lr-form').addEventListener('submit', (e) => e.preventDefault());
+ wireSummary();
+}
+
+function wireSummary() {
+ $('#lr-requote')?.addEventListener('click', () => scheduleQuote(0));
+ $('#lr-launch')?.addEventListener('click', confirmLaunch);
+ const copy = $('#lr-copy');
+ copy?.addEventListener('click', async () => {
+ try {
+ await navigator.clipboard.writeText(copy.dataset.copy);
+ copy.textContent = 'Copied';
+ copy.classList.add('is-done');
+ } catch {
+ copy.textContent = 'Select and copy';
+ }
+ });
+}
+
+function paintSummary() {
+ const side = $('.lr-side');
+ if (!side) return;
+ side.innerHTML = summaryCard();
+ wireSummary();
+}
+
+let quoteTimer = null;
+function scheduleQuote(delay = 450) {
+ clearTimeout(quoteTimer);
+ quoteTimer = setTimeout(runQuote, delay);
+}
+
+async function runQuote() {
+ const body = requestBody();
+ if (!state.form.agentId || !body.name || !body.symbol) {
+ state.quote = null;
+ state.quoteError = '';
+ paintSummary();
+ return;
+ }
+ const seq = ++state.quoteSeq;
+ state.quoting = true;
+ state.quoteError = '';
+ paintSummary();
+ try {
+ const { data } = await api(`/api/agents/${encodeURIComponent(state.form.agentId)}/pons/quote`, { method: 'POST', body });
+ if (seq !== state.quoteSeq) return;
+ state.quote = data;
+ } catch (err) {
+ if (seq !== state.quoteSeq) return;
+ state.quote = null;
+ state.quoteError = err.message;
+ } finally {
+ if (seq === state.quoteSeq) {
+ state.quoting = false;
+ paintSummary();
+ }
+ }
+}
+
+// ── Launch ─────────────────────────────────────────────────────────────────
+
+function confirmLaunch() {
+ const q = state.quote;
+ if (!q?.ready || state.launching) return;
+ const dialog = document.createElement('dialog');
+ dialog.className = 'lr-dialog';
+ dialog.setAttribute('aria-labelledby', 'lr-dialog-title');
+ dialog.innerHTML = `
+ <h2 id="lr-dialog-title">Launch $${esc(q.coin.symbol)}?</h2>
+ <p>This spends real ETH from your agent's wallet and creates a coin anyone can trade. It cannot be undone.</p>
+ <dl class="lr-cost">
+ <div><dt>From</dt><dd class="lr-mono">${esc(q.agent.name || 'Agent')} · ${esc(short(q.wallet.address))}</dd></div>
+ <div><dt>To</dt><dd>Pons launchpad</dd></div>
+ <div><dt>Chain</dt><dd>Robinhood Chain (${esc(q.chain_id)})</dd></div>
+ <div class="lr-total"><dt>Amount</dt><dd class="lr-mono">${esc(fmtEth(q.cost.total_eth))} ETH${q.cost.total_usd != null ? `<small>≈ $${esc(q.cost.total_usd.toLocaleString('en-US'))}</small>` : ''}</dd></div>
+ </dl>
+ <div class="lr-actions">
+ <button type="button" class="lr-btn" value="cancel" id="lr-cancel">Cancel</button>
+ <button type="button" class="lr-btn lr-btn-primary" id="lr-go">Launch</button>
+ </div>`;
+ document.body.appendChild(dialog);
+ const close = () => {
+ dialog.close();
+ dialog.remove();
+ };
+ dialog.addEventListener('cancel', close);
+ $('#lr-cancel', dialog).addEventListener('click', close);
+ $('#lr-go', dialog).addEventListener('click', async () => {
+ close();
+ await launch();
+ });
+ dialog.showModal();
+ $('#lr-go', dialog).focus();
+}
+
+async function launch() {
+ if (!(await ensureRiskAck({ context: 'pons-launch' }))) return;
+ state.launching = true;
+ const btn = $('#lr-launch');
+ if (btn) {
+ btn.disabled = true;
+ btn.textContent = 'Signing and sending…';
+ btn.classList.add('is-busy');
+ }
+ try {
+ const { data } = await api(`/api/agents/${encodeURIComponent(state.form.agentId)}/pons/launch`, {
+ method: 'POST',
+ body: requestBody(),
+ });
+ state.launched = data;
+ render();
+ window.scrollTo({ top: 0, behavior: 'smooth' });
+ } catch (err) {
+ state.quoteError = err.message;
+ state.quote = null;
+ paintSummary();
+ } finally {
+ state.launching = false;
+ }
+}
+
+boot();
diff --git a/src/launches.css b/src/launches.css
index cd936260e..983a00fea 100644
--- a/src/launches.css
+++ b/src/launches.css
@@ -705,6 +705,19 @@ body {
transform: rotate(40deg) scale(1.15);
}
+.lx-coin-art .lx-coin-logo {
+ position: absolute;
+ inset: 0;
+ width: 100%;
+ height: 100%;
+ object-fit: cover;
+ transition: transform var(--duration-slow) var(--ease-standard);
+}
+
+.lx-card:hover .lx-coin-art .lx-coin-logo {
+ transform: scale(1.06);
+}
+
.lx-coin-id {
min-width: 0;
}
@@ -755,6 +768,11 @@ body {
border-color: color-mix(in srgb, var(--warn) 35%, transparent);
}
+.lx-badge-chain {
+ color: var(--accent);
+ border-color: color-mix(in srgb, var(--accent) 35%, transparent);
+}
+
.lx-coin-id .lx-coin-name {
display: block;
}
diff --git a/src/launches.js b/src/launches.js
index 2b273ef43..0cd6be806 100644
--- a/src/launches.js
+++ b/src/launches.js
@@ -457,7 +457,21 @@ function agentChip(agent) {
);
}
+// Coins an agent launched on an EVM chain (Robinhood Chain through Pons) carry
+// their venue in the row, not pump.fun: trade on the venue, verify on the
+// chain's explorer, and open the on-platform coin page for that chain.
+const EVM_LAUNCH_CHAINS = {
+ robinhood: {
+ label: 'Robinhood Chain',
+ explorer: (addr) => `https://robinhoodchain.blockscout.com/token/${addr}`,
+ coinPage: (addr) => `/markets/robinhood/coin/${addr}`,
+ },
+};
+const VENUE_LABELS = { pons: 'Pons' };
+
function launchCard(launch, index, { featured = false } = {}) {
+ const evm = EVM_LAUNCH_CHAINS[launch.chain] || null;
+ if (evm) return evmLaunchCard(launch, index, evm, { featured });
const isDevnet = launch.network === 'devnet';
const tradeHref = isDevnet
? `https://explorer.solana.com/address/${launch.mint}?cluster=devnet`
@@ -615,6 +629,76 @@ function launchCard(launch, index, { featured = false } = {}) {
return card;
}
+function evmLaunchCard(launch, index, chain, { featured = false } = {}) {
+ const venue = VENUE_LABELS[launch.venue] || launch.venue || 'Launchpad';
+ const label = launch.symbol ? `$${launch.symbol}` : launch.name || 'coin';
+ const badges = el('div', { class: 'lx-badges' });
+ if (launch.created_at) {
+ badges.appendChild(
+ el('span', { class: 'lx-badge lx-badge-age', title: `Launched ${timeAgo(launch.created_at)}`, text: timeAgo(launch.created_at) }),
+ );
+ }
+ badges.appendChild(el('span', { class: 'lx-badge lx-badge-chain', text: chain.label }));
+
+ const identicon = mintIdenticon(launch.mint);
+ const logo = launch.fixed?.image_url
+ ? el('img', {
+ class: 'lx-coin-logo',
+ src: proxiedImageURL(launch.fixed.image_url, launch.mint, { width: 96 }) || launch.fixed.image_url,
+ alt: '',
+ loading: 'lazy',
+ onerror: (e) => e.currentTarget.replaceWith(identicon),
+ })
+ : identicon;
+ const market = el('div', { class: 'lx-market' }, [
+ el('div', { class: 'lx-market-devnet' }, [
+ el('div', { class: 'lx-coin-art' }, [logo]),
+ el('div', { class: 'lx-coin-id' }, [
+ el('h3', { class: 'lx-coin-name', text: launch.name || launch.symbol || 'Unnamed coin' }),
+ el('span', { class: 'lx-coin-symbol', text: launch.symbol ? `$${launch.symbol}` : shortAddr(launch.mint) }),
+ ]),
+ el('time', { class: 'lx-time', datetime: launch.created_at, text: timeAgo(launch.created_at) }),
+ ]),
+ ]);
+
+ const actions = [];
+ if (launch.fixed?.venue_url) {
+ actions.push(
+ el('a', {
+ class: 'lx-action',
+ href: launch.fixed.venue_url,
+ target: '_blank',
+ rel: 'noopener noreferrer',
+ text: `${venue} ↗`,
+ 'aria-label': `Trade ${label} on ${venue}`,
+ }),
+ );
+ }
+ actions.push(
+ el('a', {
+ class: 'lx-action',
+ href: chain.explorer(launch.mint),
+ target: '_blank',
+ rel: 'noopener noreferrer',
+ text: 'Explorer ↗',
+ 'aria-label': `View ${label} on the ${chain.label} explorer`,
+ }),
+ );
+
+ const card = el('article', { class: `lx-card${featured ? ' lx-card-featured' : ''}`, 'data-mint': launch.mint }, [
+ el('a', { class: 'lx-card-link', href: chain.coinPage(launch.mint), 'aria-label': `Open ${label} profile` }),
+ featured ? el('span', { class: 'lx-feat-tag', text: 'Latest' }) : null,
+ featured && launch.symbol ? el('span', { class: 'lx-feat-ghost', 'aria-hidden': 'true', text: `$${launch.symbol}` }) : null,
+ market,
+ badges,
+ agentChip(launch.agent),
+ el('div', { class: 'lx-card-actions' }, actions),
+ el('span', { class: 'lx-mint', text: launch.mint, title: launch.mint }),
+ ]);
+ reveal(card, index);
+ return card;
+}
+
// ── ticker ───────────────────────────────────────────────────────────────────
// Marquee strip of the freshest launches. Content duplicated once so the
// translateX(-50%) loop is seamless. Decorative (aria-hidden) — the same data
diff --git a/src/markets-robinhood.js b/src/markets-robinhood.js
index a0bc0b1d4..9d5fb33c4 100644
--- a/src/markets-robinhood.js
+++ b/src/markets-robinhood.js
@@ -250,7 +250,7 @@ function renderCoinsShell() {
</div>
</div>
<div id="rh-coins-table">${skeletonTable(6)}</div>
- <div class="cv-toolbar" style="margin: 2rem 0 1rem"><h2 class="cv-h2" style="margin: 0">Recent Launches</h2></div>
+ <div class="cv-toolbar" style="margin: 2rem 0 1rem"><h2 class="cv-h2" style="margin: 0">Recent Launches</h2><a class="rh-launch-cta" href="/launch/robinhood">Launch your agent's coin on Pons →</a></div>
<div id="rh-launches-table">${skeletonTable(4, 5)}</div>
`;
panel.querySelectorAll('.rh-cat-btn').forEach((btn) => {
diff --git a/src/paired/coin.js b/src/paired/coin.js
new file mode 100644
index 000000000..dbd459e4d
--- /dev/null
+++ b/src/paired/coin.js
@@ -0,0 +1,242 @@
+// /markets/robinhood/paired/:address: one paired coin on Robinhood Chain.
+//
+// Data: GET /api/v1/robinhood/paired-coins-detail?address=&interval= returns
+// the coin's pools (read live from the launchpad, priced in dollars), its
+// verified descriptor, the launching agent, recent trades and candles per
+// pool. The chart and the trade ticket follow the selected pool; trades refresh
+// every 15 seconds while the tab is visible.
+
+import { createChart, CandlestickSeries, HistogramSeries, CrosshairMode } from 'lightweight-charts';
+import { ago, amount, classChip, coinLogo, esc, explainLoad, getJson, pct, short, usd } from './common.js';
+import { mountTicket } from './trade.js';
+
+const $ = (s, r = document) => r.querySelector(s);
+const ADDR_RE = /^\/markets\/robinhood\/paired\/(0x[0-9a-fA-F]{40})\/?$/;
+const EXPLORER = 'https://robinhoodchain.blockscout.com';
+const REFRESH_MS = 15_000;
+
+const state = { address: null, coin: null, error: '', pool: 0, interval: '1h', ticket: null, chart: null, candle: null, volume: null };
+
+function cssVar(name, fallback) {
+ return getComputedStyle(document.documentElement).getPropertyValue(name).trim() || fallback;
+}
+
+function renderSkeleton() {
+ $('#pc-head').innerHTML = '<div class="ch-hero"><div class="cv-skel" style="width:16rem;height:2.5rem"></div><div class="cv-skel" style="width:22rem;height:1.25rem;margin-top:0.75rem"></div></div>';
+ $('#pc-pools').innerHTML = `<div class="pc-pools">${Array.from({ length: 2 }, () => '<div class="cv-skel" style="height:150px;border-radius:14px"></div>').join('')}</div>`;
+ $('#pc-rail').innerHTML = '<div class="cv-skel" style="height:340px;border-radius:14px"></div>';
+}
+
+function renderError() {
+ const notCoin = /not a coin/i.test(state.error);
+ $('#pc-head').innerHTML = `<div class="pc-empty" role="alert">
+ <h2>${notCoin ? 'Not a paired coin' : 'Could not load this coin'}</h2>
+ <p>${esc(notCoin ? `${state.address} is not a coin on the paired launchpad. It may be a regular Robinhood Chain token.` : state.error)}</p>
+ <div class="pc-hero-actions" style="justify-content:center">
+ ${notCoin ? `<a class="pc-btn" href="/markets/robinhood/coin/${esc(state.address)}">Open as a Robinhood Chain coin</a>` : '<button type="button" class="pc-btn" id="pc-retry">Try again</button>'}
+ <a class="pc-btn" href="/markets/robinhood/paired">All paired coins</a>
+ </div>
+ </div>`;
+ $('#pc-retry')?.addEventListener('click', () => load(true));
+ $('#pc-pools').innerHTML = '';
+ $('#pc-chart-wrap').hidden = true;
+ $('#pc-trades').innerHTML = '';
+ $('#pc-rail').innerHTML = '';
+}
+
+function renderHead(c) {
+ document.title = `${c.name} ($${c.symbol}) · Paired coin · three.ws`;
+ $('#pc-crumb').textContent = `$${c.symbol}`;
+ const d = c.descriptor;
+ const links = [
+ d?.links?.website && `<a class="pc-btn" href="${esc(d.links.website)}" target="_blank" rel="noopener noreferrer">Website ↗</a>`,
+ d?.links?.twitter && `<a class="pc-btn" href="${esc(d.links.twitter)}" target="_blank" rel="noopener noreferrer">X ↗</a>`,
+ d?.links?.telegram && `<a class="pc-btn" href="${esc(d.links.telegram)}" target="_blank" rel="noopener noreferrer">Telegram ↗</a>`,
+ `<a class="pc-btn" href="${EXPLORER}/token/${esc(c.address)}" target="_blank" rel="noopener noreferrer">Explorer ↗</a>`,
+ ].filter(Boolean);
+ const by = c.agent
+ ? `<a class="pc-agent" href="${esc(c.agent.url)}">${c.agent.avatar ? `<img src="${esc(c.agent.avatar)}" alt="" />` : '<span class="pc-agent-dot"></span>'}<span>Launched by ${esc(c.agent.name || 'an agent')}</span></a>`
+ : `<span class="pc-agent"><span>Created by <a href="${EXPLORER}/address/${esc(c.creator)}" target="_blank" rel="noopener noreferrer"><code>${esc(short(c.creator))}</code></a></span></span>`;
+ const verified = d
+ ? d.verified
+ ? '<span class="ch-chip" title="The descriptor hashes to the commitment the coin stored on chain">Metadata verified</span>'
+ : '<span class="ch-chip" title="The descriptor does not hash to the on-chain commitment">Metadata unverified</span>'
+ : '';
+ $('#pc-head').innerHTML = `
+ <div class="ch-hero">
+ <div class="ch-title-row" style="gap:0.875rem">
+ ${coinLogo(c, 56)}
+ <div>
+ <h1 class="ch-title" style="margin:0">${esc(c.name)}</h1>
+ <div style="display:flex;flex-wrap:wrap;gap:0.5rem;align-items:center;margin-top:0.35rem">
+ <span class="cv-rank-badge">$${esc(c.symbol)}</span>
+ ${verified}
+ ${by}
+ </div>
+ </div>
+ </div>
+ <div class="cv-price-row" style="margin-top:0.875rem">
+ <span class="cv-price cv-mono">${esc(usd(c.marketCapUsd))}</span>
+ <span class="cv-sub">market cap · ${c.pairs.length} ${c.pairs.length === 1 ? 'pool' : 'pools'} · ${esc(c.tradeCount)} ${c.tradeCount === 1 ? 'trade' : 'trades'}</span>
+ </div>
+ ${d?.description ? `<p class="pc-hero-lede">${esc(d.description)}</p>` : ''}
+ <div class="pc-hero-actions">
+ ${links.join('')}
+ <button type="button" class="pc-btn" id="pc-copy" data-copy="${esc(c.address)}" aria-label="Copy contract address"><code>${esc(short(c.address))}</code> Copy</button>
+ </div>
+ </div>`;
+ $('#pc-copy').addEventListener('click', async (e) => {
+ const btn = e.currentTarget;
+ try {
+ await navigator.clipboard.writeText(btn.dataset.copy);
+ btn.innerHTML = 'Copied';
+ } catch {
+ btn.innerHTML = esc(btn.dataset.copy);
+ }
+ });
+}
+
+function renderPools(c) {
+ $('#pc-pools').innerHTML = `<div class="pc-pools" role="group" aria-label="Pools">${c.pairs
+ .map(
+ (p, i) => `<button type="button" class="pc-pool" data-pool="${i}" aria-pressed="${i === state.pool}">
+ <div class="pc-pool-head"><strong>${esc(p.quoteSymbol)}</strong>${classChip(p.quoteClass)}</div>
+ <dl>
+ <dt>Share of supply</dt><dd>${esc(pct(p.weightBps))}</dd>
+ <dt>Price</dt><dd>${esc(amount(p.price))} ${esc(p.quoteSymbol)}</dd>
+ <dt>In dollars</dt><dd>${esc(usd(p.priceUsd, { compact: false }))}</dd>
+ <dt>Raised</dt><dd>${esc(amount(p.raised))} ${esc(p.quoteSymbol)}</dd>
+ <dt>Sold</dt><dd>${esc(amount(p.soldPct, 2))}%</dd>
+ </dl>
+ <div class="pc-progress" aria-hidden="true"><span style="width:${Math.min(100, p.soldPct)}%"></span></div>
+ </button>`,
+ )
+ .join('')}</div>
+ <p class="pc-fine" style="margin-top:0.5rem">Each pool is its own bonding curve with liquidity locked forever. Swap fee ${esc(pct(c.terms.swapFeeBps))}, of which ${esc(pct(c.terms.creatorShareBps))} goes to the creator.</p>`;
+ $('#pc-pools').querySelectorAll('[data-pool]').forEach((b) =>
+ b.addEventListener('click', () => {
+ if (state.pool === Number(b.dataset.pool)) return;
+ state.pool = Number(b.dataset.pool);
+ renderPools(state.coin);
+ renderChart(state.coin);
+ state.ticket?.poolChanged();
+ }),
+ );
+}
+
+function ensureChart() {
+ if (state.chart) return;
+ const el = $('#pc-chart');
+ const text = cssVar('--cv-text-3', '#8b8f9a');
+ const grid = cssVar('--cv-border', 'rgba(127,127,127,0.15)');
+ state.chart = createChart(el, {
+ autoSize: true,
+ layout: { background: { color: 'transparent' }, textColor: text, fontFamily: cssVar('--cv-font-mono', 'ui-monospace, monospace') },
+ grid: { vertLines: { color: grid }, horzLines: { color: grid } },
+ crosshair: { mode: CrosshairMode.Normal },
+ rightPriceScale: { borderColor: grid, scaleMargins: { top: 0.1, bottom: 0.25 } },
+ timeScale: { borderColor: grid, timeVisible: true, secondsVisible: false },
+ });
+ const up = cssVar('--cv-chart-green', '#22c55e');
+ const down = cssVar('--cv-chart-red', '#ef4444');
+ state.candle = state.chart.addSeries(CandlestickSeries, {
+ upColor: up,
+ downColor: down,
+ borderUpColor: up,
+ borderDownColor: down,
+ wickUpColor: up,
+ wickDownColor: down,
+ priceFormat: { type: 'custom', formatter: (v) => amount(v), minMove: 1e-12 },
+ });
+ state.volume = state.chart.addSeries(HistogramSeries, { priceFormat: { type: 'volume' }, priceScaleId: 'vol', priceLineVisible: false, lastValueVisible: false });
+ state.chart.priceScale('vol').applyOptions({ scaleMargins: { top: 0.8, bottom: 0 } });
+}
+
+function renderChart(c) {
+ $('#pc-chart-wrap').hidden = false;
+ const p = c.pairs[state.pool];
+ $('#pc-intervals').innerHTML = c.intervals
+ .map((k) => `<button type="button" class="pc-tab" role="tab" data-interval="${k}" aria-selected="${k === state.interval}">${k}</button>`)
+ .join('');
+ $('#pc-chart-title').textContent = `$${c.symbol} / ${p.quoteSymbol}`;
+ const empty = $('#pc-chart-empty');
+ if (!p.candles.length) {
+ empty.hidden = false;
+ empty.innerHTML = `<strong>No trades in the ${esc(p.quoteSymbol)} pool yet</strong><span>The curve opens at ${esc(amount(p.price))} ${esc(p.quoteSymbol)} per coin (${esc(usd(p.priceUsd, { compact: false }))}). The first buy draws the first candle.</span>`;
+ state.candle?.setData([]);
+ state.volume?.setData([]);
+ return;
+ }
+ empty.hidden = true;
+ ensureChart();
+ const up = cssVar('--cv-chart-green', '#22c55e');
+ const down = cssVar('--cv-chart-red', '#ef4444');
+ state.candle.setData(p.candles.map((k) => ({ time: k.time, open: k.open, high: k.high, low: k.low, close: k.close })));
+ state.volume.setData(p.candles.map((k) => ({ time: k.time, value: k.volume, color: `${k.close >= k.open ? up : down}66` })));
+ state.chart.timeScale().fitContent();
+}
+
+function renderTrades(c) {
+ if (!c.trades.length) {
+ $('#pc-trades').innerHTML = `<div class="pc-empty"><h3>No trades yet</h3><p>Trades on any of this coin's pools appear here as they land on chain.</p></div>`;
+ return;
+ }
+ $('#pc-trades').innerHTML = `<div class="cv-table-wrap"><table class="pc-trades">
+ <thead><tr><th scope="col">Side</th><th scope="col">Pool</th><th scope="col" class="num">Coins</th><th scope="col" class="num">Paid / received</th><th scope="col">Trader</th><th scope="col">When</th></tr></thead>
+ <tbody>${c.trades
+ .map(
+ (t) => `<tr>
+ <td class="${t.isBuy ? 'pc-buy' : 'pc-sell'}">${t.isBuy ? 'Buy' : 'Sell'}</td>
+ <td>${esc(t.quoteSymbol)}</td>
+ <td class="num">${esc(amount(t.tokenAmount, 2))}</td>
+ <td class="num">${esc(amount(t.quoteAmount))} ${esc(t.quoteSymbol)}</td>
+ <td><a href="${EXPLORER}/address/${esc(t.trader)}" target="_blank" rel="noopener noreferrer"><code>${esc(short(t.trader))}</code></a></td>
+ <td><a href="${EXPLORER}/tx/${esc(t.txHash)}" target="_blank" rel="noopener noreferrer">${esc(ago(t.time))}</a></td>
+ </tr>`,
+ )
+ .join('')}</tbody></table></div>
+ ${c.tradeCount > c.trades.length ? `<p class="pc-fine">Showing the latest ${c.trades.length} of ${c.tradeCount} trades.</p>` : ''}`;
+}
+
+async function load(first) {
+ if (first) renderSkeleton();
+ try {
+ const coin = await getJson(`/api/v1/robinhood/paired-coins-detail?address=${state.address}&interval=${state.interval}`);
+ state.error = '';
+ state.coin = coin;
+ if (state.pool >= coin.pairs.length) state.pool = 0;
+ renderHead(coin);
+ renderPools(coin);
+ renderChart(coin);
+ renderTrades(coin);
+ if (!state.ticket) state.ticket = mountTicket($('#pc-rail'), { coin, getPool: () => state.coin.pairs[state.pool], onTraded: () => load(false) });
+ } catch (err) {
+ if (!first && state.coin) return;
+ state.error = explainLoad(err);
+ renderError();
+ } finally {
+ $('#main-content').setAttribute('aria-busy', 'false');
+ }
+}
+
+function boot() {
+ const m = location.pathname.match(ADDR_RE);
+ state.address = m ? m[1] : null;
+ if (!state.address) {
+ state.error = 'That is not a valid coin address.';
+ renderError();
+ return;
+ }
+ $('#pc-intervals').addEventListener('click', (e) => {
+ const tab = e.target.closest('[data-interval]');
+ if (!tab || tab.dataset.interval === state.interval) return;
+ state.interval = tab.dataset.interval;
+ load(false);
+ });
+ load(true);
+ setInterval(() => {
+ if (document.visibilityState === 'visible' && state.coin) load(false);
+ }, REFRESH_MS);
+}
+
+boot();
diff --git a/src/paired/common.js b/src/paired/common.js
new file mode 100644
index 000000000..dd8d7f2ab
--- /dev/null
+++ b/src/paired/common.js
@@ -0,0 +1,79 @@
+// Shared helpers for the paired-coin pages: /markets/robinhood/paired (hub),
+// /markets/robinhood/paired/:address (coin page) and /launch/paired (launch).
+
+export const esc = (v) =>
+ String(v ?? '').replace(/[&<>"']/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' })[c]);
+
+export const short = (a) => (a ? `${a.slice(0, 6)}…${a.slice(-4)}` : '');
+
+export const CLASS_LABELS = {
+ 'rwa-equity': 'Stock',
+ stablecoin: 'Stablecoin',
+ 'crypto-major': 'Major',
+ 'crypto-native': 'Chain coin',
+ unlisted: 'Unlisted',
+};
+
+/** Dollar amount, compact above $10k. */
+export function usd(n, { compact = true } = {}) {
+ const v = Number(n);
+ if (n == null || !Number.isFinite(v)) return '-';
+ if (compact && Math.abs(v) >= 10_000) {
+ return `$${v.toLocaleString('en-US', { notation: 'compact', maximumFractionDigits: 2 })}`;
+ }
+ if (Math.abs(v) > 0 && Math.abs(v) < 0.01) return `$${v.toPrecision(3)}`;
+ return `$${v.toLocaleString('en-US', { minimumFractionDigits: 2, maximumFractionDigits: 2 })}`;
+}
+
+/** A quote-denominated amount: tiny prices keep four significant digits instead of rounding to zero. */
+export function amount(n, digits = 6) {
+ const v = Number(n);
+ if (n == null || !Number.isFinite(v)) return '-';
+ if (v === 0) return '0';
+ if (Math.abs(v) < 0.0001) return v.toPrecision(4);
+ if (Math.abs(v) >= 1_000_000) return v.toLocaleString('en-US', { notation: 'compact', maximumFractionDigits: 2 });
+ return v.toLocaleString('en-US', { maximumFractionDigits: Math.abs(v) >= 1 ? Math.min(digits, 4) : digits });
+}
+
+export const pct = (bps) => `${Number((bps / 100).toFixed(2))}%`;
+
+export function ago(seconds) {
+ if (!seconds) return '';
+ const d = Math.max(0, Date.now() / 1000 - seconds);
+ if (d < 60) return `${Math.floor(d)}s ago`;
+ if (d < 3600) return `${Math.floor(d / 60)}m ago`;
+ if (d < 86400) return `${Math.floor(d / 3600)}h ago`;
+ return `${Math.floor(d / 86400)}d ago`;
+}
+
+export async function getJson(url, init) {
+ const res = await fetch(url, { headers: { accept: 'application/json' }, credentials: 'include', ...init });
+ const body = await res.json().catch(() => null);
+ if (!res.ok) {
+ throw Object.assign(new Error(body?.error_description || body?.error || `Request failed (${res.status})`), {
+ status: res.status,
+ code: body?.error,
+ detail: body?.detail,
+ });
+ }
+ return body?.data ?? body;
+}
+
+/** A readable error line for a failed load, with the network case named plainly. */
+export function explainLoad(err) {
+ if (/failed to fetch|network/i.test(err?.message || '')) return 'three.ws could not be reached. Check your connection and try again.';
+ if (err?.status === 429) return 'Too many requests right now. Wait a few seconds and try again.';
+ return err?.message || 'Something went wrong loading this.';
+}
+
+export function classChip(assetClass) {
+ const key = CLASS_LABELS[assetClass] ? assetClass : 'unlisted';
+ return `<span class="pc-class pc-class-${esc(key)}">${esc(CLASS_LABELS[key])}</span>`;
+}
+
+/** The initial-letter disc shown when a coin has no logo. */
+export function coinLogo(coin, size = 44) {
+ const img = coin.descriptor?.image;
+ if (img) return `<img class="pc-logo" src="${esc(img)}" alt="" width="${size}" height="${size}" loading="lazy" decoding="async" data-no-dark-filter />`;
+ return `<span class="pc-logo pc-logo-fallback" style="width:${size}px;height:${size}px" aria-hidden="true">${esc((coin.symbol || '?').slice(0, 1))}</span>`;
+}
diff --git a/src/paired/hub.js b/src/paired/hub.js
new file mode 100644
index 000000000..cadfe141d
--- /dev/null
+++ b/src/paired/hub.js
@@ -0,0 +1,201 @@
+// /markets/robinhood/paired: every paired coin on Robinhood Chain and every
+// asset a coin can pair with.
+//
+// Data: GET /api/v1/robinhood/paired-coins (the launchpad's coins, newest
+// first, with dollar prices and the launching agent) and GET
+// /api/v1/robinhood/paired-markets (the live quote registry with each asset's
+// class, price and opening value). Both read the chain; nothing here is cached
+// client side beyond the page view.
+
+import { CLASS_LABELS, amount, classChip, coinLogo, esc, explainLoad, getJson, pct, usd } from './common.js';
+
+const $ = (s, r = document) => r.querySelector(s);
+const PAGE = 24;
+const POOL_COLORS = ['#60a5fa', '#34d399', '#a78bfa', '#fbbf24', '#f472b6'];
+
+const state = {
+ coins: [],
+ total: 0,
+ offset: 0,
+ loadingMore: false,
+ coinsError: '',
+ markets: null,
+ config: null,
+ marketsError: '',
+ klass: 'all',
+ query: '',
+};
+
+function poolDots(coin) {
+ const bar = coin.pairs.map((p, i) => `<span style="width:${p.weightBps / 100}%;background:${POOL_COLORS[i % POOL_COLORS.length]}"></span>`).join('');
+ const labels = coin.pairs
+ .map((p, i) => `<span class="pc-pair"><i style="background:${POOL_COLORS[i % POOL_COLORS.length]}"></i>${esc(p.quoteSymbol)} ${esc(pct(p.weightBps))}</span>`)
+ .join('');
+ return `<div class="pc-pairbar" aria-hidden="true">${bar}</div><div class="pc-pairs">${labels}</div>`;
+}
+
+function coinCard(c) {
+ const agent = c.agent
+ ? `<span class="pc-agent">${c.agent.avatar ? `<img src="${esc(c.agent.avatar)}" alt="" loading="lazy" />` : '<span class="pc-agent-dot"></span>'}<span>by ${esc(c.agent.name || 'an agent')}</span></span>`
+ : `<span class="pc-agent"><span>${esc(c.creator.slice(0, 6))}…${esc(c.creator.slice(-4))}</span></span>`;
+ const sold = c.pairs.length ? c.pairs.reduce((s, p) => s + p.soldPct * p.weightBps, 0) / c.pairs.reduce((s, p) => s + p.weightBps, 0) : 0;
+ return `
+ <a class="pc-card" href="${esc(c.url)}" aria-label="${esc(c.name)} (${esc(c.symbol)})">
+ <div class="pc-card-head">
+ ${coinLogo(c)}
+ <div class="pc-card-id">
+ <h3 class="pc-card-name">${esc(c.name)}</h3>
+ <span class="pc-card-sym">$${esc(c.symbol)} · ${c.pairs.length} ${c.pairs.length === 1 ? 'pool' : 'pools'}</span>
+ </div>
+ <div class="pc-card-mcap">${esc(usd(c.marketCapUsd))}<small>market cap</small></div>
+ </div>
+ ${c.descriptor?.description ? `<p class="pc-card-desc">${esc(c.descriptor.description)}</p>` : ''}
+ ${poolDots(c)}
+ <div class="pc-card-foot">${agent}<span>${esc(amount(sold, 2))}% sold</span></div>
+ </a>`;
+}
+
+function renderCoins() {
+ const host = $('#pc-coins');
+ if (state.coinsError && !state.coins.length) {
+ host.innerHTML = `<div class="pc-empty" role="alert"><h3>Could not load paired coins</h3><p>${esc(state.coinsError)}</p><button type="button" class="pc-btn" id="pc-coins-retry">Try again</button></div>`;
+ $('#pc-coins-retry').addEventListener('click', () => loadCoins(true));
+ return;
+ }
+ if (!state.coins.length) {
+ host.innerHTML = `<div class="pc-empty"><h3>No paired coins yet</h3><p>Be the first: your agent can launch a coin paired with stocks, WETH and stablecoins from its own wallet in one transaction.</p><a class="pc-btn pc-btn-primary" href="/launch/paired">Launch with your agent</a></div>`;
+ return;
+ }
+ const more = state.offset < state.total
+ ? `<div style="display:flex;justify-content:center;margin-top:1rem"><button type="button" class="pc-btn ${state.loadingMore ? 'is-busy' : ''}" id="pc-more" ${state.loadingMore ? 'disabled' : ''}>Load more</button></div>`
+ : '';
+ host.innerHTML = `<div class="pc-grid">${state.coins.map(coinCard).join('')}</div>${more}`;
+ $('#pc-more')?.addEventListener('click', () => loadCoins(false));
+}
+
+function renderStats() {
+ const host = $('#pc-stats');
+ if (!state.config || !state.markets) {
+ host.innerHTML = `<div class="cv-stats-grid">${Array.from({ length: 4 }, () => '<div class="cv-skel" style="height:4.5rem"></div>').join('')}</div>`;
+ return;
+ }
+ const counts = {};
+ for (const m of state.markets) counts[m.assetClass] = (counts[m.assetClass] || 0) + 1;
+ const breakdown = Object.entries(counts).map(([k, n]) => `${n} ${CLASS_LABELS[k] || k}`).join(' · ');
+ const tiles = [
+ ['Paired coins', String(state.config.tokenCount), 'launched on the launchpad'],
+ ['Markets', String(state.markets.length), breakdown],
+ ['Launch fee', `${state.config.launchFeeEth} ETH`, 'plus gas, nothing to deposit'],
+ ['Creator share', pct(state.config.creatorShareBps), `of the ${pct(state.config.swapFeeBps)} swap fee, in every pool`],
+ ];
+ host.innerHTML = `<div class="cv-stats-grid">${tiles
+ .map(([k, v, s]) => `<div class="cv-stat-card"><div class="cv-sub">${esc(k)}</div><div class="cv-price cv-mono" style="font-size:1.375rem">${esc(v)}</div><div class="cv-sub" style="font-size:0.75rem">${esc(s)}</div></div>`)
+ .join('')}</div>`;
+}
+
+function filteredMarkets() {
+ const q = state.query.trim().toLowerCase();
+ return (state.markets || []).filter(
+ (m) => (state.klass === 'all' || m.assetClass === state.klass) && (!q || m.symbol.toLowerCase().includes(q) || m.name.toLowerCase().includes(q) || m.address.toLowerCase() === q),
+ );
+}
+
+function renderMarkets() {
+ const host = $('#pc-markets');
+ if (state.marketsError) {
+ host.innerHTML = `<div class="pc-empty" role="alert"><h3>Could not load markets</h3><p>${esc(state.marketsError)}</p><button type="button" class="pc-btn" id="pc-markets-retry">Try again</button></div>`;
+ $('#pc-markets-retry').addEventListener('click', loadMarkets);
+ return;
+ }
+ if (!state.markets) {
+ host.innerHTML = Array.from({ length: 6 }, () => '<div class="cv-skel" style="height:2.75rem;margin-bottom:0.5rem"></div>').join('');
+ return;
+ }
+ const classes = ['all', ...new Set(state.markets.map((m) => m.assetClass))];
+ $('#pc-market-tabs').innerHTML = classes
+ .map((k) => `<button type="button" role="tab" class="pc-tab" data-class="${esc(k)}" aria-selected="${k === state.klass}">${esc(k === 'all' ? 'All' : CLASS_LABELS[k] || k)}</button>`)
+ .join('');
+ const rows = filteredMarkets();
+ if (!rows.length) {
+ host.innerHTML = `<div class="pc-empty"><h3>No market matches "${esc(state.query)}"</h3><p>Search by ticker, name or contract address, or clear the filter.</p></div>`;
+ return;
+ }
+ host.innerHTML = `
+ <div class="cv-table-wrap"><table class="pc-markets">
+ <thead><tr><th scope="col">Asset</th><th scope="col">Class</th><th scope="col" class="num">Price</th><th scope="col" class="num">Liquidity</th><th scope="col" class="num">Opens at</th><th scope="col"><span class="cv-sr-only">Launch</span></th></tr></thead>
+ <tbody>${rows
+ .map(
+ (m) => `<tr>
+ <td><div class="pc-market-sym"><strong>${esc(m.symbol)}</strong><small title="${esc(m.address)}">${esc(m.name)}</small></div></td>
+ <td>${classChip(m.assetClass)}${m.canonical === false ? ' <span class="pc-class" title="This contract uses a ticker another token owns">Impostor ticker</span>' : ''}</td>
+ <td class="num">${esc(usd(m.priceUsd, { compact: false }))}</td>
+ <td class="num">${esc(usd(m.liquidityUsd))}</td>
+ <td class="num" title="Market cap a coin opens at with all of its supply in this pool">${esc(usd(m.openingValueUsd))}</td>
+ <td class="num"><a class="pc-btn" style="min-height:32px" href="/launch/paired?markets=${encodeURIComponent(m.symbol)}">Pair</a></td>
+ </tr>`,
+ )
+ .join('')}</tbody>
+ </table></div>`;
+}
+
+async function loadCoins(reset) {
+ if (reset) {
+ state.coins = [];
+ state.offset = 0;
+ state.coinsError = '';
+ $('#pc-coins').innerHTML = `<div class="pc-grid">${Array.from({ length: 6 }, () => '<div class="cv-skel" style="height:170px;border-radius:14px"></div>').join('')}</div>`;
+ } else {
+ state.loadingMore = true;
+ renderCoins();
+ }
+ try {
+ const data = await getJson(`/api/v1/robinhood/paired-coins?limit=${PAGE}&offset=${state.offset}`);
+ state.coins = state.coins.concat(data.coins);
+ state.total = data.total;
+ state.offset += data.coins.length;
+ state.coinsError = '';
+ } catch (err) {
+ state.coinsError = explainLoad(err);
+ } finally {
+ state.loadingMore = false;
+ renderCoins();
+ }
+}
+
+async function loadMarkets() {
+ state.marketsError = '';
+ state.markets = null;
+ renderMarkets();
+ renderStats();
+ try {
+ const data = await getJson('/api/v1/robinhood/paired-markets');
+ state.markets = data.markets;
+ state.config = data.config;
+ } catch (err) {
+ state.marketsError = explainLoad(err);
+ }
+ renderMarkets();
+ renderStats();
+}
+
+function wire() {
+ $('#pc-market-tabs').addEventListener('click', (e) => {
+ const tab = e.target.closest('[data-class]');
+ if (!tab) return;
+ state.klass = tab.dataset.class;
+ renderMarkets();
+ });
+ let t;
+ $('#pc-market-search').addEventListener('input', (e) => {
+ clearTimeout(t);
+ t = setTimeout(() => {
+ state.query = e.target.value;
+ renderMarkets();
+ }, 150);
+ });
+}
+
+wire();
+renderStats();
+loadCoins(true);
+loadMarkets();
diff --git a/src/paired/launch.js b/src/paired/launch.js
new file mode 100644
index 000000000..4387c9516
--- /dev/null
+++ b/src/paired/launch.js
@@ -0,0 +1,620 @@
+// /launch/paired: an owner has one of their agents launch a paired coin on
+// Robinhood Chain from the agent's own EVM wallet.
+//
+// Data flow: GET /api/agents lists the owner's agents and GET
+// /api/v1/robinhood/paired-markets lists what a coin can pair with. Every form
+// change is debounced into POST /api/agents/:id/paired/quote, which validates
+// the coin, prices every pool and the launch, checks the agent wallet and its
+// spend policy, and names anything blocking. Launch confirms the quoted cost
+// in a dialog, then POSTs the identical body to /paired/launch, which signs
+// with the agent's custodial key. Every number on screen came from a quote.
+
+import { ensureRiskAck } from '../shared/risk-ack.js';
+import { CLASS_LABELS, amount, classChip, esc, explainLoad, getJson, short, usd } from './common.js';
+
+const $ = (s, r = document) => r.querySelector(s);
+const MAX_MARKETS = 5;
+
+const state = {
+ user: undefined,
+ agents: null,
+ agentsError: '',
+ markets: null,
+ marketsError: '',
+ klass: 'all',
+ search: '',
+ form: {
+ agentId: '',
+ name: '',
+ symbol: '',
+ symbolTouched: false,
+ description: '',
+ image: '',
+ website: '',
+ twitter: '',
+ telegram: '',
+ picked: [],
+ buyMarket: '',
+ buyAmount: '',
+ },
+ quote: null,
+ quoteError: '',
+ quoting: false,
+ quoteSeq: 0,
+ launching: false,
+ launched: null,
+};
+
+const suggestSymbol = (name) => String(name || '').toUpperCase().replace(/[^A-Z0-9]/g, '').slice(0, 10);
+const selectedAgent = () => state.agents?.find((a) => a.id === state.form.agentId) || null;
+const marketBySymbol = (sym) => state.markets?.find((m) => m.symbol === sym) || null;
+
+function evenSplit() {
+ const n = state.form.picked.length;
+ if (!n) return;
+ const base = Math.floor(10000 / n);
+ let rem = 10000 - base * n;
+ state.form.picked.forEach((p) => {
+ p.bps = base + (rem-- > 0 ? 1 : 0);
+ });
+}
+
+const totalBps = () => state.form.picked.reduce((s, p) => s + p.bps, 0);
+
+/** The body /quote and /launch both take, built only from the form. */
+function requestBody() {
+ const f = state.form;
+ const body = {
+ name: f.name.trim(),
+ symbol: f.symbol.trim(),
+ markets: f.picked.map((p) => p.symbol),
+ weights: f.picked.map((p) => p.bps / 100),
+ };
+ if (f.description.trim()) body.description = f.description.trim();
+ if (f.image.trim()) body.image_url = f.image.trim();
+ const socials = {};
+ if (f.website.trim()) socials.website = f.website.trim();
+ if (f.twitter.trim()) socials.twitter = f.twitter.trim();
+ if (f.telegram.trim()) socials.telegram = f.telegram.trim();
+ if (Object.keys(socials).length) body.socials = socials;
+ if (Number(f.buyAmount) > 0 && f.picked.some((p) => p.symbol === f.buyMarket)) {
+ body.dev_buy = { market: f.buyMarket, amount: f.buyAmount.trim() };
+ }
+ return body;
+}
+
+// ── Boot ───────────────────────────────────────────────────────────────────
+
+async function boot() {
+ const params = new URL(location.href).searchParams;
+ state.form.name = (params.get('name') || '').slice(0, 32);
+ if (params.get('symbol')) {
+ state.form.symbol = suggestSymbol(params.get('symbol'));
+ state.form.symbolTouched = true;
+ } else state.form.symbol = suggestSymbol(state.form.name);
+ const wantedMarkets = (params.get('markets') || '').split(',').map((s) => s.trim().replace(/^\$/, '').toUpperCase()).filter(Boolean);
+ render();
+
+ const [me, markets] = await Promise.allSettled([
+ fetch('/api/auth/me', { credentials: 'include' }).then((r) => (r.ok ? r.json() : null)),
+ getJson('/api/v1/robinhood/paired-markets'),
+ ]);
+ if (markets.status === 'fulfilled') {
+ state.markets = markets.value.markets;
+ for (const sym of wantedMarkets.slice(0, MAX_MARKETS)) {
+ const m = state.markets.find((x) => x.symbol.toUpperCase() === sym);
+ if (m && !state.form.picked.some((p) => p.symbol === m.symbol)) state.form.picked.push({ symbol: m.symbol, bps: 0 });
+ }
+ evenSplit();
+ } else state.marketsError = explainLoad(markets.reason);
+
+ state.user = me.status === 'fulfilled' ? me.value?.user || null : null;
+ if (state.user) {
+ try {
+ const { agents = [] } = await getJson('/api/agents');
+ state.agents = agents;
+ const wanted = params.get('agent');
+ state.form.agentId = (agents.find((a) => a.id === wanted) || agents[0])?.id || '';
+ } catch (err) {
+ state.agentsError = explainLoad(err);
+ state.agents = [];
+ }
+ } else state.agents = [];
+ render();
+ scheduleQuote(0);
+}
+
+// ── Rendering ──────────────────────────────────────────────────────────────
+
+function emptyCard(title, text, action) {
+ return `<section class="pc-empty"><h2>${esc(title)}</h2><p>${text}</p><div>${action}</div></section>`;
+}
+
+function render() {
+ const root = $('#pl-app');
+ if (state.agents === null) {
+ root.innerHTML = `<div class="pc-launch"><div class="cv-skel" style="height:620px;border-radius:14px"></div><div class="cv-skel" style="height:380px;border-radius:14px"></div></div>`;
+ return;
+ }
+ if (state.agentsError) {
+ root.innerHTML = emptyCard('Could not load your agents', esc(state.agentsError), '<button type="button" class="pc-btn" id="pl-retry">Try again</button>');
+ $('#pl-retry').addEventListener('click', () => location.reload());
+ return;
+ }
+ if (!state.user) {
+ const next = encodeURIComponent(location.pathname + location.search);
+ root.innerHTML = emptyCard(
+ 'Sign in to launch',
+ 'Your agent signs the launch with its own wallet, so you need to be signed in as its owner. Browse <a href="/markets/robinhood/paired">paired coins</a> in the meantime.',
+ `<a class="pc-btn pc-btn-primary" href="/login?next=${next}">Sign in</a>`,
+ ) + botsCard();
+ return;
+ }
+ if (!state.agents.length) {
+ root.innerHTML = emptyCard(
+ 'Create an agent first',
+ 'Paired coins launch from an agent\'s own wallet. Create a 3D agent and it gets a wallet that works on Robinhood Chain.',
+ '<a class="pc-btn pc-btn-primary" href="/create">Create an agent</a>',
+ ) + botsCard();
+ return;
+ }
+ if (state.launched) {
+ root.innerHTML = successCard(state.launched) + botsCard();
+ $('#pl-again').addEventListener('click', () => {
+ state.launched = null;
+ Object.assign(state.form, { name: '', symbol: '', symbolTouched: false, description: '', buyAmount: '' });
+ render();
+ scheduleQuote(0);
+ });
+ return;
+ }
+ root.innerHTML = `<div class="pc-launch">${formCard()}<aside id="pl-side">${summaryCard()}</aside></div>${botsCard()}`;
+ wireForm();
+ paintPicker();
+ paintAlloc();
+ wireSummary();
+}
+
+function formCard() {
+ const f = state.form;
+ const agent = selectedAgent();
+ const options = state.agents.map((a) => `<option value="${esc(a.id)}" ${a.id === f.agentId ? 'selected' : ''}>${esc(a.name || 'Agent')}</option>`).join('');
+ const logoHint = agent?.avatar_thumbnail_url ? "Leave empty to use your agent's avatar." : "An https:// image. Your agent's avatar is private, so add one here.";
+ return `
+ <form class="pc-panel" id="pl-form" novalidate>
+ <label class="pc-field"><span>Agent</span>
+ <select class="pc-input" id="f-agent">${options}</select>
+ </label>
+ <div class="pc-row">
+ <label class="pc-field"><span>Coin name</span>
+ <input class="pc-input" id="f-name" maxlength="32" autocomplete="off" placeholder="${esc(agent?.name || 'My agent coin')}" value="${esc(f.name)}" required />
+ </label>
+ <label class="pc-field pc-ticker"><span>Ticker</span>
+ <input class="pc-input mono" id="f-symbol" maxlength="10" autocomplete="off" placeholder="TICKER" value="${esc(f.symbol)}" required />
+ </label>
+ </div>
+
+ <div class="pc-picker">
+ <div class="pc-field" style="gap:0.2rem"><span>Pair with <em>up to ${MAX_MARKETS}</em></span><small>Each market gets its own bonding curve. Your agent does not need to hold any of them.</small></div>
+ <div class="pc-picker-search">
+ <div class="pc-tabs" id="pl-classes" role="tablist" aria-label="Asset class"></div>
+ <input class="pc-input" id="pl-search" type="search" placeholder="Search" aria-label="Search markets" style="flex:1;min-width:120px" />
+ </div>
+ <div class="pc-chips" id="pl-chips" role="group" aria-label="Markets"></div>
+ </div>
+
+ <div class="pc-alloc" id="pl-alloc" aria-live="polite"></div>
+
+ <label class="pc-field"><span>Description <em>optional</em></span>
+ <textarea class="pc-input" id="f-description" maxlength="480" rows="3" placeholder="What is this coin about?">${esc(f.description)}</textarea>
+ </label>
+ <label class="pc-field"><span>Logo URL <em>optional</em></span>
+ <input class="pc-input" id="f-image" type="url" inputmode="url" maxlength="512" placeholder="https://" value="${esc(f.image)}" />
+ <small>${esc(logoHint)} It is copied onto three.ws so it can never change.</small>
+ </label>
+ <fieldset class="pc-field" style="border:0;padding:0;margin:0"><legend style="padding:0;margin-bottom:0.35rem">Links <em>optional</em></legend>
+ <div class="pc-row">
+ <input class="pc-input" id="f-website" type="url" inputmode="url" maxlength="200" placeholder="https://your-site" aria-label="Website" value="${esc(f.website)}" />
+ <input class="pc-input" id="f-twitter" type="url" inputmode="url" maxlength="200" placeholder="https://x.com/…" aria-label="X link" value="${esc(f.twitter)}" />
+ <input class="pc-input" id="f-telegram" type="url" inputmode="url" maxlength="200" placeholder="https://t.me/…" aria-label="Telegram link" value="${esc(f.telegram)}" />
+ </div>
+ </fieldset>
+ <div class="pc-row" id="pl-buy"></div>
+ </form>`;
+}
+
+function paintPicker() {
+ const tabs = $('#pl-classes');
+ const chips = $('#pl-chips');
+ if (!tabs) return;
+ if (state.marketsError) {
+ chips.innerHTML = `<p class="pc-status is-error" role="alert">${esc(state.marketsError)} <button type="button" class="pc-btn" id="pl-mretry" style="min-height:28px">Retry</button></p>`;
+ $('#pl-mretry').addEventListener('click', async () => {
+ state.marketsError = '';
+ try {
+ state.markets = (await getJson('/api/v1/robinhood/paired-markets')).markets;
+ } catch (err) {
+ state.marketsError = explainLoad(err);
+ }
+ paintPicker();
+ });
+ return;
+ }
+ if (!state.markets) {
+ chips.innerHTML = '<div class="cv-skel" style="height:72px;width:100%;border-radius:10px"></div>';
+ return;
+ }
+ const classes = ['all', ...new Set(state.markets.map((m) => m.assetClass))];
+ tabs.innerHTML = classes
+ .map((k) => `<button type="button" class="pc-tab" role="tab" data-class="${esc(k)}" aria-selected="${k === state.klass}">${esc(k === 'all' ? 'All' : CLASS_LABELS[k] || k)}</button>`)
+ .join('');
+ const q = state.search.trim().toLowerCase();
+ const full = state.form.picked.length >= MAX_MARKETS;
+ const list = state.markets.filter((m) => (state.klass === 'all' || m.assetClass === state.klass) && (!q || m.symbol.toLowerCase().includes(q) || m.name.toLowerCase().includes(q)));
+ chips.innerHTML = list.length
+ ? list
+ .map((m) => {
+ const on = state.form.picked.some((p) => p.symbol === m.symbol);
+ return `<button type="button" class="pc-chip" data-symbol="${esc(m.symbol)}" aria-pressed="${on}" ${!on && full ? 'disabled' : ''} title="${esc(m.name)}: opens at ${esc(usd(m.openingValueUsd))}">${esc(m.symbol)}<small>${esc(CLASS_LABELS[m.assetClass] || '')}</small></button>`;
+ })
+ .join('')
+ : `<p class="pc-fine">No market matches "${esc(state.search)}".</p>`;
+}
+
+function paintAlloc() {
+ const host = $('#pl-alloc');
+ if (!host) return;
+ const f = state.form;
+ if (!f.picked.length) {
+ host.innerHTML = '<p class="pc-fine">Pick at least one market above. A coin paired with several splits its one billion supply across them.</p>';
+ paintBuy();
+ return;
+ }
+ const total = totalBps();
+ host.innerHTML = `${f.picked
+ .map((p, i) => {
+ const m = marketBySymbol(p.symbol);
+ return `<div class="pc-alloc-row">
+ <span><strong>${esc(p.symbol)}</strong><br />${m ? classChip(m.assetClass) : ''}</span>
+ <input type="range" min="1" max="100" step="1" value="${Math.round(p.bps / 100)}" data-i="${i}" aria-label="${esc(p.symbol)} share of supply" />
+ <div class="pc-unit"><input class="pc-input mono" data-pct="${i}" inputmode="decimal" value="${esc(+(p.bps / 100).toFixed(2))}" aria-label="${esc(p.symbol)} percent" /><span>%</span></div>
+ <button type="button" class="pc-x" data-remove="${i}" aria-label="Remove ${esc(p.symbol)}">×</button>
+ </div>`;
+ })
+ .join('')}
+ <div class="pc-alloc-total ${total === 10000 ? '' : 'is-bad'}"><span>Total <strong>${esc(+(total / 100).toFixed(2))}%</strong>${total === 10000 ? '' : ' (must be exactly 100%)'}</span>${f.picked.length > 1 ? '<button type="button" class="pc-btn" id="pl-even" style="min-height:28px">Even split</button>' : ''}</div>`;
+
+ host.querySelectorAll('input[type="range"]').forEach((r) =>
+ r.addEventListener('input', () => {
+ f.picked[Number(r.dataset.i)].bps = Number(r.value) * 100;
+ host.querySelector(`[data-pct="${r.dataset.i}"]`).value = r.value;
+ paintTotal();
+ scheduleQuote();
+ }),
+ );
+ host.querySelectorAll('[data-pct]').forEach((input) =>
+ input.addEventListener('input', () => {
+ const v = Math.max(0, Math.min(100, Number(input.value) || 0));
+ f.picked[Number(input.dataset.pct)].bps = Math.round(v * 100);
+ host.querySelector(`input[type="range"][data-i="${input.dataset.pct}"]`).value = String(Math.round(v));
+ paintTotal();
+ scheduleQuote();
+ }),
+ );
+ host.querySelectorAll('[data-remove]').forEach((b) =>
+ b.addEventListener('click', () => {
+ f.picked.splice(Number(b.dataset.remove), 1);
+ evenSplit();
+ paintPicker();
+ paintAlloc();
+ scheduleQuote();
+ }),
+ );
+ $('#pl-even')?.addEventListener('click', () => {
+ evenSplit();
+ paintAlloc();
+ scheduleQuote();
+ });
+ paintBuy();
+}
+
+function paintTotal() {
+ const el = $('.pc-alloc-total');
+ if (!el) return;
+ const total = totalBps();
+ el.classList.toggle('is-bad', total !== 10000);
+ el.querySelector('span').innerHTML = `Total <strong>${esc(+(total / 100).toFixed(2))}%</strong>${total === 10000 ? '' : ' (must be exactly 100%)'}`;
+}
+
+function paintBuy() {
+ const host = $('#pl-buy');
+ if (!host) return;
+ const f = state.form;
+ if (!f.picked.length) {
+ host.innerHTML = '';
+ return;
+ }
+ if (!f.picked.some((p) => p.symbol === f.buyMarket)) f.buyMarket = f.picked[0].symbol;
+ host.innerHTML = `
+ <label class="pc-field"><span>Opening buy <em>optional</em></span>
+ <div class="pc-unit"><input class="pc-input mono" id="f-buy" inputmode="decimal" autocomplete="off" placeholder="0.0" value="${esc(f.buyAmount)}" /><span>${esc(f.buyMarket)}</span></div>
+ <small>Bought in the launch transaction itself, so nobody trades the curve first. Spends the agent's ${esc(f.buyMarket)}.</small>
+ </label>
+ <label class="pc-field pc-ticker"><span>Buy with</span>
+ <select class="pc-input" id="f-buy-market">${f.picked.map((p) => `<option ${p.symbol === f.buyMarket ? 'selected' : ''}>${esc(p.symbol)}</option>`).join('')}</select>
+ </label>`;
+ $('#f-buy').addEventListener('input', (e) => {
+ const clean = e.target.value.replace(/[^0-9.]/g, '');
+ if (clean !== e.target.value) e.target.value = clean;
+ f.buyAmount = clean;
+ scheduleQuote();
+ });
+ $('#f-buy-market').addEventListener('change', (e) => {
+ f.buyMarket = e.target.value;
+ paintBuy();
+ scheduleQuote();
+ });
+}
+
+function summaryCard() {
+ const q = state.quote;
+ const f = state.form;
+ if (state.quoteError) {
+ return `<section class="pc-panel"><h2 class="cv-h2">Cost</h2><p class="pc-status is-error" role="alert">${esc(state.quoteError)}</p>
+ <button type="button" class="pc-btn" id="pl-requote">Try again</button></section>`;
+ }
+ if (!q) {
+ const need = !f.name.trim() || !f.symbol.trim() ? 'Name the coin and pick a ticker' : !f.picked.length ? 'Pick at least one market' : totalBps() !== 10000 ? 'Make the shares total 100%' : '';
+ return `<section class="pc-panel"><h2 class="cv-h2">Cost</h2>
+ ${state.quoting ? '<div class="cv-skel" style="height:1.1rem"></div><div class="cv-skel" style="height:1.1rem"></div><div class="cv-skel" style="height:1.1rem"></div>' : `<p class="pc-fine">${esc(need || 'Pricing…')} to see the live cost.</p>`}
+ <button type="button" class="pc-btn pc-btn-primary" disabled>Launch paired coin</button></section>`;
+ }
+ const opening = q.pairs.every((p) => p.opening_value_usd != null) ? q.pairs.reduce((s, p) => s + p.opening_value_usd, 0) : null;
+ const blockers = q.blockers.length ? `<ul class="pc-blockers" role="alert">${q.blockers.map((b) => `<li>${esc(b)}</li>`).join('')}</ul>` : '';
+ return `
+ <section class="pc-panel" ${state.quoting ? 'style="opacity:0.7"' : ''}>
+ <h2 class="cv-h2">$${esc(q.coin.symbol)} pools</h2>
+ <dl class="pc-out">${q.pairs
+ .map((p) => `<dt>${esc(p.symbol)} · ${esc(p.weight_pct)}%</dt><dd>${p.opening_value_usd != null ? `opens ${esc(usd(p.opening_value_usd))}` : 'unpriced'}</dd>`)
+ .join('')}${opening != null ? `<dt><strong>Opening market cap</strong></dt><dd><strong>${esc(usd(opening))}</strong></dd>` : ''}</dl>
+ <h2 class="cv-h2">Cost</h2>
+ <dl class="pc-out">
+ <dt>Launch fee</dt><dd>${esc(q.cost.launch_fee_eth)} ETH</dd>
+ <dt>${q.cost.gas_estimated ? 'Network gas' : 'Network gas (typical)'}</dt><dd>${esc(amount(q.cost.gas_eth))} ETH</dd>
+ ${q.opening_buy ? `<dt>Opening buy</dt><dd>${esc(q.opening_buy.amount)} ${esc(q.opening_buy.market)}</dd>` : ''}
+ <dt><strong>Total ETH</strong></dt><dd><strong>${esc(amount(q.cost.total_eth))} ETH</strong></dd>
+ ${q.cost.total_usd != null ? `<dt>All in</dt><dd>≈ ${esc(usd(q.cost.total_usd, { compact: false }))}</dd>` : ''}
+ </dl>
+ ${q.opening_buy ? `<p class="pc-fine" style="color:var(--cv-text-2)">Your agent receives <strong>${esc(amount(q.opening_buy.tokens, 0))} $${esc(q.coin.symbol)}</strong>, ${esc(q.opening_buy.pct_of_supply)}% of supply.</p>` : ''}
+ <div class="pc-field" style="gap:0.3rem">
+ <span>${esc(q.agent.name || 'Agent')} wallet on Robinhood Chain</span>
+ <div style="display:flex;align-items:center;gap:0.5rem;flex-wrap:wrap">
+ <code title="${esc(q.wallet.address)}">${esc(short(q.wallet.address))}</code>
+ <button type="button" class="pc-btn" id="pl-copy" data-copy="${esc(q.wallet.address)}" style="min-height:28px" aria-label="Copy wallet address">Copy</button>
+ <span class="cv-mono" style="margin-left:auto">${esc(amount(q.wallet.balance_eth))} ETH</span>
+ </div>
+ </div>
+ ${blockers}
+ <button type="button" class="pc-btn pc-btn-primary" id="pl-launch" ${q.ready && !state.quoting ? '' : 'disabled'}>Launch paired coin</button>
+ <p class="pc-fine">Swap fee ${esc(q.terms.swap_fee_bps / 100)}% per trade, ${esc(q.terms.creator_share_bps / 100)}% of it paid to your agent in each pool's asset. Liquidity is locked forever and there is no migration.</p>
+ </section>`;
+}
+
+function successCard(r) {
+ return `
+ <section class="pc-panel" style="max-width:720px">
+ <p class="cv-sub" style="margin:0">Live on Robinhood Chain</p>
+ <h2 class="cv-h2" style="font-size:1.5rem">$${esc(r.symbol)} is trading</h2>
+ <p style="margin:0;color:var(--cv-text-2)">${esc(r.name)} launched from your agent's wallet in block ${esc(r.block.toLocaleString('en-US'))}, paired with ${esc(r.pairs.map((p) => `${p.symbol} ${p.weight_pct}%`).join(', '))}.${r.opening_buy ? ` The opening buy of ${esc(r.opening_buy.amount)} ${esc(r.opening_buy.market)} bought ${esc(amount(r.opening_buy.tokens, 0))} $${esc(r.symbol)}.` : ''}</p>
+ <code>${esc(r.token)}</code>
+ <div class="pc-hero-actions">
+ <a class="pc-btn pc-btn-primary" href="${esc(r.urls.coin)}">Open the coin page</a>
+ <a class="pc-btn" href="${esc(r.urls.explorer)}" target="_blank" rel="noopener noreferrer">Transaction ↗</a>
+ <button type="button" class="pc-btn" id="pl-again">Launch another</button>
+ </div>
+ </section>`;
+}
+
+function botsCard() {
+ const id = state.form.agentId || '<agent-id>';
+ return `
+ <section class="pc-panel" style="margin-top:1.25rem">
+ <h2 class="cv-h2">Let your agent and your bots launch</h2>
+ <p class="pc-fine" style="font-size:0.875rem;color:var(--cv-text-2)">The same launch is one API call, so a bot can quote, check with you, then launch. Use an API key with spend permission, give your agent the <code>paired-launch</code> skill, or connect the three.ws MCP server and call <code>paired_launch_quote</code> then <code>paired_launch</code>.</p>
+ <pre class="pc-code"><code>curl -X POST https://three.ws/api/agents/${esc(id)}/paired/quote \\
+ -H "authorization: Bearer $THREEWS_API_KEY" \\
+ -H "content-type: application/json" \\
+ -d '{"name":"Chip Stack","symbol":"CHIPS","markets":["NVDA","WETH","USDG"],"weights":[50,30,20]}'
+
+# The same body to /paired/launch sends it.</code></pre>
+ <a href="/docs/paired-coins">Read the paired coins guide →</a>
+ </section>`;
+}
+
+// ── Wiring + live quote ────────────────────────────────────────────────────
+
+function wireForm() {
+ const f = state.form;
+ const bind = (sel, key, after) => {
+ const input = $(sel);
+ input.addEventListener('input', () => {
+ f[key] = input.value;
+ after?.(input);
+ scheduleQuote();
+ });
+ };
+ $('#f-agent').addEventListener('change', (e) => {
+ f.agentId = e.target.value;
+ state.quote = null;
+ render();
+ scheduleQuote(0);
+ });
+ bind('#f-name', 'name', () => {
+ if (!f.symbolTouched) {
+ f.symbol = suggestSymbol(f.name);
+ $('#f-symbol').value = f.symbol;
+ }
+ });
+ bind('#f-symbol', 'symbol', (input) => {
+ f.symbolTouched = true;
+ const clean = input.value.toUpperCase().replace(/[^A-Z0-9]/g, '');
+ if (clean !== input.value) input.value = clean;
+ f.symbol = clean;
+ });
+ bind('#f-description', 'description');
+ bind('#f-image', 'image');
+ bind('#f-website', 'website');
+ bind('#f-twitter', 'twitter');
+ bind('#f-telegram', 'telegram');
+ $('#pl-classes').addEventListener('click', (e) => {
+ const tab = e.target.closest('[data-class]');
+ if (!tab) return;
+ state.klass = tab.dataset.class;
+ paintPicker();
+ });
+ let t;
+ $('#pl-search').addEventListener('input', (e) => {
+ clearTimeout(t);
+ t = setTimeout(() => {
+ state.search = e.target.value;
+ paintPicker();
+ }, 120);
+ });
+ $('#pl-chips').addEventListener('click', (e) => {
+ const chip = e.target.closest('[data-symbol]');
+ if (!chip || chip.disabled) return;
+ const sym = chip.dataset.symbol;
+ const i = f.picked.findIndex((p) => p.symbol === sym);
+ if (i >= 0) f.picked.splice(i, 1);
+ else if (f.picked.length < MAX_MARKETS) f.picked.push({ symbol: sym, bps: 0 });
+ evenSplit();
+ paintPicker();
+ paintAlloc();
+ scheduleQuote();
+ });
+ $('#pl-form').addEventListener('submit', (e) => e.preventDefault());
+}
+
+function wireSummary() {
+ $('#pl-requote')?.addEventListener('click', () => scheduleQuote(0));
+ $('#pl-launch')?.addEventListener('click', confirmLaunch);
+ const copy = $('#pl-copy');
+ copy?.addEventListener('click', async () => {
+ try {
+ await navigator.clipboard.writeText(copy.dataset.copy);
+ copy.textContent = 'Copied';
+ } catch {
+ copy.textContent = 'Select and copy';
+ }
+ });
+}
+
+function paintSummary() {
+ const side = $('#pl-side');
+ if (!side) return;
+ side.innerHTML = summaryCard();
+ wireSummary();
+}
+
+let quoteTimer = null;
+function scheduleQuote(delay = 450) {
+ clearTimeout(quoteTimer);
+ quoteTimer = setTimeout(runQuote, delay);
+}
+
+async function runQuote() {
+ const body = requestBody();
+ if (!state.form.agentId || !body.name || !body.symbol || !body.markets.length || totalBps() !== 10000) {
+ state.quote = null;
+ state.quoteError = '';
+ paintSummary();
+ return;
+ }
+ const seq = ++state.quoteSeq;
+ state.quoting = true;
+ state.quoteError = '';
+ paintSummary();
+ try {
+ const data = await getJson(`/api/agents/${encodeURIComponent(state.form.agentId)}/paired/quote`, {
+ method: 'POST',
+ headers: { 'content-type': 'application/json', accept: 'application/json' },
+ body: JSON.stringify(body),
+ });
+ if (seq !== state.quoteSeq) return;
+ state.quote = data;
+ } catch (err) {
+ if (seq !== state.quoteSeq) return;
+ state.quote = null;
+ state.quoteError = explainLoad(err);
+ } finally {
+ if (seq === state.quoteSeq) {
+ state.quoting = false;
+ paintSummary();
+ }
+ }
+}
+
+// ── Launch ─────────────────────────────────────────────────────────────────
+
+function confirmLaunch() {
+ const q = state.quote;
+ if (!q?.ready || state.launching) return;
+ const dialog = document.createElement('dialog');
+ dialog.className = 'pc-dialog';
+ dialog.setAttribute('aria-labelledby', 'pl-dialog-title');
+ dialog.innerHTML = `
+ <h2 id="pl-dialog-title" class="cv-h2">Launch $${esc(q.coin.symbol)}?</h2>
+ <p class="pc-fine" style="font-size:0.875rem;color:var(--cv-text-2)">This spends real funds from your agent's wallet and creates a coin anyone can trade. It cannot be undone.</p>
+ <dl class="pc-out">
+ <dt>From</dt><dd>${esc(q.agent.name || 'Agent')} · ${esc(short(q.wallet.address))}</dd>
+ <dt>To</dt><dd>Paired launchpad ${esc(short(q.launchpad))}</dd>
+ <dt>Chain</dt><dd>Robinhood Chain (${esc(q.chain_id)})</dd>
+ <dt>Pairs</dt><dd>${esc(q.pairs.map((p) => `${p.symbol} ${p.weight_pct}%`).join(', '))}</dd>
+ <dt><strong>Amount</strong></dt><dd><strong>${esc(amount(q.cost.total_eth))} ETH</strong>${q.opening_buy ? ` + ${esc(q.opening_buy.amount)} ${esc(q.opening_buy.market)}` : ''}</dd>
+ </dl>
+ <div class="pc-dialog-actions">
+ <button type="button" class="pc-btn" id="pl-cancel">Cancel</button>
+ <button type="button" class="pc-btn pc-btn-primary" id="pl-go">Launch</button>
+ </div>`;
+ document.body.appendChild(dialog);
+ const close = () => {
+ dialog.close();
+ dialog.remove();
+ };
+ dialog.addEventListener('cancel', close);
+ $('#pl-cancel', dialog).addEventListener('click', close);
+ $('#pl-go', dialog).addEventListener('click', async () => {
+ close();
+ await launch();
+ });
+ dialog.showModal();
+ $('#pl-go', dialog).focus();
+}
+
+async function launch() {
+ if (!(await ensureRiskAck({ context: 'paired-launch' }))) return;
+ state.launching = true;
+ const btn = $('#pl-launch');
+ if (btn) {
+ btn.disabled = true;
+ btn.textContent = 'Signing and sending…';
+ btn.classList.add('is-busy');
+ }
+ try {
+ state.launched = await getJson(`/api/agents/${encodeURIComponent(state.form.agentId)}/paired/launch`, {
+ method: 'POST',
+ headers: { 'content-type': 'application/json', accept: 'application/json' },
+ body: JSON.stringify(requestBody()),
+ });
+ render();
+ window.scrollTo({ top: 0, behavior: 'smooth' });
+ } catch (err) {
+ state.quoteError = explainLoad(err);
+ state.quote = null;
+ paintSummary();
+ } finally {
+ state.launching = false;
+ }
+}
+
+boot();
diff --git a/src/paired/paired.css b/src/paired/paired.css
new file mode 100644
index 000000000..b45304ef3
--- /dev/null
+++ b/src/paired/paired.css
@@ -0,0 +1,807 @@
+/* Paired coins on Robinhood Chain: hub, coin page and launch page.
+ Built on the coin-page tokens (--cv-*) so it follows the light/dark theme. */
+
+.pc-hero-lede {
+ max-width: 720px;
+ margin: 0.5rem 0 0;
+ color: var(--cv-text-2);
+ font-size: 0.9375rem;
+ line-height: 1.55;
+}
+.pc-hero-actions {
+ display: flex;
+ flex-wrap: wrap;
+ gap: 0.5rem;
+ margin-top: 1rem;
+}
+
+.pc-btn {
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ gap: 0.4rem;
+ min-height: 40px;
+ padding: 0 1rem;
+ border: 1px solid var(--cv-border);
+ border-radius: var(--cv-radius-md);
+ background: var(--cv-surface-2);
+ color: var(--cv-text);
+ font: 600 0.875rem/1 var(--cv-font-sans);
+ text-decoration: none;
+ cursor: pointer;
+ transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
+}
+.pc-btn:hover {
+ border-color: var(--cv-border-hover);
+ background: var(--cv-surface-3);
+}
+.pc-btn:active {
+ transform: translateY(1px);
+}
+.pc-btn:focus-visible,
+.pc-input:focus-visible,
+.pc-chip:focus-visible,
+.pc-tab:focus-visible,
+.pc-card:focus-visible {
+ outline: 2px solid var(--cv-accent);
+ outline-offset: 2px;
+}
+.pc-btn[disabled] {
+ opacity: 0.5;
+ cursor: not-allowed;
+ transform: none;
+}
+.pc-btn-primary {
+ border-color: transparent;
+ background: var(--cv-accent-solid);
+ color: var(--cv-on-accent);
+}
+.pc-btn-primary:hover {
+ background: var(--cv-accent-hover);
+ border-color: transparent;
+}
+.pc-btn.is-busy::after {
+ content: '';
+ width: 12px;
+ height: 12px;
+ border: 2px solid currentColor;
+ border-right-color: transparent;
+ border-radius: 50%;
+ animation: pc-spin 0.7s linear infinite;
+}
+@keyframes pc-spin {
+ to {
+ transform: rotate(360deg);
+ }
+}
+
+/* Asset-class chips */
+.pc-class {
+ display: inline-flex;
+ align-items: center;
+ padding: 0.15rem 0.45rem;
+ border-radius: 999px;
+ font: 600 0.6875rem/1.3 var(--cv-font-mono);
+ letter-spacing: 0.02em;
+ white-space: nowrap;
+ background: var(--cv-surface-3);
+ color: var(--cv-text-2);
+}
+.pc-class-rwa-equity {
+ background: color-mix(in srgb, #60a5fa 18%, transparent);
+ color: #60a5fa;
+}
+.pc-class-stablecoin {
+ background: color-mix(in srgb, #34d399 18%, transparent);
+ color: #34d399;
+}
+.pc-class-crypto-major {
+ background: color-mix(in srgb, #a78bfa 18%, transparent);
+ color: #a78bfa;
+}
+.pc-class-crypto-native {
+ background: color-mix(in srgb, #fbbf24 18%, transparent);
+ color: #d4a017;
+}
+:root[data-theme='light'] .pc-class-rwa-equity { color: #1d4ed8; }
+:root[data-theme='light'] .pc-class-stablecoin { color: #047857; }
+:root[data-theme='light'] .pc-class-crypto-major { color: #6d28d9; }
+:root[data-theme='light'] .pc-class-crypto-native { color: #92400e; }
+
+.pc-logo {
+ flex: none;
+ border-radius: 50%;
+ object-fit: cover;
+ background: var(--cv-surface-3);
+}
+.pc-logo-fallback {
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ font: 700 1rem/1 var(--cv-font-sans);
+ color: var(--cv-text-2);
+}
+
+/* Coin cards (hub) */
+.pc-grid {
+ display: grid;
+ grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
+ gap: 0.875rem;
+}
+.pc-card {
+ display: flex;
+ flex-direction: column;
+ gap: 0.75rem;
+ padding: 1rem;
+ border: 1px solid var(--cv-border);
+ border-radius: var(--cv-radius-lg);
+ background: var(--cv-surface);
+ color: inherit;
+ text-decoration: none;
+ box-shadow: var(--cv-shadow-card);
+ transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
+ animation: pc-in 0.25s ease both;
+}
+.pc-card:hover {
+ border-color: var(--cv-border-hover);
+ transform: translateY(-2px);
+ box-shadow: var(--cv-shadow-card-hover);
+}
+@keyframes pc-in {
+ from {
+ opacity: 0;
+ transform: translateY(4px);
+ }
+}
+.pc-card-head {
+ display: flex;
+ align-items: center;
+ gap: 0.75rem;
+ min-width: 0;
+}
+.pc-card-id {
+ min-width: 0;
+}
+.pc-card-name {
+ margin: 0;
+ font: 700 1rem/1.25 var(--cv-font-sans);
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+.pc-card-sym {
+ font: 600 0.75rem/1.2 var(--cv-font-mono);
+ color: var(--cv-text-3);
+}
+.pc-card-mcap {
+ margin-left: auto;
+ text-align: right;
+ font: 700 0.9375rem/1.2 var(--cv-font-mono);
+}
+.pc-card-mcap small {
+ display: block;
+ font: 500 0.6875rem/1.2 var(--cv-font-sans);
+ color: var(--cv-text-3);
+}
+.pc-card-desc {
+ margin: 0;
+ color: var(--cv-text-2);
+ font-size: 0.8125rem;
+ line-height: 1.45;
+ display: -webkit-box;
+ -webkit-line-clamp: 2;
+ line-clamp: 2;
+ -webkit-box-orient: vertical;
+ overflow: hidden;
+}
+.pc-pairbar {
+ display: flex;
+ height: 6px;
+ border-radius: 999px;
+ overflow: hidden;
+ background: var(--cv-surface-3);
+}
+.pc-pairbar span {
+ height: 100%;
+}
+.pc-pairs {
+ display: flex;
+ flex-wrap: wrap;
+ gap: 0.35rem;
+}
+.pc-pair {
+ display: inline-flex;
+ align-items: center;
+ gap: 0.3rem;
+ font: 600 0.75rem/1 var(--cv-font-mono);
+ color: var(--cv-text-2);
+}
+.pc-pair i {
+ width: 8px;
+ height: 8px;
+ border-radius: 50%;
+}
+.pc-card-foot {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: 0.5rem;
+ font-size: 0.75rem;
+ color: var(--cv-text-3);
+}
+.pc-agent {
+ display: inline-flex;
+ align-items: center;
+ gap: 0.4rem;
+ min-width: 0;
+ color: var(--cv-text-2);
+ font-weight: 600;
+}
+.pc-agent img,
+.pc-agent .pc-agent-dot {
+ width: 20px;
+ height: 20px;
+ border-radius: 50%;
+ object-fit: cover;
+ background: var(--cv-surface-3);
+}
+.pc-agent span {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+/* Section toolbar + tabs */
+.pc-toolbar {
+ display: flex;
+ flex-wrap: wrap;
+ align-items: center;
+ justify-content: space-between;
+ gap: 0.75rem;
+ margin: 1.5rem 0 0.875rem;
+}
+.pc-toolbar h2 {
+ margin: 0;
+}
+.pc-tabs {
+ display: inline-flex;
+ flex-wrap: wrap;
+ gap: 0.25rem;
+ padding: 0.25rem;
+ border: 1px solid var(--cv-border);
+ border-radius: var(--cv-radius-md);
+ background: var(--cv-surface);
+}
+.pc-tab {
+ min-height: 32px;
+ padding: 0 0.75rem;
+ border: 0;
+ border-radius: var(--cv-radius-sm);
+ background: transparent;
+ color: var(--cv-text-2);
+ font: 600 0.8125rem/1 var(--cv-font-sans);
+ cursor: pointer;
+ transition: background 0.15s ease, color 0.15s ease;
+}
+.pc-tab:hover {
+ color: var(--cv-text);
+}
+.pc-tab[aria-selected='true'] {
+ background: var(--cv-surface-3);
+ color: var(--cv-text);
+}
+
+/* Markets board */
+.pc-markets {
+ width: 100%;
+ border-collapse: collapse;
+ font-size: 0.875rem;
+}
+.pc-markets th {
+ padding: 0.5rem 0.75rem;
+ text-align: left;
+ font: 600 0.6875rem/1 var(--cv-font-mono);
+ letter-spacing: 0.04em;
+ text-transform: uppercase;
+ color: var(--cv-text-3);
+ border-bottom: 1px solid var(--cv-border);
+}
+.pc-markets td {
+ padding: 0.625rem 0.75rem;
+ border-bottom: 1px solid var(--cv-border);
+}
+.pc-markets tr:hover td {
+ background: var(--cv-surface-2);
+}
+.pc-markets .num {
+ text-align: right;
+ font-family: var(--cv-font-mono);
+ white-space: nowrap;
+}
+.pc-market-sym {
+ display: flex;
+ flex-direction: column;
+ gap: 0.15rem;
+}
+.pc-market-sym strong {
+ font: 700 0.875rem/1.2 var(--cv-font-mono);
+}
+.pc-market-sym small {
+ color: var(--cv-text-3);
+ font-size: 0.75rem;
+ max-width: 280px;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+/* Coin page pools */
+.pc-pools {
+ display: grid;
+ grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
+ gap: 0.75rem;
+}
+.pc-pool {
+ display: flex;
+ flex-direction: column;
+ gap: 0.5rem;
+ padding: 0.875rem;
+ border: 1px solid var(--cv-border);
+ border-radius: var(--cv-radius-lg);
+ background: var(--cv-surface);
+ text-align: left;
+ color: inherit;
+ font: inherit;
+ cursor: pointer;
+ transition: border-color 0.15s ease, background 0.15s ease;
+}
+.pc-pool:hover {
+ border-color: var(--cv-border-hover);
+}
+.pc-pool[aria-pressed='true'] {
+ border-color: var(--cv-accent);
+ background: var(--cv-surface-2);
+}
+.pc-pool-head {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: 0.5rem;
+}
+.pc-pool-head strong {
+ font: 700 0.9375rem/1 var(--cv-font-mono);
+}
+.pc-pool dl {
+ display: grid;
+ grid-template-columns: 1fr auto;
+ gap: 0.3rem 0.75rem;
+ margin: 0;
+ font-size: 0.8125rem;
+}
+.pc-pool dt {
+ color: var(--cv-text-3);
+}
+.pc-pool dd {
+ margin: 0;
+ text-align: right;
+ font-family: var(--cv-font-mono);
+}
+.pc-progress {
+ height: 6px;
+ border-radius: 999px;
+ background: var(--cv-surface-3);
+ overflow: hidden;
+}
+.pc-progress span {
+ display: block;
+ height: 100%;
+ min-width: 2px;
+ background: var(--cv-accent-solid);
+ transition: width 0.4s ease;
+}
+
+/* Chart */
+.pc-chart {
+ position: relative;
+ height: 320px;
+ border: 1px solid var(--cv-border);
+ border-radius: var(--cv-radius-lg);
+ background: var(--cv-surface);
+ overflow: hidden;
+}
+.pc-chart-empty {
+ position: absolute;
+ inset: 0;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ gap: 0.35rem;
+ padding: 1rem;
+ text-align: center;
+ color: var(--cv-text-3);
+ font-size: 0.875rem;
+}
+.pc-chart-empty strong {
+ color: var(--cv-text-2);
+}
+
+/* Trades */
+.pc-trades {
+ width: 100%;
+ border-collapse: collapse;
+ font-size: 0.8125rem;
+}
+.pc-trades td,
+.pc-trades th {
+ padding: 0.5rem 0.625rem;
+ border-bottom: 1px solid var(--cv-border);
+ text-align: left;
+}
+.pc-trades th {
+ font: 600 0.6875rem/1 var(--cv-font-mono);
+ text-transform: uppercase;
+ letter-spacing: 0.04em;
+ color: var(--cv-text-3);
+}
+.pc-trades .num {
+ text-align: right;
+ font-family: var(--cv-font-mono);
+}
+.pc-buy {
+ color: var(--cv-green-text);
+ font-weight: 700;
+}
+.pc-sell {
+ color: var(--cv-red-text);
+ font-weight: 700;
+}
+
+/* Trade ticket */
+.pc-ticket {
+ display: flex;
+ flex-direction: column;
+ gap: 0.75rem;
+ padding: 1rem;
+ border: 1px solid var(--cv-border);
+ border-radius: var(--cv-radius-lg);
+ background: var(--cv-surface);
+}
+.pc-ticket h2 {
+ margin: 0;
+}
+.pc-side {
+ display: grid;
+ grid-template-columns: 1fr 1fr;
+ gap: 0.25rem;
+ padding: 0.25rem;
+ border-radius: var(--cv-radius-md);
+ background: var(--cv-surface-2);
+}
+.pc-side button {
+ min-height: 36px;
+ border: 0;
+ border-radius: var(--cv-radius-sm);
+ background: transparent;
+ color: var(--cv-text-2);
+ font: 700 0.875rem/1 var(--cv-font-sans);
+ cursor: pointer;
+}
+.pc-side button[aria-pressed='true'][data-side='buy'] {
+ background: var(--cv-green-soft);
+ color: var(--cv-green-text);
+}
+.pc-side button[aria-pressed='true'][data-side='sell'] {
+ background: var(--cv-red-soft);
+ color: var(--cv-red-text);
+}
+.pc-field {
+ display: flex;
+ flex-direction: column;
+ gap: 0.35rem;
+ font-size: 0.8125rem;
+ color: var(--cv-text-2);
+}
+.pc-field small {
+ color: var(--cv-text-3);
+ font-size: 0.75rem;
+ line-height: 1.4;
+}
+.pc-field em {
+ font-style: normal;
+ color: var(--cv-text-3);
+}
+.pc-input {
+ width: 100%;
+ min-height: 40px;
+ padding: 0.5rem 0.75rem;
+ border: 1px solid var(--cv-border);
+ border-radius: var(--cv-radius-md);
+ background: var(--cv-surface-2);
+ color: var(--cv-text);
+ font: 500 0.9375rem/1.3 var(--cv-font-sans);
+ box-sizing: border-box;
+ transition: border-color 0.15s ease, background 0.15s ease;
+}
+.pc-input:hover {
+ border-color: var(--cv-border-hover);
+}
+.pc-input.mono {
+ font-family: var(--cv-font-mono);
+}
+.pc-unit {
+ position: relative;
+}
+.pc-unit .pc-input {
+ padding-right: 4.5rem;
+}
+.pc-unit > span {
+ position: absolute;
+ right: 0.75rem;
+ top: 50%;
+ transform: translateY(-50%);
+ font: 600 0.75rem/1 var(--cv-font-mono);
+ color: var(--cv-text-3);
+ pointer-events: none;
+}
+.pc-out {
+ display: grid;
+ grid-template-columns: 1fr auto;
+ gap: 0.3rem 0.75rem;
+ margin: 0;
+ padding: 0.75rem;
+ border-radius: var(--cv-radius-md);
+ background: var(--cv-surface-2);
+ font-size: 0.8125rem;
+}
+.pc-out dt {
+ color: var(--cv-text-3);
+}
+.pc-out dd {
+ margin: 0;
+ text-align: right;
+ font-family: var(--cv-font-mono);
+}
+.pc-status {
+ margin: 0;
+ font-size: 0.8125rem;
+ line-height: 1.45;
+ color: var(--cv-text-2);
+ overflow-wrap: anywhere;
+}
+.pc-status.is-error {
+ color: var(--cv-red-text);
+}
+.pc-status.is-ok {
+ color: var(--cv-green-text);
+}
+.pc-status a {
+ color: inherit;
+}
+.pc-gate {
+ display: flex;
+ gap: 0.5rem;
+ align-items: flex-start;
+ padding: 0.75rem;
+ border: 1px solid var(--cv-border);
+ border-radius: var(--cv-radius-md);
+ font-size: 0.75rem;
+ line-height: 1.45;
+ color: var(--cv-text-2);
+}
+.pc-gate input {
+ margin-top: 0.15rem;
+}
+
+/* Launch page */
+.pc-launch {
+ display: grid;
+ grid-template-columns: minmax(0, 1fr) 360px;
+ gap: 1.25rem;
+ align-items: start;
+}
+.pc-panel {
+ display: flex;
+ flex-direction: column;
+ gap: 1rem;
+ padding: 1.25rem;
+ border: 1px solid var(--cv-border);
+ border-radius: var(--cv-radius-lg);
+ background: var(--cv-surface);
+}
+.pc-panel h2 {
+ margin: 0;
+}
+.pc-row {
+ display: flex;
+ gap: 0.75rem;
+}
+.pc-row > * {
+ flex: 1;
+ min-width: 0;
+}
+.pc-row > .pc-ticker {
+ flex: 0 0 140px;
+}
+.pc-picker {
+ display: flex;
+ flex-direction: column;
+ gap: 0.625rem;
+}
+.pc-picker-search {
+ display: flex;
+ gap: 0.5rem;
+}
+.pc-chips {
+ display: flex;
+ flex-wrap: wrap;
+ gap: 0.375rem;
+ max-height: 260px;
+ overflow: auto;
+ padding: 2px;
+}
+.pc-chip {
+ display: inline-flex;
+ align-items: center;
+ gap: 0.4rem;
+ min-height: 32px;
+ padding: 0 0.625rem;
+ border: 1px solid var(--cv-border);
+ border-radius: 999px;
+ background: var(--cv-surface-2);
+ color: var(--cv-text);
+ font: 600 0.8125rem/1 var(--cv-font-mono);
+ cursor: pointer;
+ transition: border-color 0.15s ease, background 0.15s ease;
+}
+.pc-chip:hover {
+ border-color: var(--cv-border-hover);
+}
+.pc-chip[aria-pressed='true'] {
+ border-color: var(--cv-accent);
+ background: color-mix(in srgb, var(--cv-accent) 14%, transparent);
+}
+.pc-chip[disabled] {
+ opacity: 0.45;
+ cursor: not-allowed;
+}
+.pc-chip small {
+ font: 500 0.6875rem/1 var(--cv-font-sans);
+ color: var(--cv-text-3);
+}
+.pc-alloc {
+ display: flex;
+ flex-direction: column;
+ gap: 0.5rem;
+}
+.pc-alloc-row {
+ display: grid;
+ grid-template-columns: 90px minmax(0, 1fr) 84px 32px;
+ align-items: center;
+ gap: 0.625rem;
+ font-size: 0.8125rem;
+}
+.pc-alloc-row strong {
+ font: 700 0.8125rem/1 var(--cv-font-mono);
+}
+.pc-alloc-row input[type='range'] {
+ width: 100%;
+ accent-color: var(--cv-accent-solid);
+}
+.pc-alloc-row .pc-input {
+ min-height: 32px;
+ padding: 0.25rem 0.5rem;
+ text-align: right;
+}
+.pc-x {
+ width: 32px;
+ height: 32px;
+ border: 0;
+ border-radius: var(--cv-radius-sm);
+ background: transparent;
+ color: var(--cv-text-3);
+ font-size: 1.1rem;
+ cursor: pointer;
+}
+.pc-x:hover {
+ background: var(--cv-surface-3);
+ color: var(--cv-text);
+}
+.pc-alloc-total {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ font-size: 0.8125rem;
+ color: var(--cv-text-2);
+}
+.pc-alloc-total.is-bad strong {
+ color: var(--cv-red-text);
+}
+.pc-blockers {
+ margin: 0;
+ padding-left: 1.1rem;
+ color: var(--cv-red-text);
+ font-size: 0.8125rem;
+ line-height: 1.45;
+}
+.pc-fine {
+ margin: 0;
+ font-size: 0.75rem;
+ line-height: 1.45;
+ color: var(--cv-text-3);
+}
+.pc-code {
+ margin: 0;
+ padding: 0.75rem;
+ border-radius: var(--cv-radius-md);
+ background: var(--cv-surface-2);
+ font: 0.75rem/1.5 var(--cv-font-mono);
+ overflow: auto;
+ white-space: pre;
+}
+.pc-empty {
+ padding: 2rem 1.25rem;
+ text-align: center;
+ border: 1px dashed var(--cv-border);
+ border-radius: var(--cv-radius-lg);
+ color: var(--cv-text-2);
+}
+.pc-empty h2,
+.pc-empty h3 {
+ margin: 0 0 0.5rem;
+ color: var(--cv-text);
+}
+.pc-empty p {
+ margin: 0 auto 1rem;
+ max-width: 520px;
+ line-height: 1.5;
+}
+.pc-dialog {
+ width: min(440px, calc(100vw - 32px));
+ padding: 1.25rem;
+ border: 1px solid var(--cv-border);
+ border-radius: var(--cv-radius-lg);
+ background: var(--cv-surface);
+ color: var(--cv-text);
+}
+.pc-dialog::backdrop {
+ background: rgba(0, 0, 0, 0.55);
+}
+.pc-dialog h2 {
+ margin: 0 0 0.5rem;
+}
+.pc-dialog-actions {
+ display: flex;
+ justify-content: flex-end;
+ gap: 0.5rem;
+ margin-top: 1rem;
+}
+
+@media (max-width: 900px) {
+ .pc-launch {
+ grid-template-columns: 1fr;
+ }
+}
+@media (max-width: 520px) {
+ .pc-row {
+ flex-direction: column;
+ }
+ .pc-row > .pc-ticker {
+ flex: 1;
+ }
+ .pc-alloc-row {
+ grid-template-columns: 70px minmax(0, 1fr) 72px 28px;
+ gap: 0.4rem;
+ }
+ .pc-chart {
+ height: 260px;
+ }
+}
+@media (prefers-reduced-motion: reduce) {
+ .pc-card,
+ .pc-btn,
+ .pc-progress span {
+ animation: none;
+ transition: none;
+ }
+}
diff --git a/src/paired/trade.js b/src/paired/trade.js
new file mode 100644
index 000000000..7a5bb392a
--- /dev/null
+++ b/src/paired/trade.js
@@ -0,0 +1,348 @@
+// The trade ticket on a paired coin's page: buy the coin with one of its quote
+// assets, or sell it back into that pool, from the visitor's own EVM wallet.
+//
+// Every number comes from the launchpad itself: quoteBuy / quoteSell price the
+// trade at the curve's current point, the minimum out is that quote less the
+// visitor's slippage, and the contract reverts rather than fill worse. An
+// approval is requested only for the exact amount being traded, never an
+// unlimited one, and only when the current allowance is short.
+//
+// Selling into a pool quoted in a tokenized stock delivers a Stock Token, so
+// that path carries the same eligibility disclosure the platform shows
+// wherever a Stock Token is the output, and needs the visitor to affirm it.
+
+import { BaseError, ContractFunctionRevertedError, createPublicClient, createWalletClient, custom, formatUnits, http, parseUnits } from 'viem';
+import { HOOD_MAINNET, ensureChain } from '../robinhood-purchase.js';
+import { amount, esc, short } from './common.js';
+
+const EXPLORER = 'https://robinhoodchain.blockscout.com';
+const TOKEN_DECIMALS = 18;
+
+const view = (name, inputs, outputs) => ({ name, type: 'function', stateMutability: 'view', inputs, outputs });
+const ERC20 = [
+ view('balanceOf', [{ type: 'address' }], [{ type: 'uint256' }]),
+ view('allowance', [{ type: 'address' }, { type: 'address' }], [{ type: 'uint256' }]),
+ { name: 'approve', type: 'function', stateMutability: 'nonpayable', inputs: [{ type: 'address' }, { type: 'uint256' }], outputs: [{ type: 'bool' }] },
+];
+const ERRORS = ['UnknownMarket', 'ZeroAmount', 'SlippageExceeded', 'Reentrancy'];
+const LAUNCHPAD = [
+ view('quoteBuy', [{ type: 'address' }, { type: 'address' }, { type: 'uint256' }], [{ name: 'tokensOut', type: 'uint256' }, { name: 'fee', type: 'uint256' }]),
+ view('quoteSell', [{ type: 'address' }, { type: 'address' }, { type: 'uint256' }], [{ name: 'quoteOut', type: 'uint256' }, { name: 'fee', type: 'uint256' }]),
+ {
+ name: 'buy',
+ type: 'function',
+ stateMutability: 'nonpayable',
+ inputs: [{ type: 'address' }, { type: 'address' }, { type: 'uint256' }, { type: 'uint256' }],
+ outputs: [{ type: 'uint256' }],
+ },
+ {
+ name: 'sell',
+ type: 'function',
+ stateMutability: 'nonpayable',
+ inputs: [{ type: 'address' }, { type: 'address' }, { type: 'uint256' }, { type: 'uint256' }],
+ outputs: [{ type: 'uint256' }],
+ },
+ ...ERRORS.map((name) => ({ name, type: 'error', inputs: [] })),
+];
+
+const REVERTS = {
+ SlippageExceeded: 'The price moved past your slippage before the trade landed. Nothing was traded. Raise slippage or try again.',
+ ZeroAmount: 'That amount is too small to trade, or more than the pool has left to sell.',
+ UnknownMarket: 'This coin does not trade in that pool.',
+};
+
+let reader;
+function client() {
+ if (!reader) reader = createPublicClient({ chain: HOOD_MAINNET, transport: http(undefined, { timeout: 10_000, retryCount: 2 }) });
+ return reader;
+}
+
+function explain(err) {
+ if (err instanceof BaseError) {
+ const reverted = err.walk((e) => e instanceof ContractFunctionRevertedError);
+ const name = reverted instanceof ContractFunctionRevertedError ? reverted.data?.errorName : null;
+ if (name) return REVERTS[name] || `The launchpad rejected the trade (${name}). Nothing was traded.`;
+ }
+ const text = String(err?.shortMessage || err?.message || err).toLowerCase();
+ if (text.includes('user rejected') || text.includes('user denied')) return 'You cancelled in your wallet. Nothing was traded.';
+ if (text.includes('insufficient funds')) return 'Your wallet needs a little ETH on Robinhood Chain for gas.';
+ if (text.includes('exceeds balance') || text.includes('insufficient balance')) return 'Your wallet does not hold enough for that amount.';
+ return err?.shortMessage || err?.message || 'The trade failed.';
+}
+
+/**
+ * Mount the ticket. `coin` is the coin-detail payload, `getPool()` returns the
+ * pool currently selected on the page, `onTraded()` refreshes the page data.
+ */
+export function mountTicket(container, { coin, getPool, onTraded }) {
+ const s = { side: 'buy', amount: '', slippage: 1, account: null, wallet: null, quote: null, quoting: false, busy: false, eligible: false, balances: null, status: null };
+ const launchpad = coin.terms.launchpad;
+ let seq = 0;
+ let timer = null;
+
+ const pool = () => getPool();
+ const inDecimals = () => (s.side === 'buy' ? pool().quoteDecimals : TOKEN_DECIMALS);
+ const inSymbol = () => (s.side === 'buy' ? pool().quoteSymbol : coin.symbol);
+ const outSymbol = () => (s.side === 'buy' ? coin.symbol : pool().quoteSymbol);
+ const needsGate = () => s.side === 'sell' && pool().quoteClass === 'rwa-equity';
+
+ function setStatus(text, kind = '') {
+ s.status = text ? { text, kind } : null;
+ const el = container.querySelector('#pc-t-status');
+ if (!el) return;
+ el.hidden = !text;
+ el.className = `pc-status${kind ? ` is-${kind}` : ''}`;
+ el.innerHTML = text || '';
+ }
+
+ function parsedIn() {
+ const text = String(s.amount).trim();
+ if (!text || !/^\d*\.?\d+$/.test(text)) return null;
+ try {
+ const v = parseUnits(text, inDecimals());
+ return v > 0n ? v : null;
+ } catch {
+ return null;
+ }
+ }
+
+ async function refreshBalances() {
+ if (!s.account) return;
+ const p = pool();
+ const [q, t] = await Promise.all([
+ client().readContract({ address: p.quoteToken, abi: ERC20, functionName: 'balanceOf', args: [s.account] }),
+ client().readContract({ address: coin.address, abi: ERC20, functionName: 'balanceOf', args: [s.account] }),
+ ]).catch(() => [null, null]);
+ s.balances = q == null ? null : { quote: q, token: t };
+ paintDynamic();
+ }
+
+ async function requote() {
+ const id = ++seq;
+ const amountIn = parsedIn();
+ if (!amountIn) {
+ s.quote = null;
+ paintDynamic();
+ return;
+ }
+ s.quoting = true;
+ paintDynamic();
+ try {
+ const p = pool();
+ const fn = s.side === 'buy' ? 'quoteBuy' : 'quoteSell';
+ const [out, fee] = await client().readContract({ address: launchpad, abi: LAUNCHPAD, functionName: fn, args: [coin.address, p.quoteToken, amountIn] });
+ if (id !== seq) return;
+ s.quote = { amountIn, out, fee };
+ } catch (err) {
+ if (id !== seq) return;
+ s.quote = null;
+ setStatus(explain(err), 'error');
+ } finally {
+ if (id === seq) {
+ s.quoting = false;
+ paintDynamic();
+ }
+ }
+ }
+
+ function scheduleQuote() {
+ clearTimeout(timer);
+ timer = setTimeout(requote, 250);
+ }
+
+ async function connect() {
+ if (!window.ethereum) {
+ setStatus('No browser wallet found. Install MetaMask or another EVM wallet to trade.', 'error');
+ return;
+ }
+ try {
+ await ensureChain(window.ethereum);
+ s.wallet = createWalletClient({ chain: HOOD_MAINNET, transport: custom(window.ethereum) });
+ const [addr] = await s.wallet.requestAddresses();
+ s.account = addr;
+ setStatus('');
+ paintDynamic();
+ await refreshBalances();
+ } catch (err) {
+ setStatus(explain(err), 'error');
+ }
+ }
+
+ async function execute() {
+ if (!s.quote || s.busy) return;
+ if (needsGate() && !s.eligible) return;
+ const p = pool();
+ const { amountIn, out } = s.quote;
+ const minOut = (out * BigInt(Math.round((100 - s.slippage) * 100))) / 10_000n;
+ const spend = s.side === 'buy' ? p.quoteToken : coin.address;
+ s.busy = true;
+ paintDynamic();
+ try {
+ await ensureChain(window.ethereum);
+ const allowance = await client().readContract({ address: spend, abi: ERC20, functionName: 'allowance', args: [s.account, launchpad] });
+ if (allowance < amountIn) {
+ setStatus(`Approve ${esc(amount(formatUnits(amountIn, inDecimals())))} ${esc(inSymbol())} in your wallet (this exact amount only).`);
+ const approveHash = await s.wallet.writeContract({ account: s.account, address: spend, abi: ERC20, functionName: 'approve', args: [launchpad, amountIn] });
+ await client().waitForTransactionReceipt({ hash: approveHash });
+ }
+ setStatus(`Confirm the ${s.side} in your wallet.`);
+ const hash = await s.wallet.writeContract({
+ account: s.account,
+ address: launchpad,
+ abi: LAUNCHPAD,
+ functionName: s.side,
+ args: [coin.address, p.quoteToken, amountIn, minOut],
+ });
+ setStatus(`Submitted. Waiting for Robinhood Chain… <a href="${EXPLORER}/tx/${esc(hash)}" target="_blank" rel="noopener noreferrer">${esc(short(hash))} ↗</a>`);
+ const receipt = await client().waitForTransactionReceipt({ hash });
+ if (receipt.status !== 'success') throw new Error('The trade reverted on chain. Only gas was spent.');
+ setStatus(
+ `Done: ${s.side === 'buy' ? 'bought' : 'sold'} for at least ${esc(amount(formatUnits(minOut, s.side === 'buy' ? TOKEN_DECIMALS : p.quoteDecimals)))} ${esc(outSymbol())}. <a href="${EXPLORER}/tx/${esc(hash)}" target="_blank" rel="noopener noreferrer">View transaction ↗</a>`,
+ 'ok',
+ );
+ s.amount = '';
+ s.quote = null;
+ const input = container.querySelector('#pc-t-amount');
+ if (input) input.value = '';
+ await refreshBalances();
+ onTraded?.();
+ } catch (err) {
+ setStatus(explain(err), 'error');
+ } finally {
+ s.busy = false;
+ paintDynamic();
+ }
+ }
+
+ /** The parts that change while the visitor types: quote, gate, button, balance. */
+ function paintDynamic() {
+ const p = pool();
+ const balIn = s.balances ? (s.side === 'buy' ? s.balances.quote : s.balances.token) : null;
+ const over = balIn != null && s.quote && s.quote.amountIn > balIn;
+ const outDecimals = s.side === 'buy' ? TOKEN_DECIMALS : p.quoteDecimals;
+ const minOut = s.quote ? (s.quote.out * BigInt(Math.round((100 - s.slippage) * 100))) / 10_000n : 0n;
+
+ const outEl = container.querySelector('#pc-t-out');
+ if (outEl) {
+ outEl.innerHTML = s.quote
+ ? `<dl class="pc-out">
+ <dt>You receive about</dt><dd>${esc(amount(formatUnits(s.quote.out, outDecimals)))} ${esc(outSymbol())}</dd>
+ <dt>Minimum after ${esc(s.slippage)}% slippage</dt><dd>${esc(amount(formatUnits(minOut, outDecimals)))}</dd>
+ <dt>Swap fee</dt><dd>${esc(amount(formatUnits(s.quote.fee, p.quoteDecimals)))} ${esc(p.quoteSymbol)}</dd>
+ </dl>`
+ : s.quoting
+ ? '<div class="cv-skel" style="height:84px;border-radius:10px"></div>'
+ : '';
+ }
+
+ const gateEl = container.querySelector('#pc-t-gatebox');
+ if (gateEl) {
+ gateEl.innerHTML = needsGate()
+ ? `<label class="pc-gate"><input type="checkbox" id="pc-t-gate" ${s.eligible ? 'checked' : ''} /><span>Selling here pays out ${esc(p.quoteSymbol)}, a Stock Token: a tokenized debt security issued by Robinhood Assets (Jersey) Ltd that may not be offered, sold or delivered to US persons (extra limits apply in Canada, the UK and Switzerland). I confirm I am eligible to receive it.</span></label>`
+ : '';
+ gateEl.querySelector('#pc-t-gate')?.addEventListener('change', (e) => {
+ s.eligible = e.target.checked;
+ paintDynamic();
+ });
+ }
+
+ const balEl = container.querySelector('#pc-t-bal');
+ if (balEl) balEl.textContent = balIn != null ? ` · balance ${amount(formatUnits(balIn, inDecimals()))}` : '';
+ const maxEl = container.querySelector('#pc-t-max');
+ if (maxEl) maxEl.hidden = !(balIn != null && balIn > 0n);
+ const slipEl = container.querySelector('#pc-t-slipval');
+ if (slipEl) slipEl.textContent = `${s.slippage}%`;
+
+ const actionEl = container.querySelector('#pc-t-action');
+ if (actionEl) {
+ if (!s.account) {
+ actionEl.innerHTML = '<button type="button" class="pc-btn pc-btn-primary" id="pc-t-connect" style="width:100%">Connect wallet</button>';
+ actionEl.querySelector('#pc-t-connect').addEventListener('click', connect);
+ } else {
+ const ready = s.quote && !s.quoting && !s.busy && !over && (!needsGate() || s.eligible);
+ const label = s.busy ? 'Confirm in your wallet…' : over ? `Not enough ${inSymbol()}` : `${s.side === 'buy' ? 'Buy' : 'Sell'} $${coin.symbol}`;
+ actionEl.innerHTML = `<button type="button" class="pc-btn pc-btn-primary ${s.busy ? 'is-busy' : ''}" id="pc-t-go" style="width:100%" ${ready ? '' : 'disabled'}>${esc(label)}</button>`;
+ actionEl.querySelector('#pc-t-go').addEventListener('click', execute);
+ }
+ }
+ const footEl = container.querySelector('#pc-t-foot');
+ if (footEl) {
+ footEl.innerHTML = s.account
+ ? `Connected as <code>${esc(short(s.account))}</code> on Robinhood Chain.`
+ : 'No ETH on Robinhood Chain yet? <a href="https://jumper.exchange/?toChain=4663&amp;toToken=0x0000000000000000000000000000000000000000" target="_blank" rel="noopener noreferrer">Bridge in via LI.FI ↗</a>';
+ }
+ }
+
+ /** The ticket's shell, rebuilt only when the side or the pool changes. */
+ function paint() {
+ const p = pool();
+ container.innerHTML = `
+ <section class="pc-ticket" aria-label="Trade">
+ <h2 class="cv-h2">Trade $${esc(coin.symbol)}</h2>
+ <div class="pc-side" role="group" aria-label="Side">
+ <button type="button" data-side="buy" aria-pressed="${s.side === 'buy'}">Buy</button>
+ <button type="button" data-side="sell" aria-pressed="${s.side === 'sell'}">Sell</button>
+ </div>
+ <p class="pc-fine" style="margin:0">Pool: <strong>${esc(p.quoteSymbol)}</strong>. Pick another pool to trade in it.</p>
+ <label class="pc-field" for="pc-t-amount"><span>${s.side === 'buy' ? 'You pay' : 'You sell'}<em id="pc-t-bal"></em></span>
+ <div class="pc-unit"><input class="pc-input mono" id="pc-t-amount" inputmode="decimal" autocomplete="off" placeholder="0.0" value="${esc(s.amount)}" /><span>${esc(inSymbol())}</span></div>
+ </label>
+ <button type="button" class="pc-btn" id="pc-t-max" style="min-height:28px;align-self:flex-start" hidden>Max</button>
+ <label class="pc-field" for="pc-t-slip"><span>Slippage <em id="pc-t-slipval"></em></span>
+ <input type="range" id="pc-t-slip" min="0.1" max="10" step="0.1" value="${esc(s.slippage)}" />
+ </label>
+ <div id="pc-t-out" aria-live="polite"></div>
+ <div id="pc-t-gatebox"></div>
+ <div id="pc-t-action"></div>
+ <p class="pc-status" id="pc-t-status" role="status" hidden></p>
+ <p class="pc-fine" id="pc-t-foot"></p>
+ </section>`;
+ wire();
+ setStatus(s.status?.text || '', s.status?.kind || '');
+ paintDynamic();
+ }
+
+ function wire() {
+ container.querySelectorAll('[data-side]').forEach((b) =>
+ b.addEventListener('click', () => {
+ if (s.side === b.dataset.side) return;
+ s.side = b.dataset.side;
+ s.amount = '';
+ s.quote = null;
+ s.status = null;
+ paint();
+ }),
+ );
+ const input = container.querySelector('#pc-t-amount');
+ input.addEventListener('input', () => {
+ const clean = input.value.replace(/[^0-9.]/g, '');
+ if (clean !== input.value) input.value = clean;
+ s.amount = clean;
+ scheduleQuote();
+ });
+ container.querySelector('#pc-t-max').addEventListener('click', () => {
+ const bal = s.side === 'buy' ? s.balances.quote : s.balances.token;
+ s.amount = formatUnits(bal, inDecimals());
+ input.value = s.amount;
+ requote();
+ });
+ const slip = container.querySelector('#pc-t-slip');
+ slip.addEventListener('input', () => {
+ s.slippage = Number(slip.value);
+ paintDynamic();
+ });
+ }
+
+ paint();
+ return {
+ /** Called when the page switches pools: reprice in the new pool. */
+ poolChanged() {
+ s.quote = null;
+ s.eligible = false;
+ s.status = null;
+ paint();
+ refreshBalances();
+ if (parsedIn()) requote();
+ },
+ };
+}
diff --git a/src/robinhood-coin.js b/src/robinhood-coin.js
index cad47291b..b1092cbfa 100644
--- a/src/robinhood-coin.js
+++ b/src/robinhood-coin.js
@@ -170,6 +170,20 @@ function renderError(message) {
document.getElementById('rh-retry')?.addEventListener('click', main);
}
+/**
+ * A coin from the paired launchpad trades on its own curves, not a DEX pool,
+ * so it has its own page. Only asked when there is no DEX market, which every
+ * paired coin lacks and almost every other coin has.
+ */
+async function forwardIfPaired(address) {
+ const res = await fetch(`/api/v1/robinhood/paired-coins-detail?address=${encodeURIComponent(address)}`, {
+ headers: { accept: 'application/json' },
+ }).catch(() => null);
+ if (!res?.ok) return false;
+ location.replace(`/markets/robinhood/paired/${address}`);
+ return true;
+}
+
async function main() {
const address = addressFromPath();
if (!address) return;
@@ -178,10 +192,12 @@ async function main() {
try {
c = await getJson(`/api/v1/robinhood/coins-detail?address=${encodeURIComponent(address)}`);
} catch (err) {
+ if (err.status === 404 && (await forwardIfPaired(address))) return;
if (err.status === 404) renderNotFound(address);
else renderError(err.message);
return;
}
+ if (!c.market && (await forwardIfPaired(address))) return;
document.getElementById('rh-main').removeAttribute('aria-busy');
renderHead(c);
renderPools(c);
diff --git a/src/robinhood-purchase.js b/src/robinhood-purchase.js
index 6cf29a4a4..3e1c90367 100644
--- a/src/robinhood-purchase.js
+++ b/src/robinhood-purchase.js
@@ -15,7 +15,7 @@ import { createPublicClient, createWalletClient, custom, http, parseUnits, forma
// viem 2.52 (pinned in package.json) predates the official `robinhood` chain
// export in `viem/chains` (lands 2.55+) — inline chain def, same shape every
// other custom chain in this codebase uses (src/vault.js, src/erc8004/gasless-register.js).
-const HOOD_MAINNET = {
+export const HOOD_MAINNET = {
id: 4663,
name: 'Robinhood Chain',
nativeCurrency: { name: 'Ether', symbol: 'ETH', decimals: 18 },
@@ -118,7 +118,7 @@ async function bestQuote(tokenOutAddress, amountInWei) {
return ok.reduce((best, cur) => (cur.amountOut > best.amountOut ? cur : best));
}
-async function ensureChain(ethProvider) {
+export async function ensureChain(ethProvider) {
const hex = `0x${HOOD_MAINNET.id.toString(16)}`;
try {
await ethProvider.request({ method: 'wallet_switchEthereumChain', params: [{ chainId: hex }] });
diff --git a/src/robinhood.css b/src/robinhood.css
index 06ade5463..75976a880 100644
--- a/src/robinhood.css
+++ b/src/robinhood.css
@@ -174,6 +174,30 @@
border: 1px solid var(--cv-border);
}
+.rh-launch-cta {
+ font-size: 0.875rem;
+ font-weight: 600;
+ color: var(--cv-text-2);
+ text-decoration: none;
+ padding: 0.375rem 0.75rem;
+ border-radius: 999px;
+ border: 1px solid var(--cv-border);
+ transition:
+ color 0.15s ease,
+ border-color 0.15s ease,
+ background 0.15s ease;
+}
+
+.rh-launch-cta:hover {
+ color: var(--cv-text);
+ background: var(--cv-surface-2);
+}
+
+.rh-launch-cta:focus-visible {
+ outline: 2px solid currentColor;
+ outline-offset: 2px;
+}
+
.rh-disclosure {
font-size: 0.8125rem;
color: var(--cv-text-3);
diff --git a/tests/api/v1-robinhood.test.js b/tests/api/v1-robinhood.test.js
index 9cbd6879d..045ac8e69 100644
--- a/tests/api/v1-robinhood.test.js
+++ b/tests/api/v1-robinhood.test.js
@@ -79,6 +79,10 @@ vi.mock('../../api/_lib/robinhood.js', () => ({
asOf: () => '2026-07-12T00:00:00.000Z',
}));
+vi.mock('../../api/_lib/pons.js', () => ({
+ recentPonsLaunches: async () => [{ launchpad: 'Pons', type: 'bonding-curve', token: '0xp0ns567890123456789012345678901234567890', deployer: '0xcreator', block: 83042365, txHash: '0xponstx', timestamp: '2026-10-08T04:43:11.000Z', symbol: 'PROBE', name: 'Probe Coin', url: 'https://ponsfamily.com/launchpad/0xp0ns567890123456789012345678901234567890' }],
+}));
+
beforeEach(() => {
robinhoodReadOk = true;
});
@@ -257,9 +261,13 @@ describe('GET /api/v1/robinhood/launches', () => {
it('returns recent launches enriched with market data', async () => {
const { res, body } = await dispatch('../../api/v1/robinhood/launches.js', '/api/v1/robinhood/launches');
expect(res.statusCode).toBe(200);
- expect(body.data.launches.length).toBe(1);
- expect(body.data.launches[0].launchpad).toBe('NOXA');
- expect(body.data.launchpads.length).toBe(2);
+ expect(body.data.launches.length).toBe(2);
+ // Newest block first: the Pons launch leads, NOXA follows.
+ expect(body.data.launches.map((l) => l.launchpad)).toEqual(['Pons', 'NOXA']);
+ // A curve-stage coin has no DEX pair yet, so its on-chain name and symbol carry.
+ expect(body.data.launches[0].symbol).toBe('PROBE');
+ expect(body.data.launches[0].links.launchpad).toMatch(/^https:\/\/ponsfamily\.com\/launchpad\//);
+ expect(body.data.launchpads.map((l) => l.name)).toEqual(['Pons', 'NOXA', 'The Odyssey']);
});
});
diff --git a/tests/fixtures/pons-v2-launches.json b/tests/fixtures/pons-v2-launches.json
new file mode 100644
index 000000000..6e42789be
--- /dev/null
+++ b/tests/fixtures/pons-v2-launches.json
@@ -0,0 +1,233 @@
+{
+ "source": "Robinhood Chain mainnet (4663), fetched via eth_getTransactionByHash + eth_getTransactionReceipt on 2026-10-08",
+ "launches": [
+ {
+ "hash": "0xfdbfb6a68bacc675e4be32fa85b83f26238a4359b536def64c52dc3ee8500fad",
+ "block": 83028712,
+ "from": "0x33ed46f1738a7cc093e02c747d95fbd983e7d109",
+ "to": "0xe33e9e479df8802cb0866d5d05258bec4cf62948",
+ "value": "20500000000000000",
+ "input": "0xf85f8e4100000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000470de4df82000000000000000000000000000000000000000000000009410a64dd3a2a8cd07cd900000000000000000000000033ed46f1738a7cc093e02c747d95fbd983e7d10900000000000000000000000000000000000000000000000000000000000004e00000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000001c00000000000000000000000000000000000000000000000000000000000000240000000000000000000000000000000000000000000000000000000000000028000000000000000000000000033ed46f1738a7cc093e02c747d95fbd983e7d10900000000000000000000000000000000000000000000000000000000000000c80000000000000000000000000000000000000000000000000000000000000000a9fc75d4203a33fe660e8fa32c74c3aa41c1fda4bf23d3a39b6bc22a1f8b1ca769ac1a9cc41a2cbdf7f73c241a14213802504f015796e65a8768ad8e6907350d0000000000000000000000000000000000000000000000000000000000000009636c65766f2061707000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005434c45564f0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000042697066733a2f2f626166796265696471656b683776666772647867326176636363656776747661697566766b7637783370766a633673736b72616b736a337276737100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000194275696c6420616e797468696e67207769746820636c65766f0000000000000000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000001568747470733a2f2f782e636f6d2f636c65766f6169000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001268747470733a2f2f636c65766f2e74656368000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
+ "logs": [
+ {
+ "address": "0x9f98d2b91b2f3d2c09d93097045e37c1e397253b",
+ "topics": [
+ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
+ "0x0000000000000000000000000000000000000000000000000000000000000000",
+ "0x0000000000000000000000007d00d96b06488830a94b9612d410c314e9f55287"
+ ],
+ "data": "0x0000000000000000000000000000000000000000033b2e3c9fd0803ce8000000"
+ },
+ {
+ "address": "0x7d00d96b06488830a94b9612d410c314e9f55287",
+ "topics": [
+ "0x908408e307fc569b417f6cbec5d5a06f44a0a505ac0479b47d421a4b2fd6a1e6"
+ ],
+ "data": "0x0000000000000000000000009f98d2b91b2f3d2c09d93097045e37c1e397253b"
+ },
+ {
+ "address": "0x7d00d96b06488830a94b9612d410c314e9f55287",
+ "topics": [
+ "0xe4b7e48fbd47c2f602bacadee76ad33b16542ddb4997cfc0de04c311adcfa8c7",
+ "0x00000000000000000000000033ed46f1738a7cc093e02c747d95fbd983e7d109"
+ ],
+ "data": "0x"
+ },
+ {
+ "address": "0x31ea5b453a6cd60f36203830de046ff32dec2cdb",
+ "topics": [
+ "0x85177f287940f2f05425a4029951af0e047a7f9c4eaa9a6e6917bcd869f86695",
+ "0x0000000000000000000000007ed598bcef8bd9edd8c97a195c6d13f40801ec7e"
+ ],
+ "data": "0x0000000000000000000000000000000000000000000000000001c6bf52634000"
+ },
+ {
+ "address": "0x7ed598bcef8bd9edd8c97a195c6d13f40801ec7e",
+ "topics": [
+ "0x8d4aad4953d0ca700d468f3753aa14432d1b35b43ec6409f051fb6aa43a89607",
+ "0x0000000000000000000000009f98d2b91b2f3d2c09d93097045e37c1e397253b",
+ "0x0000000000000000000000007d00d96b06488830a94b9612d410c314e9f55287",
+ "0x00000000000000000000000033ed46f1738a7cc093e02c747d95fbd983e7d109"
+ ],
+ "data": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003a4965bf58a40000"
+ },
+ {
+ "address": "0x7d00d96b06488830a94b9612d410c314e9f55287",
+ "topics": [
+ "0xe4b7e48fbd47c2f602bacadee76ad33b16542ddb4997cfc0de04c311adcfa8c7",
+ "0x00000000000000000000000033ed46f1738a7cc093e02c747d95fbd983e7d109"
+ ],
+ "data": "0x"
+ },
+ {
+ "address": "0x9f98d2b91b2f3d2c09d93097045e37c1e397253b",
+ "topics": [
+ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
+ "0x0000000000000000000000007d00d96b06488830a94b9612d410c314e9f55287",
+ "0x00000000000000000000000033ed46f1738a7cc093e02c747d95fbd983e7d109"
+ ],
+ "data": "0x0000000000000000000000000000000000000000000971636c25a9114bc511af"
+ },
+ {
+ "address": "0x7d00d96b06488830a94b9612d410c314e9f55287",
+ "topics": [
+ "0xec36bf571f136799e8dc0b0b8bea4b04d8bd3d43de838aab0d5fc21d4cbfc455",
+ "0x000000000000000000000000e33e9e479df8802cb0866d5d05258bec4cf62948",
+ "0x00000000000000000000000033ed46f1738a7cc093e02c747d95fbd983e7d109"
+ ],
+ "data": "0x00000000000000000000000000000000000000000000000000470de4df8200000000000000000000000000000000000000000000000971636c25a9114bc511af0000000000000000000000000000000000000000000000000000b5e620f4800000000000000000000000000000000000000000000000000000016bcc41e90000"
+ },
+ {
+ "address": "0xe33e9e479df8802cb0866d5d05258bec4cf62948",
+ "topics": [
+ "0xdcacba5e347ae7abd91cb519eb877af8fa7774e347b85dd3ddcd24a2ba8cdf37",
+ "0x0000000000000000000000009f98d2b91b2f3d2c09d93097045e37c1e397253b",
+ "0x0000000000000000000000007d00d96b06488830a94b9612d410c314e9f55287",
+ "0x00000000000000000000000033ed46f1738a7cc093e02c747d95fbd983e7d109"
+ ],
+ "data": "0x00000000000000000000000033ed46f1738a7cc093e02c747d95fbd983e7d10900000000000000000000000000000000000000000000000000470de4df8200000000000000000000000000000000000000000000000971636c25a9114bc511af"
+ }
+ ]
+ },
+ {
+ "hash": "0x0aa42e3e96a2b2647b47de3f6c7abde822ac2f0fa0709d0156a4e1de35cf434e",
+ "block": 83034971,
+ "from": "0xb193de199eeb9bd1143607a11ad00999ceb956b8",
+ "to": "0xe33e9e479df8802cb0866d5d05258bec4cf62948",
+ "value": "863600000000000",
+ "input": "0xf85f8e4100000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014ab138d72000000000000000000000000000000000000000000000002b1bc0a8017b8a0787ce000000000000000000000000b193de199eeb9bd1143607a11ad00999ceb956b800000000000000000000000000000000000000000000000000000000000005600000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000001c0000000000000000000000000000000000000000000000000000000000000024000000000000000000000000000000000000000000000000000000000000002e0000000000000000000000000b193de199eeb9bd1143607a11ad00999ceb956b8000000000000000000000000000000000000000000000000000000000000012c0000000000000000000000000000000000000000000000000000000000000000a9fc75d4203a33fe660e8fa32c74c3aa41c1fda4bf23d3a39b6bc22a1f8b1ca7d1647fc10c969ee4f63eaaba2e97ec70d699b5899ece8a9f9d2686a4c00747fa00000000000000000000000000000000000000000000000000000000000000036261670000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000442414753000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000042697066733a2f2f62616679626569656479667665336364637367347464327672677134766f657071707168686a6d7576636a3436726a6977756e676d766d786864340000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000062546865206f70656e2c20636861696e2d61676e6f73746963207374616e6461726420666f7220696e766573746d656e7420737472617465676965730a637265617465202d20696e76657374202d20666f726b206974206c696b652061207265706f2e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000001b68747470733a2f2f782e636f6d2f62616770726f746f636f6c68710000000000000000000000000000000000000000000000000000000000000000000000001a68747470733a2f2f742e6d652f62616770726f746f636f6c68710000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001768747470733a2f2f62616770726f746f636f6c2e636f6d00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
+ "logs": [
+ {
+ "address": "0xe7a1a6b9e8757bd7bb9711664c0c5006fd34f596",
+ "topics": [
+ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
+ "0x0000000000000000000000000000000000000000000000000000000000000000",
+ "0x0000000000000000000000004cb57bae113b2c0b4318599bd23503d15decbdf1"
+ ],
+ "data": "0x0000000000000000000000000000000000000000033b2e3c9fd0803ce8000000"
+ },
+ {
+ "address": "0x4cb57bae113b2c0b4318599bd23503d15decbdf1",
+ "topics": [
+ "0x908408e307fc569b417f6cbec5d5a06f44a0a505ac0479b47d421a4b2fd6a1e6"
+ ],
+ "data": "0x000000000000000000000000e7a1a6b9e8757bd7bb9711664c0c5006fd34f596"
+ },
+ {
+ "address": "0x4cb57bae113b2c0b4318599bd23503d15decbdf1",
+ "topics": [
+ "0xe4b7e48fbd47c2f602bacadee76ad33b16542ddb4997cfc0de04c311adcfa8c7",
+ "0x000000000000000000000000b193de199eeb9bd1143607a11ad00999ceb956b8"
+ ],
+ "data": "0x"
+ },
+ {
+ "address": "0x31ea5b453a6cd60f36203830de046ff32dec2cdb",
+ "topics": [
+ "0x85177f287940f2f05425a4029951af0e047a7f9c4eaa9a6e6917bcd869f86695",
+ "0x0000000000000000000000007ed598bcef8bd9edd8c97a195c6d13f40801ec7e"
+ ],
+ "data": "0x0000000000000000000000000000000000000000000000000001c6bf52634000"
+ },
+ {
+ "address": "0x7ed598bcef8bd9edd8c97a195c6d13f40801ec7e",
+ "topics": [
+ "0x8d4aad4953d0ca700d468f3753aa14432d1b35b43ec6409f051fb6aa43a89607",
+ "0x000000000000000000000000e7a1a6b9e8757bd7bb9711664c0c5006fd34f596",
+ "0x0000000000000000000000004cb57bae113b2c0b4318599bd23503d15decbdf1",
+ "0x000000000000000000000000b193de199eeb9bd1143607a11ad00999ceb956b8"
+ ],
+ "data": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003a4965bf58a40000"
+ },
+ {
+ "address": "0x4cb57bae113b2c0b4318599bd23503d15decbdf1",
+ "topics": [
+ "0xe4b7e48fbd47c2f602bacadee76ad33b16542ddb4997cfc0de04c311adcfa8c7",
+ "0x000000000000000000000000b193de199eeb9bd1143607a11ad00999ceb956b8"
+ ],
+ "data": "0x"
+ },
+ {
+ "address": "0xe7a1a6b9e8757bd7bb9711664c0c5006fd34f596",
+ "topics": [
+ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
+ "0x0000000000000000000000004cb57bae113b2c0b4318599bd23503d15decbdf1",
+ "0x000000000000000000000000b193de199eeb9bd1143607a11ad00999ceb956b8"
+ ],
+ "data": "0x000000000000000000000000000000000000000000002bfcf8d53afb72b9511c"
+ },
+ {
+ "address": "0x4cb57bae113b2c0b4318599bd23503d15decbdf1",
+ "topics": [
+ "0xec36bf571f136799e8dc0b0b8bea4b04d8bd3d43de838aab0d5fc21d4cbfc455",
+ "0x000000000000000000000000e33e9e479df8802cb0866d5d05258bec4cf62948",
+ "0x000000000000000000000000b193de199eeb9bd1143607a11ad00999ceb956b8"
+ ],
+ "data": "0x00000000000000000000000000000000000000000000000000014ab138d72000000000000000000000000000000000000000000000002bfcf8d53afb72b9511c0000000000000000000000000000000000000000000000000000034e927d0800000000000000000000000000000000000000000000000000000009ebb7771800"
+ },
+ {
+ "address": "0xe33e9e479df8802cb0866d5d05258bec4cf62948",
+ "topics": [
+ "0xdcacba5e347ae7abd91cb519eb877af8fa7774e347b85dd3ddcd24a2ba8cdf37",
+ "0x000000000000000000000000e7a1a6b9e8757bd7bb9711664c0c5006fd34f596",
+ "0x0000000000000000000000004cb57bae113b2c0b4318599bd23503d15decbdf1",
+ "0x000000000000000000000000b193de199eeb9bd1143607a11ad00999ceb956b8"
+ ],
+ "data": "0x000000000000000000000000b193de199eeb9bd1143607a11ad00999ceb956b800000000000000000000000000000000000000000000000000014ab138d72000000000000000000000000000000000000000000000002bfcf8d53afb72b9511c"
+ }
+ ]
+ },
+ {
+ "hash": "0x31f9b87e7d2f67deeb6f381fe38dde71c5876ed5e334ba833bcffc3f44d1b984",
+ "block": 83023801,
+ "from": "0x80ee64b9368dc74bb9180d0cdcdff202a140e342",
+ "to": "0x7ed598bcef8bd9edd8c97a195c6d13f40801ec7e",
+ "value": "500000000000000",
+ "input": "0xa72101af00000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004200000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000001c00000000000000000000000000000000000000000000000000000000000000240000000000000000000000000000000000000000000000000000000000000026000000000000000000000000080ee64b9368dc74bb9180d0cdcdff202a140e34200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a9fc75d4203a33fe660e8fa32c74c3aa41c1fda4bf23d3a39b6bc22a1f8b1ca79e08b2cdf71b5ca8ad4c5fd03865df36cef1f47e01a31f3f8a779eac2d45604500000000000000000000000000000000000000000000000000000000000000026161000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000241410000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000042697066733a2f2f6261666b7265696469667169377a6b6a353278347737636e353463757833326462687972773568776f7434656e64336970667134643476357a636d000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
+ "logs": [
+ {
+ "address": "0xbc783d6839c59e4fe8e1c632fe54511cabfc9582",
+ "topics": [
+ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
+ "0x0000000000000000000000000000000000000000000000000000000000000000",
+ "0x0000000000000000000000002208a69e6c9cf10e865daf0a4249c79472da5454"
+ ],
+ "data": "0x0000000000000000000000000000000000000000033b2e3c9fd0803ce8000000"
+ },
+ {
+ "address": "0x2208a69e6c9cf10e865daf0a4249c79472da5454",
+ "topics": [
+ "0x908408e307fc569b417f6cbec5d5a06f44a0a505ac0479b47d421a4b2fd6a1e6"
+ ],
+ "data": "0x000000000000000000000000bc783d6839c59e4fe8e1c632fe54511cabfc9582"
+ },
+ {
+ "address": "0x2208a69e6c9cf10e865daf0a4249c79472da5454",
+ "topics": [
+ "0xe4b7e48fbd47c2f602bacadee76ad33b16542ddb4997cfc0de04c311adcfa8c7",
+ "0x00000000000000000000000080ee64b9368dc74bb9180d0cdcdff202a140e342"
+ ],
+ "data": "0x"
+ },
+ {
+ "address": "0x31ea5b453a6cd60f36203830de046ff32dec2cdb",
+ "topics": [
+ "0x85177f287940f2f05425a4029951af0e047a7f9c4eaa9a6e6917bcd869f86695",
+ "0x0000000000000000000000007ed598bcef8bd9edd8c97a195c6d13f40801ec7e"
+ ],
+ "data": "0x0000000000000000000000000000000000000000000000000001c6bf52634000"
+ },
+ {
+ "address": "0x7ed598bcef8bd9edd8c97a195c6d13f40801ec7e",
+ "topics": [
+ "0x8d4aad4953d0ca700d468f3753aa14432d1b35b43ec6409f051fb6aa43a89607",
+ "0x000000000000000000000000bc783d6839c59e4fe8e1c632fe54511cabfc9582",
+ "0x0000000000000000000000002208a69e6c9cf10e865daf0a4249c79472da5454",
+ "0x00000000000000000000000080ee64b9368dc74bb9180d0cdcdff202a140e342"
+ ],
+ "data": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003a4965bf58a40000"
+ }
+ ]
+ }
+ ]
+}
diff --git a/tests/pons.test.js b/tests/pons.test.js
new file mode 100644
index 000000000..47927ff6c
--- /dev/null
+++ b/tests/pons.test.js
@@ -0,0 +1,207 @@
+// Proves api/_lib/pons.js against real Pons V2 launches on Robinhood Chain
+// mainnet. The fixture holds the untouched calldata and receipt logs of three
+// launches (two atomic launch-and-buys through PonsV2LaunchAndBuy, one bare
+// factory launch), so every assertion below is checked against bytes the
+// chain actually accepted, not against our own reading of the ABI.
+
+import { describe, it, expect } from 'vitest';
+import { readFileSync } from 'node:fs';
+import { decodeFunctionData } from 'viem';
+import {
+ PONS_ABI,
+ PONS_V2_FACTORY,
+ PONS_V2_LAUNCH_AND_BUY,
+ TOKEN_LAUNCHED_TOPIC,
+ PonsError,
+ buildLaunchTx,
+ buildTokenParams,
+ curveState,
+ parseLaunchReceipt,
+ quoteOpeningBuy,
+ ponsCoinUrl,
+} from '../api/_lib/pons.js';
+
+const fixture = JSON.parse(readFileSync(new URL('./fixtures/pons-v2-launches.json', import.meta.url), 'utf8'));
+const byHash = Object.fromEntries(fixture.launches.map((l) => [l.hash, l]));
+const CLEVO = byHash['0xfdbfb6a68bacc675e4be32fa85b83f26238a4359b536def64c52dc3ee8500fad'];
+const SMALL_BUY = byHash['0x0aa42e3e96a2b2647b47de3f6c7abde822ac2f0fa0709d0156a4e1de35cf434e'];
+const BARE = byHash['0x31f9b87e7d2f67deeb6f381fe38dde71c5876ed5e334ba833bcffc3f44d1b984'];
+
+// The single live native-ETH launch config (getLaunchConfig(0)) and fee as
+// read from the factory on 2026-10-08, the terms every fixture launch used.
+const LIVE_TERMS = {
+ launchEnabled: true,
+ launchFee: 500000000000000n,
+ maxCreatorTaxBps: 1000n,
+ launchConfigId: 0n,
+ pairToken: '0x0000000000000000000000000000000000000000',
+ config: {
+ supply: 1000000000000000000000000000n,
+ curveFeeBps: 100n,
+ phantomQuote: 1680000000000000000n,
+ graduationThreshold: 4200000000000000000n,
+ poolFee: 0,
+ tickSpacing: 200,
+ enabled: true,
+ },
+ expectedEconomics: '0xa9fc75d4203a33fe660e8fa32c74c3aa41c1fda4bf23d3a39b6bc22a1f8b1ca7',
+};
+
+function decode(launch) {
+ return decodeFunctionData({ abi: PONS_ABI, data: launch.input });
+}
+
+describe('Pons V2 calldata, proven against mainnet', () => {
+ it('rebuilds a real launchAndBuy byte-for-byte, value included', () => {
+ const { functionName, args } = decode(CLEVO);
+ expect(functionName).toBe('launchAndBuy');
+ const [onchain, , , quoteIn, , recipient] = args;
+ const params = buildTokenParams({ ...onchain });
+ const tx = buildLaunchTx({ params, terms: LIVE_TERMS, quoteIn, recipient });
+ expect(tx.to.toLowerCase()).toBe(CLEVO.to.toLowerCase());
+ expect(tx.value).toBe(BigInt(CLEVO.value));
+ // The creator pinned minTokensOut with 2% slippage; ours pins the exact
+ // fill, so only that one word differs. Swap it in and compare the rest.
+ const ours = decodeFunctionData({ abi: PONS_ABI, data: tx.data }).args;
+ expect(ours[4]).toBeGreaterThanOrEqual(args[4]);
+ const rebuilt = buildLaunchTx({ params, terms: LIVE_TERMS, quoteIn, recipient });
+ const withTheirMin = rebuilt.data.replace(
+ ours[4].toString(16).padStart(64, '0'),
+ args[4].toString(16).padStart(64, '0'),
+ );
+ expect(withTheirMin).toBe(CLEVO.input);
+ });
+
+ it('rebuilds a real no-buy launch byte-for-byte against the factory', () => {
+ const [onchain] = decode(BARE).args;
+ const params = buildTokenParams({ ...onchain });
+ const tx = buildLaunchTx({ params, terms: LIVE_TERMS, quoteIn: 0n, recipient: BARE.from });
+ expect(tx.to).toBe(PONS_V2_FACTORY);
+ expect(tx.value).toBe(BigInt(BARE.value));
+ expect(tx.data).toBe(BARE.input);
+ });
+
+ it('targets the router the factory trusts as its launch forwarder', () => {
+ expect(CLEVO.to.toLowerCase()).toBe(PONS_V2_LAUNCH_AND_BUY.toLowerCase());
+ expect(BARE.to.toLowerCase()).toBe(PONS_V2_FACTORY.toLowerCase());
+ expect(decode(BARE).functionName).toBe('launchToken');
+ });
+
+ it('charges launch fee plus opening buy as msg.value', () => {
+ for (const launch of [CLEVO, SMALL_BUY]) {
+ const quoteIn = decode(launch).args[3];
+ expect(BigInt(launch.value)).toBe(LIVE_TERMS.launchFee + quoteIn);
+ }
+ expect(BigInt(BARE.value)).toBe(LIVE_TERMS.launchFee);
+ });
+});
+
+describe('quoteOpeningBuy', () => {
+ it('reproduces the exact tokens the curve paid on real launches', () => {
+ for (const launch of [CLEVO, SMALL_BUY]) {
+ const { args } = decode(launch);
+ const parsed = parseLaunchReceipt({ logs: launch.logs });
+ const quoted = quoteOpeningBuy({
+ quoteIn: args[3],
+ config: LIVE_TERMS.config,
+ creatorTaxBps: args[0].creatorTaxBps,
+ });
+ expect(quoted).toBe(parsed.openingBuy.tokensOut);
+ }
+ });
+
+ it('is zero for no buy and clamps at the sellable allocation', () => {
+ expect(quoteOpeningBuy({ quoteIn: 0n, config: LIVE_TERMS.config })).toBe(0n);
+ const huge = quoteOpeningBuy({ quoteIn: 10n ** 24n, config: LIVE_TERMS.config });
+ const { supply, phantomQuote, graduationThreshold } = LIVE_TERMS.config;
+ expect(huge).toBe(supply - (supply * phantomQuote) / (phantomQuote + graduationThreshold));
+ });
+});
+
+describe('parseLaunchReceipt', () => {
+ it('reads token, curve, deployer and the opening fill', () => {
+ const r = parseLaunchReceipt({ logs: CLEVO.logs });
+ expect(r.token).toBe('0x9F98d2b91b2F3d2C09d93097045E37c1e397253B');
+ expect(r.curve).toBe('0x7d00D96B06488830A94b9612d410C314E9F55287');
+ expect(r.deployer.toLowerCase()).toBe(CLEVO.from.toLowerCase());
+ expect(r.openingBuy.quoteIn).toBe(20000000000000000n);
+ expect(r.graduationThreshold).toBe(LIVE_TERMS.config.graduationThreshold);
+ });
+
+ it('reports no opening buy for a bare launch, and null without a launch', () => {
+ expect(parseLaunchReceipt({ logs: BARE.logs }).openingBuy).toBeNull();
+ expect(parseLaunchReceipt({ logs: [] })).toBeNull();
+ });
+
+ it('matches the factory log topic', () => {
+ const factoryLog = CLEVO.logs.find((l) => l.address.toLowerCase() === PONS_V2_FACTORY.toLowerCase());
+ expect(factoryLog.topics[0]).toBe(TOKEN_LAUNCHED_TOPIC);
+ });
+});
+
+describe('buildTokenParams', () => {
+ const base = {
+ name: 'Test Coin',
+ symbol: '$test',
+ creatorFeeRecipient: '0x33ed46f1738a7cc093e02c747d95fbd983e7d109',
+ salt: `0x${'ab'.repeat(32)}`,
+ };
+
+ it('normalises the ticker and checksums the fee recipient', () => {
+ const p = buildTokenParams(base);
+ expect(p.symbol).toBe('TEST');
+ expect(p.creatorFeeRecipient).toBe('0x33ed46f1738a7cC093E02c747d95fbd983E7d109');
+ expect(p.expectedEconomics).toBe(`0x${'0'.repeat(64)}`);
+ });
+
+ it('enforces the on-chain metadata caps before gas is spent', () => {
+ expect(() => buildTokenParams({ ...base, name: 'x'.repeat(65) })).toThrow(PonsError);
+ expect(() => buildTokenParams({ ...base, symbol: 'A'.repeat(17) })).toThrow(PonsError);
+ expect(() => buildTokenParams({ ...base, description: 'd'.repeat(2049) })).toThrow(PonsError);
+ });
+
+ it('rejects unsafe links and malformed tickers', () => {
+ expect(() => buildTokenParams({ ...base, logo: 'javascript:alert(1)' })).toThrow(/Logo/);
+ expect(() => buildTokenParams({ ...base, socials: { twitter: 'http://x.com/a' } })).toThrow(/twitter/);
+ expect(() => buildTokenParams({ ...base, symbol: 'NO SPACE' })).toThrow(/letters and digits/);
+ });
+
+ it('refuses a creator tax above the live ceiling', () => {
+ const params = buildTokenParams({ ...base, creatorTaxBps: 1500 });
+ expect(() => buildLaunchTx({ params, terms: LIVE_TERMS, recipient: base.creatorFeeRecipient })).toThrow(
+ /capped at 10%/,
+ );
+ });
+});
+
+describe('ponsCoinUrl', () => {
+ it('links the coin page on ponsfamily.com', () => {
+ expect(ponsCoinUrl('0x9f98d2b91b2f3d2c09d93097045e37c1e397253b')).toBe(
+ 'https://ponsfamily.com/launchpad/0x9F98d2b91b2F3d2C09d93097045E37c1e397253B',
+ );
+ });
+});
+
+describe('curveState', () => {
+ const ok = (result) => ({ status: 'success', result });
+ const threshold = 4200000000000000000n;
+
+ it('prices a live curve from its reserves and reports progress', () => {
+ const s = curveState([ok([1680000000000000000n, 1000000000000000000000000000n]), ok(420000000000000000n), ok(false)], threshold);
+ expect(s.graduated).toBe(false);
+ expect(s.priceEth).toBeCloseTo(1.68e-9, 15);
+ expect(s.progressPct).toBe(10);
+ });
+
+ it('leaves price to the V4 pool once graduated', () => {
+ expect(curveState([ok([1n, 1n]), ok(threshold), ok(true)], threshold)).toEqual({ graduated: true, priceEth: null, progressPct: 100 });
+ });
+
+ it('reports nothing it could not read', () => {
+ expect(curveState([{ status: 'failure' }, { status: 'failure' }, { status: 'failure' }], threshold)).toEqual({
+ graduated: null,
+ priceEth: null,
+ progressPct: null,
+ });
+ });
+});
diff --git a/vercel.json b/vercel.json
index 74f680d28..490a12689 100644
--- a/vercel.json
+++ b/vercel.json
@@ -1375,6 +1375,18 @@
"src": "/markets/robinhood/coin/(0x[0-9a-fA-F]{40})/?",
"dest": "/robinhood-coin.html"
},
+ {
+ "src": "/markets/robinhood/paired/?",
+ "dest": "/paired-coins.html"
+ },
+ {
+ "src": "/markets/robinhood/paired/(0x[0-9a-fA-F]{40})/?",
+ "dest": "/paired-coin.html"
+ },
+ {
+ "src": "/launch/paired/?",
+ "dest": "/launch-paired.html"
+ },
{
"src": "/fear-greed/?",
"dest": "/fear-greed.html"
@@ -2051,6 +2063,10 @@
"src": "/launchpad/?",
"dest": "/launchpad.html"
},
+ {
+ "src": "/launch/robinhood/?",
+ "dest": "/launch-robinhood.html"
+ },
{
"src": "/launch/?",
"dest": "/launch.html"
@@ -3296,6 +3312,10 @@
"src": "/api/agents/([^/]+)/pumpfun/([^/]+)",
"dest": "/api/agents/pumpfun/[action]?id=$1&action=$2"
},
+ {
+ "src": "/api/agents/([^/]+)/paired/([^/]+)",
+ "dest": "/api/agents/paired/[action]?id=$1&action=$2"
+ },
{
"src": "/api/agents/([^/]+)/pons/([^/]+)",
"dest": "/api/agents/pons/[action]?id=$1&action=$2"
diff --git a/vite.config.js b/vite.config.js
index 0a46135eb..2d3c92dc7 100644
--- a/vite.config.js
+++ b/vite.config.js
@@ -753,6 +753,7 @@ const appConfig = {
widget: resolve(__dirname, 'pages/widget.html'),
launchpad: resolve(__dirname, 'pages/launchpad.html'),
launch: resolve(__dirname, 'pages/launch.html'),
+ 'launch-robinhood': resolve(__dirname, 'pages/launch-robinhood.html'),
'launch-studio': resolve(__dirname, 'pages/launch-studio.html'),
start: resolve(__dirname, 'pages/start.html'),
create: resolve(__dirname, 'pages/create.html'),
@@ -1000,6 +1001,9 @@ const appConfig = {
'billing-keys': resolve(__dirname, 'pages/billing/keys.html'),
'robinhood-stock': resolve(__dirname, 'pages/robinhood-stock.html'),
'robinhood-coin': resolve(__dirname, 'pages/robinhood-coin.html'),
+ 'paired-coins': resolve(__dirname, 'pages/paired-coins.html'),
+ 'paired-coin': resolve(__dirname, 'pages/paired-coin.html'),
+ 'launch-paired': resolve(__dirname, 'pages/launch-paired.html'),
credits: resolve(__dirname, 'pages/credits.html'),
payments: resolve(__dirname, 'pages/payments.html'),
'pay-simulator': resolve(__dirname, 'pages/pay-simulator.html'),
@@ -1774,6 +1778,10 @@ const appConfig = {
'/markets/robinhood/': resolve(root, 'pages/markets-robinhood.html'),
'/markets/robinhood/desk': resolve(root, 'pages/hood-desk.html'),
'/markets/robinhood/desk/': resolve(root, 'pages/hood-desk.html'),
+ '/markets/robinhood/paired': resolve(root, 'pages/paired-coins.html'),
+ '/markets/robinhood/paired/': resolve(root, 'pages/paired-coins.html'),
+ '/launch/paired': resolve(root, 'pages/launch-paired.html'),
+ '/launch/paired/': resolve(root, 'pages/launch-paired.html'),
'/markets/robinhood/portfolios': resolve(root, 'pages/hood-portfolios.html'),
'/markets/robinhood/portfolios/': resolve(root, 'pages/hood-portfolios.html'),
'/markets/robinhood/portfolios/universe': resolve(root, 'pages/hood-portfolios-universe.html'),
@@ -1972,6 +1980,8 @@ const appConfig = {
'/launch-week/': resolve(root, 'pages/three-ws-launch-week.html'),
'/launchpad': resolve(root, 'pages/launchpad.html'),
'/launchpad/': resolve(root, 'pages/launchpad.html'),
+ '/launch/robinhood': resolve(root, 'pages/launch-robinhood.html'),
+ '/launch/robinhood/': resolve(root, 'pages/launch-robinhood.html'),
'/launch': resolve(root, 'pages/launch.html'),
'/launch/': resolve(root, 'pages/launch.html'),
'/p': resolve(root, 'public/p/index.html'),
@@ -2427,6 +2437,12 @@ const appConfig = {
/^\/markets\/robinhood\/stock\/[A-Za-z0-9.-]{1,10}\/?$/.test(path)
)
filePath = resolve(root, 'pages/robinhood-stock.html');
+ // /markets/robinhood/paired/:address → paired coin detail
+ else if (
+ !filePath &&
+ /^\/markets\/robinhood\/paired\/0x[0-9a-fA-F]{40}\/?$/.test(path)
+ )
+ filePath = resolve(root, 'pages/paired-coin.html');
// /markets/robinhood/coin/:address → Robinhood Chain coin detail
else if (
!filePath &&