feyikemiwooden-cyan
Updated 2025-02-02
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 tab1 as (
select
distinct contract_address as pool_address,
POOL_NAME
from base.defi.ez_dex_swaps
where platform ILIKE '%aerodrome%'
)
, tab_price as (
SELECT
date_trunc('day', hour) as Date,
token_address,
symbol,
avg(price) as price
from base.price.ez_prices_hourly
where hour > current_date
group by 1,2,3
)
, tab2 as (
select
to_address as Pool,
contract_address as Token_address,
sum(raw_amount/power(10, DECIMALS)) as Amount
from base.core.ez_token_transfers
where to_address in (select pool_address from tab1)
group by 1,2
UNION ALL
select
from_address as Pool,
QueryRunArchived: QueryRun has been archived