Decentralized exchanges (DEXs) have evolved significantly, now offering advanced functionalities that rival those of centralized exchanges (CEX). A key feature increasingly available on DEXs is the limit order. This article explores the current landscape of limit order protocols, analyzing their advantages and limitations.
Unlike market orders, which execute immediately at the last available market price, limit orders only execute once a predetermined price level is reached. Most automated market maker (AMM)-based DEXs default to a market order system, which is straightforward for beginners. Market orders either execute successfully or fail due to parameters like excessive price impact.
Limit orders are generally considered tools for more advanced traders. They require analyzing market conditions and assessing the probability that an asset will reach a specific price level. For professional market makers (PMMs), limit orders are an essential tool that can significantly improve trading profitability. However, placing limit orders on a blockchain also requires careful consideration of gas fees, which are influenced by order size.
Several decentralized protocols, including SushiSwap and 0x, now offer limit order functionality, much like their centralized counterparts.
The 1inch Limit Order Protocol
This summer, the 1inch Network launched its own limit order protocol, incorporating several advanced features. A key differentiator is its cost structure. The 1inch protocol holds an advantage over some competitors by not adding extra fees on top of network costs. While 0x previously charged fees for limit orders in its V3 and V4 iterations, its community voted for a zero-fee model following issues arising from Ethereum's EIP-1559 update. SushiSwap also doesn't charge additional fees, but its orders can only be filled by its own market makers, which can complicate arbitrage and lead to orders only executing when prices overlap more significantly.
Beyond cost, the 1inch Limit Order Protocol introduces sophisticated features rarely seen in DeFi, such as dynamic pricing, conditional execution, and a Request-for-Quote (RFQ) system.
Request-for-Quote (RFQ) Functionality
The RFQ system can be thought of as an over-the-counter (OTC) trading desk within a DEX. It enables market makers to bridge liquidity from CEXs to DEX users, providing better pricing for medium to large-sized trades.
This system connects CEX and cross-chain liquidity to 1inch, offering a more seamless solution than many so-called "cross-chain swaps." The goal is to make providing large amounts of liquidity to DEXs easier and more profitable while mitigating risk. Because the RFQ system allows market makers to choose when and with whom to trade, they can maximize the ratio of retail order flow to arbitrage flow.
This functionality allows professional market makers, who typically trade on CEXs or OTC desks, to execute large cryptocurrency trades on DEXs with lower risk. Consequently, it incentivizes them to shift significant liquidity from CEXs onto decentralized venues.
For example, if a user wants to swap 1000 ETH, the 1inch RFQ protocol can contact professional market makers to gauge their interest. If interested, a market maker sends a signed order. Once executed, the market maker might sell the 1000 ETH on a DEX on another chain for a profit, and the DEX benefits from the imported liquidity. This process effectively transfers CEX and cross-chain liquidity to the 1inch ecosystem.
Furthermore, the RFQ system offers improved gas efficiency. While filling a simple market order might cost around 90k gas, an RFQ order on the 1inch protocol consumes approximately 70k gas.
Conditional Order Execution
The conditional execution feature allows users to maximize their trading returns by specifying custom conditions that must be met for an order to execute. The 1inch protocol supports fully dynamic conditions that can rely on oracle data. A prime example of this is a stop-loss order based on an oracle's price feed.
Dynamic Pricing
With dynamic pricing, the swap rate is calculated on-chain by a smart contract based on real-time supply and demand. This differs from other limit order protocols where users simply state they want to swap X amount of Token A for Y amount of Token B. With dynamic pricing, the smart contract determines how much of Token B the user will receive for their offered amount of Token A.
One promising application for dynamic pricing is auctions. Limit orders can be configured so that their price increases or decreases over time. Similarly, this functionality can support token sales based on auction models or NFT auctions.
Stop Orders and Trailing Stop Orders
The combination of conditional execution and dynamic pricing enables more complex order types like stop orders and trailing stop orders.
A stop order is only triggered when specific price conditions are met, with data provided by an oracle. For example, "Sell wETH at $2000 when the oracle price falls below $2000." Stop orders can be combined with market or limit orders, providing traders greater flexibility to create sophisticated strategies.
The fundamental difference between a limit order and a stop order is visibility. Limit orders are typically placed on an order book and are visible to everyone, while a stop order is only submitted to the order book once a pre-defined trigger price is reached.
A stop order instructs the system to "buy/sell immediately if the price reaches X," while a stop-limit order says, "place a buy/sell limit order at price Y if the price reaches X." The values for X and Y can be the same, but don't have to be.
For instance, a combination could be: "If the oracle price for Bitcoin falls below $30,500, then place a sell order for Bitcoin at $30,000."
A trailing stop order is a market order that sets a stop price at a specific percentage below the market price, rather than a single static value. This stop price then "trails" the market price as it moves up, locking in profits. An example is: "Sell this asset if its price falls $300 from its highest price today."
Trailing stop orders are made possible by the conditional execution and dynamic pricing features unique to the 1inch Limit Order Protocol.
These advanced features can be further developed by third parties in the future, as the protocol is open-source and designed for composability and extension.
Gas Efficiency
An analysis of gas usage across different protocols reveals the efficiency of the 1inch approach. The following data summarizes the 90th percentile gas usage (covering 90% of transactions) for RFQ order execution in four versions of the 0x protocol compared to both regular limit and RFQ orders in the 1inch protocol.
The results show that 1inch RFQ orders consume the least amount of gas, making them among the most cost-effective options for traders when total cost is considered.
Multi-Chain Support and Integration
Another significant advantage of the 1inch Limit Order Protocol is its multi-chain support. Deployed on Ethereum, Binance Smart Chain, Polygon, and Arbitrum, it extends limit order functionality far beyond the Ethereum ecosystem.
The protocol is highly versatile and can be easily integrated into any other DeFi protocol, serving as a foundation for building various complex products. Developer documentation outlines the main operational principles for limit and RFQ orders. Developers interested in building specific solutions on the protocol can even apply for a grant from the 1inch Foundation for projects like stop-loss orders, trailing stop orders, or liquidation auctions for protocols like Aave and Maker.
Frequently Asked Questions
What is a limit order on a DEX?
A limit order is an instruction to buy or sell a crypto asset only at a specified price or better. Unlike a market order that executes immediately at the current market rate, a limit order waits on the order book until its conditions are met.
How does a limit order differ from a stop order?
A limit order is placed on the order book immediately and is visible to others. A stop order remains hidden and is only triggered and converted into a market or limit order once a specific market price (the "stop price") is reached, as reported by an oracle.
Why is gas efficiency important for limit orders?
Since limit orders are placed on-chain, users pay gas fees. Higher gas costs can erode potential profits from a successful trade, especially for smaller orders. Efficient protocols minimize these costs.
What is an RFQ (Request-for-Quote) in DeFi?
An RFQ system allows larger traders to request price quotes from professional market makers directly within a DEX. This often results in better pricing for large trades by tapping into CEX-level liquidity, effectively bridging centralized and decentralized liquidity.
Can I create a trailing stop order on a DEX?
Yes, advanced protocols like 1inch's enable trailing stop orders through features like conditional execution and dynamic pricing. These orders automatically adjust their trigger price as the market moves to help lock in profits. 👉 Explore advanced trading strategies
Are limit orders on DEXs secure?
Limit orders on reputable DEXs are executed via audited smart contracts, making them trustless and secure. However, users must be aware of the smart contract risks associated with any DeFi protocol and should only use well-established platforms.
Conclusion
The goal of DEXs has always been to mirror the functionality of CEXs within a decentralized framework. In some areas, like AMMs, DEXs have already surpassed their centralized counterparts. Limit order functionality is a crucial tool for pushing the segment forward and closing the gap in the options provided by CEXs and DEXs. Advanced features like those offered by the 1inch protocol enhance flexibility, efficiency, and access to liquidity, making decentralized trading more powerful for all users. 👉 View real-time trading tools