binhachonKatana Covered Call Vault Popularity - BTC vault
    Updated 2022-03-28
    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