Get V2 vault caps history
Historical allocation and cap state of a Morpho Vault V2 grouped by cap.
Vault selector example: 1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11 (format: <chain_id>:<vault_address>; replace with the target vault).
Enterprise API access
For enterprise access, use https://private.api.morpho.org as the base URL and send your API key in the x-api-key header. Request an API key.
Path Parameters
vault-selector*string
Selector formatted as <chain_id>:<vault_address>. Example: 1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11.
Format
<chain_id>:<vault_address>Query Parameters
lookback?string
Lookback period. Defaults to thirty_days. Historical sampling is selected automatically.
Value in
"one_day" | "seven_days" | "thirty_days" | "ninety_days" | "one_year" | "inception"cap_id?string
Optional Vault V2 cap id filter.
Match
^0x[a-fA-F0-9]{64}$cap_type?string
Optional Vault V2 cap type filter.
Value in
"adapter" | "collateral" | "marketV1" | "unknown"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}/v0/vaults-v2/${vaultSelector}/caps/history`);url.searchParams.set("lookback", "thirty_days");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();{
"params": {
"chain_id": "1",
"vault_address": "0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11"
},
"data": [
{
"cap_id": "0x0a14a2d85b0d8b52f0991fdc2d47e9c469a70735c084f99f74d0113dd4b61899",
"cap_type": "marketV1",
"history": [
{
"timestamp": 1729900800,
"allocation": "46000000000000",
"absolute_cap": "100000000000000",
"relative_cap_wad": "600000000000000000",
"relative_allocation": 0.46
},
{
"timestamp": 1729987200,
"allocation": "47500000000000",
"absolute_cap": "100000000000000",
"relative_cap_wad": "600000000000000000",
"relative_allocation": 0.475
}
]
}
],
"last_indexed_block": "25475349"
}