permarynew users
    Updated 2025-03-17

    WITH historical_users AS (
    -- Find all wallets that used XSGD on Ethereum or Polygon before September 2024
    SELECT DISTINCT origin_from_address AS wallet_address
    FROM ethereum.core.ez_token_transfers
    WHERE contract_address = LOWER('0x70e8dE73cE538DA2bEEd35d14187F6959a8ecA96')
    AND block_timestamp < '2024-09-01'

    UNION

    SELECT DISTINCT origin_to_address AS wallet_address
    FROM ethereum.core.ez_token_transfers
    WHERE contract_address = LOWER('0x70e8dE73cE538DA2bEEd35d14187F6959a8ecA96')
    AND block_timestamp < '2024-09-01'

    UNION

    SELECT DISTINCT origin_from_address AS wallet_address
    FROM polygon.core.ez_token_transfers
    WHERE contract_address = LOWER('0xDC3326e71D45186F113a2F448984CA0e8D201995')
    AND block_timestamp < '2024-09-01'

    UNION

    SELECT DISTINCT origin_to_address AS wallet_address
    FROM polygon.core.ez_token_transfers
    WHERE contract_address = LOWER('0xDC3326e71D45186F113a2F448984CA0e8D201995')
    AND block_timestamp < '2024-09-01'
    ),

    first_tx_per_chain AS (
    -- Find first transaction per user on each chain (starting from September 2024)
    SELECT
    'Ethereum' AS chain,
    origin_from_address AS wallet_address,
    MIN(DATE_TRUNC('month', block_timestamp)) AS first_tx_month
    Last run: about 1 month ago
    CHAIN
    FIRST_TX_MONTH
    NEW_USERS
    1
    Avalanche2024-09-01 00:00:00.00055
    2
    Ethereum2024-09-01 00:00:00.000301
    3
    Polygon2024-09-01 00:00:00.0002064
    4
    Polygon2024-10-01 00:00:00.0001146
    5
    Avalanche2024-10-01 00:00:00.00094
    6
    Ethereum2024-10-01 00:00:00.000120
    7
    Avalanche2024-11-01 00:00:00.000408
    8
    Polygon2024-11-01 00:00:00.0001465
    9
    Ethereum2024-11-01 00:00:00.000151
    10
    Ethereum2024-12-01 00:00:00.000159
    11
    Avalanche2024-12-01 00:00:00.000639
    12
    Polygon2024-12-01 00:00:00.0001160
    13
    Polygon2025-01-01 00:00:00.000930
    14
    Ethereum2025-01-01 00:00:00.000117
    15
    Avalanche2025-01-01 00:00:00.0001100
    16
    Ethereum2025-02-01 00:00:00.000171
    17
    Avalanche2025-02-01 00:00:00.000870
    18
    Polygon2025-02-01 00:00:00.000893
    19
    Polygon2025-03-01 00:00:00.000346
    20
    Ethereum2025-03-01 00:00:00.000105
    21
    907B
    30s