-
Notifications
You must be signed in to change notification settings - Fork 631
Description
Component
Position Manager
Describe the suggested feature and problem it solves.
Summary
Add support for using ERC6909 credits as a payment method in the PositionManager, allowing users to leverage their existing credits in the PoolManager for position-related operations without requiring external token transfers.
Motivation
The current PositionManager implementation supports creating and modifying positions using external tokens via Permit2, but lacks the ability to utilize ERC6909 credits that users may already have in the PoolManager. This creates an architectural disconnect between the core and periphery layers, as the PoolManager supports a dual accounting system (delta accounting and ERC6909 credits) while the PositionManager only interfaces with one side of this system.
Adding ERC6909 credits support would:
- Improve gas efficiency by eliminating unnecessary token transfers for users who already have credits
- Create a more cohesive UX between swapping and liquidity provision
- Better align the periphery with core design principles
- Enable more sophisticated integrations with hooks and other protocols
Describe the desired implementation.
Proposed Solution
Enhance the PositionManager to support using ERC6909 credits for operations such as minting positions and modifying liquidity. This would involve:
- Modifying the
_paymethod to check for and use ERC6909 credits when available - Adding new action types to the
Actionslibrary to explicitly support ERC6909-based operations - Implementing preference mechanisms to allow users to choose between credits and external transfers
Example Usage Flows
Current Flow (Using External Tokens):
- User approves tokens via
Permit2 - User calls
PositionManagerto mint/modify position PositionManagertransfers tokens from user viaPermit2- Position is created/modified
Proposed Flow (Using ERC6909 Credits):
- User already has
ERC6909credits inPoolManager - User calls
PositionManagerwith action indicating ERC6909 credit usage PositionManagerburns user's credits viaPoolManager- Position is created/modified
Hybrid Flow:
- User has some credits and some external tokens
- User approves external tokens via
Permit2 - User calls
PositionManagerwith hybrid action PositionManageruses credits first, then external tokens as needed- Position is created/modified
Implementation Considerations
Core Components to Modify
-
DeltaResolver Base Contract:
- Enhance
_paymethod to support ERC6909 credits
- Enhance
-
Actions Library:
- Add new action codes for ERC6909-specific operations
- Consider adding preference parameters to existing actions
-
PositionManager Contract:
- Extend
_handleActionto process new ERC6909-related actions
- Extend
Initial Action Types to Consider
MINT_POSITION_FROM_6909- Create position using existing creditsINCREASE_LIQUIDITY_FROM_6909- Add liquidity using existing credits
Describe alternatives.
No response
Additional context.
No response