← Back to home

LimitCraft

Advanced limit order platform with TWAP and integrated lending protocols

Problem Statement

⛓️The Problem: Traditional limit orders rid lenders and traders of yield-earning opportunities by forcing them to wait for price targets. Capital sits idle, creating opportunity cost.🚀Our Solution: LimitCraft revolutionizes limit orders by integrating lending protocols directly into the order execution flow and also offers TWAP.Key Innovations:🪙Auto Asset UnwrapAutomatically withdraw maker tokens from AAVE just before your limit order fillsNo idle capital - your assets earn yield while orders are pending⚡Instant Yield DeploymentReceived tokens are instantly deposited into lending markets right after order executionSeamless transition from one yield-earning position to another at a favorable trade rate📊TWAP ExecutionFill large orders gradually over customizable time intervalsReduces market impact while maintaining capital efficiencyEach sub-order maintains the lending integration🔐Gasless ExperiencePermit2 integration eliminates repeated approval transactionsSign once, trade efficiently across multiple ordersTechnical Advantages:Non-custodial: Built entirely on 1inch Limit Order Protocol extensionsGas Optimized: Batched interactions reduce transaction costsMobile Responsive: Modern React UI with real-time order tracking

Solution

LimitCraft pushes the 1inch Limit Order Protocol to its limits, implementing sophisticated capital efficiency features through smart contract extensions:🏗️ Smart Contract ArchitectureCore Extensions(Solidity + Foundry):InteractionManager.sol- Orchestrates lending protocol interactionsTwapCalculator.sol- Handles time-weighted order calculationsCustom extension system integrating AAVE V3 lending pools🔄 Advanced Order MechanicsPreInteraction- Executed before order fills:Detects if maker asset is in AAVE lending positionAutomatically withdraws exact amount needed for the tradeSupports both regular and TWAP order typesPostInteraction- Executed after order fills:Instantly supplies received tokens to AAVE lending poolsMaintains capital efficiency throughout the trade lifecycleTWAP Implementation:UsesgetMakingAmount()andgetTakingAmount()callbacksCustom time-based calculation with Chainlink price feedsSupports 1-168 hour execution windows with configurable intervals⚡ Frontend InnovationModern React Stack:TypeScript + Vite for fast developmentWagmi v2 + RainbowKit for Web3 integrationshadcn/ui components for polished UXReal-time order status tracking with WebSocket connections1inch API Integration:Balance API for live wallet dataToken API for metadata resolutionPrice API for market rate calculationsPermit2 signatures for gasless approvals🛠️ Backend InfrastructureHigh-Performance Stack:Bun + Elysia.js- Ultra-fast TypeScript runtime (3x faster than Node.js)PostgreSQL + Drizzle ORM- Type-safe database operationsAutomated Resolver Service- Monitors and executes orders using 1inch APIsSystem Components:├── contracts/ - Solidity extensions + Foundry tests ├── api/ - REST API with order management ├── db/ - Database schema + migrations ├── resolver/ - Background order execution service └── ui/ - React frontend with Web3 integration🔐 Security & UX FeaturesEIP-712 Signatures- Industry standard order signingPermit2 Integration- Eliminates repeated approvals (gas savings ~60%)Mobile Responsive- Works seamlessly across all devices🎯 Hackathon AchievementsFirst-everlimit order platform with integrated lending yieldSub-secondorder matching and executionProduction-readyarchitecture with horizontal scaling supportIntuitive UX- Complex DeFi interactions simplified into one-click actions

Hackathon

ETHGlobal Unite

2025

Contributors