hbd199404 - A Report of Gas Station Usage
    Updated 2025-01-19
    ----------------------------------------------------- Adding Tokens and Symbols -----------------------------------------------------

    WITH tokens AS (
    select
    token_address as token,
    name,
    symbol,
    uri
    FROM $query('b227b22d-94d7-49d7-951a-309cb1755c73')),

    ----------------------------------------------------- Pool Creations -----------------------------------------------------

    pools as (
    select
    BLOCK_TIMESTAMP as creation_date,
    INSTRUCTION:accounts[1] as tokenMintA,
    b.symbol as tokenMintA_symbol,
    INSTRUCTION:accounts[2] as tokenMintB,
    c.symbol as tokenMintB_symbol,
    tokenMintB_symbol || ' - ' || tokenMintA_symbol as pool_name,
    INSTRUCTION:accounts[5] as pool_funder,
    INSTRUCTION:accounts[6] as pool_address,
    INSTRUCTION:accounts[7] as tokenVaultA,
    INSTRUCTION:accounts[8] as tokenVaultB,
    case
    when INSTRUCTION:accounts[9] = '9ZhzuqjANw7T8Q8KWErXELrx9ZMArUdXAUmoJ9qBGuUS' then '0.01' when INSTRUCTION:accounts[9] = 'BWhUdrPPor8gxya47efretmwTtkCpFQxDiK8eRDV4ibE' then '0.02'
    when INSTRUCTION:accounts[9] = '9uqkUhxV5Gu3yMKSQ9Baavj3ky8MkVDp925XNfCng1dy' then '0.05' when INSTRUCTION:accounts[9] = 'ELt2ABgf4BpXZhKLcxKCg3QJb7WGtcz9ACGcHc6pFvaG' then '0.1'
    when INSTRUCTION:accounts[9] = '2G1aYAbxbwHLUV74HZ1gFdj6eftPiwKx9yRsSsMeCXSq' then '0.15' when INSTRUCTION:accounts[9] = 'DT3cBTV8RMkNRLGV4S7Xj7QbbxrZvPG3kPYq2YnstEnn' then '0.3'
    when INSTRUCTION:accounts[9] = 'Cu433u9MsEH57ZFJC4Pw9DT97PSgeVF4EY1YoLfUwRze' then '0.65' when INSTRUCTION:accounts[9] = '7wAquQD66tK61wzM45uG8S3cHTKho1gknydE8qzDnV18' then '1'
    when INSTRUCTION:accounts[9] = '8ESd9eMrLUGveZGSKg2Fw9wKGD5oWzy41RAPfeZQNUrQ' then '1' when INSTRUCTION:accounts[9] = 'Hb1U1qAm1ZQYR4rJgDhGusPGUzkW4yjF3Ak7J9fZ8VHG' then '2'
    end as fee_percent
    from eclipse.core.fact_events a
    left join tokens b on b.TOKEN = a.INSTRUCTION:accounts[1]
    left join tokens c on c.TOKEN = a.INSTRUCTION:accounts[2]
    where substr(replace(substr(utils.udf_base58_to_hex(INSTRUCTION:data),3,1000), ''),0,16) = 'cf2d57f21b3fcc43'
    order by 1, INDEX),