Query editor
-- OpenStock — platform-wide headline snapshot. Single row.---- Builds one (wallet, deposited, withdrawn) row per transfer leg, then folds-- to per-wallet totals before aggregating. This deduplicates wallets that-- deposited on multiple chains (a "sum of per-chain distincts" would-- double-count) and lets us define claims/profit precisely:---- deposit : USDC sent INTO the vault (wallet = sender)-- withdrawal : USDC sent OUT of the vault (wallet = recipient)-- claim : a withdrawal to an address that previously deposited-- (this excludes capital deployed to the SPV, which goes to a-- non-depositor address, and dust to non-depositors)-- realized_profit : for a wallet that has claimed, withdrawn − deposited---- ADDING A NEW VAULT: append the address to the `IN (...)` filter for the-- relevant chain CTE (both the deposit leg and the withdrawal leg).WITH eth_flows AS (-- deposit leg: USDC into the vaultSELECT CAST("from" AS VARCHAR) AS wallet,CAST(value AS DOUBLE)/1e6 AS deposited,0.0 AS withdrawnFROM erc20_ethereum.evt_TransferWHERE contract_address = 0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48AND evt_block_time >= CAST('2026-05-17' AS timestamp)AND "to" IN (0xcee063f8148901037323c1c3a3763b8a5c7c36fb)UNION ALL-- withdrawal leg: USDC out of the vaultSELECT CAST("to" AS VARCHAR) AS wallet,0.0 AS deposited,CAST(value AS DOUBLE)/1e6 AS withdrawnFROM erc20_ethereum.evt_TransferWHERE contract_address = 0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48AND evt_block_time >= CAST('2026-05-17' AS timestamp)AND "from" IN (0xcee063f8148901037323c1c3a3763b8a5c7c36fb)),base_flows AS (SELECT CAST("from" AS VARCHAR) AS wallet,CAST(value AS DOUBLE)/1e6 AS deposited,0.0 AS withdrawnFROM erc20_base.evt_TransferWHERE contract_address = 0x833589fcd6edb6e08f4c7c32d4f71b54bda02913AND evt_block_time >= CAST('2026-05-17' AS timestamp)AND "to" IN (0x3ed40ee069214f350a36764b4f38cffbe3c6d8a7)UNION ALLSELECT CAST("to" AS VARCHAR) AS wallet,0.0 AS deposited,CAST(value AS DOUBLE)/1e6 AS withdrawnFROM erc20_base.evt_TransferWHERE contract_address = 0x833589fcd6edb6e08f4c7c32d4f71b54bda02913AND evt_block_time >= CAST('2026-05-17' AS timestamp)AND "from" IN (0x3ed40ee069214f350a36764b4f38cffbe3c6d8a7)),sol_flows AS (SELECT from_owner AS wallet,CAST(amount AS DOUBLE)/1e6 AS deposited,0.0 AS withdrawnFROM tokens_solana.transfersWHERE token_mint_address = 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v'AND block_time >= CAST('2026-05-17' AS timestamp)