Inspiration

AI agents are starting to pay for things on their own. With x402, an agent calls an API, pays a cent in USDC on Solana, and gets the data. No signup, no account, no email. That's great for the agent, but the seller is flying blind: an x402 payment is just a wallet address and an amount. If you sell through Stripe you know your customer. Through x402 you know nothing.

What it does

thirdLayer is customer intelligence for x402 sellers.

  • 3-line SDK. Wrap your x402 middleware with thirdLayer.track(...). It records what every settled payment bought: endpoint, parameters, client, and the settlement transaction.
  • Wallet profiling. For each paying wallet we read its Solana history (parsed transactions, programs used, USDC flows to other known x402 sellers) and build a profile: persona, score, other sellers it pays, and a written summary.
  • Segments. Wallets roll up into customer segments (Traders, Researchers, Whale watchers, Portfolio managers, ...) so a seller can see who their customers are and what to build or price next.
  • Before/after. The seller screen has an SDK on/off switch. With it off, you see what the chain alone gives you: blurred, anonymous payments. With it on, every new payment shows exactly what was bought and who bought it.
  • Real Claude as a customer. An MCP server gives Claude its own wallet and a buy_data tool, so Claude pays our API over x402 and shows up live as a profiled customer.

How we built it

  • Payments: x402 v2 (@x402/hono, @x402/svm, @x402/fetch) on Solana devnet with USDC, settled through the PayAI facilitator (fee-sponsored).
  • Backend: Hono on Bun, SQLite, @solana/kit. The SDK middleware decodes the PAYMENT-RESPONSE header and emits settled/failed events over SSE.
  • Enrichment: Solana JSON-RPC (getSignaturesForAddress, jsonParsed getTransaction) with a permanent transaction cache, a registry of x402 sellers, persona/score inference, and Claude for narratives.
  • Real market data: an "x402 Pulse" product reads real x402 settlements on Solana mainnet (~890/day via the PayAI fee payer).
  • Agents: a fleet of agent wallets with real devnet histories, plus Claude via MCP.
  • Frontend: Next.js + motion: Seller screen and Business screen.
  • QuickNode: a Streams filter and webhook endpoint for push-based capture.

Challenges we ran into

  • Public devnet RPC rate limits (429s) broke payments and enrichment. We added staggering, retry/backoff and a permanent parsed-transaction cache.
  • The default facilitator was rate-limited during settlement, so we moved to PayAI.
  • There are no real wallets with rich x402 histories on devnet, so we gave agents real on-chain histories (purchases from several sellers, transfers, memos) instead of mocking them.

What we learned

x402 makes agents first-class customers, but the protocol deliberately carries no identity. The useful identity is already on-chain. You just have to join the payment to what it bought and to the wallet's history.

What's next

Mainnet, QuickNode Streams for real-time capture across many sellers, and a hosted dashboard so any x402 seller can drop in the SDK.

Every demo payment is a real Solana devnet transaction: seller wallet on Solana Explorer

Built With

Share this project:

Updates

Submission history