kidaTop 100 NFTs
    Updated 2022-07-27
    SELECT
    SELECT
    SPLIT(PARSE_JSON(args):token_id, ':')[0] as token_id,
    PARSE_JSON(args):nft_contract_id as nft_contract_id,
    SUM(PARSE_JSON(args):price::int) / 1e24 as total_sales,
    COUNT(DISTINCT txn_hash) as total_sale_count,
    total_sales / total_sale_count as avg_price_per_sale
    FROM flipside_prod_db.mdao_near.actions_events_function_call
    WHERE method_name = 'buy' AND NOT CONTAINS(args::string, '\0') AND TRY_PARSE_JSON(args) is not null AND TRY_CAST(TRY_PARSE_JSON(args):price::string as INT) is not null
    GROUP BY token_id, nft_contract_id
    ORDER BY total_sales DESC
    LIMIT 100
    Run a query to Download Data