Skip to main content

Module size_estimator

Module size_estimator 

Source
Expand description

Size estimation utilities for DeFi pool profiler.

This module provides functions for estimating optimal trade sizes based on target price impact/slippage levels using binary search and liquidity analysis.

Structs§

EstimationConfig
Configuration for size estimation algorithms.
SizeForImpactResult
Detailed result of a size-for-impact search.

Functions§

estimate_max_size_for_impact
Estimates the maximum trade size for a given impact target.
size_for_impact_bps
Finds the maximum trade size that produces a target slippage (including fees).
size_for_impact_bps_detailed
Finds the maximum trade size with detailed search diagnostics.
slippage_for_size_bps
Calculates the slippage in basis points for a given trade size.