HadisehNEAR City Layout 1
    Updated 2022-11-09
    with t1 as (
    select
    date(block_timestamp) as date,
    count(distinct ORIGIN_FROM_ADDRESS) as total_staker,
    sum(total_staker) over (order by date) as cumulative_stakers,
    count(distinct TX_HASH) as total_stakes,
    sum(total_stakes) over (order by date) as cumulative_stakes
    from ethereum.core.ez_eth_transfers
    where eth_to_address = '0xae7ab96520de3a18e5e111b5eaab095312d7fe84'
    and date >= CURRENT_DATE - 120
    group by date
    ),
    t2 as (
    select date_trunc('day', a.block_timestamp) as date,
    COUNT(DISTINCT tx_signer) as total_staker,
    sum(total_staker) over (order by date) as cumulative_stakers,
    COUNT(DISTINCT a.TX_HASH) as total_stakes,
    sum(total_stakes) over (order by date) as cumulative_stakes
    FROM near.core.fact_actions_events_function_call a
    JOIN near.core.fact_transactions b ON a.tx_hash = b.tx_hash and a.block_timestamp=b.block_timestamp
    WHERE method_name = 'deposit_and_stake'
    and date >= CURRENT_DATE - 120
    group by date
    )
    SELECT 'Ethereum' as chain, date,total_staker,cumulative_stakers, total_stakes ,cumulative_stakes from t1
    UNION
    SELECT 'NEAR' as chain, date,total_staker,cumulative_stakers, total_stakes ,cumulative_stakes from t2


    Run a query to Download Data