Papasotpact.fi LP mints/burns
    Updated 2023-01-03
    With pact_app_ids as
    ( SELECT DISTINCT tx_message :txn :apid :: NUMBER AS app_id
    FROM algorand.transactions
    WHERE inner_tx = 'FALSE'
    AND tx_message :dt :itx [0] :txn :type :: STRING = 'acfg'
    AND tx_message :dt :itx [0] :txn :apar :an :: STRING LIKE '%PACT LP Token'
    AND tx_message :dt :itx [0] :txn :apar :au :: STRING = 'https://pact.fi/' )
    select
    date_trunc('day',block_timestamp) as block_day,
    case
    when TRY_BASE64_DECODE_STRING(tx_message :txn :apaa [0] :: STRING) = 'ADDLIQ' then 'LP mint'
    else 'LP burn' end as note,
    count(tx_message)
    from algorand.application_call_transaction where app_id IN ( SELECT app_id FROM pact_app_ids ) And
    TRY_BASE64_DECODE_STRING(tx_message :txn :apaa [0] :: STRING) = 'ADDLIQ' OR TRY_BASE64_DECODE_STRING(tx_message :txn :apaa [0] :: STRING) = 'REMLIQ'
    group by block_day, note
    order by block_day
    Run a query to Download Data