{"openapi":"3.1.0","info":{"title":"Morpho Radar API","version":"2.1.0","description":"Morpho Blue liquidation headroom and stress analysis on Base. Paid requests use x402 v2, exact 0.05 USDC. A free, shared on-chain sample (cached up to 60 seconds) and an illustrative simulation fixture are available separately.","contact":{"name":"Rare Frequency Works","url":"https://rarefrequencyworks.com"}},"servers":[{"url":"https://radar-api.rarefrequencyworks.com"}],"externalDocs":{"url":"https://radar.rarefrequencyworks.com/docs"},"paths":{"/api/v1/liquidation-headroom":{"get":{"operationId":"getLiquidationHeadroom","summary":"Accrued Morpho Blue position risk on Base","description":"A request without PAYMENT-SIGNATURE returns HTTP 402 and PAYMENT-REQUIRED. An x402 v2 client signs the quoted USDC authorization and repeats the exact query. A confirmed response includes PAYMENT-RESPONSE. Query parameters are required for computation; the bare path returns discovery terms only.","parameters":[{"name":"marketId","in":"query","required":true,"schema":{"type":"string","pattern":"^0x[0-9a-fA-F]{64}$","description":"Morpho Blue market ID on Base mainnet"},"example":"0x9103c3b4e834476c9a62ea009ba2c884ee42e94e6e314a26f04d312434191836"},{"name":"borrower","in":"query","required":true,"schema":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Borrower wallet address on Base mainnet"},"example":"0x6aBB9Aeb93e9aF04c8D9FD2b84BF6ca8EDC3eAf2"}],"x-x402":{"version":2,"scheme":"exact","network":"eip155:8453","amount":"50000","asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"responses":{"200":{"description":"Paid position result with settlement receipt","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid query or payment payload"},"402":{"description":"Payment required; terms are in PAYMENT-REQUIRED","headers":{"PAYMENT-REQUIRED":{"schema":{"type":"string"},"description":"Base64 x402 v2 payment requirements"}}},"409":{"description":"Duplicate or uncertain payment; reconcile the existing authorization"},"503":{"description":"Payment service or on-chain calculation unavailable"}}}},"/api/v1/sample":{"get":{"operationId":"getFreeLiveSample","summary":"Free shared on-chain sample; no wallet or payment","description":"Fixed documented market and borrower on Base. Real accrued debt, block number, and sample refresh/expiry timestamps. Cached for up to 60 seconds, with at most one shared refresh attempt per minute. No custom query parameters. Does not test payment settlement.","responses":{"200":{"description":"Shared on-chain position result with sample cache metadata","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Query parameters are not accepted"},"503":{"description":"Refreshing or upstream unavailable; retry after the Retry-After interval. No payment requested.","headers":{"Retry-After":{"schema":{"type":"integer"}}}}}}},"/api/v1/preview":{"get":{"operationId":"getFreePreview","summary":"Free illustrative manual simulation","responses":{"200":{"description":"Illustrative data; no live position read"}}}},"/ready":{"get":{"operationId":"getReadiness","summary":"Payment configuration, database, facilitator, and Base RPC readiness","responses":{"200":{"description":"Ready; does not prove funded settlement"},"503":{"description":"Unavailable"}}}}}}