Skip to content
RAINMAKER PROTOCOL

RAINMAKER PROTOCOL

Find clients. Get paid. Zero human clicks.

Created on 14th April 2026

•

RAINMAKER PROTOCOL

RAINMAKER PROTOCOL

Find clients. Get paid. Zero human clicks.

The problem RAINMAKER PROTOCOL solves

Freelancers and consultants spend 4–8 hours per week manually searching for leads, writing cold emails, chasing payments — with under 3% conversion. The unit economics are broken: high time cost, low yield, slow cash collection.

Rainmaker Protocol inverts this entirely. You provide your skill and hourly rate. The agent autonomously executes the entire acquisition-to-payment pipeline:

  1. Discovers B2B companies via Tavily AI Search (Locus wrapped)
  2. Enriches decision-maker contacts via Hunter.io (Locus wrapped)
  3. Screens every entity against the OFAC SDN + EU sanctions lists — hard-blocked at ≥75/100 fuzzy-match confidence, zero contact with sanctioned entities
  4. Generates a personalised cold email via Claude AI
  5. Sends it from an autonomous AgentMail inbox (funded via x402 — $2.00 USDC confirmed on-chain)
  6. Creates a unique Locus Checkout session per prospect (USDC payment URL embedded in the email)
  7. Detects payment via Locus webhook + Redis pub/sub cross-instance coordination
  8. Automatically delivers the contracted work to the client via AgentMail

Total agent spend: ~$2.64 USDC. Total earned: $50.00 USDC. ROI: 18.9x.
Everything runs within a hard $5.00 USDC budget cap — the agent stops cleanly if it runs out, it never bleeds money.

Challenges I ran into

  1. Vercel serverless timeout (10s limit)
    The agent pipeline has 8 steps taking 30–60 seconds total. The fix was counterintuitive: I moved all agent execution out of POST /start and into GET /stream. The open SSE connection keeps the function alive for the full run. /start now just allocates a run ID and returns immediately. One architectural change fixed everything.

  2. Webhook race condition (cross-instance)
    When Locus fires a CHECKOUT_PAID webhook, it can land on a different Vercel serverless instance than the one holding the user's SSE stream. In-memory event bus couldn't bridge them.

Fix: Upstash Redis pub/sub. The webhook handler writes rmp:payment:{runId}:{prospectId} to Redis (TTL 2h). The polling loop on the SSE instance atomically reads and deletes that key each cycle — ensuring payment confirmation always reaches the right instance regardless of which instance the webhook hit. Zero missed payments.

  1. Apollo and Clado APIs returned 404 in Beta
    Both were listed in the Locus wrapped registry but were unavailable mid-run — after the AgentMail x402 payment had already fired ($2.00 USDC, confirmed on-chain, April 14 2026). I swapped to Tavily for company discovery and Hunter for contact enrichment — both fully registered and working. The Locus transaction history shows all 10 calls confirmed on Base.

  2. Locus dual wallet address bug
    Locus wallets have two addresses: the ownerAddress returned at registration and the deployed smart contract wallet that takes ~30 seconds to propagate. Fixed by polling the status endpoint before storing the wallet address for checkout session correlation.

  3. Implementing a byte-perfect x402 server endpoint

Rainmaker Protocol exposes POST /api/agent/hire — any external AI agent can autonomously hire the full pipeline via HTTP 402 with no API key or signup. Getting the 402 response accepted required reverse-engineering the exact x402 V1 schema.

My first implementation returned:

{ "paymentRequired": true, "priceUsd": 1.00, "payTo": "0x..." }

My own frontend understood it. The x402 standard did not — any client following the spec rejected it silently with no error message.

The correct V1 PaymentRequired schema requires:

-> Top-level x402Version: 1
-> An accepts[] array (not a flat object)
Each entry: scheme ("exact"), network ("base"), maxAmountRequired in USDC atomic units (1 USDC = "1000000" at 6 decimals), asset (the USDC contract on Base: 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913), payTo, resource, maxTimeoutSeconds
-> A PAYMENT-REQUIRED response header containing the entire payload as a Base64-encoded JSON string

Once the schema was byte-perfect, the full hire flow worked end-to-end: any agent POSTs without payment → receives 402 with valid USDC requirements → pays exactly 1 USDC on Base → re-POSTs with X-Payment: <base64 proof> → receives 202 with runId, pollUrl, and streamUrl. The lesson: in M2M protocols, a single missing field is the same as total rejection. That strictness is what makes autonomous commerce trustworthy.

Tracks Applied (1)

Using PayWithLocus.com to leverage our suite.

Rainmaker Protocol uses 14 Locus APIs — every one load-bearing, none decorative. Locus is not a payment layer bolted ont...Read More

Discussion

Builders also viewed

See more projects on Devfolio