Yield Farm Payment
by @altoninelli
Transform your outgoing payments into a yield-generating asset. Auto recover of all paid amounts through yield farming on Aave V3. This skill automates on-ch...
clawhub install yield-farm-paymentπ About This Skill
name: yield-farm-payment version: 1.0.14 author: altoninelli
Please donate if you find this skill useful! (Base Mainnet).
donation: "0x1C7f7c428dE42B8402F8331612131cc8bC126369" description: "Free usage! Transform your outgoing payments into a yield-generating asset. Auto recover of all paid amounts through yield farming on Aave V3. This skill automates on-chain payments on the Base Network while simultaneously supplying collateral to Aave to optimize your capital efficiency." tags: ["DeFi", "Net Zero Cost", "Savings", "Payment", "Base network", "Automation", "Aave"] price_per_call: 0 USDC requires: - viem metadata: openclaw: emoji: "πΎ" category: "DeFi Payments" reputation_required: "medium" security_level: "high-privilege" warning: "Requires raw PRIVATE_KEY of a dedicated, low-balance wallet. Use only with a wallet containing limited funds."YieldFarmPayment Skill v1.0
Important Security Notice
This skill requires the user to provide a raw PRIVATE_KEY in the .env file.
This grants full control of the wallet to the skill.
Strongly recommended:
Environment variables required:
PRIVATE_KEY: Private key of dedicated walletBASE_RPC_URL: Base Mainnet RPC URLDeFi Immediate Payment System with Capital Recovery via Aave V3
Pay recipients immediately on Base network, then recover your capital over time through Aave V3 yield farming.
β οΈ v1.0 β Upfront Mode Only
v1.0 supports only Upfront Mode (immediate payment to recipient). Standard Mode (yield streaming) and Smart Mode (deadline optimization) are planned for v2.0 with x402 protocol integration.
π― Features
π° Monetization & Usage
π° How It Works (Upfront Mode)
Payment Flow:
1. Calculate total collateral:payment Γ multiplier Γ (1 + buffer%)
2. Transfer payment immediately to recipient (seller gets paid NOW)
3. Deposit remaining collateral in Aave V3
4. Yield accumulates on deposited collateral
5. Buyer recovers the payment amount over time via yieldRecovery Time Calculation:
The amount to recover is the PAYMENT (sent to seller), NOT the total collateral.
Recovery 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
Aave example APY ~3%
Annual Yield: 2.06 Γ 3% = 0.0618 USDC/year
Amount to Recover: 0.1 USDC (the payment, NOT the collateral)
Recovery Time: 0.1 / 0.0618 β 592 days (~1.6 years)
Why Higher Collateral = Faster Recovery:
| Multiplier | Aave Deposit | Annual Yield | Recovery 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 generated β faster recovery of the payment amount.
π Quick Start
Prerequisites
Installation
cd your-project
npm install viem dotenv
Configuration
1. Copy.env.example to .env
2. Set your PRIVATE_KEY and BASE_RPC_URL
3. Verify contract addresses for Base networkUsage
# Check configuration
node scripts/check-configuration.jsSafe simulation testing (no transactions)
node scripts/test-realistic-payment.jsRECOMMENDED WORKFLOW:
Step 1: Test with dry-run first (no on-chain execution)
node scripts/cli.js --dry-run --amount 0.1 --recipient 0x... --collateral 5 --buffer 8Step 2: Execute real transaction with interactive confirmation
node scripts/cli.js --amount 0.1 --recipient 0x... --collateral 5 --buffer 8Advanced: Skip confirmation after thorough review (use with caution)
node scripts/cli.js --confirm --amount 0.1 --recipient 0x... --collateral 5 --buffer 8Custom collateral multiplier
node scripts/cli.js --mode upfront --amount 0.5 --recipient 0x... --collateral 10 --buffer 5
π Project Structure
yield-farm-payment/
βββ SKILL.md # This documentation
βββ .env.example # Configuration template
βββ package.json # Dependencies
βββ scripts/
β βββ cli.js # CLI interface (upfront mode only in v1.0)
β βββ yield-farm-payment.js # Core payment logic (active)
β βββ transaction-manager.js # Robust transaction handling
β βββ collateral-calculator.js # Collateral optimization
β βββ check-configuration.js # Config validation
β βββ test-realistic-payment.js # Comprehensive tests
βββ references/
βββ aave-addresses.md # Aave contract addresses (v1.0)
βββ v2.0-planned/ # Planned features for future release
βββ 10x-collateral-guide.md
βββ flexible-collateral-guide.md
βββ x402-integration.md
π§ Configuration
Environment Variables (.env)
# Required
PRIVATE_KEY=0x... # Your wallet private key
BASE_RPC_URL=https://... # Base network RPCAave V3 Contracts (Base)
AAVE_V3_POOL_ADDRESS=0xA238Dd80C259a72e81d7e4664a9801593F98d1c5
USDC_ADDRESS=0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
AAVE_USDC_TOKEN_ADDRESS=0x4e65fE4DbA92790696d040ac24Aa414708F5c0ABSettings
SKILL_FEE_USDC=0 # Fee per skill call
DEFAULT_COLLATERAL_MULTIPLIER=20 # 20x default for ~1.6 year recovery
DEFAULT_BUFFER_PERCENTAGE=8
ESTIMATED_APY=0.03 # 3% conservative APY estimate
π Security & Safety
Built-in Protections
Transaction Confirmation & Prevention of Accidents
--dry-run flag)CLI Safety Flags
# Test with dry-run first (RECOMMENDED)
node scripts/cli.js --dry-run --amount 0.1 --recipient 0x...Real transaction with interactive confirmation (default)
node scripts/cli.js --amount 0.1 --recipient 0x...Skip confirmation only after thorough review (use with caution)
node scripts/cli.js --confirm --amount 0.1 --recipient 0x...
Risk Management
π¨ Error Handling
Common Errors & Solutions
π Roadmap
v2.0 Planned Features
π License
MIT License
π Acknowledgments
YieldFarmPayment v1.0 β Immediate payments with capital recovery on Base network. π
π‘ Examples
# Check configuration
node scripts/check-configuration.jsSafe simulation testing (no transactions)
node scripts/test-realistic-payment.jsRECOMMENDED WORKFLOW:
Step 1: Test with dry-run first (no on-chain execution)
node scripts/cli.js --dry-run --amount 0.1 --recipient 0x... --collateral 5 --buffer 8Step 2: Execute real transaction with interactive confirmation
node scripts/cli.js --amount 0.1 --recipient 0x... --collateral 5 --buffer 8Advanced: Skip confirmation after thorough review (use with caution)
node scripts/cli.js --confirm --amount 0.1 --recipient 0x... --collateral 5 --buffer 8Custom collateral multiplier
node scripts/cli.js --mode upfront --amount 0.5 --recipient 0x... --collateral 10 --buffer 5
βοΈ Configuration
1. Copy .env.example to .env
2. Set your PRIVATE_KEY and BASE_RPC_URL
3. Verify contract addresses for Base network
Usage
# Check configuration
node scripts/check-configuration.jsSafe simulation testing (no transactions)
node scripts/test-realistic-payment.jsRECOMMENDED WORKFLOW:
Step 1: Test with dry-run first (no on-chain execution)
node scripts/cli.js --dry-run --amount 0.1 --recipient 0x... --collateral 5 --buffer 8Step 2: Execute real transaction with interactive confirmation
node scripts/cli.js --amount 0.1 --recipient 0x... --collateral 5 --buffer 8Advanced: Skip confirmation after thorough review (use with caution)
node scripts/cli.js --confirm --amount 0.1 --recipient 0x... --collateral 5 --buffer 8Custom collateral multiplier
node scripts/cli.js --mode upfront --amount 0.5 --recipient 0x... --collateral 10 --buffer 5