Position Limit Orders
Summary
Position Limit Orders plugin enables AMM-based limit orders implemented fully on-chain.
This implementation is based on the popular notion that a concentrated liquidity position outside the current price range is essentially a limit order.
Note, there are some important differences with existing off-chain solutions:
- • Limit Orders are only supported for ‘Sell High’/’Buy Low’ direction relative to existing price;
- • Order can be executed partially if price movement is too small;
- • User funds are withdrawn when the order is placed;
- • User has to trigger funds collection after the order has been executed;
- • Limit Orders are not time restricted and order cancellation is manual;
This plugin also requires a dedicated UI to enable user interaction with Limit Order functionality. Algebra provides a reference implementation of such a UI.
Features
- • Custom UI: Plugin-related UI needs to be integrated with DEX frontend.
- • Fully On-Chain: Deep integration with CLAMM mechanics ensures low slippage, order execution guarantees and no delays.
- • Moderate gas overhead: Limit Order check takes 20K - 40K gas on each swap. Closing all limit orders in single tick takes 140K - 150K gas (regardless of # orders closed).
- • Extra fees: Initiator of Limit Order obtains small fee generated by limit order liquidity
About Algebra Integral
Until now, each DEX had its source code in the form of a single immutable monolith, and updating such architecture required liquidity migration and associated additional expenses.
With the advent of Integral, it became possible to separate the most vulnerable part (liquidity storage) and peripheral functionality modules (e.g. oracles, fee calculation) from each other. Critical functionality of liquidity storage and swap calculations is kept at the unchangeable Core, while peripheral functionality performs as Plugins and can be updated when needed without liquidity migration. This approach allows DEXes to develop faster.
Plugins can be introduced by DEXes themselves or external developers encouraged by the fees to create new Plugins and push the technology forward according to DeFi current trends.