SajjadiiiUntitled Query
    Updated 2022-08-23
    with a as (
    select distinct (concat('0x',substr(data,27,40))) as game_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 ,
    tokenflow_eth.hextoint(substr(data,3+17*64,64)) as sport_code
    from optimism.core.fact_event_logs
    where topics[0] = '0x889e2060e46779287c2fcbf489c195ef20f5b44a74e3dcb58d491ae073c1370f'
    and contract_address = '0x2b91c14ce9aa828ed124d12541452a017d8a2148' -- game maker contract
    and sport_code >= 9000
    and sport_code <= 9050
    )


    select block_timestamp::date as date , TX_HASH ,
    from optimism.core.fact_event_logs
    where tx_hash = '0x2072d57af9eb255993f0307d9713a2518ba7686cee15a47d6af1ba07031fa865'
    and contract_address = '0x8c6f28f2f1a3c87f0f938b96d27520d9751ec8d9' --Synthetix: sUSD Token
    and ORIGIN_TO_ADDRESS = EVENT_INPUTS:from
    and EVENT_INPUTS:to in (select game_contract from a )
    --and EVENT_INPUTS:to = '0x170a5714112daeff20e798b6e92e25b86ea603c1'
    Run a query to Download Data