{"openapi":"3.1.0","info":{"title":"Philidor API","version":"1.1.0","description":"Public API for DeFi vault risk analytics"},"servers":[{"url":"https://api.philidor.io","description":"Production"},{"url":"http://localhost:3003","description":"Local"}],"components":{"schemas":{"EventListItem":{"type":"object","properties":{"id":{"type":"string"},"event_type":{"type":"string"},"severity":{"type":"string"},"title":{"type":"string"},"description":{"type":"string","nullable":true},"occurred_at":{"type":"string"},"protocol_id":{"type":"string","nullable":true},"protocol_name":{"type":"string","nullable":true},"chain_id":{"type":"number","nullable":true},"chain_name":{"type":"string","nullable":true},"curator_id":{"type":"string","nullable":true},"curator_name":{"type":"string","nullable":true},"incident_severity":{"type":"string","nullable":true},"loss_amount_usd":{"type":"number","nullable":true},"remediation_status":{"type":"string","nullable":true},"affected_asset":{"type":"string","nullable":true},"links":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"url":{"type":"string"}},"required":["label","url"]}},"provisional":{"type":"boolean"},"confirmations_required":{"type":"number","nullable":true},"retracted_at":{"type":"string","nullable":true},"source":{"type":"string","nullable":true},"tx_hash":{"type":"string","nullable":true},"block_number":{"type":"number","nullable":true}},"required":["id","event_type","severity","title","description","occurred_at","protocol_id","protocol_name","chain_id","chain_name","curator_id","curator_name","incident_severity","loss_amount_usd","remediation_status","affected_asset","links"]},"EventDetail":{"type":"object","properties":{"id":{"type":"string"},"event_type":{"type":"string"},"severity":{"type":"string"},"title":{"type":"string"},"description":{"type":"string","nullable":true},"occurred_at":{"type":"string"},"detected_at":{"type":"string","nullable":true},"protocol_id":{"type":"string","nullable":true},"protocol_name":{"type":"string","nullable":true},"protocol_logo":{"type":"string","nullable":true},"chain_id":{"type":"number","nullable":true},"chain_name":{"type":"string","nullable":true},"curator_id":{"type":"string","nullable":true},"curator_name":{"type":"string","nullable":true},"incident_scope":{"type":"string","nullable":true},"incident_severity":{"type":"string","nullable":true},"loss_amount_usd":{"type":"number","nullable":true},"remediation_status":{"type":"string","nullable":true},"user_compensation":{"type":"string","nullable":true},"post_mortem_url":{"type":"string","nullable":true},"affected_asset":{"type":"string","nullable":true},"tx_hash":{"type":"string","nullable":true},"block_number":{"type":"number","nullable":true},"links":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"url":{"type":"string"}},"required":["label","url"]}},"affected_vaults":{"type":"array","items":{"type":"object","properties":{"vault_id":{"type":"string"},"vault_name":{"type":"string"},"tvl_usd":{"type":"number"},"chain_id":{"type":"number","nullable":true},"address":{"type":"string","nullable":true}},"required":["vault_id","vault_name","tvl_usd","chain_id","address"]}}},"required":["id","event_type","severity","title","description","occurred_at","detected_at","protocol_id","protocol_name","protocol_logo","chain_id","chain_name","curator_id","curator_name","incident_scope","incident_severity","loss_amount_usd","remediation_status","user_compensation","post_mortem_url","affected_asset","tx_hash","block_number","links","affected_vaults"]},"Vault":{"type":"object","properties":{"id":{"type":"string"},"address":{"type":"string"},"protocol_id":{"type":"string"},"chain_id":{"type":"number"},"curator_id":{"type":"string","nullable":true},"name":{"type":"string"},"symbol":{"type":"string","nullable":true},"external_id":{"type":"string","nullable":true},"asset_address":{"type":"string","nullable":true},"asset_symbol":{"type":"string","nullable":true},"tvl_usd":{"type":"number"},"apr_net":{"type":"number","nullable":true},"apr_forward":{"type":"number","nullable":true},"total_score":{"type":"number","nullable":true},"risk_tier":{"type":"string","nullable":true,"enum":["Prime","Core","Edge"],"description":"Published tier (hysteresis-stabilized). May briefly differ from a naive derivation from risk_score while a boundary move is dwelling."},"risk_vectors":{"type":"object","nullable":true,"properties":{"asset":{"type":"object","properties":{"score":{"type":"number"},"weight":{"type":"number"},"details":{"nullable":true},"exposures":{"type":"array","items":{"type":"object","properties":{"address":{"type":"string"},"chainId":{"type":"number"},"category":{"type":"string","enum":["native","fiat_backed_stablecoin","cdp_stablecoin","synthetic_stablecoin","lst","lrt","wrapped_btc","governance_token","unreviewed"]},"reviewStatus":{"type":"string","enum":["reviewed","provisional","unreviewed"]},"score":{"type":"number"},"weight":{"type":"number"},"suitability":{"type":"string","enum":["institutional","qualified","speculative","not_assessed"]},"capsApplied":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["overlay","review_status","hard_fail","override","staleness","drag","fail_safe"]},"cap":{"type":"number"},"reason":{"type":"string"},"binding":{"type":"boolean"}},"required":["type","cap","reason","binding"]}},"symbol":{"type":"string"},"overlays":{"type":"array","items":{"type":"string","enum":["yield_bearing","lockup"]}},"weightedScore":{"type":"number"},"dimensionScores":{"type":"array","items":{"type":"object","properties":{"dimension":{"type":"string","enum":["peg_stability","issuer_custody","redeemability","reserve_transparency","governance_controls","protocol_security","operator_quality","bridge_mechanism","dependency_depth","liquidity","volatility"]},"value":{"type":"number"},"effectiveValue":{"type":"number"},"source":{"type":"string"},"sourceDisplay":{"type":"string"},"observedAt":{"type":"string"},"freshUntil":{"type":"string"},"isStale":{"type":"boolean"},"isExpired":{"type":"boolean"},"confidence":{"type":"string","enum":["high","medium","low"]}},"required":["dimension","value","effectiveValue","source","observedAt","freshUntil","isStale","isExpired","confidence"]}},"hardFailFlags":{"type":"array","items":{"type":"object","properties":{"flag":{"type":"string","enum":["active_depeg","sanctions_exposure","redemption_paused","single_signer_upgrade","endogenous_collateral_high","proof_of_reserve_missing","no_recent_attestation","unaudited_token_contract"]},"scoreCap":{"type":"number"},"triggerSource":{"type":"string"},"inCooldown":{"type":"boolean"}},"required":["flag","scoreCap","triggerSource","inCooldown"]}},"activeOverrides":{"type":"array","items":{"type":"object","properties":{"scoreCap":{"type":"number"},"reasonCode":{"type":"string"},"reasonDetail":{"type":"string"},"expiresAt":{"type":"string","nullable":true},"autoApproved":{"type":"boolean"},"humanConfirmed":{"type":"boolean"}},"required":["scoreCap","reasonCode","expiresAt"]}},"upgradeConditions":{"type":"array","items":{"type":"string"}}},"required":["address","chainId","category","reviewStatus","score"]}},"failSafeMode":{"type":"string","enum":["normal","degraded","fail_closed"]}},"required":["score","weight"]},"platform":{"type":"object","properties":{"score":{"type":"number"},"weight":{"type":"number"},"details":{"nullable":true}},"required":["score","weight"]},"control":{"type":"object","properties":{"score":{"type":"number"},"weight":{"type":"number"},"details":{"nullable":true}},"required":["score","weight"]},"provenance":{"type":"object","properties":{"methodologyVersion":{"type":"number"},"scoreRunId":{"type":"string","nullable":true},"computedAt":{"type":"string"},"failSafeMode":{"type":"string","enum":["normal","degraded","fail_closed"]}},"required":["methodologyVersion","scoreRunId","computedAt","failSafeMode"]}}},"is_active":{"type":"boolean"},"is_shutdown":{"type":"boolean"},"is_depositable":{"type":"boolean","nullable":true,"description":"True when the vault accepts new deposits over a small dust threshold, sourced from ERC-4626 maxDeposit. Null when not yet indexed or unknown. Prefer `deposit_status` for client logic — it surfaces the tri-state explicitly."},"deposit_capacity_usd":{"type":"number","nullable":true,"description":"USD-denominated deposit headroom (capacity remaining before hitting the cap). Null when uncapped, when the vault has no TVL reference for pricing, or when not yet indexed."},"deposit_status":{"type":"string","enum":["open","closed","unknown"],"description":"Explicit tri-state derived from is_depositable. `open` = accepts new deposits over a $100 dust threshold. `closed` = on-chain maxDeposit == 0 (caps reached, paused, gates blocking, or queue saturated). `unknown` = depositability not yet read on chain (typically non-ERC4626 protocols or a vault added since the last sync). Clients routing capital should treat `closed` as a hard exclude; `unknown` as \"check independently if precision matters.\""},"withdraw_status":{"type":"string","enum":["open","closed","unknown"],"description":"Coarse withdrawal-side mirror of deposit_status. `closed` when the vault is in shutdown; `open` when operationally live and we have a confirmed deposit-side reading this cycle; `unknown` when we have no recent on-chain probe. This is intentionally a conservative operational signal — withdrawal-specific pause/gate detection (per-protocol) is on the roadmap. For now: trust `open`, escalate on `closed`, treat `unknown` like deposit-side unknown."},"freshness_seconds":{"type":"integer","nullable":true,"description":"Seconds since the most recent successful sync wrote this row. Use this to enforce a client-side freshness SLA before routing capital — e.g. reject any vault whose freshness_seconds exceeds your tolerance. Null when the vault has never been synced (extremely rare; only seen for legacy rows pre-dating the sync timestamp column)."},"needs_risk_review":{"type":"boolean"},"last_synced_at":{"type":"string"},"created_at":{"type":"string"},"is_stablecoin":{"type":"boolean"},"is_lsd":{"type":"boolean"},"is_single_exposure":{"type":"boolean"},"has_impermanent_loss":{"type":"boolean"},"is_audited":{"type":"boolean"},"is_high_confidence":{"type":"boolean"},"strategy_type":{"type":"string","nullable":true,"enum":["lending","savings","staking","isolated_lending","liquidity_provision","multi_market","auto_compound","yield_aggregation","points_farming","restaking","fixed_rate","leveraged_lending","delta_neutral","options_derivatives"]},"base_apr":{"type":"number","nullable":true},"protocol_name":{"type":"string"},"protocol_logo":{"type":"string","nullable":true},"curator_name":{"type":"string","nullable":true},"curator_logo":{"type":"string","nullable":true},"chain_name":{"type":"string"},"chain_logo":{"type":"string","nullable":true}},"required":["id","address","protocol_id","chain_id","curator_id","name","symbol","external_id","asset_address","asset_symbol","tvl_usd","apr_net","apr_forward","total_score","risk_tier","risk_vectors","is_active","is_shutdown","is_depositable","deposit_capacity_usd","deposit_status","withdraw_status","freshness_seconds","needs_risk_review","last_synced_at","created_at","is_stablecoin","is_lsd","is_single_exposure","has_impermanent_loss","is_audited","is_high_confidence","strategy_type","base_apr","protocol_name","protocol_logo","curator_name","curator_logo","chain_name","chain_logo"]},"VaultListResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Vault"}},"meta":{"type":"object","properties":{"page":{"type":"number"},"limit":{"type":"number"},"total":{"type":"number"},"totalPages":{"type":"number"}},"required":["page","limit","total","totalPages"]}},"required":["data","meta"]},"VaultBatchResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Vault"}}},"required":["data"]},"VaultBatchBody":{"type":"object","properties":{"ids":{"type":"array","items":{"type":"string"},"maxItems":100,"description":"Array of vault IDs (max 100)","example":["morpho-ethereum-0x..."]},"addresses":{"type":"array","items":{"type":"string"},"maxItems":100,"description":"Array of vault contract addresses (max 100)","example":["0x..."]}}},"VaultScore":{"type":"object","properties":{"id":{"type":"string"},"address":{"type":"string"},"chain_id":{"type":"number"},"chain_name":{"type":"string"},"protocol_id":{"type":"string"},"asset_symbol":{"type":"string","nullable":true},"tvl_usd":{"type":"number"},"apr_net":{"type":"number","nullable":true},"total_score":{"type":"number","nullable":true},"risk_tier":{"type":"string","nullable":true,"enum":["Prime","Core","Edge"],"description":"Published tier (hysteresis-stabilized). May briefly differ from a naive derivation from risk_score while a boundary move is dwelling."},"is_active":{"type":"boolean"},"last_synced_at":{"type":"string"}},"required":["id","address","chain_id","chain_name","protocol_id","asset_symbol","tvl_usd","apr_net","total_score","risk_tier","is_active","last_synced_at"]},"VaultScoresResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/VaultScore"}},"meta":{"type":"object","properties":{"page":{"type":"number"},"limit":{"type":"number"},"total":{"type":"number"},"totalPages":{"type":"number"}},"required":["page","limit","total","totalPages"]}},"required":["data","meta"]},"VaultChangesResponse":{"type":"object","properties":{"data":{"type":"object","properties":{"vaults":{"type":"array","items":{"$ref":"#/components/schemas/VaultScore"}},"cursor":{"type":"string","description":"Stable cursor — use as \"since\" in your next request"}},"required":["vaults","cursor"]},"meta":{"type":"object","properties":{"total":{"type":"number","description":"Total vaults changed since the given timestamp"}},"required":["total"]}},"required":["data","meta"]},"VaultDetail":{"allOf":[{"$ref":"#/components/schemas/Vault"},{"type":"object","properties":{"protocol_version":{"type":"string","nullable":true},"protocol_website":{"type":"string","nullable":true},"protocol_created_at":{"type":"string","nullable":true},"curator_one_liner":{"type":"string","nullable":true},"is_source_verified":{"type":"boolean","nullable":true},"deployment_timestamp":{"type":"string","nullable":true},"risk_score":{"type":"number","nullable":true},"audit_status":{"type":"string","nullable":true,"enum":["Audited","Partial","Pending","Unaudited"]},"auditors":{"type":"array","nullable":true,"items":{"type":"string"}},"audit_date":{"type":"string","nullable":true},"audit_report_url":{"type":"string","nullable":true},"is_immutable":{"type":"boolean","nullable":true},"timelock_seconds":{"type":"number","nullable":true},"protocol_launch_date":{"type":"string","nullable":true},"protocol_auditors":{"type":"array","nullable":true,"items":{"type":"string"}},"protocol_security_page_url":{"type":"string","nullable":true},"protocol_bug_bounty_url":{"type":"string","nullable":true},"version_display_name":{"type":"string","nullable":true},"version_launch_date":{"type":"string","nullable":true},"version_auditors":{"type":"array","nullable":true,"items":{"type":"string"}},"version_audit_report_url":{"type":"string","nullable":true},"version_security_page_url":{"type":"string","nullable":true}},"required":["protocol_version","protocol_website","protocol_created_at","curator_one_liner","is_source_verified","deployment_timestamp","risk_score","audit_status","auditors","audit_date","audit_report_url","is_immutable","timelock_seconds","protocol_launch_date","protocol_auditors","protocol_security_page_url","protocol_bug_bounty_url","version_display_name","version_launch_date","version_auditors","version_audit_report_url","version_security_page_url"]}]},"Snapshot":{"type":"object","properties":{"recorded_at":{"type":"string"},"tvl_usd":{"type":"number"},"apr_net":{"type":"number","nullable":true},"price_per_share":{"type":"number","nullable":true}},"required":["recorded_at","tvl_usd","apr_net","price_per_share"]},"Event":{"type":"object","properties":{"id":{"type":"number"},"vault_id":{"type":"string","nullable":true},"curator_id":{"type":"string","nullable":true},"protocol_id":{"type":"string","nullable":true},"protocol_version":{"type":"string","nullable":true},"chain_id":{"type":"number","nullable":true},"event_type":{"type":"string","enum":["Incident","ParameterChange","Pause","Deprecation","AllocationChange","DepositabilityChange"]},"severity":{"type":"string","enum":["Info","Warning","Critical"]},"title":{"type":"string"},"description":{"type":"string","nullable":true},"tx_hash":{"type":"string","nullable":true},"block_number":{"type":"number","nullable":true},"links":{"nullable":true},"occurred_at":{"type":"string"},"created_at":{"type":"string"},"incident_scope":{"type":"string","nullable":true,"enum":["vault","protocol","curator"]},"incident_severity":{"type":"string","nullable":true,"enum":["minor","major"]},"loss_amount_usd":{"type":"number","nullable":true},"remediation_status":{"type":"string","nullable":true,"enum":["resolved","unresolved"]},"user_compensation":{"type":"string","nullable":true,"enum":["full","partial","none"]},"post_mortem_url":{"type":"string","nullable":true}},"required":["id","vault_id","curator_id","protocol_id","protocol_version","chain_id","event_type","severity","title","description","tx_hash","block_number","occurred_at","created_at","incident_scope","incident_severity","loss_amount_usd","remediation_status","user_compensation","post_mortem_url"]},"Reward":{"type":"object","properties":{"token_symbol":{"type":"string","nullable":true},"token_address":{"type":"string","nullable":true},"apr":{"type":"number","nullable":true},"reward_type":{"type":"string","nullable":true,"enum":["token_incentive","points","trading_fee","strategy"]}},"required":["token_symbol","token_address","apr","reward_type"]},"VaultDetailResponse":{"type":"object","properties":{"data":{"type":"object","properties":{"vault":{"$ref":"#/components/schemas/VaultDetail"},"snapshots":{"type":"array","items":{"$ref":"#/components/schemas/Snapshot"}},"events":{"type":"array","items":{"$ref":"#/components/schemas/Event"}},"rewards":{"type":"array","items":{"$ref":"#/components/schemas/Reward"}}},"required":["vault","snapshots","events","rewards"]}},"required":["data"]},"Protocol":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"logo_url":{"type":"string","nullable":true},"vault_count":{"type":"number"},"tvl":{"type":"number"}},"required":["id","name","logo_url","vault_count","tvl"]},"ProtocolListResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Protocol"}}},"required":["data"]},"ProtocolDetail":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"logo_url":{"type":"string","nullable":true},"website_url":{"type":"string","nullable":true},"created_at":{"type":"string"},"mainnet_launch_date":{"type":"string","nullable":true},"total_audit_count":{"type":"number","nullable":true},"primary_auditors":{"type":"array","nullable":true,"items":{"type":"string"}},"security_contact":{"type":"string","nullable":true},"bug_bounty_url":{"type":"string","nullable":true},"security_page_url":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"tvl_total":{"type":"number"},"vault_count":{"type":"number"}},"required":["id","name","logo_url","website_url","created_at","mainnet_launch_date","total_audit_count","primary_auditors","security_contact","bug_bounty_url","security_page_url","description","tvl_total","vault_count"]},"ProtocolVersion":{"type":"object","properties":{"version":{"type":"string"},"display_name":{"type":"string","nullable":true},"launch_date":{"type":"string","nullable":true},"auditors":{"type":"array","nullable":true,"items":{"type":"string"}},"audit_report_url":{"type":"string","nullable":true},"security_page_url":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"vault_count":{"type":"number"},"tvl":{"type":"number"}},"required":["version","display_name","launch_date","auditors","audit_report_url","security_page_url","description","vault_count","tvl"]},"ProtocolDetailResponse":{"type":"object","properties":{"data":{"type":"object","properties":{"protocol":{"$ref":"#/components/schemas/ProtocolDetail"},"vaults":{"type":"array","items":{"nullable":true}},"versions":{"type":"array","items":{"$ref":"#/components/schemas/ProtocolVersion"}},"incidents":{"type":"array","items":{"nullable":true}}},"required":["protocol","vaults","versions","incidents"]}},"required":["data"]},"Curator":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"logo_url":{"type":"string","nullable":true},"website":{"type":"string","nullable":true},"one_liner":{"type":"string","nullable":true},"created_at":{"type":"string"},"tvl_total":{"type":"number"},"vault_count":{"type":"number"},"avg_apr":{"type":"number","nullable":true}},"required":["id","name","logo_url","website","one_liner","created_at","tvl_total","vault_count","avg_apr"]},"CuratorListResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Curator"}},"meta":{"type":"object","properties":{"page":{"type":"number"},"limit":{"type":"number"},"total":{"type":"number"},"totalPages":{"type":"number"}},"required":["page","limit","total","totalPages"]}},"required":["data","meta"]},"CuratorDetailResponse":{"type":"object","properties":{"data":{"type":"object","properties":{"curator":{"$ref":"#/components/schemas/Curator"},"vaults":{"type":"array","items":{"nullable":true}},"chainDistribution":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"vault_count":{"type":"number"},"tvl":{"type":"number"}},"required":["id","name","vault_count","tvl"]}},"events":{"type":"array","items":{"nullable":true}},"eventsTotal":{"type":"number"}},"required":["curator","vaults","chainDistribution","events","eventsTotal"]}},"required":["data"]},"ChainListResponse":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"logo_url":{"type":"string","nullable":true},"vault_count":{"type":"number"},"tvl":{"type":"number"}},"required":["id","name","logo_url","vault_count","tvl"]}}},"required":["data"]},"AssetListResponse":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"asset_symbol":{"type":"string"},"vault_count":{"type":"number"}},"required":["asset_symbol","vault_count"]}}},"required":["data"]},"StatsResponse":{"type":"object","properties":{"data":{"type":"object","properties":{"totalVaults":{"type":"number"},"totalTvl":{"type":"number"},"avgApr":{"type":"number","nullable":true},"curatorCount":{"type":"number"},"protocolCount":{"type":"number"},"chainCount":{"type":"number"},"riskDistribution":{"type":"array","items":{"type":"object","properties":{"risk_tier":{"type":"string","enum":["Prime","Core","Edge"],"description":"Published tier (hysteresis-stabilized). May briefly differ from a naive derivation from risk_score while a boundary move is dwelling."},"count":{"type":"number"},"tvl":{"type":"number"}},"required":["risk_tier","count","tvl"]}},"tvlByProtocol":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"logo_url":{"type":"string","nullable":true},"vault_count":{"type":"number"},"tvl":{"type":"number"}},"required":["id","name","logo_url","vault_count","tvl"]}},"tvlByChain":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"logo_url":{"type":"string","nullable":true},"vault_count":{"type":"number"},"tvl":{"type":"number"}},"required":["id","name","logo_url","vault_count","tvl"]}},"lastSync":{"type":"string","nullable":true}},"required":["totalVaults","totalTvl","avgApr","curatorCount","protocolCount","chainCount","riskDistribution","tvlByProtocol","tvlByChain","lastSync"]}},"required":["data"]},"HealthResponse":{"type":"object","properties":{"data":{"type":"object","properties":{"status":{"type":"string"},"version":{"type":"string"},"vaultCount":{"type":"number"},"lastSync":{"type":"string","nullable":true},"timestamp":{"type":"string"},"lastScoreRun":{"type":"object","nullable":true,"properties":{"completedAt":{"type":"string","nullable":true},"failSafeMode":{"type":"string","nullable":true}},"required":["completedAt","failSafeMode"]},"assetRegistryCoverage":{"type":"object","nullable":true,"properties":{"totalExposures":{"type":"number"},"withAssetVersion":{"type":"number"},"coveragePercent":{"type":"number"}},"required":["totalExposures","withAssetVersion","coveragePercent"]},"assetRegistryQueueBacklog":{"type":"number","nullable":true}},"required":["status","version","vaultCount","lastSync","timestamp","lastScoreRun","assetRegistryCoverage","assetRegistryQueueBacklog"]}},"required":["data"]},"OracleFreshnessResponse":{"type":"object","properties":{"meta":{"type":"object","properties":{"timestamp":{"type":"number"},"cacheAgeSeconds":{"type":"number"},"nextRefreshIn":{"type":"number"}},"required":["timestamp","cacheAgeSeconds","nextRefreshIn"]},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"asset":{"type":"string"},"network":{"type":"string"},"architecture":{"type":"object","properties":{"type":{"type":"string"},"provider":{"type":"string"}},"required":["type","provider"]},"metrics":{"type":"object","properties":{"baselinePrice":{"type":"number","nullable":true},"onChainPrice":{"type":"number","nullable":true},"offChainPrice":{"type":"number","nullable":true},"timeDelaySeconds":{"type":"number","nullable":true},"deviationPercentage":{"type":"number","nullable":true}},"required":["baselinePrice","onChainPrice","offChainPrice","timeDelaySeconds","deviationPercentage"]},"config":{"type":"object","properties":{"heartbeatHours":{"type":"number"},"deviationThresholdPercent":{"type":"number"}},"required":["heartbeatHours","deviationThresholdPercent"]},"error":{"type":"string"}},"required":["id","asset","network","architecture","metrics","config"]}}},"required":["meta","data"]},"GraphLookThroughResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"snapshotId":{"type":"string"},"builtAt":{"type":"string"},"validTime":{"type":"string"},"results":{"type":"object","additionalProperties":{"type":"object","nullable":true,"properties":{"vaultKey":{"type":"string"},"curator":{"type":"string","nullable":true},"protocol":{"type":"string","nullable":true},"chain":{"type":"string","nullable":true},"assets":{"type":"array","items":{"type":"object","properties":{"assetKey":{"type":"string"},"symbol":{"type":"string","nullable":true},"usdExposure":{"type":"string"},"wrappers":{"type":"array","items":{"type":"object","properties":{"assetKey":{"type":"string"},"symbol":{"type":"string","nullable":true}},"required":["assetKey","symbol"]}},"oracles":{"type":"array","items":{"type":"string"}}},"required":["assetKey","symbol","usdExposure","wrappers","oracles"]}},"cycles":{"type":"array","items":{"type":"array","items":{"type":"string"}}}},"required":["vaultKey","curator","protocol","chain","assets","cycles"]}}},"required":["snapshotId","builtAt","validTime","results"]}},"required":["success","data"]},"GraphDecisionVerifyResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"found":{"type":"boolean"},"envelopeIntact":{"type":"boolean"},"signatureValid":{"type":"boolean"},"signerRecognized":{"type":"boolean"},"signerActiveAtIssuance":{"type":"boolean"},"decision":{"type":"object","properties":{"id":{"type":"string"},"portfolioRef":{"type":"string"},"snapshotId":{"type":"string"},"verdict":{"type":"string"},"methodologyScope":{"type":"string"},"methodologyVersion":{"type":"string"},"signerAddress":{"type":"string"},"keyId":{"type":"string"},"createdAt":{"type":"string"}},"required":["id","portfolioRef","snapshotId","verdict","methodologyScope","methodologyVersion","signerAddress","keyId","createdAt"]}},"required":["found","envelopeIntact","signatureValid","signerRecognized","signerActiveAtIssuance"]}},"required":["success","data"]},"GraphCheckResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"snapshotId":{"type":"string"},"builtAt":{"type":"string"},"verdict":{"type":"string","enum":["approve","caution","reject"]},"totalUsd":{"type":"string"},"unresolvedVaults":{"type":"array","items":{"type":"string"}},"findings":{"type":"array","items":{"type":"object","properties":{"dimension":{"type":"string"},"entityId":{"type":"string"},"share":{"type":"string"},"limit":{"type":"string"},"severity":{"type":"string","enum":["breach","near"]}},"required":["dimension","entityId","share","limit","severity"]}},"exposures":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"type":"string"}}},"decision":{"type":"object","properties":{"decisionId":{"type":"string"},"signerAddress":{"type":"string"},"inserted":{"type":"boolean"}},"required":["decisionId","signerAddress","inserted"]}},"required":["snapshotId","builtAt","verdict","totalUsd","unresolvedVaults","findings","exposures"]}},"required":["success","data"]},"GraphCheckRequest":{"type":"object","properties":{"portfolioRef":{"type":"string","minLength":1,"maxLength":200},"positions":{"type":"array","items":{"type":"object","properties":{"vaultKey":{"type":"string","pattern":"^\\d+:0x[0-9a-f]{40}$"},"amountUsd":{"type":"number","minimum":0,"exclusiveMinimum":true}},"required":["vaultKey","amountUsd"]},"minItems":1,"maxItems":100},"limits":{"type":"object","properties":{"maxSharePerCurator":{"type":"number","minimum":0,"exclusiveMinimum":true,"maximum":1},"maxSharePerProtocol":{"type":"number","minimum":0,"exclusiveMinimum":true,"maximum":1},"maxSharePerChain":{"type":"number","minimum":0,"exclusiveMinimum":true,"maximum":1},"maxSharePerAsset":{"type":"number","minimum":0,"exclusiveMinimum":true,"maximum":1},"maxSharePerOracle":{"type":"number","minimum":0,"exclusiveMinimum":true,"maximum":1}},"default":{}},"issue":{"type":"boolean","default":false}},"required":["portfolioRef","positions"]},"GraphBreachResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"observedAt":{"type":"string"},"protocolId":{"type":"string"},"maturity":{"type":"string","enum":["preview"]},"paramsAsOf":{"type":"string"},"shockPcts":{"type":"array","items":{"type":"number"}},"chains":{"type":"array","items":{"type":"object","properties":{"chainId":{"type":"number"},"marketsCovered":{"type":"number"},"totalBorrowUsd":{"type":"string"},"underwaterDebtUsd":{"type":"string"},"positionsTotal":{"type":"number"},"positionsFetched":{"type":"number"},"shocks":{"type":"array","items":{"type":"object","properties":{"shockPct":{"type":"number"},"liquidatableLoUsd":{"type":"string"},"liquidatableHiUsd":{"type":"string"}},"required":["shockPct","liquidatableLoUsd","liquidatableHiUsd"]}}},"required":["chainId","marketsCovered","totalBorrowUsd","underwaterDebtUsd","shocks"]}},"topMarkets":{"type":"array","items":{"type":"object","properties":{"marketKey":{"type":"string"},"chainId":{"type":"number"},"lltv":{"type":"string"},"totalBorrowUsd":{"type":"string"},"totalCollateralUsd":{"type":"string"},"positionCount":{"type":"number"},"coverage":{"type":"string","enum":["full","truncated"]},"shocks":{"type":"array","items":{"type":"object","properties":{"shockPct":{"type":"number"},"liquidatableLoUsd":{"type":"string"},"liquidatableHiUsd":{"type":"string"}},"required":["shockPct","liquidatableLoUsd","liquidatableHiUsd"]}}},"required":["marketKey","chainId","lltv","totalBorrowUsd","totalCollateralUsd","positionCount","coverage","shocks"]}},"topVaultExposures":{"type":"array","items":{"type":"object","properties":{"vaultId":{"type":"string"},"vaultName":{"type":"string"},"chainId":{"type":"number"},"marketKey":{"type":"string"},"vaultSupplyUsd":{"type":"string"},"marketUnderwaterUsd":{"type":"string"},"marketTotalBorrowUsd":{"type":"string"}},"required":["vaultId","vaultName","chainId","marketKey","vaultSupplyUsd","marketUnderwaterUsd","marketTotalBorrowUsd"]},"description":"Vaults supplying markets that carry underwater (HF<1) debt. vaultSupplyUsd is an exposure CEILING to that bad debt, not a loss estimate."}},"required":["observedAt","protocolId","maturity","shockPcts","chains","topMarkets"]}},"required":["success","data"]},"RiskDistribution":{"type":"object","properties":{"tier":{"type":"string","enum":["Prime","Core","Edge","Unrated"]},"count":{"type":"number"},"value_usd":{"type":"number"},"percent":{"type":"number"}},"required":["tier","count","value_usd","percent"]},"PortfolioAggregates":{"type":"object","properties":{"total_value_usd":{"type":"number"},"weighted_risk_score":{"type":"number","nullable":true},"weighted_risk_tier":{"type":"string","enum":["Prime","Core","Edge","Unrated"]},"weighted_apr":{"type":"number","nullable":true},"position_count":{"type":"number"},"chain_count":{"type":"number"},"risk_distribution":{"type":"array","items":{"$ref":"#/components/schemas/RiskDistribution"}}},"required":["total_value_usd","weighted_risk_score","weighted_risk_tier","weighted_apr","position_count","chain_count","risk_distribution"]},"Position":{"type":"object","properties":{"vault_id":{"type":"string"},"vault_address":{"type":"string"},"vault_name":{"type":"string"},"chain_id":{"type":"number"},"chain_name":{"type":"string"},"protocol_id":{"type":"string"},"protocol_name":{"type":"string"},"protocol_logo":{"type":"string","nullable":true},"curator_name":{"type":"string","nullable":true},"asset_symbol":{"type":"string","nullable":true},"balance_raw":{"type":"string"},"balance_usd":{"type":"number"},"share_of_vault":{"type":"number"},"tvl_usd":{"type":"number"},"apr_net":{"type":"number","nullable":true},"base_apr":{"type":"number","nullable":true},"risk_score":{"type":"number","nullable":true},"risk_tier":{"type":"string","enum":["Prime","Core","Edge","Unrated"]},"is_shutdown":{"type":"boolean"},"kind":{"type":"string","enum":["vault","idle"]},"token_address":{"type":"string","nullable":true},"token_symbol":{"type":"string","nullable":true},"price_usd":{"type":"number","nullable":true},"price_source":{"type":"string","nullable":true}},"required":["vault_id","vault_address","vault_name","chain_id","chain_name","protocol_id","protocol_name","protocol_logo","curator_name","asset_symbol","balance_raw","balance_usd","share_of_vault","tvl_usd","apr_net","base_apr","risk_score","risk_tier","is_shutdown"]},"ChainResult":{"type":"object","properties":{"chain_id":{"type":"number"},"chain_name":{"type":"string"},"status":{"type":"string","enum":["success","error","timeout","partial"]},"vault_count":{"type":"number"},"error_message":{"type":"string","nullable":true}},"required":["chain_id","chain_name","status","vault_count","error_message"]},"AddressPositionsResponse":{"type":"object","properties":{"data":{"type":"object","properties":{"aggregates":{"$ref":"#/components/schemas/PortfolioAggregates"},"positions":{"type":"array","items":{"$ref":"#/components/schemas/Position"}},"chain_results":{"type":"array","items":{"$ref":"#/components/schemas/ChainResult"}}},"required":["aggregates","positions","chain_results"]}},"required":["data"]},"UserChatUsage":{"type":"object","properties":{"promptTokenCount":{"type":"integer","nullable":true,"minimum":0},"candidatesTokenCount":{"type":"integer","nullable":true,"minimum":0},"totalTokenCount":{"type":"integer","nullable":true,"minimum":0}},"required":["promptTokenCount","candidatesTokenCount","totalTokenCount"]},"BasketReviewer":{"type":"object","nullable":true,"properties":{"slug":{"type":"string"},"name":{"type":"string","nullable":true},"role":{"type":"string","nullable":true},"attested_at":{"type":"string","nullable":true}},"required":["slug","name","role","attested_at"]},"RwaIssuer":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"jurisdiction":{"type":"string","nullable":true},"type":{"type":"string","nullable":true},"website_url":{"type":"string","nullable":true,"format":"uri"}},"required":["id","name"]},"RwaReviewer":{"type":"object","nullable":true,"properties":{"slug":{"type":"string"},"name":{"type":"string"},"role":{"type":"string","nullable":true},"attested_at":{"type":"string"}},"required":["slug","name","role","attested_at"]},"RwaFreshness":{"type":"object","properties":{"last_refresh_at":{"type":"string","nullable":true},"age_hours":{"type":"number","nullable":true},"status":{"type":"string","enum":["fresh","stale","degraded","unknown"]},"last_status":{"type":"string","nullable":true,"enum":["updated","no_change","fetch_error","parse_error"]}},"required":["last_refresh_at","age_hours","status","last_status"]},"RwaItem":{"type":"object","properties":{"asset_id":{"type":"string"},"asset_version_id":{"type":"string"},"address":{"type":"string"},"chain_id":{"type":"number"},"symbol":{"type":"string"},"name":{"type":"string","nullable":true},"category":{"type":"string","enum":["tokenized_treasury","t_bill_backed_stable","rwa_credit"]},"review_status":{"type":"string","enum":["reviewed","provisional","unreviewed"]},"risk_score":{"type":"number"},"risk_tier":{"type":"string","enum":["Prime","Core","Edge"]},"issuer":{"$ref":"#/components/schemas/RwaIssuer"},"in_basket_a":{"type":"boolean"},"dimensions":{"type":"object","properties":{"issuer_custody":{"type":"number","nullable":true},"reserve_transparency":{"type":"number","nullable":true},"redeemability":{"type":"number","nullable":true},"protocol_security":{"type":"number","nullable":true},"liquidity":{"type":"number","nullable":true},"credit_quality":{"type":"number","nullable":true},"default_rate":{"type":"number","nullable":true},"recovery_rate":{"type":"number","nullable":true},"subadvisor_concentration":{"type":"number","nullable":true},"redemption_terms":{"type":"number","nullable":true}},"required":["issuer_custody","reserve_transparency","redeemability","protocol_security","liquidity","credit_quality","default_rate","recovery_rate","subadvisor_concentration","redemption_terms"]},"institutional":{"type":"object","properties":{"regulatory_wrapper":{"type":"string","nullable":true,"enum":["40_act","reg_d_506c","reg_s","144a","cayman_bvi_feeder","mas_cms","sfc_type1","sfc_authorised","mica","bvi_fsc","bermuda_dab","unregulated","genius_act_stablecoin","ucits_mmf_sicav","bvi_siba"]},"regulatory_jurisdiction":{"type":"string","nullable":true},"kyc_gate":{"type":"string","nullable":true,"enum":["permissionless","kyc_required","accredited","qualified_purchaser","professional_investor","institutional_only"]},"custodian_name":{"type":"string","nullable":true},"auditor_name":{"type":"string","nullable":true},"attestation_cadence":{"type":"string","nullable":true,"enum":["continuous","daily","weekly","monthly","quarterly","annual","none"]},"redemption_window":{"type":"string","nullable":true,"enum":["T+0","T+1","T+2","weekly","monthly","quarterly_window","gated"]},"aum_usd":{"type":"number","nullable":true},"yield_pct":{"type":"number","nullable":true},"duration_days":{"type":"number","nullable":true},"currency":{"type":"string","nullable":true,"enum":["USD","EUR","GBP","JPY","HKD","SGD","CHF"]},"aum_native":{"type":"number","nullable":true},"fx_rate_used":{"type":"number","nullable":true},"fx_rate_at":{"type":"string","nullable":true},"aum_usd_source":{"type":"string","nullable":true,"enum":["native","fx_translated"]},"yield_basis":{"type":"string","nullable":true,"enum":["sec_7_day","sec_30_day","distribution_rate_ttm","target_apy","none"]}},"required":["regulatory_wrapper","regulatory_jurisdiction","kyc_gate","custodian_name","auditor_name","attestation_cadence","redemption_window","aum_usd","yield_pct","duration_days","currency","aum_native","fx_rate_used","fx_rate_at","aum_usd_source","yield_basis"]},"data_provenance":{"nullable":true},"reviewed_by":{"type":"string","nullable":true},"reviewer":{"$ref":"#/components/schemas/RwaReviewer"},"recorded_at":{"type":"string"},"freshness":{"$ref":"#/components/schemas/RwaFreshness"},"dependency_chain":{"type":"array","nullable":true,"items":{"type":"object","properties":{"symbol":{"type":"string"},"layer":{"type":"number"},"kind":{"type":"string","nullable":true}},"required":["symbol","layer"]}},"methodology_version":{"type":"string","nullable":true},"chain_overlay":{"type":"object","nullable":true,"properties":{"multiplier":{"type":"number"},"bridge_centralization":{"type":"number"},"sequencer_centralization":{"type":"number"},"validator_set_size_score":{"type":"number"},"chain_age_score":{"type":"number"},"rationale":{"type":"string","nullable":true}},"required":["multiplier","bridge_centralization","sequencer_centralization","validator_set_size_score","chain_age_score","rationale"]}},"required":["asset_id","asset_version_id","address","chain_id","symbol","name","category","review_status","risk_score","risk_tier","issuer","in_basket_a","dimensions","institutional","reviewed_by","reviewer","recorded_at","freshness","dependency_chain","methodology_version","chain_overlay"]},"RwaListResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/RwaItem"}},"pagination":{"type":"object","properties":{"page":{"type":"number"},"limit":{"type":"number"},"total":{"type":"number"},"totalPages":{"type":"number"}},"required":["page","limit","total","totalPages"]}},"required":["data","pagination"]},"RwaFacetsResponse":{"type":"object","properties":{"data":{"type":"object","properties":{"chains":{"type":"array","items":{"type":"object","properties":{"chain_id":{"type":"number"},"count":{"type":"number"}},"required":["chain_id","count"]}},"categories":{"type":"array","items":{"type":"object","properties":{"category":{"type":"string","enum":["tokenized_treasury","t_bill_backed_stable","rwa_credit"]},"count":{"type":"number"}},"required":["category","count"]}},"review_statuses":{"type":"array","items":{"type":"object","properties":{"review_status":{"type":"string","enum":["reviewed","provisional","unreviewed"]},"count":{"type":"number"}},"required":["review_status","count"]}},"risk_tiers":{"type":"array","items":{"type":"object","properties":{"risk_tier":{"type":"string","enum":["Prime","Core","Edge"]},"count":{"type":"number"}},"required":["risk_tier","count"]}},"regulatory_wrappers":{"type":"array","items":{"type":"object","properties":{"regulatory_wrapper":{"type":"string"},"count":{"type":"number"}},"required":["regulatory_wrapper","count"]}},"kyc_gates":{"type":"array","items":{"type":"object","properties":{"kyc_gate":{"type":"string"},"count":{"type":"number"}},"required":["kyc_gate","count"]}},"jurisdictions":{"type":"array","items":{"type":"object","properties":{"jurisdiction":{"type":"string"},"count":{"type":"number"}},"required":["jurisdiction","count"]}},"custodians":{"type":"array","items":{"type":"object","properties":{"custodian":{"type":"string"},"count":{"type":"number"}},"required":["custodian","count"]}},"auditors":{"type":"array","items":{"type":"object","properties":{"auditor":{"type":"string"},"count":{"type":"number"}},"required":["auditor","count"]}}},"required":["chains","categories","review_statuses","risk_tiers","regulatory_wrappers","kyc_gates","jurisdictions","custodians","auditors"]}},"required":["data"]},"RwaVersionHistoryEntry":{"type":"object","properties":{"asset_version_id":{"type":"string"},"recorded_at":{"type":"string"},"risk_score":{"type":"number","nullable":true},"risk_tier":{"type":"string","nullable":true,"enum":["Prime","Core","Edge"]},"review_status":{"type":"string","enum":["reviewed","provisional","unreviewed"]},"aum_usd":{"type":"number","nullable":true},"yield_pct":{"type":"number","nullable":true}},"required":["asset_version_id","recorded_at","risk_score","risk_tier","review_status","aum_usd","yield_pct"]},"RwaAttestationEntry":{"type":"object","properties":{"asset_version_id":{"type":"string"},"reviewer_slug":{"type":"string"},"reviewer_name":{"type":"string"},"reviewer_role":{"type":"string","nullable":true},"attested_at":{"type":"string"},"signature":{"type":"string","nullable":true},"signature_valid":{"type":"boolean","nullable":true}},"required":["asset_version_id","reviewer_slug","reviewer_name","reviewer_role","attested_at","signature","signature_valid"]},"RwaDiscoveryRecord":{"type":"object","nullable":true,"properties":{"source_slug":{"type":"string"},"discovered_at":{"type":"string"},"last_seen_at":{"type":"string"}},"required":["source_slug","discovered_at","last_seen_at"]},"RwaRiskScoreBreakdown":{"type":"object","properties":{"category":{"type":"string"},"weights":{"type":"object","additionalProperties":{"type":"number"}},"dimensions":{"type":"object","additionalProperties":{"type":"number","nullable":true}},"weighted_sum":{"type":"number"},"overlays_applied":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string"},"effect":{"type":"string"},"value_after":{"type":"number"}},"required":["kind","effect","value_after"]}},"score":{"type":"number"},"tier":{"type":"string"},"methodology_version":{"type":"string"}},"required":["category","weights","dimensions","weighted_sum","overlays_applied","score","tier","methodology_version"]},"RwaDetailItem":{"allOf":[{"$ref":"#/components/schemas/RwaItem"},{"type":"object","properties":{"version_history":{"type":"array","items":{"$ref":"#/components/schemas/RwaVersionHistoryEntry"}},"attestation_history":{"type":"array","items":{"$ref":"#/components/schemas/RwaAttestationEntry"}},"discovery":{"$ref":"#/components/schemas/RwaDiscoveryRecord"},"risk_score_breakdown":{"$ref":"#/components/schemas/RwaRiskScoreBreakdown"}},"required":["version_history","attestation_history","discovery","risk_score_breakdown"]}]},"RwaDetailResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RwaDetailItem"}},"required":["data"]},"MethodologyVersionEntry":{"type":"object","properties":{"version":{"type":"string"},"effective_from":{"type":"string"},"effective_to":{"type":"string","nullable":true},"changelog":{"type":"string"},"approved_by":{"type":"string"}},"required":["version","effective_from","effective_to","changelog","approved_by"]},"MethodologyResponse":{"type":"object","properties":{"data":{"type":"object","properties":{"versions":{"type":"array","items":{"$ref":"#/components/schemas/MethodologyVersionEntry"}},"categories":{"type":"array","items":{"type":"string"}},"dimensions":{"type":"array","items":{"type":"string"}},"weights_by_category":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"type":"number"}}}},"required":["versions","categories","dimensions","weights_by_category"]}},"required":["data"]}},"parameters":{}},"paths":{"/v1/events":{"get":{"tags":["Events"],"summary":"List events","description":"Paginated list of DeFi events with filtering by type, severity, protocol, curator, chain, and full-text search.","parameters":[{"schema":{"type":"string","default":"1","description":"Page number (minimum 1)","example":"1"},"required":false,"name":"page","in":"query"},{"schema":{"type":"string","default":"20","description":"Items per page (1–100)","example":"20"},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","enum":["Incident","ParameterChange","Pause","Deprecation","AllocationChange","DepositabilityChange","RatingChange"],"description":"Filter by event type","example":"Incident"},"required":false,"name":"eventType","in":"query"},{"schema":{"type":"string","enum":["Critical","Warning","Info"],"description":"Filter by severity","example":"Critical"},"required":false,"name":"severity","in":"query"},{"schema":{"type":"string","description":"Filter by protocol ID","example":"morpho"},"required":false,"name":"protocolId","in":"query"},{"schema":{"type":"string","description":"Filter by curator ID","example":"gauntlet"},"required":false,"name":"curatorId","in":"query"},{"schema":{"type":"string","description":"Filter by chain ID","example":"1"},"required":false,"name":"chainId","in":"query"},{"schema":{"type":"string","enum":["minor","major"],"description":"Filter by incident severity"},"required":false,"name":"incidentSeverity","in":"query"},{"schema":{"type":"string","enum":["resolved","unresolved"],"description":"Filter by remediation status"},"required":false,"name":"remediationStatus","in":"query"},{"schema":{"type":"string","description":"Full-text search on title and description"},"required":false,"name":"search","in":"query"},{"schema":{"type":"string","description":"Sort field","example":"occurred_at"},"required":false,"name":"sortBy","in":"query"},{"schema":{"type":"string","description":"Sort order: asc or desc","example":"desc"},"required":false,"name":"sortOrder","in":"query"},{"schema":{"type":"string","description":"Lookback window in days (max 730). When omitted the default adapts to the query path: 30 for the unfiltered/protocol/chain feed (deduped — kept tight for cold-cache latency), 45 when a search term is set, and 90 for severity-filtered incident history.","example":"30"},"required":false,"name":"daysBack","in":"query"}],"responses":{"200":{"description":"Event list","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/EventListItem"}},"meta":{"type":"object","properties":{"page":{"type":"number"},"limit":{"type":"number"},"hasMore":{"type":"boolean"}},"required":["page","limit","hasMore"]}},"required":["data","meta"]}}}}}}},"/v1/events/{id}":{"get":{"tags":["Events"],"summary":"Get event detail","description":"Full event detail including incident fields, joined entity names, and affected vaults.","parameters":[{"schema":{"type":"string","description":"Event ID","example":"42"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Event detail","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/EventDetail"}},"required":["data"]}}}},"404":{"description":"Event not found"}}}},"/v1/vaults/with-critical-incidents":{"get":{"tags":["Vaults"],"summary":"List vaults with recent critical incidents","description":"Vaults that had at least one critical incident in the last 365 days (severity Critical or incident_severity major). Sorted by TVL descending, then by time since event ascending.","responses":{"200":{"description":"Vaults with recent critical incidents","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"vault_id":{"type":"string"},"vault_name":{"type":"string"},"chain_name":{"type":"string"},"protocol_name":{"type":"string"},"curator_name":{"type":"string","nullable":true},"tvl_usd":{"type":"number"},"last_incident_at":{"type":"string"},"days_since_incident":{"type":"number"},"incident_title":{"type":"string"},"incident_severity":{"type":"string","nullable":true},"event_severity":{"type":"string"}},"required":["vault_id","vault_name","chain_name","protocol_name","curator_name","tvl_usd","last_incident_at","days_since_incident","incident_title","incident_severity","event_severity"]}}},"required":["data"]}}}}}}},"/v1/vaults":{"get":{"tags":["Vaults"],"summary":"List vaults","description":"Paginated list of DeFi vaults with filtering, sorting, and search.","parameters":[{"schema":{"type":"string","default":"1","description":"Page number (minimum 1)","example":"1"},"required":false,"name":"page","in":"query"},{"schema":{"type":"string","default":"20","description":"Items per page (1–100)","example":"20"},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","description":"Filter by chain name (comma-separated)","example":"Ethereum,Base"},"required":false,"name":"chain","in":"query"},{"schema":{"type":"string","description":"Filter by protocol ID (comma-separated)","example":"morpho,aave-v3"},"required":false,"name":"protocol","in":"query"},{"schema":{"type":"string","description":"Filter by curator ID (comma-separated)"},"required":false,"name":"curator","in":"query"},{"schema":{"type":"string","description":"Filter by asset symbol (comma-separated)","example":"USDC,WETH"},"required":false,"name":"asset","in":"query"},{"schema":{"type":"string","description":"Filter by risk tier (comma-separated)","example":"Prime,Core"},"required":false,"name":"riskTier","in":"query"},{"schema":{"type":"string","description":"Search vault name, symbol, asset, protocol, or curator"},"required":false,"name":"search","in":"query"},{"schema":{"type":"string","description":"Minimum TVL in USD","example":"100000"},"required":false,"name":"minTvl","in":"query"},{"schema":{"type":"string","description":"When 'true', chains with a registry minTvlUsdOverride (young ecosystems) are exempt from minTvl — intended for Philidor UI default views. Omit for strict minTvl filtering (the default for API clients)."},"required":false,"name":"chainFloorExempt","in":"query"},{"schema":{"type":"string","description":"Filter stablecoin vaults (true/false)"},"required":false,"name":"stablecoin","in":"query"},{"schema":{"type":"string","description":"Filter LSD vaults (true/false)"},"required":false,"name":"lsd","in":"query"},{"schema":{"type":"string","description":"Filter single-exposure vaults (true/false)"},"required":false,"name":"singleExposure","in":"query"},{"schema":{"type":"string","description":"Filter no impermanent loss vaults (true/false)"},"required":false,"name":"noIL","in":"query"},{"schema":{"type":"string","description":"Filter audited vaults (true/false)"},"required":false,"name":"audited","in":"query"},{"schema":{"type":"string","description":"Filter high-confidence vaults (true/false)"},"required":false,"name":"highConfidence","in":"query"},{"schema":{"type":"string","description":"Filter vaults that currently accept deposits (true/false). When true, vaults whose depositability is not yet indexed are included; when false, only confirmed-non-depositable vaults are returned."},"required":false,"name":"depositable","in":"query"},{"schema":{"type":"string","description":"Sort field","example":"tvl_usd"},"required":false,"name":"sortBy","in":"query"},{"schema":{"type":"string","description":"Sort order: asc or desc","example":"desc"},"required":false,"name":"sortOrder","in":"query"},{"schema":{"type":"string","description":"Minimum risk score (0–10 scale, inclusive). Vaults without scores are excluded.","example":"5"},"required":false,"name":"minRiskScore","in":"query"},{"schema":{"type":"string","description":"Maximum risk score (0–10 scale, inclusive). Vaults without scores are excluded.","example":"8"},"required":false,"name":"maxRiskScore","in":"query"}],"responses":{"200":{"description":"Vault list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VaultListResponse"}}}}}}},"/v1/vaults/batch":{"post":{"tags":["Vaults"],"summary":"Batch vault lookup","description":"Look up multiple vaults by ID or contract address in a single request. Max 100 items per batch.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VaultBatchBody"}}}},"responses":{"200":{"description":"Matching vaults","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VaultBatchResponse"}}}}}}},"/v1/vaults/scores":{"get":{"tags":["Vaults"],"summary":"List vault scores (lightweight)","description":"Lightweight endpoint for bulk screening. Returns only essential fields (score, TVL, APR) without risk vectors, logos, or curator details. Supports higher limits (default 500, max 1000).","parameters":[{"schema":{"type":"string","default":"1","description":"Page number (minimum 1)","example":"1"},"required":false,"name":"page","in":"query"},{"schema":{"type":"string","default":"500","description":"Items per page (1–1000)","example":"500"},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","description":"Filter by chain name (comma-separated)"},"required":false,"name":"chain","in":"query"},{"schema":{"type":"string","description":"Filter by protocol ID (comma-separated)"},"required":false,"name":"protocol","in":"query"},{"schema":{"type":"string","description":"Filter by curator ID (comma-separated)"},"required":false,"name":"curator","in":"query"},{"schema":{"type":"string","description":"Filter by asset symbol (comma-separated)"},"required":false,"name":"asset","in":"query"},{"schema":{"type":"string","description":"Filter by risk tier (comma-separated)","example":"Prime,Core"},"required":false,"name":"riskTier","in":"query"},{"schema":{"type":"string","description":"Search vault name, symbol, asset, protocol"},"required":false,"name":"search","in":"query"},{"schema":{"type":"string","description":"Minimum TVL in USD"},"required":false,"name":"minTvl","in":"query"},{"schema":{"type":"string","description":"When 'true', chains with a registry minTvlUsdOverride are exempt from minTvl (Philidor UI default views). Omit for strict filtering."},"required":false,"name":"chainFloorExempt","in":"query"},{"schema":{"type":"string","description":"Minimum risk score (0–10)"},"required":false,"name":"minRiskScore","in":"query"},{"schema":{"type":"string","description":"Maximum risk score (0–10)"},"required":false,"name":"maxRiskScore","in":"query"},{"schema":{"type":"string","description":"Filter stablecoin vaults (true/false)"},"required":false,"name":"stablecoin","in":"query"},{"schema":{"type":"string","description":"Filter LSD vaults (true/false)"},"required":false,"name":"lsd","in":"query"},{"schema":{"type":"string","description":"Filter single-exposure vaults (true/false)"},"required":false,"name":"singleExposure","in":"query"},{"schema":{"type":"string","description":"Filter no impermanent loss vaults (true/false)"},"required":false,"name":"noIL","in":"query"},{"schema":{"type":"string","description":"Filter audited vaults (true/false)"},"required":false,"name":"audited","in":"query"},{"schema":{"type":"string","description":"Filter high-confidence vaults (true/false)"},"required":false,"name":"highConfidence","in":"query"},{"schema":{"type":"string","description":"Filter vaults that currently accept deposits (true/false). When true, vaults whose depositability is not yet indexed are included; when false, only confirmed-non-depositable vaults are returned."},"required":false,"name":"depositable","in":"query"},{"schema":{"type":"string","description":"Sort field","example":"tvl_usd"},"required":false,"name":"sortBy","in":"query"},{"schema":{"type":"string","description":"Sort order: asc or desc","example":"desc"},"required":false,"name":"sortOrder","in":"query"}],"responses":{"200":{"description":"Vault scores","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VaultScoresResponse"}}}}}}},"/v1/vaults/changes":{"get":{"tags":["Vaults"],"summary":"Get recently changed vaults","description":"Returns vaults modified after the given timestamp. Use the returned `cursor` as the `since` parameter in your next request for efficient polling.","parameters":[{"schema":{"type":"string","description":"ISO 8601 timestamp or cursor from previous response. Returns vaults modified after this point. Use the returned cursor for your next poll.","example":"2025-01-01T00:00:00.000Z"},"required":true,"name":"since","in":"query"},{"schema":{"type":"string","default":"100","description":"Max results (1–500)","example":"100"},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Changed vaults since the given timestamp","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VaultChangesResponse"}}}}}}},"/v1/vaults/{id}":{"get":{"tags":["Vaults"],"summary":"Get vault by ID","description":"Full vault detail including snapshots (90 days) and recent events.","parameters":[{"schema":{"type":"string","description":"Vault ID","example":"morpho-ethereum-0x..."},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","description":"Snapshot resolution (max data points, 1–2160). Default: 2160 (hourly). Use 360 for 6-hour intervals.","example":"360"},"required":false,"name":"resolution","in":"query"}],"responses":{"200":{"description":"Vault detail","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VaultDetailResponse"}}}}}}},"/v1/vault/{network}/{address}":{"get":{"tags":["Vaults"],"summary":"Get vault by network and address","description":"Lookup a vault by chain slug and contract address.","parameters":[{"schema":{"type":"string","description":"Network slug","example":"ethereum"},"required":true,"name":"network","in":"path"},{"schema":{"type":"string","description":"Vault contract address","example":"0x..."},"required":true,"name":"address","in":"path"}],"responses":{"200":{"description":"Vault detail","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VaultDetailResponse"}}}}}}},"/v1/vault/{network}/{address}/events":{"get":{"tags":["Vaults"],"summary":"Get vault events","description":"Recent events for a vault including incidents, parameter changes, and allocation changes.","parameters":[{"schema":{"type":"string","description":"Network slug","example":"ethereum"},"required":true,"name":"network","in":"path"},{"schema":{"type":"string","description":"Vault contract address","example":"0x..."},"required":true,"name":"address","in":"path"}],"responses":{"200":{"description":"Vault events","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Event"}}},"required":["data"]}}}}}}},"/v1/vault/{network}/{address}/markets":{"get":{"tags":["Vaults"],"summary":"Get Morpho market allocations","description":"Returns market allocation data for Morpho vaults. Non-Morpho vaults return empty markets.","parameters":[{"schema":{"type":"string","description":"Network slug","example":"ethereum"},"required":true,"name":"network","in":"path"},{"schema":{"type":"string","description":"Vault contract address","example":"0x..."},"required":true,"name":"address","in":"path"}],"responses":{"200":{"description":"Market data","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"nullable":true}}}}}}}}},"/v1/vault/{network}/{address}/strategies":{"get":{"tags":["Vaults"],"summary":"Get Yearn strategy details","description":"Proxies to ydaemon API for Yearn vault strategies.","parameters":[{"schema":{"type":"string","description":"Network slug","example":"ethereum"},"required":true,"name":"network","in":"path"},{"schema":{"type":"string","description":"Vault contract address","example":"0x..."},"required":true,"name":"address","in":"path"}],"responses":{"200":{"description":"Strategy data","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"nullable":true}}}}}}}}},"/v1/vault/{network}/{address}/strategy":{"get":{"tags":["Vaults"],"summary":"Get Beefy strategy info","description":"Returns processed Beefy vault strategy with yield sources, risk flags, and APY.","parameters":[{"schema":{"type":"string","description":"Network slug","example":"ethereum"},"required":true,"name":"network","in":"path"},{"schema":{"type":"string","description":"Vault contract address","example":"0x..."},"required":true,"name":"address","in":"path"}],"responses":{"200":{"description":"Strategy data","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"nullable":true}}}}}}}}},"/v1/protocols":{"get":{"tags":["Protocols"],"summary":"List protocols","description":"Returns protocols that have active vaults, with vault counts and TVL.","responses":{"200":{"description":"Protocol list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProtocolListResponse"}}}}}}},"/v1/protocols/{id}":{"get":{"tags":["Protocols"],"summary":"Get protocol by ID","description":"Full protocol detail including metadata, vaults, versions, and incidents.","parameters":[{"schema":{"type":"string","description":"Protocol ID","example":"morpho"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","default":"1","description":"Vault sub-resource page (minimum 1)","example":"1"},"required":false,"name":"vaultPage","in":"query"},{"schema":{"type":"string","default":"50","description":"Vaults per page (1–100)","example":"50"},"required":false,"name":"vaultLimit","in":"query"}],"responses":{"200":{"description":"Protocol detail","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProtocolDetailResponse"}}}}}}},"/v1/curators":{"get":{"tags":["Curators"],"summary":"List curators","description":"Paginated list of curators with aggregated TVL, vault count, and average APR.","parameters":[{"schema":{"type":"string","default":"1","description":"Page number (minimum 1)","example":"1"},"required":false,"name":"page","in":"query"},{"schema":{"type":"string","default":"20","description":"Items per page (1–100)","example":"20"},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","description":"Sort field: tvl_total, vault_count, avg_apr, name","example":"tvl_total"},"required":false,"name":"sortBy","in":"query"},{"schema":{"type":"string","description":"Sort order: asc or desc","example":"desc"},"required":false,"name":"sortOrder","in":"query"}],"responses":{"200":{"description":"Curator list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CuratorListResponse"}}}}}}},"/v1/curators/{id}":{"get":{"tags":["Curators"],"summary":"Get curator by ID","description":"Curator detail including vaults, chain distribution, and events.","parameters":[{"schema":{"type":"string","description":"Curator ID","example":"gauntlet"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","default":"1","description":"Vault sub-resource page (minimum 1)","example":"1"},"required":false,"name":"vaultPage","in":"query"},{"schema":{"type":"string","default":"50","description":"Vaults per page (1–100)","example":"50"},"required":false,"name":"vaultLimit","in":"query"}],"responses":{"200":{"description":"Curator detail","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CuratorDetailResponse"}}}}}}},"/v1/curators/{id}/events":{"get":{"tags":["Curators"],"summary":"Get curator events","description":"Paginated events for a curator, including vault-associated events.","parameters":[{"schema":{"type":"string","description":"Curator ID","example":"gauntlet"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","description":"Offset for pagination","example":"0"},"required":false,"name":"offset","in":"query"},{"schema":{"type":"string","description":"Events per page","example":"5"},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Curator events","content":{"application/json":{"schema":{"nullable":true}}}}}}},"/v1/chains":{"get":{"tags":["Reference"],"summary":"Supported chains","description":"Returns chains that have active vaults, with vault counts and TVL.","responses":{"200":{"description":"Chain list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChainListResponse"}}}}}}},"/v1/assets":{"get":{"tags":["Reference"],"summary":"Asset symbols","description":"Returns asset symbols with the number of active vaults for each.","responses":{"200":{"description":"Asset list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssetListResponse"}}}}}}},"/v1/stats":{"get":{"tags":["Stats"],"summary":"Platform-wide statistics","description":"Returns aggregate stats: TVL, vault count, risk distribution, TVL by protocol and chain.","responses":{"200":{"description":"Platform stats","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatsResponse"}}}}}}},"/v1/health":{"get":{"tags":["System"],"summary":"Health check","responses":{"200":{"description":"Health status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"}}}}}}},"/v1/oracle-vector/freshness":{"get":{"tags":["Oracle Vector"],"summary":"Oracle feed freshness and deviation data","responses":{"200":{"description":"Oracle freshness data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OracleFreshnessResponse"}}}},"503":{"description":"Service unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/graph/look-through":{"get":{"tags":["Graph"],"summary":"Portfolio look-through (preview)","description":"Resolves vault positions to their underlying exposures — curator, protocol, chain, collateral assets with wrapper ancestry and oracle dependencies — from the latest worker-materialized Risk Graph snapshot. Preview feature: dark unless enabled; results are point-in-time (snapshotId is the content-addressed graph state).","parameters":[{"schema":{"type":"string","minLength":1,"description":"Comma-separated vault keys, each `{chainId}:{vaultAddress}` (lowercase address). Max 50.","example":"1:0x1111111111111111111111111111111111111111"},"required":true,"name":"vaults","in":"query"}],"responses":{"200":{"description":"Look-through closures for the requested vaults (null = vault not in graph)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GraphLookThroughResponse"}}}},"400":{"description":"Bad request (too many vaults, malformed keys)"},"404":{"description":"Feature disabled"},"503":{"description":"Graph materialization unavailable — fail-closed, retry later"}}}},"/v1/graph/decision/{id}/verify":{"get":{"tags":["Graph"],"summary":"Verify a signed decision (preview)","description":"Recomputes the canonical decision envelope from stored fields and checks the signature chain: envelope hash integrity and signer recovery. The compliance artifact for audit trails (engine plan §11).","parameters":[{"schema":{"type":"string","pattern":"^[0-9a-f]{64}$","description":"Decision id (= envelope hash, 64-hex)"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Verification result (found=false when no such decision exists)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GraphDecisionVerifyResponse"}}}},"404":{"description":"Feature disabled"}}}},"/v1/graph/check":{"post":{"tags":["Graph"],"summary":"Pre-trade exposure check (preview)","description":"Evaluates a portfolio against look-through exposure limits using the latest Risk Graph materialization: per-dimension shares across curator, protocol, chain, collateral assets (through wrapper ancestry) and oracles. verdict=reject on any breached limit; caution near limits or on partially unresolvable portfolios. With issue=true (and server-side signing configured), persists a signed sizing decision verifiable at /v1/graph/decision/{id}/verify.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GraphCheckRequest"}}}},"responses":{"200":{"description":"Evaluation result (and signed decision when issued)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GraphCheckResponse"}}}},"401":{"description":"issue=true requires an API key"},"404":{"description":"Feature disabled"},"503":{"description":"Graph materialization or signing unavailable — fail-closed"}}}},"/v1/graph/breach":{"get":{"tags":["Graph"],"summary":"Liquidation breach surface (preview)","description":"Per-market borrower health books (Morpho, aggregated health-factor bands — no borrower addresses) with deterministic liquidatable-debt BOUNDS at standard collateral shocks. A −s% collateral shock makes positions with health factor below 1/(1−s) liquidatable; band aggregation yields [lo, hi] ranges, never point estimates. PREVIEW: bounds on liquidatable debt are not loss estimates and cannot back sizing decisions. coverage=truncated marks lower-bound totals.","responses":{"200":{"description":"Latest breach surface from the borrow-book sweep","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GraphBreachResponse"}}}},"404":{"description":"Feature disabled"},"503":{"description":"Breach materialization unavailable — fail-closed, retry later"}}}},"/v1/address/{address}/positions":{"get":{"tags":["Portfolio"],"summary":"Get portfolio positions for an address","description":"Returns all DeFi vault positions held by an Ethereum address across supported chains, with USD valuations and risk metrics.","parameters":[{"schema":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$","description":"Ethereum address","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"required":true,"name":"address","in":"path"}],"responses":{"200":{"description":"Portfolio positions with aggregates","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddressPositionsResponse"}}}},"400":{"description":"Invalid address","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"503":{"description":"Service unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/users/:address/agents":{"get":{"tags":["User agents"],"summary":"Get agents for a wallet","description":"Returns persisted agents and config for the given wallet. Requires wallet signature: sign the message from GET /users/:address/agents/auth-message?method=GET, send as base64 in x-philidor-agents-message and hex in x-philidor-agents-signature.","parameters":[{"schema":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$","description":"Wallet address (Ethereum)"},"required":true,"name":"address","in":"path"}],"responses":{"200":{"description":"Agents and config","content":{"application/json":{"schema":{"type":"object","properties":{"mainWalletName":{"type":"string"},"mainWalletPosition":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"linkWaypoints":{"type":"object","additionalProperties":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]}},"agents":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"evmAddress":{"type":"string"},"strategy":{"type":"string","enum":["aggressive","moderate","conservative"]},"rebalanceFrequency":{"type":"string","enum":["daily","weekly","monthly"]},"blacklist":{"type":"array","items":{"type":"string"}},"whitelist":{"type":"array","items":{"type":"string"}},"x":{"type":"number"},"y":{"type":"number"}},"required":["id","name","blacklist","whitelist","x","y"]}}},"required":["agents"]}}}},"401":{"description":"Missing or invalid signature"}}},"put":{"tags":["User agents"],"summary":"Replace agents for a wallet","description":"Replaces persisted agents and config. Requires wallet signature: sign buildAgentsAuthMessage(\"PUT\", address), include in body with payload.","parameters":[{"schema":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$","description":"Wallet address (Ethereum)"},"required":true,"name":"address","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","minLength":1,"description":"Message signed by wallet (see docs)"},"signature":{"type":"string","minLength":1,"description":"EIP-191 signature (0x-prefixed)"},"mainWalletName":{"type":"string"},"mainWalletPosition":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"linkWaypoints":{"type":"object","additionalProperties":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]}},"agents":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Agent id (e.g. uuid)"},"name":{"type":"string","minLength":1},"evmAddress":{"type":"string","nullable":true},"strategy":{"type":"string","nullable":true,"enum":["aggressive","moderate","conservative"]},"rebalanceFrequency":{"type":"string","nullable":true,"enum":["daily","weekly","monthly"]},"blacklist":{"type":"array","items":{"type":"string"},"default":[]},"whitelist":{"type":"array","items":{"type":"string"},"default":[]},"x":{"type":"number"},"y":{"type":"number"}},"required":["id","name","x","y"]},"default":[]}},"required":["message","signature"]}}}},"responses":{"200":{"description":"Updated agents and config","content":{"application/json":{"schema":{"type":"object","properties":{"mainWalletName":{"type":"string"},"mainWalletPosition":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"linkWaypoints":{"type":"object","additionalProperties":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]}},"agents":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"evmAddress":{"type":"string"},"strategy":{"type":"string","enum":["aggressive","moderate","conservative"]},"rebalanceFrequency":{"type":"string","enum":["daily","weekly","monthly"]},"blacklist":{"type":"array","items":{"type":"string"}},"whitelist":{"type":"array","items":{"type":"string"}},"x":{"type":"number"},"y":{"type":"number"}},"required":["id","name","blacklist","whitelist","x","y"]}}},"required":["agents"]}}}},"401":{"description":"Missing or invalid signature"}}}},"/v1/users/:address/agents/auth-message":{"get":{"tags":["User agents"],"summary":"Get auth message to sign","description":"Returns the message to sign for GET or PUT /users/:address/agents. Query: method=GET or method=PUT.","parameters":[{"schema":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$","description":"Wallet address (Ethereum)"},"required":true,"name":"address","in":"path"},{"schema":{"type":"string","enum":["GET","PUT"],"default":"GET"},"required":false,"name":"method","in":"query"}],"responses":{"200":{"description":"Message to sign","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}}}}}},"/v1/chat":{"post":{"tags":["User chat"],"summary":"Ask Phil from an IP-limited public session","description":"IP-limited research chat endpoint backed by Gemini. Intended for low-cost analysis only; no transaction execution.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":1200,"example":"Compare the safest USDC vaults on Base."},"history":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["user","assistant"],"example":"user"},"text":{"type":"string","minLength":1,"maxLength":1200,"example":"Show me the safest ETH vaults."}},"required":["role","text"]},"maxItems":6}},"required":["prompt"]}}}},"responses":{"200":{"description":"Assistant reply","content":{"application/json":{"schema":{"type":"object","properties":{"reply":{"type":"string","example":"Here are the lowest-risk USDC vaults on Base..."},"model":{"type":"string","example":"gemini-2.5-flash-lite"},"usage":{"$ref":"#/components/schemas/UserChatUsage"}},"required":["reply","model","usage"]}}}},"429":{"description":"Per-minute or daily budget exceeded"},"503":{"description":"Chat service unavailable"}}}},"/v1/baskets":{"get":{"tags":["Baskets"],"summary":"List reference baskets","description":"Returns a summary row per published reference basket, including the current version id, last rebalance timestamp, and the published content hash (also the response ETag for the detail endpoint).","responses":{"200":{"description":"Reference baskets","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"constituent_type":{"type":"string","enum":["asset","vault"]},"version_id":{"type":"string","nullable":true},"effective_from":{"type":"string","nullable":true},"content_hash":{"type":"string","nullable":true},"last_rebalanced_at":{"type":"string","nullable":true}},"required":["id","name","constituent_type","version_id","effective_from","content_hash","last_rebalanced_at"]}}},"required":["data"]}}}}}}},"/v1/baskets/{id}":{"get":{"tags":["Baskets"],"summary":"Get basket (current or historical)","description":"Returns the current published version of a basket. Pass `?at=` to resolve to the version that was effective at a historical timestamp; that response is treated as immutable (year-long Cache-Control).","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-z0-9][a-z0-9-]{0,63}$","description":"Basket slug, e.g. rwa-tbill-conservative","example":"rwa-tbill-conservative"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"date-time","description":"Optional ISO-8601 timestamp; resolves to the basket version that was effective at that time. Omit for the current version.","example":"2026-01-15T12:00:00Z"},"required":false,"name":"at","in":"query"}],"responses":{"200":{"description":"Basket detail","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"version_id":{"type":"number"},"effective_from":{"type":"string"},"constituent_type":{"type":"string","enum":["asset","vault"]},"content_hash":{"type":"string"},"methodology":{"type":"object","properties":{"summary":{"type":"string"},"eligibility_rule":{"type":"string"},"weighting_rule":{"type":"string"},"refresh_rule":{"type":"string"},"caps":{"type":"object","properties":{"single_name_pct":{"type":"number"},"issuer_pct":{"type":"number"},"floor_pct":{"type":"number"}},"required":["single_name_pct","issuer_pct","floor_pct"]},"version":{"type":"string"},"doc_url":{"type":"string"}},"required":["summary","eligibility_rule","weighting_rule","refresh_rule","caps","version","doc_url"]},"constituents":{"type":"array","items":{"type":"object","properties":{"ref_id":{"type":"string"},"ref_type":{"type":"string","enum":["asset","vault"]},"symbol":{"type":"string"},"name":{"type":"string"},"issuer":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"reviewer":{"$ref":"#/components/schemas/BasketReviewer"},"weight":{"type":"number"},"risk_score":{"type":"number"},"risk_tier":{"type":"string","enum":["Prime","Core","Edge"],"description":"Published tier (hysteresis-stabilized). May briefly differ from a naive derivation from risk_score while a boundary move is dwelling."},"methodology_version":{"type":"string"},"link_chain_id":{"type":"number","nullable":true},"link_address":{"type":"string","nullable":true}},"required":["ref_id","ref_type","symbol","name","issuer","weight","risk_score","risk_tier","methodology_version","link_chain_id","link_address"]}},"analytics":{"type":"object","nullable":true,"properties":{"weighted_risk_score":{"type":"number"},"weighted_yield_pct":{"type":"number","nullable":true},"weighted_yield_30d_pct":{"type":"number","nullable":true},"weighted_yield_90d_pct":{"type":"number","nullable":true},"per_constituent_yields":{"type":"object","additionalProperties":{"type":"object","properties":{"spot":{"type":"number","nullable":true},"d30":{"type":"number","nullable":true},"d90":{"type":"number","nullable":true}},"required":["spot","d30","d90"]}},"weighted_duration_days":{"type":"number","nullable":true},"hhi":{"type":"number"},"top_5_concentration_pct":{"type":"number"},"regulatory_wrapper_split":{"type":"object","additionalProperties":{"type":"number"}},"regulatory_jurisdiction_split":{"type":"object","additionalProperties":{"type":"number"}},"kyc_gate_split":{"type":"object","additionalProperties":{"type":"number"}},"chain_split":{"type":"object","additionalProperties":{"type":"number"}},"governance_model_split":{"type":"object","additionalProperties":{"type":"number"}},"curator_jurisdiction_split":{"type":"object","additionalProperties":{"type":"number"}},"legal_entity_type_split":{"type":"object","additionalProperties":{"type":"number"}},"audit_firm_split":{"type":"object","additionalProperties":{"type":"number"}},"protocol_governance_split":{"type":"object","additionalProperties":{"type":"number"}},"protocol_bug_bounty_tier_split":{"type":"object","additionalProperties":{"type":"number"}},"protocol_split":{"type":"object","additionalProperties":{"type":"number"}},"curator_split":{"type":"object","additionalProperties":{"type":"number"}},"weighted_protocol_age_days":{"type":"number","nullable":true},"coverage":{"type":"object","properties":{"yield_field_pct":{"type":"number"},"yield_30d_field_pct":{"type":"number"},"yield_90d_field_pct":{"type":"number"},"duration_field_pct":{"type":"number"},"regulatory_wrapper_field_pct":{"type":"number"},"regulatory_jurisdiction_field_pct":{"type":"number"},"kyc_gate_field_pct":{"type":"number"},"governance_model_field_pct":{"type":"number"},"curator_jurisdiction_field_pct":{"type":"number"},"legal_entity_type_field_pct":{"type":"number"},"audit_firm_field_pct":{"type":"number"},"protocol_governance_field_pct":{"type":"number"},"protocol_bug_bounty_tier_field_pct":{"type":"number"},"protocol_age_field_pct":{"type":"number"},"protocol_split_field_pct":{"type":"number"},"curator_split_field_pct":{"type":"number"}},"required":["yield_field_pct","duration_field_pct","regulatory_wrapper_field_pct","regulatory_jurisdiction_field_pct","kyc_gate_field_pct"]}},"required":["weighted_risk_score","weighted_yield_pct","weighted_duration_days","hhi","top_5_concentration_pct","regulatory_wrapper_split","regulatory_jurisdiction_split","kyc_gate_split","chain_split","coverage"]},"support_status":{"type":"string","enum":["current","supported","deprecated","retired"]},"retired_at":{"type":"string","nullable":true}},"required":["id","name","version_id","effective_from","constituent_type","content_hash","methodology","constituents","analytics"]}},"required":["data"]}}}},"304":{"description":"Not modified (If-None-Match matched)"},"404":{"description":"Basket not found"}}}},"/v1/baskets/{id}/versions":{"get":{"tags":["Baskets"],"summary":"List basket version history","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-z0-9][a-z0-9-]{0,63}$","description":"Basket slug, e.g. rwa-tbill-conservative","example":"rwa-tbill-conservative"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","default":"1","example":"1"},"required":false,"name":"page","in":"query"},{"schema":{"type":"string","default":"50","example":"50"},"required":false,"name":"pageSize","in":"query"}],"responses":{"200":{"description":"Version history","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"version_id":{"type":"string"},"basket_id":{"type":"string"},"effective_from":{"type":"string"},"trigger_reason":{"type":"string"},"prior_version_id":{"type":"string","nullable":true},"methodology_version":{"type":"string"},"content_hash":{"type":"string"},"signing_key_id":{"type":"string"},"created_at":{"type":"string"}},"required":["version_id","basket_id","effective_from","trigger_reason","prior_version_id","methodology_version","content_hash","signing_key_id","created_at"]}},"meta":{"type":"object","properties":{"page":{"type":"number"},"limit":{"type":"number"},"total":{"type":"number"},"totalPages":{"type":"number"}},"required":["page","limit","total","totalPages"]}},"required":["data","meta"]}}}},"404":{"description":"Basket not found"}}}},"/v1/baskets/{id}/methodology/versions":{"get":{"tags":["Baskets"],"summary":"Methodology version history","description":"Newest-first list of every methodology version this basket has published, with activated_at and content_hash. Compliance reviewers use this to answer \"which methodology was in force on date X\". The active version is the row with retired_at IS NULL; superseded versions retain their activated_at and gain a retired_at when a newer version is inserted.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-z0-9][a-z0-9-]{0,63}$","description":"Basket slug, e.g. rwa-tbill-conservative","example":"rwa-tbill-conservative"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Methodology versions","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"version":{"type":"string"},"doc_url":{"type":"string"},"content_hash":{"type":"string"},"activated_at":{"type":"string"},"retired_at":{"type":"string","nullable":true},"is_active":{"type":"boolean"}},"required":["version","doc_url","content_hash","activated_at","retired_at","is_active"]}}},"required":["data"]}}}},"404":{"description":"Basket not found"}}}},"/v1/baskets/{id}/changes":{"get":{"tags":["Baskets"],"summary":"Per-rebalance diff log","description":"For each of the most recent N versions, returns the constituent-level diff vs. the prior version (added, removed, weight_changed).","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-z0-9][a-z0-9-]{0,63}$","description":"Basket slug, e.g. rwa-tbill-conservative","example":"rwa-tbill-conservative"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","default":"20","example":"20"},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Per-version diffs","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"version_id":{"type":"string"},"prior_version_id":{"type":"string","nullable":true},"effective_from":{"type":"string"},"trigger_reason":{"type":"string"},"added":{"type":"array","items":{"type":"object","properties":{"ref_type":{"type":"string","enum":["asset","vault"]},"ref_id":{"type":"string"},"symbol":{"type":"string"},"weight":{"type":"number"}},"required":["ref_type","ref_id","symbol","weight"]}},"removed":{"type":"array","items":{"type":"object","properties":{"ref_type":{"type":"string","enum":["asset","vault"]},"ref_id":{"type":"string"},"symbol":{"type":"string"},"weight":{"type":"number"}},"required":["ref_type","ref_id","symbol","weight"]}},"weight_changed":{"type":"array","items":{"type":"object","properties":{"ref_type":{"type":"string","enum":["asset","vault"]},"ref_id":{"type":"string"},"symbol":{"type":"string"},"prior_weight":{"type":"number"},"new_weight":{"type":"number"}},"required":["ref_type","ref_id","symbol","prior_weight","new_weight"]}}},"required":["version_id","prior_version_id","effective_from","trigger_reason","added","removed","weight_changed"]}}},"required":["data"]}}}},"404":{"description":"Basket not found"}}}},"/v1/baskets/{id}/version/{versionId}":{"get":{"tags":["Baskets"],"summary":"Get a specific (immutable) basket version","description":"Returns an immutable snapshot keyed by version id. Cache-Control: public, max-age=31536000, immutable.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-z0-9][a-z0-9-]{0,63}$","example":"rwa-tbill-conservative"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","pattern":"^\\d+$","description":"Numeric basket_versions.id","example":"42"},"required":true,"name":"versionId","in":"path"}],"responses":{"200":{"description":"Immutable basket version","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"version_id":{"type":"number"},"effective_from":{"type":"string"},"constituent_type":{"type":"string","enum":["asset","vault"]},"content_hash":{"type":"string"},"methodology":{"type":"object","properties":{"summary":{"type":"string"},"eligibility_rule":{"type":"string"},"weighting_rule":{"type":"string"},"refresh_rule":{"type":"string"},"caps":{"type":"object","properties":{"single_name_pct":{"type":"number"},"issuer_pct":{"type":"number"},"floor_pct":{"type":"number"}},"required":["single_name_pct","issuer_pct","floor_pct"]},"version":{"type":"string"},"doc_url":{"type":"string"}},"required":["summary","eligibility_rule","weighting_rule","refresh_rule","caps","version","doc_url"]},"constituents":{"type":"array","items":{"type":"object","properties":{"ref_id":{"type":"string"},"ref_type":{"type":"string","enum":["asset","vault"]},"symbol":{"type":"string"},"name":{"type":"string"},"issuer":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"reviewer":{"$ref":"#/components/schemas/BasketReviewer"},"weight":{"type":"number"},"risk_score":{"type":"number"},"risk_tier":{"type":"string","enum":["Prime","Core","Edge"],"description":"Published tier (hysteresis-stabilized). May briefly differ from a naive derivation from risk_score while a boundary move is dwelling."},"methodology_version":{"type":"string"},"link_chain_id":{"type":"number","nullable":true},"link_address":{"type":"string","nullable":true}},"required":["ref_id","ref_type","symbol","name","issuer","weight","risk_score","risk_tier","methodology_version","link_chain_id","link_address"]}},"analytics":{"type":"object","nullable":true,"properties":{"weighted_risk_score":{"type":"number"},"weighted_yield_pct":{"type":"number","nullable":true},"weighted_yield_30d_pct":{"type":"number","nullable":true},"weighted_yield_90d_pct":{"type":"number","nullable":true},"per_constituent_yields":{"type":"object","additionalProperties":{"type":"object","properties":{"spot":{"type":"number","nullable":true},"d30":{"type":"number","nullable":true},"d90":{"type":"number","nullable":true}},"required":["spot","d30","d90"]}},"weighted_duration_days":{"type":"number","nullable":true},"hhi":{"type":"number"},"top_5_concentration_pct":{"type":"number"},"regulatory_wrapper_split":{"type":"object","additionalProperties":{"type":"number"}},"regulatory_jurisdiction_split":{"type":"object","additionalProperties":{"type":"number"}},"kyc_gate_split":{"type":"object","additionalProperties":{"type":"number"}},"chain_split":{"type":"object","additionalProperties":{"type":"number"}},"governance_model_split":{"type":"object","additionalProperties":{"type":"number"}},"curator_jurisdiction_split":{"type":"object","additionalProperties":{"type":"number"}},"legal_entity_type_split":{"type":"object","additionalProperties":{"type":"number"}},"audit_firm_split":{"type":"object","additionalProperties":{"type":"number"}},"protocol_governance_split":{"type":"object","additionalProperties":{"type":"number"}},"protocol_bug_bounty_tier_split":{"type":"object","additionalProperties":{"type":"number"}},"protocol_split":{"type":"object","additionalProperties":{"type":"number"}},"curator_split":{"type":"object","additionalProperties":{"type":"number"}},"weighted_protocol_age_days":{"type":"number","nullable":true},"coverage":{"type":"object","properties":{"yield_field_pct":{"type":"number"},"yield_30d_field_pct":{"type":"number"},"yield_90d_field_pct":{"type":"number"},"duration_field_pct":{"type":"number"},"regulatory_wrapper_field_pct":{"type":"number"},"regulatory_jurisdiction_field_pct":{"type":"number"},"kyc_gate_field_pct":{"type":"number"},"governance_model_field_pct":{"type":"number"},"curator_jurisdiction_field_pct":{"type":"number"},"legal_entity_type_field_pct":{"type":"number"},"audit_firm_field_pct":{"type":"number"},"protocol_governance_field_pct":{"type":"number"},"protocol_bug_bounty_tier_field_pct":{"type":"number"},"protocol_age_field_pct":{"type":"number"},"protocol_split_field_pct":{"type":"number"},"curator_split_field_pct":{"type":"number"}},"required":["yield_field_pct","duration_field_pct","regulatory_wrapper_field_pct","regulatory_jurisdiction_field_pct","kyc_gate_field_pct"]}},"required":["weighted_risk_score","weighted_yield_pct","weighted_duration_days","hhi","top_5_concentration_pct","regulatory_wrapper_split","regulatory_jurisdiction_split","kyc_gate_split","chain_split","coverage"]},"support_status":{"type":"string","enum":["current","supported","deprecated","retired"]},"retired_at":{"type":"string","nullable":true}},"required":["id","name","version_id","effective_from","constituent_type","content_hash","methodology","constituents","analytics"]}},"required":["data"]}}}},"404":{"description":"Basket or version not found"}}}},"/v1/baskets/{id}/webhooks":{"post":{"tags":["Baskets"],"summary":"Create a webhook subscription (paid tiers)","description":"Creates a paid-tier webhook subscription for a basket. The plaintext signing secret is returned ONCE in the response and stored encrypted-at-rest server-side; subsequent reads will not include it.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-z0-9][a-z0-9-]{0,63}$","description":"Basket slug, e.g. rwa-tbill-conservative","example":"rwa-tbill-conservative"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"HTTPS URL Philidor will POST signed events to."},"pinned_version_id":{"type":"integer","minimum":0,"exclusiveMinimum":true,"description":"Wave A: when set, the subscription pins to this specific basket version. Webhook events fired against this version (BasketVersionDeprecated, BasketVersionRetired, and constituent-incident events) are delivered to this subscription. When omitted, the subscription follows the latest published version (legacy behavior)."}},"required":["url"]}}}},"responses":{"201":{"description":"Webhook created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"number"},"basket_id":{"type":"string"},"url":{"type":"string"},"secret":{"type":"string","description":"Plaintext HMAC secret. Returned ONLY on creation; never readable again."},"status":{"type":"string","enum":["active"]},"created_at":{"type":"string"}},"required":["id","basket_id","url","secret","status","created_at"]}},"required":["data"]}}}},"401":{"description":"API key required"},"403":{"description":"Tier not eligible"},"404":{"description":"Basket not found"}}}},"/v1/baskets/{id}/webhooks/{whId}":{"delete":{"tags":["Baskets"],"summary":"Delete a webhook subscription","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-z0-9][a-z0-9-]{0,63}$","example":"rwa-tbill-conservative"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","pattern":"^\\d+$","description":"Numeric webhook subscription id","example":"7"},"required":true,"name":"whId","in":"path"}],"responses":{"204":{"description":"Deleted"},"401":{"description":"API key required"},"403":{"description":"Tier not eligible"},"404":{"description":"Webhook not found"}}}},"/v1/baskets/{id}/webhooks/{whId}/replay":{"post":{"tags":["Baskets"],"summary":"Replay terminal-failed webhook deliveries","description":"Re-enqueues `failed_terminal` deliveries within an optional date range (defaults to the last 24 hours). Returns the number of deliveries enqueued for retry.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-z0-9][a-z0-9-]{0,63}$","example":"rwa-tbill-conservative"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","pattern":"^\\d+$","description":"Numeric webhook subscription id","example":"7"},"required":true,"name":"whId","in":"path"},{"schema":{"type":"string","format":"date-time","example":"2026-04-01T00:00:00Z"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","format":"date-time","example":"2026-04-02T00:00:00Z"},"required":false,"name":"to","in":"query"}],"responses":{"200":{"description":"Replay scheduled","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"enqueued":{"type":"number"}},"required":["enqueued"]}},"required":["data"]}}}},"401":{"description":"API key required"},"403":{"description":"Tier not eligible"},"404":{"description":"Webhook not found"}}}},"/v1/rwa":{"get":{"tags":["RWA"],"summary":"List RWA universe","description":"Paginated listing of all assets categorized as tokenized_treasury, t_bill_backed_stable, or rwa_credit, regardless of review status. Includes a per-row in_basket_a flag indicating membership in the rwa-tbill-conservative basket, plus the reviewer-of-record (latest signed attestation) when one exists.","parameters":[{"schema":{"type":"string","default":"1","description":"Page number (minimum 1)","example":"1"},"required":false,"name":"page","in":"query"},{"schema":{"type":"string","default":"20","description":"Items per page (1–100)","example":"20"},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","description":"Filter by chain_id","example":"1"},"required":false,"name":"chain","in":"query"},{"schema":{"type":"string","enum":["tokenized_treasury","t_bill_backed_stable","rwa_credit"],"description":"Filter by RWA category"},"required":false,"name":"category","in":"query"},{"schema":{"type":"string","enum":["reviewed","provisional","unreviewed"],"description":"Filter by review status"},"required":false,"name":"review_status","in":"query"},{"schema":{"type":"string","enum":["Prime","Core","Edge"],"description":"Filter by risk tier"},"required":false,"name":"risk_tier","in":"query"},{"schema":{"type":"string","enum":["40_act","reg_d_506c","reg_s","144a","cayman_bvi_feeder","mas_cms","sfc_type1","sfc_authorised","mica","bvi_fsc","bermuda_dab","unregulated","genius_act_stablecoin","ucits_mmf_sicav","bvi_siba"],"description":"Filter by regulatory wrapper"},"required":false,"name":"regulatory_wrapper","in":"query"},{"schema":{"type":"string","enum":["permissionless","kyc_required","accredited","qualified_purchaser","professional_investor","institutional_only"],"description":"Filter by investor-eligibility gate"},"required":false,"name":"kyc_gate","in":"query"},{"schema":{"type":"string","description":"Search symbol or address (case-insensitive substring)"},"required":false,"name":"search","in":"query"}],"responses":{"200":{"description":"RWA list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RwaListResponse"}}}}}}},"/v1/rwa/facets":{"get":{"tags":["RWA"],"summary":"RWA filter facets","description":"Aggregate counts across the entire RWA universe — useful for sizing filter chips and concentration bars on the listing page. Independent of any active filter.","responses":{"200":{"description":"Facet counts","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RwaFacetsResponse"}}}}}}},"/v1/rwa/{asset_id}":{"get":{"tags":["RWA"],"summary":"Get RWA asset detail","description":"Full institutional record for a single RWA asset: current asset_versions row, issuer, dimensions, institutional metadata, basket membership, plus version history (last 30 approved versions), signed attestation ledger (last 50), and discovery provenance (registry source that surfaced the asset).","parameters":[{"schema":{"type":"string","description":"Asset id (numeric)","example":"3881"},"required":true,"name":"asset_id","in":"path"}],"responses":{"200":{"description":"RWA detail","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RwaDetailResponse"}}}},"404":{"description":"Asset not found in RWA universe"}}}},"/v1/reviewers":{"get":{"tags":["Reviewers"],"summary":"List methodology reviewers","description":"Public roster of named methodology reviewers who attest to per-asset and per-vault classifications. Each row includes role, bio, profile URL, status, and the count of attestations the reviewer has authored. Active reviewers first, then by attestation count.","responses":{"200":{"description":"Reviewer roster","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"role":{"type":"string","enum":["methodology_lead","risk_analyst","asset_specialist","protocol_specialist","committee"]},"bio":{"type":"string","nullable":true},"profile_url":{"type":"string","nullable":true},"status":{"type":"string","enum":["active","inactive"]},"attestation_count":{"type":"integer","minimum":0}},"required":["id","name","role","bio","profile_url","status","attestation_count"]}}},"required":["data"]}}}}}}},"/v1/methodology":{"get":{"tags":["Methodology"],"summary":"Per-category scoring methodology + version registry","description":"Public registry of methodology versions (effective dates + changelogs) and per-category dimension weight vectors. A reader can independently reconstruct any asset_version row score from its dimensions + the weights for the methodology_version pinned on that row.","responses":{"200":{"description":"Methodology registry","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MethodologyResponse"}}}}}}}}}