Afonso_DiazTop pools
Updated 2025-01-24
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,
symbol,
decimals,
avg(price) as token_price_usd
from
sei.price.ez_prices_hourly
group by 1, 2, 3, 4
),
main as (
select
tx_id,
block_timestamp,
lp_action as action,
liquidity_provider_address as user,
pool_name,
pool_address,
a.symbol as symbol1,
b.symbol as symbol2,
nvl((token1_amount / pow(10, a.decimals)) * a.token_price_usd, 0) as token1_amount_usd,
nvl((token2_amount / pow(10, b.decimals)) * b.token_price_usd, 0) as token2_amount_usd,
token1_amount_usd + token2_amount_usd as amount_usd
from
sei.defi.fact_lp_actions c
left join
pricet a on block_timestamp::date = a.date and a.token_address = c.token1_currency
left join
pricet b on block_timestamp::date = b.date and b.token_address = c.token2_currency
where
tx_succeeded
)
QueryRunArchived: QueryRun has been archived