Query editor
-- ============================================================================-- LENDING PROTOCOLS — Deduplicated Total Daily Historical-- One row per day: DAU, cumulative unique users, new users, rolling WAU/MAU-- ⚠️ Update lending_protocols list as new lending protocols launch-- ============================================================================WITH event_whitelist AS (SELECT LOWER(name) AS name FROM (VALUES('Supply'), ('Deposit'), ('Withdraw'), ('Withdrawal'),('Redeem'), ('Borrow'), ('Repay'), ('FlashLoan'),('Liquidation'), ('LiquidatePosition'), ('LiquidationCall'),('SupplyCollateral'), ('AccrueInterest'),('ReserveUsedAsCollateralEnabled'), ('ReserveUsedAsCollateralDisabled'),('ReserveDataUpdated'), ('BorrowRateUpdate'),('Swap'), ('AssetSwapped'), ('Swapped'), ('Exchange'), ('Routed'),('Mint'), ('Burn'), ('Collect'),('LiquidityAdded'), ('LiquidityRemoved'),('Enter'), ('Sync'), ('Poke'),('Stake'), ('Unstake'),('StakeReceived'), ('StakeRecorded'), ('Delegate'),('RewardsClaimed'), ('Claimed'), ('Distribute'),('Bridge'), ('BridgeInitiated'), ('BridgeCompleted'),('LiFiGenericSwapCompleted'), ('LiFiTransferStarted'),('UpdateLastTotalAssets'), ('UpdateLostAssets'),('SetAuthorization'), ('ShortcutExecuted'),('OrderPlaced'), ('OrderFilled'), ('OrderCancelled'),('BalanceTransfer'), ('RawAction'), ('L1OperationAggregated')) AS t(name)),lending_protocols AS (SELECT LOWER(name) AS name FROM (VALUES('hypurrfi'),('hyperlend'),('morpho_blue'),('metamorpho_vaults'),('morpho_v2'),('felix_cdp'),('looping_collective'),('kinetiq'),('upshift'),('lazysummer'),('pendle')) AS t(name)),raw_interactions AS (SELECTCAST(ld.block_time AS DATE) AS block_date,ld.tx_from AS user_addressFROM hyperevm.logs_decoded ldJOIN hyperevm.contracts cON ld.contract_address = c.addressJOIN event_whitelist wON LOWER(ld.event_name) = w.nameWHERE ld.tx_from IS NOT NULLAND c.namespace IS NOT NULLAND LOWER(c.namespace) IN (SELECT name FROM lending_protocols)),daily_users AS (SELECTblock_date,COUNT(DISTINCT user_address) AS dau