AurelianLabssUSDe Daily Volume Market Share
    Updated 2024-08-10
    With sUSDe_transfers as (select
    a.block_timestamp,
    a.tx_id,
    t.signers[0] as origin_tx_signer,
    a.tx_from,
    CASE
    when a.tx_from = 'DdiBUm31RAqr9JRPw1zzMUzZCoUEYPuxULZFPHSM61QX' then 'Orca (PYUSD-sUSDe) Market'
    when a.tx_from = '73a2yN8Qd4dN8g9RJBeHCUywMdXaKoh7LRuF7Gj9dL8Z' then 'Kamino Treasury Fee Vault Authority'
    when a.tx_from = 'D9nup6RADfzx3B5ZTkb6z659nDpqzt7cBvzQLxV3SouR' then 'Kamino (PYUSD-sUSDe) Pool Authority'
    when a.tx_from = 'GuWEkEJb5bh8Ai2gaYmZWMTUq8MrFeoaDZ89BrQfB1FZ' then 'Kamino Reserve 4/Lending Program'
    when a.tx_from = 'JCNCMFXo5M5qwUPg2Utu1u6YWp3MbygxqBsBeXXJfrw' then 'Drift vault'
    else null
    end as sender_address_label,
    a.tx_to,
    CASE
    when a.tx_to = 'DdiBUm31RAqr9JRPw1zzMUzZCoUEYPuxULZFPHSM61QX' then 'Orca (PYUSD-sUSDe) Market'
    when a.tx_to = '73a2yN8Qd4dN8g9RJBeHCUywMdXaKoh7LRuF7Gj9dL8Z' then 'Kamino Treasury Fee Vault Authority'
    when a.tx_to = 'D9nup6RADfzx3B5ZTkb6z659nDpqzt7cBvzQLxV3SouR' then 'Kamino (PYUSD-sUSDe) Pool Authority'
    when a.tx_to = 'GuWEkEJb5bh8Ai2gaYmZWMTUq8MrFeoaDZ89BrQfB1FZ' then 'Kamino Reserve 4/Lending Program'
    when a.tx_to = 'JCNCMFXo5M5qwUPg2Utu1u6YWp3MbygxqBsBeXXJfrw' then 'Drift vault'
    else null
    end as receiver_address_label,
    a.amount
    from solana.core.fact_transfers a
    left join solana.core.dim_labels b on a.tx_to = b.address
    left join solana.core.dim_labels c on a.tx_from = c.address
    left join solana.core.fact_transactions t ON a.tx_id = t.tx_id
    join (select tx_id, max(index) as index from solana.core.fact_transfers where block_timestamp::date > '2024-08-06' group by 1) d ON a.tx_id = d.tx_id AND a.index = d.index
    where mint = 'Eh6XEPhSwoLv5wFApukmnaVSHQ6sAnoD9BmgmwQoN2sN' --and
    --a.tx_id = '5eWnkDoBRQk1AfmHmiRFPLc59pg5fvJfA37g9YM3SMFANK6DFYLP5fpGzEVaek7q7kGung9THzLSYcP34man2cP6'
    )

    select
    date_trunc('day', block_timestamp) as date,
    CASE
    when receiver_address_label is not null then receiver_address_label
    QueryRunArchived: QueryRun has been archived