mirror of
https://github.com/RoboSats/robosats.git
synced 2025-07-19 17:23:19 +00:00
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:
@ -192,8 +192,3 @@ def compute_avg_premium(queryset):
|
|||||||
values_sorted=False)
|
values_sorted=False)
|
||||||
|
|
||||||
return weighted_median_premium, total_volume
|
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
|
|
||||||
|
Reference in New Issue
Block a user