binhachonwETH & wBTC On- and Off- Ramps - WBTC on-off ramp
Updated 2022-06-06
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
›
⌄
-- select
-- date_trunc('day', block_timestamp) as time,
-- 'WETH/OSMO' as pool_name,
-- case
-- when time <= '2022-05-18' then 0
-- when time <= '2022-06-02' then 4.91
-- else 10 end
-- as incentive,
-- sum(case when action = 'pool_joined' then amount/pow(10, decimal) else -amount/pow(10, decimal) end) as providing_amount
-- from osmosis.core.fact_liquidity_provider_actions
-- where pool_id = 704
-- and currency = 'uosmo'
-- group by 1, 2, 3
-- union all
select
date_trunc('day', block_timestamp) as time,
'LP inflow' as type,
sum(case when action = 'pool_joined' then amount/pow(10, decimal) else -amount/pow(10, decimal) end) as providing_amount
from osmosis.core.fact_liquidity_provider_actions
where pool_id = 712
and currency != 'uosmo'
and tx_status = 'SUCCEEDED'
group by 1, 2
union all
select
date_trunc('day', block_timestamp) as time,
'IBC inflow' as type,
sum(case when transfer_type = 'IBC_TRANSFER_IN' then amount/pow(10, decimal) else -amount/pow(10, decimal) end)
from osmosis.core.fact_transfers
where transfer_type in ('IBC_TRANSFER_IN', 'IBC_TRANSFER_OUT')
and tx_status = 'SUCCEEDED'
and currency = 'ibc/D1542AA8762DB13087D8364F3EA6509FD6F009A34F00426AF9E4F9FA85CBBF1F'
group by 1, 2
Run a query to Download Data