Query editor
-- q_sol_batch_efficiency [Solana] panel: table-- caption: Per settle_batch tx: calls packed (premium-in legs) and gross USDC moved. gross_usdc_per_call is GROSS throughput (premium+refund+fee), not net settled. Init/topup txs show 0 calls and sort to the bottom.-- PACT NETWORK | SOLANA | settle_batch efficiency. action widened.-- usdc_moved/gross_usdc_per_call are GROSS (premium+refund+fee), not net settled.WITH pact_txs AS (SELECT DISTINCT tx_id FROM solana.instruction_callsWHERE executing_account = '5bCJcdWdKLJ7arrMVMFh3z99rQDxV785fnD9XGcr3xwc'),pact_usdc_legs AS (SELECT t.tx_id, 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),per_tx AS (SELECT tx_id, MIN(block_time) AS settled_at,COUNT(*) FILTER (WHERE to_owner IN (SELECT owner FROM pool_owners) AND from_owner NOT IN (SELECT owner FROM pool_owners)) AS calls_in_batch,SUM(usdc) AS usdc_moved_in_batch_gross,COUNT(*) AS total_legs_in_batchFROM pact_usdc_legs GROUP BY tx_id)SELECT tx_id, settled_at, calls_in_batch, usdc_moved_in_batch_gross, total_legs_in_batch,usdc_moved_in_batch_gross / NULLIF(calls_in_batch, 0) AS gross_usdc_per_callFROM per_tx ORDER BY settled_at