pub fn compare_pool_profiler(
profiler: &PoolProfiler,
snapshot: &PoolSnapshot,
) -> boolExpand description
Compares a pool profiler’s internal state with on-chain state to verify consistency.
This function validates that the profiler’s tracked state matches the actual on-chain pool state by comparing global pool parameters, tick data, and position data. Any mismatches are logged as errors, while matches are logged as info.
§Arguments
profiler- The pool profiler whose state should be comparedcurrent_tick- The current active tick from on-chain stateprice_sqrt_ratio_x96- The current sqrt price ratio (Q64.96 format) from on-chain statefee_protocol- The protocol fee setting from on-chain stateliquidity- The current liquidity from on-chain stateticks- Map of tick indices to their on-chain tick datapositions- Vector of on-chain position data
§Panics
Panics if the profiler has not been initialized
§Returns
Returns true if all compared values match, false if any mismatches are detected.