binhachonKatana Covered Call Vault Popularity - Vault crossover
    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
    )
    select
    category,
    count_if(number_of_vaults > 1) as number_of_addresses
    from (
    select
    authority,
    category,
    count(distinct category) over (partition by authority) as number_of_vaults
    from deposit_transaction
    where category != 'Others'
    group by authority, category
    order by authority
    Run a query to Download Data