Query editor
withnames as (SELECTbytearray_substring(data, 6 --start from discrim (1 byte) + length (4 bytes) => 6th byte start, bytearray_to_bigint(bytearray_reverse(bytearray_substring(data,2,4))) --strings are vec<u32> so we get the first 4 bytes for length then convert binary string to utf8) as string_binary, trim(from_utf8(bytearray_substring(data, 6 --start from discrim (1 byte) + length (4 bytes) => 6th byte start,bytearray_to_bigint(bytearray_reverse(bytearray_substring(data,2,4))) --strings are vec<u32> so we get the first 4 bytes for length then convert binary string to utf8))) || '.sol' as string_utf8, tx_id, block_time, tx_signer as owner, case when bytearray_substring(data,1,1) IN (0x0d, 0x00, 0x11) then account_arguments[3]--0x00 https://solscan.io/tx/4hFMPcncHeTa4SUCqAr8NWbE7NaAGvz7F8LNVbuieJuHCVvewkuZpFkPZxXezfsBKWiKHfa1rJoviTrSrDiUYNG6--0x0d https://solscan.io/tx/28Wr9Tg83FwWTJNXMLT561ZDd7sqo29Z9dCeWJhvuWeNFtkAQvnF7ajGyL7haAicEmKozTaWGPiyorWNNpAhupc6--0x11 https://solscan.io/tx/325dGEvxPLdMJgQH62ea89EJcaRSEuJtrd761Xhxadj1ZtirPhJmLvgx2ENaSodU74tXwzQk8ShvFsZQ1qw3T53Ewhen bytearray_substring(data,1,1) = 0x01 then account_arguments[5] --https://solscan.io/tx/4776cgKwMaHuF1gZjPd5UXqTu1ChjZWh9gVDh3A96PmGzfW49RFvDo2ToBHHEqUmmxx6jgXD3UxeM3T7RxkHUJuCwhen bytearray_substring(data,1,1) = 0x09 then account_arguments[4] --https://solscan.io/tx/3KYM9GFVoBiS2da1rk55GLiXgqEcriFHsCtJY7JtQZKuwCqYrYVBXU4Fh7EUq35EfzmqhnR4GLHH4ABmduWUHMyvend as domain_accountFROM solana.instruction_callsWHERE executing_account = 'jCebN34bUfdeUYJT13J1yG16XWQpt5PDx6Mse9GUqhR'and bytearray_substring(data,1,1) IN (0x01, 0x09, 0x0d, 0x00, 0x11) --different register instructions-- and block_slot = 86509693-- and tx_id = '4776cgKwMaHuF1gZjPd5UXqTu1ChjZWh9gVDh3A96PmGzfW49RFvDo2ToBHHEqUmmxx6jgXD3UxeM3T7RxkHUJuC'-- and block_time > now() - interval '3' day), transfers as (--namesLPneVptA9Z5rqUDD9tMTWEJwofgaYwp8cawRkX executing_account to transfer--https://solscan.io/tx/3fFsUjj9McWt8ncV9CSdpMvdDEnBWL61MLenE5kPxuwe9ZwKtrc9mJR66a68MgKNAbKEgTc6MN7m4VpSZyrcgGv8--account being transferred is 8zzUuxRTnBj2kbDAiDRWKQLgvAjaNfkjeXY9vRoLXAH8--from kyle's account https://solscan.io/account/4yhXa4iERFGma3T1HMMjH8nJ8EdFqbahCV5Yomm8Z3do#domainsSELECTtoBase58(bytearray_substring(data,2,32)) as owner, account_arguments[1] as domain_account, block_time, row_number() OVER (partition by account_arguments[1] order by block_time desc) as latest, tx_idFROM solana.instruction_callsWHERE executing_account = 'namesLPneVptA9Z5rqUDD9tMTWEJwofgaYwp8cawRkX'and bytearray_substring(data,1,1) = 0x02-- and toBase58(bytearray_substring(data,2,32)) = '4yhXa4iERFGma3T1HMMjH8nJ8EdFqbahCV5Yomm8Z3do' --test), latest_holders as (SELECTn.domain_account, n.string_utf8, COALESCE(t.owner, n.owner) as owner, n.block_time as registered_at, t.block_time as transferred_atFROM names nLEFT JOIN transfers t ON t.domain_account = n.domain_account AND t.latest = 1), favorites as (--example transaction: https://solscan.io/tx/24UqDsCzqATuA4LMf83b1MC77VfQvJqfeFVZF653ezsBCmYwNifU9SMMRD4u4CCzGJf4fAfbyrsG7cFjCzFVFypJ--account_arguments[1] = domain_account