From 8325d763b77836a53cc9aa9db8c06509a924ab38 Mon Sep 17 00:00:00 2001 From: Julian Ventura <43799596+JulianVentura@users.noreply.github.com> Date: Thu, 9 Jan 2025 11:41:34 -0300 Subject: [PATCH] hotfix(explorer): Fix the proof price average (#1717) Co-authored-by: Julian Ventura Co-authored-by: Julian Arce <52429267+JuArce@users.noreply.github.com> --- explorer/lib/explorer/models/batches.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/explorer/lib/explorer/models/batches.ex b/explorer/lib/explorer/models/batches.ex index abedb8c6d..4b988b791 100644 --- a/explorer/lib/explorer/models/batches.ex +++ b/explorer/lib/explorer/models/batches.ex @@ -144,7 +144,7 @@ defmodule Batches do query = from(b in Batches, where: b.is_verified == true, - select: avg(b.fee_per_proof) + select: sum(b.fee_per_proof * b.amount_of_proofs) / sum(b.amount_of_proofs) ) case Explorer.Repo.one(query) do