Query editor
-- ============================================================-- AUSD Ops | #2 Daily Mint/Burn Summary (Ethereum)-- 每日汇总:Mint量、Burn量、净发行、笔数、30日均值-- ============================================================WITH daily_ops AS (SELECTdate_trunc('day', evt_block_time) AS op_date,CASEWHEN "from" = 0x0000000000000000000000000000000000000000 THEN 'MINT'WHEN "to" = 0x0000000000000000000000000000000000000000 THEN 'BURN'END AS operation_type,value / 1e6 AS amountFROM erc20_ethereum.evt_TransferWHERE contract_address = 0x00000000eFE302BEAA2b3e6e1b18d08D69a9012aAND ("from" = 0x0000000000000000000000000000000000000000OR "to" = 0x0000000000000000000000000000000000000000))SELECTop_date,COALESCE(SUM(CASE WHEN operation_type = 'MINT' THEN amount END), 0) AS daily_mint,COALESCE(SUM(CASE WHEN operation_type = 'BURN' THEN amount END), 0) AS daily_burn,COALESCE(SUM(CASE WHEN operation_type = 'MINT' THEN amount END), 0)- COALESCE(SUM(CASE WHEN operation_type = 'BURN' THEN amount END), 0) AS net_issuance,COUNT(CASE WHEN operation_type = 'MINT' THEN 1 END) AS mint_count,COUNT(CASE WHEN operation_type = 'BURN' THEN 1 END) AS burn_countFROM daily_opsGROUP BY op_dateORDER BY op_date DESC