{"components":{"schemas":{"AuditItem":{"properties":{"audit_date":{"format":"date","type":["string","null"]},"auditor":{"example":"Trail of Bits","type":"string"},"finding_count_critical":{"type":"integer"},"finding_count_high":{"type":"integer"},"finding_count_low":{"type":"integer"},"finding_count_medium":{"type":"integer"},"id":{"format":"uuid","type":"string"},"report_url":{"format":"uri","type":["string","null"]}},"type":"object"},"Error":{"properties":{"error":{"type":"string"},"suggestion":{"type":"string"}},"type":"object"},"IncidentItem":{"properties":{"amount_usd":{"example":"197000000","type":["string","null"]},"attack_type":{"example":"flash-loan","type":["string","null"]},"id":{"format":"uuid","type":"string"},"occurred_at":{"format":"date-time","type":["string","null"]},"source":{"example":"rekt","type":["string","null"]},"source_url":{"format":"uri","type":["string","null"]},"summary":{"type":["string","null"]}},"type":"object"},"ProtocolRef":{"properties":{"chain":{"example":"Ethereum","type":["string","null"]},"coverage_tier":{"enum":["full","partial","metadata_only"],"type":"string"},"display_name":{"example":"Aave V3","type":"string"},"slug":{"example":"aave-v3","type":"string"},"tvl_usd":{"example":"12400000000","type":["string","null"]}},"type":"object"},"RiskFactor":{"properties":{"applied":{"type":"boolean"},"delta":{"example":-20,"type":"integer"},"name":{"example":"hack_in_6m","type":"string"}},"type":"object"},"SecuritySummary":{"properties":{"audits":{"properties":{"most_recent_audit_date":{"format":"date","type":["string","null"]},"total":{"type":"integer"}},"type":"object"},"bug_bounty":{"properties":{"active":{"type":"boolean"},"max_bounty_usd":{"type":["string","null"]}},"type":"object"},"data_freshness_utc":{"format":"date-time","type":"string"},"incidents":{"properties":{"most_recent":{"oneOf":[{"$ref":"#/components/schemas/IncidentItem"},{"type":"null"}]},"total":{"type":"integer"},"total_amount_usd":{"type":["string","null"]}},"type":"object"},"protocol":{"$ref":"#/components/schemas/ProtocolRef"},"risk_factors":{"items":{"$ref":"#/components/schemas/RiskFactor"},"type":"array"},"risk_score":{"maximum":100,"minimum":0,"type":"integer"},"staleness_warning":{"type":"boolean"}},"type":"object"}},"securitySchemes":{"x402":{"description":"x402 v2 payment signature on Base mainnet. Call the endpoint without this header to receive a 402 with a Payment-Required header (base64-encoded JSON) containing payment details, then sign with an x402 v2 client library (npm: x402, pip: x402) and retry with the Payment-Signature header. Network: eip155:8453 (Base mainnet), Asset: USDC.","in":"header","name":"Payment-Signature","type":"apiKey"}}},"info":{"contact":{"url":"https://rektwatch.dev"},"description":"Per-call DeFi security data: protocol incidents, audit reports, bug bounties, and risk scores. Paid endpoints require a micropayment in USDC on Base via the x402 protocol. Free endpoints require no wallet.","title":"RektWatch — DeFi Security Intelligence","version":"1.0.0","x-guidance":"RektWatch is a DeFi security intelligence API. IMPORTANT: Before calling any paid endpoint, fetch GET https://rektwatch.dev/protocols (free, no payment needed) to get the list of tracked protocols and their slugs — use these slugs as the {name} parameter. Also check GET https://rektwatch.dev/health (free) to verify data freshness before making paid calls. Paid endpoints cost $0.02–$0.15 USDC per call on Base mainnet — no subscription. To pay: (1) call the endpoint without a payment header, (2) receive a 402 with a Payment-Required response header containing base64-encoded x402 v2 payment details, (3) use an x402 v2 client library to sign a USDC TransferWithAuthorization and retry with the Payment-Signature header. npm: x402  pip: x402  docs: https://x402.org.","x-x402":{"asset":"USDC","challenge_header":"Payment-Required","docs":"https://x402.org","network":"eip155:8453","payment_header":"Payment-Signature","scheme":"exact","version":2}},"openapi":"3.1.0","paths":{"/alerts/recent-24h":{"get":{"description":"Returns all DeFi incidents recorded in the past 24 hours across all tracked protocols.","operationId":"getRecentAlerts","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"count":{"type":"integer"},"data_freshness_utc":{"format":"date-time","type":"string"},"incidents":{"items":{"allOf":[{"$ref":"#/components/schemas/IncidentItem"},{"properties":{"protocol_name":{"type":"string"},"protocol_slug":{"type":"string"}},"type":"object"}]},"type":"array"},"staleness_warning":{"type":"boolean"},"window_hours":{"example":24,"type":"integer"}},"type":"object"}}},"description":"Recent alerts"},"402":{"description":"Payment Required"}},"security":[{"x402":[]}],"summary":"Incidents in the last 24 hours","tags":["paid"],"x-payment-info":{"extensions":{"bazaar":{"schema":{"properties":{"input":{"properties":{"queryParams":{}}},"output":{"properties":{"example":{"count":{"type":"integer"},"incidents":{"type":"array"},"window_hours":{"type":"integer"}}}}}}}},"price":{"amount":"0.02","currency":"USD","mode":"fixed"},"protocols":[{"x402":{}}]}}},"/compare":{"get":{"description":"Returns full security summaries for two protocols in a single call. Cheaper than calling /security-summary twice ($0.10 vs $0.30).","operationId":"compareProtocols","parameters":[{"description":"First protocol slug (from /protocols)","in":"query","name":"a","required":true,"schema":{"example":"aave-v3","type":"string"}},{"description":"Second protocol slug (from /protocols)","in":"query","name":"b","required":true,"schema":{"example":"compound-v3","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"a":{"$ref":"#/components/schemas/SecuritySummary"},"b":{"$ref":"#/components/schemas/SecuritySummary"},"data_freshness_utc":{"format":"date-time","type":"string"}},"type":"object"}}},"description":"Comparison result"},"400":{"description":"Missing ?a= or ?b= parameter"},"402":{"description":"Payment Required"},"404":{"description":"One or both protocol slugs not found"}},"security":[{"x402":[]}],"summary":"Side-by-side security comparison","tags":["paid"],"x-payment-info":{"extensions":{"bazaar":{"schema":{"properties":{"input":{"properties":{"queryParams":{"a":{"type":"string"},"b":{"type":"string"}}}},"output":{"properties":{"example":{"a":{"type":"object"},"b":{"type":"object"}}}}}}}},"price":{"amount":"0.10","currency":"USD","mode":"fixed"},"protocols":[{"x402":{}}]}}},"/protocol/{name}/audits":{"get":{"description":"All audit reports on record for a protocol, with finding counts by severity (critical, high, medium, low) and a link to the full PDF where available.","operationId":"getProtocolAudits","parameters":[{"description":"Protocol slug (from /protocols) or alias","in":"path","name":"name","required":true,"schema":{"example":"compound-v3","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"audits":{"items":{"$ref":"#/components/schemas/AuditItem"},"type":"array"},"data_freshness_utc":{"format":"date-time","type":"string"},"protocol":{"type":"string"},"staleness_warning":{"type":"boolean"},"total":{"type":"integer"}},"type":"object"}}},"description":"Audit list"},"402":{"description":"Payment Required"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unknown protocol"}},"security":[{"x402":[]}],"summary":"Protocol audit reports","tags":["paid"],"x-payment-info":{"extensions":{"bazaar":{"schema":{"properties":{"input":{"properties":{"queryParams":{"name":{"type":"string"}}}},"output":{"properties":{"example":{"audits":{"type":"array"},"total":{"type":"integer"}}}}}}}},"price":{"amount":"0.10","currency":"USD","mode":"fixed"},"protocols":[{"x402":{}}]}}},"/protocol/{name}/incidents":{"get":{"description":"Paginated list of security incidents for a specific protocol: amounts lost, attack type, date, and source link.","operationId":"getProtocolIncidents","parameters":[{"description":"Protocol slug (from /protocols) or alias","in":"path","name":"name","required":true,"schema":{"example":"aave-v3","type":"string"}},{"in":"query","name":"limit","schema":{"default":50,"maximum":200,"minimum":1,"type":"integer"}},{"in":"query","name":"offset","schema":{"default":0,"minimum":0,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data_freshness_utc":{"format":"date-time","type":"string"},"incidents":{"items":{"$ref":"#/components/schemas/IncidentItem"},"type":"array"},"limit":{"type":"integer"},"offset":{"type":"integer"},"protocol":{"$ref":"#/components/schemas/ProtocolRef"},"staleness_warning":{"type":"boolean"},"total":{"type":"integer"}},"type":"object"}}},"description":"Incident list"},"402":{"description":"Payment Required"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unknown protocol"}},"security":[{"x402":[]}],"summary":"Protocol incident history","tags":["paid"],"x-payment-info":{"extensions":{"bazaar":{"schema":{"properties":{"input":{"properties":{"queryParams":{"limit":{"type":"integer"},"name":{"type":"string"},"offset":{"type":"integer"}}}},"output":{"properties":{"example":{"incidents":{"type":"array"},"total":{"type":"integer"}}}}}}}},"price":{"amount":"0.05","currency":"USD","mode":"fixed"},"protocols":[{"x402":{}}]}}},"/protocol/{name}/risk-score":{"get":{"description":"0–100 composite risk score with per-factor breakdown. Higher is safer. Factors include recent hacks, unresolved audit findings, bug bounty presence, and tier-1 audit recency.","operationId":"getProtocolRiskScore","parameters":[{"description":"Protocol slug (from /protocols) or alias","in":"path","name":"name","required":true,"schema":{"example":"uniswap-v3","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data_freshness_utc":{"format":"date-time","type":"string"},"factors":{"items":{"$ref":"#/components/schemas/RiskFactor"},"type":"array"},"protocol":{"type":"string"},"score":{"maximum":100,"minimum":0,"type":"integer"},"staleness_warning":{"type":"boolean"}},"type":"object"}}},"description":"Risk score"},"402":{"description":"Payment Required"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unknown protocol"}},"security":[{"x402":[]}],"summary":"Protocol risk score","tags":["paid"],"x-payment-info":{"extensions":{"bazaar":{"schema":{"properties":{"input":{"properties":{"queryParams":{"name":{"type":"string"}}}},"output":{"properties":{"example":{"factors":{"type":"array"},"protocol":{"type":"string"},"score":{"type":"integer"}}}}}}}},"price":{"amount":"0.10","currency":"USD","mode":"fixed"},"protocols":[{"x402":{}}]}}},"/protocol/{name}/security-summary":{"get":{"description":"Everything in one call: risk score with factors, incident history summary, audit summary, and bug bounty status. Priced below the $0.25 cost of the individual endpoints.","operationId":"getProtocolSecuritySummary","parameters":[{"description":"Protocol slug (from /protocols) or alias","in":"path","name":"name","required":true,"schema":{"example":"lido","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SecuritySummary"}}},"description":"Security summary"},"402":{"description":"Payment Required"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unknown protocol"}},"security":[{"x402":[]}],"summary":"Full security summary (risk score + incidents + audits + bounty)","tags":["paid"],"x-payment-info":{"extensions":{"bazaar":{"schema":{"properties":{"input":{"properties":{"queryParams":{"name":{"type":"string"}}}},"output":{"properties":{"example":{"protocol":{"type":"string"},"risk_score":{"type":"integer"}}}}}}}},"price":{"amount":"0.15","currency":"USD","mode":"fixed"},"protocols":[{"x402":{}}]}}}},"security":[],"servers":[{"description":"Production","url":"https://rektwatch.dev"}]}