Afonso_DiazUntitled Query
    Updated 2023-01-31
    select
    receiver_id as validator,
    count(distinct a.tx_hash) as stakes_count,
    count(distinct tx_signer) as stakers_count,
    sum((regexp_substr(c.value, 'contract total staked balance is ([0-9]+)[\.]' , 1, 1, 'ei')::float / pow(10, 24))) as total_volume
    from near.core.fact_receipts a,
    lateral flatten(input => logs) c
    join near.core.fact_transactions b
    where c.value ilike '%contract total staked balance is%'
    and b.block_timestamp > current_date - 90
    and a.tx_hash = b.tx_hash
    group by validator
    order by stakes_count desc
    limit 10
    Run a query to Download Data