Koskamo

Morpho MCP

Morpho's hosted, remote MCP server that provides MCP-compatible agents with live access to Morpho vaults, markets, Midnight fixed-rate markets, and positions. It allows agents to query data and prepare unsigned transactions for user review and signing, without the server ever signing or broadcasting transactions itself.

Endpoint and access

No sign-in to connect and list tools. Individual tools may still need a vendor account, credentials, or permissions; check the documented prerequisites.

Morpho MCP logo, by MorphoVendor evidenceStreamable HTTPNo sign-inEndpoint checked 2026-11-06Operated by Morpho
MCP endpoint (Streamable HTTP)
https://mcp.morpho.org/
Vendor documentation

What its tools do

53 tools, grouped by the hints the server advertises. Hints are self-declared, not verified behavior.

Read-only (53)

53 of 53 have a description · 53 of 53 declare behavior hints · 20 of 51 with parameters document them all

Checks and signals

Each line is separate evidence, not a trust score.

  • Passed Endpoint answered the live check ·
  • Passed Official MCP Registry namespace is tied to morpho.org ·
  • Passed Endpoint is on the registry namespace domain ·
  • Availability 1 of 1 checks passed in 30 days

What you can do with it

  • Query Morpho vaults and markets data
  • Access Midnight fixed-rate markets and positions
  • Prepare unsigned transactions for review and signing

Source and maintenance

Vendor evidenceRegistry 1.0.0

Protocol and capabilities

Server
org.morpho/mcp d6ff00e
MCP protocol negotiated in check
2025-11-25
Tools
53 advertised
Resources
Not advertised
Resource templates
Not advertised
Prompts
Not advertised
Server-advertised capabilities
{
  "tools": {}
}

Server-provided instructions

Untrusted server output shown for inspection. It is not Koskamo guidance and is excluded from knowledge search.

You are connected to the Morpho MCP server. Morpho is a lending protocol with Morpho Markets (isolated variable-rate markets, also called Morpho Blue), Vaults V1 and Vaults V2 (which allocate deposits across markets), and Midnight fixed-rate markets. ## Tool Composition Follow this workflow for any write operation: 1. **Discover** — Use `morpho_query_vaults` or `morpho_query_markets` to find targets. Never hardcode addresses. 2. **Inspect** — Use `morpho_get_vault` or `morpho_get_market` for one target. For user positions, use `morpho_get_vault_positions` or `morpho_get_market_positions`. 3. **Prepare** — Use a `morpho_prepare_*` tool to build unsigned transactions. Actions-backed tools return their result under `data`: if `data.status` is `signature_required`, have the user sign each `data.signatures[].typed_data`, then call the same tool again as its description explains; a finished result lists the calls in `data.calls`. `morpho_prepare_claim_rewards`, and any prepare result without `data`, returns a `PreparedOperation` with `transactions`, `requirements`, `outcome` (preview-derived post-state estimate), and `warnings`. 4. **Simulate before signing** — run `morpho_simulate_transactions` with `mode: "final"` on the calls a prepare tool returned, or on signed transactions, with the prepare tool's `simulation_limits` as `limits` when present (otherwise `limits` for the user's action). Treat `status: "failed"` as HALT and show `error`. 5. **Present** — Show the summary and calls to the user. For Actions-backed results, check `data.simulation.status`; if `failed`, show `data.simulation.failure` and HALT, and don't present calls after `data.expires_at`. For a `PreparedOperation`, show its `transactions` and `outcome`, and flag any warnings before they sign. ## Key Rules - **Select targets with selectors** — `morpho_get_vault` and Actions-backed vault prepare tools take a `vault-selector` formatted as `<chainId>:<vaultAddress>`. Market read and Actions-backed prepare tools take a `market-selector` formatted as `<chainId>:<marketId>`. Midnight market IDs are unique across chains, so Midnight tools take a `market-id` with no chain ID. The vault list uses `chain_ids`; other list tools take their API's chain-ID filters. Prepare tools that return a `PreparedOperation` take a `chain` slug and a plain address or market ID instead. - **Use registered slugs for RPC tools** — tools with a `chain` input (such as `morpho_get_token_balance` and `morpho_prepare_claim_rewards`) require one of: "ethereum", "base", "arbitrum", "optimism", "polygon", "unichain", "worldchain", "katana", "hyperevm", "monad", "stable". Targets on other chains can be read with the generated tools but not used with these. - **Rank vaults from list results** — `morpho_query_vaults` returns net APY, total assets, and liquidity in USD for V1 and V2 vaults. Apply the requested filters and paginate before comparing candidates. - **Curator names** — use a curator name only when a tool response includes one. - **Docs lookup** — use `morpho_doc_search` to answer conceptual questions (protocol mechanics, integration guides, terminology) from the official Morpho documentation instead of guessing. - **Never assume token decimals** — USDC/USDT use 6 decimals, WETH/DAI use 18. Read decimals from tool responses. - **Approvals precede operations** — Actions-backed prepare tools return `data.calls` and may return `data.signatures`. A `PreparedOperation` returns `requirements` and `transactions`, with approval transactions included. - **USDT needs allowance reset** — approve to 0 before setting a new allowance. The prepare tools handle this automatically. - **DAI does not support Permit** — use standard ERC20 approve only. - **Health factor < 1.0 = liquidatable** — warn the user immediately if any Blue borrow position is near this threshold. Read `health_factor` from `morpho_get_market_positions`; do not infer it when the response omits it. - **Unsigned only** — this server never signs or broadcasts. Write tools return unsigned transaction payloads. - **Outcome is a preview, not a guarantee** — a `PreparedOperation`'s `outcome` reflects SDK math at prepare time. Operations may still revert at broadcast (insufficient balance, allowance, or market liquidity). - **Simulation field (`simulation`)** — in a `PreparedOperation`, when present, lists the verified ERC-20/native transfers a successful simulation observed. Absent when the simulator skipped or failed; the failure surfaces as a `warnings` entry. `error`-level simulation warnings still mean HALT. - **Respect warning severity** — `PreparedOperation` warnings appear in `warnings`: - `error`: HALT. Do not present transactions for signing. Explain the risk and suggest next steps. - `warning`: Present transactions but prominently flag the warning. The user must acknowledge before proceeding. - `info`: Include in the summary for transparency. No action needed.

Tools

53 advertised

morpho_health_check
Advertised by the server during the last successful anonymous check.
Advertised read-only

Check the health status of the MCP server and connected services

morpho_health_check input schema
{
  "type": "object",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "properties": {},
  "additionalProperties": false
}
morpho_health_check annotations
{
  "title": "Health Check",
  "readOnlyHint": true,
  "destructiveHint": false
}
morpho_get_supported_chains
Advertised by the server during the last successful anonymous check.
Advertised read-only

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.

morpho_get_supported_chains input schema
{
  "type": "object",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "properties": {},
  "additionalProperties": false
}
morpho_get_supported_chains annotations
{
  "title": "Get Supported Chains",
  "readOnlyHint": true,
  "destructiveHint": false
}
morpho_get_token_balance
Advertised by the server during the last successful anonymous check.
Advertised read-only

Get token balance and whether the user needs to approve Morpho or the Bundler before writing. Balance and allowances are self-describing TokenAmounts.

morpho_get_token_balance input schema
{
  "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
}
morpho_get_token_balance annotations
{
  "title": "Get Token Balance",
  "readOnlyHint": true,
  "destructiveHint": false
}
morpho_simulate_transactions
Advertised by the server during the last successful anonymous check.
Advertised read-only

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.

morpho_simulate_transactions input schema
{
  "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
}
morpho_simulate_transactions annotations
{
  "title": "Simulate Transactions",
  "readOnlyHint": true,
  "destructiveHint": false
}
morpho_doc_search
Advertised by the server during the last successful anonymous check.
Advertised read-only

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).

morpho_doc_search input schema
{
  "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
}
morpho_doc_search annotations
{
  "title": "Doc Search",
  "readOnlyHint": true,
  "destructiveHint": false
}
morpho_prepare_deposit
Advertised by the server during the last successful anonymous check.
Advertised read-only

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.

morpho_prepare_deposit input schema
{
  "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
}
morpho_prepare_deposit annotations
{
  "title": "Prepare Deposit",
  "readOnlyHint": true,
  "destructiveHint": false
}
morpho_prepare_withdraw
Advertised by the server during the last successful anonymous check.
Advertised read-only

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.

morpho_prepare_withdraw input schema
{
  "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
}
morpho_prepare_withdraw annotations
{
  "title": "Prepare Withdraw",
  "readOnlyHint": true,
  "destructiveHint": false
}
morpho_prepare_supply
Advertised by the server during the last successful anonymous check.
Advertised read-only

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.

morpho_prepare_supply input schema
{
  "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
}
morpho_prepare_supply annotations
{
  "title": "Prepare Supply",
  "readOnlyHint": true,
  "destructiveHint": false
}
morpho_prepare_borrow
Advertised by the server during the last successful anonymous check.
Advertised read-only

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.

morpho_prepare_borrow input schema
{
  "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
}
morpho_prepare_borrow annotations
{
  "title": "Prepare Borrow",
  "readOnlyHint": true,
  "destructiveHint": false
}
morpho_prepare_repay
Advertised by the server during the last successful anonymous check.
Advertised read-only

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.

morpho_prepare_repay input schema
{
  "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
}
morpho_prepare_repay annotations
{
  "title": "Prepare Repay",
  "readOnlyHint": true,
  "destructiveHint": false
}
morpho_prepare_supply_collateral
Advertised by the server during the last successful anonymous check.
Advertised read-only

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.

morpho_prepare_supply_collateral input schema
{
  "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
}
morpho_prepare_supply_collateral annotations
{
  "title": "Prepare Supply Collateral",
  "readOnlyHint": true,
  "destructiveHint": false
}
morpho_prepare_withdraw_collateral
Advertised by the server during the last successful anonymous check.
Advertised read-only

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.

morpho_prepare_withdraw_collateral input schema
{
  "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
}
morpho_prepare_withdraw_collateral annotations
{
  "title": "Prepare Withdraw Collateral",
  "readOnlyHint": true,
  "destructiveHint": false
}
morpho_prepare_claim_rewards
Advertised by the server during the last successful anonymous check.
Advertised read-only

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.

morpho_prepare_claim_rewards input schema
{
  "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
}
morpho_prepare_claim_rewards annotations
{
  "title": "Prepare Claim Rewards",
  "readOnlyHint": true,
  "destructiveHint": false
}
morpho_prepare_redeem
Advertised by the server during the last successful anonymous check.
Advertised read-only

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.

morpho_prepare_redeem input schema
{
  "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
}
morpho_prepare_redeem annotations
{
  "title": "Prepare Redeem",
  "readOnlyHint": true,
  "destructiveHint": false
}
morpho_prepare_redeem_in_kind
Advertised by the server during the last successful anonymous check.
Advertised read-only

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.

morpho_prepare_redeem_in_kind input schema
{
  "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
}
morpho_prepare_redeem_in_kind annotations
{
  "title": "Prepare Redeem In Kind",
  "readOnlyHint": true,
  "destructiveHint": false
}
morpho_prepare_force_withdraw
Advertised by the server during the last successful anonymous check.
Advertised read-only

Prepare a Vault V2 force withdrawal. The SDK selects the vault adapter and deallocates as needed.

morpho_prepare_force_withdraw input schema
{
  "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
}
morpho_prepare_force_withdraw annotations
{
  "title": "Prepare Force Withdraw",
  "readOnlyHint": true,
  "destructiveHint": false
}
morpho_prepare_force_redeem
Advertised by the server during the last successful anonymous check.
Advertised read-only

Prepare a Vault V2 share redemption after user-directed market deallocations. Each deallocation amount should include a buffer for share-price drift.

morpho_prepare_force_redeem input schema
{
  "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
}
morpho_prepare_force_redeem annotations
{
  "title": "Prepare Force Redeem",
  "readOnlyHint": true,
  "destructiveHint": false
}
morpho_prepare_migrate_to_vault_v2
Advertised by the server during the last successful anonymous check.
Advertised read-only

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.

morpho_prepare_migrate_to_vault_v2 input schema
{
  "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
}
morpho_prepare_migrate_to_vault_v2 annotations
{
  "title": "Prepare Migrate To Vault V2",
  "readOnlyHint": true,
  "destructiveHint": false
}
morpho_prepare_blue_withdraw
Advertised by the server during the last successful anonymous check.
Advertised read-only

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.

morpho_prepare_blue_withdraw input schema
{
  "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
}
morpho_prepare_blue_withdraw annotations
{
  "title": "Prepare Blue Withdraw",
  "readOnlyHint": true,
  "destructiveHint": false
}
morpho_prepare_supply_collateral_and_borrow
Advertised by the server during the last successful anonymous check.
Advertised read-only

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.

morpho_prepare_supply_collateral_and_borrow input schema
{
  "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
}
morpho_prepare_supply_collateral_and_borrow annotations
{
  "title": "Prepare Supply Collateral And Borrow",
  "readOnlyHint": true,
  "destructiveHint": false
}
morpho_prepare_repay_and_withdraw_collateral
Advertised by the server during the last successful anonymous check.
Advertised read-only

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.

morpho_prepare_repay_and_withdraw_collateral input schema
{
  "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
}
morpho_prepare_repay_and_withdraw_collateral annotations
{
  "title": "Prepare Repay And Withdraw Collateral",
  "readOnlyHint": true,
  "destructiveHint": false
}
morpho_prepare_refinance
Advertised by the server during the last successful anonymous check.
Advertised read-only

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.

morpho_prepare_refinance input schema
{
  "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
}
morpho_prepare_refinance annotations
{
  "title": "Prepare Refinance",
  "readOnlyHint": true,
  "destructiveHint": false
}
morpho_prepare_midnight_take_lend
Advertised by the server during the last successful anonymous check.
Advertised read-only

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.

morpho_prepare_midnight_take_lend input schema
{
  "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
}
morpho_prepare_midnight_take_lend annotations
{
  "title": "Prepare Midnight Take Lend",
  "readOnlyHint": true,
  "destructiveHint": false
}
morpho_prepare_midnight_take_borrow
Advertised by the server during the last successful anonymous check.
Advertised read-only

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.

morpho_prepare_midnight_take_borrow input schema
{
  "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
}
morpho_prepare_midnight_take_borrow annotations
{
  "title": "Prepare Midnight Take Borrow",
  "readOnlyHint": true,
  "destructiveHint": false
}
morpho_prepare_midnight_supply_collateral_take_borrow
Advertised by the server during the last successful anonymous check.
Advertised read-only

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.

morpho_prepare_midnight_supply_collateral_take_borrow input schema
{
  "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
}
morpho_prepare_midnight_supply_collateral_take_borrow annotations
{
  "title": "Prepare Midnight Supply Collateral Take Borrow",
  "readOnlyHint": true,
  "destructiveHint": false
}
morpho_prepare_midnight_take_withdraw
Advertised by the server during the last successful anonymous check.
Advertised read-only

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.

morpho_prepare_midnight_take_withdraw input schema
{
  "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
}
morpho_prepare_midnight_take_withdraw annotations
{
  "title": "Prepare Midnight Take Withdraw",
  "readOnlyHint": true,
  "destructiveHint": false
}
morpho_prepare_midnight_take_repay_withdraw_collateral
Advertised by the server during the last successful anonymous check.
Advertised read-only

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.

morpho_prepare_midnight_take_repay_withdraw_collateral input schema
{
  "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
}
morpho_prepare_midnight_take_repay_withdraw_collateral annotations
{
  "title": "Prepare Midnight Take Repay Withdraw Collateral",
  "readOnlyHint": true,
  "destructiveHint": false
}
morpho_prepare_midnight_supply_collateral
Advertised by the server during the last successful anonymous check.
Advertised read-only

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.

morpho_prepare_midnight_supply_collateral input schema
{
  "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
}
morpho_prepare_midnight_supply_collateral annotations
{
  "title": "Prepare Midnight Supply Collateral",
  "readOnlyHint": true,
  "destructiveHint": false
}
morpho_prepare_midnight_redeem
Advertised by the server during the last successful anonymous check.
Advertised read-only

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.

morpho_prepare_midnight_redeem input schema
{
  "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
}
morpho_prepare_midnight_redeem annotations
{
  "title": "Prepare Midnight Redeem",
  "readOnlyHint": true,
  "destructiveHint": false
}
morpho_prepare_midnight_repay_withdraw_collateral
Advertised by the server during the last successful anonymous check.
Advertised read-only

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.

morpho_prepare_midnight_repay_withdraw_collateral input schema
{
  "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
}
morpho_prepare_midnight_repay_withdraw_collateral annotations
{
  "title": "Prepare Midnight Repay Withdraw Collateral",
  "readOnlyHint": true,
  "destructiveHint": false
}
morpho_prepare_midnight_cancel_offers
Advertised by the server during the last successful anonymous check.
Advertised read-only

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.

morpho_prepare_midnight_cancel_offers input schema
{
  "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
}
morpho_prepare_midnight_cancel_offers annotations
{
  "title": "Prepare Midnight Cancel Offers",
  "readOnlyHint": true,
  "destructiveHint": false
}
morpho_prepare_midnight_set_authorization
Advertised by the server during the last successful anonymous check.
Advertised read-only

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.

morpho_prepare_midnight_set_authorization input schema
{
  "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
}
morpho_prepare_midnight_set_authorization annotations
{
  "title": "Prepare Midnight Set Authorization",
  "readOnlyHint": true,
  "destructiveHint": false
}
morpho_get_vault
Advertised by the server during the last successful anonymous check.
Advertised read-only

Get one Morpho vault (V1 or V2) by vault selector `<chainId>:<vaultAddress>`.

morpho_get_vault input schema
{
  "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."
    }
  }
}
morpho_get_vault output schema
{
  "type": "object",
  "$defs": {
    "VaultV1RootResponse": {
      "type": "object",
      "required": [
        "data"
      ],
      "properties": {
        "data": {
          "type": "object",
          "required": [
            "chain_id",
            "address",
            "version",
            "name",
            "symbol",
            "asset",
            "factory_address",
            "fee_recipient",
            "skim_recipient",
            "owner",
            "curator",
            "guardian",
            "timelock_seconds"
          ],
          "properties": {
            "name": {
              "type": "string",
              "description": "ERC-20 name of the vault share token."
            },
            "asset": {
              "type": "object",
              "required": [
                "address",
                "decimals",
                "name",
                "symbol"
              ],
              "properties": {
                "name": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "ERC-20 token name."
                },
                "symbol": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "ERC-20 token symbol."
                },
                "address": {
                  "type": "string",
                  "description": "ERC-20 token contract address."
                },
                "decimals": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "maximum": 255,
                  "minimum": 0,
                  "description": "ERC-20 token decimals."
                }
              },
              "description": "Underlying asset metadata."
            },
            "owner": {
              "type": "string",
              "description": "Current owner address."
            },
            "symbol": {
              "type": "string",
              "description": "ERC-20 symbol of the vault share token."
            },
            "address": {
              "type": "string",
              "description": "Vault V1 contract address."
            },
            "curator": {
              "type": [
                "string",
                "null"
              ],
              "description": "Current curator address."
            },
            "fee_wad": {
              "type": [
                "string",
                "null"
              ],
              "description": "Active fee value, scaled by WAD (1e18 = 100%).",
              "internalType": "bigint"
            },
            "version": {
              "enum": [
                "1.0",
                "1.1"
              ],
              "type": "string",
              "description": "Vault contract version (semantic)."
            },
            "chain_id": {
              "type": "integer",
              "description": "EVM chain identifier.",
              "exclusiveMinimum": 0
            },
            "guardian": {
              "type": [
                "string",
                "null"
              ],
              "description": "Current guardian address."
            },
            "fee_recipient": {
              "type": [
                "string",
                "null"
              ],
              "description": "Active fee recipient address."
            },
            "skim_recipient": {
              "type": [
                "string",
                "null"
              ],
              "description": "Active skim recipient address (reward token sweeps)."
            },
            "factory_address": {
              "type": "string",
              "description": "Factory contract address that deployed the vault."
            },
            "timelock_seconds": {
              "type": "integer",
              "minimum": 0,
              "description": "Active timelock duration, in seconds."
            },
            "last_indexed_block": {
              "type": "string",
              "description": "Latest indexed block used to compute this vault configuration.",
              "internalType": "bigint"
            },
            "creation_block_number": {
              "type": "string",
              "description": "Vault creation block number.",
              "internalType": "bigint"
            }
          },
          "description": "Vault V1 configuration."
        }
      }
    },
    "VaultV2RootResponse": {
      "type": "object",
      "required": [
        "data"
      ],
      "properties": {
        "data": {
          "type": "object",
          "required": [
            "chain_id",
            "address",
            "version",
            "name",
            "symbol",
            "asset",
            "decimals_offset",
            "factory_address",
            "owner",
            "curator",
            "timelock_seconds",
            "management_fee_recipient",
            "performance_fee_recipient",
            "adapter_registry",
            "liquidity_adapter",
            "liquidity_data",
            "gates"
          ],
          "properties": {
            "name": {
              "type": [
                "string",
                "null"
              ],
              "description": "ERC-20 name of the vault share token."
            },
            "asset": {
              "type": "object",
              "required": [
                "address",
                "decimals",
                "name",
                "symbol"
              ],
              "properties": {
                "name": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "ERC-20 token name."
                },
                "symbol": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "ERC-20 token symbol."
                },
                "address": {
                  "type": "string",
                  "description": "ERC-20 token contract address."
                },
                "decimals": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "maximum": 255,
                  "minimum": 0,
                  "description": "ERC-20 token decimals."
                }
              },
              "description": "Underlying asset metadata."
            },
            "gates": {
              "type": "object",
              "required": [
                "send_shares",
                "receive_shares",
                "send_assets",
                "receive_assets"
              ],
              "properties": {
                "send_assets": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Gate for sending assets (withdraw)."
                },
                "send_shares": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Gate for sending shares (transfer from vault)."
                },
                "receive_assets": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Gate for receiving assets (deposit)."
                },
                "receive_shares": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Gate for receiving shares (transfer to vault)."
                }
              },
              "description": "Gates controlling access to Vault V2 operations."
            },
            "owner": {
              "type": [
                "string",
                "null"
              ],
              "description": "Current owner address."
            },
            "symbol": {
              "type": [
                "string",
                "null"
              ],
              "description": "ERC-20 symbol of the vault share token."
            },
            "address": {
              "type": "string",
              "description": "Vault V2 contract address."
            },
            "curator": {
              "type": [
                "string",
                "null"
              ],
              "description": "Current curator address."
            },
            "version": {
              "type": "string",
              "description": "Vault contract version."
            },
            "chain_id": {
              "type": "integer",
              "description": "EVM chain identifier.",
              "exclusiveMinimum": 0
            },
            "liquidity_data": {
              "type": [
                "string",
                "null"
              ],
              "description": "Active liquidity adapter calldata."
            },
            "decimals_offset": {
              "type": [
                "integer",
                "null"
              ],
              "maximum": 18,
              "minimum": 0,
              "description": "Decimals offset applied to vault share accounting."
            },
            "factory_address": {
              "type": "string",
              "description": "Factory contract address that deployed the vault."
            },
            "adapter_registry": {
              "type": [
                "string",
                "null"
              ],
              "description": "Active adapter registry address."
            },
            "timelock_seconds": {
              "type": [
                "integer",
                "null"
              ],
              "minimum": 0,
              "description": "Maximum active timelock duration across timelocked functions, in seconds. Unbounded timelocks (e.g. set to make them irrevocable) are clamped to the maximum safe integer."
            },
            "liquidity_adapter": {
              "type": [
                "string",
                "null"
              ],
              "description": "Active liquidity adapter address."
            },
            "last_indexed_block": {
              "type": "string",
              "description": "Latest indexed block used to compute this vault configuration.",
              "internalType": "bigint"
            },
            "management_fee_wad": {
              "type": [
                "string",
                "null"
              ],
              "description": "Active management fee value, scaled by WAD (1e18 = 100%).",
              "internalType": "bigint"
            },
            "performance_fee_wad": {
              "type": [
                "string",
                "null"
              ],
              "description": "Active performance fee value, scaled by WAD (1e18 = 100%).",
              "internalType": "bigint"
            },
            "creation_block_number": {
              "type": "string",
              "description": "Vault creation block number.",
              "internalType": "bigint"
            },
            "max_rate_per_second_wad": {
              "type": [
                "string",
                "null"
              ],
              "description": "Maximum rate per second, scaled by WAD (1e18 = 100%).",
              "internalType": "bigint"
            },
            "management_fee_recipient": {
              "type": [
                "string",
                "null"
              ],
              "description": "Active management fee recipient address."
            },
            "performance_fee_recipient": {
              "type": [
                "string",
                "null"
              ],
              "description": "Active performance fee recipient address."
            }
          },
          "description": "Vault V2 configuration."
        }
      }
    }
  },
  "anyOf": [
    {
      "type": "object",
      "$defs": {
        "VaultV2RootResponse": {
          "type": "object",
          "required": [
            "data"
          ],
          "properties": {
            "data": {
              "type": "object",
              "required": [
                "chain_id",
                "address",
                "version",
                "name",
                "symbol",
                "asset",
                "decimals_offset",
                "factory_address",
                "owner",
                "curator",
                "timelock_seconds",
                "management_fee_recipient",
                "performance_fee_recipient",
                "adapter_registry",
                "liquidity_adapter",
                "liquidity_data",
                "gates"
              ],
              "properties": {
                "name": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "ERC-20 name of the vault share token."
                },
                "asset": {
                  "type": "object",
                  "required": [
                    "address",
                    "decimals",
                    "name",
                    "symbol"
                  ],
                  "properties": {
                    "name": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "ERC-20 token name."
                    },
                    "symbol": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "ERC-20 token symbol."
                    },
                    "address": {
                      "type": "string",
                      "description": "ERC-20 token contract address."
                    },
                    "decimals": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "maximum": 255,
                      "minimum": 0,
                      "description": "ERC-20 token decimals."
                    }
                  },
                  "description": "Underlying asset metadata."
                },
                "gates": {
                  "type": "object",
                  "required": [
                    "send_shares",
                    "receive_shares",
                    "send_assets",
                    "receive_assets"
                  ],
                  "properties": {
                    "send_assets": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Gate for sending assets (withdraw)."
                    },
                    "send_shares": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Gate for sending shares (transfer from vault)."
                    },
                    "receive_assets": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Gate for receiving assets (deposit)."
                    },
                    "receive_shares": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Gate for receiving shares (transfer to vault)."
                    }
                  },
                  "description": "Gates controlling access to Vault V2 operations."
                },
                "owner": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Current owner address."
                },
                "symbol": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "ERC-20 symbol of the vault share token."
                },
                "address": {
                  "type": "string",
                  "description": "Vault V2 contract address."
                },
                "curator": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Current curator address."
                },
                "version": {
                  "type": "string",
                  "description": "Vault contract version."
                },
                "chain_id": {
                  "type": "integer",
                  "description": "EVM chain identifier.",
                  "exclusiveMinimum": 0
                },
                "liquidity_data": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Active liquidity adapter calldata."
                },
                "decimals_offset": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "maximum": 18,
                  "minimum": 0,
                  "description": "Decimals offset applied to vault share accounting."
                },
                "factory_address": {
                  "type": "string",
                  "description": "Factory contract address that deployed the vault."
                },
                "adapter_registry": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Active adapter registry address."
                },
                "timelock_seconds": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "minimum": 0,
                  "description": "Maximum active timelock duration across timelocked functions, in seconds. Unbounded timelocks (e.g. set to make them irrevocable) are clamped to the maximum safe integer."
                },
                "liquidity_adapter": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Active liquidity adapter address."
                },
                "last_indexed_block": {
                  "type": "string",
                  "description": "Latest indexed block used to compute this vault configuration.",
                  "internalType": "bigint"
                },
                "management_fee_wad": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Active management fee value, scaled by WAD (1e18 = 100%).",
                  "internalType": "bigint"
                },
                "performance_fee_wad": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Active performance fee value, scaled by WAD (1e18 = 100%).",
                  "internalType": "bigint"
                },
                "creation_block_number": {
                  "type": "string",
                  "description": "Vault creation block number.",
                  "internalType": "bigint"
                },
                "max_rate_per_second_wad": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Maximum rate per second, scaled by WAD (1e18 = 100%).",
                  "internalType": "bigint"
                },
                "management_fee_recipient": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Active management fee recipient address."
                },
                "performance_fee_recipient": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Active performance fee recipient address."
                }
              },
              "description": "Vault V2 configuration."
            }
          }
        }
      },
      "required": [
        "data"
      ],
      "properties": {
        "data": {
          "type": "object",
          "required": [
            "chain_id",
            "address",
            "version",
            "name",
            "symbol",
            "asset",
            "decimals_offset",
            "factory_address",
            "owner",
            "curator",
            "timelock_seconds",
            "management_fee_recipient",
            "performance_fee_recipient",
            "adapter_registry",
            "liquidity_adapter",
            "liquidity_data",
            "gates"
          ],
          "properties": {
            "name": {
              "type": [
                "string",
                "null"
              ],
              "description": "ERC-20 name of the vault share token."
            },
            "asset": {
              "type": "object",
              "required": [
                "address",
                "decimals",
                "name",
                "symbol"
              ],
              "properties": {
                "name": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "ERC-20 token name."
                },
                "symbol": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "ERC-20 token symbol."
                },
                "address": {
                  "type": "string",
                  "description": "ERC-20 token contract address."
                },
                "decimals": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "maximum": 255,
                  "minimum": 0,
                  "description": "ERC-20 token decimals."
                }
              },
              "description": "Underlying asset metadata."
            },
            "gates": {
              "type": "object",
              "required": [
                "send_shares",
                "receive_shares",
                "send_assets",
                "receive_assets"
              ],
              "properties": {
                "send_assets": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Gate for sending assets (withdraw)."
                },
                "send_shares": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Gate for sending shares (transfer from vault)."
                },
                "receive_assets": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Gate for receiving assets (deposit)."
                },
                "receive_shares": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Gate for receiving shares (transfer to vault)."
                }
              },
              "description": "Gates controlling access to Vault V2 operations."
            },
            "owner": {
              "type": [
                "string",
                "null"
              ],
              "description": "Current owner address."
            },
            "symbol": {
              "type": [
                "string",
                "null"
              ],
              "description": "ERC-20 symbol of the vault share token."
            },
            "address": {
              "type": "string",
              "description": "Vault V2 contract address."
            },
            "curator": {
              "type": [
                "string",
                "null"
              ],
              "description": "Current curator address."
            },
            "version": {
              "type": "string",
              "description": "Vault contract version."
            },
            "chain_id": {
              "type": "integer",
              "description": "EVM chain identifier.",
              "exclusiveMinimum": 0
            },
            "liquidity_data": {
              "type": [
                "string",
                "null"
              ],
              "description": "Active liquidity adapter calldata."
            },
            "decimals_offset": {
              "type": [
                "integer",
                "null"
              ],
              "maximum": 18,
              "minimum": 0,
              "description": "Decimals offset applied to vault share accounting."
            },
            "factory_address": {
              "type": "string",
              "description": "Factory contract address that deployed the vault."
            },
            "adapter_registry": {
              "type": [
                "string",
                "null"
              ],
              "description": "Active adapter registry address."
            },
            "timelock_seconds": {
              "type": [
                "integer",
                "null"
              ],
              "minimum": 0,
              "description": "Maximum active timelock duration across timelocked functions, in seconds. Unbounded timelocks (e.g. set to make them irrevocable) are clamped to the maximum safe integer."
            },
            "liquidity_adapter": {
              "type": [
                "string",
                "null"
              ],
              "description": "Active liquidity adapter address."
            },
            "last_indexed_block": {
              "type": "string",
              "description": "Latest indexed block used to compute this vault configuration.",
              "internalType": "bigint"
            },
            "management_fee_wad": {
              "type": [
                "string",
                "null"
              ],
              "description": "Active management fee value, scaled by WAD (1e18 = 100%).",
              "internalType": "bigint"
            },
            "performance_fee_wad": {
              "type": [
                "string",
                "null"
              ],
              "description": "Active performance fee value, scaled by WAD (1e18 = 100%).",
              "internalType": "bigint"
            },
            "creation_block_number": {
              "type": "string",
              "description": "Vault creation block number.",
              "internalType": "bigint"
            },
            "max_rate_per_second_wad": {
              "type": [
                "string",
                "null"
              ],
              "description": "Maximum rate per second, scaled by WAD (1e18 = 100%).",
              "internalType": "bigint"
            },
            "management_fee_recipient": {
              "type": [
                "string",
                "null"
              ],
              "description": "Active management fee recipient address."
            },
            "performance_fee_recipient": {
              "type": [
                "string",
                "null"
              ],
              "description": "Active performance fee recipient address."
            }
          },
          "description": "Vault V2 configuration."
        }
      },
      "x-fastmcp-top-level-schema": "VaultV2RootResponse"
    },
    {
      "type": "object",
      "$defs": {
        "VaultV1RootResponse": {
          "type": "object",
          "required": [
            "data"
          ],
          "properties": {
            "data": {
              "type": "object",
              "required": [
                "chain_id",
                "address",
                "version",
                "name",
                "symbol",
                "asset",
                "factory_address",
                "fee_recipient",
                "skim_recipient",
                "owner",
                "curator",
                "guardian",
                "timelock_seconds"
              ],
              "properties": {
                "name": {
                  "type": "string",
                  "description": "ERC-20 name of the vault share token."
                },
                "asset": {
                  "type": "object",
                  "required": [
                    "address",
                    "decimals",
                    "name",
                    "symbol"
                  ],
                  "properties": {
                    "name": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "ERC-20 token name."
                    },
                    "symbol": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "ERC-20 token symbol."
                    },
                    "address": {
                      "type": "string",
                      "description": "ERC-20 token contract address."
                    },
                    "decimals": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "maximum": 255,
                      "minimum": 0,
                      "description": "ERC-20 token decimals."
                    }
                  },
                  "description": "Underlying asset metadata."
                },
                "owner": {
                  "type": "string",
                  "description": "Current owner address."
                },
                "symbol": {
                  "type": "string",
                  "description": "ERC-20 symbol of the vault share token."
                },
                "address": {
                  "type": "string",
                  "description": "Vault V1 contract address."
                },
                "curator": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Current curator address."
                },
                "fee_wad": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Active fee value, scaled by WAD (1e18 = 100%).",
                  "internalType": "bigint"
                },
                "version": {
                  "enum": [
                    "1.0",
                    "1.1"
                  ],
                  "type": "string",
                  "description": "Vault contract version (semantic)."
                },
                "chain_id": {
                  "type": "integer",
                  "description": "EVM chain identifier.",
                  "exclusiveMinimum": 0
                },
                "guardian": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Current guardian address."
                },
                "fee_recipient": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Active fee recipient address."
                },
                "skim_recipient": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Active skim recipient address (reward token sweeps)."
                },
                "factory_address": {
                  "type": "string",
                  "description": "Factory contract address that deployed the vault."
                },
                "timelock_seconds": {
                  "type": "integer",
                  "minimum": 0,
                  "description": "Active timelock duration, in seconds."
                },
                "last_indexed_block": {
                  "type": "string",
                  "description": "Latest indexed block used to compute this vault configuration.",
                  "internalType": "bigint"
                },
                "creation_block_number": {
                  "type": "string",
                  "description": "Vault creation block number.",
                  "internalType": "bigint"
                }
              },
              "description": "Vault V1 configuration."
            }
          }
        }
      },
      "required": [
        "data"
      ],
      "properties": {
        "data": {
          "type": "object",
          "required": [
            "chain_id",
            "address",
            "version",
            "name",
            "symbol",
            "asset",
            "factory_address",
            "fee_recipient",
            "skim_recipient",
            "owner",
            "curator",
            "guardian",
            "timelock_seconds"
          ],
          "properties": {
            "name": {
              "type": "string",
              "description": "ERC-20 name of the vault share token."
            },
            "asset": {
              "type": "object",
              "required": [
                "address",
                "decimals",
                "name",
                "symbol"
              ],
              "properties": {
                "name": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "ERC-20 token name."
                },
                "symbol": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "ERC-20 token symbol."
                },
                "address": {
                  "type": "string",
                  "description": "ERC-20 token contract address."
                },
                "decimals": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "maximum": 255,
                  "minimum": 0,
                  "description": "ERC-20 token decimals."
                }
              },
              "description": "Underlying asset metadata."
            },
            "owner": {
              "type": "string",
              "description": "Current owner address."
            },
            "symbol": {
              "type": "string",
              "description": "ERC-20 symbol of the vault share token."
            },
            "address": {
              "type": "string",
              "description": "Vault V1 contract address."
            },
            "curator": {
              "type": [
                "string",
                "null"
              ],
              "description": "Current curator address."
            },
            "fee_wad": {
              "type": [
                "string",
                "null"
              ],
              "description": "Active fee value, scaled by WAD (1e18 = 100%).",
              "internalType": "bigint"
            },
            "version": {
              "enum": [
                "1.0",
                "1.1"
              ],
              "type": "string",
              "description": "Vault contract version (semantic)."
            },
            "chain_id": {
              "type": "integer",
              "description": "EVM chain identifier.",
              "exclusiveMinimum": 0
            },
            "guardian": {
              "type": [
                "string",
                "null"
              ],
              "description": "Current guardian address."
            },
            "fee_recipient": {
              "type": [
                "string",
                "null"
              ],
              "description": "Active fee recipient address."
            },
            "skim_recipient": {
              "type": [
                "string",
                "null"
              ],
              "description": "Active skim recipient address (reward token sweeps)."
            },
            "factory_address": {
              "type": "string",
              "description": "Factory contract address that deployed the vault."
            },
            "timelock_seconds": {
              "type": "integer",
              "minimum": 0,
              "description": "Active timelock duration, in seconds."
            },
            "last_indexed_block": {
              "type": "string",
              "description": "Latest indexed block used to compute this vault configuration.",
              "internalType": "bigint"
            },
            "creation_block_number": {
              "type": "string",
              "description": "Vault creation block number.",
              "internalType": "bigint"
            }
          },
          "description": "Vault V1 configuration."
        }
      },
      "x-fastmcp-top-level-schema": "VaultV1RootResponse"
    }
  ]
}
morpho_get_vault annotations
{
  "title": "Get Vault",
  "readOnlyHint": true,
  "destructiveHint": false
}
morpho_query_vaults
Advertised by the server during the last successful anonymous check.
Advertised read-only

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.

morpho_query_vaults input schema
{
  "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."
    }
  }
}
morpho_query_vaults output schema
{
  "type": "object",
  "$defs": {
    "VvrmBridgeVaultsResponse": {
      "type": "object",
      "required": [
        "data",
        "cursor",
        "count_total",
        "facets"
      ],
      "properties": {
        "data": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "chain_id",
              "address",
              "version",
              "name",
              "creation_timestamp",
              "asset",
              "total_assets_usd",
              "liquidity_usd",
              "performance_fee",
              "management_fee",
              "curators",
              "warnings",
              "rewards",
              "exposure",
              "apy",
              "net_apy_excluding_rewards",
              "net_apy",
              "max_rate",
              "apy_breakdown",
              "total_assets",
              "liquidity"
            ],
            "properties": {
              "apy": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Native: the V2 vault's gross APY before fees, excluding rewards. Null for V1 vaults."
              },
              "name": {
                "type": "string"
              },
              "asset": {
                "type": "object",
                "required": [
                  "address",
                  "symbol",
                  "name",
                  "decimals",
                  "logo_uri",
                  "price_usd",
                  "yield_apr",
                  "yield_apy"
                ],
                "properties": {
                  "name": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Null when the token has no name."
                  },
                  "symbol": {
                    "type": "string"
                  },
                  "address": {
                    "type": "string"
                  },
                  "decimals": {
                    "type": "integer",
                    "maximum": 9007199254740991,
                    "minimum": 0
                  },
                  "logo_uri": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Null when no logo is known."
                  },
                  "price_usd": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "USD price of one token. Null when no price is known."
                  },
                  "yield_apr": {
                    "type": [
                      "number",
                      "null"
                    ],
                    "description": "Native yield of the asset itself (e.g. staking), a fraction. Not part of any vault APY. Read with the vault snapshot, so it can lag the `yield.apr` that `/tokens` serves by the snapshot TTL. Null when the asset has no known yield or the yield read failed."
                  },
                  "yield_apy": {
                    "type": [
                      "number",
                      "null"
                    ],
                    "description": "Native yield of the asset itself (e.g. staking), as an APY fraction. Not part of any vault APY. Read with the vault snapshot, so it can lag the `yield.apy` that `/tokens` serves by the snapshot TTL. Null when the asset has no known yield or the yield read failed."
                  }
                }
              },
              "address": {
                "type": "string"
              },
              "net_apy": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Net: native APY net of fees plus rewards-only APRs."
              },
              "rewards": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "asset",
                    "supply_apr"
                  ],
                  "properties": {
                    "asset": {
                      "type": "object",
                      "required": [
                        "chain_id",
                        "address",
                        "symbol",
                        "decimals",
                        "logo_uri"
                      ],
                      "properties": {
                        "symbol": {
                          "type": "string"
                        },
                        "address": {
                          "type": "string"
                        },
                        "chain_id": {
                          "type": "integer",
                          "maximum": 9007199254740991,
                          "exclusiveMinimum": 0
                        },
                        "decimals": {
                          "type": "integer",
                          "maximum": 9007199254740991,
                          "minimum": 0
                        },
                        "logo_uri": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      }
                    },
                    "supply_apr": {
                      "type": "number",
                      "description": "Rewards-only: the APR this reward adds, as a decimal rate, excluding the native APY."
                    }
                  }
                },
                "description": "The composed vault-level reward set. Allocation-level market rewards are already included in it and must never be added on top."
              },
              "version": {
                "enum": [
                  "1.0",
                  "1.1",
                  "2.0"
                ],
                "type": "string"
              },
              "chain_id": {
                "type": "integer",
                "maximum": 9007199254740991,
                "exclusiveMinimum": 0
              },
              "curators": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "id",
                    "name",
                    "image",
                    "aum_usd"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "image": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "description": "Null when the curator has no image."
                    },
                    "aum_usd": {
                      "type": "number",
                      "description": "Assets under management across vaults, in USD."
                    }
                  }
                }
              },
              "exposure": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "collateral_asset",
                    "exposure_usd"
                  ],
                  "properties": {
                    "exposure_usd": {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "description": "USD value allocated to this collateral. Null when the asset has no USD price, never 0."
                    },
                    "collateral_asset": {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "address",
                            "symbol",
                            "decimals",
                            "logo_uri"
                          ],
                          "properties": {
                            "symbol": {
                              "type": "string"
                            },
                            "address": {
                              "type": "string"
                            },
                            "decimals": {
                              "type": "integer",
                              "maximum": 9007199254740991,
                              "minimum": 0
                            },
                            "logo_uri": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          }
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "description": "Null for idle assets."
                    }
                  }
                }
              },
              "max_rate": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Native: the V2 rate cap on the realised APY. Null for V1 vaults."
              },
              "warnings": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "type",
                    "level",
                    "content",
                    "delisted"
                  ],
                  "properties": {
                    "type": {
                      "type": "string"
                    },
                    "level": {
                      "enum": [
                        "yellow",
                        "red"
                      ],
                      "type": "string"
                    },
                    "content": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "description": "Custom warning text. Null for every non-custom warning type."
                    },
                    "delisted": {
                      "type": "boolean",
                      "description": "True on a `not_whitelisted` warning when the vault has a listing history, i.e. it was listed before and delisted; vvrm shows it as deprecated. False otherwise."
                    }
                  }
                },
                "description": "The vault's own warnings only. GREEN warnings are never returned."
              },
              "liquidity": {
                "type": "string",
                "description": "Withdrawable liquidity, in asset units.",
                "internalType": "bigint"
              },
              "total_assets": {
                "type": "string",
                "description": "Total assets, in asset units.",
                "internalType": "bigint"
              },
              "apy_breakdown": {
                "type": [
                  "object",
                  "null"
                ],
                "required": [
                  "apy",
                  "organic_apy",
                  "surplus_boost_apy",
                  "net_apy_excluding_rewards",
                  "organic_net_apy_excluding_rewards",
                  "surplus_boost_net_apy_excluding_rewards",
                  "surplus_boost_active"
                ],
                "properties": {
                  "apy": {
                    "type": "number",
                    "description": "Native: gross APY of this snapshot; equals organic_apy + surplus_boost_apy. Decimal, 0.05 = 5%. An infinite value is clamped to the largest finite number."
                  },
                  "organic_apy": {
                    "type": "number",
                    "description": "Native: what apy would be without the surplus, capped by the vault's maxRate. Decimal. An infinite value is clamped to the largest finite number."
                  },
                  "surplus_boost_apy": {
                    "type": "number",
                    "description": "Native: APY points added by the surplus (donations), only the part under the maxRate cap. Decimal. An infinite value is clamped to the largest finite number."
                  },
                  "surplus_boost_active": {
                    "type": "boolean",
                    "description": "Native: whether apy is pinned to the maxRate APY by the surplus."
                  },
                  "net_apy_excluding_rewards": {
                    "type": [
                      "number",
                      "null"
                    ],
                    "description": "Net: apy after this snapshot's performance and management fees, excluding rewards. Decimal. Null when the value is not a number; an infinite value is clamped to the largest finite number."
                  },
                  "organic_net_apy_excluding_rewards": {
                    "type": [
                      "number",
                      "null"
                    ],
                    "description": "Net: organic_apy after the same fees. Decimal. Null when the value is not a number; an infinite value is clamped to the largest finite number."
                  },
                  "surplus_boost_net_apy_excluding_rewards": {
                    "type": [
                      "number",
                      "null"
                    ],
                    "description": "Net: net_apy_excluding_rewards minus organic_net_apy_excluding_rewards, floored at 0; null when either is null. Decimal. An infinite value is clamped to the largest finite number."
                  }
                },
                "description": "Native APY split into organic and surplus-boost (donation) parts, gross and net of fees. All fields come from one realtime accrual snapshot (fees included) and reconcile with each other; consumers should take the headline from this object rather than mix it with the top-level apy / net_apy_excluding_rewards, which come from a separate realtime read. Null when the vault has no accrual checkpoint or the breakdown read fails."
              },
              "liquidity_usd": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "`liquidity` in USD. Null when the asset has no USD price, never 0."
              },
              "management_fee": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Annualised management fee, as a decimal fraction. Null for V1 vaults, which have no management fee."
              },
              "performance_fee": {
                "type": "number",
                "description": "Performance fee, as a decimal fraction."
              },
              "total_assets_usd": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "`total_assets` in USD. Null when the asset has no USD price, never 0."
              },
              "creation_timestamp": {
                "type": "integer",
                "maximum": 9007199254740991,
                "minimum": 0,
                "description": "Unix timestamp in seconds (UTC)."
              },
              "net_apy_excluding_rewards": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Native: net of fees, excluding rewards."
              }
            }
          },
          "description": "Page of returned items."
        },
        "cursor": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "Opaque cursor for the next page. Null on the last page."
        },
        "facets": {
          "anyOf": [
            {
              "type": "object",
              "required": [
                "chain_ids",
                "versions",
                "assets",
                "curator_ids",
                "collateral_exposure"
              ],
              "properties": {
                "assets": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "value",
                      "count",
                      "metadata"
                    ],
                    "properties": {
                      "count": {
                        "type": "integer",
                        "maximum": 9007199254740991,
                        "minimum": 0
                      },
                      "value": {
                        "type": "string",
                        "description": "Asset selector, `<chain_id>:<address>`, as `assets` accepts."
                      },
                      "metadata": {
                        "anyOf": [
                          {
                            "type": "object",
                            "required": [
                              "chain_id",
                              "address",
                              "symbol",
                              "logo_uri",
                              "tags"
                            ],
                            "properties": {
                              "tags": {
                                "anyOf": [
                                  {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  },
                                  {
                                    "type": "null"
                                  }
                                ],
                                "description": "Null when no tags are known for the token."
                              },
                              "symbol": {
                                "type": "string"
                              },
                              "address": {
                                "type": "string"
                              },
                              "chain_id": {
                                "type": "integer",
                                "maximum": 9007199254740991,
                                "exclusiveMinimum": 0
                              },
                              "logo_uri": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ],
                                "description": "Null when no logo is known."
                              }
                            }
                          },
                          {
                            "type": "null"
                          }
                        ],
                        "description": "Null when no metadata is known for the asset."
                      }
                    }
                  }
                },
                "versions": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "value",
                      "count"
                    ],
                    "properties": {
                      "count": {
                        "type": "integer",
                        "maximum": 9007199254740991,
                        "minimum": 0
                      },
                      "value": {
                        "enum": [
                          "1.0",
                          "1.1",
                          "2.0"
                        ],
                        "type": "string"
                      }
                    }
                  }
                },
                "chain_ids": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "value",
                      "count",
                      "total_assets_usd"
                    ],
                    "properties": {
                      "count": {
                        "type": "integer",
                        "maximum": 9007199254740991,
                        "minimum": 0
                      },
                      "value": {
                        "type": "integer",
                        "maximum": 9007199254740991,
                        "exclusiveMinimum": 0
                      },
                      "total_assets_usd": {
                        "type": "number",
                        "description": "Sum over the chain's listed vaults regardless of filters; vaults without a USD value add 0."
                      }
                    }
                  }
                },
                "curator_ids": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "value",
                      "count",
                      "metadata"
                    ],
                    "properties": {
                      "count": {
                        "type": "integer",
                        "maximum": 9007199254740991,
                        "minimum": 0
                      },
                      "value": {
                        "type": "string"
                      },
                      "metadata": {
                        "anyOf": [
                          {
                            "type": "object",
                            "required": [
                              "name",
                              "image"
                            ],
                            "properties": {
                              "name": {
                                "type": "string"
                              },
                              "image": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              }
                            }
                          },
                          {
                            "type": "null"
                          }
                        ],
                        "description": "Null when no metadata is known for the curator."
                      }
                    }
                  }
                },
                "collateral_exposure": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "value",
                      "count",
                      "metadata"
                    ],
                    "properties": {
                      "count": {
                        "type": "integer",
                        "maximum": 9007199254740991,
                        "minimum": 0
                      },
                      "value": {
                        "type": "string",
                        "description": "Asset selector, `<chain_id>:<address>`, as `collateral_exposure` accepts."
                      },
                      "metadata": {
                        "anyOf": [
                          {
                            "type": "object",
                            "required": [
                              "chain_id",
                              "address",
                              "symbol",
                              "logo_uri",
                              "tags"
                            ],
                            "properties": {
                              "tags": {
                                "anyOf": [
                                  {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  },
                                  {
                                    "type": "null"
                                  }
                                ],
                                "description": "Null when no tags are known for the token."
                              },
                              "symbol": {
                                "type": "string"
                              },
                              "address": {
                                "type": "string"
                              },
                              "chain_id": {
                                "type": "integer",
                                "maximum": 9007199254740991,
                                "exclusiveMinimum": 0
                              },
                              "logo_uri": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ],
                                "description": "Null when no logo is known."
                              }
                            }
                          },
                          {
                            "type": "null"
                          }
                        ],
                        "description": "Null when no metadata is known for the asset."
                      }
                    }
                  }
                }
              }
            },
            {
              "type": "null"
            }
          ],
          "description": "Null unless `include_facets` is true. Each facet counts the vaults matching every other filter, ignoring its own; `collateral_exclusion` applies to all of them."
        },
        "count_total": {
          "type": "integer",
          "maximum": 9007199254740991,
          "minimum": 0,
          "description": "Vaults matching the filters, across every page. Vaults that fail to load are left out and not counted."
        }
      }
    }
  },
  "required": [
    "data",
    "cursor",
    "count_total",
    "facets"
  ],
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "chain_id",
          "address",
          "version",
          "name",
          "creation_timestamp",
          "asset",
          "total_assets_usd",
          "liquidity_usd",
          "performance_fee",
          "management_fee",
          "curators",
          "warnings",
          "rewards",
          "exposure",
          "apy",
          "net_apy_excluding_rewards",
          "net_apy",
          "max_rate",
          "apy_breakdown",
          "total_assets",
          "liquidity"
        ],
        "properties": {
          "apy": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Native: the V2 vault's gross APY before fees, excluding rewards. Null for V1 vaults."
          },
          "name": {
            "type": "string"
          },
          "asset": {
            "type": "object",
            "required": [
              "address",
              "symbol",
              "name",
              "decimals",
              "logo_uri",
              "price_usd",
              "yield_apr",
              "yield_apy"
            ],
            "properties": {
              "name": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Null when the token has no name."
              },
              "symbol": {
                "type": "string"
              },
              "address": {
                "type": "string"
              },
              "decimals": {
                "type": "integer",
                "maximum": 9007199254740991,
                "minimum": 0
              },
              "logo_uri": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Null when no logo is known."
              },
              "price_usd": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "USD price of one token. Null when no price is known."
              },
              "yield_apr": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "Native yield of the asset itself (e.g. staking), a fraction. Not part of any vault APY. Read with the vault snapshot, so it can lag the `yield.apr` that `/tokens` serves by the snapshot TTL. Null when the asset has no known yield or the yield read failed."
              },
              "yield_apy": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "Native yield of the asset itself (e.g. staking), as an APY fraction. Not part of any vault APY. Read with the vault snapshot, so it can lag the `yield.apy` that `/tokens` serves by the snapshot TTL. Null when the asset has no known yield or the yield read failed."
              }
            }
          },
          "address": {
            "type": "string"
          },
          "net_apy": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Net: native APY net of fees plus rewards-only APRs."
          },
          "rewards": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "asset",
                "supply_apr"
              ],
              "properties": {
                "asset": {
                  "type": "object",
                  "required": [
                    "chain_id",
                    "address",
                    "symbol",
                    "decimals",
                    "logo_uri"
                  ],
                  "properties": {
                    "symbol": {
                      "type": "string"
                    },
                    "address": {
                      "type": "string"
                    },
                    "chain_id": {
                      "type": "integer",
                      "maximum": 9007199254740991,
                      "exclusiveMinimum": 0
                    },
                    "decimals": {
                      "type": "integer",
                      "maximum": 9007199254740991,
                      "minimum": 0
                    },
                    "logo_uri": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                },
                "supply_apr": {
                  "type": "number",
                  "description": "Rewards-only: the APR this reward adds, as a decimal rate, excluding the native APY."
                }
              }
            },
            "description": "The composed vault-level reward set. Allocation-level market rewards are already included in it and must never be added on top."
          },
          "version": {
            "enum": [
              "1.0",
              "1.1",
              "2.0"
            ],
            "type": "string"
          },
          "chain_id": {
            "type": "integer",
            "maximum": 9007199254740991,
            "exclusiveMinimum": 0
          },
          "curators": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "id",
                "name",
                "image",
                "aum_usd"
              ],
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "image": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "Null when the curator has no image."
                },
                "aum_usd": {
                  "type": "number",
                  "description": "Assets under management across vaults, in USD."
                }
              }
            }
          },
          "exposure": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "collateral_asset",
                "exposure_usd"
              ],
              "properties": {
                "exposure_usd": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "USD value allocated to this collateral. Null when the asset has no USD price, never 0."
                },
                "collateral_asset": {
                  "anyOf": [
                    {
                      "type": "object",
                      "required": [
                        "address",
                        "symbol",
                        "decimals",
                        "logo_uri"
                      ],
                      "properties": {
                        "symbol": {
                          "type": "string"
                        },
                        "address": {
                          "type": "string"
                        },
                        "decimals": {
                          "type": "integer",
                          "maximum": 9007199254740991,
                          "minimum": 0
                        },
                        "logo_uri": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      }
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "Null for idle assets."
                }
              }
            }
          },
          "max_rate": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Native: the V2 rate cap on the realised APY. Null for V1 vaults."
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "type",
                "level",
                "content",
                "delisted"
              ],
              "properties": {
                "type": {
                  "type": "string"
                },
                "level": {
                  "enum": [
                    "yellow",
                    "red"
                  ],
                  "type": "string"
                },
                "content": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "Custom warning text. Null for every non-custom warning type."
                },
                "delisted": {
                  "type": "boolean",
                  "description": "True on a `not_whitelisted` warning when the vault has a listing history, i.e. it was listed before and delisted; vvrm shows it as deprecated. False otherwise."
                }
              }
            },
            "description": "The vault's own warnings only. GREEN warnings are never returned."
          },
          "liquidity": {
            "type": "string",
            "description": "Withdrawable liquidity, in asset units.",
            "internalType": "bigint"
          },
          "total_assets": {
            "type": "string",
            "description": "Total assets, in asset units.",
            "internalType": "bigint"
          },
          "apy_breakdown": {
            "type": [
              "object",
              "null"
            ],
            "required": [
              "apy",
              "organic_apy",
              "surplus_boost_apy",
              "net_apy_excluding_rewards",
              "organic_net_apy_excluding_rewards",
              "surplus_boost_net_apy_excluding_rewards",
              "surplus_boost_active"
            ],
            "properties": {
              "apy": {
                "type": "number",
                "description": "Native: gross APY of this snapshot; equals organic_apy + surplus_boost_apy. Decimal, 0.05 = 5%. An infinite value is clamped to the largest finite number."
              },
              "organic_apy": {
                "type": "number",
                "description": "Native: what apy would be without the surplus, capped by the vault's maxRate. Decimal. An infinite value is clamped to the largest finite number."
              },
              "surplus_boost_apy": {
                "type": "number",
                "description": "Native: APY points added by the surplus (donations), only the part under the maxRate cap. Decimal. An infinite value is clamped to the largest finite number."
              },
              "surplus_boost_active": {
                "type": "boolean",
                "description": "Native: whether apy is pinned to the maxRate APY by the surplus."
              },
              "net_apy_excluding_rewards": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "Net: apy after this snapshot's performance and management fees, excluding rewards. Decimal. Null when the value is not a number; an infinite value is clamped to the largest finite number."
              },
              "organic_net_apy_excluding_rewards": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "Net: organic_apy after the same fees. Decimal. Null when the value is not a number; an infinite value is clamped to the largest finite number."
              },
              "surplus_boost_net_apy_excluding_rewards": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "Net: net_apy_excluding_rewards minus organic_net_apy_excluding_rewards, floored at 0; null when either is null. Decimal. An infinite value is clamped to the largest finite number."
              }
            },
            "description": "Native APY split into organic and surplus-boost (donation) parts, gross and net of fees. All fields come from one realtime accrual snapshot (fees included) and reconcile with each other; consumers should take the headline from this object rather than mix it with the top-level apy / net_apy_excluding_rewards, which come from a separate realtime read. Null when the vault has no accrual checkpoint or the breakdown read fails."
          },
          "liquidity_usd": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "`liquidity` in USD. Null when the asset has no USD price, never 0."
          },
          "management_fee": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Annualised management fee, as a decimal fraction. Null for V1 vaults, which have no management fee."
          },
          "performance_fee": {
            "type": "number",
            "description": "Performance fee, as a decimal fraction."
          },
          "total_assets_usd": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "`total_assets` in USD. Null when the asset has no USD price, never 0."
          },
          "creation_timestamp": {
            "type": "integer",
            "maximum": 9007199254740991,
            "minimum": 0,
            "description": "Unix timestamp in seconds (UTC)."
          },
          "net_apy_excluding_rewards": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Native: net of fees, excluding rewards."
          }
        }
      },
      "description": "Page of returned items."
    },
    "cursor": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Opaque cursor for the next page. Null on the last page."
    },
    "facets": {
      "anyOf": [
        {
          "type": "object",
          "required": [
            "chain_ids",
            "versions",
            "assets",
            "curator_ids",
            "collateral_exposure"
          ],
          "properties": {
            "assets": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "value",
                  "count",
                  "metadata"
                ],
                "properties": {
                  "count": {
                    "type": "integer",
                    "maximum": 9007199254740991,
                    "minimum": 0
                  },
                  "value": {
                    "type": "string",
                    "description": "Asset selector, `<chain_id>:<address>`, as `assets` accepts."
                  },
                  "metadata": {
                    "anyOf": [
                      {
                        "type": "object",
                        "required": [
                          "chain_id",
                          "address",
                          "symbol",
                          "logo_uri",
                          "tags"
                        ],
                        "properties": {
                          "tags": {
                            "anyOf": [
                              {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "Null when no tags are known for the token."
                          },
                          "symbol": {
                            "type": "string"
                          },
                          "address": {
                            "type": "string"
                          },
                          "chain_id": {
                            "type": "integer",
                            "maximum": 9007199254740991,
                            "exclusiveMinimum": 0
                          },
                          "logo_uri": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "Null when no logo is known."
                          }
                        }
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Null when no metadata is known for the asset."
                  }
                }
              }
            },
            "versions": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "value",
                  "count"
                ],
                "properties": {
                  "count": {
                    "type": "integer",
                    "maximum": 9007199254740991,
                    "minimum": 0
                  },
                  "value": {
                    "enum": [
                      "1.0",
                      "1.1",
                      "2.0"
                    ],
                    "type": "string"
                  }
                }
              }
            },
            "chain_ids": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "value",
                  "count",
                  "total_assets_usd"
                ],
                "properties": {
                  "count": {
                    "type": "integer",
                    "maximum": 9007199254740991,
                    "minimum": 0
                  },
                  "value": {
                    "type": "integer",
                    "maximum": 9007199254740991,
                    "exclusiveMinimum": 0
                  },
                  "total_assets_usd": {
                    "type": "number",
                    "description": "Sum over the chain's listed vaults regardless of filters; vaults without a USD value add 0."
                  }
                }
              }
            },
            "curator_ids": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "value",
                  "count",
                  "metadata"
                ],
                "properties": {
                  "count": {
                    "type": "integer",
                    "maximum": 9007199254740991,
                    "minimum": 0
                  },
                  "value": {
                    "type": "string"
                  },
                  "metadata": {
                    "anyOf": [
                      {
                        "type": "object",
                        "required": [
                          "name",
                          "image"
                        ],
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "image": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        }
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Null when no metadata is known for the curator."
                  }
                }
              }
            },
            "collateral_exposure": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "value",
                  "count",
                  "metadata"
                ],
                "properties": {
                  "count": {
                    "type": "integer",
                    "maximum": 9007199254740991,
                    "minimum": 0
                  },
                  "value": {
                    "type": "string",
                    "description": "Asset selector, `<chain_id>:<address>`, as `collateral_exposure` accepts."
                  },
                  "metadata": {
                    "anyOf": [
                      {
                        "type": "object",
                        "required": [
                          "chain_id",
                          "address",
                          "symbol",
                          "logo_uri",
                          "tags"
                        ],
                        "properties": {
                          "tags": {
                            "anyOf": [
                              {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "Null when no tags are known for the token."
                          },
                          "symbol": {
                            "type": "string"
                          },
                          "address": {
                            "type": "string"
                          },
                          "chain_id": {
                            "type": "integer",
                            "maximum": 9007199254740991,
                            "exclusiveMinimum": 0
                          },
                          "logo_uri": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "Null when no logo is known."
                          }
                        }
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Null when no metadata is known for the asset."
                  }
                }
              }
            }
          }
        },
        {
          "type": "null"
        }
      ],
      "description": "Null unless `include_facets` is true. Each facet counts the vaults matching every other filter, ignoring its own; `collateral_exclusion` applies to all of them."
    },
    "count_total": {
      "type": "integer",
      "maximum": 9007199254740991,
      "minimum": 0,
      "description": "Vaults matching the filters, across every page. Vaults that fail to load are left out and not counted."
    }
  },
  "x-fastmcp-top-level-schema": "VvrmBridgeVaultsResponse"
}
morpho_query_vaults annotations
{
  "title": "Query Vaults",
  "readOnlyHint": true,
  "destructiveHint": false
}
morpho_get_vault_positions
Advertised by the server during the last successful anonymous check.
Advertised read-only

List a user's Morpho V1 and V2 vault positions with portfolio totals. Paginate by passing back `cursor` until it is null.

morpho_get_vault_positions input schema
{
  "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."
    }
  }
}
morpho_get_vault_positions output schema
{
  "type": "object",
  "$defs": {
    "VvrmBridgeEarnPositionsResponse": {
      "type": "object",
      "required": [
        "data",
        "cursor",
        "count_total",
        "totals",
        "facets"
      ],
      "properties": {
        "data": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "assets_usd",
              "pnl_usd",
              "vault",
              "assets",
              "shares",
              "pnl_assets"
            ],
            "properties": {
              "vault": {
                "type": "object",
                "required": [
                  "chain_id",
                  "address",
                  "version",
                  "name",
                  "asset",
                  "total_assets_usd",
                  "performance_fee",
                  "management_fee",
                  "net_apy_excluding_rewards",
                  "net_apy",
                  "max_apy",
                  "apy_breakdown",
                  "curators",
                  "rewards",
                  "warnings",
                  "exposure"
                ],
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "asset": {
                    "type": "object",
                    "required": [
                      "chain_id",
                      "address",
                      "symbol",
                      "name",
                      "decimals",
                      "logo_uri",
                      "price_usd",
                      "yield_apr",
                      "yield_apy"
                    ],
                    "properties": {
                      "name": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "symbol": {
                        "type": "string"
                      },
                      "address": {
                        "type": "string",
                        "description": "Token address, EIP-55 checksummed."
                      },
                      "chain_id": {
                        "type": "integer",
                        "maximum": 9007199254740991,
                        "description": "EVM chain identifier.",
                        "exclusiveMinimum": 0
                      },
                      "decimals": {
                        "type": "integer",
                        "maximum": 9007199254740991,
                        "minimum": -9007199254740991
                      },
                      "logo_uri": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "price_usd": {
                        "anyOf": [
                          {
                            "type": "number"
                          },
                          {
                            "type": "null"
                          }
                        ],
                        "description": "Null when the token has no price."
                      },
                      "yield_apr": {
                        "anyOf": [
                          {
                            "type": "number"
                          },
                          {
                            "type": "null"
                          }
                        ],
                        "description": "Native yield of the token itself (e.g. staking), a fraction. Null when unknown."
                      },
                      "yield_apy": {
                        "type": [
                          "number",
                          "null"
                        ],
                        "description": "Native yield of the token itself (e.g. staking), as an APY fraction. Null when unknown."
                      }
                    }
                  },
                  "address": {
                    "type": "string",
                    "description": "Vault address, EIP-55 checksummed."
                  },
                  "max_apy": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "V2 only: the APY equivalent of the vault's max rate, which caps the native APY. Null for V1 vaults or when no max rate is set."
                  },
                  "net_apy": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Net APY: native APY net of fees plus the rewards-only APRs in `rewards`, a fraction. Null when unknown."
                  },
                  "rewards": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "asset",
                        "supply_apr"
                      ],
                      "properties": {
                        "asset": {
                          "type": "object",
                          "required": [
                            "chain_id",
                            "address",
                            "symbol",
                            "name",
                            "decimals",
                            "logo_uri"
                          ],
                          "properties": {
                            "name": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "symbol": {
                              "type": "string"
                            },
                            "address": {
                              "type": "string",
                              "description": "Token address, EIP-55 checksummed."
                            },
                            "chain_id": {
                              "type": "integer",
                              "maximum": 9007199254740991,
                              "description": "EVM chain identifier.",
                              "exclusiveMinimum": 0
                            },
                            "decimals": {
                              "type": "integer",
                              "maximum": 9007199254740991,
                              "minimum": -9007199254740991
                            },
                            "logo_uri": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          }
                        },
                        "supply_apr": {
                          "type": "number",
                          "description": "Rewards-only supply APR, excluding the native APY: a fraction."
                        }
                      }
                    },
                    "description": "The composed reward set: rewards on the vault itself plus rewards forwarded from the markets it supplies, directly or through its adapters. Each `supply_apr` is rewards-only."
                  },
                  "version": {
                    "enum": [
                      "1.0",
                      "1.1",
                      "2.0"
                    ],
                    "type": "string"
                  },
                  "chain_id": {
                    "type": "integer",
                    "maximum": 9007199254740991,
                    "exclusiveMinimum": 0
                  },
                  "curators": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "id",
                        "name",
                        "image",
                        "aum_usd"
                      ],
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "image": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ],
                          "description": "Null when the curator has no logo."
                        },
                        "aum_usd": {
                          "type": "number",
                          "description": "Assets under management across the curator's vaults, in USD. The internal source reports 0 when the AUM is unknown."
                        }
                      }
                    }
                  },
                  "exposure": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "collateral_asset",
                        "exposure_usd"
                      ],
                      "properties": {
                        "exposure_usd": {
                          "anyOf": [
                            {
                              "type": "number"
                            },
                            {
                              "type": "null"
                            }
                          ],
                          "description": "USD value of the vault asset supplied against this collateral (or held idle). Null when the vault asset has no price. The internal source still reports 0 when the vault state is unavailable."
                        },
                        "collateral_asset": {
                          "anyOf": [
                            {
                              "type": "object",
                              "required": [
                                "chain_id",
                                "address",
                                "symbol",
                                "name",
                                "decimals",
                                "logo_uri"
                              ],
                              "properties": {
                                "name": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "symbol": {
                                  "type": "string"
                                },
                                "address": {
                                  "type": "string",
                                  "description": "Token address, EIP-55 checksummed."
                                },
                                "chain_id": {
                                  "type": "integer",
                                  "maximum": 9007199254740991,
                                  "description": "EVM chain identifier.",
                                  "exclusiveMinimum": 0
                                },
                                "decimals": {
                                  "type": "integer",
                                  "maximum": 9007199254740991,
                                  "minimum": -9007199254740991
                                },
                                "logo_uri": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                }
                              }
                            },
                            {
                              "type": "null"
                            }
                          ],
                          "description": "Null for idle assets."
                        }
                      }
                    }
                  },
                  "warnings": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "type",
                        "level",
                        "content",
                        "deprecated"
                      ],
                      "properties": {
                        "type": {
                          "type": "string",
                          "description": "E.g. `not_whitelisted`, `custom`."
                        },
                        "level": {
                          "enum": [
                            "yellow",
                            "red",
                            "green"
                          ],
                          "type": "string"
                        },
                        "content": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ],
                          "description": "Null unless `custom`."
                        },
                        "deprecated": {
                          "type": "boolean",
                          "description": "True for a `not_whitelisted` warning on a vault that was listed before (non-empty listing history in the source metadata)."
                        }
                      }
                    }
                  },
                  "apy_breakdown": {
                    "type": [
                      "object",
                      "null"
                    ],
                    "required": [
                      "apy",
                      "organic_apy",
                      "surplus_boost_apy",
                      "net_apy_excluding_rewards",
                      "organic_net_apy_excluding_rewards",
                      "surplus_boost_net_apy_excluding_rewards",
                      "surplus_boost_active"
                    ],
                    "properties": {
                      "apy": {
                        "type": "number",
                        "description": "Native: gross APY of this snapshot; equals organic_apy + surplus_boost_apy. Decimal, 0.05 = 5%. An infinite value is clamped to the largest finite number."
                      },
                      "organic_apy": {
                        "type": "number",
                        "description": "Native: what apy would be without the surplus, capped by the vault's maxRate. Decimal. An infinite value is clamped to the largest finite number."
                      },
                      "surplus_boost_apy": {
                        "type": "number",
                        "description": "Native: APY points added by the surplus (donations), only the part under the maxRate cap. Decimal. An infinite value is clamped to the largest finite number."
                      },
                      "surplus_boost_active": {
                        "type": "boolean",
                        "description": "Native: whether apy is pinned to the maxRate APY by the surplus."
                      },
                      "net_apy_excluding_rewards": {
                        "type": [
                          "number",
                          "null"
                        ],
                        "description": "Net: apy after this snapshot's performance and management fees, excluding rewards. Decimal. Null when the value is not a number; an infinite value is clamped to the largest finite number."
                      },
                      "organic_net_apy_excluding_rewards": {
                        "type": [
                          "number",
                          "null"
                        ],
                        "description": "Net: organic_apy after the same fees. Decimal. Null when the value is not a number; an infinite value is clamped to the largest finite number."
                      },
                      "surplus_boost_net_apy_excluding_rewards": {
                        "type": [
                          "number",
                          "null"
                        ],
                        "description": "Net: net_apy_excluding_rewards minus organic_net_apy_excluding_rewards, floored at 0; null when either is null. Decimal. An infinite value is clamped to the largest finite number."
                      }
                    },
                    "description": "Native APY split into organic and surplus-boost (donation) parts, gross and net of fees. All fields come from one realtime accrual snapshot (fees included) and reconcile with each other; consumers should take the headline from this object rather than mix it with the top-level apy / net_apy_excluding_rewards, which come from a separate realtime read. Null when the vault has no accrual checkpoint or the breakdown read fails."
                  },
                  "management_fee": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Annualized management fee as a fraction. Null for V1 vaults."
                  },
                  "performance_fee": {
                    "type": "number",
                    "description": "Performance fee as a fraction (0.1 = 10%)."
                  },
                  "total_assets_usd": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Vault total assets in USD. Null when the vault asset has no price. The internal source still reports 0 when the vault state is unavailable."
                  },
                  "net_apy_excluding_rewards": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Native APY net of performance and management fees, excluding rewards: a fraction. Null when unknown."
                  }
                }
              },
              "assets": {
                "type": "string",
                "description": "In vault asset units.",
                "internalType": "bigint"
              },
              "shares": {
                "type": "string",
                "description": "Vault shares held.",
                "internalType": "bigint"
              },
              "pnl_usd": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Earnings in USD. Null when `pnl_assets` is null or its USD value is unknown; 0 when `pnl_assets` is 0, even if the vault asset has no price."
              },
              "assets_usd": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Null when the vault asset has no price; 0 when `assets` is 0."
              },
              "pnl_assets": {
                "anyOf": [
                  {
                    "type": "string",
                    "internalType": "bigint"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Earnings on the position in vault asset units, computed from the user's indexed deposits and withdrawals. Null when unknown."
              }
            }
          },
          "description": "Page of returned items."
        },
        "cursor": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "Opaque cursor for the next page. Null on the last page."
        },
        "facets": {
          "type": "object",
          "required": [
            "chain_ids",
            "assets"
          ],
          "properties": {
            "assets": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "value",
                  "count",
                  "metadata"
                ],
                "properties": {
                  "count": {
                    "type": "integer",
                    "maximum": 9007199254740991,
                    "minimum": 0
                  },
                  "value": {
                    "type": "string",
                    "description": "Asset selector `<chain_id>:<address>`; filter on it with `chain_ids` + `asset_addresses`."
                  },
                  "metadata": {
                    "type": "object",
                    "required": [
                      "chain_id",
                      "address",
                      "symbol",
                      "logo_uri",
                      "tags"
                    ],
                    "properties": {
                      "tags": {
                        "type": [
                          "array",
                          "null"
                        ],
                        "items": {
                          "type": "string"
                        }
                      },
                      "symbol": {
                        "type": "string"
                      },
                      "address": {
                        "type": "string",
                        "description": "Token address, EIP-55 checksummed."
                      },
                      "chain_id": {
                        "type": "integer",
                        "maximum": 9007199254740991,
                        "description": "EVM chain identifier.",
                        "exclusiveMinimum": 0
                      },
                      "logo_uri": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    }
                  }
                }
              },
              "description": "Positions per vault asset, ignoring `asset_addresses` but still narrowed by `chain_ids`."
            },
            "chain_ids": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "value",
                  "count"
                ],
                "properties": {
                  "count": {
                    "type": "integer",
                    "maximum": 9007199254740991,
                    "minimum": 0
                  },
                  "value": {
                    "type": "integer",
                    "maximum": 9007199254740991,
                    "exclusiveMinimum": 0
                  }
                }
              },
              "description": "Positions per chain, ignoring `chain_ids` but still narrowed by `asset_addresses`, whose selectors embed chain ids."
            }
          }
        },
        "totals": {
          "type": "object",
          "required": [
            "total_assets_usd",
            "total_net_apy",
            "total_net_apy_excluding_rewards",
            "rewards"
          ],
          "properties": {
            "rewards": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "asset",
                  "supply_apr"
                ],
                "properties": {
                  "asset": {
                    "type": "object",
                    "required": [
                      "chain_id",
                      "address",
                      "symbol",
                      "name",
                      "decimals",
                      "logo_uri"
                    ],
                    "properties": {
                      "name": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "symbol": {
                        "type": "string"
                      },
                      "address": {
                        "type": "string",
                        "description": "Token address, EIP-55 checksummed."
                      },
                      "chain_id": {
                        "type": "integer",
                        "maximum": 9007199254740991,
                        "description": "EVM chain identifier.",
                        "exclusiveMinimum": 0
                      },
                      "decimals": {
                        "type": "integer",
                        "maximum": 9007199254740991,
                        "minimum": -9007199254740991
                      },
                      "logo_uri": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    }
                  },
                  "supply_apr": {
                    "type": "number",
                    "description": "Rewards-only supply APR, excluding the native APY: a fraction."
                  }
                }
              },
              "description": "Rewards-only APR per reward token over the whole portfolio: weighted by `assets_usd` and divided by `total_assets_usd`, so positions without that reward count as 0, unpriced positions are left out, and the APRs add up."
            },
            "total_net_apy": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Net APY (native net of fees plus rewards), weighted by `assets_usd`. Null when no position has both."
            },
            "total_assets_usd": {
              "type": "number",
              "description": "Sum of `assets_usd`; unpriced positions add 0."
            },
            "total_net_apy_excluding_rewards": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Native APY net of fees, excluding rewards, weighted by `assets_usd`. Null when no position has both."
            }
          },
          "description": "Portfolio totals over every exposed position, ignoring `chain_ids` and `asset_addresses`."
        },
        "count_total": {
          "type": "integer",
          "maximum": 9007199254740991,
          "minimum": 0,
          "description": "Positions matching the filters, over all pages."
        }
      }
    }
  },
  "required": [
    "data",
    "cursor",
    "count_total",
    "totals",
    "facets"
  ],
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "assets_usd",
          "pnl_usd",
          "vault",
          "assets",
          "shares",
          "pnl_assets"
        ],
        "properties": {
          "vault": {
            "type": "object",
            "required": [
              "chain_id",
              "address",
              "version",
              "name",
              "asset",
              "total_assets_usd",
              "performance_fee",
              "management_fee",
              "net_apy_excluding_rewards",
              "net_apy",
              "max_apy",
              "apy_breakdown",
              "curators",
              "rewards",
              "warnings",
              "exposure"
            ],
            "properties": {
              "name": {
                "type": "string"
              },
              "asset": {
                "type": "object",
                "required": [
                  "chain_id",
                  "address",
                  "symbol",
                  "name",
                  "decimals",
                  "logo_uri",
                  "price_usd",
                  "yield_apr",
                  "yield_apy"
                ],
                "properties": {
                  "name": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "symbol": {
                    "type": "string"
                  },
                  "address": {
                    "type": "string",
                    "description": "Token address, EIP-55 checksummed."
                  },
                  "chain_id": {
                    "type": "integer",
                    "maximum": 9007199254740991,
                    "description": "EVM chain identifier.",
                    "exclusiveMinimum": 0
                  },
                  "decimals": {
                    "type": "integer",
                    "maximum": 9007199254740991,
                    "minimum": -9007199254740991
                  },
                  "logo_uri": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "price_usd": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Null when the token has no price."
                  },
                  "yield_apr": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Native yield of the token itself (e.g. staking), a fraction. Null when unknown."
                  },
                  "yield_apy": {
                    "type": [
                      "number",
                      "null"
                    ],
                    "description": "Native yield of the token itself (e.g. staking), as an APY fraction. Null when unknown."
                  }
                }
              },
              "address": {
                "type": "string",
                "description": "Vault address, EIP-55 checksummed."
              },
              "max_apy": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "V2 only: the APY equivalent of the vault's max rate, which caps the native APY. Null for V1 vaults or when no max rate is set."
              },
              "net_apy": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Net APY: native APY net of fees plus the rewards-only APRs in `rewards`, a fraction. Null when unknown."
              },
              "rewards": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "asset",
                    "supply_apr"
                  ],
                  "properties": {
                    "asset": {
                      "type": "object",
                      "required": [
                        "chain_id",
                        "address",
                        "symbol",
                        "name",
                        "decimals",
                        "logo_uri"
                      ],
                      "properties": {
                        "name": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "symbol": {
                          "type": "string"
                        },
                        "address": {
                          "type": "string",
                          "description": "Token address, EIP-55 checksummed."
                        },
                        "chain_id": {
                          "type": "integer",
                          "maximum": 9007199254740991,
                          "description": "EVM chain identifier.",
                          "exclusiveMinimum": 0
                        },
                        "decimals": {
                          "type": "integer",
                          "maximum": 9007199254740991,
                          "minimum": -9007199254740991
                        },
                        "logo_uri": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      }
                    },
                    "supply_apr": {
                      "type": "number",
                      "description": "Rewards-only supply APR, excluding the native APY: a fraction."
                    }
                  }
                },
                "description": "The composed reward set: rewards on the vault itself plus rewards forwarded from the markets it supplies, directly or through its adapters. Each `supply_apr` is rewards-only."
              },
              "version": {
                "enum": [
                  "1.0",
                  "1.1",
                  "2.0"
                ],
                "type": "string"
              },
              "chain_id": {
                "type": "integer",
                "maximum": 9007199254740991,
                "exclusiveMinimum": 0
              },
              "curators": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "id",
                    "name",
                    "image",
                    "aum_usd"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "image": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "description": "Null when the curator has no logo."
                    },
                    "aum_usd": {
                      "type": "number",
                      "description": "Assets under management across the curator's vaults, in USD. The internal source reports 0 when the AUM is unknown."
                    }
                  }
                }
              },
              "exposure": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "collateral_asset",
                    "exposure_usd"
                  ],
                  "properties": {
                    "exposure_usd": {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "description": "USD value of the vault asset supplied against this collateral (or held idle). Null when the vault asset has no price. The internal source still reports 0 when the vault state is unavailable."
                    },
                    "collateral_asset": {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "chain_id",
                            "address",
                            "symbol",
                            "name",
                            "decimals",
                            "logo_uri"
                          ],
                          "properties": {
                            "name": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "symbol": {
                              "type": "string"
                            },
                            "address": {
                              "type": "string",
                              "description": "Token address, EIP-55 checksummed."
                            },
                            "chain_id": {
                              "type": "integer",
                              "maximum": 9007199254740991,
                              "description": "EVM chain identifier.",
                              "exclusiveMinimum": 0
                            },
                            "decimals": {
                              "type": "integer",
                              "maximum": 9007199254740991,
                              "minimum": -9007199254740991
                            },
                            "logo_uri": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          }
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "description": "Null for idle assets."
                    }
                  }
                }
              },
              "warnings": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "type",
                    "level",
                    "content",
                    "deprecated"
                  ],
                  "properties": {
                    "type": {
                      "type": "string",
                      "description": "E.g. `not_whitelisted`, `custom`."
                    },
                    "level": {
                      "enum": [
                        "yellow",
                        "red",
                        "green"
                      ],
                      "type": "string"
                    },
                    "content": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "description": "Null unless `custom`."
                    },
                    "deprecated": {
                      "type": "boolean",
                      "description": "True for a `not_whitelisted` warning on a vault that was listed before (non-empty listing history in the source metadata)."
                    }
                  }
                }
              },
              "apy_breakdown": {
                "type": [
                  "object",
                  "null"
                ],
                "required": [
                  "apy",
                  "organic_apy",
                  "surplus_boost_apy",
                  "net_apy_excluding_rewards",
                  "organic_net_apy_excluding_rewards",
                  "surplus_boost_net_apy_excluding_rewards",
                  "surplus_boost_active"
                ],
                "properties": {
                  "apy": {
                    "type": "number",
                    "description": "Native: gross APY of this snapshot; equals organic_apy + surplus_boost_apy. Decimal, 0.05 = 5%. An infinite value is clamped to the largest finite number."
                  },
                  "organic_apy": {
                    "type": "number",
                    "description": "Native: what apy would be without the surplus, capped by the vault's maxRate. Decimal. An infinite value is clamped to the largest finite number."
                  },
                  "surplus_boost_apy": {
                    "type": "number",
                    "description": "Native: APY points added by the surplus (donations), only the part under the maxRate cap. Decimal. An infinite value is clamped to the largest finite number."
                  },
                  "surplus_boost_active": {
                    "type": "boolean",
                    "description": "Native: whether apy is pinned to the maxRate APY by the surplus."
                  },
                  "net_apy_excluding_rewards": {
                    "type": [
                      "number",
                      "null"
                    ],
                    "description": "Net: apy after this snapshot's performance and management fees, excluding rewards. Decimal. Null when the value is not a number; an infinite value is clamped to the largest finite number."
                  },
                  "organic_net_apy_excluding_rewards": {
                    "type": [
                      "number",
                      "null"
                    ],
                    "description": "Net: organic_apy after the same fees. Decimal. Null when the value is not a number; an infinite value is clamped to the largest finite number."
                  },
                  "surplus_boost_net_apy_excluding_rewards": {
                    "type": [
                      "number",
                      "null"
                    ],
                    "description": "Net: net_apy_excluding_rewards minus organic_net_apy_excluding_rewards, floored at 0; null when either is null. Decimal. An infinite value is clamped to the largest finite number."
                  }
                },
                "description": "Native APY split into organic and surplus-boost (donation) parts, gross and net of fees. All fields come from one realtime accrual snapshot (fees included) and reconcile with each other; consumers should take the headline from this object rather than mix it with the top-level apy / net_apy_excluding_rewards, which come from a separate realtime read. Null when the vault has no accrual checkpoint or the breakdown read fails."
              },
              "management_fee": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Annualized management fee as a fraction. Null for V1 vaults."
              },
              "performance_fee": {
                "type": "number",
                "description": "Performance fee as a fraction (0.1 = 10%)."
              },
              "total_assets_usd": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Vault total assets in USD. Null when the vault asset has no price. The internal source still reports 0 when the vault state is unavailable."
              },
              "net_apy_excluding_rewards": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Native APY net of performance and management fees, excluding rewards: a fraction. Null when unknown."
              }
            }
          },
          "assets": {
            "type": "string",
            "description": "In vault asset units.",
            "internalType": "bigint"
          },
          "shares": {
            "type": "string",
            "description": "Vault shares held.",
            "internalType": "bigint"
          },
          "pnl_usd": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Earnings in USD. Null when `pnl_assets` is null or its USD value is unknown; 0 when `pnl_assets` is 0, even if the vault asset has no price."
          },
          "assets_usd": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Null when the vault asset has no price; 0 when `assets` is 0."
          },
          "pnl_assets": {
            "anyOf": [
              {
                "type": "string",
                "internalType": "bigint"
              },
              {
                "type": "null"
              }
            ],
            "description": "Earnings on the position in vault asset units, computed from the user's indexed deposits and withdrawals. Null when unknown."
          }
        }
      },
      "description": "Page of returned items."
    },
    "cursor": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Opaque cursor for the next page. Null on the last page."
    },
    "facets": {
      "type": "object",
      "required": [
        "chain_ids",
        "assets"
      ],
      "properties": {
        "assets": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "value",
              "count",
              "metadata"
            ],
            "properties": {
              "count": {
                "type": "integer",
                "maximum": 9007199254740991,
                "minimum": 0
              },
              "value": {
                "type": "string",
                "description": "Asset selector `<chain_id>:<address>`; filter on it with `chain_ids` + `asset_addresses`."
              },
              "metadata": {
                "type": "object",
                "required": [
                  "chain_id",
                  "address",
                  "symbol",
                  "logo_uri",
                  "tags"
                ],
                "properties": {
                  "tags": {
                    "type": [
                      "array",
                      "null"
                    ],
                    "items": {
                      "type": "string"
                    }
                  },
                  "symbol": {
                    "type": "string"
                  },
                  "address": {
                    "type": "string",
                    "description": "Token address, EIP-55 checksummed."
                  },
                  "chain_id": {
                    "type": "integer",
                    "maximum": 9007199254740991,
                    "description": "EVM chain identifier.",
                    "exclusiveMinimum": 0
                  },
                  "logo_uri": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                }
              }
            }
          },
          "description": "Positions per vault asset, ignoring `asset_addresses` but still narrowed by `chain_ids`."
        },
        "chain_ids": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "value",
              "count"
            ],
            "properties": {
              "count": {
                "type": "integer",
                "maximum": 9007199254740991,
                "minimum": 0
              },
              "value": {
                "type": "integer",
                "maximum": 9007199254740991,
                "exclusiveMinimum": 0
              }
            }
          },
          "description": "Positions per chain, ignoring `chain_ids` but still narrowed by `asset_addresses`, whose selectors embed chain ids."
        }
      }
    },
    "totals": {
      "type": "object",
      "required": [
        "total_assets_usd",
        "total_net_apy",
        "total_net_apy_excluding_rewards",
        "rewards"
      ],
      "properties": {
        "rewards": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "asset",
              "supply_apr"
            ],
            "properties": {
              "asset": {
                "type": "object",
                "required": [
                  "chain_id",
                  "address",
                  "symbol",
                  "name",
                  "decimals",
                  "logo_uri"
                ],
                "properties": {
                  "name": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "symbol": {
                    "type": "string"
                  },
                  "address": {
                    "type": "string",
                    "description": "Token address, EIP-55 checksummed."
                  },
                  "chain_id": {
                    "type": "integer",
                    "maximum": 9007199254740991,
                    "description": "EVM chain identifier.",
                    "exclusiveMinimum": 0
                  },
                  "decimals": {
                    "type": "integer",
                    "maximum": 9007199254740991,
                    "minimum": -9007199254740991
                  },
                  "logo_uri": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                }
              },
              "supply_apr": {
                "type": "number",
                "description": "Rewards-only supply APR, excluding the native APY: a fraction."
              }
            }
          },
          "description": "Rewards-only APR per reward token over the whole portfolio: weighted by `assets_usd` and divided by `total_assets_usd`, so positions without that reward count as 0, unpriced positions are left out, and the APRs add up."
        },
        "total_net_apy": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "description": "Net APY (native net of fees plus rewards), weighted by `assets_usd`. Null when no position has both."
        },
        "total_assets_usd": {
          "type": "number",
          "description": "Sum of `assets_usd`; unpriced positions add 0."
        },
        "total_net_apy_excluding_rewards": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "description": "Native APY net of fees, excluding rewards, weighted by `assets_usd`. Null when no position has both."
        }
      },
      "description": "Portfolio totals over every exposed position, ignoring `chain_ids` and `asset_addresses`."
    },
    "count_total": {
      "type": "integer",
      "maximum": 9007199254740991,
      "minimum": 0,
      "description": "Positions matching the filters, over all pages."
    }
  },
  "x-fastmcp-top-level-schema": "VvrmBridgeEarnPositionsResponse"
}
morpho_get_vault_positions annotations
{
  "title": "Get Vault Positions",
  "readOnlyHint": true,
  "destructiveHint": false
}
morpho_query_markets
Advertised by the server during the last successful anonymous check.
Advertised read-only

List Morpho Blue markets, filterable by chain, loan token and collateral token. Paginate by passing back `cursor` until it is null.

morpho_query_markets input schema
{
  "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."
    }
  }
}
morpho_query_markets output schema
{
  "type": "object",
  "$defs": {
    "BlueMarketsResponseDto": {
      "type": "object",
      "required": [
        "cursor",
        "data"
      ],
      "properties": {
        "data": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "chain_id",
              "market_id",
              "loan_token",
              "collateral_token",
              "oracle",
              "irm",
              "lltv_wad",
              "supply_assets",
              "supply_assets_usd",
              "liquidity_assets",
              "liquidity_assets_usd",
              "outstanding_loans",
              "outstanding_loans_usd",
              "supply_apy",
              "borrow_apy"
            ],
            "properties": {
              "irm": {
                "type": "string",
                "description": "Interest rate model address."
              },
              "oracle": {
                "type": "string",
                "description": "Oracle address."
              },
              "chain_id": {
                "type": "number",
                "description": "Chain id where the market exists."
              },
              "lltv_wad": {
                "type": "string",
                "description": "Liquidation loan-to-value, WAD-scaled (1e18 = 100%).",
                "internalType": "bigint"
              },
              "market_id": {
                "type": "string",
                "description": "Onchain Morpho Blue market id, unique per chain."
              },
              "borrow_apy": {
                "type": "number",
                "description": "Native borrow APY as a decimal fraction (0.05 = 5%), excluding rewards."
              },
              "loan_token": {
                "type": "string",
                "description": "Loan token address."
              },
              "supply_apy": {
                "type": "number",
                "description": "Native supply APY as a decimal fraction (0.05 = 5%), excluding rewards."
              },
              "supply_assets": {
                "type": "string",
                "description": "Total supplied assets, in loan-token units.",
                "internalType": "bigint"
              },
              "collateral_token": {
                "type": "string",
                "description": "Collateral token address. The zero address for idle markets."
              },
              "liquidity_assets": {
                "type": "string",
                "description": "Borrowable liquidity (supplied minus borrowed assets, floored at zero), in loan-token units.",
                "internalType": "bigint"
              },
              "outstanding_loans": {
                "type": "string",
                "description": "Total borrowed assets, in loan-token units.",
                "internalType": "bigint"
              },
              "supply_assets_usd": {
                "type": [
                  "number",
                  "null"
                ],
                "minimum": 0,
                "description": "USD value of total supplied assets, null when the loan token price is unavailable."
              },
              "liquidity_assets_usd": {
                "type": [
                  "number",
                  "null"
                ],
                "minimum": 0,
                "description": "USD value of borrowable liquidity, null when the loan token price is unavailable."
              },
              "outstanding_loans_usd": {
                "type": [
                  "number",
                  "null"
                ],
                "minimum": 0,
                "description": "USD value of total borrowed assets, null when the loan token price is unavailable."
              }
            }
          },
          "description": "Page of returned items."
        },
        "cursor": {
          "type": [
            "string",
            "null"
          ],
          "description": "Opaque cursor for the next page, or null when there is none."
        }
      }
    }
  },
  "required": [
    "cursor",
    "data"
  ],
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "chain_id",
          "market_id",
          "loan_token",
          "collateral_token",
          "oracle",
          "irm",
          "lltv_wad",
          "supply_assets",
          "supply_assets_usd",
          "liquidity_assets",
          "liquidity_assets_usd",
          "outstanding_loans",
          "outstanding_loans_usd",
          "supply_apy",
          "borrow_apy"
        ],
        "properties": {
          "irm": {
            "type": "string",
            "description": "Interest rate model address."
          },
          "oracle": {
            "type": "string",
            "description": "Oracle address."
          },
          "chain_id": {
            "type": "number",
            "description": "Chain id where the market exists."
          },
          "lltv_wad": {
            "type": "string",
            "description": "Liquidation loan-to-value, WAD-scaled (1e18 = 100%).",
            "internalType": "bigint"
          },
          "market_id": {
            "type": "string",
            "description": "Onchain Morpho Blue market id, unique per chain."
          },
          "borrow_apy": {
            "type": "number",
            "description": "Native borrow APY as a decimal fraction (0.05 = 5%), excluding rewards."
          },
          "loan_token": {
            "type": "string",
            "description": "Loan token address."
          },
          "supply_apy": {
            "type": "number",
            "description": "Native supply APY as a decimal fraction (0.05 = 5%), excluding rewards."
          },
          "supply_assets": {
            "type": "string",
            "description": "Total supplied assets, in loan-token units.",
            "internalType": "bigint"
          },
          "collateral_token": {
            "type": "string",
            "description": "Collateral token address. The zero address for idle markets."
          },
          "liquidity_assets": {
            "type": "string",
            "description": "Borrowable liquidity (supplied minus borrowed assets, floored at zero), in loan-token units.",
            "internalType": "bigint"
          },
          "outstanding_loans": {
            "type": "string",
            "description": "Total borrowed assets, in loan-token units.",
            "internalType": "bigint"
          },
          "supply_assets_usd": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0,
            "description": "USD value of total supplied assets, null when the loan token price is unavailable."
          },
          "liquidity_assets_usd": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0,
            "description": "USD value of borrowable liquidity, null when the loan token price is unavailable."
          },
          "outstanding_loans_usd": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0,
            "description": "USD value of total borrowed assets, null when the loan token price is unavailable."
          }
        }
      },
      "description": "Page of returned items."
    },
    "cursor": {
      "type": [
        "string",
        "null"
      ],
      "description": "Opaque cursor for the next page, or null when there is none."
    }
  },
  "x-fastmcp-top-level-schema": "BlueMarketsResponseDto"
}
morpho_query_markets annotations
{
  "title": "Query Markets",
  "readOnlyHint": true,
  "destructiveHint": false
}
morpho_get_market
Advertised by the server during the last successful anonymous check.
Advertised read-only

Get one Morpho Blue market by market selector.

morpho_get_market input schema
{
  "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."
    }
  }
}
morpho_get_market output schema
{
  "type": "object",
  "$defs": {
    "BlueMarketResponse": {
      "type": "object",
      "required": [
        "data"
      ],
      "properties": {
        "data": {
          "type": "object",
          "required": [
            "chain_id",
            "market_id",
            "loan_token",
            "collateral_token",
            "oracle",
            "irm",
            "lltv_wad",
            "supply_assets",
            "supply_assets_usd",
            "liquidity_assets",
            "liquidity_assets_usd",
            "outstanding_loans",
            "outstanding_loans_usd",
            "supply_apy",
            "borrow_apy"
          ],
          "properties": {
            "irm": {
              "type": "string",
              "description": "Interest rate model address."
            },
            "oracle": {
              "type": "string",
              "description": "Oracle address."
            },
            "chain_id": {
              "type": "number",
              "description": "Chain id where the market exists."
            },
            "lltv_wad": {
              "type": "string",
              "description": "Liquidation loan-to-value, WAD-scaled (1e18 = 100%).",
              "internalType": "bigint"
            },
            "market_id": {
              "type": "string",
              "description": "Onchain Morpho Blue market id, unique per chain."
            },
            "borrow_apy": {
              "type": "number",
              "description": "Native borrow APY as a decimal fraction (0.05 = 5%), excluding rewards."
            },
            "loan_token": {
              "type": "string",
              "description": "Loan token address."
            },
            "supply_apy": {
              "type": "number",
              "description": "Native supply APY as a decimal fraction (0.05 = 5%), excluding rewards."
            },
            "supply_assets": {
              "type": "string",
              "description": "Total supplied assets, in loan-token units.",
              "internalType": "bigint"
            },
            "collateral_token": {
              "type": "string",
              "description": "Collateral token address. The zero address for idle markets."
            },
            "liquidity_assets": {
              "type": "string",
              "description": "Borrowable liquidity (supplied minus borrowed assets, floored at zero), in loan-token units.",
              "internalType": "bigint"
            },
            "outstanding_loans": {
              "type": "string",
              "description": "Total borrowed assets, in loan-token units.",
              "internalType": "bigint"
            },
            "supply_assets_usd": {
              "type": [
                "number",
                "null"
              ],
              "minimum": 0,
              "description": "USD value of total supplied assets, null when the loan token price is unavailable."
            },
            "liquidity_assets_usd": {
              "type": [
                "number",
                "null"
              ],
              "minimum": 0,
              "description": "USD value of borrowable liquidity, null when the loan token price is unavailable."
            },
            "outstanding_loans_usd": {
              "type": [
                "number",
                "null"
              ],
              "minimum": 0,
              "description": "USD value of total borrowed assets, null when the loan token price is unavailable."
            }
          }
        }
      }
    }
  },
  "required": [
    "data"
  ],
  "properties": {
    "data": {
      "type": "object",
      "required": [
        "chain_id",
        "market_id",
        "loan_token",
        "collateral_token",
        "oracle",
        "irm",
        "lltv_wad",
        "supply_assets",
        "supply_assets_usd",
        "liquidity_assets",
        "liquidity_assets_usd",
        "outstanding_loans",
        "outstanding_loans_usd",
        "supply_apy",
        "borrow_apy"
      ],
      "properties": {
        "irm": {
          "type": "string",
          "description": "Interest rate model address."
        },
        "oracle": {
          "type": "string",
          "description": "Oracle address."
        },
        "chain_id": {
          "type": "number",
          "description": "Chain id where the market exists."
        },
        "lltv_wad": {
          "type": "string",
          "description": "Liquidation loan-to-value, WAD-scaled (1e18 = 100%).",
          "internalType": "bigint"
        },
        "market_id": {
          "type": "string",
          "description": "Onchain Morpho Blue market id, unique per chain."
        },
        "borrow_apy": {
          "type": "number",
          "description": "Native borrow APY as a decimal fraction (0.05 = 5%), excluding rewards."
        },
        "loan_token": {
          "type": "string",
          "description": "Loan token address."
        },
        "supply_apy": {
          "type": "number",
          "description": "Native supply APY as a decimal fraction (0.05 = 5%), excluding rewards."
        },
        "supply_assets": {
          "type": "string",
          "description": "Total supplied assets, in loan-token units.",
          "internalType": "bigint"
        },
        "collateral_token": {
          "type": "string",
          "description": "Collateral token address. The zero address for idle markets."
        },
        "liquidity_assets": {
          "type": "string",
          "description": "Borrowable liquidity (supplied minus borrowed assets, floored at zero), in loan-token units.",
          "internalType": "bigint"
        },
        "outstanding_loans": {
          "type": "string",
          "description": "Total borrowed assets, in loan-token units.",
          "internalType": "bigint"
        },
        "supply_assets_usd": {
          "type": [
            "number",
            "null"
          ],
          "minimum": 0,
          "description": "USD value of total supplied assets, null when the loan token price is unavailable."
        },
        "liquidity_assets_usd": {
          "type": [
            "number",
            "null"
          ],
          "minimum": 0,
          "description": "USD value of borrowable liquidity, null when the loan token price is unavailable."
        },
        "outstanding_loans_usd": {
          "type": [
            "number",
            "null"
          ],
          "minimum": 0,
          "description": "USD value of total borrowed assets, null when the loan token price is unavailable."
        }
      }
    }
  },
  "x-fastmcp-top-level-schema": "BlueMarketResponse"
}
morpho_get_market annotations
{
  "title": "Get Market",
  "readOnlyHint": true,
  "destructiveHint": false
}
morpho_get_market_positions
Advertised by the server during the last successful anonymous check.
Advertised read-only

List a user's Morpho Blue market positions, filterable by chain. Paginate by passing back `cursor` until it is null.

morpho_get_market_positions input schema
{
  "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."
    }
  }
}
morpho_get_market_positions output schema
{
  "type": "object",
  "$defs": {
    "BlueUserPositionsResponse": {
      "type": "object",
      "required": [
        "data",
        "cursor"
      ],
      "properties": {
        "data": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "chain_id",
              "market_id",
              "loan_asset",
              "collateral_asset",
              "supply_apy",
              "borrow_apy",
              "supply_assets_usd",
              "borrow_assets_usd",
              "collateral_assets_usd",
              "health_factor",
              "lltv_wad",
              "supply_shares",
              "supply_assets",
              "borrow_shares",
              "borrow_assets",
              "collateral_assets",
              "collateral_value_assets"
            ],
            "properties": {
              "chain_id": {
                "type": "integer",
                "maximum": 9007199254740991,
                "description": "EVM chain identifier.",
                "exclusiveMinimum": 0
              },
              "lltv_wad": {
                "type": "string",
                "description": "Market liquidation loan-to-value, WAD-scaled (1e18 = 100%).",
                "internalType": "bigint"
              },
              "market_id": {
                "type": "string",
                "description": "Morpho Blue market identifier."
              },
              "borrow_apy": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "Current market borrow APY, rewards excluded, as a fraction (0.05 = 5%). Null when the realtime store has no state for the market; an infinite value is clamped to the largest finite number."
              },
              "loan_asset": {
                "type": "object",
                "required": [
                  "address",
                  "symbol",
                  "decimals",
                  "logo_uri",
                  "price_usd"
                ],
                "properties": {
                  "symbol": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Token symbol, or null if unknown."
                  },
                  "address": {
                    "type": "string",
                    "description": "Token contract address."
                  },
                  "decimals": {
                    "type": "integer",
                    "maximum": 9007199254740991,
                    "minimum": 0,
                    "description": "Token decimals."
                  },
                  "logo_uri": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Token logo URI, or null if unknown."
                  },
                  "price_usd": {
                    "type": [
                      "number",
                      "null"
                    ],
                    "description": "Current USD price, null when the pricing service has none."
                  }
                },
                "description": "Loan token metadata and price."
              },
              "supply_apy": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "Current market supply APY, rewards excluded, as a fraction (0.05 = 5%). Null when the realtime store has no state for the market; an infinite value is clamped to the largest finite number."
              },
              "borrow_assets": {
                "type": "string",
                "description": "Borrowed amount in loan token base units, from the borrow shares at the latest indexed share price.",
                "internalType": "bigint"
              },
              "borrow_shares": {
                "type": "string",
                "description": "Borrow shares owed.",
                "internalType": "bigint"
              },
              "health_factor": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "Collateral value times LLTV over borrowed assets. Null when the position has no debt or no oracle price is known."
              },
              "supply_assets": {
                "type": "string",
                "description": "Supplied amount in loan token base units, from the supply shares at the latest indexed share price.",
                "internalType": "bigint"
              },
              "supply_shares": {
                "type": "string",
                "description": "Supply shares held.",
                "internalType": "bigint"
              },
              "collateral_asset": {
                "type": [
                  "object",
                  "null"
                ],
                "required": [
                  "address",
                  "symbol",
                  "decimals",
                  "logo_uri",
                  "price_usd"
                ],
                "properties": {
                  "symbol": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Token symbol, or null if unknown."
                  },
                  "address": {
                    "type": "string",
                    "description": "Token contract address."
                  },
                  "decimals": {
                    "type": "integer",
                    "maximum": 9007199254740991,
                    "minimum": 0,
                    "description": "Token decimals."
                  },
                  "logo_uri": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Token logo URI, or null if unknown."
                  },
                  "price_usd": {
                    "type": [
                      "number",
                      "null"
                    ],
                    "description": "Current USD price, null when the pricing service has none."
                  }
                },
                "description": "Collateral token metadata and price. Null for an idle market, whose collateral token is the zero address."
              },
              "borrow_assets_usd": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "USD value of `borrow_assets`. Null, never 0, when `borrow_assets` is not 0 and the loan token has no price."
              },
              "collateral_assets": {
                "type": "string",
                "description": "Collateral deposited, in collateral token base units.",
                "internalType": "bigint"
              },
              "supply_assets_usd": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "USD value of `supply_assets`. Null, never 0, when `supply_assets` is not 0 and the loan token has no price."
              },
              "collateral_assets_usd": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "USD value of `collateral_assets`. Null for an idle market and, when `collateral_assets` is not 0, when the collateral token has no price."
              },
              "collateral_value_assets": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Value of `collateral_assets` in loan token base units at the market oracle price. Null when the realtime store has no oracle price for the market.",
                "internalType": "bigint"
              }
            }
          },
          "description": "Page of returned items."
        },
        "cursor": {
          "type": [
            "string",
            "null"
          ],
          "description": "Opaque cursor for the next page. Null on the last page."
        }
      }
    }
  },
  "required": [
    "data",
    "cursor"
  ],
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "chain_id",
          "market_id",
          "loan_asset",
          "collateral_asset",
          "supply_apy",
          "borrow_apy",
          "supply_assets_usd",
          "borrow_assets_usd",
          "collateral_assets_usd",
          "health_factor",
          "lltv_wad",
          "supply_shares",
          "supply_assets",
          "borrow_shares",
          "borrow_assets",
          "collateral_assets",
          "collateral_value_assets"
        ],
        "properties": {
          "chain_id": {
            "type": "integer",
            "maximum": 9007199254740991,
            "description": "EVM chain identifier.",
            "exclusiveMinimum": 0
          },
          "lltv_wad": {
            "type": "string",
            "description": "Market liquidation loan-to-value, WAD-scaled (1e18 = 100%).",
            "internalType": "bigint"
          },
          "market_id": {
            "type": "string",
            "description": "Morpho Blue market identifier."
          },
          "borrow_apy": {
            "type": [
              "number",
              "null"
            ],
            "description": "Current market borrow APY, rewards excluded, as a fraction (0.05 = 5%). Null when the realtime store has no state for the market; an infinite value is clamped to the largest finite number."
          },
          "loan_asset": {
            "type": "object",
            "required": [
              "address",
              "symbol",
              "decimals",
              "logo_uri",
              "price_usd"
            ],
            "properties": {
              "symbol": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Token symbol, or null if unknown."
              },
              "address": {
                "type": "string",
                "description": "Token contract address."
              },
              "decimals": {
                "type": "integer",
                "maximum": 9007199254740991,
                "minimum": 0,
                "description": "Token decimals."
              },
              "logo_uri": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Token logo URI, or null if unknown."
              },
              "price_usd": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "Current USD price, null when the pricing service has none."
              }
            },
            "description": "Loan token metadata and price."
          },
          "supply_apy": {
            "type": [
              "number",
              "null"
            ],
            "description": "Current market supply APY, rewards excluded, as a fraction (0.05 = 5%). Null when the realtime store has no state for the market; an infinite value is clamped to the largest finite number."
          },
          "borrow_assets": {
            "type": "string",
            "description": "Borrowed amount in loan token base units, from the borrow shares at the latest indexed share price.",
            "internalType": "bigint"
          },
          "borrow_shares": {
            "type": "string",
            "description": "Borrow shares owed.",
            "internalType": "bigint"
          },
          "health_factor": {
            "type": [
              "number",
              "null"
            ],
            "description": "Collateral value times LLTV over borrowed assets. Null when the position has no debt or no oracle price is known."
          },
          "supply_assets": {
            "type": "string",
            "description": "Supplied amount in loan token base units, from the supply shares at the latest indexed share price.",
            "internalType": "bigint"
          },
          "supply_shares": {
            "type": "string",
            "description": "Supply shares held.",
            "internalType": "bigint"
          },
          "collateral_asset": {
            "type": [
              "object",
              "null"
            ],
            "required": [
              "address",
              "symbol",
              "decimals",
              "logo_uri",
              "price_usd"
            ],
            "properties": {
              "symbol": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Token symbol, or null if unknown."
              },
              "address": {
                "type": "string",
                "description": "Token contract address."
              },
              "decimals": {
                "type": "integer",
                "maximum": 9007199254740991,
                "minimum": 0,
                "description": "Token decimals."
              },
              "logo_uri": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Token logo URI, or null if unknown."
              },
              "price_usd": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "Current USD price, null when the pricing service has none."
              }
            },
            "description": "Collateral token metadata and price. Null for an idle market, whose collateral token is the zero address."
          },
          "borrow_assets_usd": {
            "type": [
              "number",
              "null"
            ],
            "description": "USD value of `borrow_assets`. Null, never 0, when `borrow_assets` is not 0 and the loan token has no price."
          },
          "collateral_assets": {
            "type": "string",
            "description": "Collateral deposited, in collateral token base units.",
            "internalType": "bigint"
          },
          "supply_assets_usd": {
            "type": [
              "number",
              "null"
            ],
            "description": "USD value of `supply_assets`. Null, never 0, when `supply_assets` is not 0 and the loan token has no price."
          },
          "collateral_assets_usd": {
            "type": [
              "number",
              "null"
            ],
            "description": "USD value of `collateral_assets`. Null for an idle market and, when `collateral_assets` is not 0, when the collateral token has no price."
          },
          "collateral_value_assets": {
            "type": [
              "string",
              "null"
            ],
            "description": "Value of `collateral_assets` in loan token base units at the market oracle price. Null when the realtime store has no oracle price for the market.",
            "internalType": "bigint"
          }
        }
      },
      "description": "Page of returned items."
    },
    "cursor": {
      "type": [
        "string",
        "null"
      ],
      "description": "Opaque cursor for the next page. Null on the last page."
    }
  },
  "x-fastmcp-top-level-schema": "BlueUserPositionsResponse"
}
morpho_get_market_positions annotations
{
  "title": "Get Market Positions",
  "readOnlyHint": true,
  "destructiveHint": false
}
morpho_midnight_list_markets
Advertised by the server during the last successful anonymous check.
Advertised read-only

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`.

morpho_midnight_list_markets input schema
{
  "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."
    }
  }
}
morpho_midnight_list_markets output schema
{
  "type": "object",
  "$defs": {
    "MarketsResponse": {
      "type": "object",
      "required": [
        "cursor",
        "data"
      ],
      "properties": {
        "data": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "chain_id",
              "market_id",
              "market_family_id",
              "loan_token",
              "maturity",
              "rcf_threshold",
              "enter_gate",
              "liquidator_gate",
              "total_units",
              "tick_granularity",
              "settlement_fee_schedule",
              "current_settlement_fee_wad",
              "current_settlement_fee_cbp",
              "continuous_fee_rate",
              "listed",
              "lend_depth",
              "borrow_depth",
              "collaterals"
            ],
            "properties": {
              "listed": {
                "type": "boolean",
                "description": "Whether this market is surfaced by the app trust layer (curated listing)."
              },
              "chain_id": {
                "type": "number",
                "description": "Chain id where the market exists."
              },
              "maturity": {
                "type": "integer",
                "maximum": 9007199254740991,
                "minimum": 0,
                "description": "Maturity timestamp in unix seconds."
              },
              "market_id": {
                "type": "string",
                "description": "Globally unique Midnight market id."
              },
              "enter_gate": {
                "type": "string",
                "description": "Enter gate address."
              },
              "lend_depth": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Cached lend-side order-book depth in loan-token units (sum of bid level assets). Null until first Router sync, or once the market has matured.",
                "internalType": "bigint"
              },
              "loan_token": {
                "type": "string",
                "description": "Loan token address."
              },
              "collaterals": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "token",
                    "lltv",
                    "liquidation_cursor",
                    "oracle"
                  ],
                  "properties": {
                    "lltv": {
                      "type": "string",
                      "description": "Liquidation loan-to-value for this collateral, WAD-scaled.",
                      "internalType": "bigint"
                    },
                    "token": {
                      "type": "string",
                      "description": "Collateral token address."
                    },
                    "oracle": {
                      "type": "string",
                      "description": "Oracle address used for this collateral."
                    },
                    "liquidation_cursor": {
                      "type": "string",
                      "description": "Liquidation cursor for this collateral, WAD-scaled.",
                      "internalType": "bigint"
                    }
                  }
                },
                "description": "Collateral configuration for the market."
              },
              "total_units": {
                "type": "string",
                "description": "Current total units.",
                "internalType": "bigint"
              },
              "borrow_depth": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Cached borrow-side order-book depth in loan-token units (sum of ask level assets). Null until first Router sync, or once the market has matured.",
                "internalType": "bigint"
              },
              "rcf_threshold": {
                "type": "string",
                "description": "Recovery close factor threshold.",
                "internalType": "bigint"
              },
              "liquidator_gate": {
                "type": "string",
                "description": "Liquidator gate address."
              },
              "market_family_id": {
                "type": "string",
                "description": "Stable identifier shared by Midnight markets that differ only by maturity."
              },
              "tick_granularity": {
                "type": "integer",
                "maximum": 9007199254740991,
                "minimum": -9007199254740991,
                "description": "Offer tick granularity for this market. Valid offer ticks are multiples of this value."
              },
              "continuous_fee_rate": {
                "type": "string",
                "description": "Per-second continuous fee rate, WAD-scaled.",
                "internalType": "bigint"
              },
              "settlement_fee_schedule": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "time_to_maturity_days",
                    "fee_cbp"
                  ],
                  "properties": {
                    "fee_cbp": {
                      "type": "string",
                      "description": "Settlement fee at this breakpoint, in cbp (1 cbp = 1e-6 WAD = 0.01 bps).",
                      "internalType": "bigint"
                    },
                    "time_to_maturity_days": {
                      "type": "integer",
                      "maximum": 9007199254740991,
                      "minimum": 0,
                      "description": "Settlement fee breakpoint time to maturity, in days."
                    }
                  }
                },
                "maxItems": 7,
                "minItems": 7,
                "description": "Settlement fee schedule at [0d, 1d, 7d, 30d, 90d, 180d, 360d] time-to-maturity breakpoints."
              },
              "current_settlement_fee_cbp": {
                "type": "string",
                "pattern": "^\\d+(\\.\\d+)?$",
                "description": "Current settlement fee in cbp. May include decimals because the current fee is interpolated."
              },
              "current_settlement_fee_wad": {
                "type": "string",
                "description": "Current settlement fee, WAD-scaled, based on time to maturity.",
                "internalType": "bigint"
              }
            }
          },
          "description": "Page of returned items."
        },
        "cursor": {
          "type": [
            "string",
            "null"
          ],
          "description": "Opaque cursor for the next page, or null when there is none."
        }
      }
    }
  },
  "required": [
    "cursor",
    "data"
  ],
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "chain_id",
          "market_id",
          "market_family_id",
          "loan_token",
          "maturity",
          "rcf_threshold",
          "enter_gate",
          "liquidator_gate",
          "total_units",
          "tick_granularity",
          "settlement_fee_schedule",
          "current_settlement_fee_wad",
          "current_settlement_fee_cbp",
          "continuous_fee_rate",
          "listed",
          "lend_depth",
          "borrow_depth",
          "collaterals"
        ],
        "properties": {
          "listed": {
            "type": "boolean",
            "description": "Whether this market is surfaced by the app trust layer (curated listing)."
          },
          "chain_id": {
            "type": "number",
            "description": "Chain id where the market exists."
          },
          "maturity": {
            "type": "integer",
            "maximum": 9007199254740991,
            "minimum": 0,
            "description": "Maturity timestamp in unix seconds."
          },
          "market_id": {
            "type": "string",
            "description": "Globally unique Midnight market id."
          },
          "enter_gate": {
            "type": "string",
            "description": "Enter gate address."
          },
          "lend_depth": {
            "type": [
              "string",
              "null"
            ],
            "description": "Cached lend-side order-book depth in loan-token units (sum of bid level assets). Null until first Router sync, or once the market has matured.",
            "internalType": "bigint"
          },
          "loan_token": {
            "type": "string",
            "description": "Loan token address."
          },
          "collaterals": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "token",
                "lltv",
                "liquidation_cursor",
                "oracle"
              ],
              "properties": {
                "lltv": {
                  "type": "string",
                  "description": "Liquidation loan-to-value for this collateral, WAD-scaled.",
                  "internalType": "bigint"
                },
                "token": {
                  "type": "string",
                  "description": "Collateral token address."
                },
                "oracle": {
                  "type": "string",
                  "description": "Oracle address used for this collateral."
                },
                "liquidation_cursor": {
                  "type": "string",
                  "description": "Liquidation cursor for this collateral, WAD-scaled.",
                  "internalType": "bigint"
                }
              }
            },
            "description": "Collateral configuration for the market."
          },
          "total_units": {
            "type": "string",
            "description": "Current total units.",
            "internalType": "bigint"
          },
          "borrow_depth": {
            "type": [
              "string",
              "null"
            ],
            "description": "Cached borrow-side order-book depth in loan-token units (sum of ask level assets). Null until first Router sync, or once the market has matured.",
            "internalType": "bigint"
          },
          "rcf_threshold": {
            "type": "string",
            "description": "Recovery close factor threshold.",
            "internalType": "bigint"
          },
          "liquidator_gate": {
            "type": "string",
            "description": "Liquidator gate address."
          },
          "market_family_id": {
            "type": "string",
            "description": "Stable identifier shared by Midnight markets that differ only by maturity."
          },
          "tick_granularity": {
            "type": "integer",
            "maximum": 9007199254740991,
            "minimum": -9007199254740991,
            "description": "Offer tick granularity for this market. Valid offer ticks are multiples of this value."
          },
          "continuous_fee_rate": {
            "type": "string",
            "description": "Per-second continuous fee rate, WAD-scaled.",
            "internalType": "bigint"
          },
          "settlement_fee_schedule": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "time_to_maturity_days",
                "fee_cbp"
              ],
              "properties": {
                "fee_cbp": {
                  "type": "string",
                  "description": "Settlement fee at this breakpoint, in cbp (1 cbp = 1e-6 WAD = 0.01 bps).",
                  "internalType": "bigint"
                },
                "time_to_maturity_days": {
                  "type": "integer",
                  "maximum": 9007199254740991,
                  "minimum": 0,
                  "description": "Settlement fee breakpoint time to maturity, in days."
                }
              }
            },
            "maxItems": 7,
            "minItems": 7,
            "description": "Settlement fee schedule at [0d, 1d, 7d, 30d, 90d, 180d, 360d] time-to-maturity breakpoints."
          },
          "current_settlement_fee_cbp": {
            "type": "string",
            "pattern": "^\\d+(\\.\\d+)?$",
            "description": "Current settlement fee in cbp. May include decimals because the current fee is interpolated."
          },
          "current_settlement_fee_wad": {
            "type": "string",
            "description": "Current settlement fee, WAD-scaled, based on time to maturity.",
            "internalType": "bigint"
          }
        }
      },
      "description": "Page of returned items."
    },
    "cursor": {
      "type": [
        "string",
        "null"
      ],
      "description": "Opaque cursor for the next page, or null when there is none."
    }
  },
  "x-fastmcp-top-level-schema": "MarketsResponse"
}
morpho_midnight_list_markets annotations
{
  "title": "Midnight List Markets",
  "readOnlyHint": true,
  "destructiveHint": false
}
morpho_midnight_get_market
Advertised by the server during the last successful anonymous check.
Advertised read-only

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.

morpho_midnight_get_market input schema
{
  "type": "object",
  "required": [
    "market-id"
  ],
  "properties": {
    "market-id": {
      "type": "string",
      "example": "0xcc9418ea594c6e658650aedd205ce4544b266b69493f56fd2adc65c14bd06738",
      "description": "Midnight market id."
    }
  }
}
morpho_midnight_get_market output schema
{
  "type": "object",
  "$defs": {
    "MarketDetailResponse": {
      "type": "object",
      "required": [
        "data"
      ],
      "properties": {
        "data": {
          "type": "object",
          "required": [
            "chain_id",
            "market_id",
            "market_family_id",
            "loan_token",
            "maturity",
            "rcf_threshold",
            "enter_gate",
            "liquidator_gate",
            "collaterals"
          ],
          "properties": {
            "chain_id": {
              "type": "number",
              "description": "Chain id where the market exists."
            },
            "maturity": {
              "type": "integer",
              "maximum": 9007199254740991,
              "minimum": 0,
              "description": "Maturity timestamp in unix seconds."
            },
            "market_id": {
              "type": "string",
              "description": "Globally unique Midnight market id."
            },
            "enter_gate": {
              "type": "string",
              "description": "Enter gate address."
            },
            "loan_token": {
              "type": "string",
              "description": "Loan token address."
            },
            "collaterals": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "token",
                  "lltv",
                  "liquidation_cursor",
                  "oracle"
                ],
                "properties": {
                  "lltv": {
                    "type": "string",
                    "description": "Liquidation loan-to-value for this collateral, WAD-scaled.",
                    "internalType": "bigint"
                  },
                  "token": {
                    "type": "string",
                    "description": "Collateral token address."
                  },
                  "oracle": {
                    "type": "string",
                    "description": "Oracle address used for this collateral."
                  },
                  "liquidation_cursor": {
                    "type": "string",
                    "description": "Liquidation cursor for this collateral, WAD-scaled.",
                    "internalType": "bigint"
                  }
                }
              },
              "description": "Collateral configuration for the market."
            },
            "rcf_threshold": {
              "type": "string",
              "description": "Recovery close factor threshold.",
              "internalType": "bigint"
            },
            "liquidator_gate": {
              "type": "string",
              "description": "Liquidator gate address."
            },
            "market_family_id": {
              "type": "string",
              "description": "Stable identifier shared by Midnight markets that differ only by maturity."
            }
          },
          "description": "Midnight market configuration payload."
        }
      }
    }
  },
  "required": [
    "data"
  ],
  "properties": {
    "data": {
      "type": "object",
      "required": [
        "chain_id",
        "market_id",
        "market_family_id",
        "loan_token",
        "maturity",
        "rcf_threshold",
        "enter_gate",
        "liquidator_gate",
        "collaterals"
      ],
      "properties": {
        "chain_id": {
          "type": "number",
          "description": "Chain id where the market exists."
        },
        "maturity": {
          "type": "integer",
          "maximum": 9007199254740991,
          "minimum": 0,
          "description": "Maturity timestamp in unix seconds."
        },
        "market_id": {
          "type": "string",
          "description": "Globally unique Midnight market id."
        },
        "enter_gate": {
          "type": "string",
          "description": "Enter gate address."
        },
        "loan_token": {
          "type": "string",
          "description": "Loan token address."
        },
        "collaterals": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "token",
              "lltv",
              "liquidation_cursor",
              "oracle"
            ],
            "properties": {
              "lltv": {
                "type": "string",
                "description": "Liquidation loan-to-value for this collateral, WAD-scaled.",
                "internalType": "bigint"
              },
              "token": {
                "type": "string",
                "description": "Collateral token address."
              },
              "oracle": {
                "type": "string",
                "description": "Oracle address used for this collateral."
              },
              "liquidation_cursor": {
                "type": "string",
                "description": "Liquidation cursor for this collateral, WAD-scaled.",
                "internalType": "bigint"
              }
            }
          },
          "description": "Collateral configuration for the market."
        },
        "rcf_threshold": {
          "type": "string",
          "description": "Recovery close factor threshold.",
          "internalType": "bigint"
        },
        "liquidator_gate": {
          "type": "string",
          "description": "Liquidator gate address."
        },
        "market_family_id": {
          "type": "string",
          "description": "Stable identifier shared by Midnight markets that differ only by maturity."
        }
      },
      "description": "Midnight market configuration payload."
    }
  },
  "x-fastmcp-top-level-schema": "MarketDetailResponse"
}
morpho_midnight_get_market annotations
{
  "title": "Midnight Get Market",
  "readOnlyHint": true,
  "destructiveHint": false
}
morpho_midnight_get_market_state
Advertised by the server during the last successful anonymous check.
Advertised read-only

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.

morpho_midnight_get_market_state input schema
{
  "type": "object",
  "required": [
    "market-id"
  ],
  "properties": {
    "market-id": {
      "type": "string",
      "example": "0xcc9418ea594c6e658650aedd205ce4544b266b69493f56fd2adc65c14bd06738",
      "description": "Midnight market id."
    }
  }
}
morpho_midnight_get_market_state output schema
{
  "type": "object",
  "$defs": {
    "MarketStateResponse": {
      "type": "object",
      "required": [
        "data"
      ],
      "properties": {
        "data": {
          "type": "object",
          "required": [
            "chain_id",
            "market_id",
            "market_family_id",
            "last_indexed_block",
            "total_units",
            "tick_granularity",
            "settlement_fee_schedule",
            "current_settlement_fee_wad",
            "current_settlement_fee_cbp",
            "continuous_fee_rate"
          ],
          "properties": {
            "chain_id": {
              "type": "number",
              "description": "Chain id where the market exists."
            },
            "market_id": {
              "type": "string",
              "description": "Globally unique Midnight market id."
            },
            "total_units": {
              "type": "string",
              "description": "Current total units.",
              "internalType": "bigint"
            },
            "market_family_id": {
              "type": "string",
              "description": "Stable identifier shared by Midnight markets that differ only by maturity."
            },
            "tick_granularity": {
              "type": "integer",
              "maximum": 9007199254740991,
              "minimum": -9007199254740991,
              "description": "Offer tick granularity for this market. Valid offer ticks are multiples of this value."
            },
            "last_indexed_block": {
              "type": "string",
              "description": "Latest block covered by the API when this market state payload was computed.",
              "internalType": "bigint"
            },
            "continuous_fee_rate": {
              "type": "string",
              "description": "Per-second continuous fee rate, WAD-scaled.",
              "internalType": "bigint"
            },
            "settlement_fee_schedule": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "time_to_maturity_days",
                  "fee_cbp"
                ],
                "properties": {
                  "fee_cbp": {
                    "type": "string",
                    "description": "Settlement fee at this breakpoint, in cbp (1 cbp = 1e-6 WAD = 0.01 bps).",
                    "internalType": "bigint"
                  },
                  "time_to_maturity_days": {
                    "type": "integer",
                    "maximum": 9007199254740991,
                    "minimum": 0,
                    "description": "Settlement fee breakpoint time to maturity, in days."
                  }
                }
              },
              "maxItems": 7,
              "minItems": 7,
              "description": "Settlement fee schedule at [0d, 1d, 7d, 30d, 90d, 180d, 360d] time-to-maturity breakpoints."
            },
            "current_settlement_fee_cbp": {
              "type": "string",
              "pattern": "^\\d+(\\.\\d+)?$",
              "description": "Current settlement fee in cbp. May include decimals because the current fee is interpolated."
            },
            "current_settlement_fee_wad": {
              "type": "string",
              "description": "Current settlement fee, WAD-scaled, based on time to maturity.",
              "internalType": "bigint"
            }
          },
          "description": "Midnight market dynamic state payload."
        }
      }
    }
  },
  "required": [
    "data"
  ],
  "properties": {
    "data": {
      "type": "object",
      "required": [
        "chain_id",
        "market_id",
        "market_family_id",
        "last_indexed_block",
        "total_units",
        "tick_granularity",
        "settlement_fee_schedule",
        "current_settlement_fee_wad",
        "current_settlement_fee_cbp",
        "continuous_fee_rate"
      ],
      "properties": {
        "chain_id": {
          "type": "number",
          "description": "Chain id where the market exists."
        },
        "market_id": {
          "type": "string",
          "description": "Globally unique Midnight market id."
        },
        "total_units": {
          "type": "string",
          "description": "Current total units.",
          "internalType": "bigint"
        },
        "market_family_id": {
          "type": "string",
          "description": "Stable identifier shared by Midnight markets that differ only by maturity."
        },
        "tick_granularity": {
          "type": "integer",
          "maximum": 9007199254740991,
          "minimum": -9007199254740991,
          "description": "Offer tick granularity for this market. Valid offer ticks are multiples of this value."
        },
        "last_indexed_block": {
          "type": "string",
          "description": "Latest block covered by the API when this market state payload was computed.",
          "internalType": "bigint"
        },
        "continuous_fee_rate": {
          "type": "string",
          "description": "Per-second continuous fee rate, WAD-scaled.",
          "internalType": "bigint"
        },
        "settlement_fee_schedule": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "time_to_maturity_days",
              "fee_cbp"
            ],
            "properties": {
              "fee_cbp": {
                "type": "string",
                "description": "Settlement fee at this breakpoint, in cbp (1 cbp = 1e-6 WAD = 0.01 bps).",
                "internalType": "bigint"
              },
              "time_to_maturity_days": {
                "type": "integer",
                "maximum": 9007199254740991,
                "minimum": 0,
                "description": "Settlement fee breakpoint time to maturity, in days."
              }
            }
          },
          "maxItems": 7,
          "minItems": 7,
          "description": "Settlement fee schedule at [0d, 1d, 7d, 30d, 90d, 180d, 360d] time-to-maturity breakpoints."
        },
        "current_settlement_fee_cbp": {
          "type": "string",
          "pattern": "^\\d+(\\.\\d+)?$",
          "description": "Current settlement fee in cbp. May include decimals because the current fee is interpolated."
        },
        "current_settlement_fee_wad": {
          "type": "string",
          "description": "Current settlement fee, WAD-scaled, based on time to maturity.",
          "internalType": "bigint"
        }
      },
      "description": "Midnight market dynamic state payload."
    }
  },
  "x-fastmcp-top-level-schema": "MarketStateResponse"
}
morpho_midnight_get_market_state annotations
{
  "title": "Midnight Get Market State",
  "readOnlyHint": true,
  "destructiveHint": false
}
morpho_midnight_list_user_positions
Advertised by the server during the last successful anonymous check.
Advertised read-only

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`.

morpho_midnight_list_user_positions input schema
{
  "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."
    }
  }
}
morpho_midnight_list_user_positions output schema
{
  "type": "object",
  "$defs": {
    "PositionsResponse": {
      "type": "object",
      "required": [
        "cursor",
        "data"
      ],
      "properties": {
        "data": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "chain_id",
              "market_id",
              "user_address",
              "loan_token",
              "maturity",
              "credit",
              "pending_fee",
              "last_loss_factor",
              "loss_factor",
              "debt",
              "cost_basis",
              "effective_rate_wad",
              "effective_apr",
              "collaterals",
              "created_at",
              "type"
            ],
            "properties": {
              "debt": {
                "type": "string",
                "description": "Current debt amount.",
                "internalType": "bigint"
              },
              "type": {
                "enum": [
                  "lend",
                  "borrow",
                  "collateral_only"
                ],
                "type": "string",
                "description": "Position type."
              },
              "credit": {
                "type": "string",
                "description": "Current credit amount.",
                "internalType": "bigint"
              },
              "chain_id": {
                "type": "number",
                "description": "Chain id where the position exists."
              },
              "maturity": {
                "type": "integer",
                "maximum": 9007199254740991,
                "minimum": 0,
                "description": "Maturity timestamp in unix seconds."
              },
              "market_id": {
                "type": "string",
                "description": "Midnight market id."
              },
              "cost_basis": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Cost basis in loan-token units, WAD-scaled, when available.",
                "internalType": "bigint"
              },
              "created_at": {
                "type": "integer",
                "maximum": 9007199254740991,
                "minimum": 0,
                "description": "Timestamp when the user first acquired a position in this market, in unix seconds."
              },
              "loan_token": {
                "type": "string",
                "description": "Loan token address."
              },
              "collaterals": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "token",
                    "amount"
                  ],
                  "properties": {
                    "token": {
                      "type": "string",
                      "description": "Collateral token address."
                    },
                    "amount": {
                      "type": "string",
                      "description": "Collateral amount for this token.",
                      "internalType": "bigint"
                    }
                  }
                },
                "description": "Collateral balances for the position."
              },
              "loss_factor": {
                "type": "string",
                "description": "Market loss factor.",
                "internalType": "bigint"
              },
              "pending_fee": {
                "type": "string",
                "description": "Current pending fee amount.",
                "internalType": "bigint"
              },
              "user_address": {
                "type": "string",
                "description": "User address."
              },
              "effective_apr": {
                "type": [
                  "number",
                  "null"
                ],
                "maximum": 10,
                "description": "Annualized simple effective rate using a 365-day year, as a decimal fraction capped at 10, derived from persisted open lots when available."
              },
              "last_loss_factor": {
                "type": "string",
                "description": "Loss factor last applied to this position.",
                "internalType": "bigint"
              },
              "effective_rate_wad": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Annualized compounded effective rate (IRR+) using a 365.25-day year, WAD-scaled, when available.",
                "internalType": "bigint"
              }
            }
          },
          "description": "Page of returned items."
        },
        "cursor": {
          "type": [
            "string",
            "null"
          ],
          "description": "Opaque cursor for the next page, or null when there is none."
        }
      }
    }
  },
  "required": [
    "cursor",
    "data"
  ],
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "chain_id",
          "market_id",
          "user_address",
          "loan_token",
          "maturity",
          "credit",
          "pending_fee",
          "last_loss_factor",
          "loss_factor",
          "debt",
          "cost_basis",
          "effective_rate_wad",
          "effective_apr",
          "collaterals",
          "created_at",
          "type"
        ],
        "properties": {
          "debt": {
            "type": "string",
            "description": "Current debt amount.",
            "internalType": "bigint"
          },
          "type": {
            "enum": [
              "lend",
              "borrow",
              "collateral_only"
            ],
            "type": "string",
            "description": "Position type."
          },
          "credit": {
            "type": "string",
            "description": "Current credit amount.",
            "internalType": "bigint"
          },
          "chain_id": {
            "type": "number",
            "description": "Chain id where the position exists."
          },
          "maturity": {
            "type": "integer",
            "maximum": 9007199254740991,
            "minimum": 0,
            "description": "Maturity timestamp in unix seconds."
          },
          "market_id": {
            "type": "string",
            "description": "Midnight market id."
          },
          "cost_basis": {
            "type": [
              "string",
              "null"
            ],
            "description": "Cost basis in loan-token units, WAD-scaled, when available.",
            "internalType": "bigint"
          },
          "created_at": {
            "type": "integer",
            "maximum": 9007199254740991,
            "minimum": 0,
            "description": "Timestamp when the user first acquired a position in this market, in unix seconds."
          },
          "loan_token": {
            "type": "string",
            "description": "Loan token address."
          },
          "collaterals": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "token",
                "amount"
              ],
              "properties": {
                "token": {
                  "type": "string",
                  "description": "Collateral token address."
                },
                "amount": {
                  "type": "string",
                  "description": "Collateral amount for this token.",
                  "internalType": "bigint"
                }
              }
            },
            "description": "Collateral balances for the position."
          },
          "loss_factor": {
            "type": "string",
            "description": "Market loss factor.",
            "internalType": "bigint"
          },
          "pending_fee": {
            "type": "string",
            "description": "Current pending fee amount.",
            "internalType": "bigint"
          },
          "user_address": {
            "type": "string",
            "description": "User address."
          },
          "effective_apr": {
            "type": [
              "number",
              "null"
            ],
            "maximum": 10,
            "description": "Annualized simple effective rate using a 365-day year, as a decimal fraction capped at 10, derived from persisted open lots when available."
          },
          "last_loss_factor": {
            "type": "string",
            "description": "Loss factor last applied to this position.",
            "internalType": "bigint"
          },
          "effective_rate_wad": {
            "type": [
              "string",
              "null"
            ],
            "description": "Annualized compounded effective rate (IRR+) using a 365.25-day year, WAD-scaled, when available.",
            "internalType": "bigint"
          }
        }
      },
      "description": "Page of returned items."
    },
    "cursor": {
      "type": [
        "string",
        "null"
      ],
      "description": "Opaque cursor for the next page, or null when there is none."
    }
  },
  "x-fastmcp-top-level-schema": "PositionsResponse"
}
morpho_midnight_list_user_positions annotations
{
  "title": "Midnight List User Positions",
  "readOnlyHint": true,
  "destructiveHint": false
}
morpho_midnight_list_market_positions
Advertised by the server during the last successful anonymous check.
Advertised read-only

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`.

morpho_midnight_list_market_positions input schema
{
  "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."
    }
  }
}
morpho_midnight_list_market_positions output schema
{
  "type": "object",
  "$defs": {
    "PositionsResponse": {
      "type": "object",
      "required": [
        "cursor",
        "data"
      ],
      "properties": {
        "data": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "chain_id",
              "market_id",
              "user_address",
              "loan_token",
              "maturity",
              "credit",
              "pending_fee",
              "last_loss_factor",
              "loss_factor",
              "debt",
              "cost_basis",
              "effective_rate_wad",
              "effective_apr",
              "collaterals",
              "created_at",
              "type"
            ],
            "properties": {
              "debt": {
                "type": "string",
                "description": "Current debt amount.",
                "internalType": "bigint"
              },
              "type": {
                "enum": [
                  "lend",
                  "borrow",
                  "collateral_only"
                ],
                "type": "string",
                "description": "Position type."
              },
              "credit": {
                "type": "string",
                "description": "Current credit amount.",
                "internalType": "bigint"
              },
              "chain_id": {
                "type": "number",
                "description": "Chain id where the position exists."
              },
              "maturity": {
                "type": "integer",
                "maximum": 9007199254740991,
                "minimum": 0,
                "description": "Maturity timestamp in unix seconds."
              },
              "market_id": {
                "type": "string",
                "description": "Midnight market id."
              },
              "cost_basis": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Cost basis in loan-token units, WAD-scaled, when available.",
                "internalType": "bigint"
              },
              "created_at": {
                "type": "integer",
                "maximum": 9007199254740991,
                "minimum": 0,
                "description": "Timestamp when the user first acquired a position in this market, in unix seconds."
              },
              "loan_token": {
                "type": "string",
                "description": "Loan token address."
              },
              "collaterals": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "token",
                    "amount"
                  ],
                  "properties": {
                    "token": {
                      "type": "string",
                      "description": "Collateral token address."
                    },
                    "amount": {
                      "type": "string",
                      "description": "Collateral amount for this token.",
                      "internalType": "bigint"
                    }
                  }
                },
                "description": "Collateral balances for the position."
              },
              "loss_factor": {
                "type": "string",
                "description": "Market loss factor.",
                "internalType": "bigint"
              },
              "pending_fee": {
                "type": "string",
                "description": "Current pending fee amount.",
                "internalType": "bigint"
              },
              "user_address": {
                "type": "string",
                "description": "User address."
              },
              "effective_apr": {
                "type": [
                  "number",
                  "null"
                ],
                "maximum": 10,
                "description": "Annualized simple effective rate using a 365-day year, as a decimal fraction capped at 10, derived from persisted open lots when available."
              },
              "last_loss_factor": {
                "type": "string",
                "description": "Loss factor last applied to this position.",
                "internalType": "bigint"
              },
              "effective_rate_wad": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Annualized compounded effective rate (IRR+) using a 365.25-day year, WAD-scaled, when available.",
                "internalType": "bigint"
              }
            }
          },
          "description": "Page of returned items."
        },
        "cursor": {
          "type": [
            "string",
            "null"
          ],
          "description": "Opaque cursor for the next page, or null when there is none."
        }
      }
    }
  },
  "required": [
    "cursor",
    "data"
  ],
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "chain_id",
          "market_id",
          "user_address",
          "loan_token",
          "maturity",
          "credit",
          "pending_fee",
          "last_loss_factor",
          "loss_factor",
          "debt",
          "cost_basis",
          "effective_rate_wad",
          "effective_apr",
          "collaterals",
          "created_at",
          "type"
        ],
        "properties": {
          "debt": {
            "type": "string",
            "description": "Current debt amount.",
            "internalType": "bigint"
          },
          "type": {
            "enum": [
              "lend",
              "borrow",
              "collateral_only"
            ],
            "type": "string",
            "description": "Position type."
          },
          "credit": {
            "type": "string",
            "description": "Current credit amount.",
            "internalType": "bigint"
          },
          "chain_id": {
            "type": "number",
            "description": "Chain id where the position exists."
          },
          "maturity": {
            "type": "integer",
            "maximum": 9007199254740991,
            "minimum": 0,
            "description": "Maturity timestamp in unix seconds."
          },
          "market_id": {
            "type": "string",
            "description": "Midnight market id."
          },
          "cost_basis": {
            "type": [
              "string",
              "null"
            ],
            "description": "Cost basis in loan-token units, WAD-scaled, when available.",
            "internalType": "bigint"
          },
          "created_at": {
            "type": "integer",
            "maximum": 9007199254740991,
            "minimum": 0,
            "description": "Timestamp when the user first acquired a position in this market, in unix seconds."
          },
          "loan_token": {
            "type": "string",
            "description": "Loan token address."
          },
          "collaterals": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "token",
                "amount"
              ],
              "properties": {
                "token": {
                  "type": "string",
                  "description": "Collateral token address."
                },
                "amount": {
                  "type": "string",
                  "description": "Collateral amount for this token.",
                  "internalType": "bigint"
                }
              }
            },
            "description": "Collateral balances for the position."
          },
          "loss_factor": {
            "type": "string",
            "description": "Market loss factor.",
            "internalType": "bigint"
          },
          "pending_fee": {
            "type": "string",
            "description": "Current pending fee amount.",
            "internalType": "bigint"
          },
          "user_address": {
            "type": "string",
            "description": "User address."
          },
          "effective_apr": {
            "type": [
              "number",
              "null"
            ],
            "maximum": 10,
            "description": "Annualized simple effective rate using a 365-day year, as a decimal fraction capped at 10, derived from persisted open lots when available."
          },
          "last_loss_factor": {
            "type": "string",
            "description": "Loss factor last applied to this position.",
            "internalType": "bigint"
          },
          "effective_rate_wad": {
            "type": [
              "string",
              "null"
            ],
            "description": "Annualized compounded effective rate (IRR+) using a 365.25-day year, WAD-scaled, when available.",
            "internalType": "bigint"
          }
        }
      },
      "description": "Page of returned items."
    },
    "cursor": {
      "type": [
        "string",
        "null"
      ],
      "description": "Opaque cursor for the next page, or null when there is none."
    }
  },
  "x-fastmcp-top-level-schema": "PositionsResponse"
}
morpho_midnight_list_market_positions annotations
{
  "title": "Midnight List Market Positions",
  "readOnlyHint": true,
  "destructiveHint": false
}
morpho_midnight_get_user_position
Advertised by the server during the last successful anonymous check.
Advertised read-only

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"`.

morpho_midnight_get_user_position input schema
{
  "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."
    }
  }
}
morpho_midnight_get_user_position output schema
{
  "type": "object",
  "$defs": {
    "PositionDetailResponse": {
      "type": "object",
      "required": [
        "data"
      ],
      "properties": {
        "data": {
          "type": "object",
          "required": [
            "chain_id",
            "market_id",
            "user_address",
            "loan_token",
            "maturity",
            "credit",
            "pending_fee",
            "last_loss_factor",
            "loss_factor",
            "debt",
            "collaterals",
            "type",
            "last_indexed_block"
          ],
          "properties": {
            "debt": {
              "type": "string",
              "description": "Current debt amount.",
              "internalType": "bigint"
            },
            "type": {
              "enum": [
                "lend",
                "borrow",
                "collateral_only",
                null
              ],
              "type": [
                "string",
                "null"
              ],
              "description": "Position type, or null when the position has zero credit, zero debt, and no remaining collateral."
            },
            "credit": {
              "type": "string",
              "description": "Current credit amount.",
              "internalType": "bigint"
            },
            "chain_id": {
              "type": "number",
              "description": "Chain id where the position exists."
            },
            "maturity": {
              "type": "integer",
              "maximum": 9007199254740991,
              "minimum": 0,
              "description": "Maturity timestamp in unix seconds."
            },
            "market_id": {
              "type": "string",
              "description": "Midnight market id."
            },
            "loan_token": {
              "type": "string",
              "description": "Loan token address."
            },
            "collaterals": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "token",
                  "amount"
                ],
                "properties": {
                  "token": {
                    "type": "string",
                    "description": "Collateral token address."
                  },
                  "amount": {
                    "type": "string",
                    "description": "Collateral amount for this token.",
                    "internalType": "bigint"
                  }
                }
              },
              "description": "Collateral balances for the position."
            },
            "loss_factor": {
              "type": "string",
              "description": "Market loss factor.",
              "internalType": "bigint"
            },
            "pending_fee": {
              "type": "string",
              "description": "Current pending fee amount.",
              "internalType": "bigint"
            },
            "user_address": {
              "type": "string",
              "description": "User address."
            },
            "last_loss_factor": {
              "type": "string",
              "description": "Loss factor last applied to this position.",
              "internalType": "bigint"
            },
            "last_indexed_block": {
              "type": "string",
              "description": "Latest block covered by the API when this position payload was computed.",
              "internalType": "bigint"
            }
          },
          "description": "Position payload. Positions with zero balances are returned with null type."
        }
      }
    }
  },
  "required": [
    "data"
  ],
  "properties": {
    "data": {
      "type": "object",
      "required": [
        "chain_id",
        "market_id",
        "user_address",
        "loan_token",
        "maturity",
        "credit",
        "pending_fee",
        "last_loss_factor",
        "loss_factor",
        "debt",
        "collaterals",
        "type",
        "last_indexed_block"
      ],
      "properties": {
        "debt": {
          "type": "string",
          "description": "Current debt amount.",
          "internalType": "bigint"
        },
        "type": {
          "enum": [
            "lend",
            "borrow",
            "collateral_only",
            null
          ],
          "type": [
            "string",
            "null"
          ],
          "description": "Position type, or null when the position has zero credit, zero debt, and no remaining collateral."
        },
        "credit": {
          "type": "string",
          "description": "Current credit amount.",
          "internalType": "bigint"
        },
        "chain_id": {
          "type": "number",
          "description": "Chain id where the position exists."
        },
        "maturity": {
          "type": "integer",
          "maximum": 9007199254740991,
          "minimum": 0,
          "description": "Maturity timestamp in unix seconds."
        },
        "market_id": {
          "type": "string",
          "description": "Midnight market id."
        },
        "loan_token": {
          "type": "string",
          "description": "Loan token address."
        },
        "collaterals": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "token",
              "amount"
            ],
            "properties": {
              "token": {
                "type": "string",
                "description": "Collateral token address."
              },
              "amount": {
                "type": "string",
                "description": "Collateral amount for this token.",
                "internalType": "bigint"
              }
            }
          },
          "description": "Collateral balances for the position."
        },
        "loss_factor": {
          "type": "string",
          "description": "Market loss factor.",
          "internalType": "bigint"
        },
        "pending_fee": {
          "type": "string",
          "description": "Current pending fee amount.",
          "internalType": "bigint"
        },
        "user_address": {
          "type": "string",
          "description": "User address."
        },
        "last_loss_factor": {
          "type": "string",
          "description": "Loss factor last applied to this position.",
          "internalType": "bigint"
        },
        "last_indexed_block": {
          "type": "string",
          "description": "Latest block covered by the API when this position payload was computed.",
          "internalType": "bigint"
        }
      },
      "description": "Position payload. Positions with zero balances are returned with null type."
    }
  },
  "x-fastmcp-top-level-schema": "PositionDetailResponse"
}
morpho_midnight_get_user_position annotations
{
  "title": "Midnight Get User Position",
  "readOnlyHint": true,
  "destructiveHint": false
}
morpho_midnight_get_user_position_performance
Advertised by the server during the last successful anonymous check.
Advertised read-only

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.

morpho_midnight_get_user_position_performance input schema
{
  "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."
    }
  }
}
morpho_midnight_get_user_position_performance output schema
{
  "type": "object",
  "$defs": {
    "PositionPerformanceResponse": {
      "type": "object",
      "required": [
        "data"
      ],
      "properties": {
        "data": {
          "type": "object",
          "required": [
            "chain_id",
            "market_id",
            "user_address",
            "type",
            "cost_basis",
            "effective_rate_wad",
            "effective_apr",
            "last_indexed_block",
            "accounting_method"
          ],
          "properties": {
            "type": {
              "enum": [
                "lend",
                "borrow",
                "collateral_only",
                null
              ],
              "type": [
                "string",
                "null"
              ],
              "description": "Position type, or null when the position has zero credit, zero debt, and no remaining collateral."
            },
            "chain_id": {
              "type": "number",
              "description": "Chain id where the position exists."
            },
            "market_id": {
              "type": "string",
              "description": "Midnight market id."
            },
            "cost_basis": {
              "type": [
                "string",
                "null"
              ],
              "description": "Cost basis in loan-token units, WAD-scaled, when available.",
              "internalType": "bigint"
            },
            "user_address": {
              "type": "string",
              "description": "User address."
            },
            "effective_apr": {
              "type": [
                "number",
                "null"
              ],
              "maximum": 10,
              "description": "Annualized simple effective rate using a 365-day year, as a decimal fraction capped at 10, derived from persisted open lots when available."
            },
            "accounting_method": {
              "enum": [
                "average_cost"
              ],
              "type": "string",
              "description": "Accounting method used to compute cost basis."
            },
            "effective_rate_wad": {
              "type": [
                "string",
                "null"
              ],
              "description": "Annualized compounded effective rate (IRR+) using a 365.25-day year, WAD-scaled, when available.",
              "internalType": "bigint"
            },
            "last_indexed_block": {
              "type": "string",
              "description": "Latest block covered by the API when this position payload was computed.",
              "internalType": "bigint"
            }
          },
          "description": "Position performance payload. Positions with zero balances are returned with null type and null analytics."
        }
      }
    }
  },
  "required": [
    "data"
  ],
  "properties": {
    "data": {
      "type": "object",
      "required": [
        "chain_id",
        "market_id",
        "user_address",
        "type",
        "cost_basis",
        "effective_rate_wad",
        "effective_apr",
        "last_indexed_block",
        "accounting_method"
      ],
      "properties": {
        "type": {
          "enum": [
            "lend",
            "borrow",
            "collateral_only",
            null
          ],
          "type": [
            "string",
            "null"
          ],
          "description": "Position type, or null when the position has zero credit, zero debt, and no remaining collateral."
        },
        "chain_id": {
          "type": "number",
          "description": "Chain id where the position exists."
        },
        "market_id": {
          "type": "string",
          "description": "Midnight market id."
        },
        "cost_basis": {
          "type": [
            "string",
            "null"
          ],
          "description": "Cost basis in loan-token units, WAD-scaled, when available.",
          "internalType": "bigint"
        },
        "user_address": {
          "type": "string",
          "description": "User address."
        },
        "effective_apr": {
          "type": [
            "number",
            "null"
          ],
          "maximum": 10,
          "description": "Annualized simple effective rate using a 365-day year, as a decimal fraction capped at 10, derived from persisted open lots when available."
        },
        "accounting_method": {
          "enum": [
            "average_cost"
          ],
          "type": "string",
          "description": "Accounting method used to compute cost basis."
        },
        "effective_rate_wad": {
          "type": [
            "string",
            "null"
          ],
          "description": "Annualized compounded effective rate (IRR+) using a 365.25-day year, WAD-scaled, when available.",
          "internalType": "bigint"
        },
        "last_indexed_block": {
          "type": "string",
          "description": "Latest block covered by the API when this position payload was computed.",
          "internalType": "bigint"
        }
      },
      "description": "Position performance payload. Positions with zero balances are returned with null type and null analytics."
    }
  },
  "x-fastmcp-top-level-schema": "PositionPerformanceResponse"
}
morpho_midnight_get_user_position_performance annotations
{
  "title": "Midnight Get User Position Performance",
  "readOnlyHint": true,
  "destructiveHint": false
}
morpho_midnight_get_offer_group
Advertised by the server during the last successful anonymous check.
Advertised read-only

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`.

morpho_midnight_get_offer_group input schema
{
  "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."
    }
  }
}
morpho_midnight_get_offer_group output schema
{
  "type": "object",
  "$defs": {
    "ParsedRatifierDataRateV1": {
      "type": "object",
      "title": "RateV1",
      "required": [
        "ratifier_type",
        "rate_per_second_wad",
        "allowed_taker"
      ],
      "properties": {
        "allowed_taker": {
          "type": "string",
          "description": "Only taker allowed to take the offer. The zero address means any taker may take it."
        },
        "ratifier_type": {
          "enum": [
            "rate_v1"
          ],
          "type": "string"
        },
        "rate_per_second_wad": {
          "type": "string",
          "description": "Per-second simple interest rate encoded in ratifier_data, WAD-scaled (1e18 = 100% per second).",
          "internalType": "bigint"
        }
      },
      "description": "RateRatifierV1 offer."
    },
    "ParsedRatifierDataSetter": {
      "type": "object",
      "title": "Setter",
      "required": [
        "ratifier_type"
      ],
      "properties": {
        "ratifier_type": {
          "enum": [
            "setter"
          ],
          "type": "string"
        }
      },
      "description": "SetterRatifier offer."
    },
    "ParsedRatifierDataInvalid": {
      "type": "object",
      "title": "Invalid",
      "required": [
        "ratifier_type",
        "expected_ratifier_type"
      ],
      "properties": {
        "ratifier_type": {
          "enum": [
            "invalid"
          ],
          "type": "string"
        },
        "expected_ratifier_type": {
          "enum": [
            "rate_v1",
            "price_v1",
            "ecrecover",
            "setter"
          ],
          "type": "string",
          "description": "Ratifier type identified from the ratifier address."
        }
      },
      "description": "Ratifier address is a known deployment, but ratifier_data could not be decoded for its type."
    },
    "ParsedRatifierDataPriceV1": {
      "type": "object",
      "title": "PriceV1",
      "required": [
        "ratifier_type",
        "allowed_taker"
      ],
      "properties": {
        "allowed_taker": {
          "type": "string",
          "description": "Only taker allowed to take the offer. The zero address means any taker may take it."
        },
        "ratifier_type": {
          "enum": [
            "price_v1"
          ],
          "type": "string"
        }
      },
      "description": "PriceRatifierV1 offer. The offer-level tick is the ratified price."
    },
    "ParsedRatifierDataUnknown": {
      "type": "object",
      "title": "Unknown",
      "required": [
        "ratifier_type"
      ],
      "properties": {
        "ratifier_type": {
          "enum": [
            "unknown"
          ],
          "type": "string"
        }
      },
      "description": "Ratifier address is not a known Midnight ratifier deployment."
    },
    "OfferGroupsByGroupResponse": {
      "type": "object",
      "required": [
        "data"
      ],
      "properties": {
        "data": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "id",
              "chain_id",
              "status",
              "type",
              "created_at",
              "expiry",
              "max_units",
              "max_assets",
              "consumed",
              "callback",
              "offers"
            ],
            "properties": {
              "id": {
                "type": "string",
                "description": "Offer group id."
              },
              "type": {
                "enum": [
                  "buy",
                  "sell_reduce_only",
                  "sell",
                  "buy_reduce_only",
                  null
                ],
                "type": [
                  "string",
                  "null"
                ],
                "description": "Shared offer intent across the group's status-targeted offers, or null when their buy and reduce-only values are inconsistent."
              },
              "expiry": {
                "type": "integer",
                "maximum": 9007199254740991,
                "minimum": 0,
                "description": "Maximum offer expiry derived from the group's latest offer set. Active and scheduled groups use the not-yet-ended horizon; terminal statuses use the complete latest set."
              },
              "offers": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "market_id",
                    "market",
                    "created_at",
                    "buy",
                    "maker",
                    "max_units",
                    "max_assets",
                    "continuous_fee_cap",
                    "start",
                    "expiry",
                    "tick",
                    "callback",
                    "callback_data",
                    "receiver_if_maker_is_seller",
                    "ratifier",
                    "ratifier_data",
                    "parsed_ratifier_data",
                    "reduce_only"
                  ],
                  "properties": {
                    "buy": {
                      "type": "boolean",
                      "description": "Whether the offer is a buy offer."
                    },
                    "tick": {
                      "type": "integer",
                      "maximum": 9007199254740991,
                      "minimum": -9007199254740991,
                      "description": "Offer tick."
                    },
                    "maker": {
                      "type": "string",
                      "description": "Offer maker address."
                    },
                    "start": {
                      "type": "integer",
                      "maximum": 9007199254740991,
                      "minimum": 0,
                      "description": "Offer start timestamp."
                    },
                    "expiry": {
                      "type": "integer",
                      "maximum": 9007199254740991,
                      "minimum": 0,
                      "description": "Offer expiry timestamp."
                    },
                    "market": {
                      "type": "object",
                      "required": [
                        "loan_token",
                        "maturity",
                        "rcf_threshold",
                        "enter_gate",
                        "liquidator_gate",
                        "collaterals"
                      ],
                      "properties": {
                        "maturity": {
                          "type": "integer",
                          "maximum": 9007199254740991,
                          "minimum": 0,
                          "description": "Market maturity timestamp in unix seconds."
                        },
                        "enter_gate": {
                          "type": "string",
                          "description": "Enter gate address."
                        },
                        "loan_token": {
                          "type": "string",
                          "description": "Loan token address."
                        },
                        "collaterals": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "required": [
                              "token",
                              "lltv",
                              "liquidation_cursor",
                              "oracle"
                            ],
                            "properties": {
                              "lltv": {
                                "type": "string",
                                "description": "Liquidation loan-to-value for this collateral, WAD-scaled.",
                                "internalType": "bigint"
                              },
                              "token": {
                                "type": "string",
                                "description": "Collateral token address."
                              },
                              "oracle": {
                                "type": "string",
                                "description": "Oracle address used for this collateral."
                              },
                              "liquidation_cursor": {
                                "type": "string",
                                "description": "Liquidation cursor for this collateral, WAD-scaled.",
                                "internalType": "bigint"
                              }
                            }
                          },
                          "description": "Collateral configuration used to derive the market id."
                        },
                        "rcf_threshold": {
                          "type": "string",
                          "description": "Recovery close factor threshold.",
                          "internalType": "bigint"
                        },
                        "liquidator_gate": {
                          "type": "string",
                          "description": "Liquidator gate address."
                        }
                      },
                      "description": "Immutable market configuration used to derive market_id. This is included because market_id is a one-way hash and uncreated markets cannot be decoded from it."
                    },
                    "callback": {
                      "type": "string",
                      "description": "Callback address."
                    },
                    "ratifier": {
                      "type": "string",
                      "description": "Offer ratifier address."
                    },
                    "market_id": {
                      "type": "string",
                      "description": "Midnight market id."
                    },
                    "max_units": {
                      "type": "string",
                      "description": "Maximum units.",
                      "internalType": "bigint"
                    },
                    "created_at": {
                      "type": "integer",
                      "maximum": 9007199254740991,
                      "minimum": 0,
                      "description": "Offer creation block timestamp."
                    },
                    "max_assets": {
                      "type": "string",
                      "description": "Maximum assets.",
                      "internalType": "bigint"
                    },
                    "reduce_only": {
                      "type": "boolean",
                      "description": "Whether the offer is reduce-only."
                    },
                    "callback_data": {
                      "type": "string",
                      "pattern": "^0x[0-9a-fA-F]*$",
                      "description": "Callback data."
                    },
                    "ratifier_data": {
                      "type": "string",
                      "pattern": "^0x[0-9a-fA-F]*$",
                      "description": "Opaque per-offer ratifier data passed unchanged to Midnight take."
                    },
                    "continuous_fee_cap": {
                      "type": "string",
                      "description": "Maximum continuous fee accepted by the maker.",
                      "internalType": "bigint"
                    },
                    "parsed_ratifier_data": {
                      "anyOf": [
                        {
                          "$ref": "#/$defs/ParsedRatifierDataRateV1",
                          "required": [
                            "ratifier_type"
                          ]
                        },
                        {
                          "$ref": "#/$defs/ParsedRatifierDataPriceV1",
                          "required": [
                            "ratifier_type"
                          ]
                        },
                        {
                          "$ref": "#/$defs/ParsedRatifierDataEcrecover",
                          "required": [
                            "ratifier_type"
                          ]
                        },
                        {
                          "$ref": "#/$defs/ParsedRatifierDataSetter",
                          "required": [
                            "ratifier_type"
                          ]
                        },
                        {
                          "$ref": "#/$defs/ParsedRatifierDataUnknown",
                          "required": [
                            "ratifier_type"
                          ]
                        },
                        {
                          "$ref": "#/$defs/ParsedRatifierDataInvalid",
                          "required": [
                            "ratifier_type"
                          ]
                        }
                      ],
                      "description": "Structured metadata decoded from ratifier_data. The ratifier type is identified by matching ratifier against the chain's known Midnight ratifier deployments; ratifier_data remains the authoritative raw bytes."
                    },
                    "receiver_if_maker_is_seller": {
                      "type": "string",
                      "description": "Receiver when the maker is the seller."
                    }
                  }
                },
                "description": "Status-targeted latest offers matching the non-market request filters. Group-id lookup returns every latest offer revision regardless of status."
              },
              "status": {
                "enum": [
                  "scheduled",
                  "active",
                  "filled",
                  "expired",
                  "cancelled"
                ],
                "type": "string",
                "description": "Current lifecycle status derived from every latest offer in the group."
              },
              "callback": {
                "type": [
                  "object",
                  "null"
                ],
                "required": [
                  "type",
                  "callback_address",
                  "market_id",
                  "market_params"
                ],
                "properties": {
                  "type": {
                    "enum": [
                      "blue_buy"
                    ],
                    "type": "string",
                    "description": "Verified callback type."
                  },
                  "market_id": {
                    "type": "string",
                    "description": "Morpho Blue market id."
                  },
                  "market_params": {
                    "type": "object",
                    "required": [
                      "loan_token",
                      "collateral_token",
                      "oracle_address",
                      "irm_address",
                      "lltv_wad"
                    ],
                    "properties": {
                      "lltv_wad": {
                        "type": "string",
                        "description": "Morpho Blue liquidation loan-to-value, WAD-scaled.",
                        "internalType": "bigint"
                      },
                      "loan_token": {
                        "type": "string",
                        "description": "Morpho Blue loan token address."
                      },
                      "irm_address": {
                        "type": "string",
                        "description": "Morpho Blue IRM address."
                      },
                      "oracle_address": {
                        "type": "string",
                        "description": "Morpho Blue oracle address."
                      },
                      "collateral_token": {
                        "type": "string",
                        "description": "Morpho Blue collateral token address."
                      }
                    },
                    "description": "Decoded Morpho Blue market parameters."
                  },
                  "callback_address": {
                    "type": "string",
                    "description": "BlueBuyCallback contract address."
                  }
                },
                "description": "Verified group callback metadata, or null when the latest offer set is empty-callback, malformed, inconsistent, unregistered, registered to another owner, or registered after offer creation."
              },
              "chain_id": {
                "type": "number",
                "description": "Chain id where the group exists."
              },
              "consumed": {
                "type": "string",
                "description": "Latest consumed amount for this group.",
                "internalType": "bigint"
              },
              "max_units": {
                "type": "string",
                "description": "Representative matching offer max units for this group.",
                "internalType": "bigint"
              },
              "created_at": {
                "type": "integer",
                "maximum": 9007199254740991,
                "minimum": 0,
                "description": "Timestamp of the first matching status-targeted offer created in this group."
              },
              "max_assets": {
                "type": "string",
                "description": "Representative matching offer max assets for this group.",
                "internalType": "bigint"
              }
            }
          },
          "description": "Offer groups in any lifecycle state matching the requested onchain group identifier."
        }
      }
    },
    "ParsedRatifierDataEcrecover": {
      "type": "object",
      "title": "Ecrecover",
      "required": [
        "ratifier_type"
      ],
      "properties": {
        "ratifier_type": {
          "enum": [
            "ecrecover"
          ],
          "type": "string"
        }
      },
      "description": "EcrecoverRatifier offer."
    }
  },
  "required": [
    "data"
  ],
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "id",
          "chain_id",
          "status",
          "type",
          "created_at",
          "expiry",
          "max_units",
          "max_assets",
          "consumed",
          "callback",
          "offers"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Offer group id."
          },
          "type": {
            "enum": [
              "buy",
              "sell_reduce_only",
              "sell",
              "buy_reduce_only",
              null
            ],
            "type": [
              "string",
              "null"
            ],
            "description": "Shared offer intent across the group's status-targeted offers, or null when their buy and reduce-only values are inconsistent."
          },
          "expiry": {
            "type": "integer",
            "maximum": 9007199254740991,
            "minimum": 0,
            "description": "Maximum offer expiry derived from the group's latest offer set. Active and scheduled groups use the not-yet-ended horizon; terminal statuses use the complete latest set."
          },
          "offers": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "market_id",
                "market",
                "created_at",
                "buy",
                "maker",
                "max_units",
                "max_assets",
                "continuous_fee_cap",
                "start",
                "expiry",
                "tick",
                "callback",
                "callback_data",
                "receiver_if_maker_is_seller",
                "ratifier",
                "ratifier_data",
                "parsed_ratifier_data",
                "reduce_only"
              ],
              "properties": {
                "buy": {
                  "type": "boolean",
                  "description": "Whether the offer is a buy offer."
                },
                "tick": {
                  "type": "integer",
                  "maximum": 9007199254740991,
                  "minimum": -9007199254740991,
                  "description": "Offer tick."
                },
                "maker": {
                  "type": "string",
                  "description": "Offer maker address."
                },
                "start": {
                  "type": "integer",
                  "maximum": 9007199254740991,
                  "minimum": 0,
                  "description": "Offer start timestamp."
                },
                "expiry": {
                  "type": "integer",
                  "maximum": 9007199254740991,
                  "minimum": 0,
                  "description": "Offer expiry timestamp."
                },
                "market": {
                  "type": "object",
                  "required": [
                    "loan_token",
                    "maturity",
                    "rcf_threshold",
                    "enter_gate",
                    "liquidator_gate",
                    "collaterals"
                  ],
                  "properties": {
                    "maturity": {
                      "type": "integer",
                      "maximum": 9007199254740991,
                      "minimum": 0,
                      "description": "Market maturity timestamp in unix seconds."
                    },
                    "enter_gate": {
                      "type": "string",
                      "description": "Enter gate address."
                    },
                    "loan_token": {
                      "type": "string",
                      "description": "Loan token address."
                    },
                    "collaterals": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "token",
                          "lltv",
                          "liquidation_cursor",
                          "oracle"
                        ],
                        "properties": {
                          "lltv": {
                            "type": "string",
                            "description": "Liquidation loan-to-value for this collateral, WAD-scaled.",
                            "internalType": "bigint"
                          },
                          "token": {
                            "type": "string",
                            "description": "Collateral token address."
                          },
                          "oracle": {
                            "type": "string",
                            "description": "Oracle address used for this collateral."
                          },
                          "liquidation_cursor": {
                            "type": "string",
                            "description": "Liquidation cursor for this collateral, WAD-scaled.",
                            "internalType": "bigint"
                          }
                        }
                      },
                      "description": "Collateral configuration used to derive the market id."
                    },
                    "rcf_threshold": {
                      "type": "string",
                      "description": "Recovery close factor threshold.",
                      "internalType": "bigint"
                    },
                    "liquidator_gate": {
                      "type": "string",
                      "description": "Liquidator gate address."
                    }
                  },
                  "description": "Immutable market configuration used to derive market_id. This is included because market_id is a one-way hash and uncreated markets cannot be decoded from it."
                },
                "callback": {
                  "type": "string",
                  "description": "Callback address."
                },
                "ratifier": {
                  "type": "string",
                  "description": "Offer ratifier address."
                },
                "market_id": {
                  "type": "string",
                  "description": "Midnight market id."
                },
                "max_units": {
                  "type": "string",
                  "description": "Maximum units.",
                  "internalType": "bigint"
                },
                "created_at": {
                  "type": "integer",
                  "maximum": 9007199254740991,
                  "minimum": 0,
                  "description": "Offer creation block timestamp."
                },
                "max_assets": {
                  "type": "string",
                  "description": "Maximum assets.",
                  "internalType": "bigint"
                },
                "reduce_only": {
                  "type": "boolean",
                  "description": "Whether the offer is reduce-only."
                },
                "callback_data": {
                  "type": "string",
                  "pattern": "^0x[0-9a-fA-F]*$",
                  "description": "Callback data."
                },
                "ratifier_data": {
                  "type": "string",
                  "pattern": "^0x[0-9a-fA-F]*$",
                  "description": "Opaque per-offer ratifier data passed unchanged to Midnight take."
                },
                "continuous_fee_cap": {
                  "type": "string",
                  "description": "Maximum continuous fee accepted by the maker.",
                  "internalType": "bigint"
                },
                "parsed_ratifier_data": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/ParsedRatifierDataRateV1",
                      "required": [
                        "ratifier_type"
                      ]
                    },
                    {
                      "$ref": "#/$defs/ParsedRatifierDataPriceV1",
                      "required": [
                        "ratifier_type"
                      ]
                    },
                    {
                      "$ref": "#/$defs/ParsedRatifierDataEcrecover",
                      "required": [
                        "ratifier_type"
                      ]
                    },
                    {
                      "$ref": "#/$defs/ParsedRatifierDataSetter",
                      "required": [
                        "ratifier_type"
                      ]
                    },
                    {
                      "$ref": "#/$defs/ParsedRatifierDataUnknown",
                      "required": [
                        "ratifier_type"
                      ]
                    },
                    {
                      "$ref": "#/$defs/ParsedRatifierDataInvalid",
                      "required": [
                        "ratifier_type"
                      ]
                    }
                  ],
                  "description": "Structured metadata decoded from ratifier_data. The ratifier type is identified by matching ratifier against the chain's known Midnight ratifier deployments; ratifier_data remains the authoritative raw bytes."
                },
                "receiver_if_maker_is_seller": {
                  "type": "string",
                  "description": "Receiver when the maker is the seller."
                }
              }
            },
            "description": "Status-targeted latest offers matching the non-market request filters. Group-id lookup returns every latest offer revision regardless of status."
          },
          "status": {
            "enum": [
              "scheduled",
              "active",
              "filled",
              "expired",
              "cancelled"
            ],
            "type": "string",
            "description": "Current lifecycle status derived from every latest offer in the group."
          },
          "callback": {
            "type": [
              "object",
              "null"
            ],
            "required": [
              "type",
              "callback_address",
              "market_id",
              "market_params"
            ],
            "properties": {
              "type": {
                "enum": [
                  "blue_buy"
                ],
                "type": "string",
                "description": "Verified callback type."
              },
              "market_id": {
                "type": "string",
                "description": "Morpho Blue market id."
              },
              "market_params": {
                "type": "object",
                "required": [
                  "loan_token",
                  "collateral_token",
                  "oracle_address",
                  "irm_address",
                  "lltv_wad"
                ],
                "properties": {
                  "lltv_wad": {
                    "type": "string",
                    "description": "Morpho Blue liquidation loan-to-value, WAD-scaled.",
                    "internalType": "bigint"
                  },
                  "loan_token": {
                    "type": "string",
                    "description": "Morpho Blue loan token address."
                  },
                  "irm_address": {
                    "type": "string",
                    "description": "Morpho Blue IRM address."
                  },
                  "oracle_address": {
                    "type": "string",
                    "description": "Morpho Blue oracle address."
                  },
                  "collateral_token": {
                    "type": "string",
                    "description": "Morpho Blue collateral token address."
                  }
                },
                "description": "Decoded Morpho Blue market parameters."
              },
              "callback_address": {
                "type": "string",
                "description": "BlueBuyCallback contract address."
              }
            },
            "description": "Verified group callback metadata, or null when the latest offer set is empty-callback, malformed, inconsistent, unregistered, registered to another owner, or registered after offer creation."
          },
          "chain_id": {
            "type": "number",
            "description": "Chain id where the group exists."
          },
          "consumed": {
            "type": "string",
            "description": "Latest consumed amount for this group.",
            "internalType": "bigint"
          },
          "max_units": {
            "type": "string",
            "description": "Representative matching offer max units for this group.",
            "internalType": "bigint"
          },
          "created_at": {
            "type": "integer",
            "maximum": 9007199254740991,
            "minimum": 0,
            "description": "Timestamp of the first matching status-targeted offer created in this group."
          },
          "max_assets": {
            "type": "string",
            "description": "Representative matching offer max assets for this group.",
            "internalType": "bigint"
          }
        }
      },
      "description": "Offer groups in any lifecycle state matching the requested onchain group identifier."
    }
  },
  "x-fastmcp-top-level-schema": "OfferGroupsByGroupResponse"
}
morpho_midnight_get_offer_group annotations
{
  "title": "Midnight Get Offer Group",
  "readOnlyHint": true,
  "destructiveHint": false
}
morpho_midnight_list_user_offer_groups
Advertised by the server during the last successful anonymous check.
Advertised read-only

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`.

morpho_midnight_list_user_offer_groups input schema
{
  "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."
    }
  }
}
morpho_midnight_list_user_offer_groups output schema
{
  "type": "object",
  "$defs": {
    "OfferGroupsResponse": {
      "type": "object",
      "required": [
        "cursor",
        "data"
      ],
      "properties": {
        "data": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "id",
              "chain_id",
              "status",
              "type",
              "created_at",
              "expiry",
              "max_units",
              "max_assets",
              "consumed",
              "callback",
              "offers"
            ],
            "properties": {
              "id": {
                "type": "string",
                "description": "Offer group id."
              },
              "type": {
                "enum": [
                  "buy",
                  "sell_reduce_only",
                  "sell",
                  "buy_reduce_only",
                  null
                ],
                "type": [
                  "string",
                  "null"
                ],
                "description": "Shared offer intent across the group's status-targeted offers, or null when their buy and reduce-only values are inconsistent."
              },
              "expiry": {
                "type": "integer",
                "maximum": 9007199254740991,
                "minimum": 0,
                "description": "Maximum offer expiry derived from the group's latest offer set. Active and scheduled groups use the not-yet-ended horizon; terminal statuses use the complete latest set."
              },
              "offers": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "market_id",
                    "market",
                    "created_at",
                    "buy",
                    "maker",
                    "max_units",
                    "max_assets",
                    "continuous_fee_cap",
                    "start",
                    "expiry",
                    "tick",
                    "callback",
                    "callback_data",
                    "receiver_if_maker_is_seller",
                    "ratifier",
                    "ratifier_data",
                    "parsed_ratifier_data",
                    "reduce_only"
                  ],
                  "properties": {
                    "buy": {
                      "type": "boolean",
                      "description": "Whether the offer is a buy offer."
                    },
                    "tick": {
                      "type": "integer",
                      "maximum": 9007199254740991,
                      "minimum": -9007199254740991,
                      "description": "Offer tick."
                    },
                    "maker": {
                      "type": "string",
                      "description": "Offer maker address."
                    },
                    "start": {
                      "type": "integer",
                      "maximum": 9007199254740991,
                      "minimum": 0,
                      "description": "Offer start timestamp."
                    },
                    "expiry": {
                      "type": "integer",
                      "maximum": 9007199254740991,
                      "minimum": 0,
                      "description": "Offer expiry timestamp."
                    },
                    "market": {
                      "type": "object",
                      "required": [
                        "loan_token",
                        "maturity",
                        "rcf_threshold",
                        "enter_gate",
                        "liquidator_gate",
                        "collaterals"
                      ],
                      "properties": {
                        "maturity": {
                          "type": "integer",
                          "maximum": 9007199254740991,
                          "minimum": 0,
                          "description": "Market maturity timestamp in unix seconds."
                        },
                        "enter_gate": {
                          "type": "string",
                          "description": "Enter gate address."
                        },
                        "loan_token": {
                          "type": "string",
                          "description": "Loan token address."
                        },
                        "collaterals": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "required": [
                              "token",
                              "lltv",
                              "liquidation_cursor",
                              "oracle"
                            ],
                            "properties": {
                              "lltv": {
                                "type": "string",
                                "description": "Liquidation loan-to-value for this collateral, WAD-scaled.",
                                "internalType": "bigint"
                              },
                              "token": {
                                "type": "string",
                                "description": "Collateral token address."
                              },
                              "oracle": {
                                "type": "string",
                                "description": "Oracle address used for this collateral."
                              },
                              "liquidation_cursor": {
                                "type": "string",
                                "description": "Liquidation cursor for this collateral, WAD-scaled.",
                                "internalType": "bigint"
                              }
                            }
                          },
                          "description": "Collateral configuration used to derive the market id."
                        },
                        "rcf_threshold": {
                          "type": "string",
                          "description": "Recovery close factor threshold.",
                          "internalType": "bigint"
                        },
                        "liquidator_gate": {
                          "type": "string",
                          "description": "Liquidator gate address."
                        }
                      },
                      "description": "Immutable market configuration used to derive market_id. This is included because market_id is a one-way hash and uncreated markets cannot be decoded from it."
                    },
                    "callback": {
                      "type": "string",
                      "description": "Callback address."
                    },
                    "ratifier": {
                      "type": "string",
                      "description": "Offer ratifier address."
                    },
                    "market_id": {
                      "type": "string",
                      "description": "Midnight market id."
                    },
                    "max_units": {
                      "type": "string",
                      "description": "Maximum units.",
                      "internalType": "bigint"
                    },
                    "created_at": {
                      "type": "integer",
                      "maximum": 9007199254740991,
                      "minimum": 0,
                      "description": "Offer creation block timestamp."
                    },
                    "max_assets": {
                      "type": "string",
                      "description": "Maximum assets.",
                      "internalType": "bigint"
                    },
                    "reduce_only": {
                      "type": "boolean",
                      "description": "Whether the offer is reduce-only."
                    },
                    "callback_data": {
                      "type": "string",
                      "pattern": "^0x[0-9a-fA-F]*$",
                      "description": "Callback data."
                    },
                    "ratifier_data": {
                      "type": "string",
                      "pattern": "^0x[0-9a-fA-F]*$",
                      "description": "Opaque per-offer ratifier data passed unchanged to Midnight take."
                    },
                    "continuous_fee_cap": {
                      "type": "string",
                      "description": "Maximum continuous fee accepted by the maker.",
                      "internalType": "bigint"
                    },
                    "parsed_ratifier_data": {
                      "anyOf": [
                        {
                          "$ref": "#/$defs/ParsedRatifierDataRateV1",
                          "required": [
                            "ratifier_type"
                          ]
                        },
                        {
                          "$ref": "#/$defs/ParsedRatifierDataPriceV1",
                          "required": [
                            "ratifier_type"
                          ]
                        },
                        {
                          "$ref": "#/$defs/ParsedRatifierDataEcrecover",
                          "required": [
                            "ratifier_type"
                          ]
                        },
                        {
                          "$ref": "#/$defs/ParsedRatifierDataSetter",
                          "required": [
                            "ratifier_type"
                          ]
                        },
                        {
                          "$ref": "#/$defs/ParsedRatifierDataUnknown",
                          "required": [
                            "ratifier_type"
                          ]
                        },
                        {
                          "$ref": "#/$defs/ParsedRatifierDataInvalid",
                          "required": [
                            "ratifier_type"
                          ]
                        }
                      ],
                      "description": "Structured metadata decoded from ratifier_data. The ratifier type is identified by matching ratifier against the chain's known Midnight ratifier deployments; ratifier_data remains the authoritative raw bytes."
                    },
                    "receiver_if_maker_is_seller": {
                      "type": "string",
                      "description": "Receiver when the maker is the seller."
                    }
                  }
                },
                "description": "Status-targeted latest offers matching the non-market request filters. Group-id lookup returns every latest offer revision regardless of status."
              },
              "status": {
                "enum": [
                  "scheduled",
                  "active",
                  "filled",
                  "expired",
                  "cancelled"
                ],
                "type": "string",
                "description": "Current lifecycle status derived from every latest offer in the group."
              },
              "callback": {
                "type": [
                  "object",
                  "null"
                ],
                "required": [
                  "type",
                  "callback_address",
                  "market_id",
                  "market_params"
                ],
                "properties": {
                  "type": {
                    "enum": [
                      "blue_buy"
                    ],
                    "type": "string",
                    "description": "Verified callback type."
                  },
                  "market_id": {
                    "type": "string",
                    "description": "Morpho Blue market id."
                  },
                  "market_params": {
                    "type": "object",
                    "required": [
                      "loan_token",
                      "collateral_token",
                      "oracle_address",
                      "irm_address",
                      "lltv_wad"
                    ],
                    "properties": {
                      "lltv_wad": {
                        "type": "string",
                        "description": "Morpho Blue liquidation loan-to-value, WAD-scaled.",
                        "internalType": "bigint"
                      },
                      "loan_token": {
                        "type": "string",
                        "description": "Morpho Blue loan token address."
                      },
                      "irm_address": {
                        "type": "string",
                        "description": "Morpho Blue IRM address."
                      },
                      "oracle_address": {
                        "type": "string",
                        "description": "Morpho Blue oracle address."
                      },
                      "collateral_token": {
                        "type": "string",
                        "description": "Morpho Blue collateral token address."
                      }
                    },
                    "description": "Decoded Morpho Blue market parameters."
                  },
                  "callback_address": {
                    "type": "string",
                    "description": "BlueBuyCallback contract address."
                  }
                },
                "description": "Verified group callback metadata, or null when the latest offer set is empty-callback, malformed, inconsistent, unregistered, registered to another owner, or registered after offer creation."
              },
              "chain_id": {
                "type": "number",
                "description": "Chain id where the group exists."
              },
              "consumed": {
                "type": "string",
                "description": "Latest consumed amount for this group.",
                "internalType": "bigint"
              },
              "max_units": {
                "type": "string",
                "description": "Representative matching offer max units for this group.",
                "internalType": "bigint"
              },
              "created_at": {
                "type": "integer",
                "maximum": 9007199254740991,
                "minimum": 0,
                "description": "Timestamp of the first matching status-targeted offer created in this group."
              },
              "max_assets": {
                "type": "string",
                "description": "Representative matching offer max assets for this group.",
                "internalType": "bigint"
              }
            }
          },
          "description": "Page of returned items."
        },
        "cursor": {
          "type": [
            "string",
            "null"
          ],
          "description": "Opaque cursor for the next page, or null when there is none."
        }
      }
    },
    "ParsedRatifierDataRateV1": {
      "type": "object",
      "title": "RateV1",
      "required": [
        "ratifier_type",
        "rate_per_second_wad",
        "allowed_taker"
      ],
      "properties": {
        "allowed_taker": {
          "type": "string",
          "description": "Only taker allowed to take the offer. The zero address means any taker may take it."
        },
        "ratifier_type": {
          "enum": [
            "rate_v1"
          ],
          "type": "string"
        },
        "rate_per_second_wad": {
          "type": "string",
          "description": "Per-second simple interest rate encoded in ratifier_data, WAD-scaled (1e18 = 100% per second).",
          "internalType": "bigint"
        }
      },
      "description": "RateRatifierV1 offer."
    },
    "ParsedRatifierDataSetter": {
      "type": "object",
      "title": "Setter",
      "required": [
        "ratifier_type"
      ],
      "properties": {
        "ratifier_type": {
          "enum": [
            "setter"
          ],
          "type": "string"
        }
      },
      "description": "SetterRatifier offer."
    },
    "ParsedRatifierDataInvalid": {
      "type": "object",
      "title": "Invalid",
      "required": [
        "ratifier_type",
        "expected_ratifier_type"
      ],
      "properties": {
        "ratifier_type": {
          "enum": [
            "invalid"
          ],
          "type": "string"
        },
        "expected_ratifier_type": {
          "enum": [
            "rate_v1",
            "price_v1",
            "ecrecover",
            "setter"
          ],
          "type": "string",
          "description": "Ratifier type identified from the ratifier address."
        }
      },
      "description": "Ratifier address is a known deployment, but ratifier_data could not be decoded for its type."
    },
    "ParsedRatifierDataPriceV1": {
      "type": "object",
      "title": "PriceV1",
      "required": [
        "ratifier_type",
        "allowed_taker"
      ],
      "properties": {
        "allowed_taker": {
          "type": "string",
          "description": "Only taker allowed to take the offer. The zero address means any taker may take it."
        },
        "ratifier_type": {
          "enum": [
            "price_v1"
          ],
          "type": "string"
        }
      },
      "description": "PriceRatifierV1 offer. The offer-level tick is the ratified price."
    },
    "ParsedRatifierDataUnknown": {
      "type": "object",
      "title": "Unknown",
      "required": [
        "ratifier_type"
      ],
      "properties": {
        "ratifier_type": {
          "enum": [
            "unknown"
          ],
          "type": "string"
        }
      },
      "description": "Ratifier address is not a known Midnight ratifier deployment."
    },
    "ParsedRatifierDataEcrecover": {
      "type": "object",
      "title": "Ecrecover",
      "required": [
        "ratifier_type"
      ],
      "properties": {
        "ratifier_type": {
          "enum": [
            "ecrecover"
          ],
          "type": "string"
        }
      },
      "description": "EcrecoverRatifier offer."
    }
  },
  "required": [
    "cursor",
    "data"
  ],
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "id",
          "chain_id",
          "status",
          "type",
          "created_at",
          "expiry",
          "max_units",
          "max_assets",
          "consumed",
          "callback",
          "offers"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Offer group id."
          },
          "type": {
            "enum": [
              "buy",
              "sell_reduce_only",
              "sell",
              "buy_reduce_only",
              null
            ],
            "type": [
              "string",
              "null"
            ],
            "description": "Shared offer intent across the group's status-targeted offers, or null when their buy and reduce-only values are inconsistent."
          },
          "expiry": {
            "type": "integer",
            "maximum": 9007199254740991,
            "minimum": 0,
            "description": "Maximum offer expiry derived from the group's latest offer set. Active and scheduled groups use the not-yet-ended horizon; terminal statuses use the complete latest set."
          },
          "offers": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "market_id",
                "market",
                "created_at",
                "buy",
                "maker",
                "max_units",
                "max_assets",
                "continuous_fee_cap",
                "start",
                "expiry",
                "tick",
                "callback",
                "callback_data",
                "receiver_if_maker_is_seller",
                "ratifier",
                "ratifier_data",
                "parsed_ratifier_data",
                "reduce_only"
              ],
              "properties": {
                "buy": {
                  "type": "boolean",
                  "description": "Whether the offer is a buy offer."
                },
                "tick": {
                  "type": "integer",
                  "maximum": 9007199254740991,
                  "minimum": -9007199254740991,
                  "description": "Offer tick."
                },
                "maker": {
                  "type": "string",
                  "description": "Offer maker address."
                },
                "start": {
                  "type": "integer",
                  "maximum": 9007199254740991,
                  "minimum": 0,
                  "description": "Offer start timestamp."
                },
                "expiry": {
                  "type": "integer",
                  "maximum": 9007199254740991,
                  "minimum": 0,
                  "description": "Offer expiry timestamp."
                },
                "market": {
                  "type": "object",
                  "required": [
                    "loan_token",
                    "maturity",
                    "rcf_threshold",
                    "enter_gate",
                    "liquidator_gate",
                    "collaterals"
                  ],
                  "properties": {
                    "maturity": {
                      "type": "integer",
                      "maximum": 9007199254740991,
                      "minimum": 0,
                      "description": "Market maturity timestamp in unix seconds."
                    },
                    "enter_gate": {
                      "type": "string",
                      "description": "Enter gate address."
                    },
                    "loan_token": {
                      "type": "string",
                      "description": "Loan token address."
                    },
                    "collaterals": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "token",
                          "lltv",
                          "liquidation_cursor",
                          "oracle"
                        ],
                        "properties": {
                          "lltv": {
                            "type": "string",
                            "description": "Liquidation loan-to-value for this collateral, WAD-scaled.",
                            "internalType": "bigint"
                          },
                          "token": {
                            "type": "string",
                            "description": "Collateral token address."
                          },
                          "oracle": {
                            "type": "string",
                            "description": "Oracle address used for this collateral."
                          },
                          "liquidation_cursor": {
                            "type": "string",
                            "description": "Liquidation cursor for this collateral, WAD-scaled.",
                            "internalType": "bigint"
                          }
                        }
                      },
                      "description": "Collateral configuration used to derive the market id."
                    },
                    "rcf_threshold": {
                      "type": "string",
                      "description": "Recovery close factor threshold.",
                      "internalType": "bigint"
                    },
                    "liquidator_gate": {
                      "type": "string",
                      "description": "Liquidator gate address."
                    }
                  },
                  "description": "Immutable market configuration used to derive market_id. This is included because market_id is a one-way hash and uncreated markets cannot be decoded from it."
                },
                "callback": {
                  "type": "string",
                  "description": "Callback address."
                },
                "ratifier": {
                  "type": "string",
                  "description": "Offer ratifier address."
                },
                "market_id": {
                  "type": "string",
                  "description": "Midnight market id."
                },
                "max_units": {
                  "type": "string",
                  "description": "Maximum units.",
                  "internalType": "bigint"
                },
                "created_at": {
                  "type": "integer",
                  "maximum": 9007199254740991,
                  "minimum": 0,
                  "description": "Offer creation block timestamp."
                },
                "max_assets": {
                  "type": "string",
                  "description": "Maximum assets.",
                  "internalType": "bigint"
                },
                "reduce_only": {
                  "type": "boolean",
                  "description": "Whether the offer is reduce-only."
                },
                "callback_data": {
                  "type": "string",
                  "pattern": "^0x[0-9a-fA-F]*$",
                  "description": "Callback data."
                },
                "ratifier_data": {
                  "type": "string",
                  "pattern": "^0x[0-9a-fA-F]*$",
                  "description": "Opaque per-offer ratifier data passed unchanged to Midnight take."
                },
                "continuous_fee_cap": {
                  "type": "string",
                  "description": "Maximum continuous fee accepted by the maker.",
                  "internalType": "bigint"
                },
                "parsed_ratifier_data": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/ParsedRatifierDataRateV1",
                      "required": [
                        "ratifier_type"
                      ]
                    },
                    {
                      "$ref": "#/$defs/ParsedRatifierDataPriceV1",
                      "required": [
                        "ratifier_type"
                      ]
                    },
                    {
                      "$ref": "#/$defs/ParsedRatifierDataEcrecover",
                      "required": [
                        "ratifier_type"
                      ]
                    },
                    {
                      "$ref": "#/$defs/ParsedRatifierDataSetter",
                      "required": [
                        "ratifier_type"
                      ]
                    },
                    {
                      "$ref": "#/$defs/ParsedRatifierDataUnknown",
                      "required": [
                        "ratifier_type"
                      ]
                    },
                    {
                      "$ref": "#/$defs/ParsedRatifierDataInvalid",
                      "required": [
                        "ratifier_type"
                      ]
                    }
                  ],
                  "description": "Structured metadata decoded from ratifier_data. The ratifier type is identified by matching ratifier against the chain's known Midnight ratifier deployments; ratifier_data remains the authoritative raw bytes."
                },
                "receiver_if_maker_is_seller": {
                  "type": "string",
                  "description": "Receiver when the maker is the seller."
                }
              }
            },
            "description": "Status-targeted latest offers matching the non-market request filters. Group-id lookup returns every latest offer revision regardless of status."
          },
          "status": {
            "enum": [
              "scheduled",
              "active",
              "filled",
              "expired",
              "cancelled"
            ],
            "type": "string",
            "description": "Current lifecycle status derived from every latest offer in the group."
          },
          "callback": {
            "type": [
              "object",
              "null"
            ],
            "required": [
              "type",
              "callback_address",
              "market_id",
              "market_params"
            ],
            "properties": {
              "type": {
                "enum": [
                  "blue_buy"
                ],
                "type": "string",
                "description": "Verified callback type."
              },
              "market_id": {
                "type": "string",
                "description": "Morpho Blue market id."
              },
              "market_params": {
                "type": "object",
                "required": [
                  "loan_token",
                  "collateral_token",
                  "oracle_address",
                  "irm_address",
                  "lltv_wad"
                ],
                "properties": {
                  "lltv_wad": {
                    "type": "string",
                    "description": "Morpho Blue liquidation loan-to-value, WAD-scaled.",
                    "internalType": "bigint"
                  },
                  "loan_token": {
                    "type": "string",
                    "description": "Morpho Blue loan token address."
                  },
                  "irm_address": {
                    "type": "string",
                    "description": "Morpho Blue IRM address."
                  },
                  "oracle_address": {
                    "type": "string",
                    "description": "Morpho Blue oracle address."
                  },
                  "collateral_token": {
                    "type": "string",
                    "description": "Morpho Blue collateral token address."
                  }
                },
                "description": "Decoded Morpho Blue market parameters."
              },
              "callback_address": {
                "type": "string",
                "description": "BlueBuyCallback contract address."
              }
            },
            "description": "Verified group callback metadata, or null when the latest offer set is empty-callback, malformed, inconsistent, unregistered, registered to another owner, or registered after offer creation."
          },
          "chain_id": {
            "type": "number",
            "description": "Chain id where the group exists."
          },
          "consumed": {
            "type": "string",
            "description": "Latest consumed amount for this group.",
            "internalType": "bigint"
          },
          "max_units": {
            "type": "string",
            "description": "Representative matching offer max units for this group.",
            "internalType": "bigint"
          },
          "created_at": {
            "type": "integer",
            "maximum": 9007199254740991,
            "minimum": 0,
            "description": "Timestamp of the first matching status-targeted offer created in this group."
          },
          "max_assets": {
            "type": "string",
            "description": "Representative matching offer max assets for this group.",
            "internalType": "bigint"
          }
        }
      },
      "description": "Page of returned items."
    },
    "cursor": {
      "type": [
        "string",
        "null"
      ],
      "description": "Opaque cursor for the next page, or null when there is none."
    }
  },
  "x-fastmcp-top-level-schema": "OfferGroupsResponse"
}
morpho_midnight_list_user_offer_groups annotations
{
  "title": "Midnight List User Offer Groups",
  "readOnlyHint": true,
  "destructiveHint": false
}
morpho_midnight_list_books
Advertised by the server during the last successful anonymous check.
Advertised read-only

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.

morpho_midnight_list_books input schema
{
  "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."
    }
  }
}
morpho_midnight_list_books output schema
{
  "type": "object",
  "$defs": {
    "PriceLevel": {
      "type": "object",
      "required": [
        "tick",
        "price",
        "units",
        "assets",
        "count"
      ],
      "properties": {
        "tick": {
          "type": "number",
          "example": 495,
          "maximum": 6744,
          "minimum": 0
        },
        "count": {
          "type": "number",
          "example": 5
        },
        "price": {
          "type": "string",
          "example": "500000000000000000",
          "description": "Price at this tick (scaled by 1e18)."
        },
        "units": {
          "type": "string",
          "example": "369216000000000000000000",
          "description": "Total executable units at this tick."
        },
        "assets": {
          "type": "string",
          "example": "184608000000000000000000",
          "description": "Total maker-side assets at this tick, using onchain rounding per offer (buy books floor, sell books ceil)."
        }
      }
    },
    "BookMarketResponse": {
      "type": "object",
      "required": [
        "market_id",
        "chain_id",
        "midnight",
        "loan_token",
        "collaterals",
        "maturity",
        "rcf_threshold",
        "enter_gate",
        "liquidator_gate",
        "asks",
        "bids"
      ],
      "properties": {
        "asks": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/PriceLevel"
          },
          "description": "Ask levels, sorted best first. List responses include up to the top 3 asks."
        },
        "bids": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/PriceLevel"
          },
          "description": "Bid levels, sorted best first. List responses include up to the top 3 bids."
        },
        "chain_id": {
          "type": "number",
          "example": 1
        },
        "maturity": {
          "type": "number",
          "example": 1761922800
        },
        "midnight": {
          "type": "string",
          "example": "0x2F7a3AA739ba5792Ce1b4eA046117f2C0095BCA6",
          "description": "Address of the Midnight contract that owns the market."
        },
        "market_id": {
          "type": "string",
          "example": "0x12590ae1aee324a005be565f3bcdd16dbf8daf7969b26c181c8b8f467dad9f67",
          "description": "Market id (32-byte hex) this book belongs to."
        },
        "enter_gate": {
          "type": "string",
          "example": "0x0000000000000000000000000000000000000000"
        },
        "loan_token": {
          "type": "string",
          "example": "0xC9A9C45C0eB717f8b5F193Af6bAa05A1c0Ac5078"
        },
        "collaterals": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/CollateralResponse"
          }
        },
        "rcf_threshold": {
          "type": "string",
          "example": "0"
        },
        "liquidator_gate": {
          "type": "string",
          "example": "0x0000000000000000000000000000000000000000"
        }
      }
    },
    "CollateralResponse": {
      "type": "object",
      "required": [
        "token",
        "lltv",
        "liquidation_cursor",
        "oracle"
      ],
      "properties": {
        "lltv": {
          "type": "string",
          "example": "860000000000000000",
          "description": "Liquidation loan-to-value for this collateral, scaled by 1e18."
        },
        "token": {
          "type": "string",
          "example": "0x34Cf890dB685FC536E05652FB41f02090c3fb751",
          "description": "Collateral token address."
        },
        "oracle": {
          "type": "string",
          "example": "0x45093658BE7f90B63D7c359e8f408e503c2D9401",
          "description": "Oracle address used to price this collateral."
        },
        "liquidation_cursor": {
          "type": "string",
          "example": "300000000000000000",
          "description": "Liquidation cursor for this collateral, scaled by 1e18. The protocol derives the maximum liquidation incentive factor from it."
        }
      }
    },
    "BookCursorListResponse": {
      "type": "object",
      "required": [
        "cursor",
        "data"
      ],
      "properties": {
        "data": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/BookMarketResponse"
          },
          "description": "Books with market metadata and the top 3 ask/bid levels."
        },
        "cursor": {
          "type": [
            "string",
            "null"
          ],
          "example": "eyJzb3J0IjpbImlkIl0sImlkIjoiMHgxMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExIiwiYXNrIjoiMCIsImJpZCI6IjAiLCJtYXR1cml0eSI6MTc2MTkyMjgwMH0",
          "description": "Opaque pagination cursor."
        }
      }
    }
  },
  "required": [
    "cursor",
    "data"
  ],
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/BookMarketResponse"
      },
      "description": "Books with market metadata and the top 3 ask/bid levels."
    },
    "cursor": {
      "type": [
        "string",
        "null"
      ],
      "example": "eyJzb3J0IjpbImlkIl0sImlkIjoiMHgxMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExIiwiYXNrIjoiMCIsImJpZCI6IjAiLCJtYXR1cml0eSI6MTc2MTkyMjgwMH0",
      "description": "Opaque pagination cursor."
    }
  },
  "x-fastmcp-top-level-schema": "BookCursorListResponse"
}
morpho_midnight_list_books annotations
{
  "title": "Midnight List Books",
  "readOnlyHint": true,
  "destructiveHint": false
}
morpho_midnight_get_book
Advertised by the server during the last successful anonymous check.
Advertised read-only

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.

morpho_midnight_get_book input schema
{
  "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)."
    }
  }
}
morpho_midnight_get_book output schema
{
  "type": "object",
  "$defs": {
    "PriceLevel": {
      "type": "object",
      "required": [
        "tick",
        "price",
        "units",
        "assets",
        "count"
      ],
      "properties": {
        "tick": {
          "type": "number",
          "example": 495,
          "maximum": 6744,
          "minimum": 0
        },
        "count": {
          "type": "number",
          "example": 5
        },
        "price": {
          "type": "string",
          "example": "500000000000000000",
          "description": "Price at this tick (scaled by 1e18)."
        },
        "units": {
          "type": "string",
          "example": "369216000000000000000000",
          "description": "Total executable units at this tick."
        },
        "assets": {
          "type": "string",
          "example": "184608000000000000000000",
          "description": "Total maker-side assets at this tick, using onchain rounding per offer (buy books floor, sell books ceil)."
        }
      }
    },
    "BookDataResponse": {
      "type": "object",
      "required": [
        "data"
      ],
      "properties": {
        "data": {
          "$ref": "#/$defs/BookMarketResponse",
          "description": "Book snapshot with market metadata and both sides."
        }
      }
    },
    "BookMarketResponse": {
      "type": "object",
      "required": [
        "market_id",
        "chain_id",
        "midnight",
        "loan_token",
        "collaterals",
        "maturity",
        "rcf_threshold",
        "enter_gate",
        "liquidator_gate",
        "asks",
        "bids"
      ],
      "properties": {
        "asks": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/PriceLevel"
          },
          "description": "Ask levels, sorted best first. List responses include up to the top 3 asks."
        },
        "bids": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/PriceLevel"
          },
          "description": "Bid levels, sorted best first. List responses include up to the top 3 bids."
        },
        "chain_id": {
          "type": "number",
          "example": 1
        },
        "maturity": {
          "type": "number",
          "example": 1761922800
        },
        "midnight": {
          "type": "string",
          "example": "0x2F7a3AA739ba5792Ce1b4eA046117f2C0095BCA6",
          "description": "Address of the Midnight contract that owns the market."
        },
        "market_id": {
          "type": "string",
          "example": "0x12590ae1aee324a005be565f3bcdd16dbf8daf7969b26c181c8b8f467dad9f67",
          "description": "Market id (32-byte hex) this book belongs to."
        },
        "enter_gate": {
          "type": "string",
          "example": "0x0000000000000000000000000000000000000000"
        },
        "loan_token": {
          "type": "string",
          "example": "0xC9A9C45C0eB717f8b5F193Af6bAa05A1c0Ac5078"
        },
        "collaterals": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/CollateralResponse"
          }
        },
        "rcf_threshold": {
          "type": "string",
          "example": "0"
        },
        "liquidator_gate": {
          "type": "string",
          "example": "0x0000000000000000000000000000000000000000"
        }
      }
    },
    "CollateralResponse": {
      "type": "object",
      "required": [
        "token",
        "lltv",
        "liquidation_cursor",
        "oracle"
      ],
      "properties": {
        "lltv": {
          "type": "string",
          "example": "860000000000000000",
          "description": "Liquidation loan-to-value for this collateral, scaled by 1e18."
        },
        "token": {
          "type": "string",
          "example": "0x34Cf890dB685FC536E05652FB41f02090c3fb751",
          "description": "Collateral token address."
        },
        "oracle": {
          "type": "string",
          "example": "0x45093658BE7f90B63D7c359e8f408e503c2D9401",
          "description": "Oracle address used to price this collateral."
        },
        "liquidation_cursor": {
          "type": "string",
          "example": "300000000000000000",
          "description": "Liquidation cursor for this collateral, scaled by 1e18. The protocol derives the maximum liquidation incentive factor from it."
        }
      }
    }
  },
  "required": [
    "data"
  ],
  "properties": {
    "data": {
      "$ref": "#/$defs/BookMarketResponse",
      "description": "Book snapshot with market metadata and both sides."
    }
  },
  "x-fastmcp-top-level-schema": "BookDataResponse"
}
morpho_midnight_get_book annotations
{
  "title": "Midnight Get Book",
  "readOnlyHint": true,
  "destructiveHint": false
}
morpho_midnight_get_book_side
Advertised by the server during the last successful anonymous check.
Advertised read-only

Returns one side of a book as price levels grouped by tick with total units, assets, and price, sorted best price first.

morpho_midnight_get_book_side input schema
{
  "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)."
    }
  }
}
morpho_midnight_get_book_side output schema
{
  "type": "object",
  "$defs": {
    "PriceLevel": {
      "type": "object",
      "required": [
        "tick",
        "price",
        "units",
        "assets",
        "count"
      ],
      "properties": {
        "tick": {
          "type": "number",
          "example": 495,
          "maximum": 6744,
          "minimum": 0
        },
        "count": {
          "type": "number",
          "example": 5
        },
        "price": {
          "type": "string",
          "example": "500000000000000000",
          "description": "Price at this tick (scaled by 1e18)."
        },
        "units": {
          "type": "string",
          "example": "369216000000000000000000",
          "description": "Total executable units at this tick."
        },
        "assets": {
          "type": "string",
          "example": "184608000000000000000000",
          "description": "Total maker-side assets at this tick, using onchain rounding per offer (buy books floor, sell books ceil)."
        }
      }
    },
    "ListBookPriceLevelResponse": {
      "type": "object",
      "required": [
        "data"
      ],
      "properties": {
        "data": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/PriceLevel"
          },
          "description": "Book price levels grouped by tick, sorted best first."
        }
      }
    }
  },
  "required": [
    "data"
  ],
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/PriceLevel"
      },
      "description": "Book price levels grouped by tick, sorted best first."
    }
  },
  "x-fastmcp-top-level-schema": "ListBookPriceLevelResponse"
}
morpho_midnight_get_book_side annotations
{
  "title": "Midnight Get Book Side",
  "readOnlyHint": true,
  "destructiveHint": false
}
morpho_midnight_get_book_side_takeable_offers
Advertised by the server during the last successful anonymous check.
Advertised read-only

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.

morpho_midnight_get_book_side_takeable_offers input schema
{
  "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)."
    }
  }
}
morpho_midnight_get_book_side_takeable_offers output schema
{
  "type": "object",
  "$defs": {
    "OfferDataResponse": {
      "type": "object",
      "required": [
        "market",
        "buy",
        "maker",
        "max_units",
        "start",
        "expiry",
        "tick",
        "group",
        "callback",
        "callback_data",
        "receiver_if_maker_is_seller",
        "ratifier",
        "reduce_only",
        "max_assets",
        "continuous_fee_cap"
      ],
      "properties": {
        "buy": {
          "type": "boolean",
          "example": false
        },
        "tick": {
          "type": "number",
          "example": 495,
          "maximum": 6744,
          "minimum": 0
        },
        "group": {
          "type": "string",
          "example": "0x000000000000000000000000000000000000000000000000000000000008b8f4"
        },
        "maker": {
          "type": "string",
          "example": "0x7b093658BE7f90B63D7c359e8f408e503c2D9401"
        },
        "start": {
          "type": "number",
          "example": 1761922790
        },
        "expiry": {
          "type": "number",
          "example": 1761922799
        },
        "market": {
          "$ref": "#/$defs/MarketOfferResponse",
          "example": {
            "chain_id": 8453,
            "maturity": 1761922799,
            "midnight": "0x2F7a3AA739ba5792Ce1b4eA046117f2C0095BCA6",
            "enter_gate": "0x0000000000000000000000000000000000000000",
            "loan_token": "0xC9A9C45C0eB717f8b5F193Af6bAa05A1c0Ac5078",
            "collaterals": [
              {
                "lltv": "860000000000000000",
                "token": "0x34Cf890dB685FC536E05652FB41f02090c3fb751",
                "oracle": "0x45093658BE7f90B63D7c359e8f408e503c2D9401",
                "liquidation_cursor": "300000000000000000"
              }
            ],
            "rcf_threshold": "0",
            "liquidator_gate": "0x0000000000000000000000000000000000000000"
          }
        },
        "callback": {
          "type": "string",
          "example": "0x0000000000000000000000000000000000000000",
          "description": "Settlement callback address. Use the zero address for empty callbacks. A Blue-backed buy uses a BlueBuyCallback registered to the maker by the chain's factory at or before the offer's creation block; a maker-chosen salt allows multiple callbacks."
        },
        "ratifier": {
          "type": "string",
          "example": "0x0000000000000000000000000000000000000002"
        },
        "max_units": {
          "type": "string",
          "example": "369216000000000000000000"
        },
        "max_assets": {
          "type": "string",
          "example": "0"
        },
        "reduce_only": {
          "type": "boolean",
          "example": false
        },
        "callback_data": {
          "type": "string",
          "example": "0x",
          "description": "Settlement callback data. Use `0x` for empty callbacks. A Blue-backed buy uses the exact 160-byte ABI encoding of Morpho Blue `MarketParams` (`loanToken`, `collateralToken`, `oracle`, `irm`, `lltv`); `loanToken` must match the offer market."
        },
        "continuous_fee_cap": {
          "type": "string",
          "example": "115792089237316195423570985008687907853269984665640564039457584007913129639935",
          "description": "Maximum market continuous fee the maker accepts; the offer is not takeable while the market continuous fee exceeds it. Decimal uint256 string."
        },
        "receiver_if_maker_is_seller": {
          "type": "string",
          "example": "0x7b093658BE7f90B63D7c359e8f408e503c2D9401"
        }
      }
    },
    "CollateralResponse": {
      "type": "object",
      "required": [
        "token",
        "lltv",
        "liquidation_cursor",
        "oracle"
      ],
      "properties": {
        "lltv": {
          "type": "string",
          "example": "860000000000000000",
          "description": "Liquidation loan-to-value for this collateral, scaled by 1e18."
        },
        "token": {
          "type": "string",
          "example": "0x34Cf890dB685FC536E05652FB41f02090c3fb751",
          "description": "Collateral token address."
        },
        "oracle": {
          "type": "string",
          "example": "0x45093658BE7f90B63D7c359e8f408e503c2D9401",
          "description": "Oracle address used to price this collateral."
        },
        "liquidation_cursor": {
          "type": "string",
          "example": "300000000000000000",
          "description": "Liquidation cursor for this collateral, scaled by 1e18. The protocol derives the maximum liquidation incentive factor from it."
        }
      }
    },
    "MarketOfferResponse": {
      "type": "object",
      "required": [
        "chain_id",
        "midnight",
        "loan_token",
        "collaterals",
        "maturity",
        "rcf_threshold",
        "enter_gate",
        "liquidator_gate"
      ],
      "properties": {
        "chain_id": {
          "type": "number",
          "example": 8453,
          "description": "EVM chain id the market lives on."
        },
        "maturity": {
          "type": "number",
          "example": 1761922799
        },
        "midnight": {
          "type": "string",
          "example": "0x2F7a3AA739ba5792Ce1b4eA046117f2C0095BCA6",
          "description": "Address of the Midnight contract that owns the market."
        },
        "enter_gate": {
          "type": "string",
          "example": "0x0000000000000000000000000000000000000000"
        },
        "loan_token": {
          "type": "string",
          "example": "0xC9A9C45C0eB717f8b5F193Af6bAa05A1c0Ac5078"
        },
        "collaterals": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/CollateralResponse"
          },
          "example": [
            {
              "lltv": "860000000000000000",
              "token": "0x34Cf890dB685FC536E05652FB41f02090c3fb751",
              "oracle": "0x45093658BE7f90B63D7c359e8f408e503c2D9401",
              "liquidation_cursor": "300000000000000000"
            }
          ]
        },
        "rcf_threshold": {
          "type": "string",
          "example": "0"
        },
        "liquidator_gate": {
          "type": "string",
          "example": "0x0000000000000000000000000000000000000000"
        }
      }
    },
    "BookTakeableOfferResponse": {
      "type": "object",
      "required": [
        "units",
        "offer",
        "ratifier_data",
        "valid_until",
        "market_id",
        "warning"
      ],
      "properties": {
        "offer": {
          "$ref": "#/$defs/OfferDataResponse",
          "example": {
            "buy": false,
            "tick": 495,
            "group": "0x000000000000000000000000000000000000000000000000000000000008b8f4",
            "maker": "0x7b093658BE7f90B63D7c359e8f408e503c2D9401",
            "start": 1761922790,
            "expiry": 1761922799,
            "market": {
              "chain_id": 8453,
              "maturity": 1761922799,
              "midnight": "0x2F7a3AA739ba5792Ce1b4eA046117f2C0095BCA6",
              "enter_gate": "0x0000000000000000000000000000000000000000",
              "loan_token": "0xC9A9C45C0eB717f8b5F193Af6bAa05A1c0Ac5078",
              "collaterals": [
                {
                  "lltv": "860000000000000000",
                  "token": "0x34Cf890dB685FC536E05652FB41f02090c3fb751",
                  "oracle": "0x45093658BE7f90B63D7c359e8f408e503c2D9401",
                  "liquidation_cursor": "300000000000000000"
                }
              ],
              "rcf_threshold": "0",
              "liquidator_gate": "0x0000000000000000000000000000000000000000"
            },
            "callback": "0x0000000000000000000000000000000000000000",
            "ratifier": "0x0000000000000000000000000000000000000002",
            "max_units": "369216000000000000000000",
            "max_assets": "0",
            "reduce_only": false,
            "callback_data": "0x",
            "continuous_fee_cap": "115792089237316195423570985008687907853269984665640564039457584007913129639935",
            "receiver_if_maker_is_seller": "0x7b093658BE7f90B63D7c359e8f408e503c2D9401"
          }
        },
        "units": {
          "type": "string",
          "example": "369216000000000000000000",
          "description": "Executable or currently reserved offer size in units."
        },
        "warning": {
          "anyOf": [
            {
              "$ref": "#/$defs/TakeabilityWarningResponse"
            },
            {
              "enum": [
                null
              ]
            }
          ],
          "example": null,
          "description": "Deprecated: still returned for now, but will become null in a future release and then be removed. Do not rely on it; `units` already is the amount you can take. Quote responses preserve this pre-quote book measurement after clipping. Makers can still see why their offers are limited on `GET /v0/midnight/takeable-offers`."
        },
        "market_id": {
          "type": "string",
          "example": "0x25690ae1aee324a005be565f3bcdd16dbf8daf7969b26c181c8b8f467dad9f67",
          "description": "Market id (32-byte hex) the offer belongs to."
        },
        "valid_until": {
          "type": "integer",
          "example": 1761922799,
          "minimum": 0,
          "description": "Inclusive Unix-second bound until which `offer` and `ratifier_data` stay executable as published; never exceeds `offer.expiry`. Refetch after it passes."
        },
        "ratifier_data": {
          "type": "string",
          "example": "0x000000000000000000000000000000000000000000000000000000000000001b12121212121212121212121212121212121212121212121212121212121212123434343434343434343434343434343434343434343434343434343434343434",
          "description": "Mandatory data generated by the maker to verify the offer onchain."
        }
      }
    },
    "TakeabilityWarningResponse": {
      "anyOf": [
        {
          "type": "object",
          "required": [
            "code"
          ],
          "properties": {
            "code": {
              "enum": [
                "MAKER_LIQUIDITY"
              ],
              "type": "string",
              "example": "MAKER_LIQUIDITY"
            }
          },
          "description": "Maker-controlled funds cannot back more units.",
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "code"
          ],
          "properties": {
            "code": {
              "enum": [
                "MAKER_ALLOWANCE"
              ],
              "type": "string",
              "example": "MAKER_ALLOWANCE"
            }
          },
          "description": "The maker's loan-token approval cannot back more units.",
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "code"
          ],
          "properties": {
            "code": {
              "enum": [
                "SOURCE_LIQUIDITY"
              ],
              "type": "string",
              "example": "SOURCE_LIQUIDITY"
            }
          },
          "description": "The underlying protocol cannot currently release more liquidity.",
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "code"
          ],
          "properties": {
            "code": {
              "enum": [
                "REDUCE_ONLY"
              ],
              "type": "string",
              "example": "REDUCE_ONLY"
            }
          },
          "description": "More units would increase rather than reduce the maker's position.",
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "code"
          ],
          "properties": {
            "code": {
              "enum": [
                "POSITION_CAPACITY"
              ],
              "type": "string",
              "example": "POSITION_CAPACITY"
            }
          },
          "description": "The maker's credit or debt position has no room for more units.",
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "code"
          ],
          "properties": {
            "code": {
              "enum": [
                "AMOUNT_ROUNDING"
              ],
              "type": "string",
              "example": "AMOUNT_ROUNDING"
            }
          },
          "description": "Asset and unit rounding prevents another meaningful unit from executing.",
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "code"
          ],
          "properties": {
            "code": {
              "enum": [
                "CALLBACK_NOT_REGISTERED"
              ],
              "type": "string",
              "example": "CALLBACK_NOT_REGISTERED"
            }
          },
          "description": "The callback was not registered to the maker at or before the offer's creation block.",
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "code"
          ],
          "properties": {
            "code": {
              "enum": [
                "RATIFIER_NOT_AUTHORIZED"
              ],
              "type": "string",
              "example": "RATIFIER_NOT_AUTHORIZED"
            }
          },
          "description": "The maker does not currently authorize the offer's ratifier.",
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "code"
          ],
          "properties": {
            "code": {
              "enum": [
                "SIMULATION_FAILED"
              ],
              "type": "string",
              "example": "SIMULATION_FAILED"
            }
          },
          "description": "Router simulation failed for the offer's group and market.",
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "code"
          ],
          "properties": {
            "code": {
              "enum": [
                "RESTRICTED_TAKER"
              ],
              "type": "string",
              "example": "RESTRICTED_TAKER"
            }
          },
          "description": "The offer is reserved for a specific taker and cannot be taken publicly.",
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "code",
            "limit_units"
          ],
          "properties": {
            "code": {
              "enum": [
                "SINGLE_TAKE_LIMIT"
              ],
              "type": "string",
              "example": "SINGLE_TAKE_LIMIT"
            },
            "limit_units": {
              "type": "string",
              "pattern": "^\\d+$",
              "description": "Maximum units allowed in one take."
            }
          },
          "description": "The offer exceeds the maximum units allowed in one take.",
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "code",
            "root"
          ],
          "properties": {
            "code": {
              "enum": [
                "ROOT_CANCELED"
              ],
              "type": "string",
              "example": "ROOT_CANCELED"
            },
            "root": {
              "type": "string",
              "pattern": "^0x[0-9a-fA-F]{64}$",
              "description": "Canceled Ecrecover Merkle root."
            }
          },
          "description": "The offer's Ecrecover Merkle root was permanently canceled.",
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "code",
            "root"
          ],
          "properties": {
            "code": {
              "enum": [
                "ROOT_NOT_RATIFIED"
              ],
              "type": "string",
              "example": "ROOT_NOT_RATIFIED"
            },
            "root": {
              "type": "string",
              "pattern": "^0x[0-9a-fA-F]{64}$",
              "description": "Setter Merkle root the maker has not currently ratified."
            }
          },
          "description": "The maker has not currently ratified the offer's Setter Merkle root.",
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "code",
            "signer"
          ],
          "properties": {
            "code": {
              "enum": [
                "SIGNER_NOT_AUTHORIZED"
              ],
              "type": "string",
              "example": "SIGNER_NOT_AUTHORIZED"
            },
            "signer": {
              "type": "string",
              "pattern": "^0x[0-9a-fA-F]{40}$",
              "description": "Tree signer the maker has not authorized."
            }
          },
          "description": "The maker does not currently authorize the offer tree's signer.",
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "code",
            "observed_assets",
            "minimum_assets"
          ],
          "properties": {
            "code": {
              "enum": [
                "BELOW_MINIMUM_SIZE"
              ],
              "type": "string",
              "example": "BELOW_MINIMUM_SIZE"
            },
            "minimum_assets": {
              "type": "string",
              "pattern": "^\\d+$",
              "description": "Required minimum assets."
            },
            "observed_assets": {
              "type": "string",
              "pattern": "^\\d+$",
              "description": "Assets measured when the offer was removed."
            }
          },
          "description": "The offer was removed after its supported size fell below policy minimum.",
          "additionalProperties": false
        }
      ],
      "description": "Primary warning discriminated by its machine-readable code."
    },
    "ListBookTakeableOfferResponse": {
      "type": "object",
      "required": [
        "data"
      ],
      "properties": {
        "data": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/BookTakeableOfferResponse"
          },
          "example": [
            {
              "offer": {
                "buy": false,
                "tick": 495,
                "group": "0x000000000000000000000000000000000000000000000000000000000008b8f4",
                "maker": "0x7b093658BE7f90B63D7c359e8f408e503c2D9401",
                "start": 1761922790,
                "expiry": 1761922799,
                "market": {
                  "chain_id": 8453,
                  "maturity": 1761922799,
                  "midnight": "0x2F7a3AA739ba5792Ce1b4eA046117f2C0095BCA6",
                  "enter_gate": "0x0000000000000000000000000000000000000000",
                  "loan_token": "0xC9A9C45C0eB717f8b5F193Af6bAa05A1c0Ac5078",
                  "collaterals": [
                    {
                      "lltv": "860000000000000000",
                      "token": "0x34Cf890dB685FC536E05652FB41f02090c3fb751",
                      "oracle": "0x45093658BE7f90B63D7c359e8f408e503c2D9401",
                      "liquidation_cursor": "300000000000000000"
                    }
                  ],
                  "rcf_threshold": "0",
                  "liquidator_gate": "0x0000000000000000000000000000000000000000"
                },
                "callback": "0x0000000000000000000000000000000000000000",
                "ratifier": "0x0000000000000000000000000000000000000002",
                "max_units": "369216000000000000000000",
                "max_assets": "0",
                "reduce_only": false,
                "callback_data": "0x",
                "continuous_fee_cap": "115792089237316195423570985008687907853269984665640564039457584007913129639935",
                "receiver_if_maker_is_seller": "0x7b093658BE7f90B63D7c359e8f408e503c2D9401"
              },
              "units": "369216000000000000000000",
              "warning": null,
              "market_id": "0x25690ae1aee324a005be565f3bcdd16dbf8daf7969b26c181c8b8f467dad9f67",
              "valid_until": 1761922799,
              "ratifier_data": "0x000000000000000000000000000000000000000000000000000000000000001b12121212121212121212121212121212121212121212121212121212121212123434343434343434343434343434343434343434343434343434343434343434"
            }
          ],
          "description": "Takeable offers for this book side."
        }
      }
    }
  },
  "required": [
    "data"
  ],
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/BookTakeableOfferResponse"
      },
      "example": [
        {
          "offer": {
            "buy": false,
            "tick": 495,
            "group": "0x000000000000000000000000000000000000000000000000000000000008b8f4",
            "maker": "0x7b093658BE7f90B63D7c359e8f408e503c2D9401",
            "start": 1761922790,
            "expiry": 1761922799,
            "market": {
              "chain_id": 8453,
              "maturity": 1761922799,
              "midnight": "0x2F7a3AA739ba5792Ce1b4eA046117f2C0095BCA6",
              "enter_gate": "0x0000000000000000000000000000000000000000",
              "loan_token": "0xC9A9C45C0eB717f8b5F193Af6bAa05A1c0Ac5078",
              "collaterals": [
                {
                  "lltv": "860000000000000000",
                  "token": "0x34Cf890dB685FC536E05652FB41f02090c3fb751",
                  "oracle": "0x45093658BE7f90B63D7c359e8f408e503c2D9401",
                  "liquidation_cursor": "300000000000000000"
                }
              ],
              "rcf_threshold": "0",
              "liquidator_gate": "0x0000000000000000000000000000000000000000"
            },
            "callback": "0x0000000000000000000000000000000000000000",
            "ratifier": "0x0000000000000000000000000000000000000002",
            "max_units": "369216000000000000000000",
            "max_assets": "0",
            "reduce_only": false,
            "callback_data": "0x",
            "continuous_fee_cap": "115792089237316195423570985008687907853269984665640564039457584007913129639935",
            "receiver_if_maker_is_seller": "0x7b093658BE7f90B63D7c359e8f408e503c2D9401"
          },
          "units": "369216000000000000000000",
          "warning": null,
          "market_id": "0x25690ae1aee324a005be565f3bcdd16dbf8daf7969b26c181c8b8f467dad9f67",
          "valid_until": 1761922799,
          "ratifier_data": "0x000000000000000000000000000000000000000000000000000000000000001b12121212121212121212121212121212121212121212121212121212121212123434343434343434343434343434343434343434343434343434343434343434"
        }
      ],
      "description": "Takeable offers for this book side."
    }
  },
  "x-fastmcp-top-level-schema": "ListBookTakeableOfferResponse"
}
morpho_midnight_get_book_side_takeable_offers annotations
{
  "title": "Midnight Get Book Side Takeable Offers",
  "readOnlyHint": true,
  "destructiveHint": false
}
morpho_midnight_get_book_quote
Advertised by the server during the last successful anonymous check.
Advertised read-only

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.

morpho_midnight_get_book_quote input schema
{
  "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`."
    }
  }
}
morpho_midnight_get_book_quote output schema
{
  "type": "object",
  "$defs": {
    "OfferDataResponse": {
      "type": "object",
      "required": [
        "market",
        "buy",
        "maker",
        "max_units",
        "start",
        "expiry",
        "tick",
        "group",
        "callback",
        "callback_data",
        "receiver_if_maker_is_seller",
        "ratifier",
        "reduce_only",
        "max_assets",
        "continuous_fee_cap"
      ],
      "properties": {
        "buy": {
          "type": "boolean",
          "example": false
        },
        "tick": {
          "type": "number",
          "example": 495,
          "maximum": 6744,
          "minimum": 0
        },
        "group": {
          "type": "string",
          "example": "0x000000000000000000000000000000000000000000000000000000000008b8f4"
        },
        "maker": {
          "type": "string",
          "example": "0x7b093658BE7f90B63D7c359e8f408e503c2D9401"
        },
        "start": {
          "type": "number",
          "example": 1761922790
        },
        "expiry": {
          "type": "number",
          "example": 1761922799
        },
        "market": {
          "$ref": "#/$defs/MarketOfferResponse",
          "example": {
            "chain_id": 8453,
            "maturity": 1761922799,
            "midnight": "0x2F7a3AA739ba5792Ce1b4eA046117f2C0095BCA6",
            "enter_gate": "0x0000000000000000000000000000000000000000",
            "loan_token": "0xC9A9C45C0eB717f8b5F193Af6bAa05A1c0Ac5078",
            "collaterals": [
              {
                "lltv": "860000000000000000",
                "token": "0x34Cf890dB685FC536E05652FB41f02090c3fb751",
                "oracle": "0x45093658BE7f90B63D7c359e8f408e503c2D9401",
                "liquidation_cursor": "300000000000000000"
              }
            ],
            "rcf_threshold": "0",
            "liquidator_gate": "0x0000000000000000000000000000000000000000"
          }
        },
        "callback": {
          "type": "string",
          "example": "0x0000000000000000000000000000000000000000",
          "description": "Settlement callback address. Use the zero address for empty callbacks. A Blue-backed buy uses a BlueBuyCallback registered to the maker by the chain's factory at or before the offer's creation block; a maker-chosen salt allows multiple callbacks."
        },
        "ratifier": {
          "type": "string",
          "example": "0x0000000000000000000000000000000000000002"
        },
        "max_units": {
          "type": "string",
          "example": "369216000000000000000000"
        },
        "max_assets": {
          "type": "string",
          "example": "0"
        },
        "reduce_only": {
          "type": "boolean",
          "example": false
        },
        "callback_data": {
          "type": "string",
          "example": "0x",
          "description": "Settlement callback data. Use `0x` for empty callbacks. A Blue-backed buy uses the exact 160-byte ABI encoding of Morpho Blue `MarketParams` (`loanToken`, `collateralToken`, `oracle`, `irm`, `lltv`); `loanToken` must match the offer market."
        },
        "continuous_fee_cap": {
          "type": "string",
          "example": "115792089237316195423570985008687907853269984665640564039457584007913129639935",
          "description": "Maximum market continuous fee the maker accepts; the offer is not takeable while the market continuous fee exceeds it. Decimal uint256 string."
        },
        "receiver_if_maker_is_seller": {
          "type": "string",
          "example": "0x7b093658BE7f90B63D7c359e8f408e503c2D9401"
        }
      }
    },
    "QuoteDataResponse": {
      "type": "object",
      "required": [
        "data"
      ],
      "properties": {
        "data": {
          "$ref": "#/$defs/QuotePayloadResponse",
          "example": {
            "available_units": "1500000000000000000",
            "takeable_offers": [
              {
                "offer": {
                  "buy": false,
                  "tick": 495,
                  "group": "0x000000000000000000000000000000000000000000000000000000000008b8f4",
                  "maker": "0x7b093658BE7f90B63D7c359e8f408e503c2D9401",
                  "start": 1761922790,
                  "expiry": 1761922799,
                  "market": {
                    "chain_id": 8453,
                    "maturity": 1761922799,
                    "midnight": "0x2F7a3AA739ba5792Ce1b4eA046117f2C0095BCA6",
                    "enter_gate": "0x0000000000000000000000000000000000000000",
                    "loan_token": "0xC9A9C45C0eB717f8b5F193Af6bAa05A1c0Ac5078",
                    "collaterals": [
                      {
                        "lltv": "860000000000000000",
                        "token": "0x34Cf890dB685FC536E05652FB41f02090c3fb751",
                        "oracle": "0x45093658BE7f90B63D7c359e8f408e503c2D9401",
                        "liquidation_cursor": "300000000000000000"
                      }
                    ],
                    "rcf_threshold": "0",
                    "liquidator_gate": "0x0000000000000000000000000000000000000000"
                  },
                  "callback": "0x0000000000000000000000000000000000000000",
                  "ratifier": "0x0000000000000000000000000000000000000002",
                  "max_units": "369216000000000000000000",
                  "max_assets": "0",
                  "reduce_only": false,
                  "callback_data": "0x",
                  "continuous_fee_cap": "115792089237316195423570985008687907853269984665640564039457584007913129639935",
                  "receiver_if_maker_is_seller": "0x7b093658BE7f90B63D7c359e8f408e503c2D9401"
                },
                "units": "369216000000000000000000",
                "warning": null,
                "market_id": "0x25690ae1aee324a005be565f3bcdd16dbf8daf7969b26c181c8b8f467dad9f67",
                "valid_until": 1761922799,
                "ratifier_data": "0x000000000000000000000000000000000000000000000000000000000000001b12121212121212121212121212121212121212121212121212121212121212123434343434343434343434343434343434343434343434343434343434343434"
              }
            ],
            "available_assets": "1500000000000000000",
            "average_best_price": "1000000000000000000",
            "average_worst_price": "1000000000000000000"
          },
          "description": "Quote result and signed takeable-offer instructions."
        }
      }
    },
    "CollateralResponse": {
      "type": "object",
      "required": [
        "token",
        "lltv",
        "liquidation_cursor",
        "oracle"
      ],
      "properties": {
        "lltv": {
          "type": "string",
          "example": "860000000000000000",
          "description": "Liquidation loan-to-value for this collateral, scaled by 1e18."
        },
        "token": {
          "type": "string",
          "example": "0x34Cf890dB685FC536E05652FB41f02090c3fb751",
          "description": "Collateral token address."
        },
        "oracle": {
          "type": "string",
          "example": "0x45093658BE7f90B63D7c359e8f408e503c2D9401",
          "description": "Oracle address used to price this collateral."
        },
        "liquidation_cursor": {
          "type": "string",
          "example": "300000000000000000",
          "description": "Liquidation cursor for this collateral, scaled by 1e18. The protocol derives the maximum liquidation incentive factor from it."
        }
      }
    },
    "MarketOfferResponse": {
      "type": "object",
      "required": [
        "chain_id",
        "midnight",
        "loan_token",
        "collaterals",
        "maturity",
        "rcf_threshold",
        "enter_gate",
        "liquidator_gate"
      ],
      "properties": {
        "chain_id": {
          "type": "number",
          "example": 8453,
          "description": "EVM chain id the market lives on."
        },
        "maturity": {
          "type": "number",
          "example": 1761922799
        },
        "midnight": {
          "type": "string",
          "example": "0x2F7a3AA739ba5792Ce1b4eA046117f2C0095BCA6",
          "description": "Address of the Midnight contract that owns the market."
        },
        "enter_gate": {
          "type": "string",
          "example": "0x0000000000000000000000000000000000000000"
        },
        "loan_token": {
          "type": "string",
          "example": "0xC9A9C45C0eB717f8b5F193Af6bAa05A1c0Ac5078"
        },
        "collaterals": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/CollateralResponse"
          },
          "example": [
            {
              "lltv": "860000000000000000",
              "token": "0x34Cf890dB685FC536E05652FB41f02090c3fb751",
              "oracle": "0x45093658BE7f90B63D7c359e8f408e503c2D9401",
              "liquidation_cursor": "300000000000000000"
            }
          ]
        },
        "rcf_threshold": {
          "type": "string",
          "example": "0"
        },
        "liquidator_gate": {
          "type": "string",
          "example": "0x0000000000000000000000000000000000000000"
        }
      }
    },
    "QuotePayloadResponse": {
      "type": "object",
      "required": [
        "average_best_price",
        "average_worst_price",
        "available_assets",
        "available_units",
        "takeable_offers"
      ],
      "properties": {
        "available_units": {
          "type": "string",
          "example": "1500000000000000000",
          "description": "Maximum units available from the returned takeable-offer caps if they remain executable. This can exceed the requested target so bundle execution has fallback liquidity."
        },
        "takeable_offers": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/BookTakeableOfferResponse"
          },
          "example": [
            {
              "offer": {
                "buy": false,
                "tick": 495,
                "group": "0x000000000000000000000000000000000000000000000000000000000008b8f4",
                "maker": "0x7b093658BE7f90B63D7c359e8f408e503c2D9401",
                "start": 1761922790,
                "expiry": 1761922799,
                "market": {
                  "chain_id": 8453,
                  "maturity": 1761922799,
                  "midnight": "0x2F7a3AA739ba5792Ce1b4eA046117f2C0095BCA6",
                  "enter_gate": "0x0000000000000000000000000000000000000000",
                  "loan_token": "0xC9A9C45C0eB717f8b5F193Af6bAa05A1c0Ac5078",
                  "collaterals": [
                    {
                      "lltv": "860000000000000000",
                      "token": "0x34Cf890dB685FC536E05652FB41f02090c3fb751",
                      "oracle": "0x45093658BE7f90B63D7c359e8f408e503c2D9401",
                      "liquidation_cursor": "300000000000000000"
                    }
                  ],
                  "rcf_threshold": "0",
                  "liquidator_gate": "0x0000000000000000000000000000000000000000"
                },
                "callback": "0x0000000000000000000000000000000000000000",
                "ratifier": "0x0000000000000000000000000000000000000002",
                "max_units": "369216000000000000000000",
                "max_assets": "0",
                "reduce_only": false,
                "callback_data": "0x",
                "continuous_fee_cap": "115792089237316195423570985008687907853269984665640564039457584007913129639935",
                "receiver_if_maker_is_seller": "0x7b093658BE7f90B63D7c359e8f408e503c2D9401"
              },
              "units": "369216000000000000000000",
              "warning": null,
              "market_id": "0x25690ae1aee324a005be565f3bcdd16dbf8daf7969b26c181c8b8f467dad9f67",
              "valid_until": 1761922799,
              "ratifier_data": "0x000000000000000000000000000000000000000000000000000000000000001b12121212121212121212121212121212121212121212121212121212121212123434343434343434343434343434343434343434343434343434343434343434"
            }
          ],
          "description": "Best-priced signed takeable-offer caps intended for target-aware bundle execution. Each `units` value is the maximum that offer may contribute, not an exact allocation for the requested target; the sum can exceed the requested size so a bundle executor can skip stale offers and still fill the target. If you call Midnight.take directly instead of using target-aware bundle execution, clamp each offer to your remaining target and current takeability, otherwise you may execute more than intended."
        },
        "available_assets": {
          "type": "string",
          "example": "1500000000000000000",
          "description": "Maximum assets available from the returned takeable-offer caps if they remain executable. This can exceed the requested target so bundle execution has fallback liquidity."
        },
        "average_best_price": {
          "type": "string",
          "example": "1000000000000000000",
          "description": "Realized average price for the requested size filled against the returned offers in book order, applying the same per-offer rounding as onchain execution and rounded against the taker, so unit or asset guards derived from it stay executable."
        },
        "average_worst_price": {
          "type": "string",
          "example": "1000000000000000000",
          "description": "Conservative adverse-placement bound for the requested size across the returned offer caps. It fractionally relaxes full-offer selection at each cap's realized assets-per-unit rate and rounds the boundary against the taker, bounding every combination of full returned caps plus one target-closing partial. It is never more favorable than average_best_price and never echoes the caller's guard or a best-plus-slippage projection. Multiple offers that are all partially consumed after quoting can still require a fresh quote or execution-time minimum/maximum checks."
        }
      }
    },
    "BookTakeableOfferResponse": {
      "type": "object",
      "required": [
        "units",
        "offer",
        "ratifier_data",
        "valid_until",
        "market_id",
        "warning"
      ],
      "properties": {
        "offer": {
          "$ref": "#/$defs/OfferDataResponse",
          "example": {
            "buy": false,
            "tick": 495,
            "group": "0x000000000000000000000000000000000000000000000000000000000008b8f4",
            "maker": "0x7b093658BE7f90B63D7c359e8f408e503c2D9401",
            "start": 1761922790,
            "expiry": 1761922799,
            "market": {
              "chain_id": 8453,
              "maturity": 1761922799,
              "midnight": "0x2F7a3AA739ba5792Ce1b4eA046117f2C0095BCA6",
              "enter_gate": "0x0000000000000000000000000000000000000000",
              "loan_token": "0xC9A9C45C0eB717f8b5F193Af6bAa05A1c0Ac5078",
              "collaterals": [
                {
                  "lltv": "860000000000000000",
                  "token": "0x34Cf890dB685FC536E05652FB41f02090c3fb751",
                  "oracle": "0x45093658BE7f90B63D7c359e8f408e503c2D9401",
                  "liquidation_cursor": "300000000000000000"
                }
              ],
              "rcf_threshold": "0",
              "liquidator_gate": "0x0000000000000000000000000000000000000000"
            },
            "callback": "0x0000000000000000000000000000000000000000",
            "ratifier": "0x0000000000000000000000000000000000000002",
            "max_units": "369216000000000000000000",
            "max_assets": "0",
            "reduce_only": false,
            "callback_data": "0x",
            "continuous_fee_cap": "115792089237316195423570985008687907853269984665640564039457584007913129639935",
            "receiver_if_maker_is_seller": "0x7b093658BE7f90B63D7c359e8f408e503c2D9401"
          }
        },
        "units": {
          "type": "string",
          "example": "369216000000000000000000",
          "description": "Executable or currently reserved offer size in units."
        },
        "warning": {
          "anyOf": [
            {
              "$ref": "#/$defs/TakeabilityWarningResponse"
            },
            {
              "enum": [
                null
              ]
            }
          ],
          "example": null,
          "description": "Deprecated: still returned for now, but will become null in a future release and then be removed. Do not rely on it; `units` already is the amount you can take. Quote responses preserve this pre-quote book measurement after clipping. Makers can still see why their offers are limited on `GET /v0/midnight/takeable-offers`."
        },
        "market_id": {
          "type": "string",
          "example": "0x25690ae1aee324a005be565f3bcdd16dbf8daf7969b26c181c8b8f467dad9f67",
          "description": "Market id (32-byte hex) the offer belongs to."
        },
        "valid_until": {
          "type": "integer",
          "example": 1761922799,
          "minimum": 0,
          "description": "Inclusive Unix-second bound until which `offer` and `ratifier_data` stay executable as published; never exceeds `offer.expiry`. Refetch after it passes."
        },
        "ratifier_data": {
          "type": "string",
          "example": "0x000000000000000000000000000000000000000000000000000000000000001b12121212121212121212121212121212121212121212121212121212121212123434343434343434343434343434343434343434343434343434343434343434",
          "description": "Mandatory data generated by the maker to verify the offer onchain."
        }
      }
    },
    "TakeabilityWarningResponse": {
      "anyOf": [
        {
          "type": "object",
          "required": [
            "code"
          ],
          "properties": {
            "code": {
              "enum": [
                "MAKER_LIQUIDITY"
              ],
              "type": "string",
              "example": "MAKER_LIQUIDITY"
            }
          },
          "description": "Maker-controlled funds cannot back more units.",
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "code"
          ],
          "properties": {
            "code": {
              "enum": [
                "MAKER_ALLOWANCE"
              ],
              "type": "string",
              "example": "MAKER_ALLOWANCE"
            }
          },
          "description": "The maker's loan-token approval cannot back more units.",
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "code"
          ],
          "properties": {
            "code": {
              "enum": [
                "SOURCE_LIQUIDITY"
              ],
              "type": "string",
              "example": "SOURCE_LIQUIDITY"
            }
          },
          "description": "The underlying protocol cannot currently release more liquidity.",
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "code"
          ],
          "properties": {
            "code": {
              "enum": [
                "REDUCE_ONLY"
              ],
              "type": "string",
              "example": "REDUCE_ONLY"
            }
          },
          "description": "More units would increase rather than reduce the maker's position.",
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "code"
          ],
          "properties": {
            "code": {
              "enum": [
                "POSITION_CAPACITY"
              ],
              "type": "string",
              "example": "POSITION_CAPACITY"
            }
          },
          "description": "The maker's credit or debt position has no room for more units.",
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "code"
          ],
          "properties": {
            "code": {
              "enum": [
                "AMOUNT_ROUNDING"
              ],
              "type": "string",
              "example": "AMOUNT_ROUNDING"
            }
          },
          "description": "Asset and unit rounding prevents another meaningful unit from executing.",
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "code"
          ],
          "properties": {
            "code": {
              "enum": [
                "CALLBACK_NOT_REGISTERED"
              ],
              "type": "string",
              "example": "CALLBACK_NOT_REGISTERED"
            }
          },
          "description": "The callback was not registered to the maker at or before the offer's creation block.",
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "code"
          ],
          "properties": {
            "code": {
              "enum": [
                "RATIFIER_NOT_AUTHORIZED"
              ],
              "type": "string",
              "example": "RATIFIER_NOT_AUTHORIZED"
            }
          },
          "description": "The maker does not currently authorize the offer's ratifier.",
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "code"
          ],
          "properties": {
            "code": {
              "enum": [
                "SIMULATION_FAILED"
              ],
              "type": "string",
              "example": "SIMULATION_FAILED"
            }
          },
          "description": "Router simulation failed for the offer's group and market.",
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "code"
          ],
          "properties": {
            "code": {
              "enum": [
                "RESTRICTED_TAKER"
              ],
              "type": "string",
              "example": "RESTRICTED_TAKER"
            }
          },
          "description": "The offer is reserved for a specific taker and cannot be taken publicly.",
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "code",
            "limit_units"
          ],
          "properties": {
            "code": {
              "enum": [
                "SINGLE_TAKE_LIMIT"
              ],
              "type": "string",
              "example": "SINGLE_TAKE_LIMIT"
            },
            "limit_units": {
              "type": "string",
              "pattern": "^\\d+$",
              "description": "Maximum units allowed in one take."
            }
          },
          "description": "The offer exceeds the maximum units allowed in one take.",
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "code",
            "root"
          ],
          "properties": {
            "code": {
              "enum": [
                "ROOT_CANCELED"
              ],
              "type": "string",
              "example": "ROOT_CANCELED"
            },
            "root": {
              "type": "string",
              "pattern": "^0x[0-9a-fA-F]{64}$",
              "description": "Canceled Ecrecover Merkle root."
            }
          },
          "description": "The offer's Ecrecover Merkle root was permanently canceled.",
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "code",
            "root"
          ],
          "properties": {
            "code": {
              "enum": [
                "ROOT_NOT_RATIFIED"
              ],
              "type": "string",
              "example": "ROOT_NOT_RATIFIED"
            },
            "root": {
              "type": "string",
              "pattern": "^0x[0-9a-fA-F]{64}$",
              "description": "Setter Merkle root the maker has not currently ratified."
            }
          },
          "description": "The maker has not currently ratified the offer's Setter Merkle root.",
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "code",
            "signer"
          ],
          "properties": {
            "code": {
              "enum": [
                "SIGNER_NOT_AUTHORIZED"
              ],
              "type": "string",
              "example": "SIGNER_NOT_AUTHORIZED"
            },
            "signer": {
              "type": "string",
              "pattern": "^0x[0-9a-fA-F]{40}$",
              "description": "Tree signer the maker has not authorized."
            }
          },
          "description": "The maker does not currently authorize the offer tree's signer.",
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "code",
            "observed_assets",
            "minimum_assets"
          ],
          "properties": {
            "code": {
              "enum": [
                "BELOW_MINIMUM_SIZE"
              ],
              "type": "string",
              "example": "BELOW_MINIMUM_SIZE"
            },
            "minimum_assets": {
              "type": "string",
              "pattern": "^\\d+$",
              "description": "Required minimum assets."
            },
            "observed_assets": {
              "type": "string",
              "pattern": "^\\d+$",
              "description": "Assets measured when the offer was removed."
            }
          },
          "description": "The offer was removed after its supported size fell below policy minimum.",
          "additionalProperties": false
        }
      ],
      "description": "Primary warning discriminated by its machine-readable code."
    }
  },
  "required": [
    "data"
  ],
  "properties": {
    "data": {
      "$ref": "#/$defs/QuotePayloadResponse",
      "example": {
        "available_units": "1500000000000000000",
        "takeable_offers": [
          {
            "offer": {
              "buy": false,
              "tick": 495,
              "group": "0x000000000000000000000000000000000000000000000000000000000008b8f4",
              "maker": "0x7b093658BE7f90B63D7c359e8f408e503c2D9401",
              "start": 1761922790,
              "expiry": 1761922799,
              "market": {
                "chain_id": 8453,
                "maturity": 1761922799,
                "midnight": "0x2F7a3AA739ba5792Ce1b4eA046117f2C0095BCA6",
                "enter_gate": "0x0000000000000000000000000000000000000000",
                "loan_token": "0xC9A9C45C0eB717f8b5F193Af6bAa05A1c0Ac5078",
                "collaterals": [
                  {
                    "lltv": "860000000000000000",
                    "token": "0x34Cf890dB685FC536E05652FB41f02090c3fb751",
                    "oracle": "0x45093658BE7f90B63D7c359e8f408e503c2D9401",
                    "liquidation_cursor": "300000000000000000"
                  }
                ],
                "rcf_threshold": "0",
                "liquidator_gate": "0x0000000000000000000000000000000000000000"
              },
              "callback": "0x0000000000000000000000000000000000000000",
              "ratifier": "0x0000000000000000000000000000000000000002",
              "max_units": "369216000000000000000000",
              "max_assets": "0",
              "reduce_only": false,
              "callback_data": "0x",
              "continuous_fee_cap": "115792089237316195423570985008687907853269984665640564039457584007913129639935",
              "receiver_if_maker_is_seller": "0x7b093658BE7f90B63D7c359e8f408e503c2D9401"
            },
            "units": "369216000000000000000000",
            "warning": null,
            "market_id": "0x25690ae1aee324a005be565f3bcdd16dbf8daf7969b26c181c8b8f467dad9f67",
            "valid_until": 1761922799,
            "ratifier_data": "0x000000000000000000000000000000000000000000000000000000000000001b12121212121212121212121212121212121212121212121212121212121212123434343434343434343434343434343434343434343434343434343434343434"
          }
        ],
        "available_assets": "1500000000000000000",
        "average_best_price": "1000000000000000000",
        "average_worst_price": "1000000000000000000"
      },
      "description": "Quote result and signed takeable-offer instructions."
    }
  },
  "x-fastmcp-top-level-schema": "QuoteDataResponse"
}
morpho_midnight_get_book_quote annotations
{
  "title": "Midnight Get Book Quote",
  "readOnlyHint": true,
  "destructiveHint": false
}
morpho_midnight_list_maker_takeable_offers
Advertised by the server during the last successful anonymous check.
Advertised read-only

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.

morpho_midnight_list_maker_takeable_offers input schema
{
  "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."
    }
  }
}
morpho_midnight_list_maker_takeable_offers output schema
{
  "type": "object",
  "$defs": {
    "OfferDataResponse": {
      "type": "object",
      "required": [
        "market",
        "buy",
        "maker",
        "max_units",
        "start",
        "expiry",
        "tick",
        "group",
        "callback",
        "callback_data",
        "receiver_if_maker_is_seller",
        "ratifier",
        "reduce_only",
        "max_assets",
        "continuous_fee_cap"
      ],
      "properties": {
        "buy": {
          "type": "boolean",
          "example": false
        },
        "tick": {
          "type": "number",
          "example": 495,
          "maximum": 6744,
          "minimum": 0
        },
        "group": {
          "type": "string",
          "example": "0x000000000000000000000000000000000000000000000000000000000008b8f4"
        },
        "maker": {
          "type": "string",
          "example": "0x7b093658BE7f90B63D7c359e8f408e503c2D9401"
        },
        "start": {
          "type": "number",
          "example": 1761922790
        },
        "expiry": {
          "type": "number",
          "example": 1761922799
        },
        "market": {
          "$ref": "#/$defs/MarketOfferResponse",
          "example": {
            "chain_id": 8453,
            "maturity": 1761922799,
            "midnight": "0x2F7a3AA739ba5792Ce1b4eA046117f2C0095BCA6",
            "enter_gate": "0x0000000000000000000000000000000000000000",
            "loan_token": "0xC9A9C45C0eB717f8b5F193Af6bAa05A1c0Ac5078",
            "collaterals": [
              {
                "lltv": "860000000000000000",
                "token": "0x34Cf890dB685FC536E05652FB41f02090c3fb751",
                "oracle": "0x45093658BE7f90B63D7c359e8f408e503c2D9401",
                "liquidation_cursor": "300000000000000000"
              }
            ],
            "rcf_threshold": "0",
            "liquidator_gate": "0x0000000000000000000000000000000000000000"
          }
        },
        "callback": {
          "type": "string",
          "example": "0x0000000000000000000000000000000000000000",
          "description": "Settlement callback address. Use the zero address for empty callbacks. A Blue-backed buy uses a BlueBuyCallback registered to the maker by the chain's factory at or before the offer's creation block; a maker-chosen salt allows multiple callbacks."
        },
        "ratifier": {
          "type": "string",
          "example": "0x0000000000000000000000000000000000000002"
        },
        "max_units": {
          "type": "string",
          "example": "369216000000000000000000"
        },
        "max_assets": {
          "type": "string",
          "example": "0"
        },
        "reduce_only": {
          "type": "boolean",
          "example": false
        },
        "callback_data": {
          "type": "string",
          "example": "0x",
          "description": "Settlement callback data. Use `0x` for empty callbacks. A Blue-backed buy uses the exact 160-byte ABI encoding of Morpho Blue `MarketParams` (`loanToken`, `collateralToken`, `oracle`, `irm`, `lltv`); `loanToken` must match the offer market."
        },
        "continuous_fee_cap": {
          "type": "string",
          "example": "115792089237316195423570985008687907853269984665640564039457584007913129639935",
          "description": "Maximum market continuous fee the maker accepts; the offer is not takeable while the market continuous fee exceeds it. Decimal uint256 string."
        },
        "receiver_if_maker_is_seller": {
          "type": "string",
          "example": "0x7b093658BE7f90B63D7c359e8f408e503c2D9401"
        }
      }
    },
    "CollateralResponse": {
      "type": "object",
      "required": [
        "token",
        "lltv",
        "liquidation_cursor",
        "oracle"
      ],
      "properties": {
        "lltv": {
          "type": "string",
          "example": "860000000000000000",
          "description": "Liquidation loan-to-value for this collateral, scaled by 1e18."
        },
        "token": {
          "type": "string",
          "example": "0x34Cf890dB685FC536E05652FB41f02090c3fb751",
          "description": "Collateral token address."
        },
        "oracle": {
          "type": "string",
          "example": "0x45093658BE7f90B63D7c359e8f408e503c2D9401",
          "description": "Oracle address used to price this collateral."
        },
        "liquidation_cursor": {
          "type": "string",
          "example": "300000000000000000",
          "description": "Liquidation cursor for this collateral, scaled by 1e18. The protocol derives the maximum liquidation incentive factor from it."
        }
      }
    },
    "MarketOfferResponse": {
      "type": "object",
      "required": [
        "chain_id",
        "midnight",
        "loan_token",
        "collaterals",
        "maturity",
        "rcf_threshold",
        "enter_gate",
        "liquidator_gate"
      ],
      "properties": {
        "chain_id": {
          "type": "number",
          "example": 8453,
          "description": "EVM chain id the market lives on."
        },
        "maturity": {
          "type": "number",
          "example": 1761922799
        },
        "midnight": {
          "type": "string",
          "example": "0x2F7a3AA739ba5792Ce1b4eA046117f2C0095BCA6",
          "description": "Address of the Midnight contract that owns the market."
        },
        "enter_gate": {
          "type": "string",
          "example": "0x0000000000000000000000000000000000000000"
        },
        "loan_token": {
          "type": "string",
          "example": "0xC9A9C45C0eB717f8b5F193Af6bAa05A1c0Ac5078"
        },
        "collaterals": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/CollateralResponse"
          },
          "example": [
            {
              "lltv": "860000000000000000",
              "token": "0x34Cf890dB685FC536E05652FB41f02090c3fb751",
              "oracle": "0x45093658BE7f90B63D7c359e8f408e503c2D9401",
              "liquidation_cursor": "300000000000000000"
            }
          ]
        },
        "rcf_threshold": {
          "type": "string",
          "example": "0"
        },
        "liquidator_gate": {
          "type": "string",
          "example": "0x0000000000000000000000000000000000000000"
        }
      }
    },
    "TakeableOfferResponse": {
      "type": "object",
      "required": [
        "units",
        "offer",
        "ratifier_data",
        "valid_until",
        "market_id",
        "warning"
      ],
      "properties": {
        "offer": {
          "$ref": "#/$defs/OfferDataResponse",
          "example": {
            "buy": false,
            "tick": 495,
            "group": "0x000000000000000000000000000000000000000000000000000000000008b8f4",
            "maker": "0x7b093658BE7f90B63D7c359e8f408e503c2D9401",
            "start": 1761922790,
            "expiry": 1761922799,
            "market": {
              "chain_id": 8453,
              "maturity": 1761922799,
              "midnight": "0x2F7a3AA739ba5792Ce1b4eA046117f2C0095BCA6",
              "enter_gate": "0x0000000000000000000000000000000000000000",
              "loan_token": "0xC9A9C45C0eB717f8b5F193Af6bAa05A1c0Ac5078",
              "collaterals": [
                {
                  "lltv": "860000000000000000",
                  "token": "0x34Cf890dB685FC536E05652FB41f02090c3fb751",
                  "oracle": "0x45093658BE7f90B63D7c359e8f408e503c2D9401",
                  "liquidation_cursor": "300000000000000000"
                }
              ],
              "rcf_threshold": "0",
              "liquidator_gate": "0x0000000000000000000000000000000000000000"
            },
            "callback": "0x0000000000000000000000000000000000000000",
            "ratifier": "0x0000000000000000000000000000000000000002",
            "max_units": "369216000000000000000000",
            "max_assets": "0",
            "reduce_only": false,
            "callback_data": "0x",
            "continuous_fee_cap": "115792089237316195423570985008687907853269984665640564039457584007913129639935",
            "receiver_if_maker_is_seller": "0x7b093658BE7f90B63D7c359e8f408e503c2D9401"
          }
        },
        "units": {
          "type": "string",
          "example": "369216000000000000000000",
          "description": "Executable or currently reserved offer size in units."
        },
        "warning": {
          "anyOf": [
            {
              "$ref": "#/$defs/TakeabilityWarningResponse"
            },
            {
              "enum": [
                null
              ]
            }
          ],
          "example": null,
          "description": "Primary reason why more of this active offer is not currently takeable. Null when its complete remaining capacity is takeable."
        },
        "market_id": {
          "type": "string",
          "example": "0x25690ae1aee324a005be565f3bcdd16dbf8daf7969b26c181c8b8f467dad9f67",
          "description": "Market id (32-byte hex) the offer belongs to."
        },
        "valid_until": {
          "type": "integer",
          "example": 1761922799,
          "minimum": 0,
          "description": "Inclusive Unix-second bound until which `offer` and `ratifier_data` stay executable as published; never exceeds `offer.expiry`. Refetch after it passes."
        },
        "ratifier_data": {
          "type": "string",
          "example": "0x000000000000000000000000000000000000000000000000000000000000001b12121212121212121212121212121212121212121212121212121212121212123434343434343434343434343434343434343434343434343434343434343434",
          "description": "Mandatory data generated by the maker to verify the offer onchain."
        }
      }
    },
    "ListTakeableOfferResponse": {
      "type": "object",
      "required": [
        "cursor",
        "data"
      ],
      "properties": {
        "data": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/TakeableOfferResponse"
          },
          "example": [
            {
              "offer": {
                "buy": false,
                "tick": 495,
                "group": "0x000000000000000000000000000000000000000000000000000000000008b8f4",
                "maker": "0x7b093658BE7f90B63D7c359e8f408e503c2D9401",
                "start": 1761922790,
                "expiry": 1761922799,
                "market": {
                  "chain_id": 8453,
                  "maturity": 1761922799,
                  "midnight": "0x2F7a3AA739ba5792Ce1b4eA046117f2C0095BCA6",
                  "enter_gate": "0x0000000000000000000000000000000000000000",
                  "loan_token": "0xC9A9C45C0eB717f8b5F193Af6bAa05A1c0Ac5078",
                  "collaterals": [
                    {
                      "lltv": "860000000000000000",
                      "token": "0x34Cf890dB685FC536E05652FB41f02090c3fb751",
                      "oracle": "0x45093658BE7f90B63D7c359e8f408e503c2D9401",
                      "liquidation_cursor": "300000000000000000"
                    }
                  ],
                  "rcf_threshold": "0",
                  "liquidator_gate": "0x0000000000000000000000000000000000000000"
                },
                "callback": "0x0000000000000000000000000000000000000000",
                "ratifier": "0x0000000000000000000000000000000000000002",
                "max_units": "369216000000000000000000",
                "max_assets": "0",
                "reduce_only": false,
                "callback_data": "0x",
                "continuous_fee_cap": "115792089237316195423570985008687907853269984665640564039457584007913129639935",
                "receiver_if_maker_is_seller": "0x7b093658BE7f90B63D7c359e8f408e503c2D9401"
              },
              "units": "369216000000000000000000",
              "warning": null,
              "market_id": "0x25690ae1aee324a005be565f3bcdd16dbf8daf7969b26c181c8b8f467dad9f67",
              "valid_until": 1761922799,
              "ratifier_data": "0x000000000000000000000000000000000000000000000000000000000000001b12121212121212121212121212121212121212121212121212121212121212123434343434343434343434343434343434343434343434343434343434343434"
            }
          ],
          "description": "Takeable offers for this maker."
        },
        "cursor": {
          "type": [
            "string",
            "null"
          ],
          "example": "eyJncm91cCI6IjB4MTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMSIsImhhc2giOiIweDIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIiLCJtYXJrZXRJZCI6IjB4MzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMyJ9",
          "description": "Opaque pagination cursor."
        }
      }
    },
    "TakeabilityWarningResponse": {
      "anyOf": [
        {
          "type": "object",
          "required": [
            "code"
          ],
          "properties": {
            "code": {
              "enum": [
                "MAKER_LIQUIDITY"
              ],
              "type": "string",
              "example": "MAKER_LIQUIDITY"
            }
          },
          "description": "Maker-controlled funds cannot back more units.",
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "code"
          ],
          "properties": {
            "code": {
              "enum": [
                "MAKER_ALLOWANCE"
              ],
              "type": "string",
              "example": "MAKER_ALLOWANCE"
            }
          },
          "description": "The maker's loan-token approval cannot back more units.",
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "code"
          ],
          "properties": {
            "code": {
              "enum": [
                "SOURCE_LIQUIDITY"
              ],
              "type": "string",
              "example": "SOURCE_LIQUIDITY"
            }
          },
          "description": "The underlying protocol cannot currently release more liquidity.",
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "code"
          ],
          "properties": {
            "code": {
              "enum": [
                "REDUCE_ONLY"
              ],
              "type": "string",
              "example": "REDUCE_ONLY"
            }
          },
          "description": "More units would increase rather than reduce the maker's position.",
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "code"
          ],
          "properties": {
            "code": {
              "enum": [
                "POSITION_CAPACITY"
              ],
              "type": "string",
              "example": "POSITION_CAPACITY"
            }
          },
          "description": "The maker's credit or debt position has no room for more units.",
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "code"
          ],
          "properties": {
            "code": {
              "enum": [
                "AMOUNT_ROUNDING"
              ],
              "type": "string",
              "example": "AMOUNT_ROUNDING"
            }
          },
          "description": "Asset and unit rounding prevents another meaningful unit from executing.",
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "code"
          ],
          "properties": {
            "code": {
              "enum": [
                "CALLBACK_NOT_REGISTERED"
              ],
              "type": "string",
              "example": "CALLBACK_NOT_REGISTERED"
            }
          },
          "description": "The callback was not registered to the maker at or before the offer's creation block.",
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "code"
          ],
          "properties": {
            "code": {
              "enum": [
                "RATIFIER_NOT_AUTHORIZED"
              ],
              "type": "string",
              "example": "RATIFIER_NOT_AUTHORIZED"
            }
          },
          "description": "The maker does not currently authorize the offer's ratifier.",
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "code"
          ],
          "properties": {
            "code": {
              "enum": [
                "SIMULATION_FAILED"
              ],
              "type": "string",
              "example": "SIMULATION_FAILED"
            }
          },
          "description": "Router simulation failed for the offer's group and market.",
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "code"
          ],
          "properties": {
            "code": {
              "enum": [
                "RESTRICTED_TAKER"
              ],
              "type": "string",
              "example": "RESTRICTED_TAKER"
            }
          },
          "description": "The offer is reserved for a specific taker and cannot be taken publicly.",
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "code",
            "limit_units"
          ],
          "properties": {
            "code": {
              "enum": [
                "SINGLE_TAKE_LIMIT"
              ],
              "type": "string",
              "example": "SINGLE_TAKE_LIMIT"
            },
            "limit_units": {
              "type": "string",
              "pattern": "^\\d+$",
              "description": "Maximum units allowed in one take."
            }
          },
          "description": "The offer exceeds the maximum units allowed in one take.",
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "code",
            "root"
          ],
          "properties": {
            "code": {
              "enum": [
                "ROOT_CANCELED"
              ],
              "type": "string",
              "example": "ROOT_CANCELED"
            },
            "root": {
              "type": "string",
              "pattern": "^0x[0-9a-fA-F]{64}$",
              "description": "Canceled Ecrecover Merkle root."
            }
          },
          "description": "The offer's Ecrecover Merkle root was permanently canceled.",
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "code",
            "root"
          ],
          "properties": {
            "code": {
              "enum": [
                "ROOT_NOT_RATIFIED"
              ],
              "type": "string",
              "example": "ROOT_NOT_RATIFIED"
            },
            "root": {
              "type": "string",
              "pattern": "^0x[0-9a-fA-F]{64}$",
              "description": "Setter Merkle root the maker has not currently ratified."
            }
          },
          "description": "The maker has not currently ratified the offer's Setter Merkle root.",
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "code",
            "signer"
          ],
          "properties": {
            "code": {
              "enum": [
                "SIGNER_NOT_AUTHORIZED"
              ],
              "type": "string",
              "example": "SIGNER_NOT_AUTHORIZED"
            },
            "signer": {
              "type": "string",
              "pattern": "^0x[0-9a-fA-F]{40}$",
              "description": "Tree signer the maker has not authorized."
            }
          },
          "description": "The maker does not currently authorize the offer tree's signer.",
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "code",
            "observed_assets",
            "minimum_assets"
          ],
          "properties": {
            "code": {
              "enum": [
                "BELOW_MINIMUM_SIZE"
              ],
              "type": "string",
              "example": "BELOW_MINIMUM_SIZE"
            },
            "minimum_assets": {
              "type": "string",
              "pattern": "^\\d+$",
              "description": "Required minimum assets."
            },
            "observed_assets": {
              "type": "string",
              "pattern": "^\\d+$",
              "description": "Assets measured when the offer was removed."
            }
          },
          "description": "The offer was removed after its supported size fell below policy minimum.",
          "additionalProperties": false
        }
      ],
      "description": "Primary warning discriminated by its machine-readable code."
    }
  },
  "required": [
    "cursor",
    "data"
  ],
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/TakeableOfferResponse"
      },
      "example": [
        {
          "offer": {
            "buy": false,
            "tick": 495,
            "group": "0x000000000000000000000000000000000000000000000000000000000008b8f4",
            "maker": "0x7b093658BE7f90B63D7c359e8f408e503c2D9401",
            "start": 1761922790,
            "expiry": 1761922799,
            "market": {
              "chain_id": 8453,
              "maturity": 1761922799,
              "midnight": "0x2F7a3AA739ba5792Ce1b4eA046117f2C0095BCA6",
              "enter_gate": "0x0000000000000000000000000000000000000000",
              "loan_token": "0xC9A9C45C0eB717f8b5F193Af6bAa05A1c0Ac5078",
              "collaterals": [
                {
                  "lltv": "860000000000000000",
                  "token": "0x34Cf890dB685FC536E05652FB41f02090c3fb751",
                  "oracle": "0x45093658BE7f90B63D7c359e8f408e503c2D9401",
                  "liquidation_cursor": "300000000000000000"
                }
              ],
              "rcf_threshold": "0",
              "liquidator_gate": "0x0000000000000000000000000000000000000000"
            },
            "callback": "0x0000000000000000000000000000000000000000",
            "ratifier": "0x0000000000000000000000000000000000000002",
            "max_units": "369216000000000000000000",
            "max_assets": "0",
            "reduce_only": false,
            "callback_data": "0x",
            "continuous_fee_cap": "115792089237316195423570985008687907853269984665640564039457584007913129639935",
            "receiver_if_maker_is_seller": "0x7b093658BE7f90B63D7c359e8f408e503c2D9401"
          },
          "units": "369216000000000000000000",
          "warning": null,
          "market_id": "0x25690ae1aee324a005be565f3bcdd16dbf8daf7969b26c181c8b8f467dad9f67",
          "valid_until": 1761922799,
          "ratifier_data": "0x000000000000000000000000000000000000000000000000000000000000001b12121212121212121212121212121212121212121212121212121212121212123434343434343434343434343434343434343434343434343434343434343434"
        }
      ],
      "description": "Takeable offers for this maker."
    },
    "cursor": {
      "type": [
        "string",
        "null"
      ],
      "example": "eyJncm91cCI6IjB4MTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMSIsImhhc2giOiIweDIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIiLCJtYXJrZXRJZCI6IjB4MzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMyJ9",
      "description": "Opaque pagination cursor."
    }
  },
  "x-fastmcp-top-level-schema": "ListTakeableOfferResponse"
}
morpho_midnight_list_maker_takeable_offers annotations
{
  "title": "Midnight List Maker Takeable Offers",
  "readOnlyHint": true,
  "destructiveHint": false
}

Prompts

Not advertised

No prompt definitions available.

Resources

Not advertised

No resource definitions available.

90-day uptime

A lightweight connection check about every six hours, sampled on hosts with many listings. It shows the server answered, not that its tools work.

Too few checks for a percentage yet (1 of 1 answered).

  1. 2026-11-07: 1 of 1 checks answered

30-day availability

Aggregated from read-only remote checks; this is not a tool-execution or security guarantee.

Successful checks
1 of 1 (100%)
Average latency
684 ms
95th percentile latency
684 ms

Maintenance history

Public check and source-refresh events. Editorial and ownership records remain private.

  • · probe · passed · 684 ms · metadata changed · 53 tool(s)

Connect from your client

Each snippet registers the same endpoint; pick the client you use.

This server is operated by the named third party. Listing and endpoint checks are not an endorsement or a security audit. Review the operator's permissions, terms, and data handling before connecting. How listings are checked and corrected.

Claude Code

Run this once in a terminal. It registers the remote server. Use --scope project to write .mcp.json for the repo.
Claude Code configuration
claude mcp add --transport http morpho-mcp https://mcp.morpho.org/

Codex

Run this once. Codex stores MCP servers in ~/.codex/config.toml (or .codex/config.toml in a trusted project).
Codex configuration
codex mcp add morpho-mcp --url https://mcp.morpho.org/

Cursor

Merge this server into .cursor/mcp.json in your project, then enable morpho-mcp in your MCP settings.
Cursor configuration
{
  "mcpServers": {
    "morpho-mcp": {
      "url": "https://mcp.morpho.org/"
    }
  }
}

Cline

Merge this into cline_mcp_settings.json (Cline → MCP Servers → Configure).
Cline configuration
{
  "mcpServers": {
    "morpho-mcp": {
      "type": "streamableHttp",
      "url": "https://mcp.morpho.org/",
      "disabled": false
    }
  }
}

VS Code

Merge this server into .vscode/mcp.json. Use MCP: List Servers to start morpho-mcp and inspect its tools.
VS Code configuration
{
  "servers": {
    "morpho-mcp": {
      "type": "http",
      "url": "https://mcp.morpho.org/"
    }
  }
}

Gemini CLI

Run this once. It writes .gemini/settings.json in the current project; pass --scope user for ~/.gemini/settings.json.
Gemini CLI configuration
gemini mcp add --transport http morpho-mcp https://mcp.morpho.org/

Claude Desktop

Open Claude Settings > Connectors > Add custom connector, enter this server URL and enable it for the conversation. This is a manual remote-connector handoff, not a desktop JSON configuration.
Claude Desktop configuration
https://mcp.morpho.org/

Windsurf

Merge this into ~/.codeium/windsurf/mcp_config.json, then refresh MCP in Cascade. Windsurf remote servers use serverUrl, not url.
Windsurf configuration
{
  "mcpServers": {
    "morpho-mcp": {
      "serverUrl": "https://mcp.morpho.org/"
    }
  }
}

Let your agent find its tools

Find servers like Morpho MCP from your agent. Add Koskamo once to search the index for endpoints, access requirements, and client setup. Public discovery needs no key.

Do you run Morpho MCP?

Prove ownership with a DNS record, a well-known file, or your Official MCP Registry entry, and your edits publish immediately. Proofs are re-checked weekly; admins can still hide or remove a listing.

Claim this listing