mrwildcatbsc bridges active addesses
    Updated 2023-04-20
    -- forked from arbitrum bridges active addesses copy @ https://flipsidecrypto.xyz/edit/queries/32603d5b-b012-40d0-83d2-fee9bcae8194

    WITH
    bridge_addresses AS (
    SELECT
    address,
    address_name,
    project_name
    FROM
    crosschain.core.address_labels
    WHERE
    label_subtype = 'bridge'
    AND blockchain = 'bsc'
    ),
    token_transfers AS (
    SELECT
    ft.*,
    ba.address_name,
    ba.project_name
    FROM
    bsc.core.fact_token_transfers ft
    JOIN bridge_addresses ba ON ft.TO_ADDRESS = ba.address
    WHERE
    ft.TO_ADDRESS IN (
    SELECT
    address
    FROM
    bridge_addresses
    )
    )

    SELECT
    DATE_TRUNC('month', BLOCK_TIMESTAMP) AS date,
    count(DISTINCT (ORIGIN_FROM_ADDRESS)) as N_USERS
    FROM
    token_transfers
    Run a query to Download Data