Zanyar_98Top 3 Auction in terms of the highest number of participants
    Updated 2022-09-19
    WITH Project_On_Ethereum AS (
    SELECT Contract_Address
    FROM ethereum.core.fact_event_logs
    WHERE ORIGIN_TO_ADDRESS='0x7603a35af5cf10b113f167d424eb75bb7062c8ce' AND
    ORIGIN_FUNCTION_SIGNATURE = '0xfa18022c' AND EVENT_NAME='AuctionTimeUpdated'),

    ETHEREUM_TOP3 AS (SELECT COUNT(DISTINCT(FROM_ADDRESS)) AS "Number of participants", To_ADDRESS AS "Auction", 'Ethereum' AS NETWORK
    FROM ethereum.core.fact_transactions
    WHERE To_ADDRESS IN (SELECT Contract_Address FROM Project_On_Ethereum)
    GROUP BY "Auction"
    ORDER BY "Number of participants" DESC
    LIMIT 3),

    Project_On_BSC AS (
    SELECT Contract_Address
    FROM bsc.core.fact_event_logs
    WHERE ORIGIN_TO_ADDRESS='0x5629ce74ddcad7cc72b3ea30444da7172ad851d9' AND
    ORIGIN_FUNCTION_SIGNATURE = '0xfa18022c' AND EVENT_NAME='AuctionTimeUpdated'),

    BSC_TOP3 AS (SELECT COUNT(DISTINCT(FROM_ADDRESS)) AS "Number of participants", To_ADDRESS AS "Auction", 'BSC' AS NETWORK
    FROM bsc.core.fact_transactions
    WHERE To_ADDRESS IN (SELECT Contract_Address FROM Project_On_BSC)
    GROUP BY "Auction"
    ORDER BY "Number of participants" DESC
    LIMIT 3),
    Project_On_Polygon AS (
    SELECT Contract_Address
    FROM polygon.core.fact_event_logs
    WHERE ORIGIN_TO_ADDRESS='0xc040f84cf7046409f92d578ef9040fe45e6ef4be' AND
    ORIGIN_FUNCTION_SIGNATURE = '0xfa18022c' AND EVENT_NAME='AuctionTimeUpdated'),

    Polygon_Top3 AS (SELECT COUNT(DISTINCT(FROM_ADDRESS)) AS "Number of participants", To_ADDRESS AS "Auction", 'Polygon' AS NETWORK
    FROM polygon.core.fact_transactions
    WHERE To_ADDRESS IN (SELECT Contract_Address FROM Project_On_Polygon)
    Run a query to Download Data