Query editor
-- Non-MSC income (May 2026) — v2-- Changes vs v1:-- 1. Intra-transaction ordering is now EXACT: events are ordered by-- (block, tx_index, trace_address) instead of assuming fold-before-frob.-- Trace addresses are zero-padded and joined so string order = execution order.-- 2. The dart running sum (Art reconstruction) is kept in DECIMAL(38,0) — exact —-- instead of DOUBLE. Converted to DOUBLE only for the final Art × Δrate product.-- 3. PSM: sums ALL jar burns on the first burn DATE after month-end-- (v1 took only the earliest block_time, which would drop a second burn tx).---- Stability fees: income = Art(ilk) × Δrate at each vat.fold inside the month.-- This is exactly the amount fold credits to the vow — the protocol's own recognition.-- Art is not emitted by fold, so it is rebuilt as the running sum of every dart-- from vat.frob + vat.grab since genesis (fork moves debt between urns within an-- ilk and does not change total Art; heal/suck never touch Art).---- One-time validation (no Dune credits): read vat.ilks(ilk).Art on-chain today and-- compare to the running sum at the current block — exact match proves the reconstruction.WITH included AS (SELECT ilk FROM (VALUES('ETH-A'), ('ETH-B'), ('ETH-C'),('WSTETH-A'), ('WSTETH-B'),('WBTC-A'), ('WBTC-B'), ('WBTC-C'),('LSEV2-SKY-A')) AS t(ilk)),events AS (-- fold: carries Δrate; does not change ArtSELECT from_utf8(bytearray_rtrim(i)) AS ilk_name,call_block_number AS bn,call_tx_index AS txi,array_join(transform(call_trace_address, x -> lpad(CAST(x AS VARCHAR), 6, '0')), ',') AS tr,1 AS is_fold,CAST(rate AS DOUBLE) AS drate,CAST(0 AS DECIMAL(38, 0)) AS dart,call_block_time AS tFROM maker_ethereum.vat_call_foldWHERE call_success AND call_block_date < DATE '2026-06-02'UNION ALL-- frob: user borrow/repay; changes Art by dartSELECT from_utf8(bytearray_rtrim(i)),call_block_number,call_tx_index,array_join(transform(call_trace_address, x -> lpad(CAST(x AS VARCHAR), 6, '0')), ','),0,0e0,CAST(dart AS DECIMAL(38, 0)),call_block_timeFROM maker_ethereum.vat_call_frobWHERE call_success AND call_block_date < DATE '2026-06-02'UNION ALL-- grab: liquidation seizure; changes Art by dartSELECT from_utf8(bytearray_rtrim(i)),call_block_number,