Get market state history
Historical state of a Morpho Blue market: total supply and borrow assets and shares.
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
market-selector*string
Selector formatted as <chain_id>:<market_id>. Example: 1:0xfff1970c0ffae288764186fbb38a9171a17e98676744a1e345809cb8b9e73342.
Format
<chain_id>:<market_id>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"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 marketSelector = "1:0xfff1970c0ffae288764186fbb38a9171a17e98676744a1e345809cb8b9e73342";const url = new URL(`${baseUrl}/v0/blue/markets/${marketSelector}/state/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",
"market_id": "0xb323495f7e4148be5643a4ea4a8221eef163e4bccfded827a6f46947d7ad9afb"
},
"data": [
{
"timestamp": 1729900800,
"total_supply_assets": "119800000000000",
"total_supply_shares": "118300000000000000000",
"total_borrow_assets": "84200000000000",
"total_borrow_shares": "83500000000000000000"
},
{
"timestamp": 1729987200,
"total_supply_assets": "120500000000000",
"total_supply_shares": "118900000000000000000",
"total_borrow_assets": "85000000000000",
"total_borrow_shares": "84200000000000000000"
}
],
"last_indexed_block": "19847234"
}