StangFASTbase-04
    Updated 2023-09-27
    -- forked from base-02 @ https://flipsidecrypto.xyz/edit/queries/2934b49b-7e7a-4b2a-be0b-781e4e7accce

    -- forked from base-01 @ https://flipsidecrypto.xyz/edit/queries/222502d4-4183-4b9e-845b-7ffba5f83ffd

    SELECT
    a.block_timestamp AS bt
    , a.signers[0] AS us
    , a.tx_id AS tx
    , split( split( b.value , '.' )[0] , ' ' )[ array_size( split( split( b.value , '.' )[0], ' ' ) ) - 1 ] AS nm
    , split( b.value , '.' )[1] AS dm

    , case
    when dm = 'bonk' then 'BONK'
    when dm = 'superteam' then 'SFT'
    when dm = 'monke' then 'MONKECLAIM'
    else 'SOL'
    end
    AS tk

    , length( nm )
    AS ch

    , case
    when dm = 'bonk' then 69000000
    when dm = 'monke' then 1
    else d.amount
    end
    AS am

    FROM
    solana.core.fact_transactions a
    JOIN
    lateral flatten ( input => a.log_messages ) b
    JOIN
    (
    Run a query to Download Data