Afonso_DiazTotal
Updated 2025-04-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 ton_prices as (
select
hour::date as date,
avg(price) as ton_price
from
crosschain.price.ez_prices_hourly
where
token_address = '0x76a797a59ba2c17726896976b7b3747bfd1d220f'
and blockchain = 'bsc'
group by 1
),
latest_metadata as (
select
address,
symbol,
row_number() over (partition by address order by update_timestamp_onchain desc nulls last) as rn
from ton.core.fact_jetton_metadata
),
main as (
select
tx_hash,
block_timestamp,
trader_address as swapper,
case
when volume_usd is not null then volume_usd
when volume_ton is not null then volume_ton * tp.ton_price
else null
end as amount_usd,
token_bought_address,
token_sold_address,
coalesce(jm_bought.symbol, 'TON') as bought_symbol,
coalesce(jm_sold.symbol, 'TON') as sold_symbol,
project,
pool_address,
QueryRunArchived: QueryRun has been archived