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.
This commit is contained in:
satsbaba 2022-06-25 12:47:35 +02:00 committed by GitHub
parent f2f90bd948
commit f4caa98eef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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