binhachonTracking the Top Saber Lockers - Top 20
    Updated 2022-03-09
    with SBR_lock_transaction as (
    select
    block_timestamp,
    inner_instruction:instructions[0]:parsed:info:amount/1e6 as amount,
    inner_instruction:instructions[0]:parsed:info:source::string as source,
    inner_instruction:instructions[0]:parsed:info:authority::string as authority,
    inner_instruction:instructions[0]:parsed:info:destination::string as destination
    from solana.events
    where instruction:programId::string = 'LocktDzaV1W2Bm9DeZeiyz4J9zs4fRqNiYqQyracRXw'
    and inner_instruction:instructions[0]:parsed:type::string = 'transfer'
    and pretokenbalances[0]:mint::string = 'Saber2gLauYim4Mvftnrasomsv6NvAuncvMEZwcLpD1'
    and amount is not null
    ),
    top_20 as (
    select
    authority,
    sum(amount) as locked_amount,
    count(*) as frequency,
    row_number() over (order by locked_amount desc) as rank
    from SBR_lock_transaction
    where block_timestamp::date >= '2022-02-01'
    and block_timestamp::date < '2022-03-01'
    group by authority
    qualify rank < 21
    )
    select
    *
    from top_20
    Run a query to Download Data