Get V2 vault state

Live state of a Morpho Vault V2: total assets and shares, withdrawable assets, allocated assets, and idle assets.

Vault selector example: 1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11 (format: <chain_id>:<vault_address>; replace with the target vault).

Path Parameters

vault-selector*string

Selector formatted as <chain_id>:<vault_address>. Example: 1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11.

Format<chain_id>:<vault_address>

Response Body

application/json

const baseUrl = process.env.CORE_REST_BASE_URL ?? "https://api.morpho.org";const apiKey = process.env.MORPHO_API_KEY ?? "<MORPHO_API_KEY>";const vaultSelector = "1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11";const url = new URL(`${baseUrl}/v1/vaults-v2/${vaultSelector}/state`);const response = await fetch(url, {  headers: {    accept: "application/json",    "x-api-key": apiKey,  },});if (!response.ok) throw new Error(await response.text());const body = await response.json();
{
  "data": {
    "chain_id": 1,
    "address": "0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11",
    "last_indexed_block": "25475349",
    "last_accrual_timestamp": 1783363079,
    "total_assets": "64630689825420",
    "total_supply": "63983179535078553542936844",
    "withdrawable_assets": "8833322907237",
    "allocated_assets": "64630689825420",
    "idle_assets": "0",
    "share_price_ray": "1010120008024709698799907272"
  }
}