Query editor
/*@title: Morpho V2 - Vaults Data@description: Provides an overview of Morpho vaults@author: Steakhouse Financial@references:1) https://morpho.blockanalitica.com/metamorpho/2) https://legacy.morpho.org/vault?vault={VAULT_ADDRESS_HERE}&network=mainnet3) V1 query: https://dune.com/queries/3959703@definitions:- Assets: amount of the underlying token (asset) that the contract holds (ie: USDC)- Shares: tokens issued by the vault to represent a user’s proportional ownership of the underlying assets- Share Price: conversion rate between shares & assets, increases over time (as interest accrues)how many underlying tokens (eg: USDT) correspond to 1 share@notes: naming convention changes V1 vs. V2V1 V2metamorpho vault_addressname vault_namemarket_symbol vault_symbolcoll_decimals token_decimalssymbol, coll_symbol token_symbolasset token_address@version:- 1.0 - 2025-02-26 - Initial version- 2.0 - 2025-04-13 - Refactor queries in V2 format-> Modify the Aggregate query variables-> Remove the Metamorpho Calcs CTE- 3.0 - 2025-04-21 - Set a minimal precision for assets and shares- 4.0 - 2025-04-26 - Add liquidity and liquidity_ratio- 5.0 - 2025-04-30 - Removed update_assets CTE and its link in the vault_accrued_fees CTE- 6.0 - 2025-05-20 - Add feeShares into the total supply shares- 7.0 - 2025-06-19 - Coalesce accounting_price_usd first- 8.0 - 2025-07-15 - Use Mat view of Morpho vaults_data query- 9.0 - 2025-07-17 - Add Markets Supply Rate in Final Output- 9.1 - 2025-09-28 - interest fees shares where actually in usd and not in shares- 9.2 - 2025-10-09 - Update Morpho vaults precisions to (assets and shares > 300 filter out small txs)- 10.0 - 2026-01-06 - Update the interpolation for the end stage- 11.0 - 2026-03-01 - Sort final values in order- 12.0 - 2026-05-06 - If fees = 0 it shows null, fixed it so it shows 0 instead.- 13.0 - 2026-06-09 - Add inflows and outflows in shares and usd values*/with-- get all metamorpho vaults created from factory contractsvault_data as (selectcreation_date as creation_ts,DATE(creation_date) AS creation_dt,blockchain,token_address,vault_address,vault_name,vault_symbol,token_symbol,token_decimals,18 as market_decimals,curator_name as curator,versionfrom dune.steakhouse.result_morpho_vaults-- query_4835775 -- Morpho - Vaults),