Updated 2022-08-24
    with x as (
    SELECT
    to_address,
    count(DISTINCT tx_hash) as bets,
    sum(RAW_AMOUNT / pow(10, 18) ) as volume_in
    FROM
    optimism.core.fact_token_transfers
    WHERE
    from_address LIKE lower(
    '0x170a5714112daEfF20E798B6e92e25B86Ea603C1'
    )
    and contract_address = '0x8c6f28f2f1a3c87f0f938b96d27520d9751ec8d9'
    and block_timestamp >= current_date - 14
    GROUP BY
    1
    ),
    y as (
    SELECT
    from_address as users,
    sum(
    RAW_AMOUNT / pow(10, 18)
    ) as volume_out
    FROM
    optimism.core.fact_token_transfers
    WHERE
    to_address LIKE lower(
    '0x170a5714112daEfF20E798B6e92e25B86Ea603C1'
    )
    and contract_address = '0x8c6f28f2f1a3c87f0f938b96d27520d9751ec8d9'
    and block_timestamp >= current_date - 14
    GROUP BY
    1
    ),
    xy as (
    SELECT
    users,
    Run a query to Download Data