Get market

Detail lookup for a single market. :market-id is the stable Midnight market id and is unique across supported chains, so no chain id is required.

Returns the immutable market configuration inside a data envelope. Use GET /v0/midnight/markets/{market-id}/state for dynamic market state. 404s when the id is unknown.

Path Parameters

market-id*string

Midnight market id.

Response Body

application/json

application/json

const baseUrl = "https://api.morpho.org";const marketId = "0xcc9418ea594c6e658650aedd205ce4544b266b69493f56fd2adc65c14bd06738";const url = new URL(`${baseUrl}/v0/midnight/markets/${marketId}`);const response = await fetch(url, {  headers: {    accept: "application/json",  },});if (!response.ok) throw new Error(await response.text());const body = await response.json();
{
  "data": {
    "chain_id": 8453,
    "market_id": "0xcc9418ea594c6e658650aedd205ce4544b266b69493f56fd2adc65c14bd06738",
    "loan_token": "0x4200000000000000000000000000000000000006",
    "maturity": 1784300400,
    "rcf_threshold": "0",
    "enter_gate": "0x0000000000000000000000000000000000000000",
    "liquidator_gate": "0x0000000000000000000000000000000000000000",
    "collaterals": [
      {
        "token": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
        "lltv": "860000000000000000",
        "liquidation_cursor": "300000000000000000",
        "oracle": "0xD09048c8B568Dbf5f189302beA26c9edABFC4858"
      }
    ]
  }
}
{
  "error": {
    "code": "MARKET_NOT_FOUND",
    "message": "Market 0x0000000000000000000000000000000000000000000000000000000000000000 not found",
    "details": null,
    "request_id": "f0e1d2c3-b4a5-4968-8728-1c0d1e2f3a4b"
  }
}