rmasFlow - Wallet Providers - Accounts Created
    Updated 2022-07-11
    WITH

    labels AS (
    SELECT
    column1 AS address
    , column2 AS label

    FROM (VALUES
    ('0x18eb4ee6b3c026d2', 'Dapper Wallet')
    , ('0x55ad22f01ef568a1', 'Blocto')
    , ('0x1b65c33d7a352c61', 'FanCraze Wallet')
    ) AS r
    )

    SELECT
    tx.payer
    , coalesce(l.label, tx.payer) AS payer_label
    , tx.block_timestamp::date AS utc_date
    , count(distinct event_data['address']::varchar) AS accounts_created
    FROM flow.core.fact_events AS ac
    INNER JOIN flow.core.fact_transactions AS tx
    ON tx.tx_id = ac.tx_id

    LEFT JOIN labels AS l
    ON l.address = tx.payer
    WHERE ac.event_type = 'AccountCreated'
    GROUP BY 1,2,3
    LIMIT 10000

    Run a query to Download Data