estimate_liquidity_depth_at_block

Documentation for eth_defi.uniswap_v3.liquidity.estimate_liquidity_depth_at_block function.

estimate_liquidity_depth_at_block(pool_address, block_number, *, depths=[- 5, - 2, - 1, - 0.5, - 0.2, - 0.1, 0.1, 0.2, 0.5, 1, 2, 5], verbose=False)[source]

Calculate the liquidity at multiple depths of a pool at a given block

See this StackExchange question for commentary

Parameters
  • pool_address (HexAddress) – Uniswap v3 pool address

  • block_number (int) – Block number when the liquidity should be measured

  • depths (list[float]) – A list of depths in percentage where liquidity should be measured, default: 12 depth range from -5% to +%5

  • verbose (bool) – Print out information to console if True, default: False

Returns

A list of liquidity depth in form of tuple: depth, amount of token needed to buy to reach current depth, adjusted amount of token (based on token decimals)

Return type

list[tuple[float, float, float]]