Synthesis Hackathon — Best Agent Built with Ampersend

Ampersend + Escroue

Managed agent payments via x402. Budget-capped smart accounts, human oversight dashboard, and seamless MCP tool payments — all on Base.

SDK
@ampersend_ai/ampersend-sdk
Version
v0.0.12
By
Edge & Node (The Graph)
Network
Base Sepolia

What is Ampersend?

Agent payment management platform by Edge & Node — the team behind The Graph protocol.

Ampersend solves a critical problem: how do you give autonomous agents the ability to spend money without losing control?

It provides smart account wallets (ERC-4337) for each agent, a Treasurer that enforces spend limits before every payment, and a human operator dashboard for monitoring and control.

Under the hood, it uses the x402 protocol (HTTP 402 payments) — the same protocol already integrated into Escroue. Ampersend wraps x402 with managed wallets and treasury controls, making it production-ready for agent commerce.

How It Works

The payment flow from buyer agent to seller agent, with Treasurer oversight at every step.

👛
01Buyer Agent → Wallet

Buyer gets an EOA or ERC-4337 Smart Account wallet via Ampersend SDK. The wallet holds USDC and is controlled by a session key.

🏦
02Treasurer → Spend Limits

A Treasurer authorizes every payment before it happens. Enforces daily, monthly, and per-transaction limits. Human operators set these via the Ampersend dashboard.

🔌
03Seller Agent → Paid MCP Tools

Seller agents expose their capabilities as MCP tools with x402 payment requirements. Each tool call costs a set amount of USDC.

💳
04Auto-Pay via x402

When the buyer calls a paid tool, the SDK handles the full 402 flow: receive requirements → treasurer approves → sign payment → retry with payment header.

05Facilitator → Settlement

Payments are verified and settled through the x402 facilitator. The seller receives USDC, and the transaction is recorded on-chain on Base.

Integration with Escroue

How Ampersend enhances our existing payment infrastructure.

Buyer Agent PaymentBUILT
Before
Raw x402 with manual wallet management
After
Ampersend Treasurer with spend limits + smart accounts
Seller Agent ServicesBUILT
Before
Custom Express x402 middleware
After
MCP Server with withX402Payment gating per tool
Human OversightAVAILABLE
Before
No visibility into agent spending
After
Dashboard with daily/monthly limits, tx history
Wallet ManagementAVAILABLE
Before
Single EOA shared across agents
After
Per-agent smart accounts with session keys

SDK Components

Click any component to see usage code. These are the building blocks for agent payments.

AccountWallet
@ampersend_ai/ampersend-sdk

EOA wallet from private key. Creates x402 payment payloads with EIP-3009 signatures.

SmartAccountWallet
@ampersend_ai/ampersend-sdk

ERC-4337 smart account wallet. Uses session keys for signing. Deployed via Ampersend platform.

NaiveTreasurer
@ampersend_ai/ampersend-sdk/x402/treasurers

Auto-approves all payments. Good for testing and demos.

AmpersendTreasurer
@ampersend_ai/ampersend-sdk

Production treasurer with spend limits. Consults Ampersend API before every payment.

MCP Client
@ampersend_ai/ampersend-sdk

Auto-paying MCP client. Handles 402 responses transparently — buyer just calls tools.

FastMCP Server
@ampersend_ai/ampersend-sdk/mcp/server/fastmcp

MCP server with x402 payment gating. Seller defines price per tool, middleware handles verification.

HTTP Client
@x402/fetch + ampersend-sdk

Wraps fetch() to auto-pay on 402 responses. Works with any x402-enabled HTTP endpoint.

Quick Start

Get up and running with Ampersend in Escroue.

1Install the SDK
npm install @ampersend_ai/ampersend-sdk
2Register on the Ampersend platform
# Visit https://app.staging.ampersend.ai
# Create an agent → get smart account address + session key
3Fund with testnet USDC
# Get USDC from https://faucet.circle.com
# Send to your smart account address on Base Sepolia
4Run the demo
AMPERSEND_PRIVATE_KEY=0x... node agents/src/ampersend/demo.js
5Use in your agent
import { createDemoTreasurer, createPayingFetch } from './ampersend/client.js';

// Create a paying fetch client
const { fetch: payFetch } = await createPayingFetch(privateKey);

// Call a paid endpoint — 402 handling is automatic
const response = await payFetch('https://seller-agent.example.com/api/task');

Payment Flow

How x402 payments work between buyer and seller agents via Ampersend.

┌──────────────┐    ┌──────────────┐    ┌──────────────┐
│  Buyer Agent │    │  Treasurer   │    │ Seller Agent │
│  (MCP Client)│    │  (Ampersend) │    │ (MCP Server) │
└──────┬───────┘    └──────┬───────┘    └──────┬───────┘
       │                   │                   │
       │  callTool("summarize", {text})        │
       │───────────────────────────────────────>│
       │                   │                   │
       │                   │   402 + payment   │
       │<──────────────────────────────────────│
       │                   │   requirements    │
       │                   │                   │
       │  authorize?       │                   │
       │──────────────────>│                   │
       │                   │                   │
       │  ✅ authorized    │                   │
       │<──────────────────│                   │
       │  (within limits)  │                   │
       │                   │                   │
       │  retry + payment header               │
       │───────────────────────────────────────>│
       │                   │                   │
       │                   │     verify via    │
       │                   │     facilitator   │
       │                   │                   │
       │              200 + result             │
       │<──────────────────────────────────────│
       │                   │                   │

Hackathon Prize

Best Agent Built with ampersend-sdk
Synthesis Hackathon — Prize Track #126
Prize Track
Effort
3-4 hours
Risk
Low
Competition
Very low
📦SDK Repository💡SDK Examples🖥️Staging Dashboard💰USDC Faucet🔗x402 Protocol🏗️Escroue Repo

Built for The Synthesis Hackathon — Escroue x Ampersend