negin-khTotal number of users who bet on sports
Updated 2022-08-25
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
›
⌄
WITH tab1 AS
(SELECT
sum(raw_amount/1e18) as sUSD_amount,
count(distinct(origin_from_address)) as Those_who_bet
from optimism.core.fact_token_transfers
where to_address = '0x170a5714112daeff20e798b6e92e25b86ea603c1'
and contract_address = '0x8c6f28f2f1a3c87f0f938b96d27520d9751ec8d9'
and block_timestamp >= current_date - 14
)
select
date_trunc('day', block_timestamp) as day,
sum(raw_amount/1e18) as sUSD_amount,
sum(sUSD_amount) over (order by day) as cum_sUSD,
count(distinct(origin_from_address)) as original_addres,
(select sum(sUSD_amount) from tab1) as sUSD,
(select sum(Those_who_bet) from tab1) as bettors
from optimism.core.fact_token_transfers
where to_address = '0x170a5714112daeff20e798b6e92e25b86ea603c1'
and contract_address = '0x8c6f28f2f1a3c87f0f938b96d27520d9751ec8d9'
group by 1
order by 1 desc
Run a query to Download Data