StangFAST01 - General metrics
    Updated 2023-04-13
    with rainbow_bridge AS
    (
    SELECT
    *
    FROM
    (
    SELECT
    *
    , CASE
    when len( account_id ) = 64 then 'Near'
    when contains( account_id , 'near' ) then 'Near'
    when contains( account_id , 'aurora:' ) then 'Aurora'
    ELSE account_id
    END
    AS label
    FROM
    (
    SELECT
    CASE
    when tx_json:receipt:logs[1]:decoded:inputs:accountId IS NOT NULL then tx_json:receipt:logs[1]:decoded:inputs:accountId
    when tx_json:receipt:logs[2]:decoded:inputs:accountId IS NOT NULL then tx_json:receipt:logs[2]:decoded:inputs:accountId
    when tx_json:receipt:logs[3]:decoded:inputs:accountId IS NOT NULL then tx_json:receipt:logs[3]:decoded:inputs:accountId
    when tx_json:receipt:logs[4]:decoded:inputs:accountId IS NOT NULL then tx_json:receipt:logs[4]:decoded:inputs:accountId
    when tx_json:receipt:logs[5]:decoded:inputs:accountId IS NOT NULL then tx_json:receipt:logs[5]:decoded:inputs:accountId
    when tx_json:receipt:logs[6]:decoded:inputs:accountId IS NOT NULL then tx_json:receipt:logs[6]:decoded:inputs:accountId
    ELSE NULL
    END AS account_id
    ,
    CASE
    when tx_json:receipt:logs[1]:decoded:inputs:amount IS NOT NULL then tx_json:receipt:logs[1]:decoded:inputs:amount
    when tx_json:receipt:logs[2]:decoded:inputs:amount IS NOT NULL then tx_json:receipt:logs[2]:decoded:inputs:amount
    when tx_json:receipt:logs[3]:decoded:inputs:amount IS NOT NULL then tx_json:receipt:logs[3]:decoded:inputs:amount
    when tx_json:receipt:logs[4]:decoded:inputs:amount IS NOT NULL then tx_json:receipt:logs[4]:decoded:inputs:amount
    when tx_json:receipt:logs[5]:decoded:inputs:amount IS NOT NULL then tx_json:receipt:logs[5]:decoded:inputs:amount
    when tx_json:receipt:logs[6]:decoded:inputs:amount IS NOT NULL then tx_json:receipt:logs[6]:decoded:inputs:amount
    ELSE NULL
    Run a query to Download Data