Query editor
WITH all_actions AS (-- Mint actions (supply)SELECT minter as wallet, COUNT(*) as action_countFROM venus_bnb.vbep20delegate_v2_evt_mintGROUP BY minterUNION ALLSELECT minter as wallet, COUNT(*) as action_countFROM venus_bnb.vbnb_v2_evt_mintGROUP BY minterUNION ALL-- Borrow actionsSELECT borrower as wallet, COUNT(*) as action_countFROM venus_bnb.vbep20delegate_v2_evt_borrowGROUP BY borrowerUNION ALLSELECT borrower as wallet, COUNT(*) as action_countFROM venus_bnb.vbnb_v2_evt_borrowGROUP BY borrowerUNION ALL-- Liquidation actionsSELECT borrower as wallet, COUNT(*) as action_countFROM venus_bnb.vbnb_v2_evt_liquidateborrowGROUP BY borrowerUNION ALLSELECT liquidator as wallet, COUNT(*) as action_countFROM venus_bnb.vbnb_v2_evt_liquidateborrowGROUP BY liquidatorUNION ALLSELECT borrower as wallet, COUNT(*) as action_countFROM venus_bnb.liquidator_evt_liquidateborrowedtokensGROUP BY borrowerUNION ALLSELECT liquidator as wallet, COUNT(*) as action_countFROM venus_bnb.liquidator_evt_liquidateborrowedtokensGROUP BY liquidator),wallet_totals AS (SELECT wallet, SUM(action_count) as total_actionsFROM all_actionsGROUP BY wallet),wallet_ranks AS (SELECTwallet,total_actions,NTILE(10) OVER (ORDER BY total_actions DESC) as decile