Abbas_ra21op deposit stats part 1
Updated 2022-09-08
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
›
⌄
with main_stats 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='0x794a61358d6845594f94dc1db02a252b5b4814ad'
and ORIGIN_FUNCTION_SIGNATURE='0xf7a73840')
select
Date(BLOCK_TIMESTAMP) AS DAY,
count(Distinct TX_HASH) AS "number of deposits",
count(distinct depositer) AS "number of unique depositer",
sum(USD_amount) AS "deposit amount in USD"
from main_stats
group by 1
Run a query to Download Data