10Blockchain2. Calculer le coût payé sur Ethereum (L1)
    Updated 2025-02-21
    WITH daily_l1 AS (
    SELECT
    DATE_TRUNC('day', block_timestamp) AS dt,
    -- On suppose que effective_gas_price est en gwei et gas_used en gas units.
    -- Donc le produit se retrouve en gwei (car gwei * gas).
    SUM(gas_used * effective_gas_price) AS cost_l1_gwei
    FROM ethereum.core.fact_transactions
    WHERE from_address = LOWER('0x2f40D796917ffB642bD2e2bdD2C762A5e40fd749')
    GROUP BY 1
    )
    SELECT
    dt,
    cost_l1_gwei,
    -- 1 gwei = 1e-9 ETH
    (cost_l1_gwei / 1e9) AS cost_l1_eth
    FROM daily_l1
    ORDER BY dt;

    Last run: 2 months ago
    DT
    COST_L1_GWEI
    COST_L1_ETH
    1
    2023-07-04 00:00:00.000986074462.6900890.9860744627
    2
    2023-07-05 00:00:00.000130012985.5325220.1300129855
    3
    2023-07-06 00:00:00.0001314935560.305841.31493556
    4
    2023-07-07 00:00:00.0001490501690.99981.490501691
    5
    2023-07-08 00:00:00.000901032981.6718290.9010329817
    6
    2023-07-09 00:00:00.000818081161.6367220.8180811616
    7
    2023-07-10 00:00:00.0001007492946.222651.007492946
    8
    2023-07-11 00:00:00.0001012768819.239751.012768819
    9
    2023-07-12 00:00:00.0001246600532.564221.246600533
    10
    2023-07-13 00:00:00.0001451586015.687271.451586016
    11
    2023-07-14 00:00:00.0001104120293.130691.104120293
    12
    2023-07-15 00:00:00.000649284377.9593460.649284378
    13
    2023-07-16 00:00:00.000729250973.7047240.7292509737
    14
    2023-07-17 00:00:00.0001013061254.561291.013061255
    15
    2023-07-18 00:00:00.0001371822470.59451.371822471
    16
    2023-07-19 00:00:00.0001151907863.744181.151907864
    17
    2023-07-20 00:00:00.0001226840733.640631.226840734
    18
    2023-07-21 00:00:00.0001315132105.394081.315132105
    19
    2023-07-22 00:00:00.000878022953.3414230.8780229533
    20
    2023-07-23 00:00:00.000927220984.1311270.9272209841
    ...
    599
    34KB
    16s