hessPairs ( All Time )
Updated 2023-05-16
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 price as ( select hour as date,token_address, symbol , avg(price) as avg_price
from crosschain.core.ez_hourly_prices
where token_address in ('0x6982508145454ce325ddbe47a25d4ec3d2311933',
lower('0x6B89B97169a797d94F057F4a0B01E2cA303155e4'),'0x95ad61b0a150d79219dcf64e1e6cc01f0b64c4ce',
'0xcf0c122c6b73ff809c693db761e7baebe62b6a2e',
lower('0x7D8146cf21e8D7cbe46054e01588207b51198729'),
'0xa35923162c49cf95e6bf26623385eb431ad920d3')
and date >= '2023-04-15'
group by 1,2,3
UNION
select RECORDED_HOUR as date, 'Bonk' as token_address, symbol, avg(close) as avg_price
from solana.core.fact_token_prices_hourly
where symbol = 'BONK'
and date >= '2023-04-15'
group by 1,2,3
UNION
select hour as date,token_address, symbol , avg(price) as avg_price
from bsc.core.fact_hourly_token_prices
where symbol = 'DOGE'
and date >= '2023-04-15'
group by 1,2,3)
,
eth_swap as ( select block_timestamp , tx_hash, origin_from_address, amount_in, amount_in*avg_price as volume_in ,symbol_in, concat(symbol_in,'/',symbol_out) as pair
from ethereum.core.ez_dex_swaps a join price b on a.TOKEN_IN = b.token_address and a.block_timestamp::date = b.date::date
where token_in in ('0x6982508145454ce325ddbe47a25d4ec3d2311933',
lower('0x6B89B97169a797d94F057F4a0B01E2cA303155e4'),'0x95ad61b0a150d79219dcf64e1e6cc01f0b64c4ce',
'0xcf0c122c6b73ff809c693db761e7baebe62b6a2e',
lower('0x7D8146cf21e8D7cbe46054e01588207b51198729'),
'0xa35923162c49cf95e6bf26623385eb431ad920d3')
and a.block_timestamp::date >= '2023-04-15')
,
bonk_swap as ( select block_timestamp as date, tx_id as tx_hash, swapper as origin_from_address, swap_from_amount as amount_from, swap_from_amount*avg_price as volume_in,
b.symbol as symbol_out, concat(token_name,'/',b.symbol) as pair
from solana.core.fact_swaps a join price b on a.block_timestamp::date = b.date::date
join solana.core.dim_tokens c on a.swap_to_mint = c.token_address
where b.symbol = 'BONK'
Run a query to Download Data