Query editor
-- What addresses do after a first USDC vault deposit on Base: share that traded on a Base exchange or borrowed within 30 and 90 days, beside addresses that received USDC and never deposited.-- Reads ERC-4626 deposit events of every USDC vault on Base, USDC transfers on eight reference days, the curated exchange trades and borrow tables for Base, creation traces and a public address table.-- Depositors: addresses whose first deposit into any USDC vault on Base fell between January 1 and August 22, 2026, so 90 days are observed. Size is what they deposited in their first 30 days.-- Comparison set: addresses that received USDC on Base on the 15th of a month from January to August 2026 and have never deposited into a USDC vault on Base. Size is USDC received that day.-- The comparison rate for a group is weighted to the depositors' mix of account type and size, so the two sides are compared like for like on those two traits only.-- The 30 and 90 days start the day after the first deposit, or the day after the reference day, so the transfer that put an address in either set is not itself counted.-- A trade counts when the address is the recorded taker or the transaction sender. A borrow counts when the address is the borrower of record. Single trades are capped at 10 million US dollars.-- Contracts that are neither a wallet factory account nor a Safe are left out of both sides. One address is one row; an address is not a person.WITH pl AS (SELECT place_address AS vault FROM dune.paigeisonfire.result_base_usdc_lenders_places WHERE kind = 'vault' GROUP BY 1),d AS (SELECT owner AS acct, evt_block_date AS day, CAST(assets AS DOUBLE) / 1e6 AS usd FROM erc4626_base.evt_deposit WHERE contract_address IN (SELECT vault FROM pl) AND evt_block_date <= DATE '2026-11-20'),dep AS (SELECT acct, first_day AS idx, SUM(CASE WHEN day < date_add('day', 30, first_day) THEN usd ELSE 0 END) AS size_usdFROM (SELECT acct, day, usd, MIN(day) OVER (PARTITION BY acct) AS first_day FROM d)GROUP BY 1, 2),ctl AS (SELECT t."to" AS acct, MIN(t.evt_block_date) AS idx, max_by(t.day_usd, t.evt_block_date) AS size_usdFROM (SELECT "to", evt_block_date, SUM(CAST(value AS DOUBLE)) / 1e6 AS day_usdFROM base_usdc_base.fiattokenv2_1_evt_transferWHERE evt_block_date IN (DATE '2026-01-15', DATE '2026-02-15', DATE '2026-03-15', DATE '2026-04-15', DATE '2026-05-15', DATE '2026-06-15', DATE '2026-07-15', DATE '2026-08-15')GROUP BY 1, 2 HAVING SUM(CAST(value AS DOUBLE)) / 1e6 >= 1) tLEFT JOIN dep x ON x.acct = t."to"WHERE x.acct IS NULL AND t."to" NOT IN (SELECT vault FROM pl)GROUP BY 1),people AS (SELECT 'Deposited' AS side, acct, idx, size_usd FROM dep WHERE idx BETWEEN DATE '2026-01-01' AND DATE '2026-08-22' AND size_usd >= 1UNION ALLSELECT 'Did not deposit', acct, idx, size_usd FROM ctl),ct AS (SELECT address AS acct, MIN_BY("from", block_number) AS creator FROM base.creation_traces WHERE address IN (SELECT acct FROM people) GROUP BY 1),tr AS (SELECT u.addr, t.block_date AS day, least(COALESCE(t.amount_usd, 0), 1e7) AS usdFROM dex.trades t CROSS JOIN UNNEST(CASE WHEN t.taker = t.tx_from THEN ARRAY[t.taker] ELSE ARRAY[t.taker, t.tx_from] END) AS u(addr)WHERE t.blockchain = 'base' AND t.block_month >= DATE '2026-01-01' AND t.block_date <= DATE '2026-11-20'),bo AS (SELECT COALESCE(on_behalf_of, borrower) AS addr, CAST(block_time AS DATE) AS day, amount_usd AS usdFROM lending.borrowWHERE blockchain = 'base' AND block_month >= DATE '2026-01-01' AND transaction_type = 'borrow' AND amount_usd > 0),act AS (SELECT p.acct, p.idx, 1 AS is_trade, a.day, a.usd FROM people p JOIN tr a ON a.addr = p.acct AND a.day > p.idx AND a.day <= date_add('day', 90, p.idx)UNION ALLSELECT p.acct, p.idx, 0, a.day, a.usd FROM people p JOIN bo a ON a.addr = p.acct AND a.day > p.idx AND a.day <= date_add('day', 90, p.idx)),agg AS (SELECT acct,COUNT(CASE WHEN is_trade = 1 AND day <= date_add('day', 30, idx) THEN 1 END) AS trades30, COUNT(CASE WHEN is_trade = 1 THEN 1 END) AS trades90,SUM(CASE WHEN is_trade = 1 THEN usd END) AS vol90,SUM(CASE WHEN is_trade = 0 AND day <= date_add('day', 30, idx) THEN usd END) AS bor30, SUM(CASE WHEN is_trade = 0 THEN usd END) AS bor90FROM act GROUP BY 1),ppl AS (SELECT p.side = 'Deposited' AS dep, p.acct,CASE WHEN p.size_usd < 1e4 THEN '1. Under $10K' WHEN p.size_usd <= 1e6 THEN '2. $10K to $1M' ELSE '3. Over $1M' END AS size_band,CASE WHEN ct.creator IN (0x0BA5ED0c6AA8c49038F819E587E2633c4A9F428a, 0xBA5ED110eFDBa3D005bfC882d75358ACBbB85842) THEN 'Smart wallet from an app wallet factory'WHEN ct.creator IN (0x4e1DCf7AD4e460CfD30791CCC4F9c8a4f820ec67, 0xa6B71E26C5e0845f74c812102Ca7114b6a896AB2, 0xC22834581EbC8527d974F8a1c97E1bEA4EF910BC) THEN 'Safe account'