Query editor
WITH backgrounds AS (SELECTsplit(token_idbackground, ',')[1] AS token_id,split(token_idbackground, ',')[2] AS backgroundFROM dune.klintoshi.dataset_bosu_legacy_backgrounds_Klintoshi),transformed AS (SELECT DISTINCTbytearray_to_uint256(topic2) AS token_idFROM ethereum.logsWHERE contract_address = 0xb792864e4659d0b8076f9c6912c228f914ec66d4)SELECTb.background,COUNT(*) FILTER (WHERE t.token_id IS NULL) AS remaining_transformable,COUNT(*) FILTER (WHERE t.token_id IS NOT NULL) AS already_usedFROM backgrounds bLEFT JOIN transformed tON CAST(b.token_id AS BIGINT) = t.token_idGROUP BY 1ORDER BY remaining_transformable DESC;