SalehUntitled Query
Updated 2022-10-01
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
›
⌄
-- select
-- -- EVENT_NAME
-- DISTINCT TX_STATUS
-- -- ,count(DISTINCT tx_hash) as tx_count
-- -- from ethereum.core.fact_transactions
-- from ethereum.core.fact_event_logs
-- -- where tx_hash= '0x97c4a46551106209103d28c024dcba5a99549c6174d99d3fac6cb188fd04fdca'
-- -- where CONTRACT_ADDRESS in (select LENDING_POOL_ADDRESS from ethereum.sushi.ez_borrowing)
-- -- and EVENT_NAME in ('LogAddAsset','LogRemoveAsset','LogAddCollateral','LogBorrow','LogRepay','LogRemoveCollateral')
-- -- group by 1,2
select
TX_JSON:receipt:logs[2]:decoded:eventName
,count(DISTINCT tx_hash)
from ethereum.core.fact_transactions
-- where tx_hash= '0x97c4a46551106209103d28c024dcba5a99549c6174d99d3fac6cb188fd04fdca'
where to_address in (select LENDING_POOL_ADDRESS from ethereum.sushi.ez_borrowing)
group by 1
order by 2 desc
Run a query to Download Data