Query editor
-- part of a query repo-- query name: Assets-- query link: https://dune.com/queries/3152410-- Time series of Fabrica properties, acres, and TVL on-chain-- Uses CSV data for token attributes (acres, value) including burned tokens-- Uses blockchain data for accurate mint/burn timestamps-- Filters for valid tokens only (score >= 2142)-- Note: Uses VARCHAR for token_id to avoid precision loss with large integersWITH fabrica_contract AS (SELECT 0x5cbeb7A0df7Ed85D82a472FD56d81ed550f3Ea95 AS address),-- Valid tokens from CSV (includes burned tokens with their original data)-- Excludes premints (they're not on-chain yet)valid_tokens AS (SELECT-- Strip 'id_' prefix to get token_id as string (preserves precision)SUBSTR(token_id, 4) AS token_id,CAST(acres AS DOUBLE) AS acres,CAST(estimated_value_usd AS DOUBLE) AS estimated_value,is_burnedFROM dune.fabrica.dataset_fabrica_tokensWHERE is_valid = trueAND is_premint = false),-- All mints from blockchain with token datamint_events AS (SELECTDATE(t.block_time) AS day,t.token_id,vt.acres,vt.estimated_valueFROM nft.transfers tCROSS JOIN fabrica_contract fcINNER JOIN valid_tokens vt ON CAST(t.token_id AS VARCHAR) = vt.token_idWHERE t.blockchain = 'ethereum'AND t.token_standard = 'erc1155'AND t.contract_address = fc.addressAND t."from" = 0x0000000000000000000000000000000000000000),-- All burns from blockchain with token databurn_events AS (SELECTDATE(t.block_time) AS day,t.token_id,vt.acres,vt.estimated_valueFROM nft.transfers tCROSS JOIN fabrica_contract fcINNER JOIN valid_tokens vt ON CAST(t.token_id AS VARCHAR) = vt.token_idWHERE t.blockchain = 'ethereum'AND t.token_standard = 'erc1155'AND t.contract_address = fc.addressAND t."to" = 0x0000000000000000000000000000000000000000),-- Daily mint aggregatesdaily_mints AS (SELECTday,