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.
How It Works
x402$ live-swap
⚡ Swap ETH → PULSE
BaseSwaps execute via Uniswap on Base. PULSE tokens are used to send on-chain liveness signals.
$ available-actions
Swap Quote
Get real-time swap quotes across DEXs on Base. Returns optimal route, price impact, gas estimate, and minimum output.
Gas Analysis
Current gas prices on Base chain. Helps agents optimize transaction timing and estimate costs before executing swaps.
Portfolio Tracking
Full portfolio breakdown with USD values. Track any wallet’s holdings across all tokens on Base.
Token Balances
Raw token balances for a wallet on Base. Lightweight alternative to full portfolio when you just need quantities.
Wallet Analysis
AI-powered wallet analysis. Evaluates transaction patterns, portfolio health, and risk exposure for any address.
Token Price
Get current price for any token on Base by contract address. Includes USD price and 24h change.
Quick Integration
SDKimport { 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?
ProtocolHTTP 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.