Aephia2024-05-14 08:08 PM
    Updated 2024-05-14
    select
    fact_events.*
    --date_trunc('day', block_timestamp::date) as date,
    ----------------------------------------------------
    /*
    sum(case when inner_instruction:instructions[0]:parsed:info:authority IN ('5sLjP87xFvWQVHa8mkxyb5oCiqzaQzk8hK3n6z8n2mG5')
    AND inner_instruction:instructions[0]:parsed:info:authority != 'MRKT9mCmNU2R4KnZt9BV5uh9MESj7Phxws4AR7fUhRc'
    AND inner_instruction:instructions[2]:parsed:info: mint = 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v'
    then inner_instruction:instructions[2]:parsed:info:tokenAmount:uiAmount
    when inner_instruction:instructions[1]:parsed:info:authority IN ('5sLjP87xFvWQVHa8mkxyb5oCiqzaQzk8hK3n6z8n2mG5')
    AND inner_instruction:instructions[1]:parsed:info:authority != 'MRKT9mCmNU2R4KnZt9BV5uh9MESj7Phxws4AR7fUhRc'
    AND inner_instruction:instructions[2]:parsed:info: mint = 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v'
    then inner_instruction:instructions[2]:parsed:info:tokenAmount:uiAmount
    when inner_instruction:instructions[2]:parsed:info:authority IN ('5sLjP87xFvWQVHa8mkxyb5oCiqzaQzk8hK3n6z8n2mG5')
    AND inner_instruction:instructions[2]:parsed:info:authority != 'MRKT9mCmNU2R4KnZt9BV5uh9MESj7Phxws4AR7fUhRc'
    AND inner_instruction:instructions[1]:parsed:info: mint = 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v'
    then inner_instruction:instructions[1]:parsed:info:tokenAmount:uiAmount
    when inner_instruction:instructions[4]:parsed:info:authority IN ('5sLjP87xFvWQVHa8mkxyb5oCiqzaQzk8hK3n6z8n2mG5')
    AND inner_instruction:instructions[4]:parsed:info:authority != 'MRKT9mCmNU2R4KnZt9BV5uh9MESj7Phxws4AR7fUhRc'
    AND inner_instruction:instructions[3]:parsed:info: mint = 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v'
    then inner_instruction:instructions[3]:parsed:info:tokenAmount:uiAmount
    end) AS assets_USDC,
    sum(case when inner_instruction:instructions[0]:parsed:info:authority IN ('5sLjP87xFvWQVHa8mkxyb5oCiqzaQzk8hK3n6z8n2mG5')
    AND inner_instruction:instructions[0]:parsed:info:authority != 'MRKT9mCmNU2R4KnZt9BV5uh9MESj7Phxws4AR7fUhRc'
    AND inner_instruction:instructions[2]:parsed:info: mint = 'ATLASXmbPQxBUYbxPsV97usA3fPQYEqzQBUHgiFCUsXx'
    then inner_instruction:instructions[2]:parsed:info:tokenAmount:uiAmount
    when inner_instruction:instructions[1]:parsed:info:authority IN ('5sLjP87xFvWQVHa8mkxyb5oCiqzaQzk8hK3n6z8n2mG5')
    AND inner_instruction:instructions[1]:parsed:info:authority != 'MRKT9mCmNU2R4KnZt9BV5uh9MESj7Phxws4AR7fUhRc'
    AND inner_instruction:instructions[2]:parsed:info: mint = 'ATLASXmbPQxBUYbxPsV97usA3fPQYEqzQBUHgiFCUsXx'
    then inner_instruction:instructions[2]:parsed:info:tokenAmount:uiAmount
    when inner_instruction:instructions[2]:parsed:info:authority IN ('5sLjP87xFvWQVHa8mkxyb5oCiqzaQzk8hK3n6z8n2mG5')
    AND inner_instruction:instructions[2]:parsed:info:authority != 'MRKT9mCmNU2R4KnZt9BV5uh9MESj7Phxws4AR7fUhRc'
    AND inner_instruction:instructions[1]:parsed:info: mint = 'ATLASXmbPQxBUYbxPsV97usA3fPQYEqzQBUHgiFCUsXx'
    then inner_instruction:instructions[1]:parsed:info:tokenAmount:uiAmount
    when inner_instruction:instructions[4]:parsed:info:authority IN ('5sLjP87xFvWQVHa8mkxyb5oCiqzaQzk8hK3n6z8n2mG5')
    AND inner_instruction:instructions[4]:parsed:info:authority != 'MRKT9mCmNU2R4KnZt9BV5uh9MESj7Phxws4AR7fUhRc'
    QueryRunArchived: QueryRun has been archived