KaskoazulTinyman LP Pool TOP10Burn
    Updated 2022-03-03
    WITH TINYMAN_ACTION AS (
    SELECT
    block_timestamp::date as fecha,
    tx_id,
    CASE
    WHEN tx_message:txn:apas[2] IS NULL then tx_message:txn:apas[1]
    WHEN tx_message:txn:apas[2] != 0 then tx_message:txn:apas[2]
    END AS LP_AssetID,
    tx_message:txn:apas[0],
    tx_message:txn:apas[1],
    tx_message:txn:apas[2],
    try_base64_decode_string(tx_message:txn:apaa[0]::string) as Action
    FROM algorand.application_call_transaction
    WHERE
    fecha >= '2022-01-01'
    AND try_base64_decode_string(tx_message:txn:apaa[0]::string) IN ('mint', 'burn')
    AND app_id IN (552635992) --Tinyman
    ),

    LP_ACTION AS (
    SELECT
    LP.Action,
    a.asset_name,
    count (LP.tx_id) as Number
    FROM TINYMAN_ACTION LP
    INNER JOIN algorand.asset a
    ON LP.LP_AssetID = a.asset_ID
    GROUP BY 1,2
    ),

    TOP10MINT AS (
    SELECT
    asset_name,
    Action,
    Number
    FROM LP_ACTION
    Run a query to Download Data