freemartianSoccer Leagues Popularity
Updated 2022-08-21
999
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
36
›
⌄
with a as (
select
distinct ft.tx_hash as tx,
tt.contract_address as currency,
regexp_substr_all(SUBSTR(input_data, 11, len(input_data)), '.{64}') AS segmented_data,
concat('0x', substr(segmented_data[0], 25, 40)) as game,
ethereum.public.udf_hex_to_int(segmented_data[3] :: STRING) :: FLOAT as paid_bet,
ft.from_address as bettor,
case
when currency = '0xda10009cbd5d07dd0cecc66161fc93d7c9000da1' then sum(paid_bet)/pow(10,18)
when currency = '0x8c6f28f2f1a3c87f0f938b96d27520d9751ec8d9' then sum(paid_bet)/pow(10,18)
when currency = '0x94b008aa00579c1307b0ef2c499ad98a8ce58e58' then sum(paid_bet)/pow(10,6)
when currency = '0x7f5c764cbc14f9669b88837ca1490cca17c31607' then sum(paid_bet)/pow(10,6)
end as volume
from optimism.core.fact_transactions ft
inner join optimism.core.fact_token_transfers tt on tt.tx_hash = ft.tx_hash
where ft.tx_hash in (
select tx_hash
from optimism.core.fact_token_transfers
where to_address = '0x170a5714112daeff20e798b6e92e25b86ea603c1'
and from_address != '0x0000000000000000000000000000000000000000'
and from_address != '0x061b87122ed14b9526a813209c8a59a633257bab'
and origin_function_signature in ('0x6cc5a6ff', '0x8875eb84')
and block_timestamp >= CURRENT_DATE - 14)
and currency in (
'0xda10009cbd5d07dd0cecc66161fc93d7c9000da1',
'0x8c6f28f2f1a3c87f0f938b96d27520d9751ec8d9',
'0x94b008aa00579c1307b0ef2c499ad98a8ce58e58',
'0x7f5c764cbc14f9669b88837ca1490cca17c31607'
)
group by 1, 2, 3, 4, 5, 6)
select
case
when game in (
Run a query to Download Data