project screenshot 1
project screenshot 2
project screenshot 3
project screenshot 4

NextInch

Split large orders into chunks executed over time to minimize slippage & market impact.

NextInch

Created At

Unite Defi

Project Description

Nextinch is a sophisticated Time-Weighted Average Price (TWAP) execution system that enables cryptocurrency traders to execute large orders while minimizing market impact and slippage. Built on top of 1inch's infrastructure, our solution splits large trades into smaller chunks executed at predetermined intervals over time. The core innovation lies in our hybrid architecture: on-chain smart contracts securely hold user funds and manage order lifecycle, while off-chain workers handle order construction and simulation using 1inch's official SDK and APIs. This approach maintains decentralization principles while optimizing for gas efficiency and execution quality.

The system operates through three integrated components:

Smart Contracts (Solidity/Foundry) that custody funds and emit execution events

Node.js Workers that listen for events, construct orders via 1inch SDK, simulate trades using 1inch API, and trigger on-chain completion

React Frontend (Next.js) providing an intuitive interface for order creation and real-time progress tracking. Users configure token pairs, total amount, number of chunks (1-100), time intervals (minutes/hours), and slippage tolerance (1-5%). When orders are created, funds move to the secure contract, and workers automatically handle execution at scheduled times using 1inch's optimal price routing. The entire process is transparent, non-custodial, and includes cancellation options at any stage, with comprehensive testing ensuring security and reliability.

How it's Made

We built Nextinch using a hybrid on-chain/off-chain architecture with Solidity smart contracts handling fund security and order management. At the same time, Node.js workers perform heavy computations like order signing and simulation. The core TWAPCore contract uses event-driven scheduling to trigger off-chain workers, which leverage 1inch's SDK for limit order construction and API for trade simulation - allowing us to demonstrate advanced trading strategies without direct protocol interaction while complying with hackathon requirements.

The implementation features several innovative solutions: packed structs reduced storage costs by 30%, event-based scheduling eliminated expensive on-chain cron jobs, and a simulation-first approach with automatic slippage retries ensured reliable execution. We used Foundry for comprehensive testing (100% coverage), and developed a responsive Next.js frontend with real-time progress tracking - all while maintaining non-custodial security throughout the order lifecycle.

background image mobile

Join the mailing list

Get the latest news and updates