mattkstewTop 10 Users by Average Score
    Updated 2023-08-21

    -- credit to Discord: smol data#9784
    -- Twitter: @LittlerData
    -- used some of the contracts he found and methods he used to find this data.
    with submissions as (

    select
    origin_from_address submitter
    ,to_number(ethereum.public.udf_hex_to_int(substr(topics[2], 3, 64))) bounty_id
    ,to_number(ethereum.public.udf_hex_to_int(substr(topics[3], 3, 64))) submission_id
    from polygon.core.fact_event_logs
    where block_timestamp > '2023-01-01'
    and origin_function_signature = '0x269dde89'
    and contract_address in ('0x280b3b748ccc42d5062ce59111fad08594f51d9f', '0x3e4f7978447e354e832d38363e927231e518e33a'
    ,'0xadfd6e51b1a8a4f6cd5bb2e1c33b08cbaf47b1e8', '0xacbf13fd19f35c2032d3030619318f5b595cc7d8'
    ,'0x3eeac7cf0526e4c26f9cd400fbea852715381709') --approved marketplaces, cant get to leave out the test marketplaces
    ),

    reviews as (
    select
    to_number(ethereum.public.udf_hex_to_int(substr(topics[2], 3, 64))) bounty_id
    ,to_number(ethereum.public.udf_hex_to_int(substr(topics[3], 3, 64))) submission_id
    ,to_number(ethereum.public.udf_hex_to_int(substr(data, 3, 64))) score
    from polygon.core.fact_event_logs
    where contract_address in ('0x280b3b748ccc42d5062ce59111fad08594f51d9f', '0x3e4f7978447e354e832d38363e927231e518e33a'
    ,'0xadfd6e51b1a8a4f6cd5bb2e1c33b08cbaf47b1e8', '0xacbf13fd19f35c2032d3030619318f5b595cc7d8'
    ,'0x3eeac7cf0526e4c26f9cd400fbea852715381709') --approved marketplaces, cant get to leave out the test marketplaces
    and origin_function_signature = '0x8ddad6ac'
    and origin_to_address = contract_address
    ),

    grading as (
    select
    submission_id
    ,floor(avg(score)) grade
    ,round(avg(score)/4*100,2) Score
    Run a query to Download Data