FEAWS

Production grade DeFi protocol using TWAP + yield-aware orders via 1inch for treasury optimization

FEAWS

Created At

Unite Defi

Project Description

1inch Limit Order Protocol Extension: Yield-Gated TWAP

FEAWS implements advanced strategies and hooks for the 1inch Limit Order Protocol, specifically yield-gated TWAP swaps that combine:

  • Time-weighted average price (TWAP) execution
  • Yield-aware predicates (only execute when destination asset yield ≥ threshold)
  • Custom order hooks via 1inch LoP predicates
  • Advanced order types beyond basic limit orders

1. Vision & Value Proposition

FEAWS (Flexible Execution Automated Yield Swaps) allows treasuries and advanced traders to ladder into or out of positions only when the real-time yield of the destination asset meets a configurable threshold. It unites the capital-efficiency of TWAP/DCA with capital-productivity awareness (staking/lending yield), delivering smarter order execution on Ethereum & L2s.

Key benefits:

  • Lower slippage & better prices – tranches smooth market impact.
  • Yield-aware deployment – capital moves only when it earns the desired return.
  • 100 % on-chain & trustless – leverages 1inch Limit Order Protocol (LoP) predicates.
  • Reusable building block for treasury automation, robo-advisors, and yield strategies.

2. Problem Statement

Treasury desks often dollar-cost average into yield-bearing assets (e.g. stETH, aUSDC) but:

  1. Bulk swaps create slippage.
  2. Static DCA ignores whether the yield is attractive.
  3. Manual monitoring is error-prone and lacks execution discipline.

How it's Made

Tech Stack

Smart Contracts

  • Solidity 0.8.23 - Latest stable version with custom errors
  • Hardhat 2.19+ - Development environment, testing, deployment
  • Foundry - Advanced testing with fuzzing and gas optimization
  • OpenZeppelin 5.0 - Security-audited base contracts
  • 1inch Limit Order Protocol v4 - Core order execution

Oracle & Automation

  • Chainlink Functions - Off-chain APY data fetching (primary)
  • Gelato Automate - Backup oracle update mechanism
  • Chainlink Price Feeds - Token price validation
  • The Graph - Event indexing for strategy tracking

Relayer Bot

  • Node.js 20+ with TypeScript 5.3
  • ethers.js v6 - Ethereum interaction
  • PostgreSQL - Strategy and tranche state management
  • Redis - Caching and job queuing
  • Docker - Containerized deployment
  • PM2 - Process management and monitoring

4 Frontend

  • Next.js 14 - React framework with App Router
  • wagmi v2 - React hooks for Ethereum
  • viem - TypeScript Ethereum library
  • RainbowKit - Wallet connection UI
  • TailwindCSS - Styling framework
  • Recharts - Data visualization

5 Development Tools

  • GitHub Actions - CI/CD pipeline
  • Tenderly - Smart contract monitoring
  • Slither - Static analysis security scanner
  • Gas Reporter - Gas optimization tracking

background image mobile

Join the mailing list

Get the latest news and updates