Consolidate monthly stats to common method

This commit is contained in:
Matthias
2022-06-08 19:52:05 +02:00
parent 3cb15a2a54
commit d4dd026310
3 changed files with 18 additions and 53 deletions

View File

@@ -579,10 +579,11 @@ class Telegram(RPCHandler):
except (TypeError, ValueError, IndexError):
timescale = 7
try:
stats = self._rpc._rpc_daily_profit(
stats = self._rpc._rpc_timeunit_profit(
timescale,
stake_cur,
fiat_disp_cur
fiat_disp_cur,
'days'
)
stats_tab = tabulate(
[[day['date'],
@@ -618,7 +619,7 @@ class Telegram(RPCHandler):
except (TypeError, ValueError, IndexError):
timescale = 8
try:
stats = self._rpc._rpc_daily_profit(
stats = self._rpc._rpc_timeunit_profit(
timescale,
stake_cur,
fiat_disp_cur,
@@ -659,10 +660,11 @@ class Telegram(RPCHandler):
except (TypeError, ValueError, IndexError):
timescale = 6
try:
stats = self._rpc._rpc_monthly_profit(
stats = self._rpc._rpc_timeunit_profit(
timescale,
stake_cur,
fiat_disp_cur
fiat_disp_cur,
'months'
)
stats_tab = tabulate(
[[month['date'],