Read Morpho vaults and markets data and prepare unsigned transactions.
Maintain this server? Claim it
Call this server's tools from your browser. Nothing to install.
Requests go through mcptry because browsers can't call most MCP servers directly. Header values are sent to the server for that request only and are never stored or logged.
Tool list from our last check. Connect live to refresh it.
Search the Morpho documentation (docs.morpho.org) by semantic similarity. Returns raw search hits; each hit carries the matched text plus metadata (page title, absolute docs.morpho.org url, breadcrumbs, excerpt).
Natural-language search query
Maximum number of result chunks to return
Rerank results for relevance
Let the search service rewrite the query
Only return results scoring at or above this relevance score
Pick your client. Values in capitals, like YOUR_TOKEN, are yours to fill in.
Run in a terminal
claude mcp add --transport http mcp https://mcp.morpho.org/
Search the Morpho documentation (docs.morpho.org) by semantic similarity. Returns raw search hits; each hit carries the matched text plus metadata (page title, absolute docs.morpho.org url, breadcrumbs, excerpt).
| Argument | Type | Description |
|---|---|---|
| topK | integer | Maximum number of result chunks to return |
| query* | string | Natural-language search query |
| rerank | boolean | Rerank results for relevance |
| rewriteQuery | boolean | Let the search service rewrite the query |
| scoreThreshold | number | Only return results scoring at or above this relevance score |
{
"type": "object",
"$schema": "http://json-schema.org/draft-07/schema#",
"required": [
"query"
],
"properties": {
"topK": {
"type": "integer",
"default": 10,
"maximum": 100,
"minimum": 1,
"description": "Maximum number of result chunks to return"
},
"query": {
"type": "string",
"minLength": 1,
"description": "Natural-language search query"
},
"rerank": {
"type": "boolean",
"default": true,
"description": "Rerank results for relevance"
},
"rewriteQuery": {
"type": "boolean",
"description": "Let the search service rewrite the query"
},
"scoreThreshold": {
"type": "number",
"description": "Only return results scoring at or above this relevance score"
}
},
"additionalProperties": false
}Get one Morpho Blue market by market selector.
| Argument | Type | Description |
|---|---|---|
| market-selector* | string | Selector formatted as <chain_id>:<market_id>. Example: 1:0xfff1970c0ffae288764186fbb38a9171a17e98676744a1e345809cb8b9e73342. Chain id at most 2147483647. |
{
"type": "object",
"required": [
"market-selector"
],
"properties": {
"market-selector": {
"type": "string",
"format": "<chain_id>:<market_id>",
"example": "1:0xfff1970c0ffae288764186fbb38a9171a17e98676744a1e345809cb8b9e73342",
"description": "Selector formatted as <chain_id>:<market_id>. Example: 1:0xfff1970c0ffae288764186fbb38a9171a17e98676744a1e345809cb8b9e73342. Chain id at most 2147483647."
}
}
}List a user's Morpho Blue market positions, filterable by chain. Paginate by passing back `cursor` until it is null.
| Argument | Type | Description |
|---|---|---|
| limit | integer | Page size. Defaults to 100, at most 100. |
| cursor | string | Opaque cursor returned by the previous page. |
| chain_ids | array | Only positions on these chains (comma-delimited). Defaults to every exposed chain. |
| user-address* | string | Position owner address. |
{
"type": "object",
"required": [
"user-address"
],
"properties": {
"limit": {
"type": "integer",
"default": 100,
"maximum": 100,
"minimum": 1,
"description": "Page size. Defaults to 100, at most 100."
},
"cursor": {
"type": "string",
"maxLength": 4096,
"minLength": 1,
"description": "Opaque cursor returned by the previous page."
},
"chain_ids": {
"type": "array",
"items": {
"type": "integer",
"maximum": 9007199254740991,
"exclusiveMinimum": 0
},
"maxItems": 100,
"description": "Only positions on these chains (comma-delimited). Defaults to every exposed chain."
},
"user-address": {
"type": "string",
"example": "0x0774b5B15B0CEe5E2e14814CCF4d4611fF78CcF5",
"description": "Position owner address."
}
}
}List every chain the Morpho MCP serves, by name, with whether Morpho Blue markets, Morpho Vaults (V1 or V2) and Midnight are supported on it. Blue and Vault support come from the Morpho API chain list the read tools use; Midnight support also requires the chain to be accepted by the Midnight tools.
No arguments.
{
"type": "object",
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {},
"additionalProperties": false
}Get token balance and whether the user needs to approve Morpho or the Bundler before writing. Balance and allowances are self-describing TokenAmounts.
| Argument | Type | Description |
|---|---|---|
| chain* | string | |
| userAddress* | string | |
| tokenAddress* | string |
{
"type": "object",
"$schema": "http://json-schema.org/draft-07/schema#",
"required": [
"chain",
"userAddress",
"tokenAddress"
],
"properties": {
"chain": {
"enum": [
"ethereum",
"base",
"arbitrum",
"optimism",
"polygon",
"unichain",
"worldchain",
"katana",
"hyperevm",
"monad",
"stable"
],
"type": "string"
},
"userAddress": {
"type": "string",
"pattern": "^0x[a-fA-F0-9]{40}$"
},
"tokenAddress": {
"type": "string",
"pattern": "^0x[a-fA-F0-9]{40}$"
}
},
"additionalProperties": false
}Get one Morpho vault (V1 or V2) by vault selector `<chainId>:<vaultAddress>`.
| Argument | Type | Description |
|---|---|---|
| vault-selector* | string | Selector formatted as <chain_id>:<vault_address>. Example: 1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11. |
{
"type": "object",
"required": [
"vault-selector"
],
"properties": {
"vault-selector": {
"type": "string",
"format": "<chain_id>:<vault_address>",
"example": "1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11",
"description": "Selector formatted as <chain_id>:<vault_address>. Example: 1:0x23f5E9c35820f4baB695Ac1F19c203cC3f8e1e11."
}
}
}List a user's Morpho V1 and V2 vault positions with portfolio totals. Paginate by passing back `cursor` until it is null.
| Argument | Type | Description |
|---|---|---|
| limit | integer | Page size. Defaults to 100, at most 1000. |
| cursor | string | Opaque cursor returned by the previous page. |
| sort_by | string | Sort field. Positions with a null sort value come last. |
| chain_ids | array | Chains to keep. Defaults to every exposed chain. |
| user-address* | string | Position owner address. |
| sort_direction | string | |
| asset_addresses | array | Vault asset addresses to keep. Requires chain_ids; matches positions whose vault asset is one of these addresses on one of the chain_ids. |
{
"type": "object",
"required": [
"user-address"
],
"properties": {
"limit": {
"type": "integer",
"default": 100,
"maximum": 1000,
"minimum": 1,
"description": "Page size. Defaults to 100, at most 1000."
},
"cursor": {
"type": "string",
"maxLength": 4096,
"minLength": 1,
"description": "Opaque cursor returned by the previous page."
},
"sort_by": {
"enum": [
"assets_usd",
"net_apy"
],
"type": "string",
"default": "assets_usd",
"description": "Sort field. Positions with a null sort value come last."
},
"chain_ids": {
"type": "array",
"items": {
"type": "integer",
"maximum": 9007199254740991,
"exclusiveMinimum": 0
},
"maxItems": 100,
"description": "Chains to keep. Defaults to every exposed chain."
},
"user-address": {
"type": "string",
"example": "0x0774b5B15B0CEe5E2e14814CCF4d4611fF78CcF5",
"description": "Position owner address."
},
"sort_direction": {
"enum": [
"asc",
"desc"
],
"type": "string",
"default": "desc"
},
"asset_addresses": {
"type": "array",
"items": {
"type": "string"
},
"maxItems": 100,
"description": "Vault asset addresses to keep. Requires chain_ids; matches positions whose vault asset is one of these addresses on one of the chain_ids."
}
}
}Check the health status of the MCP server and connected services
No arguments.
{
"type": "object",
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {},
"additionalProperties": false
}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.
| Argument | Type | Description |
|---|---|---|
| depth | number | Maximum levels returned per side. Default: 100. Maximum: 6745 (ticks 0 through 6744, inclusive). |
| market-id* | string | Market ID whose book to read (`market_id` in responses). |
{
"type": "object",
"required": [
"market-id"
],
"properties": {
"depth": {
"type": "number",
"maximum": 6745,
"description": "Maximum levels returned per side. Default: 100. Maximum: 6745 (ticks 0 through 6744, inclusive)."
},
"market-id": {
"type": "string",
"example": "0xcc9418ea594c6e658650aedd205ce4544b266b69493f56fd2adc65c14bd06738",
"description": "Market ID whose book to read (`market_id` in responses)."
}
}
}Returns a bundle-ready quote for the requested assets or units, plus expected best/worst average prices and maximum executable liquidity. The 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. At 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. Use 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. If the requested size cannot be fully satisfied at quote time under the selected guard, the endpoint returns 422.
| Argument | Type | Description |
|---|---|---|
| side* | string | Book side to quote (`asks` or `bids`). |
| limit | string | 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. |
| units | string | Target unit amount. Provide exactly one of `assets` or `units`. |
| assets | string |
Returns one side of a book as price levels grouped by tick with total units, assets, and price, sorted best price first.
| Argument | Type | Description |
|---|---|---|
| side* | string | Book side to query (`asks` or `bids`). |
| depth | number | Maximum levels returned. Default: 100. Maximum: 6745 (ticks 0 through 6744, inclusive). |
| market-id* | string | Market ID whose book side to read (`market_id` in responses). |
{
"type": "object",
"required": [
"market-id",
"side"
],
"properties": {
"side": {
"enum": [
"asks",
"bids"
],
"type": "string",
"description": "Book side to query (`asks` or `bids`)."
},
"depth": {
"type": "number",
"maximum": 6745,
"description": "Maximum levels returned. Default: 100. Maximum: 6745 (ticks 0 through 6744, inclusive)."
},
"market-id": {
"type": "string",
"example": "0xcc9418ea594c6e658650aedd205ce4544b266b69493f56fd2adc65c14bd06738",
"description": "Market ID whose book side to read (`market_id` in responses)."
}
}
}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.
| Argument | Type | Description |
|---|---|---|
| side* | string | Book side to query (`asks` or `bids`). |
| market-id* | string | Market ID whose book side to read (`market_id` in responses). |
{
"type": "object",
"required": [
"market-id",
"side"
],
"properties": {
"side": {
"enum": [
"asks",
"bids"
],
"type": "string",
"description": "Book side to query (`asks` or `bids`)."
},
"market-id": {
"type": "string",
"example": "0xcc9418ea594c6e658650aedd205ce4544b266b69493f56fd2adc65c14bd06738",
"description": "Market ID whose book side to read (`market_id` in responses)."
}
}
}Detail lookup for a single market. `:market-id` is the stable Midnight market id and is unique across supported chains, so no chain id is required. Returns the immutable market configuration inside a `data` envelope. Use `morpho_midnight_get_market_state` for dynamic market state. 404s when the id is unknown.
| Argument | Type | Description |
|---|---|---|
| market-id* | string | Midnight market id. |
{
"type": "object",
"required": [
"market-id"
],
"properties": {
"market-id": {
"type": "string",
"example": "0xcc9418ea594c6e658650aedd205ce4544b266b69493f56fd2adc65c14bd06738",
"description": "Midnight market id."
}
}
}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. Returns the market state inside a `data` envelope. Use `morpho_midnight_get_market` for immutable market configuration. 404s when the id is unknown.
| Argument | Type | Description |
|---|---|---|
| market-id* | string | Midnight market id. |
{
"type": "object",
"required": [
"market-id"
],
"properties": {
"market-id": {
"type": "string",
"example": "0xcc9418ea594c6e658650aedd205ce4544b266b69493f56fd2adc65c14bd06738",
"description": "Midnight market id."
}
}
}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. The 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. It does not apply Router mempool admission policy: oracle, token, market-triplet, LLTV, RCF threshold, and other mempool-validation policy checks do not gate retrieval. 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. An unrecognized ratifier address returns `unknown`; a recognized address whose `ratifier_data` cannot be decoded returns `invalid` with `expected_ratifier_type`.
| Argument | Type | Description |
|---|---|---|
| maker | string | Filter by offer maker address. |
| chain_id | integer | Filter by chain id. |
| group-id* | string | Offer group id. |
Detail lookup for a single position by `(market-id, user-address)`. `: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. Returns 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"`.
| Argument | Type | Description |
|---|---|---|
| market-id* | string | Midnight market id. |
| user-address* | string | User address for the requested position. Lowercase input is checksummed. |
{
"type": "object",
"required": [
"market-id",
"user-address"
],
"properties": {
"market-id": {
"type": "string",
"example": "0xcc9418ea594c6e658650aedd205ce4544b266b69493f56fd2adc65c14bd06738",
"description": "Midnight market id."
},
"user-address": {
"type": "string",
"example": "0xd4F43105098845fFE89B16E7A3DCdd0A31898118",
"description": "User address for the requested position. Lowercase input is checksummed."
}
}
}Performance-only lookup for a single position by `(market-id, user-address)`. Returns performance analytics inside a `data` envelope. `effective_rate_wad` 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.
| Argument | Type | Description |
|---|---|---|
| market-id* | string | Midnight market id. |
| user-address* | string | User address for the requested position. Lowercase input is checksummed. |
{
"type": "object",
"required": [
"market-id",
"user-address"
],
"properties": {
"market-id": {
"type": "string",
"example": "0xcc9418ea594c6e658650aedd205ce4544b266b69493f56fd2adc65c14bd06738",
"description": "Midnight market id."
},
"user-address": {
"type": "string",
"example": "0xd4F43105098845fFE89B16E7A3DCdd0A31898118",
"description": "User address for the requested position. Lowercase input is checksummed."
}
}
}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.
| Argument | Type | Description |
|---|---|---|
| ids | string | Market ID filter as a single comma-separated query parameter. Returns books for matching currently listed markets. Maximum 20 IDs. |
| sort | string | Sort by comma-separated fields (`id`, `ask`, `bid`, `maturity`). Prefix a field with `-` for descending. Max 3 fields. |
| limit | number | Maximum number of items to return (max 20, default 10). |
| cursor | string | Opaque pagination cursor from a previous response. |
| chain_ids | array | Chain ID filter (comma-separated). Currently accepts at most one chain id. |
| maturities | array | Exact maturity timestamp filter in unix seconds (comma-separated). Maximum 150 values. |
| loan_tokens | array | Loan token address filter (comma-separated). Maximum 150 values. |
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.
| Argument | Type | Description |
|---|---|---|
| limit | number | Maximum number of items to return. |
| maker* | string | Maker EVM address. Matching is case-insensitive. |
| cursor | string | Opaque pagination cursor from a previous response. |
| groups | string | Comma-separated group IDs (32-byte hex). Matches takeable offers in any of the provided groups. Maximum 20 IDs. |
| market_ids | string | Comma-separated market IDs (32-byte hex). Matches takeable offers in any of the provided markets. Maximum 20 IDs. Combined with `groups` using AND semantics. |
{
"type": "object",
"required": [
"maker"
],
"properties": {
"limit": {
"type": "number",
"description": "Maximum number of items to return."
},
"maker": {
"type": "string",
"description": "Maker EVM address. Matching is case-insensitive."
},
"cursor": {
"type": "string",
"description": "Opaque pagination cursor from a previous response."
},
"groups": {
"type": "string",
"description": "Comma-separated group IDs (32-byte hex). Matches takeable offers in any of the provided groups. Maximum 20 IDs."
},
"market_ids": {
"type": "string",
"description": "Comma-separated market IDs (32-byte hex). Matches takeable offers in any of the provided markets. Maximum 20 IDs. Combined with `groups` using AND semantics."
}
}
}Cursor-paginated list of current Midnight positions for a market. `:market-id` is the stable Midnight market id and is globally unique across supported chains. The response uses the same public position item shape as `morpho_midnight_list_user_positions`: `{ cursor, data }`, with `type`, state fields, collateral balances, and performance analytics. **Filters.** Range filters exist on `created_at`, `credit`, `debt`, `cost_basis`, and `effective_rate_wad`. `effective_apr` has no filter or sort key. `active_only=true` excludes matured markets. The path market id is always enforced. **Pagination.** Pass back `cursor` verbatim on the next call. Positions are ordered newest-first by `created_at` by default. **Cache.** `public, max-age=2, stale-while-revalidate=1`.
| Argument | Type | Description |
|---|---|---|
| limit | integer | Maximum number of items to return. |
| types | array | Filter by position type. |
| cursor | string | Opaque cursor from a previous page response. |
| sort_by | string | Sort field for cursor pagination. |
| debt_gte | string | Filter for debt greater than or equal to this value. |
| debt_lte | string | Filter for debt less than or equal to this value. |
Cursor-paginated list of Midnight markets. **Use this to discover markets.** For a given user's positions on those markets, follow up with `morpho_midnight_list_user_positions`. **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. **Pagination.** Response follows the list envelope: `{ cursor, data }`. Pass back `cursor` verbatim on the next call. A `null` `cursor` means the last page. **Cache.** `public, max-age=5, stale-while-revalidate=2`.
| Argument | Type | Description |
|---|---|---|
| limit | integer | Maximum number of items to return. |
| cursor | string | Opaque cursor from a previous page response. |
| listed | string | Filter by listing status. When true, returns only markets surfaced by the app trust layer; when false, only unlisted markets. Omit to return both. |
| sort_by | string | Sort field for cursor pagination. |
| chain_ids | array | Filter by chain ids. Supported chains: Ethereum (1), Base (8453), Arc (5042), and Robinhood Chain (4663). Required when any address filter is provided. |
| market_ids | array |
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. **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. Lifecycle is derived from every latest 15:00 UTC offer revision before market, asset, maturity, type, callback, or listing filters are applied. `cancelled` has highest priority and requires an explicit `SetConsumed(type(uint128).max)` event; a `Take` reaching the same numeric value remains `filled`. Otherwise, a group is `filled` when every latest leg has no remaining capacity. It is `active` when at least one remaining leg has started and is at or before both its expiry and non-zero maturity. It is `scheduled` when no leg is active but at least one remaining leg starts in the future without having expired or matured. All remaining groups are `expired`. Active takes remain valid at exact expiry or maturity, matching the onchain inclusive boundary. Nested offers are lifecycle-targeted for list results: active returns live remaining-capacity legs, scheduled returns future remaining-capacity 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; terminal statuses use the complete latest set. Requesting all five statuses returns every group with a 15:00 UTC offer exactly once. **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. **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. **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. **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. An unrecognized ratifier address returns `unknown`; a recognized address whose `ratifier_data` cannot be decoded returns `invalid` with `expected_ratifier_type`. **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`.
Cursor-paginated list of a user's current Midnight positions. **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. **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 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. **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 `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. **Pagination.** Response envelope: `{ cursor, data }`. Positions are ordered newest-first by `created_at` by default. **Cache.** `public, max-age=2, stale-while-revalidate=1`.
| Argument | Type | Description |
|---|---|---|
| limit | integer | Maximum number of items to return. |
| types | array | Filter by position type. |
| cursor | string | Opaque cursor from a previous page response. |
| listed |
Prepare a supply-side withdrawal from a Morpho Blue market. Supports "max" for the full supply position. A BlueBundlesV1 authorization transaction may come first in transactions.
| Argument | Type | Description |
|---|---|---|
| chain* | string | |
| marketId* | string | |
| userAddress* | string | |
| withdrawAmount* | string | number | Supply-side loan token amount in human-readable decimals, or "max" for the full supply |
{
"type": "object",
"$schema": "http://json-schema.org/draft-07/schema#",
"required": [
"chain",
"marketId",
"userAddress",
"withdrawAmount"
],
"properties": {
"chain": {
"enum": [
"ethereum",
"base",
"arbitrum",
"optimism",
"polygon",
"unichain",
"worldchain",
"katana",
"hyperevm",
"monad",
"stable"
],
"type": "string"
},
"marketId": {
"type": "string",
"pattern": "^0x[a-fA-F0-9]{64}$"
},
"userAddress": {
"type": "string",
"pattern": "^0x[a-fA-F0-9]{40}$"
},
"withdrawAmount": {
"type": [
"string",
"number"
],
"description": "Supply-side loan token amount in human-readable decimals, or \"max\" for the full supply"
}
},
"additionalProperties": false
}Prepare a borrow on a Morpho Blue market. Returns a ready-to-sign transactions array with the borrow tx. Includes health factor check against existing collateral position. A BlueBundlesV1 authorization transaction may come first in transactions.
| Argument | Type | Description |
|---|---|---|
| chain* | string | |
| marketId* | string | |
| userAddress* | string | |
| borrowAmount* | string | number | Loan token amount to borrow in human-readable decimals (e.g., "500"), or "max" for maximum borrowable |
{
"type": "object",
"$schema": "http://json-schema.org/draft-07/schema#",
"required": [
"chain",
"marketId",
"userAddress",
"borrowAmount"
],
"properties": {
"chain": {
"enum": [
"ethereum",
"base",
"arbitrum",
"optimism",
"polygon",
"unichain",
"worldchain",
"katana",
"hyperevm",
"monad",
"stable"
],
"type": "string"
},
"marketId": {
"type": "string",
"pattern": "^0x[a-fA-F0-9]{64}$"
},
"userAddress": {
"type": "string",
"pattern": "^0x[a-fA-F0-9]{40}$"
},
"borrowAmount": {
"type": [
"string",
"number"
],
"description": "Loan token amount to borrow in human-readable decimals (e.g., \"500\"), or \"max\" for maximum borrowable"
}
},
"additionalProperties": false
}Fetch a user's claimable Merkl rewards and prepare a single claim transaction against the canonical Merkl Distributor (0x3Ef3D8bA38EBe18DB133cEc108f4D14CE00Dd9Ae). Returns a ready-to-sign transaction; if nothing is claimable, returns an empty transactions array with an info-level warning. No on-chain approval needed — the Distributor pulls from its own balance via Merkle proofs.
| Argument | Type | Description |
|---|---|---|
| chain* | string | |
| userAddress* | string |
{
"type": "object",
"$schema": "http://json-schema.org/draft-07/schema#",
"required": [
"chain",
"userAddress"
],
"properties": {
"chain": {
"enum": [
"ethereum",
"base",
"arbitrum",
"optimism",
"polygon",
"unichain",
"worldchain",
"katana",
"hyperevm",
"monad",
"stable"
],
"type": "string"
},
"userAddress": {
"type": "string",
"pattern": "^0x[a-fA-F0-9]{40}$"
}
},
"additionalProperties": false
}Prepare a deposit into a Morpho vault. Checks on-chain allowance and returns a ready-to-sign transactions array with approval txs (if needed) followed by the deposit tx. Handles USDT reset-to-zero and DAI non-standard approval.
| Argument | Type | Description |
|---|---|---|
| chain* | string | |
| amount* | string | number | Token amount in human-readable decimals (e.g., "1000.50"), or "max" for full balance |
| userAddress* | string | |
| vaultAddress* | string |
{
"type": "object",
"$schema": "http://json-schema.org/draft-07/schema#",
"required": [
"chain",
"vaultAddress",
"userAddress",
"amount"
],
"properties": {
"chain": {
"enum": [
"ethereum",
"base",
"arbitrum",
"optimism",
"polygon",
"unichain",
"worldchain",
"katana",
"hyperevm",
"monad",
"stable"
],
"type": "string"
},
"amount": {
"type": [
"string",
"number"
],
"description": "Token amount in human-readable decimals (e.g., \"1000.50\"), or \"max\" for full balance"
},
"userAddress": {
"type": "string",
"pattern": "^0x[a-fA-F0-9]{40}$"
},
"vaultAddress": {
"type": "string",
"pattern": "^0x[a-fA-F0-9]{40}$"
}
},
"additionalProperties": false
}Prepare a Vault V2 share redemption after user-directed market deallocations. Each deallocation amount should include a buffer for share-price drift.
| Argument | Type | Description |
|---|---|---|
| chain* | string | |
| shares* | string | number | Vault shares in human-readable decimals, or "max" for the full share balance |
| userAddress* | string | |
| vaultAddress* | string | |
| deallocations* | array |
{
"type": "object",
"$schema": "http://json-schema.org/draft-07/schema#",
"required": [
"chain",
"vaultAddress",
"userAddress",
"shares",
"deallocations"
],
"properties": {
"chain": {
"enum": [
"ethereum",
"base",
"arbitrum",
"optimism",
"polygon",
"unichain",
"worldchain",
"katana",
"hyperevm",
"monad",
"stable"
],
"type": "string"
},
"shares": {
"type": [
"string",
"number"
],
"description": "Vault shares in human-readable decimals, or \"max\" for the full share balance"
},
"userAddress": {
"type": "string",
"pattern": "^0x[a-fA-F0-9]{40}$"
},
"vaultAddress": {
"type": "string",
"pattern": "^0x[a-fA-F0-9]{40}$"
},
"deallocations": {
"type": "array",
"items": {
"type": "object",
"required": [
"marketId",
"assets"
],
"properties": {
"assets": {
"type": [
"string",
"number"
],
"description": "Assets to deallocate in human-readable decimals"
},
"marketId": {
"type": "string",
"pattern": "^0x[a-fA-F0-9]{64}$"
}
},
"additionalProperties": false
},
"minItems": 1
}
},
"additionalProperties": false
}Prepare a Vault V2 force withdrawal. The SDK selects the vault adapter and deallocates as needed.
| Argument | Type | Description |
|---|---|---|
| chain* | string | |
| assets* | string | number | Penalty-inclusive asset amount to withdraw in human-readable decimals |
| userAddress* | string | |
| vaultAddress* | string |
{
"type": "object",
"$schema": "http://json-schema.org/draft-07/schema#",
"required": [
"chain",
"vaultAddress",
"userAddress",
"assets"
],
"properties": {
"chain": {
"enum": [
"ethereum",
"base",
"arbitrum",
"optimism",
"polygon",
"unichain",
"worldchain",
"katana",
"hyperevm",
"monad",
"stable"
],
"type": "string"
},
"assets": {
"type": [
"string",
"number"
],
"description": "Penalty-inclusive asset amount to withdraw in human-readable decimals"
},
"userAddress": {
"type": "string",
"pattern": "^0x[a-fA-F0-9]{40}$"
},
"vaultAddress": {
"type": "string",
"pattern": "^0x[a-fA-F0-9]{40}$"
}
},
"additionalProperties": false
}Prepare cancelling a maker's Midnight offer groups through MidnightBundlesV2. First call `morpho_midnight_list_user_offer_groups` for the maker's group IDs. Cancels each group whatever has already been filled. Returns unsigned transactions, approval and MidnightBundlesV2 authorization first, plus a simulation and warnings.
| Argument | Type | Description |
|---|---|---|
| chain* | string | |
| groups* | array | Offer group IDs to cancel (`id` from `morpho_midnight_list_user_offer_groups`) |
| userAddress* | string | Maker that sends the transaction |
{
"type": "object",
"$schema": "http://json-schema.org/draft-07/schema#",
"required": [
"chain",
"userAddress",
"groups"
],
"properties": {
"chain": {
"enum": [
"ethereum",
"base",
"arbitrum",
"optimism",
"polygon",
"unichain",
"worldchain",
"katana",
"hyperevm",
"monad",
"stable"
],
"type": "string"
},
"groups": {
"type": "array",
"items": {
"type": "string",
"pattern": "^0x[a-fA-F0-9]{64}$"
},
"minItems": 1,
"description": "Offer group IDs to cancel (`id` from `morpho_midnight_list_user_offer_groups`)"
},
"userAddress": {
"type": "string",
"pattern": "^0x[a-fA-F0-9]{40}$",
"description": "Maker that sends the transaction"
}
},
"additionalProperties": false
}Prepare redeeming Midnight lend credit for loan tokens, limited to what the market can pay out now. First call `morpho_midnight_get_user_position` for the credit. Before maturity a market with a continuous fee leaves some credit; redeem again after maturity. Returns unsigned transactions, approval and MidnightBundlesV2 authorization first, plus a simulation and warnings.
| Argument | Type | Description |
|---|---|---|
| chain* | string | |
| amount | string | number | Credit units to redeem, in loan token decimals. Omit to redeem the full face value. |
| marketId* | string | Midnight market ID (`market_id` from the Midnight read tools) |
| userAddress* | string | Account that sends the transactions and owns the position |
{
"type": "object",
"$schema": "http://json-schema.org/draft-07/schema#",
"required": [
"chain",
"marketId",
"userAddress"
],
"properties": {
"chain": {
"enum": [
"ethereum",
"base",
"arbitrum",
"optimism",
"polygon",
"unichain",
"worldchain",
"katana",
"hyperevm",
"monad",
"stable"
],
"type": "string"
},
"amount": {
"type": [
"string",
"number"
],
"description": "Credit units to redeem, in loan token decimals. Omit to redeem the full face value."
},
"marketId": {
"type": "string",
"pattern": "^0x[a-fA-F0-9]{64}$",
"description": "Midnight market ID (`market_id` from the Midnight read tools)"
},
"userAddress": {
"type": "string",
"pattern": "^0x[a-fA-F0-9]{40}$",
"description": "Account that sends the transactions and owns the position"
}
},
"additionalProperties": false
}Prepare repaying Midnight debt at face value, withdrawing collateral, or both, in one MidnightBundlesV2 transaction. First call `morpho_midnight_get_user_position` for the debt and collateral. To repay at the book price before maturity, use `morpho_prepare_midnight_take_repay_withdraw_collateral`. Returns unsigned transactions, approval and MidnightBundlesV2 authorization first, plus a simulation and warnings.
| Argument | Type | Description |
|---|---|---|
| chain* | string | |
| marketId* | string | Midnight market ID (`market_id` from the Midnight read tools) |
| repayAmount | string | number | Loan token amount to repay, in human-readable decimals, or "max" to repay all debt. "0" only withdraws collateral. |
| userAddress* | string | Account that sends the transactions and owns the position |
| collateralIndex | integer | Index of the collateral in the market `collaterals` list |
| collateralAmount | string | number | Collateral token amount to withdraw, in human-readable decimals, or "max" for the full balance. Omit to only repay. |
Prepare authorizing or revoking MidnightBundlesV2 on Midnight for the user. The other Midnight prepare tools add the authorization when they need it, so call this only to revoke it or to authorize ahead of time. Returns one unsigned transaction.
| Argument | Type | Description |
|---|---|---|
| chain* | string | |
| userAddress* | string | Account that sends the transaction |
| isAuthorized | boolean | true authorizes MidnightBundlesV2 on Midnight; false revokes it |
{
"type": "object",
"$schema": "http://json-schema.org/draft-07/schema#",
"required": [
"chain",
"userAddress"
],
"properties": {
"chain": {
"enum": [
"ethereum",
"base",
"arbitrum",
"optimism",
"polygon",
"unichain",
"worldchain",
"katana",
"hyperevm",
"monad",
"stable"
],
"type": "string"
},
"userAddress": {
"type": "string",
"pattern": "^0x[a-fA-F0-9]{40}$",
"description": "Account that sends the transaction"
},
"isAuthorized": {
"type": "boolean",
"default": true,
"description": "true authorizes MidnightBundlesV2 on Midnight; false revokes it"
}
},
"additionalProperties": false
}Prepare supplying collateral to a Midnight market directly on Midnight. First call `morpho_midnight_get_market` for the collateral index and token. Returns unsigned transactions, approval and MidnightBundlesV2 authorization first, plus a simulation and warnings.
| Argument | Type | Description |
|---|---|---|
| chain* | string | |
| amount* | string | number | Collateral token amount to supply, in human-readable decimals |
| marketId* | string | Midnight market ID (`market_id` from the Midnight read tools) |
| userAddress* | string | Account that sends the transactions and owns the position |
| collateralIndex | integer | Index of the collateral in the market `collaterals` list |
{
"type": "object",
"$schema": "http://json-schema.org/draft-07/schema#",
"required": [
"chain",
"marketId",
"userAddress",
"amount"
],
"properties": {
"chain": {
"enum": [
"ethereum",
"base",
"arbitrum",
"optimism",
"polygon",
"unichain",
"worldchain",
"katana",
"hyperevm",
"monad",
"stable"
],
"type": "string"
},
"amount": {
"type": [
"string",
"number"
],
"description": "Collateral token amount to supply, in human-readable decimals"
},
"marketId": {
"type": "string",
"pattern": "^0x[a-fA-F0-9]{64}$",
"description": "Midnight market ID (`market_id` from the Midnight read tools)"
},
"userAddress": {
"type": "string",
"pattern": "^0x[a-fA-F0-9]{40}$",
"description": "Account that sends the transactions and owns the position"
},
"collateralIndex": {
"type": "integer",
"default": 0,
"maximum": 9007199254740991,
"minimum": 0,
"description": "Index of the collateral in the market `collaterals` list"
}
},
"additionalProperties": false
}Prepare supplying collateral and a fixed-rate borrow on a Midnight market in one MidnightBundlesV2 transaction, taking the best bid offers. First call `morpho_midnight_get_market` for the collateral index and tokens, and `morpho_midnight_get_book_quote` with side `bids` and the same amount. Returns unsigned transactions, approval and MidnightBundlesV2 authorization first, plus a simulation and warnings.
| Argument | Type | Description |
|---|---|---|
| chain* | string | |
| amount* | string | number | Loan token amount to receive, in human-readable decimals (e.g. "100") |
| marketId* | string | Midnight market ID (`market_id` from the Midnight read tools) |
| slippage | string | number | Slippage percentage applied to the book quote (e.g. "0.5" = 0.5%). Bounds the units filled at the quoted average price. |
| userAddress* | string | Account that sends the transactions and owns the position |
| collateralIndex | integer | Index of the collateral in the market `collaterals` list |
| collateralAmount |
Prepare a fixed-rate borrow on a Midnight market against collateral already supplied, by taking the best bid offers through MidnightBundlesV2. First call `morpho_midnight_get_user_position` to check collateral and `morpho_midnight_get_book_quote` with side `bids` and the same amount. Use `morpho_prepare_midnight_supply_collateral_take_borrow` when collateral is not supplied yet. Returns unsigned transactions, approval and MidnightBundlesV2 authorization first, plus a simulation and warnings.
| Argument | Type | Description |
|---|---|---|
| chain* | string | |
| amount* | string | number | Loan token amount to receive, in human-readable decimals (e.g. "100") |
| marketId* | string | Midnight market ID (`market_id` from the Midnight read tools) |
| slippage | string | number | Slippage percentage applied to the book quote (e.g. "0.5" = 0.5%). Bounds the units filled at the quoted average price. |
| userAddress* | string | Account that sends the transactions and owns the position |
{
"type": "object",
"$schema": "http://json-schema.org/draft-07/schema#",
"required": [
"chain",
"marketId",
"userAddress",
"amount"
],
"properties": {
"chain": {
"enum": [
"ethereum",
"base",
"arbitrum",
"optimism",
"polygon",
"unichain",
"worldchain",
"katana",
"hyperevm",
"monad",
"stable"
],
"type": "string"
},
"amount": {
"type": [
"string",
"number"
],
"description": "Loan token amount to receive, in human-readable decimals (e.g. \"100\")"
},
"marketId": {
"type": "string",
"pattern": "^0x[a-fA-F0-9]{64}$",
"description": "Midnight market ID (`market_id` from the Midnight read tools)"
},
"slippage": {
"type": [
"string",
"number"
],
"description": "Slippage percentage applied to the book quote (e.g. \"0.5\" = 0.5%). Bounds the units filled at the quoted average price."
},
"userAddress": {
"type": "string",
"pattern": "^0x[a-fA-F0-9]{40}$",
"description": "Account that sends the transactions and owns the position"
}
},
"additionalProperties": false
}Prepare a fixed-rate lend on a Midnight market by taking the best ask offers through MidnightBundlesV2. First call `morpho_midnight_get_market` for the loan token and `morpho_midnight_get_book_quote` with side `asks` and the same amount to check the rate and depth. The tool re-quotes the asks book itself. Returns unsigned transactions, approval and MidnightBundlesV2 authorization first, plus a simulation and warnings.
| Argument | Type | Description |
|---|---|---|
| chain* | string | |
| amount* | string | number | Loan token amount to lend, in human-readable decimals (e.g. "100") |
| marketId* | string | Midnight market ID (`market_id` from the Midnight read tools) |
| slippage | string | number | Slippage percentage applied to the book quote (e.g. "0.5" = 0.5%). Bounds the units filled at the quoted average price. |
| userAddress* | string | Account that sends the transactions and owns the position |
{
"type": "object",
"$schema": "http://json-schema.org/draft-07/schema#",
"required": [
"chain",
"marketId",
"userAddress",
"amount"
],
"properties": {
"chain": {
"enum": [
"ethereum",
"base",
"arbitrum",
"optimism",
"polygon",
"unichain",
"worldchain",
"katana",
"hyperevm",
"monad",
"stable"
],
"type": "string"
},
"amount": {
"type": [
"string",
"number"
],
"description": "Loan token amount to lend, in human-readable decimals (e.g. \"100\")"
},
"marketId": {
"type": "string",
"pattern": "^0x[a-fA-F0-9]{64}$",
"description": "Midnight market ID (`market_id` from the Midnight read tools)"
},
"slippage": {
"type": [
"string",
"number"
],
"description": "Slippage percentage applied to the book quote (e.g. \"0.5\" = 0.5%). Bounds the units filled at the quoted average price."
},
"userAddress": {
"type": "string",
"pattern": "^0x[a-fA-F0-9]{40}$",
"description": "Account that sends the transactions and owns the position"
}
},
"additionalProperties": false
}Prepare repaying Midnight debt before maturity by buying back units from the best ask offers, then optionally withdrawing collateral, in one MidnightBundlesV2 transaction. First call `morpho_midnight_get_user_position` for the debt and collateral and `morpho_midnight_get_book_quote` with side `asks` and the same amount. Returns unsigned transactions, approval and MidnightBundlesV2 authorization first, plus a simulation and warnings.
| Argument | Type | Description |
|---|---|---|
| chain* | string | |
| amount* | string | number | Loan token amount to spend buying back debt, in human-readable decimals |
| marketId* | string | Midnight market ID (`market_id` from the Midnight read tools) |
| slippage | string | number | Slippage percentage applied to the book quote (e.g. "0.5" = 0.5%). Bounds the units filled at the quoted average price. |
| userAddress* | string | Account that sends the transactions and owns the position |
| collateralIndex | integer | Index of the collateral in the market `collaterals` list |
Prepare exiting a Midnight lend position before maturity: redeems withdrawable credit, then sells the rest to the best bid offers through MidnightBundlesV2. First call `morpho_midnight_get_user_position` for the credit and `morpho_midnight_get_book_quote` with side `bids` and the same amount. After maturity use `morpho_prepare_midnight_redeem`. Returns unsigned transactions, approval and MidnightBundlesV2 authorization first, plus a simulation and warnings.
| Argument | Type | Description |
|---|---|---|
| chain* | string | |
| amount* | string | number | Loan token amount to receive for the sold credit, in human-readable decimals |
| marketId* | string | Midnight market ID (`market_id` from the Midnight read tools) |
| slippage | string | number | Slippage percentage applied to the book quote (e.g. "0.5" = 0.5%). Bounds the units filled at the quoted average price. |
| userAddress* | string | Account that sends the transactions and owns the position |
{
"type": "object",
"$schema": "http://json-schema.org/draft-07/schema#",
"required": [
"chain",
"marketId",
"userAddress",
"amount"
],
"properties": {
"chain": {
"enum": [
"ethereum",
"base",
"arbitrum",
"optimism",
"polygon",
"unichain",
"worldchain",
"katana",
"hyperevm",
"monad",
"stable"
],
"type": "string"
},
"amount": {
"type": [
"string",
"number"
],
"description": "Loan token amount to receive for the sold credit, in human-readable decimals"
},
"marketId": {
"type": "string",
"pattern": "^0x[a-fA-F0-9]{64}$",
"description": "Midnight market ID (`market_id` from the Midnight read tools)"
},
"slippage": {
"type": [
"string",
"number"
],
"description": "Slippage percentage applied to the book quote (e.g. \"0.5\" = 0.5%). Bounds the units filled at the quoted average price."
},
"userAddress": {
"type": "string",
"pattern": "^0x[a-fA-F0-9]{40}$",
"description": "Account that sends the transactions and owns the position"
}
},
"additionalProperties": false
}Prepare migration of shares from a Vault V1 into a Vault V2 with the same underlying asset. A vault-share approval transaction may come first and is listed in requirements.
| Argument | Type | Description |
|---|---|---|
| chain* | string | |
| shares* | string | number | Source Vault V1 shares in human-readable decimals, or "max" for the full share balance |
| userAddress* | string | |
| vaultAddress* | string | |
| targetVaultAddress* | string |
{
"type": "object",
"$schema": "http://json-schema.org/draft-07/schema#",
"required": [
"chain",
"vaultAddress",
"targetVaultAddress",
"userAddress",
"shares"
],
"properties": {
"chain": {
"enum": [
"ethereum",
"base",
"arbitrum",
"optimism",
"polygon",
"unichain",
"worldchain",
"katana",
"hyperevm",
"monad",
"stable"
],
"type": "string"
},
"shares": {
"type": [
"string",
"number"
],
"description": "Source Vault V1 shares in human-readable decimals, or \"max\" for the full share balance"
},
"userAddress": {
"type": "string",
"pattern": "^0x[a-fA-F0-9]{40}$"
},
"vaultAddress": {
"type": "string",
"pattern": "^0x[a-fA-F0-9]{40}$"
},
"targetVaultAddress": {
"type": "string",
"pattern": "^0x[a-fA-F0-9]{40}$"
}
},
"additionalProperties": false
}Prepare a share-based redemption from a Morpho Vault V1 or V2. Checks share allowance and supports "max" for the full share balance. A vault-share approval transaction may come first and is listed in requirements.
| Argument | Type | Description |
|---|---|---|
| chain* | string | |
| shares* | string | number | Vault shares in human-readable decimals, or "max" for the full share balance |
| userAddress* | string | |
| vaultAddress* | string |
{
"type": "object",
"$schema": "http://json-schema.org/draft-07/schema#",
"required": [
"chain",
"vaultAddress",
"userAddress",
"shares"
],
"properties": {
"chain": {
"enum": [
"ethereum",
"base",
"arbitrum",
"optimism",
"polygon",
"unichain",
"worldchain",
"katana",
"hyperevm",
"monad",
"stable"
],
"type": "string"
},
"shares": {
"type": [
"string",
"number"
],
"description": "Vault shares in human-readable decimals, or \"max\" for the full share balance"
},
"userAddress": {
"type": "string",
"pattern": "^0x[a-fA-F0-9]{40}$"
},
"vaultAddress": {
"type": "string",
"pattern": "^0x[a-fA-F0-9]{40}$"
}
},
"additionalProperties": false
}Prepare an in-kind redemption from a Morpho Vault V1 or V2, exiting through its underlying Blue markets. A vault-share approval transaction may come first and is listed in requirements.
| Argument | Type | Description |
|---|---|---|
| chain* | string | |
| amount* | string | number | Asset-denominated amount to exit in human-readable decimals |
| userAddress* | string | |
| vaultAddress* | string |
{
"type": "object",
"$schema": "http://json-schema.org/draft-07/schema#",
"required": [
"chain",
"vaultAddress",
"userAddress",
"amount"
],
"properties": {
"chain": {
"enum": [
"ethereum",
"base",
"arbitrum",
"optimism",
"polygon",
"unichain",
"worldchain",
"katana",
"hyperevm",
"monad",
"stable"
],
"type": "string"
},
"amount": {
"type": [
"string",
"number"
],
"description": "Asset-denominated amount to exit in human-readable decimals"
},
"userAddress": {
"type": "string",
"pattern": "^0x[a-fA-F0-9]{40}$"
},
"vaultAddress": {
"type": "string",
"pattern": "^0x[a-fA-F0-9]{40}$"
}
},
"additionalProperties": false
}Prepare a full migration of a Morpho Blue borrow position into a destination market with matching loan and collateral tokens. A BlueBundlesV1 authorization transaction may come first in transactions.
| Argument | Type | Description |
|---|---|---|
| chain* | string | |
| marketId* | string | |
| userAddress* | string | |
| destinationMarketId* | string |
{
"type": "object",
"$schema": "http://json-schema.org/draft-07/schema#",
"required": [
"chain",
"marketId",
"destinationMarketId",
"userAddress"
],
"properties": {
"chain": {
"enum": [
"ethereum",
"base",
"arbitrum",
"optimism",
"polygon",
"unichain",
"worldchain",
"katana",
"hyperevm",
"monad",
"stable"
],
"type": "string"
},
"marketId": {
"type": "string",
"pattern": "^0x[a-fA-F0-9]{64}$"
},
"userAddress": {
"type": "string",
"pattern": "^0x[a-fA-F0-9]{40}$"
},
"destinationMarketId": {
"type": "string",
"pattern": "^0x[a-fA-F0-9]{64}$"
}
},
"additionalProperties": false
}Prepare a repay on a Morpho Blue market. Checks on-chain allowance and returns a ready-to-sign transactions array with approval txs (if needed) followed by the repay tx. Supports "max" for full repayment. Handles USDT reset-to-zero and DAI non-standard approval.
| Argument | Type | Description |
|---|---|---|
| chain* | string | |
| amount* | string | number | Loan token amount to repay in human-readable decimals (e.g., "100"), or "max" for full repayment |
| marketId* | string | |
| userAddress* | string |
{
"type": "object",
"$schema": "http://json-schema.org/draft-07/schema#",
"required": [
"chain",
"marketId",
"userAddress",
"amount"
],
"properties": {
"chain": {
"enum": [
"ethereum",
"base",
"arbitrum",
"optimism",
"polygon",
"unichain",
"worldchain",
"katana",
"hyperevm",
"monad",
"stable"
],
"type": "string"
},
"amount": {
"type": [
"string",
"number"
],
"description": "Loan token amount to repay in human-readable decimals (e.g., \"100\"), or \"max\" for full repayment"
},
"marketId": {
"type": "string",
"pattern": "^0x[a-fA-F0-9]{64}$"
},
"userAddress": {
"type": "string",
"pattern": "^0x[a-fA-F0-9]{40}$"
}
},
"additionalProperties": false
}Prepare a combined Morpho Blue debt repayment and collateral withdrawal. Supports "max" for full repayment or all collateral. A BlueBundlesV1 authorization transaction may come first in transactions.
| Argument | Type | Description |
|---|---|---|
| chain* | string | |
| marketId* | string | |
| repayAmount* | string | number | Loan token amount to repay in human-readable decimals, or "max" for full repayment |
| userAddress* | string | |
| withdrawCollateralAmount* | string | number | Collateral amount to withdraw in human-readable decimals, or "max" for all collateral |
{
"type": "object",
"$schema": "http://json-schema.org/draft-07/schema#",
"required": [
"chain",
"marketId",
"userAddress",
"repayAmount",
"withdrawCollateralAmount"
],
"properties": {
"chain": {
"enum": [
"ethereum",
"base",
"arbitrum",
"optimism",
"polygon",
"unichain",
"worldchain",
"katana",
"hyperevm",
"monad",
"stable"
],
"type": "string"
},
"marketId": {
"type": "string",
"pattern": "^0x[a-fA-F0-9]{64}$"
},
"repayAmount": {
"type": [
"string",
"number"
],
"description": "Loan token amount to repay in human-readable decimals, or \"max\" for full repayment"
},
"userAddress": {
"type": "string",
"pattern": "^0x[a-fA-F0-9]{40}$"
},
"withdrawCollateralAmount": {
"type": [
"string",
"number"
],
"description": "Collateral amount to withdraw in human-readable decimals, or \"max\" for all collateral"
}
},
"additionalProperties": false
}Prepare a supply to a Morpho Blue market. Checks on-chain allowance and returns a ready-to-sign transactions array with approval txs (if needed) followed by the supply tx. Handles USDT reset-to-zero and DAI non-standard approval.
| Argument | Type | Description |
|---|---|---|
| chain* | string | |
| amount* | string | number | Loan token amount in human-readable decimals (e.g., "1000.50"), or "max" for full balance |
| marketId* | string | |
| userAddress* | string |
{
"type": "object",
"$schema": "http://json-schema.org/draft-07/schema#",
"required": [
"chain",
"marketId",
"userAddress",
"amount"
],
"properties": {
"chain": {
"enum": [
"ethereum",
"base",
"arbitrum",
"optimism",
"polygon",
"unichain",
"worldchain",
"katana",
"hyperevm",
"monad",
"stable"
],
"type": "string"
},
"amount": {
"type": [
"string",
"number"
],
"description": "Loan token amount in human-readable decimals (e.g., \"1000.50\"), or \"max\" for full balance"
},
"marketId": {
"type": "string",
"pattern": "^0x[a-fA-F0-9]{64}$"
},
"userAddress": {
"type": "string",
"pattern": "^0x[a-fA-F0-9]{40}$"
}
},
"additionalProperties": false
}Prepare a supply of collateral tokens to a Morpho Blue market without borrowing. Checks on-chain allowance and returns a ready-to-sign transactions array with approval txs (if needed) followed by the supply collateral tx. Handles USDT reset-to-zero and DAI non-standard approval.
| Argument | Type | Description |
|---|---|---|
| chain* | string | |
| amount* | string | number | Collateral token amount in human-readable decimals (e.g., "1.5" for 1.5 WETH), or "max" for full balance |
| marketId* | string | |
| userAddress* | string |
{
"type": "object",
"$schema": "http://json-schema.org/draft-07/schema#",
"required": [
"chain",
"marketId",
"userAddress",
"amount"
],
"properties": {
"chain": {
"enum": [
"ethereum",
"base",
"arbitrum",
"optimism",
"polygon",
"unichain",
"worldchain",
"katana",
"hyperevm",
"monad",
"stable"
],
"type": "string"
},
"amount": {
"type": [
"string",
"number"
],
"description": "Collateral token amount in human-readable decimals (e.g., \"1.5\" for 1.5 WETH), or \"max\" for full balance"
},
"marketId": {
"type": "string",
"pattern": "^0x[a-fA-F0-9]{64}$"
},
"userAddress": {
"type": "string",
"pattern": "^0x[a-fA-F0-9]{40}$"
}
},
"additionalProperties": false
}Prepare one transaction that supplies collateral and borrows from a Morpho Blue market, including when the user has no collateral on-chain yet. A BlueBundlesV1 authorization transaction may come first in transactions.
| Argument | Type | Description |
|---|---|---|
| chain* | string | |
| marketId* | string | |
| userAddress* | string | |
| borrowAmount* | string | number | Loan token amount to borrow in human-readable decimals |
| collateralAmount* | string | number | Collateral token amount to supply in human-readable decimals |
{
"type": "object",
"$schema": "http://json-schema.org/draft-07/schema#",
"required": [
"chain",
"marketId",
"userAddress",
"collateralAmount",
"borrowAmount"
],
"properties": {
"chain": {
"enum": [
"ethereum",
"base",
"arbitrum",
"optimism",
"polygon",
"unichain",
"worldchain",
"katana",
"hyperevm",
"monad",
"stable"
],
"type": "string"
},
"marketId": {
"type": "string",
"pattern": "^0x[a-fA-F0-9]{64}$"
},
"userAddress": {
"type": "string",
"pattern": "^0x[a-fA-F0-9]{40}$"
},
"borrowAmount": {
"type": [
"string",
"number"
],
"description": "Loan token amount to borrow in human-readable decimals"
},
"collateralAmount": {
"type": [
"string",
"number"
],
"description": "Collateral token amount to supply in human-readable decimals"
}
},
"additionalProperties": false
}Prepare a withdraw from a Morpho vault. Returns a ready-to-sign transactions array. Supports "max" for full withdrawal. A vault-share approval transaction may come first and is listed in requirements.
| Argument | Type | Description |
|---|---|---|
| chain* | string | |
| amount* | string | number | Token amount in human-readable decimals (e.g., "1000.50"), or "max" for full withdrawal |
| userAddress* | string | |
| vaultAddress* | string |
{
"type": "object",
"$schema": "http://json-schema.org/draft-07/schema#",
"required": [
"chain",
"vaultAddress",
"userAddress",
"amount"
],
"properties": {
"chain": {
"enum": [
"ethereum",
"base",
"arbitrum",
"optimism",
"polygon",
"unichain",
"worldchain",
"katana",
"hyperevm",
"monad",
"stable"
],
"type": "string"
},
"amount": {
"type": [
"string",
"number"
],
"description": "Token amount in human-readable decimals (e.g., \"1000.50\"), or \"max\" for full withdrawal"
},
"userAddress": {
"type": "string",
"pattern": "^0x[a-fA-F0-9]{40}$"
},
"vaultAddress": {
"type": "string",
"pattern": "^0x[a-fA-F0-9]{40}$"
}
},
"additionalProperties": false
}Prepare a withdrawal of collateral tokens from a Morpho Blue market position. Returns a ready-to-sign transactions array. Supports "max" for full collateral withdrawal. Includes health factor check when user has active borrows. A BlueBundlesV1 authorization transaction may come first in transactions.
| Argument | Type | Description |
|---|---|---|
| chain* | string | |
| amount* | string | number | Collateral token amount in human-readable decimals (e.g., "1.5"), or "max" for full withdrawal |
| marketId* | string | |
| userAddress* | string |
{
"type": "object",
"$schema": "http://json-schema.org/draft-07/schema#",
"required": [
"chain",
"marketId",
"userAddress",
"amount"
],
"properties": {
"chain": {
"enum": [
"ethereum",
"base",
"arbitrum",
"optimism",
"polygon",
"unichain",
"worldchain",
"katana",
"hyperevm",
"monad",
"stable"
],
"type": "string"
},
"amount": {
"type": [
"string",
"number"
],
"description": "Collateral token amount in human-readable decimals (e.g., \"1.5\"), or \"max\" for full withdrawal"
},
"marketId": {
"type": "string",
"pattern": "^0x[a-fA-F0-9]{64}$"
},
"userAddress": {
"type": "string",
"pattern": "^0x[a-fA-F0-9]{40}$"
}
},
"additionalProperties": false
}List Morpho Blue markets, filterable by chain, loan token and collateral token. Paginate by passing back `cursor` until it is null.
| Argument | Type | Description |
|---|---|---|
| limit | integer | Maximum number of items to return. |
| cursor | string | Opaque cursor from a previous page response. |
| listed | string | Filter by listing status. When true, returns only markets surfaced by the app trust layer; when false, only unlisted markets. Omit to return both. |
| sort_by | string | Sort field for cursor pagination. Markets without a value for the sort field (for example, unpriced markets on USD sorts) come last in both directions. |
| chain_ids | array | Filter by chain ids. Required when `loan_tokens` or `collateral_tokens` is provided. Omit to list markets on every chain the API exposes. |
| loan_tokens | array | Filter by loan token addresses. Combine with chain_ids; lowercase input is checksummed. |
| sort_direction | string | Sort direction for cursor pagination. |
| collateral_tokens |
List Morpho vaults (V1 and V2) with net APY, total assets and liquidity in USD, curators, warnings, and `version`. Filter by `chain_ids`, `search`, and other supported fields. Paginate by passing back `cursor` until it is null.
| Argument | Type | Description |
|---|---|---|
| limit | integer | Page size. Defaults to 100, at most 1000. |
| assets | array | Underlying asset selectors, `<chain_id>:<address>` — the same values the `assets` facet returns. |
| cursor | string | Opaque cursor returned by the previous page. |
| search | string | Case-insensitive substring of the vault name or address, the asset symbol or address, or a curator name. |
| sort_by | string | Sort key. Rows with a null sort value come last, except `performance_fee` and `management_fee`, where a null fee sorts as 0 (V1 vaults have no management fee). |
| versions | array | Vault versions to list. Defaults to every version. |
| chain_ids | array | Chains to list. Defaults to every chain the app exposes. |
| curator_ids | array |
Simulate transactions on the latest block with eth_simulateV1 and check them against the limits of the Morpho action the user is taking, without sending anything. Use mode "preview" for unsigned calls, listing pending approvals or permits in `authorizations`; use mode "final" for calls whose signatures are already in the calldata, or pass a raw signed transaction as `signedTransaction`. `limits.operations` names each Morpho action in the bundle, for example `{ type: "vaultV2Deposit", vault, inputs: { assets } }` or `{ type: "blueBorrow", marketId, inputs: { assets } }`, so the simulation checks what the user pays, receives and holds; when a prepare tool returned `simulation_limits`, pass that as `limits`; use "none" only for bundles no operation type covers (reward claims, approval-only bundles). Amounts are integer strings in base units. Returns every simulated call, transfers, per-account asset changes and the checked limits, or `status: "failed"` with the error code and revert data. Health factor and LTV are not checked. Nothing is signed or sent.
| Argument | Type | Description |
|---|---|---|
| mode* | string | |
| limits* | any | |
| chainId* | integer | |
| blockNumber | string | |
| transactions* | array | |
We read every tool's name, description and inputs the way the model will, looking for instructions hidden from you. A clean result means no warning signs, not a guarantee. Scanned Nov 6, 2026.
A very long tool description (over 4,000 characters) is hard to review and easy to hide instructions in.
Fix: Keep the description to what the tool does and when to use it; move reference material to resources or docs.
| Target assets amount. Provide exactly one of `assets` or `units`. |
| slippage | string | 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`. |
| market-id* | string | Market ID whose book to quote (`market_id` in responses). |
| average_worst_price | string | Optional 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`. |
{
"type": "object",
"required": [
"market-id",
"side"
],
"properties": {
"side": {
"enum": [
"asks",
"bids"
],
"type": "string",
"description": "Book side to quote (`asks` or `bids`)."
},
"limit": {
"type": "string",
"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."
},
"units": {
"type": "string",
"description": "Target unit amount. Provide exactly one of `assets` or `units`."
},
"assets": {
"type": "string",
"description": "Target assets amount. Provide exactly one of `assets` or `units`."
},
"slippage": {
"type": "string",
"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`."
},
"market-id": {
"type": "string",
"example": "0xcc9418ea594c6e658650aedd205ce4544b266b69493f56fd2adc65c14bd06738",
"description": "Market ID whose book to quote (`market_id` in responses)."
},
"average_worst_price": {
"type": "string",
"description": "Optional 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`."
}
}
}{
"type": "object",
"required": [
"group-id"
],
"properties": {
"maker": {
"type": "string",
"description": "Filter by offer maker address."
},
"chain_id": {
"enum": [
1,
8453,
5042,
4663
],
"type": "integer",
"maximum": 9007199254740991,
"description": "Filter by chain id.",
"exclusiveMinimum": 0
},
"group-id": {
"type": "string",
"example": "0x0bab51fab64157bc1011ce65b9bf9b2b11f202b8a7ab76b408cf40b8adf069d3",
"description": "Offer group id."
}
}
}| maturity_gte | integer | Inclusive lower maturity bound in unix seconds. |
| maturity_lte | integer | Inclusive upper maturity bound in unix seconds. |
| collateral_tokens | array | Collateral token filter (comma-separated, matches any collateral). Maximum 150 values. |
{
"type": "object",
"required": [],
"properties": {
"ids": {
"type": "string",
"description": "Market ID filter as a single comma-separated query parameter. Returns books for matching currently listed markets. Maximum 20 IDs."
},
"sort": {
"type": "string",
"description": "Sort by comma-separated fields (`id`, `ask`, `bid`, `maturity`). Prefix a field with `-` for descending. Max 3 fields."
},
"limit": {
"type": "number",
"description": "Maximum number of items to return (max 20, default 10)."
},
"cursor": {
"type": "string",
"description": "Opaque pagination cursor from a previous response."
},
"chain_ids": {
"type": "array",
"items": {
"enum": [
1,
8453,
5042,
4663
],
"type": "number"
},
"maxItems": 1,
"description": "Chain ID filter (comma-separated). Currently accepts at most one chain id."
},
"maturities": {
"type": "array",
"items": {
"type": "integer",
"maximum": 9007199254740991,
"minimum": 1
},
"maxItems": 150,
"description": "Exact maturity timestamp filter in unix seconds (comma-separated). Maximum 150 values."
},
"loan_tokens": {
"type": "array",
"items": {
"type": "string"
},
"maxItems": 150,
"description": "Loan token address filter (comma-separated). Maximum 150 values."
},
"maturity_gte": {
"type": "integer",
"maximum": 9007199254740991,
"minimum": 1,
"description": "Inclusive lower maturity bound in unix seconds."
},
"maturity_lte": {
"type": "integer",
"maximum": 9007199254740991,
"minimum": 1,
"description": "Inclusive upper maturity bound in unix seconds."
},
"collateral_tokens": {
"type": "array",
"items": {
"type": "string"
},
"maxItems": 150,
"description": "Collateral token filter (comma-separated, matches any collateral). Maximum 150 values."
}
}
}| chain_ids |
| array |
| Filter by chain ids. Supported chains: Ethereum (1), Base (8453), Arc (5042), and Robinhood Chain (4663). Required when loan_assets is provided. |
| market-id* | string | Midnight market id. |
| credit_gte | string | Filter for credit greater than or equal to this value. |
| credit_lte | string | Filter for credit less than or equal to this value. |
| maturities | array | Filter by exact maturity timestamps, in unix seconds. |
| active_only | string | When true, keep only positions whose market has not matured yet. |
| loan_assets | array | Filter by loan token addresses. Combine with chain_ids; lowercase input is checksummed. |
| maturity_gte | any | Filter for maturities greater than or equal to this unix timestamp. |
| maturity_lte | any | Filter for maturities less than or equal to this unix timestamp. |
| cost_basis_gte | string | Filter for cost basis greater than or equal to this value. |
| cost_basis_lte | string | Filter for cost basis less than or equal to this value. |
| created_at_gte | any | Filter for position created_at greater than or equal to this unix timestamp. |
| created_at_lte | any | Filter for position created_at less than or equal to this unix timestamp. |
| sort_direction | string | Sort direction for cursor pagination. |
| pending_fee_gte | string | Filter for pending fee greater than or equal to this value. |
| pending_fee_lte | string | Filter for pending fee less than or equal to this value. |
| effective_rate_wad_gte | string | Filter for compounded effective rate WAD greater than or equal to this value. |
| effective_rate_wad_lte | string | Filter for compounded effective rate WAD less than or equal to this value. |
{
"type": "object",
"required": [
"market-id"
],
"properties": {
"limit": {
"type": "integer",
"default": 100,
"maximum": 100,
"minimum": 1,
"description": "Maximum number of items to return."
},
"types": {
"type": "array",
"items": {
"enum": [
"lend",
"borrow",
"collateral_only"
],
"type": "string"
},
"maxItems": 100,
"description": "Filter by position type."
},
"cursor": {
"type": "string",
"maxLength": 4096,
"minLength": 1,
"description": "Opaque cursor from a previous page response."
},
"sort_by": {
"enum": [
"created_at",
"credit",
"debt",
"maturity",
"cost_basis",
"effective_rate_wad"
],
"type": "string",
"default": "created_at",
"description": "Sort field for cursor pagination."
},
"debt_gte": {
"type": "string",
"pattern": "^\\d{1,78}$",
"description": "Filter for debt greater than or equal to this value."
},
"debt_lte": {
"type": "string",
"pattern": "^\\d{1,78}$",
"description": "Filter for debt less than or equal to this value."
},
"chain_ids": {
"type": "array",
"items": {
"enum": [
1,
8453,
5042,
4663
],
"type": "integer",
"maximum": 9007199254740991,
"exclusiveMinimum": 0
},
"maxItems": 100,
"description": "Filter by chain ids. Supported chains: Ethereum (1), Base (8453), Arc (5042), and Robinhood Chain (4663). Required when loan_assets is provided."
},
"market-id": {
"type": "string",
"example": "0xcc9418ea594c6e658650aedd205ce4544b266b69493f56fd2adc65c14bd06738",
"description": "Midnight market id."
},
"credit_gte": {
"type": "string",
"pattern": "^\\d{1,78}$",
"description": "Filter for credit greater than or equal to this value."
},
"credit_lte": {
"type": "string",
"pattern": "^\\d{1,78}$",
"description": "Filter for credit less than or equal to this value."
},
"maturities": {
"type": "array",
"items": {
"anyOf": [
{
"type": "string",
"pattern": "^\\d+$",
"maxLength": 16
},
{
"type": "integer",
"maximum": 9007199254740991,
"minimum": 0
}
]
},
"maxItems": 100,
"description": "Filter by exact maturity timestamps, in unix seconds."
},
"active_only": {
"enum": [
"true",
"false"
],
"type": "string",
"description": "When true, keep only positions whose market has not matured yet."
},
"loan_assets": {
"type": "array",
"items": {
"type": "string"
},
"maxItems": 100,
"description": "Filter by loan token addresses. Combine with chain_ids; lowercase input is checksummed."
},
"maturity_gte": {
"anyOf": [
{
"type": "string",
"pattern": "^\\d+$",
"maxLength": 16
},
{
"type": "integer",
"maximum": 9007199254740991,
"minimum": 0
}
],
"description": "Filter for maturities greater than or equal to this unix timestamp."
},
"maturity_lte": {
"anyOf": [
{
"type": "string",
"pattern": "^\\d+$",
"maxLength": 16
},
{
"type": "integer",
"maximum": 9007199254740991,
"minimum": 0
}
],
"description": "Filter for maturities less than or equal to this unix timestamp."
},
"cost_basis_gte": {
"type": "string",
"pattern": "^\\d{1,78}$",
"description": "Filter for cost basis greater than or equal to this value."
},
"cost_basis_lte": {
"type": "string",
"pattern": "^\\d{1,78}$",
"description": "Filter for cost basis less than or equal to this value."
},
"created_at_gte": {
"anyOf": [
{
"type": "string",
"pattern": "^\\d+$",
"maxLength": 16
},
{
"type": "integer",
"maximum": 9007199254740991,
"minimum": 0
}
],
"description": "Filter for position created_at greater than or equal to this unix timestamp."
},
"created_at_lte": {
"anyOf": [
{
"type": "string",
"pattern": "^\\d+$",
"maxLength": 16
},
{
"type": "integer",
"maximum": 9007199254740991,
"minimum": 0
}
],
"description": "Filter for position created_at less than or equal to this unix timestamp."
},
"sort_direction": {
"enum": [
"asc",
"desc"
],
"type": "string",
"default": "desc",
"description": "Sort direction for cursor pagination."
},
"pending_fee_gte": {
"type": "string",
"pattern": "^\\d{1,78}$",
"description": "Filter for pending fee greater than or equal to this value."
},
"pending_fee_lte": {
"type": "string",
"pattern": "^\\d{1,78}$",
"description": "Filter for pending fee less than or equal to this value."
},
"effective_rate_wad_gte": {
"type": "string",
"pattern": "^-?\\d{1,78}$",
"description": "Filter for compounded effective rate WAD greater than or equal to this value."
},
"effective_rate_wad_lte": {
"type": "string",
"pattern": "^-?\\d{1,78}$",
"description": "Filter for compounded effective rate WAD less than or equal to this value."
}
}
}| Filter by Midnight market ids. These ids are globally unique. |
| maturities | array | Filter by exact maturity timestamps, in unix seconds. |
| active_only | string | When true, enforces maturity strictly after the current timestamp. |
| enter_gates | array | Filter by enter gate addresses. Combine with chain_ids; lowercase input is checksummed. |
| loan_assets | array | Filter by loan token addresses. Combine with chain_ids; lowercase input is checksummed. |
| maturity_gte | any | Filter for maturities greater than or equal to this unix timestamp. |
| maturity_lte | any | Filter for maturities less than or equal to this unix timestamp. |
| lend_depth_gte | string | Filter for cached lend-side order-book depth, in loan-token units, greater than or equal to this value. |
| lend_depth_lte | string | Filter for cached lend-side order-book depth, in loan-token units, less than or equal to this value. |
| sort_direction | string | Sort direction for cursor pagination. |
| total_units_gte | string | Filter for total units greater than or equal to this value. |
| total_units_lte | string | Filter for total units less than or equal to this value. |
| borrow_depth_gte | string | Filter for cached borrow-side order-book depth, in loan-token units, greater than or equal to this value. |
| borrow_depth_lte | string | Filter for cached borrow-side order-book depth, in loan-token units, less than or equal to this value. |
| liquidator_gates | array | Filter by liquidator gate addresses. Combine with chain_ids; lowercase input is checksummed. |
| oracle_addresses | array | Filter by collateral oracle addresses. Combine with chain_ids; lowercase input is checksummed. |
| collateral_assets | array | Filter by collateral token addresses. Combine with chain_ids; lowercase input is checksummed. |
| market_family_ids | array | Filter by Midnight market family ids. A family contains markets whose immutable parameters differ only by maturity. |
{
"type": "object",
"required": [],
"properties": {
"limit": {
"type": "integer",
"default": 100,
"maximum": 1000,
"minimum": 1,
"description": "Maximum number of items to return."
},
"cursor": {
"type": "string",
"maxLength": 4096,
"minLength": 1,
"description": "Opaque cursor from a previous page response."
},
"listed": {
"enum": [
"true",
"false"
],
"type": "string",
"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."
},
"sort_by": {
"enum": [
"total_units",
"maturity",
"lend_depth",
"borrow_depth"
],
"type": "string",
"default": "total_units",
"description": "Sort field for cursor pagination."
},
"chain_ids": {
"type": "array",
"items": {
"enum": [
1,
8453,
5042,
4663
],
"type": "integer",
"maximum": 9007199254740991,
"exclusiveMinimum": 0
},
"maxItems": 100,
"description": "Filter by chain ids. Supported chains: Ethereum (1), Base (8453), Arc (5042), and Robinhood Chain (4663). Required when any address filter is provided."
},
"market_ids": {
"type": "array",
"items": {
"type": "string"
},
"maxItems": 100,
"description": "Filter by Midnight market ids. These ids are globally unique."
},
"maturities": {
"type": "array",
"items": {
"anyOf": [
{
"type": "string",
"pattern": "^\\d+$",
"maxLength": 16
},
{
"type": "integer",
"maximum": 9007199254740991,
"minimum": 0
}
]
},
"maxItems": 100,
"description": "Filter by exact maturity timestamps, in unix seconds."
},
"active_only": {
"enum": [
"true",
"false"
],
"type": "string",
"description": "When true, enforces maturity strictly after the current timestamp."
},
"enter_gates": {
"type": "array",
"items": {
"type": "string"
},
"maxItems": 100,
"description": "Filter by enter gate addresses. Combine with chain_ids; lowercase input is checksummed."
},
"loan_assets": {
"type": "array",
"items": {
"type": "string"
},
"maxItems": 100,
"description": "Filter by loan token addresses. Combine with chain_ids; lowercase input is checksummed."
},
"maturity_gte": {
"anyOf": [
{
"type": "string",
"pattern": "^\\d+$",
"maxLength": 16
},
{
"type": "integer",
"maximum": 9007199254740991,
"minimum": 0
}
],
"description": "Filter for maturities greater than or equal to this unix timestamp."
},
"maturity_lte": {
"anyOf": [
{
"type": "string",
"pattern": "^\\d+$",
"maxLength": 16
},
{
"type": "integer",
"maximum": 9007199254740991,
"minimum": 0
}
],
"description": "Filter for maturities less than or equal to this unix timestamp."
},
"lend_depth_gte": {
"type": "string",
"pattern": "^\\d{1,78}$",
"description": "Filter for cached lend-side order-book depth, in loan-token units, greater than or equal to this value."
},
"lend_depth_lte": {
"type": "string",
"pattern": "^\\d{1,78}$",
"description": "Filter for cached lend-side order-book depth, in loan-token units, less than or equal to this value."
},
"sort_direction": {
"enum": [
"asc",
"desc"
],
"type": "string",
"default": "desc",
"description": "Sort direction for cursor pagination."
},
"total_units_gte": {
"type": "string",
"pattern": "^\\d{1,78}$",
"description": "Filter for total units greater than or equal to this value."
},
"total_units_lte": {
"type": "string",
"pattern": "^\\d{1,78}$",
"description": "Filter for total units less than or equal to this value."
},
"borrow_depth_gte": {
"type": "string",
"pattern": "^\\d{1,78}$",
"description": "Filter for cached borrow-side order-book depth, in loan-token units, greater than or equal to this value."
},
"borrow_depth_lte": {
"type": "string",
"pattern": "^\\d{1,78}$",
"description": "Filter for cached borrow-side order-book depth, in loan-token units, less than or equal to this value."
},
"liquidator_gates": {
"type": "array",
"items": {
"type": "string"
},
"maxItems": 100,
"description": "Filter by liquidator gate addresses. Combine with chain_ids; lowercase input is checksummed."
},
"oracle_addresses": {
"type": "array",
"items": {
"type": "string"
},
"maxItems": 100,
"description": "Filter by collateral oracle addresses. Combine with chain_ids; lowercase input is checksummed."
},
"collateral_assets": {
"type": "array",
"items": {
"type": "string"
},
"maxItems": 100,
"description": "Filter by collateral token addresses. Combine with chain_ids; lowercase input is checksummed."
},
"market_family_ids": {
"type": "array",
"items": {
"type": "string"
},
"maxItems": 100,
"description": "Filter by Midnight market family ids. A family contains markets whose immutable parameters differ only by maturity."
}
}
}| Argument | Type | Description |
|---|---|---|
| limit | integer | Maximum number of groups to return. |
| types | array | 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. |
| cursor | string | Opaque cursor from a previous page response. |
| groups | array | Filter by offer group ids. Combined with market_ids, loan_assets, collateral_assets, and maturities using AND semantics. |
| listed | string | 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. |
| status | string | Deprecated single-value alias for statuses. Omit both status and statuses to return active groups. |
| sort_by | string | Sort field for group cursor pagination. |
| statuses | array | 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. |
| chain_ids | array | Filter by chain ids. Supported chains: Ethereum (1), Base (8453), Arc (5042), and Robinhood Chain (4663). |
| market_ids | array | Filter groups to those containing offers in the requested lifecycle and Midnight markets. Nested offers are not narrowed by this filter. |
| maturities | array | 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. |
| loan_assets | array | Filter nested offers in the requested lifecycle by loan token addresses. Combined with market_ids, collateral_assets, maturities, and groups using AND semantics. |
| maturity_gte | any | 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. |
| maturity_lte | any | 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. |
| user-address* | string | User address whose offer groups should be listed. |
| callback_type | string | 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. |
| created_at_gte | any | Filter for group created_at greater than or equal to this unix timestamp. |
| created_at_lte | any | Filter for group created_at less than or equal to this unix timestamp. |
| sort_direction | string | Sort direction for group cursor pagination. |
| collateral_assets | array | 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. |
| market_family_ids | array | 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. |
{
"type": "object",
"required": [
"user-address"
],
"properties": {
"limit": {
"type": "integer",
"default": 100,
"maximum": 100,
"minimum": 1,
"description": "Maximum number of groups to return."
},
"types": {
"type": "array",
"items": {
"enum": [
"buy",
"sell_reduce_only",
"sell",
"buy_reduce_only"
],
"type": "string"
},
"maxItems": 20,
"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."
},
"cursor": {
"type": "string",
"maxLength": 4096,
"minLength": 1,
"description": "Opaque cursor from a previous page response."
},
"groups": {
"type": "array",
"items": {
"type": "string"
},
"maxItems": 20,
"description": "Filter by offer group ids. Combined with market_ids, loan_assets, collateral_assets, and maturities using AND semantics."
},
"listed": {
"enum": [
"true",
"false"
],
"type": "string",
"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."
},
"status": {
"enum": [
"scheduled",
"active",
"filled",
"expired",
"cancelled"
],
"type": "string",
"description": "Deprecated single-value alias for statuses. Omit both status and statuses to return active groups."
},
"sort_by": {
"enum": [
"id",
"created_at"
],
"type": "string",
"default": "id",
"description": "Sort field for group cursor pagination."
},
"statuses": {
"type": "array",
"items": {
"enum": [
"scheduled",
"active",
"filled",
"expired",
"cancelled"
],
"type": "string"
},
"maxItems": 5,
"minItems": 1,
"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."
},
"chain_ids": {
"type": "array",
"items": {
"enum": [
1,
8453,
5042,
4663
],
"type": "integer",
"maximum": 9007199254740991,
"exclusiveMinimum": 0
},
"maxItems": 100,
"description": "Filter by chain ids. Supported chains: Ethereum (1), Base (8453), Arc (5042), and Robinhood Chain (4663)."
},
"market_ids": {
"type": "array",
"items": {
"type": "string"
},
"maxItems": 20,
"description": "Filter groups to those containing offers in the requested lifecycle and Midnight markets. Nested offers are not narrowed by this filter."
},
"maturities": {
"type": "array",
"items": {
"anyOf": [
{
"type": "string",
"pattern": "^\\d+$",
"maxLength": 16
},
{
"type": "integer",
"maximum": 9007199254740991,
"minimum": 0
}
]
},
"maxItems": 20,
"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."
},
"loan_assets": {
"type": "array",
"items": {
"type": "string"
},
"maxItems": 20,
"description": "Filter nested offers in the requested lifecycle by loan token addresses. Combined with market_ids, collateral_assets, maturities, and groups using AND semantics."
},
"maturity_gte": {
"anyOf": [
{
"type": "string",
"pattern": "^\\d+$",
"maxLength": 16
},
{
"type": "integer",
"maximum": 9007199254740991,
"minimum": 0
}
],
"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."
},
"maturity_lte": {
"anyOf": [
{
"type": "string",
"pattern": "^\\d+$",
"maxLength": 16
},
{
"type": "integer",
"maximum": 9007199254740991,
"minimum": 0
}
],
"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."
},
"user-address": {
"type": "string",
"example": "0x958eB498a4172EA513c79b09E7f064070C5b1917",
"description": "User address whose offer groups should be listed."
},
"callback_type": {
"enum": [
"blue_buy"
],
"type": "string",
"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."
},
"created_at_gte": {
"anyOf": [
{
"type": "string",
"pattern": "^\\d+$",
"maxLength": 16
},
{
"type": "integer",
"maximum": 9007199254740991,
"minimum": 0
}
],
"description": "Filter for group created_at greater than or equal to this unix timestamp."
},
"created_at_lte": {
"anyOf": [
{
"type": "string",
"pattern": "^\\d+$",
"maxLength": 16
},
{
"type": "integer",
"maximum": 9007199254740991,
"minimum": 0
}
],
"description": "Filter for group created_at less than or equal to this unix timestamp."
},
"sort_direction": {
"enum": [
"asc",
"desc"
],
"type": "string",
"default": "asc",
"description": "Sort direction for group cursor pagination."
},
"collateral_assets": {
"type": "array",
"items": {
"type": "string"
},
"maxItems": 20,
"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."
},
"market_family_ids": {
"type": "array",
"items": {
"type": "string"
},
"maxItems": 20,
"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."
}
}
}| string |
| Filter by market listing status. When true, returns only positions on listed markets; when false, only positions on unlisted markets. Omit to return both. |
| sort_by | string | Sort field for cursor pagination. |
| debt_gte | string | Filter for debt greater than or equal to this value. |
| debt_lte | string | Filter for debt less than or equal to this value. |
| chain_ids | array | Filter by chain ids. Supported chains: Ethereum (1), Base (8453), Arc (5042), and Robinhood Chain (4663). Required when loan_assets is provided. |
| credit_gte | string | Filter for credit greater than or equal to this value. |
| credit_lte | string | Filter for credit less than or equal to this value. |
| market_ids | array | Filter by Midnight market ids. |
| maturities | array | Filter by exact maturity timestamps, in unix seconds. |
| active_only | string | When true, keep only positions whose market has not matured yet. |
| loan_assets | array | Filter by loan token addresses. Combine with chain_ids; lowercase input is checksummed. |
| maturity_gte | any | Filter for maturities greater than or equal to this unix timestamp. |
| maturity_lte | any | Filter for maturities less than or equal to this unix timestamp. |
| user-address* | string | User address to list positions for. Lowercase input is checksummed. |
| cost_basis_gte | string | Filter for cost basis greater than or equal to this value. |
| cost_basis_lte | string | Filter for cost basis less than or equal to this value. |
| created_at_gte | any | Filter for position created_at greater than or equal to this unix timestamp. |
| created_at_lte | any | Filter for position created_at less than or equal to this unix timestamp. |
| sort_direction | string | Sort direction for cursor pagination. |
| pending_fee_gte | string | Filter for pending fee greater than or equal to this value. |
| pending_fee_lte | string | Filter for pending fee less than or equal to this value. |
| collateral_assets | array | Filter by configured market collateral token addresses. Combine with chain_ids; lowercase input is checksummed. |
| market_family_ids | array | Filter by Midnight market family ids. Combined with market_ids using AND semantics. |
| effective_rate_wad_gte | string | Filter for compounded effective rate WAD greater than or equal to this value. |
| effective_rate_wad_lte | string | Filter for compounded effective rate WAD less than or equal to this value. |
{
"type": "object",
"required": [
"user-address"
],
"properties": {
"limit": {
"type": "integer",
"default": 100,
"maximum": 100,
"minimum": 1,
"description": "Maximum number of items to return."
},
"types": {
"type": "array",
"items": {
"enum": [
"lend",
"borrow",
"collateral_only"
],
"type": "string"
},
"maxItems": 100,
"description": "Filter by position type."
},
"cursor": {
"type": "string",
"maxLength": 4096,
"minLength": 1,
"description": "Opaque cursor from a previous page response."
},
"listed": {
"enum": [
"true",
"false"
],
"type": "string",
"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."
},
"sort_by": {
"enum": [
"created_at",
"credit",
"debt",
"maturity",
"cost_basis",
"effective_rate_wad"
],
"type": "string",
"default": "created_at",
"description": "Sort field for cursor pagination."
},
"debt_gte": {
"type": "string",
"pattern": "^\\d{1,78}$",
"description": "Filter for debt greater than or equal to this value."
},
"debt_lte": {
"type": "string",
"pattern": "^\\d{1,78}$",
"description": "Filter for debt less than or equal to this value."
},
"chain_ids": {
"type": "array",
"items": {
"enum": [
1,
8453,
5042,
4663
],
"type": "integer",
"maximum": 9007199254740991,
"exclusiveMinimum": 0
},
"maxItems": 100,
"description": "Filter by chain ids. Supported chains: Ethereum (1), Base (8453), Arc (5042), and Robinhood Chain (4663). Required when loan_assets is provided."
},
"credit_gte": {
"type": "string",
"pattern": "^\\d{1,78}$",
"description": "Filter for credit greater than or equal to this value."
},
"credit_lte": {
"type": "string",
"pattern": "^\\d{1,78}$",
"description": "Filter for credit less than or equal to this value."
},
"market_ids": {
"type": "array",
"items": {
"type": "string"
},
"maxItems": 100,
"description": "Filter by Midnight market ids."
},
"maturities": {
"type": "array",
"items": {
"anyOf": [
{
"type": "string",
"pattern": "^\\d+$",
"maxLength": 16
},
{
"type": "integer",
"maximum": 9007199254740991,
"minimum": 0
}
]
},
"maxItems": 100,
"description": "Filter by exact maturity timestamps, in unix seconds."
},
"active_only": {
"enum": [
"true",
"false"
],
"type": "string",
"description": "When true, keep only positions whose market has not matured yet."
},
"loan_assets": {
"type": "array",
"items": {
"type": "string"
},
"maxItems": 100,
"description": "Filter by loan token addresses. Combine with chain_ids; lowercase input is checksummed."
},
"maturity_gte": {
"anyOf": [
{
"type": "string",
"pattern": "^\\d+$",
"maxLength": 16
},
{
"type": "integer",
"maximum": 9007199254740991,
"minimum": 0
}
],
"description": "Filter for maturities greater than or equal to this unix timestamp."
},
"maturity_lte": {
"anyOf": [
{
"type": "string",
"pattern": "^\\d+$",
"maxLength": 16
},
{
"type": "integer",
"maximum": 9007199254740991,
"minimum": 0
}
],
"description": "Filter for maturities less than or equal to this unix timestamp."
},
"user-address": {
"type": "string",
"example": "0xd4F43105098845fFE89B16E7A3DCdd0A31898118",
"description": "User address to list positions for. Lowercase input is checksummed."
},
"cost_basis_gte": {
"type": "string",
"pattern": "^\\d{1,78}$",
"description": "Filter for cost basis greater than or equal to this value."
},
"cost_basis_lte": {
"type": "string",
"pattern": "^\\d{1,78}$",
"description": "Filter for cost basis less than or equal to this value."
},
"created_at_gte": {
"anyOf": [
{
"type": "string",
"pattern": "^\\d+$",
"maxLength": 16
},
{
"type": "integer",
"maximum": 9007199254740991,
"minimum": 0
}
],
"description": "Filter for position created_at greater than or equal to this unix timestamp."
},
"created_at_lte": {
"anyOf": [
{
"type": "string",
"pattern": "^\\d+$",
"maxLength": 16
},
{
"type": "integer",
"maximum": 9007199254740991,
"minimum": 0
}
],
"description": "Filter for position created_at less than or equal to this unix timestamp."
},
"sort_direction": {
"enum": [
"asc",
"desc"
],
"type": "string",
"default": "desc",
"description": "Sort direction for cursor pagination."
},
"pending_fee_gte": {
"type": "string",
"pattern": "^\\d{1,78}$",
"description": "Filter for pending fee greater than or equal to this value."
},
"pending_fee_lte": {
"type": "string",
"pattern": "^\\d{1,78}$",
"description": "Filter for pending fee less than or equal to this value."
},
"collateral_assets": {
"type": "array",
"items": {
"type": "string"
},
"maxItems": 100,
"description": "Filter by configured market collateral token addresses. Combine with chain_ids; lowercase input is checksummed."
},
"market_family_ids": {
"type": "array",
"items": {
"type": "string"
},
"maxItems": 100,
"description": "Filter by Midnight market family ids. Combined with market_ids using AND semantics."
},
"effective_rate_wad_gte": {
"type": "string",
"pattern": "^-?\\d{1,78}$",
"description": "Filter for compounded effective rate WAD greater than or equal to this value."
},
"effective_rate_wad_lte": {
"type": "string",
"pattern": "^-?\\d{1,78}$",
"description": "Filter for compounded effective rate WAD less than or equal to this value."
}
}
}{
"type": "object",
"$schema": "http://json-schema.org/draft-07/schema#",
"required": [
"chain",
"marketId",
"userAddress"
],
"properties": {
"chain": {
"enum": [
"ethereum",
"base",
"arbitrum",
"optimism",
"polygon",
"unichain",
"worldchain",
"katana",
"hyperevm",
"monad",
"stable"
],
"type": "string"
},
"marketId": {
"type": "string",
"pattern": "^0x[a-fA-F0-9]{64}$",
"description": "Midnight market ID (`market_id` from the Midnight read tools)"
},
"repayAmount": {
"type": [
"string",
"number"
],
"description": "Loan token amount to repay, in human-readable decimals, or \"max\" to repay all debt. \"0\" only withdraws collateral."
},
"userAddress": {
"type": "string",
"pattern": "^0x[a-fA-F0-9]{40}$",
"description": "Account that sends the transactions and owns the position"
},
"collateralIndex": {
"type": "integer",
"default": 0,
"maximum": 9007199254740991,
"minimum": 0,
"description": "Index of the collateral in the market `collaterals` list"
},
"collateralAmount": {
"type": [
"string",
"number"
],
"description": "Collateral token amount to withdraw, in human-readable decimals, or \"max\" for the full balance. Omit to only repay."
}
},
"additionalProperties": false
}| string | number |
| Collateral token amount to supply, in human-readable decimals |
{
"type": "object",
"$schema": "http://json-schema.org/draft-07/schema#",
"required": [
"chain",
"marketId",
"userAddress",
"collateralAmount",
"amount"
],
"properties": {
"chain": {
"enum": [
"ethereum",
"base",
"arbitrum",
"optimism",
"polygon",
"unichain",
"worldchain",
"katana",
"hyperevm",
"monad",
"stable"
],
"type": "string"
},
"amount": {
"type": [
"string",
"number"
],
"description": "Loan token amount to receive, in human-readable decimals (e.g. \"100\")"
},
"marketId": {
"type": "string",
"pattern": "^0x[a-fA-F0-9]{64}$",
"description": "Midnight market ID (`market_id` from the Midnight read tools)"
},
"slippage": {
"type": [
"string",
"number"
],
"description": "Slippage percentage applied to the book quote (e.g. \"0.5\" = 0.5%). Bounds the units filled at the quoted average price."
},
"userAddress": {
"type": "string",
"pattern": "^0x[a-fA-F0-9]{40}$",
"description": "Account that sends the transactions and owns the position"
},
"collateralIndex": {
"type": "integer",
"default": 0,
"maximum": 9007199254740991,
"minimum": 0,
"description": "Index of the collateral in the market `collaterals` list"
},
"collateralAmount": {
"type": [
"string",
"number"
],
"description": "Collateral token amount to supply, in human-readable decimals"
}
},
"additionalProperties": false
}| collateralAmount |
| string | number |
| Collateral token amount to withdraw after the repay, in human-readable decimals, or "max" for the full balance. Omit to only repay. |
{
"type": "object",
"$schema": "http://json-schema.org/draft-07/schema#",
"required": [
"chain",
"marketId",
"userAddress",
"amount"
],
"properties": {
"chain": {
"enum": [
"ethereum",
"base",
"arbitrum",
"optimism",
"polygon",
"unichain",
"worldchain",
"katana",
"hyperevm",
"monad",
"stable"
],
"type": "string"
},
"amount": {
"type": [
"string",
"number"
],
"description": "Loan token amount to spend buying back debt, in human-readable decimals"
},
"marketId": {
"type": "string",
"pattern": "^0x[a-fA-F0-9]{64}$",
"description": "Midnight market ID (`market_id` from the Midnight read tools)"
},
"slippage": {
"type": [
"string",
"number"
],
"description": "Slippage percentage applied to the book quote (e.g. \"0.5\" = 0.5%). Bounds the units filled at the quoted average price."
},
"userAddress": {
"type": "string",
"pattern": "^0x[a-fA-F0-9]{40}$",
"description": "Account that sends the transactions and owns the position"
},
"collateralIndex": {
"type": "integer",
"default": 0,
"maximum": 9007199254740991,
"minimum": 0,
"description": "Index of the collateral in the market `collaterals` list"
},
"collateralAmount": {
"type": [
"string",
"number"
],
"description": "Collateral token amount to withdraw after the repay, in human-readable decimals, or \"max\" for the full balance. Omit to only repay."
}
},
"additionalProperties": false
}| array |
| Filter by collateral token addresses. Combine with chain_ids; lowercase input is checksummed. |
{
"type": "object",
"required": [],
"properties": {
"limit": {
"type": "integer",
"default": 20,
"maximum": 100,
"minimum": 1,
"description": "Maximum number of items to return."
},
"cursor": {
"type": "string",
"minLength": 1,
"description": "Opaque cursor from a previous page response."
},
"listed": {
"enum": [
"true",
"false"
],
"type": "string",
"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."
},
"sort_by": {
"enum": [
"outstanding_loans_usd",
"liquidity_assets_usd",
"supply_apy",
"borrow_apy",
"lltv"
],
"type": "string",
"default": "outstanding_loans_usd",
"description": "Sort field for cursor pagination. Markets without a value for the sort field (for example, unpriced markets on USD sorts) come last in both directions."
},
"chain_ids": {
"type": "array",
"items": {
"type": "integer",
"maximum": 9007199254740991,
"exclusiveMinimum": 0
},
"maxItems": 100,
"description": "Filter by chain ids. Required when `loan_tokens` or `collateral_tokens` is provided. Omit to list markets on every chain the API exposes."
},
"loan_tokens": {
"type": "array",
"items": {
"type": "string"
},
"maxItems": 100,
"description": "Filter by loan token addresses. Combine with chain_ids; lowercase input is checksummed."
},
"sort_direction": {
"enum": [
"asc",
"desc"
],
"type": "string",
"default": "desc",
"description": "Sort direction for cursor pagination."
},
"collateral_tokens": {
"type": "array",
"items": {
"type": "string"
},
"maxItems": 100,
"description": "Filter by collateral token addresses. Combine with chain_ids; lowercase input is checksummed."
}
}
}| Curator ids to list, matched case-insensitively (lowercased before matching and cursor binding). |
| net_apy_gte | number | Minimum `net_apy`, as a decimal rate. Bounds the net APY (native net of fees plus rewards). |
| net_apy_lte | number | Maximum `net_apy`, as a decimal rate. Bounds the net APY (native net of fees plus rewards). |
| include_facets | string | Return the `facets` extra. Facets are only computed when true; the flag is not part of the cursor binding. |
| sort_direction | string |
| liquidity_usd_gte | number | Minimum `liquidity_usd`. Vaults with a null `liquidity_usd` are left out. |
| liquidity_usd_lte | number | Maximum `liquidity_usd`. Vaults with a null `liquidity_usd` are left out. |
| collateral_exposure | array | Collateral asset selectors, `<chain_id>:<address>` — the same values the `collateral_exposure` facet returns. Keeps only vaults allocating to any of these collaterals. |
| collateral_exclusion | array | Collateral asset selectors, `<chain_id>:<address>`. Drops vaults allocating to any of these collaterals; applies to every facet count. |
| total_assets_usd_gte | number | Minimum `total_assets_usd`. Vaults with a null `total_assets_usd` are left out. |
| total_assets_usd_lte | number | Maximum `total_assets_usd`. Vaults with a null `total_assets_usd` are left out. |
{
"type": "object",
"required": [],
"properties": {
"limit": {
"type": "integer",
"default": 100,
"maximum": 1000,
"minimum": 1,
"description": "Page size. Defaults to 100, at most 1000."
},
"assets": {
"type": "array",
"items": {
"type": "string",
"format": "<chainId>:<address>",
"example": "1:0x1234567890abcdef1234567890abcdef12345678"
},
"maxItems": 100,
"description": "Underlying asset selectors, `<chain_id>:<address>` — the same values the `assets` facet returns."
},
"cursor": {
"type": "string",
"maxLength": 4096,
"minLength": 1,
"description": "Opaque cursor returned by the previous page."
},
"search": {
"type": "string",
"maxLength": 100,
"minLength": 1,
"description": "Case-insensitive substring of the vault name or address, the asset symbol or address, or a curator name."
},
"sort_by": {
"enum": [
"total_assets_usd",
"name",
"net_apy",
"net_apy_excluding_rewards",
"performance_fee",
"management_fee",
"liquidity_usd",
"creation_timestamp"
],
"type": "string",
"default": "total_assets_usd",
"description": "Sort key. Rows with a null sort value come last, except `performance_fee` and `management_fee`, where a null fee sorts as 0 (V1 vaults have no management fee)."
},
"versions": {
"type": "array",
"items": {
"enum": [
"1.0",
"1.1",
"2.0"
],
"type": "string"
},
"maxItems": 100,
"description": "Vault versions to list. Defaults to every version."
},
"chain_ids": {
"type": "array",
"items": {
"type": "integer",
"maximum": 9007199254740991,
"exclusiveMinimum": 0
},
"maxItems": 100,
"description": "Chains to list. Defaults to every chain the app exposes."
},
"curator_ids": {
"type": "array",
"items": {
"type": "string",
"minLength": 1
},
"maxItems": 100,
"description": "Curator ids to list, matched case-insensitively (lowercased before matching and cursor binding)."
},
"net_apy_gte": {
"type": "number",
"description": "Minimum `net_apy`, as a decimal rate. Bounds the net APY (native net of fees plus rewards)."
},
"net_apy_lte": {
"type": "number",
"description": "Maximum `net_apy`, as a decimal rate. Bounds the net APY (native net of fees plus rewards)."
},
"include_facets": {
"enum": [
"true",
"false"
],
"type": "string",
"description": "Return the `facets` extra. Facets are only computed when true; the flag is not part of the cursor binding."
},
"sort_direction": {
"enum": [
"asc",
"desc"
],
"type": "string",
"default": "desc"
},
"liquidity_usd_gte": {
"type": "number",
"minimum": 0,
"description": "Minimum `liquidity_usd`. Vaults with a null `liquidity_usd` are left out."
},
"liquidity_usd_lte": {
"type": "number",
"minimum": 0,
"description": "Maximum `liquidity_usd`. Vaults with a null `liquidity_usd` are left out."
},
"collateral_exposure": {
"type": "array",
"items": {
"type": "string",
"format": "<chainId>:<address>",
"example": "1:0x1234567890abcdef1234567890abcdef12345678"
},
"maxItems": 100,
"description": "Collateral asset selectors, `<chain_id>:<address>` — the same values the `collateral_exposure` facet returns. Keeps only vaults allocating to any of these collaterals."
},
"collateral_exclusion": {
"type": "array",
"items": {
"type": "string",
"format": "<chainId>:<address>",
"example": "1:0x1234567890abcdef1234567890abcdef12345678"
},
"maxItems": 100,
"description": "Collateral asset selectors, `<chain_id>:<address>`. Drops vaults allocating to any of these collaterals; applies to every facet count."
},
"total_assets_usd_gte": {
"type": "number",
"minimum": 0,
"description": "Minimum `total_assets_usd`. Vaults with a null `total_assets_usd` are left out."
},
"total_assets_usd_lte": {
"type": "number",
"minimum": 0,
"description": "Maximum `total_assets_usd`. Vaults with a null `total_assets_usd` are left out."
}
}
}| authorizations |
| array |
{
"type": "object",
"$schema": "http://json-schema.org/draft-07/schema#",
"required": [
"chainId",
"mode",
"transactions",
"limits"
],
"properties": {
"mode": {
"enum": [
"preview",
"final"
],
"type": "string"
},
"limits": {
"anyOf": [
{
"type": "string",
"const": "none"
},
{
"type": "object",
"required": [
"operations"
],
"properties": {
"operations": {
"type": "array",
"items": {
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"enum": [
"blueSupply",
"blueWithdraw",
"blueSupplyCollateral",
"blueBorrow",
"blueSupplyCollateralBorrow",
"blueRepay",
"blueWithdrawCollateral",
"blueRepayWithdrawCollateral",
"blueRefinance",
"vaultV1Deposit",
"vaultV2Deposit",
"vaultV1Withdraw",
"vaultV2Withdraw",
"vaultV1Redeem",
"vaultV2Redeem",
"vaultV2ForceWithdraw",
"vaultV2ForceRedeem",
"vaultV1InKindRedeem",
"vaultV2InKindRedeem",
"vaultV1MigrateToV2",
"midnightSupplyCollateral",
"midnightSupplyCollateralMakeBorrow",
"midnightSupplyBlueMakeLend",
"midnightRedeem",
"midnightTakeLend",
"midnightTakeBorrow",
"midnightTakeWithdraw",
"midnightSupplyCollateralTakeBorrow",
"midnightRepayWithdrawCollateral",
"midnightTakeRepayWithdrawCollateral"
],
"type": "string"
}
},
"additionalProperties": {}
},
"maxItems": 20,
"minItems": 1
}
},
"additionalProperties": false
}
]
},
"chainId": {
"type": "integer",
"maximum": 9007199254740991,
"exclusiveMinimum": 0
},
"blockNumber": {
"type": "string",
"pattern": "^\\d+$"
},
"transactions": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"required": [
"from",
"to",
"data"
],
"properties": {
"to": {
"type": "string",
"pattern": "^0x[a-fA-F0-9]{40}$"
},
"data": {
"type": "string",
"pattern": "^0x(?:[a-fA-F0-9]{2})*$",
"maxLength": 220002
},
"from": {
"type": "string",
"pattern": "^0x[a-fA-F0-9]{40}$"
},
"value": {
"type": "string",
"default": "0",
"pattern": "^\\d+$"
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"signedTransaction"
],
"properties": {
"signedTransaction": {
"type": "string",
"pattern": "^0x(?:[a-fA-F0-9]{2})*$",
"maxLength": 220002
}
},
"additionalProperties": false
}
]
},
"maxItems": 20,
"minItems": 1
},
"authorizations": {
"type": "array",
"items": {
"type": "object",
"properties": {},
"additionalProperties": {}
},
"maxItems": 20
}
},
"additionalProperties": false
}