{
  "x402Version": 2,
  "id": 2467,
  "slug": "2467",
  "resource": "https://www.tereno.xyz/api/v1/capabilities/morpho.collateral.guard/invoke",
  "description": "Will this borrow/leverage action breach Morpho liquidation thresholds? Simulate user position against declared LLTV, evaluate health factor buffer, and check oracle freshness before execution.",
  "type": "http",
  "accepts": [
    {
      "scheme": "exact",
      "network": "eip155:8453",
      "payTo": "0xfbF218ACCBb0D57fc4E8fc3E2A885C910c4C9e94",
      "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "amount": "750000",
      "maxTimeoutSeconds": 300
    }
  ],
  "outputSchema": {
    "bazaar": {
      "info": {
        "input": {
          "body": {
            "borrowAmountWei": "0",
            "collateralToken": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
            "loanToken": "0x4200000000000000000000000000000000000006",
            "marketId": "0x1111111111111111111111111111111111111111111111111111111111111111",
            "userAddress": "0x2222222222222222222222222222222222222222"
          },
          "bodyType": "json",
          "method": "POST",
          "type": "http"
        },
        "output": {
          "example": {
            "capabilityId": "morpho.collateral.guard",
            "capabilityVersion": "1.0.0",
            "invocationId": "uuid",
            "pricing": {
              "currency": "USDC",
              "pricePaidUsd": 0.5
            },
            "receiptUrl": "/api/v1/receipts/uuid",
            "result": {
              "currentLtvBps": 6500,
              "liquidationBufferBps": 2100,
              "lltvBps": 8600,
              "marketId": "0x1111111111111111111111111111111111111111111111111111111111111111",
              "projectedLtvBps": 6500,
              "reasonCodes": [
                "SOLVENCY_BUFFER_HEALTHY"
              ],
              "risks": [],
              "solvencyStatus": "healthy",
              "verdict": "allow"
            },
            "verdict": "allow"
          },
          "type": "json"
        }
      },
      "schema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "properties": {
          "input": {
            "additionalProperties": false,
            "properties": {
              "body": {
                "additionalProperties": false,
                "properties": {
                  "borrowAmountWei": {
                    "description": "Additional borrow amount in wei.",
                    "pattern": "^[0-9]+$",
                    "type": "string"
                  },
                  "collateralToken": {
                    "description": "Collateral asset address.",
                    "pattern": "^0x[a-fA-F0-9]{40}$",
                    "type": "string"
                  },
                  "loanToken": {
                    "description": "Borrow/loan asset address.",
                    "pattern": "^0x[a-fA-F0-9]{40}$",
                    "type": "string"
                  },
                  "marketId": {
                    "description": "Morpho market identifier (32 bytes hex).",
                    "pattern": "^0x[a-fA-F0-9]{64}$",
                    "type": "string"
                  },
                  "userAddress": {
                    "description": "Borrower wallet address.",
                    "pattern": "^0x[a-fA-F0-9]{40}$",
                    "type": "string"
                  }
                },
                "required": [
                  "marketId",
                  "collateralToken",
                  "loanToken",
                  "userAddress"
                ],
                "type": "object"
              },
              "bodyType": {
                "enum": [
                  "json",
                  "form-data",
                  "text"
                ],
                "type": "string"
              },
              "method": {
                "enum": [
                  "POST"
                ],
                "type": "string"
              },
              "type": {
                "const": "http",
                "type": "string"
              }
            },
            "required": [
              "type",
              "method",
              "bodyType",
              "body"
            ],
            "type": "object"
          },
          "output": {
            "properties": {
              "example": {
                "properties": {
                  "capabilityId": {
                    "const": "morpho.collateral.guard"
                  },
                  "invocationId": {
                    "type": "string"
                  },
                  "pricing": {
                    "type": "object"
                  },
                  "receiptUrl": {
                    "type": "string"
                  },
                  "result": {
                    "type": "object"
                  },
                  "verdict": {
                    "enum": [
                      "allow",
                      "review",
                      "block"
                    ]
                  }
                },
                "required": [
                  "capabilityId",
                  "invocationId",
                  "verdict",
                  "result",
                  "pricing",
                  "receiptUrl"
                ],
                "type": "object"
              },
              "type": {
                "type": "string"
              }
            },
            "required": [
              "type"
            ],
            "type": "object"
          }
        },
        "required": [
          "input"
        ],
        "type": "object"
      }
    },
    "builder-code": {
      "info": {
        "a": "bc_8kag0yoi"
      },
      "schema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "additionalProperties": false,
        "properties": {
          "a": {
            "description": "App builder code",
            "pattern": "^[a-z0-9_]{1,32}$",
            "type": "string"
          },
          "s": {
            "description": "Service builder codes",
            "items": {
              "pattern": "^[a-z0-9_]{1,32}$",
              "type": "string"
            },
            "type": "array"
          },
          "w": {
            "description": "Wallet builder code",
            "pattern": "^[a-z0-9_]{1,32}$",
            "type": "string"
          }
        },
        "type": "object"
      }
    }
  },
  "tags": [
    "bazaar",
    "builder-code"
  ],
  "sourceHost": "www.tereno.xyz",
  "lastUpdated": "2026-09-11T15:23:04.527Z",
  "quality": {
    "calls30d": 3,
    "uniquePayers30d": 1,
    "lastCalledAt": "2026-09-11T15:23:04.319Z"
  },
  "liveness": {},
  "verified": false,
  "featured": false,
  "provider": {
    "host": "www.tereno.xyz",
    "manifest_name": "www.tereno.xyz",
    "source": "cdp-mirror",
    "source_manifest_url": "https://api.cdp.coinbase.com/platform/v2/x402/discovery/resources",
    "submitted_at": "2026-09-18T22:00:31.484Z"
  }
}