From 2ceba1cec70f5437a8c0dcf90c90518b1bd8a276 Mon Sep 17 00:00:00 2001 From: martines3000 Date: Mon, 6 Jan 2025 17:56:48 +0100 Subject: [PATCH] chore: update pool snapshots query --- apps/indexer-sentio/queries/pool_snapshots.sql | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/indexer-sentio/queries/pool_snapshots.sql b/apps/indexer-sentio/queries/pool_snapshots.sql index 5003acaa..f5cd2d94 100644 --- a/apps/indexer-sentio/queries/pool_snapshots.sql +++ b/apps/indexer-sentio/queries/pool_snapshots.sql @@ -45,7 +45,9 @@ SELECT timestamp, borrowIndex AS borrow_index, borrowApr AS borrow_apr, totalFeesUsd AS total_fees_usd, - userFeesUsd AS user_fees_usd, + ( + borrowedAmountUsd * borrowApr - suppliedAmountUsd * supplyApr + ) / 100 / 365 / 24 as user_fees_usd, protocolFeesUsd AS protocol_fees_usd FROM `BasePoolSnapshot_raw` WHERE timestamp > timestamp('{{timestamp}}') \ No newline at end of file