uniswap
v4-core
fees
calculate-swap-fee
lp-fee-bounds
protocol-fee
override-flag
hook-charge
revenue-splits
compliance-evidence
mcp:check_v4_hook_fee_conformance

V4 Hook Fee Conformance

Recomputes a Uniswap v4 pool’s per-swap fee from v4-core’s own rules at pinned a7cf038cd568801a79a9b4cf92cd5b52c95c8585 (calculateSwapFee composition), validates the packed protocol fee and LP-fee bounds, decodes the 0x400000 override, and checks each emitted fee: CONFORMS, OUT_OF_BOUNDS, FEE_MISMATCH, or INDETERMINATE. Accrues the declared hook charge in integer arithmetic with remainders reported; LP revenue reported separately, never netted. Evidence only; zero network.

Tool URL: https://ainumbers.co/chaingraph/art-709-v4-hook-fee-conformance.html AP2/Policy Mandate export: yes

post/v1/tools/check_v4_hook_fee_conformance

Request

  • Base URL: https://ainumbers.co
  • URL: https://ainumbers.co/v1/tools/check_v4_hook_fee_conformance
  • Auth: none declared

Request body

protocol_feeinteger required

uint24, both directions packed as v4 stores it: low 12 bits zeroForOne, bits 12-23 oneForZero; each direction <= 1000 pips (isValidProtocolFee).

pool_feeinteger required

uint24: static LP fee in pips, or 0x800000 (8388608) for a dynamic-fee pool.

declared_lp_fee_boundsobject required

{ min_pips, max_pips }: the LP-fee band the declared story permits (0..1000000).

declared_total_fee_cap_pipsinteger

Optional total cap in pips; the composed swap fee plus the hook-charge rate is checked against it.

declared_hook_chargeobject required

{ rate_pips, splits: [{ recipient_label, share_bps }] }: the separately declared hook charge; shares reported as declared, never coerced.

Response

Successful tool execution result

assumptionsstring[] required
declared_total_fee_cap_pipsnumber nullable
detailstring
error'hook_charge_splits_invalid' | 'lp_fee_bounds_invalid' | 'swaps_invalid'
fee_story_explainedfalse | true
pool_feenumber
pool_fee_is_dynamicfalse | true
protocol_feenumber
protocol_fee_one_for_zero_pipsnumber
protocol_fee_validboolean nullable required
protocol_fee_zero_for_one_pipsnumber
splits_okfalse | true
splits_sum_bpsnumber
total_cap_okboolean nullable
totalsobject nullable required
v4_core_commitstring required

Changes

No recorded changes to this operation across all 1 revision of this API.