All projects

AgentTrade

AI trading agents consume CRE workflows via x402 USDC micropayments for verified signals

CRE & AI

What it is

AgentTrade demonstrates how AI trading agents can consume Chainlink CRE workflows via x402 micropayments. The system uses CRE to orchestrate real-time price analysis from Chainlink Data Feeds on Sepolia, generates AI-powered trading signals using momentum and mean reversion strategies, and serves them through an x402-gated API where any AI agent can pay $0.01 USDC per request. No accounts or API keys needed - just programmatic payments. The CRE workflow runs on a 5-minute cron schedule across the DON, reading ETH/USD and BTC/USD prices via evmClient.callContract(), then running multi-strategy signal analysis. This solves the problem of AI agents needing reliable, tamper-proof market data with no standard pay-per-use infrastructure.

How it Works

Built with Chainlink CRE SDK in TypeScript. The CRE workflow uses cron triggers (every 5 min), EVM client callContract() to read Chainlink Data Feeds (ETH/USD and BTC/USD on Sepolia), and HTTP triggers for on-demand requests. Signal analysis uses momentum and mean reversion strategies with confidence scoring. The x402 gateway is an Express.js server that returns 402 Payment Required with USDC payment details. AI agent consumes signals with position sizing and risk management. Stack: CRE SDK, TypeScript, Viem, Express.js, x402 protocol.

Links

Created by

  • Alex Tolmach