Open the app

HookrKernelQuoterV1

Read about the trusted quoter contract: the exact same router code path, always simulated first and then cleanly reverted.

Deployed at 0x5Ba8FBbB4aB20Ff6Daf0ecDEBe3784f869BcB1B5, compiled from src/HookrKernelQuoterV1.sol at source commit 8db7fc940938f811f508ba9cb0c8f2d3f24c9a25. Its source is verified on the explorer; see Verification. ABI: /api/v2-abi/HookrKernelQuoterV1.

Implements: IUnlockCallback, IHookrKernelIntegrationV1

The trusted quoter. Simulates a swap through the real code path and reverts with the result

A Hookr quote runs the same hook callbacks, the same module walk and the same fee override a real swap would, then reverts to discard the state. That is what makes it accurate on a pool with surge fees, a guard window, or input cuts, where a curve-only quote would be wrong.

Being the pool's registered quoter also means the pot leg is simulated. A quote from the Uniswap V4Quoter sees the same pool without the pot cut, which is what a Universal Router swap would actually pay.

Identity

Two pure getters every contract in the graph carries, so an integrator can confirm what it is holding without a bytecode comparison.

function contractName() external pure returns (string memory);   // "HookrKernelQuoterV1"
function contractVersion() external pure returns (string memory); // "1.1.0"

Constants

NameTypeValue
KERNEL_FAMILY_IDbytes32keccak256("HOOKR_SWAP_DELTA_V1")
QUOTER_INTEGRATION_KINDbytes32keccak256("HOOKR_KERNEL_INTEGRATION_QUOTER")
DYNAMIC_FEE_FLAGuint240x800000, the PoolKey.fee every Hookr pool carries
MAX_MODULE_DATA_LENGTHuint2563,904
MIN_SQRT_PRICE_LIMITuint1604295128740
MAX_SQRT_PRICE_LIMITuint1601461446703485210103287273052203988822378723970341

State Variables

NameTypeDescription
poolManagerIPoolManagerImmutable. The v4 singleton the simulation unlocks
stackRegistryIHookrStackRegistryV1Immutable. Source of the pool's frozen stack

Integration Identity

The registry round-trips a registration through these three getters and reverts IntegrationMetadataMismatch if the values it was handed disagree with what the implementation answers, so a quoter cannot be registered under a family or version it does not serve.

function integrationKind() external pure returns (bytes32);      // QUOTER_INTEGRATION_KIND
function integrationFamilyId() external pure returns (bytes32);  // KERNEL_FAMILY_ID
function integrationVersion() external pure returns (uint32);    // 1

Functions

constructor

constructor(IPoolManager poolManager_, IHookrStackRegistryV1 stackRegistry_);

quote

Simulates the swap and returns the delta-aware amounts. Not a view function: it calls poolManager.unlock, so use eth_call or a static call from another contract.

function quote(QuoteParams calldata params, bytes calldata moduleData)
    external
    returns (uint256 amountIn, uint256 amountOut);

Parameters

NameTypeDescription
paramsQuoteParamsPool key, payer, recipient, direction, signed amount, bound and price limit
moduleDatabytesData forwarded to the pool's modules

Returns

NameTypeDescription
amountInuint256Input the swap would consume
amountOutuint256Output the swap would deliver

amountSpecified follows the v4 convention: negative for exact input, positive for exact output. Pass the real recipient you intend to swap with, because the pot leg is recipient-specific and a different recipient can produce a different result.

integrationKind, integrationFamilyId, integrationVersion

function integrationKind() external pure returns (bytes32);
function integrationFamilyId() external pure returns (bytes32);
function integrationVersion() external pure returns (uint32);

unlockCallback

Executes the simulated swap and reverts with QuoteResult, which quote catches and authenticates against the expected quote id.

function unlockCallback(bytes calldata rawData) external returns (bytes memory);

Structs

QuoteParams

struct QuoteParams {
    PoolKey key;
    address payer;
    address recipient;
    bool zeroForOne;
    int128 amountSpecified;
    uint128 amountBound;
    uint160 sqrtPriceLimitX96;
}

Errors

QuoteResult

Not a failure. The internal successful-simulation carrier that quote decodes.

error QuoteResult(bytes32 quoteId, uint128 amountIn, uint128 amountOut);

Others

InvalidWiring, Reentrancy, NotPoolManager, CallbackNotActive, InvalidStack, StackNotInitialized, UntrustedStackQuoter(expected, actual), InvalidIdentity, InvalidAmount, InvalidAmountBound, InvalidSqrtPriceLimit, ModuleDataTooLarge, UnexpectedDelta, TooLittleReceived(minimum, received), TooMuchRequested(maximum, requested), InvalidQuoteResult, SimulationDidNotRevert.

A revert that is not QuoteResult bubbles up unchanged, so a guard-window rejection or a cap breach reaches the caller as the error the swap would have thrown.