banbannardwETH & wBTC On- and Off- Ramps 4
Updated 2022-06-06Copy Reference Fork
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
›
⌄
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