Exclude BTC swaps from avg premium calculation

This commit is contained in:
Reckless_Satoshi 2022-06-07 14:05:34 -07:00
parent 1905d147bf
commit 31730e0a05
No known key found for this signature in database
GPG Key ID: 9C4585B561315571

View File

@ -116,7 +116,9 @@ def compute_premium_percentile(order):
def compute_avg_premium(queryset):
weighted_premiums = []
volumes = []
for tick in queryset:
# We exclude BTC, as LN <-> BTC swap premiums should not be mixed with FIAT.
for tick in queryset.exclude(currency=1000):
weighted_premiums.append(tick.premium * tick.volume)
volumes.append(tick.volume)