10Blockchainnearby-aquamarine
    Updated 2025-03-04
    WITH daily_native AS (
    -- 1) Nombre de transactions natives / addresses actives / volume en coin natif
    SELECT
    DATE_TRUNC('DAY', block_timestamp) AS day,
    COUNT(*) AS nb_txs, -- Nombre total de TX
    COUNT(DISTINCT from_address) AS daily_active_addresses,
    SUM(value) AS total_native -- Montant total en natif
    FROM swell.core.fact_transactions
    WHERE tx_succeeded = TRUE
    GROUP BY 1
    ),

    daily_erc20 AS (
    -- 2) Nombre d'events ERC20 Transfer / Volume total transferts ERC20
    SELECT
    DATE_TRUNC('DAY', block_timestamp) AS day,
    COUNT(*) AS nb_erc20_transfers,
    SUM(
    CAST(DECODED_LOG:"value" AS DOUBLE)
    / POWER(10, c.DECIMALS)
    ) AS total_erc20 -- Montant total des transferts ERC20
    FROM swell.core.ez_decoded_event_logs AS e
    JOIN swell.core.dim_contracts AS c
    ON e.contract_address = c.address
    WHERE e.event_name = 'Transfer'
    GROUP BY 1
    )

    SELECT
    n.day,
    n.nb_txs,
    n.daily_active_addresses,
    n.total_native,
    COALESCE(e.nb_erc20_transfers, 0) AS nb_erc20_transfers,
    COALESCE(e.total_erc20, 0) AS total_erc20
    FROM daily_native n
    Last run: about 2 months ago
    DAY
    NB_TXS
    DAILY_ACTIVE_ADDRESSES
    TOTAL_NATIVE
    NB_ERC20_TRANSFERS
    TOTAL_ERC20
    1
    2025-03-04 00:00:00.0003566619364.683914455367631264498.2661801
    2
    2025-03-03 00:00:00.00049382295106.562716369449828676272.9180597
    3
    2025-03-02 00:00:00.0004855426671.572632553470515279264.6068699
    4
    2025-03-01 00:00:00.0004713226271.381546117265414479582.495607
    5
    2025-02-28 00:00:00.0004919924988.128084417452120957190.3828307
    6
    2025-02-27 00:00:00.00048830271109.878652029454340057111.3445976
    7
    2025-02-26 00:00:00.00048858268156.945290004415616528104.0263597
    8
    2025-02-25 00:00:00.00049483255111.646930682378428374544.9773919
    9
    2025-02-24 00:00:00.0004791525081.582027536290486169831.1005124
    10
    2025-02-23 00:00:00.0004698227350.463821953289417199215.5630799
    11
    2025-02-22 00:00:00.0004696725222.969926516288714296695.2343588
    12
    2025-02-21 00:00:00.00048692382121.83906247441225290133.6715463
    13
    2025-02-20 00:00:00.0004665230032.163994402199510056482.3191662
    14
    2025-02-19 00:00:00.0004712038417.136938812220318379378.2422476
    15
    2025-02-18 00:00:00.0004809035790.335930612348651952122.325417
    16
    2025-02-17 00:00:00.00048469315138.801803061459618525095.6960658
    17
    2025-02-16 00:00:00.00048343331234.726153927594812369383.4381606
    18
    2025-02-15 00:00:00.0004904036431.716445773697236509542.3748702
    19
    2025-02-14 00:00:00.0004877037579.899047294529951498149.4789756
    20
    2025-02-13 00:00:00.00048480357116.326061666435725455471.6681421
    60
    4KB
    2s