zackmendel4a. Top 10 Dapps Used CEX Users
    Updated 2023-05-02
    WITH cex_users AS (
    SELECT
    tx_receiver AS wallets
    FROM near.core.fact_transfers t JOIN near.core.dim_address_labels l
    ON t.tx_signer = l.address
    WHERE label_type = 'cex'
    AND status = 'true'

    UNION

    SELECT
    tx_signer AS wallets
    FROM near.core.fact_transfers t JOIN near.core.dim_address_labels l
    ON t.tx_receiver = l.address
    WHERE label_type = 'cex'
    AND status = 'true'
    )
    SELECT
    DISTINCT project_name,
    COUNT (DISTINCT signer_id) AS user
    FROM near.core.fact_actions_events e JOIN near.core.dim_address_labels l
    ON e.receiver_id = l.address
    WHERE l.label_type = 'dapp'
    AND signer_id IN (SELECT wallets FROM cex_users)
    GROUP BY 1
    ORDER BY 2 DESC
    LIMIT 10
    Run a query to Download Data