Afonso_DiazTotal
Updated 2024-07-22
99
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 pricet as (
select
hour::date as date,
token_address,
decimals,
symbol,
avg(price) as price_usd
from aptos.price.ez_prices_hourly
group by 1, 2, 3, 4
union all
select
hour::date,
'0xfaf4e633ae9eb31366c9ca24214231760926576c7b625313b3688b5e900731f6::staking::ThalaAPT',
8,
'thAPT',
avg(price)
from aptos.price.ez_prices_hourly
where symbol = 'APT'
group by 1, 2, 3, 4
),
main as (
select
tx_hash,
block_timestamp,
sender as user,
event_data:amount_0 as amount0_unadj,
event_data:amount_1 as amount1_unadj,
split(split(event_type, 'LiquidityEvent<')[1], ', ')[0] as token0_address,
split(split(event_type, 'LiquidityEvent<')[1], ', ')[1] as token1_address,
iff(event_resource like 'AddLiquidityEvent%', 'ADD_LIQUIDITY', 'REMOVE_LIQUIDITY') as action,
'Stable Liquidity' as liquidity_type
from aptos.core.fact_events
join aptos.core.fact_transactions
QueryRunArchived: QueryRun has been archived