m0rt3zaMISO - Arbitrum users over time
    Updated 2022-09-18
    WITH markets AS (
    SELECT
    origin_from_address as creator,
    event_inputs:addr as market_address,
    event_inputs:marketTemplate as market_template,
    CASE
    WHEN market_template = '0x1c5771e96c9d5524fb6e606f5b356d08c40eb194' THEN 'Dutch Auction'
    WHEN market_template = '0xf60e5f4a44a510742457d8064ffd360b12d8d9af' THEN 'Crowdsale'
    WHEN market_template = '0x258f7e97149afd7d7f84fa63b10e4a3f0c38b788' THEN 'Batch Auction'
    END as market_type
    FROM arbitrum.core.fact_event_logs
    WHERE origin_to_address = '0x3db923fbab372ab8c796fef9bb8341cdb37cb9ec'
    AND event_name = 'MarketCreated'
    ), txs AS (
    SELECT
    b.block_timestamp,
    b.from_address as user,
    b.tx_hash,
    a.*
    FROM markets as a JOIN arbitrum.core.fact_transactions as b on a.market_address = b.to_address
    )
    SELECT
    date_trunc('Week', block_timestamp) as week,
    date_trunc('Month', block_timestamp) as month,
    count(DISTINCT tx_hash) as "Transaction Count",
    count(DISTINCT user) as "User Count"
    FROM txs
    GROUP BY week, month
    Run a query to Download Data