{"openapi":"3.0.0","info":{"contact":{},"description":"REST API for reading Morpho Blue and Midnight data. Private endpoints require an `x-api-key` header.","title":"Morpho Read API","version":"1.0"},"servers":[{"url":"https://api.morpho.org"}],"paths":{"/v0/blocks/{block-selector}/timestamp":{"get":{"description":"The hash and unix timestamp of a block, identified by its number on a given chain.","operationId":"BlockTimestampController_getTimestamp","parameters":[{"description":"Selector formatted as <chain_id>:<block_number>. Example: 1:19700000.","example":"1:19700000","in":"path","name":"block-selector","required":true,"schema":{"example":"1:19700000","format":"<chain_id>:<block_number>","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BlockTimestampResponse"}}},"description":""}},"summary":"Get block timestamp","tags":["Blocks"],"x-codeSamples":[{"label":"cURL","lang":"bash","source":"BASE_URL=\"${CORE_REST_BASE_URL:-https://api.morpho.org}\"\nMORPHO_API_KEY=\"<MORPHO_API_KEY>\"\nBLOCK_SELECTOR=\"<chain_id>:<block_number>\"\n\ncurl -sS \"${BASE_URL}/v0/blocks/${BLOCK_SELECTOR}/timestamp\" \\\n  -H \"accept: application/json\" \\\n  -H \"x-api-key: ${MORPHO_API_KEY}\"","id":"curl"},{"label":"JavaScript","lang":"js","source":"const baseUrl = process.env.CORE_REST_BASE_URL ?? \"https://api.morpho.org\";\nconst apiKey = process.env.MORPHO_API_KEY ?? \"<MORPHO_API_KEY>\";\nconst blockSelector = \"<chain_id>:<block_number>\";\n\nconst url = new URL(`${baseUrl}/v0/blocks/${blockSelector}/timestamp`);\n\nconst response = await fetch(url, {\n  headers: {\n    accept: \"application/json\",\n    \"x-api-key\": apiKey,\n  },\n});\nif (!response.ok) throw new Error(await response.text());\n\nconst body = await response.json();","id":"js"}]}},"/v0/blue/markets":{"get":{"description":"Cursor-paginated discovery list of indexed Morpho Blue markets. Rows and both sort orders use immutable market configuration from the indexer. Dynamic state is exposed by the single-market state endpoint.\n\n**Freshness.** The rows contain configuration only and may span multiple chains, so there is no single meaningful `last_indexed_block`. Use `GET /v0/chains` for per-chain indexer tips.","operationId":"MarketListController_list","parameters":[{"description":"Opaque pagination cursor.","in":"query","name":"cursor","required":false,"schema":{"type":"string"}},{"in":"query","name":"limit","required":false,"schema":{"default":100,"maximum":1000,"minimum":1,"type":"integer"}},{"description":"Filter to one or more EVM chain IDs.","in":"query","name":"chain_id","required":false,"schema":{"items":{"exclusiveMinimum":true,"maximum":9007199254740991,"minimum":0,"type":"integer"},"maxItems":100,"type":"array"}},{"description":"Filter to one or more loan token asset selectors formatted as <chain_id>:<address>.","in":"query","name":"loan_token","required":false,"schema":{"items":{"description":"Selector formatted as <chain_id>:<address>. Example: 8453:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913.","example":"8453:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","format":"<chain_id>:<address>","type":"string"},"maxItems":100,"type":"array"}},{"description":"Filter to one collateral token address.","in":"query","name":"collateral_token","required":false,"schema":{"type":"string"}},{"description":"Filter to one or more collateral token addresses.","in":"query","name":"collateral_tokens","required":false,"schema":{"items":{"type":"string"},"maxItems":100,"type":"array"}},{"description":"Filter to one or more market ids. Market ids are per chain, so combine with `chain_id` to target one chain.","in":"query","name":"market_id","required":false,"schema":{"items":{"type":"string"},"maxItems":100,"type":"array"}},{"description":"Minimum `lltv_wad` (1e18 = 100%).","in":"query","name":"lltv_wad_gte","required":false,"schema":{"pattern":"^\\d+$","type":"string"}},{"description":"Maximum `lltv_wad` (1e18 = 100%).","in":"query","name":"lltv_wad_lte","required":false,"schema":{"pattern":"^\\d+$","type":"string"}},{"description":"Sort key. `market_id` orders by `(chain_id, market_id)`; `lltv_wad` orders by immutable market configuration. Both break ties by `(chain_id, market_id)`.","in":"query","name":"sort_by","required":false,"schema":{"default":"market_id","enum":["market_id","lltv_wad"],"type":"string"}},{"description":"Sort direction. Defaults to `asc` for `market_id` and `desc` for every other key. `market_id` supports `asc` only.","in":"query","name":"sort_direction","required":false,"schema":{"enum":["asc","desc"],"type":"string"}},{"description":"Filter to markets present in Morpho's public registry (`true`) or absent from it (`false`).","in":"query","name":"listed","required":false,"schema":{"enum":["true","false"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketListResponse"}}},"description":"Cursor-paginated list of Morpho Blue markets."}},"summary":"List markets","tags":["Blue"],"x-codeSamples":[{"label":"cURL","lang":"bash","source":"BASE_URL=\"${CORE_REST_BASE_URL:-https://api.morpho.org}\"\nMORPHO_API_KEY=\"<MORPHO_API_KEY>\"\n\ncurl -sS \"${BASE_URL}/v0/blue/markets\" \\\n  -H \"accept: application/json\" \\\n  -H \"x-api-key: ${MORPHO_API_KEY}\"","id":"curl"},{"label":"JavaScript","lang":"js","source":"const baseUrl = process.env.CORE_REST_BASE_URL ?? \"https://api.morpho.org\";\nconst apiKey = process.env.MORPHO_API_KEY ?? \"<MORPHO_API_KEY>\";\n\nconst url = new URL(`${baseUrl}/v0/blue/markets`);\n\nconst response = await fetch(url, {\n  headers: {\n    accept: \"application/json\",\n    \"x-api-key\": apiKey,\n  },\n});\nif (!response.ok) throw new Error(await response.text());\n\nconst body = await response.json();","id":"js"}]}},"/v0/blue/markets/{market-selector}":{"get":{"description":"Morpho Blue market configuration: loan and collateral tokens, oracle, IRM, and liquidation LTV. Values are immutable for the lifetime of the market.","operationId":"MarketRootController_getRoot","parameters":[{"description":"Selector formatted as <chain_id>:<market_id>. Example: 1:0xfff1970c0ffae288764186fbb38a9171a17e98676744a1e345809cb8b9e73342.","example":"1:0xfff1970c0ffae288764186fbb38a9171a17e98676744a1e345809cb8b9e73342","in":"path","name":"market-selector","required":true,"schema":{"example":"1:0xfff1970c0ffae288764186fbb38a9171a17e98676744a1e345809cb8b9e73342","format":"<chain_id>:<market_id>","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketRootResponse"}}},"description":""}},"summary":"Get market","tags":["Blue"],"x-codeSamples":[{"label":"cURL","lang":"bash","source":"BASE_URL=\"${CORE_REST_BASE_URL:-https://api.morpho.org}\"\nMORPHO_API_KEY=\"<MORPHO_API_KEY>\"\nMARKET_SELECTOR=\"1:0xfff1970c0ffae288764186fbb38a9171a17e98676744a1e345809cb8b9e73342\"\n\ncurl -sS \"${BASE_URL}/v0/blue/markets/${MARKET_SELECTOR}\" \\\n  -H \"accept: application/json\" \\\n  -H \"x-api-key: ${MORPHO_API_KEY}\"","id":"curl"},{"label":"JavaScript","lang":"js","source":"const baseUrl = process.env.CORE_REST_BASE_URL ?? \"https://api.morpho.org\";\nconst apiKey = process.env.MORPHO_API_KEY ?? \"<MORPHO_API_KEY>\";\nconst marketSelector = \"1:0xfff1970c0ffae288764186fbb38a9171a17e98676744a1e345809cb8b9e73342\";\n\nconst url = new URL(`${baseUrl}/v0/blue/markets/${marketSelector}`);\n\nconst response = await fetch(url, {\n  headers: {\n    accept: \"application/json\",\n    \"x-api-key\": apiKey,\n  },\n});\nif (!response.ok) throw new Error(await response.text());\n\nconst body = await response.json();","id":"js"}]}},"/v0/blue/markets/{market-selector}/apy-averages":{"get":{"description":"Average supply and borrow APYs for a Morpho Blue market over fixed historical windows on the v0 REST API. Values exclude rewards.","operationId":"MarketApyAveragesController_getApyAverages","parameters":[{"description":"Selector formatted as <chain_id>:<market_id>. Example: 1:0xfff1970c0ffae288764186fbb38a9171a17e98676744a1e345809cb8b9e73342.","example":"1:0xfff1970c0ffae288764186fbb38a9171a17e98676744a1e345809cb8b9e73342","in":"path","name":"market-selector","required":true,"schema":{"example":"1:0xfff1970c0ffae288764186fbb38a9171a17e98676744a1e345809cb8b9e73342","format":"<chain_id>:<market_id>","type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"data":{"borrow_apy_averages":{"1y":0.0324,"24h":0.0421,"30d":0.0405,"6h":0.0425,"7d":0.0413,"90d":0.0398},"chain_id":1,"last_indexed_block":"19847234","market_id":"0xb1adceddb2941033a02dd819a3b9636a8c6f1cd1c2cd1add34e3c7b1f6c0fe25","supply_apy_averages":{"1y":0.0324,"24h":0.0421,"30d":0.0405,"6h":0.0425,"7d":0.0413,"90d":0.0398}}},"schema":{"$ref":"#/components/schemas/MarketApyAveragesResponseDto"}}},"description":""}},"summary":"Get market APY averages","tags":["Blue"],"x-codeSamples":[{"label":"cURL","lang":"bash","source":"BASE_URL=\"${CORE_REST_BASE_URL:-https://api.morpho.org}\"\nMORPHO_API_KEY=\"<MORPHO_API_KEY>\"\nMARKET_SELECTOR=\"1:0xfff1970c0ffae288764186fbb38a9171a17e98676744a1e345809cb8b9e73342\"\n\ncurl -sS \"${BASE_URL}/v0/blue/markets/${MARKET_SELECTOR}/apy-averages\" \\\n  -H \"accept: application/json\" \\\n  -H \"x-api-key: ${MORPHO_API_KEY}\"","id":"curl"},{"label":"JavaScript","lang":"js","source":"const baseUrl = process.env.CORE_REST_BASE_URL ?? \"https://api.morpho.org\";\nconst apiKey = process.env.MORPHO_API_KEY ?? \"<MORPHO_API_KEY>\";\nconst marketSelector = \"1:0xfff1970c0ffae288764186fbb38a9171a17e98676744a1e345809cb8b9e73342\";\n\nconst url = new URL(`${baseUrl}/v0/blue/markets/${marketSelector}/apy-averages`);\n\nconst response = await fetch(url, {\n  headers: {\n    accept: \"application/json\",\n    \"x-api-key\": apiKey,\n  },\n});\nif (!response.ok) throw new Error(await response.text());\n\nconst body = await response.json();","id":"js"}]}},"/v0/blue/markets/{market-selector}/apy/history":{"get":{"description":"Historical supply and borrow APYs for a Morpho Blue market. The APY averaging window is derived automatically from lookback: one_day and seven_days use one_day; thirty_days uses seven_days; ninety_days, one_year, and inception use thirty_days. six_hours selects a six-hour result range with hourly samples and a trailing six-hour APY averaging window; the range starts at the later of creation or six hours ago, with samples starting at the next top of hour. Points that do not have enough historical data for the derived window are omitted.","operationId":"MarketApyHistoryController_getApyHistory","parameters":[{"description":"Selector formatted as <chain_id>:<market_id>. Example: 1:0xfff1970c0ffae288764186fbb38a9171a17e98676744a1e345809cb8b9e73342.","example":"1:0xfff1970c0ffae288764186fbb38a9171a17e98676744a1e345809cb8b9e73342","in":"path","name":"market-selector","required":true,"schema":{"example":"1:0xfff1970c0ffae288764186fbb38a9171a17e98676744a1e345809cb8b9e73342","format":"<chain_id>:<market_id>","type":"string"}},{"description":"Lookback period. Defaults to thirty_days. Historical sampling is selected automatically. The APY averaging window is derived automatically from lookback: one_day and seven_days use one_day; thirty_days uses seven_days; ninety_days, one_year, and inception use thirty_days. six_hours selects a six-hour result range with hourly samples and a trailing six-hour APY averaging window; the range starts at the later of creation or six hours ago, with samples starting at the next top of hour. Points that do not have enough historical data for the derived window are omitted.","in":"query","name":"lookback","required":false,"schema":{"enum":["one_day","seven_days","thirty_days","ninety_days","one_year","inception","six_hours"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"data":[{"borrow_apy":0.0612,"supply_apy":0.0421,"timestamp":1729900800},{"borrow_apy":0.0608,"supply_apy":0.0418,"timestamp":1729987200}],"last_indexed_block":"19847234","params":{"chain_id":"1","market_id":"0xb323495f7e4148be5643a4ea4a8221eef163e4bccfded827a6f46947d7ad9afb"}},"schema":{"$ref":"#/components/schemas/MarketApyHistoryResponse"}}},"description":""}},"summary":"Get market APY history","tags":["Blue"],"x-codeSamples":[{"label":"cURL","lang":"bash","source":"BASE_URL=\"${CORE_REST_BASE_URL:-https://api.morpho.org}\"\nMORPHO_API_KEY=\"<MORPHO_API_KEY>\"\nMARKET_SELECTOR=\"1:0xfff1970c0ffae288764186fbb38a9171a17e98676744a1e345809cb8b9e73342\"\n\ncurl -sS \"${BASE_URL}/v0/blue/markets/${MARKET_SELECTOR}/apy/history?lookback=thirty_days\" \\\n  -H \"accept: application/json\" \\\n  -H \"x-api-key: ${MORPHO_API_KEY}\"","id":"curl"},{"label":"JavaScript","lang":"js","source":"const baseUrl = process.env.CORE_REST_BASE_URL ?? \"https://api.morpho.org\";\nconst apiKey = process.env.MORPHO_API_KEY ?? \"<MORPHO_API_KEY>\";\nconst marketSelector = \"1:0xfff1970c0ffae288764186fbb38a9171a17e98676744a1e345809cb8b9e73342\";\n\nconst url = new URL(`${baseUrl}/v0/blue/markets/${marketSelector}/apy/history`);\nurl.searchParams.set(\"lookback\", \"thirty_days\");\n\nconst response = await fetch(url, {\n  headers: {\n    accept: \"application/json\",\n    \"x-api-key\": apiKey,\n  },\n});\nif (!response.ok) throw new Error(await response.text());\n\nconst body = await response.json();","id":"js"}]}},"/v0/blue/markets/{market-selector}/liquidity":{"get":{"description":"Current Morpho Blue market liquidity and Public Allocator V2 reallocation capacity at one SDK simulation timestamp.","operationId":"MarketLiquidityController_getLiquidity","parameters":[{"description":"Selector formatted as <chain_id>:<market_id>. Example: 1:0xfff1970c0ffae288764186fbb38a9171a17e98676744a1e345809cb8b9e73342.","example":"1:0xfff1970c0ffae288764186fbb38a9171a17e98676744a1e345809cb8b9e73342","in":"path","name":"market-selector","required":true,"schema":{"example":"1:0xfff1970c0ffae288764186fbb38a9171a17e98676744a1e345809cb8b9e73342","format":"<chain_id>:<market_id>","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketLiquidityResponse"}}},"description":""}},"summary":"Get market liquidity","tags":["Blue"],"x-codeSamples":[{"label":"cURL","lang":"bash","source":"BASE_URL=\"${CORE_REST_BASE_URL:-https://api.morpho.org}\"\nMORPHO_API_KEY=\"<MORPHO_API_KEY>\"\nMARKET_SELECTOR=\"1:0xfff1970c0ffae288764186fbb38a9171a17e98676744a1e345809cb8b9e73342\"\n\ncurl -sS \"${BASE_URL}/v0/blue/markets/${MARKET_SELECTOR}/liquidity\" \\\n  -H \"accept: application/json\" \\\n  -H \"x-api-key: ${MORPHO_API_KEY}\"","id":"curl"},{"label":"JavaScript","lang":"js","source":"const baseUrl = process.env.CORE_REST_BASE_URL ?? \"https://api.morpho.org\";\nconst apiKey = process.env.MORPHO_API_KEY ?? \"<MORPHO_API_KEY>\";\nconst marketSelector = \"1:0xfff1970c0ffae288764186fbb38a9171a17e98676744a1e345809cb8b9e73342\";\n\nconst url = new URL(`${baseUrl}/v0/blue/markets/${marketSelector}/liquidity`);\n\nconst response = await fetch(url, {\n  headers: {\n    accept: \"application/json\",\n    \"x-api-key\": apiKey,\n  },\n});\nif (!response.ok) throw new Error(await response.text());\n\nconst body = await response.json();","id":"js"}]}},"/v0/blue/markets/{market-selector}/positions/health":{"get":{"description":"Cursor-paginated LTV of every position with debt in one listed Morpho Blue market, for polling liquidation risk.\n\n**Freshness.** `ltv_computed_at` is the LTV evaluation time, not the age of every input. The endpoint evaluates indexed balances with accrued market state and an oracle observation cached for up to five seconds; the market observation has its own block timestamp. Uninitialized inputs and required-read failures return 503. Responses are never cached.\n\n**Accuracy.** Debt is rounded down; positions whose debt rounds to zero are omitted. Threshold membership uses the indexed borrow-shares/collateral ratio, so a returned `ltv_wad` can be just below `ltv_wad_gte` after rounding. Re-check positions onchain before acting.\n\n**Pagination.** Each page uses current inputs; a walk can span updates. A position that starts matching before the cursor is seen on the next walk, not this one.\n\n**Coverage.** Listed markets only (404 otherwise). A known missing oracle price returns an empty page, not an error.","operationId":"MarketPositionsHealthController_getPositionsHealth","parameters":[{"description":"Selector formatted as <chain_id>:<market_id>. Example: 1:0xfff1970c0ffae288764186fbb38a9171a17e98676744a1e345809cb8b9e73342.","example":"1:0xfff1970c0ffae288764186fbb38a9171a17e98676744a1e345809cb8b9e73342","in":"path","name":"market-selector","required":true,"schema":{"example":"1:0xfff1970c0ffae288764186fbb38a9171a17e98676744a1e345809cb8b9e73342","format":"<chain_id>:<market_id>","type":"string"}},{"description":"Inclusive LTV threshold (1e18 = 100%). Membership is ratio-based; returned rounded `ltv_wad` can be just below this threshold. Omit to return every position with debt.","in":"query","name":"ltv_wad_gte","required":false,"schema":{"pattern":"^\\d{1,78}$","type":"string"}},{"description":"Maximum number of positions to return. Default 100, maximum 1000.","in":"query","name":"limit","required":false,"schema":{"default":100,"maximum":1000,"minimum":1,"type":"integer"}},{"description":"Opaque pagination cursor from the previous page. It is bound to the market and `ltv_wad_gte`.","in":"query","name":"cursor","required":false,"schema":{"maxLength":4096,"minLength":1,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketPositionsHealthResponse"}}},"description":""}},"summary":"Get market positions health","tags":["Blue"],"x-codeSamples":[{"label":"cURL","lang":"bash","source":"BASE_URL=\"${CORE_REST_BASE_URL:-https://private.api.morpho.org}\"\nMORPHO_API_KEY=\"<MORPHO_API_KEY>\"\nMARKET_SELECTOR=\"1:0xfff1970c0ffae288764186fbb38a9171a17e98676744a1e345809cb8b9e73342\"\n\ncurl -sS \"${BASE_URL}/v0/blue/markets/${MARKET_SELECTOR}/positions/health\" \\\n  -H \"accept: application/json\" \\\n  -H \"x-api-key: ${MORPHO_API_KEY}\"","id":"curl"},{"label":"JavaScript","lang":"js","source":"const baseUrl = process.env.CORE_REST_BASE_URL ?? \"https://private.api.morpho.org\";\nconst apiKey = process.env.MORPHO_API_KEY ?? \"<MORPHO_API_KEY>\";\nconst marketSelector = \"1:0xfff1970c0ffae288764186fbb38a9171a17e98676744a1e345809cb8b9e73342\";\n\nconst url = new URL(`${baseUrl}/v0/blue/markets/${marketSelector}/positions/health`);\n\nconst response = await fetch(url, {\n  headers: {\n    accept: \"application/json\",\n    \"x-api-key\": apiKey,\n  },\n});\nif (!response.ok) throw new Error(await response.text());\n\nconst body = await response.json();","id":"js"}],"x-morpho-private-only":true,"servers":[{"url":"https://private.api.morpho.org"}],"security":[{"ApiKeyAuth":[]}]}},"/v0/blue/markets/{market-selector}/public-allocator-vaults":{"get":{"description":"Public Allocator V2 candidates for a Morpho Blue market. Returns one row per vault and adapter candidate, without aggregation. Order is unspecified. Returns an empty list when the chain has no Public Allocator V2 deployment or no candidates exist.","operationId":"getBlueMarketPublicAllocatorVaults","parameters":[{"description":"Selector formatted as <chain_id>:<market_id>. Example: 1:0xfff1970c0ffae288764186fbb38a9171a17e98676744a1e345809cb8b9e73342.","example":"1:0xfff1970c0ffae288764186fbb38a9171a17e98676744a1e345809cb8b9e73342","in":"path","name":"market-selector","required":true,"schema":{"example":"1:0xfff1970c0ffae288764186fbb38a9171a17e98676744a1e345809cb8b9e73342","format":"<chain_id>:<market_id>","type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"data":[{"absolute_cap":"1000000000","adapter_address":"0x2222222222222222222222222222222222222222","can_pull_from_idle":false,"can_pull_from_market":true,"cap_id":"0x3333333333333333333333333333333333333333333333333333333333333333","penalty_wad":"10000000000000000","public_allocator_address":"0x4444444444444444444444444444444444444444","vault_address":"0x1111111111111111111111111111111111111111"}],"last_indexed_block":"19847234"},"schema":{"$ref":"#/components/schemas/MarketPublicAllocatorVaultsResponse"}}},"description":""},"404":{"description":"Market not found"}},"summary":"Get Public Allocator V2 candidate vaults","tags":["Blue"],"x-codeSamples":[{"label":"cURL","lang":"bash","source":"BASE_URL=\"${CORE_REST_BASE_URL:-https://api.morpho.org}\"\nMORPHO_API_KEY=\"<MORPHO_API_KEY>\"\nMARKET_SELECTOR=\"1:0xfff1970c0ffae288764186fbb38a9171a17e98676744a1e345809cb8b9e73342\"\n\ncurl -sS \"${BASE_URL}/v0/blue/markets/${MARKET_SELECTOR}/public-allocator-vaults\" \\\n  -H \"accept: application/json\" \\\n  -H \"x-api-key: ${MORPHO_API_KEY}\"","id":"curl"},{"label":"JavaScript","lang":"js","source":"const baseUrl = process.env.CORE_REST_BASE_URL ?? \"https://api.morpho.org\";\nconst apiKey = process.env.MORPHO_API_KEY ?? \"<MORPHO_API_KEY>\";\nconst marketSelector = \"1:0xfff1970c0ffae288764186fbb38a9171a17e98676744a1e345809cb8b9e73342\";\n\nconst url = new URL(`${baseUrl}/v0/blue/markets/${marketSelector}/public-allocator-vaults`);\n\nconst response = await fetch(url, {\n  headers: {\n    accept: \"application/json\",\n    \"x-api-key\": apiKey,\n  },\n});\nif (!response.ok) throw new Error(await response.text());\n\nconst body = await response.json();","id":"js"}]}},"/v0/blue/markets/{market-selector}/state":{"get":{"description":"Live state of a Morpho Blue market: total supply and borrow assets, shares, fee, and AdaptiveCurveIRM rate at target.","operationId":"MarketStateController_getState","parameters":[{"description":"Selector formatted as <chain_id>:<market_id>. Example: 1:0xfff1970c0ffae288764186fbb38a9171a17e98676744a1e345809cb8b9e73342.","example":"1:0xfff1970c0ffae288764186fbb38a9171a17e98676744a1e345809cb8b9e73342","in":"path","name":"market-selector","required":true,"schema":{"example":"1:0xfff1970c0ffae288764186fbb38a9171a17e98676744a1e345809cb8b9e73342","format":"<chain_id>:<market_id>","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketStateResponse"}}},"description":""}},"summary":"Get market state","tags":["Blue"],"x-codeSamples":[{"label":"cURL","lang":"bash","source":"BASE_URL=\"${CORE_REST_BASE_URL:-https://api.morpho.org}\"\nMORPHO_API_KEY=\"<MORPHO_API_KEY>\"\nMARKET_SELECTOR=\"1:0xfff1970c0ffae288764186fbb38a9171a17e98676744a1e345809cb8b9e73342\"\n\ncurl -sS \"${BASE_URL}/v0/blue/markets/${MARKET_SELECTOR}/state\" \\\n  -H \"accept: application/json\" \\\n  -H \"x-api-key: ${MORPHO_API_KEY}\"","id":"curl"},{"label":"JavaScript","lang":"js","source":"const baseUrl = process.env.CORE_REST_BASE_URL ?? \"https://api.morpho.org\";\nconst apiKey = process.env.MORPHO_API_KEY ?? \"<MORPHO_API_KEY>\";\nconst marketSelector = \"1:0xfff1970c0ffae288764186fbb38a9171a17e98676744a1e345809cb8b9e73342\";\n\nconst url = new URL(`${baseUrl}/v0/blue/markets/${marketSelector}/state`);\n\nconst response = await fetch(url, {\n  headers: {\n    accept: \"application/json\",\n    \"x-api-key\": apiKey,\n  },\n});\nif (!response.ok) throw new Error(await response.text());\n\nconst body = await response.json();","id":"js"}]}},"/v0/blue/markets/{market-selector}/state/history":{"get":{"description":"Historical state of a Morpho Blue market: total supply and borrow assets and shares, and total collateral assets.","operationId":"MarketStateHistoryController_getStateHistory","parameters":[{"description":"Selector formatted as <chain_id>:<market_id>. Example: 1:0xfff1970c0ffae288764186fbb38a9171a17e98676744a1e345809cb8b9e73342.","example":"1:0xfff1970c0ffae288764186fbb38a9171a17e98676744a1e345809cb8b9e73342","in":"path","name":"market-selector","required":true,"schema":{"example":"1:0xfff1970c0ffae288764186fbb38a9171a17e98676744a1e345809cb8b9e73342","format":"<chain_id>:<market_id>","type":"string"}},{"description":"Lookback period. Defaults to thirty_days. Historical sampling is selected automatically.","in":"query","name":"lookback","required":false,"schema":{"enum":["one_day","seven_days","thirty_days","ninety_days","one_year","inception"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"data":[{"timestamp":1729900800,"total_borrow_assets":"84200000000000","total_borrow_shares":"83500000000000000000","total_collateral_assets":"41500000000000000000000","total_supply_assets":"119800000000000","total_supply_shares":"118300000000000000000"},{"timestamp":1729987200,"total_borrow_assets":"85000000000000","total_borrow_shares":"84200000000000000000","total_collateral_assets":"42000000000000000000000","total_supply_assets":"120500000000000","total_supply_shares":"118900000000000000000"}],"last_indexed_block":"19847234","params":{"chain_id":"1","market_id":"0xb323495f7e4148be5643a4ea4a8221eef163e4bccfded827a6f46947d7ad9afb"}},"schema":{"$ref":"#/components/schemas/MarketStateHistoryResponse"}}},"description":""}},"summary":"Get market state history","tags":["Blue"],"x-codeSamples":[{"label":"cURL","lang":"bash","source":"BASE_URL=\"${CORE_REST_BASE_URL:-https://api.morpho.org}\"\nMORPHO_API_KEY=\"<MORPHO_API_KEY>\"\nMARKET_SELECTOR=\"1:0xfff1970c0ffae288764186fbb38a9171a17e98676744a1e345809cb8b9e73342\"\n\ncurl -sS \"${BASE_URL}/v0/blue/markets/${MARKET_SELECTOR}/state/history?lookback=thirty_days\" \\\n  -H \"accept: application/json\" \\\n  -H \"x-api-key: ${MORPHO_API_KEY}\"","id":"curl"},{"label":"JavaScript","lang":"js","source":"const baseUrl = process.env.CORE_REST_BASE_URL ?? \"https://api.morpho.org\";\nconst apiKey = process.env.MORPHO_API_KEY ?? \"<MORPHO_API_KEY>\";\nconst marketSelector = \"1:0xfff1970c0ffae288764186fbb38a9171a17e98676744a1e345809cb8b9e73342\";\n\nconst url = new URL(`${baseUrl}/v0/blue/markets/${marketSelector}/state/history`);\nurl.searchParams.set(\"lookback\", \"thirty_days\");\n\nconst response = await fetch(url, {\n  headers: {\n    accept: \"application/json\",\n    \"x-api-key\": apiKey,\n  },\n});\nif (!response.ok) throw new Error(await response.text());\n\nconst body = await response.json();","id":"js"}]}},"/v0/blue/markets/{market-selector}/users/{user-address}/position":{"get":{"description":"A user's live position in a Morpho Blue market: collateral deposited, supply shares, and borrow shares.","operationId":"UserMarketPositionController_getPosition","parameters":[{"description":"Position owner address. Example: 0x0774b5B15B0CEe5E2e14814CCF4d4611fF78CcF5.","example":"0x0774b5B15B0CEe5E2e14814CCF4d4611fF78CcF5","in":"path","name":"user-address","required":true,"schema":{"example":"0x0774b5B15B0CEe5E2e14814CCF4d4611fF78CcF5","format":"address","type":"string"}},{"description":"Selector formatted as <chain_id>:<market_id>. Example: 1:0x15bb2a6af0c909eed19fb1f2ceeead34ecbdcba626de752c6b09389ee14eec32.","example":"1:0x15bb2a6af0c909eed19fb1f2ceeead34ecbdcba626de752c6b09389ee14eec32","in":"path","name":"market-selector","required":true,"schema":{"example":"1:0x15bb2a6af0c909eed19fb1f2ceeead34ecbdcba626de752c6b09389ee14eec32","format":"<chain_id>:<market_id>","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserMarketPositionResponse"}}},"description":""},"404":{"description":"The selected market does not exist on this chain."}},"summary":"User market position","tags":["Blue"],"x-codeSamples":[{"label":"cURL","lang":"bash","source":"BASE_URL=\"${CORE_REST_BASE_URL:-https://api.morpho.org}\"\nMORPHO_API_KEY=\"<MORPHO_API_KEY>\"\nMARKET_SELECTOR=\"1:0x15bb2a6af0c909eed19fb1f2ceeead34ecbdcba626de752c6b09389ee14eec32\"\nUSER_ADDRESS=\"0x0774b5B15B0CEe5E2e14814CCF4d4611fF78CcF5\"\n\ncurl -sS \"${BASE_URL}/v0/blue/markets/${MARKET_SELECTOR}/users/${USER_ADDRESS}/position\" \\\n  -H \"accept: application/json\" \\\n  -H \"x-api-key: ${MORPHO_API_KEY}\"","id":"curl"},{"label":"JavaScript","lang":"js","source":"const baseUrl = process.env.CORE_REST_BASE_URL ?? \"https://api.morpho.org\";\nconst apiKey = process.env.MORPHO_API_KEY ?? \"<MORPHO_API_KEY>\";\nconst marketSelector = \"1:0x15bb2a6af0c909eed19fb1f2ceeead34ecbdcba626de752c6b09389ee14eec32\";\nconst userAddress = \"0x0774b5B15B0CEe5E2e14814CCF4d4611fF78CcF5\";\n\nconst url = new URL(`${baseUrl}/v0/blue/markets/${marketSelector}/users/${userAddress}/position`);\n\nconst response = await fetch(url, {\n  headers: {\n    accept: \"application/json\",\n    \"x-api-key\": apiKey,\n  },\n});\nif (!response.ok) throw new Error(await response.text());\n\nconst body = await response.json();","id":"js"}]}},"/v0/blue/markets/{market-selector}/users/{user-address}/position/history":{"get":{"description":"A user's historical position in a Morpho Blue market: collateral deposited, supply shares, and borrow shares.","operationId":"UserMarketPositionHistoryController_getPositionHistory","parameters":[{"description":"Position owner address. Example: 0xabcdefabcdefabcdefabcdefabcdefabcdefabcd.","example":"0xabcdefabcdefabcdefabcdefabcdefabcdefabcd","in":"path","name":"user-address","required":true,"schema":{"example":"0xabcdefabcdefabcdefabcdefabcdefabcdefabcd","format":"address","type":"string"}},{"description":"Selector formatted as <chain_id>:<market_id>. Example: 1:0xfff1970c0ffae288764186fbb38a9171a17e98676744a1e345809cb8b9e73342.","example":"1:0xfff1970c0ffae288764186fbb38a9171a17e98676744a1e345809cb8b9e73342","in":"path","name":"market-selector","required":true,"schema":{"example":"1:0xfff1970c0ffae288764186fbb38a9171a17e98676744a1e345809cb8b9e73342","format":"<chain_id>:<market_id>","type":"string"}},{"description":"Lookback period. Defaults to thirty_days. Historical sampling is selected automatically.","in":"query","name":"lookback","required":false,"schema":{"enum":["one_day","seven_days","thirty_days","ninety_days","one_year","inception"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"data":[{"borrow_shares":"300000000000000000","collateral_assets":"1000000000000000000","supply_shares":"2000000000000000000","timestamp":1729900800},{"borrow_shares":"250000000000000000","collateral_assets":"1100000000000000000","supply_shares":"2000000000000000000","timestamp":1729987200}],"last_indexed_block":"19847234","params":{"chain_id":"1","market_id":"0xb323495f7e4148be5643a4ea4a8221eef163e4bccfded827a6f46947d7ad9afb","user_address":"0x0000000000000000000000000000000000000001"}},"schema":{"$ref":"#/components/schemas/UserMarketPositionHistoryResponse"}}},"description":""}},"summary":"User market position history","tags":["Blue"],"x-codeSamples":[{"label":"cURL","lang":"bash","source":"BASE_URL=\"${CORE_REST_BASE_URL:-https://api.morpho.org}\"\nMORPHO_API_KEY=\"<MORPHO_API_KEY>\"\nMARKET_SELECTOR=\"1:0xfff1970c0ffae288764186fbb38a9171a17e98676744a1e345809cb8b9e73342\"\nUSER_ADDRESS=\"0xabcdefabcdefabcdefabcdefabcdefabcdefabcd\"\n\ncurl -sS \"${BASE_URL}/v0/blue/markets/${MARKET_SELECTOR}/users/${USER_ADDRESS}/position/history?lookback=thirty_days\" \\\n  -H \"accept: application/json\" \\\n  -H \"x-api-key: ${MORPHO_API_KEY}\"","id":"curl"},{"label":"JavaScript","lang":"js","source":"const baseUrl = process.env.CORE_REST_BASE_URL ?? \"https://api.morpho.org\";\nconst apiKey = process.env.MORPHO_API_KEY ?? \"<MORPHO_API_KEY>\";\nconst marketSelector = \"1:0xfff1970c0ffae288764186fbb38a9171a17e98676744a1e345809cb8b9e73342\";\nconst userAddress = \"0xabcdefabcdefabcdefabcdefabcdefabcdefabcd\";\n\nconst url = new URL(`${baseUrl}/v0/blue/markets/${marketSelector}/users/${userAddress}/position/history`);\nurl.searchParams.set(\"lookback\", \"thirty_days\");\n\nconst response = await fetch(url, {\n  headers: {\n    accept: \"application/json\",\n    \"x-api-key\": apiKey,\n  },\n});\nif (!response.ok) throw new Error(await response.text());\n\nconst body = await response.json();","id":"js"}]}},"/v0/blue/markets/{market-selector}/users/{user-address}/position/performance":{"get":{"description":"Average-cost realized and unrealized Morpho Blue supply earnings and borrow costs. External rewards are excluded.","operationId":"UserMarketPositionPerformanceController_getPerformance","parameters":[{"description":"Position owner address. Example: 0xabcdefabcdefabcdefabcdefabcdefabcdefabcd.","example":"0xabcdefabcdefabcdefabcdefabcdefabcdefabcd","in":"path","name":"user-address","required":true,"schema":{"example":"0xabcdefabcdefabcdefabcdefabcdefabcdefabcd","format":"address","type":"string"}},{"description":"Selector formatted as <chain_id>:<market_id>. Example: 1:0xfff1970c0ffae288764186fbb38a9171a17e98676744a1e345809cb8b9e73342.","example":"1:0xfff1970c0ffae288764186fbb38a9171a17e98676744a1e345809cb8b9e73342","in":"path","name":"market-selector","required":true,"schema":{"example":"1:0xfff1970c0ffae288764186fbb38a9171a17e98676744a1e345809cb8b9e73342","format":"<chain_id>:<market_id>","type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"data":{"accounting_method":"average_cost","borrow_cost_on_capital":0.00969,"borrow_net_cost_assets":"82354123","chain_id":1,"last_indexed_block":"19847234","market_id":"0xb1adceddb2941033a02dd819a3b9636a8c6f1cd1c2cd1add34e3c7b1f6c0fe25","supply_net_earnings_assets":"1124530000","supply_return_on_capital":0.02249,"user_address":"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"}},"schema":{"$ref":"#/components/schemas/UserMarketPositionPerformanceResponse"}}},"description":""}},"summary":"User market position performance","tags":["Blue"],"x-codeSamples":[{"label":"cURL","lang":"bash","source":"BASE_URL=\"${CORE_REST_BASE_URL:-https://api.morpho.org}\"\nMORPHO_API_KEY=\"<MORPHO_API_KEY>\"\nMARKET_SELECTOR=\"1:0xfff1970c0ffae288764186fbb38a9171a17e98676744a1e345809cb8b9e73342\"\nUSER_ADDRESS=\"0xabcdefabcdefabcdefabcdefabcdefabcdefabcd\"\n\ncurl -sS \"${BASE_URL}/v0/blue/markets/${MARKET_SELECTOR}/users/${USER_ADDRESS}/position/performance\" \\\n  -H \"accept: application/json\" \\\n  -H \"x-api-key: ${MORPHO_API_KEY}\"","id":"curl"},{"label":"JavaScript","lang":"js","source":"const baseUrl = process.env.CORE_REST_BASE_URL ?? \"https://api.morpho.org\";\nconst apiKey = process.env.MORPHO_API_KEY ?? \"<MORPHO_API_KEY>\";\nconst marketSelector = \"1:0xfff1970c0ffae288764186fbb38a9171a17e98676744a1e345809cb8b9e73342\";\nconst userAddress = \"0xabcdefabcdefabcdefabcdefabcdefabcdefabcd\";\n\nconst url = new URL(`${baseUrl}/v0/blue/markets/${marketSelector}/users/${userAddress}/position/performance`);\n\nconst response = await fetch(url, {\n  headers: {\n    accept: \"application/json\",\n    \"x-api-key\": apiKey,\n  },\n});\nif (!response.ok) throw new Error(await response.text());\n\nconst body = await response.json();","id":"js"}]}},"/v0/blue/markets/{market-selector}/vaults":{"get":{"description":"Factual relationship lookup of Vault V1 and V2 vaults currently configured for or holding a position in this Blue market. Not filtered by vault listing; a vault may appear with zero supplied assets. Does not compute reallocatable liquidity or Public Allocator eligibility. Discovery describes configuration, not allocatability. A latest positive V2 relative cap is a relationship even when the absolute cap and allocation are zero. A vault that sets its absolute cap to zero but leaves its relative cap positive remains listed until the relative cap is also cleared. Deterministic ordering: (version ASC, chain_id ASC, vault_address ASC), with 1.0 before 2.0, chain_id constant for this market, and addresses ordered by address value (lowercase hex), not checksum letter case. Cursor pagination is opaque and bound to this market. A known market with no relationships returns 200 with data: [] and cursor: null. SLA tier: T2 config.","operationId":"getBlueMarketVaults","parameters":[{"description":"Selector formatted as <chain_id>:<market_id>. Example: 1:0xfff1970c0ffae288764186fbb38a9171a17e98676744a1e345809cb8b9e73342.","example":"1:0xfff1970c0ffae288764186fbb38a9171a17e98676744a1e345809cb8b9e73342","in":"path","name":"market-selector","required":true,"schema":{"example":"1:0xfff1970c0ffae288764186fbb38a9171a17e98676744a1e345809cb8b9e73342","format":"<chain_id>:<market_id>","type":"string"}},{"in":"query","name":"limit","required":false,"schema":{"default":100,"maximum":1000,"minimum":1,"type":"integer"}},{"description":"Opaque cursor bound to this market.","in":"query","name":"cursor","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketVaultsResponse"}}},"description":"Vault relationships, or data: [] and cursor: null for a known market with no relationships."},"400":{"description":"Invalid selector, query or cursor"},"404":{"description":"Market not found"}},"summary":"List vaults configured for or holding a position in a market","tags":["Blue"],"x-codeSamples":[{"label":"cURL","lang":"bash","source":"BASE_URL=\"${CORE_REST_BASE_URL:-https://private.api.morpho.org}\"\nMORPHO_API_KEY=\"<MORPHO_API_KEY>\"\nMARKET_SELECTOR=\"1:0xfff1970c0ffae288764186fbb38a9171a17e98676744a1e345809cb8b9e73342\"\n\ncurl -sS \"${BASE_URL}/v0/blue/markets/${MARKET_SELECTOR}/vaults\" \\\n  -H \"accept: application/json\" \\\n  -H \"x-api-key: ${MORPHO_API_KEY}\"","id":"curl"},{"label":"JavaScript","lang":"js","source":"const baseUrl = process.env.CORE_REST_BASE_URL ?? \"https://private.api.morpho.org\";\nconst apiKey = process.env.MORPHO_API_KEY ?? \"<MORPHO_API_KEY>\";\nconst marketSelector = \"1:0xfff1970c0ffae288764186fbb38a9171a17e98676744a1e345809cb8b9e73342\";\n\nconst url = new URL(`${baseUrl}/v0/blue/markets/${marketSelector}/vaults`);\n\nconst response = await fetch(url, {\n  headers: {\n    accept: \"application/json\",\n    \"x-api-key\": apiKey,\n  },\n});\nif (!response.ok) throw new Error(await response.text());\n\nconst body = await response.json();","id":"js"}],"x-morpho-private-only":true,"servers":[{"url":"https://private.api.morpho.org"}],"security":[{"ApiKeyAuth":[]}]}},"/v0/blue/users/{user-address}/positions":{"get":{"description":"Cursor-paginated list of a user's Morpho Blue market positions across exposed chains, one row per market the realtime position store holds for the user, listed or unlisted. By default (`active_only=true`), only positions with non-zero supply shares, borrow shares or collateral are returned. With `active_only=false`, positions the user has fully exited are also returned, with zero balances. Positions in blacklisted markets are removed from the store and never returned. Results can be filtered with chain_ids and market_ids. Pagination is weakly consistent and not snapshot-isolated: continuation pages re-evaluate realtime state, so changes to balances, active status or membership may omit or repeat rows. The response does not carry an indexed block.","operationId":"UserMarketPositionListController_list","parameters":[{"description":"User address to list positions for. Lowercase input is checksummed. Example: 0xabcdefabcdefabcdefabcdefabcdefabcdefabcd.","example":"0xabcdefabcdefabcdefabcdefabcdefabcdefabcd","in":"path","name":"user-address","required":true,"schema":{"example":"0xabcdefabcdefabcdefabcdefabcdefabcdefabcd","format":"address","type":"string"}},{"description":"Comma-separated EVM chain identifiers to filter on. Defaults to every exposed chain.","in":"query","name":"chain_ids","required":false,"schema":{"items":{"enum":[1,8453,747474,999,42161,137,130,10,480,143,988,4217,4663,5042,196],"exclusiveMinimum":true,"maximum":9007199254740991,"minimum":0,"type":"integer"},"maxItems":100,"type":"array"},"style":"form","explode":false},{"description":"Comma-separated Morpho Blue market identifiers to filter on.","in":"query","name":"market_ids","required":false,"schema":{"items":{"type":"string"},"maxItems":100,"type":"array"},"style":"form","explode":false},{"description":"When true (default), excludes positions with zero supply shares, borrow shares, and collateral assets. When false, also returns fully exited positions with zero balances.","in":"query","name":"active_only","required":false,"schema":{"default":"true","enum":["true","false"],"type":"string"}},{"description":"Sort field for cursor pagination.","in":"query","name":"sort_by","required":false,"schema":{"default":"market_id","enum":["market_id","supply_shares","borrow_shares","collateral_assets"],"type":"string"}},{"description":"Sort direction.","in":"query","name":"sort_direction","required":false,"schema":{"default":"desc","enum":["asc","desc"],"type":"string"}},{"description":"Maximum number of positions to return.","in":"query","name":"limit","required":false,"schema":{"default":100,"maximum":100,"minimum":1,"type":"integer"}},{"description":"Opaque cursor returned by a previous page. Encodes the sort field, sort direction, user address and filter set; changing any of them invalidates it. Do not parse it.","in":"query","name":"cursor","required":false,"schema":{"maxLength":4096,"minLength":1,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"cursor":null,"data":[{"borrow_shares":"45000000000000000000000","chain_id":1,"collateral_assets":"12500000000000000000","market_id":"0xfff1970c0ffae288764186fbb38a9171a17e98676744a1e345809cb8b9e73342","supply_shares":"0"}],"params":{"user_address":"0xabcdefabcdefabcdefabcdefabcdefabcdefabcd"}},"schema":{"$ref":"#/components/schemas/UserMarketPositionsResponse"}}},"description":""}},"summary":"List user Blue positions","tags":["Blue"],"x-codeSamples":[{"label":"cURL","lang":"bash","source":"BASE_URL=\"${CORE_REST_BASE_URL:-https://api.morpho.org}\"\nMORPHO_API_KEY=\"<MORPHO_API_KEY>\"\nUSER_ADDRESS=\"0xabcdefabcdefabcdefabcdefabcdefabcdefabcd\"\n\ncurl -sS \"${BASE_URL}/v0/blue/users/${USER_ADDRESS}/positions\" \\\n  -H \"accept: application/json\" \\\n  -H \"x-api-key: ${MORPHO_API_KEY}\"","id":"curl"},{"label":"JavaScript","lang":"js","source":"const baseUrl = process.env.CORE_REST_BASE_URL ?? \"https://api.morpho.org\";\nconst apiKey = process.env.MORPHO_API_KEY ?? \"<MORPHO_API_KEY>\";\nconst userAddress = \"0xabcdefabcdefabcdefabcdefabcdefabcdefabcd\";\n\nconst url = new URL(`${baseUrl}/v0/blue/users/${userAddress}/positions`);\n\nconst response = await fetch(url, {\n  headers: {\n    accept: \"application/json\",\n    \"x-api-key\": apiKey,\n  },\n});\nif (!response.ok) throw new Error(await response.text());\n\nconst body = await response.json();","id":"js"}]}},"/v0/chains":{"get":{"description":"Fully supported EVM chains exposed by the Core REST API, with the chain id, network name, the protocols deployed on the chain, and the last block fully processed by all realtime service jobs for the chain.","operationId":"ChainsController_getChains","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChainsResponse"}}},"description":""}},"summary":"Get chains","tags":["Chains"],"x-codeSamples":[{"label":"cURL","lang":"bash","source":"BASE_URL=\"${CORE_REST_BASE_URL:-https://api.morpho.org}\"\nMORPHO_API_KEY=\"<MORPHO_API_KEY>\"\n\ncurl -sS \"${BASE_URL}/v0/chains\" \\\n  -H \"accept: application/json\" \\\n  -H \"x-api-key: ${MORPHO_API_KEY}\"","id":"curl"},{"label":"JavaScript","lang":"js","source":"const baseUrl = process.env.CORE_REST_BASE_URL ?? \"https://api.morpho.org\";\nconst apiKey = process.env.MORPHO_API_KEY ?? \"<MORPHO_API_KEY>\";\n\nconst url = new URL(`${baseUrl}/v0/chains`);\n\nconst response = await fetch(url, {\n  headers: {\n    accept: \"application/json\",\n    \"x-api-key\": apiKey,\n  },\n});\nif (!response.ok) throw new Error(await response.text());\n\nconst body = await response.json();","id":"js"}]}},"/v0/curators":{"get":{"description":"Cursor-paginated list of curator identities from Morpho's curator registry, `morpho-org/morpho-blue-api-metadata/data/curators-listing.json`, the same source as `GET /v0/curators/{curator-selector}/details`. Use it to discover curators before you know a curator address; each item groups the curator's registered addresses across chains.\n\n**Global registry metadata, not on-chain facts.** `curator_id`, `name`, `image_url` and `verified` are editorial values Morpho maintains in the registry. They are an explicit exception to Core's facts-only rule, like the details route. `verified` is Morpho's registry flag, not an on-chain property, and a registry address is not proof that it holds a curator role on any vault.\n\n**Membership.** A curator is listed when it has at least one registered address on a chain in `chain_ids` (default: every chain Core exposes). Unverified curators are included unless `verified=true`. `addresses` always lists the curator's addresses on every exposed chain, so filtering by chain does not split an identity.\n\n**Not here.** Socials are on the details route. AUM, rankings and other provider-dependent data are not part of this route.\n\n**Pagination.** Items are sorted by `curator_id`. Pass `cursor` back verbatim on the next call; a `null` cursor means the last page. The cursor is bound to the filter set that produced it, so changing filters is a 400. Pages are offsets into the live registry, so a registry change between calls can shift items across pages.\n\n**Freshness.** The registry syncs about every five minutes, lookups are cached for up to five minutes, and responses may be CDN-cached for up to five minutes.","operationId":"getCurators","parameters":[{"description":"Only curators whose registry `verified` flag matches. Omit to list verified and unverified curators.","in":"query","name":"verified","required":false,"schema":{"enum":["true","false"],"type":"string"}},{"description":"Only curators with at least one registered address on these chains. Defaults to every chain Core exposes.","in":"query","name":"chain_ids","required":false,"schema":{"items":{"enum":[1,8453,747474,999,42161,137,130,10,480,143,988,4217,4663,5042,196],"exclusiveMinimum":true,"maximum":9007199254740991,"minimum":0,"type":"integer"},"maxItems":100,"type":"array"}},{"description":"Maximum number of curators to return.","in":"query","name":"limit","required":false,"schema":{"default":100,"maximum":1000,"minimum":1,"type":"integer"}},{"description":"Opaque cursor from a previous page response. Bound to the filter set that produced it.","in":"query","name":"cursor","required":false,"schema":{"maxLength":4096,"minLength":1,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"cursor":null,"data":[{"addresses":[{"chain_id":1,"curator_address":"0x827e86072B06674a077f592A531dcE4590aDeCdB"},{"chain_id":8453,"curator_address":"0x0A0e559bc3b0950a7e448F0d4894db195b9cf8DD"}],"curator_id":"steakhouse-financial","image_url":"https://cdn.morpho.org/v2/assets/images/steakhouse.svg","name":"Steakhouse Financial","verified":true}]},"schema":{"$ref":"#/components/schemas/CoreCuratorListResponse"}}},"description":""},"400":{"description":"Malformed or replayed cursor (`INVALID_CURSOR`), an unsupported or hidden chain id, a bad `limit`, or a non-boolean `verified`."}},"summary":"List curators","tags":["Curators"],"x-codeSamples":[{"label":"cURL","lang":"bash","source":"BASE_URL=\"${CORE_REST_BASE_URL:-https://api.morpho.org}\"\nMORPHO_API_KEY=\"<MORPHO_API_KEY>\"\n\ncurl -sS \"${BASE_URL}/v0/curators\" \\\n  -H \"accept: application/json\" \\\n  -H \"x-api-key: ${MORPHO_API_KEY}\"","id":"curl"},{"label":"JavaScript","lang":"js","source":"const baseUrl = process.env.CORE_REST_BASE_URL ?? \"https://api.morpho.org\";\nconst apiKey = process.env.MORPHO_API_KEY ?? \"<MORPHO_API_KEY>\";\n\nconst url = new URL(`${baseUrl}/v0/curators`);\n\nconst response = await fetch(url, {\n  headers: {\n    accept: \"application/json\",\n    \"x-api-key\": apiKey,\n  },\n});\nif (!response.ok) throw new Error(await response.text());\n\nconst body = await response.json();","id":"js"}]}},"/v0/curators/{curator-selector}/details":{"get":{"description":"Resolve curator details using the selector `<chain_id>:<curator_address>`, where the address is the vault's on-chain `curator` role. This joins directly from Core Vault V1 and V2 responses, which remain unchanged and expose the address only.\n\n`name`, `logo_uri`, and `socials` are editorial metadata from Morpho's curator registry, `morpho-org/morpho-blue-api-metadata/data/curators-listing.json`, not on-chain facts. This is an explicit exception to Core's facts-only rule. The registry syncs about every five minutes, lookups are cached for up to five minutes, and responses may be CDN-cached for up to five minutes, so a registry change can take up to about fifteen minutes to appear.\n\nResults are every curator registry profile registered to the supplied chain and address. They are registry matches, not a verified or vault-scoped attribution: they can include unverified profiles and owner-only profiles, which the response does not distinguish. GraphQL `Vault.state.curators` / `VaultV2.curators` resolve curators per vault instead: they return none unless the vault was ever listed and its owner address has a registry profile, combine the owner's and curator's profiles, drop owner-only profiles, and fall back to the underlying V1 vault for a V2 fee wrapper. This route alone does not reproduce those vault-scoped results.\n\nA 404 means the selected chain is unsupported or not exposed by Core.","operationId":"getCuratorDetails","parameters":[{"description":"Selector formatted as <chain_id>:<curator_address>. Example: 1:0x827e86072B06674a077f592A531dcE4590aDeCdB.","example":"1:0x827e86072B06674a077f592A531dcE4590aDeCdB","in":"path","name":"curator-selector","required":true,"schema":{"example":"1:0x827e86072B06674a077f592A531dcE4590aDeCdB","format":"<chain_id>:<curator_address>","type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"data":{"chain_id":1,"curator_address":"0x827e86072B06674a077f592A531dcE4590aDeCdB","curators":[{"id":"steakhouse-financial","logo_uri":"https://cdn.morpho.org/v2/assets/images/steakhouse.svg","name":"Steakhouse Financial","socials":[{"type":"url","url":"https://www.steakhouse.financial"}]}]}},"schema":{"$ref":"#/components/schemas/CoreCuratorDetailsResponse"}}},"description":"Curator profiles registered to the selected chain and address; `curators` may be empty or hold several profiles when registry entries share an address."},"404":{"description":"The selected chain is unsupported or not exposed by Core."}},"summary":"Get curator details","tags":["Curators"],"x-codeSamples":[{"label":"cURL","lang":"bash","source":"BASE_URL=\"${CORE_REST_BASE_URL:-https://api.morpho.org}\"\nMORPHO_API_KEY=\"<MORPHO_API_KEY>\"\nCURATOR_SELECTOR=\"<chain_id>:<curator_address>\"\n\ncurl -sS \"${BASE_URL}/v0/curators/${CURATOR_SELECTOR}/details\" \\\n  -H \"accept: application/json\" \\\n  -H \"x-api-key: ${MORPHO_API_KEY}\"","id":"curl"},{"label":"JavaScript","lang":"js","source":"const baseUrl = process.env.CORE_REST_BASE_URL ?? \"https://api.morpho.org\";\nconst apiKey = process.env.MORPHO_API_KEY ?? \"<MORPHO_API_KEY>\";\nconst curatorSelector = \"<chain_id>:<curator_address>\";\n\nconst url = new URL(`${baseUrl}/v0/curators/${curatorSelector}/details`);\n\nconst response = await fetch(url, {\n  headers: {\n    accept: \"application/json\",\n    \"x-api-key\": apiKey,\n  },\n});\nif (!response.ok) throw new Error(await response.text());\n\nconst body = await response.json();","id":"js"}]}},"/v0/oracles/{oracle-selector}/state":{"get":{"description":"Latest indexed state of an oracle: quote, onchain update timestamp, and indexed block.","operationId":"OracleStateController_getState","parameters":[{"description":"Selector formatted as <chain_id>:<oracle_address>. Example: 1:0x2a01EB9496094dA03c4E364Def50f5aD1280AD72.","example":"1:0x2a01EB9496094dA03c4E364Def50f5aD1280AD72","in":"path","name":"oracle-selector","required":true,"schema":{"example":"1:0x2a01EB9496094dA03c4E364Def50f5aD1280AD72","format":"<chain_id>:<oracle_address>","type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"data":{"chain_id":1,"last_indexed_block":"19700042","last_updated_at":"1717000100","oracle_address":"0x2a01EB9496094dA03c4E364Def50f5aD1280AD72","price":"1150750000000000000000000000000000000"}},"schema":{"$ref":"#/components/schemas/OracleStateResponse"}}},"description":""}},"summary":"Get oracle state","tags":["Oracles"],"x-codeSamples":[{"label":"cURL","lang":"bash","source":"BASE_URL=\"${CORE_REST_BASE_URL:-https://api.morpho.org}\"\nMORPHO_API_KEY=\"<MORPHO_API_KEY>\"\nORACLE_SELECTOR=\"<chain_id>:<oracle_address>\"\n\ncurl -sS \"${BASE_URL}/v0/oracles/${ORACLE_SELECTOR}/state\" \\\n  -H \"accept: application/json\" \\\n  -H \"x-api-key: ${MORPHO_API_KEY}\"","id":"curl"},{"label":"JavaScript","lang":"js","source":"const baseUrl = process.env.CORE_REST_BASE_URL ?? \"https://api.morpho.org\";\nconst apiKey = process.env.MORPHO_API_KEY ?? \"<MORPHO_API_KEY>\";\nconst oracleSelector = \"<chain_id>:<oracle_address>\";\n\nconst url = new URL(`${baseUrl}/v0/oracles/${oracleSelector}/state`);\n\nconst response = await fetch(url, {\n  headers: {\n    accept: \"application/json\",\n    \"x-api-key\": apiKey,\n  },\n});\nif (!response.ok) throw new Error(await response.text());\n\nconst body = await response.json();","id":"js"}]}},"/v0/tokens/{token-selector}":{"get":{"description":"ERC-20 token identity and metadata: chain, address, name, symbol, decimals, logo, and tags.","operationId":"TokenRootController_getRoot","parameters":[{"description":"Selector formatted as <chain_id>:<address>. Example: 8453:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913.","example":"8453:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","in":"path","name":"token-selector","required":true,"schema":{"example":"8453:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","format":"<chain_id>:<address>","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenRootResponse"}}},"description":""}},"summary":"Get token","tags":["Token"],"x-codeSamples":[{"label":"cURL","lang":"bash","source":"BASE_URL=\"${CORE_REST_BASE_URL:-https://api.morpho.org}\"\nMORPHO_API_KEY=\"<MORPHO_API_KEY>\"\nTOKEN_SELECTOR=\"<chain_id>:<address>\"\n\ncurl -sS \"${BASE_URL}/v0/tokens/${TOKEN_SELECTOR}\" \\\n  -H \"accept: application/json\" \\\n  -H \"x-api-key: ${MORPHO_API_KEY}\"","id":"curl"},{"label":"JavaScript","lang":"js","source":"const baseUrl = process.env.CORE_REST_BASE_URL ?? \"https://api.morpho.org\";\nconst apiKey = process.env.MORPHO_API_KEY ?? \"<MORPHO_API_KEY>\";\nconst tokenSelector = \"<chain_id>:<address>\";\n\nconst url = new URL(`${baseUrl}/v0/tokens/${tokenSelector}`);\n\nconst response = await fetch(url, {\n  headers: {\n    accept: \"application/json\",\n    \"x-api-key\": apiKey,\n  },\n});\nif (!response.ok) throw new Error(await response.text());\n\nconst body = await response.json();","id":"js"}]}},"/v0/tokens/{token-selector}/price":{"get":{"description":"Canonical spot price of an ERC-20 token in USD, sourced from hourly price feeds.","operationId":"TokenPriceController_getPrice","parameters":[{"description":"Selector formatted as <chain_id>:<address>. Example: 8453:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913.","example":"8453:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","in":"path","name":"token-selector","required":true,"schema":{"example":"8453:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","format":"<chain_id>:<address>","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenPriceResponse"}}},"description":"Known token with an available USD price."},"206":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenPriceResponse"}}},"description":"Known token that the API cannot currently price. Price, timestamp, and provider are null."},"404":{"description":"Token is not known by the API."}},"summary":"Get token price","tags":["Token"],"x-codeSamples":[{"label":"cURL","lang":"bash","source":"BASE_URL=\"${CORE_REST_BASE_URL:-https://api.morpho.org}\"\nMORPHO_API_KEY=\"<MORPHO_API_KEY>\"\nTOKEN_SELECTOR=\"<chain_id>:<address>\"\n\ncurl -sS \"${BASE_URL}/v0/tokens/${TOKEN_SELECTOR}/price\" \\\n  -H \"accept: application/json\" \\\n  -H \"x-api-key: ${MORPHO_API_KEY}\"","id":"curl"},{"label":"JavaScript","lang":"js","source":"const baseUrl = process.env.CORE_REST_BASE_URL ?? \"https://api.morpho.org\";\nconst apiKey = process.env.MORPHO_API_KEY ?? \"<MORPHO_API_KEY>\";\nconst tokenSelector = \"<chain_id>:<address>\";\n\nconst url = new URL(`${baseUrl}/v0/tokens/${tokenSelector}/price`);\n\nconst response = await fetch(url, {\n  headers: {\n    accept: \"application/json\",\n    \"x-api-key\": apiKey,\n  },\n});\nif (!response.ok) throw new Error(await response.text());\n\nconst body = await response.json();","id":"js"}]}},"/v0/vaults-v1":{"get":{"description":"Cursor-paginated list of listed Morpho Vault V1 instances across every supported chain: identity, deployment facts, the performance-fee setup and the owner / curator roles. Enough to build and rank a vault directory without a follow-up call per row; `{chain-id}:{vault_address}` on each item addresses the detail routes.\n\n**Membership is gated on listing.** A V1 vault appears once it is promoted, or once a Vault V2 references it through a `MorphoVaultV1Adapter`. This is therefore not a complete enumeration of indexed Vault V1 instances, and its contents can change with no on-chain event. Unlisted vaults remain reachable through `GET /v0/vaults-v1/{chain-id}:{vault-address}`.\n\n**Roles and filters.** Roles are factual onchain configuration: owner (`owner()`), curator (`curator()`), guardian (`guardian()`) and enabled allocator (`isAllocator(address)` is true). Address lists match any address within that role (OR); different filters, including different roles, combine with AND. Allocator collections are not embedded in list items.\n\n**Not here.** Live state (`total_assets`, `share_price_ray`) is on `…/state` and APY on `…/apy`; the underlying token's name, symbol and decimals are on `GET /v0/tokens/{chain-id}:{address}`; `skim_recipient`, `timelock_seconds` and pending governance state are on the single-vault lookup.\n\n**Pagination.** Pass `cursor` back verbatim on the next call; a `null` cursor means the last page. The cursor is bound to both the sort and the filter set that produced it, so changing either is a 400 rather than a silently wrong page.\n\n**Freshness.** Every field is configuration that changes only on a governance action or a new deployment, so the payload does not move between blocks and carries no `last_indexed_block`. Use `GET /v0/chains` for per-chain indexer tips.","operationId":"getVaultsV1","parameters":[{"description":"Opaque cursor from a previous page response. Bound to the sort and filter set that produced it.","in":"query","name":"cursor","required":false,"schema":{"maxLength":4096,"minLength":1,"type":"string"}},{"description":"Maximum number of vaults to return.","in":"query","name":"limit","required":false,"schema":{"default":100,"maximum":1000,"minimum":1,"type":"integer"}},{"description":"Sort key. `address` sorts on the `(chain_id, vault_address)` tiebreak. `name` compares the first 512 characters, with ties broken by chain id and vault address.","in":"query","name":"sort_by","required":false,"schema":{"default":"address","enum":["address","creation_timestamp","creation_block_number","name","performance_fee_wad"],"type":"string"}},{"description":"Sort direction. Defaults to `asc` for `address` and `name`, `desc` for `creation_timestamp`, `creation_block_number` and `performance_fee_wad`.","in":"query","name":"sort_direction","required":false,"schema":{"enum":["asc","desc"],"type":"string"}},{"description":"Filter by chain ids. Required when any address filter is provided.","in":"query","name":"chain_ids","required":false,"schema":{"items":{"enum":[1,8453,747474,999,42161,137,130,10,480,143,988,4217,4663,5042,196],"exclusiveMinimum":true,"maximum":9007199254740991,"minimum":0,"type":"integer"},"maxItems":100,"type":"array"}},{"description":"Filter by underlying asset address. Combine with chain_ids; lowercase input is checksummed.","in":"query","name":"asset_addresses","required":false,"schema":{"items":{"type":"string"},"maxItems":100,"type":"array"}},{"description":"Filter by deploying factory address. Combine with chain_ids; lowercase input is checksummed.","in":"query","name":"factory_addresses","required":false,"schema":{"items":{"type":"string"},"maxItems":100,"type":"array"}},{"description":"Filter by current owner. Combine with chain_ids; lowercase input is checksummed.","in":"query","name":"owners","required":false,"schema":{"items":{"type":"string"},"maxItems":100,"type":"array"}},{"description":"Filter by current curator. Combine with chain_ids; lowercase input is checksummed.","in":"query","name":"curators","required":false,"schema":{"items":{"type":"string"},"maxItems":100,"type":"array"}},{"description":"Filter by current guardian (guardian()), factual onchain data. Combine with chain_ids; lowercase input is checksummed. Addresses within a filter combine with OR; different filters combine with AND.","in":"query","name":"guardians","required":false,"schema":{"items":{"type":"string"},"maxItems":100,"type":"array"}},{"description":"Filter by currently enabled allocator (isAllocator(address) is true), factual onchain data, not historical or revoked permissions. Combine with chain_ids; lowercase input is checksummed. Addresses within a filter combine with OR; different filters combine with AND.","in":"query","name":"allocators","required":false,"schema":{"items":{"type":"string"},"maxItems":100,"type":"array"}},{"description":"Filter by factory lineage.","in":"query","name":"versions","required":false,"schema":{"items":{"enum":["1.0","1.1"],"type":"string"},"maxItems":100,"type":"array"}}],"responses":{"200":{"content":{"application/json":{"example":{"cursor":"eyJzIjoiYWRkcmVzcyIsImQiOiJhc2MiLCJ2IjoiMHhCRUVGMDE3MzVjMTMyQWRhNDZBQTlhQTRjNTQ2MjNjQUE5MkE2NENCIiwidk51bGwiOmZhbHNlLCJpIjpbMSwiMHhCRUVGMDE3MzVjMTMyQWRhNDZBQTlhQTRjNTQ2MjNjQUE5MkE2NENCIl0sImYiOiJjMmYwYTEifQ","data":[{"asset_address":"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48","chain_id":1,"creation_block_number":"18928285","creation_timestamp":1704500000,"creator_address":"0x255c7705e8BB334DfCae438197f7C4297988085a","curator":"0x827e86072B06674a077f592A531dcE4590aDeCdB","factory_address":"0xA9c3D3a366466Fa809d1Ae982Fb2c46E5fC41101","guardian":null,"name":"Steakhouse USDC","owner":"0x0A0e559bc3b0950a7e448F0d4894db195b9cf8DD","performance_fee_recipient":"0x255c7705e8BB334DfCae438197f7C4297988085a","performance_fee_wad":"50000000000000000","symbol":"steakUSDC","vault_address":"0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB","version":"1.0"}]},"schema":{"$ref":"#/components/schemas/VaultV1ListResponse"}}},"description":""},"400":{"description":"Malformed or replayed cursor (`INVALID_CURSOR`), an unsupported chain id, a bad `limit` or `sort_by`, a malformed address, or an array / cross-product limit exceeded."}},"summary":"List V1 vaults","tags":["Vaults V1"],"x-codeSamples":[{"label":"cURL","lang":"bash","source":"BASE_URL=\"${CORE_REST_BASE_URL:-https://api.morpho.org}\"\nMORPHO_API_KEY=\"<MORPHO_API_KEY>\"\n\ncurl -sS \"${BASE_URL}/v0/vaults-v1\" \\\n  -H \"accept: application/json\" \\\n  -H \"x-api-key: ${MORPHO_API_KEY}\"","id":"curl"},{"label":"JavaScript","lang":"js","source":"const baseUrl = process.env.CORE_REST_BASE_URL ?? \"https://api.morpho.org\";\nconst apiKey = process.env.MORPHO_API_KEY ?? \"<MORPHO_API_KEY>\";\n\nconst url = new URL(`${baseUrl}/v0/vaults-v1`);\n\nconst response = await fetch(url, {\n  headers: {\n    accept: \"application/json\",\n    \"x-api-key\": apiKey,\n  },\n});\nif (!response.ok) throw new Error(await response.text());\n\nconst body = await response.json();","id":"js"}]}},"/v0/vaults-v1/users/{user-address}/positions":{"get":{"description":"Cursor-paginated discovery list of Morpho Vault V1 positions held by a user across exposed chains, including unlisted vaults. By default, only positions with non-zero shares are returned. With active_only=false, the list also returns zero-share rows for every vault in which the user has held shares, so a fully exited position stays discoverable with shares and assets of 0. Blacklisted vaults are the exception: their rows are removed from the index. Membership follows vault share Transfer events: a deposit is recorded for the share receiver, a withdrawal or redemption for the share owner, and a share transfer for both sender and recipient; an address that only sends assets on behalf of another receiver is not listed. Rows reflect the realtime position index, which is updated as those events are indexed; a position in a newly created vault appears once that vault itself has been indexed. Results can be filtered with chain_ids and vault_addresses. Pagination is weakly consistent and not snapshot-isolated: continuation pages re-evaluate realtime state, so changes to shares, assets, active status or membership may omit or repeat rows. last_indexed_block is freshness metadata only, not a pagination snapshot. Rows use the same position item shape as the singular Vault V1 user-position endpoint.","operationId":"UserVaultV1PositionListController_list","parameters":[{"description":"User address to list positions for. Lowercase input is checksummed. Example: 0xabcdefabcdefabcdefabcdefabcdefabcdefabcd.","example":"0xabcdefabcdefabcdefabcdefabcdefabcdefabcd","in":"path","name":"user-address","required":true,"schema":{"example":"0xabcdefabcdefabcdefabcdefabcdefabcdefabcd","format":"address","type":"string"}},{"description":"Comma-separated EVM chain identifiers to filter on. Defaults to every exposed chain.","in":"query","name":"chain_ids","required":false,"schema":{"items":{"enum":[1,8453,747474,999,42161,137,130,10,480,143,988,4217,4663,5042,196],"exclusiveMinimum":true,"maximum":9007199254740991,"minimum":0,"type":"integer"},"maxItems":100,"type":"array"},"style":"form","explode":false},{"description":"Comma-separated vault addresses to filter on.","in":"query","name":"vault_addresses","required":false,"schema":{"items":{"format":"address","type":"string"},"maxItems":100,"type":"array"},"style":"form","explode":false},{"description":"When true, excludes positions with zero shares. Defaults to true.","in":"query","name":"active_only","required":false,"schema":{"default":"true","enum":["true","false"],"type":"string"}},{"description":"Sort field for cursor pagination.","in":"query","name":"sort_by","required":false,"schema":{"default":"vault_address","enum":["vault_address","shares","assets"],"type":"string"}},{"description":"Sort direction.","in":"query","name":"sort_direction","required":false,"schema":{"default":"desc","enum":["asc","desc"],"type":"string"}},{"description":"Maximum number of positions to return.","in":"query","name":"limit","required":false,"schema":{"default":100,"maximum":100,"minimum":1,"type":"integer"}},{"description":"Opaque seek cursor (maximum 4096 characters) returned by a previous page. Do not modify it or parse it. It is unsigned and untrusted, not an authorization boundary; the user and filters are reapplied on every page, and changing the collection, sort, user or filters invalidates it.","in":"query","name":"cursor","required":false,"schema":{"maxLength":4096,"minLength":1,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"cursor":null,"data":[{"assets":"1004300000000000000000","chain_id":1,"last_indexed_block":"23481902","shares":"980000000000000000000","vault_address":"0x38989BBA00BDF8181F4082995b3DEAe96163aC5D"}],"params":{"user_address":"0x821b0F1A2C3d4E5f6789aBcDeF0123456789AbCd"}},"schema":{"$ref":"#/components/schemas/UserVaultPositionsResponse"}}},"description":""}},"summary":"List user V1 vault positions","tags":["Vaults V1"],"x-codeSamples":[{"label":"cURL","lang":"bash","source":"BASE_URL=\"${CORE_REST_BASE_URL:-https://api.morpho.org}\"\nMORPHO_API_KEY=\"<MORPHO_API_KEY>\"\nUSER_ADDRESS=\"0xabcdefabcdefabcdefabcdefabcdefabcdefabcd\"\n\ncurl -sS \"${BASE_URL}/v0/vaults-v1/users/${USER_ADDRESS}/positions\" \\\n  -H \"accept: application/json\" \\\n  -H \"x-api-key: ${MORPHO_API_KEY}\"","id":"curl"},{"label":"JavaScript","lang":"js","source":"const baseUrl = process.env.CORE_REST_BASE_URL ?? \"https://api.morpho.org\";\nconst apiKey = process.env.MORPHO_API_KEY ?? \"<MORPHO_API_KEY>\";\nconst userAddress = \"0xabcdefabcdefabcdefabcdefabcdefabcdefabcd\";\n\nconst url = new URL(`${baseUrl}/v0/vaults-v1/users/${userAddress}/positions`);\n\nconst response = await fetch(url, {\n  headers: {\n    accept: \"application/json\",\n    \"x-api-key\": apiKey,\n  },\n});\nif (!response.ok) throw new Error(await response.text());\n\nconst body = await response.json();","id":"js"}]}},"/v0/vaults-v1/{vault-selector}":{"get":{"description":"Morpho Vault V1 configuration: identity (name, symbol, version), underlying asset, factory, fee setup, owner/curator/guardian roles, and timelock.\n\nVault selector example: `1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB` (format: `<chain_id>:<vault_address>`; replace with the target vault).","operationId":"VaultV1RootController_getRoot","parameters":[{"description":"Selector formatted as <chain_id>:<vault_address>. Example: 1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB.","example":"1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB","in":"path","name":"vault-selector","required":true,"schema":{"example":"1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB","format":"<chain_id>:<vault_address>","type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"data":{"address":"0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB","asset":{"address":"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48","decimals":6,"name":"USDCoin","symbol":"USDC"},"chain_id":1,"creation_block_number":"18928285","creator_address":"0x255c7705e8BB334DfCae438197f7C4297988085a","curator":"0x827e86072B06674a077f592A531dcE4590aDeCdB","factory_address":"0xA9c3D3a366466Fa809d1Ae982Fb2c46E5fC41101","fee_recipient":"0x255c7705e8BB334DfCae438197f7C4297988085a","fee_wad":"50000000000000000","guardian":"0xaa0500198B4425DfC4E272FbE42C8E64E21fc03d","last_indexed_block":"25475346","name":"Steakhouse USDC","owner":"0x0A0e559bc3b0950a7e448F0d4894db195b9cf8DD","skim_recipient":null,"symbol":"steakUSDC","timelock_seconds":604800,"version":"1.0"}},"schema":{"$ref":"#/components/schemas/VaultV1RootResponse"}}},"description":""}},"summary":"Get V1 vault","tags":["Vaults V1"],"x-codeSamples":[{"label":"cURL","lang":"bash","source":"BASE_URL=\"${CORE_REST_BASE_URL:-https://api.morpho.org}\"\nMORPHO_API_KEY=\"<MORPHO_API_KEY>\"\nVAULT_SELECTOR=\"1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB\"\n\ncurl -sS \"${BASE_URL}/v0/vaults-v1/${VAULT_SELECTOR}\" \\\n  -H \"accept: application/json\" \\\n  -H \"x-api-key: ${MORPHO_API_KEY}\"","id":"curl"},{"label":"JavaScript","lang":"js","source":"const baseUrl = process.env.CORE_REST_BASE_URL ?? \"https://api.morpho.org\";\nconst apiKey = process.env.MORPHO_API_KEY ?? \"<MORPHO_API_KEY>\";\nconst vaultSelector = \"1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB\";\n\nconst url = new URL(`${baseUrl}/v0/vaults-v1/${vaultSelector}`);\n\nconst response = await fetch(url, {\n  headers: {\n    accept: \"application/json\",\n    \"x-api-key\": apiKey,\n  },\n});\nif (!response.ok) throw new Error(await response.text());\n\nconst body = await response.json();","id":"js"}]}},"/v0/vaults-v1/{vault-selector}/allocations":{"get":{"description":"Current market allocation state of a Morpho Vault V1, including timelocked per-market cap changes and market removals. Covers every market with a current or pending relationship to the vault, ordered by ascending market id.\n\nVault selector example: `1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB` (format: `<chain_id>:<vault_address>`; replace with the target vault).","operationId":"VaultV1AllocationsController_getAllocations","parameters":[{"description":"Selector formatted as <chain_id>:<vault_address>. Example: 1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB.","example":"1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB","in":"path","name":"vault-selector","required":true,"schema":{"example":"1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB","format":"<chain_id>:<vault_address>","type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"data":{"allocations":[{"market_id":"0xb323495f7e4148be5643a4ea4a8221eef163e4bccfded827a6f46947d7ad9afb","pending":{"removal":null,"supply_cap":null},"supply_assets":"62500000000000","supply_cap":"24519928653854221733733552434404946937899825954937634815","supply_queue_index":0,"supply_shares":"61800000000000000","withdraw_queue_index":2},{"market_id":"0xc54d7acf14de29e0e5527cabd7a576506870346a78a11a6762e2cca66322ec41","pending":{"removal":{"valid_at_timestamp":1730259200},"supply_cap":null},"supply_assets":"20000000000000","supply_cap":"30000000000000","supply_queue_index":1,"supply_shares":"19800000000000000","withdraw_queue_index":0},{"market_id":"0xfff1970c0ffae288764186fbb38a9171a17e98676744a1e345809cb8b9e73342","pending":{"removal":null,"supply_cap":{"valid_at_timestamp":1730172800,"value":"10000000000000"}},"supply_assets":"0","supply_cap":"0","supply_queue_index":null,"supply_shares":"0","withdraw_queue_index":null}],"chain_id":1,"last_indexed_block":"19847234","vault_address":"0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB"}},"schema":{"$ref":"#/components/schemas/VaultV1AllocationsResponse"}}},"description":""}},"summary":"Get V1 vault allocations","tags":["Vaults V1"],"x-codeSamples":[{"label":"cURL","lang":"bash","source":"BASE_URL=\"${CORE_REST_BASE_URL:-https://api.morpho.org}\"\nMORPHO_API_KEY=\"<MORPHO_API_KEY>\"\nVAULT_SELECTOR=\"1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB\"\n\ncurl -sS \"${BASE_URL}/v0/vaults-v1/${VAULT_SELECTOR}/allocations\" \\\n  -H \"accept: application/json\" \\\n  -H \"x-api-key: ${MORPHO_API_KEY}\"","id":"curl"},{"label":"JavaScript","lang":"js","source":"const baseUrl = process.env.CORE_REST_BASE_URL ?? \"https://api.morpho.org\";\nconst apiKey = process.env.MORPHO_API_KEY ?? \"<MORPHO_API_KEY>\";\nconst vaultSelector = \"1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB\";\n\nconst url = new URL(`${baseUrl}/v0/vaults-v1/${vaultSelector}/allocations`);\n\nconst response = await fetch(url, {\n  headers: {\n    accept: \"application/json\",\n    \"x-api-key\": apiKey,\n  },\n});\nif (!response.ok) throw new Error(await response.text());\n\nconst body = await response.json();","id":"js"}]}},"/v0/vaults-v1/{vault-selector}/allocations/history":{"get":{"description":"Historical allocation state of a Morpho Vault V1 grouped by market: supplied assets, supplied shares, and supply cap.\n\nVault selector example: `1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB` (format: `<chain_id>:<vault_address>`; replace with the target vault).","operationId":"VaultV1AllocationHistoryController_getAllocationHistory","parameters":[{"description":"Selector formatted as <chain_id>:<vault_address>. Example: 1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB.","example":"1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB","in":"path","name":"vault-selector","required":true,"schema":{"example":"1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB","format":"<chain_id>:<vault_address>","type":"string"}},{"description":"Lookback period. Defaults to thirty_days. Historical sampling is selected automatically.","in":"query","name":"lookback","required":false,"schema":{"enum":["one_day","seven_days","thirty_days","ninety_days","one_year","inception"],"type":"string"}},{"description":"Optional Morpho Blue market id filter.","in":"query","name":"market_id","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"data":[{"history":[{"supply_assets":"51200000000000","supply_cap":"100000000000000","supply_shares":"51000000000000000000000","timestamp":1729900800},{"supply_assets":"52500000000000","supply_cap":"100000000000000","supply_shares":"52300000000000000000000","timestamp":1729987200}],"market_id":"0xb323495f7e4148be5643a4ea4a8221eef163e4bccfded827a6f46947d7ad9afb"}],"last_indexed_block":"19847234","params":{"chain_id":"1","vault_address":"0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB"}},"schema":{"$ref":"#/components/schemas/VaultV1AllocationHistoryResponse"}}},"description":""}},"summary":"Get V1 vault allocation history","tags":["Vaults V1"],"x-codeSamples":[{"label":"cURL","lang":"bash","source":"BASE_URL=\"${CORE_REST_BASE_URL:-https://api.morpho.org}\"\nMORPHO_API_KEY=\"<MORPHO_API_KEY>\"\nVAULT_SELECTOR=\"1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB\"\n\ncurl -sS \"${BASE_URL}/v0/vaults-v1/${VAULT_SELECTOR}/allocations/history?lookback=thirty_days\" \\\n  -H \"accept: application/json\" \\\n  -H \"x-api-key: ${MORPHO_API_KEY}\"","id":"curl"},{"label":"JavaScript","lang":"js","source":"const baseUrl = process.env.CORE_REST_BASE_URL ?? \"https://api.morpho.org\";\nconst apiKey = process.env.MORPHO_API_KEY ?? \"<MORPHO_API_KEY>\";\nconst vaultSelector = \"1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB\";\n\nconst url = new URL(`${baseUrl}/v0/vaults-v1/${vaultSelector}/allocations/history`);\nurl.searchParams.set(\"lookback\", \"thirty_days\");\n\nconst response = await fetch(url, {\n  headers: {\n    accept: \"application/json\",\n    \"x-api-key\": apiKey,\n  },\n});\nif (!response.ok) throw new Error(await response.text());\n\nconst body = await response.json();","id":"js"}]}},"/v0/vaults-v1/{vault-selector}/allocators":{"get":{"description":"Active allocator addresses for a Morpho Vault V1 and the transaction hash and block number of each latest role grant.\n\nVault selector example: `1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB` (format: `<chain_id>:<vault_address>`; replace with the target vault).","operationId":"getVaultsV1Allocators","parameters":[{"description":"Selector formatted as <chain_id>:<vault_address>. Example: 1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB.","example":"1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB","in":"path","name":"vault-selector","required":true,"schema":{"example":"1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB","format":"<chain_id>:<vault_address>","type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"data":[{"grant_block_number":"23335802","role_address":"0x0000aeB716a0DF7A9A1AAd119b772644Bc089dA8","tx_hash":"0x8ef18dd4c5ef94344d30852f61e3abb1ad6c7cc4deee3cb0b032598515ec3164"}],"last_indexed_block":"25501833","params":{"chain_id":1,"vault_address":"0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB"}},"schema":{"$ref":"#/components/schemas/VaultRoleListResponse"}}},"description":""}},"summary":"Get V1 vault allocators","tags":["Vaults V1"],"x-codeSamples":[{"label":"cURL","lang":"bash","source":"BASE_URL=\"${CORE_REST_BASE_URL:-https://api.morpho.org}\"\nMORPHO_API_KEY=\"<MORPHO_API_KEY>\"\nVAULT_SELECTOR=\"1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB\"\n\ncurl -sS \"${BASE_URL}/v0/vaults-v1/${VAULT_SELECTOR}/allocators\" \\\n  -H \"accept: application/json\" \\\n  -H \"x-api-key: ${MORPHO_API_KEY}\"","id":"curl"},{"label":"JavaScript","lang":"js","source":"const baseUrl = process.env.CORE_REST_BASE_URL ?? \"https://api.morpho.org\";\nconst apiKey = process.env.MORPHO_API_KEY ?? \"<MORPHO_API_KEY>\";\nconst vaultSelector = \"1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB\";\n\nconst url = new URL(`${baseUrl}/v0/vaults-v1/${vaultSelector}/allocators`);\n\nconst response = await fetch(url, {\n  headers: {\n    accept: \"application/json\",\n    \"x-api-key\": apiKey,\n  },\n});\nif (!response.ok) throw new Error(await response.text());\n\nconst body = await response.json();","id":"js"}]}},"/v0/vaults-v1/{vault-selector}/apy-averages":{"get":{"description":"Realized average APY of a Morpho Vault V1 over a predefined lookback period, derived from share price evolution. Post-fee, excludes rewards.\n\nVault selector example: `1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB` (format: `<chain_id>:<vault_address>`; replace with the target vault).","operationId":"VaultV1ApyAveragesController_getApyAverages","parameters":[{"description":"Selector formatted as <chain_id>:<vault_address>. Example: 1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB.","example":"1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB","in":"path","name":"vault-selector","required":true,"schema":{"example":"1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB","format":"<chain_id>:<vault_address>","type":"string"}},{"description":"Lookback period for the APY calculation. Defaults to `six_hours`.","in":"query","name":"lookback","required":false,"schema":{"enum":["one_hour","six_hours","one_day","seven_days","thirty_days","ninety_days","one_year","inception"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"data":{"apy":0.03172317044232895,"chain_id":1,"last_indexed_block":"25475347","lookback":"six_hours","vault_address":"0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB"}},"schema":{"$ref":"#/components/schemas/VaultV1ApyAveragesResponse"}}},"description":""}},"summary":"Get V1 vault realized average APY","tags":["Vaults V1"],"x-codeSamples":[{"label":"cURL","lang":"bash","source":"BASE_URL=\"${CORE_REST_BASE_URL:-https://api.morpho.org}\"\nMORPHO_API_KEY=\"<MORPHO_API_KEY>\"\nVAULT_SELECTOR=\"1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB\"\n\ncurl -sS \"${BASE_URL}/v0/vaults-v1/${VAULT_SELECTOR}/apy-averages?lookback=six_hours\" \\\n  -H \"accept: application/json\" \\\n  -H \"x-api-key: ${MORPHO_API_KEY}\"","id":"curl"},{"label":"JavaScript","lang":"js","source":"const baseUrl = process.env.CORE_REST_BASE_URL ?? \"https://api.morpho.org\";\nconst apiKey = process.env.MORPHO_API_KEY ?? \"<MORPHO_API_KEY>\";\nconst vaultSelector = \"1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB\";\n\nconst url = new URL(`${baseUrl}/v0/vaults-v1/${vaultSelector}/apy-averages`);\nurl.searchParams.set(\"lookback\", \"six_hours\");\n\nconst response = await fetch(url, {\n  headers: {\n    accept: \"application/json\",\n    \"x-api-key\": apiKey,\n  },\n});\nif (!response.ok) throw new Error(await response.text());\n\nconst body = await response.json();","id":"js"}]}},"/v0/vaults-v1/{vault-selector}/apy/history":{"get":{"description":"Historical APY for a Morpho Vault V1. The APY averaging window is derived automatically from lookback: one_day and seven_days use one_day; thirty_days uses seven_days; ninety_days, one_year, and inception use thirty_days. six_hours selects a six-hour result range with hourly samples and a trailing six-hour APY averaging window; the range starts at the later of creation or six hours ago, with samples starting at the next top of hour. A point closer to the vault's first hourly snapshot than its window averages from that snapshot instead; points less than one day after it are omitted, except six_hours requires at least six hours after that snapshot. Points whose averaging window starts or ends while the vault holds fewer than 1,000,000 raw units of its asset (1 USDC, 0.01 WBTC) are omitted, because a near-empty vault's share price is dominated by rounding.\n\nVault selector example: `1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB` (format: `<chain_id>:<vault_address>`; replace with the target vault).","operationId":"VaultV1ApyHistoryController_getApyHistory","parameters":[{"description":"Selector formatted as <chain_id>:<vault_address>. Example: 1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB.","example":"1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB","in":"path","name":"vault-selector","required":true,"schema":{"example":"1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB","format":"<chain_id>:<vault_address>","type":"string"}},{"description":"Lookback period. Defaults to thirty_days. Historical sampling is selected automatically. The APY averaging window is derived automatically from lookback: one_day and seven_days use one_day; thirty_days uses seven_days; ninety_days, one_year, and inception use thirty_days. six_hours selects a six-hour result range with hourly samples and a trailing six-hour APY averaging window; the range starts at the later of creation or six hours ago, with samples starting at the next top of hour. A point closer to the vault's first hourly snapshot than its window averages from that snapshot instead; points less than one day after it are omitted, except six_hours requires at least six hours after that snapshot. Points whose averaging window starts or ends while the vault holds fewer than 1,000,000 raw units of its asset (1 USDC, 0.01 WBTC) are omitted, because a near-empty vault's share price is dominated by rounding.","in":"query","name":"lookback","required":false,"schema":{"enum":["one_day","seven_days","thirty_days","ninety_days","one_year","inception","six_hours"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"data":[{"apy":0.0317,"timestamp":1729900800},{"apy":0.0321,"timestamp":1729987200}],"last_indexed_block":"19847234","params":{"chain_id":"1","vault_address":"0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB"}},"schema":{"$ref":"#/components/schemas/VaultV1ApyHistoryResponse"}}},"description":""}},"summary":"Get V1 vault APY history","tags":["Vaults V1"],"x-codeSamples":[{"label":"cURL","lang":"bash","source":"BASE_URL=\"${CORE_REST_BASE_URL:-https://api.morpho.org}\"\nMORPHO_API_KEY=\"<MORPHO_API_KEY>\"\nVAULT_SELECTOR=\"1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB\"\n\ncurl -sS \"${BASE_URL}/v0/vaults-v1/${VAULT_SELECTOR}/apy/history?lookback=thirty_days\" \\\n  -H \"accept: application/json\" \\\n  -H \"x-api-key: ${MORPHO_API_KEY}\"","id":"curl"},{"label":"JavaScript","lang":"js","source":"const baseUrl = process.env.CORE_REST_BASE_URL ?? \"https://api.morpho.org\";\nconst apiKey = process.env.MORPHO_API_KEY ?? \"<MORPHO_API_KEY>\";\nconst vaultSelector = \"1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB\";\n\nconst url = new URL(`${baseUrl}/v0/vaults-v1/${vaultSelector}/apy/history`);\nurl.searchParams.set(\"lookback\", \"thirty_days\");\n\nconst response = await fetch(url, {\n  headers: {\n    accept: \"application/json\",\n    \"x-api-key\": apiKey,\n  },\n});\nif (!response.ok) throw new Error(await response.text());\n\nconst body = await response.json();","id":"js"}]}},"/v0/vaults-v1/{vault-selector}/markets/{market-selector}/reallocatable-liquidity":{"get":{"description":"T2 dynamic. Public Allocator V1 liquidity from canonical indexed shared reallocation routes. Vault and market selectors must use the same chain (400 otherwise). Unknown vault, unknown market, missing Public Allocator V1 deployment or a vault without that allocator enabled return 404. Vault-target pairs without a completed per-vault snapshot return 404 LIQUIDITY_NOT_COMPUTED, even if another vault has a snapshot for the target. Completed configured pairs with no capacity return zero and empty routes. At most 29 distinct source markets: MetaMorpho MAX_QUEUE_LENGTH is 30 including the target, which cannot be a source. Stored results exceeding 29 sources fail with 500, never truncate. The fee is a fixed native-token wei amount per reallocateTo call, not WAD or proportional; missing configuration means zero. Freshness is the minimum of the persisted calculation's simulation, realtime vault, allocation, market and oracle snapshot blocks and the stable indexer tips used by the calculation and endpoint. Event-derived flow caps, allocator assignments, market configuration and live PA configuration use their read checkpoint as vintage, not the blocks of their underlying events. PA configuration and flow-cap events are read live at or below that checkpoint; no-event defaults also use the checkpoint. Routes and provenance are loaded from one per-vault snapshot, isolated from legacy shared-liquidity writes and cleanup. Failed calculations retain the prior snapshot and its watermark.\n\nVault selector example: `1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB` (format: `<chain_id>:<vault_address>`; replace with the target vault).","operationId":"getVaultV1MarketReallocatableLiquidity","parameters":[{"description":"Selector formatted as <chain_id>:<vault_address>. Example: 1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB.","example":"1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB","in":"path","name":"vault-selector","required":true,"schema":{"example":"1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB","format":"<chain_id>:<vault_address>","type":"string"}},{"description":"Selector formatted as <chain_id>:<market_id>. Example: 1:0xfff1970c0ffae288764186fbb38a9171a17e98676744a1e345809cb8b9e73342.","example":"1:0xfff1970c0ffae288764186fbb38a9171a17e98676744a1e345809cb8b9e73342","in":"path","name":"market-selector","required":true,"schema":{"example":"1:0xfff1970c0ffae288764186fbb38a9171a17e98676744a1e345809cb8b9e73342","format":"<chain_id>:<market_id>","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VaultV1MarketReallocatableLiquidityResponse"}}},"description":""},"400":{"description":"Invalid selector or selectors on different chains; standard validation error envelope."},"404":{"description":"VAULT_NOT_FOUND, MARKET_NOT_FOUND, PUBLIC_ALLOCATOR_NOT_FOUND, PUBLIC_ALLOCATOR_NOT_ENABLED or LIQUIDITY_NOT_COMPUTED (stable message prefixes in the standard error envelope). LIQUIDITY_NOT_COMPUTED includes never-computed vault-target pairs and vaults removed from a target's completed calculation because they no longer hold it. Successful empty discovery at a known checkpoint deletes the target's snapshots; it does not record zero capacity. Configured pairs that compute to zero still return 200 with zero and empty routes."},"500":{"description":"REALLOCATION_ROUTE_LIMIT_EXCEEDED: stored rows exceed 29 distinct source markets."}},"summary":"Get Vault V1 target market reallocatable liquidity","tags":["Vaults V1"],"x-codeSamples":[{"label":"cURL","lang":"bash","source":"BASE_URL=\"${CORE_REST_BASE_URL:-https://private.api.morpho.org}\"\nMORPHO_API_KEY=\"<MORPHO_API_KEY>\"\nVAULT_SELECTOR=\"1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB\"\nMARKET_SELECTOR=\"1:0xfff1970c0ffae288764186fbb38a9171a17e98676744a1e345809cb8b9e73342\"\n\ncurl -sS \"${BASE_URL}/v0/vaults-v1/${VAULT_SELECTOR}/markets/${MARKET_SELECTOR}/reallocatable-liquidity\" \\\n  -H \"accept: application/json\" \\\n  -H \"x-api-key: ${MORPHO_API_KEY}\"","id":"curl"},{"label":"JavaScript","lang":"js","source":"const baseUrl = process.env.CORE_REST_BASE_URL ?? \"https://private.api.morpho.org\";\nconst apiKey = process.env.MORPHO_API_KEY ?? \"<MORPHO_API_KEY>\";\nconst vaultSelector = \"1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB\";\nconst marketSelector = \"1:0xfff1970c0ffae288764186fbb38a9171a17e98676744a1e345809cb8b9e73342\";\n\nconst url = new URL(`${baseUrl}/v0/vaults-v1/${vaultSelector}/markets/${marketSelector}/reallocatable-liquidity`);\n\nconst response = await fetch(url, {\n  headers: {\n    accept: \"application/json\",\n    \"x-api-key\": apiKey,\n  },\n});\nif (!response.ok) throw new Error(await response.text());\n\nconst body = await response.json();","id":"js"}],"x-morpho-private-only":true,"servers":[{"url":"https://private.api.morpho.org"}],"security":[{"ApiKeyAuth":[]}]}},"/v0/vaults-v1/{vault-selector}/pending-governance-actions":{"get":{"description":"Pending governance actions for a Morpho Vault V1, including timelocked cap increases, timelock decreases, guardian changes, market removals, and pending ownership transfers.\n\nVault selector example: `1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB` (format: `<chain_id>:<vault_address>`; replace with the target vault).","operationId":"VaultV1PendingGovernanceActionsController_getPendingGovernanceActions","parameters":[{"description":"Selector formatted as <chain_id>:<vault_address>. Example: 1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB.","example":"1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB","in":"path","name":"vault-selector","required":true,"schema":{"example":"1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB","format":"<chain_id>:<vault_address>","type":"string"}},{"in":"query","name":"limit","required":false,"schema":{"default":100,"maximum":1000,"minimum":1,"type":"integer"}},{"in":"query","name":"cursor","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"cursor":null,"data":[{"action_type":"set_cap","executable_at_timestamp":1730086400,"parameters":{"market_id":"0x3a85e619751152991742810df6ec69ce473daef99e28a64ab2340d7b7ccfee49","new_supply_cap":"1000000000000"},"submitted_transaction_hash":"0x1111111111111111111111111111111111111111111111111111111111111111"},{"action_type":"set_timelock","executable_at_timestamp":1730086400,"parameters":{"new_timelock_seconds":86400},"submitted_transaction_hash":"0x2222222222222222222222222222222222222222222222222222222222222222"},{"action_type":"set_guardian","executable_at_timestamp":1730086400,"parameters":{"new_guardian":"0x4b6Cb9Cf2A3C4cD8b3F8bF8E2Cb5B7d4C0F2Ee99"},"submitted_transaction_hash":"0x3333333333333333333333333333333333333333333333333333333333333333"},{"action_type":"remove_market","executable_at_timestamp":1730086400,"parameters":{"market_id":"0x3a85e619751152991742810df6ec69ce473daef99e28a64ab2340d7b7ccfee49"},"submitted_transaction_hash":"0x4444444444444444444444444444444444444444444444444444444444444444"},{"action_type":"transfer_ownership","executable_at_timestamp":null,"parameters":{"pending_owner":"0x4b6Cb9Cf2A3C4cD8b3F8bF8E2Cb5B7d4C0F2Ee99"},"submitted_transaction_hash":"0x5555555555555555555555555555555555555555555555555555555555555555"}],"last_indexed_block":"19847234","params":{"chain_id":1,"vault_address":"0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB"}},"schema":{"$ref":"#/components/schemas/VaultV1PendingGovernanceActionsResponse"}}},"description":""}},"summary":"Get V1 vault pending governance actions","tags":["Vaults V1"],"x-codeSamples":[{"label":"cURL","lang":"bash","source":"BASE_URL=\"${CORE_REST_BASE_URL:-https://api.morpho.org}\"\nMORPHO_API_KEY=\"<MORPHO_API_KEY>\"\nVAULT_SELECTOR=\"1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB\"\n\ncurl -sS \"${BASE_URL}/v0/vaults-v1/${VAULT_SELECTOR}/pending-governance-actions\" \\\n  -H \"accept: application/json\" \\\n  -H \"x-api-key: ${MORPHO_API_KEY}\"","id":"curl"},{"label":"JavaScript","lang":"js","source":"const baseUrl = process.env.CORE_REST_BASE_URL ?? \"https://api.morpho.org\";\nconst apiKey = process.env.MORPHO_API_KEY ?? \"<MORPHO_API_KEY>\";\nconst vaultSelector = \"1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB\";\n\nconst url = new URL(`${baseUrl}/v0/vaults-v1/${vaultSelector}/pending-governance-actions`);\n\nconst response = await fetch(url, {\n  headers: {\n    accept: \"application/json\",\n    \"x-api-key\": apiKey,\n  },\n});\nif (!response.ok) throw new Error(await response.text());\n\nconst body = await response.json();","id":"js"}]}},"/v0/vaults-v1/{vault-selector}/state":{"get":{"description":"Live state of a Morpho Vault V1: total assets and shares, and withdrawable assets.\n\nVault selector example: `1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB` (format: `<chain_id>:<vault_address>`; replace with the target vault).","operationId":"VaultV1StateController_getState","parameters":[{"description":"Selector formatted as <chain_id>:<vault_address>. Example: 1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB.","example":"1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB","in":"path","name":"vault-selector","required":true,"schema":{"example":"1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB","format":"<chain_id>:<vault_address>","type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"data":{"address":"0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB","chain_id":1,"last_indexed_block":"25475347","share_price_ray":"1132033263779470871876688077","total_assets":"94526725305307","total_supply":"83501720602903970503901222","withdrawable_assets":"52824490248986"}},"schema":{"$ref":"#/components/schemas/VaultV1StateResponse"}}},"description":""}},"summary":"Get V1 vault state","tags":["Vaults V1"],"x-codeSamples":[{"label":"cURL","lang":"bash","source":"BASE_URL=\"${CORE_REST_BASE_URL:-https://api.morpho.org}\"\nMORPHO_API_KEY=\"<MORPHO_API_KEY>\"\nVAULT_SELECTOR=\"1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB\"\n\ncurl -sS \"${BASE_URL}/v0/vaults-v1/${VAULT_SELECTOR}/state\" \\\n  -H \"accept: application/json\" \\\n  -H \"x-api-key: ${MORPHO_API_KEY}\"","id":"curl"},{"label":"JavaScript","lang":"js","source":"const baseUrl = process.env.CORE_REST_BASE_URL ?? \"https://api.morpho.org\";\nconst apiKey = process.env.MORPHO_API_KEY ?? \"<MORPHO_API_KEY>\";\nconst vaultSelector = \"1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB\";\n\nconst url = new URL(`${baseUrl}/v0/vaults-v1/${vaultSelector}/state`);\n\nconst response = await fetch(url, {\n  headers: {\n    accept: \"application/json\",\n    \"x-api-key\": apiKey,\n  },\n});\nif (!response.ok) throw new Error(await response.text());\n\nconst body = await response.json();","id":"js"}]}},"/v0/vaults-v1/{vault-selector}/state/history":{"get":{"description":"Historical state of a Morpho Vault V1: total assets and shares, withdrawable assets, and share price.\n\nVault selector example: `1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB` (format: `<chain_id>:<vault_address>`; replace with the target vault).","operationId":"VaultV1StateHistoryController_getStateHistory","parameters":[{"description":"Selector formatted as <chain_id>:<vault_address>. Example: 1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB.","example":"1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB","in":"path","name":"vault-selector","required":true,"schema":{"example":"1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB","format":"<chain_id>:<vault_address>","type":"string"}},{"description":"Lookback period. Defaults to thirty_days. Historical sampling is selected automatically.","in":"query","name":"lookback","required":false,"schema":{"enum":["one_day","seven_days","thirty_days","ninety_days","one_year","inception"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"data":[{"share_price_ray":"1012363526315789473000000000","timestamp":1729900800,"total_assets":"82710000000000","total_supply":"81700000000000000000000","withdrawable_assets":"9100000000000"},{"share_price_ray":"1017625458996328029000000000","timestamp":1729987200,"total_assets":"83140000000000","total_supply":"81700000000000000000000","withdrawable_assets":"9300000000000"}],"last_indexed_block":"19847234","params":{"chain_id":"1","vault_address":"0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB"}},"schema":{"$ref":"#/components/schemas/VaultV1StateHistoryResponse"}}},"description":""}},"summary":"Get V1 vault state history","tags":["Vaults V1"],"x-codeSamples":[{"label":"cURL","lang":"bash","source":"BASE_URL=\"${CORE_REST_BASE_URL:-https://api.morpho.org}\"\nMORPHO_API_KEY=\"<MORPHO_API_KEY>\"\nVAULT_SELECTOR=\"1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB\"\n\ncurl -sS \"${BASE_URL}/v0/vaults-v1/${VAULT_SELECTOR}/state/history?lookback=thirty_days\" \\\n  -H \"accept: application/json\" \\\n  -H \"x-api-key: ${MORPHO_API_KEY}\"","id":"curl"},{"label":"JavaScript","lang":"js","source":"const baseUrl = process.env.CORE_REST_BASE_URL ?? \"https://api.morpho.org\";\nconst apiKey = process.env.MORPHO_API_KEY ?? \"<MORPHO_API_KEY>\";\nconst vaultSelector = \"1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB\";\n\nconst url = new URL(`${baseUrl}/v0/vaults-v1/${vaultSelector}/state/history`);\nurl.searchParams.set(\"lookback\", \"thirty_days\");\n\nconst response = await fetch(url, {\n  headers: {\n    accept: \"application/json\",\n    \"x-api-key\": apiKey,\n  },\n});\nif (!response.ok) throw new Error(await response.text());\n\nconst body = await response.json();","id":"js"}]}},"/v0/vaults-v1/{vault-selector}/users/{user-address}/position":{"get":{"description":"A user's live position in a Morpho Vault V1: shares held and the equivalent value in underlying assets. Returns zero shares/assets for users who have never interacted with the vault.\n\nVault selector example: `1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB` (format: `<chain_id>:<vault_address>`; replace with the target vault).","operationId":"UserVaultV1PositionController_getPosition","parameters":[{"description":"Position owner address. Example: 0xabcdefabcdefabcdefabcdefabcdefabcdefabcd.","example":"0xabcdefabcdefabcdefabcdefabcdefabcdefabcd","in":"path","name":"user-address","required":true,"schema":{"example":"0xabcdefabcdefabcdefabcdefabcdefabcdefabcd","format":"address","type":"string"}},{"description":"Selector formatted as <chain_id>:<vault_address>. Example: 1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB.","example":"1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB","in":"path","name":"vault-selector","required":true,"schema":{"example":"1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB","format":"<chain_id>:<vault_address>","type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"data":{"assets":"0","chain_id":1,"last_indexed_block":"25475347","shares":"0","user_address":"0xABcdEFABcdEFabcdEfAbCdefabcdeFABcDEFabCD","vault_address":"0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB"}},"schema":{"$ref":"#/components/schemas/UserVaultV1PositionResponse"}}},"description":""},"404":{"description":"The selected vault does not exist on this chain."}},"summary":"User V1 vault position","tags":["Vaults V1"],"x-codeSamples":[{"label":"cURL","lang":"bash","source":"BASE_URL=\"${CORE_REST_BASE_URL:-https://api.morpho.org}\"\nMORPHO_API_KEY=\"<MORPHO_API_KEY>\"\nVAULT_SELECTOR=\"1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB\"\nUSER_ADDRESS=\"0xabcdefabcdefabcdefabcdefabcdefabcdefabcd\"\n\ncurl -sS \"${BASE_URL}/v0/vaults-v1/${VAULT_SELECTOR}/users/${USER_ADDRESS}/position\" \\\n  -H \"accept: application/json\" \\\n  -H \"x-api-key: ${MORPHO_API_KEY}\"","id":"curl"},{"label":"JavaScript","lang":"js","source":"const baseUrl = process.env.CORE_REST_BASE_URL ?? \"https://api.morpho.org\";\nconst apiKey = process.env.MORPHO_API_KEY ?? \"<MORPHO_API_KEY>\";\nconst vaultSelector = \"1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB\";\nconst userAddress = \"0xabcdefabcdefabcdefabcdefabcdefabcdefabcd\";\n\nconst url = new URL(`${baseUrl}/v0/vaults-v1/${vaultSelector}/users/${userAddress}/position`);\n\nconst response = await fetch(url, {\n  headers: {\n    accept: \"application/json\",\n    \"x-api-key\": apiKey,\n  },\n});\nif (!response.ok) throw new Error(await response.text());\n\nconst body = await response.json();","id":"js"}]}},"/v0/vaults-v1/{vault-selector}/users/{user-address}/position/activity":{"get":{"description":"Discrete, log-derived events affecting a user's share balance in a Morpho Vault V1: deposits, withdrawals, and incoming or outgoing share transfers. Every event appears exactly once, ordered by block number then log index, most recent first. The signed sum of the share amounts across the complete feed equals the shares reported by the position endpoint; it holds only from inception to a null cursor, and not for the vault's fee recipient, whose balance also grows through fee mints this endpoint does not emit. Events that do not move the share balance are omitted.\n\nVault selector example: `1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB` (format: `<chain_id>:<vault_address>`; replace with the target vault).","operationId":"UserVaultV1PositionActivityController_getPositionActivity","parameters":[{"description":"Position owner address. Example: 0xabcdefabcdefabcdefabcdefabcdefabcdefabcd.","example":"0xabcdefabcdefabcdefabcdefabcdefabcdefabcd","in":"path","name":"user-address","required":true,"schema":{"example":"0xabcdefabcdefabcdefabcdefabcdefabcdefabcd","format":"address","type":"string"}},{"description":"Selector formatted as <chain_id>:<vault_address>. Example: 1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB.","example":"1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB","in":"path","name":"vault-selector","required":true,"schema":{"example":"1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB","format":"<chain_id>:<vault_address>","type":"string"}},{"description":"Maximum number of events to return.","in":"query","name":"limit","required":false,"schema":{"default":100,"maximum":1000,"minimum":1,"type":"integer"}},{"description":"Opaque cursor returned by a previous page.","in":"query","name":"cursor","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"cursor":null,"data":[{"block_number":"19640000","data":{"shares":"250000000000000000000","to_address":"0x3a9B4c5D6E7f8091A2b3c4D5E6F708192A3B4C5d"},"log_index":12,"timestamp":1712870400,"tx_hash":"0x4e3a9b0ff1c2d52d7e8c5e1d3b9a8f7e6c5b4a39281706f5e4d3c2b1a09f8e7d","type":"shares_transfer_out"},{"block_number":"19600500","data":{"assets":"302631578","on_behalf":"0x71C7656EC7ab88b098defB751B7401B5f6d8976F","receiver":"0x8ba1f109551bD432803012645Ac136ddd64DBA72","sender":"0x71C7656EC7ab88b098defB751B7401B5f6d8976F","shares":"300000000000000000000"},"log_index":4,"timestamp":1712396400,"tx_hash":"0x1f2e3d4c5b6a798807162534435261708f9e0d1c2b3a49586776859403f2e1d0","type":"withdraw"},{"block_number":"19550200","data":{"from_address":"0x8ba1f109551bD432803012645Ac136ddd64DBA72","shares":"500000000000000000000"},"log_index":88,"timestamp":1711792800,"tx_hash":"0xa1b2c3d4e5f60718293a4b5c6d7e8f900112233445566778899aabbccddeeff0","type":"shares_transfer_in"},{"block_number":"19500100","data":{"assets":"1000000000","on_behalf":"0x71C7656EC7ab88b098defB751B7401B5f6d8976F","sender":"0x4095F064B8d3c3548A3bebfd0Bbfd04750E30077","shares":"1000000000000000000000"},"log_index":16,"timestamp":1711191600,"tx_hash":"0xaabbccddeeff00112233445566778899aabbccddeeff00112233445566778899","type":"deposit"}],"last_indexed_block":"19847234","params":{"chain_id":1,"user_address":"0x71C7656EC7ab88b098defB751B7401B5f6d8976F","vault_address":"0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB"}},"schema":{"$ref":"#/components/schemas/UserVaultV1PositionActivityResponse"}}},"description":""}},"summary":"User V1 vault position activity","tags":["Vaults V1"],"x-codeSamples":[{"label":"cURL","lang":"bash","source":"BASE_URL=\"${CORE_REST_BASE_URL:-https://api.morpho.org}\"\nMORPHO_API_KEY=\"<MORPHO_API_KEY>\"\nVAULT_SELECTOR=\"1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB\"\nUSER_ADDRESS=\"0xabcdefabcdefabcdefabcdefabcdefabcdefabcd\"\n\ncurl -sS \"${BASE_URL}/v0/vaults-v1/${VAULT_SELECTOR}/users/${USER_ADDRESS}/position/activity\" \\\n  -H \"accept: application/json\" \\\n  -H \"x-api-key: ${MORPHO_API_KEY}\"","id":"curl"},{"label":"JavaScript","lang":"js","source":"const baseUrl = process.env.CORE_REST_BASE_URL ?? \"https://api.morpho.org\";\nconst apiKey = process.env.MORPHO_API_KEY ?? \"<MORPHO_API_KEY>\";\nconst vaultSelector = \"1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB\";\nconst userAddress = \"0xabcdefabcdefabcdefabcdefabcdefabcdefabcd\";\n\nconst url = new URL(`${baseUrl}/v0/vaults-v1/${vaultSelector}/users/${userAddress}/position/activity`);\n\nconst response = await fetch(url, {\n  headers: {\n    accept: \"application/json\",\n    \"x-api-key\": apiKey,\n  },\n});\nif (!response.ok) throw new Error(await response.text());\n\nconst body = await response.json();","id":"js"}]}},"/v0/vaults-v1/{vault-selector}/users/{user-address}/position/history":{"get":{"description":"A user's historical position in a Morpho Vault V1: shares held and the equivalent value in underlying assets.\n\nVault selector example: `1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB` (format: `<chain_id>:<vault_address>`; replace with the target vault).","operationId":"UserVaultV1PositionHistoryController_getPositionHistory","parameters":[{"description":"Position owner address. Example: 0xabcdefabcdefabcdefabcdefabcdefabcdefabcd.","example":"0xabcdefabcdefabcdefabcdefabcdefabcdefabcd","in":"path","name":"user-address","required":true,"schema":{"example":"0xabcdefabcdefabcdefabcdefabcdefabcdefabcd","format":"address","type":"string"}},{"description":"Selector formatted as <chain_id>:<vault_address>. Example: 1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB.","example":"1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB","in":"path","name":"vault-selector","required":true,"schema":{"example":"1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB","format":"<chain_id>:<vault_address>","type":"string"}},{"description":"Lookback period. Defaults to thirty_days. Historical sampling is selected automatically.","in":"query","name":"lookback","required":false,"schema":{"enum":["one_day","seven_days","thirty_days","ninety_days","one_year","inception"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"data":[{"assets":"1012000000","shares":"1000000000000000000000","timestamp":1729900800},{"assets":"1221000000","shares":"1200000000000000000000","timestamp":1729987200}],"last_indexed_block":"19847234","params":{"chain_id":"1","user_address":"0x0000000000000000000000000000000000000001","vault_address":"0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB"}},"schema":{"$ref":"#/components/schemas/UserVaultV1PositionHistoryResponse"}}},"description":""}},"summary":"User V1 vault position history","tags":["Vaults V1"],"x-codeSamples":[{"label":"cURL","lang":"bash","source":"BASE_URL=\"${CORE_REST_BASE_URL:-https://api.morpho.org}\"\nMORPHO_API_KEY=\"<MORPHO_API_KEY>\"\nVAULT_SELECTOR=\"1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB\"\nUSER_ADDRESS=\"0xabcdefabcdefabcdefabcdefabcdefabcdefabcd\"\n\ncurl -sS \"${BASE_URL}/v0/vaults-v1/${VAULT_SELECTOR}/users/${USER_ADDRESS}/position/history?lookback=thirty_days\" \\\n  -H \"accept: application/json\" \\\n  -H \"x-api-key: ${MORPHO_API_KEY}\"","id":"curl"},{"label":"JavaScript","lang":"js","source":"const baseUrl = process.env.CORE_REST_BASE_URL ?? \"https://api.morpho.org\";\nconst apiKey = process.env.MORPHO_API_KEY ?? \"<MORPHO_API_KEY>\";\nconst vaultSelector = \"1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB\";\nconst userAddress = \"0xabcdefabcdefabcdefabcdefabcdefabcdefabcd\";\n\nconst url = new URL(`${baseUrl}/v0/vaults-v1/${vaultSelector}/users/${userAddress}/position/history`);\nurl.searchParams.set(\"lookback\", \"thirty_days\");\n\nconst response = await fetch(url, {\n  headers: {\n    accept: \"application/json\",\n    \"x-api-key\": apiKey,\n  },\n});\nif (!response.ok) throw new Error(await response.text());\n\nconst body = await response.json();","id":"js"}]}},"/v0/vaults-v1/{vault-selector}/users/{user-address}/position/performance":{"get":{"description":"Realized + unrealized earnings of a user's Morpho Vault V1 position. Uses the `average_cost` accounting method: per-user share-price differentials are accumulated against the running share balance, with transfers netted into the same balance so that earnings reflect the user's economic exposure rather than their on-chain transaction count. `return_on_capital` is the time-weighted ratio of net earnings to capital deployed over the holding period (non-annualised). When `as_of_date` is set, the cutoff is the start of that UTC day. For an open position, valuation uses the last hourly share-price history point or the user's last position change, whichever is later, at or before the cutoff; it is not block-exact. `as_of.timestamp` is the effective valuation timestamp. For a position fully exited before the cutoff it is the last position change and the value is final. Invalid or future dates and unsupported chains return 400; unavailable history returns 503 or 404.\n\nVault selector example: `1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB` (format: `<chain_id>:<vault_address>`; replace with the target vault).","operationId":"UserVaultV1PositionPerformanceController_getPerformance","parameters":[{"description":"Position owner address. Example: 0xabcdefabcdefabcdefabcdefabcdefabcdefabcd.","example":"0xabcdefabcdefabcdefabcdefabcdefabcdefabcd","in":"path","name":"user-address","required":true,"schema":{"example":"0xabcdefabcdefabcdefabcdefabcdefabcdefabcd","format":"address","type":"string"}},{"description":"Selector formatted as <chain_id>:<vault_address>. Example: 1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB.","example":"1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB","in":"path","name":"vault-selector","required":true,"schema":{"example":"1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB","format":"<chain_id>:<vault_address>","type":"string"}},{"description":"UTC calendar date in YYYY-MM-DD format; returns performance through 00:00:00Z on that date. Future dates are not supported.","in":"query","name":"as_of_date","required":false,"schema":{"example":"2024-05-17","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$","type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"data":{"accounting_method":"average_cost","chain_id":1,"last_indexed_block":"25475347","net_earnings_assets":"0","return_on_capital":null,"user_address":"0xABcdEFABcdEFabcdEfAbCdefabcdeFABcDEFabCD","vault_address":"0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB"}},"schema":{"$ref":"#/components/schemas/UserVaultV1PositionPerformanceResponse"}}},"description":""}},"summary":"User V1 vault position performance","tags":["Vaults V1"],"x-codeSamples":[{"label":"cURL","lang":"bash","source":"BASE_URL=\"${CORE_REST_BASE_URL:-https://api.morpho.org}\"\nMORPHO_API_KEY=\"<MORPHO_API_KEY>\"\nVAULT_SELECTOR=\"1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB\"\nUSER_ADDRESS=\"0xabcdefabcdefabcdefabcdefabcdefabcdefabcd\"\n\ncurl -sS \"${BASE_URL}/v0/vaults-v1/${VAULT_SELECTOR}/users/${USER_ADDRESS}/position/performance\" \\\n  -H \"accept: application/json\" \\\n  -H \"x-api-key: ${MORPHO_API_KEY}\"","id":"curl"},{"label":"JavaScript","lang":"js","source":"const baseUrl = process.env.CORE_REST_BASE_URL ?? \"https://api.morpho.org\";\nconst apiKey = process.env.MORPHO_API_KEY ?? \"<MORPHO_API_KEY>\";\nconst vaultSelector = \"1:0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB\";\nconst userAddress = \"0xabcdefabcdefabcdefabcdefabcdefabcdefabcd\";\n\nconst url = new URL(`${baseUrl}/v0/vaults-v1/${vaultSelector}/users/${userAddress}/position/performance`);\n\nconst response = await fetch(url, {\n  headers: {\n    accept: \"application/json\",\n    \"x-api-key\": apiKey,\n  },\n});\nif (!response.ok) throw new Error(await response.text());\n\nconst body = await response.json();","id":"js"}]}},"/v0/vaults-v2":{"get":{"description":"Cursor-paginated discovery list of the listed Morpho Vault V2 instances across all exposed chains. Rows carry vault identity, underlying asset, factory, creation parameters, fees and the owner and curator roles — enough to build a vault picker and to construct the <chain_id>:<vault_address> selector for every per-vault route. Live state, APY and allocations are served by the per-vault endpoints.","operationId":"VaultV2ListController_list","parameters":[{"description":"Opaque cursor returned by a previous page. Encodes the sort field, the sort direction and the filter set; changing any of them invalidates it. Do not parse it.","in":"query","name":"cursor","required":false,"schema":{"maxLength":4096,"minLength":1,"type":"string"}},{"description":"Maximum number of vaults to return.","in":"query","name":"limit","required":false,"schema":{"default":100,"maximum":1000,"minimum":1,"type":"integer"}},{"description":"Comma-separated EVM chain identifiers to filter on. Defaults to every exposed chain. A chain that is unsupported or not exposed is rejected.","in":"query","name":"chain_ids","required":false,"schema":{"items":{"enum":[1,8453,747474,999,42161,137,130,10,480,143,988,4217,4663,5042,196],"exclusiveMinimum":true,"maximum":9007199254740991,"minimum":0,"type":"integer"},"maxItems":100,"type":"array"},"style":"form","explode":false},{"description":"Comma-separated underlying asset addresses to filter on.","in":"query","name":"asset_addresses","required":false,"schema":{"items":{"type":"string"},"maxItems":100,"type":"array"},"style":"form","explode":false},{"description":"Comma-separated owner addresses to filter on.","in":"query","name":"owners","required":false,"schema":{"items":{"type":"string"},"maxItems":100,"type":"array"},"style":"form","explode":false},{"description":"Comma-separated curator addresses to filter on.","in":"query","name":"curators","required":false,"schema":{"items":{"type":"string"},"maxItems":100,"type":"array"},"style":"form","explode":false},{"description":"Sort field. `name` is the only nullable key and always sorts nulls last; it compares the first 512 characters, with ties broken by chain id and vault address.","in":"query","name":"sort_by","required":false,"schema":{"default":"vault_address","enum":["vault_address","name","creation_timestamp","creation_block_number","management_fee_wad","performance_fee_wad"],"type":"string"}},{"description":"Sort direction.","in":"query","name":"sort_direction","required":false,"schema":{"default":"asc","enum":["asc","desc"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"cursor":null,"data":[{"asset_address":"0xdAC17F958D2ee523a2206206994597C13D831ec7","chain_id":1,"creation_block_number":"24568955","creation_timestamp":1776950399,"curator":"0x3F32bC09d41eE699844F8296e806417D6bf61Bba","factory_address":"0xA1D94F746dEfa1928926b84fB2596c06926C0405","management_fee_recipient":null,"management_fee_wad":null,"name":"sky.money USDT Savings","owner":"0x3F32bC09d41eE699844F8296e806417D6bf61Bba","performance_fee_recipient":"0x3F32bC09d41eE699844F8296e806417D6bf61Bba","performance_fee_wad":"100000000000000000","symbol":"skyMoneyUsdtSavings","vault_address":"0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11","version":"2.0"}]},"schema":{"$ref":"#/components/schemas/VaultV2ListResponse"}}},"description":""}},"summary":"List V2 vaults","tags":["Vaults V2"],"x-codeSamples":[{"label":"cURL","lang":"bash","source":"BASE_URL=\"${CORE_REST_BASE_URL:-https://api.morpho.org}\"\nMORPHO_API_KEY=\"<MORPHO_API_KEY>\"\n\ncurl -sS \"${BASE_URL}/v0/vaults-v2\" \\\n  -H \"accept: application/json\" \\\n  -H \"x-api-key: ${MORPHO_API_KEY}\"","id":"curl"},{"label":"JavaScript","lang":"js","source":"const baseUrl = process.env.CORE_REST_BASE_URL ?? \"https://api.morpho.org\";\nconst apiKey = process.env.MORPHO_API_KEY ?? \"<MORPHO_API_KEY>\";\n\nconst url = new URL(`${baseUrl}/v0/vaults-v2`);\n\nconst response = await fetch(url, {\n  headers: {\n    accept: \"application/json\",\n    \"x-api-key\": apiKey,\n  },\n});\nif (!response.ok) throw new Error(await response.text());\n\nconst body = await response.json();","id":"js"}]}},"/v0/vaults-v2/users/{user-address}/positions":{"get":{"description":"Cursor-paginated discovery list of Morpho Vault V2 positions held by a user across exposed chains. By default, only positions with non-zero shares are returned. With active_only=false, the list also returns zero-share rows for vaults the user has fully exited, listed or not, so it lists every Morpho Vault V2 position the realtime service has tracked for the user. Rows belong to the share holder: a deposit credits its onBehalf address and a share transfer credits its recipient; a full withdrawal, redemption or transfer out leaves the row with zero shares and zero assets. Rows update when the realtime service processes the user's Vault V2 deposit, withdrawal or transfer events; a scheduled re-sync every 10 minutes catches recently indexed events the live path missed. It scans only about the last 15 minutes of blocks before the chain head, so an event indexed after that window can stay stale until the user's next Vault V2 event or a backfill. Results can be filtered with chain_ids and vault_addresses. Fee wrappers and vaults that are not Morpho Vault V2s are not listed. Blacklisted vaults are removed eventually rather than at request time: a cleanup job deletes their position rows when the realtime scheduler starts and then every hour, so a newly blacklisted vault can stay listed until the next run. Unsupported vault adapters can stop a row from being created or refreshed, so those positions may be missing or stale. Pagination is weakly consistent and not snapshot-isolated: continuation pages re-evaluate realtime state, so changes to shares, assets, active status or membership may omit or repeat rows. last_indexed_block is freshness metadata only, not a pagination snapshot. Rows use the same position item shape as the singular Vault V2 user-position endpoint.","operationId":"UserVaultV2PositionListController_list","parameters":[{"description":"User address to list positions for. Lowercase input is checksummed. Example: 0xabcdefabcdefabcdefabcdefabcdefabcdefabcd.","example":"0xabcdefabcdefabcdefabcdefabcdefabcdefabcd","in":"path","name":"user-address","required":true,"schema":{"example":"0xabcdefabcdefabcdefabcdefabcdefabcdefabcd","format":"address","type":"string"}},{"description":"Comma-separated EVM chain identifiers to filter on. Defaults to every exposed chain.","in":"query","name":"chain_ids","required":false,"schema":{"items":{"enum":[1,8453,747474,999,42161,137,130,10,480,143,988,4217,4663,5042,196],"exclusiveMinimum":true,"maximum":9007199254740991,"minimum":0,"type":"integer"},"maxItems":100,"type":"array"},"style":"form","explode":false},{"description":"Comma-separated vault addresses to filter on.","in":"query","name":"vault_addresses","required":false,"schema":{"items":{"format":"address","type":"string"},"maxItems":100,"type":"array"},"style":"form","explode":false},{"description":"When true, excludes positions with zero shares. Defaults to true.","in":"query","name":"active_only","required":false,"schema":{"default":"true","enum":["true","false"],"type":"string"}},{"description":"Sort field for cursor pagination.","in":"query","name":"sort_by","required":false,"schema":{"default":"vault_address","enum":["vault_address","shares","assets"],"type":"string"}},{"description":"Sort direction.","in":"query","name":"sort_direction","required":false,"schema":{"default":"desc","enum":["asc","desc"],"type":"string"}},{"description":"Maximum number of positions to return.","in":"query","name":"limit","required":false,"schema":{"default":100,"maximum":100,"minimum":1,"type":"integer"}},{"description":"Opaque seek cursor (maximum 4096 characters) returned by a previous page. Do not modify it or parse it. It is unsigned and untrusted, not an authorization boundary; the user and filters are reapplied on every page, and changing the collection, sort, user or filters invalidates it.","in":"query","name":"cursor","required":false,"schema":{"maxLength":4096,"minLength":1,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"cursor":null,"data":[{"assets":"1312500000000000000000","chain_id":1,"last_indexed_block":"23481902","shares":"1250000000000000000000","vault_address":"0xBEEFcf0BA6b4a04AB8C5B2Dd1E5c5F0E2A5F64CB"}],"params":{"user_address":"0x821b0F1A2C3d4E5f6789aBcDeF0123456789AbCd"}},"schema":{"$ref":"#/components/schemas/UserVaultPositionsResponse"}}},"description":""}},"summary":"List user V2 vault positions","tags":["Vaults V2"],"x-codeSamples":[{"label":"cURL","lang":"bash","source":"BASE_URL=\"${CORE_REST_BASE_URL:-https://api.morpho.org}\"\nMORPHO_API_KEY=\"<MORPHO_API_KEY>\"\nUSER_ADDRESS=\"0xabcdefabcdefabcdefabcdefabcdefabcdefabcd\"\n\ncurl -sS \"${BASE_URL}/v0/vaults-v2/users/${USER_ADDRESS}/positions\" \\\n  -H \"accept: application/json\" \\\n  -H \"x-api-key: ${MORPHO_API_KEY}\"","id":"curl"},{"label":"JavaScript","lang":"js","source":"const baseUrl = process.env.CORE_REST_BASE_URL ?? \"https://api.morpho.org\";\nconst apiKey = process.env.MORPHO_API_KEY ?? \"<MORPHO_API_KEY>\";\nconst userAddress = \"0xabcdefabcdefabcdefabcdefabcdefabcdefabcd\";\n\nconst url = new URL(`${baseUrl}/v0/vaults-v2/users/${userAddress}/positions`);\n\nconst response = await fetch(url, {\n  headers: {\n    accept: \"application/json\",\n    \"x-api-key\": apiKey,\n  },\n});\nif (!response.ok) throw new Error(await response.text());\n\nconst body = await response.json();","id":"js"}]}},"/v0/vaults-v2/{vault-selector}":{"get":{"description":"Morpho Vault V2 configuration: identity, underlying asset, factory, management/performance fees, owner and curator roles, per-function timelocks and abdications, adapter registry, liquidity adapter, and gating contracts.\n\nVault selector example: `1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11` (format: `<chain_id>:<vault_address>`; replace with the target vault).","operationId":"VaultV2RootController_getRoot","parameters":[{"description":"Selector formatted as <chain_id>:<vault_address>. Example: 1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11.","example":"1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11","in":"path","name":"vault-selector","required":true,"schema":{"example":"1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11","format":"<chain_id>:<vault_address>","type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"data":{"adapter_registry":"0x3696c5eAe4a7Ffd04Ea163564571E9CD8Ed9364e","address":"0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11","asset":{"address":"0xdAC17F958D2ee523a2206206994597C13D831ec7","decimals":6,"name":"Tether USD","symbol":"USDT"},"chain_id":1,"creation_block_number":"24568955","curator":"0x3F32bC09d41eE699844F8296e806417D6bf61Bba","decimals_offset":12,"factory_address":"0xA1D94F746dEfa1928926b84fB2596c06926C0405","gates":{"receive_assets":null,"receive_shares":null,"send_assets":null,"send_shares":null},"governance":{"timelocks":[{"abdicated_at_timestamp":null,"function_name":"setIsAllocator","is_abdicated":false,"timelock_seconds":"604800"},{"abdicated_at_timestamp":null,"function_name":"setReceiveSharesGate","is_abdicated":false,"timelock_seconds":"0"},{"abdicated_at_timestamp":null,"function_name":"setSendSharesGate","is_abdicated":false,"timelock_seconds":"0"},{"abdicated_at_timestamp":null,"function_name":"setReceiveAssetsGate","is_abdicated":false,"timelock_seconds":"0"},{"abdicated_at_timestamp":null,"function_name":"setSendAssetsGate","is_abdicated":false,"timelock_seconds":"0"},{"abdicated_at_timestamp":null,"function_name":"setAdapterRegistry","is_abdicated":false,"timelock_seconds":"0"},{"abdicated_at_timestamp":null,"function_name":"addAdapter","is_abdicated":false,"timelock_seconds":"0"},{"abdicated_at_timestamp":null,"function_name":"removeAdapter","is_abdicated":false,"timelock_seconds":"0"},{"abdicated_at_timestamp":null,"function_name":"increaseTimelock","is_abdicated":false,"timelock_seconds":"0"},{"abdicated_at_timestamp":null,"function_name":"decreaseTimelock","is_abdicated":false,"timelock_seconds":"0"},{"abdicated_at_timestamp":null,"function_name":"setPerformanceFee","is_abdicated":false,"timelock_seconds":"0"},{"abdicated_at_timestamp":null,"function_name":"setManagementFee","is_abdicated":false,"timelock_seconds":"0"},{"abdicated_at_timestamp":null,"function_name":"setPerformanceFeeRecipient","is_abdicated":false,"timelock_seconds":"0"},{"abdicated_at_timestamp":null,"function_name":"setManagementFeeRecipient","is_abdicated":false,"timelock_seconds":"0"},{"abdicated_at_timestamp":null,"function_name":"increaseAbsoluteCap","is_abdicated":false,"timelock_seconds":"0"},{"abdicated_at_timestamp":null,"function_name":"increaseRelativeCap","is_abdicated":false,"timelock_seconds":"0"},{"abdicated_at_timestamp":null,"function_name":"setForceDeallocatePenalty","is_abdicated":false,"timelock_seconds":"0"},{"abdicated_at_timestamp":null,"function_name":"abdicate","is_abdicated":false,"timelock_seconds":"0"}]},"last_indexed_block":"25475349","liquidity_adapter":"0x6C5D5D47A39FE9f8CA14731a9A42bD31d64fb40D","liquidity_data":"0x3274643db77a064abd3bc851de77556a4ad2e2f502f4f0c80845fa8f909ecf0b","management_fee_recipient":null,"management_fee_wad":null,"max_rate_per_second_wad":"63419583967","name":"sky.money USDT Savings","owner":"0x3F32bC09d41eE699844F8296e806417D6bf61Bba","performance_fee_recipient":null,"performance_fee_wad":null,"symbol":"skyMoneyUsdtSavings","timelock_seconds":604800,"version":"2.0"}},"schema":{"$ref":"#/components/schemas/VaultV2RootResponse"}}},"description":""}},"summary":"Get V2 vault","tags":["Vaults V2"],"x-codeSamples":[{"label":"cURL","lang":"bash","source":"BASE_URL=\"${CORE_REST_BASE_URL:-https://api.morpho.org}\"\nMORPHO_API_KEY=\"<MORPHO_API_KEY>\"\nVAULT_SELECTOR=\"1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11\"\n\ncurl -sS \"${BASE_URL}/v0/vaults-v2/${VAULT_SELECTOR}\" \\\n  -H \"accept: application/json\" \\\n  -H \"x-api-key: ${MORPHO_API_KEY}\"","id":"curl"},{"label":"JavaScript","lang":"js","source":"const baseUrl = process.env.CORE_REST_BASE_URL ?? \"https://api.morpho.org\";\nconst apiKey = process.env.MORPHO_API_KEY ?? \"<MORPHO_API_KEY>\";\nconst vaultSelector = \"1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11\";\n\nconst url = new URL(`${baseUrl}/v0/vaults-v2/${vaultSelector}`);\n\nconst response = await fetch(url, {\n  headers: {\n    accept: \"application/json\",\n    \"x-api-key\": apiKey,\n  },\n});\nif (!response.ok) throw new Error(await response.text());\n\nconst body = await response.json();","id":"js"}]}},"/v0/vaults-v2/{vault-selector}/allocations":{"get":{"description":"Adapter and cap allocation state of a Morpho Vault V2. Each entry is an active adapter, carrying the caps scoped to it and the assets currently allocated against each. Caps that are not scoped to a single adapter — collateral caps, and caps whose target could not be decoded — are reported separately under unscoped_caps. Caps pointing at an adapter that is no longer active are omitted.\n\nVault selector example: `1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11` (format: `<chain_id>:<vault_address>`; replace with the target vault).","operationId":"getVaultsV2Allocations","parameters":[{"description":"Selector formatted as <chain_id>:<vault_address>. Example: 1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11.","example":"1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11","in":"path","name":"vault-selector","required":true,"schema":{"example":"1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11","format":"<chain_id>:<vault_address>","type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"data":{"allocations":[{"adapter_address":"0x6C5D5D47A39FE9f8CA14731a9A42bD31d64fb40D","adapter_kind":"morpho_market_v1","caps":[{"absolute_cap":"115792089237316195423570985008687907853269984665640564039457584007913129639935","allocated_assets":"46000000000000","cap_data":"0x00000000000000000000000000000000000000000000000000000000000000400000000000000000000000006c5d5d47a39fe9f8ca14731a9a42bd31d64fb40d00000000000000000000000000000000000000000000000000000000000000047468697300000000000000000000000000000000000000000000000000000000","cap_id":"0xae24ee5060e52617daf39855191a6b07eb5921e80260e655a7948b507fa3956c","cap_type":"adapter","pending":{"absolute_cap":null,"relative_cap_wad":null},"real_assets":"46012500000000","relative_cap_wad":"1000000000000000000"},{"absolute_cap":"100000000000000","allocated_assets":"46000000000000","cap_data":"0x00000000000000000000000000000000000000000000000000000000000000e00000000000000000000000006c5d5d47a39fe9f8ca14731a9a42bd31d64fb40d000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000007f39c581f595b53c5cb19bd0b3f8da6c935e2ca000000000000000000000000048f7e36eb6b826b2df4b2e630b62cd25e89e40e2000000000000000000000000870ac11d48b15db9a138cf899d20f13f79ba00bc0000000000000000000000000000000000000000000000000bef55718ad600000000000000000000000000000000000000000000000000000000000000000011746869732f6d61726b6574506172616d73000000000000000000000000000000","cap_id":"0x1748c76027999bc7f3df33d1872ada5ac024707b6a700327037bacf7decc1e72","cap_type":"market_v1","expected_supply_assets":"46012500000000","market_id":"0xa5c50bd6e28de8b098defa897f677798f3f256959c2d47dabe8c5994ff53d8fd","pending":{"absolute_cap":null,"relative_cap_wad":{"valid_at_timestamp":1730259200,"value":"650000000000000000"}},"relative_cap_wad":"600000000000000000"}],"pending":{"removal":null},"target":{"type":"blue_market"}},{"adapter_address":"0x1122334455667788990011223344556677889900","adapter_kind":"morpho_vault_v1","caps":[{"absolute_cap":"300000000000000","allocated_assets":"18630689825420","cap_data":"0x0000000000000000000000000000000000000000000000000000000000000040000000000000000000000000112233445566778899001122334455667788990000000000000000000000000000000000000000000000000000000000000000047468697300000000000000000000000000000000000000000000000000000000","cap_id":"0x6a9c9d91305f96fadf8665e7c7f702d152168ae534b03dc5163db557448c2030","cap_type":"adapter","pending":{"absolute_cap":{"valid_at_timestamp":1730259200,"value":"500000000000000"},"relative_cap_wad":null},"real_assets":"18631704120911","relative_cap_wad":"300000000000000000"}],"pending":{"removal":{"valid_at_timestamp":1730345600}},"target":{"type":"vault_v1","vault_address":"0xb576765fB15505433aF24FEe2c0325895C559FB2"}}],"chain_id":1,"last_indexed_block":"25475349","unscoped_caps":[{"absolute_cap":"80000000000000","allocated_assets":"46000000000000","cap_data":"0x00000000000000000000000000000000000000000000000000000000000000400000000000000000000000007f39c581f595b53c5cb19bd0b3f8da6c935e2ca0000000000000000000000000000000000000000000000000000000000000000f636f6c6c61746572616c546f6b656e0000000000000000000000000000000000","cap_id":"0x7fec14a26d24d99916f8800202b21d034d3b543349fc0e6632a4bd78a2891a20","cap_type":"collateral","collateral_address":"0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0","pending":{"absolute_cap":null,"relative_cap_wad":null},"relative_cap_wad":"800000000000000000"}],"vault_address":"0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11"}},"schema":{"$ref":"#/components/schemas/VaultV2AllocationsResponse"}}},"description":""}},"summary":"Get V2 vault allocations","tags":["Vaults V2"],"x-codeSamples":[{"label":"cURL","lang":"bash","source":"BASE_URL=\"${CORE_REST_BASE_URL:-https://api.morpho.org}\"\nMORPHO_API_KEY=\"<MORPHO_API_KEY>\"\nVAULT_SELECTOR=\"1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11\"\n\ncurl -sS \"${BASE_URL}/v0/vaults-v2/${VAULT_SELECTOR}/allocations\" \\\n  -H \"accept: application/json\" \\\n  -H \"x-api-key: ${MORPHO_API_KEY}\"","id":"curl"},{"label":"JavaScript","lang":"js","source":"const baseUrl = process.env.CORE_REST_BASE_URL ?? \"https://api.morpho.org\";\nconst apiKey = process.env.MORPHO_API_KEY ?? \"<MORPHO_API_KEY>\";\nconst vaultSelector = \"1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11\";\n\nconst url = new URL(`${baseUrl}/v0/vaults-v2/${vaultSelector}/allocations`);\n\nconst response = await fetch(url, {\n  headers: {\n    accept: \"application/json\",\n    \"x-api-key\": apiKey,\n  },\n});\nif (!response.ok) throw new Error(await response.text());\n\nconst body = await response.json();","id":"js"}]}},"/v0/vaults-v2/{vault-selector}/allocators":{"get":{"description":"Active allocator addresses for a Morpho Vault V2 and the transaction hash and block number of each latest role grant.\n\nVault selector example: `1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11` (format: `<chain_id>:<vault_address>`; replace with the target vault).","operationId":"getVaultsV2Allocators","parameters":[{"description":"Selector formatted as <chain_id>:<vault_address>. Example: 1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11.","example":"1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11","in":"path","name":"vault-selector","required":true,"schema":{"example":"1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11","format":"<chain_id>:<vault_address>","type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"data":[{"grant_block_number":"24569063","role_address":"0x3F32bC09d41eE699844F8296e806417D6bf61Bba","tx_hash":"0x55105b7f237a881f96b372475578aa8b237fc76d20371499b69104e00c0086ca"}],"last_indexed_block":"25501833","params":{"chain_id":1,"vault_address":"0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11"}},"schema":{"$ref":"#/components/schemas/VaultRoleListResponse"}}},"description":""}},"summary":"Get V2 vault allocators","tags":["Vaults V2"],"x-codeSamples":[{"label":"cURL","lang":"bash","source":"BASE_URL=\"${CORE_REST_BASE_URL:-https://api.morpho.org}\"\nMORPHO_API_KEY=\"<MORPHO_API_KEY>\"\nVAULT_SELECTOR=\"1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11\"\n\ncurl -sS \"${BASE_URL}/v0/vaults-v2/${VAULT_SELECTOR}/allocators\" \\\n  -H \"accept: application/json\" \\\n  -H \"x-api-key: ${MORPHO_API_KEY}\"","id":"curl"},{"label":"JavaScript","lang":"js","source":"const baseUrl = process.env.CORE_REST_BASE_URL ?? \"https://api.morpho.org\";\nconst apiKey = process.env.MORPHO_API_KEY ?? \"<MORPHO_API_KEY>\";\nconst vaultSelector = \"1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11\";\n\nconst url = new URL(`${baseUrl}/v0/vaults-v2/${vaultSelector}/allocators`);\n\nconst response = await fetch(url, {\n  headers: {\n    accept: \"application/json\",\n    \"x-api-key\": apiKey,\n  },\n});\nif (!response.ok) throw new Error(await response.text());\n\nconst body = await response.json();","id":"js"}]}},"/v0/vaults-v2/{vault-selector}/apy/history":{"get":{"description":"Historical APY for a Morpho Vault V2. The APY averaging window is derived automatically from lookback: one_day and seven_days use one_day; thirty_days uses seven_days; ninety_days, one_year, and inception use thirty_days. six_hours selects a six-hour result range with hourly samples and a trailing six-hour APY averaging window; the range starts at the later of creation or six hours ago, with samples starting at the next top of hour. A point closer to the vault's first hourly snapshot than its window averages from that snapshot instead; points less than one day after it are omitted, except six_hours requires at least six hours after that snapshot. Points whose averaging window starts or ends while the vault holds fewer than 1,000,000 raw units of its asset (1 USDC, 0.01 WBTC) are omitted, because a near-empty vault's share price is dominated by rounding.\n\nVault selector example: `1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11` (format: `<chain_id>:<vault_address>`; replace with the target vault).","operationId":"VaultV2ApyHistoryController_getApyHistory","parameters":[{"description":"Selector formatted as <chain_id>:<vault_address>. Example: 1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11.","example":"1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11","in":"path","name":"vault-selector","required":true,"schema":{"example":"1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11","format":"<chain_id>:<vault_address>","type":"string"}},{"description":"Lookback period. Defaults to thirty_days. Historical sampling is selected automatically. The APY averaging window is derived automatically from lookback: one_day and seven_days use one_day; thirty_days uses seven_days; ninety_days, one_year, and inception use thirty_days. six_hours selects a six-hour result range with hourly samples and a trailing six-hour APY averaging window; the range starts at the later of creation or six hours ago, with samples starting at the next top of hour. A point closer to the vault's first hourly snapshot than its window averages from that snapshot instead; points less than one day after it are omitted, except six_hours requires at least six hours after that snapshot. Points whose averaging window starts or ends while the vault holds fewer than 1,000,000 raw units of its asset (1 USDC, 0.01 WBTC) are omitted, because a near-empty vault's share price is dominated by rounding.","in":"query","name":"lookback","required":false,"schema":{"enum":["one_day","seven_days","thirty_days","ninety_days","one_year","inception","six_hours"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"data":[{"apy":0.0215,"timestamp":1729900800},{"apy":0.0219,"timestamp":1729987200}],"last_indexed_block":"19847234","params":{"chain_id":"1","vault_address":"0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11"}},"schema":{"$ref":"#/components/schemas/VaultV2ApyHistoryResponse"}}},"description":""}},"summary":"Get V2 vault APY history","tags":["Vaults V2"],"x-codeSamples":[{"label":"cURL","lang":"bash","source":"BASE_URL=\"${CORE_REST_BASE_URL:-https://api.morpho.org}\"\nMORPHO_API_KEY=\"<MORPHO_API_KEY>\"\nVAULT_SELECTOR=\"1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11\"\n\ncurl -sS \"${BASE_URL}/v0/vaults-v2/${VAULT_SELECTOR}/apy/history?lookback=thirty_days\" \\\n  -H \"accept: application/json\" \\\n  -H \"x-api-key: ${MORPHO_API_KEY}\"","id":"curl"},{"label":"JavaScript","lang":"js","source":"const baseUrl = process.env.CORE_REST_BASE_URL ?? \"https://api.morpho.org\";\nconst apiKey = process.env.MORPHO_API_KEY ?? \"<MORPHO_API_KEY>\";\nconst vaultSelector = \"1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11\";\n\nconst url = new URL(`${baseUrl}/v0/vaults-v2/${vaultSelector}/apy/history`);\nurl.searchParams.set(\"lookback\", \"thirty_days\");\n\nconst response = await fetch(url, {\n  headers: {\n    accept: \"application/json\",\n    \"x-api-key\": apiKey,\n  },\n});\nif (!response.ok) throw new Error(await response.text());\n\nconst body = await response.json();","id":"js"}]}},"/v0/vaults-v2/{vault-selector}/caps/history":{"get":{"description":"Historical allocation and cap state of a Morpho Vault V2 grouped by cap.\n\nVault selector example: `1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11` (format: `<chain_id>:<vault_address>`; replace with the target vault).","operationId":"VaultV2CapsHistoryController_getCapsHistory","parameters":[{"description":"Selector formatted as <chain_id>:<vault_address>. Example: 1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11.","example":"1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11","in":"path","name":"vault-selector","required":true,"schema":{"example":"1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11","format":"<chain_id>:<vault_address>","type":"string"}},{"description":"Lookback period. Defaults to thirty_days. Historical sampling is selected automatically.","in":"query","name":"lookback","required":false,"schema":{"enum":["one_day","seven_days","thirty_days","ninety_days","one_year","inception"],"type":"string"}},{"description":"Optional Vault V2 cap id filter.","in":"query","name":"cap_id","required":false,"schema":{"pattern":"^0x[a-fA-F0-9]{64}$","type":"string"}},{"description":"Optional Vault V2 cap type filter.","in":"query","name":"cap_type","required":false,"schema":{"enum":["adapter","collateral","marketV1","unknown"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"data":[{"adapter_address":"0xFc98D101F6E2F7C27DB2bAEf7D803298F0e0043C","cap_id":"0x5c1f2a8a1c9b2f6a4c4b0e4e6f0a7a3d2c1b0a9f8e7d6c5b4a3f2e1d0c9b8a7f","cap_type":"adapter","history":[{"absolute_cap":"50000000000000","allocation":"12000000000000","relative_allocation":0.12,"relative_cap_wad":"300000000000000000","timestamp":1729900800}],"target":{"type":"vault_v1","vault_address":"0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB"}},{"adapter_address":"0x6C5D5D47A39FE9f8CA14731a9A42bD31d64fb40D","cap_id":"0x0a14a2d85b0d8b52f0991fdc2d47e9c469a70735c084f99f74d0113dd4b61899","cap_type":"marketV1","collateral_address":"0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0","history":[{"absolute_cap":"100000000000000","allocation":"46000000000000","relative_allocation":0.46,"relative_cap_wad":"600000000000000000","timestamp":1729900800},{"absolute_cap":"100000000000000","allocation":"47500000000000","relative_allocation":0.475,"relative_cap_wad":"600000000000000000","timestamp":1729987200}],"market_id":"0xa5c50bd6e28de8b098defa897f677798f3f256959c2d47dabe8c5994ff53d8fd"}],"last_indexed_block":"25475349","params":{"chain_id":"1","vault_address":"0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11"}},"schema":{"$ref":"#/components/schemas/VaultV2CapsHistoryResponse"}}},"description":""}},"summary":"Get V2 vault caps history","tags":["Vaults V2"],"x-codeSamples":[{"label":"cURL","lang":"bash","source":"BASE_URL=\"${CORE_REST_BASE_URL:-https://api.morpho.org}\"\nMORPHO_API_KEY=\"<MORPHO_API_KEY>\"\nVAULT_SELECTOR=\"1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11\"\n\ncurl -sS \"${BASE_URL}/v0/vaults-v2/${VAULT_SELECTOR}/caps/history?lookback=thirty_days\" \\\n  -H \"accept: application/json\" \\\n  -H \"x-api-key: ${MORPHO_API_KEY}\"","id":"curl"},{"label":"JavaScript","lang":"js","source":"const baseUrl = process.env.CORE_REST_BASE_URL ?? \"https://api.morpho.org\";\nconst apiKey = process.env.MORPHO_API_KEY ?? \"<MORPHO_API_KEY>\";\nconst vaultSelector = \"1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11\";\n\nconst url = new URL(`${baseUrl}/v0/vaults-v2/${vaultSelector}/caps/history`);\nurl.searchParams.set(\"lookback\", \"thirty_days\");\n\nconst response = await fetch(url, {\n  headers: {\n    accept: \"application/json\",\n    \"x-api-key\": apiKey,\n  },\n});\nif (!response.ok) throw new Error(await response.text());\n\nconst body = await response.json();","id":"js"}]}},"/v0/vaults-v2/{vault-selector}/markets/{market-selector}/reallocatable-liquidity":{"get":{"description":"Tier: T2 dynamic. Public Allocator V2 capacity into one Blue market, filtered from the canonical full composition so competing vaults share constraints. The full composition is cached for 10 seconds per chain, allocator and target market; concurrent fills are deduplicated across vault requests. Penalty settings are read per request. Both selectors must use the same chain; invalid selectors or a chain mismatch return 400. Unknown vaults return 404. Markets absent from indexer configuration return 404 with message 'Unknown market'; an existing market without Midx target-market state returns retryable 503. Missing chain deployment, current allocator assignment or current target-market configuration returns 404 with message 'No Public Allocator V2 configuration'. Historical setters for other markets do not qualify. Configured zero-capacity pairs return 200 with no routes and the configured proportional penalty. Unsupported adapters or funded vaults outside the top-20 simulated set return distinct 501 errors, never zero capacity. Incomplete Midx vault state returns retryable 503. Freshness is bounded by the cached composition's own starting indexer head, every contributing Midx snapshot block and the request's starting head. Forward indexer progress never raises cached freshness. Rollback below the composition's starting head or the request's starting head returns retryable 503. Routes are bounded to 200 distinct source/target cap pairs by the composer SDK-cardinality guard; an exceeded bound fails closed with 500, never truncates.\n\nVault selector example: `1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11` (format: `<chain_id>:<vault_address>`; replace with the target vault).","operationId":"VaultV2MarketReallocatableLiquidityController_getLiquidity","parameters":[{"description":"Selector formatted as <chain_id>:<vault_address>. Example: 1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11.","example":"1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11","in":"path","name":"vault-selector","required":true,"schema":{"example":"1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11","format":"<chain_id>:<vault_address>","type":"string"}},{"description":"Selector formatted as <chain_id>:<market_id>. Example: 1:0xfff1970c0ffae288764186fbb38a9171a17e98676744a1e345809cb8b9e73342.","example":"1:0xfff1970c0ffae288764186fbb38a9171a17e98676744a1e345809cb8b9e73342","in":"path","name":"market-selector","required":true,"schema":{"example":"1:0xfff1970c0ffae288764186fbb38a9171a17e98676744a1e345809cb8b9e73342","format":"<chain_id>:<market_id>","type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"data":{"chain_id":8453,"market_id":"0x1111111111111111111111111111111111111111111111111111111111111111","penalty_wad":"10000000000000000","public_allocator_address":"0x1111111111111111111111111111111111111111","reallocatable_assets":"600000000000","routes":[{"chain_id":8453,"reallocatable_assets":"500000000000","source_adapter_address":"0x2222222222222222222222222222222222222222","source_type":"market","target_adapter_address":"0x3333333333333333333333333333333333333333","withdraw_market_id":"0x2222222222222222222222222222222222222222222222222222222222222222"},{"reallocatable_assets":"100000000000","source_type":"idle","target_adapter_address":"0x3333333333333333333333333333333333333333"}]},"last_indexed_block":"25475347"},"schema":{"$ref":"#/components/schemas/VaultV2MarketReallocatableLiquidityResponse"}}},"description":""},"501":{"description":"Unsupported Public Allocator V2 vault adapter, or vault outside the bounded simulated set. These omissions are not zero capacity."},"503":{"description":"Retryable upstream unavailability: missing Midx target-market state for an existing market, incomplete Midx vault state, unavailable penalty configuration, missing required state, or indexer rollback below the composition or request starting head."}},"summary":"Get Vault V2 target-market reallocatable liquidity","tags":["Vaults V2"],"x-codeSamples":[{"label":"cURL","lang":"bash","source":"BASE_URL=\"${CORE_REST_BASE_URL:-https://private.api.morpho.org}\"\nMORPHO_API_KEY=\"<MORPHO_API_KEY>\"\nVAULT_SELECTOR=\"1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11\"\nMARKET_SELECTOR=\"1:0xfff1970c0ffae288764186fbb38a9171a17e98676744a1e345809cb8b9e73342\"\n\ncurl -sS \"${BASE_URL}/v0/vaults-v2/${VAULT_SELECTOR}/markets/${MARKET_SELECTOR}/reallocatable-liquidity\" \\\n  -H \"accept: application/json\" \\\n  -H \"x-api-key: ${MORPHO_API_KEY}\"","id":"curl"},{"label":"JavaScript","lang":"js","source":"const baseUrl = process.env.CORE_REST_BASE_URL ?? \"https://private.api.morpho.org\";\nconst apiKey = process.env.MORPHO_API_KEY ?? \"<MORPHO_API_KEY>\";\nconst vaultSelector = \"1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11\";\nconst marketSelector = \"1:0xfff1970c0ffae288764186fbb38a9171a17e98676744a1e345809cb8b9e73342\";\n\nconst url = new URL(`${baseUrl}/v0/vaults-v2/${vaultSelector}/markets/${marketSelector}/reallocatable-liquidity`);\n\nconst response = await fetch(url, {\n  headers: {\n    accept: \"application/json\",\n    \"x-api-key\": apiKey,\n  },\n});\nif (!response.ok) throw new Error(await response.text());\n\nconst body = await response.json();","id":"js"}],"x-morpho-private-only":true,"servers":[{"url":"https://private.api.morpho.org"}],"security":[{"ApiKeyAuth":[]}]}},"/v0/vaults-v2/{vault-selector}/pending-governance-actions":{"get":{"description":"Pending governance actions for a Morpho Vault V2, decoded from the on-chain timelock submit calldata. Unknown selectors are returned with null parameters.\n\nVault selector example: `1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11` (format: `<chain_id>:<vault_address>`; replace with the target vault).","operationId":"VaultV2PendingGovernanceActionsController_getPendingGovernanceActions","parameters":[{"description":"Selector formatted as <chain_id>:<vault_address>. Example: 1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11.","example":"1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11","in":"path","name":"vault-selector","required":true,"schema":{"example":"1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11","format":"<chain_id>:<vault_address>","type":"string"}},{"in":"query","name":"limit","required":false,"schema":{"default":100,"maximum":1000,"minimum":1,"type":"integer"}},{"in":"query","name":"cursor","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"cursor":null,"data":[{"action_type":"set_is_allocator","executable_at_timestamp":1730086400,"parameters":{"account":"0x3F32bC09d41eE699844F8296e806417D6bf61Bba","is_allocator":true},"submitted_transaction_hash":"0x1111111111111111111111111111111111111111111111111111111111111111"},{"action_type":"increase_timelock","executable_at_timestamp":1730086400,"parameters":{"new_duration_seconds":"604800","selector":"0xf6f98fd5"},"submitted_transaction_hash":"0x2222222222222222222222222222222222222222222222222222222222222222"},{"action_type":"increase_absolute_cap","executable_at_timestamp":1730086400,"parameters":{"id_data":"0x1234","new_absolute_cap":"1000000000"},"submitted_transaction_hash":"0x3333333333333333333333333333333333333333333333333333333333333333"},{"action_type":"unknown","executable_at_timestamp":1730172800,"parameters":null,"submitted_transaction_hash":"0x4444444444444444444444444444444444444444444444444444444444444444"}],"last_indexed_block":"19847234","params":{"chain_id":1,"vault_address":"0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11"}},"schema":{"$ref":"#/components/schemas/VaultV2PendingGovernanceActionsResponse"}}},"description":""}},"summary":"Get V2 vault pending governance actions","tags":["Vaults V2"],"x-codeSamples":[{"label":"cURL","lang":"bash","source":"BASE_URL=\"${CORE_REST_BASE_URL:-https://api.morpho.org}\"\nMORPHO_API_KEY=\"<MORPHO_API_KEY>\"\nVAULT_SELECTOR=\"1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11\"\n\ncurl -sS \"${BASE_URL}/v0/vaults-v2/${VAULT_SELECTOR}/pending-governance-actions\" \\\n  -H \"accept: application/json\" \\\n  -H \"x-api-key: ${MORPHO_API_KEY}\"","id":"curl"},{"label":"JavaScript","lang":"js","source":"const baseUrl = process.env.CORE_REST_BASE_URL ?? \"https://api.morpho.org\";\nconst apiKey = process.env.MORPHO_API_KEY ?? \"<MORPHO_API_KEY>\";\nconst vaultSelector = \"1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11\";\n\nconst url = new URL(`${baseUrl}/v0/vaults-v2/${vaultSelector}/pending-governance-actions`);\n\nconst response = await fetch(url, {\n  headers: {\n    accept: \"application/json\",\n    \"x-api-key\": apiKey,\n  },\n});\nif (!response.ok) throw new Error(await response.text());\n\nconst body = await response.json();","id":"js"}]}},"/v0/vaults-v2/{vault-selector}/sentinels":{"get":{"description":"Active sentinel addresses for a Morpho Vault V2 and the transaction hash and block number of each latest role grant.\n\nVault selector example: `1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11` (format: `<chain_id>:<vault_address>`; replace with the target vault).","operationId":"getVaultsV2Sentinels","parameters":[{"description":"Selector formatted as <chain_id>:<vault_address>. Example: 1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11.","example":"1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11","in":"path","name":"vault-selector","required":true,"schema":{"example":"1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11","format":"<chain_id>:<vault_address>","type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"data":[{"grant_block_number":"24569065","role_address":"0x3F32bC09d41eE699844F8296e806417D6bf61Bba","tx_hash":"0xcf8980c0f540e8965d9b25fe39e89c4abada2ced9d8a5ebbc69ed1395a05f25c"}],"last_indexed_block":"25501833","params":{"chain_id":1,"vault_address":"0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11"}},"schema":{"$ref":"#/components/schemas/VaultRoleListResponse"}}},"description":""}},"summary":"Get V2 vault sentinels","tags":["Vaults V2"],"x-codeSamples":[{"label":"cURL","lang":"bash","source":"BASE_URL=\"${CORE_REST_BASE_URL:-https://api.morpho.org}\"\nMORPHO_API_KEY=\"<MORPHO_API_KEY>\"\nVAULT_SELECTOR=\"1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11\"\n\ncurl -sS \"${BASE_URL}/v0/vaults-v2/${VAULT_SELECTOR}/sentinels\" \\\n  -H \"accept: application/json\" \\\n  -H \"x-api-key: ${MORPHO_API_KEY}\"","id":"curl"},{"label":"JavaScript","lang":"js","source":"const baseUrl = process.env.CORE_REST_BASE_URL ?? \"https://api.morpho.org\";\nconst apiKey = process.env.MORPHO_API_KEY ?? \"<MORPHO_API_KEY>\";\nconst vaultSelector = \"1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11\";\n\nconst url = new URL(`${baseUrl}/v0/vaults-v2/${vaultSelector}/sentinels`);\n\nconst response = await fetch(url, {\n  headers: {\n    accept: \"application/json\",\n    \"x-api-key\": apiKey,\n  },\n});\nif (!response.ok) throw new Error(await response.text());\n\nconst body = await response.json();","id":"js"}]}},"/v0/vaults-v2/{vault-selector}/state/history":{"get":{"description":"Historical state of a Morpho Vault V2: total assets and shares, withdrawable assets, allocated assets, idle assets, and share price.\n\nVault selector example: `1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11` (format: `<chain_id>:<vault_address>`; replace with the target vault).","operationId":"VaultV2StateHistoryController_getStateHistory","parameters":[{"description":"Selector formatted as <chain_id>:<vault_address>. Example: 1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11.","example":"1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11","in":"path","name":"vault-selector","required":true,"schema":{"example":"1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11","format":"<chain_id>:<vault_address>","type":"string"}},{"description":"Lookback period. Defaults to thirty_days. Historical sampling is selected automatically.","in":"query","name":"lookback","required":false,"schema":{"enum":["one_day","seven_days","thirty_days","ninety_days","one_year","inception"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"data":[{"allocated_assets":"79500000000000","idle_assets":"12500000000000","share_price_ray":"1008771929824561403000000000","timestamp":1729900800,"total_assets":"92000000000000","total_supply":"91200000000000000000000","withdrawable_assets":"12500000000000"},{"allocated_assets":"79200000000000","idle_assets":"13100000000000","share_price_ray":"1012061403508771929000000000","timestamp":1729987200,"total_assets":"92300000000000","total_supply":"91200000000000000000000","withdrawable_assets":"13100000000000"}],"last_indexed_block":"19847234","params":{"chain_id":"1","vault_address":"0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11"}},"schema":{"$ref":"#/components/schemas/VaultV2StateHistoryResponse"}}},"description":""}},"summary":"Get V2 vault state history","tags":["Vaults V2"],"x-codeSamples":[{"label":"cURL","lang":"bash","source":"BASE_URL=\"${CORE_REST_BASE_URL:-https://api.morpho.org}\"\nMORPHO_API_KEY=\"<MORPHO_API_KEY>\"\nVAULT_SELECTOR=\"1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11\"\n\ncurl -sS \"${BASE_URL}/v0/vaults-v2/${VAULT_SELECTOR}/state/history?lookback=thirty_days\" \\\n  -H \"accept: application/json\" \\\n  -H \"x-api-key: ${MORPHO_API_KEY}\"","id":"curl"},{"label":"JavaScript","lang":"js","source":"const baseUrl = process.env.CORE_REST_BASE_URL ?? \"https://api.morpho.org\";\nconst apiKey = process.env.MORPHO_API_KEY ?? \"<MORPHO_API_KEY>\";\nconst vaultSelector = \"1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11\";\n\nconst url = new URL(`${baseUrl}/v0/vaults-v2/${vaultSelector}/state/history`);\nurl.searchParams.set(\"lookback\", \"thirty_days\");\n\nconst response = await fetch(url, {\n  headers: {\n    accept: \"application/json\",\n    \"x-api-key\": apiKey,\n  },\n});\nif (!response.ok) throw new Error(await response.text());\n\nconst body = await response.json();","id":"js"}]}},"/v0/vaults-v2/{vault-selector}/users/{user-address}/position":{"get":{"description":"A user's live position in a Morpho Vault V2: shares held and the equivalent value in underlying assets.\n\nVault selector example: `1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11` (format: `<chain_id>:<vault_address>`; replace with the target vault).","operationId":"UserVaultV2PositionController_getPosition","parameters":[{"description":"Position owner address. Example: 0xabcdefabcdefabcdefabcdefabcdefabcdefabcd.","example":"0xabcdefabcdefabcdefabcdefabcdefabcdefabcd","in":"path","name":"user-address","required":true,"schema":{"example":"0xabcdefabcdefabcdefabcdefabcdefabcdefabcd","format":"address","type":"string"}},{"description":"Selector formatted as <chain_id>:<vault_address>. Example: 1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11.","example":"1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11","in":"path","name":"vault-selector","required":true,"schema":{"example":"1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11","format":"<chain_id>:<vault_address>","type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"data":{"assets":"0","chain_id":1,"last_indexed_block":"25475349","shares":"0","user_address":"0xABcdEFABcdEFabcdEfAbCdefabcdeFABcDEFabCD","vault_address":"0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11"}},"schema":{"$ref":"#/components/schemas/UserVaultV2PositionResponse"}}},"description":""},"404":{"description":"The selected vault does not exist on this chain."}},"summary":"User V2 vault position","tags":["Vaults V2"],"x-codeSamples":[{"label":"cURL","lang":"bash","source":"BASE_URL=\"${CORE_REST_BASE_URL:-https://api.morpho.org}\"\nMORPHO_API_KEY=\"<MORPHO_API_KEY>\"\nVAULT_SELECTOR=\"1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11\"\nUSER_ADDRESS=\"0xabcdefabcdefabcdefabcdefabcdefabcdefabcd\"\n\ncurl -sS \"${BASE_URL}/v0/vaults-v2/${VAULT_SELECTOR}/users/${USER_ADDRESS}/position\" \\\n  -H \"accept: application/json\" \\\n  -H \"x-api-key: ${MORPHO_API_KEY}\"","id":"curl"},{"label":"JavaScript","lang":"js","source":"const baseUrl = process.env.CORE_REST_BASE_URL ?? \"https://api.morpho.org\";\nconst apiKey = process.env.MORPHO_API_KEY ?? \"<MORPHO_API_KEY>\";\nconst vaultSelector = \"1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11\";\nconst userAddress = \"0xabcdefabcdefabcdefabcdefabcdefabcdefabcd\";\n\nconst url = new URL(`${baseUrl}/v0/vaults-v2/${vaultSelector}/users/${userAddress}/position`);\n\nconst response = await fetch(url, {\n  headers: {\n    accept: \"application/json\",\n    \"x-api-key\": apiKey,\n  },\n});\nif (!response.ok) throw new Error(await response.text());\n\nconst body = await response.json();","id":"js"}]}},"/v0/vaults-v2/{vault-selector}/users/{user-address}/position/activity":{"get":{"description":"Events that changed a user's share balance in a Morpho Vault V2, newest first, one row per event log.\n\nSigns: `deposit` and `shares_transfer_in` add shares, `withdraw` and `shares_transfer_out` remove them. Folding the whole feed with those signs returns the `shares` of the position endpoint at the same `last_indexed_block`; a partial window does not reconcile, and neither does the feed of a fee recipient, whose balance also grows through fee mints this endpoint does not emit.\n\n`assets` is never derived: it is present on `deposit` and `withdraw`, and absent on share transfers, whose ERC-20 log carries no asset amount.\n\nBundled transactions are reconciled: a share transfer to or from a bundler adapter that carries a bundled deposit or withdrawal is reported as that deposit or withdrawal.\n\nA self-transfer is omitted, since it changes no balance. Rows are therefore capped, not filled, by `limit`: keep paginating until `cursor` is null.\n\nCursors are bound to the selector and to the `type` filter of the request that produced them; replaying one with different filters returns 400.\n\nVault selector example: `1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11` (format: `<chain_id>:<vault_address>`; replace with the target vault).","operationId":"UserVaultV2PositionActivityController_getPositionActivity","parameters":[{"description":"Position owner address. Example: 0xabcdefabcdefabcdefabcdefabcdefabcdefabcd.","example":"0xabcdefabcdefabcdefabcdefabcdefabcdefabcd","in":"path","name":"user-address","required":true,"schema":{"example":"0xabcdefabcdefabcdefabcdefabcdefabcdefabcd","format":"address","type":"string"}},{"description":"Selector formatted as <chain_id>:<vault_address>. Example: 1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11.","example":"1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11","in":"path","name":"vault-selector","required":true,"schema":{"example":"1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11","format":"<chain_id>:<vault_address>","type":"string"}},{"description":"Maximum number of event logs to read.","in":"query","name":"limit","required":false,"schema":{"default":100,"maximum":1000,"minimum":1,"type":"integer"}},{"description":"Opaque cursor returned by a previous page.","in":"query","name":"cursor","required":false,"schema":{"type":"string"}},{"description":"Restrict the feed to the given event types.","in":"query","name":"type","required":false,"schema":{"items":{"enum":["deposit","withdraw","shares_transfer_in","shares_transfer_out"],"type":"string"},"maxItems":4,"type":"array"}}],"responses":{"200":{"content":{"application/json":{"example":{"cursor":null,"data":[{"block_number":"19840000","data":{"shares":"250000000000000000000","to_address":"0x3F32bC09d41eE699844F8296e806417D6bf61Bba"},"log_index":12,"timestamp":1715270400,"tx_hash":"0x4e3a9b0ff1c2d52d7e8c5e1d3b9a8f7e6c5b4a39281706f5e4d3c2b1a09f8e7d","type":"shares_transfer_out"},{"block_number":"19800500","data":{"assets":"302631578","shares":"300000000000000000000"},"log_index":4,"timestamp":1714796400,"tx_hash":"0x1f2e3d4c5b6a798807162534435261708f9e0d1c2b3a49586776859403f2e1d0","type":"withdraw"},{"block_number":"19750200","data":{"from_address":"0x8Ba1f109551bD432803012645Ac136ddd64DBA72","shares":"500000000000000000000"},"log_index":88,"timestamp":1714192800,"tx_hash":"0xa1b2c3d4e5f60718293a4b5c6d7e8f900112233445566778899aabbccddeeff0","type":"shares_transfer_in"},{"block_number":"19700100","data":{"assets":"1000000000","shares":"1000000000000000000000"},"log_index":30,"timestamp":1713591600,"tx_hash":"0x99887766554433221100ffeeddccbbaa99887766554433221100ffeeddccbbaa","type":"deposit"}],"last_indexed_block":"19847234","params":{"chain_id":1,"user_address":"0x0000000000000000000000000000000000000001","vault_address":"0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11"}},"schema":{"$ref":"#/components/schemas/UserVaultV2PositionActivityResponse"}}},"description":""}},"summary":"User V2 vault position activity","tags":["Vaults V2"],"x-codeSamples":[{"label":"cURL","lang":"bash","source":"BASE_URL=\"${CORE_REST_BASE_URL:-https://api.morpho.org}\"\nMORPHO_API_KEY=\"<MORPHO_API_KEY>\"\nVAULT_SELECTOR=\"1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11\"\nUSER_ADDRESS=\"0xabcdefabcdefabcdefabcdefabcdefabcdefabcd\"\n\ncurl -sS \"${BASE_URL}/v0/vaults-v2/${VAULT_SELECTOR}/users/${USER_ADDRESS}/position/activity\" \\\n  -H \"accept: application/json\" \\\n  -H \"x-api-key: ${MORPHO_API_KEY}\"","id":"curl"},{"label":"JavaScript","lang":"js","source":"const baseUrl = process.env.CORE_REST_BASE_URL ?? \"https://api.morpho.org\";\nconst apiKey = process.env.MORPHO_API_KEY ?? \"<MORPHO_API_KEY>\";\nconst vaultSelector = \"1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11\";\nconst userAddress = \"0xabcdefabcdefabcdefabcdefabcdefabcdefabcd\";\n\nconst url = new URL(`${baseUrl}/v0/vaults-v2/${vaultSelector}/users/${userAddress}/position/activity`);\n\nconst response = await fetch(url, {\n  headers: {\n    accept: \"application/json\",\n    \"x-api-key\": apiKey,\n  },\n});\nif (!response.ok) throw new Error(await response.text());\n\nconst body = await response.json();","id":"js"}]}},"/v0/vaults-v2/{vault-selector}/users/{user-address}/position/history":{"get":{"description":"A user's historical position in a Morpho Vault V2: shares held and the equivalent value in underlying assets.\n\nVault selector example: `1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11` (format: `<chain_id>:<vault_address>`; replace with the target vault).","operationId":"UserVaultV2PositionHistoryController_getPositionHistory","parameters":[{"description":"Position owner address. Example: 0xabcdefabcdefabcdefabcdefabcdefabcdefabcd.","example":"0xabcdefabcdefabcdefabcdefabcdefabcdefabcd","in":"path","name":"user-address","required":true,"schema":{"example":"0xabcdefabcdefabcdefabcdefabcdefabcdefabcd","format":"address","type":"string"}},{"description":"Selector formatted as <chain_id>:<vault_address>. Example: 1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11.","example":"1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11","in":"path","name":"vault-selector","required":true,"schema":{"example":"1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11","format":"<chain_id>:<vault_address>","type":"string"}},{"description":"Lookback period. Defaults to thirty_days. Historical sampling is selected automatically.","in":"query","name":"lookback","required":false,"schema":{"enum":["one_day","seven_days","thirty_days","ninety_days","one_year","inception"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"data":[{"assets":"1012000000","shares":"1000000000000000000000","timestamp":1729900800},{"assets":"1221000000","shares":"1200000000000000000000","timestamp":1729987200}],"last_indexed_block":"19847234","params":{"chain_id":"1","user_address":"0x0000000000000000000000000000000000000001","vault_address":"0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11"}},"schema":{"$ref":"#/components/schemas/UserVaultV2PositionHistoryResponse"}}},"description":""}},"summary":"User V2 vault position history","tags":["Vaults V2"],"x-codeSamples":[{"label":"cURL","lang":"bash","source":"BASE_URL=\"${CORE_REST_BASE_URL:-https://api.morpho.org}\"\nMORPHO_API_KEY=\"<MORPHO_API_KEY>\"\nVAULT_SELECTOR=\"1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11\"\nUSER_ADDRESS=\"0xabcdefabcdefabcdefabcdefabcdefabcdefabcd\"\n\ncurl -sS \"${BASE_URL}/v0/vaults-v2/${VAULT_SELECTOR}/users/${USER_ADDRESS}/position/history?lookback=thirty_days\" \\\n  -H \"accept: application/json\" \\\n  -H \"x-api-key: ${MORPHO_API_KEY}\"","id":"curl"},{"label":"JavaScript","lang":"js","source":"const baseUrl = process.env.CORE_REST_BASE_URL ?? \"https://api.morpho.org\";\nconst apiKey = process.env.MORPHO_API_KEY ?? \"<MORPHO_API_KEY>\";\nconst vaultSelector = \"1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11\";\nconst userAddress = \"0xabcdefabcdefabcdefabcdefabcdefabcdefabcd\";\n\nconst url = new URL(`${baseUrl}/v0/vaults-v2/${vaultSelector}/users/${userAddress}/position/history`);\nurl.searchParams.set(\"lookback\", \"thirty_days\");\n\nconst response = await fetch(url, {\n  headers: {\n    accept: \"application/json\",\n    \"x-api-key\": apiKey,\n  },\n});\nif (!response.ok) throw new Error(await response.text());\n\nconst body = await response.json();","id":"js"}]}},"/v0/vaults-v2/{vault-selector}/users/{user-address}/position/performance":{"get":{"description":"Realized + unrealized earnings of a user's Morpho Vault V2 position. Uses the `average_cost` accounting method: per-user share-price differentials are accumulated against the running share balance, with transfers netted into the same balance so that earnings reflect the user's economic exposure rather than their on-chain transaction count. `return_on_capital` is the time-weighted ratio of net earnings to capital deployed over the holding period (non-annualised). When `as_of_date` is set, the cutoff is the start of that UTC day. For an open position, valuation uses the last hourly share-price history point or the user's last position change, whichever is later, at or before the cutoff; it is not block-exact. `as_of.timestamp` is the effective valuation timestamp. For a position fully exited before the cutoff it is the last position change and the value is final. Invalid or future dates and unsupported chains return 400; unavailable history returns 503 or 404.\n\nVault selector example: `1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11` (format: `<chain_id>:<vault_address>`; replace with the target vault).","operationId":"UserVaultV2PositionPerformanceController_getPerformance","parameters":[{"description":"Position owner address. Example: 0xabcdefabcdefabcdefabcdefabcdefabcdefabcd.","example":"0xabcdefabcdefabcdefabcdefabcdefabcdefabcd","in":"path","name":"user-address","required":true,"schema":{"example":"0xabcdefabcdefabcdefabcdefabcdefabcdefabcd","format":"address","type":"string"}},{"description":"Selector formatted as <chain_id>:<vault_address>. Example: 1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11.","example":"1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11","in":"path","name":"vault-selector","required":true,"schema":{"example":"1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11","format":"<chain_id>:<vault_address>","type":"string"}},{"description":"UTC calendar date in YYYY-MM-DD format; returns performance through 00:00:00Z on that date. Future dates are not supported.","in":"query","name":"as_of_date","required":false,"schema":{"example":"2024-05-17","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$","type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"data":{"accounting_method":"average_cost","chain_id":1,"last_indexed_block":"25475349","net_earnings_assets":"0","return_on_capital":null,"user_address":"0xABcdEFABcdEFabcdEfAbCdefabcdeFABcDEFabCD","vault_address":"0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11"}},"schema":{"$ref":"#/components/schemas/UserVaultV2PositionPerformanceResponse"}}},"description":""}},"summary":"User V2 vault position performance","tags":["Vaults V2"],"x-codeSamples":[{"label":"cURL","lang":"bash","source":"BASE_URL=\"${CORE_REST_BASE_URL:-https://api.morpho.org}\"\nMORPHO_API_KEY=\"<MORPHO_API_KEY>\"\nVAULT_SELECTOR=\"1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11\"\nUSER_ADDRESS=\"0xabcdefabcdefabcdefabcdefabcdefabcdefabcd\"\n\ncurl -sS \"${BASE_URL}/v0/vaults-v2/${VAULT_SELECTOR}/users/${USER_ADDRESS}/position/performance\" \\\n  -H \"accept: application/json\" \\\n  -H \"x-api-key: ${MORPHO_API_KEY}\"","id":"curl"},{"label":"JavaScript","lang":"js","source":"const baseUrl = process.env.CORE_REST_BASE_URL ?? \"https://api.morpho.org\";\nconst apiKey = process.env.MORPHO_API_KEY ?? \"<MORPHO_API_KEY>\";\nconst vaultSelector = \"1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11\";\nconst userAddress = \"0xabcdefabcdefabcdefabcdefabcdefabcdefabcd\";\n\nconst url = new URL(`${baseUrl}/v0/vaults-v2/${vaultSelector}/users/${userAddress}/position/performance`);\n\nconst response = await fetch(url, {\n  headers: {\n    accept: \"application/json\",\n    \"x-api-key\": apiKey,\n  },\n});\nif (!response.ok) throw new Error(await response.text());\n\nconst body = await response.json();","id":"js"}]}},"/v0/vaults-v2/{vault-selector}/withdrawal-options":{"get":{"description":"Immediately available assets and adapter-level force-deallocation capacity and penalty rates for a Morpho Vault V2.\n\nVault selector example: `1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11` (format: `<chain_id>:<vault_address>`; replace with the target vault).","operationId":"VaultV2WithdrawalOptionsController_getWithdrawalOptions","parameters":[{"description":"Selector formatted as <chain_id>:<vault_address>. Example: 1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11.","example":"1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11","in":"path","name":"vault-selector","required":true,"schema":{"example":"1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11","format":"<chain_id>:<vault_address>","type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"data":{"adapter_penalties":[{"adapter_address":"0x1111111111111111111111111111111111111111","adapter_kind":"blue_market_adapter","force_deallocatable_assets":"60000000000000","penalty_rate_wad":"5000000000000000"}],"chain_id":1,"idle_assets":"12500000000000","liquidity_adapter_available_assets":"12500000000000","vault_address":"0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11"}},"schema":{"$ref":"#/components/schemas/VaultV2WithdrawalOptionsResponse"}}},"description":""}},"summary":"Get V2 vault withdrawal options","tags":["Vaults V2"],"x-codeSamples":[{"label":"cURL","lang":"bash","source":"BASE_URL=\"${CORE_REST_BASE_URL:-https://api.morpho.org}\"\nMORPHO_API_KEY=\"<MORPHO_API_KEY>\"\nVAULT_SELECTOR=\"1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11\"\n\ncurl -sS \"${BASE_URL}/v0/vaults-v2/${VAULT_SELECTOR}/withdrawal-options\" \\\n  -H \"accept: application/json\" \\\n  -H \"x-api-key: ${MORPHO_API_KEY}\"","id":"curl"},{"label":"JavaScript","lang":"js","source":"const baseUrl = process.env.CORE_REST_BASE_URL ?? \"https://api.morpho.org\";\nconst apiKey = process.env.MORPHO_API_KEY ?? \"<MORPHO_API_KEY>\";\nconst vaultSelector = \"1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11\";\n\nconst url = new URL(`${baseUrl}/v0/vaults-v2/${vaultSelector}/withdrawal-options`);\n\nconst response = await fetch(url, {\n  headers: {\n    accept: \"application/json\",\n    \"x-api-key\": apiKey,\n  },\n});\nif (!response.ok) throw new Error(await response.text());\n\nconst body = await response.json();","id":"js"}]}},"/v1/vaults-v2/{vault-selector}/apy-averages":{"get":{"description":"Realized average APY of a Morpho Vault V2 over a predefined lookback period, derived from share price evolution.\n\nVault selector example: `1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11` (format: `<chain_id>:<vault_address>`; replace with the target vault).","operationId":"VaultV2ApyAveragesController_getApyAverages","parameters":[{"description":"Selector formatted as <chain_id>:<vault_address>. Example: 1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11.","example":"1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11","in":"path","name":"vault-selector","required":true,"schema":{"example":"1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11","format":"<chain_id>:<vault_address>","type":"string"}},{"description":"Lookback period for the APY calculation. Defaults to `six_hours`.","in":"query","name":"lookback","required":false,"schema":{"enum":["one_hour","six_hours","one_day","seven_days","thirty_days","ninety_days","one_year","inception"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"data":{"apy":0.021513718810443165,"chain_id":1,"last_indexed_block":"25475349","lookback":"six_hours","vault_address":"0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11"}},"schema":{"$ref":"#/components/schemas/VaultV2ApyAveragesResponse"}}},"description":""}},"summary":"Get V2 vault realized average APY","tags":["Vaults V2"],"x-codeSamples":[{"label":"cURL","lang":"bash","source":"BASE_URL=\"${CORE_REST_BASE_URL:-https://api.morpho.org}\"\nMORPHO_API_KEY=\"<MORPHO_API_KEY>\"\nVAULT_SELECTOR=\"1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11\"\n\ncurl -sS \"${BASE_URL}/v1/vaults-v2/${VAULT_SELECTOR}/apy-averages?lookback=six_hours\" \\\n  -H \"accept: application/json\" \\\n  -H \"x-api-key: ${MORPHO_API_KEY}\"","id":"curl"},{"label":"JavaScript","lang":"js","source":"const baseUrl = process.env.CORE_REST_BASE_URL ?? \"https://api.morpho.org\";\nconst apiKey = process.env.MORPHO_API_KEY ?? \"<MORPHO_API_KEY>\";\nconst vaultSelector = \"1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11\";\n\nconst url = new URL(`${baseUrl}/v1/vaults-v2/${vaultSelector}/apy-averages`);\nurl.searchParams.set(\"lookback\", \"six_hours\");\n\nconst response = await fetch(url, {\n  headers: {\n    accept: \"application/json\",\n    \"x-api-key\": apiKey,\n  },\n});\nif (!response.ok) throw new Error(await response.text());\n\nconst body = await response.json();","id":"js"}]}},"/v1/vaults-v2/{vault-selector}/state":{"get":{"description":"Live state of a Morpho Vault V2: total assets and shares, withdrawable assets, allocated assets, and idle assets.\n\nVault selector example: `1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11` (format: `<chain_id>:<vault_address>`; replace with the target vault).","operationId":"VaultV2StateController_getState","parameters":[{"description":"Selector formatted as <chain_id>:<vault_address>. Example: 1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11.","example":"1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11","in":"path","name":"vault-selector","required":true,"schema":{"example":"1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11","format":"<chain_id>:<vault_address>","type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"data":{"address":"0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11","allocated_assets":"64630689825420","chain_id":1,"idle_assets":"0","last_accrual_timestamp":1783363079,"last_indexed_block":"25475349","share_price_ray":"1010120008024709698799907272","total_assets":"64630689825420","total_supply":"63983179535078553542936844","withdrawable_assets":"8833322907237"}},"schema":{"$ref":"#/components/schemas/VaultV2StateResponse"}}},"description":""}},"summary":"Get V2 vault state","tags":["Vaults V2"],"x-codeSamples":[{"label":"cURL","lang":"bash","source":"BASE_URL=\"${CORE_REST_BASE_URL:-https://api.morpho.org}\"\nMORPHO_API_KEY=\"<MORPHO_API_KEY>\"\nVAULT_SELECTOR=\"1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11\"\n\ncurl -sS \"${BASE_URL}/v1/vaults-v2/${VAULT_SELECTOR}/state\" \\\n  -H \"accept: application/json\" \\\n  -H \"x-api-key: ${MORPHO_API_KEY}\"","id":"curl"},{"label":"JavaScript","lang":"js","source":"const baseUrl = process.env.CORE_REST_BASE_URL ?? \"https://api.morpho.org\";\nconst apiKey = process.env.MORPHO_API_KEY ?? \"<MORPHO_API_KEY>\";\nconst vaultSelector = \"1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11\";\n\nconst url = new URL(`${baseUrl}/v1/vaults-v2/${vaultSelector}/state`);\n\nconst response = await fetch(url, {\n  headers: {\n    accept: \"application/json\",\n    \"x-api-key\": apiKey,\n  },\n});\nif (!response.ok) throw new Error(await response.text());\n\nconst body = await response.json();","id":"js"}]}},"/v0/midnight/markets/{market-id}/transactions":{"get":{"description":"Cursor-paginated feed of Midnight economic transactions for one market.\n\n**Scope.** Includes `borrow`, `lend`, `exit_lend_primary`, `exit_lend_secondary`, `exit_borrow_primary`, `exit_borrow_secondary`, `partial_liquidation`, `full_liquidation`, `withdraw_collateral`, `supply_collateral`, and `roll`. Admin, authorization, fee, flashloan, accounting-only, and market creation activity is excluded from v0.\n\n**Trade actions.** A single trade can affect both the lender and borrower side. Market-level queries can therefore return multiple API items for the same transaction, while account queries return only the items affecting that account. For trade items, `data.assets` is the loan-token amount attributed to the item; `buyer_assets`, `seller_assets`, `take_units`, and `total_units_delta` describe the full trade.\n\n**Filters.** `:market-id` constrains the market and is globally unique across chains. `chain_ids` is optional and can further narrow the query.\n\n**Pagination.** Response follows the list envelope: `{ cursor, data }`. Pass back `cursor` verbatim on the next call. A `null` cursor means the last page. Ordering is fixed to `created_at` with deterministic tie-breakers.\n\n**Cache.** `public, max-age=2, stale-while-revalidate=1`.","operationId":"MidnightActivityController_listMarketTransactions","parameters":[{"name":"market-id","required":true,"in":"path","description":"Midnight market id.","schema":{"type":"string","example":"0xcc9418ea594c6e658650aedd205ce4544b266b69493f56fd2adc65c14bd06738"},"example":"0xcc9418ea594c6e658650aedd205ce4544b266b69493f56fd2adc65c14bd06738"},{"name":"chain_ids","required":false,"in":"query","description":"Filter by chain ids. Supported chains: Ethereum (1), Base (8453), Arc (5042), Robinhood Chain (4663), Tempo (4217), and Arbitrum (42161).","schema":{"maxItems":100,"type":"array","items":{"type":"integer","exclusiveMinimum":true,"maximum":9007199254740991,"minimum":0,"enum":[1,8453,5042,4663,4217,42161]}}},{"name":"event_types","required":false,"in":"query","description":"Filter by transaction event type.","schema":{"maxItems":100,"type":"array","items":{"type":"string","enum":["borrow","lend","exit_lend_primary","exit_lend_secondary","exit_borrow_primary","exit_borrow_secondary","partial_liquidation","full_liquidation","withdraw_collateral","supply_collateral","roll"]}}},{"name":"loan_assets","required":false,"in":"query","description":"Filter by market loan token addresses. Combine with chain_ids.","schema":{"maxItems":100,"type":"array","items":{"type":"string"}}},{"name":"collateral_assets","required":false,"in":"query","description":"Filter by collateral token addresses. Combine with chain_ids.","schema":{"maxItems":100,"type":"array","items":{"type":"string"}}},{"name":"created_at_gte","required":false,"in":"query","description":"Filter for transaction timestamps greater than or equal to this unix timestamp.","schema":{"anyOf":[{"type":"string","maxLength":16,"pattern":"^\\d+$"},{"type":"integer","minimum":0,"maximum":9007199254740991}]}},{"name":"created_at_lte","required":false,"in":"query","description":"Filter for transaction timestamps less than or equal to this unix timestamp.","schema":{"anyOf":[{"type":"string","maxLength":16,"pattern":"^\\d+$"},{"type":"integer","minimum":0,"maximum":9007199254740991}]}},{"name":"tx_hash","required":false,"in":"query","description":"Filter by tx hash.","schema":{"type":"string"}},{"name":"sort_direction","required":false,"in":"query","description":"Sort direction for cursor pagination. Ordering is by created_at with deterministic tie-breakers.","schema":{"default":"desc","type":"string","enum":["asc","desc"]}},{"name":"limit","required":false,"in":"query","description":"Maximum number of transactions to return.","schema":{"minimum":1,"maximum":1000,"default":100,"type":"integer"}},{"name":"cursor","required":false,"in":"query","description":"Opaque cursor from a previous page response.","schema":{"minLength":1,"maxLength":4096,"type":"string"}}],"responses":{"200":{"description":"Cursor-paginated list of Midnight market transactions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransactionsResponse"},"example":{"cursor":"eyJkIjoiZGVzYyIsInQiOiIxNzgzNjA2NjQ3IiwiYyI6ODQ1MywiYiI6IjQ4NDA4NjUwIiwieCI6MTgyLCJsIjo0NTcsImEiOjEsImgiOiIweDMzN2JiYWNhYTJkMDE0ODc0ZjBhMjRlOGIwODdlNTY2MmRjZmExN2Y2ZmNmYjFhNTNhZTE0ODcyMTg3MjYxNjciLCJlIjoic3VwcGx5X2NvbGxhdGVyYWwifQ","data":[{"id":"0048408700-a3c10-000201:1","chain_id":8453,"market_id":"0xcc9418ea594c6e658650aedd205ce4544b266b69493f56fd2adc65c14bd06738","event_type":"roll","tx_hash":"0x7b14e43d5ee70317395381ca6944b70b9436eb24a8709a87c1940c76e9708ca0","data":{"account":"0x535690CB1330232dd4f2ac5B724040751bdF4C91","caller":"0x3f60566413487406F80572A4Eb91163aC097E415","blue_market_id":"0x8f9f10e18b7ce37cf0607f54851072dbfd535054c6fbb7588d58bd773ce7b62b","config_id":"0x5294d456cf93e551c548d0163434bf680c901f9b7dda755a45e8bce86b76b079","debt_assets":"80000000000000","collateral_assets":"1000000","incentive_assets":"400000000000"},"created_at":1783606700},{"id":"0048408650-fe33f-000460:4","chain_id":8453,"market_id":"0xcc9418ea594c6e658650aedd205ce4544b266b69493f56fd2adc65c14bd06738","event_type":"borrow","tx_hash":"0x337bbacaa2d014874f0a24e8b087e5662dcfa17f6fcfb1a53ae1487218726167","data":{"account":"0x535690CB1330232dd4f2ac5B724040751bdF4C91","caller":"0x3f60566413487406F80572A4Eb91163aC097E415","maker":"0x958eB498a4172EA513c79b09E7f064070C5b1917","taker":"0x535690CB1330232dd4f2ac5B724040751bdF4C91","buyer":"0x958eB498a4172EA513c79b09E7f064070C5b1917","seller":"0x535690CB1330232dd4f2ac5B724040751bdF4C91","buyer_assets":"80000000000000","seller_assets":"80000000000000","assets":"80000000000000","units":"80001344022580","take_units":"80001344022580","buyer_pending_fee_increase":"0","seller_pending_fee_decrease":"0","total_units_delta":"80001344022580","payer":"0x958eB498a4172EA513c79b09E7f064070C5b1917","receiver":"0x535690CB1330232dd4f2ac5B724040751bdF4C91","group":"0xe6ceb8a150e3da1ade87bc6308a293149b1f6d10a204bb7883dd6e328b9bf674","consumed":"80000000000000"},"created_at":1783606647},{"id":"0048408650-fe33f-000460:2","chain_id":8453,"market_id":"0xcc9418ea594c6e658650aedd205ce4544b266b69493f56fd2adc65c14bd06738","event_type":"lend","tx_hash":"0x337bbacaa2d014874f0a24e8b087e5662dcfa17f6fcfb1a53ae1487218726167","data":{"account":"0x958eB498a4172EA513c79b09E7f064070C5b1917","caller":"0x3f60566413487406F80572A4Eb91163aC097E415","maker":"0x958eB498a4172EA513c79b09E7f064070C5b1917","taker":"0x535690CB1330232dd4f2ac5B724040751bdF4C91","buyer":"0x958eB498a4172EA513c79b09E7f064070C5b1917","seller":"0x535690CB1330232dd4f2ac5B724040751bdF4C91","buyer_assets":"80000000000000","seller_assets":"80000000000000","assets":"80000000000000","units":"80001344022580","take_units":"80001344022580","buyer_pending_fee_increase":"0","seller_pending_fee_decrease":"0","total_units_delta":"80001344022580","payer":"0x958eB498a4172EA513c79b09E7f064070C5b1917","receiver":"0x535690CB1330232dd4f2ac5B724040751bdF4C91","group":"0xe6ceb8a150e3da1ade87bc6308a293149b1f6d10a204bb7883dd6e328b9bf674","consumed":"80000000000000"},"created_at":1783606647},{"id":"0048408650-fe33f-000457:1","chain_id":8453,"market_id":"0xcc9418ea594c6e658650aedd205ce4544b266b69493f56fd2adc65c14bd06738","event_type":"supply_collateral","tx_hash":"0x337bbacaa2d014874f0a24e8b087e5662dcfa17f6fcfb1a53ae1487218726167","data":{"account":"0x535690CB1330232dd4f2ac5B724040751bdF4C91","caller":"0x3f60566413487406F80572A4Eb91163aC097E415","on_behalf":"0x535690CB1330232dd4f2ac5B724040751bdF4C91","collateral":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","assets":"1000000"},"created_at":1783606647}]}}}},"400":{"description":"`VALIDATION_FAILED` — request parameters failed validation. `INVALID_CURSOR` — the provided cursor is malformed or was produced by a different sort direction.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightErrorResponse"},"examples":{"validationFailed":{"summary":"Validation failed","value":{"error":{"code":"VALIDATION_FAILED","message":"Validation failed","details":[{"code":"invalid_type","message":"Expected number, received string","path":["chain_ids",0]}],"request_id":"f0e1d2c3-b4a5-4968-8728-1c0d1e2f3a4b"}}},"requestError":{"summary":"INVALID_CURSOR","value":{"error":{"code":"INVALID_CURSOR","message":"cursor sort direction does not match request sort direction","details":null,"request_id":"f0e1d2c3-b4a5-4968-8728-1c0d1e2f3a4b"}}}}}}},"500":{"description":"`INTERNAL_ERROR` — the request failed due to an unexpected server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightErrorResponse"},"example":{"error":{"code":"INTERNAL_ERROR","message":"Internal server error","details":null,"request_id":"f0e1d2c3-b4a5-4968-8728-1c0d1e2f3a4b"}}}}}},"summary":"List market transactions","tags":["Transactions"],"x-codeSamples":[{"lang":"bash","label":"cURL","source":"BASE_URL='https://api.morpho.org'\nMARKET_ID=\"0xcc9418ea594c6e658650aedd205ce4544b266b69493f56fd2adc65c14bd06738\"\n\ncurl -sS \"${BASE_URL}/v0/midnight/markets/${MARKET_ID}/transactions?chain_ids=1\" \\\n  -H \"accept: application/json\"","id":"curl"},{"lang":"js","label":"JavaScript","source":"const baseUrl = \"https://api.morpho.org\";\nconst marketId = \"0xcc9418ea594c6e658650aedd205ce4544b266b69493f56fd2adc65c14bd06738\";\n\nconst url = new URL(`${baseUrl}/v0/midnight/markets/${marketId}/transactions`);\nurl.searchParams.set(\"chain_ids\", \"1\");\n\nconst response = await fetch(url, {\n  headers: {\n    accept: \"application/json\",\n  },\n});\nif (!response.ok) throw new Error(await response.text());\n\nconst body = await response.json();","id":"js"}]}},"/v0/midnight/users/{user-address}/transactions":{"get":{"description":"Cursor-paginated feed of Midnight economic transactions affecting one user.\n\n**Scope.** Includes `borrow`, `lend`, `exit_lend_primary`, `exit_lend_secondary`, `exit_borrow_primary`, `exit_borrow_secondary`, `partial_liquidation`, `full_liquidation`, `withdraw_collateral`, `supply_collateral`, and `roll`. Admin, authorization, fee, flashloan, accounting-only, and market creation activity is excluded from v0.\n\n**Affected account.** This endpoint returns only items affecting `:user-address`: buyer/seller for trades, `on_behalf` for primary exits and collateral actions, borrower for liquidations, and the refinanced borrower for rolls. For trade items, `data.assets` is the loan-token amount attributed to the item; `buyer_assets`, `seller_assets`, `take_units`, and `total_units_delta` describe the full trade.\n\n**Filters.** `:user-address` constrains the affected account across supported chains. `chain_ids` is optional and can further narrow the query. `market_family_ids` selects transactions on created sibling markets and combines with `market_ids` using AND semantics. `maturities` matches the transaction market's exact maturity timestamps in unix seconds. `maturity_gte` and `maturity_lte` bound the transaction market's maturity, inclusive, in unix seconds. Markets with no maturity deadline have maturity `0`: their transactions match any `maturity_lte` and are excluded by `maturity_gte` of `1` or more. `group_id` matches `data.group` on take-derived transactions; non-take transactions do not match. `listed=true` keeps only transactions on listed markets; `listed=false` keeps only transactions on unlisted markets.\n\n**Pagination.** Response follows the list envelope: `{ cursor, data }`. Pass back `cursor` verbatim on the next call. A `null` cursor means the last page. Ordering is fixed to `created_at` with deterministic tie-breakers.\n\n**Cache.** `public, max-age=2, stale-while-revalidate=1`.","operationId":"MidnightActivityController_listUserTransactions","parameters":[{"name":"user-address","required":true,"in":"path","description":"User address whose transactions should be listed.","schema":{"type":"string","example":"0xd4F43105098845fFE89B16E7A3DCdd0A31898118"},"example":"0xd4F43105098845fFE89B16E7A3DCdd0A31898118"},{"name":"chain_ids","required":false,"in":"query","description":"Filter by chain ids. Supported chains: Ethereum (1), Base (8453), Arc (5042), Robinhood Chain (4663), Tempo (4217), and Arbitrum (42161).","schema":{"maxItems":100,"type":"array","items":{"type":"integer","exclusiveMinimum":true,"maximum":9007199254740991,"minimum":0,"enum":[1,8453,5042,4663,4217,42161]}}},{"name":"event_types","required":false,"in":"query","description":"Filter by transaction event type.","schema":{"maxItems":100,"type":"array","items":{"type":"string","enum":["borrow","lend","exit_lend_primary","exit_lend_secondary","exit_borrow_primary","exit_borrow_secondary","partial_liquidation","full_liquidation","withdraw_collateral","supply_collateral","roll"]}}},{"name":"loan_assets","required":false,"in":"query","description":"Filter by market loan token addresses. Combine with chain_ids.","schema":{"maxItems":100,"type":"array","items":{"type":"string"}}},{"name":"collateral_assets","required":false,"in":"query","description":"Filter by collateral token addresses. Combine with chain_ids.","schema":{"maxItems":100,"type":"array","items":{"type":"string"}}},{"name":"created_at_gte","required":false,"in":"query","description":"Filter for transaction timestamps greater than or equal to this unix timestamp.","schema":{"anyOf":[{"type":"string","maxLength":16,"pattern":"^\\d+$"},{"type":"integer","minimum":0,"maximum":9007199254740991}]}},{"name":"created_at_lte","required":false,"in":"query","description":"Filter for transaction timestamps less than or equal to this unix timestamp.","schema":{"anyOf":[{"type":"string","maxLength":16,"pattern":"^\\d+$"},{"type":"integer","minimum":0,"maximum":9007199254740991}]}},{"name":"tx_hash","required":false,"in":"query","description":"Filter by tx hash.","schema":{"type":"string"}},{"name":"sort_direction","required":false,"in":"query","description":"Sort direction for cursor pagination. Ordering is by created_at with deterministic tie-breakers.","schema":{"default":"desc","type":"string","enum":["asc","desc"]}},{"name":"limit","required":false,"in":"query","description":"Maximum number of transactions to return.","schema":{"minimum":1,"maximum":1000,"default":100,"type":"integer"}},{"name":"cursor","required":false,"in":"query","description":"Opaque cursor from a previous page response.","schema":{"minLength":1,"maxLength":4096,"type":"string"}},{"name":"market_ids","required":false,"in":"query","description":"Filter by Midnight market ids.","schema":{"maxItems":100,"type":"array","items":{"type":"string"}}},{"name":"market_family_ids","required":false,"in":"query","description":"Filter by Midnight market family ids. Combined with market_ids using AND semantics.","schema":{"maxItems":100,"type":"array","items":{"type":"string"}}},{"name":"maturities","required":false,"in":"query","description":"Filter by the transaction market's exact maturity timestamps, in unix seconds.","schema":{"maxItems":100,"type":"array","items":{"anyOf":[{"type":"string","maxLength":16,"pattern":"^\\d+$"},{"type":"integer","minimum":0,"maximum":9007199254740991}]}}},{"name":"maturity_gte","required":false,"in":"query","description":"Filter for the transaction market's maturity greater than or equal to this unix timestamp. Markets with no maturity deadline have maturity 0, so their transactions match any maturity_lte and are excluded by maturity_gte of 1 or more.","schema":{"anyOf":[{"type":"string","maxLength":16,"pattern":"^\\d+$"},{"type":"integer","minimum":0,"maximum":9007199254740991}]}},{"name":"maturity_lte","required":false,"in":"query","description":"Filter for the transaction market's maturity less than or equal to this unix timestamp. Markets with no maturity deadline have maturity 0, so their transactions match any maturity_lte and are excluded by maturity_gte of 1 or more.","schema":{"anyOf":[{"type":"string","maxLength":16,"pattern":"^\\d+$"},{"type":"integer","minimum":0,"maximum":9007199254740991}]}},{"name":"group_id","required":false,"in":"query","description":"Filter by offer group id. Matches data.group on take-derived transactions; non-take transactions do not match.","schema":{"type":"string"}},{"name":"listed","required":false,"in":"query","description":"Filter by market listing status. When true, returns only transactions on listed markets; when false, only transactions on unlisted markets. Omit to return both.","schema":{"type":"string","enum":["true","false"]}}],"responses":{"200":{"description":"Cursor-paginated list of Midnight user transactions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransactionsResponse"},"example":{"cursor":"eyJkIjoiZGVzYyIsInQiOiIxNzgzNTQ1MDE3IiwiYyI6ODQ1MywiYiI6IjQ4Mzc3ODM1IiwieCI6MzM4LCJsIjozNTIsImEiOjIsImgiOiIweDljMGI5Y2UxNTE5ZjMzMDhiZDViNmI1NmMxMTc4MDgwODhjNDhmOTNhMGY5N2JlMDQ3ZTVlZjkxYjZkYjY4YTAiLCJlIjoibGVuZCJ9","data":[{"id":"0048378373-743cf-000167:2","chain_id":8453,"market_id":"0x9ce1a0a9e5ca28a5333cec7a14d08afbab7fe1eb3a55024b3ae88f2d3bdcc229","event_type":"lend","tx_hash":"0x59a11252d53e57e6b00f74362ee0cc73007168916fff4988fd16cf8eeb4cf95d","data":{"account":"0xd4F43105098845fFE89B16E7A3DCdd0A31898118","caller":"0x3f60566413487406F80572A4Eb91163aC097E415","maker":"0xd4F43105098845fFE89B16E7A3DCdd0A31898118","taker":"0x0388895353b98B81234347E17D1eE6c9268F3D50","buyer":"0xd4F43105098845fFE89B16E7A3DCdd0A31898118","seller":"0x0388895353b98B81234347E17D1eE6c9268F3D50","buyer_assets":"309631","seller_assets":"309631","assets":"309631","units":"309641","take_units":"309641","buyer_pending_fee_increase":"0","seller_pending_fee_decrease":"0","total_units_delta":"309641","payer":"0xc0b438Bbf5a8cC4e57C0D81e1818C069e413DdDf","receiver":"0x0388895353b98B81234347E17D1eE6c9268F3D50","group":"0x74656e6f720101869f52995f061617c55e88ad1ab1211d2e85ff9715bb72c22e","consumed":"23999631"},"created_at":1783546093},{"id":"0048377999-c6f6f-000097:2","chain_id":8453,"market_id":"0xa4030043fce4483aa527a225608e6eb27be7c16a062073b297941c5f72c032d2","event_type":"lend","tx_hash":"0xfa76a9faf38f0281cdd826f8f18325eed940cfa2b05ec811194635041848fbb4","data":{"account":"0xd4F43105098845fFE89B16E7A3DCdd0A31898118","caller":"0x3f60566413487406F80572A4Eb91163aC097E415","maker":"0xd4F43105098845fFE89B16E7A3DCdd0A31898118","taker":"0x5F2F456266831DbbE57D3845187A93e1BD5EF1ba","buyer":"0xd4F43105098845fFE89B16E7A3DCdd0A31898118","seller":"0x5F2F456266831DbbE57D3845187A93e1BD5EF1ba","buyer_assets":"5002955","seller_assets":"5002955","assets":"5002955","units":"5007884","take_units":"5007884","buyer_pending_fee_increase":"0","seller_pending_fee_decrease":"0","total_units_delta":"5007884","payer":"0xd4F43105098845fFE89B16E7A3DCdd0A31898118","receiver":"0x3f60566413487406F80572A4Eb91163aC097E415","group":"0x74656e6f720100c34faf17861d5cc43cc10dc4920f7bb61267d86efa6898954c","consumed":"23305627"},"created_at":1783545345},{"id":"0048377835-7aee7-000352:2","chain_id":8453,"market_id":"0xa4030043fce4483aa527a225608e6eb27be7c16a062073b297941c5f72c032d2","event_type":"lend","tx_hash":"0x9c0b9ce1519f3308bd5b6b56c117808088c48f93a0f97be047e5ef91b6db68a0","data":{"account":"0xd4F43105098845fFE89B16E7A3DCdd0A31898118","caller":"0x3f60566413487406F80572A4Eb91163aC097E415","maker":"0xd4F43105098845fFE89B16E7A3DCdd0A31898118","taker":"0x5F2F456266831DbbE57D3845187A93e1BD5EF1ba","buyer":"0xd4F43105098845fFE89B16E7A3DCdd0A31898118","seller":"0x5F2F456266831DbbE57D3845187A93e1BD5EF1ba","buyer_assets":"16009469","seller_assets":"16009469","assets":"16009469","units":"16025242","take_units":"16025242","buyer_pending_fee_increase":"0","seller_pending_fee_decrease":"0","total_units_delta":"16025242","payer":"0xd4F43105098845fFE89B16E7A3DCdd0A31898118","receiver":"0x3f60566413487406F80572A4Eb91163aC097E415","group":"0x74656e6f720100c34faf17861d5cc43cc10dc4920f7bb61267d86efa6898954c","consumed":"18302672"},"created_at":1783545017}]}}}},"400":{"description":"`VALIDATION_FAILED` — request parameters failed validation. `INVALID_CURSOR` — the provided cursor is malformed or was produced by a different sort direction.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightErrorResponse"},"examples":{"validationFailed":{"summary":"Validation failed","value":{"error":{"code":"VALIDATION_FAILED","message":"Validation failed","details":[{"code":"invalid_type","message":"Expected number, received string","path":["chain_ids",0]}],"request_id":"f0e1d2c3-b4a5-4968-8728-1c0d1e2f3a4b"}}},"requestError":{"summary":"INVALID_CURSOR","value":{"error":{"code":"INVALID_CURSOR","message":"cursor sort direction does not match request sort direction","details":null,"request_id":"f0e1d2c3-b4a5-4968-8728-1c0d1e2f3a4b"}}}}}}},"500":{"description":"`INTERNAL_ERROR` — the request failed due to an unexpected server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightErrorResponse"},"example":{"error":{"code":"INTERNAL_ERROR","message":"Internal server error","details":null,"request_id":"f0e1d2c3-b4a5-4968-8728-1c0d1e2f3a4b"}}}}}},"summary":"List user transactions","tags":["Transactions"],"x-codeSamples":[{"lang":"bash","label":"cURL","source":"BASE_URL='https://api.morpho.org'\nUSER_ADDRESS=\"0xd4F43105098845fFE89B16E7A3DCdd0A31898118\"\n\ncurl -sS \"${BASE_URL}/v0/midnight/users/${USER_ADDRESS}/transactions?chain_ids=1\" \\\n  -H \"accept: application/json\"","id":"curl"},{"lang":"js","label":"JavaScript","source":"const baseUrl = \"https://api.morpho.org\";\nconst userAddress = \"0xd4F43105098845fFE89B16E7A3DCdd0A31898118\";\n\nconst url = new URL(`${baseUrl}/v0/midnight/users/${userAddress}/transactions`);\nurl.searchParams.set(\"chain_ids\", \"1\");\n\nconst response = await fetch(url, {\n  headers: {\n    accept: \"application/json\",\n  },\n});\nif (!response.ok) throw new Error(await response.text());\n\nconst body = await response.json();","id":"js"}]}},"/v0/midnight/markets":{"get":{"description":"Cursor-paginated list of Midnight markets.\n\n**Use this to discover markets.** For a given user's positions on those markets, follow up with `GET /v0/midnight/users/{user-address}/positions`.\n\n**Filters.** Address filters (`loan_assets`, `collateral_assets`, `oracle_addresses`, `enter_gates`, `liquidator_gates`) must be combined with `chain_ids` — an address alone is not chain-unique. Lowercase addresses are checksummed server-side. Pass `active_only=true` to exclude markets past maturity.\n\n**Pagination.** Response follows the list envelope: `{ cursor, data }`. Pass back `cursor` verbatim on the next call. A `null` `cursor` means the last page.\n\n**Cache.** `public, max-age=5, stale-while-revalidate=2`.","operationId":"MidnightMarketsController_list","parameters":[{"name":"chain_ids","required":false,"in":"query","description":"Filter by chain ids. Supported chains: Ethereum (1), Base (8453), Arc (5042), Robinhood Chain (4663), Tempo (4217), and Arbitrum (42161). Required when any address filter is provided.","schema":{"maxItems":100,"type":"array","items":{"type":"integer","exclusiveMinimum":true,"maximum":9007199254740991,"minimum":0,"enum":[1,8453,5042,4663,4217,42161]}}},{"name":"market_ids","required":false,"in":"query","description":"Filter by Midnight market ids. These ids are globally unique.","schema":{"maxItems":100,"type":"array","items":{"type":"string"}}},{"name":"market_family_ids","required":false,"in":"query","description":"Filter by Midnight market family ids. A family contains markets whose immutable parameters differ only by maturity.","schema":{"maxItems":100,"type":"array","items":{"type":"string"}}},{"name":"loan_assets","required":false,"in":"query","description":"Filter by loan token addresses. Combine with chain_ids; lowercase input is checksummed.","schema":{"maxItems":100,"type":"array","items":{"type":"string"}}},{"name":"collateral_assets","required":false,"in":"query","description":"Filter by collateral token addresses. Combine with chain_ids; lowercase input is checksummed.","schema":{"maxItems":100,"type":"array","items":{"type":"string"}}},{"name":"oracle_addresses","required":false,"in":"query","description":"Filter by collateral oracle addresses. Combine with chain_ids; lowercase input is checksummed.","schema":{"maxItems":100,"type":"array","items":{"type":"string"}}},{"name":"enter_gates","required":false,"in":"query","description":"Filter by enter gate addresses. Combine with chain_ids; lowercase input is checksummed.","schema":{"maxItems":100,"type":"array","items":{"type":"string"}}},{"name":"liquidator_gates","required":false,"in":"query","description":"Filter by liquidator gate addresses. Combine with chain_ids; lowercase input is checksummed.","schema":{"maxItems":100,"type":"array","items":{"type":"string"}}},{"name":"maturities","required":false,"in":"query","description":"Filter by exact maturity timestamps, in unix seconds.","schema":{"maxItems":100,"type":"array","items":{"anyOf":[{"type":"string","maxLength":16,"pattern":"^\\d+$"},{"type":"integer","minimum":0,"maximum":9007199254740991}]}}},{"name":"active_only","required":false,"in":"query","description":"When true, enforces maturity strictly after the current timestamp.","schema":{"type":"string","enum":["true","false"]}},{"name":"maturity_gte","required":false,"in":"query","description":"Filter for maturities greater than or equal to this unix timestamp.","schema":{"anyOf":[{"type":"string","maxLength":16,"pattern":"^\\d+$"},{"type":"integer","minimum":0,"maximum":9007199254740991}]}},{"name":"maturity_lte","required":false,"in":"query","description":"Filter for maturities less than or equal to this unix timestamp.","schema":{"anyOf":[{"type":"string","maxLength":16,"pattern":"^\\d+$"},{"type":"integer","minimum":0,"maximum":9007199254740991}]}},{"name":"total_units_gte","required":false,"in":"query","description":"Filter for total units greater than or equal to this value.","schema":{"pattern":"^\\d{1,78}$","type":"string"}},{"name":"total_units_lte","required":false,"in":"query","description":"Filter for total units less than or equal to this value.","schema":{"pattern":"^\\d{1,78}$","type":"string"}},{"name":"lend_depth_gte","required":false,"in":"query","description":"Filter for cached lend-side order-book depth, in loan-token units, greater than or equal to this value.","schema":{"pattern":"^\\d{1,78}$","type":"string"}},{"name":"lend_depth_lte","required":false,"in":"query","description":"Filter for cached lend-side order-book depth, in loan-token units, less than or equal to this value.","schema":{"pattern":"^\\d{1,78}$","type":"string"}},{"name":"borrow_depth_gte","required":false,"in":"query","description":"Filter for cached borrow-side order-book depth, in loan-token units, greater than or equal to this value.","schema":{"pattern":"^\\d{1,78}$","type":"string"}},{"name":"borrow_depth_lte","required":false,"in":"query","description":"Filter for cached borrow-side order-book depth, in loan-token units, less than or equal to this value.","schema":{"pattern":"^\\d{1,78}$","type":"string"}},{"name":"listed","required":false,"in":"query","description":"Filter by listing status. When true, returns only markets surfaced by the app trust layer; when false, only unlisted markets. Omit to return both.","schema":{"type":"string","enum":["true","false"]}},{"name":"sort_by","required":false,"in":"query","description":"Sort field for cursor pagination.","schema":{"default":"total_units","type":"string","enum":["total_units","maturity","lend_depth","borrow_depth"]}},{"name":"sort_direction","required":false,"in":"query","description":"Sort direction for cursor pagination.","schema":{"default":"desc","type":"string","enum":["asc","desc"]}},{"name":"limit","required":false,"in":"query","description":"Maximum number of items to return.","schema":{"minimum":1,"maximum":1000,"default":100,"type":"integer"}},{"name":"cursor","required":false,"in":"query","description":"Opaque cursor from a previous page response.","schema":{"minLength":1,"maxLength":4096,"type":"string"}}],"responses":{"200":{"description":"Cursor-paginated list of Midnight markets.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketsResponse"},"example":{"cursor":"eyJzIjoidG90YWxfdW5pdHMiLCJkIjoiZGVzYyIsInYiOiIxNDgxNDM5OTkyMDIwMDEzIiwidk51bGwiOmZhbHNlLCJpIjpbODQ1MywiMHhjYzk0MThlYTU5NGM2ZTY1ODY1MGFlZGQyMDVjZTQ1NDRiMjY2YjY5NDkzZjU2ZmQyYWRjNjVjMTRiZDA2NzM4Il0sImYiOiJSQk52bzFXelo0b1JScTBXOS1oa25wIn0","data":[{"chain_id":8453,"market_id":"0xcc9418ea594c6e658650aedd205ce4544b266b69493f56fd2adc65c14bd06738","market_family_id":"0x9a6ece688006fb810141501154acfd1aa29ae7ac3753452f4931a092f2653f1f","loan_token":"0x4200000000000000000000000000000000000006","maturity":1784300400,"rcf_threshold":"0","enter_gate":"0x0000000000000000000000000000000000000000","liquidator_gate":"0x0000000000000000000000000000000000000000","collaterals":[{"token":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","lltv":"860000000000000000","liquidation_cursor":"300000000000000000","oracle":"0xD09048c8B568Dbf5f189302beA26c9edABFC4858"}],"total_units":"1481439992020013","tick_granularity":4,"settlement_fee_schedule":[{"time_to_maturity_days":0,"fee_cbp":"0"},{"time_to_maturity_days":1,"fee_cbp":"0"},{"time_to_maturity_days":7,"fee_cbp":"0"},{"time_to_maturity_days":30,"fee_cbp":"0"},{"time_to_maturity_days":90,"fee_cbp":"0"},{"time_to_maturity_days":180,"fee_cbp":"0"},{"time_to_maturity_days":360,"fee_cbp":"0"}],"current_settlement_fee_wad":"0","current_settlement_fee_cbp":"0","continuous_fee_rate":"0","listed":false,"lend_depth":"400000000000000000","borrow_depth":"350000000000000000"}]}}}},"400":{"description":"`VALIDATION_FAILED` — request parameters failed validation. `INVALID_CURSOR` — the provided cursor is malformed or was produced by a different sort configuration.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightErrorResponse"},"examples":{"validationFailed":{"summary":"Validation failed","value":{"error":{"code":"VALIDATION_FAILED","message":"Validation failed","details":[{"code":"invalid_type","message":"Expected number, received string","path":["chain_ids",0]}],"request_id":"f0e1d2c3-b4a5-4968-8728-1c0d1e2f3a4b"}}},"requestError":{"summary":"INVALID_CURSOR","value":{"error":{"code":"INVALID_CURSOR","message":"cursor sort/direction does not match request sort/direction","details":null,"request_id":"f0e1d2c3-b4a5-4968-8728-1c0d1e2f3a4b"}}}}}}},"500":{"description":"`INTERNAL_ERROR` — the request failed due to an unexpected server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightErrorResponse"},"example":{"error":{"code":"INTERNAL_ERROR","message":"Internal server error","details":null,"request_id":"f0e1d2c3-b4a5-4968-8728-1c0d1e2f3a4b"}}}}}},"summary":"List markets","tags":["Markets"],"x-codeSamples":[{"lang":"bash","label":"cURL","source":"BASE_URL='https://api.morpho.org'\n\ncurl -sS \"${BASE_URL}/v0/midnight/markets?chain_ids=1\" \\\n  -H \"accept: application/json\"","id":"curl"},{"lang":"js","label":"JavaScript","source":"const baseUrl = \"https://api.morpho.org\";\n\nconst url = new URL(`${baseUrl}/v0/midnight/markets`);\nurl.searchParams.set(\"chain_ids\", \"1\");\n\nconst response = await fetch(url, {\n  headers: {\n    accept: \"application/json\",\n  },\n});\nif (!response.ok) throw new Error(await response.text());\n\nconst body = await response.json();","id":"js"}]}},"/v0/midnight/markets/{market-id}":{"get":{"description":"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.\n\nReturns 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.","operationId":"MidnightMarketsController_detail","parameters":[{"name":"market-id","required":true,"in":"path","description":"Midnight market id.","schema":{"type":"string","example":"0xcc9418ea594c6e658650aedd205ce4544b266b69493f56fd2adc65c14bd06738"},"example":"0xcc9418ea594c6e658650aedd205ce4544b266b69493f56fd2adc65c14bd06738"}],"responses":{"200":{"description":"Midnight market detail.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketDetailResponse"},"example":{"data":{"chain_id":8453,"market_id":"0xcc9418ea594c6e658650aedd205ce4544b266b69493f56fd2adc65c14bd06738","market_family_id":"0x9a6ece688006fb810141501154acfd1aa29ae7ac3753452f4931a092f2653f1f","loan_token":"0x4200000000000000000000000000000000000006","maturity":1784300400,"rcf_threshold":"0","enter_gate":"0x0000000000000000000000000000000000000000","liquidator_gate":"0x0000000000000000000000000000000000000000","collaterals":[{"token":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","lltv":"860000000000000000","liquidation_cursor":"300000000000000000","oracle":"0xD09048c8B568Dbf5f189302beA26c9edABFC4858"}]}}}}},"400":{"description":"`VALIDATION_FAILED` — request parameters failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightErrorResponse"},"example":{"error":{"code":"VALIDATION_FAILED","message":"Validation failed","details":[{"code":"invalid_string","message":"Invalid input","path":["market-id"]}],"request_id":"f0e1d2c3-b4a5-4968-8728-1c0d1e2f3a4b"}}}}},"404":{"description":"`MARKET_NOT_FOUND` — no market exists for this id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightErrorResponse"},"example":{"error":{"code":"MARKET_NOT_FOUND","message":"Market 0x0000000000000000000000000000000000000000000000000000000000000000 not found","details":null,"request_id":"f0e1d2c3-b4a5-4968-8728-1c0d1e2f3a4b"}}}}},"500":{"description":"`INTERNAL_ERROR` — the request failed due to an unexpected server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightErrorResponse"},"example":{"error":{"code":"INTERNAL_ERROR","message":"Internal server error","details":null,"request_id":"f0e1d2c3-b4a5-4968-8728-1c0d1e2f3a4b"}}}}}},"summary":"Get market","tags":["Markets"],"x-codeSamples":[{"lang":"bash","label":"cURL","source":"BASE_URL='https://api.morpho.org'\nMARKET_ID=\"0xcc9418ea594c6e658650aedd205ce4544b266b69493f56fd2adc65c14bd06738\"\n\ncurl -sS \"${BASE_URL}/v0/midnight/markets/${MARKET_ID}\" \\\n  -H \"accept: application/json\"","id":"curl"},{"lang":"js","label":"JavaScript","source":"const baseUrl = \"https://api.morpho.org\";\nconst marketId = \"0xcc9418ea594c6e658650aedd205ce4544b266b69493f56fd2adc65c14bd06738\";\n\nconst url = new URL(`${baseUrl}/v0/midnight/markets/${marketId}`);\n\nconst response = await fetch(url, {\n  headers: {\n    accept: \"application/json\",\n  },\n});\nif (!response.ok) throw new Error(await response.text());\n\nconst body = await response.json();","id":"js"}]}},"/v0/midnight/markets/{market-id}/state":{"get":{"description":"Dynamic state 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.\n\nReturns the market state inside a `data` envelope. Use `GET /v0/midnight/markets/{market-id}` for immutable market configuration. 404s when the id is unknown.","operationId":"MidnightMarketsController_state","parameters":[{"name":"market-id","required":true,"in":"path","description":"Midnight market id.","schema":{"type":"string","example":"0xcc9418ea594c6e658650aedd205ce4544b266b69493f56fd2adc65c14bd06738"},"example":"0xcc9418ea594c6e658650aedd205ce4544b266b69493f56fd2adc65c14bd06738"}],"responses":{"200":{"description":"Midnight market state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightMarketStateResponse"},"example":{"data":{"chain_id":8453,"market_id":"0xcc9418ea594c6e658650aedd205ce4544b266b69493f56fd2adc65c14bd06738","market_family_id":"0x9a6ece688006fb810141501154acfd1aa29ae7ac3753452f4931a092f2653f1f","total_units":"1481439992020013","tick_granularity":4,"settlement_fee_schedule":[{"time_to_maturity_days":0,"fee_cbp":"0"},{"time_to_maturity_days":1,"fee_cbp":"0"},{"time_to_maturity_days":7,"fee_cbp":"0"},{"time_to_maturity_days":30,"fee_cbp":"0"},{"time_to_maturity_days":90,"fee_cbp":"0"},{"time_to_maturity_days":180,"fee_cbp":"0"},{"time_to_maturity_days":360,"fee_cbp":"0"}],"current_settlement_fee_wad":"0","current_settlement_fee_cbp":"0","continuous_fee_rate":"0","last_indexed_block":"48408699"}}}}},"400":{"description":"`VALIDATION_FAILED` — request parameters failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightErrorResponse"},"example":{"error":{"code":"VALIDATION_FAILED","message":"Validation failed","details":[{"code":"invalid_string","message":"Invalid input","path":["market-id"]}],"request_id":"f0e1d2c3-b4a5-4968-8728-1c0d1e2f3a4b"}}}}},"404":{"description":"`MARKET_NOT_FOUND` — no market exists for this id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightErrorResponse"},"example":{"error":{"code":"MARKET_NOT_FOUND","message":"Market 0x0000000000000000000000000000000000000000000000000000000000000000 not found","details":null,"request_id":"f0e1d2c3-b4a5-4968-8728-1c0d1e2f3a4b"}}}}},"500":{"description":"`INTERNAL_ERROR` — the request failed due to an unexpected server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightErrorResponse"},"example":{"error":{"code":"INTERNAL_ERROR","message":"Internal server error","details":null,"request_id":"f0e1d2c3-b4a5-4968-8728-1c0d1e2f3a4b"}}}}}},"summary":"Get market state","tags":["Markets"],"x-codeSamples":[{"lang":"bash","label":"cURL","source":"BASE_URL='https://api.morpho.org'\nMARKET_ID=\"0xcc9418ea594c6e658650aedd205ce4544b266b69493f56fd2adc65c14bd06738\"\n\ncurl -sS \"${BASE_URL}/v0/midnight/markets/${MARKET_ID}/state\" \\\n  -H \"accept: application/json\"","id":"curl"},{"lang":"js","label":"JavaScript","source":"const baseUrl = \"https://api.morpho.org\";\nconst marketId = \"0xcc9418ea594c6e658650aedd205ce4544b266b69493f56fd2adc65c14bd06738\";\n\nconst url = new URL(`${baseUrl}/v0/midnight/markets/${marketId}/state`);\n\nconst response = await fetch(url, {\n  headers: {\n    accept: \"application/json\",\n  },\n});\nif (!response.ok) throw new Error(await response.text());\n\nconst body = await response.json();","id":"js"}]}},"/v0/midnight/users/{user-address}/positions":{"get":{"description":"Cursor-paginated list of a user's current Midnight positions.\n\n**Position type.** `type` is `lend` for positions with credit, `borrow` for positions with debt, or `collateral_only` for positions with no credit or debt but remaining collateral. Closed positions with no credit, no debt, and no remaining collateral are excluded.\n\n**Performance fields.** `cost_basis` uses the average cost method and is returned as a WAD-scaled bigint string in loan-token units. `effective_rate_wad` is deprecated in favor of `effective_apr`: it is the unchanged WAD-scaled compounded IRR+ using a 365.25-day year. `effective_apr` is the simple annualized decimal fraction using a 365-day year, capped at `10`, and derived from persisted open lots. Analytics can be `null` when there is not enough attributable history.\n\n**Filters.** `chain_ids` is required when `loan_assets` is provided. `collateral_assets` matches configured market collateral tokens across all chains unless `chain_ids` narrows the query; lowercase addresses are checksummed. Range filters exist on `created_at`, `credit`, `debt`, `cost_basis`, and the deprecated `effective_rate_wad`. `effective_apr` has no filter or sort key. `active_only=true` excludes matured markets. `listed=true` keeps only positions on listed markets; `listed=false` keeps only positions on unlisted markets.\n\n**Pagination.** Response envelope: `{ cursor, data }`. Positions are ordered newest-first by `created_at` by default.\n\n**Cache.** `public, max-age=2, stale-while-revalidate=1`.","operationId":"MidnightPositionsController_list","parameters":[{"name":"user-address","required":true,"in":"path","description":"User address to list positions for. Lowercase input is checksummed.","schema":{"type":"string","example":"0xd4F43105098845fFE89B16E7A3DCdd0A31898118"},"example":"0xd4F43105098845fFE89B16E7A3DCdd0A31898118"},{"name":"chain_ids","required":false,"in":"query","description":"Filter by chain ids. Supported chains: Ethereum (1), Base (8453), Arc (5042), Robinhood Chain (4663), Tempo (4217), and Arbitrum (42161). Required when loan_assets is provided.","schema":{"maxItems":100,"type":"array","items":{"type":"integer","exclusiveMinimum":true,"maximum":9007199254740991,"minimum":0,"enum":[1,8453,5042,4663,4217,42161]}}},{"name":"market_ids","required":false,"in":"query","description":"Filter by Midnight market ids.","schema":{"maxItems":100,"type":"array","items":{"type":"string"}}},{"name":"types","required":false,"in":"query","description":"Filter by position type.","schema":{"maxItems":100,"type":"array","items":{"type":"string","enum":["lend","borrow","collateral_only"]}}},{"name":"loan_assets","required":false,"in":"query","description":"Filter by loan token addresses. Combine with chain_ids; lowercase input is checksummed.","schema":{"maxItems":100,"type":"array","items":{"type":"string"}}},{"name":"maturities","required":false,"in":"query","description":"Filter by exact maturity timestamps, in unix seconds.","schema":{"maxItems":100,"type":"array","items":{"anyOf":[{"type":"string","maxLength":16,"pattern":"^\\d+$"},{"type":"integer","minimum":0,"maximum":9007199254740991}]}}},{"name":"active_only","required":false,"in":"query","description":"When true, keep only positions whose market has not matured yet.","schema":{"type":"string","enum":["true","false"]}},{"name":"maturity_gte","required":false,"in":"query","description":"Filter for maturities greater than or equal to this unix timestamp.","schema":{"anyOf":[{"type":"string","maxLength":16,"pattern":"^\\d+$"},{"type":"integer","minimum":0,"maximum":9007199254740991}]}},{"name":"maturity_lte","required":false,"in":"query","description":"Filter for maturities less than or equal to this unix timestamp.","schema":{"anyOf":[{"type":"string","maxLength":16,"pattern":"^\\d+$"},{"type":"integer","minimum":0,"maximum":9007199254740991}]}},{"name":"credit_gte","required":false,"in":"query","description":"Filter for credit greater than or equal to this value.","schema":{"pattern":"^\\d{1,78}$","type":"string"}},{"name":"credit_lte","required":false,"in":"query","description":"Filter for credit less than or equal to this value.","schema":{"pattern":"^\\d{1,78}$","type":"string"}},{"name":"pending_fee_gte","required":false,"in":"query","description":"Filter for pending fee greater than or equal to this value.","schema":{"pattern":"^\\d{1,78}$","type":"string"}},{"name":"pending_fee_lte","required":false,"in":"query","description":"Filter for pending fee less than or equal to this value.","schema":{"pattern":"^\\d{1,78}$","type":"string"}},{"name":"debt_gte","required":false,"in":"query","description":"Filter for debt greater than or equal to this value.","schema":{"pattern":"^\\d{1,78}$","type":"string"}},{"name":"debt_lte","required":false,"in":"query","description":"Filter for debt less than or equal to this value.","schema":{"pattern":"^\\d{1,78}$","type":"string"}},{"name":"cost_basis_gte","required":false,"in":"query","description":"Filter for cost basis greater than or equal to this value.","schema":{"pattern":"^\\d{1,78}$","type":"string"}},{"name":"cost_basis_lte","required":false,"in":"query","description":"Filter for cost basis less than or equal to this value.","schema":{"pattern":"^\\d{1,78}$","type":"string"}},{"name":"effective_rate_wad_gte","required":false,"in":"query","description":"Deprecated along with `effective_rate_wad`; there is no `effective_apr` filter. Filter for compounded effective rate WAD greater than or equal to this value.","deprecated":true,"schema":{"pattern":"^-?\\d{1,78}$","type":"string"}},{"name":"effective_rate_wad_lte","required":false,"in":"query","description":"Deprecated along with `effective_rate_wad`; there is no `effective_apr` filter. Filter for compounded effective rate WAD less than or equal to this value.","deprecated":true,"schema":{"pattern":"^-?\\d{1,78}$","type":"string"}},{"name":"created_at_gte","required":false,"in":"query","description":"Filter for position created_at greater than or equal to this unix timestamp.","schema":{"anyOf":[{"type":"string","maxLength":16,"pattern":"^\\d+$"},{"type":"integer","minimum":0,"maximum":9007199254740991}]}},{"name":"created_at_lte","required":false,"in":"query","description":"Filter for position created_at less than or equal to this unix timestamp.","schema":{"anyOf":[{"type":"string","maxLength":16,"pattern":"^\\d+$"},{"type":"integer","minimum":0,"maximum":9007199254740991}]}},{"name":"sort_by","required":false,"in":"query","description":"Sort field for cursor pagination. `effective_rate_wad` is deprecated.","schema":{"default":"created_at","type":"string","enum":["created_at","credit","debt","maturity","cost_basis","effective_rate_wad"]}},{"name":"sort_direction","required":false,"in":"query","description":"Sort direction for cursor pagination.","schema":{"default":"desc","type":"string","enum":["asc","desc"]}},{"name":"limit","required":false,"in":"query","description":"Maximum number of items to return.","schema":{"minimum":1,"maximum":100,"default":100,"type":"integer"}},{"name":"cursor","required":false,"in":"query","description":"Opaque cursor from a previous page response.","schema":{"minLength":1,"maxLength":4096,"type":"string"}},{"name":"collateral_assets","required":false,"in":"query","description":"Filter by configured market collateral token addresses. Combine with chain_ids; lowercase input is checksummed.","schema":{"maxItems":100,"type":"array","items":{"type":"string"}}},{"name":"market_family_ids","required":false,"in":"query","description":"Filter by Midnight market family ids. Combined with market_ids using AND semantics.","schema":{"maxItems":100,"type":"array","items":{"type":"string"}}},{"name":"listed","required":false,"in":"query","description":"Filter by market listing status. When true, returns only positions on listed markets; when false, only positions on unlisted markets. Omit to return both.","schema":{"type":"string","enum":["true","false"]}}],"responses":{"200":{"description":"Cursor-paginated list of Midnight positions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PositionsResponse"},"example":{"cursor":null,"data":[{"chain_id":8453,"market_id":"0x56b822d7d8be6bded8e1782277989fe5dc4e5b0a4f7f9d349482bc933bd5436c","user_address":"0xd4F43105098845fFE89B16E7A3DCdd0A31898118","loan_token":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","maturity":1786147200,"created_at":1783584485,"type":"lend","credit":"1691361","pending_fee":"0","last_loss_factor":"0","loss_factor":"0","debt":"0","cost_basis":"1684382000000000000000000","effective_rate_wad":"51269234716454728","effective_apr":0.052603,"collaterals":[]},{"chain_id":8453,"market_id":"0xcc9418ea594c6e658650aedd205ce4544b266b69493f56fd2adc65c14bd06738","user_address":"0xd4F43105098845fFE89B16E7A3DCdd0A31898118","loan_token":"0x4200000000000000000000000000000000000006","maturity":1784300400,"type":"borrow","credit":"0","pending_fee":"0","last_loss_factor":"0","loss_factor":"0","debt":"1046492040981691","collaterals":[{"token":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","amount":"4000000"}],"created_at":1783546093,"cost_basis":"1046483736229728000000000000000000","effective_rate_wad":"327402597840809","effective_apr":0.000327456}]}}}},"400":{"description":"`VALIDATION_FAILED` — request parameters failed validation. `INVALID_CURSOR` — the provided cursor is malformed or was produced by a different sort configuration.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightErrorResponse"},"examples":{"validationFailed":{"summary":"Validation failed","value":{"error":{"code":"VALIDATION_FAILED","message":"Validation failed","details":[{"code":"invalid_type","message":"Expected number, received string","path":["chain_ids",0]}],"request_id":"f0e1d2c3-b4a5-4968-8728-1c0d1e2f3a4b"}}},"requestError":{"summary":"INVALID_CURSOR","value":{"error":{"code":"INVALID_CURSOR","message":"cursor sort/direction does not match request sort/direction","details":null,"request_id":"f0e1d2c3-b4a5-4968-8728-1c0d1e2f3a4b"}}}}}}},"500":{"description":"`INTERNAL_ERROR` — the request failed due to an unexpected server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightErrorResponse"},"example":{"error":{"code":"INTERNAL_ERROR","message":"Internal server error","details":null,"request_id":"f0e1d2c3-b4a5-4968-8728-1c0d1e2f3a4b"}}}}}},"summary":"List positions","tags":["Positions"],"x-codeSamples":[{"lang":"bash","label":"cURL","source":"BASE_URL='https://api.morpho.org'\nUSER_ADDRESS=\"0xd4F43105098845fFE89B16E7A3DCdd0A31898118\"\n\ncurl -sS \"${BASE_URL}/v0/midnight/users/${USER_ADDRESS}/positions?chain_ids=1\" \\\n  -H \"accept: application/json\"","id":"curl"},{"lang":"js","label":"JavaScript","source":"const baseUrl = \"https://api.morpho.org\";\nconst userAddress = \"0xd4F43105098845fFE89B16E7A3DCdd0A31898118\";\n\nconst url = new URL(`${baseUrl}/v0/midnight/users/${userAddress}/positions`);\nurl.searchParams.set(\"chain_ids\", \"1\");\n\nconst response = await fetch(url, {\n  headers: {\n    accept: \"application/json\",\n  },\n});\nif (!response.ok) throw new Error(await response.text());\n\nconst body = await response.json();","id":"js"}]}},"/v0/midnight/markets/{market-id}/positions":{"get":{"description":"Cursor-paginated list of current Midnight positions for a market.\n\n`:market-id` is the stable Midnight market id and is globally unique across supported chains.\n\nThe response uses the same public position item shape as `GET /v0/midnight/users/{user-address}/positions`: `{ cursor, data }`, with `type`, state fields, collateral balances, and performance analytics.\n\n**Filters.** Range filters exist on `created_at`, `credit`, `debt`, `cost_basis`, and the deprecated `effective_rate_wad`. `effective_apr` has no filter or sort key. `active_only=true` excludes matured markets. The path market id is always enforced.\n\n**Pagination.** Pass back `cursor` verbatim on the next call. Positions are ordered newest-first by `created_at` by default.\n\n**Cache.** `public, max-age=2, stale-while-revalidate=1`.","operationId":"MidnightPositionsController_listMarket","parameters":[{"name":"market-id","required":true,"in":"path","description":"Midnight market id.","schema":{"type":"string","example":"0xcc9418ea594c6e658650aedd205ce4544b266b69493f56fd2adc65c14bd06738"},"example":"0xcc9418ea594c6e658650aedd205ce4544b266b69493f56fd2adc65c14bd06738"},{"name":"chain_ids","required":false,"in":"query","description":"Filter by chain ids. Supported chains: Ethereum (1), Base (8453), Arc (5042), Robinhood Chain (4663), Tempo (4217), and Arbitrum (42161). Required when loan_assets is provided.","schema":{"maxItems":100,"type":"array","items":{"type":"integer","exclusiveMinimum":true,"maximum":9007199254740991,"minimum":0,"enum":[1,8453,5042,4663,4217,42161]}}},{"name":"types","required":false,"in":"query","description":"Filter by position type.","schema":{"maxItems":100,"type":"array","items":{"type":"string","enum":["lend","borrow","collateral_only"]}}},{"name":"loan_assets","required":false,"in":"query","description":"Filter by loan token addresses. Combine with chain_ids; lowercase input is checksummed.","schema":{"maxItems":100,"type":"array","items":{"type":"string"}}},{"name":"maturities","required":false,"in":"query","description":"Filter by exact maturity timestamps, in unix seconds.","schema":{"maxItems":100,"type":"array","items":{"anyOf":[{"type":"string","maxLength":16,"pattern":"^\\d+$"},{"type":"integer","minimum":0,"maximum":9007199254740991}]}}},{"name":"active_only","required":false,"in":"query","description":"When true, keep only positions whose market has not matured yet.","schema":{"type":"string","enum":["true","false"]}},{"name":"maturity_gte","required":false,"in":"query","description":"Filter for maturities greater than or equal to this unix timestamp.","schema":{"anyOf":[{"type":"string","maxLength":16,"pattern":"^\\d+$"},{"type":"integer","minimum":0,"maximum":9007199254740991}]}},{"name":"maturity_lte","required":false,"in":"query","description":"Filter for maturities less than or equal to this unix timestamp.","schema":{"anyOf":[{"type":"string","maxLength":16,"pattern":"^\\d+$"},{"type":"integer","minimum":0,"maximum":9007199254740991}]}},{"name":"credit_gte","required":false,"in":"query","description":"Filter for credit greater than or equal to this value.","schema":{"pattern":"^\\d{1,78}$","type":"string"}},{"name":"credit_lte","required":false,"in":"query","description":"Filter for credit less than or equal to this value.","schema":{"pattern":"^\\d{1,78}$","type":"string"}},{"name":"pending_fee_gte","required":false,"in":"query","description":"Filter for pending fee greater than or equal to this value.","schema":{"pattern":"^\\d{1,78}$","type":"string"}},{"name":"pending_fee_lte","required":false,"in":"query","description":"Filter for pending fee less than or equal to this value.","schema":{"pattern":"^\\d{1,78}$","type":"string"}},{"name":"debt_gte","required":false,"in":"query","description":"Filter for debt greater than or equal to this value.","schema":{"pattern":"^\\d{1,78}$","type":"string"}},{"name":"debt_lte","required":false,"in":"query","description":"Filter for debt less than or equal to this value.","schema":{"pattern":"^\\d{1,78}$","type":"string"}},{"name":"cost_basis_gte","required":false,"in":"query","description":"Filter for cost basis greater than or equal to this value.","schema":{"pattern":"^\\d{1,78}$","type":"string"}},{"name":"cost_basis_lte","required":false,"in":"query","description":"Filter for cost basis less than or equal to this value.","schema":{"pattern":"^\\d{1,78}$","type":"string"}},{"name":"effective_rate_wad_gte","required":false,"in":"query","description":"Deprecated along with `effective_rate_wad`; there is no `effective_apr` filter. Filter for compounded effective rate WAD greater than or equal to this value.","deprecated":true,"schema":{"pattern":"^-?\\d{1,78}$","type":"string"}},{"name":"effective_rate_wad_lte","required":false,"in":"query","description":"Deprecated along with `effective_rate_wad`; there is no `effective_apr` filter. Filter for compounded effective rate WAD less than or equal to this value.","deprecated":true,"schema":{"pattern":"^-?\\d{1,78}$","type":"string"}},{"name":"created_at_gte","required":false,"in":"query","description":"Filter for position created_at greater than or equal to this unix timestamp.","schema":{"anyOf":[{"type":"string","maxLength":16,"pattern":"^\\d+$"},{"type":"integer","minimum":0,"maximum":9007199254740991}]}},{"name":"created_at_lte","required":false,"in":"query","description":"Filter for position created_at less than or equal to this unix timestamp.","schema":{"anyOf":[{"type":"string","maxLength":16,"pattern":"^\\d+$"},{"type":"integer","minimum":0,"maximum":9007199254740991}]}},{"name":"sort_by","required":false,"in":"query","description":"Sort field for cursor pagination. `effective_rate_wad` is deprecated.","schema":{"default":"created_at","type":"string","enum":["created_at","credit","debt","maturity","cost_basis","effective_rate_wad"]}},{"name":"sort_direction","required":false,"in":"query","description":"Sort direction for cursor pagination.","schema":{"default":"desc","type":"string","enum":["asc","desc"]}},{"name":"limit","required":false,"in":"query","description":"Maximum number of items to return.","schema":{"minimum":1,"maximum":100,"default":100,"type":"integer"}},{"name":"cursor","required":false,"in":"query","description":"Opaque cursor from a previous page response.","schema":{"minLength":1,"maxLength":4096,"type":"string"}}],"responses":{"200":{"description":"Cursor-paginated list of Midnight positions for a market.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PositionsResponse"},"example":{"cursor":"eyJzIjoiY3JlYXRlZEF0IiwiZCI6ImRlc2MiLCJ2IjoiMTc4MzU0NjA5MyIsInZOdWxsIjpmYWxzZSwiaSI6eyJjaGFpbklkIjo4NDUzLCJtYXJrZXRJZCI6IjB4Y2M5NDE4ZWE1OTRjNmU2NTg2NTBhZWRkMjA1Y2U0NTQ0YjI2NmI2OTQ5M2Y1NmZkMmFkYzY1YzE0YmQwNjczOCIsInVzZXJBZGRyZXNzIjoiMHg1MzU2OTBDQjEzMzAyMzJkZDRmMmFjNUI3MjQwNDA3NTFiZEY0QzkxIn0sImYiOiJCcVJWSnR0WEdkeFY1UG1kMlp1VFFFIn0","data":[{"chain_id":8453,"market_id":"0xcc9418ea594c6e658650aedd205ce4544b266b69493f56fd2adc65c14bd06738","user_address":"0xd4F43105098845fFE89B16E7A3DCdd0A31898118","loan_token":"0x4200000000000000000000000000000000000006","maturity":1784300400,"type":"borrow","credit":"0","pending_fee":"0","last_loss_factor":"0","loss_factor":"0","debt":"1046492040981691","collaterals":[{"token":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","amount":"4000000"}],"created_at":1783606647,"cost_basis":"1046483736229728000000000000000000","effective_rate_wad":"327402597840809","effective_apr":0.000327456},{"chain_id":8453,"market_id":"0xcc9418ea594c6e658650aedd205ce4544b266b69493f56fd2adc65c14bd06738","user_address":"0x958eB498a4172EA513c79b09E7f064070C5b1917","loan_token":"0x4200000000000000000000000000000000000006","maturity":1784300400,"created_at":1783584485,"type":"lend","credit":"1481439992020013","pending_fee":"0","last_loss_factor":"0","loss_factor":"0","debt":"0","cost_basis":"1480000000000000000000000000000000","effective_rate_wad":"41189691462004744","effective_apr":0.042042,"collaterals":[]},{"chain_id":8453,"market_id":"0xcc9418ea594c6e658650aedd205ce4544b266b69493f56fd2adc65c14bd06738","user_address":"0x535690CB1330232dd4f2ac5B724040751bdF4C91","loan_token":"0x4200000000000000000000000000000000000006","maturity":1784300400,"created_at":1783546093,"type":"borrow","credit":"0","pending_fee":"0","last_loss_factor":"0","loss_factor":"0","debt":"80001344022580","cost_basis":"80000000000000000000000000000000","effective_rate_wad":"763977389592662","effective_apr":0.000764,"collaterals":[{"token":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","amount":"1000000"}]}]}}}},"400":{"description":"`VALIDATION_FAILED` — request parameters failed validation. `INVALID_CURSOR` — the provided cursor is malformed or was produced by a different sort/filter configuration.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightErrorResponse"},"examples":{"validationFailed":{"summary":"Validation failed","value":{"error":{"code":"VALIDATION_FAILED","message":"Validation failed","details":[{"code":"invalid_type","message":"Expected number, received string","path":["chain_ids",0]}],"request_id":"f0e1d2c3-b4a5-4968-8728-1c0d1e2f3a4b"}}},"requestError":{"summary":"INVALID_CURSOR","value":{"error":{"code":"INVALID_CURSOR","message":"cursor sort/direction does not match request sort/direction","details":null,"request_id":"f0e1d2c3-b4a5-4968-8728-1c0d1e2f3a4b"}}}}}}},"500":{"description":"`INTERNAL_ERROR` — the request failed due to an unexpected server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightErrorResponse"},"example":{"error":{"code":"INTERNAL_ERROR","message":"Internal server error","details":null,"request_id":"f0e1d2c3-b4a5-4968-8728-1c0d1e2f3a4b"}}}}}},"summary":"List market positions","tags":["Positions"],"x-codeSamples":[{"lang":"bash","label":"cURL","source":"BASE_URL='https://api.morpho.org'\nMARKET_ID=\"0xcc9418ea594c6e658650aedd205ce4544b266b69493f56fd2adc65c14bd06738\"\n\ncurl -sS \"${BASE_URL}/v0/midnight/markets/${MARKET_ID}/positions?chain_ids=1\" \\\n  -H \"accept: application/json\"","id":"curl"},{"lang":"js","label":"JavaScript","source":"const baseUrl = \"https://api.morpho.org\";\nconst marketId = \"0xcc9418ea594c6e658650aedd205ce4544b266b69493f56fd2adc65c14bd06738\";\n\nconst url = new URL(`${baseUrl}/v0/midnight/markets/${marketId}/positions`);\nurl.searchParams.set(\"chain_ids\", \"1\");\n\nconst response = await fetch(url, {\n  headers: {\n    accept: \"application/json\",\n  },\n});\nif (!response.ok) throw new Error(await response.text());\n\nconst body = await response.json();","id":"js"}]}},"/v0/midnight/markets/{market-id}/users/{user-address}/position":{"get":{"description":"Detail lookup for a single position by `(market-id, user-address)`.\n\n`:market-id` is the stable Midnight market id and is globally unique across supported chains. `:user-address` accepts any casing and is checksummed server-side.\n\nReturns the position inside a `data` envelope. When the position is **closed** (no credit, no debt, no remaining collateral) or has never existed for a known market, the endpoint returns zero balances with `type: null`. Positions with `credit == 0 && debt == 0` but non-empty `collaterals` are returned as `type: \"collateral_only\"`.","operationId":"MidnightPositionsController_detail","parameters":[{"name":"market-id","required":true,"in":"path","description":"Midnight market id.","schema":{"type":"string","example":"0xcc9418ea594c6e658650aedd205ce4544b266b69493f56fd2adc65c14bd06738"},"example":"0xcc9418ea594c6e658650aedd205ce4544b266b69493f56fd2adc65c14bd06738"},{"name":"user-address","required":true,"in":"path","description":"User address for the requested position. Lowercase input is checksummed.","schema":{"type":"string","example":"0xd4F43105098845fFE89B16E7A3DCdd0A31898118"},"example":"0xd4F43105098845fFE89B16E7A3DCdd0A31898118"}],"responses":{"200":{"description":"Midnight position detail.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PositionDetailResponse"},"example":{"data":{"chain_id":8453,"market_id":"0xcc9418ea594c6e658650aedd205ce4544b266b69493f56fd2adc65c14bd06738","user_address":"0xd4F43105098845fFE89B16E7A3DCdd0A31898118","loan_token":"0x4200000000000000000000000000000000000006","maturity":1784300400,"type":"borrow","credit":"0","pending_fee":"0","last_loss_factor":"0","loss_factor":"0","debt":"1046492040981691","collaterals":[{"token":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","amount":"4000000"}],"last_indexed_block":"48408699"}},"examples":{"active":{"summary":"Open position","value":{"data":{"chain_id":8453,"market_id":"0xcc9418ea594c6e658650aedd205ce4544b266b69493f56fd2adc65c14bd06738","user_address":"0xd4F43105098845fFE89B16E7A3DCdd0A31898118","loan_token":"0x4200000000000000000000000000000000000006","maturity":1784300400,"type":"borrow","credit":"0","pending_fee":"0","last_loss_factor":"0","loss_factor":"0","debt":"1046492040981691","collaterals":[{"token":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","amount":"4000000"}],"last_indexed_block":"48408699"}}},"empty":{"summary":"Closed or missing position on a known market","value":{"data":{"chain_id":8453,"market_id":"0xcc9418ea594c6e658650aedd205ce4544b266b69493f56fd2adc65c14bd06738","user_address":"0xd4F43105098845fFE89B16E7A3DCdd0A31898118","loan_token":"0x4200000000000000000000000000000000000006","maturity":1784300400,"type":null,"credit":"0","pending_fee":"0","last_loss_factor":"0","loss_factor":"0","debt":"0","collaterals":[],"last_indexed_block":"48408699"}}}}}}},"400":{"description":"`VALIDATION_FAILED` — request parameters failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightErrorResponse"},"example":{"error":{"code":"VALIDATION_FAILED","message":"Validation failed","details":[{"code":"invalid_string","message":"Invalid address","path":["user-address"]}],"request_id":"f0e1d2c3-b4a5-4968-8728-1c0d1e2f3a4b"}}}}},"404":{"description":"`MARKET_NOT_FOUND` — no market exists for this id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightErrorResponse"},"example":{"error":{"code":"MARKET_NOT_FOUND","message":"Market 0x0000000000000000000000000000000000000000000000000000000000000000 not found","details":null,"request_id":"f0e1d2c3-b4a5-4968-8728-1c0d1e2f3a4b"}}}}},"500":{"description":"`INTERNAL_ERROR` — the request failed due to an unexpected server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightErrorResponse"},"example":{"error":{"code":"INTERNAL_ERROR","message":"Internal server error","details":null,"request_id":"f0e1d2c3-b4a5-4968-8728-1c0d1e2f3a4b"}}}}}},"summary":"Get position","tags":["Positions"],"x-codeSamples":[{"lang":"bash","label":"cURL","source":"BASE_URL='https://api.morpho.org'\nMARKET_ID=\"0xcc9418ea594c6e658650aedd205ce4544b266b69493f56fd2adc65c14bd06738\"\nUSER_ADDRESS=\"0xd4F43105098845fFE89B16E7A3DCdd0A31898118\"\n\ncurl -sS \"${BASE_URL}/v0/midnight/markets/${MARKET_ID}/users/${USER_ADDRESS}/position\" \\\n  -H \"accept: application/json\"","id":"curl"},{"lang":"js","label":"JavaScript","source":"const baseUrl = \"https://api.morpho.org\";\nconst marketId = \"0xcc9418ea594c6e658650aedd205ce4544b266b69493f56fd2adc65c14bd06738\";\nconst userAddress = \"0xd4F43105098845fFE89B16E7A3DCdd0A31898118\";\n\nconst url = new URL(`${baseUrl}/v0/midnight/markets/${marketId}/users/${userAddress}/position`);\n\nconst response = await fetch(url, {\n  headers: {\n    accept: \"application/json\",\n  },\n});\nif (!response.ok) throw new Error(await response.text());\n\nconst body = await response.json();","id":"js"}]}},"/v0/midnight/markets/{market-id}/users/{user-address}/position/performance":{"get":{"description":"Performance-only lookup for a single position by `(market-id, user-address)`.\n\nReturns performance analytics inside a `data` envelope. `effective_rate_wad` is deprecated in favor of `effective_apr`: it is compounded IRR+ using a 365.25-day year. `effective_apr` is simple interest using a 365-day year and is capped at `10` (1000%). The position detail endpoint omits these fields to keep state and performance concerns separate. When the position is closed or has never existed for a known market, this endpoint returns `type: null` and null analytics.","operationId":"MidnightPositionsController_performance","parameters":[{"name":"market-id","required":true,"in":"path","description":"Midnight market id.","schema":{"type":"string","example":"0xcc9418ea594c6e658650aedd205ce4544b266b69493f56fd2adc65c14bd06738"},"example":"0xcc9418ea594c6e658650aedd205ce4544b266b69493f56fd2adc65c14bd06738"},{"name":"user-address","required":true,"in":"path","description":"User address for the requested position. Lowercase input is checksummed.","schema":{"type":"string","example":"0xd4F43105098845fFE89B16E7A3DCdd0A31898118"},"example":"0xd4F43105098845fFE89B16E7A3DCdd0A31898118"}],"responses":{"200":{"description":"Midnight position performance analytics.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PositionPerformanceResponse"},"example":{"data":{"chain_id":8453,"market_id":"0xcc9418ea594c6e658650aedd205ce4544b266b69493f56fd2adc65c14bd06738","user_address":"0xd4F43105098845fFE89B16E7A3DCdd0A31898118","type":"borrow","accounting_method":"average_cost","cost_basis":"1046483736229728000000000000000000","effective_rate_wad":"327402597840809","effective_apr":0.000327456,"last_indexed_block":"48408699"}},"examples":{"active":{"summary":"Open position performance","value":{"data":{"chain_id":8453,"market_id":"0xcc9418ea594c6e658650aedd205ce4544b266b69493f56fd2adc65c14bd06738","user_address":"0xd4F43105098845fFE89B16E7A3DCdd0A31898118","type":"borrow","accounting_method":"average_cost","cost_basis":"1046483736229728000000000000000000","effective_rate_wad":"327402597840809","effective_apr":0.000327456,"last_indexed_block":"48408699"}}},"empty":{"summary":"Closed or missing position on a known market","value":{"data":{"chain_id":8453,"market_id":"0xcc9418ea594c6e658650aedd205ce4544b266b69493f56fd2adc65c14bd06738","user_address":"0xd4F43105098845fFE89B16E7A3DCdd0A31898118","type":null,"accounting_method":"average_cost","cost_basis":null,"effective_rate_wad":null,"effective_apr":null,"last_indexed_block":"48408699"}}}}}}},"400":{"description":"`VALIDATION_FAILED` — request parameters failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightErrorResponse"},"example":{"error":{"code":"VALIDATION_FAILED","message":"Validation failed","details":[{"code":"invalid_string","message":"Invalid address","path":["user-address"]}],"request_id":"f0e1d2c3-b4a5-4968-8728-1c0d1e2f3a4b"}}}}},"404":{"description":"`MARKET_NOT_FOUND` — no market exists for this id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightErrorResponse"},"example":{"error":{"code":"MARKET_NOT_FOUND","message":"Market 0x0000000000000000000000000000000000000000000000000000000000000000 not found","details":null,"request_id":"f0e1d2c3-b4a5-4968-8728-1c0d1e2f3a4b"}}}}},"500":{"description":"`INTERNAL_ERROR` — the request failed due to an unexpected server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightErrorResponse"},"example":{"error":{"code":"INTERNAL_ERROR","message":"Internal server error","details":null,"request_id":"f0e1d2c3-b4a5-4968-8728-1c0d1e2f3a4b"}}}}}},"summary":"Get Midnight position performance","tags":["Positions"],"x-codeSamples":[{"lang":"bash","label":"cURL","source":"BASE_URL='https://api.morpho.org'\nMARKET_ID=\"0xcc9418ea594c6e658650aedd205ce4544b266b69493f56fd2adc65c14bd06738\"\nUSER_ADDRESS=\"0xd4F43105098845fFE89B16E7A3DCdd0A31898118\"\n\ncurl -sS \"${BASE_URL}/v0/midnight/markets/${MARKET_ID}/users/${USER_ADDRESS}/position/performance\" \\\n  -H \"accept: application/json\"","id":"curl"},{"lang":"js","label":"JavaScript","source":"const baseUrl = \"https://api.morpho.org\";\nconst marketId = \"0xcc9418ea594c6e658650aedd205ce4544b266b69493f56fd2adc65c14bd06738\";\nconst userAddress = \"0xd4F43105098845fFE89B16E7A3DCdd0A31898118\";\n\nconst url = new URL(`${baseUrl}/v0/midnight/markets/${marketId}/users/${userAddress}/position/performance`);\n\nconst response = await fetch(url, {\n  headers: {\n    accept: \"application/json\",\n  },\n});\nif (!response.ok) throw new Error(await response.text());\n\nconst body = await response.json();","id":"js"}]}},"/v0/midnight/offer-groups/{group-id}":{"get":{"description":"Returns every offer group matching the onchain group id, regardless of lifecycle status. The maker is not required; optional chain_id and maker query parameters can disambiguate the lookup. Distinct chain, maker, and group-id combinations remain separate, and no match returns an empty data array.\n\nThe endpoint returns every latest offer revision in each matched group and exposes the current lifecycle as `status`. Each group exposes the shared offer intent as `type`, or `null` when its latest offers have inconsistent `buy` and `reduce_only` values. For active and scheduled groups, the group-level `type`, `callback`, `expiry`, `max_units`, `max_assets` and `created_at` leave out root-cancelled offers, while `offers` still lists every latest offer. It does not apply Router mempool admission policy: oracle, token, market-triplet, RCF threshold, and other mempool-validation policy checks do not gate retrieval. Offers on an LLTV or liquidation cursor that Midnight has not enabled are never indexed, so they are not returned.\n\nEach nested offer includes the exact per-offer `ratifier_data` bytes originally submitted, plus `parsed_ratifier_data`, a structured view discriminated by `ratifier_type`. The type is identified by matching `ratifier` against the chain's known Midnight ratifier deployments: `rate_v1` exposes `rate_per_second_wad` and `allowed_taker`, `price_v1` exposes `allowed_taker` (the offer-level `tick` is the ratified price), and `ecrecover` and `setter` expose only their type. A zero `allowed_taker` means any taker may take the offer. Midnight vault adapter offers, whose `maker`, `ratifier`, and `callback` are the same address, whose `receiver_if_maker_is_seller` is also that address for a sell offer, whose `ratifier_data` decodes as `abi.encode(sub_ratifier, sub_ratifier_data)`, and whose `ratifier` was created by the chain's current official Midnight adapter factory (possibly after the offer was posted), and whose `loan_token` is the asset of the adapter's parent vault, return `adapter` with `parent_vault`, `sub_ratifier`, and a nested `parsed_sub_ratifier_data` that reuses the `rate_v1` and `price_v1` shapes, identified by matching `sub_ratifier` against the chain's known adapter sub-ratifier deployments. Sub-ratifier errors stay nested: an unrecognized `sub_ratifier` returns `unknown`, and undecodable sub-ratifier data returns `invalid` with `expected_ratifier_type`. An adapter-shaped offer whose `ratifier` is not a verified adapter, or whose `loan_token` is not the parent vault's asset, returns `unknown`. Any other unrecognized ratifier address returns `unknown`; a recognized address whose `ratifier_data` cannot be decoded returns `invalid` with `expected_ratifier_type`.","operationId":"MidnightOfferGroupsController_getByGroup","parameters":[{"name":"group-id","required":true,"in":"path","description":"Offer group id.","schema":{"type":"string","example":"0x0bab51fab64157bc1011ce65b9bf9b2b11f202b8a7ab76b408cf40b8adf069d3"},"example":"0x0bab51fab64157bc1011ce65b9bf9b2b11f202b8a7ab76b408cf40b8adf069d3"},{"name":"chain_id","required":false,"in":"query","description":"Filter by chain id.","schema":{"maximum":9007199254740991,"exclusiveMinimum":true,"type":"integer","minimum":0,"enum":[1,8453,5042,4663,4217,42161]}},{"name":"maker","required":false,"in":"query","description":"Filter by offer maker address.","schema":{"type":"string"}}],"responses":{"200":{"description":"Midnight offer groups matching the group id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OfferGroupsByGroupResponse"},"example":{"data":[{"id":"0x0bab51fab64157bc1011ce65b9bf9b2b11f202b8a7ab76b408cf40b8adf069d3","chain_id":8453,"status":"active","type":"buy","created_at":1783584485,"expiry":1784300399,"max_units":"0","max_assets":"80000000000000","consumed":"0","callback":null,"offers":[{"market_id":"0xcc9418ea594c6e658650aedd205ce4544b266b69493f56fd2adc65c14bd06738","market":{"loan_token":"0x4200000000000000000000000000000000000006","maturity":1784300400,"rcf_threshold":"0","enter_gate":"0x0000000000000000000000000000000000000000","liquidator_gate":"0x0000000000000000000000000000000000000000","collaterals":[{"token":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","lltv":"860000000000000000","liquidation_cursor":"300000000000000000","oracle":"0xD09048c8B568Dbf5f189302beA26c9edABFC4858"}]},"created_at":1783584485,"buy":true,"maker":"0x958eB498a4172EA513c79b09E7f064070C5b1917","max_units":"0","max_assets":"80000000000000","continuous_fee_cap":"115792089237316195423570985008687907853269984665640564039457584007913129639935","start":1783584483,"expiry":1784300399,"tick":4408,"callback":"0x0000000000000000000000000000000000000000","callback_data":"0x","receiver_if_maker_is_seller":"0x0000000000000000000000000000000000000000","ratifier":"0xd6e70365C8E8DDa9a4ca662C07bbE663b017755E","ratifier_data":"0x000000000000000000000000000000000000000000000000000000000000001b3f4a8c6d2e109b7f5c4d8a1e6b3f7092c5d4e8a7b1c6f3092d5e4a8b7c1f60392a7d5c9e4b1f8036d8c2a5e7f1049b3d6c8e2a5f7b1d4093c6e8a2f5b7d1049c8b2f6d4a1c9e7035f8b2d6a4c1e9073f5b8d2a6c4e1f9037b5d8a2c6e4f1093b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000000","parsed_ratifier_data":{"ratifier_type":"ecrecover"},"reduce_only":false}]}]}}}},"400":{"description":"`VALIDATION_FAILED` — request parameters failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightErrorResponse"},"example":{"error":{"code":"VALIDATION_FAILED","message":"Validation failed","details":[{"code":"invalid_string","message":"Invalid offer group id","path":["group-id"]}],"request_id":"f0e1d2c3-b4a5-4968-8728-1c0d1e2f3a4b"}}}}},"500":{"description":"`INTERNAL_ERROR` — the request failed due to an unexpected server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightErrorResponse"},"example":{"error":{"code":"INTERNAL_ERROR","message":"Internal server error","details":null,"request_id":"f0e1d2c3-b4a5-4968-8728-1c0d1e2f3a4b"}}}}}},"summary":"Get Midnight offer groups by group id","tags":["Offer Groups"]}},"/v0/midnight/users/{user-address}/offer-groups":{"get":{"description":"Cursor-paginated list of a user's offer groups with nested offers. The `statuses` filter accepts one or more lifecycle states with OR semantics. The deprecated singular `status` parameter is a single-value alias; requests containing both are rejected. Omitting both defaults to `active` for backward compatibility.\n\n**Maturity policy.** The list includes only offers whose maturity is at 15:00 UTC, the maturities Router quotes. Other offers are excluded before lifecycle, filters, type, callback, and group `expiry` are computed, and groups with no such offer are omitted. The by-group endpoint returns every offer regardless of maturity.\n\nLifecycle is derived from every latest 15:00 UTC offer revision before market, asset, maturity, type, callback, or listing filters are applied. An explicit `SetConsumed(type(uint128).max)` sentinel cancels the entire group with highest priority. A `CancelRoot` permanently cancels only legs matching its chain, maker, ratifier address and root encoded in `ratifier_data`, regardless of event ordering. Root-cancelled legs cannot make a group `active` or `scheduled`. Among uncancelled legs with remaining capacity, a started leg at or before both its expiry and non-zero maturity makes the group `active`; otherwise a future-starting leg that has not expired or matured makes it `scheduled`. If neither applies, any root-cancelled latest leg makes the group `cancelled`, ahead of `filled` and `expired`. Otherwise, the group is `filled` when every latest leg has no remaining capacity, and `expired` otherwise. A `Take` reaching the sentinel's numeric value alone remains `filled`. Active takes remain valid at exact expiry or maturity, matching the onchain inclusive boundary.\n\nNested offers are lifecycle-targeted for list results: active returns live remaining-capacity legs, scheduled returns future remaining-capacity legs, and both exclude root-cancelled legs. Filled and cancelled return all latest legs, and expired returns terminal expired or matured legs. Active and scheduled group `expiry` is the maximum not-yet-ended latest-offer horizon excluding root-cancelled offers; terminal statuses use the complete latest set. Requesting all five statuses returns every group with a 15:00 UTC offer exactly once.\n\n**Callbacks.** A group has `callback.type=blue_buy` only when every latest offer considered for the lifecycle has the same callback address and data, contains canonical Blue market parameters with the matching loan token, and the earliest indexed registration from the official factory names the maker as owner at or before the offer's creation block. Registration transaction or log order within the same block is intentionally ignored. The callback is `null` when any condition fails. Verified callbacks include their address, decoded Blue market parameters, and derived Blue market id.\n\n**Types.** Group `type` is derived from the shared `buy` and `reduce_only` values across all offers considered for the requested lifecycle. `buy` and `sell` mean `reduce_only=false`; `buy_reduce_only` and `sell_reduce_only` mean `reduce_only=true`. For the portfolio, `buy` and `sell_reduce_only` represent lend orders and secondary exits, while `sell` and `buy_reduce_only` represent borrow orders and secondary exits. Inconsistent groups return `type: null` and do not match the `types` filter. This describes offer intent, not the maker's current position.\n\n**Filters.** `market_ids` filters the group page to groups containing at least one offer in the requested lifecycle and any requested market, but does not narrow nested sibling offers. `chain_ids` and `groups` filter the group page and nested offers. `loan_assets`, `collateral_assets`, exact `maturities`, and the inclusive unix-second bounds `maturity_gte` and `maturity_lte` filter both the group page and returned offers in the requested lifecycle for every status, and combine with other filters using AND semantics. `types` accepts comma-separated offer-group types with OR semantics and combines with other filters using AND semantics without narrowing nested offers. `callback_type=blue_buy` keeps only groups with verified Blue callback metadata. `listed=true` requires every lifecycle-matching offer in a group to be on a listed market; `listed=false` requires at least one lifecycle-matching unlisted offer. Address filters match across all chains unless `chain_ids` also narrows the query; lowercase addresses are checksummed. Group `expiry` is not narrowed by offer filters; active results use the active-eligible latest offer set, while expired results use the complete latest offer set. `created_at_gte` and `created_at_lte` filter by the first matching offer created in each group. `market_ids`, `loan_assets`, `collateral_assets`, `maturities`, `groups`, and `types` are capped at 20 values. Each offer includes both `market_id` and the immutable `market` config used to derive it, because uncreated markets cannot be decoded from `market_id` alone.\n\n**Ratifier data.** Each nested offer includes the exact per-offer `ratifier_data` bytes originally submitted, plus `parsed_ratifier_data`, a structured view discriminated by `ratifier_type`. The type is identified by matching `ratifier` against the chain's known Midnight ratifier deployments: `rate_v1` exposes `rate_per_second_wad` and `allowed_taker`, `price_v1` exposes `allowed_taker` (the offer-level `tick` is the ratified price), and `ecrecover` and `setter` expose only their type. A zero `allowed_taker` means any taker may take the offer. Midnight vault adapter offers, whose `maker`, `ratifier`, and `callback` are the same address, whose `receiver_if_maker_is_seller` is also that address for a sell offer, whose `ratifier_data` decodes as `abi.encode(sub_ratifier, sub_ratifier_data)`, and whose `ratifier` was created by the chain's current official Midnight adapter factory (possibly after the offer was posted), and whose `loan_token` is the asset of the adapter's parent vault, return `adapter` with `parent_vault`, `sub_ratifier`, and a nested `parsed_sub_ratifier_data` that reuses the `rate_v1` and `price_v1` shapes, identified by matching `sub_ratifier` against the chain's known adapter sub-ratifier deployments. Sub-ratifier errors stay nested: an unrecognized `sub_ratifier` returns `unknown`, and undecodable sub-ratifier data returns `invalid` with `expected_ratifier_type`. An adapter-shaped offer whose `ratifier` is not a verified adapter, or whose `loan_token` is not the parent vault's asset, returns `unknown`. Any other unrecognized ratifier address returns `unknown`; a recognized address whose `ratifier_data` cannot be decoded returns `invalid` with `expected_ratifier_type`.\n\n**Pagination.** Response follows the list envelope: `{ cursor, data }`. Pagination is over groups; nested offers are not split across pages. Sort groups with `sort_by=id|created_at` and `sort_direction=asc|desc`.","operationId":"MidnightOfferGroupsController_list","parameters":[{"name":"user-address","required":true,"in":"path","description":"User address whose offer groups should be listed.","schema":{"type":"string","example":"0x958eB498a4172EA513c79b09E7f064070C5b1917"},"example":"0x958eB498a4172EA513c79b09E7f064070C5b1917"},{"name":"status","required":false,"in":"query","description":"Deprecated single-value alias for statuses. Omit both status and statuses to return active groups.","deprecated":true,"schema":{"type":"string","enum":["scheduled","active","filled","expired","cancelled"]}},{"name":"statuses","required":false,"in":"query","description":"Filter by one or more offer-group lifecycle states using OR semantics. Combined with other filters using AND semantics. Omit both status and statuses to return active groups.","schema":{"minItems":1,"maxItems":5,"type":"array","items":{"type":"string","enum":["scheduled","active","filled","expired","cancelled"]}}},{"name":"callback_type","required":false,"in":"query","description":"Filter by verified group callback type. blue_buy requires canonical Blue market params and an official factory registration owned by the maker at or before offer creation.","schema":{"type":"string","enum":["blue_buy"]}},{"name":"types","required":false,"in":"query","description":"Filter by group offer intent. Multiple values use OR semantics. buy and sell mean reduce_only=false; buy_reduce_only and sell_reduce_only mean reduce_only=true. Combined with other filters using AND semantics.","schema":{"maxItems":20,"type":"array","items":{"type":"string","enum":["buy","sell_reduce_only","sell","buy_reduce_only"]}}},{"name":"chain_ids","required":false,"in":"query","description":"Filter by chain ids. Supported chains: Ethereum (1), Base (8453), Arc (5042), Robinhood Chain (4663), Tempo (4217), and Arbitrum (42161).","schema":{"maxItems":100,"type":"array","items":{"type":"integer","exclusiveMinimum":true,"maximum":9007199254740991,"minimum":0,"enum":[1,8453,5042,4663,4217,42161]}}},{"name":"market_ids","required":false,"in":"query","description":"Filter groups to those containing offers in the requested lifecycle and Midnight markets. Nested offers are not narrowed by this filter.","schema":{"maxItems":20,"type":"array","items":{"type":"string"}}},{"name":"market_family_ids","required":false,"in":"query","description":"Filter groups to those containing offers in the requested lifecycle and Midnight market families. Combined with market_ids using AND semantics. Nested offers are not narrowed by this filter.","schema":{"maxItems":20,"type":"array","items":{"type":"string"}}},{"name":"loan_assets","required":false,"in":"query","description":"Filter nested offers in the requested lifecycle by loan token addresses. Combined with market_ids, collateral_assets, maturities, and groups using AND semantics.","schema":{"maxItems":20,"type":"array","items":{"type":"string"}}},{"name":"collateral_assets","required":false,"in":"query","description":"Filter nested offers in the requested lifecycle by configured collateral token addresses. Combined with market_ids, loan_assets, maturities, and groups using AND semantics; lowercase input is checksummed.","schema":{"maxItems":20,"type":"array","items":{"type":"string"}}},{"name":"maturities","required":false,"in":"query","description":"Filter nested offers in the requested lifecycle by exact market maturity timestamps, in unix seconds. Combined with market_ids, loan_assets, collateral_assets, and groups using AND semantics.","schema":{"maxItems":20,"type":"array","items":{"anyOf":[{"type":"string","maxLength":16,"pattern":"^\\d+$"},{"type":"integer","minimum":0,"maximum":9007199254740991}]}}},{"name":"maturity_gte","required":false,"in":"query","description":"Filter nested offers in the requested lifecycle by market maturity greater than or equal to this unix timestamp. Combined with market_ids, loan_assets, collateral_assets, maturities, and groups using AND semantics.","schema":{"anyOf":[{"type":"string","maxLength":16,"pattern":"^\\d+$"},{"type":"integer","minimum":0,"maximum":9007199254740991}]}},{"name":"maturity_lte","required":false,"in":"query","description":"Filter nested offers in the requested lifecycle by market maturity less than or equal to this unix timestamp. Combined with market_ids, loan_assets, collateral_assets, maturities, and groups using AND semantics.","schema":{"anyOf":[{"type":"string","maxLength":16,"pattern":"^\\d+$"},{"type":"integer","minimum":0,"maximum":9007199254740991}]}},{"name":"groups","required":false,"in":"query","description":"Filter by offer group ids. Combined with market_ids, loan_assets, collateral_assets, and maturities using AND semantics.","schema":{"maxItems":20,"type":"array","items":{"type":"string"}}},{"name":"created_at_gte","required":false,"in":"query","description":"Filter for group created_at greater than or equal to this unix timestamp.","schema":{"anyOf":[{"type":"string","maxLength":16,"pattern":"^\\d+$"},{"type":"integer","minimum":0,"maximum":9007199254740991}]}},{"name":"created_at_lte","required":false,"in":"query","description":"Filter for group created_at less than or equal to this unix timestamp.","schema":{"anyOf":[{"type":"string","maxLength":16,"pattern":"^\\d+$"},{"type":"integer","minimum":0,"maximum":9007199254740991}]}},{"name":"listed","required":false,"in":"query","description":"Filter by market listing status. When true, returns only groups where every offer in the requested lifecycle is on a listed market; when false, groups with at least one lifecycle-matching offer on an unlisted market. Omit to return both.","schema":{"type":"string","enum":["true","false"]}},{"name":"sort_by","required":false,"in":"query","description":"Sort field for group cursor pagination.","schema":{"default":"id","type":"string","enum":["id","created_at"]}},{"name":"sort_direction","required":false,"in":"query","description":"Sort direction for group cursor pagination.","schema":{"default":"asc","type":"string","enum":["asc","desc"]}},{"name":"limit","required":false,"in":"query","description":"Maximum number of groups to return.","schema":{"minimum":1,"maximum":100,"default":100,"type":"integer"}},{"name":"cursor","required":false,"in":"query","description":"Opaque cursor from a previous page response.","schema":{"minLength":1,"maxLength":4096,"type":"string"}}],"responses":{"200":{"description":"Cursor-paginated list of Midnight offer groups.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OfferGroupsResponse"},"examples":{"active":{"summary":"Default active offer groups","value":{"cursor":"eyJzb3J0QnkiOiJpZCIsInNvcnREaXJlY3Rpb24iOiJhc2MiLCJjaGFpbklkIjo4NDUzLCJncm91cCI6IjB4MGJhYjUxZmFiNjQxNTdiYzEwMTFjZTY1YjliZjliMmIxMWYyMDJiOGE3YWI3NmI0MDhjZjQwYjhhZGYwNjlkMyJ9","data":[{"id":"0x0bab51fab64157bc1011ce65b9bf9b2b11f202b8a7ab76b408cf40b8adf069d3","chain_id":8453,"status":"active","type":"buy","created_at":1783584485,"expiry":1784300399,"max_units":"0","max_assets":"80000000000000","consumed":"0","callback":null,"offers":[{"market_id":"0xcc9418ea594c6e658650aedd205ce4544b266b69493f56fd2adc65c14bd06738","market":{"loan_token":"0x4200000000000000000000000000000000000006","maturity":1784300400,"rcf_threshold":"0","enter_gate":"0x0000000000000000000000000000000000000000","liquidator_gate":"0x0000000000000000000000000000000000000000","collaterals":[{"token":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","lltv":"860000000000000000","liquidation_cursor":"300000000000000000","oracle":"0xD09048c8B568Dbf5f189302beA26c9edABFC4858"}]},"created_at":1783584485,"buy":true,"maker":"0x958eB498a4172EA513c79b09E7f064070C5b1917","max_units":"0","max_assets":"80000000000000","continuous_fee_cap":"115792089237316195423570985008687907853269984665640564039457584007913129639935","start":1783584483,"expiry":1784300399,"tick":4408,"callback":"0x0000000000000000000000000000000000000000","callback_data":"0x","receiver_if_maker_is_seller":"0x0000000000000000000000000000000000000000","ratifier":"0xd6e70365C8E8DDa9a4ca662C07bbE663b017755E","ratifier_data":"0x000000000000000000000000000000000000000000000000000000000000001b3f4a8c6d2e109b7f5c4d8a1e6b3f7092c5d4e8a7b1c6f3092d5e4a8b7c1f60392a7d5c9e4b1f8036d8c2a5e7f1049b3d6c8e2a5f7b1d4093c6e8a2f5b7d1049c8b2f6d4a1c9e7035f8b2d6a4c1e9073f5b8d2a6c4e1f9037b5d8a2c6e4f1093b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000000","parsed_ratifier_data":{"ratifier_type":"ecrecover"},"reduce_only":false}]}]}},"scheduled":{"summary":"Scheduled offer group","value":{"cursor":null,"data":[{"id":"0x0bab51fab64157bc1011ce65b9bf9b2b11f202b8a7ab76b408cf40b8adf069d3","chain_id":8453,"status":"scheduled","type":"buy","created_at":1783584485,"expiry":1791000000,"max_units":"0","max_assets":"80000000000000","consumed":"0","callback":null,"offers":[{"market_id":"0xcc9418ea594c6e658650aedd205ce4544b266b69493f56fd2adc65c14bd06738","market":{"loan_token":"0x4200000000000000000000000000000000000006","maturity":1792000000,"rcf_threshold":"0","enter_gate":"0x0000000000000000000000000000000000000000","liquidator_gate":"0x0000000000000000000000000000000000000000","collaterals":[{"token":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","lltv":"860000000000000000","liquidation_cursor":"300000000000000000","oracle":"0xD09048c8B568Dbf5f189302beA26c9edABFC4858"}]},"created_at":1783584485,"buy":true,"maker":"0x958eB498a4172EA513c79b09E7f064070C5b1917","max_units":"0","max_assets":"80000000000000","continuous_fee_cap":"115792089237316195423570985008687907853269984665640564039457584007913129639935","start":1790000000,"expiry":1791000000,"tick":4408,"callback":"0x0000000000000000000000000000000000000000","callback_data":"0x","receiver_if_maker_is_seller":"0x0000000000000000000000000000000000000000","ratifier":"0xd6e70365C8E8DDa9a4ca662C07bbE663b017755E","ratifier_data":"0x000000000000000000000000000000000000000000000000000000000000001b3f4a8c6d2e109b7f5c4d8a1e6b3f7092c5d4e8a7b1c6f3092d5e4a8b7c1f60392a7d5c9e4b1f8036d8c2a5e7f1049b3d6c8e2a5f7b1d4093c6e8a2f5b7d1049c8b2f6d4a1c9e7035f8b2d6a4c1e9073f5b8d2a6c4e1f9037b5d8a2c6e4f1093b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000000","parsed_ratifier_data":{"ratifier_type":"ecrecover"},"reduce_only":false}]}]}},"blueBuy":{"summary":"Verified Blue buy callback group","value":{"cursor":null,"data":[{"id":"0x5798f67bc04fa5dcbf907af3c3cee279242ab1f96c036fb42d9c86110c18f43d","chain_id":8453,"status":"active","type":"buy","created_at":1786022643,"expiry":1790348399,"max_units":"10000000000000","max_assets":"0","consumed":"0","callback":{"type":"blue_buy","callback_address":"0xBfd1E870837a0229C1C4E2979f8cfAEd42b9d220","market_id":"0xe920c120b2e1c79e9f97c5219ab092f96e06ed0b58882737fe863b029395f36f","market_params":{"loan_token":"0x4200000000000000000000000000000000000006","collateral_token":"0x0000000000000000000000000000000000000000","oracle_address":"0x0000000000000000000000000000000000000000","irm_address":"0x0000000000000000000000000000000000000000","lltv_wad":"0"}},"offers":[{"market_id":"0xeb8ee91c68c8cba3eebe7c8bfd8da4039fe274add65c2ed28015b137bbcc34cd","market":{"loan_token":"0x4200000000000000000000000000000000000006","maturity":1790348400,"rcf_threshold":"2000000000000000000","enter_gate":"0x0000000000000000000000000000000000000000","liquidator_gate":"0x0000000000000000000000000000000000000000","collaterals":[{"token":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","lltv":"860000000000000000","liquidation_cursor":"300000000000000000","oracle":"0xD09048c8B568Dbf5f189302beA26c9edABFC4858"}]},"created_at":1786022643,"buy":true,"maker":"0x3C521Cc604AFbD0dF28A2917C07a91fd323C13CA","max_units":"10000000000000","max_assets":"0","continuous_fee_cap":"115792089237316195423570985008687907853269984665640564039457584007913129639935","start":1786022637,"expiry":1790348399,"tick":6700,"callback":"0xBfd1E870837a0229C1C4E2979f8cfAEd42b9d220","callback_data":"0x00000000000000000000000042000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","receiver_if_maker_is_seller":"0x0000000000000000000000000000000000000000","ratifier":"0x3B2FbA901C88f026BF50A12c8B28484Cd81F9526","ratifier_data":"0x5c4d8a1e6b3f7092c5d4e8a7b1c6f3092d5e4a8b7c1f60392a7d5c9e4b1f8036000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000005e80a6bf00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","parsed_ratifier_data":{"ratifier_type":"rate_v1","rate_per_second_wad":"1585489599","allowed_taker":"0x0000000000000000000000000000000000000000"},"reduce_only":false}]}]}},"adapter":{"summary":"Midnight vault adapter offer group","value":{"cursor":null,"data":[{"id":"0x3d2f1c8a7b6e5d4c3b2a19f8e7d6c5b4a39281706f5e4d3c2b1a09f8e7d6c5b4","chain_id":8453,"status":"active","type":"buy","created_at":1783584485,"expiry":1784300399,"max_units":"5000000000000","max_assets":"0","consumed":"0","callback":null,"offers":[{"market_id":"0xcc9418ea594c6e658650aedd205ce4544b266b69493f56fd2adc65c14bd06738","market":{"loan_token":"0x4200000000000000000000000000000000000006","maturity":1784300400,"rcf_threshold":"0","enter_gate":"0x0000000000000000000000000000000000000000","liquidator_gate":"0x0000000000000000000000000000000000000000","collaterals":[{"token":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","lltv":"860000000000000000","liquidation_cursor":"300000000000000000","oracle":"0xD09048c8B568Dbf5f189302beA26c9edABFC4858"}]},"created_at":1783584485,"buy":true,"maker":"0x2c1F6B5Ad9C1D0a5e3F4B7C8D9E0A1b2c3d4E5f6","max_units":"5000000000000","max_assets":"0","continuous_fee_cap":"115792089237316195423570985008687907853269984665640564039457584007913129639935","start":1783584483,"expiry":1784300399,"tick":6700,"callback":"0x2c1F6B5Ad9C1D0a5e3F4B7C8D9E0A1b2c3d4E5f6","callback_data":"0x","receiver_if_maker_is_seller":"0x0000000000000000000000000000000000000000","ratifier":"0x2c1F6B5Ad9C1D0a5e3F4B7C8D9E0A1b2c3d4E5f6","ratifier_data":"0x00000000000000000000000039c01afa4b3f827a0bfaa39cdc4610111f80babc000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000c05c4d8a1e6b3f7092c5d4e8a7b1c6f3092d5e4a8b7c1f60392a7d5c9e4b1f8036000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000005e80a6bf00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","parsed_ratifier_data":{"ratifier_type":"adapter","parent_vault":"0x8f6e4C2a0b9d7E5f3A1c8b6D4E2F0a9C7B5d3e1f","sub_ratifier":"0x39c01afA4B3f827a0bfAa39cDC4610111f80BABc","parsed_sub_ratifier_data":{"ratifier_type":"rate_v1","rate_per_second_wad":"1585489599","allowed_taker":"0x0000000000000000000000000000000000000000"}},"reduce_only":false}]}]}},"expired":{"summary":"Expired offer group","value":{"cursor":null,"data":[{"id":"0xf0b804928ce5e746ebf5c991c8d74f4141ef45ba35ec75940ef29ae6243d4606","chain_id":8453,"status":"expired","type":"buy","created_at":1783497600,"expiry":1783584000,"max_units":"0","max_assets":"80000000000000","consumed":"0","callback":null,"offers":[{"market_id":"0xcc9418ea594c6e658650aedd205ce4544b266b69493f56fd2adc65c14bd06738","market":{"loan_token":"0x4200000000000000000000000000000000000006","maturity":1784300400,"rcf_threshold":"0","enter_gate":"0x0000000000000000000000000000000000000000","liquidator_gate":"0x0000000000000000000000000000000000000000","collaterals":[{"token":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","lltv":"860000000000000000","liquidation_cursor":"300000000000000000","oracle":"0xD09048c8B568Dbf5f189302beA26c9edABFC4858"}]},"created_at":1783497600,"buy":true,"maker":"0x958eB498a4172EA513c79b09E7f064070C5b1917","max_units":"0","max_assets":"80000000000000","continuous_fee_cap":"115792089237316195423570985008687907853269984665640564039457584007913129639935","start":1783497600,"expiry":1783584000,"tick":4408,"callback":"0x0000000000000000000000000000000000000000","callback_data":"0x","receiver_if_maker_is_seller":"0x0000000000000000000000000000000000000000","ratifier":"0xd6e70365C8E8DDa9a4ca662C07bbE663b017755E","ratifier_data":"0x000000000000000000000000000000000000000000000000000000000000001b3f4a8c6d2e109b7f5c4d8a1e6b3f7092c5d4e8a7b1c6f3092d5e4a8b7c1f60392a7d5c9e4b1f8036d8c2a5e7f1049b3d6c8e2a5f7b1d4093c6e8a2f5b7d1049c8b2f6d4a1c9e7035f8b2d6a4c1e9073f5b8d2a6c4e1f9037b5d8a2c6e4f1093b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000000","parsed_ratifier_data":{"ratifier_type":"ecrecover"},"reduce_only":false}]}]}},"filled":{"summary":"Filled offer group","value":{"cursor":null,"data":[{"id":"0xf0b804928ce5e746ebf5c991c8d74f4141ef45ba35ec75940ef29ae6243d4606","chain_id":8453,"status":"filled","type":"buy","created_at":1783497600,"expiry":1783584000,"max_units":"0","max_assets":"80000000000000","consumed":"80000000000000","callback":null,"offers":[{"market_id":"0xcc9418ea594c6e658650aedd205ce4544b266b69493f56fd2adc65c14bd06738","market":{"loan_token":"0x4200000000000000000000000000000000000006","maturity":1784300400,"rcf_threshold":"0","enter_gate":"0x0000000000000000000000000000000000000000","liquidator_gate":"0x0000000000000000000000000000000000000000","collaterals":[{"token":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","lltv":"860000000000000000","liquidation_cursor":"300000000000000000","oracle":"0xD09048c8B568Dbf5f189302beA26c9edABFC4858"}]},"created_at":1783497600,"buy":true,"maker":"0x958eB498a4172EA513c79b09E7f064070C5b1917","max_units":"0","max_assets":"80000000000000","continuous_fee_cap":"115792089237316195423570985008687907853269984665640564039457584007913129639935","start":1783497600,"expiry":1783584000,"tick":4408,"callback":"0x0000000000000000000000000000000000000000","callback_data":"0x","receiver_if_maker_is_seller":"0x0000000000000000000000000000000000000000","ratifier":"0xd6e70365C8E8DDa9a4ca662C07bbE663b017755E","ratifier_data":"0x000000000000000000000000000000000000000000000000000000000000001b3f4a8c6d2e109b7f5c4d8a1e6b3f7092c5d4e8a7b1c6f3092d5e4a8b7c1f60392a7d5c9e4b1f8036d8c2a5e7f1049b3d6c8e2a5f7b1d4093c6e8a2f5b7d1049c8b2f6d4a1c9e7035f8b2d6a4c1e9073f5b8d2a6c4e1f9037b5d8a2c6e4f1093b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000000","parsed_ratifier_data":{"ratifier_type":"ecrecover"},"reduce_only":false}]}]}},"cancelled":{"summary":"Cancelled offer group","value":{"cursor":null,"data":[{"id":"0xf0b804928ce5e746ebf5c991c8d74f4141ef45ba35ec75940ef29ae6243d4606","chain_id":8453,"status":"cancelled","type":"buy","created_at":1783497600,"expiry":1783584000,"max_units":"0","max_assets":"80000000000000","consumed":"340282366920938463463374607431768211455","callback":null,"offers":[{"market_id":"0xcc9418ea594c6e658650aedd205ce4544b266b69493f56fd2adc65c14bd06738","market":{"loan_token":"0x4200000000000000000000000000000000000006","maturity":1784300400,"rcf_threshold":"0","enter_gate":"0x0000000000000000000000000000000000000000","liquidator_gate":"0x0000000000000000000000000000000000000000","collaterals":[{"token":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","lltv":"860000000000000000","liquidation_cursor":"300000000000000000","oracle":"0xD09048c8B568Dbf5f189302beA26c9edABFC4858"}]},"created_at":1783497600,"buy":true,"maker":"0x958eB498a4172EA513c79b09E7f064070C5b1917","max_units":"0","max_assets":"80000000000000","continuous_fee_cap":"115792089237316195423570985008687907853269984665640564039457584007913129639935","start":1783497600,"expiry":1783584000,"tick":4408,"callback":"0x0000000000000000000000000000000000000000","callback_data":"0x","receiver_if_maker_is_seller":"0x0000000000000000000000000000000000000000","ratifier":"0xd6e70365C8E8DDa9a4ca662C07bbE663b017755E","ratifier_data":"0x000000000000000000000000000000000000000000000000000000000000001b3f4a8c6d2e109b7f5c4d8a1e6b3f7092c5d4e8a7b1c6f3092d5e4a8b7c1f60392a7d5c9e4b1f8036d8c2a5e7f1049b3d6c8e2a5f7b1d4093c6e8a2f5b7d1049c8b2f6d4a1c9e7035f8b2d6a4c1e9073f5b8d2a6c4e1f9037b5d8a2c6e4f1093b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000000","parsed_ratifier_data":{"ratifier_type":"ecrecover"},"reduce_only":false}]}]}}}}}},"400":{"description":"`VALIDATION_FAILED` — request parameters failed validation. `INVALID_CURSOR` — the provided cursor is malformed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightErrorResponse"},"examples":{"validationFailed":{"summary":"Validation failed","value":{"error":{"code":"VALIDATION_FAILED","message":"Validation failed","details":[{"code":"invalid_type","message":"Expected number, received string","path":["chain_ids",0]}],"request_id":"f0e1d2c3-b4a5-4968-8728-1c0d1e2f3a4b"}}},"requestError":{"summary":"INVALID_CURSOR","value":{"error":{"code":"INVALID_CURSOR","message":"Invalid user group cursor","details":null,"request_id":"f0e1d2c3-b4a5-4968-8728-1c0d1e2f3a4b"}}}}}}},"500":{"description":"`INTERNAL_ERROR` — the request failed due to an unexpected server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightErrorResponse"},"example":{"error":{"code":"INTERNAL_ERROR","message":"Internal server error","details":null,"request_id":"f0e1d2c3-b4a5-4968-8728-1c0d1e2f3a4b"}}}}}},"summary":"List Midnight offer groups for a user","tags":["Offer Groups"],"x-codeSamples":[{"lang":"bash","label":"cURL","source":"BASE_URL='https://api.morpho.org'\nUSER_ADDRESS=\"0x958eB498a4172EA513c79b09E7f064070C5b1917\"\n\ncurl -sS \"${BASE_URL}/v0/midnight/users/${USER_ADDRESS}/offer-groups?chain_ids=1\" \\\n  -H \"accept: application/json\"","id":"curl"},{"lang":"js","label":"JavaScript","source":"const baseUrl = \"https://api.morpho.org\";\nconst userAddress = \"0x958eB498a4172EA513c79b09E7f064070C5b1917\";\n\nconst url = new URL(`${baseUrl}/v0/midnight/users/${userAddress}/offer-groups`);\nurl.searchParams.set(\"chain_ids\", \"1\");\n\nconst response = await fetch(url, {\n  headers: {\n    accept: \"application/json\",\n  },\n});\nif (!response.ok) throw new Error(await response.text());\n\nconst body = await response.json();","id":"js"}]}},"/v0/midnight/books":{"get":{"tags":["Books"],"summary":"List books","description":"Returns books for active maturities admitted by the current policy, with market metadata and the top 3 ask/bid levels. Unlisted and past maturities are excluded, even when requested with `ids`. If a maturity leaves the policy, its books are hidden immediately, including books with existing offers. Supports filtering, sorting, and pagination; default sort is `id` ascending.","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BookCursorListResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestResponse"}}}},"503":{"description":"Service Unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceUnavailableResponse"}}}}},"parameters":[{"in":"query","name":"sort","required":false,"description":"Sort by comma-separated fields (`id`, `ask`, `bid`, `maturity`). Prefix a field with `-` for descending. Max 3 fields.","style":"form","explode":false,"schema":{"type":"string"}},{"in":"query","name":"maturity_lte","required":false,"description":"Inclusive upper maturity bound in unix seconds.","schema":{"type":"integer","minimum":1,"maximum":9007199254740991}},{"in":"query","name":"maturity_gte","required":false,"description":"Inclusive lower maturity bound in unix seconds.","schema":{"type":"integer","minimum":1,"maximum":9007199254740991}},{"in":"query","name":"maturities","required":false,"description":"Exact maturity timestamp filter in unix seconds (comma-separated). Maximum 150 values.","style":"form","explode":false,"schema":{"type":"array","items":{"type":"integer","minimum":1,"maximum":9007199254740991},"maxItems":150}},{"in":"query","name":"collateral_tokens","required":false,"description":"Collateral token filter (comma-separated 20-byte 0x-prefixed EVM addresses, matches any collateral). Maximum 150 values.","style":"form","explode":false,"schema":{"type":"array","items":{"type":"string"},"maxItems":150}},{"in":"query","name":"loan_tokens","required":false,"description":"Loan token address filter (comma-separated 20-byte 0x-prefixed EVM addresses). Maximum 150 values.","style":"form","explode":false,"schema":{"type":"array","items":{"type":"string"},"maxItems":150}},{"in":"query","name":"chain_ids","required":false,"description":"Integer EVM chain ID filter (comma-separated, e.g. 1 for Ethereum). Currently accepts at most one chain id.","style":"form","explode":false,"schema":{"type":"array","items":{"type":"number","enum":[1,8453,5042,4663,4217,42161]},"maxItems":1}},{"in":"query","name":"ids","required":false,"description":"Market ID filter as a single comma-separated query parameter of 32-byte 0x-prefixed hex IDs. Returns books for matching currently listed markets. Maximum 20 IDs.","style":"form","explode":false,"schema":{"type":"string"}},{"in":"query","name":"limit","description":"Maximum number of items to return (max 20, default 10).","schema":{"type":"number"}},{"in":"query","name":"cursor","description":"Opaque pagination cursor from a previous response.","schema":{"type":"string"}}],"security":[],"x-codeSamples":[{"lang":"bash","label":"cURL","source":"BASE_URL='https://api.morpho.org'\n\ncurl -sS \"${BASE_URL}/v0/midnight/books?chain_ids=1\" \\\n  -H \"accept: application/json\"","id":"curl"},{"lang":"js","label":"JavaScript","source":"const baseUrl = \"https://api.morpho.org\";\n\nconst url = new URL(`${baseUrl}/v0/midnight/books`);\nurl.searchParams.set(\"chain_ids\", \"1\");\n\nconst response = await fetch(url, {\n  headers: {\n    accept: \"application/json\",\n  },\n});\nif (!response.ok) throw new Error(await response.text());\n\nconst body = await response.json();","id":"js"}]}},"/v0/midnight/books/{market-id}":{"get":{"tags":["Books"],"summary":"Get book","description":"Returns one active book whose maturity is admitted by the current policy, with market metadata and both sides. If its maturity leaves the policy, the book becomes unavailable immediately, including when existing offers remain. A visible book with no offers returns empty `asks` and `bids`. Each side returns up to `depth` levels, sorted best price first.","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BookDataResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestResponse"}}}},"404":{"description":"Book is not currently listed, unknown, unsupported, or matured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundResponse"}}}},"503":{"description":"Service Unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceUnavailableResponse"}}}}},"parameters":[{"in":"query","name":"depth","required":false,"description":"Maximum levels returned per side. Default: 100. Maximum: 6745 (ticks 0 through 6744, inclusive).","schema":{"type":"number","maximum":6745}},{"in":"path","name":"market-id","description":"32-byte 0x-prefixed Midnight market ID. List live markets with `GET /v0/midnight/books`.","schema":{"type":"string"},"example":"{market-id}"}],"security":[]}},"/v0/midnight/books/{market-id}/{side}":{"get":{"tags":["Books"],"summary":"List book price levels","description":"Returns one side of a book as price levels grouped by tick with total units, assets, and price, sorted best price first.","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListBookPriceLevelResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestResponse"}}}},"503":{"description":"Service Unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceUnavailableResponse"}}}}},"parameters":[{"in":"query","name":"depth","required":false,"description":"Maximum levels returned. Default: 100. Maximum: 6745 (ticks 0 through 6744, inclusive).","schema":{"type":"number","maximum":6745}},{"in":"path","name":"side","example":"asks","description":"Book side to query (`asks` or `bids`).","schema":{"type":"string","enum":["asks","bids"]}},{"in":"path","name":"market-id","description":"32-byte 0x-prefixed Midnight market ID. List live markets with `GET /v0/midnight/books`.","schema":{"type":"string"},"example":"{market-id}"}],"security":[]}},"/v0/midnight/books/{market-id}/{side}/takeable-offers":{"get":{"tags":["Books"],"summary":"List book takeable offers","deprecated":true,"description":"Returns up to 1,000 executable offers for one book side, sorted best price first. This endpoint is not paginated and does not accept a limit or cursor.","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListBookTakeableOfferResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestResponse"}}}},"503":{"description":"Service Unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceUnavailableResponse"}}}}},"parameters":[{"in":"path","name":"side","example":"asks","description":"Book side to query (`asks` or `bids`).","schema":{"type":"string","enum":["asks","bids"]}},{"in":"path","name":"market-id","description":"32-byte 0x-prefixed Midnight market ID. List live markets with `GET /v0/midnight/books`.","schema":{"type":"string"},"example":"{market-id}"}],"security":[]}},"/v0/midnight/books/{market-id}/{side}/quote":{"get":{"tags":["Books"],"summary":"Get quote","description":"Returns a bundle-ready quote for the requested assets or units, plus expected best/worst average prices and maximum executable liquidity.\n\nThe endpoint optimizes for successful target-aware bundle execution under contention: `takeable_offers` are best-priced per-offer caps and their total can exceed the requested target, giving a bundle executor fallback liquidity when earlier offers are partially consumed or skipped.\n\nAt most `limit` (default and maximum 10,000) best-priced takeable offers are walked and returned; prices and availability always describe exactly the returned window. A request that cannot fill within `limit` offers returns 422.\n\nUse the returned takeable offers with a bundle abstraction that stops at your requested target and applies your max/min asset or unit protections. If you execute takeable offers independently with Midnight.take, do not submit every returned unit blindly: clamp each offer to your remaining target and current takeability, or you may execute more than intended.\n\nIf the requested size cannot be fully satisfied at quote time under the selected guard, the endpoint returns 422.","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuoteDataResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestResponse"}}}},"422":{"description":"Requested quote size cannot be fully satisfied.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientLiquidityResponse"}}}},"503":{"description":"Service Unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceUnavailableResponse"}}}}},"parameters":[{"in":"query","name":"limit","required":false,"description":"Maximum number of best-priced takeable offers the quote may walk and return. Returned prices and availability describe exactly this window, and a request that cannot fill within `limit` offers returns 422. Maximum: 10000. Default: 10000.","schema":{"type":"string"}},{"in":"query","name":"average_worst_price","required":false,"description":"Optional positive base-10 integer string (1e18-scaled) conservative average worst-price guard for the requested target. For `asks`, the returned `average_worst_price` is at or below this value; for `bids`, it is at or above it. The target-closing offer is clipped exactly when needed, and only whole additional fallback caps whose conservative bound remains inside the guard are returned. If the target itself cannot satisfy the guard, the request fails with 422. Mutually exclusive with `slippage`.","schema":{"type":"string"}},{"in":"query","name":"slippage","required":false,"description":"Optional slippage percentage used to derive a worst-price guard from the realized `average_best_price` for the requested target. The returned fallback window is trimmed until its conservative `average_worst_price` stays inside that guard. For `asks`, the guard increases by slippage; for `bids`, it decreases by slippage. The response reports the conservative bound, not the derived guard. Range: 0.1 to 100, with at most one decimal place. Mutually exclusive with `average_worst_price`.","schema":{"type":"string"}},{"in":"query","name":"taker","required":false,"description":"20-byte 0x-prefixed EVM account address that will execute the take (the `taker` passed to Midnight `take`). Offers made by this account are excluded, since Midnight rejects self-takes.","schema":{"type":"string"}},{"in":"query","name":"units","required":false,"description":"Target unit amount as a positive base-10 integer string. Exactly one of `assets` or `units` is required.","schema":{"type":"string"}},{"in":"query","name":"assets","required":false,"description":"Target assets amount as a positive base-10 integer string in the loan token’s smallest unit. Exactly one of `assets` or `units` is required.","schema":{"type":"string"}},{"in":"path","name":"side","example":"asks","description":"Book side to quote (`asks` or `bids`).","schema":{"type":"string","enum":["asks","bids"]}},{"in":"path","name":"market-id","description":"32-byte 0x-prefixed Midnight market ID. List live markets with `GET /v0/midnight/books`.","schema":{"type":"string"},"example":"{market-id}"}],"security":[]}},"/v0/midnight/takeable-offers":{"get":{"tags":["Books"],"summary":"List maker takeable offers","description":"Returns one maker's active offers. A fresh offer is withheld until measured, unless indexed ratifier state proves both a blocker and maker intent through the tree signature, signer-authorization history, or root history. Eligible blocked offers return with `units` set to `0`; missing state and unproven offers naming the maker remain hidden.","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListTakeableOfferResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestResponse"}}}},"503":{"description":"Service Unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceUnavailableResponse"}}}}},"parameters":[{"in":"query","name":"maker","required":true,"example":"0x7b093658BE7f90B63D7c359e8f408e503c2D9401","description":"Maker EVM address. Matching is case-insensitive.","schema":{"type":"string"}},{"in":"query","name":"market_ids","required":false,"description":"Comma-separated market IDs (32-byte 0x-prefixed hex). Matches takeable offers in any of the provided markets. Maximum 20 IDs. Combined with `groups` using AND semantics.","style":"form","explode":false,"schema":{"type":"string"}},{"in":"query","name":"groups","required":false,"description":"Comma-separated group IDs (32-byte 0x-prefixed hex). Matches takeable offers in any of the provided groups. Maximum 20 IDs.","style":"form","explode":false,"schema":{"type":"string"}},{"in":"query","name":"limit","description":"Maximum number of items to return.","schema":{"type":"number"}},{"in":"query","name":"cursor","description":"Opaque pagination cursor from a previous response.","schema":{"type":"string"}}],"security":[]}},"/v0/midnight/mempool/validate":{"post":{"tags":["Mempool"],"summary":"Validate a mempool payload","description":"Use this endpoint before submitting an encoded payload to the mempool.\n\nIt checks whether the router would accept the payload for indexing; it does not prove a later on-chain transaction will succeed. `data.issues` is empty when the payload passes. When issues are returned, each `rule` appears once for the whole payload, not once per offer. `details` is normally null; `min_offer_assets_usd` retains the first failing offer's `loan_token` and `min_assets`, and adds the configured `usd_threshold`.\n\nIssue names you may see:\n\n**Payload format**\n- `payload_version`: payload uses an unsupported version.\n- `payload_frame`: payload is not valid hex or is missing required framing bytes.\n- `payload_gzip_length`: declared compressed length does not match the payload bytes.\n- `payload_suffix_too_large`: trailing attribution or suffix bytes exceed the allowed size.\n- `payload_decompression`: compressed bytes cannot be decompressed or exceed size limits.\n- `payload_abi_decode`: decompressed bytes are not a valid offer list.\n- `empty_payload`: payload contains no offers.\n- `max_offers_per_tree`: payload contains more offers than the chain allows.\n- `duplicate_offer_hash`: the same offer appears more than once.\n\n**Chain and market support**\n- `unsupported_chain`: `chain_id` is not supported.\n- `market_chain_mismatch`: an offer embeds a chain id or Midnight deployment address that does not match the requested chain.\n- `maturity`: market maturity is outside the allowed maturity windows.\n- `loan_token`: loan token is not supported on this chain or has no configured minimum.\n- `collateral_token`: a collateral token is the zero address; any other token is accepted.\n- `oracle`: a collateral oracle is the zero address.\n- `loan_collateral`: the loan token is used as collateral on a chain that does not admit it, without the chain's fixed-price oracle, without the required LLTV, or without another collateral alongside it.\n- `rcf_threshold`: market RCF threshold does not match its loan token and highest non-loan collateral LLTV, or the market has no non-loan collateral.\n- `collateral_lltv`: collateral loan-to-value tier is not enabled.\n- `max_lif`: liquidation incentive setting is not enabled.\n- `max_collaterals`: an offer uses too many collateral entries.\n\n**Offer terms**\n- `amount_missing`: neither `max_units` nor `max_assets` is set.\n- `amount_conflict`: both `max_units` and `max_assets` are set; choose one.\n- `min_offer_assets_usd`: offer size is below the configured loan-token minimum; `details` provides the raw-asset floor.\n- `min_tick`: price tick is below the allowed range.\n- `max_tick`: price tick is above the allowed range.\n- `tick_spacing`: price tick is not on the allowed tick grid.\n- `min_duration`: offer start/expiry window is too short.\n- `ratifier`: ratifier contract is not accepted for the chain.\n\n**Batch consistency**\n- `mixed_maker`: offers in one payload use different makers.\n- `mixed_ratifier`: offers in one payload use different ratifiers.\n- `group_identity`: group id does not match the offers in that group.\n- `group_consistency`: offers sharing a group have conflicting terms or overlapping active windows.\n\n**Callbacks**\n- `non_empty_callback`: callbacks with custom address or data are not accepted.\n- `blue_callback`: a non-empty callback is only accepted on a buy offer whose callback data is the exact ABI-encoded Blue `MarketParams` with the same loan token as the offer. Validation does not check that the callback is registered: register it to the maker through the chain's factory published by `/v0/midnight/mempool/rules` at or before the offer's creation block, or the offer is rejected after indexing.\n- `vault_v2_callback`: Applies only when `ratifier == maker == callback.address` (the Midnight adapter), alongside the chain's other callback rule. Sells must use the adapter as `receiver_if_maker_is_seller` with empty callback data. Buys must use `abi.encode(address(0), \"\")` for idle assets or `abi.encode(fundingAdapter, abi.encode(MarketParams))`; the funding adapter cannot be zero or the adapter itself, and `MarketParams.loanToken` must equal the offer's loan token. Ratifier data must be `abi.encode(subRatifier, data)` with `subRatifier` in the published `sub_ratifiers`. Vault, asset, and funding-adapter registration is checked after indexing.\n- `buy_empty_callback`: buy offers with empty callbacks are not accepted.\n- `sell_empty_callback`: sell offers with empty callbacks are not accepted.","responses":{"200":{"description":"Validation result. Check `data.issues`; an empty list means the payload passes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationSuccessResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestResponse"}}}},"413":{"description":"Payload Too Large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PayloadTooLargeResponse"}}}},"503":{"description":"Service Unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceUnavailableResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidateMempoolPayloadRequest"}}}},"parameters":[{"in":"query","name":"timestamp","required":false,"description":"Optional ISO-8601 UTC timestamp. Uses the policy snapshot active at the latest 15:00 UTC boundary at or before this timestamp; omitted uses the current time.","schema":{"type":"string"}}],"security":[]}},"/v0/midnight/mempool/rules":{"get":{"tags":["Mempool"],"summary":"List mempool rules","description":"Returns admission rules and payload limits for the requested chains and policy snapshot. Follow the pagination cursor to retrieve every row.\n\n`liquidation_cursor` gives the required cursor for every collateral on a chain, scaled by 1e18. `max_lif` gives the resulting maximum liquidation incentive factor for each LLTV. Validation reports cursor mismatches as `max_lif` issues.\n\n`min_offer_assets` gives the exact minimum per loan token in raw units; `min_offer_assets_usd` gives the chain-level USD threshold. A `min_offer_assets_usd` validation issue reports `loan_token`, `min_assets`, and `usd_threshold`. For offers sized in units, the minimum applies to assets converted at the offer tick with side-specific rounding.\n\nCallback policy publishes the chain's active rules independently: `vault_v2_callback` is listed alongside the other active non-empty callback rule, `non_empty_callback` or `blue_callback`. Empty callbacks use the zero address and `0x` data. Validation reports the corresponding rule name when its check fails.\n\nRules with only `type` and `chain_id` have fixed meanings:\n\n- `payload_frame`: payload must be valid hex with a one-byte version and four-byte gzip length header.\n\n- `payload_gzip_length`: the declared gzip stream must fit within the payload bytes.\n\n- `payload_abi_decode`: decompressed bytes must be a canonical ABI offer list with valid offer fields.\n\n- `empty_payload`: payload must contain at least one non-empty offer.\n\n- `duplicate_offer_hash`: non-empty offers must not repeat the same offer hash.\n\n- `unsupported_chain`: the request chain must be supported by the service.\n\n- `market_chain_mismatch`: every offer must target the requested chain and its Midnight deployment.\n\n- `nonzero_collateral_token`: at least one collateral, with no zero token addresses.\n\n- `collateral_order`: collateral token addresses must be sorted ascending without duplicates.\n\n- `nonzero_oracle`: every collateral oracle must be nonzero on every chain, including Anvil.\n\n- `offer_time_bounds`: start < expiry <= market maturity.\n\n- `buy_zero_receiver_if_maker_is_seller`: buy offers must set receiver_if_maker_is_seller to the zero address.\n\n`POST /v0/midnight/mempool/validate` reports some of these rules under a different issue name: `nonzero_collateral_token` as `collateral_token`, `nonzero_oracle` as `oracle`, `payload_compression` as `payload_decompression`, and `collateral_order`, `offer_time_bounds`, and `buy_zero_receiver_if_maker_is_seller` as `payload_abi_decode`.\n\nPayload size rules use bytes. The compressed limit covers the gzip stream only; decompressed and suffix limits are separate. `max_offers_per_tree.max` limits the number of payload entries, including empty padding entries.","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfigRulesSuccessResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestResponse"}}}},"503":{"description":"Service Unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceUnavailableResponse"}}}}},"parameters":[{"in":"query","name":"timestamp","required":false,"description":"Optional ISO-8601 UTC timestamp. Uses the policy snapshot active at the latest 15:00 UTC boundary at or before this timestamp; omitted uses the current time.","schema":{"type":"string"}},{"in":"query","name":"chain_ids","required":false,"description":"Filter by integer EVM chain IDs (comma-separated, e.g. 1 for Ethereum). Maximum 20 values.","style":"form","explode":false,"schema":{"type":"array","items":{"type":"number","enum":[1,8453,5042,4663,4217,42161]},"maxItems":20}},{"in":"query","name":"types","required":false,"description":"Filter by rule types (comma-separated, e.g. maturity,min_offer_assets). Maximum 43 values.","style":"form","explode":false,"schema":{"type":"array","items":{"type":"string"},"maxItems":43}},{"in":"query","name":"limit","required":false,"description":"Maximum number of items to return (max 1000).","schema":{"type":"number"}},{"in":"query","name":"cursor","required":false,"description":"Opaque pagination cursor from a previous response.","schema":{"type":"string"}}],"security":[],"x-codeSamples":[{"lang":"bash","label":"cURL","source":"BASE_URL='https://api.morpho.org'\n\ncurl -sS \"${BASE_URL}/v0/midnight/mempool/rules?chain_ids=1\" \\\n  -H \"accept: application/json\"","id":"curl"},{"lang":"js","label":"JavaScript","source":"const baseUrl = \"https://api.morpho.org\";\n\nconst url = new URL(`${baseUrl}/v0/midnight/mempool/rules`);\nurl.searchParams.set(\"chain_ids\", \"1\");\n\nconst response = await fetch(url, {\n  headers: {\n    accept: \"application/json\",\n  },\n});\nif (!response.ok) throw new Error(await response.text());\n\nconst body = await response.json();","id":"js"}]}}},"components":{"schemas":{"BlockTimestampResponse":{"properties":{"data":{"description":"Block timestamp.","properties":{"block_hash":{"description":"Block hash.","type":"string"},"block_number":{"description":"Block number.","internalType":"bigint","type":"string"},"chain_id":{"description":"EVM chain identifier.","exclusiveMinimum":true,"minimum":0,"type":"integer"},"timestamp":{"description":"Block timestamp, in unix seconds.","exclusiveMinimum":true,"minimum":0,"type":"integer"}},"required":["chain_id","block_number","block_hash","timestamp"],"type":"object"}},"required":["data"],"type":"object"},"ChainsResponse":{"properties":{"data":{"description":"Supported EVM chains.","items":{"properties":{"chain_id":{"description":"EVM chain identifier.","exclusiveMinimum":true,"minimum":0,"type":"integer"},"last_indexed_block":{"description":"Last block fully processed by all realtime service jobs for this chain. Null when no realtime processing has been recorded yet.","internalType":"bigint","nullable":true,"type":"string"},"name":{"description":"Human-readable chain name.","type":"string"},"supported_protocols":{"description":"Morpho protocols deployed on the chain.","items":{"enum":["blue","vault-v1","vault-v2","midnight","preliquidation"],"type":"string"},"type":"array"}},"required":["chain_id","name","supported_protocols"],"type":"object"},"type":"array"}},"required":["data"],"type":"object"},"CoreCuratorDetailsResponse":{"properties":{"data":{"description":"Curator details resolved by a chain-specific on-chain curator address.","properties":{"chain_id":{"description":"Chain of the selected curator address.","exclusiveMinimum":true,"minimum":0,"type":"integer"},"curator_address":{"description":"Checksummed on-chain curator role address selected by the path.","type":"string"},"curators":{"description":"Every curator registry profile registered to this chain and address, sorted by registry `id`; empty when none.","items":{"properties":{"id":{"description":"Stable curator registry ID; distinguishes multiple profiles registered to one address.","type":"string"},"logo_uri":{"description":"Editorial curator logo URI from the registry. Null when the registry has no image.","nullable":true,"type":"string"},"name":{"description":"Editorial curator display name from the registry.","type":"string"},"socials":{"description":"Editorial curator social links from the registry; empty when none.","items":{"properties":{"type":{"description":"Social-link type key from the curator registry.","type":"string"},"url":{"description":"Social link URL.","type":"string"}},"required":["type","url"],"type":"object"},"type":"array"}},"required":["id","name","logo_uri","socials"],"type":"object"},"type":"array"}},"required":["chain_id","curator_address","curators"],"type":"object"}},"required":["data"],"type":"object"},"CoreCuratorListResponse":{"properties":{"cursor":{"description":"Opaque cursor for the next page. Null on the last page.","nullable":true,"type":"string"},"data":{"description":"Page of curator registry identities, sorted by `curator_id`.","items":{"properties":{"addresses":{"description":"Every address registered to the curator on a chain Core exposes, one entry per chain and address, sorted by chain then address. Not narrowed by `chain_ids`.","items":{"properties":{"chain_id":{"description":"Chain the curator address is registered on.","exclusiveMinimum":true,"minimum":0,"type":"integer"},"curator_address":{"description":"Checksummed address registered to the curator on this chain. Pass `{chain_id}:{curator_address}` to `GET /v0/curators/{curator-selector}/details` for socials.","type":"string"}},"required":["chain_id","curator_address"],"type":"object"},"type":"array"},"curator_id":{"description":"Stable curator registry ID. Approved Global registry metadata, not an on-chain fact; matches `id` on the curator details route.","type":"string"},"image_url":{"description":"Editorial curator logo URL from the registry. Null when the registry has no image.","nullable":true,"type":"string"},"name":{"description":"Editorial curator display name from the registry.","type":"string"},"verified":{"description":"Registry verification flag set by Morpho. Approved Global registry metadata, not an on-chain fact.","type":"boolean"}},"required":["curator_id","name","image_url","verified","addresses"],"type":"object"},"type":"array"}},"required":["data","cursor"],"type":"object"},"MarketApyAveragesResponseDto":{"properties":{"data":{"description":"Morpho Blue market APY averages.","properties":{"borrow_apy_averages":{"description":"Average borrow APYs excluding rewards.","properties":{"1y":{"description":"Average APY as a decimal rate. Null when historical snapshots are not available for the full window.","nullable":true,"type":"number"},"24h":{"description":"Average APY as a decimal rate. Null when historical snapshots are not available for the full window.","nullable":true,"type":"number"},"30d":{"description":"Average APY as a decimal rate. Null when historical snapshots are not available for the full window.","nullable":true,"type":"number"},"6h":{"description":"Average APY as a decimal rate. Null when historical snapshots are not available for the full window.","nullable":true,"type":"number"},"7d":{"description":"Average APY as a decimal rate. Null when historical snapshots are not available for the full window.","nullable":true,"type":"number"},"90d":{"description":"Average APY as a decimal rate. Null when historical snapshots are not available for the full window.","nullable":true,"type":"number"}},"required":["6h","24h","7d","30d","90d","1y"],"type":"object"},"chain_id":{"description":"EVM chain identifier.","exclusiveMinimum":true,"minimum":0,"type":"integer"},"last_indexed_block":{"description":"Latest indexed block used to compute these APY averages.","internalType":"bigint","type":"string"},"market_id":{"description":"Morpho Blue market id (bytes32 unique key).","type":"string"},"supply_apy_averages":{"description":"Average supply APYs excluding rewards.","properties":{"1y":{"description":"Average APY as a decimal rate. Null when historical snapshots are not available for the full window.","nullable":true,"type":"number"},"24h":{"description":"Average APY as a decimal rate. Null when historical snapshots are not available for the full window.","nullable":true,"type":"number"},"30d":{"description":"Average APY as a decimal rate. Null when historical snapshots are not available for the full window.","nullable":true,"type":"number"},"6h":{"description":"Average APY as a decimal rate. Null when historical snapshots are not available for the full window.","nullable":true,"type":"number"},"7d":{"description":"Average APY as a decimal rate. Null when historical snapshots are not available for the full window.","nullable":true,"type":"number"},"90d":{"description":"Average APY as a decimal rate. Null when historical snapshots are not available for the full window.","nullable":true,"type":"number"}},"required":["6h","24h","7d","30d","90d","1y"],"type":"object"}},"required":["chain_id","market_id","last_indexed_block","supply_apy_averages","borrow_apy_averages"],"type":"object"}},"required":["data"],"type":"object"},"MarketApyHistoryResponse":{"properties":{"data":{"description":"Morpho Blue market historical APY points.","items":{"properties":{"borrow_apy":{"description":"Historical borrow APY.","nullable":true,"type":"number"},"supply_apy":{"description":"Historical supply APY.","nullable":true,"type":"number"},"timestamp":{"description":"Historical sample timestamp in Unix seconds.","minimum":0,"type":"integer"}},"required":["timestamp","supply_apy","borrow_apy"],"type":"object"},"type":"array"},"last_indexed_block":{"description":"Latest indexed block used to serve this historical APY.","internalType":"bigint","type":"string"},"params":{"description":"Request selector parameters.","properties":{"chain_id":{"description":"EVM chain identifier from the market selector.","pattern":"^\\d+$","type":"string"},"market_id":{"description":"Morpho Blue market id from the market selector.","type":"string"}},"required":["chain_id","market_id"],"type":"object"}},"required":["params","data","last_indexed_block"],"type":"object"},"MarketLiquidityResponse":{"properties":{"data":{"description":"Morpho Blue market and Public Allocator V2 liquidity.","properties":{"borrow_amount_to_target_utilization":{"description":"Additional borrow capacity to target utilization, including Public Allocator V2 reallocations, in loan token native units.","internalType":"bigint","type":"string"},"last_indexed_block":{"description":"Indexer tip block number when serving the response.","internalType":"bigint","type":"string"},"market_liquidity":{"description":"Market liquidity in loan token native units.","internalType":"bigint","type":"string"},"reallocatable_liquidity":{"description":"Liquidity available through Public Allocator V2 in loan token native units.","internalType":"bigint","type":"string"}},"required":["market_liquidity","reallocatable_liquidity","borrow_amount_to_target_utilization","last_indexed_block"],"type":"object"}},"required":["data"],"type":"object"},"MarketListResponse":{"properties":{"cursor":{"description":"Opaque cursor. Null on the last page.","nullable":true,"type":"string"},"data":{"items":{"properties":{"chain_id":{"exclusiveMinimum":true,"minimum":0,"type":"integer"},"collateral_token":{"type":"string"},"creation_block_number":{"internalType":"bigint","type":"string"},"creation_timestamp":{"minimum":0,"type":"integer"},"irm_address":{"type":"string"},"lltv_wad":{"description":"Liquidation LTV in WAD (1e18 = 100%).","internalType":"bigint","type":"string"},"loan_token":{"type":"string"},"market_id":{"description":"Morpho Blue market id. Use <chain_id>:<market_id> for resource selectors, for example 1:0xfff1970c0ffae288764186fbb38a9171a17e98676744a1e345809cb8b9e73342.","type":"string"},"oracle_address":{"type":"string"}},"required":["chain_id","market_id","loan_token","collateral_token","oracle_address","irm_address","lltv_wad","creation_block_number","creation_timestamp"],"type":"object"},"type":"array"}},"required":["data","cursor"],"type":"object"},"MarketPositionsHealthResponse":{"properties":{"cursor":{"description":"Cursor for the next page; null on the last page.","nullable":true,"type":"string"},"data":{"description":"Positions with debt, ordered by `user_address` ascending. Empty when the market has no oracle price.","items":{"properties":{"borrow_shares":{"description":"Borrow shares.","internalType":"bigint","type":"string"},"chain_id":{"description":"EVM chain ID of the market.","type":"integer"},"collateral_assets":{"description":"Collateral supplied, in collateral token native units.","internalType":"bigint","type":"string"},"ltv_wad":{"description":"Borrow assets over collateral value, WAD-scaled (1e18 = 100%) and rounded up. Max uint256 when collateral is worth zero. Can round just below a ratio-based threshold.","internalType":"bigint","type":"string"},"market_id":{"description":"Morpho Blue market id.","type":"string"},"user_address":{"description":"Borrower address, EIP-55 checksummed.","type":"string"}},"required":["chain_id","market_id","user_address","collateral_assets","borrow_shares","ltv_wad"],"type":"object"},"type":"array"},"last_indexed_block":{"description":"Indexer tip block number of the market's chain when serving the response.","internalType":"bigint","type":"string"},"ltv_computed_at":{"description":"Accrued-state LTV evaluation time in Unix seconds. Input ages are separate: oracle observations are cached for up to five seconds and market observations have their own block timestamp.","type":"integer"},"oracle_price_block":{"description":"Block number at which the oracle price used for this response was read, including cached observations. Omitted when no usable oracle price is available.","internalType":"bigint","type":"string"}},"required":["data","cursor","last_indexed_block","ltv_computed_at"],"type":"object"},"MarketPublicAllocatorVaultsResponse":{"properties":{"data":{"description":"Candidate vault and adapter rows. Order is unspecified.","items":{"properties":{"absolute_cap":{"description":"Absolute cap from the vault's Public Allocator V2 market config for this adapter, in loan-token native units. Not the vault's own Vault V2 cap.","internalType":"bigint","type":"string"},"adapter_address":{"description":"Adapter contract address.","type":"string"},"can_pull_from_idle":{"description":"Whether the Public Allocator V2 can pull idle assets from this vault.","type":"boolean"},"can_pull_from_market":{"description":"Whether the Public Allocator V2 can pull assets from this market.","type":"boolean"},"cap_id":{"description":"Adapter-qualified market cap identifier (bytes32) from the vault's Public Allocator V2 config for this adapter.","pattern":"^0x[a-fA-F0-9]{64}$","type":"string"},"penalty_wad":{"description":"Public Allocator V2 penalty, WAD-scaled (1e18 = 100%).","internalType":"bigint","type":"string"},"public_allocator_address":{"description":"Public Allocator V2 contract address.","type":"string"},"vault_address":{"description":"Vault V2 contract address.","type":"string"}},"required":["vault_address","adapter_address","cap_id","absolute_cap","can_pull_from_market","can_pull_from_idle","penalty_wad","public_allocator_address"],"type":"object"},"type":"array"},"last_indexed_block":{"description":"Indexer tip block number when serving the response.","internalType":"bigint","type":"string"}},"required":["data","last_indexed_block"],"type":"object"},"MarketRootResponse":{"properties":{"data":{"properties":{"chain_id":{"exclusiveMinimum":true,"minimum":0,"type":"integer"},"collateral_token":{"type":"string"},"creation_block_number":{"internalType":"bigint","type":"string"},"irm_address":{"type":"string"},"lltv_wad":{"description":"Liquidation LTV in WAD (1e18 = 100%).","internalType":"bigint","type":"string"},"loan_token":{"type":"string"},"market_id":{"type":"string"},"oracle_address":{"type":"string"}},"required":["chain_id","market_id","loan_token","collateral_token","oracle_address","irm_address","lltv_wad","creation_block_number"],"type":"object"}},"required":["data"],"type":"object"},"MarketStateHistoryResponse":{"properties":{"data":{"description":"Morpho Blue market historical state points. Missing snapshots are omitted from the series; available snapshots with null collateral totals are retained.","items":{"properties":{"timestamp":{"description":"Snapshot timestamp in Unix seconds.","minimum":0,"type":"integer"},"total_borrow_assets":{"description":"Total borrowed assets in loan token units.","internalType":"bigint","type":"string"},"total_borrow_shares":{"description":"Total borrow shares.","internalType":"bigint","type":"string"},"total_collateral_assets":{"description":"Total collateral in raw collateral-token asset units (not decimal-adjusted). Null when unavailable from the source, including markets without a collateral token (zero address).","internalType":"bigint","nullable":true,"type":"string"},"total_supply_assets":{"description":"Total supplied assets in loan token units.","internalType":"bigint","type":"string"},"total_supply_shares":{"description":"Total supply shares.","internalType":"bigint","type":"string"}},"required":["timestamp","total_supply_assets","total_supply_shares","total_borrow_assets","total_borrow_shares","total_collateral_assets"],"type":"object"},"type":"array"},"last_indexed_block":{"description":"Latest indexed block used to serve this historical state.","internalType":"bigint","type":"string"},"params":{"description":"Request selector parameters.","properties":{"chain_id":{"description":"EVM chain identifier from the market selector.","pattern":"^\\d+$","type":"string"},"market_id":{"description":"Morpho Blue market id from the market selector.","type":"string"}},"required":["chain_id","market_id"],"type":"object"}},"required":["params","data","last_indexed_block"],"type":"object"},"MarketStateResponse":{"properties":{"data":{"description":"Morpho Blue market live state.","properties":{"chain_id":{"description":"EVM chain identifier.","exclusiveMinimum":true,"minimum":0,"type":"integer"},"fee_wad":{"description":"Protocol fee scaled by WAD (1e18).","internalType":"bigint","type":"string"},"last_accrual_timestamp":{"description":"Latest accrual timestamp, in Unix seconds.","minimum":0,"type":"integer"},"last_indexed_block":{"description":"Latest indexed block used to compute this market state.","internalType":"bigint","type":"string"},"market_id":{"description":"Morpho Blue market id (bytes32 unique key).","type":"string"},"rate_at_target_per_second_wad":{"description":"AdaptiveCurveIRM borrow rate per second at target utilization (90%), scaled by WAD (1e18). It describes the market at the same moment as the totals in this response: on indexed responses both are accrued forward from `last_accrual_timestamp` (Midx to the request time, realtime to its indexed block), and on the RPC fallback both are the values stored on-chain at `last_accrual_timestamp`. Null when the market's IRM is not the chain's AdaptiveCurveIRM (including markets with no IRM) or no rate at target is stored for the market.","internalType":"bigint","nullable":true,"type":"string"},"total_borrow_assets":{"description":"Total borrowed assets in loan token units.","internalType":"bigint","type":"string"},"total_borrow_shares":{"description":"Total borrow shares.","internalType":"bigint","type":"string"},"total_supply_assets":{"description":"Total supplied assets in loan token units.","internalType":"bigint","type":"string"},"total_supply_shares":{"description":"Total supply shares.","internalType":"bigint","type":"string"}},"required":["chain_id","market_id","last_indexed_block","last_accrual_timestamp","total_supply_assets","total_supply_shares","total_borrow_assets","total_borrow_shares","fee_wad","rate_at_target_per_second_wad"],"type":"object"}},"required":["data"],"type":"object"},"MarketVaultsResponse":{"properties":{"cursor":{"nullable":true,"type":"string"},"data":{"items":{"properties":{"chain_id":{"description":"EVM chain identifier.","exclusiveMinimum":true,"minimum":0,"type":"integer"},"vault_address":{"description":"EIP-55 checksummed vault contract address.","type":"string"},"version":{"description":"Vault contract version.","enum":["1.0","2.0"],"type":"string"}},"required":["chain_id","vault_address","version"],"type":"object"},"type":"array"},"last_indexed_block":{"internalType":"bigint","type":"string"}},"required":["data","cursor","last_indexed_block"],"type":"object"},"OracleStateResponse":{"properties":{"data":{"description":"Oracle live state.","properties":{"chain_id":{"description":"EVM chain identifier.","exclusiveMinimum":true,"minimum":0,"type":"integer"},"last_indexed_block":{"description":"Latest indexed block used to compute this oracle state.","internalType":"bigint","type":"string"},"last_updated_at":{"description":"Unix timestamp (seconds) at which the oracle price was last updated onchain.","internalType":"bigint","nullable":true,"type":"string"},"oracle_address":{"description":"Oracle contract address.","type":"string"},"price":{"description":"Oracle quote, null when the latest quote is unavailable.","internalType":"bigint","nullable":true,"type":"string"}},"required":["oracle_address","chain_id","last_indexed_block"],"type":"object"}},"required":["data"],"type":"object"},"TokenPriceResponse":{"properties":{"data":{"description":"Token spot price in USD. Nullable price fields indicate that the known token cannot currently be priced.","properties":{"address":{"description":"ERC-20 token contract address.","type":"string"},"chain_id":{"description":"EVM chain identifier.","exclusiveMinimum":true,"minimum":0,"type":"integer"},"price":{"description":"Spot price in USD. Null when the API cannot currently price the known token.","nullable":true,"type":"number"},"provider":{"description":"Upstream price data provider. Null when no price point is available.","nullable":true,"type":"string"},"timestamp":{"description":"Unix timestamp (seconds) of the price point. Null when no price point is available.","internalType":"bigint","nullable":true,"type":"string"}},"required":["chain_id","address","price","provider"],"type":"object"}},"required":["data"],"type":"object"},"TokenRootResponse":{"properties":{"data":{"description":"ERC-20 token identity and metadata.","properties":{"address":{"description":"ERC-20 token contract address.","type":"string"},"chain_id":{"description":"EVM chain identifier.","exclusiveMinimum":true,"minimum":0,"type":"integer"},"decimals":{"description":"ERC-20 token decimals.","maximum":255,"minimum":0,"type":"integer"},"logo_uri":{"description":"Token logo URI.","nullable":true,"type":"string"},"name":{"description":"ERC-20 token name. May be overridden by the Morpho team.","nullable":true,"type":"string"},"symbol":{"description":"ERC-20 token symbol. May be overridden by the Morpho team.","nullable":true,"type":"string"},"tags":{"description":"Curated asset tags.","items":{"type":"string"},"nullable":true,"type":"array"}},"required":["chain_id","address","name","symbol","decimals","logo_uri","tags"],"type":"object"}},"required":["data"],"type":"object"},"UserMarketPositionHistoryResponse":{"properties":{"data":{"description":"User's Morpho Blue market historical position points.","items":{"properties":{"borrow_shares":{"description":"Borrow shares owed, denominated in loan token shares.","internalType":"bigint","type":"string"},"collateral_assets":{"description":"Collateral amount deposited, in collateral token units.","internalType":"bigint","type":"string"},"supply_shares":{"description":"Supply shares held, denominated in loan token shares.","internalType":"bigint","type":"string"},"timestamp":{"description":"Historical sample timestamp in Unix seconds.","minimum":0,"type":"integer"}},"required":["timestamp","collateral_assets","supply_shares","borrow_shares"],"type":"object"},"type":"array"},"last_indexed_block":{"description":"Latest indexed block used to serve this historical position.","internalType":"bigint","type":"string"},"params":{"description":"Request selector parameters.","properties":{"chain_id":{"description":"EVM chain identifier from the market selector.","pattern":"^\\d+$","type":"string"},"market_id":{"description":"Morpho Blue market id from the market selector.","type":"string"},"user_address":{"description":"Position owner address from the user address parameter.","type":"string"}},"required":["chain_id","market_id","user_address"],"type":"object"}},"required":["params","data","last_indexed_block"],"type":"object"},"UserMarketPositionPerformanceResponse":{"properties":{"data":{"properties":{"accounting_method":{"enum":["average_cost"],"type":"string"},"borrow_cost_on_capital":{"nullable":true,"type":"number"},"borrow_net_cost_assets":{"description":"Signed realized and unrealized borrow cost in loan-token units; positive means cost.","internalType":"bigint","type":"string"},"chain_id":{"description":"EVM chain identifier.","exclusiveMinimum":true,"minimum":0,"type":"integer"},"last_indexed_block":{"description":"Minimum of the market-state and position-performance sync blocks.","internalType":"bigint","type":"string"},"market_id":{"description":"Morpho Blue market identifier.","type":"string"},"supply_net_earnings_assets":{"description":"Signed realized and unrealized supply earnings in loan-token units.","internalType":"bigint","type":"string"},"supply_return_on_capital":{"nullable":true,"type":"number"},"user_address":{"description":"Position owner address.","type":"string"}},"required":["chain_id","market_id","user_address","last_indexed_block","accounting_method","supply_net_earnings_assets","supply_return_on_capital","borrow_net_cost_assets","borrow_cost_on_capital"],"type":"object"}},"required":["data"],"type":"object"},"UserMarketPositionResponse":{"properties":{"data":{"description":"User's live Morpho Blue market position.","properties":{"borrow_shares":{"description":"Borrow shares owed, denominated in loan token shares.","internalType":"bigint","type":"string"},"chain_id":{"description":"EVM chain identifier.","exclusiveMinimum":true,"minimum":0,"type":"integer"},"collateral_assets":{"description":"Collateral amount deposited, in collateral token units.","internalType":"bigint","type":"string"},"last_indexed_block":{"description":"Latest indexed block used to compute this position.","internalType":"bigint","type":"string"},"market_id":{"description":"Morpho Blue market identifier.","type":"string"},"supply_shares":{"description":"Supply shares held, denominated in loan token shares.","internalType":"bigint","type":"string"},"user_address":{"description":"Position owner address.","type":"string"}},"required":["chain_id","market_id","user_address","last_indexed_block","collateral_assets","supply_shares","borrow_shares"],"type":"object"}},"required":["data"],"type":"object"},"UserMarketPositionsResponse":{"properties":{"cursor":{"description":"Opaque cursor. Null on the last page.","nullable":true,"type":"string"},"data":{"description":"User Morpho Blue market positions.","items":{"properties":{"borrow_shares":{"description":"Borrow shares owed, denominated in loan token shares.","internalType":"bigint","type":"string"},"chain_id":{"description":"EVM chain identifier.","exclusiveMinimum":true,"minimum":0,"type":"integer"},"collateral_assets":{"description":"Collateral deposited, in collateral token units.","internalType":"bigint","type":"string"},"market_id":{"description":"Morpho Blue market identifier.","type":"string"},"supply_shares":{"description":"Supply shares held, denominated in loan token shares.","internalType":"bigint","type":"string"}},"required":["chain_id","market_id","supply_shares","borrow_shares","collateral_assets"],"type":"object"},"type":"array"},"params":{"properties":{"user_address":{"description":"Position owner address.","type":"string"}},"required":["user_address"],"type":"object"}},"required":["params","data","cursor"],"type":"object"},"UserVaultPositionsResponse":{"properties":{"cursor":{"description":"Opaque seek cursor for a weakly consistent continuation page. Null on the last page. Do not parse or modify it.","nullable":true,"type":"string"},"data":{"description":"User vault positions.","items":{"properties":{"assets":{"description":"Value of vault shares held, in underlying token units. Computed from the sampled share price and rounded down.","internalType":"bigint","type":"string"},"chain_id":{"description":"EVM chain identifier.","exclusiveMinimum":true,"minimum":0,"type":"integer"},"last_indexed_block":{"description":"Indexer freshness tip for this chain, or the row source block when the tip is unavailable. Null only when neither exists. This is not a snapshot boundary for pagination.","internalType":"bigint","nullable":true,"type":"string"},"shares":{"description":"Amount of vault shares.","internalType":"bigint","type":"string"},"vault_address":{"description":"Vault contract address.","type":"string"}},"required":["chain_id","vault_address","shares","assets","last_indexed_block"],"type":"object"},"type":"array"},"params":{"properties":{"user_address":{"description":"Position owner address.","type":"string"}},"required":["user_address"],"type":"object"}},"required":["params","data","cursor"],"type":"object"},"UserVaultV1PositionActivityResponse":{"properties":{"cursor":{"description":"Opaque pagination cursor. Null on the last page.","nullable":true,"type":"string"},"data":{"description":"Share balance events, ordered by block number then log index, most recent first.","items":{"oneOf":[{"properties":{"block_number":{"description":"Block in which the event occurred.","internalType":"bigint","type":"string"},"data":{"properties":{"assets":{"description":"Deposited assets in underlying token units, taken from the log.","internalType":"bigint","type":"string"},"on_behalf":{"description":"Address credited with the minted shares (the Deposit event's owner). Always the requested user on this endpoint.","type":"string"},"sender":{"description":"Address that called deposit or mint and supplied the assets (the Deposit event's sender). May differ from the requested user, for example a bundler or router.","type":"string"},"shares":{"description":"Magnitude of the share balance change. Never negative; direction comes from the event type.","internalType":"bigint","type":"string"}},"required":["shares","assets","sender","on_behalf"],"type":"object"},"log_index":{"description":"Index of the event log within the transaction.","minimum":0,"type":"integer"},"timestamp":{"description":"Block timestamp in Unix seconds.","minimum":0,"type":"integer"},"tx_hash":{"description":"Hash of the transaction that emitted the event.","pattern":"^0x[a-fA-F0-9]{64}$","type":"string"},"type":{"enum":["deposit"],"type":"string"}},"required":["block_number","tx_hash","log_index","timestamp","type","data"],"type":"object"},{"properties":{"block_number":{"description":"Block in which the event occurred.","internalType":"bigint","type":"string"},"data":{"properties":{"assets":{"description":"Withdrawn assets in underlying token units, taken from the log.","internalType":"bigint","type":"string"},"on_behalf":{"description":"Address whose shares were burned (the Withdraw event's owner). Always the requested user on this endpoint.","type":"string"},"receiver":{"description":"Address that received the withdrawn assets (the Withdraw event's receiver). May differ from the requested user.","type":"string"},"sender":{"description":"Address that called withdraw or redeem (the Withdraw event's sender). May differ from the requested user when an approved spender or bundler acts for them.","type":"string"},"shares":{"description":"Magnitude of the share balance change. Never negative; direction comes from the event type.","internalType":"bigint","type":"string"}},"required":["shares","assets","sender","receiver","on_behalf"],"type":"object"},"log_index":{"description":"Index of the event log within the transaction.","minimum":0,"type":"integer"},"timestamp":{"description":"Block timestamp in Unix seconds.","minimum":0,"type":"integer"},"tx_hash":{"description":"Hash of the transaction that emitted the event.","pattern":"^0x[a-fA-F0-9]{64}$","type":"string"},"type":{"enum":["withdraw"],"type":"string"}},"required":["block_number","tx_hash","log_index","timestamp","type","data"],"type":"object"},{"properties":{"block_number":{"description":"Block in which the event occurred.","internalType":"bigint","type":"string"},"data":{"properties":{"from_address":{"description":"Sender of the shares.","type":"string"},"shares":{"description":"Magnitude of the share balance change. Never negative; direction comes from the event type.","internalType":"bigint","type":"string"}},"required":["shares","from_address"],"type":"object"},"log_index":{"description":"Index of the event log within the transaction.","minimum":0,"type":"integer"},"timestamp":{"description":"Block timestamp in Unix seconds.","minimum":0,"type":"integer"},"tx_hash":{"description":"Hash of the transaction that emitted the event.","pattern":"^0x[a-fA-F0-9]{64}$","type":"string"},"type":{"enum":["shares_transfer_in"],"type":"string"}},"required":["block_number","tx_hash","log_index","timestamp","type","data"],"type":"object"},{"properties":{"block_number":{"description":"Block in which the event occurred.","internalType":"bigint","type":"string"},"data":{"properties":{"shares":{"description":"Magnitude of the share balance change. Never negative; direction comes from the event type.","internalType":"bigint","type":"string"},"to_address":{"description":"Recipient of the shares.","type":"string"}},"required":["shares","to_address"],"type":"object"},"log_index":{"description":"Index of the event log within the transaction.","minimum":0,"type":"integer"},"timestamp":{"description":"Block timestamp in Unix seconds.","minimum":0,"type":"integer"},"tx_hash":{"description":"Hash of the transaction that emitted the event.","pattern":"^0x[a-fA-F0-9]{64}$","type":"string"},"type":{"enum":["shares_transfer_out"],"type":"string"}},"required":["block_number","tx_hash","log_index","timestamp","type","data"],"type":"object"}]},"type":"array"},"last_indexed_block":{"description":"Latest indexed block covered by this page. Pinned to the first page's indexer tip for every continuation page, so a complete walk to a null cursor reconciles against a single watermark.","internalType":"bigint","type":"string"},"params":{"description":"Request selector parameters.","properties":{"chain_id":{"description":"EVM chain identifier from the vault selector.","exclusiveMinimum":true,"minimum":0,"type":"integer"},"user_address":{"description":"Position owner address from the user address parameter.","type":"string"},"vault_address":{"description":"Vault contract address from the vault selector.","type":"string"}},"required":["chain_id","vault_address","user_address"],"type":"object"}},"required":["params","data","cursor","last_indexed_block"],"type":"object"},"UserVaultV1PositionHistoryResponse":{"properties":{"data":{"description":"User's Vault V1 historical position points.","items":{"properties":{"assets":{"description":"Value of vault shares held, in underlying token units.","internalType":"bigint","type":"string"},"shares":{"description":"Amount of vault shares held.","internalType":"bigint","type":"string"},"timestamp":{"description":"Historical sample timestamp in Unix seconds.","minimum":0,"type":"integer"}},"required":["timestamp","shares","assets"],"type":"object"},"type":"array"},"last_indexed_block":{"description":"Latest indexed block used to serve this historical position.","internalType":"bigint","type":"string"},"params":{"description":"Request selector parameters.","properties":{"chain_id":{"description":"EVM chain identifier from the vault selector.","pattern":"^\\d+$","type":"string"},"user_address":{"description":"Position owner address from the user address parameter.","type":"string"},"vault_address":{"description":"Vault contract address from the vault selector.","type":"string"}},"required":["chain_id","vault_address","user_address"],"type":"object"}},"required":["params","data","last_indexed_block"],"type":"object"},"UserVaultV1PositionPerformanceResponse":{"properties":{"data":{"description":"User's Vault V1 position performance.","properties":{"accounting_method":{"description":"Accounting method used to compute net earnings and return on capital.","enum":["average_cost"],"type":"string"},"as_of":{"description":"Present only when `as_of_date` is set. Historical valuation through the UTC start-of-day cutoff of `as_of_date`. For an open position, valuation uses the last hourly share-price history point or the user's last position change, whichever is later, at or before the cutoff; it is not block-exact, and the gap between the cutoff and `timestamp` indicates the age of the valuation point. For a position fully exited before the cutoff, `timestamp` is its last position change and the value is final, so that gap does not indicate staleness.","properties":{"timestamp":{"description":"Effective valuation timestamp (Unix seconds) used for the historical result; null only when the user had no position before the cutoff and the vault has no share-price history at or before it.","nullable":true,"type":"integer"}},"required":["timestamp"],"type":"object"},"chain_id":{"description":"EVM chain identifier.","exclusiveMinimum":true,"minimum":0,"type":"integer"},"last_indexed_block":{"description":"Latest indexed block used to compute this performance snapshot.","internalType":"bigint","type":"string"},"net_earnings_assets":{"description":"Realized + unrealized earnings of the position, in underlying token units; measured up to the cutoff when `as_of_date` is set.","internalType":"bigint","type":"string"},"return_on_capital":{"description":"Time-weighted return of the position over its holding period, non-annualized; measured up to the cutoff when `as_of_date` is set.","nullable":true,"type":"number"},"user_address":{"description":"Position owner address.","type":"string"},"vault_address":{"description":"Vault contract address.","type":"string"}},"required":["user_address","chain_id","vault_address","last_indexed_block","accounting_method","net_earnings_assets","return_on_capital"],"type":"object"}},"required":["data"],"type":"object"},"UserVaultV1PositionResponse":{"properties":{"data":{"description":"User's live Vault V1 position.","properties":{"assets":{"description":"Value of vault shares held, in underlying token units.","internalType":"bigint","type":"string"},"chain_id":{"description":"EVM chain identifier.","exclusiveMinimum":true,"minimum":0,"type":"integer"},"last_indexed_block":{"description":"Latest indexed block used to compute this position.","internalType":"bigint","type":"string"},"shares":{"description":"Amount of vault shares.","internalType":"bigint","type":"string"},"user_address":{"description":"Position owner address.","type":"string"},"vault_address":{"description":"Vault contract address.","type":"string"}},"required":["user_address","chain_id","vault_address","last_indexed_block","shares","assets"],"type":"object"}},"required":["data"],"type":"object"},"UserVaultV2PositionActivityResponse":{"properties":{"cursor":{"description":"Opaque pagination cursor. Null on the last page.","nullable":true,"type":"string"},"data":{"description":"Events that changed the user's share balance in this Vault V2, newest first.","items":{"oneOf":[{"properties":{"block_number":{"description":"Block that contains the event log.","internalType":"bigint","type":"string"},"data":{"properties":{"assets":{"description":"Assets deposited, in underlying token units.","internalType":"bigint","type":"string"},"shares":{"description":"Vault shares minted to the user.","internalType":"bigint","type":"string"}},"required":["shares","assets"],"type":"object"},"log_index":{"description":"Index of the event log within its block.","minimum":0,"type":"integer"},"timestamp":{"description":"Block timestamp in Unix seconds.","minimum":0,"type":"integer"},"tx_hash":{"description":"Hash of the transaction that emitted the event log.","pattern":"^0x[a-fA-F0-9]{64}$","type":"string"},"type":{"enum":["deposit"],"type":"string"}},"required":["type","data","block_number","tx_hash","log_index","timestamp"],"type":"object"},{"properties":{"block_number":{"description":"Block that contains the event log.","internalType":"bigint","type":"string"},"data":{"properties":{"assets":{"description":"Assets withdrawn, in underlying token units.","internalType":"bigint","type":"string"},"shares":{"description":"Vault shares burned from the user.","internalType":"bigint","type":"string"}},"required":["shares","assets"],"type":"object"},"log_index":{"description":"Index of the event log within its block.","minimum":0,"type":"integer"},"timestamp":{"description":"Block timestamp in Unix seconds.","minimum":0,"type":"integer"},"tx_hash":{"description":"Hash of the transaction that emitted the event log.","pattern":"^0x[a-fA-F0-9]{64}$","type":"string"},"type":{"enum":["withdraw"],"type":"string"}},"required":["type","data","block_number","tx_hash","log_index","timestamp"],"type":"object"},{"properties":{"block_number":{"description":"Block that contains the event log.","internalType":"bigint","type":"string"},"data":{"properties":{"from_address":{"description":"Address the vault shares were sent from.","type":"string"},"shares":{"description":"Vault shares received by the user.","internalType":"bigint","type":"string"}},"required":["shares","from_address"],"type":"object"},"log_index":{"description":"Index of the event log within its block.","minimum":0,"type":"integer"},"timestamp":{"description":"Block timestamp in Unix seconds.","minimum":0,"type":"integer"},"tx_hash":{"description":"Hash of the transaction that emitted the event log.","pattern":"^0x[a-fA-F0-9]{64}$","type":"string"},"type":{"enum":["shares_transfer_in"],"type":"string"}},"required":["type","data","block_number","tx_hash","log_index","timestamp"],"type":"object"},{"properties":{"block_number":{"description":"Block that contains the event log.","internalType":"bigint","type":"string"},"data":{"properties":{"shares":{"description":"Vault shares sent by the user.","internalType":"bigint","type":"string"},"to_address":{"description":"Address the vault shares were sent to.","type":"string"}},"required":["shares","to_address"],"type":"object"},"log_index":{"description":"Index of the event log within its block.","minimum":0,"type":"integer"},"timestamp":{"description":"Block timestamp in Unix seconds.","minimum":0,"type":"integer"},"tx_hash":{"description":"Hash of the transaction that emitted the event log.","pattern":"^0x[a-fA-F0-9]{64}$","type":"string"},"type":{"enum":["shares_transfer_out"],"type":"string"}},"required":["type","data","block_number","tx_hash","log_index","timestamp"],"type":"object"}]},"type":"array"},"last_indexed_block":{"description":"Latest indexed block used to serve this activity page.","internalType":"bigint","type":"string"},"params":{"description":"Request selector parameters.","properties":{"chain_id":{"description":"EVM chain identifier from the vault selector.","exclusiveMinimum":true,"minimum":0,"type":"integer"},"user_address":{"description":"Position owner address from the user address parameter.","type":"string"},"vault_address":{"description":"Vault contract address from the vault selector.","type":"string"}},"required":["chain_id","vault_address","user_address"],"type":"object"}},"required":["params","data","cursor","last_indexed_block"],"type":"object"},"UserVaultV2PositionHistoryResponse":{"properties":{"data":{"description":"User's Vault V2 historical position points.","items":{"properties":{"assets":{"description":"Value of vault shares held, in underlying token units.","internalType":"bigint","type":"string"},"shares":{"description":"Amount of vault shares held.","internalType":"bigint","type":"string"},"timestamp":{"description":"Historical sample timestamp in Unix seconds.","minimum":0,"type":"integer"}},"required":["timestamp","shares","assets"],"type":"object"},"type":"array"},"last_indexed_block":{"description":"Latest indexed block used to serve this historical position.","internalType":"bigint","type":"string"},"params":{"description":"Request selector parameters.","properties":{"chain_id":{"description":"EVM chain identifier from the vault selector.","pattern":"^\\d+$","type":"string"},"user_address":{"description":"Position owner address from the user address parameter.","type":"string"},"vault_address":{"description":"Vault contract address from the vault selector.","type":"string"}},"required":["chain_id","vault_address","user_address"],"type":"object"}},"required":["params","data","last_indexed_block"],"type":"object"},"UserVaultV2PositionPerformanceResponse":{"properties":{"data":{"description":"User's Vault V2 position performance.","properties":{"accounting_method":{"description":"Accounting method used to compute net earnings and return on capital.","enum":["average_cost"],"type":"string"},"as_of":{"description":"Present only when `as_of_date` is set. Historical valuation through the UTC start-of-day cutoff of `as_of_date`. For an open position, valuation uses the last hourly share-price history point or the user's last position change, whichever is later, at or before the cutoff; it is not block-exact, and the gap between the cutoff and `timestamp` indicates the age of the valuation point. For a position fully exited before the cutoff, `timestamp` is its last position change and the value is final, so that gap does not indicate staleness.","properties":{"timestamp":{"description":"Effective valuation timestamp (Unix seconds) used for the historical result; null only when the user had no position before the cutoff and the vault has no share-price history at or before it.","nullable":true,"type":"integer"}},"required":["timestamp"],"type":"object"},"chain_id":{"description":"EVM chain identifier.","exclusiveMinimum":true,"minimum":0,"type":"integer"},"last_indexed_block":{"description":"Latest indexed block used to compute this performance snapshot.","internalType":"bigint","type":"string"},"net_earnings_assets":{"description":"Realized + unrealized earnings of the position, in underlying token units; measured up to the cutoff when `as_of_date` is set.","internalType":"bigint","type":"string"},"return_on_capital":{"description":"Time-weighted return of the position over its holding period, non-annualized; measured up to the cutoff when `as_of_date` is set.","nullable":true,"type":"number"},"user_address":{"description":"Position owner address.","type":"string"},"vault_address":{"description":"Vault contract address.","type":"string"}},"required":["user_address","chain_id","vault_address","last_indexed_block","accounting_method","net_earnings_assets","return_on_capital"],"type":"object"}},"required":["data"],"type":"object"},"UserVaultV2PositionResponse":{"properties":{"data":{"description":"User's live Vault V2 position.","properties":{"assets":{"description":"Value of vault shares held, in underlying token units.","internalType":"bigint","type":"string"},"chain_id":{"description":"EVM chain identifier.","exclusiveMinimum":true,"minimum":0,"type":"integer"},"last_indexed_block":{"description":"Latest indexed block used to compute this position.","internalType":"bigint","type":"string"},"shares":{"description":"Amount of vault shares.","internalType":"bigint","type":"string"},"user_address":{"description":"Position owner address.","type":"string"},"vault_address":{"description":"Vault contract address.","type":"string"}},"required":["user_address","chain_id","vault_address","last_indexed_block","shares","assets"],"type":"object"}},"required":["data"],"type":"object"},"VaultRoleListResponse":{"properties":{"data":{"description":"Complete set of active role assignments.","items":{"properties":{"grant_block_number":{"description":"Chain block number of the latest role grant event identified by tx_hash, as a base-10 integer string. After revocation and re-grant, this is the re-grant block, not the first grant block.","internalType":"bigint","type":"string"},"role_address":{"description":"Role account address.","type":"string"},"tx_hash":{"description":"Transaction hash of the latest role grant event.","pattern":"^0x[a-fA-F0-9]{64}$","type":"string"}},"required":["role_address","tx_hash","grant_block_number"],"type":"object"},"type":"array"},"last_indexed_block":{"description":"Latest indexed block used to compute this role list.","internalType":"bigint","type":"string"},"params":{"description":"Request selector parameters.","properties":{"chain_id":{"description":"EVM chain identifier from the vault selector.","exclusiveMinimum":true,"minimum":0,"type":"integer"},"vault_address":{"description":"Vault contract address from the vault selector.","type":"string"}},"required":["chain_id","vault_address"],"type":"object"}},"required":["params","data","last_indexed_block"],"type":"object"},"VaultV1AllocationHistoryResponse":{"properties":{"data":{"description":"Vault V1 allocation history grouped by market.","items":{"properties":{"history":{"description":"Historical allocation points for this market.","items":{"properties":{"supply_assets":{"description":"Assets supplied by the vault to the market, in underlying token units.","internalType":"bigint","type":"string"},"supply_cap":{"description":"Vault supply cap for the market, in underlying token units.","internalType":"bigint","type":"string"},"supply_shares":{"description":"Supply shares owned by the vault in the market.","internalType":"bigint","type":"string"},"timestamp":{"description":"Snapshot timestamp in Unix seconds.","minimum":0,"type":"integer"}},"required":["timestamp","supply_assets","supply_shares","supply_cap"],"type":"object"},"type":"array"},"market_id":{"description":"Morpho Blue market id.","type":"string"}},"required":["market_id","history"],"type":"object"},"type":"array"},"last_indexed_block":{"description":"Latest indexed block used to serve this historical allocation state.","internalType":"bigint","type":"string"},"params":{"description":"Request selector parameters.","properties":{"chain_id":{"description":"EVM chain identifier from the vault selector.","pattern":"^\\d+$","type":"string"},"vault_address":{"description":"Vault contract address from the vault selector.","type":"string"}},"required":["chain_id","vault_address"],"type":"object"}},"required":["params","data","last_indexed_block"],"type":"object"},"VaultV1AllocationsResponse":{"properties":{"data":{"description":"Vault V1 allocation state.","properties":{"allocations":{"description":"Every market with a current or pending relationship to the vault, ordered by ascending market id. Market details are not embedded; join through the Blue market endpoints.","items":{"properties":{"market_id":{"description":"Morpho Blue market id.","type":"string"},"pending":{"description":"Timelocked allocation changes submitted for this market.","properties":{"removal":{"description":"Timelocked market removal, or null when no removal is pending.","nullable":true,"properties":{"valid_at_timestamp":{"description":"Unix seconds from which the market can be removed from the withdraw queue.","minimum":0,"type":"integer"}},"required":["valid_at_timestamp"],"type":"object"},"supply_cap":{"description":"Timelocked supply cap change, or null when no cap change is pending.","nullable":true,"properties":{"valid_at_timestamp":{"description":"Unix seconds from which the submitted supply cap can be accepted.","minimum":0,"type":"integer"},"value":{"description":"Submitted supply cap, in underlying token units.","internalType":"bigint","type":"string"}},"required":["value","valid_at_timestamp"],"type":"object"}},"required":["supply_cap","removal"],"type":"object"},"supply_assets":{"description":"Assets supplied by the vault to the market, in underlying token units.","internalType":"bigint","type":"string"},"supply_cap":{"description":"Vault supply cap for the market, in underlying token units. Stored on-chain as a uint184, so the highest possible cap is 2^184 - 1. A cap of 0 means the vault cannot supply to the market; there is no sentinel value for an uncapped market.","internalType":"bigint","type":"string"},"supply_queue_index":{"description":"Zero-based position in the vault supply queue, or null when the market is not in the supply queue.","minimum":0,"nullable":true,"type":"integer"},"supply_shares":{"description":"Supply shares owned by the vault in the market.","internalType":"bigint","type":"string"},"withdraw_queue_index":{"description":"Zero-based position in the vault withdraw queue, or null when the market is not in the withdraw queue.","minimum":0,"nullable":true,"type":"integer"}},"required":["market_id","supply_assets","supply_shares","supply_cap","supply_queue_index","withdraw_queue_index","pending"],"type":"object"},"type":"array"},"chain_id":{"description":"EVM chain identifier.","exclusiveMinimum":true,"minimum":0,"type":"integer"},"last_indexed_block":{"description":"Latest indexed block used to compute this allocation state.","internalType":"bigint","type":"string"},"vault_address":{"description":"Vault V1 contract address.","type":"string"}},"required":["chain_id","vault_address","last_indexed_block","allocations"],"type":"object"}},"required":["data"],"type":"object"},"VaultV1ApyAveragesResponse":{"properties":{"data":{"description":"Vault V1 realized average APY.","properties":{"apy":{"description":"Realized average APY of the vault, calculated from share price evolution over the lookback period. Null when the vault holds fewer than 1,000,000 raw units of its asset (1 USDC, 0.01 WBTC) at the latest snapshot or at the lookback snapshot, because a near-empty vault's share price is dominated by rounding. inception averages from the initial share price at creation, so only the latest snapshot is checked.","nullable":true,"type":"number"},"chain_id":{"description":"EVM chain identifier.","exclusiveMinimum":true,"minimum":0,"type":"integer"},"last_indexed_block":{"description":"Latest indexed block used to compute this APY average.","internalType":"bigint","type":"string"},"lookback":{"description":"Lookback period used to compute the average APY.","enum":["one_hour","six_hours","one_day","seven_days","thirty_days","ninety_days","one_year","inception"],"type":"string"},"vault_address":{"description":"Vault contract address.","type":"string"}},"required":["chain_id","vault_address","last_indexed_block","lookback","apy"],"type":"object"}},"required":["data"],"type":"object"},"VaultV1ApyHistoryResponse":{"properties":{"data":{"description":"Vault V1 historical APY points.","items":{"properties":{"apy":{"description":"Historical vault APY.","nullable":true,"type":"number"},"timestamp":{"description":"Historical sample timestamp in Unix seconds.","minimum":0,"type":"integer"}},"required":["timestamp","apy"],"type":"object"},"type":"array"},"last_indexed_block":{"description":"Latest indexed block used to serve this historical APY.","internalType":"bigint","type":"string"},"params":{"description":"Request selector parameters.","properties":{"chain_id":{"description":"EVM chain identifier from the vault selector.","pattern":"^\\d+$","type":"string"},"vault_address":{"description":"Vault contract address from the vault selector.","type":"string"}},"required":["chain_id","vault_address"],"type":"object"}},"required":["params","data","last_indexed_block"],"type":"object"},"VaultV1ListResponse":{"properties":{"cursor":{"description":"Opaque cursor for the next page. Null on the last page.","nullable":true,"type":"string"},"data":{"description":"Page of listed Morpho Vault V1 deployments.","items":{"properties":{"asset_address":{"description":"Underlying asset address. Join through `GET /v0/tokens/{chain-id}:{address}` for its name, symbol and decimals.","type":"string"},"chain_id":{"description":"EVM chain identifier.","exclusiveMinimum":true,"minimum":0,"type":"integer"},"creation_block_number":{"description":"Vault creation block number.","internalType":"bigint","type":"string"},"creation_timestamp":{"description":"Unix seconds of the creation block.","minimum":0,"type":"integer"},"creator_address":{"description":"Address that called the factory to deploy the vault (the `caller` of the factory's `CreateMetaMorpho` event).","type":"string"},"curator":{"description":"Current curator address. Null when no curator is set.","nullable":true,"type":"string"},"factory_address":{"description":"Factory contract address that deployed the vault.","type":"string"},"guardian":{"description":"Current guardian address (guardian()), factual onchain data. Null when no guardian has been set; an explicitly-set zero address is returned verbatim.","nullable":true,"type":"string"},"name":{"description":"Current ERC-20 name of the vault share token.","type":"string"},"owner":{"description":"Current owner address.","type":"string"},"performance_fee_recipient":{"description":"Active performance fee recipient. Null when the vault has never set one; an explicitly-set zero address is returned verbatim.","nullable":true,"type":"string"},"performance_fee_wad":{"description":"Active performance fee, WAD-scaled (1e18 = 100%). \"0\" when no fee has ever been set, which is the on-chain value.","internalType":"bigint","type":"string"},"symbol":{"description":"Current ERC-20 symbol of the vault share token.","type":"string"},"vault_address":{"description":"Vault V1 contract address. The compound `{chain-id}:{vault_address}` form identifies the vault in resource URLs.","type":"string"},"version":{"description":"Factory lineage of the vault contract.","enum":["1.0","1.1"],"type":"string"}},"required":["chain_id","vault_address","version","name","symbol","asset_address","factory_address","creator_address","creation_block_number","creation_timestamp","performance_fee_wad","performance_fee_recipient","owner","curator","guardian"],"type":"object"},"type":"array"}},"required":["data","cursor"],"type":"object"},"VaultV1MarketReallocatableLiquidityResponse":{"properties":{"data":{"description":"Public Allocator V1 reallocatable liquidity for a configured vault and target market.","properties":{"chain_id":{"description":"EVM chain identifier.","exclusiveMinimum":true,"minimum":0,"type":"integer"},"market_id":{"description":"Target Morpho Blue market id (bytes32 unique key).","type":"string"},"public_allocator_address":{"description":"Public Allocator V1 deployment address.","type":"string"},"reallocatable_assets":{"description":"Exact sum of the routes, in underlying loan-token units. Withdrawals are jointly constrained by the target flow cap and vault supply cap, with 100% maximum source withdrawal utilization.","internalType":"bigint","type":"string"},"reallocation_fee_native":{"description":"Fixed native-token wei amount charged per reallocateTo call, not a WAD-scaled rate. Defaults to zero when no fee has been configured.","internalType":"bigint","type":"string"},"routes":{"description":"Positive canonical reallocation routes ordered by ascending source market id; empty when no liquidity is available. At most 29 sources: MetaMorpho MAX_QUEUE_LENGTH is 30 and the target cannot be a source. Stored data exceeding this bound fails with 500, never truncates.","items":{"properties":{"chain_id":{"description":"EVM chain identifier.","exclusiveMinimum":true,"minimum":0,"type":"integer"},"reallocatable_assets":{"description":"Assets withdrawable from this source in the shared reallocation, in underlying loan-token units.","internalType":"bigint","type":"string"},"withdraw_market_id":{"description":"Source Morpho Blue market id (bytes32 unique key).","type":"string"}},"required":["chain_id","withdraw_market_id","reallocatable_assets"],"type":"object"},"maxItems":29,"type":"array"}},"required":["chain_id","market_id","public_allocator_address","reallocation_fee_native","reallocatable_assets","routes"],"type":"object"},"last_indexed_block":{"description":"Minimum of the persisted liquidity calculation's simulation, realtime vault, allocation, market and oracle snapshot blocks and the stable indexer tips used by the calculation and endpoint. Event-derived flow caps, allocator assignments, market configuration and live PA configuration use their read checkpoint as vintage, not their event blocks. PA configuration and flow-cap events are read live at or below that checkpoint; no-event defaults also use the checkpoint. Routes and provenance come from one completed per-vault snapshot, including zero-capacity snapshots, isolated from legacy shared-liquidity writes and cleanup. Missing required calculation inputs retain the prior snapshot; vault-target pairs without a snapshot return 404 LIQUIDITY_NOT_COMPUTED.","internalType":"bigint","type":"string"}},"required":["data","last_indexed_block"],"type":"object"},"VaultV1PendingGovernanceActionsResponse":{"properties":{"cursor":{"description":"Opaque pagination cursor.","nullable":true,"type":"string"},"data":{"description":"Pending governance actions for this Vault V1.","items":{"oneOf":[{"properties":{"action_type":{"enum":["set_cap"],"type":"string"},"executable_at_timestamp":{"description":"Unix seconds when the action becomes executable.","minimum":0,"type":"integer"},"parameters":{"properties":{"market_id":{"description":"Morpho Blue market id.","type":"string"},"new_supply_cap":{"description":"Pending supply cap in underlying token units.","internalType":"bigint","type":"string"}},"required":["market_id","new_supply_cap"],"type":"object"},"submitted_transaction_hash":{"description":"Transaction hash that submitted the pending governance action.","pattern":"^0x[a-fA-F0-9]{64}$","type":"string"}},"required":["submitted_transaction_hash","action_type","parameters","executable_at_timestamp"],"type":"object"},{"properties":{"action_type":{"enum":["set_timelock"],"type":"string"},"executable_at_timestamp":{"description":"Unix seconds when the action becomes executable.","minimum":0,"type":"integer"},"parameters":{"properties":{"new_timelock_seconds":{"description":"Pending timelock duration, in seconds.","minimum":0,"type":"integer"}},"required":["new_timelock_seconds"],"type":"object"},"submitted_transaction_hash":{"description":"Transaction hash that submitted the pending governance action.","pattern":"^0x[a-fA-F0-9]{64}$","type":"string"}},"required":["submitted_transaction_hash","action_type","parameters","executable_at_timestamp"],"type":"object"},{"properties":{"action_type":{"enum":["set_guardian"],"type":"string"},"executable_at_timestamp":{"description":"Unix seconds when the action becomes executable.","minimum":0,"type":"integer"},"parameters":{"properties":{"new_guardian":{"description":"Pending guardian address.","type":"string"}},"required":["new_guardian"],"type":"object"},"submitted_transaction_hash":{"description":"Transaction hash that submitted the pending governance action.","pattern":"^0x[a-fA-F0-9]{64}$","type":"string"}},"required":["submitted_transaction_hash","action_type","parameters","executable_at_timestamp"],"type":"object"},{"properties":{"action_type":{"enum":["remove_market"],"type":"string"},"executable_at_timestamp":{"description":"Unix seconds when the action becomes executable.","minimum":0,"type":"integer"},"parameters":{"properties":{"market_id":{"description":"Morpho Blue market id.","type":"string"}},"required":["market_id"],"type":"object"},"submitted_transaction_hash":{"description":"Transaction hash that submitted the pending governance action.","pattern":"^0x[a-fA-F0-9]{64}$","type":"string"}},"required":["submitted_transaction_hash","action_type","parameters","executable_at_timestamp"],"type":"object"},{"properties":{"action_type":{"enum":["transfer_ownership"],"type":"string"},"executable_at_timestamp":{"description":"Ownable2Step ownership transfers are not timelocked.","type":"null"},"parameters":{"properties":{"pending_owner":{"description":"Pending owner address.","type":"string"}},"required":["pending_owner"],"type":"object"},"submitted_transaction_hash":{"description":"Transaction hash that submitted the pending governance action.","pattern":"^0x[a-fA-F0-9]{64}$","type":"string"}},"required":["submitted_transaction_hash","action_type","parameters","executable_at_timestamp"],"type":"object"}]},"type":"array"},"last_indexed_block":{"description":"Latest indexed block used to compute this pending action list.","internalType":"bigint","type":"string"},"params":{"properties":{"chain_id":{"description":"EVM chain identifier.","enum":[1,8453,747474,999,42161,137,130,10,480,143,988,4217,4663,5042,196],"type":"number"},"vault_address":{"description":"Vault contract address.","type":"string"}},"required":["chain_id","vault_address"],"type":"object"}},"required":["params","data","cursor","last_indexed_block"],"type":"object"},"VaultV1RootResponse":{"properties":{"data":{"description":"Vault V1 configuration.","properties":{"address":{"description":"Vault V1 contract address.","type":"string"},"asset":{"description":"Underlying asset metadata.","properties":{"address":{"description":"ERC-20 token contract address.","type":"string"},"decimals":{"description":"ERC-20 token decimals.","maximum":255,"minimum":0,"nullable":true,"type":"integer"},"name":{"description":"ERC-20 token name.","nullable":true,"type":"string"},"symbol":{"description":"ERC-20 token symbol.","nullable":true,"type":"string"}},"required":["address","decimals","name","symbol"],"type":"object"},"chain_id":{"description":"EVM chain identifier.","exclusiveMinimum":true,"minimum":0,"type":"integer"},"creation_block_number":{"description":"Vault creation block number.","internalType":"bigint","type":"string"},"creator_address":{"description":"Address that called the factory to deploy the vault (the `caller` of the factory's `CreateMetaMorpho` event). Null when the response is served from the RPC fallback, which has no creation event.","nullable":true,"type":"string"},"curator":{"description":"Current curator address.","nullable":true,"type":"string"},"factory_address":{"description":"Factory contract address that deployed the vault.","type":"string"},"fee_recipient":{"description":"Active fee recipient address.","nullable":true,"type":"string"},"fee_wad":{"description":"Active fee value, scaled by WAD (1e18 = 100%).","internalType":"bigint","nullable":true,"type":"string"},"guardian":{"description":"Current guardian address.","nullable":true,"type":"string"},"last_indexed_block":{"description":"Latest indexed block used to compute this vault configuration.","internalType":"bigint","type":"string"},"name":{"description":"ERC-20 name of the vault share token.","type":"string"},"owner":{"description":"Current owner address.","type":"string"},"skim_recipient":{"description":"Active skim recipient address (reward token sweeps).","nullable":true,"type":"string"},"symbol":{"description":"ERC-20 symbol of the vault share token.","type":"string"},"timelock_seconds":{"description":"Active timelock duration, in seconds.","minimum":0,"type":"integer"},"version":{"description":"Vault contract version (semantic).","enum":["1.0","1.1"],"type":"string"}},"required":["chain_id","address","last_indexed_block","version","name","symbol","asset","factory_address","creator_address","creation_block_number","fee_recipient","skim_recipient","owner","curator","guardian","timelock_seconds"],"type":"object"}},"required":["data"],"type":"object"},"VaultV1StateHistoryResponse":{"properties":{"data":{"description":"Vault V1 historical state points.","items":{"properties":{"share_price_ray":{"description":"Normalized share price scaled by RAY (1e27): one whole share token quoted in whole underlying tokens.","internalType":"bigint","nullable":true,"type":"string"},"timestamp":{"description":"Snapshot timestamp in Unix seconds.","minimum":0,"type":"integer"},"total_assets":{"description":"Total value of vault holdings, in underlying token units.","internalType":"bigint","type":"string"},"total_supply":{"description":"Vault shares total supply.","internalType":"bigint","type":"string"},"withdrawable_assets":{"description":"Assets available for immediate withdrawal from the vault.","internalType":"bigint","type":"string"}},"required":["timestamp","total_assets","total_supply","withdrawable_assets","share_price_ray"],"type":"object"},"type":"array"},"last_indexed_block":{"description":"Latest indexed block used to serve this historical state.","internalType":"bigint","type":"string"},"params":{"description":"Request selector parameters.","properties":{"chain_id":{"description":"EVM chain identifier from the vault selector.","pattern":"^\\d+$","type":"string"},"vault_address":{"description":"Vault contract address from the vault selector.","type":"string"}},"required":["chain_id","vault_address"],"type":"object"}},"required":["params","data","last_indexed_block"],"type":"object"},"VaultV1StateResponse":{"properties":{"data":{"description":"Vault V1 live state.","properties":{"address":{"description":"Vault V1 contract address.","type":"string"},"chain_id":{"description":"EVM chain identifier.","exclusiveMinimum":true,"minimum":0,"type":"integer"},"last_indexed_block":{"description":"Latest indexed block used to compute this vault state.","internalType":"bigint","type":"string"},"share_price_ray":{"description":"Normalized share price scaled by RAY (1e27): one whole share token quoted in whole underlying tokens.","internalType":"bigint","nullable":true,"type":"string"},"total_assets":{"description":"Total value of vault holdings, in underlying token units.","internalType":"bigint","type":"string"},"total_supply":{"description":"Vault shares total supply.","internalType":"bigint","type":"string"},"withdrawable_assets":{"description":"Assets available for immediate withdrawal from the vault.","internalType":"bigint","type":"string"}},"required":["chain_id","address","last_indexed_block","total_assets","total_supply","withdrawable_assets","share_price_ray"],"type":"object"}},"required":["data"],"type":"object"},"VaultV2AllocationsResponse":{"properties":{"data":{"description":"Vault V2 adapter and cap allocation state.","properties":{"allocations":{"description":"Active adapters of the vault with their caps and current allocations.","items":{"properties":{"adapter_address":{"description":"Adapter contract address.","type":"string"},"adapter_kind":{"description":"Adapter implementation. Open-ended: new kinds ship additively, so treat unrecognized values as unknown.","enum":["morpho_market_v1","morpho_market_v1_v2","morpho_vault_v1","morpho_vault_v2","unknown"],"type":"string"},"caps":{"description":"Caps scoped to this adapter: its own adapter-wide cap and one cap per Morpho Blue market it is capped on.","items":{"oneOf":[{"properties":{"absolute_cap":{"description":"Absolute allocation cap, in underlying token units. 2^256 - 1 means no effective absolute cap.","internalType":"bigint","type":"string"},"allocated_assets":{"description":"Assets currently allocated against this cap, in underlying token units.","internalType":"bigint","type":"string"},"cap_data":{"description":"Opaque ABI-encoded cap id preimage, as stored on chain. Decoding it yields the cap target.","pattern":"^0x([a-fA-F0-9]{2})*$","type":"string"},"cap_id":{"description":"Vault V2 cap id (bytes32 keccak256 hash of cap_data).","pattern":"^0x[a-fA-F0-9]{64}$","type":"string"},"cap_type":{"description":"Cap tracked against the adapter as a whole, covering every position it holds.","enum":["adapter"],"type":"string"},"pending":{"description":"Pending cap increases. Cap decreases are not timelocked and apply immediately, so they never appear here.","properties":{"absolute_cap":{"description":"Pending absolute cap increase, in underlying token units. Null when no increase is pending. Absolute and relative cap increases are timelocked independently, so each carries its own valid_at_timestamp.","nullable":true,"properties":{"valid_at_timestamp":{"description":"Unix seconds at which the pending change becomes executable.","minimum":0,"type":"integer"},"value":{"description":"Pending cap value once executable.","internalType":"bigint","type":"string"}},"required":["value","valid_at_timestamp"],"type":"object"},"relative_cap_wad":{"description":"Pending relative cap increase, scaled by WAD (1e18 = 100%). Null when no increase is pending.","nullable":true,"properties":{"valid_at_timestamp":{"description":"Unix seconds at which the pending change becomes executable.","minimum":0,"type":"integer"},"value":{"description":"Pending cap value once executable.","internalType":"bigint","type":"string"}},"required":["value","valid_at_timestamp"],"type":"object"}},"required":["absolute_cap","relative_cap_wad"],"type":"object"},"real_assets":{"description":"Assets the adapter holds, in underlying token units, accrued to the read time. Matches the adapter's realAssets(). Unlike allocated_assets, which is updated only on allocate and deallocate, it includes interest earned since. The values across adapter caps sum to the vault-level allocated_assets served by the state route. Null when the vault's accrual state is unavailable or the adapter kind is not supported.","internalType":"bigint","nullable":true,"type":"string"},"relative_cap_wad":{"description":"Relative allocation cap, scaled by WAD (1e18 = 100%).","internalType":"bigint","type":"string"}},"required":["cap_id","cap_data","allocated_assets","absolute_cap","relative_cap_wad","pending","cap_type","real_assets"],"type":"object"},{"properties":{"absolute_cap":{"description":"Absolute allocation cap, in underlying token units. 2^256 - 1 means no effective absolute cap.","internalType":"bigint","type":"string"},"allocated_assets":{"description":"Assets currently allocated against this cap, in underlying token units.","internalType":"bigint","type":"string"},"cap_data":{"description":"Opaque ABI-encoded cap id preimage, as stored on chain. Decoding it yields the cap target.","pattern":"^0x([a-fA-F0-9]{2})*$","type":"string"},"cap_id":{"description":"Vault V2 cap id (bytes32 keccak256 hash of cap_data).","pattern":"^0x[a-fA-F0-9]{64}$","type":"string"},"cap_type":{"description":"Cap tracked against a single Morpho Blue market via an adapter.","enum":["market_v1"],"type":"string"},"expected_supply_assets":{"description":"Assets the adapter supplies to this market, in underlying token units, accrued to the read time. Matches the adapter's expectedSupplyAssets(marketId). Unlike allocated_assets, which is updated only on allocate and deallocate, it includes interest earned since. Zero can also mean the accrual state predates the market position; allocated_assets is then the better estimate. Null when the vault's accrual state is unavailable or the adapter is not a Morpho Market V1 adapter.","internalType":"bigint","nullable":true,"type":"string"},"market_id":{"description":"Morpho Blue market id this cap constrains.","type":"string"},"pending":{"description":"Pending cap increases. Cap decreases are not timelocked and apply immediately, so they never appear here.","properties":{"absolute_cap":{"description":"Pending absolute cap increase, in underlying token units. Null when no increase is pending. Absolute and relative cap increases are timelocked independently, so each carries its own valid_at_timestamp.","nullable":true,"properties":{"valid_at_timestamp":{"description":"Unix seconds at which the pending change becomes executable.","minimum":0,"type":"integer"},"value":{"description":"Pending cap value once executable.","internalType":"bigint","type":"string"}},"required":["value","valid_at_timestamp"],"type":"object"},"relative_cap_wad":{"description":"Pending relative cap increase, scaled by WAD (1e18 = 100%). Null when no increase is pending.","nullable":true,"properties":{"valid_at_timestamp":{"description":"Unix seconds at which the pending change becomes executable.","minimum":0,"type":"integer"},"value":{"description":"Pending cap value once executable.","internalType":"bigint","type":"string"}},"required":["value","valid_at_timestamp"],"type":"object"}},"required":["absolute_cap","relative_cap_wad"],"type":"object"},"relative_cap_wad":{"description":"Relative allocation cap, scaled by WAD (1e18 = 100%).","internalType":"bigint","type":"string"}},"required":["cap_id","cap_data","allocated_assets","absolute_cap","relative_cap_wad","pending","cap_type","market_id","expected_supply_assets"],"type":"object"}]},"type":"array"},"pending":{"description":"Pending governance changes scoped to this adapter.","properties":{"removal":{"description":"Pending removal of this adapter from the vault. Null when no removal is pending.","nullable":true,"properties":{"valid_at_timestamp":{"description":"Unix seconds at which the pending change becomes executable.","minimum":0,"type":"integer"}},"required":["valid_at_timestamp"],"type":"object"}},"required":["removal"],"type":"object"},"target":{"description":"Where this adapter routes the assets it receives.","oneOf":[{"properties":{"type":{"description":"Adapter supplying to Morpho Blue markets. A single adapter can serve several markets, so the markets themselves are listed per cap.","enum":["blue_market"],"type":"string"}},"required":["type"],"type":"object"},{"properties":{"type":{"description":"Adapter depositing into a Morpho Vault V1.","enum":["vault_v1"],"type":"string"},"vault_address":{"description":"Address of the Morpho Vault V1 the adapter deposits into.","type":"string"}},"required":["type","vault_address"],"type":"object"},{"properties":{"type":{"description":"Adapter depositing into a nested Morpho Vault V2.","enum":["vault_v2"],"type":"string"},"vault_address":{"description":"Address of the nested Morpho Vault V2 the adapter deposits into.","type":"string"}},"required":["type","vault_address"],"type":"object"},{"properties":{"target_address":{"description":"On-chain target pointer when one is recorded, for diagnostics. Null when the adapter exposes no target.","nullable":true,"type":"string"},"type":{"description":"Adapter that was not deployed by a known Morpho factory, or whose target is neither a Vault V1 nor a Vault V2.","enum":["unknown"],"type":"string"}},"required":["type","target_address"],"type":"object"}]}},"required":["adapter_address","adapter_kind","target","pending","caps"],"type":"object"},"type":"array"},"chain_id":{"description":"EVM chain identifier.","exclusiveMinimum":true,"minimum":0,"type":"integer"},"last_indexed_block":{"description":"Latest indexed block used to serve this allocation state.","internalType":"bigint","type":"string"},"unscoped_caps":{"description":"Caps that are not scoped to a single adapter: collateral caps, which constrain every market adapter holding that collateral, and caps whose target could not be decoded.","items":{"oneOf":[{"properties":{"absolute_cap":{"description":"Absolute allocation cap, in underlying token units. 2^256 - 1 means no effective absolute cap.","internalType":"bigint","type":"string"},"allocated_assets":{"description":"Assets currently allocated against this cap, in underlying token units.","internalType":"bigint","type":"string"},"cap_data":{"description":"Opaque ABI-encoded cap id preimage, as stored on chain. Decoding it yields the cap target.","pattern":"^0x([a-fA-F0-9]{2})*$","type":"string"},"cap_id":{"description":"Vault V2 cap id (bytes32 keccak256 hash of cap_data).","pattern":"^0x[a-fA-F0-9]{64}$","type":"string"},"cap_type":{"description":"Cap tracked against a collateral token across every market adapter of the vault.","enum":["collateral"],"type":"string"},"collateral_address":{"description":"ERC-20 collateral token address this cap constrains.","type":"string"},"pending":{"description":"Pending cap increases. Cap decreases are not timelocked and apply immediately, so they never appear here.","properties":{"absolute_cap":{"description":"Pending absolute cap increase, in underlying token units. Null when no increase is pending. Absolute and relative cap increases are timelocked independently, so each carries its own valid_at_timestamp.","nullable":true,"properties":{"valid_at_timestamp":{"description":"Unix seconds at which the pending change becomes executable.","minimum":0,"type":"integer"},"value":{"description":"Pending cap value once executable.","internalType":"bigint","type":"string"}},"required":["value","valid_at_timestamp"],"type":"object"},"relative_cap_wad":{"description":"Pending relative cap increase, scaled by WAD (1e18 = 100%). Null when no increase is pending.","nullable":true,"properties":{"valid_at_timestamp":{"description":"Unix seconds at which the pending change becomes executable.","minimum":0,"type":"integer"},"value":{"description":"Pending cap value once executable.","internalType":"bigint","type":"string"}},"required":["value","valid_at_timestamp"],"type":"object"}},"required":["absolute_cap","relative_cap_wad"],"type":"object"},"relative_cap_wad":{"description":"Relative allocation cap, scaled by WAD (1e18 = 100%).","internalType":"bigint","type":"string"}},"required":["cap_id","cap_data","allocated_assets","absolute_cap","relative_cap_wad","pending","cap_type","collateral_address"],"type":"object"},{"properties":{"absolute_cap":{"description":"Absolute allocation cap, in underlying token units. 2^256 - 1 means no effective absolute cap.","internalType":"bigint","type":"string"},"allocated_assets":{"description":"Assets currently allocated against this cap, in underlying token units.","internalType":"bigint","type":"string"},"cap_data":{"description":"Opaque ABI-encoded cap id preimage, as stored on chain. Decoding it yields the cap target.","pattern":"^0x([a-fA-F0-9]{2})*$","type":"string"},"cap_id":{"description":"Vault V2 cap id (bytes32 keccak256 hash of cap_data).","pattern":"^0x[a-fA-F0-9]{64}$","type":"string"},"cap_type":{"description":"Cap whose cap_data does not match any known encoding, so its target could not be resolved.","enum":["unknown"],"type":"string"},"pending":{"description":"Pending cap increases. Cap decreases are not timelocked and apply immediately, so they never appear here.","properties":{"absolute_cap":{"description":"Pending absolute cap increase, in underlying token units. Null when no increase is pending. Absolute and relative cap increases are timelocked independently, so each carries its own valid_at_timestamp.","nullable":true,"properties":{"valid_at_timestamp":{"description":"Unix seconds at which the pending change becomes executable.","minimum":0,"type":"integer"},"value":{"description":"Pending cap value once executable.","internalType":"bigint","type":"string"}},"required":["value","valid_at_timestamp"],"type":"object"},"relative_cap_wad":{"description":"Pending relative cap increase, scaled by WAD (1e18 = 100%). Null when no increase is pending.","nullable":true,"properties":{"valid_at_timestamp":{"description":"Unix seconds at which the pending change becomes executable.","minimum":0,"type":"integer"},"value":{"description":"Pending cap value once executable.","internalType":"bigint","type":"string"}},"required":["value","valid_at_timestamp"],"type":"object"}},"required":["absolute_cap","relative_cap_wad"],"type":"object"},"relative_cap_wad":{"description":"Relative allocation cap, scaled by WAD (1e18 = 100%).","internalType":"bigint","type":"string"}},"required":["cap_id","cap_data","allocated_assets","absolute_cap","relative_cap_wad","pending","cap_type"],"type":"object"}]},"type":"array"},"vault_address":{"description":"Vault V2 contract address.","type":"string"}},"required":["chain_id","vault_address","last_indexed_block","allocations","unscoped_caps"],"type":"object"}},"required":["data"],"type":"object"},"VaultV2ApyAveragesResponse":{"properties":{"data":{"description":"Vault V2 realized average APY.","properties":{"apy":{"description":"Realized average APY of the vault, calculated from share price evolution over the lookback period. Null when the vault holds fewer than 1,000,000 raw units of its asset (1 USDC, 0.01 WBTC) at the latest snapshot or at the lookback snapshot, because a near-empty vault's share price is dominated by rounding. inception averages from the initial share price at creation, so only the latest snapshot is checked.","nullable":true,"type":"number"},"chain_id":{"description":"EVM chain identifier.","exclusiveMinimum":true,"minimum":0,"type":"integer"},"last_indexed_block":{"description":"Latest indexed block used to compute this APY average.","internalType":"bigint","type":"string"},"lookback":{"description":"Lookback period used to compute the average APY.","enum":["one_hour","six_hours","one_day","seven_days","thirty_days","ninety_days","one_year","inception"],"type":"string"},"vault_address":{"description":"Vault contract address.","type":"string"}},"required":["chain_id","vault_address","last_indexed_block","lookback","apy"],"type":"object"}},"required":["data"],"type":"object"},"VaultV2ApyHistoryResponse":{"properties":{"data":{"description":"Vault V2 historical APY points.","items":{"properties":{"apy":{"description":"Historical vault APY.","nullable":true,"type":"number"},"timestamp":{"description":"Historical sample timestamp in Unix seconds.","minimum":0,"type":"integer"}},"required":["timestamp","apy"],"type":"object"},"type":"array"},"last_indexed_block":{"description":"Latest indexed block used to serve this historical APY.","internalType":"bigint","type":"string"},"params":{"description":"Request selector parameters.","properties":{"chain_id":{"description":"EVM chain identifier from the vault selector.","pattern":"^\\d+$","type":"string"},"vault_address":{"description":"Vault contract address from the vault selector.","type":"string"}},"required":["chain_id","vault_address"],"type":"object"}},"required":["params","data","last_indexed_block"],"type":"object"},"VaultV2CapsHistoryResponse":{"properties":{"data":{"description":"Vault V2 caps history grouped by cap.","items":{"oneOf":[{"properties":{"adapter_address":{"description":"Adapter contract address this cap constrains.","type":"string"},"cap_id":{"description":"Vault V2 cap id.","pattern":"^0x[a-fA-F0-9]{64}$","type":"string"},"cap_type":{"description":"Cap tracked against the adapter as a whole, covering every position it holds.","enum":["adapter"],"type":"string"},"history":{"description":"Historical allocation and cap points for this cap.","items":{"properties":{"absolute_cap":{"description":"Absolute allocation cap, in underlying token units.","internalType":"bigint","type":"string"},"allocation":{"description":"Assets allocated to this cap target, in underlying token units.","internalType":"bigint","type":"string"},"relative_allocation":{"description":"Allocation relative to vault total assets as a ratio.","minimum":0,"type":"number"},"relative_cap_wad":{"description":"Relative allocation cap scaled by WAD (1e18).","internalType":"bigint","type":"string"},"timestamp":{"description":"Snapshot timestamp in Unix seconds.","minimum":0,"type":"integer"}},"required":["timestamp","allocation","absolute_cap","relative_cap_wad","relative_allocation"],"type":"object"},"type":"array"},"target":{"description":"Where this adapter routes the assets it receives, in the /allocations shape. Resolved from the adapter factory's creation event, so it is also set for adapters removed from the vault.","oneOf":[{"properties":{"type":{"description":"Adapter supplying to Morpho Blue markets. A single adapter can serve several markets, so the markets themselves are listed per cap.","enum":["blue_market"],"type":"string"}},"required":["type"],"type":"object"},{"properties":{"type":{"description":"Adapter depositing into a Morpho Vault V1.","enum":["vault_v1"],"type":"string"},"vault_address":{"description":"Address of the Morpho Vault V1 the adapter deposits into.","type":"string"}},"required":["type","vault_address"],"type":"object"},{"properties":{"type":{"description":"Adapter depositing into a nested Morpho Vault V2.","enum":["vault_v2"],"type":"string"},"vault_address":{"description":"Address of the nested Morpho Vault V2 the adapter deposits into.","type":"string"}},"required":["type","vault_address"],"type":"object"},{"properties":{"target_address":{"description":"On-chain target pointer when one is recorded, for diagnostics. Null when the adapter exposes no target.","nullable":true,"type":"string"},"type":{"description":"Adapter that was not deployed by a known Morpho factory, or whose target is neither a Vault V1 nor a Vault V2.","enum":["unknown"],"type":"string"}},"required":["type","target_address"],"type":"object"}]}},"required":["cap_id","history","cap_type","adapter_address","target"],"type":"object"},{"properties":{"adapter_address":{"description":"Adapter contract address this cap constrains.","type":"string"},"cap_id":{"description":"Vault V2 cap id.","pattern":"^0x[a-fA-F0-9]{64}$","type":"string"},"cap_type":{"description":"Cap tracked against a single Morpho Blue market via an adapter.","enum":["marketV1"],"type":"string"},"collateral_address":{"description":"Collateral token address of the constrained market.","type":"string"},"history":{"description":"Historical allocation and cap points for this cap.","items":{"properties":{"absolute_cap":{"description":"Absolute allocation cap, in underlying token units.","internalType":"bigint","type":"string"},"allocation":{"description":"Assets allocated to this cap target, in underlying token units.","internalType":"bigint","type":"string"},"relative_allocation":{"description":"Allocation relative to vault total assets as a ratio.","minimum":0,"type":"number"},"relative_cap_wad":{"description":"Relative allocation cap scaled by WAD (1e18).","internalType":"bigint","type":"string"},"timestamp":{"description":"Snapshot timestamp in Unix seconds.","minimum":0,"type":"integer"}},"required":["timestamp","allocation","absolute_cap","relative_cap_wad","relative_allocation"],"type":"object"},"type":"array"},"market_id":{"description":"Morpho Blue market id this cap constrains.","type":"string"}},"required":["cap_id","history","cap_type","adapter_address","market_id","collateral_address"],"type":"object"},{"properties":{"cap_id":{"description":"Vault V2 cap id.","pattern":"^0x[a-fA-F0-9]{64}$","type":"string"},"cap_type":{"description":"Cap tracked against a collateral token across every market adapter of the vault.","enum":["collateral"],"type":"string"},"collateral_address":{"description":"ERC-20 collateral token address this cap constrains.","type":"string"},"history":{"description":"Historical allocation and cap points for this cap.","items":{"properties":{"absolute_cap":{"description":"Absolute allocation cap, in underlying token units.","internalType":"bigint","type":"string"},"allocation":{"description":"Assets allocated to this cap target, in underlying token units.","internalType":"bigint","type":"string"},"relative_allocation":{"description":"Allocation relative to vault total assets as a ratio.","minimum":0,"type":"number"},"relative_cap_wad":{"description":"Relative allocation cap scaled by WAD (1e18).","internalType":"bigint","type":"string"},"timestamp":{"description":"Snapshot timestamp in Unix seconds.","minimum":0,"type":"integer"}},"required":["timestamp","allocation","absolute_cap","relative_cap_wad","relative_allocation"],"type":"object"},"type":"array"}},"required":["cap_id","history","cap_type","collateral_address"],"type":"object"},{"properties":{"cap_id":{"description":"Vault V2 cap id.","pattern":"^0x[a-fA-F0-9]{64}$","type":"string"},"cap_type":{"description":"Cap whose cap_data does not match any known encoding, so its target could not be resolved.","enum":["unknown"],"type":"string"},"history":{"description":"Historical allocation and cap points for this cap.","items":{"properties":{"absolute_cap":{"description":"Absolute allocation cap, in underlying token units.","internalType":"bigint","type":"string"},"allocation":{"description":"Assets allocated to this cap target, in underlying token units.","internalType":"bigint","type":"string"},"relative_allocation":{"description":"Allocation relative to vault total assets as a ratio.","minimum":0,"type":"number"},"relative_cap_wad":{"description":"Relative allocation cap scaled by WAD (1e18).","internalType":"bigint","type":"string"},"timestamp":{"description":"Snapshot timestamp in Unix seconds.","minimum":0,"type":"integer"}},"required":["timestamp","allocation","absolute_cap","relative_cap_wad","relative_allocation"],"type":"object"},"type":"array"}},"required":["cap_id","history","cap_type"],"type":"object"}]},"type":"array"},"last_indexed_block":{"description":"Latest indexed block used to serve this historical cap state.","internalType":"bigint","type":"string"},"params":{"description":"Request selector parameters.","properties":{"chain_id":{"description":"EVM chain identifier from the vault selector.","pattern":"^\\d+$","type":"string"},"vault_address":{"description":"Vault contract address from the vault selector.","type":"string"}},"required":["chain_id","vault_address"],"type":"object"}},"required":["params","data","last_indexed_block"],"type":"object"},"VaultV2ListResponse":{"properties":{"cursor":{"description":"Opaque cursor. Null on the last page.","nullable":true,"type":"string"},"data":{"description":"Listed Morpho Vault V2 instances.","items":{"properties":{"asset_address":{"description":"Underlying asset address, EIP-55 checksummed. Resolve its name, symbol and decimals via the token endpoint.","type":"string"},"chain_id":{"description":"EVM chain identifier.","exclusiveMinimum":true,"minimum":0,"type":"integer"},"creation_block_number":{"description":"Vault creation block number.","internalType":"bigint","type":"string"},"creation_timestamp":{"description":"Unix timestamp of the creation block, in seconds.","minimum":0,"type":"integer"},"curator":{"description":"Current curator address. A zero address on-chain is returned as `null`.","nullable":true,"type":"string"},"factory_address":{"description":"Factory contract address that deployed the vault, EIP-55 checksummed.","type":"string"},"management_fee_recipient":{"description":"Active management fee recipient. Null while no fee is charged. A zero address on-chain is also returned as `null`.","nullable":true,"type":"string"},"management_fee_wad":{"description":"Active management fee, scaled by WAD (1e18 = 100%). Null when never set. Sorting treats null as 0, so unset fees sort lowest.","internalType":"bigint","nullable":true,"type":"string"},"name":{"description":"ERC-20 name of the vault share token.","nullable":true,"type":"string"},"owner":{"description":"Current owner address. A zero address on-chain is returned as `null`.","nullable":true,"type":"string"},"performance_fee_recipient":{"description":"Active performance fee recipient. Null while no fee is charged. A zero address on-chain is also returned as `null`.","nullable":true,"type":"string"},"performance_fee_wad":{"description":"Active performance fee, scaled by WAD (1e18 = 100%). Null when never set. Sorting treats null as 0, so unset fees sort lowest.","internalType":"bigint","nullable":true,"type":"string"},"symbol":{"description":"ERC-20 symbol of the vault share token.","nullable":true,"type":"string"},"vault_address":{"description":"Vault V2 contract address, EIP-55 checksummed. Use <chain_id>:<vault_address> as the resource selector in per-vault routes, for example 1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11.","type":"string"},"version":{"description":"Vault contract version.","type":"string"}},"required":["chain_id","vault_address","version","name","symbol","asset_address","factory_address","creation_block_number","creation_timestamp","management_fee_recipient","performance_fee_recipient","owner","curator","management_fee_wad","performance_fee_wad"],"type":"object"},"type":"array"}},"required":["data","cursor"],"type":"object"},"VaultV2MarketReallocatableLiquidityIdleRoute":{"properties":{"reallocatable_assets":{"description":"Reallocatable assets in vault-asset native units from the canonical public simulation.","internalType":"bigint","type":"string"},"source_type":{"enum":["idle"],"type":"string"},"target_adapter_address":{"type":"string"}},"required":["source_type","target_adapter_address","reallocatable_assets"],"type":"object"},"VaultV2MarketReallocatableLiquidityMarketRoute":{"properties":{"chain_id":{"description":"EVM chain identifier.","exclusiveMinimum":true,"minimum":0,"type":"integer"},"reallocatable_assets":{"description":"Reallocatable assets in vault-asset native units from the canonical public simulation.","internalType":"bigint","type":"string"},"source_adapter_address":{"type":"string"},"source_type":{"enum":["market"],"type":"string"},"target_adapter_address":{"type":"string"},"withdraw_market_id":{"description":"Bare Morpho Blue market id (bytes32 unique key).","type":"string"}},"required":["source_type","chain_id","withdraw_market_id","source_adapter_address","target_adapter_address","reallocatable_assets"],"type":"object"},"VaultV2MarketReallocatableLiquidityResponse":{"properties":{"data":{"properties":{"chain_id":{"description":"EVM chain identifier.","exclusiveMinimum":true,"minimum":0,"type":"integer"},"market_id":{"description":"Bare Morpho Blue market id (bytes32 unique key).","type":"string"},"penalty_wad":{"description":"Vault-level proportional Public Allocator V2 penalty, scaled by WAD (1e18 = 100%), paid in the vault asset. Not Public Allocator V1's fixed native-token fee.","internalType":"bigint","type":"string"},"public_allocator_address":{"type":"string"},"reallocatable_assets":{"description":"Reallocatable assets in vault-asset native units from the canonical public simulation.","internalType":"bigint","type":"string"},"routes":{"description":"Positive-capacity routes; their assets sum exactly to reallocatable_assets. At most 200 distinct source/target cap pairs, enforced without truncation.","items":{"discriminator":{"mapping":{"idle":"#/components/schemas/VaultV2MarketReallocatableLiquidityIdleRoute","market":"#/components/schemas/VaultV2MarketReallocatableLiquidityMarketRoute"},"propertyName":"source_type"},"oneOf":[{"$ref":"#/components/schemas/VaultV2MarketReallocatableLiquidityMarketRoute"},{"$ref":"#/components/schemas/VaultV2MarketReallocatableLiquidityIdleRoute"}]},"maxItems":200,"type":"array"}},"required":["chain_id","market_id","public_allocator_address","penalty_wad","reallocatable_assets","routes"],"type":"object"},"last_indexed_block":{"description":"Minimum of the cached composition's own starting indexer head, every contributing Midx market and vault snapshot (including competing vaults), and the request's starting head. Forward indexing never raises cached freshness. Rollback below the composition or request starting head returns retryable 503.","internalType":"bigint","type":"string"}},"required":["data","last_indexed_block"],"type":"object"},"VaultV2PendingGovernanceActionsResponse":{"properties":{"cursor":{"description":"Opaque pagination cursor.","nullable":true,"type":"string"},"data":{"description":"Pending governance actions for this Vault V2.","items":{"oneOf":[{"properties":{"action_type":{"enum":["set_is_allocator"],"type":"string"},"executable_at_timestamp":{"description":"Unix seconds when the action becomes executable.","minimum":0,"type":"integer"},"parameters":{"properties":{"account":{"description":"Allocator account address.","type":"string"},"is_allocator":{"description":"Whether the account becomes allocator.","type":"boolean"}},"required":["account","is_allocator"],"type":"object"},"submitted_transaction_hash":{"description":"Transaction hash that submitted the pending governance action.","pattern":"^0x[a-fA-F0-9]{64}$","type":"string"}},"required":["submitted_transaction_hash","executable_at_timestamp","action_type","parameters"],"type":"object"},{"properties":{"action_type":{"enum":["set_receive_shares_gate"],"type":"string"},"executable_at_timestamp":{"description":"Unix seconds when the action becomes executable.","minimum":0,"type":"integer"},"parameters":{"properties":{"new_gate":{"description":"Pending gate contract address.","type":"string"}},"required":["new_gate"],"type":"object"},"submitted_transaction_hash":{"description":"Transaction hash that submitted the pending governance action.","pattern":"^0x[a-fA-F0-9]{64}$","type":"string"}},"required":["submitted_transaction_hash","executable_at_timestamp","action_type","parameters"],"type":"object"},{"properties":{"action_type":{"enum":["set_send_shares_gate"],"type":"string"},"executable_at_timestamp":{"description":"Unix seconds when the action becomes executable.","minimum":0,"type":"integer"},"parameters":{"properties":{"new_gate":{"description":"Pending gate contract address.","type":"string"}},"required":["new_gate"],"type":"object"},"submitted_transaction_hash":{"description":"Transaction hash that submitted the pending governance action.","pattern":"^0x[a-fA-F0-9]{64}$","type":"string"}},"required":["submitted_transaction_hash","executable_at_timestamp","action_type","parameters"],"type":"object"},{"properties":{"action_type":{"enum":["set_receive_assets_gate"],"type":"string"},"executable_at_timestamp":{"description":"Unix seconds when the action becomes executable.","minimum":0,"type":"integer"},"parameters":{"properties":{"new_gate":{"description":"Pending gate contract address.","type":"string"}},"required":["new_gate"],"type":"object"},"submitted_transaction_hash":{"description":"Transaction hash that submitted the pending governance action.","pattern":"^0x[a-fA-F0-9]{64}$","type":"string"}},"required":["submitted_transaction_hash","executable_at_timestamp","action_type","parameters"],"type":"object"},{"properties":{"action_type":{"enum":["set_send_assets_gate"],"type":"string"},"executable_at_timestamp":{"description":"Unix seconds when the action becomes executable.","minimum":0,"type":"integer"},"parameters":{"properties":{"new_gate":{"description":"Pending gate contract address.","type":"string"}},"required":["new_gate"],"type":"object"},"submitted_transaction_hash":{"description":"Transaction hash that submitted the pending governance action.","pattern":"^0x[a-fA-F0-9]{64}$","type":"string"}},"required":["submitted_transaction_hash","executable_at_timestamp","action_type","parameters"],"type":"object"},{"properties":{"action_type":{"enum":["set_adapter_registry"],"type":"string"},"executable_at_timestamp":{"description":"Unix seconds when the action becomes executable.","minimum":0,"type":"integer"},"parameters":{"properties":{"new_adapter_registry":{"description":"Pending adapter registry address.","type":"string"}},"required":["new_adapter_registry"],"type":"object"},"submitted_transaction_hash":{"description":"Transaction hash that submitted the pending governance action.","pattern":"^0x[a-fA-F0-9]{64}$","type":"string"}},"required":["submitted_transaction_hash","executable_at_timestamp","action_type","parameters"],"type":"object"},{"properties":{"action_type":{"enum":["add_adapter"],"type":"string"},"executable_at_timestamp":{"description":"Unix seconds when the action becomes executable.","minimum":0,"type":"integer"},"parameters":{"properties":{"adapter":{"description":"Adapter contract address.","type":"string"}},"required":["adapter"],"type":"object"},"submitted_transaction_hash":{"description":"Transaction hash that submitted the pending governance action.","pattern":"^0x[a-fA-F0-9]{64}$","type":"string"}},"required":["submitted_transaction_hash","executable_at_timestamp","action_type","parameters"],"type":"object"},{"properties":{"action_type":{"enum":["remove_adapter"],"type":"string"},"executable_at_timestamp":{"description":"Unix seconds when the action becomes executable.","minimum":0,"type":"integer"},"parameters":{"properties":{"adapter":{"description":"Adapter contract address.","type":"string"}},"required":["adapter"],"type":"object"},"submitted_transaction_hash":{"description":"Transaction hash that submitted the pending governance action.","pattern":"^0x[a-fA-F0-9]{64}$","type":"string"}},"required":["submitted_transaction_hash","executable_at_timestamp","action_type","parameters"],"type":"object"},{"properties":{"action_type":{"enum":["increase_timelock"],"type":"string"},"executable_at_timestamp":{"description":"Unix seconds when the action becomes executable.","minimum":0,"type":"integer"},"parameters":{"properties":{"new_duration_seconds":{"description":"Pending timelock duration, in seconds.","pattern":"^\\d+$","type":"string"},"selector":{"description":"Four-byte function selector.","pattern":"^0x[a-fA-F0-9]{8}$","type":"string"}},"required":["selector","new_duration_seconds"],"type":"object"},"submitted_transaction_hash":{"description":"Transaction hash that submitted the pending governance action.","pattern":"^0x[a-fA-F0-9]{64}$","type":"string"}},"required":["submitted_transaction_hash","executable_at_timestamp","action_type","parameters"],"type":"object"},{"properties":{"action_type":{"enum":["decrease_timelock"],"type":"string"},"executable_at_timestamp":{"description":"Unix seconds when the action becomes executable.","minimum":0,"type":"integer"},"parameters":{"properties":{"new_duration_seconds":{"description":"Pending timelock duration, in seconds.","pattern":"^\\d+$","type":"string"},"selector":{"description":"Four-byte function selector.","pattern":"^0x[a-fA-F0-9]{8}$","type":"string"}},"required":["selector","new_duration_seconds"],"type":"object"},"submitted_transaction_hash":{"description":"Transaction hash that submitted the pending governance action.","pattern":"^0x[a-fA-F0-9]{64}$","type":"string"}},"required":["submitted_transaction_hash","executable_at_timestamp","action_type","parameters"],"type":"object"},{"properties":{"action_type":{"enum":["abdicate"],"type":"string"},"executable_at_timestamp":{"description":"Unix seconds when the action becomes executable.","minimum":0,"type":"integer"},"parameters":{"properties":{"selector":{"description":"Four-byte function selector.","pattern":"^0x[a-fA-F0-9]{8}$","type":"string"}},"required":["selector"],"type":"object"},"submitted_transaction_hash":{"description":"Transaction hash that submitted the pending governance action.","pattern":"^0x[a-fA-F0-9]{64}$","type":"string"}},"required":["submitted_transaction_hash","executable_at_timestamp","action_type","parameters"],"type":"object"},{"properties":{"action_type":{"enum":["set_performance_fee"],"type":"string"},"executable_at_timestamp":{"description":"Unix seconds when the action becomes executable.","minimum":0,"type":"integer"},"parameters":{"properties":{"new_fee_wad":{"description":"Pending fee value, scaled by WAD (1e18 = 100%).","internalType":"bigint","type":"string"}},"required":["new_fee_wad"],"type":"object"},"submitted_transaction_hash":{"description":"Transaction hash that submitted the pending governance action.","pattern":"^0x[a-fA-F0-9]{64}$","type":"string"}},"required":["submitted_transaction_hash","executable_at_timestamp","action_type","parameters"],"type":"object"},{"properties":{"action_type":{"enum":["set_management_fee"],"type":"string"},"executable_at_timestamp":{"description":"Unix seconds when the action becomes executable.","minimum":0,"type":"integer"},"parameters":{"properties":{"new_fee_wad":{"description":"Pending fee value, scaled by WAD (1e18 = 100%).","internalType":"bigint","type":"string"}},"required":["new_fee_wad"],"type":"object"},"submitted_transaction_hash":{"description":"Transaction hash that submitted the pending governance action.","pattern":"^0x[a-fA-F0-9]{64}$","type":"string"}},"required":["submitted_transaction_hash","executable_at_timestamp","action_type","parameters"],"type":"object"},{"properties":{"action_type":{"enum":["set_performance_fee_recipient"],"type":"string"},"executable_at_timestamp":{"description":"Unix seconds when the action becomes executable.","minimum":0,"type":"integer"},"parameters":{"properties":{"new_recipient":{"description":"Pending fee recipient address.","type":"string"}},"required":["new_recipient"],"type":"object"},"submitted_transaction_hash":{"description":"Transaction hash that submitted the pending governance action.","pattern":"^0x[a-fA-F0-9]{64}$","type":"string"}},"required":["submitted_transaction_hash","executable_at_timestamp","action_type","parameters"],"type":"object"},{"properties":{"action_type":{"enum":["set_management_fee_recipient"],"type":"string"},"executable_at_timestamp":{"description":"Unix seconds when the action becomes executable.","minimum":0,"type":"integer"},"parameters":{"properties":{"new_recipient":{"description":"Pending fee recipient address.","type":"string"}},"required":["new_recipient"],"type":"object"},"submitted_transaction_hash":{"description":"Transaction hash that submitted the pending governance action.","pattern":"^0x[a-fA-F0-9]{64}$","type":"string"}},"required":["submitted_transaction_hash","executable_at_timestamp","action_type","parameters"],"type":"object"},{"properties":{"action_type":{"enum":["increase_absolute_cap"],"type":"string"},"executable_at_timestamp":{"description":"Unix seconds when the action becomes executable.","minimum":0,"type":"integer"},"parameters":{"properties":{"id_data":{"description":"Adapter-specific cap id calldata.","type":"string"},"new_absolute_cap":{"description":"Pending absolute cap in underlying token units.","internalType":"bigint","type":"string"}},"required":["id_data","new_absolute_cap"],"type":"object"},"submitted_transaction_hash":{"description":"Transaction hash that submitted the pending governance action.","pattern":"^0x[a-fA-F0-9]{64}$","type":"string"}},"required":["submitted_transaction_hash","executable_at_timestamp","action_type","parameters"],"type":"object"},{"properties":{"action_type":{"enum":["increase_relative_cap"],"type":"string"},"executable_at_timestamp":{"description":"Unix seconds when the action becomes executable.","minimum":0,"type":"integer"},"parameters":{"properties":{"id_data":{"description":"Adapter-specific cap id calldata.","type":"string"},"new_relative_cap_wad":{"description":"Pending relative cap, scaled by WAD (1e18 = 100%).","internalType":"bigint","type":"string"}},"required":["id_data","new_relative_cap_wad"],"type":"object"},"submitted_transaction_hash":{"description":"Transaction hash that submitted the pending governance action.","pattern":"^0x[a-fA-F0-9]{64}$","type":"string"}},"required":["submitted_transaction_hash","executable_at_timestamp","action_type","parameters"],"type":"object"},{"properties":{"action_type":{"enum":["set_force_deallocate_penalty"],"type":"string"},"executable_at_timestamp":{"description":"Unix seconds when the action becomes executable.","minimum":0,"type":"integer"},"parameters":{"properties":{"adapter":{"description":"Adapter contract address.","type":"string"},"new_penalty_wad":{"description":"Pending force deallocation penalty, scaled by WAD (1e18 = 100%).","internalType":"bigint","type":"string"}},"required":["adapter","new_penalty_wad"],"type":"object"},"submitted_transaction_hash":{"description":"Transaction hash that submitted the pending governance action.","pattern":"^0x[a-fA-F0-9]{64}$","type":"string"}},"required":["submitted_transaction_hash","executable_at_timestamp","action_type","parameters"],"type":"object"},{"properties":{"action_type":{"enum":["unknown"],"type":"string"},"executable_at_timestamp":{"description":"Unix seconds when the action becomes executable.","minimum":0,"type":"integer"},"parameters":{"type":"null"},"submitted_transaction_hash":{"description":"Transaction hash that submitted the pending governance action.","pattern":"^0x[a-fA-F0-9]{64}$","type":"string"}},"required":["submitted_transaction_hash","executable_at_timestamp","action_type","parameters"],"type":"object"}]},"type":"array"},"last_indexed_block":{"description":"Latest indexed block used to compute this pending action list.","internalType":"bigint","type":"string"},"params":{"properties":{"chain_id":{"description":"EVM chain identifier.","enum":[1,8453,747474,999,42161,137,130,10,480,143,988,4217,4663,5042,196],"type":"number"},"vault_address":{"description":"Vault contract address.","type":"string"}},"required":["chain_id","vault_address"],"type":"object"}},"required":["params","data","cursor","last_indexed_block"],"type":"object"},"VaultV2RootResponse":{"properties":{"data":{"description":"Vault V2 configuration.","properties":{"adapter_registry":{"description":"Active adapter registry address. A zero address on-chain is returned as `null`.","nullable":true,"type":"string"},"address":{"description":"Vault V2 contract address.","type":"string"},"asset":{"description":"Underlying asset metadata.","properties":{"address":{"description":"ERC-20 token contract address.","type":"string"},"decimals":{"description":"ERC-20 token decimals.","maximum":255,"minimum":0,"nullable":true,"type":"integer"},"name":{"description":"ERC-20 token name.","nullable":true,"type":"string"},"symbol":{"description":"ERC-20 token symbol.","nullable":true,"type":"string"}},"required":["address","decimals","name","symbol"],"type":"object"},"chain_id":{"description":"EVM chain identifier.","exclusiveMinimum":true,"minimum":0,"type":"integer"},"creation_block_number":{"description":"Vault creation block number.","internalType":"bigint","type":"string"},"curator":{"description":"Current curator address. A zero address on-chain is returned as `null`.","nullable":true,"type":"string"},"decimals_offset":{"description":"Decimals offset applied to vault share accounting.","maximum":18,"minimum":0,"nullable":true,"type":"integer"},"factory_address":{"description":"Factory contract address that deployed the vault.","type":"string"},"gates":{"description":"Gates controlling access to Vault V2 operations.","properties":{"receive_assets":{"description":"Gate for receiving assets (deposit); `null` when no gate is set, including a gate reset to the zero address.","nullable":true,"type":"string"},"receive_shares":{"description":"Gate for receiving shares (transfer to vault); `null` when no gate is set, including a gate reset to the zero address.","nullable":true,"type":"string"},"send_assets":{"description":"Gate for sending assets (withdraw); `null` when no gate is set, including a gate reset to the zero address.","nullable":true,"type":"string"},"send_shares":{"description":"Gate for sending shares (transfer from vault); `null` when no gate is set, including a gate reset to the zero address.","nullable":true,"type":"string"}},"required":["send_shares","receive_shares","send_assets","receive_assets"],"type":"object"},"governance":{"description":"Indexed per-function governance configuration from the same sources as GraphQL timelocks. Null on RPC fallback, which does not load per-function timelocks or abdication state.","nullable":true,"properties":{"timelocks":{"description":"One entry for each of the 18 supported timelocked functions, including functions whose timelock has never been set.","items":{"properties":{"abdicated_at_timestamp":{"description":"Unix timestamp in seconds when this specific function was abdicated, from its indexed Abdicate event. Null when the function has not been abdicated.","minimum":0,"nullable":true,"type":"integer"},"function_name":{"description":"Solidity function name, matching GraphQL timelocks.functionName. Includes every supported timelocked function in canonical order.","enum":["setIsAllocator","setReceiveSharesGate","setSendSharesGate","setReceiveAssetsGate","setSendAssetsGate","setAdapterRegistry","addAdapter","removeAdapter","increaseTimelock","decreaseTimelock","setPerformanceFee","setManagementFee","setPerformanceFeeRecipient","setManagementFeeRecipient","increaseAbsoluteCap","increaseRelativeCap","setForceDeallocatePenalty","abdicate"],"type":"string"},"is_abdicated":{"description":"Whether the function has been permanently abdicated, based on the indexed Abdicate event. An abdicated function can never be called again.","type":"boolean"},"timelock_seconds":{"description":"Current timelock mapping value in seconds, as an exact base-10 uint256 string, including unbounded values. Zero when never set. Preserved after abdication; decreaseTimelock is scheduled using the target function's timelock at submission.","internalType":"bigint","type":"string"}},"required":["function_name","timelock_seconds","is_abdicated","abdicated_at_timestamp"],"type":"object"},"type":"array"}},"required":["timelocks"],"type":"object"},"last_indexed_block":{"description":"Latest indexed block used to compute this vault configuration.","internalType":"bigint","type":"string"},"liquidity_adapter":{"description":"Active liquidity adapter address. A zero address on-chain is returned as `null`.","nullable":true,"type":"string"},"liquidity_data":{"description":"Active liquidity adapter calldata.","nullable":true,"type":"string"},"management_fee_recipient":{"description":"Active management fee recipient address. A zero address on-chain is returned as `null`.","nullable":true,"type":"string"},"management_fee_wad":{"description":"Active management fee value, scaled by WAD (1e18 = 100%).","internalType":"bigint","nullable":true,"type":"string"},"max_rate_per_second_wad":{"description":"Maximum rate per second, scaled by WAD (1e18 = 100%).","internalType":"bigint","nullable":true,"type":"string"},"name":{"description":"ERC-20 name of the vault share token.","nullable":true,"type":"string"},"owner":{"description":"Current owner address. A zero address on-chain is returned as `null`.","nullable":true,"type":"string"},"performance_fee_recipient":{"description":"Active performance fee recipient address. A zero address on-chain is returned as `null`.","nullable":true,"type":"string"},"performance_fee_wad":{"description":"Active performance fee value, scaled by WAD (1e18 = 100%).","internalType":"bigint","nullable":true,"type":"string"},"symbol":{"description":"ERC-20 symbol of the vault share token.","nullable":true,"type":"string"},"timelock_seconds":{"description":"Maximum active timelock duration across timelocked functions, in seconds. Unbounded timelocks (e.g. set to make them irrevocable) are clamped to the maximum safe integer.","minimum":0,"nullable":true,"type":"integer"},"version":{"description":"Vault contract version.","type":"string"}},"required":["chain_id","address","last_indexed_block","version","name","symbol","asset","decimals_offset","factory_address","creation_block_number","owner","curator","governance","timelock_seconds","management_fee_recipient","performance_fee_recipient","adapter_registry","liquidity_adapter","liquidity_data","gates"],"type":"object"}},"required":["data"],"type":"object"},"VaultV2StateHistoryResponse":{"properties":{"data":{"description":"Vault V2 historical state points.","items":{"properties":{"allocated_assets":{"description":"Real assets allocated in the vault, excluding virtual accrual.","internalType":"bigint","type":"string"},"idle_assets":{"description":"Assets deposited to the vault that are not generating interest.","internalType":"bigint","type":"string"},"share_price_ray":{"description":"Normalized share price scaled by RAY (1e27): one whole share token quoted in whole underlying tokens.","internalType":"bigint","nullable":true,"type":"string"},"timestamp":{"description":"Snapshot timestamp in Unix seconds.","minimum":0,"type":"integer"},"total_assets":{"description":"Total value of vault holdings, in underlying token units.","internalType":"bigint","type":"string"},"total_supply":{"description":"Vault shares total supply.","internalType":"bigint","type":"string"},"withdrawable_assets":{"description":"Liquidity available from the liquidity adapter plus idle assets.","internalType":"bigint","type":"string"}},"required":["timestamp","total_assets","total_supply","withdrawable_assets","allocated_assets","idle_assets","share_price_ray"],"type":"object"},"type":"array"},"last_indexed_block":{"description":"Latest indexed block used to serve this historical state.","internalType":"bigint","type":"string"},"params":{"description":"Request selector parameters.","properties":{"chain_id":{"description":"EVM chain identifier from the vault selector.","pattern":"^\\d+$","type":"string"},"vault_address":{"description":"Vault contract address from the vault selector.","type":"string"}},"required":["chain_id","vault_address"],"type":"object"}},"required":["params","data","last_indexed_block"],"type":"object"},"VaultV2StateResponse":{"properties":{"data":{"description":"Vault V2 live state.","properties":{"address":{"description":"Vault V2 contract address.","type":"string"},"allocated_assets":{"description":"Real assets allocated in the vault, excluding virtual accrual.","internalType":"bigint","type":"string"},"chain_id":{"description":"EVM chain identifier.","exclusiveMinimum":true,"minimum":0,"type":"integer"},"idle_assets":{"description":"Assets deposited to the vault that are not generating interest.","internalType":"bigint","type":"string"},"last_accrual_timestamp":{"description":"Latest accrual timestamp, in Unix seconds.","minimum":0,"type":"integer"},"last_indexed_block":{"description":"Latest indexed block used to compute this vault state.","internalType":"bigint","type":"string"},"share_price_ray":{"description":"Normalized share price scaled by RAY (1e27): one whole share token quoted in whole underlying tokens.","internalType":"bigint","nullable":true,"type":"string"},"total_assets":{"description":"Total value of vault holdings, in underlying token units.","internalType":"bigint","type":"string"},"total_supply":{"description":"Vault shares total supply.","internalType":"bigint","type":"string"},"withdrawable_assets":{"description":"Liquidity available from the liquidity adapter plus idle assets.","internalType":"bigint","type":"string"}},"required":["chain_id","address","last_indexed_block","last_accrual_timestamp","total_assets","total_supply","withdrawable_assets","allocated_assets","idle_assets","share_price_ray"],"type":"object"}},"required":["data"],"type":"object"},"VaultV2WithdrawalOptionsResponse":{"properties":{"data":{"description":"Vault V2 withdrawal options.","properties":{"adapter_penalties":{"description":"One force-deallocation option per active adapter.","items":{"properties":{"adapter_address":{"description":"Vault V2 adapter address.","type":"string"},"adapter_kind":{"description":"Resolved adapter kind.","enum":["blue_market_adapter","vault_v1_adapter","vault_v2_adapter","unknown_adapter"],"type":"string"},"force_deallocatable_assets":{"description":"Assets that can currently be force-deallocated from this adapter, in underlying token units.","internalType":"bigint","type":"string"},"penalty_rate_wad":{"description":"Force-deallocation penalty rate for this adapter, scaled by WAD (1e18).","internalType":"bigint","type":"string"}},"required":["adapter_address","adapter_kind","force_deallocatable_assets","penalty_rate_wad"],"type":"object"},"type":"array"},"chain_id":{"description":"EVM chain identifier.","exclusiveMinimum":true,"minimum":0,"type":"integer"},"idle_assets":{"description":"Assets held idle by the vault and immediately withdrawable.","internalType":"bigint","type":"string"},"liquidity_adapter_available_assets":{"description":"Assets currently withdrawable through the configured liquidity adapter, excluding idle assets.","internalType":"bigint","type":"string"},"vault_address":{"description":"Vault V2 contract address.","type":"string"}},"required":["chain_id","vault_address","liquidity_adapter_available_assets","idle_assets","adapter_penalties"],"type":"object"}},"required":["data"],"type":"object"},"TransactionsResponse":{"type":"object","properties":{"cursor":{"description":"Opaque cursor for the next page, or null when there is none.","type":"string","nullable":true},"data":{"type":"array","items":{"oneOf":[{"$ref":"#/components/schemas/TransactionBorrow"},{"$ref":"#/components/schemas/TransactionLend"},{"$ref":"#/components/schemas/TransactionExitLendPrimary"},{"$ref":"#/components/schemas/TransactionExitLendSecondary"},{"$ref":"#/components/schemas/TransactionExitBorrowPrimary"},{"$ref":"#/components/schemas/TransactionExitBorrowSecondary"},{"$ref":"#/components/schemas/TransactionPartialLiquidation"},{"$ref":"#/components/schemas/TransactionFullLiquidation"},{"$ref":"#/components/schemas/TransactionWithdrawCollateral"},{"$ref":"#/components/schemas/TransactionSupplyCollateral"},{"$ref":"#/components/schemas/TransactionRoll"}],"discriminator":{"propertyName":"event_type","mapping":{"borrow":"#/components/schemas/TransactionBorrow","lend":"#/components/schemas/TransactionLend","exit_lend_primary":"#/components/schemas/TransactionExitLendPrimary","exit_lend_secondary":"#/components/schemas/TransactionExitLendSecondary","exit_borrow_primary":"#/components/schemas/TransactionExitBorrowPrimary","exit_borrow_secondary":"#/components/schemas/TransactionExitBorrowSecondary","partial_liquidation":"#/components/schemas/TransactionPartialLiquidation","full_liquidation":"#/components/schemas/TransactionFullLiquidation","withdraw_collateral":"#/components/schemas/TransactionWithdrawCollateral","supply_collateral":"#/components/schemas/TransactionSupplyCollateral","roll":"#/components/schemas/TransactionRoll"}}},"description":"Page of returned items."}},"required":["cursor","data"]},"MidnightErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","UNPROCESSABLE_ENTITY","TOO_MANY_REQUESTS","INTERNAL_ERROR","BAD_GATEWAY","SERVICE_UNAVAILABLE","GATEWAY_TIMEOUT","INVALID_CURSOR","MARKET_NOT_FOUND","VALIDATION_FAILED"],"description":"Stable, machine-readable error code."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"}]},"description":"Request field path for the issue. Empty when the issue is not tied to a specific field."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context. Null when the error has no field-level details.","nullable":true},"request_id":{"type":"string","description":"Server-assigned request id, echoed via the `X-Request-Id` response header."}},"required":["code","message","details","request_id"]}},"required":["error"]},"MarketsResponse":{"type":"object","properties":{"cursor":{"description":"Opaque cursor for the next page, or null when there is none.","type":"string","nullable":true},"data":{"type":"array","items":{"type":"object","properties":{"chain_id":{"type":"number","description":"Chain id where the market exists."},"market_id":{"type":"string","description":"Globally unique Midnight market id."},"market_family_id":{"description":"Stable identifier shared by Midnight markets that differ only by maturity.","type":"string"},"loan_token":{"description":"Loan token address.","type":"string"},"maturity":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Maturity timestamp in unix seconds."},"rcf_threshold":{"type":"string","internalType":"bigint","description":"Recovery close factor threshold."},"enter_gate":{"description":"Enter gate address.","type":"string"},"liquidator_gate":{"description":"Liquidator gate address.","type":"string"},"total_units":{"type":"string","internalType":"bigint","description":"Current total units."},"tick_granularity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Offer tick granularity for this market. Valid offer ticks are multiples of this value."},"settlement_fee_schedule":{"minItems":7,"maxItems":7,"type":"array","items":{"type":"object","properties":{"time_to_maturity_days":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Settlement fee breakpoint time to maturity, in days."},"fee_cbp":{"type":"string","internalType":"bigint","description":"Settlement fee at this breakpoint, in cbp (1 cbp = 1e-6 WAD = 0.01 bps)."}},"required":["time_to_maturity_days","fee_cbp"]},"description":"Settlement fee schedule at [0d, 1d, 7d, 30d, 90d, 180d, 360d] time-to-maturity breakpoints."},"current_settlement_fee_wad":{"type":"string","internalType":"bigint","description":"Current settlement fee, WAD-scaled, based on time to maturity."},"current_settlement_fee_cbp":{"type":"string","pattern":"^\\d+(\\.\\d+)?$","description":"Current settlement fee in cbp. May include decimals because the current fee is interpolated."},"continuous_fee_rate":{"type":"string","internalType":"bigint","description":"Per-second continuous fee rate, WAD-scaled."},"listed":{"type":"boolean","description":"Whether this market is surfaced by the app trust layer (curated listing)."},"lend_depth":{"type":"string","internalType":"bigint","description":"Cached lend-side order-book depth in loan-token units (sum of bid level assets). Null until first Router sync, or once the market has matured.","nullable":true},"borrow_depth":{"type":"string","internalType":"bigint","description":"Cached borrow-side order-book depth in loan-token units (sum of ask level assets). Null until first Router sync, or once the market has matured.","nullable":true},"collaterals":{"type":"array","items":{"type":"object","properties":{"token":{"description":"Collateral token address.","type":"string"},"lltv":{"type":"string","internalType":"bigint","description":"Liquidation loan-to-value for this collateral, WAD-scaled."},"liquidation_cursor":{"type":"string","internalType":"bigint","description":"Liquidation cursor for this collateral, WAD-scaled."},"oracle":{"description":"Oracle address used for this collateral.","type":"string"}},"required":["token","lltv","liquidation_cursor","oracle"]},"description":"Collateral configuration for the market."}},"required":["chain_id","market_id","market_family_id","loan_token","maturity","rcf_threshold","enter_gate","liquidator_gate","total_units","tick_granularity","settlement_fee_schedule","current_settlement_fee_wad","current_settlement_fee_cbp","continuous_fee_rate","listed","lend_depth","borrow_depth","collaterals"]},"description":"Page of returned items."}},"required":["cursor","data"]},"MarketDetailResponse":{"type":"object","properties":{"data":{"type":"object","properties":{"chain_id":{"type":"number","description":"Chain id where the market exists."},"market_id":{"type":"string","description":"Globally unique Midnight market id."},"market_family_id":{"description":"Stable identifier shared by Midnight markets that differ only by maturity.","type":"string"},"loan_token":{"description":"Loan token address.","type":"string"},"maturity":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Maturity timestamp in unix seconds."},"rcf_threshold":{"type":"string","internalType":"bigint","description":"Recovery close factor threshold."},"enter_gate":{"description":"Enter gate address.","type":"string"},"liquidator_gate":{"description":"Liquidator gate address.","type":"string"},"collaterals":{"type":"array","items":{"type":"object","properties":{"token":{"description":"Collateral token address.","type":"string"},"lltv":{"type":"string","internalType":"bigint","description":"Liquidation loan-to-value for this collateral, WAD-scaled."},"liquidation_cursor":{"type":"string","internalType":"bigint","description":"Liquidation cursor for this collateral, WAD-scaled."},"oracle":{"description":"Oracle address used for this collateral.","type":"string"}},"required":["token","lltv","liquidation_cursor","oracle"]},"description":"Collateral configuration for the market."}},"required":["chain_id","market_id","market_family_id","loan_token","maturity","rcf_threshold","enter_gate","liquidator_gate","collaterals"],"description":"Midnight market configuration payload."}},"required":["data"]},"PositionsResponse":{"type":"object","properties":{"cursor":{"description":"Opaque cursor for the next page, or null when there is none.","type":"string","nullable":true},"data":{"type":"array","items":{"type":"object","properties":{"chain_id":{"type":"number","description":"Chain id where the position exists."},"market_id":{"type":"string","description":"Midnight market id."},"user_address":{"description":"User address.","type":"string"},"loan_token":{"description":"Loan token address.","type":"string"},"maturity":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Maturity timestamp in unix seconds."},"credit":{"type":"string","internalType":"bigint","description":"Current credit amount."},"pending_fee":{"type":"string","internalType":"bigint","description":"Current pending fee amount."},"last_loss_factor":{"type":"string","internalType":"bigint","description":"Loss factor last applied to this position."},"loss_factor":{"type":"string","internalType":"bigint","description":"Market loss factor."},"debt":{"type":"string","internalType":"bigint","description":"Current debt amount."},"cost_basis":{"type":"string","internalType":"bigint","description":"Cost basis in loan-token units, WAD-scaled, when available.","nullable":true},"effective_rate_wad":{"type":"string","internalType":"bigint","description":"Deprecated: use `effective_apr`. Annualized compounded effective rate (IRR+) using a 365.25-day year, WAD-scaled, when available.","deprecated":true,"nullable":true},"effective_apr":{"type":"number","maximum":10,"description":"Annualized simple effective rate using a 365-day year, as a decimal fraction capped at 10, derived from persisted open lots when available.","nullable":true},"collaterals":{"type":"array","items":{"type":"object","properties":{"token":{"description":"Collateral token address.","type":"string"},"amount":{"type":"string","internalType":"bigint","description":"Collateral amount for this token."}},"required":["token","amount"]},"description":"Collateral balances for the position."},"created_at":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Timestamp when the user first acquired a position in this market, in unix seconds."},"type":{"type":"string","enum":["lend","borrow","collateral_only"],"description":"Position type."}},"required":["chain_id","market_id","user_address","loan_token","maturity","credit","pending_fee","last_loss_factor","loss_factor","debt","cost_basis","effective_rate_wad","effective_apr","collaterals","created_at","type"]},"description":"Page of returned items."}},"required":["cursor","data"]},"PositionDetailResponse":{"type":"object","properties":{"data":{"type":"object","properties":{"chain_id":{"type":"number","description":"Chain id where the position exists."},"market_id":{"type":"string","description":"Midnight market id."},"user_address":{"description":"User address.","type":"string"},"loan_token":{"description":"Loan token address.","type":"string"},"maturity":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Maturity timestamp in unix seconds."},"credit":{"type":"string","internalType":"bigint","description":"Current credit amount."},"pending_fee":{"type":"string","internalType":"bigint","description":"Current pending fee amount."},"last_loss_factor":{"type":"string","internalType":"bigint","description":"Loss factor last applied to this position."},"loss_factor":{"type":"string","internalType":"bigint","description":"Market loss factor."},"debt":{"type":"string","internalType":"bigint","description":"Current debt amount."},"collaterals":{"type":"array","items":{"type":"object","properties":{"token":{"description":"Collateral token address.","type":"string"},"amount":{"type":"string","internalType":"bigint","description":"Collateral amount for this token."}},"required":["token","amount"]},"description":"Collateral balances for the position."},"type":{"type":"string","enum":["lend","borrow","collateral_only",null],"description":"Position type, or null when the position has zero credit, zero debt, and no remaining collateral.","nullable":true},"last_indexed_block":{"type":"string","internalType":"bigint","description":"Latest block covered by the API when this position payload was computed."}},"required":["chain_id","market_id","user_address","loan_token","maturity","credit","pending_fee","last_loss_factor","loss_factor","debt","collaterals","type","last_indexed_block"],"description":"Position payload. Positions with zero balances are returned with null type."}},"required":["data"]},"PositionPerformanceResponse":{"type":"object","properties":{"data":{"type":"object","properties":{"chain_id":{"type":"number","description":"Chain id where the position exists."},"market_id":{"type":"string","description":"Midnight market id."},"user_address":{"description":"User address.","type":"string"},"type":{"type":"string","enum":["lend","borrow","collateral_only",null],"description":"Position type, or null when the position has zero credit, zero debt, and no remaining collateral.","nullable":true},"cost_basis":{"type":"string","internalType":"bigint","description":"Cost basis in loan-token units, WAD-scaled, when available.","nullable":true},"effective_rate_wad":{"type":"string","internalType":"bigint","description":"Deprecated: use `effective_apr`. Annualized compounded effective rate (IRR+) using a 365.25-day year, WAD-scaled, when available.","deprecated":true,"nullable":true},"effective_apr":{"type":"number","maximum":10,"description":"Annualized simple effective rate using a 365-day year, as a decimal fraction capped at 10, derived from persisted open lots when available.","nullable":true},"last_indexed_block":{"type":"string","internalType":"bigint","description":"Latest block covered by the API when this position payload was computed."},"accounting_method":{"type":"string","description":"Accounting method used to compute cost basis.","enum":["average_cost"]}},"required":["chain_id","market_id","user_address","type","cost_basis","effective_rate_wad","effective_apr","last_indexed_block","accounting_method"],"description":"Position performance payload. Positions with zero balances are returned with null type and null analytics."}},"required":["data"]},"OfferGroupsResponse":{"type":"object","properties":{"cursor":{"description":"Opaque cursor for the next page, or null when there is none.","type":"string","nullable":true},"data":{"type":"array","items":{"type":"object","properties":{"id":{"description":"Offer group id.","type":"string"},"chain_id":{"type":"number","description":"Chain id where the group exists."},"status":{"type":"string","enum":["scheduled","active","filled","expired","cancelled"],"description":"Current lifecycle status derived from every latest offer in the group. A SetConsumed(type(uint128).max) sentinel cancels the entire group first. CancelRoot permanently cancels only legs matching its chain, maker, ratifier and encoded root, regardless of event ordering. Active, then scheduled, are determined only from uncancelled legs with remaining capacity. If neither applies, any root-cancelled latest leg makes the group cancelled, ahead of filled and expired."},"type":{"type":"string","enum":["buy","sell_reduce_only","sell","buy_reduce_only",null],"description":"Shared offer intent across the group's status-targeted offers, or null when their buy and reduce-only values are inconsistent.","nullable":true},"created_at":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Timestamp of the first matching status-targeted offer created in this group."},"expiry":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Maximum offer expiry derived from the group's latest offer set. Active and scheduled groups use the not-yet-ended horizon excluding root-cancelled offers; terminal statuses use the complete latest set."},"max_units":{"type":"string","internalType":"bigint","description":"Representative matching offer max units for this group."},"max_assets":{"type":"string","internalType":"bigint","description":"Representative matching offer max assets for this group."},"consumed":{"type":"string","internalType":"bigint","description":"Latest consumed amount for this group."},"callback":{"type":"object","properties":{"type":{"type":"string","description":"Verified callback type.","enum":["blue_buy"]},"callback_address":{"description":"BlueBuyCallback contract address.","type":"string"},"market_id":{"description":"Morpho Blue market id.","type":"string"},"market_params":{"type":"object","properties":{"loan_token":{"description":"Morpho Blue loan token address.","type":"string"},"collateral_token":{"description":"Morpho Blue collateral token address.","type":"string"},"oracle_address":{"description":"Morpho Blue oracle address.","type":"string"},"irm_address":{"description":"Morpho Blue IRM address.","type":"string"},"lltv_wad":{"type":"string","internalType":"bigint","description":"Morpho Blue liquidation loan-to-value, WAD-scaled."}},"required":["loan_token","collateral_token","oracle_address","irm_address","lltv_wad"],"description":"Decoded Morpho Blue market parameters."}},"required":["type","callback_address","market_id","market_params"],"description":"Verified group callback metadata, or null when the latest offer set is empty-callback, malformed, inconsistent, unregistered, registered to another owner, or registered after offer creation.","nullable":true},"offers":{"type":"array","items":{"type":"object","properties":{"market_id":{"description":"Midnight market id.","type":"string"},"market":{"type":"object","properties":{"loan_token":{"description":"Loan token address.","type":"string"},"maturity":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Market maturity timestamp in unix seconds."},"rcf_threshold":{"type":"string","internalType":"bigint","description":"Recovery close factor threshold."},"enter_gate":{"description":"Enter gate address.","type":"string"},"liquidator_gate":{"description":"Liquidator gate address.","type":"string"},"collaterals":{"type":"array","items":{"type":"object","properties":{"token":{"description":"Collateral token address.","type":"string"},"lltv":{"type":"string","internalType":"bigint","description":"Liquidation loan-to-value for this collateral, WAD-scaled."},"liquidation_cursor":{"type":"string","internalType":"bigint","description":"Liquidation cursor for this collateral, WAD-scaled."},"oracle":{"description":"Oracle address used for this collateral.","type":"string"}},"required":["token","lltv","liquidation_cursor","oracle"]},"description":"Collateral configuration used to derive the market id."}},"required":["loan_token","maturity","rcf_threshold","enter_gate","liquidator_gate","collaterals"],"description":"Immutable market configuration used to derive market_id. This is included because market_id is a one-way hash and uncreated markets cannot be decoded from it."},"created_at":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Offer creation block timestamp."},"buy":{"type":"boolean","description":"Whether the offer is a buy offer."},"maker":{"description":"Offer maker address.","type":"string"},"max_units":{"type":"string","internalType":"bigint","description":"Maximum units."},"max_assets":{"type":"string","internalType":"bigint","description":"Maximum assets."},"continuous_fee_cap":{"type":"string","internalType":"bigint","description":"Maximum continuous fee accepted by the maker."},"start":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Offer start timestamp."},"expiry":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Offer expiry timestamp."},"tick":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Offer tick."},"callback":{"description":"Callback address.","type":"string"},"callback_data":{"type":"string","pattern":"^0x[0-9a-fA-F]*$","description":"Callback data."},"receiver_if_maker_is_seller":{"description":"Receiver when the maker is the seller.","type":"string"},"ratifier":{"description":"Offer ratifier address.","type":"string"},"ratifier_data":{"type":"string","pattern":"^0x[0-9a-fA-F]*$","description":"Opaque per-offer ratifier data passed unchanged to Midnight take."},"parsed_ratifier_data":{"oneOf":[{"$ref":"#/components/schemas/ParsedRatifierDataRateV1"},{"$ref":"#/components/schemas/ParsedRatifierDataPriceV1"},{"$ref":"#/components/schemas/ParsedRatifierDataEcrecover"},{"$ref":"#/components/schemas/ParsedRatifierDataSetter"},{"$ref":"#/components/schemas/ParsedRatifierDataAdapter"},{"$ref":"#/components/schemas/ParsedRatifierDataUnknown"},{"$ref":"#/components/schemas/ParsedRatifierDataInvalid"}],"description":"Structured metadata decoded from ratifier_data. The ratifier type is identified by matching ratifier against the chain's known Midnight ratifier deployments, or as adapter for Midnight vault adapter offers; ratifier_data remains the authoritative raw bytes.","discriminator":{"propertyName":"ratifier_type","mapping":{"rate_v1":"#/components/schemas/ParsedRatifierDataRateV1","price_v1":"#/components/schemas/ParsedRatifierDataPriceV1","ecrecover":"#/components/schemas/ParsedRatifierDataEcrecover","setter":"#/components/schemas/ParsedRatifierDataSetter","adapter":"#/components/schemas/ParsedRatifierDataAdapter","unknown":"#/components/schemas/ParsedRatifierDataUnknown","invalid":"#/components/schemas/ParsedRatifierDataInvalid"}}},"reduce_only":{"type":"boolean","description":"Whether the offer is reduce-only."}},"required":["market_id","market","created_at","buy","maker","max_units","max_assets","continuous_fee_cap","start","expiry","tick","callback","callback_data","receiver_if_maker_is_seller","ratifier","ratifier_data","parsed_ratifier_data","reduce_only"]},"description":"Status-targeted latest offers matching the non-market request filters. Group-id lookup returns every latest offer revision regardless of status."}},"required":["id","chain_id","status","type","created_at","expiry","max_units","max_assets","consumed","callback","offers"]},"description":"Page of returned items."}},"required":["cursor","data"]},"OfferGroupsByGroupResponse":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"description":"Offer group id.","type":"string"},"chain_id":{"type":"number","description":"Chain id where the group exists."},"status":{"type":"string","enum":["scheduled","active","filled","expired","cancelled"],"description":"Current lifecycle status derived from every latest offer in the group. A SetConsumed(type(uint128).max) sentinel cancels the entire group first. CancelRoot permanently cancels only legs matching its chain, maker, ratifier and encoded root, regardless of event ordering. Active, then scheduled, are determined only from uncancelled legs with remaining capacity. If neither applies, any root-cancelled latest leg makes the group cancelled, ahead of filled and expired."},"type":{"type":"string","enum":["buy","sell_reduce_only","sell","buy_reduce_only",null],"description":"Shared offer intent across the group's status-targeted offers, or null when their buy and reduce-only values are inconsistent.","nullable":true},"created_at":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Timestamp of the first matching status-targeted offer created in this group."},"expiry":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Maximum offer expiry derived from the group's latest offer set. Active and scheduled groups use the not-yet-ended horizon excluding root-cancelled offers; terminal statuses use the complete latest set."},"max_units":{"type":"string","internalType":"bigint","description":"Representative matching offer max units for this group."},"max_assets":{"type":"string","internalType":"bigint","description":"Representative matching offer max assets for this group."},"consumed":{"type":"string","internalType":"bigint","description":"Latest consumed amount for this group."},"callback":{"type":"object","properties":{"type":{"type":"string","description":"Verified callback type.","enum":["blue_buy"]},"callback_address":{"description":"BlueBuyCallback contract address.","type":"string"},"market_id":{"description":"Morpho Blue market id.","type":"string"},"market_params":{"type":"object","properties":{"loan_token":{"description":"Morpho Blue loan token address.","type":"string"},"collateral_token":{"description":"Morpho Blue collateral token address.","type":"string"},"oracle_address":{"description":"Morpho Blue oracle address.","type":"string"},"irm_address":{"description":"Morpho Blue IRM address.","type":"string"},"lltv_wad":{"type":"string","internalType":"bigint","description":"Morpho Blue liquidation loan-to-value, WAD-scaled."}},"required":["loan_token","collateral_token","oracle_address","irm_address","lltv_wad"],"description":"Decoded Morpho Blue market parameters."}},"required":["type","callback_address","market_id","market_params"],"description":"Verified group callback metadata, or null when the latest offer set is empty-callback, malformed, inconsistent, unregistered, registered to another owner, or registered after offer creation.","nullable":true},"offers":{"type":"array","items":{"type":"object","properties":{"market_id":{"description":"Midnight market id.","type":"string"},"market":{"type":"object","properties":{"loan_token":{"description":"Loan token address.","type":"string"},"maturity":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Market maturity timestamp in unix seconds."},"rcf_threshold":{"type":"string","internalType":"bigint","description":"Recovery close factor threshold."},"enter_gate":{"description":"Enter gate address.","type":"string"},"liquidator_gate":{"description":"Liquidator gate address.","type":"string"},"collaterals":{"type":"array","items":{"type":"object","properties":{"token":{"description":"Collateral token address.","type":"string"},"lltv":{"type":"string","internalType":"bigint","description":"Liquidation loan-to-value for this collateral, WAD-scaled."},"liquidation_cursor":{"type":"string","internalType":"bigint","description":"Liquidation cursor for this collateral, WAD-scaled."},"oracle":{"description":"Oracle address used for this collateral.","type":"string"}},"required":["token","lltv","liquidation_cursor","oracle"]},"description":"Collateral configuration used to derive the market id."}},"required":["loan_token","maturity","rcf_threshold","enter_gate","liquidator_gate","collaterals"],"description":"Immutable market configuration used to derive market_id. This is included because market_id is a one-way hash and uncreated markets cannot be decoded from it."},"created_at":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Offer creation block timestamp."},"buy":{"type":"boolean","description":"Whether the offer is a buy offer."},"maker":{"description":"Offer maker address.","type":"string"},"max_units":{"type":"string","internalType":"bigint","description":"Maximum units."},"max_assets":{"type":"string","internalType":"bigint","description":"Maximum assets."},"continuous_fee_cap":{"type":"string","internalType":"bigint","description":"Maximum continuous fee accepted by the maker."},"start":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Offer start timestamp."},"expiry":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Offer expiry timestamp."},"tick":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Offer tick."},"callback":{"description":"Callback address.","type":"string"},"callback_data":{"type":"string","pattern":"^0x[0-9a-fA-F]*$","description":"Callback data."},"receiver_if_maker_is_seller":{"description":"Receiver when the maker is the seller.","type":"string"},"ratifier":{"description":"Offer ratifier address.","type":"string"},"ratifier_data":{"type":"string","pattern":"^0x[0-9a-fA-F]*$","description":"Opaque per-offer ratifier data passed unchanged to Midnight take."},"parsed_ratifier_data":{"oneOf":[{"$ref":"#/components/schemas/ParsedRatifierDataRateV1"},{"$ref":"#/components/schemas/ParsedRatifierDataPriceV1"},{"$ref":"#/components/schemas/ParsedRatifierDataEcrecover"},{"$ref":"#/components/schemas/ParsedRatifierDataSetter"},{"$ref":"#/components/schemas/ParsedRatifierDataAdapter"},{"$ref":"#/components/schemas/ParsedRatifierDataUnknown"},{"$ref":"#/components/schemas/ParsedRatifierDataInvalid"}],"description":"Structured metadata decoded from ratifier_data. The ratifier type is identified by matching ratifier against the chain's known Midnight ratifier deployments, or as adapter for Midnight vault adapter offers; ratifier_data remains the authoritative raw bytes.","discriminator":{"propertyName":"ratifier_type","mapping":{"rate_v1":"#/components/schemas/ParsedRatifierDataRateV1","price_v1":"#/components/schemas/ParsedRatifierDataPriceV1","ecrecover":"#/components/schemas/ParsedRatifierDataEcrecover","setter":"#/components/schemas/ParsedRatifierDataSetter","adapter":"#/components/schemas/ParsedRatifierDataAdapter","unknown":"#/components/schemas/ParsedRatifierDataUnknown","invalid":"#/components/schemas/ParsedRatifierDataInvalid"}}},"reduce_only":{"type":"boolean","description":"Whether the offer is reduce-only."}},"required":["market_id","market","created_at","buy","maker","max_units","max_assets","continuous_fee_cap","start","expiry","tick","callback","callback_data","receiver_if_maker_is_seller","ratifier","ratifier_data","parsed_ratifier_data","reduce_only"]},"description":"Status-targeted latest offers matching the non-market request filters. Group-id lookup returns every latest offer revision regardless of status."}},"required":["id","chain_id","status","type","created_at","expiry","max_units","max_assets","consumed","callback","offers"]},"description":"Offer groups in any lifecycle state matching the requested onchain group identifier."}},"required":["data"]},"TransactionBorrow":{"type":"object","properties":{"id":{"type":"string","description":"Stable activity id."},"chain_id":{"type":"number","description":"Chain id where the activity happened."},"market_id":{"description":"Midnight market id.","type":"string"},"created_at":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Transaction timestamp in unix seconds."},"tx_hash":{"description":"Transaction hash.","type":"string"},"event_type":{"type":"string","enum":["borrow"]},"data":{"type":"object","properties":{"account":{"type":"string"},"caller":{"type":"string"},"maker":{"type":"string"},"taker":{"type":"string"},"buyer":{"type":"string"},"seller":{"type":"string"},"buyer_assets":{"type":"string","internalType":"bigint","description":"Total loan-token amount paid by the buyer in the trade."},"seller_assets":{"type":"string","internalType":"bigint","description":"Total loan-token amount received by the seller in the trade."},"assets":{"type":"string","internalType":"bigint","description":"Loan-token amount attributed to this transaction item."},"units":{"type":"string","internalType":"bigint","description":"Units attributed to this item."},"take_units":{"type":"string","internalType":"bigint","description":"Total units in the trade."},"buyer_pending_fee_increase":{"type":"string","internalType":"bigint"},"seller_pending_fee_decrease":{"type":"string","internalType":"bigint"},"total_units_delta":{"type":"string","internalType":"bigint"},"payer":{"type":"string"},"receiver":{"type":"string"},"group":{"type":"string"},"consumed":{"type":"string","internalType":"bigint"}},"required":["account","caller","maker","taker","buyer","seller","buyer_assets","seller_assets","assets","units","take_units","buyer_pending_fee_increase","seller_pending_fee_decrease","total_units_delta","payer","receiver","group","consumed"],"description":"Borrow action payload."}},"required":["id","chain_id","market_id","created_at","tx_hash","event_type","data"],"title":"Borrow"},"TransactionLend":{"type":"object","properties":{"id":{"type":"string","description":"Stable activity id."},"chain_id":{"type":"number","description":"Chain id where the activity happened."},"market_id":{"description":"Midnight market id.","type":"string"},"created_at":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Transaction timestamp in unix seconds."},"tx_hash":{"description":"Transaction hash.","type":"string"},"event_type":{"type":"string","enum":["lend"]},"data":{"type":"object","properties":{"account":{"type":"string"},"caller":{"type":"string"},"maker":{"type":"string"},"taker":{"type":"string"},"buyer":{"type":"string"},"seller":{"type":"string"},"buyer_assets":{"type":"string","internalType":"bigint","description":"Total loan-token amount paid by the buyer in the trade."},"seller_assets":{"type":"string","internalType":"bigint","description":"Total loan-token amount received by the seller in the trade."},"assets":{"type":"string","internalType":"bigint","description":"Loan-token amount attributed to this transaction item."},"units":{"type":"string","internalType":"bigint","description":"Units attributed to this item."},"take_units":{"type":"string","internalType":"bigint","description":"Total units in the trade."},"buyer_pending_fee_increase":{"type":"string","internalType":"bigint"},"seller_pending_fee_decrease":{"type":"string","internalType":"bigint"},"total_units_delta":{"type":"string","internalType":"bigint"},"payer":{"type":"string"},"receiver":{"type":"string"},"group":{"type":"string"},"consumed":{"type":"string","internalType":"bigint"}},"required":["account","caller","maker","taker","buyer","seller","buyer_assets","seller_assets","assets","units","take_units","buyer_pending_fee_increase","seller_pending_fee_decrease","total_units_delta","payer","receiver","group","consumed"],"description":"Lend action payload."}},"required":["id","chain_id","market_id","created_at","tx_hash","event_type","data"],"title":"Lend"},"TransactionExitLendPrimary":{"type":"object","properties":{"id":{"type":"string","description":"Stable activity id."},"chain_id":{"type":"number","description":"Chain id where the activity happened."},"market_id":{"description":"Midnight market id.","type":"string"},"created_at":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Transaction timestamp in unix seconds."},"tx_hash":{"description":"Transaction hash.","type":"string"},"event_type":{"type":"string","enum":["exit_lend_primary"]},"data":{"type":"object","properties":{"account":{"type":"string"},"caller":{"type":"string"},"on_behalf":{"type":"string"},"receiver":{"type":"string"},"units":{"type":"string","internalType":"bigint"},"pending_fee_decrease":{"type":"string","internalType":"bigint"}},"required":["account","caller","on_behalf","receiver","units","pending_fee_decrease"],"description":"Primary lend exit payload."}},"required":["id","chain_id","market_id","created_at","tx_hash","event_type","data"],"title":"ExitLendPrimary"},"TransactionExitLendSecondary":{"type":"object","properties":{"id":{"type":"string","description":"Stable activity id."},"chain_id":{"type":"number","description":"Chain id where the activity happened."},"market_id":{"description":"Midnight market id.","type":"string"},"created_at":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Transaction timestamp in unix seconds."},"tx_hash":{"description":"Transaction hash.","type":"string"},"event_type":{"type":"string","enum":["exit_lend_secondary"]},"data":{"type":"object","properties":{"account":{"type":"string"},"caller":{"type":"string"},"maker":{"type":"string"},"taker":{"type":"string"},"buyer":{"type":"string"},"seller":{"type":"string"},"buyer_assets":{"type":"string","internalType":"bigint","description":"Total loan-token amount paid by the buyer in the trade."},"seller_assets":{"type":"string","internalType":"bigint","description":"Total loan-token amount received by the seller in the trade."},"assets":{"type":"string","internalType":"bigint","description":"Loan-token amount attributed to this transaction item."},"units":{"type":"string","internalType":"bigint","description":"Units attributed to this item."},"take_units":{"type":"string","internalType":"bigint","description":"Total units in the trade."},"buyer_pending_fee_increase":{"type":"string","internalType":"bigint"},"seller_pending_fee_decrease":{"type":"string","internalType":"bigint"},"total_units_delta":{"type":"string","internalType":"bigint"},"payer":{"type":"string"},"receiver":{"type":"string"},"group":{"type":"string"},"consumed":{"type":"string","internalType":"bigint"}},"required":["account","caller","maker","taker","buyer","seller","buyer_assets","seller_assets","assets","units","take_units","buyer_pending_fee_increase","seller_pending_fee_decrease","total_units_delta","payer","receiver","group","consumed"],"description":"Secondary lend exit payload."}},"required":["id","chain_id","market_id","created_at","tx_hash","event_type","data"],"title":"ExitLendSecondary"},"TransactionExitBorrowPrimary":{"type":"object","properties":{"id":{"type":"string","description":"Stable activity id."},"chain_id":{"type":"number","description":"Chain id where the activity happened."},"market_id":{"description":"Midnight market id.","type":"string"},"created_at":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Transaction timestamp in unix seconds."},"tx_hash":{"description":"Transaction hash.","type":"string"},"event_type":{"type":"string","enum":["exit_borrow_primary"]},"data":{"type":"object","properties":{"account":{"type":"string"},"caller":{"type":"string"},"on_behalf":{"type":"string"},"units":{"type":"string","internalType":"bigint"},"payer":{"type":"string"}},"required":["account","caller","on_behalf","units","payer"],"description":"Primary borrow exit payload."}},"required":["id","chain_id","market_id","created_at","tx_hash","event_type","data"],"title":"ExitBorrowPrimary"},"TransactionExitBorrowSecondary":{"type":"object","properties":{"id":{"type":"string","description":"Stable activity id."},"chain_id":{"type":"number","description":"Chain id where the activity happened."},"market_id":{"description":"Midnight market id.","type":"string"},"created_at":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Transaction timestamp in unix seconds."},"tx_hash":{"description":"Transaction hash.","type":"string"},"event_type":{"type":"string","enum":["exit_borrow_secondary"]},"data":{"type":"object","properties":{"account":{"type":"string"},"caller":{"type":"string"},"maker":{"type":"string"},"taker":{"type":"string"},"buyer":{"type":"string"},"seller":{"type":"string"},"buyer_assets":{"type":"string","internalType":"bigint","description":"Total loan-token amount paid by the buyer in the trade."},"seller_assets":{"type":"string","internalType":"bigint","description":"Total loan-token amount received by the seller in the trade."},"assets":{"type":"string","internalType":"bigint","description":"Loan-token amount attributed to this transaction item."},"units":{"type":"string","internalType":"bigint","description":"Units attributed to this item."},"take_units":{"type":"string","internalType":"bigint","description":"Total units in the trade."},"buyer_pending_fee_increase":{"type":"string","internalType":"bigint"},"seller_pending_fee_decrease":{"type":"string","internalType":"bigint"},"total_units_delta":{"type":"string","internalType":"bigint"},"payer":{"type":"string"},"receiver":{"type":"string"},"group":{"type":"string"},"consumed":{"type":"string","internalType":"bigint"}},"required":["account","caller","maker","taker","buyer","seller","buyer_assets","seller_assets","assets","units","take_units","buyer_pending_fee_increase","seller_pending_fee_decrease","total_units_delta","payer","receiver","group","consumed"],"description":"Secondary borrow exit payload."}},"required":["id","chain_id","market_id","created_at","tx_hash","event_type","data"],"title":"ExitBorrowSecondary"},"TransactionPartialLiquidation":{"type":"object","properties":{"id":{"type":"string","description":"Stable activity id."},"chain_id":{"type":"number","description":"Chain id where the activity happened."},"market_id":{"description":"Midnight market id.","type":"string"},"created_at":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Transaction timestamp in unix seconds."},"tx_hash":{"description":"Transaction hash.","type":"string"},"event_type":{"type":"string","enum":["partial_liquidation"]},"data":{"type":"object","properties":{"account":{"type":"string"},"caller":{"type":"string"},"borrower":{"type":"string"},"collateral":{"type":"string"},"seized_assets":{"type":"string","internalType":"bigint"},"repaid_units":{"type":"string","internalType":"bigint"},"post_maturity_mode":{"type":"boolean"},"bad_debt":{"type":"string","internalType":"bigint"},"latest_loss_factor":{"type":"string","internalType":"bigint"},"latest_continuous_fee_credit":{"type":"string","internalType":"bigint"},"payer":{"type":"string"},"receiver":{"type":"string"},"pure_bad_debt_realization":{"type":"boolean"}},"required":["account","caller","borrower","collateral","seized_assets","repaid_units","post_maturity_mode","bad_debt","latest_loss_factor","latest_continuous_fee_credit","payer","receiver","pure_bad_debt_realization"],"description":"Partial liquidation payload."}},"required":["id","chain_id","market_id","created_at","tx_hash","event_type","data"],"title":"PartialLiquidation"},"TransactionFullLiquidation":{"type":"object","properties":{"id":{"type":"string","description":"Stable activity id."},"chain_id":{"type":"number","description":"Chain id where the activity happened."},"market_id":{"description":"Midnight market id.","type":"string"},"created_at":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Transaction timestamp in unix seconds."},"tx_hash":{"description":"Transaction hash.","type":"string"},"event_type":{"type":"string","enum":["full_liquidation"]},"data":{"type":"object","properties":{"account":{"type":"string"},"caller":{"type":"string"},"borrower":{"type":"string"},"collateral":{"type":"string"},"seized_assets":{"type":"string","internalType":"bigint"},"repaid_units":{"type":"string","internalType":"bigint"},"post_maturity_mode":{"type":"boolean"},"bad_debt":{"type":"string","internalType":"bigint"},"latest_loss_factor":{"type":"string","internalType":"bigint"},"latest_continuous_fee_credit":{"type":"string","internalType":"bigint"},"payer":{"type":"string"},"receiver":{"type":"string"},"pure_bad_debt_realization":{"type":"boolean"}},"required":["account","caller","borrower","collateral","seized_assets","repaid_units","post_maturity_mode","bad_debt","latest_loss_factor","latest_continuous_fee_credit","payer","receiver","pure_bad_debt_realization"],"description":"Full liquidation payload."}},"required":["id","chain_id","market_id","created_at","tx_hash","event_type","data"],"title":"FullLiquidation"},"TransactionWithdrawCollateral":{"type":"object","properties":{"id":{"type":"string","description":"Stable activity id."},"chain_id":{"type":"number","description":"Chain id where the activity happened."},"market_id":{"description":"Midnight market id.","type":"string"},"created_at":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Transaction timestamp in unix seconds."},"tx_hash":{"description":"Transaction hash.","type":"string"},"event_type":{"type":"string","enum":["withdraw_collateral"]},"data":{"type":"object","properties":{"account":{"type":"string"},"caller":{"type":"string"},"on_behalf":{"type":"string"},"receiver":{"type":"string"},"collateral":{"type":"string"},"assets":{"type":"string","internalType":"bigint"}},"required":["account","caller","on_behalf","receiver","collateral","assets"],"description":"Withdraw collateral payload."}},"required":["id","chain_id","market_id","created_at","tx_hash","event_type","data"],"title":"WithdrawCollateral"},"TransactionSupplyCollateral":{"type":"object","properties":{"id":{"type":"string","description":"Stable activity id."},"chain_id":{"type":"number","description":"Chain id where the activity happened."},"market_id":{"description":"Midnight market id.","type":"string"},"created_at":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Transaction timestamp in unix seconds."},"tx_hash":{"description":"Transaction hash.","type":"string"},"event_type":{"type":"string","enum":["supply_collateral"]},"data":{"type":"object","properties":{"account":{"type":"string"},"caller":{"type":"string"},"on_behalf":{"type":"string"},"collateral":{"type":"string"},"assets":{"type":"string","internalType":"bigint"}},"required":["account","caller","on_behalf","collateral","assets"],"description":"Supply collateral payload."}},"required":["id","chain_id","market_id","created_at","tx_hash","event_type","data"],"title":"SupplyCollateral"},"TransactionRoll":{"type":"object","properties":{"id":{"type":"string","description":"Stable activity id."},"chain_id":{"type":"number","description":"Chain id where the activity happened."},"market_id":{"description":"Midnight market id.","type":"string"},"created_at":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Transaction timestamp in unix seconds."},"tx_hash":{"description":"Transaction hash.","type":"string"},"event_type":{"type":"string","enum":["roll"]},"data":{"type":"object","properties":{"account":{"description":"Borrower whose Midnight debt was rolled into Morpho Blue.","type":"string"},"caller":{"description":"Address that executed the permissionless roll and received the incentive.","type":"string"},"blue_market_id":{"description":"Destination Morpho Blue market id.","type":"string"},"config_id":{"description":"Identifier of the borrower-authorized rolling configuration.","type":"string"},"debt_assets":{"type":"string","internalType":"bigint","description":"Loan-token amount repaid on Midnight and refinanced into Morpho Blue."},"collateral_assets":{"type":"string","internalType":"bigint","description":"Collateral amount moved from Midnight into Morpho Blue."},"incentive_assets":{"type":"string","internalType":"bigint","description":"Loan-token incentive paid to the roll caller and added to the borrower's Blue debt."}},"required":["account","caller","blue_market_id","config_id","debt_assets","collateral_assets","incentive_assets"],"description":"Fallback roll payload."}},"required":["id","chain_id","market_id","created_at","tx_hash","event_type","data"],"title":"Roll"},"ParsedSubRatifierDataRateV1":{"type":"object","properties":{"ratifier_type":{"type":"string","enum":["rate_v1"]},"rate_per_second_wad":{"type":"string","internalType":"bigint","description":"Per-second simple interest rate encoded in ratifier_data, WAD-scaled (1e18 = 100% per second)."},"allowed_taker":{"description":"Only taker allowed to take the offer. The zero address means any taker may take it.","type":"string"}},"required":["ratifier_type","rate_per_second_wad","allowed_taker"],"description":"RateRatifierV1 offer.","title":"RateV1"},"ParsedSubRatifierDataPriceV1":{"type":"object","properties":{"ratifier_type":{"type":"string","enum":["price_v1"]},"allowed_taker":{"description":"Only taker allowed to take the offer. The zero address means any taker may take it.","type":"string"}},"required":["ratifier_type","allowed_taker"],"description":"PriceRatifierV1 offer. The offer-level tick is the ratified price.","title":"PriceV1"},"ParsedSubRatifierDataUnknown":{"type":"object","properties":{"ratifier_type":{"type":"string","enum":["unknown"]}},"required":["ratifier_type"],"description":"Sub-ratifier address is not a known Midnight adapter sub-ratifier deployment.","title":"Unknown"},"ParsedSubRatifierDataInvalid":{"type":"object","properties":{"ratifier_type":{"type":"string","enum":["invalid"]},"expected_ratifier_type":{"type":"string","enum":["rate_v1","price_v1"],"description":"Ratifier type identified from the sub-ratifier address."}},"required":["ratifier_type","expected_ratifier_type"],"description":"Sub-ratifier address is a known adapter sub-ratifier deployment, but its data could not be decoded for its type.","title":"Invalid"},"ParsedRatifierDataRateV1":{"type":"object","properties":{"ratifier_type":{"type":"string","enum":["rate_v1"]},"rate_per_second_wad":{"type":"string","internalType":"bigint","description":"Per-second simple interest rate encoded in ratifier_data, WAD-scaled (1e18 = 100% per second)."},"allowed_taker":{"description":"Only taker allowed to take the offer. The zero address means any taker may take it.","type":"string"}},"required":["ratifier_type","rate_per_second_wad","allowed_taker"],"description":"RateRatifierV1 offer.","title":"RateV1"},"ParsedRatifierDataPriceV1":{"type":"object","properties":{"ratifier_type":{"type":"string","enum":["price_v1"]},"allowed_taker":{"description":"Only taker allowed to take the offer. The zero address means any taker may take it.","type":"string"}},"required":["ratifier_type","allowed_taker"],"description":"PriceRatifierV1 offer. The offer-level tick is the ratified price.","title":"PriceV1"},"ParsedRatifierDataEcrecover":{"type":"object","properties":{"ratifier_type":{"type":"string","enum":["ecrecover"]}},"required":["ratifier_type"],"description":"EcrecoverRatifier offer.","title":"Ecrecover"},"ParsedRatifierDataSetter":{"type":"object","properties":{"ratifier_type":{"type":"string","enum":["setter"]}},"required":["ratifier_type"],"description":"SetterRatifier offer.","title":"Setter"},"ParsedRatifierDataAdapter":{"type":"object","properties":{"ratifier_type":{"type":"string","enum":["adapter"]},"parent_vault":{"description":"Vault V2 the adapter was created for, as registered by the official Midnight adapter factory.","type":"string"},"sub_ratifier":{"description":"Sub-ratifier the adapter delegates ratification to, decoded from ratifier_data.","type":"string"},"parsed_sub_ratifier_data":{"oneOf":[{"$ref":"#/components/schemas/ParsedSubRatifierDataRateV1"},{"$ref":"#/components/schemas/ParsedSubRatifierDataPriceV1"},{"$ref":"#/components/schemas/ParsedSubRatifierDataUnknown"},{"$ref":"#/components/schemas/ParsedSubRatifierDataInvalid"}],"description":"Structured metadata decoded from the sub-ratifier data. The type is identified by matching sub_ratifier against the chain's known Midnight adapter sub-ratifier deployments.","discriminator":{"propertyName":"ratifier_type","mapping":{"rate_v1":"#/components/schemas/ParsedSubRatifierDataRateV1","price_v1":"#/components/schemas/ParsedSubRatifierDataPriceV1","unknown":"#/components/schemas/ParsedSubRatifierDataUnknown","invalid":"#/components/schemas/ParsedSubRatifierDataInvalid"}}}},"required":["ratifier_type","parent_vault","sub_ratifier","parsed_sub_ratifier_data"],"description":"Midnight vault adapter offer: maker, ratifier, and callback are the same address, a sell offer's receiver_if_maker_is_seller is also that address, ratifier_data decodes as abi.encode(sub_ratifier, sub_ratifier_data), the ratifier was created by the chain's current official Midnight adapter factory, and the offer's loan_token is the asset of the adapter's parent vault. The adapter may have been created after the offer was posted.","title":"Adapter"},"ParsedRatifierDataUnknown":{"type":"object","properties":{"ratifier_type":{"type":"string","enum":["unknown"]}},"required":["ratifier_type"],"description":"Ratifier address is not a known Midnight ratifier deployment, and the offer is not a verified Midnight vault adapter offer.","title":"Unknown"},"ParsedRatifierDataInvalid":{"type":"object","properties":{"ratifier_type":{"type":"string","enum":["invalid"]},"expected_ratifier_type":{"type":"string","enum":["rate_v1","price_v1","ecrecover","setter"],"description":"Ratifier type identified from the ratifier address."}},"required":["ratifier_type","expected_ratifier_type"],"description":"Ratifier address is a known deployment, but ratifier_data could not be decoded for its type.","title":"Invalid"},"BookCursorListResponse":{"type":"object","properties":{"cursor":{"type":"string","nullable":true,"example":"eyJzb3J0IjpbImlkIl0sImlkIjoiMHgxMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExIiwiYXNrIjoiMCIsImJpZCI6IjAiLCJtYXR1cml0eSI6MTc2MTkyMjgwMH0","description":"Opaque pagination cursor."},"data":{"type":"array","items":{"$ref":"#/components/schemas/BookMarketResponse"},"description":"Books with market metadata and the top 3 ask/bid levels."}},"required":["cursor","data"]},"BadRequestResponse":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/ErrorResponse"}},"required":["error"]},"ServiceUnavailableResponse":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/ErrorResponse"}},"required":["error"]},"BookDataResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/BookMarketResponse","description":"Book snapshot with market metadata and both sides."}},"required":["data"]},"NotFoundResponse":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/ErrorResponse"}},"required":["error"]},"ListBookPriceLevelResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PriceLevel"},"description":"Book price levels grouped by tick, sorted best first."}},"required":["data"]},"ListBookTakeableOfferResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/BookTakeableOfferResponse"},"description":"Takeable offers for this book side.","example":[{"market_id":"0x25690ae1aee324a005be565f3bcdd16dbf8daf7969b26c181c8b8f467dad9f67","units":"369216000000000000000000","offer":{"market":{"chain_id":8453,"midnight":"0x2F7a3AA739ba5792Ce1b4eA046117f2C0095BCA6","loan_token":"0xC9A9C45C0eB717f8b5F193Af6bAa05A1c0Ac5078","collaterals":[{"token":"0x34Cf890dB685FC536E05652FB41f02090c3fb751","lltv":"860000000000000000","liquidation_cursor":"300000000000000000","oracle":"0x45093658BE7f90B63D7c359e8f408e503c2D9401"}],"maturity":1761922799,"rcf_threshold":"0","enter_gate":"0x0000000000000000000000000000000000000000","liquidator_gate":"0x0000000000000000000000000000000000000000"},"buy":false,"maker":"0x7b093658BE7f90B63D7c359e8f408e503c2D9401","max_units":"369216000000000000000000","start":1761922790,"expiry":1761922799,"tick":495,"group":"0x000000000000000000000000000000000000000000000000000000000008b8f4","callback":"0x0000000000000000000000000000000000000000","callback_data":"0x","receiver_if_maker_is_seller":"0x7b093658BE7f90B63D7c359e8f408e503c2D9401","ratifier":"0x0000000000000000000000000000000000000002","reduce_only":false,"max_assets":"0","continuous_fee_cap":"115792089237316195423570985008687907853269984665640564039457584007913129639935"},"ratifier_data":"0x000000000000000000000000000000000000000000000000000000000000001b12121212121212121212121212121212121212121212121212121212121212123434343434343434343434343434343434343434343434343434343434343434","valid_until":1761922799,"warning":null}]}},"required":["data"]},"QuoteDataResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/QuotePayloadResponse","description":"Quote result and signed takeable-offer instructions.","example":{"average_best_price":"1000000000000000000","average_worst_price":"1000000000000000000","available_assets":"1500000000000000000","available_units":"1500000000000000000","takeable_offers":[{"market_id":"0x25690ae1aee324a005be565f3bcdd16dbf8daf7969b26c181c8b8f467dad9f67","units":"369216000000000000000000","offer":{"market":{"chain_id":8453,"midnight":"0x2F7a3AA739ba5792Ce1b4eA046117f2C0095BCA6","loan_token":"0xC9A9C45C0eB717f8b5F193Af6bAa05A1c0Ac5078","collaterals":[{"token":"0x34Cf890dB685FC536E05652FB41f02090c3fb751","lltv":"860000000000000000","liquidation_cursor":"300000000000000000","oracle":"0x45093658BE7f90B63D7c359e8f408e503c2D9401"}],"maturity":1761922799,"rcf_threshold":"0","enter_gate":"0x0000000000000000000000000000000000000000","liquidator_gate":"0x0000000000000000000000000000000000000000"},"buy":false,"maker":"0x7b093658BE7f90B63D7c359e8f408e503c2D9401","max_units":"369216000000000000000000","start":1761922790,"expiry":1761922799,"tick":495,"group":"0x000000000000000000000000000000000000000000000000000000000008b8f4","callback":"0x0000000000000000000000000000000000000000","callback_data":"0x","receiver_if_maker_is_seller":"0x7b093658BE7f90B63D7c359e8f408e503c2D9401","ratifier":"0x0000000000000000000000000000000000000002","reduce_only":false,"max_assets":"0","continuous_fee_cap":"115792089237316195423570985008687907853269984665640564039457584007913129639935"},"ratifier_data":"0x000000000000000000000000000000000000000000000000000000000000001b12121212121212121212121212121212121212121212121212121212121212123434343434343434343434343434343434343434343434343434343434343434","valid_until":1761922799,"warning":null}]}}},"required":["data"]},"InsufficientLiquidityResponse":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/ErrorResponse"}},"required":["error"]},"ListTakeableOfferResponse":{"type":"object","properties":{"cursor":{"type":"string","nullable":true,"example":"eyJncm91cCI6IjB4MTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMSIsImhhc2giOiIweDIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIiLCJtYXJrZXRJZCI6IjB4MzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMyJ9","description":"Opaque pagination cursor."},"data":{"type":"array","items":{"$ref":"#/components/schemas/TakeableOfferResponse"},"description":"Takeable offers for this maker.","example":[{"market_id":"0x25690ae1aee324a005be565f3bcdd16dbf8daf7969b26c181c8b8f467dad9f67","units":"369216000000000000000000","offer":{"market":{"chain_id":8453,"midnight":"0x2F7a3AA739ba5792Ce1b4eA046117f2C0095BCA6","loan_token":"0xC9A9C45C0eB717f8b5F193Af6bAa05A1c0Ac5078","collaterals":[{"token":"0x34Cf890dB685FC536E05652FB41f02090c3fb751","lltv":"860000000000000000","liquidation_cursor":"300000000000000000","oracle":"0x45093658BE7f90B63D7c359e8f408e503c2D9401"}],"maturity":1761922799,"rcf_threshold":"0","enter_gate":"0x0000000000000000000000000000000000000000","liquidator_gate":"0x0000000000000000000000000000000000000000"},"buy":false,"maker":"0x7b093658BE7f90B63D7c359e8f408e503c2D9401","max_units":"369216000000000000000000","start":1761922790,"expiry":1761922799,"tick":495,"group":"0x000000000000000000000000000000000000000000000000000000000008b8f4","callback":"0x0000000000000000000000000000000000000000","callback_data":"0x","receiver_if_maker_is_seller":"0x7b093658BE7f90B63D7c359e8f408e503c2D9401","ratifier":"0x0000000000000000000000000000000000000002","reduce_only":false,"max_assets":"0","continuous_fee_cap":"115792089237316195423570985008687907853269984665640564039457584007913129639935"},"ratifier_data":"0x000000000000000000000000000000000000000000000000000000000000001b12121212121212121212121212121212121212121212121212121212121212123434343434343434343434343434343434343434343434343434343434343434","valid_until":1761922799,"warning":null}]}},"required":["cursor","data"]},"ValidationSuccessResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ValidationSuccessDataResponse","description":"Validation result. HTTP 200 can still include issues; check `data.issues`."}},"required":["data"]},"PayloadTooLargeResponse":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/ErrorResponse"}},"required":["error"]},"ValidateMempoolPayloadRequest":{"type":"object","properties":{"chain_id":{"type":"number","description":"Chain ID used for validation rules.","example":1},"payload":{"type":"string","description":"Hex-encoded mempool payload produced by Midnight tooling: version byte, 4-byte big-endian gzip length, then gzip-compressed ABI `(Offer, bytes ratifierData)[]`. Trailing attribution bytes are allowed up to the payload suffix limit.","maxLength":2000002,"example":"0x01000000..."}},"required":["chain_id","payload"]},"ConfigRulesSuccessResponse":{"type":"object","properties":{"cursor":{"type":"string","nullable":true,"example":null},"data":{"type":"array","items":{"$ref":"#/components/schemas/ConfigRulesRuleResponse"},"description":"Rules currently configured in the router.","example":[{"type":"maturity","chain_id":1,"name":"end_of_next_month","timestamp":1764342000},{"type":"loan_token","chain_id":1,"address":"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"},{"type":"loan_collateral","chain_id":8453,"oracle":"0x4429112b3C00b40Cf295db81cfcdE39d7d5ADC1d","lltv":"980000000000000000","description":"A market's loan token may be supplied as its own collateral only when priced by the chain's fixed-price oracle at the loan-collateral LLTV, alongside at least one other collateral"},{"type":"rcf_threshold","chain_id":8453,"loan_token":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","lltv":"770000000000000000","threshold":"2000000000"},{"type":"liquidation_cursor","chain_id":8453,"liquidation_cursor":"300000000000000000"},{"type":"max_lif","chain_id":8453,"lltv":"770000000000000000","liquidation_cursor":"300000000000000000","max_lif":"1074113856068743286"},{"type":"buy_empty_callback","chain_id":1,"description":"Buy offers with empty callbacks are supported"},{"type":"blue_callback","chain_id":8453,"factory":"0x7337f119Eca028bD39E0e543cEf71631D2333425","description":"Buy offers may carry a BlueBuyCallback with canonical Blue market params as callback data; the callback must be registered by the published factory for the offer maker at or before the offer's creation block. Validation checks callback data only; an unregistered callback is rejected after indexing"},{"type":"vault_v2_callback","chain_id":8453,"factory":"0x797f6E11e55Fb115fE548Faa8F07152BA587bbd7","sub_ratifiers":["0x39c01afA4B3f827a0bfAa39cDC4610111f80BABc","0x8e38421bC293339798e9bD0c0a51690675D2f94b"],"description":"Vault, asset, and funding-adapter registration is checked after indexing"},{"type":"min_offer_assets_usd","chain_id":8453,"usd_threshold":"10","description":"Offers must use a loan token with a configured minimum and be at least $10 of it"},{"type":"min_offer_assets","chain_id":8453,"loan_token":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","min_assets":"10001480"},{"type":"payload_frame","chain_id":8453},{"type":"payload_gzip_length","chain_id":8453},{"type":"payload_abi_decode","chain_id":8453},{"type":"empty_payload","chain_id":8453},{"type":"duplicate_offer_hash","chain_id":8453},{"type":"unsupported_chain","chain_id":8453},{"type":"market_chain_mismatch","chain_id":8453},{"type":"nonzero_collateral_token","chain_id":8453},{"type":"collateral_order","chain_id":8453},{"type":"nonzero_oracle","chain_id":8453},{"type":"offer_time_bounds","chain_id":8453},{"type":"buy_zero_receiver_if_maker_is_seller","chain_id":8453},{"type":"payload_version","chain_id":8453,"version":1},{"type":"payload_compression","chain_id":8453,"max_bytes":999739},{"type":"payload_decompression","chain_id":8453,"max_bytes":6000000},{"type":"payload_suffix_too_large","chain_id":8453,"max_bytes":256},{"type":"min_tick","chain_id":1,"min_tick":495},{"type":"max_tick","chain_id":1,"max_tick":6744},{"type":"tick_spacing","chain_id":1,"tick_spacing":4},{"type":"ratifier","chain_id":1,"address":"0x0000000000000000000000000000000000000002"},{"type":"collateral_lltv","chain_id":1,"allowed_lltvs":["385000000000000000","625000000000000000","770000000000000000","860000000000000000","915000000000000000","945000000000000000","965000000000000000","980000000000000000","1000000000000000000"]}]}},"required":["cursor","data"]},"BookMarketResponse":{"type":"object","properties":{"market_id":{"type":"string","example":"0x12590ae1aee324a005be565f3bcdd16dbf8daf7969b26c181c8b8f467dad9f67","description":"Market id (32-byte hex) this book belongs to."},"chain_id":{"type":"number","example":1},"midnight":{"type":"string","example":"0x2F7a3AA739ba5792Ce1b4eA046117f2C0095BCA6","description":"Address of the Midnight contract that owns the market."},"loan_token":{"type":"string","example":"0xC9A9C45C0eB717f8b5F193Af6bAa05A1c0Ac5078"},"collaterals":{"type":"array","items":{"$ref":"#/components/schemas/CollateralResponse"}},"maturity":{"type":"number","example":1761922800},"rcf_threshold":{"type":"string","example":"0"},"enter_gate":{"type":"string","example":"0x0000000000000000000000000000000000000000"},"liquidator_gate":{"type":"string","example":"0x0000000000000000000000000000000000000000"},"asks":{"type":"array","items":{"$ref":"#/components/schemas/PriceLevel"},"description":"Ask levels, sorted best first. List responses include up to the top 3 asks."},"bids":{"type":"array","items":{"$ref":"#/components/schemas/PriceLevel"},"description":"Bid levels, sorted best first. List responses include up to the top 3 bids."}},"required":["market_id","chain_id","midnight","loan_token","collaterals","maturity","rcf_threshold","enter_gate","liquidator_gate","asks","bids"]},"ErrorResponse":{"type":"object","properties":{"code":{"type":"string","enum":["VALIDATION_ERROR","NOT_FOUND","INTERNAL_SERVER_ERROR","BAD_REQUEST","INVALID_PAYLOAD","PAYLOAD_TOO_LARGE","NOT_IMPLEMENTED","SERVICE_UNAVAILABLE","INSUFFICIENT_LIQUIDITY","END_NOT_SETTLED","INVALID_CURSOR"],"example":"VALIDATION_ERROR","description":"Machine-readable error code."},"message":{"type":"string","example":"Limit must be greater than 0.","description":"Human-readable error message."},"details":{"type":"array","items":{},"nullable":true,"example":[{"field":"limit","issue":"Limit must be greater than 0."}],"description":"Array of structured error details, or null when no details are available."},"request_id":{"type":"string","example":"req-123","description":"Request ID to include when reporting the error."}},"required":["code","message","details","request_id"]},"PriceLevel":{"type":"object","properties":{"tick":{"type":"number","example":495,"minimum":0,"maximum":6744},"price":{"type":"string","example":"500000000000000000","description":"Price at this tick (scaled by 1e18)."},"units":{"type":"string","example":"369216000000000000000000","description":"Total executable units at this tick."},"assets":{"type":"string","example":"184608000000000000000000","description":"Total maker-side assets at this tick, using onchain rounding per offer (buy books floor, sell books ceil)."},"count":{"type":"number","example":5}},"required":["tick","price","units","assets","count"]},"BookTakeableOfferResponse":{"type":"object","properties":{"units":{"type":"string","example":"369216000000000000000000","description":"Executable or currently reserved offer size in units."},"offer":{"$ref":"#/components/schemas/OfferDataResponse","example":{"market":{"chain_id":8453,"midnight":"0x2F7a3AA739ba5792Ce1b4eA046117f2C0095BCA6","loan_token":"0xC9A9C45C0eB717f8b5F193Af6bAa05A1c0Ac5078","collaterals":[{"token":"0x34Cf890dB685FC536E05652FB41f02090c3fb751","lltv":"860000000000000000","liquidation_cursor":"300000000000000000","oracle":"0x45093658BE7f90B63D7c359e8f408e503c2D9401"}],"maturity":1761922799,"rcf_threshold":"0","enter_gate":"0x0000000000000000000000000000000000000000","liquidator_gate":"0x0000000000000000000000000000000000000000"},"buy":false,"maker":"0x7b093658BE7f90B63D7c359e8f408e503c2D9401","max_units":"369216000000000000000000","start":1761922790,"expiry":1761922799,"tick":495,"group":"0x000000000000000000000000000000000000000000000000000000000008b8f4","callback":"0x0000000000000000000000000000000000000000","callback_data":"0x","receiver_if_maker_is_seller":"0x7b093658BE7f90B63D7c359e8f408e503c2D9401","ratifier":"0x0000000000000000000000000000000000000002","reduce_only":false,"max_assets":"0","continuous_fee_cap":"115792089237316195423570985008687907853269984665640564039457584007913129639935"}},"ratifier_data":{"type":"string","example":"0x000000000000000000000000000000000000000000000000000000000000001b12121212121212121212121212121212121212121212121212121212121212123434343434343434343434343434343434343434343434343434343434343434","description":"Mandatory data generated by the maker to verify the offer onchain."},"valid_until":{"type":"integer","minimum":0,"example":1761922799,"description":"Inclusive Unix-second bound until which `offer` and `ratifier_data` stay executable as published; never exceeds `offer.expiry`. Refetch after it passes."},"market_id":{"type":"string","example":"0x25690ae1aee324a005be565f3bcdd16dbf8daf7969b26c181c8b8f467dad9f67","description":"Market id (32-byte hex) the offer belongs to."},"warning":{"example":null,"description":"Deprecated: still returned for now, but will become null in a future release and then be removed. Do not rely on it; `units` already is the amount you can take. Quote responses preserve this pre-quote book measurement after clipping. Makers can still see why their offers are limited on `GET /v0/midnight/takeable-offers`.","deprecated":true,"oneOf":[{"$ref":"#/components/schemas/TakeabilityWarningResponse"},{"enum":[null]}]}},"required":["units","offer","ratifier_data","valid_until","market_id","warning"]},"QuotePayloadResponse":{"type":"object","properties":{"average_best_price":{"type":"string","description":"Realized average price for the requested size filled against the returned offers in book order, applying the same per-offer rounding as onchain execution and rounded against the taker, so unit or asset guards derived from it stay executable.","example":"1000000000000000000"},"average_worst_price":{"type":"string","description":"Conservative adverse-placement bound for the requested size across the returned offer caps. It fractionally relaxes full-offer selection at each cap's realized assets-per-unit rate and rounds the boundary against the taker, bounding every combination of full returned caps plus one target-closing partial. It is never more favorable than average_best_price and never echoes the caller's guard or a best-plus-slippage projection. Multiple offers that are all partially consumed after quoting can still require a fresh quote or execution-time minimum/maximum checks.","example":"1000000000000000000"},"available_assets":{"type":"string","description":"Maximum assets available from the returned takeable-offer caps if they remain executable. This can exceed the requested target so bundle execution has fallback liquidity.","example":"1500000000000000000"},"available_units":{"type":"string","description":"Maximum units available from the returned takeable-offer caps if they remain executable. This can exceed the requested target so bundle execution has fallback liquidity.","example":"1500000000000000000"},"takeable_offers":{"type":"array","items":{"$ref":"#/components/schemas/BookTakeableOfferResponse"},"description":"Best-priced signed takeable-offer caps intended for target-aware bundle execution. Each `units` value is the maximum that offer may contribute, not an exact allocation for the requested target; the sum can exceed the requested size so a bundle executor can skip stale offers and still fill the target. If you call Midnight.take directly instead of using target-aware bundle execution, clamp each offer to your remaining target and current takeability, otherwise you may execute more than intended.","example":[{"market_id":"0x25690ae1aee324a005be565f3bcdd16dbf8daf7969b26c181c8b8f467dad9f67","units":"369216000000000000000000","offer":{"market":{"chain_id":8453,"midnight":"0x2F7a3AA739ba5792Ce1b4eA046117f2C0095BCA6","loan_token":"0xC9A9C45C0eB717f8b5F193Af6bAa05A1c0Ac5078","collaterals":[{"token":"0x34Cf890dB685FC536E05652FB41f02090c3fb751","lltv":"860000000000000000","liquidation_cursor":"300000000000000000","oracle":"0x45093658BE7f90B63D7c359e8f408e503c2D9401"}],"maturity":1761922799,"rcf_threshold":"0","enter_gate":"0x0000000000000000000000000000000000000000","liquidator_gate":"0x0000000000000000000000000000000000000000"},"buy":false,"maker":"0x7b093658BE7f90B63D7c359e8f408e503c2D9401","max_units":"369216000000000000000000","start":1761922790,"expiry":1761922799,"tick":495,"group":"0x000000000000000000000000000000000000000000000000000000000008b8f4","callback":"0x0000000000000000000000000000000000000000","callback_data":"0x","receiver_if_maker_is_seller":"0x7b093658BE7f90B63D7c359e8f408e503c2D9401","ratifier":"0x0000000000000000000000000000000000000002","reduce_only":false,"max_assets":"0","continuous_fee_cap":"115792089237316195423570985008687907853269984665640564039457584007913129639935"},"ratifier_data":"0x000000000000000000000000000000000000000000000000000000000000001b12121212121212121212121212121212121212121212121212121212121212123434343434343434343434343434343434343434343434343434343434343434","valid_until":1761922799,"warning":null}]}},"required":["average_best_price","average_worst_price","available_assets","available_units","takeable_offers"]},"TakeableOfferResponse":{"type":"object","properties":{"units":{"type":"string","example":"369216000000000000000000","description":"Executable or currently reserved offer size in units."},"offer":{"$ref":"#/components/schemas/OfferDataResponse","example":{"market":{"chain_id":8453,"midnight":"0x2F7a3AA739ba5792Ce1b4eA046117f2C0095BCA6","loan_token":"0xC9A9C45C0eB717f8b5F193Af6bAa05A1c0Ac5078","collaterals":[{"token":"0x34Cf890dB685FC536E05652FB41f02090c3fb751","lltv":"860000000000000000","liquidation_cursor":"300000000000000000","oracle":"0x45093658BE7f90B63D7c359e8f408e503c2D9401"}],"maturity":1761922799,"rcf_threshold":"0","enter_gate":"0x0000000000000000000000000000000000000000","liquidator_gate":"0x0000000000000000000000000000000000000000"},"buy":false,"maker":"0x7b093658BE7f90B63D7c359e8f408e503c2D9401","max_units":"369216000000000000000000","start":1761922790,"expiry":1761922799,"tick":495,"group":"0x000000000000000000000000000000000000000000000000000000000008b8f4","callback":"0x0000000000000000000000000000000000000000","callback_data":"0x","receiver_if_maker_is_seller":"0x7b093658BE7f90B63D7c359e8f408e503c2D9401","ratifier":"0x0000000000000000000000000000000000000002","reduce_only":false,"max_assets":"0","continuous_fee_cap":"115792089237316195423570985008687907853269984665640564039457584007913129639935"}},"ratifier_data":{"type":"string","example":"0x000000000000000000000000000000000000000000000000000000000000001b12121212121212121212121212121212121212121212121212121212121212123434343434343434343434343434343434343434343434343434343434343434","description":"Mandatory data generated by the maker to verify the offer onchain."},"valid_until":{"type":"integer","minimum":0,"example":1761922799,"description":"Inclusive Unix-second bound until which `offer` and `ratifier_data` stay executable as published; never exceeds `offer.expiry`. Refetch after it passes."},"market_id":{"type":"string","example":"0x25690ae1aee324a005be565f3bcdd16dbf8daf7969b26c181c8b8f467dad9f67","description":"Market id (32-byte hex) the offer belongs to."},"warning":{"example":null,"description":"Primary reason why more of this active offer is not currently takeable. Null when its complete remaining capacity is takeable.","oneOf":[{"$ref":"#/components/schemas/TakeabilityWarningResponse"},{"enum":[null]}]}},"required":["units","offer","ratifier_data","valid_until","market_id","warning"]},"ValidationSuccessDataResponse":{"type":"object","properties":{"issues":{"type":"array","items":{"$ref":"#/components/schemas/ValidationIssueResponse"},"description":"Validation issues. Empty when validation passes. Each rule appears at most once for the whole payload.","example":[{"rule":"min_offer_assets_usd","details":{"loan_token":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","min_assets":"100014791","usd_threshold":"100"}},{"rule":"tick_spacing","details":null}]}},"required":["issues"]},"ConfigRulesRuleResponse":{"type":"object","properties":{"type":{"type":"string","enum":["payload_frame","payload_gzip_length","payload_abi_decode","empty_payload","duplicate_offer_hash","unsupported_chain","market_chain_mismatch","nonzero_collateral_token","collateral_order","nonzero_oracle","offer_time_bounds","buy_zero_receiver_if_maker_is_seller","payload_version","payload_compression","payload_decompression","payload_suffix_too_large","maturity","non_empty_callback","blue_callback","vault_v2_callback","buy_empty_callback","sell_empty_callback","loan_token","loan_collateral","rcf_threshold","collateral_lltv","group_consistency","group_identity","liquidation_cursor","max_lif","max_collaterals","max_offers_per_tree","min_duration","min_offer_assets_usd","min_offer_assets","min_tick","max_tick","tick_spacing","ratifier","mixed_maker","mixed_ratifier","amount_missing","amount_conflict"],"example":"maturity"},"chain_id":{"type":"number","example":1},"name":{"type":"string","enum":["end_of_month","end_of_next_month","end_of_quarter","end_of_next_quarter","end_of_half_year","end_of_next_half_year"],"example":"end_of_next_month"},"timestamp":{"type":"number","example":1764342000},"address":{"type":"string","example":"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"},"usd_threshold":{"type":"string","example":"10"},"min_assets":{"type":"string","description":"Minimum offer size in the loan token's smallest units (`min_offer_assets` rules).","example":"10001480"},"version":{"type":"number","description":"Accepted payload version (`payload_version` rules).","example":1},"max_bytes":{"type":"number","description":"Maximum bytes for the gzip stream (`payload_compression`), decompressed ABI data (`payload_decompression`), or trailing suffix (`payload_suffix_too_large`).","example":999739},"min_tick":{"type":"number","example":495},"max_tick":{"type":"number","example":6744},"tick_spacing":{"type":"number","example":4},"max":{"type":"number","example":128},"oracle":{"type":"string","description":"Fixed-price oracle that must price the loan token when it is supplied as collateral (`loan_collateral` rules).","example":"0x4429112b3C00b40Cf295db81cfcdE39d7d5ADC1d"},"lltv":{"type":"string","description":"LLTV scaled by 1e18: the exact loan-as-collateral LLTV (`loan_collateral`), highest non-loan collateral LLTV (`rcf_threshold`), or collateral LLTV (`max_lif`).","example":"980000000000000000"},"min_seconds":{"type":"number","example":10},"allowed_lltvs":{"type":"array","items":{"type":"string"},"example":["385000000000000000","625000000000000000","770000000000000000","860000000000000000","915000000000000000","945000000000000000","965000000000000000","980000000000000000","1000000000000000000"]},"loan_token":{"type":"string","description":"Loan token for `rcf_threshold` and `min_offer_assets` rules.","example":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913"},"threshold":{"type":"string","description":"Required RCF threshold in the loan token's smallest units (`rcf_threshold` rules). Select by loan token and highest non-loan collateral LLTV; at least one non-loan collateral is required.","example":"2000000000"},"liquidation_cursor":{"type":"string","description":"Required collateral liquidation cursor, scaled by 1e18 (`liquidation_cursor` and `max_lif` rules).","example":"300000000000000000"},"max_lif":{"type":"string","description":"Maximum liquidation incentive factor for this LLTV and cursor, scaled by 1e18 (`max_lif` rules).","example":"1074113856068743286"},"factory":{"type":"string","description":"Factory for `blue_callback` (BlueBuyCallbackFactory) or `vault_v2_callback` (Midnight adapter) rules. For Blue callbacks, call `createBlueBuyCallback(maker, salt)` before submitting; the router serves only callbacks registered to that maker at or before the offer's creation block.","example":"0x7337f119Eca028bD39E0e543cEf71631D2333425"},"sub_ratifiers":{"type":"array","items":{"type":"string"},"description":"Configured Midnight adapter Rate and Price sub-ratifiers.","example":["0x39c01afA4B3f827a0bfAa39cDC4610111f80BABc","0x8e38421bC293339798e9bD0c0a51690675D2f94b"]},"description":{"type":"string","example":"All offers in a submitted batch must share the same maker address"}},"required":["type","chain_id"]},"CollateralResponse":{"type":"object","properties":{"token":{"type":"string","example":"0x34Cf890dB685FC536E05652FB41f02090c3fb751","description":"Collateral token address."},"lltv":{"type":"string","example":"860000000000000000","description":"Liquidation loan-to-value for this collateral, scaled by 1e18."},"liquidation_cursor":{"type":"string","example":"300000000000000000","description":"Liquidation cursor for this collateral, scaled by 1e18. The protocol derives the maximum liquidation incentive factor from it."},"oracle":{"type":"string","example":"0x45093658BE7f90B63D7c359e8f408e503c2D9401","description":"Oracle address used to price this collateral."}},"required":["token","lltv","liquidation_cursor","oracle"]},"OfferDataResponse":{"type":"object","properties":{"market":{"$ref":"#/components/schemas/MarketOfferResponse","example":{"chain_id":8453,"midnight":"0x2F7a3AA739ba5792Ce1b4eA046117f2C0095BCA6","loan_token":"0xC9A9C45C0eB717f8b5F193Af6bAa05A1c0Ac5078","collaterals":[{"token":"0x34Cf890dB685FC536E05652FB41f02090c3fb751","lltv":"860000000000000000","liquidation_cursor":"300000000000000000","oracle":"0x45093658BE7f90B63D7c359e8f408e503c2D9401"}],"maturity":1761922799,"rcf_threshold":"0","enter_gate":"0x0000000000000000000000000000000000000000","liquidator_gate":"0x0000000000000000000000000000000000000000"}},"buy":{"type":"boolean","example":false},"maker":{"type":"string","example":"0x7b093658BE7f90B63D7c359e8f408e503c2D9401"},"max_units":{"type":"string","example":"369216000000000000000000"},"start":{"type":"number","example":1761922790},"expiry":{"type":"number","example":1761922799},"tick":{"type":"number","example":495,"minimum":0,"maximum":6744},"group":{"type":"string","example":"0x000000000000000000000000000000000000000000000000000000000008b8f4"},"callback":{"type":"string","example":"0x0000000000000000000000000000000000000000","description":"Settlement callback address. Use the zero address for empty callbacks. A Blue-backed buy uses a BlueBuyCallback registered to the maker by the chain's factory at or before the offer's creation block; a maker-chosen salt allows multiple callbacks."},"callback_data":{"type":"string","example":"0x","description":"Settlement callback data. Use `0x` for empty callbacks. A Blue-backed buy uses the exact 160-byte ABI encoding of Morpho Blue `MarketParams` (`loanToken`, `collateralToken`, `oracle`, `irm`, `lltv`); `loanToken` must match the offer market."},"receiver_if_maker_is_seller":{"type":"string","example":"0x7b093658BE7f90B63D7c359e8f408e503c2D9401"},"ratifier":{"type":"string","example":"0x0000000000000000000000000000000000000002"},"reduce_only":{"type":"boolean","example":false},"max_assets":{"type":"string","example":"0"},"continuous_fee_cap":{"type":"string","description":"Maximum market continuous fee the maker accepts; the offer is not takeable while the market continuous fee exceeds it. Decimal uint256 string.","example":"115792089237316195423570985008687907853269984665640564039457584007913129639935"}},"required":["market","buy","maker","max_units","start","expiry","tick","group","callback","callback_data","receiver_if_maker_is_seller","ratifier","reduce_only","max_assets","continuous_fee_cap"]},"TakeabilityWarningResponse":{"description":"Primary warning discriminated by its machine-readable code.","oneOf":[{"type":"object","description":"The maker's loan-token approval cannot back more units.","additionalProperties":false,"properties":{"code":{"type":"string","enum":["MAKER_ALLOWANCE"],"example":"MAKER_ALLOWANCE"}},"required":["code"]},{"type":"object","description":"Maker-controlled funds cannot back more units.","additionalProperties":false,"properties":{"code":{"type":"string","enum":["MAKER_LIQUIDITY"],"example":"MAKER_LIQUIDITY"}},"required":["code"]},{"type":"object","description":"The underlying protocol cannot currently release more liquidity.","additionalProperties":false,"properties":{"code":{"type":"string","enum":["SOURCE_LIQUIDITY"],"example":"SOURCE_LIQUIDITY"}},"required":["code"]},{"type":"object","description":"More units would increase rather than reduce the maker's position.","additionalProperties":false,"properties":{"code":{"type":"string","enum":["REDUCE_ONLY"],"example":"REDUCE_ONLY"}},"required":["code"]},{"type":"object","description":"The maker's credit or debt position has no room for more units.","additionalProperties":false,"properties":{"code":{"type":"string","enum":["POSITION_CAPACITY"],"example":"POSITION_CAPACITY"}},"required":["code"]},{"type":"object","description":"Asset and unit rounding prevents another meaningful unit from executing.","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AMOUNT_ROUNDING"],"example":"AMOUNT_ROUNDING"}},"required":["code"]},{"type":"object","description":"The callback was not registered to the maker at or before the offer's creation block.","additionalProperties":false,"properties":{"code":{"type":"string","enum":["CALLBACK_NOT_REGISTERED"],"example":"CALLBACK_NOT_REGISTERED"}},"required":["code"]},{"type":"object","description":"The maker does not currently authorize the offer's ratifier.","additionalProperties":false,"properties":{"code":{"type":"string","enum":["RATIFIER_NOT_AUTHORIZED"],"example":"RATIFIER_NOT_AUTHORIZED"}},"required":["code"]},{"type":"object","description":"Router simulation failed for the offer's group and market.","additionalProperties":false,"properties":{"code":{"type":"string","enum":["SIMULATION_FAILED"],"example":"SIMULATION_FAILED"}},"required":["code"]},{"type":"object","description":"The offer is reserved for a specific taker and cannot be taken publicly.","additionalProperties":false,"properties":{"code":{"type":"string","enum":["RESTRICTED_TAKER"],"example":"RESTRICTED_TAKER"}},"required":["code"]},{"type":"object","description":"The offer exceeds the maximum units allowed in one take.","additionalProperties":false,"properties":{"code":{"type":"string","enum":["SINGLE_TAKE_LIMIT"],"example":"SINGLE_TAKE_LIMIT"},"limit_units":{"type":"string","pattern":"^\\d+$","description":"Maximum units allowed in one take.","deprecated":true}},"required":["code","limit_units"]},{"type":"object","description":"The offer's Ecrecover Merkle root was permanently canceled.","additionalProperties":false,"properties":{"code":{"type":"string","enum":["ROOT_CANCELED"],"example":"ROOT_CANCELED"},"root":{"type":"string","pattern":"^0x[0-9a-fA-F]{64}$","description":"Canceled Ecrecover Merkle root.","deprecated":true}},"required":["code","root"]},{"type":"object","description":"The maker has not currently ratified the offer's Setter Merkle root.","additionalProperties":false,"properties":{"code":{"type":"string","enum":["ROOT_NOT_RATIFIED"],"example":"ROOT_NOT_RATIFIED"},"root":{"type":"string","pattern":"^0x[0-9a-fA-F]{64}$","description":"Setter Merkle root the maker has not currently ratified.","deprecated":true}},"required":["code","root"]},{"type":"object","description":"The maker does not currently authorize the offer tree's signer.","additionalProperties":false,"properties":{"code":{"type":"string","enum":["SIGNER_NOT_AUTHORIZED"],"example":"SIGNER_NOT_AUTHORIZED"},"signer":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Tree signer the maker has not authorized.","deprecated":true}},"required":["code","signer"]},{"type":"object","description":"The offer was removed after its supported size fell below policy minimum.","additionalProperties":false,"properties":{"code":{"type":"string","enum":["BELOW_MINIMUM_SIZE"],"example":"BELOW_MINIMUM_SIZE"},"observed_assets":{"type":"string","pattern":"^\\d+$","description":"Assets measured when the offer was removed.","deprecated":true},"minimum_assets":{"type":"string","pattern":"^\\d+$","description":"Required minimum assets.","deprecated":true}},"required":["code","observed_assets","minimum_assets"]},{"type":"object","description":"A Vault V2 Midnight adapter permission required to execute the offer is missing, disabled, or not indexed yet.","additionalProperties":false,"properties":{"code":{"type":"string","enum":["VAULT_PERMISSION_MISSING"],"example":"VAULT_PERMISSION_MISSING"},"permission":{"type":"string","enum":["subRatifier","adapter","allocator","fundingAdapter"],"description":"First missing Vault V2 permission required by the offer.","deprecated":true}},"required":["code","permission"]},{"type":"object","description":"The market time to maturity exceeds the adapter's indexed maximum.","additionalProperties":false,"properties":{"code":{"type":"string","enum":["ADAPTER_MAX_TTM_EXCEEDED"],"example":"ADAPTER_MAX_TTM_EXCEEDED"},"max_ttm":{"type":"string","pattern":"^\\d+$","description":"Adapter maximum time to maturity in seconds.","deprecated":true},"ttm":{"type":"string","pattern":"^\\d+$","description":"Market maturity minus canonical tip timestamp, in seconds.","deprecated":true}},"required":["code","max_ttm","ttm"]}],"discriminator":{"propertyName":"code"}},"ValidationIssueResponse":{"type":"object","properties":{"rule":{"type":"string","example":"amount_conflict","description":"Machine-readable issue name. See the validate endpoint description for meanings."},"details":{"example":null,"description":"First below-minimum loan token and configured floor for `min_offer_assets_usd`. Otherwise null.","oneOf":[{"$ref":"#/components/schemas/MinOfferAssetsUsdIssueDetailsResponse"},{"enum":[null]}]}},"required":["rule","details"],"description":"A validation issue discriminated by its machine-readable rule.","oneOf":[{"$ref":"#/components/schemas/MinOfferAssetsUsdValidationIssueResponse"},{"$ref":"#/components/schemas/ValidationIssueWithoutDetailsResponse"}],"discriminator":{"propertyName":"rule","mapping":{"min_offer_assets_usd":"#/components/schemas/MinOfferAssetsUsdValidationIssueResponse","payload_version":"#/components/schemas/ValidationIssueWithoutDetailsResponse","payload_frame":"#/components/schemas/ValidationIssueWithoutDetailsResponse","payload_gzip_length":"#/components/schemas/ValidationIssueWithoutDetailsResponse","payload_suffix_too_large":"#/components/schemas/ValidationIssueWithoutDetailsResponse","payload_decompression":"#/components/schemas/ValidationIssueWithoutDetailsResponse","payload_abi_decode":"#/components/schemas/ValidationIssueWithoutDetailsResponse","empty_payload":"#/components/schemas/ValidationIssueWithoutDetailsResponse","max_offers_per_tree":"#/components/schemas/ValidationIssueWithoutDetailsResponse","duplicate_offer_hash":"#/components/schemas/ValidationIssueWithoutDetailsResponse","unsupported_chain":"#/components/schemas/ValidationIssueWithoutDetailsResponse","market_chain_mismatch":"#/components/schemas/ValidationIssueWithoutDetailsResponse","maturity":"#/components/schemas/ValidationIssueWithoutDetailsResponse","loan_token":"#/components/schemas/ValidationIssueWithoutDetailsResponse","collateral_token":"#/components/schemas/ValidationIssueWithoutDetailsResponse","oracle":"#/components/schemas/ValidationIssueWithoutDetailsResponse","loan_collateral":"#/components/schemas/ValidationIssueWithoutDetailsResponse","rcf_threshold":"#/components/schemas/ValidationIssueWithoutDetailsResponse","collateral_lltv":"#/components/schemas/ValidationIssueWithoutDetailsResponse","max_lif":"#/components/schemas/ValidationIssueWithoutDetailsResponse","max_collaterals":"#/components/schemas/ValidationIssueWithoutDetailsResponse","amount_missing":"#/components/schemas/ValidationIssueWithoutDetailsResponse","amount_conflict":"#/components/schemas/ValidationIssueWithoutDetailsResponse","min_tick":"#/components/schemas/ValidationIssueWithoutDetailsResponse","max_tick":"#/components/schemas/ValidationIssueWithoutDetailsResponse","tick_spacing":"#/components/schemas/ValidationIssueWithoutDetailsResponse","min_duration":"#/components/schemas/ValidationIssueWithoutDetailsResponse","ratifier":"#/components/schemas/ValidationIssueWithoutDetailsResponse","mixed_maker":"#/components/schemas/ValidationIssueWithoutDetailsResponse","mixed_ratifier":"#/components/schemas/ValidationIssueWithoutDetailsResponse","group_identity":"#/components/schemas/ValidationIssueWithoutDetailsResponse","group_consistency":"#/components/schemas/ValidationIssueWithoutDetailsResponse","non_empty_callback":"#/components/schemas/ValidationIssueWithoutDetailsResponse","blue_callback":"#/components/schemas/ValidationIssueWithoutDetailsResponse","vault_v2_callback":"#/components/schemas/ValidationIssueWithoutDetailsResponse","buy_empty_callback":"#/components/schemas/ValidationIssueWithoutDetailsResponse","sell_empty_callback":"#/components/schemas/ValidationIssueWithoutDetailsResponse"}}},"MarketOfferResponse":{"type":"object","properties":{"chain_id":{"type":"number","example":8453,"description":"EVM chain id the market lives on."},"midnight":{"type":"string","example":"0x2F7a3AA739ba5792Ce1b4eA046117f2C0095BCA6","description":"Address of the Midnight contract that owns the market."},"loan_token":{"type":"string","example":"0xC9A9C45C0eB717f8b5F193Af6bAa05A1c0Ac5078"},"collaterals":{"type":"array","items":{"$ref":"#/components/schemas/CollateralResponse"},"example":[{"token":"0x34Cf890dB685FC536E05652FB41f02090c3fb751","lltv":"860000000000000000","liquidation_cursor":"300000000000000000","oracle":"0x45093658BE7f90B63D7c359e8f408e503c2D9401"}]},"maturity":{"type":"number","example":1761922799},"rcf_threshold":{"type":"string","example":"0"},"enter_gate":{"type":"string","example":"0x0000000000000000000000000000000000000000"},"liquidator_gate":{"type":"string","example":"0x0000000000000000000000000000000000000000"}},"required":["chain_id","midnight","loan_token","collaterals","maturity","rcf_threshold","enter_gate","liquidator_gate"]},"MinOfferAssetsUsdIssueDetailsResponse":{"type":"object","properties":{"loan_token":{"type":"string","example":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","description":"Loan token of the first offer below its configured minimum."},"min_assets":{"type":"string","example":"100014791","description":"Configured minimum in raw loan-token assets."},"usd_threshold":{"type":"string","pattern":"^(0|[1-9]\\d*)(\\.\\d+)?$","example":"100","description":"Configured USD minimum."}},"required":["loan_token","min_assets","usd_threshold"]},"MinOfferAssetsUsdValidationIssueResponse":{"type":"object","description":"An offer is below the configured minimum for its loan token.","properties":{"rule":{"type":"string","enum":["min_offer_assets_usd"],"example":"min_offer_assets_usd"},"details":{"$ref":"#/components/schemas/MinOfferAssetsUsdIssueDetailsResponse"}},"required":["rule","details"]},"ValidationIssueWithoutDetailsResponse":{"type":"object","description":"A validation issue without additional remediation details.","properties":{"rule":{"type":"string","enum":["payload_version","payload_frame","payload_gzip_length","payload_suffix_too_large","payload_decompression","payload_abi_decode","empty_payload","max_offers_per_tree","duplicate_offer_hash","unsupported_chain","market_chain_mismatch","maturity","loan_token","collateral_token","oracle","loan_collateral","rcf_threshold","collateral_lltv","max_lif","max_collaterals","amount_missing","amount_conflict","min_tick","max_tick","tick_spacing","min_duration","ratifier","mixed_maker","mixed_ratifier","group_identity","group_consistency","non_empty_callback","blue_callback","vault_v2_callback","buy_empty_callback","sell_empty_callback"],"example":"tick_spacing"},"details":{"enum":[null],"example":null,"description":"No additional details are available for this rule."}},"required":["rule","details"]},"MidnightMarketStateResponse":{"type":"object","properties":{"data":{"type":"object","properties":{"chain_id":{"type":"number","description":"Chain id where the market exists."},"market_id":{"type":"string","description":"Globally unique Midnight market id."},"market_family_id":{"description":"Stable identifier shared by Midnight markets that differ only by maturity.","type":"string"},"last_indexed_block":{"type":"string","internalType":"bigint","description":"Latest block covered by the API when this market state payload was computed."},"total_units":{"type":"string","internalType":"bigint","description":"Current total units."},"tick_granularity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Offer tick granularity for this market. Valid offer ticks are multiples of this value."},"settlement_fee_schedule":{"minItems":7,"maxItems":7,"type":"array","items":{"type":"object","properties":{"time_to_maturity_days":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Settlement fee breakpoint time to maturity, in days."},"fee_cbp":{"type":"string","internalType":"bigint","description":"Settlement fee at this breakpoint, in cbp (1 cbp = 1e-6 WAD = 0.01 bps)."}},"required":["time_to_maturity_days","fee_cbp"]},"description":"Settlement fee schedule at [0d, 1d, 7d, 30d, 90d, 180d, 360d] time-to-maturity breakpoints."},"current_settlement_fee_wad":{"type":"string","internalType":"bigint","description":"Current settlement fee, WAD-scaled, based on time to maturity."},"current_settlement_fee_cbp":{"type":"string","pattern":"^\\d+(\\.\\d+)?$","description":"Current settlement fee in cbp. May include decimals because the current fee is interpolated."},"continuous_fee_rate":{"type":"string","internalType":"bigint","description":"Per-second continuous fee rate, WAD-scaled."}},"required":["chain_id","market_id","market_family_id","last_indexed_block","total_units","tick_granularity","settlement_fee_schedule","current_settlement_fee_wad","current_settlement_fee_cbp","continuous_fee_rate"],"description":"Midnight market dynamic state payload."}},"required":["data"]}},"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"x-api-key"}}},"tags":[{"name":"Transactions","description":"A **Midnight transaction** item is one economic action that changed a market or account. One onchain transaction can appear as multiple API items when it affects more than one side of a trade or more than one account.\n\n### Event types\n\n`borrow`, `lend`, `exit_lend_primary`, `exit_lend_secondary`, `exit_borrow_primary`, `exit_borrow_secondary`, `partial_liquidation`, `full_liquidation`, `withdraw_collateral`, `supply_collateral`, and `roll`.\n\nAdmin, authorization, fee, flashloan, market creation, and accounting-only events are intentionally excluded from v0.\n\n### Amounts\n\nFor trade actions, `data.assets` is the loan-token amount attributed to that API item. `buyer_assets`, `seller_assets`, `take_units`, and `total_units_delta` describe the full trade when present.\n\n### User-scoped transactions\n\n`GET /v0/midnight/users/{user-address}/transactions` matches the affected account, not only the transaction caller: buyer/seller for trades, `on_behalf` for primary exits and collateral actions, borrower for liquidations, and the refinanced borrower for rolls. A roll item identifies the permissionless executor in `data.caller` and the destination Morpho Blue market in `data.blue_market_id`.\n\n### Market-scoped transactions\n\n`GET /v0/midnight/markets/{market-id}/transactions` returns every economic action for that market, so one onchain transaction can appear as multiple API items when multiple accounts are affected.\n\n### Filters\n\n`chain_ids` is optional on transaction endpoints and can narrow results to supported chains. Currently supported: Ethereum (`1`), Base (`8453`), Arc (`5042`), Robinhood Chain (`4663`), Tempo (`4217`), and Arbitrum (`42161`). `event_types`, `created_at` ranges, `tx_hash`, `loan_assets`, and `collateral_assets` can further narrow results. User-scoped transactions also accept `market_ids`, exact market `maturities`, and inclusive unix-second `maturity_gte` / `maturity_lte` bounds.\n\n### Sorting\n\nOrdering is fixed to `created_at` with deterministic tie-breakers. Use `sort_direction` to switch between newest-first and oldest-first."},{"name":"Markets","description":"A **Midnight market** defines a fixed-rate lending venue: one loan token, one maturity timestamp, optional entry/liquidator gates, and a sorted collateral list with LLTV, liquidation cursor, and oracle for each collateral. The `market_id` is stable and unique across supported chains, so it is enough to address a market.\n\n### Filters\n\nSupported chains: Ethereum (`1`), Base (`8453`), Arc (`5042`), Robinhood Chain (`4663`), Tempo (`4217`), and Arbitrum (`42161`).\n\nAddress filters (`loan_assets`, `collateral_assets`, `oracle_addresses`, `enter_gates`, `liquidator_gates`) require `chain_ids` because the same address can exist on multiple chains. Time filters (`maturity_gte`, `maturity_lte`) accept unix seconds; `active_only=true` keeps markets whose maturity is still in the future.\n\n### Sortable fields\n\n`total_units` (default), `maturity`."},{"name":"Positions","description":"A **Midnight position** is a user's current state on a given market: credit, debt, pending fee, loss factor, collateral balances, and — when available — performance analytics.\n\n### Lender vs borrower\n\nA position's `type` is `lend` when `credit > 0`, `borrow` when `debt > 0`, or `collateral_only` when only collateral remains. A position with no credit, no debt, and no remaining collateral is considered **closed** — the detail endpoint returns 200 with zero balances and `type: null` for known markets.\n\n### Cost basis & effective rates\n\n- `cost_basis` uses the **average cost method**: entries add to the basis, exits reduce it proportionally. WAD-scaled bigint in loan-asset units; `null` when the position has no history attributable to the user (e.g. received via transfer).\n- `effective_rate_wad` is **deprecated** in favor of `effective_apr`. It is **IRR+** — the single rate, annualized over a 365.25-day year, that compounds each remaining buy's capital from entry time to maturity to produce the current face value. WAD-scaled; `null` until sufficient history is available.\n- `effective_apr` is the annualized **simple** effective rate derived from persisted open lots using a 365-day year. It is a decimal fraction (`0.05` = 5%), capped at `10` (1000%), and is `null` when no valid open lot remains.\n\nThe single-position state endpoint omits these performance analytics. Use `/position/performance` when you need performance fields.\n\n### Filters\n\n`chain_ids` is required when `loan_assets` is provided. `collateral_assets` matches configured market collateral tokens across all chains unless `chain_ids` narrows the query. Lowercase address inputs are checksummed. Currently supported chains are Ethereum (`1`), Base (`8453`), Arc (`5042`), Robinhood Chain (`4663`), Tempo (`4217`), and Arbitrum (`42161`). Range filters exist on `created_at`, `credit`, `debt`, `cost_basis`, and the deprecated compounded `effective_rate_wad`; `effective_apr` has no filter or sort key.\n\n### Sortable fields\n\n`created_at` (default, newest first), `maturity`, `credit`, `debt`, `cost_basis`, `effective_rate_wad` (deprecated)."},{"name":"Offer Groups","description":"Offer groups for a user, filtered by lifecycle.\n\n### Response\n\nThe `statuses` query accepts `scheduled`, `active`, `filled`, `expired`, and `cancelled` with OR semantics. The deprecated singular `status` is a single-value alias; supplying both is invalid. Omitting both defaults to active. A `SetConsumed(maxUint128)` sentinel cancels the entire group with highest precedence. A `CancelRoot` permanently cancels only legs matching its chain, maker, ratifier address and root encoded in `ratifier_data`, regardless of event ordering. Active, then scheduled, are determined only from uncancelled legs with remaining capacity; root-cancelled legs are excluded from those list results. If neither live state applies, any root-cancelled latest leg makes the group cancelled, ahead of filled and expired. Natural fills alone remain filled. User lists include only offers whose maturity is at 15:00 UTC, the maturities Router quotes; by-group lookups return every offer. Expiry and maturity boundaries are inclusive for active offers.\n\nList envelope: `{ cursor, data: [...] }`. Pagination is over groups. Filters include `chain_ids`, `market_ids`, `loan_assets`, `collateral_assets`, exact `maturities`, inclusive unix-second `maturity_gte` / `maturity_lte` bounds, `groups`, and `callback_type`; `chain_ids` supports Ethereum (`1`), Base (`8453`), Arc (`5042`), Robinhood Chain (`4663`), Tempo (`4217`), and Arbitrum (`42161`). Lifecycle is derived before these filters, so filtering cannot reclassify a group. `market_ids` selects groups containing at least one status-targeted offer without hiding matching siblings from other markets. `loan_assets`, `collateral_assets`, `maturities`, and maturity bounds narrow the returned status-targeted offers. `callback_type=blue_buy` selects groups whose canonical callback data and earliest official factory registration verify against the maker and offer block. Verified groups expose the callback address, decoded Blue market parameters, and Blue market id; other groups return `callback: null`. Address filters match across all chains unless `chain_ids` narrows the query. Active and scheduled results derive `expiry` from the not-yet-ended latest-offer horizon excluding root-cancelled offers; terminal statuses use the complete latest set. The nested `offers` array exposes the fields needed to display, take, or recover an offer; proof metadata and offer hashes are intentionally excluded. Group-id lookup ignores lifecycle filtering and returns every latest leg."},{"name":"Books","description":"A book is the set of takeable offers for a single market, split into bid and ask sides; each market has exactly one book.\n\nA takeable offer is an offer that has been submitted to the mempool, validated, and checked against its maker's live on-chain liquidity. A book therefore reflects liquidity that is executable right now, giving a comprehensive view of what is available per market.\n\nThese read-only endpoints expose a book at three levels of detail:\n\n- **Level 1 overview:** `GET /v0/midnight/books` lists books across markets with market metadata and the top ask and bid levels.\n- **Level 2 price levels:** `GET /v0/midnight/books/{market-id}` returns a full snapshot of both sides; `GET /v0/midnight/books/{market-id}/{side}` returns one side aggregated into price levels by tick.\n- **Level 3 offers:** `GET /v0/midnight/books/{market-id}/{side}/takeable-offers` returns the individual takeable offers behind those levels, ready to execute.\n\nTo turn a target size into an executable plan, `GET /v0/midnight/books/{market-id}/{side}/quote` returns a bundle-ready quote with expected price bounds and the takeable offers to execute.\n\nTo read one maker's takeable offers across every market (their portfolio), use `GET /v0/midnight/takeable-offers?maker={address}`."},{"name":"Mempool","description":"Endpoints for validating mempool submissions before they are indexed and reading the rules used to accept offers."}]}