← Back to home

prism_orders

Automated DCA, TWAP & Grid trading via 1inch Limit Order Book API, smart & gas-optimized.

Problem Statement

Prism Orders is a smart execution strategy toolkit built on top of the 1inch Limit Order Protocol v4, designed for DeFi users, traders, and portfolio managers who want precise, automated trading with CEX-like user experience — while keeping full custody of their funds.It enables three key strategies:TWAP (Time-Weighted Average Price): Split large trades into smaller time-based chunks to minimize market impact and reduce slippage.DCA (Dollar-Cost Averaging) / Hodl Ladder: Accumulate assets over time or at strategic price levels using automated smart limit orders.Grid Strategy: Place layered buy/sell orders above and below the current price to profit from market volatility.🧠 Advanced Features:Real-time strategy tracking and order monitoringFlexible configuration: asset pairs, size, triggers, intervalsIntelligent gas price management and batch execution✅ Non-Custodial: Your funds never leave your wallet ✅ Battle-Tested: Built on 1inch’s robust infrastructure ✅ Open-Source: Fully transparent and auditable ✅ Gas-Efficient: Smart batching and optimization ✅ CEX-like UX: Seamless, intuitive experience built for DeFi

Solution

I built Prism Orders as a modular, non-custodial trading strategy toolkit designed to bringCEX-level trading experience to DEX users, leveraging the1inch Limit Order Protocol v4.Tech Stack OverviewSmart Contracts: I use inch Limit Order Protocol v4 as the backbone for all on-chain execution. Its flexibility allows us to create advanced conditional limit orders without writing new smart contracts, reducing both risk and complexity.Backend (Node.js): I wrote a Node.js automation engine that orchestrates strategy logic (TWAP, DCA, Grid). It handles:Time-based and price-triggered order schedulingInteraction with the 1inch API for order creation, signing, and broadcastingOff-chain monitoring of order status (active, filled, expired)1inch APIs:Limit Order Book API: Used to post and manage orders Price Feed API: Used to calculate price thresholds for DCA/Grid strategies These APIs were instrumental — they removed the need for us to build and host our own indexing oracles and let us focus purely on execution logic.Automation: Orders are executed on-chain, but all strategy logic runs off-chain. This allows for greater flexibility in strategy evolution (e.g., rebalancing grids or modifying TWAP parameters) without needing contract redeployment.Notable & Hacky HighlightsGas Optimization with Order Batching: I implemented a pseudo-batching system to minimize gas costs when multiple orders are created in sequence (e.g., TWAP schedules). This isn't native batching, but uses strategic timing and parameter tuning to reduce on-chain overhead.Adaptive DCA Laddering: I created a dynamic laddering algorithm that adjusts DCA steps based on current price volatility. For example, in sideways markets, it widens the spread to capture more meaningful dips.Reusing Order Signatures Across Intervals: To reduce repeated wallet interactions, we experimented withpre-signing multiple limit ordersin a single wallet session — this felt very CEX-like and removed friction for power users.Tested on Base: I choseBase chainfor fast finality and low gas, and because 1inch supports it well. This made our grid strategy far more viable due to frequent small trades.Partner Tech BenefitsUsing 1inch’s infrastructure gave us:Proven security without writing custom contractsRich APIs for order and price dataSeamless execution layer that handled edge cases like partial fills and expiration

Hackathon

ETHGlobal Cannes

2025

Prizes

  • 🏆

    Extend Limit Order Protocol2nd place

    1inch

Contributors