ParityTaxHook
The ParityTaxHook is a smart contract that acts as a hook for Uniswap V4 pools. It is designed to manage liquidity provision from different sources, distinguishing between Just-In-Time (JIT) liquidity and Provisioned Liquidity Providers (PLPs).
Key Functionalities
Liquidity Management: The hook intercepts
addLiquidityrequests and delegates them to the appropriate liquidity manager based on thelpTypespecified in the hook data.Time-Based Commitments: The hook utilizes a
TimeCommitmentmechanism to differentiate between JIT and PLP liquidity. A positiveblock.timestampin theTimeCommitmentindicates a PLP, while its absence signifies a JIT provider.Taxation and Revenue Distribution: The hook interacts with a
TaxControllerto collect taxes from JIT providers and distribute revenue to PLPs.JIT Liquidity Handling: For JIT requests, the hook communicates with a
JITHubto determine the optimal liquidity parameters for a given swap.
Core Components
taxController: An instance of theITaxControllerinterface, responsible for managing tax collection and distribution.jitHub: An instance of theIJITHubinterface, which provides functionalities for JIT liquidity management.
Hook Permissions
The ParityTaxHook implements the following hooks:
afterAddLiquidity: To enforce deadlines on committed positions.beforeRemoveLiquidity: To prevent PLPs from withdrawing liquidity before their commitment expires.afterRemoveLiquidity: To manage tax income and distribution.beforeSwap: To handle JIT liquidity provision requests.afterSwap: To fulfill JIT liquidity requests and manage related accounting.afterSwapReturnDelta: To enable dynamic fees and taxing.afterAddLiquidityReturnDelta: To adjust balances after adding liquidity.afterRemoveLiquidityReturnDelta: To manage revenue from theTaxController.
Last updated
