freemartianStable Coin Bridge From Hop To L2s
    Updated 2022-06-19
    with usdc_usdt as (
    select sum(event_inputs:amount)/1000000 as usdc_usdt_volume, date_trunc('week', block_timestamp::date) as TIME,
    case when event_inputs:chainId = '10' then 'Optimism'
    when event_inputs:chainId = '100' then 'xDAI'
    when event_inputs:chainId = '137' then 'Polygon'
    when event_inputs:chainId = '42161' then 'Arbitrum'
    end as chain
    from ethereum.core.fact_event_logs
    where origin_to_address in (lower('0x3E4a3a4796d16c0Cd582C382691998f7c06420B6'), lower('0x3666f603Cc164936C1b87e207F36BEBa4AC5f18a'))
    and block_timestamp > CURRENT_DATE - 180
    and event_name = 'TransferSentToL2'
    group by TIME, chain),
    dai as (
    select sum(event_inputs:amount)/pow(10,18) as dai_volume, date_trunc('week', block_timestamp::date) as TIME,
    case when event_inputs:chainId = '10' then 'Optimism'
    when event_inputs:chainId = '100' then 'xDAI'
    when event_inputs:chainId = '137' then 'Polygon'
    when event_inputs:chainId = '42161' then 'Arbitrum'
    end as chain
    from ethereum.core.fact_event_logs
    where origin_to_address = lower('0x3d4Cc8A61c7528Fd86C55cfe061a78dCBA48EDd1')
    and block_timestamp > CURRENT_DATE - 180
    and event_name = 'TransferSentToL2'
    group by TIME, chain
    )
    select sum(usdc_usdt_volume + dai_volume) as stable_coin_volume, u.chain, u.TIME
    from usdc_usdt u
    inner join dai d on u.TIME = d.TIME
    group by u.TIME, u.chain
    Run a query to Download Data