ramishoow2023-02-14 12:33 PM
    Updated 2023-02-14
    with ramishow as ( select tx_signer, sum(deposit/power(10,24)) as Amount_sent from near.core.fact_transfers group by 1
    ), tab2 as ( select TX_RECEIVER, sum(deposit/power(10,24)) as Amount_recieved from near.core.fact_transfers group by 1 )
    , tab3 as ( select tx_signer, amount_recieved - amount_sent as Net_NEAR from ramishow left outer join tab2 on
    tx_signer = TX_RECEIVER having net_NEAR is not null and tx_signer not like '%lockup%' and tx_signer not like 'nfeco%' and tx_signer not like 'nfendowment%' and tx_signer not like 'aurora' and tx_signer not like 'kucoinc.near'
    and tx_signer not like 'binance1.near' and tx_signer not like 'marketplace.paras.near' and tx_signer not like 'bitkubhwallet.near' and tx_signer not like 'app.nearcrowd.near'
    and net_near < 45641694.4836753 order by 2 desc limit 50 ) select action,
    sum(stake_amount/power(10,24)) as "Stake Volume", count(*) as "Stake Events" from near.core.dim_staking_actions where tx_signer in (select tx_signer from tab3) group by 1
    --

    Run a query to Download Data