📦 Yield Farm Payment
v1.0.3Pay any seller at ZERO net cost. Our high-efficiency 记录ic on Base L2 off设置s network fees by pAIring payments with low-risk, stablecoin-based yield investme...
详细分析 ▾
运行时依赖
安装命令
点击复制技能文档
YieldFarmPayment 技能 v1.0.3
导入ant Security Notice
This 技能 requires the user to provide a raw PRIVATE_KEY in the .env file. This grants full control of the wallet to the 技能.
Strongly recommended:
Use a dedicated wallet 创建d only for this 技能 Fund it with only the necessary amount + small buffer for gas Never use your mAIn wallet or a wallet contAIning 签名ificant funds
DeFi Immediate Payment 系统 with CAPItal 恢复y via Aave V3
Pay recipients immediately on Base network, then 恢复 your cAPItal over time through Aave V3 yield farming.
⚠️ v1.0.3 — Upfront Mode Only
v1.0 supports only Upfront Mode (immediate payment to recipient). Standard Mode (yield 流ing) and Smart Mode (deadline optimization) are planned for v2.0 with x402 protocol integration.
🎯 Features Upfront Mode: Immediate USDC payment to recipient + cAPItal 恢复y via yield Flexible Collateral: 3x to 20x multiplier with configurable buffer (default: 20x) Aave V3 Integration: Deposit collateral to earn yield on Base network Robust Transaction Handling: Automatic retry, gas optimization, error 恢复y Professional 命令行工具: Full-featured command line interface 💰 How It Works (Upfront Mode) Payment Flow: Calculate total collateral: payment × multiplier × (1 + buffer%) Transfer payment immediately to recipient (seller 获取s pAId NOW) Deposit remAIning collateral in Aave V3 Yield accumulates on deposited collateral Buyer 恢复s the payment amount over time via yield 恢复y Time Calculation:
The amount to 恢复 is the PAYMENT (sent to seller), NOT the total collateral.
恢复y Time = Payment Amount / Annual Yield from Aave Deposit
Example: 0.1 USDC payment, 20x collateral, 8% buffer, 3% APY Total Locked: 0.1 × 20 × 1.08 = 2.16 USDC Immediate Payment: 0.1 USDC → sent to recipient Aave Deposit: 2.16 - 0.1 = 2.06 USDC Annual Yield: 2.06 × 3% = 0.0618 USDC/year Amount to 恢复: 0.1 USDC (the payment, NOT the collateral) 恢复y Time: 0.1 / 0.0618 ≈ 592 days (~1.6 years)
Why Higher Collateral = Faster 恢复y: Multiplier Aave Deposit Annual Yield 恢复y Time 3× 0.224 USDC 0.0067 USDC ~15 years 5× 0.440 USDC 0.0132 USDC ~7.5 years 10× 0.980 USDC 0.0294 USDC ~3.4 years 20× 2.060 USDC 0.0618 USDC ~1.6 years
More collateral deposited in Aave → more yield 生成d → faster 恢复y of the payment amount.
🚀 Quick 启动 Prerequisites Node.js 18+ Base network wallet with ETH for gas USDC 令牌s for collateral 安装ation cd your-project npm 安装 viem dotenv
Configuration Copy .env.example to .env 设置 your PRIVATE_KEY and BASE_RPC_URL 验证 contract 添加resses for Base network Usage # 检查 configuration node scripts/检查-configuration.js
# Safe simulation 测试 (no transactions) node scripts/test-rea列出ic-payment.js
# Upfront payment with default 20x collateral node scripts/命令行工具.js --amount 0.1 --recipient 0x... --buffer 8
# Custom collateral multiplier node scripts/命令行工具.js --mode upfront --amount 0.5 --recipient 0x... --collateral 10 --buffer 5
📁 Project Structure yield-farm-payment/ ├── 技能.md # This documentation ├── .env.example # Configuration template ├── package.json # Dependencies ├── scripts/ │ ├── 命令行工具.js # 命令行工具 interface (upfront mode only in v1.0) │ ├── yield-farm-payment-corrected.js # Core payment 记录ic (active) │ ├── transaction-管理器.js # Robust transaction handling │ ├── collateral-calculator.js # Collateral optimization │ ├── 检查-configuration.js # Config 验证 │ └── test-rea列出ic-payment.js # Comprehensive tests └── references/ ├── aave-添加resses.md # Aave contract 添加resses (v1.0) └── v2.0-planned/ # Planned features for future release ├── 10x-collateral-图形界面de.md ├── flexible-collateral-图形界面de.md └── x402-integration.md
🔧 Configuration 环境 Variables (.env) # Required PRIVATE_KEY=0x... # Your wallet private key BASE_RPC_URL=https://... # Base network RPC
# Aave V3 Contracts (Base) AAVE_V3_POOL_添加RESS=0x794a61358D6845594F94dc1DB02A252b5b4814aD USDC_添加RESS=0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 AAVE_USDC_令牌_添加RESS=0x4e65fE4DbA92790696d040ac24Aa414708F5c0AB
# 设置tings 技能_FEE_USDC=0.20 # Fee per 技能 call DEFAULT_COLLATERAL_MULTIPLIER=20 # 20x default for ~1.6 year 恢复y DEFAULT_BUFFER_PERCENTAGE=8 ESTIMATED_APY=0.03 # 3% conservative APY estimate
🔒 Security & Safety Built-in 保护ions Balance Verification: Pre-transaction 检查s Gas Limit 监控ing: 预防s excessive fees Transaction Retry: 3 attempts with gas price escalation Nonce Management: Handles concurrent transactions Risk Management Collateral Buffer: 5-15% safety margin APY Estimation: Conservative 3% default Multiplier Limits: 3x minimum, 20x maximum 🚨 Error Handling Common Errors & Solutions "replacement transaction underpriced": Automatic retry with increased gas "insufficient funds": Balanc