mondovgas burned market share total
    Updated 2024-08-24
    WITH uniswap_eth AS (
    SELECT
    platform,
    SUM(CAST(blocks.block_header_json:baseFeePerGas AS FLOAT) / 1e18 * tx.gas_used) AS eth_burnt
    FROM crosschain.defi.ez_dex_swaps swaps
    JOIN ethereum.core.fact_transactions tx ON swaps.tx_hash = tx.tx_hash
    JOIN ethereum.core.fact_blocks blocks ON tx.block_number = blocks.block_number
    WHERE lower(swaps.platform) LIKE 'uniswap%'
    AND swaps.blockchain = 'ethereum'
    AND swaps.block_timestamp >= '2021-07-01'
    GROUP BY platform
    ),

    total_eth_burnt AS (
    SELECT
    SUM(CAST(block_header_json:baseFeePerGas AS FLOAT) / 1e18 * block_header_json:gasUsed) AS total_eth_burnt
    FROM ethereum.core.fact_blocks
    WHERE block_timestamp >= '2021-07-01'
    ),

    eth_burnt AS (
    SELECT
    'other' AS platform,
    (SELECT total_eth_burnt FROM total_eth_burnt) - COALESCE((SELECT SUM(eth_burnt) FROM uniswap_eth), 0) AS eth_burnt
    )

    SELECT
    platform, eth_burnt
    FROM uniswap_eth
    UNION ALL
    SELECT platform, eth_burnt FROM eth_burnt

    QueryRunArchived: QueryRun has been archived