SocioAnalyticaCapital Efficiency (Liquidity Utilization)
Updated 2024-05-07
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
›
⌄
with balances as (
select
date_trunc('day',block_timestamp) as day,
pool_address,
token,
amount as deltas,
protocolFeeAmount
from (
select
block_timestamp,
DECODED_LOG : poolId as pool_id,
substr(DECODED_LOG : poolId, 1, 42) as pool_address,
decoded_log : deltas[0] :: int as amount,
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 : deltas[1] :: int as amount,
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,
QueryRunArchived: QueryRun has been archived