Feature Request: Time-In-Force for Liquidity Positions
Summary
Add the ability for liquidity positions to specify time-based automatic closure
Problem Statement
Penumbra LPs can already specify a “close on fill” option which helps them emulate the behavior of limit orders. They can also be used to create “JIT liquidity” similar to “fill or kill”, by opening and closing a position in the same transaction, causing it to be live for exactly one block.
However, it would also be useful for liquidity providers to be able to specify that liquidity is available for a specific (block-based) time range. This would allow “semi-passive” liquidity management (this liquidity is available for the next 4h, 8h, etc).
Proposed Solution
Add an optional field to the position that declares a block height at which the position should be automatically closed. If set, the DEX engine should set a trigger that causes the position to be auto-closed at that height (if it is not already closed).
Technical Details
This could use a similar approach as is used for auctions.
Benefits
Allows specifying liquidity only valid today, tomorrow, etc.
Also prevents censorship of order cancellations, if they are pre declared.
Potential Drawbacks
Seems minimal. No unbounded computation is possible.
Alternatives Considered
Not having this feature (status quo)
Priority
Low: this would require a chain upgrade, it’s not worth an upgrade on its own but I think it would be useful to include in a next one, as that process shakes out.
Note to submitters: Please fill out as many sections as possible to help the development team understand and evaluate your feature request.