SocioAnalyticadaily Fees on LSTs Pool copy
Updated 2024-04-26
999
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
›
⌄
-- forked from Fees on LSTs Pool @ https://flipsidecrypto.xyz/edit/queries/db04942b-b9c1-4bce-80c9-614fa6ed5693
with protocol_fee as (
select
date_trunc('day',block_timestamp) as day,
pool_address,
token,
protocolFeeAmount
from (
select
block_timestamp,
DECODED_LOG : poolId as pool_id,
substr(DECODED_LOG : poolId, 1, 42) as pool_address,
decoded_log : tokens[0] :: string as token,
decoded_log : protocolFeeAmounts [0] :: int as protocolFeeAmount
from avalanche.core.ez_decoded_event_logs
where event_name = 'PoolBalanceChanged'
and contract_address = '0xba12222222228d8ba445958a75a0704d566bf2c8'
and
TX_STATUS = 'SUCCESS'
union all
select
block_timestamp,
DECODED_LOG : poolId as pool_id,
substr(DECODED_LOG : poolId, 1, 42) as pool_address,
decoded_log : tokens[1] :: string as token,
decoded_log : protocolFeeAmounts [1] :: int as protocolFeeAmount
from avalanche.core.ez_decoded_event_logs
where event_name = 'PoolBalanceChanged'
and contract_address = '0xba12222222228d8ba445958a75a0704d566bf2c8'
and
TX_STATUS = 'SUCCESS'
union all
select
block_timestamp,
DECODED_LOG : poolId as pool_id,
Auto-refreshes every 24 hours
QueryRunArchived: QueryRun has been archived