BlockTrackerbridge 6 chains over time in last 3 months
    Updated 2023-08-01

    with avalanche_b as (
    SELECT
    date,
    count(DISTINCT tx_hash) as n_bridges,
    count(DISTINCT bridgor) as bridgors
    FROM (
    SELECT
    date_trunc('d', block_timestamp) as date,
    tx_hash,
    from_address as bridgor
    FROM avalanche.core.fact_transactions a
    INNER JOIN avalanche.core.dim_labels b
    ON a.to_address = b.address
    WHERE b.label_type IN ('bridge', 'layer2')
    UNION
    SELECT
    date_trunc('d', block_timestamp) as date,
    tx_hash,
    to_address as bridgor
    FROM avalanche.core.fact_transactions a
    INNER JOIN avalanche.core.dim_labels b
    ON a.from_address = b.address
    WHERE b.label_type IN ('bridge', 'layer2')
    )
    WHERE date > dateadd('month', -3, current_date)
    AND date <= current_date-1
    GROUP BY 1
    )
    ,
    Bsc_b as (
    SELECT
    date,
    count(DISTINCT tx_hash) as n_bridges,
    count(DISTINCT bridgor) as bridgors
    FROM (
    Run a query to Download Data