alirso-m-p-t-01
    with base as (
    SELECT
    concat('0x',substr(data,27,40)) as contract , HEX_DECODE_STRING( substr(data,3+13*64,64 ) ) as home_team
    , HEX_DECODE_STRING( substr(data,3+15*64,64)) as away_team , concat(home_team,' vs ', away_team) as game_Name
    , regexp_substr_all(SUBSTR(DATA, 3, len(DATA)), '.{64}') AS split_data,
    ethereum.public.udf_hex_to_int(concat('0x', SUBSTR(split_data [17], 25, 40))) AS tag,
    case when tag = 9001 then 'NCAA - American Football'
    when tag = 9002 then 'NFL - American Football'
    when tag = 9003 then 'MLB - Baseball'
    when tag = 9004 then 'NBA - Basketball'
    when tag = 9005 then 'NCAA - Basketball'
    when tag = 9006 then 'NHL - Hockey'
    when tag = 9007 then 'MMA'
    when tag = 9008 then 'WNBA'
    when tag = 9010 then 'MLS - Soccer'
    when tag = 9011 then 'EPL - Soccer'
    when tag = 9012 then 'Ligue 1 - Soccer'
    when tag = 9013 then 'Bundesliga - Soccer'
    when tag = 9014 then 'La Liga - Soccer'
    when tag = 9015 then 'Serie A - Soccer'
    when tag = 9016 then 'UEFA Champions League - Soccer'
    else null
    end as sport_Name,
    block_timestamp , tx_hash
    from
    optimism.core.fact_event_logs
    where
    topics[0] = '0x889e2060e46779287c2fcbf489c195ef20f5b44a74e3dcb58d491ae073c1370f'
    )
    , transfer as (
    select
    tx_hash , raw_amount/power(10,decimals) as amount
    , lab.address_name as collateral, contract_address as contract, from_address , to_address
    FROM
    Run a query to Download Data