mmdrezaDepositors
Updated 2022-10-03Copy Reference Fork
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
›
⌄
with tab1 as (select
block_timestamp,
tx_hash,
origin_from_address as depositer,
symbol,
event_inputs:value/power(10,decimals) as amount,
(event_inputs:value/power(10,DECIMALS))*PRICE AS USD_amount
from optimism.core.fact_event_logs inner join
optimism.core.fact_hourly_token_prices on
contract_address = TOKEN_ADDRESS and date_trunc('HOUR', block_timestamp) = HOUR
where EVENT_NAME='Transfer' and event_inputs:from = ORIGIN_FROM_ADDRESS
and origin_to_address =lower('0x794a61358d6845594f94dc1db02a252b5b4814ad')
and origin_function_signature ='0xf7a73840')
select
count(distinct tx_hash) as deposit_transactions,
count(distinct depositer) as unique_depositors,
sum(USD_amount) AS amount_usd
from tab1
Run a query to Download Data