pub fn py_load_pool_snapshot(
pg_config: PostgresConnectOptions,
chain_id: u32,
pool_address: &str,
before_block: Option<u64>,
require_valid: bool,
) -> PyResult<Option<PoolSnapshot>>Expand description
Loads the latest pool snapshot from the Postgres cache for backtest replay.
Connects to the cache database and reconstructs the most recent snapshot for the pool,
including its full position and tick state, so a pool profiler can initialize before
historical swaps and liquidity updates are replayed. When before_block is set, only
snapshots at or before that block are considered, so the snapshot aligns with the replay
start. When require_valid is true, only snapshots validated against on-chain state are
returned. Returns None when no matching snapshot exists in the cache.
ยงErrors
Returns a PyErr if pool_address is not a valid pool identifier, or if the database
connection or query fails.