kasadeghUntitled Query
    Updated 2022-11-21
    with near_usdc_transfer as (
    select chain,log_volume, count(*) as transfer_count
    from
    (
    SELECT
    'near' as chain,
    TX_HASH,
    CAST(SPLIT(tx:receipt[0]['outcome']['logs'], ' ')[1] as INT)/power(10, 6) as volume,
    floor(log(2,volume)) log_volume

    FROM near.core.fact_transactions
    WHERE TX_RECEIVER LIKE 'a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48.factory.bridge.near'
    AND not SPLIT(tx:receipt[0]['outcome']['logs'], ' ')[1] LIKE 'account'
    AND block_timestamp::date >='{{start_time}}' and block_timestamp::date <='{{end_date}}'
    and volume!=0
    )
    group by 1,2
    order by 2
    )
    SELECT chain, log_volume, transfer_count / (select sum(transfer_count) from near_usdc_transfer)
    FROM near_usdc_transfer
    Run a query to Download Data