banbannardwETH & wBTC On- and Off- Ramps 4
    Updated 2022-06-06
    select
    date_trunc('week', block_timestamp) as week,
    label,
    case
    when label = 'Wrapped Bitcoin' then 'WBTC'
    when label = 'Wrapped Ether' or label = 'Wrapped Ethereum' then 'WETH'
    end as labels,
    transfer_type,
    decimal,
    sum(amount)/pow(10,decimal) as token_amount,
    'WETH Deposited'
    from osmosis.core.fact_transfers a
    join osmosis.core.dim_labels b
    on a.currency = b.address
    where label in ('Wrapped Bitcoin', 'Wrapped Ether', 'Wrapped Ethereum')
    and labels = 'WETH'
    and transfer_type = 'IBC_TRANSFER_IN'
    group by 1,2,3,4,5
    UNION

    select
    date_trunc('week', block_timestamp) as week,
    label,
    case
    when label = 'Wrapped Bitcoin' then 'WBTC'
    when label = 'Wrapped Ether' or label = 'Wrapped Ethereum' then 'WETH'
    end as labels,
    transfer_type,
    decimal,
    sum(amount)/pow(10,decimal) as token_amount,
    'WETH Withdrawn'
    from osmosis.core.fact_transfers a
    join osmosis.core.dim_labels b
    on a.currency = b.address
    where label in ('Wrapped Bitcoin', 'Wrapped Ether', 'Wrapped Ethereum')
    Run a query to Download Data