normalise_volume#

API documentation for tradingstrategy.utils.wrangle.normalise_volume Python function.

normalise_volume(df)[source]#

Clean volume data columns.

  • We have different ways to track volume depending on the DEX type

  • The underlying nuances should not matter

  • Normalise volume across all DEXes

  • Run before fix_dex_price_data()

  • The root cause is that uniswap_v2 tracks buy and sell volume, whileas for uniswap v3 we track only volume in the source data

Returns:

DataFrame where column “volume” is properly filled for all different DEXes.

Parameters:

df (DataFrame) –

Return type:

DataFrame