binhachonKatana Covered Call Vault Popularity - BTC vault
Updated 2022-03-28
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 deposit_transaction as (
select
block_timestamp,
inner_instruction:instructions[0]:parsed:info:authority as authority,
inner_instruction:instructions[0]:parsed:info:destination as destination,
case
when destination = '8vyTqVVPmJfqFexRcMBGDAHoSCyZ52RC5sRVhYzbfU4j' then 'SOL'
when destination = '7zJVLbx3DjjwkoD6eUGk4cgoBv2JR3RW67c3ff8URXYh' then 'mSOL'
when destination = '9baN3ENgbvDau1Myu5H4Gd5CiujWS6c6WuSu87YWahb7' then 'LUNA'
when destination = '377U1dX3mRd96BeoRkpmsJC67wnVDqTpi1u6dALkR9V5' then 'soETH'
when destination = '2CD9R7K7AjAswjTJDmdf9HyUZQztfck1B22h9WUJeTeh' then 'BTC'
else 'Others' end
as category,
inner_instruction:instructions[0]:parsed:info:amount::float as raw_amount,
case
when category in ('SOL', 'mSOL') then raw_amount/1e9
else raw_amount/1e6 end
as deposit_amount
from solana.fact_events
where block_timestamp::date >= '2022-02-01'
and program_id = '1349iiGjWC7ZTbu6otFmJwztms122jEEnShKgpVnNewy'
--and inner_instruction:instructions[0]:parsed:info:authority != '7wM6TyhDZMJSYojLbZWPcmkMu11xErKu6oeGJoHqtUgV'
and destination is not null
),
withdraw_transaction as (
select
block_timestamp,
inner_instruction:instructions[1]:parsed:info:source as source,
case
when source = '8vyTqVVPmJfqFexRcMBGDAHoSCyZ52RC5sRVhYzbfU4j' then 'SOL'
when source = '7zJVLbx3DjjwkoD6eUGk4cgoBv2JR3RW67c3ff8URXYh' then 'mSOL'
when source = '9baN3ENgbvDau1Myu5H4Gd5CiujWS6c6WuSu87YWahb7' then 'LUNA'
when source = '377U1dX3mRd96BeoRkpmsJC67wnVDqTpi1u6dALkR9V5' then 'soETH'
when source = '2CD9R7K7AjAswjTJDmdf9HyUZQztfck1B22h9WUJeTeh' then 'BTC'
else 'Others' end as category,
inner_instruction:instructions[1]:parsed:info:amount::float as raw_amount,
Run a query to Download Data