combine_return_columns

Documentation for eth_defi.research.vault_metrics.combine_return_columns function.

combine_return_columns(gross, net, new_line=' ', mode='percent', profit_presentation='split')

Create combined net / (gross) returns column for display.

Display values such as 8.3% (10.5%) while keeping missing values distinct from real zero returns or zero assets. The two input series must share an index; formatting preserves that index.

Parameters
  • gross (pandas.Series) – Numeric or nullable gross returns, or peak assets in USD mode.

  • net (pandas.Series) – Numeric or nullable net returns, or current assets in USD mode.

  • new_line (str) – Separator between the net value and parenthesised gross value.

  • mode (Literal['percent', 'usd']) – Percentage returns or denomination-unit asset values.

  • profit_presentation (Literal['split', 'net_only']) – Show both values, or prefer net with gross as the fallback.

Returns

Combined string series

Return type

pandas.Series