Query editor
-- Meteora daily treasury cashflow by product type (DLMM / DAMM v2 / DAMM v1 / DBC)-- Daily fork of query 7639113 for Meteora Daily. Completed UTC days only.-- Scope: USD transfers landing in the Meteora fee-claim wallet (same definition as query 6616728).-- Direct claims are typed by their executing program (outer_executing_account).-- Fees claimed via the Zap wrapper land as USDC (product masked), so each Zap tx is re-attributed-- to the Meteora AMM it interacts with. From June 2026 a new outer program pFee-- (pFee3tb7qh5z53jRF4PbLwmNd148Q8ypLNZbqsMeinA) wraps claims; the AMM is an INNER-- instruction. Prefer an outer AMM product, else the inner AMM product.-- Jupiter swap-route hops can still create mixed inner AMMs; MIN() is best-effort.WITH treasury_in AS (SELECTtx_id,block_date AS day,outer_executing_account AS outer_prog,amount_usdFROM tokens_solana.transfersWHERE block_date >= current_date - interval '120' dayAND block_date < current_dateAND to_owner = '6aYhxiNGmG8AyU25rh2R7iFu4pBrqnQHpNUGhmsEXRcm'AND action = 'transfer'AND amount_usd > 0),wrap_tx AS (SELECT DISTINCT tx_idFROM treasury_inWHERE outer_prog IN ('zapvX9M3uf5pvy4wRPAbQgdQsM1xmuiFnkfHKPvwMiz','pFee3tb7qh5z53jRF4PbLwmNd148Q8ypLNZbqsMeinA')),wrap_src AS (SELECTic.tx_id,MIN(CASE WHEN ic.is_inner = false THENCASE ic.executing_accountWHEN 'cpamdpZCGKUy5JxQXB4dcpGPiikHawvSWAd6mEn1sGG' THEN 'DAMM v2'WHEN 'LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo' THEN 'DLMM'WHEN 'Eo7WjKq67rjJQSZxS6z3YkapzY3eMj6Xy8X5EQVn5UaB' THEN 'DAMM v1'WHEN 'dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN' THEN 'DBC'ENDEND) AS outer_product,MIN(CASE WHEN ic.is_inner = true THENCASE ic.executing_accountWHEN 'cpamdpZCGKUy5JxQXB4dcpGPiikHawvSWAd6mEn1sGG' THEN 'DAMM v2'WHEN 'LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo' THEN 'DLMM'WHEN 'Eo7WjKq67rjJQSZxS6z3YkapzY3eMj6Xy8X5EQVn5UaB' THEN 'DAMM v1'WHEN 'dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN' THEN 'DBC'ENDEND) AS inner_productFROM solana.instruction_calls icWHERE ic.block_date >= current_date - interval '120' dayAND ic.block_date < current_dateAND ic.executing_account IN ('cpamdpZCGKUy5JxQXB4dcpGPiikHawvSWAd6mEn1sGG','LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo','Eo7WjKq67rjJQSZxS6z3YkapzY3eMj6Xy8X5EQVn5UaB','dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN')AND ic.tx_id IN (SELECT tx_id FROM wrap_tx)GROUP BY 1),