← Back to home

Yield Drip

Automated DCA yield farming with 1inch LOP - earn yield while dollar-cost averaging into ETH

Problem Statement

YieldDrip is a DeFi application that solves the capital inefficiency problem in traditional Dollar-Cost Averaging (DCA). When users set up a DCA strategy to buy ETH over time, their idle capital typically sits in a wallet earning nothing. YieldDrip changes this by immediately depositing all capital into a yield-bearing vault (sDAI) and withdrawing funds just-in-time for each purchase.The system works through three core smart contracts:YieldDepositHelper: Immediately deposits user's DAI into sDAI vault to start earning yieldYieldWithdrawHelper: Withdraws exact amounts needed for each trade, keeping remaining funds earning yieldLinearTwapGetter: Calculates proportional amounts for each time slice using Time-Weighted Average PriceUsers create a single EIP-712 order that generates 24 separate limit orders on 1inch's Limit Order Protocol. Each order includes custom predicates for time-based execution and price floor protection using Chainlink feeds. The system automatically skips purchases when ETH price exceeds user-defined limits, keeping funds earning yield until prices become favorable.Key innovations:Zero opportunity cost: 100% capital utilization vs ~50% in traditional DCAReal yield earning: sDAI provides 3-5% APR on idle capitalPrice protection: Smart predicates prevent overpayingSingle signature: One EIP-712 signature creates entire DCA strategyThe frontend provides real-time strategy monitoring, yield analytics, and manual execution controls for demo purposes.

Solution

YieldDrip is built using a modern DeFi stack with real smart contract integration:Smart Contracts (Solidity + Foundry):YieldDepositHelper: Handles DAI to sDAI conversion for immediate yield earningYieldWithdrawHelper: Manages just-in-time DAI withdrawal for order executionLinearTwapGetter: Calculates dynamic amounts for each time slice using TWAPMockERC4626Yield: Simulates yield-bearing vault functionality for testingComprehensive test suite with Foundry for security validationFrontend (Next.js + TypeScript + Wagmi):Real 1inch Limit Order SDK integration using @1inch/limit-order-sdkCustom React hooks (use1inchIntegration) for seamless DeFi interactionWagmi for wallet connection and EIP-712 signature handlingReal-time order monitoring with WebSocket integrationModern UI with Tailwind CSS and shadcn/ui componentsKey Technical Achievements:Direct integration with 1inch LOP v4 using official SDKCustom SDK implementation for direct contract interactionEIP-712 structured data signing for secure order creationPredicate-based order execution with Chainlink price feed integrationReal-time yield tracking with live sDAI balance monitoringDeployment & Infrastructure:Foundry-based deployment system with comprehensive scriptsBase Sepolia testnet deployment with contract verificationEnvironment-based configuration for seamless testnet/mainnet switchingDocker-ready backend architecture for production scalingThe system demonstrates advanced DeFi concepts including yield farming, automated market making, and cross-protocol integration while maintaining excellent UX through single-signature strategy creation.

Hackathon

ETHGlobal Unite

2025

Contributors