From f4caa98eeffc2d414331c3d833867dc59d809aef Mon Sep 17 00:00:00 2001 From: satsbaba <106560507+satsbaba@users.noreply.github.com> Date: Sat, 25 Jun 2022 12:47:35 +0200 Subject: [PATCH] replaced weighted mean to weighted median This commit changes the weighted mean to the weighted median for the calculation of the premium displayed on the robosats. --- api/utils.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/api/utils.py b/api/utils.py index 7eacdea8..e4dc7e79 100644 --- a/api/utils.py +++ b/api/utils.py @@ -192,8 +192,3 @@ def compute_avg_premium(queryset): values_sorted=False) return weighted_median_premium, total_volume - - total_volume = sum(volumes) - # Avg_premium is the weighted average of the premiums by volume - avg_premium = sum(weighted_premiums) / total_volume - return avg_premium, total_volume