Query editor
-- =====================================================================-- QUERY: cirBTC - Base Labeled Transfers (Ethereum)-- PURPOSE: Single source of truth for all cirBTC Transfer events on-- Ethereum, with decimals-normalized amount and a 3-tier label-- resolved for both sender and receiver. Every other dashboard-- query in this workspace reads from this one via-- `select * from query_7783594`.-- ASSUMPTIONS:-- - "Economic transfer" = any Transfer event where from != to and-- value > 0. We do not additionally try to detect "internal-- bookkeeping" beyond this, because cirBTC's contract has not been-- ABI-decoded by Dune yet as a contract-specific table; if/when a-- decoded table distinguishes wrapper-internal accounting events-- from user-facing Transfers, exclude those here too.-- - Mints (from = 0x0) and burns (to = 0x0) are kept and flagged via-- is_mint/is_burn so Circle Mint issuance/redemption is distinguishable-- from secondary-market movement.-- - De-dup: erc20_ethereum.evt_transfer already guarantees one row per-- emitted log (keyed by evt_tx_hash + evt_index), so no additional-- de-dup logic is needed.-- - Label priority: manual override > CEX > Dune auto-detected contract-- project > heuristic (is_smart_contract ? 'Unknown Contract' : 'Unknown Wallet').-- - A manual-override label table (e.g. dune.<team>.cirbtc_address_labels-- with columns address, label, label_type) is NOT yet joined below.-- Once created, add it as the highest-priority WHEN branch / coalesce-- argument in the from_label / to_label expressions below.-- =====================================================================with token_meta as (select decimalsfrom tokens.erc20where blockchain = 'ethereum'and contract_address = 0x72dfb2e44f59c5ad2bafe84314e5b99a7cd5075elimit 1),raw_transfers as (selectt.evt_block_time,t.evt_block_date,t.evt_block_number,t.evt_tx_hash,t.evt_index,t."from",t."to",t.value / power(10, m.decimals) as amount,case when t."from" = 0x0000000000000000000000000000000000000000 then true else false end as is_mint,case when t."to" = 0x0000000000000000000000000000000000000000 then true else false end as is_burnfrom erc20_ethereum.evt_transfer tcross join token_meta mwhere t.contract_address = 0x72dfb2e44f59c5ad2bafe84314e5b99a7cd5075eand t."from" != t."to"and t.value > 0)selectr.*,-- from_label: CEX > auto-detected contract project > heuristic.coalesce(