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