SandeshUntitled Query
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
›
⌄
with unstakes as (
(
select block_timestamp, TX_ID, currency, decimal, DELEGATOR_ADDRESS, VALIDATOR_ADDRESS, 'normal_unstake' as "stake"
from osmosis.core.fact_staking
where action = 'undelegate' and TX_STATUS = 'SUCCEEDED'
)
union
(
select block_timestamp, TX_ID, currency, decimal, DELEGATOR_ADDRESS, VALIDATOR_ADDRESS, 'super_unstake' as "stake"
from osmosis.core.fact_superfluid_staking
where action = 'Superfluiddelegate'
)
),
transfers as (
select ft.block_timestamp, ft.blockchain, ft.chain_id, ft.tx_id, ft.sender, ft.transfer_type, 'transfer' as act
from osmosis.core.fact_transfers ft
inner join unstakes un on (
un.delegator_address = ft.sender
and ft.block_timestamp > un.block_timestamp)
where
ft.tx_status = 'SUCCEEDED'
),
swaps as (
select sw.block_timestamp, sw.blockchain, sw.chain_id, sw.tx_id, sw.trader, sw.to_currency, 'swap' as act
from osmosis.core.fact_swaps sw
inner join unstakes un on (
un.delegator_address = sw.trader
and sw.block_timestamp > un.block_timestamp)
where from_currency = 'uosmo' and sw.tx_status = 'SUCCEEDED'
),
lp as (
select lp.block_timestamp, lp.blockchain, lp.chain_id, lp.tx_id, lp.liquidity_provider_address, lp.currency, 'provide liquidity' as act
from osmosis.core.fact_liquidity_provider_actions lp
inner join unstakes un on (
un.delegator_address = lp.LIQUIDITY_PROVIDER_ADDRESS
and lp.block_timestamp > un.block_timestamp )
Run a query to Download Data