DeFi for Agents

AI agents access real-time DeFi data through x402 micropayments. No API keys. No subscriptions. Just pay-per-call with USDC on Base.

Powered byHeyElsa x402

How It Works

x402
01
Agent calls API
Your agent sends a standard HTTP request to any DeFi endpoint. No auth headers needed.
02
402 Payment Required
Server responds with x402 payment requirements — amount, asset (USDC), and payTo address.
03
Micropayment
Agent signs an EIP-3009 TransferWithAuthorization for the exact amount ($0.001–$0.01 per call).
04
Data returned
Server verifies the payment signature and returns DeFi data. Cached for 60s to minimize costs.
6 DeFi endpoints·$0.001 min cost/call·60s cache TTL·0 API keys needed

$ live-swap

⚡ Swap ETH → PULSE

Base
ETH
PULSE

Swaps execute via Uniswap on Base. PULSE tokens are used to send on-chain liveness signals.

$ available-actions

Swap Quote

$0.01swap_quote

Get real-time swap quotes across DEXs on Base. Returns optimal route, price impact, gas estimate, and minimum output.

Gas Analysis

$0.001gas_prices

Current gas prices on Base chain. Helps agents optimize transaction timing and estimate costs before executing swaps.

Portfolio Tracking

$0.01portfolio

Full portfolio breakdown with USD values. Track any wallet’s holdings across all tokens on Base.

Token Balances

$0.005balances

Raw token balances for a wallet on Base. Lightweight alternative to full portfolio when you just need quantities.

Wallet Analysis

$0.01analyze_wallet

AI-powered wallet analysis. Evaluates transaction patterns, portfolio health, and risk exposure for any address.

Token Price

$0.002token_price

Get current price for any token on Base by contract address. Includes USD price and 24h change.

Quick Integration

SDK
typescript
import { AgentPulse } from "@agent-pulse/sdk";

const pulse = new AgentPulse();

// Get a swap quote — x402 payment handled automatically
const quote = await pulse.defi.swapQuote({
  address: "0xYOUR_WALLET",
  amount: "0.01",
  tokenIn: "ETH",
  tokenOut: "PULSE",
});

console.log(`Receive: ${quote.to_amount} PULSE`);
console.log(`Gas: $${quote.gas_amount_usd}`);

The Agent Pulse SDK wraps x402 payment negotiation so your agent can call any DeFi endpoint with a single function call. Works from Node.js, Deno, and browser environments.

Why x402?

Protocol

HTTP 402 Payment Required was reserved in the HTTP spec for exactly this: native web payments. The x402 protocol makes it real.

Instead of API keys and monthly subscriptions, agents pay per call with USDC on Base. Payment is verified via EIP-3009 signatures — no on-chain transaction needed until settlement, keeping costs at fractions of a cent.

HeyElsa provides the DeFi data layer — swap routing, portfolio analytics, gas optimization — all accessible through a single x402-enabled API. Agent Pulse proxies these calls server-side, handling payment automatically so users never see a wallet popup.