keshanUntitled Query
Updated 2022-08-04
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
›
⌄
⌄
/*
with data_ as (select tx_hash,
ifnull(address_name, contract_address) as contract_address,
block_timestamp,
origin_from_address,
event_index,
event_inputs,
event_inputs:amount0In as amount0in,
event_inputs:amount0Out as amount0out,
event_inputs:amount1In as amount1in,
event_inputs:amount1Out as amount1out,
concat_ws('$', event_index, contract_address, amount0in, amount0out, amount1in, amount1out) as raw
from optimism.core.fact_event_logs left join optimism.core.dim_labels on contract_address=address
where (ORIGIN_TO_ADDRESS=lower('0xE592427A0AEce92De3Edee1F18E0157C05861564')
OR ORIGIN_TO_ADDRESS=lower('0x68b3465833fb72a70ecdf485e0e4c7bd8665fc45'))
and event_name ='Swap' --and origin_function_signature='0xf41766d8'
and block_timestamp >= CURRENT_DATE - 30
limit 10
)
select * from (
SELECT DISTINCT tx_hash,
min(block_timestamp) time,
min(origin_from_address) from_address,
ARRAYAGG(raw) fld
FROM data_
group by tx_hash)
LIMIT 10
*/
SELECT
*
FROM optimism.velodrome.ez_lp_actions
--WHERE origin_to_address = lower('0x68b3465833fb72a70ecdf485e0e4c7bd8665fc45')
limit 2
Run a query to Download Data