Skip to main content

compare_pool_profiler

Function compare_pool_profiler 

Source
pub fn compare_pool_profiler(
    profiler: &PoolProfiler,
    snapshot: &PoolSnapshot,
) -> bool
Expand 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. Structural mismatches are logged as errors, sqrt price mismatches are logged as warnings, and matches are logged as info.

§Arguments

  • profiler - The pool profiler whose state should be compared
  • snapshot - The on-chain snapshot to compare against

§Panics

Panics if the profiler has not been initialized.

§Returns

Returns true if all compared values match, false if any mismatches are detected.