Arioovertimemarket - my edition
Updated 2022-08-25Copy Reference Fork
99
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 decoded_date as (
SELECT
hrx_decode_string(substr(data, 3 + 13 * 64, 64)) as home,
hrx_decode_string(substr(data, 3 + 15 * 64, 64)) as away,
concat('0x', substr(data, 27, 40)) as game_contract,
regexp_substr_all(substr(DATA, 3, len(DATA)), '.{64}') AS detailed_data,
ethereum.public.udf_hex_to_int(concat('0x', SUBSTR(detailed_data [17], 25, 40))) AS tags
from
optimism.core.fact_event_logs
where
block_timestamp >= CURRENT_DATE - 14
and topics [0] = '0x889e2060e46779287c2fcbf489c195ef20f5b44a74e3dcb58d491ae073c1370f'
and contract_address = '0x2b91c14ce9aa828ed124d12541452a017d8a2148'
),
trx as (
select
concat(home, away)
to_address,
tags,
raw_amount / 1e18 as bet_amount,
CASE
when tags = 9001 then 'NCAA - American Football'
when tags = 9002 then 'NFL - American Football'
when tags = 9003 then 'MLB - Baseball'
when tags = 9004 then 'NBA - Basketball'
when tags = 9005 then 'NCAA - Basketball'
when tags = 9006 then 'NHL - Hockey'
when tags = 9007 then 'MMS'
when tags = 9008 then 'WNBA'
when tags = 9010 then 'MLS - Soccer'
when tags = 9011 then 'EPL - Soccer'
when tags = 9012 then 'Ligue 1 - Soccer'
when tags = 9013 then 'Bundesliga - Soccer'
when tags = 9014 then 'La Liga - Soccer'
when tags = 9015 then 'Serie A - Soccer'
when tags = 9016 then 'UEFA Champions League - Soccer'
Run a query to Download Data