banbannardUntitled Query
Updated 2022-06-12Copy Reference Fork
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
›
⌄
with base as (select distinct(eth_from_address) as staker,
sum(amount) as amount_staked
from ethereum.core.ez_eth_transfers
where --tx_hash = '0x4026d646872f7cb6da67725b2a0b7dc20665c4aa02d1893c6cec51ea3022820d'
--origin_function_name = 'submit'
--event_name = 'transfer'
eth_to_address = '0xae7ab96520de3a18e5e111b5eaab095312d7fe84'
group by 1),
in_table as (select tx_hash, amount_in_usd as amount_in
from ethereum.core.ez_dex_swaps
where
token_in = '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2'),
out_table as (select tx_hash, amount_out_usd as amount_out
from ethereum.core.ez_dex_swaps
where
token_out = '0xae7ab96520de3a18e5e111b5eaab095312d7fe84'),
combo as (select a.tx_hash, amount_in, amount_out
from in_table a
join out_table b
on a.tx_hash = b.tx_hash)
select b.*
from combo a
join ethereum.udm_events b
where a.tx_hash = b.tx_id
and origin_address in (select staker from base)
and block_timestamp >= current_date - 7
Run a query to Download Data