nimble-metamaskTop 10 contracts daily overall (NEAR)
    Updated 2022-07-27
    with top10 AS (
    SELECT
    TX_RECEIVER AS "Top 10 Contracts",
    SUM (GAS_USED)/1e12 AS "Total Gas Used (TGas)",
    SUM (TRANSACTION_FEE)/1e24 AS "Total fee (Ⓝ)",
    COUNT (TXN_HASH) AS "The number of transactions",
    "Total Gas Used (TGas)"/"The number of transactions" AS "Average Gas Used",
    "Total fee (Ⓝ)"/"The number of transactions" AS "Average fee paid"
    FROM flipside_prod_db.mdao_near.transactions
    GROUP BY 1
    ORDER BY 2 DESC
    LIMIT 10
    )
    SELECT
    date_trunc('day', BLOCK_TIMESTAMP) AS DATE,
    t."Top 10 Contracts",
    SUM (GAS_USED)/1e12 AS "Total daily Gas Used (TGas)",
    SUM (TRANSACTION_FEE)/1e24 AS "Total daily fee (Ⓝ)",
    COUNT (TXN_HASH) AS "The number of daily transactions",
    "Total daily Gas Used (TGas)"/"The number of daily transactions" AS "Average daily Gas Used",
    "Total daily fee (Ⓝ)"/"The number of daily transactions" AS "Average daily fee paid"
    FROM top10 t
    JOIN flipside_prod_db.mdao_near.transactions n
    ON t."Top 10 Contracts" = n.TX_RECEIVER
    GROUP BY 1,2
    ORDER BY 1 DESC
    Run a query to Download Data