Query editor
-- =====================================================================-- NEAR CURRENT VALUES: latest TVL + lifetime fees/volume per NEAR vault-- =====================================================================-- EVM OAV vaults from Vault Metrics Daily (8092271); Kamino SOL Balanced-- unioned in from the reporting-DB upload (see Near Vault Metrics Daily).-- lifetime_fees_usd = cumulative minted performance/management fees (USD).-- last_pps_day on the Kamino row is its weekly snapshot date, so a value-- older than the other rows means the figure is stale.-- =====================================================================WITH evm AS (SELECT day, client, report_name, vault_name, blockchain, und_symbol, vault_address,vault_shares, pps_as_of, tvl_underlying, tvl_usd, n_deposits, n_withdrawals,inflow_underlying, outflow_underlying, inflow_usd, outflow_usd, net_flow_usd,total_volume_usd, volume_usd_cumulative, harvest_count, fee_shares,fees_underlying, fees_usd, fees_usd_cumulative, underlying_usd_price,unique_depositors, client_unique_addresses, total_unique_addressesFROM query_8092271WHERE client = 'NEAR'),kam_days AS (SELECT d.dayFROM (SELECT sequence(DATE '2026-06-19', CAST(DATE_TRUNC('day', NOW()) AS DATE), INTERVAL '1' DAY) AS s) tCROSS JOIN UNNEST(t.s) AS d(day)),kam_snap AS (SELECT CAST(event_date AS DATE) AS snapshot_day,SUM(CAST(amount AS DOUBLE)) AS tvl_underlying,SUM(CAST(usd_amount AS DOUBLE)) AS tvl_usd,COUNT(DISTINCT address) AS holdersFROM dune.yieldxyz.dataset_kamino_tvlWHERE integration_id = 'solana-kamino-sol-dccrsdum-vault'AND partner = 'NEAR'AND CAST(is_partner_facing AS VARCHAR) IN ('true', 't', '1', 'TRUE')GROUP BY 1),kam_carry AS (SELECT d.day,max_by(k.tvl_underlying, k.snapshot_day) AS tvl_underlying,max_by(k.tvl_usd, k.snapshot_day) AS tvl_usd,max_by(k.holders, k.snapshot_day) AS holders,MAX(k.snapshot_day) AS snapshot_dayFROM kam_days dLEFT JOIN kam_snap k ON k.snapshot_day <= d.dayGROUP BY 1),kam_act AS (SELECT CAST(action_date AS DATE) AS day,COUNT(CASE WHEN action_type IN ('STAKE','DEPOSIT') THEN 1 END) AS n_deposits,COUNT(CASE WHEN action_type NOT IN ('STAKE','DEPOSIT') THEN 1 END) AS n_withdrawals,SUM(CASE WHEN action_type IN ('STAKE','DEPOSIT') THEN CAST(amount AS DOUBLE) ELSE 0 END) AS inflow_underlying,SUM(CASE WHEN action_type NOT IN ('STAKE','DEPOSIT') THEN CAST(amount AS DOUBLE) ELSE 0 END) AS outflow_underlying,SUM(CASE WHEN action_type IN ('STAKE','DEPOSIT') THEN CAST(usd_amount AS DOUBLE) ELSE 0 END) AS inflow_usd,SUM(CASE WHEN action_type NOT IN ('STAKE','DEPOSIT') THEN CAST(usd_amount AS DOUBLE) ELSE 0 END) AS outflow_usd,COUNT(DISTINCT address) AS addrsFROM dune.yieldxyz.dataset_kamino_actionsWHERE integration_id = 'solana-kamino-sol-dccrsdum-vault'AND partner = 'NEAR'AND CAST(is_partner_facing AS VARCHAR) IN ('true', 't', '1', 'TRUE')GROUP BY 1