freemartianDaily & Cumulative Win Amount
    Updated 2022-08-25
    with markets as (
    select
    regexp_substr_all(SUBSTR(data, 11, len(data)), '.{64}') AS segmented_data,
    concat('0x', substr(segmented_data[0], 17, 40)) as game,
    ethereum.public.udf_hex_to_int(substr(segmented_data[17], 1, 56) :: STRING) :: FLOAT as sport_tag
    from optimism.core.fact_event_logs
    where origin_function_signature = '0xac2c957c'
    and origin_to_address = '0x2b91c14ce9aa828ed124d12541452a017d8a2148'
    and topics[0] = '0x889e2060e46779287c2fcbf489c195ef20f5b44a74e3dcb58d491ae073c1370f'
    )
    Select
    sum(raw_amount/pow(10,18)) as win_volume,
    date_trunc('day', block_timestamp::date) as TIME,
    sum(win_volume) over (order by TIME) as cumulative_win_amount
    from optimism.core.fact_token_transfers t
    inner join markets m on m.game = t.from_address
    where to_address != '0x170a5714112daeff20e798b6e92e25b86ea603c1'
    and block_timestamp >= CURRENT_DATE - 14
    group by TIME


    Run a query to Download Data