Video thumbnail

prism_orders

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

prism_orders

Created At

ETHGlobal Cannes

Winner of

1inch - Extend Limit Order Protocol 2nd place

Project Description

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 monitoring

Flexible configuration: asset pairs, size, triggers, intervals

Intelligent 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

How it's Made

I built Prism Orders as a modular, non-custodial trading strategy toolkit designed to bring CEX-level trading experience to DEX users, leveraging the 1inch Limit Order Protocol v4.

Tech Stack Overview

Smart 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 scheduling
  • Interaction with the 1inch API for order creation, signing, and broadcasting
  • Off-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 Highlights

Gas 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 with pre-signing multiple limit orders in a single wallet session — this felt very CEX-like and removed friction for power users.

Tested on Base: I chose Base chain for 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 Benefits

Using 1inch’s infrastructure gave us:

  • Proven security without writing custom contracts
  • Rich APIs for order and price data
  • Seamless execution layer that handled edge cases like partial fills and expiration
background image mobile

Join the mailing list

Get the latest news and updates