ramishoow2023-02-12 01:49 PM
    Updated 2023-02-12
    with outflows as (
    SELECT
    distinct tx_signer as wallet
    , sum(deposit/1e24) over(partition by wallet ) as total_outflow_value
    , count(tx_hash) over(partition by wallet ) as total_outflow_tx_count

    FROM
    near.core.fact_transfers
    WHERE
    status = 'TRUE'

    ) , inflows as (
    SELECT
    distinct tx_receiver as wallet
    , sum(deposit/1e24) over(partition by wallet ) as total_inflow_value
    , count(tx_hash) over(partition by wallet ) as total_inflow_tx_count

    FROM
    near.core.fact_transfers
    WHERE
    status = 'TRUE'

    )

    , top_10 as (


    select
    wallet
    , total_inflow_value
    , total_inflow_tx_count
    , total_outflow_value
    , total_outflow_tx_count
    , case
    Run a query to Download Data