Query editor
WITH window_bounds AS (SELECT DATE '2026-07-24' AS from_day, DATE '2026-07-24' - INTERVAL '1' DAY AS history_from, current_date AS to_day),fee_pda_map AS (SELECT DISTINCTelement_at(account_arguments, 2) AS wallet,element_at(account_arguments, 3) AS fee_pdaFROM solana.instruction_calls-- From before the first registration on 2026-06-10, and never windowed: a-- wallet registered once and trading a year later still needs to be found.WHERE block_date >= DATE '2026-06-01'AND block_date <= (SELECT to_day FROM window_bounds)AND executing_account = 'JTXJTXfr1wVRMEzqiPhXUr69zJtfGuLh5qEiXG772Zj'AND tx_successAND cardinality(account_arguments) >= 3AND varbinary_substring(data, 1, 1) = 0x07-- One registered signer is excluded. Any pubkey can register, and-- the transactions this one signs contain both a swap and a fee--- account create of their own, so its own signature is what would-- otherwise admit them as trades. They are not trades.AND element_at(account_arguments, 2)<> '23zyeKyn8wpF8VyWSGHTGvTVEGi5SPyziGSs9pGKr5ta'),-- The JTX marker. Every swap the terminal executes creates (idempotently) the-- token account that collects the platform fee, and account 3 of that-- instruction is the account's owner: the signer's own JTX fee PDA. Nothing-- else on chain distinguishes a JTX swap. Discriminator 0x01 is-- CreateIdempotent, which is what the terminal has always used; 0x00 is the-- versioned Create, kept only so a switch would not go unnoticed (the-- unversioned Create carries no data and cannot match either byte). Matching-- the signer against the PDA's own wallet is what keeps a fee sweep out, since-- a sweep creates the same kind of account under its own key.jtx_marked_txs AS (SELECT DISTINCT i.tx_idFROM solana.instruction_calls iINNER JOIN fee_pda_map mON element_at(i.account_arguments, 3) = m.fee_pdaAND i.tx_signer = m.walletWHERE i.block_date >= (SELECT history_from FROM window_bounds)AND i.block_date <= (SELECT to_day FROM window_bounds)AND i.executing_account = 'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL'AND i.tx_successAND cardinality(i.account_arguments) >= 3AND varbinary_substring(i.data, 1, 1) IN (0x00, 0x01)),-- Minute price bars, defined once and used by both the fee and the volume-- path. Keeping two copies is what let the fee side end up with no staleness-- fallback while the volume side had one.price_minutes AS (SELECT minute, contract_address, decimals, priceFROM prices.usdWHERE blockchain = 'solana'-- One day of lookback beyond the window. An ASOF join takes the newest-- bar at or before the fill, so a fill in the window's first hour needs-- bars from before the window to have anything to match.AND minute >= CAST((SELECT history_from FROM window_bounds) AS TIMESTAMP)- INTERVAL '1' DAY),-- Platform fee transfers into a JTX fee PDA, signed by the PDA's owner, inside-- a DFlow or Titan transaction, collapsed to one row per transaction.