From 31730e0a05edb32cce7bc4b7d862fe3b9d27bac7 Mon Sep 17 00:00:00 2001 From: Reckless_Satoshi Date: Tue, 7 Jun 2022 14:05:34 -0700 Subject: [PATCH] Exclude BTC swaps from avg premium calculation --- api/utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/api/utils.py b/api/utils.py index f1109d1c..9409d1f6 100644 --- a/api/utils.py +++ b/api/utils.py @@ -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)