IJITHub
This interface defines the external functions of the JITHub
contract. It provides a standard way for other contracts, primarily the ParityTaxHook
, to request JIT liquidity calculations.
JITLiquidityResult
Struct
JITLiquidityResult
StructThis struct encapsulates the results of the JIT liquidity calculation.
isProfitable
: A boolean indicating whether providing JIT liquidity for the swap is likely to be profitable.swapDelta
: The predicted change in balances from the swap.jitLiquidityParams
: The recommendedModifyLiquidityParams
for the JIT provider to use.priceImpact
: The predicted price impact of the swap.swapFee
: The fee earned from the swap.
Functions
calculateJITLiquidityParamsForSwap(address routerSender, PoolKey memory poolKey, SwapParams memory swapParams)
: This is the core function of theJITHub
. It takes the details of a potential swap and returns aJITLiquidityResult
struct with the optimal parameters for providing JIT liquidity.
Last updated