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 addLiquidity requests and delegates them to the appropriate liquidity manager based on the lpType specified in the hook data.

  • Time-Based Commitments: The hook utilizes a TimeCommitment mechanism to differentiate between JIT and PLP liquidity. A positive block.timestamp in the TimeCommitment indicates a PLP, while its absence signifies a JIT provider.

  • Taxation and Revenue Distribution: The hook interacts with a TaxController to collect taxes from JIT providers and distribute revenue to PLPs.

  • JIT Liquidity Handling: For JIT requests, the hook communicates with a JITHub to determine the optimal liquidity parameters for a given swap.

Core Components

  • taxController: An instance of the ITaxController interface, responsible for managing tax collection and distribution.

  • jitHub: An instance of the IJITHub interface, 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 the TaxController.

Last updated