Query editor
-- q_sol_tvl [Solana] panel: step line (running balance)-- caption: Running net USDC balance of inferred pool accounts. A FLOW-DELTA, not an absolute balance (pre-window pool funding is invisible). Genuinely negative ~-$0.098 — shown unclamped.-- PACT NETWORK | SOLANA | TVL: running net USDC balance of pool accounts-- Pinocchio => no logs => reconstruct from SPL transfer deltas. action widened (curated values not confirmed).-- TVL is a FLOW-DELTA (deposits=0, pre-window pool balance invisible); genuinely negative ~-$0.098. Do NOT clamp.WITH pact_txs AS (SELECT DISTINCT tx_id FROM solana.instruction_callsWHERE executing_account = '5bCJcdWdKLJ7arrMVMFh3z99rQDxV785fnD9XGcr3xwc'),pact_usdc_legs AS (SELECT t.block_time, t.from_owner, t.to_owner, CAST(t.amount AS DOUBLE)/1e6 AS usdcFROM tokens_solana.transfers t JOIN pact_txs p ON p.tx_id = t.tx_idWHERE t.token_mint_address = 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v'AND t.action IN ('transfer','transferChecked')AND t.from_owner IS NOT NULL AND t.to_owner IS NOT NULL),pool_owners AS (SELECT to_owner AS owner FROM pact_usdc_legs INTERSECT SELECT from_owner AS owner FROM pact_usdc_legs),pool_flows AS (SELECT block_time, usdc AS signed_usdc FROM pact_usdc_legs l WHERE l.to_owner IN (SELECT owner FROM pool_owners)UNION ALLSELECT block_time, -usdc AS signed_usdc FROM pact_usdc_legs l WHERE l.from_owner IN (SELECT owner FROM pool_owners)),daily AS (SELECT date_trunc('day', block_time) AS day, SUM(signed_usdc) AS net_usdc_day FROM pool_flows GROUP BY 1)SELECT day, net_usdc_day, SUM(net_usdc_day) OVER (ORDER BY day) AS tvl_usdc_runningFROM daily ORDER BY day