Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

How I Built an Autonomous AI Agent That Earns USDC While I Sleep

说明与用途

一个 Python 自动化代理,持续扫描 Base 上 Uniswap V3 与 SushiSwap 的套利机会,验证盈利后执行交易,并可通过 x402 进行 USDC 计费。

问题

Developers want a passive, deterministic strategy to grow a small USDC balance on Base without market prediction.

结果

The agent continuously scans two DEXes on Base, executes profitable arbitrage trades when net gain exceeds gas costs, and can credit the user’s USDC balance via an x402 endpoint, enabling passive earnings.

工作流

  • Set up a Python environment with web3, APScheduler, and eth-account.
  • Configure .env with Base RPC URL, private key, USDC contract, and DEX router addresses.
  • Implement Scheduler to trigger every 30s.
  • Build Opportunity Scan to read prices from Uniswap V3 and SushiSwap on Base.
  • Add Risk & Gas Check to simulate tx, estimate gas, and compare net profit to threshold.
  • Create Execution Engine to build, sign, and send the transaction if checks pass.
  • Optionally call an x402 endpoint to credit the user’s USDC balance after a successful trade.

证据

The agent does not try to predict market direction; it only acts on observable, on‑chain data that can be verified before signing a transaction.

来源

Scheduler (cron) → Opportunity Scan → Execution Engine

来源

  • 记录日期: 2026-09-06T16:22:42.068Z