Query editor
WITH aggregate AS (SELECTCOUNT(DISTINCT qa.asset) AS total_market_assets,SUM(qb.current_supply_usd) AS market_tvl_usd,SUM(qa.net_borrow_usd) AS outstanding_borrowed_liquidity_usd,SUM(qb.current_supply_usd - qa.net_borrow_usd) AS available_liquidity_usdFROM query_6323933 qaJOIN query_6376472 qbON qa.asset = qb.underlying_address),user_breakdown AS (SELECTCOUNT(DISTINCT CASE WHEN action = 'supply' THEN wallet END) AS total_suppliers,COUNT(DISTINCT CASE WHEN action = 'withdraw' THEN wallet END) AS total_withdrawers,COUNT(DISTINCT CASE WHEN action = 'borrow' THEN wallet END) AS total_borrowers,COUNT(DISTINCT CASE WHEN action = 'repay' THEN wallet END) AS total_repayingFROM (SELECT "user" AS wallet, 'supply' AS action FROM neverland_monad.pool_evt_supplyUNION ALLSELECT "user" AS wallet, 'withdraw' AS action FROM neverland_monad.pool_evt_withdrawUNION ALLSELECT "user" AS wallet, 'borrow' AS action FROM neverland_monad.pool_evt_borrowUNION ALLSELECT "user" AS wallet, 'repay' AS action FROM neverland_monad.pool_evt_repay) u),txs AS (SELECTCOUNT(DISTINCT tx_hash) AS total_transactionsFROM (SELECT evt_tx_hash AS tx_hash FROM neverland_monad.pool_evt_supplyUNION ALLSELECT evt_tx_hash AS tx_hash FROM neverland_monad.pool_evt_withdrawUNION ALLSELECT evt_tx_hash AS tx_hash FROM neverland_monad.pool_evt_borrowUNION ALLSELECT evt_tx_hash AS tx_hash FROM neverland_monad.pool_evt_repay) x),today_users AS (SELECTnew_users AS new_users_today,returning_users AS returning_usersFROM query_6367561WHERE "day" = (SELECT MAX("day") FROM query_6367561)),total_users AS (SELECTtotal_unique_usersFROM query_6367561),