Query editor
WITH filtered_transactions AS (SELECT t.id, t.instructions, t.signers, block_timeFROM solana.transactions AS tWHERE contains(account_keys, 'PytERJFhAKuNNuaiXkApLfWzwNwSNDACpigT3LwQfou')AND success = trueAND block_date >= (now() - interval '{{Number of days lookback}}' day))SELECTCOUNT(*) AS n_swapsFROM filtered_transactionsCROSS JOIN UNNEST(instructions) AS iWHERE i.executing_account = 'PytERJFhAKuNNuaiXkApLfWzwNwSNDACpigT3LwQfou'AND (bytearray_substring(CAST(from_base58(i.data) AS varchar), 1, 8) = '0xf8c69e91e17587c8' --swapOR bytearray_substring(CAST(from_base58(i.data) AS varchar), 1, 8) = '0x2b04ed0b1ac91e62' --swap_v2)