ArioPolyMarket - Users in the last 30 days
    Updated 9 days ago
    -- forked from PolyMarket - Users & Trades @ https://flipsidecrypto.xyz/edit/queries/69fa363d-84bb-4554-9c13-bfbe6cfa81b9

    with CFTE_NRCFTE as (
    select
    CONVERT_TIMEZONE( 'America/New_York' , BLOCK_TIMESTAMP ) as BLOCK_TIMESTAMP
    ,TX_HASH
    ,CONTRACT_ADDRESS
    ,DECODED_LOG:maker::string as maker
    ,DECODED_LOG:taker::string as taker
    from polygon.core.ez_decoded_event_logs
    where
    CONTRACT_ADDRESS in ('0x4bfb41d5b3570defd03c39a9a4d8de6bd8b8982e', '0xc5d563a36ae78145c45a50134d48a1215220f80a')
    and
    EVENT_NAME = 'OrderFilled'
    and
    TX_STATUS = 'SUCCESS'
    and block_timestamp::date >= current_timestamp - interval '29 days'
    )
    , users as (
    SELECT
    BLOCK_TIMESTAMP::date as date
    ,taker AS user_address
    ,TX_HASH
    FROM
    CFTE_NRCFTE
    WHERE
    block_timestamp::date >= current_timestamp - interval '29 days'
    AND taker != contract_address
    AND maker NOT IN (
    '0x4D97DCd97eC945f40cF65F87097ACe5EA0476045',
    '0x4bfb41d5b3570defd03c39a9a4d8de6bd8b8982e',
    '0x78769D50Be1763ed1CA0D5E878D93f05aabff29e'
    )

    UNION all
    SELECT
    Last run: 9 days ago
    Active Wallets in the Last 30 Days
    1
    324142
    1
    10B
    18s