Skip to content

Commit 433a013

Browse files
committed
remove overlapping inherited values from protocol_daily_stat data
1 parent b252b86 commit 433a013

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/mainnet/processors/protocol/protocol-sql-simple.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -213,10 +213,10 @@ const upsertProtocolDailyStats = async (ctx: Context, fromDate: string) => {
213213
), 0) as rate_usd,
214214
215215
SUM(supply) as supply,
216-
SUM(earning_tvl) as earning_tvl,
217-
SUM(tvl) as tvl,
218-
SUM(yield) as yield,
219-
SUM(revenue) as revenue,
216+
SUM(earning_tvl - inherited_tvl) as earning_tvl,
217+
SUM(tvl - inherited_tvl) as tvl,
218+
SUM(yield - inherited_yield) as yield,
219+
SUM(revenue - inherited_revenue) as revenue,
220220
221221
-- Calculate APY: (yield - revenue) / earning_tvl * 365
222222
CASE

0 commit comments

Comments
 (0)