{"openapi":"3.0.3","info":{"title":"Credit Coop API","description":"Backend API for Credit Coop cashflow-secured DeFi lending platform.\n\nTo chat with an AI agent about this API, use a prompt like \"Using https://api.creditcoop.xyz/docs/openapi.json tell me how to... ?\"","version":"3.0.0"},"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"x-api-key","description":"API key in the format: cc_xxx_yyy (for customer API routes)"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Clerk authentication token (session JWT or Clerk OAuth access token) used by Credit Coop"},"OAuth2":{"type":"oauth2","flows":{"authorizationCode":{"authorizationUrl":"https://clerk.creditcoop.xyz/oauth/authorize","tokenUrl":"https://clerk.creditcoop.xyz/oauth/token","scopes":{"openid":"OpenID Connect","email":"User email","profile":"User profile"}}},"description":"Credit Coop OAuth"}},"schemas":{"ErrorResponse":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer"}}},"Organization":{"type":"object","required":["id","name","slug"],"properties":{"id":{"type":"string","format":"uuid","description":"Organization unique identifier","example":"550e8400-e29b-41d4-a716-446655440000"},"name":{"type":"string","maxLength":255,"description":"Organization display name"},"slug":{"type":"string","maxLength":100,"description":"URL-friendly identifier"},"header":{"type":"string","nullable":true,"description":"Short tagline or headline for the organization profile"},"description":{"type":"string","nullable":true,"description":"Brief summary of the organization"},"overview":{"type":"string","nullable":true,"description":"Long-form organization description (may contain Markdown)"},"links":{"type":"array","description":"Organization links and image assets. Labels starting with \"#\" are image assets (e.g. \"#logo\", \"#header\"); all others are external links (e.g. \"Twitter\", \"Website\").","items":{"type":"object","required":["id","label","url"],"properties":{"id":{"type":"string","format":"uuid","description":"Link unique identifier"},"label":{"type":"string","description":"Link type. \"#logo\" and \"#header\" denote image assets; other values (e.g. \"Twitter\", \"Website\") denote external links."},"linkText":{"type":"string","nullable":true,"description":"Display text for external links (e.g. \"@raincards\", \"rain.xyz\")"},"iconUrl":{"type":"string","nullable":true,"description":"Icon image URL for external links"},"url":{"type":"string","description":"Target URL (image URL for asset links, destination URL for external links)"}}}}}},"Pagination":{"type":"object","required":["total","limit","offset"],"properties":{"total":{"type":"integer","description":"Total number of records matching the query"},"limit":{"type":"integer","description":"Maximum number of records returned per page"},"offset":{"type":"integer","description":"Number of records skipped from the start"}}},"IdParam":{"type":"object","required":["id"],"properties":{"id":{"type":"string","format":"uuid","description":"Resource ID"}}},"OrganizationIdParam":{"type":"object","required":["organizationId"],"properties":{"organizationId":{"type":"string","format":"uuid","description":"Organization ID"}}},"Token":{"type":"object","required":["id","address","networkId","symbol","decimals"],"properties":{"id":{"type":"string","format":"uuid","description":"Token unique identifier","example":"550e8400-e29b-41d4-a716-446655440000"},"address":{"type":"string","description":"Token contract address","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"networkId":{"type":"string","description":"CAIP-2 network identifier","example":"eip155:1"},"symbol":{"type":"string","description":"Token ticker symbol (e.g. \"USDC\", \"WETH\")"},"name":{"type":"string","nullable":true,"description":"Full token name"},"decimals":{"type":"integer","minimum":0,"maximum":255,"description":"Number of decimal places for the token"},"currency":{"type":"string","nullable":true,"description":"The currency this token is valued in (e.g. \"USD\" for USDC, \"ETH\" for WETH). Null when the token has no configured currency and is therefore not valued."},"wraps":{"type":"string","nullable":true,"deprecated":true,"description":"Deprecated — use `currency`. Returns the same value and will be removed in a future release."},"iconUrl":{"type":"string","nullable":true,"description":"URL of the token icon image"},"coingeckoId":{"type":"string","nullable":true,"description":"CoinGecko API identifier for price lookups"}}},"Network":{"type":"object","required":["networkId","displayName"],"properties":{"networkId":{"type":"string","description":"CAIP-2 network identifier","example":"eip155:1"},"displayName":{"type":"string","description":"Human-readable network name (e.g. \"Ethereum Mainnet\")"},"explorerUrl":{"type":"string","nullable":true,"description":"Block explorer base URL"},"rpcUrl":{"type":"string","nullable":true,"description":"RPC endpoint URL"},"iconUrl":{"type":"string","nullable":true,"description":"URL of the network icon image"},"nativeCurrencySymbol":{"type":"string","nullable":true,"description":"Native currency ticker (e.g. \"ETH\")"},"nativeCurrencyDecimals":{"type":"integer","nullable":true,"description":"Native currency decimal places"}}},"Currency":{"type":"object","required":["symbol","kind"],"properties":{"symbol":{"type":"string","description":"Currency code. Always upper-case.","example":"USD"},"displayName":{"type":"string","nullable":true,"description":"Human-readable currency name (e.g. \"US Dollar\")","example":"US Dollar"},"kind":{"type":"string","enum":["fiat","crypto"],"description":"Whether the currency is a fiat currency or a crypto asset","example":"fiat"}}},"Vault":{"type":"object","required":["id","address","networkId","protocolVersion","label","organizationId","deployedAt","publicListingEnabled"],"properties":{"id":{"type":"string","format":"uuid","description":"Vault unique identifier","example":"550e8400-e29b-41d4-a716-446655440000"},"address":{"type":"string","description":"Vault contract address","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"networkId":{"type":"string","description":"CAIP-2 network identifier","example":"eip155:1"},"publicListingEnabled":{"type":"boolean","description":"Whether this vault is opted into the public depositor-app surface. When true, the vault's `/v3/vaults/:id/{repayment-schedule,credit-history,redemption-queue,capacity}` routes are available; non-listed vaults 404 on those routes. Not sensitive — this is a public designation of an already-public vault.","example":false},"protocolVersion":{"type":"string","nullable":true,"description":"Credit Coop protocol/contract generation (\"v1\", \"v2\", or \"v3\"). Determines which fields apply — several facility and credit-line fields are v3 only. Null when not classified.","example":"v3"},"label":{"type":"string","nullable":true,"description":"Display label for the vault. Always present; null if not configured."},"organizationId":{"type":"string","format":"uuid","nullable":true,"description":"Vault curator organization ID","example":"550e8400-e29b-41d4-a716-446655440000"},"deployedAt":{"type":"string","format":"date-time","nullable":true,"description":"Timestamp when the vault contract was deployed","example":"2025-01-15T10:30:00Z"},"organization":{"nullable":true,"allOf":[{"$ref":"#/components/schemas/Organization"}],"description":"Organization details with links. Only included when expand includes \"organization\"."},"relatedAddresses":{"type":"object","nullable":true,"description":"On-chain related addresses. Only included when expand includes \"related-addresses\".","properties":{"creditStrategy":{"type":"string","nullable":true,"description":"CreditStrategy contract address. Manages credit allocation from vault funds to credit facilities.","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"liquidStrategy":{"type":"string","nullable":true,"description":"LiquidStrategy contract address. Manages liquid asset reserves in the vault.","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"vaultCurator":{"type":"string","nullable":true,"description":"Vault curator (manager) address of the CreditStrategy contract. Retrieved by calling manager() on the creditStrategy.","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"whitelister":{"type":"string","nullable":true,"description":"Access-control authority that gates the vault deposit whitelist. Set per vault. Null for v2 vaults.","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"synchronizer":{"type":"string","nullable":true,"description":"ERC-7540 Synchronizer contract for one-transaction deposit/redeem. Only for v3 vaults. Null for v2 vaults, or when none is set.","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"}}},"assets":{"type":"object","nullable":true,"description":"Asset information. Only included when expand includes \"assets\".","properties":{"assetToken":{"type":"string","nullable":true,"description":"Asset token address","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"shareToken":{"type":"string","nullable":true,"description":"Share token address","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"decimals":{"type":"integer","nullable":true,"description":"Asset token decimals"},"totalAssets":{"type":"string","nullable":true,"description":"Total assets in the vault (raw uint256 — divide by 10^decimals to get human-readable value)"},"totalLiquidAssets":{"type":"string","nullable":true,"description":"Total liquid assets. Vault's balance - total pending deposits - claimable redeem assets + liquid strategy total assets + uninvested credit strategy assets (raw uint256 — divide by 10^decimals to get human-readable value)"},"totalSupply":{"type":"string","nullable":true,"description":"Total supply of vault shares (raw uint256 — divide by 10^decimals to get human-readable value)"},"sharePrice":{"type":"string","nullable":true,"description":"Share price of the vault (raw uint256 — divide by 10^decimals to get human-readable value)"},"baseUnit":{"type":"string","nullable":true,"description":"Minimum accounting unit used by the CreditStrategy for scaling interest calculations (raw uint256). Equal to 10^decimals."},"totalActiveCredit":{"type":"string","nullable":true,"description":"Total active credit from CreditStrategy. Deposits plus accrued and repaid interest for all credit lines (raw uint256 — divide by 10^decimals to get human-readable value)"},"uninvestedCreditAssets":{"type":"string","nullable":true,"description":"Uninvested credit assets. Asset token balance held by CreditStrategy (raw uint256 — divide by 10^decimals to get human-readable value)"}}},"apy":{"type":"object","nullable":true,"description":"APY data from historical sharePrice snapshots. Only included when expand includes \"apy\".","properties":{"apyPct30D":{"type":"number","nullable":true,"description":"30-day APY in percent (e.g. 5.0 = 5%). Null if insufficient snapshot data."}}},"fees":{"type":"object","nullable":true,"description":"Credit strategy fees in basis points. Only included when expand includes \"fees\".","properties":{"managementFee":{"type":"integer","description":"Management fee in basis points (e.g. 200 = 2%)"},"performanceFee":{"type":"integer","description":"Performance fee in basis points (e.g. 1000 = 10%)"}}}}},"CreditFacility":{"type":"object","required":["id","address","networkId","protocolVersion","label","organizationId"],"properties":{"id":{"type":"string","format":"uuid","description":"Credit facility unique identifier","example":"550e8400-e29b-41d4-a716-446655440000"},"address":{"type":"string","description":"SecuredLine contract address","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"networkId":{"type":"string","description":"CAIP-2 network identifier","example":"eip155:1"},"protocolVersion":{"type":"string","nullable":true,"description":"Credit Coop protocol/contract generation (\"v1\", \"v2\", or \"v3\"). Determines which fields apply — several facility and credit-line fields are v3 only. Null when not classified.","example":"v3"},"label":{"type":"string","nullable":true,"description":"Display label for the credit facility. Always present; null if not configured."},"organizationId":{"type":"string","format":"uuid","nullable":true,"description":"Borrower organization ID","example":"550e8400-e29b-41d4-a716-446655440000"},"organization":{"nullable":true,"allOf":[{"$ref":"#/components/schemas/Organization"}],"description":"Organization details with links. Only included when expand includes \"organization\"."},"relatedAddresses":{"type":"object","nullable":true,"description":"On-chain related addresses. Only included when expand includes \"related-addresses\".","properties":{"spigot":{"type":"string","nullable":true,"description":"v1/v2 only. Spigot contract address. Captures and routes borrower revenue to debt repayment. Null for v3 facilities (no spigot layer).","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"borrower":{"type":"string","nullable":true,"description":"Address authorized to borrow, repay, and close credit lines. Present on all versions.","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"admin":{"type":"string","nullable":true,"description":"v1/v2 only. Credit facility administrator address. Null for v3 facilities.","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"spigotOperator":{"type":"string","nullable":true,"description":"v1/v2 only. Address authorized to execute revenue claims on the Spigot. Null for v3 facilities.","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"escrow":{"type":"string","nullable":true,"description":"v2 only. Escrow contract address. Holds collateral posted by the borrower and enforces the minimum collateral ratio. Null for v1/v3 facilities (v3 collateral lives on the Servicing contract).","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"servicing":{"type":"string","nullable":true,"description":"v3 only. The facility's bound Servicing contract — the per-borrower hub for covenants, collateral, and cross-default. Null for v1/v2 facilities.","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"servicingId":{"type":"string","format":"uuid","nullable":true,"description":"v3 only. Resource ID of the bound Servicing (use with GET /v3/servicings/:id). Null when the Servicing address is not registered, or for v1/v2 facilities.","example":"550e8400-e29b-41d4-a716-446655440000"},"commitmentToken":{"type":"string","nullable":true,"description":"v3 only. The ERC-721 CommitmentToken singleton — the NFT contract representing every commitment/credit line in the facility (ownerOf(lineTokenId) is the lender). Facility-wide: the same contract for every line. Null for v1/v2 facilities (no commitment-NFT layer).","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"}}},"fees":{"type":"object","nullable":true,"description":"Fee configuration for the Credit Facility. Only included when expand includes \"fees\".","required":["originationFee","swapFee","servicingFee","drawFee","repayFee"],"properties":{"originationFee":{"type":"string","nullable":true,"description":"Origination fee (basis points). Present on v2 and v3."},"swapFee":{"type":"string","nullable":true,"description":"v2 only. Swap fee (basis points). Null for v3."},"servicingFee":{"type":"string","nullable":true,"description":"v2 only. Servicing fee (basis points). Null for v3."},"drawFee":{"type":"string","nullable":true,"description":"v3 only. Per-draw fee (basis points, FEE_DRAW). Null for v1/v2."},"repayFee":{"type":"string","nullable":true,"description":"v3 only. Per-repay fee (basis points, FEE_REPAY). Null for v1/v2."}}},"counts":{"type":"object","nullable":true,"description":"Active credit lines and open proposals counts. Only included when expand includes \"counts\".","required":["activeCreditLines","openProposals"],"properties":{"activeCreditLines":{"type":"integer","description":"Number of active credit lines"},"openProposals":{"type":"integer","description":"Number of open mutual consent proposals"}}},"status":{"type":"object","nullable":true,"description":"On-chain status for this facility. Only included when expand includes \"status\". An open facility may report LIQUIDATABLE when its borrower is in cross-default; once a facility is closed it reports REPAID and reflects only its own terminal outcome, never absorbing the borrower's wider default state. Borrower-wide default and covenant breach levels are reported per cross-default group on GET /v3/borrowers (expand=status).","required":["code","label","facilityClosed"],"properties":{"code":{"type":"integer","description":"Numeric status code (0: UNINITIALIZED, 1: ACTIVE, 2: LIQUIDATABLE, 3: REPAID, 4: INSOLVENT, 5: ABORTED)"},"label":{"type":"string","enum":["UNINITIALIZED","ACTIVE","LIQUIDATABLE","REPAID","INSOLVENT","ABORTED","UNKNOWN"],"description":"Human-readable status label. UNKNOWN is returned when the on-chain status code is outside the known range (e.g., a new status added by a future contract version)."},"facilityClosed":{"type":"boolean","description":"Whether this specific facility is closed (terminal). Always present whenever status is present (the entire status object is omitted when unavailable). For a closed facility code/label report REPAID; for an open facility they may additionally reflect borrower-wide cross-default (LIQUIDATABLE)."}}},"collateral":{"type":"object","nullable":true,"description":"On-chain collateral state from the Escrow contract. Only included when expand includes \"collateral\". Null when the facility has no escrow, RPC is unavailable, or the facility predates the Escrow architecture.","required":["maxLtvBps","totalOutstandingDebt","collateralValue","ltvBps","targetLtvBps","collateralTokens"],"properties":{"maxLtvBps":{"type":"string","nullable":true,"description":"Maximum loan-to-value ratio allowed for this facility, in basis points (10000 = 100%). Computed server-side as 10000² / minimumCollateralRatio (integer floor). Null when the facility does not enforce a collateral requirement.","example":"8000"},"totalOutstandingDebt":{"type":"string","nullable":true,"description":"Total outstanding debt in USD as a formatted decimal string with trailing zeros trimmed (e.g. \"1234.56\"). The debt token's decimals are read from the first active credit position and applied server-side. \"0\" when there are no active positions. Null when the facility does not enforce a collateral requirement.","example":"1234.56"},"collateralValue":{"type":"string","nullable":true,"description":"Collateral value in USD as a formatted decimal string with trailing zeros trimmed (e.g. \"2000\" or \"1999.99\"). Formatted server-side. Null when the facility does not enforce a collateral requirement.","example":"2000"},"ltvBps":{"type":"string","nullable":true,"description":"Current loan-to-value ratio in basis points: (totalOutstandingDebt × 10000) / collateralValue, computed server-side from raw on-chain values (decimals normalized before division). \"0\" when there is no outstanding debt. \"999999999\" (sentinel) when debt is positive but on-chain collateral value is 0 — the facility is effectively infinitely undercollateralized. Null when the facility does not enforce a collateral requirement, or when debt decimals could not be resolved.","example":"6666"},"targetLtvBps":{"type":"string","nullable":true,"description":"Target LTV in basis points. Defines the minimum collateral value required to back the facility's credit limit (min collateral ≈ creditLimit × 10000 / targetLtvBps). Null when no target is configured for this facility.","example":"7500"},"collateralTokens":{"type":"array","description":"Every token ever enabled as collateral on the Escrow, with its current on-chain amount and USD value. May be empty if EnableCollateral events have not been ingested for this Escrow.","items":{"type":"object","required":["address","amount","decimals","usdValue"],"properties":{"address":{"type":"string","description":"Collateral token address (ERC-20).","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"amount":{"type":"string","nullable":true,"description":"Current on-chain collateral amount (raw uint256; divide by `decimals` to get human-readable value). Null if the on-chain `getCollateralData` read failed."},"decimals":{"type":"integer","nullable":true,"description":"Decimals of the collateral token itself (for rendering `amount`). Null if ERC-20 metadata could not be fetched."},"usdValue":{"type":"string","nullable":true,"description":"USD value of the current collateral amount as a human-readable decimal string (e.g. \"1234.56\"), up to 6 decimal places with trailing zeros trimmed. Null if amount, price, or decimals is unavailable."}}}}}},"totals":{"type":"object","nullable":true,"description":"v3 only. Facility-level aggregates for the facility's single asset: native-unit amounts plus `creditLimitUsd` (the total credit limit in USD). Only included when expand includes \"totals\". Null for v1/v2 facilities — their credit lines can use different tokens, so a single-asset total (and one `decimals`) is not meaningful (use the USD totals on GET /v3/credit-facilities/{id}/credit-lines instead). Also null for a v3 facility when the on-chain read is unavailable; use protocolVersion to distinguish the two cases.","required":["totalCommitment","totalDrawn","drawnRate","undrawnRate","token","decimals","creditLimitUsd"],"properties":{"totalCommitment":{"type":"string","nullable":true,"description":"The facility's total committed credit across its active credit lines, raw uint256 — divide by 10^decimals for a human-readable value. Closed lines no longer count toward the commitment."},"creditLimitUsd":{"type":"string","nullable":true,"description":"The facility's total credit limit in USD — totalCommitment priced in `token` at request time, as a human-readable decimal string. Null when totalCommitment is null, decimals is unavailable, or the token is unpriced. (For v1/v2, use creditLimitUsd on GET /v3/credit-facilities/{id}/credit-lines instead.)","example":"1234567.89"},"totalDrawn":{"type":"string","nullable":true,"description":"The facility's total drawn principal across its credit lines, raw uint256 — divide by 10^decimals for a human-readable value."},"drawnRate":{"type":"string","nullable":true,"description":"Facility-default draw rate in basis points (DRAWN_RATE_BPS) — interest on drawn principal. Individual commitments may override this; see each credit line's drawRate for the effective per-line rate. Null if the facility exposes no per-facility rate getter (e.g. TIERED)."},"undrawnRate":{"type":"string","nullable":true,"description":"Facility-default undrawn rate in basis points (UNDRAWN_RATE_BPS) — interest on the undrawn commitment. Individual commitments may override this; see each credit line's facilityRate for the effective per-line rate. Null if the facility exposes no per-facility rate getter (e.g. TIERED)."},"token":{"type":"string","nullable":true,"description":"The single ERC-20 asset every credit line in the facility is denominated in — the unit of totalCommitment and totalDrawn.","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"decimals":{"type":"integer","nullable":true,"description":"Decimals of the facility asset (token), for formatting the raw amounts above."}}}}},"CreditLine":{"type":"object","required":["lineTokenId"],"properties":{"lineTokenId":{"type":"string","description":"Credit line token ID"},"deposit":{"type":"string","nullable":true,"description":"Deposit amount (raw uint256 — divide by 10^decimals to get human-readable value)"},"creditLimit":{"type":"string","nullable":true,"description":"Credit limit (raw uint256 — divide by 10^decimals to get human-readable value). For open lines: equals current deposit. For closed lines: deposit from the most recent AddCredit or IncreaseCredit event."},"principal":{"type":"string","nullable":true,"description":"Principal amount borrowed (raw uint256 — divide by 10^decimals to get human-readable value)"},"interestBalance":{"type":"string","nullable":true,"description":"Total interest held by the credit line: the sum of interestAccrued and interestRepaid (raw uint256 — divide by 10^decimals to get human-readable value)."},"interestAccrued":{"type":"string","nullable":true,"description":"Interest accrued and owed by the borrower but not yet repaid (raw uint256 — divide by 10^decimals to get human-readable value)."},"interestRepaid":{"type":"string","nullable":true,"description":"Interest already repaid by the borrower into the credit line and held for the lender to claim/withdraw; resets to zero once the lender claims/withdraws it (raw uint256 — divide by 10^decimals to get human-readable value)."},"token":{"type":"string","nullable":true,"description":"Token address for this credit line","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"decimals":{"type":"integer","nullable":true,"description":"Token decimals"},"isOpen":{"type":"boolean","nullable":true,"description":"Whether the credit line is open"},"isRestricted":{"type":"boolean","nullable":true,"description":"Whether the credit line is restricted. Null for v3 (no equivalent)."},"earlyWithdrawalFee":{"type":"string","nullable":true,"description":"Early withdrawal fee in basis points. Null for v3 (no equivalent)."},"deadline":{"type":"string","format":"date-time","nullable":true,"description":"Credit line deadline","example":"2025-01-15T10:30:00Z"},"drawRate":{"type":"string","nullable":true,"description":"Draw rate in basis points (interest rate on borrowed principal)"},"facilityRate":{"type":"string","nullable":true,"description":"Facility rate in basis points (interest rate on unused deposit)"},"apyPct":{"type":"number","nullable":true,"description":"Computed APY as a percentage (e.g. 5.0 = 5.0%). Weighted average of drawRate on principal and facilityRate on unused deposit."},"createdTxHash":{"type":"string","nullable":true,"description":"Transaction hash of the AddCredit event that created this line"},"createdBlockNumber":{"type":"integer","nullable":true,"description":"Block number when this credit line was created"},"createdAt":{"type":"string","format":"date-time","nullable":true,"description":"Timestamp when this credit line was created. May be null for refinanced commitments.","example":"2025-01-15T10:30:00Z"},"commitmentValue":{"type":"string","nullable":true,"description":"v3 only. Canonical par value of the commitment (drawn + interestOwed + claimable + undrawn residual), raw uint256. Null for v2. As of the last on-chain accrual checkpoint."},"claimable":{"type":"string","nullable":true,"description":"v3 only. Repaid/closed proceeds currently claimable by the commitment owner, raw uint256. Null for v2."},"facilityKind":{"type":"string","nullable":true,"enum":["RevolvingCreditFacility","TermLoanFacility","DelayedDrawTermLoanFacility","TieredFacility"],"description":"v3 only. Facility kind — the on-chain contract class name. One of \"RevolvingCreditFacility\", \"TermLoanFacility\", \"DelayedDrawTermLoanFacility\", \"TieredFacility\". Null for v2."},"isDefaulted":{"type":"boolean","nullable":true,"description":"v3 only. Cross-default (impairment) flag for the position's borrower. Null for v2."},"priority":{"type":"string","nullable":true,"description":"v3 only. Repayment-queue seniority of this commitment (raw uint256; the on-chain terms.priority). Sort by it client-side if you need a strict seniority ordering — the array is not guaranteed to be priority-sorted. Closed lines report `0` (on-chain storage is cleared on close), so drop closed lines before sorting. Null for v1/v2."},"fees":{"type":"object","nullable":true,"description":"Only included when expand=fees is specified. Null if fetching failed.","required":["originationFees"],"properties":{"originationFees":{"type":"string","nullable":true,"description":"Origination fees for this credit line (raw uint256 — divide by 10^decimals to get human-readable value). Null if unavailable."}}},"error":{"type":"string","nullable":true,"description":"Error message if fetching this credit line failed. Other fields will be null."},"publicAlias":{"type":"string","nullable":true,"description":"Borrower's public display name (from the organization's `metadata.publicAlias`). Present once redaction has run (see `services/vault-redaction.ts`); null if unset."}}},"Servicing":{"type":"object","required":["id","address","networkId","organizationId"],"properties":{"id":{"type":"string","format":"uuid","description":"Servicing unique identifier","example":"550e8400-e29b-41d4-a716-446655440000"},"address":{"type":"string","description":"Servicing contract address","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"networkId":{"type":"string","description":"CAIP-2 network identifier","example":"eip155:8453"},"organizationId":{"type":"string","format":"uuid","nullable":true,"description":"Borrower organization ID","example":"550e8400-e29b-41d4-a716-446655440000"},"status":{"type":"object","nullable":true,"description":"On-chain cross-default health of the servicing. Only included when expand includes \"status\".","required":["closed","isDefaulted","breachLevel"],"properties":{"closed":{"type":"boolean","nullable":true,"description":"Whether the servicing has been wound down (terminal). Null when unavailable."},"isDefaulted":{"type":"boolean","nullable":true,"description":"Whether the borrower is in cross-default — one covenant breach gates every facility under this servicing. Null when unavailable."},"breachLevel":{"type":"string","nullable":true,"enum":["NONE","CURING","DEFAULTED"],"description":"Worst covenant breach level across the servicing. Null when it cannot be determined."}}},"asset":{"type":"object","nullable":true,"description":"The accounting unit every raw amount on this servicing (collateral value, capacity) is denominated in. Only included when expand includes \"asset\".","required":["token","decimals"],"properties":{"token":{"type":"string","nullable":true,"description":"Address of the accounting asset. Null when the servicing has no facilities yet or it could not be resolved.","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"decimals":{"type":"integer","nullable":true,"description":"Decimals of the accounting asset — divide any raw uint256 amount by 10^decimals to get a human-readable value. Null when unavailable."}}},"organization":{"nullable":true,"allOf":[{"$ref":"#/components/schemas/Organization"}],"description":"Organization details with links. Only included when expand includes \"organization\"."},"relatedAddresses":{"type":"object","nullable":true,"description":"Servicer (owner), borrower, and trustee addresses. Only included when expand includes \"related-addresses\".","required":["owner","borrower","trustee"],"properties":{"owner":{"type":"string","nullable":true,"description":"The servicer — the owner of this Servicing hub (gates servicing actions). Distinct from the borrower and trustee.","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"borrower":{"type":"string","nullable":true,"description":"The borrower this servicing serves.","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"trustee":{"type":"string","nullable":true,"description":"Recipient of seized collateral on liquidation.","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"}}},"collateral":{"type":"array","nullable":true,"description":"The shared collateral pool, one entry per registered collateral. Only included when expand includes \"collateral\".","items":{"type":"object","required":["address","advanceRateBps","value","decimals","valueUsd","level","asset","collateralToken","released","owner"],"properties":{"address":{"type":"string","description":"Collateral contract address.","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"advanceRateBps":{"type":"integer","nullable":true,"description":"Share of this collateral's value that counts toward the borrowing base, in basis points (10000 = 100%). Null if unavailable.","example":8000},"value":{"type":"string","nullable":true,"description":"Raw mark-to-market value (uint256) denominated in `asset` — divide by 10^`decimals` for the human amount. Null if unavailable."},"decimals":{"type":"integer","nullable":true,"description":"Decimals of `asset` — the shared precision of `value` and `valueUsd`. Null when the denomination could not be determined, or when `asset` is known but its on-chain `decimals()` read failed.","example":6},"valueUsd":{"type":"string","nullable":true,"description":"USD value as a human-readable decimal string, priced in `asset`. This is the correct number for the LTV sum (the server picks the right per-collateral token). Null when `asset` is unpriced or the denomination could not be determined.","example":"1234.56"},"level":{"type":"string","nullable":true,"enum":["NONE","CURING","DEFAULTED"],"description":"Breach level reported by this collateral. Null if unavailable."},"asset":{"type":"string","nullable":true,"description":"The ERC-20 token that `value` and `valueUsd` are denominated in (so `asset`, `value`, `decimals`, and `valueUsd` are all mutually consistent). For a normal deposited-token collateral this is the same as `collateralToken`. It differs only for a revenue collateral, whose `value` is a fixed appraisal expressed in the facility's accounting unit rather than in the revenue token it collects — there `asset` is that accounting unit. Null when the denomination could not be determined.","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"collateralToken":{"type":"string","nullable":true,"description":"The collateral's underlying on-chain token — use this for a \"Token\" column. For a deposited-token collateral it is the escrowed token; for a revenue collateral it is the token the revenue is paid in. Null for a collateral that pledges a contract rather than a token. Usually equals `asset`; it differs only for a revenue collateral (valued in the accounting unit, not the revenue token) — in that case use `valueUsd`/`asset`/`decimals` for the numbers and `collateralToken` only for display.","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"released":{"type":"boolean","nullable":true,"description":"Whether this collateral has been released. A released collateral no longer backs the borrowing base, so exclude it when summing `valueUsd` into a collateral-coverage total (its `valueUsd` is still reported). Null if unavailable."},"owner":{"type":"string","nullable":true,"description":"The escrow owner that gates deposit/withdraw actions. Null if unavailable.","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"}}}},"facilities":{"type":"array","nullable":true,"description":"The facilities bound to this servicing. Only included when expand includes \"facilities\".","items":{"type":"object","required":["address","facilityId","organizationId"],"properties":{"address":{"type":"string","description":"Facility contract address.","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"facilityId":{"type":"string","format":"uuid","nullable":true,"description":"Resource ID of the facility (use with GET /v3/credit-facilities/:id). Null when the facility address is not registered."},"organizationId":{"type":"string","format":"uuid","nullable":true,"description":"Organization ID of the facility, when registered."}}}},"capacity":{"type":"object","nullable":true,"description":"Shared borrowing-base aggregates across every facility. Only included when expand includes \"capacity\". All amounts are raw uint256 in the accounting unit — divide by 10^decimals.","required":["totalAdvancedValue","totalDrawn","totalCommitted","remainingDrawCapacity","remainingOriginationCapacity"],"properties":{"totalAdvancedValue":{"type":"string","nullable":true,"description":"The shared borrowing base. Null if unavailable."},"totalDrawn":{"type":"string","nullable":true,"description":"Total drawn across all facilities. Null if unavailable."},"totalCommitted":{"type":"string","nullable":true,"description":"Total committed across all facilities. Null if unavailable."},"remainingDrawCapacity":{"type":"string","nullable":true,"description":"Borrowing base remaining for new draws (floored at 0). Null when an input is unavailable."},"remainingOriginationCapacity":{"type":"string","nullable":true,"description":"Borrowing base remaining for new originations (floored at 0). Null when an input is unavailable."}}},"covenants":{"type":"array","nullable":true,"description":"Per-covenant breach levels behind the cross-default status. Only included when expand includes \"covenants\".","items":{"type":"object","required":["address","level","cureWindow","kind","defaultedSince","params"],"properties":{"address":{"type":"string","description":"Covenant contract address.","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"level":{"type":"string","nullable":true,"enum":["NONE","CURING","DEFAULTED"],"description":"Breach level for this covenant. Null if unavailable."},"cureWindow":{"type":"string","nullable":true,"description":"Grace period in seconds before a breach escalates from CURING to DEFAULTED. Null if unavailable, or for a collateral entry (collaterals also appear here but expose no cure window).","example":"86400"},"kind":{"type":"string","nullable":true,"description":"Covenant contract class name (from on-chain kind()) — one of the six threshold classes \"GreaterThanCovenant\", \"AtLeastCovenant\", \"LessThanCovenant\", \"AtMostCovenant\", \"EqualCovenant\", \"NotEqualCovenant\", or \"InvariantCovenant\", \"MaturityCovenant\", \"AttestationCovenant\", \"SigningAuthorityCovenant\" (a collateral entry surfaces its adapter class name instead). Determines which \"params\" are present. Null if unavailable.","example":"GreaterThanCovenant"},"defaultedSince":{"type":"string","nullable":true,"description":"Unix timestamp (seconds) this covenant entered DEFAULTED, as a raw uint256 string. \"0\" means not currently defaulted. Null if unavailable.","example":"0"},"params":{"type":"object","nullable":true,"description":"Kind-specific covenant configuration. Present for every recognized covenant family (threshold, invariant, maturity, attestation, signing-authority), with only that family's fields populated; null for collateral entries and unrecognized kinds.","properties":{"target":{"type":"string","nullable":true,"description":"Contract the covenant reads to evaluate compliance (threshold and invariant covenants).","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"callData":{"type":"string","nullable":true,"description":"View-call calldata read on \"target\" to obtain the reading, as raw hex (threshold and invariant covenants).","example":"0x18160ddd"},"op":{"type":"string","nullable":true,"enum":["GT","GTE","LT","LTE","EQ","NEQ"],"description":"Comparison operator applied to the reading vs. threshold, derived from the covenant class name (threshold covenants only)."},"threshold":{"type":"string","nullable":true,"description":"Value the reading is compared against, as a raw uint256 string (threshold covenants only).","example":"100000000000"},"expectedHash":{"type":"string","nullable":true,"description":"keccak256 of the expected staticcall return, as a bytes32 hex string (Invariant only).","example":"0x290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e563"},"facility":{"type":"string","nullable":true,"description":"Credit facility whose commitment maturities the covenant watches (Maturity only).","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"signer":{"type":"string","nullable":true,"description":"Wallet that must submit periodic attestations (SigningAuthority only).","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"attestationWindow":{"type":"string","nullable":true,"description":"Seconds an attestation stays fresh, as a raw uint256 string (SigningAuthority only).","example":"604800"},"deployedAt":{"type":"string","nullable":true,"description":"Deploy timestamp (unix seconds, raw uint256 string) anchoring the first attestation deadline (SigningAuthority only).","example":"1712345678"},"servicer":{"type":"string","nullable":true,"description":"Party authorized to declare/cure off-chain breaches (Attestation only).","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"}}}}}}}}}},"paths":{"/v3/platform/networks":{"get":{"operationId":"listNetworks","summary":"List supported blockchain networks","tags":["Platform"],"description":"List all supported blockchain networks","security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{"OAuth2":[]},{}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["networks"],"properties":{"networks":{"type":"array","items":{"$ref":"#/components/schemas/Network"}}}}}}}}}},"/v3/platform/currencies":{"get":{"operationId":"listCurrencies","summary":"List configured currencies","tags":["Platform"],"description":"The currencies this platform has configured. `POST /v3/self-report/cashflows` matches its `currency` field against this list case-insensitively; a symbol that is not on it is still accepted and stored verbatim. Being on the list does not by itself mean a currency has a price feed.","security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{"OAuth2":[]},{}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["currencies"],"properties":{"currencies":{"type":"array","items":{"$ref":"#/components/schemas/Currency"}}}}}}}}}},"/v3/platform/tokens":{"get":{"operationId":"listTokens","summary":"List supported tokens","tags":["Platform"],"description":"List all supported tokens with optional filters. No authentication required, but authenticated requests may receive increased rate limits.","parameters":[{"schema":{"type":"string"},"in":"query","name":"address","required":false,"description":"Filter by contract address (0x...). Example: 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},{"schema":{"type":"string"},"in":"query","name":"networkId","required":false,"description":"Filter by CAIP-2 network ID (e.g. eip155:8453)"}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{"OAuth2":[]},{}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["tokens"],"properties":{"tokens":{"type":"array","items":{"$ref":"#/components/schemas/Token"}}}}}}}}}},"/v3/platform/stats":{"get":{"operationId":"getPlatformStats","summary":"Get platform statistics","tags":["Platform"],"description":"Get all platform statistics in a single response. No authentication required, but authenticated requests may receive increased rate limits.","security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{"OAuth2":[]},{}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["totalVolumeUsd","activeLoansUsd","totalInterestPaidUsd","totalBorrowedUsd","borrowCount","repayCount","repayPrincipalCount","repayInterestCount","valuationIncomplete"],"properties":{"totalVolumeUsd":{"type":"string","description":"Total volume in USD (borrows + repayments). Returned as a string to avoid floating-point precision loss.","example":"1234567.890000"},"activeLoansUsd":{"type":"string","description":"Current outstanding principal in USD. Returned as a string to avoid floating-point precision loss.","example":"500000.000000"},"totalInterestPaidUsd":{"type":"string","description":"Total interest paid in USD. Returned as a string to avoid floating-point precision loss.","example":"45678.900000"},"totalBorrowedUsd":{"type":"string","description":"Cumulative total borrowed in USD (all time). Returned as a string to avoid floating-point precision loss.","example":"2000000.000000"},"borrowCount":{"type":"integer","description":"Total number of borrow entries across all organizations.","example":128},"repayCount":{"type":"integer","description":"Total number of repay entries across all organizations (principal + interest).","example":342},"repayPrincipalCount":{"type":"integer","description":"Number of principal repay entries across all organizations.","example":210},"repayInterestCount":{"type":"integer","description":"Number of interest repay entries across all organizations.","example":132},"valuationIncomplete":{"type":"boolean","description":"True when one or more outstanding balances could not be valued in USD and were counted as zero, so `activeLoansUsd` is off by an unknown amount in an unknown direction — a balance is a net, so an omitted one may have been negative. Read it as a partial valuation, not as a bound. False means every outstanding balance was valued. Only `activeLoansUsd` is affected; the historical totals are unaffected.","example":false}}}}}}}}},"/v3/platform/stats/vault-apys":{"get":{"operationId":"getPlatformVaultApys","summary":"Get vault APYs","tags":["Platform"],"description":"Get APY for all lending vaults from sharePrice snapshots. No authentication required, but authenticated requests may receive increased rate limits.","parameters":[{"schema":{"type":"integer","default":30},"in":"query","name":"period","required":false,"description":"Number of days to look back for APY calculation"}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{"OAuth2":[]},{}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["weightedApyBps","weightedApyPct","totalTvl","periodDays","vaultCount","decimals"],"properties":{"weightedApyBps":{"type":"number","description":"TVL-weighted average APY in basis points"},"weightedApyPct":{"type":"number","description":"TVL-weighted average APY as percentage number (e.g. 8.50 = 8.50%)"},"totalTvl":{"type":"string"},"periodDays":{"type":"number"},"vaultCount":{"type":"number"},"decimals":{"type":"integer","description":"Max decimals used for TVL normalization across vaults"}}}}}}}}},"/v3/platform/stats/time-series":{"get":{"operationId":"getPlatformTimeSeries","summary":"Get platform activity time-series","tags":["Platform"],"description":"Platform-wide borrow/repay totals bucketed by period, with cumulative outstanding. Every period in the range is returned, including quiet ones: a period with no borrowing or repayment reports zero totals and carries the outstanding position forward. A carried position is valued at its own period end, so netOutstandingUsd can differ from the period before it even when nothing was borrowed or repaid — a change there is not by itself evidence of activity. Aggregate-only — no per-borrower data. No authentication required.","parameters":[{"schema":{"type":"string","maxLength":50},"in":"query","name":"networkId","required":false,"description":"CAIP-2 network filter (e.g. \"eip155:1\")"},{"schema":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"startDate","required":false,"description":"Inclusive start date (YYYY-MM-DD)"},{"schema":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"endDate","required":false,"description":"Inclusive end date (YYYY-MM-DD)"},{"schema":{"type":"string","enum":["monthly","daily"],"default":"monthly"},"in":"query","name":"granularity","required":false}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{"OAuth2":[]},{}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["series"],"properties":{"series":{"type":"array","items":{"type":"object","required":["period","borrowUsd","repayPrincipalUsd","repayInterestUsd","netOutstandingUsd","cumulativeVolumeUsd","valuationIncomplete"],"properties":{"period":{"type":"string","description":"'YYYY-MM' (monthly) or 'YYYY-MM-DD' (daily)"},"borrowUsd":{"type":"string","description":"Total borrowed in USD this period."},"repayPrincipalUsd":{"type":"string","description":"Total principal repaid in USD this period."},"repayInterestUsd":{"type":"string","description":"Total interest repaid in USD this period."},"netOutstandingUsd":{"type":"string","description":"Outstanding principal in USD at the end of the period, including borrowing carried in from before the requested window. Reported for every period, so this reads as a continuous balance rather than only where activity occurred. Each period is valued at its own end date, so a quiet period can still report a different figure from the one before it: the position carried forward, its valuation did not. Only for a book held entirely in stablecoins does the figure repeat verbatim."},"cumulativeVolumeUsd":{"type":"string","description":"Cumulative total volume in USD (borrow + repaid principal + interest) through the end of the period, including volume from before the requested window."},"valuationIncomplete":{"type":"boolean","description":"True when one or more balances outstanding at the end of this period could not be valued in USD and were counted as zero, so `netOutstandingUsd` is off by an unknown amount in an unknown direction — a balance is a net, so an omitted one may have been negative. Read it as a partial valuation, not as a bound. Reported per period rather than for the series as a whole, so a balance that became valuable later flags only the periods it actually affected. The other figures in the period are unaffected."}}}}}}}}}}}},"/v3/platform/stats/tvl/time-series":{"get":{"operationId":"getPlatformTvlTimeSeries","summary":"Get platform TVL time-series","tags":["Platform"],"description":"Platform-wide TVL bucketed by period, from vault totalAssets() snapshots. Includes disabled vaults. Aggregate-only — no per-borrower data. No authentication required.","parameters":[{"schema":{"type":"string","maxLength":50},"in":"query","name":"networkId","required":false,"description":"CAIP-2 network filter (e.g. \"eip155:1\")"},{"schema":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"startDate","required":false,"description":"Inclusive start date (YYYY-MM-DD). Defaults to a safe lookback window."},{"schema":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"endDate","required":false,"description":"Inclusive end date (YYYY-MM-DD). Defaults to today (UTC)."},{"schema":{"type":"string","enum":["monthly","daily"],"default":"monthly"},"in":"query","name":"granularity","required":false}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{"OAuth2":[]},{}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["series"],"properties":{"series":{"type":"array","items":{"type":"object","required":["period","tvl"],"properties":{"period":{"type":"string","description":"'YYYY-MM' (monthly) or 'YYYY-MM-DD' (daily)"},"tvl":{"type":"string","description":"Total value locked in USD at end of period."}}}}}}}}}}}},"/v3/platform/stats/vault-apys/time-series":{"get":{"operationId":"getPlatformVaultApysTimeSeries","summary":"Get platform weighted-APY time-series","tags":["Platform"],"description":"Platform-wide TVL-weighted APY bucketed by period, from vault sharePrice()/totalAssets() snapshots. Includes disabled vaults. Aggregate-only — no per-borrower data. No authentication required.","parameters":[{"schema":{"type":"string","maxLength":50},"in":"query","name":"networkId","required":false,"description":"CAIP-2 network filter (e.g. \"eip155:1\")"},{"schema":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"startDate","required":false,"description":"Inclusive start date (YYYY-MM-DD). Defaults to a safe lookback window."},{"schema":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"endDate","required":false,"description":"Inclusive end date (YYYY-MM-DD). Defaults to today (UTC)."},{"schema":{"type":"string","enum":["monthly","daily"],"default":"monthly"},"in":"query","name":"granularity","required":false},{"schema":{"type":"integer","default":30,"minimum":1,"maximum":366},"in":"query","name":"period","required":false,"description":"Trailing APY lookback window in days (independent of granularity). Default 30, max 366."}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{"OAuth2":[]},{}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["series"],"properties":{"series":{"type":"array","items":{"type":"object","required":["period","weightedApyBps","weightedApyPct","totalTvl","decimals","vaultCount"],"properties":{"period":{"type":"string","description":"'YYYY-MM' (monthly) or 'YYYY-MM-DD' (daily)"},"weightedApyBps":{"type":["null","number"],"description":"TVL-weighted APY in basis points; null when no vault has enough history in the bucket."},"weightedApyPct":{"type":["null","number"],"description":"TVL-weighted APY as percentage number (e.g. 8.50 = 8.50%); null mirrors weightedApyBps."},"totalTvl":{"type":"string","description":"Total weight (scaled totalAssets) used for the bucket."},"decimals":{"type":"integer","description":"Max decimals used to normalize the bucket TVL weights."},"vaultCount":{"type":"integer","description":"Vaults that contributed APY + weight to the bucket."}}}}}}}}}}}},"/v3/api-keys":{"post":{"operationId":"createApiKey","summary":"Create API key","tags":["API Keys"],"description":"Create a new API key for the specified organization. The key authenticates requests as a member of that organization.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organizationId":{"type":"string","format":"uuid","description":"The organization this API key belongs to. Requests authenticated with this key will be made as a member of this organization. Example: 550e8400-e29b-41d4-a716-446655440000"},"name":{"type":"string","maxLength":255,"description":"Name for the API key"},"expiresInDays":{"type":"number","description":"Number of days until the key expires"}},"required":["organizationId","name"]}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{"OAuth2":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["id","organizationId","keyPrefix","name","fullKey","createdAt","message"],"properties":{"id":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"},"organizationId":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"},"keyPrefix":{"type":"string","example":"cc_abc123"},"name":{"type":"string"},"fullKey":{"type":"string","description":"Full API key. Only returned once at creation — save it immediately."},"expiresAt":{"type":"string","format":"date-time","nullable":true,"example":"2025-01-15T10:30:00Z"},"createdAt":{"type":"string","format":"date-time","example":"2025-01-15T10:30:00Z"},"message":{"type":"string"}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"get":{"operationId":"listApiKeys","summary":"List API keys","tags":["API Keys"],"description":"List all API keys scoped to the specified organization.","parameters":[{"schema":{"type":"string","format":"uuid"},"in":"query","name":"organizationId","required":true,"description":"Organization ID — only keys belonging to this organization are returned. Example: 550e8400-e29b-41d4-a716-446655440000"}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{"OAuth2":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["keys"],"properties":{"keys":{"type":"array","items":{"type":"object","required":["id","organizationId","keyPrefix","name","createdAt","updatedAt"],"properties":{"id":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"},"organizationId":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"},"keyPrefix":{"type":"string","example":"cc_abc123"},"name":{"type":"string"},"lastUsedAt":{"type":"string","format":"date-time","nullable":true,"example":"2025-01-15T10:30:00Z"},"expiresAt":{"type":"string","format":"date-time","nullable":true,"example":"2025-01-15T10:30:00Z"},"revokedAt":{"type":"string","format":"date-time","nullable":true,"example":"2025-01-15T10:30:00Z"},"createdAt":{"type":"string","format":"date-time","example":"2025-01-15T10:30:00Z"},"updatedAt":{"type":"string","format":"date-time","example":"2025-01-15T10:30:00Z"}}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v3/api-keys/{apiKeyId}":{"delete":{"operationId":"revokeApiKey","summary":"Revoke an API key","tags":["API Keys"],"description":"Revoke an API key. The organization is derived from the key itself.","security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{"OAuth2":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"apiKeyId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["success","message"],"properties":{"success":{"type":"boolean"},"message":{"type":"string"}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v3/ledger/borrows":{"get":{"operationId":"listBorrows","summary":"List credit facility borrow events","tags":["Ledger"],"description":"Get on-chain borrow events for an organization. Each row represents a single `Borrow` event emitted by a SecuredLine credit facility — the moment outstanding principal was drawn against the line.\n\nResults are sorted by `occurredAt` (descending — newest first). Ordering is not configurable from the query string.\n\nSupports three response formats via the `format` query parameter:\n- **json** (default) — paginated JSON (default limit 100, max 1000).\n- **csv** — streamed CSV file download (up to 1,000,000 rows). Columns: inflow, transaction, type, timestamp, amount, usdValue, tokenAddress, tokenIcon, tokenSymbol.\n- **event-stream** — Server-Sent Events stream (up to 1,000,000 rows). Each entry is emitted as a named `entry` event with JSON data. A final `done` event carries `{\"total\": N}`. Connect with `EventSource` or `fetch`:\n\n```js\nconst es = new EventSource('/v3/ledger/borrows?organizationId={id}&format=event-stream', {\n  headers: { 'x-api-key': 'cc_...' },\n});\nes.addEventListener('entry', (e) => console.log(JSON.parse(e.data)));\nes.addEventListener('done', (e) => { console.log('total:', JSON.parse(e.data).total); es.close(); });\n```\n\nRequires org membership or vault curator role (public orgs only).","parameters":[{"schema":{"type":"string","format":"uuid","maxLength":36,"example":"550e8400-e29b-41d4-a716-446655440000"},"in":"query","name":"organizationId","required":true,"description":"Organization ID (must be an org the caller is a member of, or a public org if caller is a vault curator)."},{"schema":{"type":"string","format":"date","example":"2025-01-15"},"in":"query","name":"startDate","required":false,"description":"Optional filter. Inclusive start date (YYYY-MM-DD); restricts results to `occurredAt >= startDate` (or `snapshotDate` for collateral-snapshots). Omit to leave the start unbounded."},{"schema":{"type":"string","format":"date","example":"2025-01-31"},"in":"query","name":"endDate","required":false,"description":"Optional filter. Inclusive end date (YYYY-MM-DD). Omit to leave the end unbounded."},{"schema":{"type":"integer","minimum":1},"in":"query","name":"limit","required":false,"description":"Maximum records returned. Format-dependent: `format=json` capped at 1000 (default 100); `format=csv|event-stream` capped at 1,000,000 (default 1,000,000). Values outside these caps are silently clamped server-side."},{"schema":{"type":"integer","minimum":0,"default":0},"in":"query","name":"offset","required":false,"description":"Number of records to skip from the start (JSON pagination only — ignored for csv/event-stream)."},{"schema":{"type":"string","enum":["json","csv","event-stream"],"default":"json"},"in":"query","name":"format","required":false,"description":"Response format. `json` returns paginated JSON. `csv` streams a CSV file download. `event-stream` returns Server-Sent Events: each row is a named `entry` event; a final `done` event carries `{\"total\": N}`."},{"schema":{"type":"string","maxLength":50,"example":"eip155:1"},"in":"query","name":"networkId","required":false,"description":"Optional filter. CAIP-2 network identifier; restricts results to a single chain. Omit to return all networks."},{"schema":{"type":"string","maxLength":42,"pattern":"^0x[0-9a-fA-F]{40}$","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"in":"query","name":"facilityAddress","required":false,"description":"Optional filter. Credit facility (SecuredLine) contract address; restricts results to a single facility. Omit to return all facilities for the organization."},{"schema":{"type":"array","style":"form","explode":false,"items":{"type":"string","enum":["v1","v2","v3"]}},"in":"query","name":"protocolVersion","required":false,"description":"Filter by protocol version(s). Comma-separated or repeated (e.g. `?protocolVersion=v1,v2` or `?protocolVersion=v1&protocolVersion=v2`). Omit to return all versions."}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{"OAuth2":[]}],"responses":{"200":{"description":"Credit facility borrow events.","content":{"application/json":{"schema":{"type":"object","required":["entries","pagination"],"properties":{"entries":{"type":"array","items":{"type":"object","required":["id","organizationId","evmLogId","facilityAddress","amount","currency","symbol","tokenSymbol","tokenAddress","tokenNetworkId","occurredAt","dataSource","networkId","transactionHash","logIndex","createdAt"],"properties":{"id":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"},"organizationId":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"},"evmLogId":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"},"facilityAddress":{"type":"string","maxLength":42,"pattern":"^0x[0-9a-fA-F]{40}$","description":"Credit facility (SecuredLine) contract address.","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"amount":{"type":"string","description":"Token amount with full decimal precision. Returned as a string to avoid floating-point precision loss."},"amountUsd":{"type":"string","nullable":true,"description":"USD value at time of entry. Returned as a string. May be `null` when no historical price is available for the currency.","example":"1234567.890000"},"currency":{"type":"string","deprecated":true,"description":"Deprecated — use `tokenSymbol` (the asset that moved) and `symbol` (the currency it is valued in). This field returns `tokenSymbol ?? symbol` and will be removed in a future release."},"symbol":{"type":"string","nullable":true,"description":"The currency this amount is valued in. Null when the asset has no configured currency, in which case `amountUsd` is also null."},"tokenSymbol":{"type":"string","nullable":true,"description":"Ticker of the asset that moved, as recorded at the time. Null for off-chain rows."},"tokenAddress":{"type":"string","nullable":true,"description":"Contract address (EVM) or mint (Solana) of the asset that moved. Null for off-chain rows."},"tokenNetworkId":{"type":"string","nullable":true,"description":"CAIP-2 network the asset lives on. Null for off-chain rows.","example":"eip155:1"},"occurredAt":{"type":"string","format":"date-time","example":"2025-01-15T10:30:00Z"},"dataSource":{"type":"string","description":"Origin of the data, e.g. `blockchain:ethereum`, `blockchain:base`."},"networkId":{"type":"string","description":"CAIP-2 network identifier.","example":"eip155:1"},"transactionHash":{"type":"string","description":"0x-prefixed transaction hash."},"logIndex":{"type":"integer","description":"Position of the log within the transaction."},"createdAt":{"type":"string","format":"date-time","example":"2025-01-15T10:30:00Z"},"organizationName":{"type":"string","nullable":true,"description":"Display name of the owning organization."},"organizationSlug":{"type":"string","nullable":true,"description":"URL-safe slug of the owning organization."}}}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}},"text/csv":{"schema":{"type":"string","description":"CSV file download. Columns: inflow, transaction, type, timestamp, amount, usdValue, tokenAddress, tokenIcon, tokenSymbol."}},"text/event-stream":{"schema":{"type":"string","description":"SSE stream. Named `entry` events carry one row each; a final `done` event carries `{\"total\": N}`."}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v3/ledger/repays":{"get":{"operationId":"listRepays","summary":"List credit facility repayment events","tags":["Ledger"],"description":"Get on-chain repayment events for an organization. Each row represents a `RepayPrincipal` or `RepayInterest` event emitted by a SecuredLine credit facility. Filter by `repaymentType` to restrict to one subtype.\n\nResults are sorted by `occurredAt` (descending — newest first). Ordering is not configurable from the query string.\n\nSupports three response formats via the `format` query parameter:\n- **json** (default) — paginated JSON (default limit 100, max 1000).\n- **csv** — streamed CSV file download (up to 1,000,000 rows). Columns: inflow, transaction, type, timestamp, amount, usdValue, tokenAddress, tokenIcon, tokenSymbol.\n- **event-stream** — Server-Sent Events stream (up to 1,000,000 rows). Each entry is emitted as a named `entry` event with JSON data. A final `done` event carries `{\"total\": N}`. Connect with `EventSource` or `fetch`:\n\n```js\nconst es = new EventSource('/v3/ledger/repays?organizationId={id}&format=event-stream', {\n  headers: { 'x-api-key': 'cc_...' },\n});\nes.addEventListener('entry', (e) => console.log(JSON.parse(e.data)));\nes.addEventListener('done', (e) => { console.log('total:', JSON.parse(e.data).total); es.close(); });\n```\n\nRequires org membership or vault curator role (public orgs only).","parameters":[{"schema":{"type":"string","format":"uuid","maxLength":36,"example":"550e8400-e29b-41d4-a716-446655440000"},"in":"query","name":"organizationId","required":true,"description":"Organization ID (must be an org the caller is a member of, or a public org if caller is a vault curator)."},{"schema":{"type":"string","format":"date","example":"2025-01-15"},"in":"query","name":"startDate","required":false,"description":"Optional filter. Inclusive start date (YYYY-MM-DD); restricts results to `occurredAt >= startDate` (or `snapshotDate` for collateral-snapshots). Omit to leave the start unbounded."},{"schema":{"type":"string","format":"date","example":"2025-01-31"},"in":"query","name":"endDate","required":false,"description":"Optional filter. Inclusive end date (YYYY-MM-DD). Omit to leave the end unbounded."},{"schema":{"type":"integer","minimum":1},"in":"query","name":"limit","required":false,"description":"Maximum records returned. Format-dependent: `format=json` capped at 1000 (default 100); `format=csv|event-stream` capped at 1,000,000 (default 1,000,000). Values outside these caps are silently clamped server-side."},{"schema":{"type":"integer","minimum":0,"default":0},"in":"query","name":"offset","required":false,"description":"Number of records to skip from the start (JSON pagination only — ignored for csv/event-stream)."},{"schema":{"type":"string","enum":["json","csv","event-stream"],"default":"json"},"in":"query","name":"format","required":false,"description":"Response format. `json` returns paginated JSON. `csv` streams a CSV file download. `event-stream` returns Server-Sent Events: each row is a named `entry` event; a final `done` event carries `{\"total\": N}`."},{"schema":{"type":"string","enum":["principal","interest"]},"in":"query","name":"repaymentType","required":false,"description":"Optional filter. Restricts results to a single repayment subtype: `principal` (reduces outstanding principal) or `interest` (paid to depositors). Omit to return both."},{"schema":{"type":"string","maxLength":50,"example":"eip155:1"},"in":"query","name":"networkId","required":false,"description":"Optional filter. CAIP-2 network identifier; restricts results to a single chain. Omit to return all networks."},{"schema":{"type":"string","maxLength":42,"pattern":"^0x[0-9a-fA-F]{40}$","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"in":"query","name":"facilityAddress","required":false,"description":"Optional filter. Credit facility (SecuredLine) contract address; restricts results to a single facility. Omit to return all facilities for the organization."},{"schema":{"type":"array","style":"form","explode":false,"items":{"type":"string","enum":["v1","v2","v3"]}},"in":"query","name":"protocolVersion","required":false,"description":"Filter by protocol version(s). Comma-separated or repeated (e.g. `?protocolVersion=v1,v2` or `?protocolVersion=v1&protocolVersion=v2`). Omit to return all versions."}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{"OAuth2":[]}],"responses":{"200":{"description":"Credit facility repayment events.","content":{"application/json":{"schema":{"type":"object","required":["entries","pagination"],"properties":{"entries":{"type":"array","items":{"type":"object","required":["id","organizationId","evmLogId","repaymentType","facilityAddress","amount","currency","symbol","tokenSymbol","tokenAddress","tokenNetworkId","occurredAt","dataSource","networkId","transactionHash","logIndex","createdAt"],"properties":{"id":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"},"organizationId":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"},"evmLogId":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"},"repaymentType":{"type":"string","enum":["principal","interest"],"description":"Repayment subtype: `principal` reduces outstanding principal; `interest` is paid to depositors."},"facilityAddress":{"type":"string","maxLength":42,"pattern":"^0x[0-9a-fA-F]{40}$","description":"Credit facility (SecuredLine) contract address.","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"amount":{"type":"string","description":"Token amount with full decimal precision. Returned as a string to avoid floating-point precision loss."},"amountUsd":{"type":"string","nullable":true,"description":"USD value at time of entry. Returned as a string. May be `null` when no historical price is available for the currency.","example":"1234567.890000"},"currency":{"type":"string","deprecated":true,"description":"Deprecated — use `tokenSymbol` (the asset that moved) and `symbol` (the currency it is valued in). This field returns `tokenSymbol ?? symbol` and will be removed in a future release."},"symbol":{"type":"string","nullable":true,"description":"The currency this amount is valued in. Null when the asset has no configured currency, in which case `amountUsd` is also null."},"tokenSymbol":{"type":"string","nullable":true,"description":"Ticker of the asset that moved, as recorded at the time. Null for off-chain rows."},"tokenAddress":{"type":"string","nullable":true,"description":"Contract address (EVM) or mint (Solana) of the asset that moved. Null for off-chain rows."},"tokenNetworkId":{"type":"string","nullable":true,"description":"CAIP-2 network the asset lives on. Null for off-chain rows.","example":"eip155:1"},"occurredAt":{"type":"string","format":"date-time","example":"2025-01-15T10:30:00Z"},"dataSource":{"type":"string"},"networkId":{"type":"string","example":"eip155:1"},"transactionHash":{"type":"string"},"logIndex":{"type":"integer"},"createdAt":{"type":"string","format":"date-time","example":"2025-01-15T10:30:00Z"},"organizationName":{"type":"string","nullable":true,"description":"Display name of the owning organization."},"organizationSlug":{"type":"string","nullable":true,"description":"URL-safe slug of the owning organization."}}}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}},"text/csv":{"schema":{"type":"string","description":"CSV file download. Columns: inflow, transaction, type, timestamp, amount, usdValue, tokenAddress, tokenIcon, tokenSymbol."}},"text/event-stream":{"schema":{"type":"string","description":"SSE stream. Named `entry` events carry one row each; a final `done` event carries `{\"total\": N}`."}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v3/ledger/transfers":{"get":{"operationId":"listCashflowTransfers","summary":"List individual cashflow transfer events","tags":["Ledger"],"description":"Get individual cashflow transfer events for an organization. Each row is a single movement of value (on-chain `Transfer`, off-chain wire/ACH, swap leg, etc.) classified by stage (`external` → `in_transit` → `secured` → `settled`) and direction (inflow / outflow). Set `excludeLinkedTransfers=true` to drop transfers whose tx hash matches a known borrow/repay and avoid double-counting against `/v3/ledger/borrows` and `/v3/ledger/repays`.\n\nResults are sorted by `occurredAt` (descending — newest first). Ordering is not configurable from the query string.\n\nSupports three response formats via the `format` query parameter:\n- **json** (default) — paginated JSON (default limit 100, max 1000).\n- **csv** — streamed CSV file download (up to 1,000,000 rows). Columns: inflow, transaction, type, timestamp, amount, usdValue, tokenAddress, tokenIcon, tokenSymbol.\n- **event-stream** — Server-Sent Events stream (up to 1,000,000 rows). Each entry is emitted as a named `entry` event with JSON data. A final `done` event carries `{\"total\": N}`. Connect with `EventSource` or `fetch`:\n\n```js\nconst es = new EventSource('/v3/ledger/transfers?organizationId={id}&format=event-stream', {\n  headers: { 'x-api-key': 'cc_...' },\n});\nes.addEventListener('entry', (e) => console.log(JSON.parse(e.data)));\nes.addEventListener('done', (e) => { console.log('total:', JSON.parse(e.data).total); es.close(); });\n```\n\nRequires org membership or vault curator role (public orgs only).","parameters":[{"schema":{"type":"string","format":"uuid","maxLength":36,"example":"550e8400-e29b-41d4-a716-446655440000"},"in":"query","name":"organizationId","required":true,"description":"Organization ID (must be an org the caller is a member of, or a public org if caller is a vault curator)."},{"schema":{"type":"string","format":"date","example":"2025-01-15"},"in":"query","name":"startDate","required":false,"description":"Optional filter. Inclusive start date (YYYY-MM-DD); restricts results to `occurredAt >= startDate` (or `snapshotDate` for collateral-snapshots). Omit to leave the start unbounded."},{"schema":{"type":"string","format":"date","example":"2025-01-31"},"in":"query","name":"endDate","required":false,"description":"Optional filter. Inclusive end date (YYYY-MM-DD). Omit to leave the end unbounded."},{"schema":{"type":"integer","minimum":1},"in":"query","name":"limit","required":false,"description":"Maximum records returned. Format-dependent: `format=json` capped at 1000 (default 100); `format=csv|event-stream` capped at 1,000,000 (default 1,000,000). Values outside these caps are silently clamped server-side."},{"schema":{"type":"integer","minimum":0,"default":0},"in":"query","name":"offset","required":false,"description":"Number of records to skip from the start (JSON pagination only — ignored for csv/event-stream)."},{"schema":{"type":"string","enum":["json","csv","event-stream"],"default":"json"},"in":"query","name":"format","required":false,"description":"Response format. `json` returns paginated JSON. `csv` streams a CSV file download. `event-stream` returns Server-Sent Events: each row is a named `entry` event; a final `done` event carries `{\"total\": N}`."},{"schema":{"type":"string","maxLength":50,"example":"eip155:1"},"in":"query","name":"networkId","required":false,"description":"Optional filter. CAIP-2 network identifier; restricts results to a single chain. Omit to return all networks."},{"schema":{"type":"string","maxLength":255},"in":"query","name":"accountId","required":false,"description":"Optional filter. Wallet address (on-chain) or bank account identifier (off-chain); restricts results to a single account. Omit to return all accounts."},{"schema":{"type":"string","enum":["external","in_transit","secured","settled"]},"in":"query","name":"stage","required":false,"description":"Optional filter. Cash-flow stage (`external` → `in_transit` → `secured` → `settled`); restricts results to a single stage. Omit to return all stages."},{"schema":{"type":"string","maxLength":20},"in":"query","name":"type","required":false,"description":"Optional filter. Transfer mechanism; restricts results to a single mechanism (common values: `swap`, `bridge`, `onramp`, `wire`, `ach`, `direct`). Omit to return all mechanisms."},{"schema":{"type":"boolean"},"in":"query","name":"inflow","required":false,"description":"Optional filter. `true` = arriving only, `false` = leaving only. Omit to return both directions."},{"schema":{"type":"boolean","default":false},"in":"query","name":"excludeLinkedTransfers","required":false,"description":"Optional. When `true`, excludes transfers whose tx hash matches a known borrow/repay event, to avoid double-counting with /v3/ledger/borrows and /v3/ledger/repays. Defaults to `false`."}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{"OAuth2":[]}],"responses":{"200":{"description":"Individual cashflow transfer events.","content":{"application/json":{"schema":{"type":"object","required":["entries","pagination"],"properties":{"entries":{"type":"array","items":{"type":"object","required":["id","organizationId","inflow","stage","accountId","amount","currency","symbol","tokenSymbol","tokenAddress","tokenNetworkId","occurredAt","dataSource","createdAt"],"properties":{"id":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"},"organizationId":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"},"webCaptureId":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000","nullable":true},"evmLogId":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000","nullable":true},"inflow":{"type":"boolean","description":"true = arriving, false = leaving."},"stage":{"type":"string","enum":["external","in_transit","secured","settled"],"description":"Cash-flow stage at time of capture (`external` → `in_transit` → `secured` → `settled`)."},"type":{"type":"string","nullable":true,"description":"Transfer mechanism (common values: `swap`, `bridge`, `onramp`, `wire`, `ach`, `direct`)."},"accountId":{"type":"string","description":"Wallet address (on-chain) or bank account identifier (off-chain)."},"institutionId":{"type":"string","nullable":true,"description":"Source institution that reported this transfer (e.g. `self_report`, `visa`)."},"externalTransactionId":{"type":"string","nullable":true,"description":"Source-system identifier for the transaction."},"amount":{"type":"string","description":"Token amount with full decimal precision. Returned as a string to avoid floating-point precision loss."},"amountUsd":{"type":"string","nullable":true,"description":"USD value at time of entry. Returned as a string. May be `null` when no historical price is available for the currency.","example":"1234567.890000"},"currency":{"type":"string","deprecated":true,"description":"Deprecated — use `tokenSymbol` (the asset that moved) and `symbol` (the currency it is valued in). This field returns `tokenSymbol ?? symbol` and will be removed in a future release."},"symbol":{"type":"string","nullable":true,"description":"The currency this amount is valued in. Null when the asset has no configured currency, in which case `amountUsd` is also null."},"tokenSymbol":{"type":"string","nullable":true,"description":"Ticker of the asset that moved, as recorded at the time. Null for off-chain rows."},"tokenAddress":{"type":"string","nullable":true,"description":"Contract address (EVM) or mint (Solana) of the asset that moved. Null for off-chain rows."},"tokenNetworkId":{"type":"string","nullable":true,"description":"CAIP-2 network the asset lives on. Null for off-chain rows.","example":"eip155:1"},"occurredAt":{"type":"string","format":"date-time","example":"2025-01-15T10:30:00Z"},"dataSource":{"type":"string"},"networkId":{"type":"string","nullable":true,"example":"eip155:1"},"transactionHash":{"type":"string","nullable":true},"logIndex":{"type":"integer","nullable":true},"createdAt":{"type":"string","format":"date-time","example":"2025-01-15T10:30:00Z"},"organizationName":{"type":"string","nullable":true,"description":"Display name of the owning organization."},"organizationSlug":{"type":"string","nullable":true,"description":"URL-safe slug of the owning organization."}}}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}},"text/csv":{"schema":{"type":"string","description":"CSV file download. Columns: inflow, transaction, type, timestamp, amount, usdValue, tokenAddress, tokenIcon, tokenSymbol."}},"text/event-stream":{"schema":{"type":"string","description":"SSE stream. Named `entry` events carry one row each; a final `done` event carries `{\"total\": N}`."}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v3/ledger/cumulative-cashflows":{"get":{"operationId":"listCumulativeCashflows","summary":"List aggregate daily cashflow snapshots","tags":["Ledger"],"description":"Get daily aggregate cashflow snapshots reported by an institution (e.g. `self_report`, `visa`) on behalf of an organization. Unlike `/v3/ledger/transfers`, each row is a *period summary* — typically one row per (institution, day, direction) — not an individual transaction. Use this endpoint when you want pre-aggregated totals; use `/v3/ledger/transfers` for line-item activity.\n\nResults are sorted by `occurredAt` (descending — newest first). Ordering is not configurable from the query string.\n\nSupports three response formats via the `format` query parameter:\n- **json** (default) — paginated JSON (default limit 100, max 1000).\n- **csv** — streamed CSV file download (up to 1,000,000 rows). Columns: inflow, transaction, type, timestamp, amount, usdValue, tokenAddress, tokenIcon, tokenSymbol.\n- **event-stream** — Server-Sent Events stream (up to 1,000,000 rows). Each entry is emitted as a named `entry` event with JSON data. A final `done` event carries `{\"total\": N}`. Connect with `EventSource` or `fetch`:\n\n```js\nconst es = new EventSource('/v3/ledger/cumulative-cashflows?organizationId={id}&format=event-stream', {\n  headers: { 'x-api-key': 'cc_...' },\n});\nes.addEventListener('entry', (e) => console.log(JSON.parse(e.data)));\nes.addEventListener('done', (e) => { console.log('total:', JSON.parse(e.data).total); es.close(); });\n```\n\nRequires org membership or vault curator role (public orgs only).","parameters":[{"schema":{"type":"string","format":"uuid","maxLength":36,"example":"550e8400-e29b-41d4-a716-446655440000"},"in":"query","name":"organizationId","required":true,"description":"Organization ID (must be an org the caller is a member of, or a public org if caller is a vault curator)."},{"schema":{"type":"string","format":"date","example":"2025-01-15"},"in":"query","name":"startDate","required":false,"description":"Optional filter. Inclusive start date (YYYY-MM-DD); restricts results to `occurredAt >= startDate` (or `snapshotDate` for collateral-snapshots). Omit to leave the start unbounded."},{"schema":{"type":"string","format":"date","example":"2025-01-31"},"in":"query","name":"endDate","required":false,"description":"Optional filter. Inclusive end date (YYYY-MM-DD). Omit to leave the end unbounded."},{"schema":{"type":"integer","minimum":1},"in":"query","name":"limit","required":false,"description":"Maximum records returned. Format-dependent: `format=json` capped at 1000 (default 100); `format=csv|event-stream` capped at 1,000,000 (default 1,000,000). Values outside these caps are silently clamped server-side."},{"schema":{"type":"integer","minimum":0,"default":0},"in":"query","name":"offset","required":false,"description":"Number of records to skip from the start (JSON pagination only — ignored for csv/event-stream)."},{"schema":{"type":"string","enum":["json","csv","event-stream"],"default":"json"},"in":"query","name":"format","required":false,"description":"Response format. `json` returns paginated JSON. `csv` streams a CSV file download. `event-stream` returns Server-Sent Events: each row is a named `entry` event; a final `done` event carries `{\"total\": N}`."},{"schema":{"type":"string","maxLength":100,"example":"self_report"},"in":"query","name":"institutionId","required":false,"description":"Optional filter. Source institution that reported the aggregate (e.g. `self_report`, `visa`); restricts results to a single institution. Omit to return all institutions."},{"schema":{"type":"string","enum":["external","in_transit","secured","settled"]},"in":"query","name":"stage","required":false,"description":"Optional filter. Cash-flow stage (`external` → `in_transit` → `secured` → `settled`); restricts results to a single stage. Omit to return all stages."},{"schema":{"type":"boolean"},"in":"query","name":"inflow","required":false,"description":"Optional filter. `true` = arriving only, `false` = leaving only. Omit to return both directions."}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{"OAuth2":[]}],"responses":{"200":{"description":"Aggregate daily cashflow snapshots.","content":{"application/json":{"schema":{"type":"object","required":["entries","pagination"],"properties":{"entries":{"type":"array","items":{"type":"object","required":["id","organizationId","webCaptureId","inflow","stage","institutionId","externalTransactionId","amount","currency","symbol","occurredAt","dataSource","createdAt"],"properties":{"id":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"},"organizationId":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"},"webCaptureId":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"},"inflow":{"type":"boolean"},"stage":{"type":"string","enum":["external","in_transit","secured","settled"],"description":"Cash-flow stage at time of capture (`external` → `in_transit` → `secured` → `settled`)."},"accountId":{"type":"string","nullable":true},"institutionId":{"type":"string","description":"Source institution that reported this aggregate (e.g. `self_report`, `visa`)."},"externalTransactionId":{"type":"string","description":"Source-system identifier for the aggregate."},"amount":{"type":"string","description":"Token amount with full decimal precision. Returned as a string to avoid floating-point precision loss."},"amountUsd":{"type":"string","nullable":true,"description":"USD value at time of entry. Returned as a string. May be `null` when no historical price is available for the currency.","example":"1234567.890000"},"currency":{"type":"string","deprecated":true,"description":"Deprecated — use `tokenSymbol` (the asset that moved) and `symbol` (the currency it is valued in). This field returns `tokenSymbol ?? symbol` and will be removed in a future release."},"symbol":{"type":"string","nullable":false,"description":"The reported currency of this aggregate."},"occurredAt":{"type":"string","format":"date-time","example":"2025-01-15T10:30:00Z"},"dataSource":{"type":"string"},"createdAt":{"type":"string","format":"date-time","example":"2025-01-15T10:30:00Z"},"organizationName":{"type":"string","nullable":true,"description":"Display name of the owning organization."},"organizationSlug":{"type":"string","nullable":true,"description":"URL-safe slug of the owning organization."}}}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}},"text/csv":{"schema":{"type":"string","description":"CSV file download. Columns: inflow, transaction, type, timestamp, amount, usdValue, tokenAddress, tokenIcon, tokenSymbol."}},"text/event-stream":{"schema":{"type":"string","description":"SSE stream. Named `entry` events carry one row each; a final `done` event carries `{\"total\": N}`."}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v3/ledger/cumulative-collateral":{"get":{"operationId":"listCumulativeCollateral","summary":"List point-in-time collateral USD snapshots","tags":["Ledger"],"description":"Get daily collateral USD snapshots for an organization. Each row is the total USD value of collateral held on a given calendar day — one row per organization per day. Use this for time-series collateral charts and coverage ratios; combine with `/v3/ledger/borrows` + `/v3/ledger/repays` to compute net leverage over time.\n\nResults are sorted by `snapshotDate` (descending — newest first). Ordering is not configurable from the query string.\n\nSupports three response formats via the `format` query parameter:\n- **json** (default) — paginated JSON (default limit 100, max 1000).\n- **csv** — streamed CSV file download (up to 1,000,000 rows). Columns: snapshotDate, amountUsd, organizationId, organizationName, createdAt.\n- **event-stream** — Server-Sent Events stream (up to 1,000,000 rows). Each entry is emitted as a named `entry` event with JSON data. A final `done` event carries `{\"total\": N}`. Connect with `EventSource` or `fetch`:\n\n```js\nconst es = new EventSource('/v3/ledger/cumulative-collateral?organizationId={id}&format=event-stream', {\n  headers: { 'x-api-key': 'cc_...' },\n});\nes.addEventListener('entry', (e) => console.log(JSON.parse(e.data)));\nes.addEventListener('done', (e) => { console.log('total:', JSON.parse(e.data).total); es.close(); });\n```\n\nRequires org membership or vault curator role (public orgs only).","parameters":[{"schema":{"type":"string","format":"uuid","maxLength":36,"example":"550e8400-e29b-41d4-a716-446655440000"},"in":"query","name":"organizationId","required":true,"description":"Organization ID (must be an org the caller is a member of, or a public org if caller is a vault curator)."},{"schema":{"type":"string","format":"date","example":"2025-01-15"},"in":"query","name":"startDate","required":false,"description":"Optional filter. Inclusive start date (YYYY-MM-DD); restricts results to `occurredAt >= startDate` (or `snapshotDate` for collateral-snapshots). Omit to leave the start unbounded."},{"schema":{"type":"string","format":"date","example":"2025-01-31"},"in":"query","name":"endDate","required":false,"description":"Optional filter. Inclusive end date (YYYY-MM-DD). Omit to leave the end unbounded."},{"schema":{"type":"integer","minimum":1},"in":"query","name":"limit","required":false,"description":"Maximum records returned. Format-dependent: `format=json` capped at 1000 (default 100); `format=csv|event-stream` capped at 1,000,000 (default 1,000,000). Values outside these caps are silently clamped server-side."},{"schema":{"type":"integer","minimum":0,"default":0},"in":"query","name":"offset","required":false,"description":"Number of records to skip from the start (JSON pagination only — ignored for csv/event-stream)."},{"schema":{"type":"string","enum":["json","csv","event-stream"],"default":"json"},"in":"query","name":"format","required":false,"description":"Response format. `json` returns paginated JSON. `csv` streams a CSV file download. `event-stream` returns Server-Sent Events: each row is a named `entry` event; a final `done` event carries `{\"total\": N}`."}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{"OAuth2":[]}],"responses":{"200":{"description":"Point-in-time collateral USD snapshots (one row per org per day).","content":{"application/json":{"schema":{"type":"object","required":["entries","pagination"],"properties":{"entries":{"type":"array","items":{"type":"object","required":["id","organizationId","webCaptureId","amountUsd","snapshotDate","createdAt"],"properties":{"id":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"},"organizationId":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"},"organizationName":{"type":"string","nullable":true},"webCaptureId":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"},"amountUsd":{"type":"string","description":"USD value (6 fractional digits). Returned as a string to avoid floating-point precision loss.","example":"1234567.890000"},"snapshotDate":{"type":"string","format":"date","example":"2025-01-15"},"createdAt":{"type":"string","format":"date-time","example":"2025-01-15T10:30:00Z"}}}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}},"text/csv":{"schema":{"type":"string","description":"CSV file download. Columns: snapshotDate, amountUsd, organizationId, organizationName, createdAt."}},"text/event-stream":{"schema":{"type":"string","description":"SSE stream. Named `entry` events carry one row each; a final `done` event carries `{\"total\": N}`."}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v3/self-report/cashflows":{"post":{"operationId":"submitSelfReportCashflows","summary":"Submit self-reported cashflows","tags":["Self Report"],"description":"Submit cashflow items for the authenticated organization. Each entry in `items` takes one of three shapes, selected by its `type` field:\n\n- `transaction` — an individual transaction with a precise `datetime` and a required `externalId` for deduplication.\n- `aggregate` — a daily total for a `date` (zero allowed for no-activity days).\n- `collateral` — a cumulative collateral snapshot for a `date`.\n\nItems flow through the standard capture → normalize pipeline. Transactions and aggregates become ledger entries; collateral snapshots are stored in the dedicated collateral_snapshots table.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["items"],"properties":{"items":{"type":"array","minItems":1,"items":{"description":"A single cashflow item. Its shape is selected by the `type` field: transaction, aggregate, or collateral.","oneOf":[{"title":"Transaction","description":"Individual transaction (type=transaction). Requires a precise datetime and an externalId for deduplication.","type":"object","required":["type","amount","currency","datetime","direction","externalId"],"properties":{"type":{"type":"string","enum":["transaction"]},"amount":{"type":"number","exclusiveMinimum":0,"description":"Transaction amount (positive)"},"currency":{"type":"string","minLength":1,"maxLength":20,"description":"Currency code — e.g. `USD`, `ETH`, `EUR`. Matched against the configured currencies — see `GET /v3/platform/currencies` for the current list. An unrecognised symbol is ACCEPTED rather than rejected.","example":"USD"},"datetime":{"type":"string","format":"date-time","description":"ISO 8601 datetime (e.g. 2026-03-01T14:30:00Z)"},"direction":{"type":"string","enum":["inflow","outflow"],"description":"Cashflow direction"},"externalId":{"type":"string","minLength":1,"maxLength":255,"description":"Customer transaction ID (required for deduplication)"},"category":{"type":"string","maxLength":100}}},{"title":"Aggregate","description":"Daily aggregate total (type=aggregate). Zero allowed for no-activity days.","type":"object","required":["type","amount","currency","date","direction"],"properties":{"type":{"type":"string","enum":["aggregate"]},"amount":{"type":"number","minimum":0,"description":"Aggregate amount (zero allowed for no-activity days)"},"currency":{"type":"string","minLength":1,"maxLength":20,"description":"Currency code — e.g. `USD`, `ETH`, `EUR`. Matched against the configured currencies — see `GET /v3/platform/currencies` for the current list. An unrecognised symbol is ACCEPTED rather than rejected.","example":"USD"},"date":{"type":"string","format":"date","description":"ISO 8601 date (YYYY-MM-DD)"},"direction":{"type":"string","enum":["inflow","outflow"],"description":"Cashflow direction"},"category":{"type":"string","maxLength":100}}},{"title":"Collateral","description":"Cumulative collateral snapshot (type=collateral).","type":"object","required":["type","amount","currency","date"],"properties":{"type":{"type":"string","enum":["collateral"]},"amount":{"type":"number","minimum":0,"description":"Cumulative collateral amount (zero allowed)"},"currency":{"type":"string","minLength":1,"maxLength":20,"description":"Currency code — e.g. `USD`, `ETH`, `EUR`. Matched against the configured currencies — see `GET /v3/platform/currencies` for the current list. An unrecognised symbol is ACCEPTED rather than rejected.","example":"USD"},"date":{"type":"string","format":"date","description":"Snapshot date (YYYY-MM-DD)"},"category":{"type":"string","maxLength":100}}}]}}},"additionalProperties":false}}}},"security":[{"ApiKeyAuth":[]}],"responses":{"202":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["message","captureId","jobId","itemCount"],"properties":{"message":{"type":"string"},"captureId":{"type":"string","format":"uuid"},"jobId":{"type":"string"},"itemCount":{"type":"integer"}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v3/vaults":{"get":{"operationId":"listVaults","summary":"List vaults","tags":["Vaults"],"description":"List enabled vaults with organization info. Authentication is optional but affects results: unauthenticated requests only see vaults with public organizations, authenticated users see vaults with public orgs plus private orgs they have access to.","parameters":[{"schema":{"type":"string","maxLength":36,"format":"uuid"},"in":"query","name":"organizationId","required":false,"description":"Filter by vault curator organization ID. Example: 550e8400-e29b-41d4-a716-446655440000"},{"schema":{"type":"string","maxLength":100},"in":"query","name":"address","required":false,"description":"Filter by vault address. Case-insensitive when networkId is omitted or is an EVM chain (eip155:*), case-sensitive otherwise. Example: 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},{"schema":{"type":"string","maxLength":50},"in":"query","name":"networkId","required":false,"description":"Filter by network ID (CAIP-2 blockchain ID), e.g., `eip155:1` (Ethereum), `eip155:137` (Polygon), `solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp` (Solana)"},{"schema":{"type":"array","style":"form","explode":false,"items":{"type":"string","enum":["v1","v2","v3"]}},"in":"query","name":"protocolVersion","required":false,"description":"Filter by protocol version(s). Comma-separated or repeated (e.g. `?protocolVersion=v1,v2` or `?protocolVersion=v1&protocolVersion=v2`). Omit to return all versions."},{"schema":{"type":"boolean"},"in":"query","name":"publicListingEnabled","required":false,"description":"Filter to vaults opted into the public depositor-app surface (or, when false, vaults not opted in). Omit to return both."},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"in":"query","name":"limit","required":false},{"schema":{"type":"integer","minimum":0,"default":0},"in":"query","name":"offset","required":false},{"schema":{"type":"array","style":"form","explode":false,"items":{"type":"string","enum":["related-addresses","assets","organization","apy","fees"]}},"in":"query","name":"expand","required":false,"description":"Comma-separated list of fields to expand. Valid values: \"related-addresses\" (fetches on-chain addresses: creditStrategy, liquidStrategy, vaultCurator. creditStrategy/liquidStrategy are v2-only and null for v3 vaults (which have no strategy layer); vaultCurator is the vault owner.), \"assets\" (fetches asset info: assetToken, shareToken, decimals, totalAssets, totalLiquidAssets, totalSupply, sharePrice, baseUnit, totalActiveCredit, uninvestedCreditAssets), \"organization\" (includes full organization object with links), \"apy\" (fetches 30-day APY from historical sharePrice snapshots), \"fees\" (fetches managementFee and performanceFee from creditStrategy in basis points)."}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{"OAuth2":[]},{}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["vaults","pagination"],"properties":{"vaults":{"type":"array","items":{"$ref":"#/components/schemas/Vault"}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}}}}},"/v3/vaults/{id}":{"get":{"operationId":"getVault","summary":"Get vault by ID","tags":["Vaults"],"description":"Get a single vault by ID with organization info. Authentication is optional but required to view vaults with private organizations. Vaults with public organizations are visible to everyone.","parameters":[{"schema":{"type":"array","style":"form","explode":false,"items":{"type":"string","enum":["related-addresses","assets","organization","apy","fees"]}},"in":"query","name":"expand","required":false,"description":"Comma-separated list of fields to expand. Valid values: \"related-addresses\" (fetches on-chain addresses: creditStrategy, liquidStrategy, vaultCurator. creditStrategy/liquidStrategy are v2-only and null for v3 vaults (which have no strategy layer); vaultCurator is the vault owner.), \"assets\" (fetches asset info: assetToken, shareToken, decimals, totalAssets, totalLiquidAssets, totalSupply, sharePrice, baseUnit, totalActiveCredit, uninvestedCreditAssets), \"organization\" (includes full organization object with links), \"apy\" (fetches 30-day APY from historical sharePrice snapshots), \"fees\" (fetches managementFee and performanceFee from creditStrategy in basis points)."},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true,"description":"Vault ID. Example: 550e8400-e29b-41d4-a716-446655440000"}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{"OAuth2":[]},{}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Vault"}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v3/vaults/{id}/logs":{"get":{"operationId":"getVaultLogs","summary":"Get vault event logs","tags":["Vaults"],"description":"Get on-chain event logs for a vault.\n\nSupports three response formats via the `format` query parameter:\n- **json** (default) — paginated JSON (default limit 20, max 1000).\n- **csv** — streamed CSV file download (up to 1 000 000 rows).\n- **event-stream** — Server-Sent Events stream (up to 1 000 000 rows). Each log is emitted as a named `log` event with JSON data. A final `done` event carries `{\"total\": N}`. Connect with `EventSource` or `fetch`:\n\n```js\nconst es = new EventSource('/v3/vaults/{id}/logs?format=event-stream');\nes.addEventListener('log', (e) => console.log(JSON.parse(e.data)));\nes.addEventListener('done', (e) => { console.log('total:', JSON.parse(e.data).total); es.close(); });\n```\n\nAuthentication is optional but required for vaults with private organizations. Events are ordered by most recent first. For a v2 vault the feed spans the vault contract, its credit and liquid strategies, and its credit facilities; for a v3 vault it spans the vault contract (ERC-7540 deposit/redeem activity plus CommitmentAdded/CommitmentRemoved) and the credit facilities holding its commitments (scoped to the vault's own commitment ids).\n\nEvent types by protocol version —\n- **v1/v2**: AddCredit, CancelDepositRequest, CancelRedeemRequest, CloseCreditPosition, Deposit, DepositRequest, IncreaseCredit, ManagerDeposit, ManagerWithdraw, MintManagementShares, MintPerformanceShares, ProcessDepositRequest, ProcessRedeemRequest, RedeemRequest, SetFee, SetManager, StrategyDeposit, StrategyWithdraw, SwapCreditPositionForTokens, VaultDeposit, VaultWithdraw, Withdraw, WithdrawDeposit, WithdrawProfit\n- **v3**: CancelDepositRequest, CancelRedeemRequest, CommitmentAccrued, CommitmentAdded, CommitmentClaimed, CommitmentClosed, CommitmentDrawn, CommitmentRemoved, CommitmentRepaid, Deposit, DepositRequest, Originated, ProcessDepositRequest, ProcessRedeemRequest, RedeemRequest, Refinanced, Withdraw\n\n(The ERC-7540 deposit/redeem events appear under both — every vault emits them.)","parameters":[{"schema":{"type":"string","enum":["json","csv","event-stream"],"default":"json"},"in":"query","name":"format","required":false,"description":"Response format. \"json\" returns paginated JSON (default 20, max 1000). \"csv\" returns a streamed CSV file download. \"event-stream\" returns Server-Sent Events with each log as a named \"log\" event and a final \"done\" event."},{"schema":{"type":"string","format":"date"},"in":"query","name":"startDate","required":false,"description":"Start date (YYYY-MM-DD). Example: 2025-01-15"},{"schema":{"type":"string","format":"date"},"in":"query","name":"endDate","required":false,"description":"End date, inclusive (YYYY-MM-DD). Example: 2025-01-15"},{"schema":{"type":"integer","minimum":1},"in":"query","name":"limit","required":false,"description":"Maximum number of results. For json: default 20, max 1000. For csv/event-stream: default 1000000, max 1000000."},{"schema":{"type":"integer","minimum":0,"default":0},"in":"query","name":"offset","required":false},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true,"description":"Vault ID. Example: 550e8400-e29b-41d4-a716-446655440000"}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{"OAuth2":[]},{}],"responses":{"200":{"description":"Vault event logs. Response format depends on the `format` query parameter.","content":{"application/json":{"schema":{"type":"object","required":["vaultAddress","networkId","logs","pagination"],"properties":{"vaultAddress":{"type":"string","description":"Vault contract address","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"networkId":{"type":"string","nullable":true,"description":"CAIP-2 network identifier (e.g. eip155:1)","example":"eip155:1"},"logs":{"type":"array","items":{"type":"object","required":["timestamp","eventType","contractAddress","txHash"],"properties":{"timestamp":{"type":"string","format":"date-time","description":"Block timestamp","example":"2025-01-15T10:30:00Z"},"eventType":{"type":"string","description":"Event name"},"address":{"type":"string","nullable":true,"description":"Event-specific principal address. Semantics vary by eventType: ERC-7540 request events (DepositRequest, RedeemRequest, ProcessDepositRequest, ProcessRedeemRequest, CancelDepositRequest, CancelRedeemRequest) → controller; Deposit → owner (ERC-4626 share recipient); Withdraw → receiver (asset recipient); ManagerDeposit, ManagerWithdraw, StrategyDeposit, StrategyWithdraw → sender; MintManagementShares, MintPerformanceShares → manager; VaultDeposit, VaultWithdraw → external vault address; WithdrawDeposit, WithdrawProfit → credit line; SwapCreditPositionForTokens → buyer; SetManager → newManager; CreditLineDeposit → credit facility; SetFee → null. Refer to eventType to interpret.","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"amount":{"type":"string","nullable":true,"description":"Raw uint256 asset amount (use decimals field to interpret). Set for asset-denominated events. Null for share-only events (RedeemRequest, CancelRedeemRequest, MintManagementShares, MintPerformanceShares). For a v3 CommitmentRepaid this is the vault's NET receipt (principal + interest − fee)."},"principal":{"type":"string","nullable":true,"description":"Raw uint256 principal portion of a v3 CommitmentRepaid (gross). Null for all other events."},"interest":{"type":"string","nullable":true,"description":"Raw uint256 interest portion of a v3 CommitmentRepaid, NET of the protocol performance fee (interest − fee) — the interest the vault actually receives. Null for all other events."},"decimals":{"type":"integer","nullable":true,"description":"Token decimals for the amount field"},"token":{"type":"string","nullable":true,"description":"Asset token address for the amount field (when available)","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"shares":{"type":"string","nullable":true,"description":"Raw uint256 vault share count. Set for: Deposit, Withdraw, ProcessDepositRequest, ProcessRedeemRequest (alongside amount), and RedeemRequest, CancelRedeemRequest, MintManagementShares, MintPerformanceShares (shares only, amount is null)."},"shareToken":{"type":"string","nullable":true,"description":"Vault share token address (the vault contract itself). Set whenever shares is non-null.","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"contractAddress":{"type":"string","description":"Contract that emitted the event","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"txHash":{"type":"string","description":"Transaction hash"},"lineTokenId":{"type":"string","nullable":true,"description":"Credit line token ID (for CreditLineDeposit events)"},"feeType":{"type":"string","nullable":true,"description":"Fee type: \"management\" or \"performance\" (for SetFee events)"},"managerShares":{"type":"string","nullable":true,"description":"Manager share amount (raw uint256, for MintManagementShares/MintPerformanceShares events only)"},"protocolShares":{"type":"string","nullable":true,"description":"Protocol share amount (raw uint256, for MintManagementShares/MintPerformanceShares events only)"},"protocolTreasury":{"type":"string","nullable":true,"description":"Protocol treasury address (for MintManagementShares/MintPerformanceShares events only)","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"}}}},"pagination":{"type":"object","required":["total","limit","offset"],"properties":{"total":{"type":"integer"},"limit":{"type":"integer"},"offset":{"type":"integer"}}}}}},"text/csv":{"schema":{"type":"string","description":"CSV file download. Columns: timestamp, eventType, address, amount, decimals, token, shares, shareToken, contractAddress, networkId, txHash, lineTokenId, feeType, managerShares, protocolShares, protocolTreasury, principal, interest."}},"text/event-stream":{"schema":{"type":"string","description":"Server-Sent Events stream. Each log is emitted as a named \"log\" event with JSON data. A final \"done\" event carries {\"total\": N}."}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v3/vaults/{id}/historical/assets":{"get":{"operationId":"getVaultHistoricalAssets","summary":"Get vault historical asset metrics","tags":["Vaults"],"description":"Get a daily timeseries of vault asset metrics derived from on-chain snapshots. Returns totalAssets, totalLiquidAssets, sharePrice, and a 30-day rolling APY for each calendar day in the requested range. Authentication is optional but required for vaults with private organizations and may increase rate limits.","parameters":[{"schema":{"type":"string","format":"date"},"in":"query","name":"startDate","required":false,"description":"Start date (YYYY-MM-DD, UTC). Defaults to the earliest available snapshot date."},{"schema":{"type":"string","format":"date"},"in":"query","name":"endDate","required":false,"description":"End date, inclusive (YYYY-MM-DD, UTC). Defaults to the latest available snapshot date."},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true,"description":"Vault ID. Example: 550e8400-e29b-41d4-a716-446655440000"}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{"OAuth2":[]},{}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["vaultAddress","networkId","assetToken","shareToken","decimals","data"],"properties":{"vaultAddress":{"type":"string","description":"Vault contract address"},"networkId":{"type":"string","nullable":true,"description":"CAIP-2 network identifier"},"assetToken":{"type":"string","nullable":true,"description":"Underlying asset token address (ERC-4626 asset())"},"shareToken":{"type":"string","nullable":true,"description":"Vault share token address (ERC-4626 share())"},"decimals":{"type":"number","nullable":true,"description":"Asset token decimals (shared by asset and share tokens)"},"data":{"type":"array","items":{"type":"object","required":["date","totalAssets","totalLiquidAssets","sharePrice","apyPct30D"],"properties":{"date":{"type":"string","description":"Calendar day (YYYY-MM-DD, UTC)"},"totalAssets":{"type":"string","nullable":true,"description":"Total vault assets (raw uint256 — divide by 10^decimals to get human-readable value)"},"totalLiquidAssets":{"type":"string","nullable":true,"description":"Total liquid assets (raw uint256 — divide by 10^decimals to get human-readable value)"},"sharePrice":{"type":"string","nullable":true,"description":"Share price (raw uint256 — divide by 10^decimals to get human-readable value)"},"apyPct30D":{"type":"number","nullable":true,"description":"30-day rolling APY in percent (e.g. 5.25 = 5.25%). Null when fewer than 30 days of snapshot data exist."}}}}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v3/vaults/{id}/credit-lines":{"get":{"operationId":"getVaultCreditLines","summary":"Get vault credit lines","tags":["Vaults"],"description":"Get credit lines for a vault by querying on-chain data from the creditStrategy contract. Authentication is optional but required to view vaults with private organizations. Vaults with public organizations are visible to everyone.","parameters":[{"schema":{"type":"array","style":"form","explode":false,"items":{"type":"string","enum":["related-addresses","fees"]}},"in":"query","name":"expand","required":false,"description":"Comma-separated list of fields to expand. Valid values: \"related-addresses\" (includes relatedAddresses with facility address on each credit line), \"fees\" (includes fees with originationFees on each credit line)."},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true,"description":"Vault ID. Example: 550e8400-e29b-41d4-a716-446655440000"}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{"OAuth2":[]},{}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["vaultId","vaultAddress","networkId","creditLines","totals"],"properties":{"vaultId":{"type":"string","format":"uuid","description":"Vault ID","example":"550e8400-e29b-41d4-a716-446655440000"},"vaultAddress":{"type":"string","description":"Vault contract address","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"networkId":{"type":"string","description":"CAIP-2 network identifier","example":"eip155:1"},"creditLines":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/CreditLine"},{"type":"object","properties":{"relatedAddresses":{"type":"object","nullable":true,"description":"Related addresses for this credit line. Present only when expand=related-addresses.","required":["facility","facilityOrganizationId"],"properties":{"facility":{"type":"string","nullable":true,"description":"Facility contract address for this credit line (v2: SecuredLine; v3: credit facility)","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"facilityOrganizationId":{"type":"string","format":"uuid","nullable":true,"description":"Organization ID of the borrower associated with the facility address. Null if the facility address is not registered."},"borrower":{"type":"string","nullable":true,"description":"v3 only. The facility's on-chain borrower address. Null for v2.","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"servicing":{"type":"string","nullable":true,"description":"v3 only. The facility's bound Servicing contract address. Null for v2.","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"servicingId":{"type":"string","format":"uuid","nullable":true,"description":"v3 only. Resource ID of the bound Servicing (use with GET /v3/servicings/:id). Null when the Servicing address is not registered, or for v2."}}}}}]}},"totals":{"type":"object","required":["deposit","principal","interestAccrued","interestRepaid","interestBalance","decimals"],"description":"Aggregated totals. Values are normalized to the highest decimals across all credit lines. All monetary fields sum across all non-errored lines (open + closed); closed credit lines on-chain can still hold non-zero values.","properties":{"deposit":{"type":"string","description":"Sum across all non-errored credit lines (open + closed) of deposit, normalized to totals.decimals precision"},"principal":{"type":"string","description":"Sum across all non-errored credit lines (open + closed) of principal, normalized to totals.decimals precision"},"interestAccrued":{"type":"string","description":"Sum across all non-errored credit lines (open + closed) of interest accrued, normalized to totals.decimals precision"},"interestRepaid":{"type":"string","description":"Sum across all non-errored credit lines (open + closed) of interest repaid, normalized to totals.decimals precision"},"interestBalance":{"type":"string","description":"Sum across all non-errored credit lines (open + closed) of interest balance, normalized to totals.decimals precision"},"decimals":{"type":"integer","description":"Decimal precision of the totals values"},"depositUsd":{"type":"string","nullable":true,"description":"Sum across all non-errored credit lines (open + closed) of deposit converted to USD. Null if any contributing line lacks a USD price."},"principalUsd":{"type":"string","nullable":true,"description":"Sum across all non-errored credit lines (open + closed) of outstanding principal converted to USD. Null if any contributing line lacks a USD price."},"interestAccruedUsd":{"type":"string","nullable":true,"description":"Sum across all non-errored credit lines (open + closed) of accrued interest converted to USD. Null if any contributing line lacks a USD price."},"interestRepaidUsd":{"type":"string","nullable":true,"description":"Sum across all non-errored credit lines (open + closed) of repaid interest converted to USD. Null if any contributing line lacks a USD price."},"interestBalanceUsd":{"type":"string","nullable":true,"description":"Sum across all non-errored credit lines (open + closed) of interest balance converted to USD. Null if any contributing line lacks a USD price."},"creditLimitUsd":{"type":"string","nullable":true,"description":"Sum across OPEN credit lines only of creditLimit converted to USD. Closed lines are excluded because their creditLimit is the historical authorised credit at close, not an active obligation."}}}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v3/vaults/{id}/liquid-strategy":{"get":{"operationId":"getVaultLiquidStrategy","summary":"Get vault liquid strategy","tags":["Vaults"],"description":"Get liquid strategy details for a vault. Authentication is optional but required to view vaults with private organizations. Returns external ERC4626 vault positions with share balances and their underlying asset values. v3 vaults have no liquid strategy (idle capital is held directly), so they return an empty `vaults` array with `liquidStrategyAddress` set to the zero address and null totals.","parameters":[{"schema":{"type":"array","style":"form","explode":false,"items":{"type":"string","enum":["apy"]}},"in":"query","name":"expand","required":false,"description":"Comma-separated list of fields to expand. Valid values: \"apy\" (fetches 30-day APY for each external vault from historical convertToAssets snapshots, and a weighted-average APY in totals)."},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true,"description":"Vault ID. Example: 550e8400-e29b-41d4-a716-446655440000"}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{"OAuth2":[]},{}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["vaultId","vaultAddress","networkId","liquidStrategyAddress","assetToken","decimals","vaults","totals"],"properties":{"vaultId":{"type":"string","format":"uuid","description":"Vault ID","example":"550e8400-e29b-41d4-a716-446655440000"},"vaultAddress":{"type":"string","description":"Vault contract address","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"networkId":{"type":"string","nullable":true,"description":"CAIP-2 network identifier","example":"eip155:1"},"liquidStrategyAddress":{"type":"string","nullable":true,"description":"Liquid strategy contract address","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"assetToken":{"type":"string","nullable":true,"description":"Underlying asset token address shared by all external vaults","example":"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"},"decimals":{"type":"integer","nullable":true,"description":"Decimal precision of the underlying asset token. Applies to asset-denominated values: totalAssets, uninvestedAssets, vaultAssets, and assetsValue."},"vaults":{"type":"array","items":{"type":"object","required":["address","shares"],"properties":{"address":{"type":"string","description":"External vault contract address","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"name":{"type":"string","nullable":true,"description":"External vault name"},"symbol":{"type":"string","nullable":true,"description":"External vault token symbol"},"shares":{"type":"string","description":"Share balance held by liquid strategy (raw uint256, use shareDecimals for precision)"},"shareDecimals":{"type":"integer","nullable":true,"description":"Decimal precision of the external vault share token. Applies to shares."},"assetsValue":{"type":"string","nullable":true,"description":"Underlying asset value via previewRedeem (raw uint256, use top-level decimals for precision), null if unavailable"},"apy":{"type":"object","nullable":true,"description":"APY data (only present when expand=apy)","properties":{"apyPct30D":{"type":"number","nullable":true,"description":"30-day annualized APY in percent (e.g. 5.25 = 5.25%)"}}}}}},"totals":{"type":"object","properties":{"totalAssets":{"type":"string","nullable":true,"description":"Total assets managed by liquid strategy (raw uint256, use top-level decimals for precision)"},"uninvestedAssets":{"type":"string","nullable":true,"description":"Uninvested asset tokens held by liquid strategy (raw uint256, use top-level decimals for precision)"},"vaultAssets":{"type":"string","nullable":true,"description":"Sum of assets deployed in external vaults (raw uint256, use top-level decimals for precision)"},"apy":{"type":"object","nullable":true,"description":"Weighted average APY across the entire liquid strategy (only present when expand=apy). The denominator is totalAssets (which includes uninvestedAssets at 0% APY), so the figure reflects the strategy's blended return, not just the invested portion.","properties":{"apyPct30D":{"type":"number","nullable":true,"description":"30-day weighted average annualized APY in percent"}}}}}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v3/vaults/{id}/whitelist-check":{"get":{"operationId":"checkVaultWhitelist","summary":"Check vault whitelist status","tags":["Vaults"],"description":"Check if an address is whitelisted on the vault's credit strategy contract (requires authentication)","parameters":[{"schema":{"type":"string","maxLength":255},"in":"query","name":"address","required":true,"description":"The address to check for whitelisting. Example: 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true,"description":"Vault ID. Example: 550e8400-e29b-41d4-a716-446655440000"}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{"OAuth2":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["vaultId","vaultAddress","networkId","address","isWhitelisted"],"properties":{"vaultId":{"type":"string","format":"uuid","description":"Vault ID","example":"550e8400-e29b-41d4-a716-446655440000"},"vaultAddress":{"type":"string","description":"Vault contract address","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"networkId":{"type":"string","description":"CAIP-2 network identifier","example":"eip155:1"},"address":{"type":"string","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"isWhitelisted":{"type":"boolean"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v3/vaults/{id}/pending-deposits":{"get":{"operationId":"getVaultPendingDeposits","summary":"Get vault pending deposits","tags":["Vaults"],"description":"Get pending deposit requests for a vault. Requires a role for the vault's organization.","parameters":[{"schema":{"type":"array","style":"form","explode":false,"items":{"type":"string","enum":["requests"]}},"in":"query","name":"expand","required":false,"description":"Comma-separated list of fields to expand. Valid values: \"requests\" (include a global, oldest-first breakdown of the individual deposit requests behind each consolidated pending amount (date + amounts, FIFO))."},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true,"description":"Vault ID. Example: 550e8400-e29b-41d4-a716-446655440000"}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{"OAuth2":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["vaultId","vaultAddress","networkId","pendingDeposits","decimals"],"properties":{"vaultId":{"type":"string","format":"uuid","description":"Vault ID","example":"550e8400-e29b-41d4-a716-446655440000"},"vaultAddress":{"type":"string","description":"Vault contract address","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"networkId":{"type":"string","description":"CAIP-2 network identifier","example":"eip155:1"},"pendingDeposits":{"type":"array","items":{"type":"object","required":["controller","pendingAssets"],"properties":{"controller":{"type":"string","description":"ERC-7540 controller address — the account that initiated the async deposit/redeem request. May differ from the eventual share owner.","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"pendingAssets":{"type":"string"}}}},"pendingRequests":{"type":"array","description":"Individual deposit requests reconstructed (FIFO) from the consolidated pending amounts, oldest first. Only present when expand includes 'requests'.","items":{"type":"object","required":["controller","requestedAt","amountRequested","amountRemaining","txHash"],"properties":{"controller":{"type":"string","description":"ERC-7540 controller address that initiated the deposit request.","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"requestedAt":{"type":"string","format":"date-time","description":"Block timestamp of the deposit request."},"amountRequested":{"type":"string","description":"Original assets requested by this deposit request."},"amountRemaining":{"type":"string","description":"Assets of this request still outstanding under FIFO fulfillment."},"txHash":{"type":"string","description":"Transaction hash of the deposit request."}}}},"decimals":{"type":"integer","nullable":true}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v3/vaults/{id}/pending-redemptions":{"get":{"operationId":"getVaultPendingRedemptions","summary":"Get vault pending redemptions","tags":["Vaults"],"description":"Get pending redemption requests for a vault. Requires a role for the vault's organization.","parameters":[{"schema":{"type":"array","style":"form","explode":false,"items":{"type":"string","enum":["requests"]}},"in":"query","name":"expand","required":false,"description":"Comma-separated list of fields to expand. Valid values: \"requests\" (include a global, oldest-first breakdown of the individual redeem requests behind each consolidated pending amount (date + amounts, FIFO))."},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true,"description":"Vault ID. Example: 550e8400-e29b-41d4-a716-446655440000"}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{"OAuth2":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["vaultId","vaultAddress","networkId","pendingRedemptions","decimals"],"properties":{"vaultId":{"type":"string","format":"uuid","description":"Vault ID","example":"550e8400-e29b-41d4-a716-446655440000"},"vaultAddress":{"type":"string","description":"Vault contract address","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"networkId":{"type":"string","description":"CAIP-2 network identifier","example":"eip155:1"},"pendingRedemptions":{"type":"array","items":{"type":"object","required":["controller","pendingShares"],"properties":{"controller":{"type":"string","description":"ERC-7540 controller address — the account that initiated the async deposit/redeem request. May differ from the eventual share owner.","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"pendingShares":{"type":"string"}}}},"pendingRequests":{"type":"array","description":"Individual redeem requests reconstructed (FIFO) from the consolidated pending amounts, oldest first. Only present when expand includes 'requests'.","items":{"type":"object","required":["controller","requestedAt","amountRequested","amountRemaining","txHash"],"properties":{"controller":{"type":"string","description":"ERC-7540 controller address that initiated the redeem request.","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"requestedAt":{"type":"string","format":"date-time","description":"Block timestamp of the redeem request."},"amountRequested":{"type":"string","description":"Original shares requested by this redeem request."},"amountRemaining":{"type":"string","description":"Shares of this request still outstanding under FIFO fulfillment."},"txHash":{"type":"string","description":"Transaction hash of the redeem request."}}}},"decimals":{"type":"integer","nullable":true}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v3/vaults/{id}/repayment-schedule":{"get":{"operationId":"getVaultRepaymentSchedule","summary":"Get vault forward repayment schedule","tags":["Vaults"],"description":"Projected weekly repayment volume carried forward at each facility's trailing run-rate, bucketed on UTC-Monday calendar weeks — the same buckets the realized series uses. The first projected entry is the next Monday; `entries` remains realized-only for the in-progress week (`paid` rows only, never partial). The in-progress week is additionally carried by the top-level `currentWeek` object: realized receipts to date plus, per facility, a projected gap-to-pace remainder — a re-projection of numbers already public elsewhere in this response, not new information. There is no on-chain instalment schedule — every entry is an explicit projection (`status: \"projected\"`), not clamped to `deadline` (most borrowers roll over; `deadline` is a UI marker only). Only the single v2 vault is supported; other vaults 404.","parameters":[{"schema":{"type":"string","format":"date"},"in":"query","name":"from","required":false,"description":"Start date (YYYY-MM-DD). When in the past, realized repayments are merged in as `status: \"paid\"` entries."},{"schema":{"type":"string","format":"date"},"in":"query","name":"to","required":false,"description":"End date (YYYY-MM-DD), inclusive, for the realized-repayment merge."},{"schema":{"type":"string","enum":["week"],"default":"week"},"in":"query","name":"granularity","required":false},{"schema":{"type":"string","pattern":"^[0-9]{1,78}$","maxLength":78},"in":"query","name":"facilityId","required":false,"description":"Restrict the schedule to a single facility (lineTokenId, a numeric id)."},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true,"description":"Vault ID"}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{"OAuth2":[]},{}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["vaultId","networkId","granularity","asOf","entries","totals","deadlines","facilitiesWithoutProjection","currentWeek","meta"],"properties":{"vaultId":{"type":"string","format":"uuid"},"networkId":{"type":"string","description":"CAIP-2 network identifier"},"granularity":{"type":"string","enum":["week"]},"asOf":{"type":"string","description":"Calendar date (YYYY-MM-DD) the projection was computed from"},"entries":{"type":"array","items":{"type":"object","required":["dueDate","facilityId","principalDue","interestDue","status","lowConfidence"],"properties":{"dueDate":{"type":"string","description":"UTC Monday (YYYY-MM-DD) that starts the weekly bucket this instalment is due or was paid in"},"facilityId":{"type":"string","description":"Opaque credit-line identifier (lineTokenId) — the correlation key across schedule/queue/history responses"},"principalDue":{"type":"string","description":"Principal amount, display units (decimal string)"},"interestDue":{"type":"string","description":"Interest amount, display units (decimal string). \"0\" when the facility rate is unavailable."},"status":{"type":"string","enum":["projected","paid"],"description":"\"projected\" for the forward run-rate projection, \"paid\" for a realized repayment merged in when `from` covers historical weeks"},"lowConfidence":{"type":"boolean","description":"True when this entry used the deadline-only fallback (no usable WALD) or a null facility rate"}}}},"totals":{"type":"object","required":["principalDue","interestDue"],"properties":{"principalDue":{"type":"string"},"interestDue":{"type":"string"}}},"deadlines":{"type":"array","items":{"type":"object","required":["facilityId","deadline"],"properties":{"facilityId":{"type":"string"},"deadline":{"type":"string","nullable":true,"description":"ISO on-chain deadline; a UI marker, not a clamp on the projection"}}}},"facilitiesWithoutProjection":{"type":"array","items":{"type":"string"},"description":"lineTokenIds with no usable deadline or WALD, so no schedule could be built"},"currentWeek":{"type":"object","required":["weekStart","realizedByFacility","projectedRemainderByFacility","totals"],"description":"Hybrid view of the in-progress calendar week: realized receipts to date plus, per facility, the projected gap-to-pace remainder `max(0, weeklyRunRate - realizedThisWeekToDate)`. A sibling of `entries`, not a marker on it — `entries` stays realized-only for this week. No new information: run-rate is already published via projected `principalDue`, and realized-to-date via `status:\"paid\"` entries.","properties":{"weekStart":{"type":"string","description":"UTC-Monday (YYYY-MM-DD) calendar date of the in-progress week — compare lexically, not as a Date instant"},"realizedByFacility":{"type":"object","additionalProperties":{"type":"object","required":["principal","interest"],"properties":{"principal":{"type":"string","description":"Decimal string, display units"},"interest":{"type":"string","description":"Decimal string, display units"}}},"description":"Realized principal/interest received so far this week, keyed by facilityId (lineTokenId). Key omitted for a facility with no receipts this week."},"projectedRemainderByFacility":{"type":"object","additionalProperties":{"type":"string"},"description":"Per-facility gap-to-pace remainder, principal-only decimal string, display units. Key omitted when the facility has no run-rate, or when realized-to-date already meets or exceeds pace."},"totals":{"type":"object","required":["realizedPrincipal","realizedInterest","projectedRemainder","onPaceFor"],"properties":{"realizedPrincipal":{"type":"string","description":"Decimal string, display units"},"realizedInterest":{"type":"string","description":"Decimal string, display units"},"projectedRemainder":{"type":"string","description":"Decimal string, display units"},"onPaceFor":{"type":"string","description":"realizedPrincipal + realizedInterest + projectedRemainder, computed server-side once so this and the chart column height can never disagree."}}}}},"meta":{"type":"object","required":["waldDaysByFacility","srrByFacility","dscrByFacility","lowConfidence"],"properties":{"waldDaysByFacility":{"type":"object","additionalProperties":{"type":"number"},"description":"WALD in days at full source precision (2 dp), used per facilityId when computable. Borrower-level, org-wide (not vault-scoped). Key omitted when not computable."},"srrByFacility":{"type":"object","additionalProperties":{"type":"number"},"description":"Trailing-30-day borrower cashflow as a multiple of credit limit, 6 dp, taken directly from the borrower analytics series. Borrower-level and org-wide. Key omitted when not computable."},"dscrByFacility":{"type":"object","additionalProperties":{"type":"number"},"description":"Loan-term-windowed borrower cashflow divided by credit limit, 6 dp — i.e. the borrower's spigot/configured cashflow over one loan-term window against its credit limit. This is NOT a classic NOI-over-debt-service DSCR. Borrower-level and org-wide (spans every LOC registered to the borrower, not just this vault's facilities). Can be negative when the borrower's analytics config uses net direction. Key omitted when the borrower has no loan term or no credit limit."},"lowConfidence":{"type":"boolean","description":"True when any entry in this response is lowConfidence"}}}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v3/vaults/{id}/credit-history":{"get":{"operationId":"getVaultCreditHistory","summary":"Get vault cumulative credit history","tags":["Vaults"],"description":"Cumulative originated (borrowed) and repaid (principal/interest split) totals across the vault's facilities, plus activity bounds. Sums and counts only — facility addresses are never surfaced. Only the single v2 vault is supported; other vaults 404.","parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true,"description":"Vault ID"}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{"OAuth2":[]},{}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["vaultId","totalOriginated","totalRepaidPrincipal","totalRepaidInterest","borrowCount","repayCount","firstActivityAt","lastActivityAt"],"properties":{"vaultId":{"type":"string","format":"uuid"},"totalOriginated":{"type":"string","description":"Cumulative borrowed amount, decimal string"},"totalRepaidPrincipal":{"type":"string","description":"Cumulative principal repaid, decimal string"},"totalRepaidInterest":{"type":"string","description":"Cumulative interest repaid, decimal string"},"borrowCount":{"type":"integer"},"repayCount":{"type":"integer"},"firstActivityAt":{"type":"string","nullable":true,"format":"date-time"},"lastActivityAt":{"type":"string","nullable":true,"format":"date-time"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v3/vaults/{id}/redemption-queue":{"get":{"operationId":"getVaultRedemptionQueue","summary":"Get vault pseudonymised redemption queue","tags":["Vaults"],"description":"FIFO queue of pending redemption requests for the vault, denominated in shares with an asset-equivalent conversion. Pseudonymised: no `controller` and no `txHash` on any request row. Only the single v2 vault is supported; other vaults 404.","parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true,"description":"Vault ID"}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{"OAuth2":[]},{}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["vaultId","requestCount","totalPendingShares","totalPendingAssets","assetsUnavailable","unavailable","earliestClearDateAllFlowDiverted","clearDateBasis","inflowCoverageRatio","requests"],"properties":{"vaultId":{"type":"string","format":"uuid"},"requestCount":{"type":"integer"},"totalPendingShares":{"type":"string","nullable":true,"description":"Sum of pending shares, display units. Null when the share-decimals read failed (see `unavailable`)."},"totalPendingAssets":{"type":"string","nullable":true,"description":"Asset-equivalent of totalPendingShares. Null when the share->asset conversion failed (see `assetsUnavailable`/`unavailable`) — never 0."},"assetsUnavailable":{"type":"boolean","description":"True when any conversion dependency (baseUnit, sharePrice, assetDecimals, or shareDecimals) could not be read. Asset amounts are null in that case; share amounts are also null when the failed read was shareDecimals (see `unavailable` for which)."},"unavailable":{"type":"array","items":{"type":"string"},"description":"Which upstream fields failed to read (any of \"baseUnit\", \"sharePrice\", \"assetDecimals\", \"shareDecimals\"). Fields whose conversion depends on a listed read are null, never raw smallest-unit values."},"earliestClearDateAllFlowDiverted":{"type":"string","nullable":true,"description":"Best case. Earliest date at which cumulative *projected* repayment inflow would cover the pending queue **if 100% of it were diverted to redemptions** — a curator decision that is not committed or guaranteed. Null if never reached within the projection horizon or if assets are unavailable."},"clearDateBasis":{"type":"string","enum":["all_repayment_flow_diverted"],"description":"Semantic basis for the clear date: all scheduled repayment flow diverted to the queue, a curator discretion, not a commitment."},"inflowCoverageRatio":{"type":"string","nullable":true,"description":"Projected repayment inflow over the next 30 days divided by totalPendingAssets, decimal string. Null when totalPendingAssets is \"0\" or unavailable."},"requests":{"type":"array","items":{"type":"object","required":["position","requestedAt","sharesRequested","sharesRemaining","assetsRemaining"],"properties":{"position":{"type":"integer","description":"FIFO queue position, oldest first, 1-indexed"},"requestedAt":{"type":"string","format":"date-time"},"sharesRequested":{"type":"string","nullable":true},"sharesRemaining":{"type":"string","nullable":true},"assetsRemaining":{"type":"string","nullable":true}}}}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v3/vaults/{id}/capacity":{"get":{"operationId":"getVaultCapacity","summary":"Get vault deposit-epoch capacity","tags":["Vaults"],"description":"Current deposit-epoch target size and live allocation for the vault. `epoch` is null when no epoch is configured for the vault — a legitimate state, not an error. `allocated` is always a live on-chain read (never the stored epoch value); a null `allocated` means the read failed (see `unavailable`) — it is never reported as 0. Only the single v2 vault is supported; other vaults 404.","parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true,"description":"Vault ID"}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{"OAuth2":[]},{}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["vaultId","epoch","targetSize","allocated","remaining","utilizationPct","depositorCount","decimals","unavailable"],"properties":{"vaultId":{"type":"string","format":"uuid"},"epoch":{"type":"object","nullable":true,"required":["epochNumber","opensAt","closesAt","state"],"properties":{"epochNumber":{"type":"integer"},"opensAt":{"type":"string","nullable":true,"format":"date-time"},"closesAt":{"type":"string","nullable":true,"format":"date-time"},"state":{"type":"string","enum":["upcoming","open","closed"]}}},"targetSize":{"type":"string","nullable":true,"description":"Smallest-unit integer string; null when uncapped or no epoch is configured"},"allocated":{"type":"string","nullable":true,"description":"Live totalAssets, smallest-unit integer string; null only on a failed RPC read (see unavailable) — never 0"},"remaining":{"type":"string","nullable":true,"description":"targetSize minus allocated, floored at 0, smallest-unit integer string; null when uncapped or allocated is unavailable"},"utilizationPct":{"type":"number","nullable":true,"description":"allocated / targetSize * 100; null when uncapped (targetSize null) or targetSize is 0"},"depositorCount":{"type":"integer","nullable":true,"description":"Distinct depositor (ERC-4626 Deposit owner) addresses, all-time; null only when the chain id could not be resolved (see unavailable) — never 0"},"decimals":{"type":"integer","nullable":true,"description":"Asset-token decimals for targetSize/allocated/remaining"},"unavailable":{"type":"array","items":{"type":"string"},"description":"Which upstream fields failed to read (e.g. [\"totalAssets\"])"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v3/depositors/pending-deposits":{"get":{"operationId":"getDepositorPendingDeposits","summary":"Get depositor pending deposits","tags":["Depositors"],"description":"Get pending deposit requests across all vaults for a given depositor controller address. If networkId is omitted, results span all chains. Requires authentication.","parameters":[{"schema":{"type":"array","style":"form","explode":false,"items":{"type":"string","enum":["v1","v2","v3"]}},"in":"query","name":"protocolVersion","required":false,"description":"Filter by protocol version(s). Comma-separated or repeated (e.g. `?protocolVersion=v1,v2` or `?protocolVersion=v1&protocolVersion=v2`). Omit to return all versions."},{"schema":{"type":"string","maxLength":200},"in":"query","name":"address","required":true,"description":"Depositor controller address to look up pending deposits for. The controller is the address that initiated the ERC-7540 async request (pendingDepositRequest / pendingRedeemRequest) and may differ from the eventual share owner — e.g. a smart wallet or router acting on a user's behalf. Example: 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},{"schema":{"type":"string","maxLength":42,"pattern":"^0x[0-9a-fA-F]{40}$"},"in":"query","name":"vaultAddress","required":false,"description":"Filter to a specific vault address. Example: 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},{"schema":{"type":"string","maxLength":200},"in":"query","name":"networkId","required":false,"description":"CAIP-2 network ID (e.g., \"eip155:1\", \"eip155:8453\"). If omitted, results span all chains."}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{"OAuth2":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["controllerAddress","pendingDeposits","claimableDeposits"],"properties":{"controllerAddress":{"type":"string","description":"ERC-7540 controller address — the account that initiated the async deposit/redeem request. May differ from the eventual share owner.","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"pendingDeposits":{"type":"array","items":{"type":"object","required":["vaultId","vaultAddress","networkId","pendingAssets"],"properties":{"vaultId":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"},"vaultAddress":{"type":"string","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"networkId":{"type":"string","example":"eip155:1"},"pendingAssets":{"type":"string","description":"Pending deposit amount (raw uint256 — divide by 10^decimals to get human-readable value)"},"decimals":{"type":"integer","nullable":true},"assetToken":{"type":"string","nullable":true,"example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"}}}},"claimableDeposits":{"type":"array","items":{"type":"object","required":["vaultId","vaultAddress","networkId","claimableAssets","claimableShares"],"properties":{"vaultId":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"},"vaultAddress":{"type":"string","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"networkId":{"type":"string","example":"eip155:1"},"claimableAssets":{"type":"string","description":"Claimable asset amount (raw uint256 — divide by 10^decimals to get human-readable value)"},"claimableShares":{"type":"string","description":"Claimable share amount (raw uint256 — divide by 10^decimals to get human-readable value)"},"decimals":{"type":"integer","nullable":true},"assetToken":{"type":"string","nullable":true,"example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"}}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v3/depositors/pending-redemptions":{"get":{"operationId":"getDepositorPendingRedemptions","summary":"Get depositor pending redemptions","tags":["Depositors"],"description":"Get pending redemption requests across all vaults for a given depositor controller address. If networkId is omitted, results span all chains. Requires authentication.","parameters":[{"schema":{"type":"array","style":"form","explode":false,"items":{"type":"string","enum":["v1","v2","v3"]}},"in":"query","name":"protocolVersion","required":false,"description":"Filter by protocol version(s). Comma-separated or repeated (e.g. `?protocolVersion=v1,v2` or `?protocolVersion=v1&protocolVersion=v2`). Omit to return all versions."},{"schema":{"type":"string","maxLength":200},"in":"query","name":"address","required":true,"description":"Depositor controller address to look up pending redemptions for. The controller is the address that initiated the ERC-7540 async request (pendingDepositRequest / pendingRedeemRequest) and may differ from the eventual share owner — e.g. a smart wallet or router acting on a user's behalf. Example: 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},{"schema":{"type":"string","maxLength":42,"pattern":"^0x[0-9a-fA-F]{40}$"},"in":"query","name":"vaultAddress","required":false,"description":"Filter to a specific vault address. Example: 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},{"schema":{"type":"string","maxLength":200},"in":"query","name":"networkId","required":false,"description":"CAIP-2 network ID (e.g., \"eip155:1\", \"eip155:8453\"). If omitted, results span all chains."}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{"OAuth2":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["controllerAddress","pendingRedemptions","claimableRedemptions"],"properties":{"controllerAddress":{"type":"string","description":"ERC-7540 controller address — the account that initiated the async deposit/redeem request. May differ from the eventual share owner.","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"pendingRedemptions":{"type":"array","items":{"type":"object","required":["vaultId","vaultAddress","networkId","pendingShares"],"properties":{"vaultId":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"},"vaultAddress":{"type":"string","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"networkId":{"type":"string","example":"eip155:1"},"pendingShares":{"type":"string","description":"Pending share amount (raw uint256 — divide by 10^decimals to get human-readable value)"},"decimals":{"type":"integer","nullable":true},"shareToken":{"type":"string","nullable":true,"example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"}}}},"claimableRedemptions":{"type":"array","items":{"type":"object","required":["vaultId","vaultAddress","networkId","claimableShares","claimableAssets"],"properties":{"vaultId":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"},"vaultAddress":{"type":"string","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"networkId":{"type":"string","example":"eip155:1"},"claimableShares":{"type":"string","description":"Claimable share amount (raw uint256 — divide by 10^decimals to get human-readable value)"},"claimableAssets":{"type":"string","description":"Claimable asset amount (raw uint256 — divide by 10^decimals to get human-readable value)"},"decimals":{"type":"integer","nullable":true},"shareToken":{"type":"string","nullable":true,"example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"}}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v3/depositors/balances":{"get":{"operationId":"getDepositorBalances","summary":"Get depositor vault balances","tags":["Depositors"],"description":"Get vault share balances for a depositor address. Returns vaults where the address holds shares, with current balance and asset value. If networkId is omitted, results span all chains. Requires authentication.","parameters":[{"schema":{"type":"array","style":"form","explode":false,"items":{"type":"string","enum":["v1","v2","v3"]}},"in":"query","name":"protocolVersion","required":false,"description":"Filter by protocol version(s). Comma-separated or repeated (e.g. `?protocolVersion=v1,v2` or `?protocolVersion=v1&protocolVersion=v2`). Omit to return all versions."},{"schema":{"type":"string","maxLength":200},"in":"query","name":"address","required":true,"description":"Depositor owner address — the ERC-4626 holder of vault shares (per balanceOf). Returns balances for shares currently owned by this address. Example: 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},{"schema":{"type":"string","maxLength":200},"in":"query","name":"networkId","required":false,"description":"CAIP-2 network ID (e.g., \"eip155:1\", \"eip155:8453\"). If omitted, results span all chains."},{"schema":{"type":"boolean"},"in":"query","name":"includeZeroBalances","required":false,"description":"If true, include vaults where the address has historical transfer activity but current balance is 0. Defaults to false."}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{"OAuth2":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["address","vaults"],"properties":{"address":{"type":"string","description":"Depositor owner address queried — the ERC-4626 share holder.","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"vaults":{"type":"array","items":{"type":"object","required":["vaultId","vaultAddress","networkId","shares"],"properties":{"vaultId":{"type":"string","format":"uuid","description":"Vault ID","example":"550e8400-e29b-41d4-a716-446655440000"},"vaultAddress":{"type":"string","description":"Vault contract address","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"networkId":{"type":"string","description":"CAIP-2 network ID","example":"eip155:1"},"shares":{"type":"string","description":"Current share balance (raw uint256 — divide by 10^decimals to get human-readable value)"},"assetsValue":{"type":"string","nullable":true,"description":"Shares converted to underlying assets (raw uint256 — divide by 10^decimals to get human-readable value)"},"assetsValueUsd":{"type":"string","nullable":true,"description":"USD value of the depositor's vault position (null if price unavailable)"},"decimals":{"type":"integer","nullable":true,"description":"Token decimals"},"assetToken":{"type":"string","nullable":true,"description":"Underlying asset token address","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"}}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v3/depositors/portfolio":{"get":{"operationId":"getDepositorPortfolio","summary":"Get depositor portfolio","tags":["Depositors"],"description":"Returns a depositor's portfolio broken down by vault and aggregated at the portfolio level. Per-vault data includes: annualized yield (APY calculated as IRR/money-weighted return), holding period, interest earned, start/end position values, total deposited/withdrawn, share balances, and deposit/withdraw counts — all in both native token amounts (raw integer strings) and USD where pricing is available. The portfolio-level summary aggregates these metrics across all vaults in USD, including a combined APY. Use the expand parameter to include per-vault transaction timelines (with running balances), organization details, and daily time series (vault-daily-stats for per-vault, portfolio-daily-stats for portfolio-level, or daily-stats for both). Uses FIFO accounting for cost basis tracking. Supports optional date range filtering — when startDate is provided, all prior transactions are used to compute the opening position. Requires authentication.","parameters":[{"schema":{"type":"array","style":"form","explode":false,"items":{"type":"string","enum":["v1","v2","v3"]}},"in":"query","name":"protocolVersion","required":false,"description":"Filter by protocol version(s). Comma-separated or repeated (e.g. `?protocolVersion=v1,v2` or `?protocolVersion=v1&protocolVersion=v2`). Omit to return all versions."},{"schema":{"type":"string","maxLength":200},"in":"query","name":"address","required":true,"description":"Depositor owner address — the ERC-4626 holder of vault shares (per balanceOf). Returns portfolio performance for shares currently owned by this address. Example: 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},{"schema":{"type":"string","maxLength":200},"in":"query","name":"networkId","required":false,"description":"CAIP-2 network ID (e.g., \"eip155:1\", \"eip155:8453\"). If omitted, results span all chains."},{"schema":{"type":"string","example":"2025-01-01"},"in":"query","name":"startDate","required":false,"description":"ISO 8601 date for the start of the measurement window (earliest: 2020-01-01). Prior transactions are used to compute the opening position."},{"schema":{"type":"string","example":"2025-03-19"},"in":"query","name":"endDate","required":false,"description":"ISO 8601 date for the end of the measurement window (inclusive). Defaults to now."},{"schema":{"type":"array","style":"form","explode":false,"items":{"type":"string","enum":["transactions","organization","vault-daily-stats","portfolio-daily-stats","daily-stats"]}},"in":"query","name":"expand","required":false,"description":"Comma-separated list of fields to expand. Valid values: \"transactions\" (includes per-vault transaction timelines (with running balances)), \"organization\" (includes full organization object with links for each vault), \"vault-daily-stats\" (includes per-vault daily stats timeseries), \"portfolio-daily-stats\" (includes portfolio-level daily stats timeseries (USD-denominated, summed across vaults)), \"daily-stats\" (alias — expands to both vault-daily-stats and portfolio-daily-stats)."}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{"OAuth2":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["address","networkId","startDate","endDate","vaults","portfolio"],"properties":{"address":{"type":"string","description":"Depositor owner address queried — the ERC-4626 share holder."},"networkId":{"type":"string","nullable":true,"description":"CAIP-2 network filter applied (null if querying all chains)"},"startDate":{"type":"string","nullable":true,"format":"date-time","description":"Start of measurement window (resolved from param or earliest activity; null if no activity)"},"endDate":{"type":"string","nullable":true,"format":"date-time","description":"End of measurement window (resolved from param or current time; null if no activity)"},"vaults":{"type":"array","items":{"type":"object","required":["vaultId","vaultAddress","networkId","decimals","holdingPeriodDays","totalInterestEarned","startValue","endValue","totalDeposited","totalWithdrawn","startShares","endShares","depositCount","withdrawCount"],"properties":{"vaultId":{"type":"string","format":"uuid"},"vaultAddress":{"type":"string"},"networkId":{"type":"string"},"apyPct":{"type":"number","nullable":true,"description":"Annualized money-weighted return as percent (10.00 = 10%). Null if holding period < 24h."},"holdingPeriodDays":{"type":"number","description":"Holding period in days (rounded to 2 decimal places)"},"assetToken":{"type":"string","nullable":true,"description":"Underlying asset token address"},"assetTokenSymbol":{"type":"string","nullable":true,"description":"Underlying asset token symbol (e.g., USDC)"},"decimals":{"type":"integer","description":"Asset token decimals — divide raw integer values by 10^decimals for human-readable amounts. Share amounts currently use the same decimals (our vaults have ERC-4626 parity) but the spec only recommends this."},"organization":{"nullable":true,"allOf":[{"$ref":"#/components/schemas/Organization"}],"description":"Organization details with links. Only included when expand includes \"organization\"."},"totalInterestEarned":{"type":"string","description":"Total interest earned (realized + unrealized) as raw integer string — divide by 10^decimals for human-readable value"},"startValue":{"type":"string","description":"Position value at start of measurement window as raw integer string — divide by 10^decimals for human-readable value"},"endValue":{"type":"string","description":"Position value at end of measurement window as raw integer string — divide by 10^decimals for human-readable value"},"totalDeposited":{"type":"string","description":"Total deposited as raw integer string — divide by 10^decimals for human-readable value"},"totalWithdrawn":{"type":"string","description":"Total withdrawn as raw integer string — divide by 10^decimals for human-readable value"},"totalInterestEarnedUsd":{"type":"string","nullable":true,"description":"Total interest earned in USD (null if price unavailable)"},"startValueUsd":{"type":"string","nullable":true,"description":"Start value in USD (null if price unavailable)"},"endValueUsd":{"type":"string","nullable":true,"description":"End value in USD (null if price unavailable)"},"totalDepositedUsd":{"type":"string","nullable":true,"description":"Total deposited in USD (null if price unavailable)"},"totalWithdrawnUsd":{"type":"string","nullable":true,"description":"Total withdrawn in USD (null if price unavailable)"},"totalTransferredIn":{"type":"string","description":"Total transferred in via peer-to-peer share transfers as raw integer string — divide by 10^decimals for human-readable value"},"totalTransferredOut":{"type":"string","description":"Total transferred out via peer-to-peer share transfers as raw integer string — divide by 10^decimals for human-readable value"},"totalTransferredInUsd":{"type":"string","nullable":true,"description":"Total transferred in USD (null if price unavailable)"},"totalTransferredOutUsd":{"type":"string","nullable":true,"description":"Total transferred out in USD (null if price unavailable)"},"totalSharesDeposited":{"type":"string","description":"Total shares deposited as raw integer string — divide by 10^decimals for human-readable value"},"totalSharesWithdrawn":{"type":"string","description":"Total shares withdrawn as raw integer string — divide by 10^decimals for human-readable value"},"totalSharesTransferredIn":{"type":"string","description":"Total shares received via peer-to-peer transfers as raw integer string — divide by 10^decimals for human-readable value"},"totalSharesTransferredOut":{"type":"string","description":"Total shares sent via peer-to-peer transfers as raw integer string — divide by 10^decimals for human-readable value"},"startShares":{"type":"string","description":"Share balance at start of measurement window as raw integer string — divide by 10^decimals for human-readable value"},"endShares":{"type":"string","description":"Share balance at end of measurement window as raw integer string — divide by 10^decimals for human-readable value"},"depositCount":{"type":"integer"},"withdrawCount":{"type":"integer"},"transferInCount":{"type":"integer"},"transferOutCount":{"type":"integer"},"dailyStats":{"type":"array","description":"Daily timeseries with share balances, asset values, and cumulative interest. Only included when expand includes \"vault-daily-stats\" or \"daily-stats\".","items":{"type":"object","required":["date","shares"],"properties":{"date":{"type":"string","description":"UTC date (YYYY-MM-DD)","example":"2025-01-15"},"shares":{"type":"string","description":"Share balance at end of day as raw integer string — divide by 10^decimals for human-readable value"},"balance":{"type":"string","nullable":true,"description":"Asset value at end of day (shares × sharePrice) as raw integer string — null if no share price snapshot available"},"balanceUsd":{"type":"string","nullable":true,"description":"USD value of position at end of day (null if price unavailable)"},"totalInterestEarned":{"type":"string","nullable":true,"description":"Cumulative interest earned up to this day as raw integer string — null if balance is null"},"totalInterestEarnedUsd":{"type":"string","nullable":true,"description":"Cumulative interest earned up to this day in USD (null if price unavailable)"}}}},"transactions":{"type":"array","description":"Ordered transaction timeline (real on-chain events only)","items":{"type":"object","required":["type","timestamp","amount","amountUsd","balance","balanceUsd","shares","sharesBalance"],"properties":{"type":{"type":"string","enum":["deposit","withdraw","transfer-in","transfer-out"]},"timestamp":{"type":"string","format":"date-time"},"amount":{"type":"string","description":"Native asset amount as raw integer string — divide by 10^decimals for human-readable value."},"amountUsd":{"type":"string","nullable":true,"description":"USD amount at transaction time (null if price unavailable)"},"balance":{"type":"string","description":"Running balance (mark-to-market: sharesBalance * sharePrice) as raw integer string — divide by 10^decimals for human-readable value"},"shares":{"type":"string","description":"Share amount for this event as raw integer string — divide by 10^decimals for human-readable value."},"sharesBalance":{"type":"string","description":"Running share count after this event as raw integer string — divide by 10^decimals for human-readable value"},"balanceUsd":{"type":"string","nullable":true,"description":"Running balance in USD at transaction time (null if price unavailable)"},"txHash":{"type":"string","nullable":true,"description":"Transaction hash"}}}}}}},"portfolio":{"type":"object","required":["apyPct","holdingPeriodDays","startValueUsd","endValueUsd","totalDepositedUsd","totalWithdrawnUsd","totalInterestEarnedUsd"],"properties":{"apyPct":{"type":"number","nullable":true,"description":"Portfolio-level annualized money-weighted return as percent (10.00 = 10%). Null if holding period < 24h."},"holdingPeriodDays":{"type":"number","description":"Total days invested in at least one vault"},"startValueUsd":{"type":"string","nullable":true,"description":"Portfolio start value in USD (null if no vaults have pricing)"},"endValueUsd":{"type":"string","nullable":true,"description":"Portfolio end value in USD (null if no vaults have pricing)"},"totalDepositedUsd":{"type":"string","nullable":true,"description":"Total deposited across all vaults in USD (null if no vaults have pricing)"},"totalWithdrawnUsd":{"type":"string","nullable":true,"description":"Total withdrawn across all vaults in USD (null if no vaults have pricing)"},"totalTransferredInUsd":{"type":"string","nullable":true,"description":"Total transferred in across all vaults in USD (null if no vaults have pricing)"},"totalTransferredOutUsd":{"type":"string","nullable":true,"description":"Total transferred out across all vaults in USD (null if no vaults have pricing)"},"transferInCount":{"type":"integer","description":"Total transfer-in count across all vaults"},"transferOutCount":{"type":"integer","description":"Total transfer-out count across all vaults"},"totalInterestEarnedUsd":{"type":"string","nullable":true,"description":"Total interest earned across all vaults in USD (null if no vaults have pricing)"},"dailyStats":{"type":"array","description":"Portfolio-level daily stats timeseries (USD-denominated, summed across vaults). Only included when expand includes \"portfolio-daily-stats\" or \"daily-stats\".","items":{"type":"object","required":["date"],"properties":{"date":{"type":"string","description":"UTC date (YYYY-MM-DD)","example":"2025-01-15"},"balanceUsd":{"type":"string","nullable":true,"description":"Portfolio USD balance at end of day (null if no priced vaults)"},"totalInterestEarnedUsd":{"type":"string","nullable":true,"description":"Portfolio cumulative interest earned in USD up to this day (null if no priced vaults)"}}}}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v3/benchmarks/vault-apy":{"get":{"operationId":"getBenchmarkVaultApy","summary":"Get historical vault APY","tags":["Benchmarks"],"description":"Returns a daily timeseries of rolling 7-day APY for any vault with on-chain snapshots. Works with both internal vaults (sharePrice) and ERC-4626 vaults (convertToAssets). Specify the vault by address or token symbol.","parameters":[{"schema":{"type":"string"},"in":"query","name":"address","required":false,"description":"Vault contract address (e.g., 0xabc...)"},{"schema":{"type":"string"},"in":"query","name":"symbol","required":false,"description":"Token symbol to look up the vault (e.g., stataEthUSDC)"},{"schema":{"type":"string","example":"eip155:1"},"in":"query","name":"networkId","required":true,"description":"CAIP-2 network identifier (e.g., eip155:1 for Ethereum, eip155:8453 for Base)"},{"schema":{"type":"string","format":"date","example":"2025-01-01"},"in":"query","name":"from","required":false,"description":"Start date (YYYY-MM-DD). Defaults to earliest available data."},{"schema":{"type":"string","format":"date","example":"2025-12-31"},"in":"query","name":"to","required":false,"description":"End date (YYYY-MM-DD). Defaults to latest available data."}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{"OAuth2":[]},{}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["address","networkId","data"],"properties":{"address":{"type":"string"},"networkId":{"type":"string"},"symbol":{"type":"string"},"data":{"type":"array","items":{"type":"object","required":["date","apyPct7D"],"properties":{"date":{"type":"string","format":"date","example":"2025-06-15"},"apyPct7D":{"type":["null","number"],"description":"Rolling 7-day APY in percent (e.g., 5.25 = 5.25%)"}}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v3/benchmarks/rate":{"get":{"operationId":"getBenchmarkRate","summary":"Get historical benchmark rate","tags":["Benchmarks"],"description":"Returns a daily timeseries of a benchmark rate from the prices table. Supported symbols: FED_FUNDS_RATE (Federal Funds Effective Rate) and SOFR_30D_AVG (30-Day Average SOFR).","parameters":[{"schema":{"type":"string","default":"FED_FUNDS_RATE"},"in":"query","name":"symbol","required":false,"description":"Rate symbol: FED_FUNDS_RATE or SOFR_30D_AVG. Defaults to FED_FUNDS_RATE."},{"schema":{"type":"string","format":"date","example":"2025-01-01"},"in":"query","name":"from","required":false,"description":"Start date (YYYY-MM-DD). Defaults to earliest available."},{"schema":{"type":"string","format":"date","example":"2025-12-31"},"in":"query","name":"to","required":false,"description":"End date (YYYY-MM-DD). Defaults to latest available."}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{"OAuth2":[]},{}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["symbol","data"],"properties":{"symbol":{"type":"string"},"data":{"type":"array","items":{"type":"object","required":["date","rate"],"properties":{"date":{"type":"string","format":"date","example":"2025-06-15"},"rate":{"type":"number","description":"Rate value (e.g., 4.33 = 4.33%)"}}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v3/credit-facilities":{"get":{"operationId":"listCreditFacilities","summary":"List credit facilities","tags":["Credit Facilities"],"description":"List enabled Credit Facilities. Authentication is required. Users see credit facilities for public orgs plus private orgs they have access to.","parameters":[{"schema":{"type":"string","maxLength":36,"format":"uuid"},"in":"query","name":"organizationId","required":false,"description":"Filter by borrower organization ID. Example: 550e8400-e29b-41d4-a716-446655440000"},{"schema":{"type":"string","maxLength":100},"in":"query","name":"address","required":false,"description":"Filter by credit facility address. Case-insensitive when networkId is omitted or is an EVM chain (eip155:*), case-sensitive otherwise."},{"schema":{"type":"string","maxLength":50},"in":"query","name":"networkId","required":false,"description":"Filter by network ID (CAIP-2 blockchain ID), e.g., `eip155:1` (Ethereum), `eip155:137` (Polygon), `solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp` (Solana)"},{"schema":{"type":"array","style":"form","explode":false,"items":{"type":"string","enum":["v1","v2","v3"]}},"in":"query","name":"protocolVersion","required":false,"description":"Filter by protocol version(s). Comma-separated or repeated (e.g. `?protocolVersion=v1,v2` or `?protocolVersion=v1&protocolVersion=v2`). Omit to return all versions."},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"in":"query","name":"limit","required":false},{"schema":{"type":"integer","minimum":0,"default":0},"in":"query","name":"offset","required":false},{"schema":{"type":"array","style":"form","explode":false,"items":{"type":"string","enum":["related-addresses","fees","organization","counts","status","collateral"]}},"in":"query","name":"expand","required":false,"description":"Comma-separated list of fields to expand. Valid values: \"related-addresses\" (fetches on-chain addresses: spigot, borrower, admin, spigotOperator, escrow, servicing (v3 only)), \"fees\" (fetches fee configuration: originationFee, swapFee + servicingFee (v2 only), drawFee + repayFee (v3 only)), \"organization\" (includes full organization object with links), \"counts\" (fetches activeCreditLines and openProposals), \"status\" (fetches on-chain contract status), \"collateral\" (fetches on-chain collateral state: maxLtvBps, collateralValue, totalOutstandingDebt, ltvBps, collateralTokens[])."}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{"OAuth2":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["creditFacilities","pagination"],"properties":{"creditFacilities":{"type":"array","items":{"$ref":"#/components/schemas/CreditFacility"}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v3/credit-facilities/{id}":{"get":{"operationId":"getCreditFacility","summary":"Get credit facility by ID","tags":["Credit Facilities"],"description":"Get a single Credit Facility by ID. Authentication is required.","parameters":[{"schema":{"type":"array","style":"form","explode":false,"items":{"type":"string","enum":["related-addresses","fees","organization","counts","status","collateral","totals"]}},"in":"query","name":"expand","required":false,"description":"Comma-separated list of fields to expand. Valid values: \"related-addresses\" (fetches on-chain addresses: spigot, borrower, admin, spigotOperator, escrow, servicing + commitmentToken (v3 only)), \"fees\" (fetches fee configuration: originationFee, swapFee + servicingFee (v2 only), drawFee + repayFee (v3 only)), \"organization\" (includes full organization object with links), \"counts\" (fetches activeCreditLines and openProposals), \"status\" (fetches on-chain contract status), \"collateral\" (fetches on-chain collateral state: maxLtvBps, collateralValue, totalOutstandingDebt, ltvBps, collateralTokens[]), \"totals\" (v3 only. fetches facility-level native-unit aggregates: totalCommitment, totalDrawn, drawnRate, undrawnRate, token, decimals. Null for v1/v2 facilities.)."},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true,"description":"Credit Facility ID. Example: 550e8400-e29b-41d4-a716-446655440000"}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{"OAuth2":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditFacility"}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v3/credit-facilities/{id}/credit-lines":{"get":{"operationId":"getCreditFacilityCreditLines","summary":"Get credit facility credit lines","tags":["Credit Facilities"],"description":"Get credit lines for a Credit Facility. Authentication is required.","parameters":[{"schema":{"type":"array","style":"form","explode":false,"items":{"type":"string","enum":["related-addresses","fees"]}},"in":"query","name":"expand","required":false,"description":"Comma-separated list of fields to expand. Valid values: \"related-addresses\" (includes relatedAddresses object with lender, vault, vaultCurator on each credit line), \"fees\" (includes fees object with originationFees on each credit line)."},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true,"description":"Credit Facility ID. Example: 550e8400-e29b-41d4-a716-446655440000"}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{"OAuth2":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["facilityId","facilityAddress","networkId","activeCount","totalCount","creditLines","totals"],"properties":{"facilityId":{"type":"string","description":"Credit Facility UUID","example":"550e8400-e29b-41d4-a716-446655440000"},"facilityAddress":{"type":"string","description":"Credit facility contract address","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"networkId":{"type":"string","description":"CAIP-2 network identifier (e.g. eip155:8453)","example":"eip155:1"},"activeCount":{"type":"integer","description":"Number of active credit lines"},"totalCount":{"type":"integer","description":"Total number of credit lines"},"relatedAddresses":{"type":"object","nullable":true,"description":"Facility-level on-chain addresses (distinct from each credit line's own relatedAddresses). Only included when expand includes \"related-addresses\".","required":["commitmentToken"],"properties":{"commitmentToken":{"type":"string","nullable":true,"description":"v3 only. The ERC-721 CommitmentToken singleton — the NFT contract representing every commitment/credit line in the facility (ownerOf(lineTokenId) is the lender). Facility-wide: the same contract for every line. Null for v1/v2 facilities.","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"}}},"fees":{"type":"object","nullable":true,"description":"Fee configuration for the credit facility. Null if fees could not be fetched.","required":["originationFee","swapFee","servicingFee","drawFee","repayFee"],"properties":{"originationFee":{"type":"string","nullable":true,"description":"Origination fee (basis points). Present on v2 and v3."},"swapFee":{"type":"string","nullable":true,"description":"v2 only. Swap fee (basis points). Null for v3."},"servicingFee":{"type":"string","nullable":true,"description":"v2 only. Servicing fee (basis points). Null for v3."},"drawFee":{"type":"string","nullable":true,"description":"v3 only. Per-draw fee (basis points, FEE_DRAW). Null for v1/v2."},"repayFee":{"type":"string","nullable":true,"description":"v3 only. Per-repay fee (basis points, FEE_REPAY). Null for v1/v2."}}},"creditLines":{"type":"array","description":"Credit lines ordered by repayment queue position (first item is repaid first)","items":{"allOf":[{"$ref":"#/components/schemas/CreditLine"},{"type":"object","properties":{"relatedAddresses":{"type":"object","nullable":true,"description":"Related addresses for this credit line. Only included when expand=related-addresses is specified. Contains lender, vault, and vaultCurator addresses. Null if fetching failed.","required":["lender"],"properties":{"lender":{"type":"string","description":"Lender address (owner of the credit line NFT)","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"vault":{"type":"string","nullable":true,"description":"Lending vault address associated with the lender","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"vaultCurator":{"type":"string","nullable":true,"description":"Vault curator address for the lender","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"}}}}}]}},"totals":{"type":"object","required":["depositUsd","principalUsd","interestAccruedUsd","interestRepaidUsd","interestBalanceUsd","creditLimitUsd"],"description":"Aggregated totals in USD. depositUsd/principalUsd/interestAccruedUsd/interestRepaidUsd/interestBalanceUsd cover all non-errored credit lines (open + closed) — closed lines can still hold non-zero balances on-chain. creditLimitUsd covers OPEN lines only because closed-line creditLimit is the historical authorised credit at close, not an active obligation. apyPct is the USD-deposit-weighted average across open lines. Any USD field is null if a contributing line lacks a USD price.","properties":{"depositUsd":{"type":"string","nullable":true,"description":"Sum across all non-errored lines (open + closed) of deposit converted to USD."},"principalUsd":{"type":"string","nullable":true,"description":"Sum across all non-errored lines (open + closed) of outstanding principal converted to USD."},"interestAccruedUsd":{"type":"string","nullable":true,"description":"Sum across all non-errored lines (open + closed) of accrued interest converted to USD."},"interestRepaidUsd":{"type":"string","nullable":true,"description":"Sum across all non-errored lines (open + closed) of repaid interest converted to USD."},"interestBalanceUsd":{"type":"string","nullable":true,"description":"Sum across all non-errored lines (open + closed) of interest balance converted to USD. Open lines: accrued + repaid. Closed lines: repaid only."},"creditLimitUsd":{"type":"string","nullable":true,"description":"Sum across OPEN credit lines only of creditLimit converted to USD. Closed lines are excluded because their creditLimit is the historical authorised credit at close, not an active obligation."},"apyPct":{"type":"number","nullable":true,"description":"USD-deposit-weighted average APY across open lines (e.g. 5.0 = 5.0%). For multi-token facilities the weighting is in USD so each line contributes proportionally to its USD exposure. Falls back to raw-deposit-weighted APY (with drawRate fallback) when no open line has a priced non-zero deposit. Null if no APY can be derived."}}}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v3/credit-facilities/{id}/proposals":{"get":{"operationId":"getCreditFacilityProposals","summary":"Get credit facility proposals","tags":["Credit Facilities"],"description":"Get mutual consent proposals for a Credit Facility. Authentication is required.","parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true,"description":"Credit Facility ID. Example: 550e8400-e29b-41d4-a716-446655440000"}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{"OAuth2":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["facilityId","facilityAddress","networkId","open","closed","revokedAllEvents"],"properties":{"facilityId":{"type":"string","description":"Credit Facility UUID","example":"550e8400-e29b-41d4-a716-446655440000"},"facilityAddress":{"type":"string","description":"Credit facility contract address","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"networkId":{"type":"string","description":"CAIP-2 network identifier (e.g. eip155:8453)","example":"eip155:1"},"open":{"type":"array","description":"Proposals that are still open (pending acceptance)","items":{"type":"object","required":["proposalId","taker","nonce","proposalType","status","registeredAt","registeredTxHash","registeredBlockNumber"],"properties":{"proposalId":{"type":"string","description":"Unique proposal identifier (bytes32)"},"taker":{"type":"string","description":"Address that needs to accept the proposal","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"nonce":{"type":"string","description":"Nonce at time of registration"},"msgData":{"type":"string","nullable":true,"description":"Raw hex-encoded function call data from the proposal"},"proposalType":{"type":"string","enum":["new_credit","refinance","set_fees","unknown"],"description":"Type of proposal: new_credit for new credit lines, refinance for modifications, set_fees for fee changes, unknown if ABI missing or function is not recognized"},"parameters":{"oneOf":[{"title":"CreditProposalParameters","type":"object","description":"Credit proposal parameters (new_credit or refinance)","required":["lender","amount","drawRate","facilityRate","deadline"],"properties":{"lender":{"type":"string","description":"Lender address","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"vaultCurator":{"type":"string","nullable":true,"description":"Vault curator (manager) address for the lender","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"vault":{"type":"string","nullable":true,"description":"Lending vault address for the lender (CreditStrategy)","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"token":{"type":"string","nullable":true,"description":"Token address","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"amount":{"type":"string","description":"Credit amount (raw uint256 — divide by the token's decimals to get human-readable value)"},"drawRate":{"type":"string","description":"Draw rate in basis points"},"facilityRate":{"type":"string","description":"Facility rate in basis points"},"deadline":{"type":"string","format":"date-time","description":"Expiration","example":"2025-01-15T10:30:00Z"},"isRestricted":{"type":"boolean","description":"Whether credit is restricted (new_credit only)"},"earlyWithdrawalFee":{"type":"string","description":"Early withdrawal fee in basis points (new_credit only)"},"lineTokenId":{"type":"string","description":"Existing credit line token ID (refinance only)"},"desiredNonce":{"type":"string","description":"Nonce the proposer required at acceptance, decoded from msgData (new_credit and refinance only)"}}},{"title":"SetFeesProposalParameters","type":"object","description":"Fee change parameters (set_fees)","required":["originationFee","swapFee","servicingFee"],"properties":{"originationFee":{"type":"string","description":"Origination fee in basis points"},"swapFee":{"type":"string","description":"Swap fee in basis points"},"servicingFee":{"type":"string","description":"Servicing fee in basis points"}}},{"type":"null"}],"description":"Decoded proposal terms. Shape depends on proposalType: credit parameters for new_credit/refinance, fee parameters for set_fees, null for unknown."},"status":{"type":"string","enum":["pending"],"description":"Proposal status (always pending for open proposals)"},"registeredAt":{"type":"string","format":"date-time","example":"2025-01-15T10:30:00Z"},"registeredTxHash":{"type":"string"},"registeredBlockNumber":{"type":"integer"}}}},"closed":{"type":"array","description":"Proposals that have been closed (accepted, revoked, or revoked_all)","items":{"type":"object","required":["proposalId","taker","nonce","proposalType","status","registeredAt","registeredTxHash","registeredBlockNumber","closedAt","closedTxHash","closedBlockNumber"],"properties":{"proposalId":{"type":"string","description":"Unique proposal identifier (bytes32)"},"taker":{"type":"string","description":"Address that needed to accept the proposal"},"nonce":{"type":"string","description":"Nonce at time of registration"},"msgData":{"type":"string","nullable":true,"description":"Raw hex-encoded function call data from the proposal"},"proposalType":{"type":"string","enum":["new_credit","refinance","set_fees","unknown"],"description":"Type of proposal: new_credit for new credit lines, refinance for modifications, set_fees for fee changes, unknown if ABI missing or function is not recognized"},"parameters":{"oneOf":[{"title":"CreditProposalParameters","type":"object","description":"Credit proposal parameters (new_credit or refinance)","required":["lender","amount","drawRate","facilityRate","deadline"],"properties":{"lender":{"type":"string","description":"Lender address","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"vaultCurator":{"type":"string","nullable":true,"description":"Vault curator (manager) address for the lender","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"vault":{"type":"string","nullable":true,"description":"Lending vault address for the lender (CreditStrategy)","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"token":{"type":"string","nullable":true,"description":"Token address","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"amount":{"type":"string","description":"Credit amount (raw uint256 — divide by the token's decimals to get human-readable value)"},"drawRate":{"type":"string","description":"Draw rate in basis points"},"facilityRate":{"type":"string","description":"Facility rate in basis points"},"deadline":{"type":"string","format":"date-time","description":"Expiration","example":"2025-01-15T10:30:00Z"},"isRestricted":{"type":"boolean","description":"Whether credit is restricted (new_credit only)"},"earlyWithdrawalFee":{"type":"string","description":"Early withdrawal fee in basis points (new_credit only)"},"lineTokenId":{"type":"string","description":"Existing credit line token ID (refinance only)"},"desiredNonce":{"type":"string","description":"Nonce the proposer required at acceptance, decoded from msgData (new_credit and refinance only)"}}},{"title":"SetFeesProposalParameters","type":"object","description":"Fee change parameters (set_fees)","required":["originationFee","swapFee","servicingFee"],"properties":{"originationFee":{"type":"string","description":"Origination fee in basis points"},"swapFee":{"type":"string","description":"Swap fee in basis points"},"servicingFee":{"type":"string","description":"Servicing fee in basis points"}}},{"type":"null"}],"description":"Decoded proposal terms. Shape depends on proposalType: credit parameters for new_credit/refinance, fee parameters for set_fees, null for unknown."},"status":{"type":"string","enum":["accepted","revoked","revoked_all"],"description":"How the proposal was closed"},"registeredAt":{"type":"string","format":"date-time","example":"2025-01-15T10:30:00Z"},"registeredTxHash":{"type":"string"},"registeredBlockNumber":{"type":"integer"},"closedAt":{"type":"string","format":"date-time","example":"2025-01-15T10:30:00Z"},"closedTxHash":{"type":"string"},"closedBlockNumber":{"type":"integer"}}}},"revokedAllEvents":{"type":"array","description":"All RevokedAll events that cleared proposals","items":{"type":"object","required":["newNonce","timestamp","txHash","blockNumber"],"properties":{"newNonce":{"type":"string","description":"New nonce after revocation"},"timestamp":{"type":"string","format":"date-time","example":"2025-01-15T10:30:00Z"},"txHash":{"type":"string"},"blockNumber":{"type":"integer"}}}}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v3/servicings":{"get":{"operationId":"listServicings","summary":"List servicings","tags":["Servicings"],"description":"List enabled Servicings (per-borrower relationship hubs). Only applicable to v3 of the protocol. Authentication is required. Users see servicings for borrowers they have access to.","parameters":[{"schema":{"type":"string","maxLength":36,"format":"uuid"},"in":"query","name":"organizationId","required":false,"description":"Filter by borrower organization ID. Example: 550e8400-e29b-41d4-a716-446655440000"},{"schema":{"type":"string","maxLength":50},"in":"query","name":"networkId","required":false,"description":"Filter by network ID (CAIP-2 blockchain ID), e.g., `eip155:1` (Ethereum), `eip155:8453` (Base)"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"in":"query","name":"limit","required":false},{"schema":{"type":"integer","minimum":0,"default":0},"in":"query","name":"offset","required":false},{"schema":{"type":"array","style":"form","explode":false,"items":{"type":"string","enum":["status","asset","organization","related-addresses","collateral","facilities","capacity","covenants"]}},"in":"query","name":"expand","required":false,"description":"Comma-separated list of fields to expand. Valid values: \"status\" (includes the cross-default status (closed, isDefaulted, worst breach level)), \"asset\" (includes the accounting unit (asset token + decimals) every raw amount is denominated in), \"organization\" (includes full organization object with links), \"related-addresses\" (includes the borrower and trustee addresses), \"collateral\" (includes the collateral pool with advance rates, raw value and USD value), \"facilities\" (includes the facilities bound to this servicing), \"capacity\" (includes the shared borrowing-base aggregates (advanced value, drawn, committed, remaining)), \"covenants\" (includes the per-covenant breach levels behind the cross-default status)."}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{"OAuth2":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["servicings","pagination"],"properties":{"servicings":{"type":"array","items":{"$ref":"#/components/schemas/Servicing"}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v3/servicings/{id}":{"get":{"operationId":"getServicing","summary":"Get servicing by ID","tags":["Servicings"],"description":"Get a single Servicing by ID. Only applicable to v3 of the protocol. Authentication is required.","parameters":[{"schema":{"type":"array","style":"form","explode":false,"items":{"type":"string","enum":["status","asset","organization","related-addresses","collateral","facilities","capacity","covenants"]}},"in":"query","name":"expand","required":false,"description":"Comma-separated list of fields to expand. Valid values: \"status\" (includes the cross-default status (closed, isDefaulted, worst breach level)), \"asset\" (includes the accounting unit (asset token + decimals) every raw amount is denominated in), \"organization\" (includes full organization object with links), \"related-addresses\" (includes the borrower and trustee addresses), \"collateral\" (includes the collateral pool with advance rates, raw value and USD value), \"facilities\" (includes the facilities bound to this servicing), \"capacity\" (includes the shared borrowing-base aggregates (advanced value, drawn, committed, remaining)), \"covenants\" (includes the per-covenant breach levels behind the cross-default status)."},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true,"description":"Servicing ID. Example: 550e8400-e29b-41d4-a716-446655440000"}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{"OAuth2":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Servicing"}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v3/borrowers":{"get":{"operationId":"listBorrowers","summary":"List borrowers","tags":["Borrowers"],"description":"List enabled borrower organizations. Authentication is optional but affects results.","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"in":"query","name":"limit","required":false},{"schema":{"type":"integer","minimum":0,"default":0},"in":"query","name":"offset","required":false},{"schema":{"type":"array","style":"form","explode":false,"items":{"type":"string","enum":["v1","v2","v3"]}},"in":"query","name":"protocolVersion","required":false,"description":"Filter by protocol version(s). Comma-separated or repeated (e.g. `?protocolVersion=v1,v2` or `?protocolVersion=v1&protocolVersion=v2`). Omit to return all versions."},{"schema":{"type":"array","style":"form","explode":false,"items":{"type":"string","enum":["organization","stats","apy","status"]}},"in":"query","name":"expand","required":false,"description":"Comma-separated list of fields to expand. Valid values: \"organization\" (includes full organization object with links), \"stats\" (includes borrower statistics), \"apy\" (includes weighted APY and facilities count), \"status\" (includes on-chain cross-default status, one entry per Servicing contract)."}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{"OAuth2":[]},{}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["borrowers","pagination"],"properties":{"borrowers":{"type":"array","items":{"type":"object","required":["organizationId","name","networkIds"],"properties":{"organizationId":{"type":"string","format":"uuid","description":"Borrower organization ID","example":"550e8400-e29b-41d4-a716-446655440000"},"name":{"type":"string","description":"Organization name"},"networkIds":{"type":"array","items":{"type":"string","example":"eip155:1"},"description":"CAIP-2 network identifiers for blockchain networks this borrower has credit facilities on"},"organization":{"nullable":true,"allOf":[{"$ref":"#/components/schemas/Organization"}],"description":"Full organization details with links. Only included when expand includes \"organization\"."},"stats":{"type":"object","nullable":true,"description":"Borrower statistics. Only included when expand includes \"stats\".","required":["totalVolumeUsd","activeLoansUsd","totalInterestPaidUsd","totalBorrowedUsd","valuationIncomplete"],"properties":{"totalVolumeUsd":{"type":"string","description":"Total USD volume (borrows + all repayments)","example":"1234567.890000"},"activeLoansUsd":{"type":"string","description":"Current outstanding principal in USD (borrows - principal repayments)","example":"1234567.890000"},"totalInterestPaidUsd":{"type":"string","description":"Cumulative interest paid in USD","example":"1234567.890000"},"totalBorrowedUsd":{"type":"string","description":"Cumulative amount borrowed in USD (regardless of repayments)","example":"1234567.890000"},"valuationIncomplete":{"type":"boolean","description":"True when one or more of this borrower's outstanding balances could not be valued in USD and were counted as zero, so `activeLoansUsd` is off by an unknown amount in an unknown direction — a balance is a net, so an omitted one may have been negative. Read it as a partial valuation, not as a bound. Only `activeLoansUsd` is affected; the historical totals are unaffected.","example":false}}},"apy":{"type":"object","nullable":true,"description":"APY and facilities data. Only included when expand includes \"apy\".","required":["facilitiesCount","activeCreditLinesCount"],"properties":{"weightedApyPct":{"type":"number","nullable":true,"description":"Weighted average APY as a percentage (e.g., 8.5 = 8.5%). Null if no credit facility or rates unavailable."},"facilitiesCount":{"type":"number","description":"Number of credit facilities for this borrower."},"activeCreditLinesCount":{"type":"number","description":"Number of open credit lines across all credit facilities for this borrower."}}},"status":{"type":"object","nullable":true,"description":"On-chain cross-default status. Only included when expand includes \"status\". Returns one entry per Servicing contract — each is an independent cross-default group, so they are not merged into a single status.","required":["servicings"],"properties":{"servicings":{"type":"array","items":{"type":"object","required":["address","networkId","closed","isDefaulted","breachLevel","covenants"],"properties":{"address":{"type":"string","description":"Servicing contract address"},"networkId":{"type":"string","nullable":true,"description":"CAIP-2 network identifier (e.g. eip155:8453)"},"closed":{"type":"boolean","nullable":true,"description":"Whether the relationship has been wound down or liquidated. Null when unavailable."},"isDefaulted":{"type":"boolean","nullable":true,"description":"Whether the borrower is in cross-default (applies to every facility under this Servicing). Null when unavailable."},"breachLevel":{"type":"string","nullable":true,"enum":["NONE","CURING","DEFAULTED"],"description":"Worst covenant breach level. CURING is a curable breach within its cure window. Null when it cannot be determined."},"covenants":{"type":"array","items":{"type":"object","required":["address","level"],"properties":{"address":{"type":"string","description":"Covenant contract address"},"level":{"type":"string","nullable":true,"enum":["NONE","CURING","DEFAULTED"],"description":"Breach level for this covenant. Null when its read failed."}}}}}}}}}}}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}}}}},"/v3/borrowers/{id}":{"get":{"operationId":"getBorrower","summary":"Get borrower by ID","tags":["Borrowers"],"description":"Get a single borrower organization by ID. Authentication is optional but required to view private borrowers.","parameters":[{"schema":{"type":"array","style":"form","explode":false,"items":{"type":"string","enum":["organization","stats","apy","status"]}},"in":"query","name":"expand","required":false,"description":"Comma-separated list of fields to expand. Valid values: \"organization\" (includes full organization object with links), \"stats\" (includes borrower statistics), \"apy\" (includes weighted APY and facilities count), \"status\" (includes on-chain cross-default status, one entry per Servicing contract)."},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true,"description":"Borrower organization ID. Example: 550e8400-e29b-41d4-a716-446655440000"}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{"OAuth2":[]},{}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["organizationId","name","networkIds"],"properties":{"organizationId":{"type":"string","format":"uuid","description":"Borrower organization ID","example":"550e8400-e29b-41d4-a716-446655440000"},"name":{"type":"string","description":"Organization name"},"networkIds":{"type":"array","items":{"type":"string","example":"eip155:1"},"description":"CAIP-2 network identifiers for blockchain networks this borrower has credit facilities on"},"organization":{"nullable":true,"allOf":[{"$ref":"#/components/schemas/Organization"}],"description":"Full organization details with links. Only included when expand includes \"organization\"."},"stats":{"type":"object","nullable":true,"description":"Borrower statistics. Only included when expand includes \"stats\".","required":["totalVolumeUsd","activeLoansUsd","totalInterestPaidUsd","totalBorrowedUsd","valuationIncomplete"],"properties":{"totalVolumeUsd":{"type":"string","description":"Total USD volume (borrows + all repayments)","example":"1234567.890000"},"activeLoansUsd":{"type":"string","description":"Current outstanding principal in USD (borrows - principal repayments)","example":"1234567.890000"},"totalInterestPaidUsd":{"type":"string","description":"Cumulative interest paid in USD","example":"1234567.890000"},"totalBorrowedUsd":{"type":"string","description":"Cumulative amount borrowed in USD (regardless of repayments)","example":"1234567.890000"},"valuationIncomplete":{"type":"boolean","description":"True when one or more of this borrower's outstanding balances could not be valued in USD and were counted as zero, so `activeLoansUsd` is off by an unknown amount in an unknown direction — a balance is a net, so an omitted one may have been negative. Read it as a partial valuation, not as a bound. Only `activeLoansUsd` is affected; the historical totals are unaffected.","example":false}}},"apy":{"type":"object","nullable":true,"description":"APY and facilities data. Only included when expand includes \"apy\".","required":["facilitiesCount","activeCreditLinesCount"],"properties":{"weightedApyPct":{"type":"number","nullable":true,"description":"Weighted average APY as a percentage (e.g., 8.5 = 8.5%). Null if no credit facility or rates unavailable."},"facilitiesCount":{"type":"number","description":"Number of credit facilities for this borrower."},"activeCreditLinesCount":{"type":"number","description":"Number of open credit lines across all credit facilities for this borrower."}}},"status":{"type":"object","nullable":true,"description":"On-chain cross-default status. Only included when expand includes \"status\". Returns one entry per Servicing contract — each is an independent cross-default group, so they are not merged into a single status.","required":["servicings"],"properties":{"servicings":{"type":"array","items":{"type":"object","required":["address","networkId","closed","isDefaulted","breachLevel","covenants"],"properties":{"address":{"type":"string","description":"Servicing contract address"},"networkId":{"type":"string","nullable":true,"description":"CAIP-2 network identifier (e.g. eip155:8453)"},"closed":{"type":"boolean","nullable":true,"description":"Whether the relationship has been wound down or liquidated. Null when unavailable."},"isDefaulted":{"type":"boolean","nullable":true,"description":"Whether the borrower is in cross-default (applies to every facility under this Servicing). Null when unavailable."},"breachLevel":{"type":"string","nullable":true,"enum":["NONE","CURING","DEFAULTED"],"description":"Worst covenant breach level. CURING is a curable breach within its cure window. Null when it cannot be determined."},"covenants":{"type":"array","items":{"type":"object","required":["address","level"],"properties":{"address":{"type":"string","description":"Covenant contract address"},"level":{"type":"string","nullable":true,"enum":["NONE","CURING","DEFAULTED"],"description":"Breach level for this covenant. Null when its read failed."}}}}}}}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v3/borrowers/{id}/logs":{"get":{"operationId":"getBorrowerLogs","summary":"Get borrower activity logs","tags":["Borrowers"],"description":"Get on-chain activity logs for a borrower. Works for both v2 and v3 borrowers, and contains two kinds of events:\n- **Financing events** — borrows/draws, repayments, deposits, withdrawals, fees, and (v3) interest accruals, emitted by the borrower's credit facilities.\n- **Status events** (v3 only) — covenant, collateral, and servicing changes.\n\nEach item carries a `source` (`facility`, `servicing`, `covenant`, or `collateral`) indicating which contract emitted it, and `lineTokenId` identifying the individual credit line (position) where applicable.\n\nSupports three response formats via the `format` query parameter:\n- **json** (default) — paginated JSON (default limit 20, max 1000).\n- **csv** — streamed CSV file download (up to 1 000 000 rows).\n- **event-stream** — Server-Sent Events stream (up to 1 000 000 rows). Each log is emitted as a named `log` event with JSON data. A final `done` event carries `{\"total\": N}`. Connect with `EventSource` or `fetch`:\n\n```js\nconst es = new EventSource('/v3/borrowers/{id}/logs?format=event-stream', {\n  headers: { 'x-api-key': 'cc_...' },\n});\nes.addEventListener('log', (e) => console.log(JSON.parse(e.data)));\nes.addEventListener('done', (e) => { console.log('total:', JSON.parse(e.data).total); es.close(); });\n```\n\nEvent types by protocol version —\n- **v1/v2**: AddCredit, Borrow, IncreaseCredit, PayServicingFee, RepayInterest, RepayPrincipal, ReservesChanged, TransferOriginationFee, WithdrawDeposit, WithdrawProfit\n- **v3**: AdvanceRateUpdated, Attested, BreachCured, BreachDeclared, Checkpointed, Claimed, CloseSurplusRecorded, Closed, CollateralAdded, CollateralReleaseFailed, CollateralReleased, CollateralRemoved, CommitmentAccrued, CommitmentClaimed, CommitmentClosed, CommitmentDrawn, CommitmentRepaid, CovenantAdded, CovenantEvalFailed, CovenantRemoved, FacilityAdded, FacilityCloseFailed, FacilityClosed, FacilityRemoved, Liquidated, Operated, OperatorUpdated, Originated, OwnerWithdrawn, Refinanced, ReleaseFailed, Released, ServicingClosed, SurplusClaimed, TargetAdded, TargetReleaseFailed, TargetReleased, TargetRemoved, TrusteeSet","parameters":[{"schema":{"type":"string","enum":["json","csv","event-stream"],"default":"json"},"in":"query","name":"format","required":false,"description":"Response format. \"json\" returns paginated JSON (default 20, max 1000). \"csv\" returns a streamed CSV file download. \"event-stream\" returns Server-Sent Events with each log as a named \"log\" event and a final \"done\" event."},{"schema":{"type":"string"},"in":"query","name":"networkId","required":false,"description":"Filter logs by CAIP-2 network identifier. Example: eip155:8453"},{"schema":{"type":"array","style":"form","explode":false,"items":{"type":"string","enum":["v1","v2","v3"]}},"in":"query","name":"protocolVersion","required":false,"description":"Filter by protocol version(s). Comma-separated or repeated (e.g. `?protocolVersion=v1,v2` or `?protocolVersion=v1&protocolVersion=v2`). Omit to return all versions."},{"schema":{"type":"string","format":"date"},"in":"query","name":"startDate","required":false,"description":"Start date (YYYY-MM-DD). Example: 2025-01-15"},{"schema":{"type":"string","format":"date"},"in":"query","name":"endDate","required":false,"description":"End date, inclusive (YYYY-MM-DD). Example: 2025-01-15"},{"schema":{"type":"integer","minimum":1},"in":"query","name":"limit","required":false,"description":"Maximum number of results. For json: default 20, max 1000. For csv/event-stream: default 1000000, max 1000000."},{"schema":{"type":"integer","minimum":0,"default":0},"in":"query","name":"offset","required":false},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true,"description":"Borrower organization ID. Example: 550e8400-e29b-41d4-a716-446655440000"}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{"OAuth2":[]}],"responses":{"200":{"description":"Borrower activity logs — financing events from the borrower's credit facilities (v2 and v3), plus v3 covenant/collateral/servicing status events. Response format depends on the `format` query parameter.","content":{"application/json":{"schema":{"type":"object","required":["organizationId","logs","pagination"],"properties":{"organizationId":{"type":"string","format":"uuid","description":"Borrower organization ID","example":"550e8400-e29b-41d4-a716-446655440000"},"logs":{"type":"array","items":{"type":"object","required":["timestamp","eventType","direction","amount","decimals","token","lineTokenId","address","source","protocolVersion","contractAddress","networkId","txHash"],"properties":{"timestamp":{"type":"string","format":"date-time","example":"2025-01-15T10:30:00Z"},"eventType":{"type":"string","description":"Event type. v1/v2: AddCredit, Borrow, IncreaseCredit, PayServicingFee, RepayInterest, RepayPrincipal, ReservesChanged, TransferOriginationFee, WithdrawDeposit, WithdrawProfit. v3: AdvanceRateUpdated, Attested, BreachCured, BreachDeclared, Checkpointed, Claimed, CloseSurplusRecorded, Closed, CollateralAdded, CollateralReleaseFailed, CollateralReleased, CollateralRemoved, CommitmentAccrued, CommitmentClaimed, CommitmentClosed, CommitmentDrawn, CommitmentRepaid, CovenantAdded, CovenantEvalFailed, CovenantRemoved, FacilityAdded, FacilityCloseFailed, FacilityClosed, FacilityRemoved, Liquidated, Operated, OperatorUpdated, Originated, OwnerWithdrawn, Refinanced, ReleaseFailed, Released, ServicingClosed, SurplusClaimed, TargetAdded, TargetReleaseFailed, TargetReleased, TargetRemoved, TrusteeSet."},"direction":{"type":"string","enum":["in","out","none"],"description":"Cash flow direction: in (deposits/repayments), out (borrows/withdrawals/fees), none (not a facility cash flow — e.g. status/lifecycle events, interest accruals, or collateral adapter sweeps/withdrawals; these may still carry a meaningful amount)"},"amount":{"type":"string","description":"Raw on-chain amount (smallest unit integer string). For a v3 CommitmentRepaid this is the gross total repaid (principal + interest)."},"principal":{"type":"string","nullable":true,"description":"Principal portion of a v3 CommitmentRepaid (raw smallest units, gross). Null for all other events."},"interest":{"type":"string","nullable":true,"description":"Interest portion of a v3 CommitmentRepaid (raw smallest units, GROSS — what the borrower paid). Null for all other events."},"fee":{"type":"string","nullable":true,"description":"Protocol performance fee on a v3 CommitmentRepaid (raw smallest units), skimmed out of the interest (fee ⊆ interest, informational). Null for all other events."},"decimals":{"type":"integer","nullable":true,"description":"Token decimals for converting amount to human-readable form"},"token":{"type":"string","nullable":true,"description":"Token contract address","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"lineTokenId":{"type":"string","nullable":true,"description":"Credit line / commitment token ID"},"address":{"type":"string","nullable":true,"description":"The address a status event concerns (e.g. the covenant, collateral, trustee, or counterparty); null when not applicable.","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"source":{"type":"string","enum":["facility","servicing","covenant","collateral"],"description":"The kind of contract that emitted the event. `facility` is the lending contract (financing events, for both v2 and v3); `servicing`, `covenant`, and `collateral` are v3 status events. The individual credit line (position) is given by `lineTokenId`."},"protocolVersion":{"type":"string","enum":["v1","v2","v3"],"description":"Protocol generation of the contract that emitted the event."},"contractAddress":{"type":"string","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"networkId":{"type":"string","description":"CAIP-2 network identifier (e.g. eip155:8453)","example":"eip155:1"},"txHash":{"type":"string"}}}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}},"text/csv":{"schema":{"type":"string","description":"CSV file download. Columns: timestamp, eventType, direction, amount, decimals, token, lineTokenId, contractAddress, networkId, txHash, source, address, protocolVersion, principal, interest, fee."}},"text/event-stream":{"schema":{"type":"string","description":"Server-Sent Events stream. Each log is emitted as a named \"log\" event with JSON data. A final \"done\" event carries {\"total\": N}."}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v3/borrowers/{id}/analytics":{"get":{"operationId":"getBorrowerAnalytics","summary":"Get borrower analytics time series","tags":["Borrowers"],"description":"Get analytics time series for a borrower. Returns daily cashflow, trailing sums, and debt metrics. Auto-detects loan start date from the first borrow event if startDate is not provided.","parameters":[{"schema":{"type":"string","format":"date"},"in":"query","name":"startDate","required":false,"description":"Start date (YYYY-MM-DD). Defaults to auto-detected loan start."},{"schema":{"type":"string","format":"date"},"in":"query","name":"endDate","required":false,"description":"End date, inclusive (YYYY-MM-DD). Defaults to today."},{"schema":{"type":"string"},"in":"query","name":"trailingDays","required":false,"description":"Comma-separated trailing periods in days (e.g. \"14,30,120\"). Max: 365. Defaults to org config or \"30\"."},{"schema":{"type":"string"},"in":"query","name":"stages","required":false,"description":"Comma-separated INTERNAL (on-chain) stage filter for cashflow (e.g. \"secured,settled\"). Valid values: in_transit, secured, settled. \"external\" is also accepted for backward compatibility but is ignored here — it does not error and does not affect the internal series; external-business cashflow is a separate series (see externalEntryType / cashFlowDailyExternal). Normally you do not need to specify this parameter. Defaults to org config or \"secured\"."},{"schema":{"type":"string","enum":["inflow","net"]},"in":"query","name":"direction","required":false,"description":"Internal (on-chain) cash flow direction. \"inflow\" counts only inflows. \"net\" computes net flow (inflows - outflows). Defaults to org config or \"inflow\"."},{"schema":{"type":"string","enum":["transfer","daily_cashflow"]},"in":"query","name":"externalEntryType","required":false,"description":"Which external-business source to display: \"transfer\" (individual transactions) or \"daily_cashflow\" (daily aggregates). Defaults to whichever source has data."},{"schema":{"type":"string","enum":["inflow","net"]},"in":"query","name":"externalDirection","required":false,"description":"External-business cash flow direction, independent of the internal direction. Defaults to org config or \"inflow\"."},{"schema":{"type":"array","style":"form","explode":false,"items":{"type":"string","enum":["debt"]}},"in":"query","name":"expand","required":false,"description":"Comma-separated list of fields to expand. Valid values: \"debt\" (adds live on-chain debt state)."},{"schema":{"type":"string","enum":["json","csv"],"default":"json"},"in":"query","name":"format","required":false,"description":"Response format. \"json\" (default) or \"csv\" file download."},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true,"description":"Borrower organization ID"}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{"OAuth2":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["organizationId","organizationName","config","timeSeries","meta"],"properties":{"organizationId":{"type":"string","format":"uuid"},"organizationName":{"type":"string"},"config":{"type":"object","properties":{"trailingPeriods":{"type":"array","items":{"type":"integer"}},"stages":{"type":"array","items":{"type":"string"},"description":"Internal (on-chain) stages included"},"direction":{"type":"string","enum":["inflow","net"],"description":"Internal direction"},"externalEntryType":{"type":"string","enum":["transfer","daily_cashflow"],"description":"External source displayed (resolved — may have been auto-picked)"},"externalDirection":{"type":"string","enum":["inflow","net"],"description":"External direction"},"loanStartDate":{"type":"string","nullable":true},"loanEndDate":{"type":"string","nullable":true},"loanTermDays":{"type":"integer","nullable":true,"description":"Loan term in days (loanEndDate - loanStartDate), used as trailing period for SRR/WALD"}}},"timeSeries":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","format":"date"},"cashFlowDaily":{"type":"string","description":"Internal (on-chain) daily cashflow for the selected pipeline stages"},"trailingCashFlows":{"type":"object","additionalProperties":{"type":"string"},"description":"Internal trailing cashflow sums keyed by period (e.g. { \"14\": \"423000.00\", \"30\": \"1523450.00\" })"},"cashFlowDailyExternal":{"type":"string","nullable":true,"description":"External-business daily cashflow (money moving outside the on-chain pipeline). Null when the org has no external-business cashflow in range (see meta.hasExternalCashflow)."},"trailingCashFlowsExternal":{"type":"object","additionalProperties":{"type":"string"},"nullable":true,"description":"External-business trailing cashflow sums keyed by period (e.g. { \"14\": \"423000.00\", \"30\": \"1523450.00\" }). Null when the org has no external-business cashflow in range (see meta.hasExternalCashflow)."},"principal":{"type":"string","nullable":true,"description":"Outstanding principal in USD as of this date, valued at this date's asset prices. Null when an open position is in an asset with no USD price for this date; principalUnpricedCurrencies lists those assets."},"interestPaid":{"type":"string","description":"Cumulative interest actually paid, in USD as of each payment date"},"accruedInterest":{"type":"string","nullable":true,"description":"Interest accrued and still owed as of this date, in USD, valued at this date's asset prices. Excludes interest already paid (see interestPaid). As of the most recent interest charge — interest continues to accrue between charges and that portion is not included. Null when interest is owed in an asset with no USD price for this date; accruedInterestUnpricedCurrencies lists those assets. A lower bound rather than a total whenever accruedInterestCoverageIncomplete is true; that flag being false is not the converse guarantee, see its own description."},"accruedInterestByCurrency":{"type":"array","nullable":true,"description":"Interest still owed per asset on this date, with its USD value. Assets with no USD price carry amountUsd null and a populated amount. Null on dates with nothing owed.","items":{"type":"object","properties":{"currency":{"type":"string","nullable":true,"description":"Asset symbol. Null when the asset has no configured denomination: amount is still exact — it was scaled by the asset's own decimals — but the asset can be neither named nor priced, so amountUsd is null too."},"amount":{"type":"string","description":"Amount in asset units"},"amountUsd":{"type":"string","nullable":true}}}},"accruedInterestUnpricedCurrencies":{"type":"array","nullable":true,"items":{"type":"string","nullable":true},"description":"Assets in accruedInterestByCurrency with no USD price for this date. accruedInterest and debt are null whenever this is present. Null when every asset owed has a price. A null element is an asset with no configured denomination — unnameable as well as unpriceable, and the same entry that carries currency null in accruedInterestByCurrency."},"accruedInterestCoverageIncomplete":{"type":"boolean","description":"True when a shortfall was detected in this borrower's interest ledger — interest repaid that the charges on record do not account for, or a charge whose amount could not be read — so accruedInterest is understated and should be read as a lower bound rather than a total. Once true it stays true for the rest of the series. False means no such shortfall was detected; it is not an independent confirmation that every charge has been accounted for. debt remains populated: the interest that could be accounted for is still included."},"debt":{"type":"string","nullable":true,"description":"Total debt in USD as of this date: principal plus interest accrued and still owed. Null when either component is null — see principalUnpricedCurrencies and accruedInterestUnpricedCurrencies for which assets are responsible."},"principalByCurrency":{"type":"array","nullable":true,"description":"Outstanding amount per asset on this date, with its USD value. Lists every open position, including assets with no USD price — those carry amountUsd null and a populated amount. Null on dates with no outstanding position.","items":{"type":"object","properties":{"currency":{"type":"string","nullable":true,"description":"Asset symbol. Null when the asset has no configured denomination: amount is still exact — it was scaled by the asset's own decimals — but the asset can be neither named nor priced, so amountUsd is null too."},"amount":{"type":"string","description":"Amount in asset units"},"amountUsd":{"type":"string","nullable":true}}}},"principalUnpricedCurrencies":{"type":"array","nullable":true,"items":{"type":"string","nullable":true},"description":"Assets in principalByCurrency with no USD price for this date. principal and debt are null whenever this is present. Null when every open position has a price. A null element is an asset with no configured denomination — unnameable as well as unpriceable, and the same entry that carries currency null in principalByCurrency."},"creditLimit":{"type":"string","nullable":true,"description":"Total credit made available as of this date, in USD. Null when any credit line could not be valued in USD, for either of the reasons given by creditLimitUnpricedCurrencies and creditLimitHasUnidentifiedAsset."},"creditLimitByCurrency":{"type":"array","nullable":true,"description":"Credit made available per asset on this date, with its USD value. Assets with no USD price carry amountUsd null and a populated amount. Credit that could not be quantified is NOT listed: when creditLimitHasUnidentifiedAsset is true these entries do not cover all credit and do not sum to creditLimit. Null on dates before any credit line existed.","items":{"type":"object","properties":{"currency":{"type":"string","nullable":true},"amount":{"type":"string","description":"Amount in asset units"},"amountUsd":{"type":"string","nullable":true}}}},"creditLimitUnpricedCurrencies":{"type":"array","nullable":true,"items":{"type":"string"},"description":"Assets in creditLimitByCurrency with no USD price for this date. Null when every listed asset has a price; creditLimit may still be null in that case, if creditLimitHasUnidentifiedAsset is true."},"creditLimitHasUnidentifiedAsset":{"type":"boolean","description":"True when credit on this date could not be quantified: either its asset could not be identified, or the amount recorded for it could not be read. Such credit is excluded from creditLimit and from creditLimitByCurrency, and no amount is reported for it anywhere in the response — this flag is the only indication that it exists. Both causes carry the same consequence for a consumer, which is why they share one flag; the field name predates the second."},"loanTerm":{"type":"string","nullable":true,"description":"Deposit-weighted average loan term (days) of credit lines open on this date. Lines in different assets are weighted by USD value; a date with a single asset needs no price. Null when any open line cannot be weighted — its asset was not identified, its amount could not be read, or the date spans several assets and one of them has no USD price."},"dscr":{"type":"string","nullable":true,"description":"DSCR: loan-term-windowed cashflow / credit limit"},"srr":{"type":"string","nullable":true,"description":"SRR (Spigot Repayment Ratio): 30d trailing cashflow / credit limit"},"wald":{"type":"string","nullable":true,"description":"WALD (Weighted Avg Liquidity Duration): 30 / SRR (days to repay at current 30d rate)"},"collateral":{"type":"string","nullable":true,"description":"Cumulative collateral snapshot (USD) as of this date"}}}},"currentDebt":{"type":"object","nullable":true,"description":"Live on-chain debt state, in USD. Only present when expand=debt. Amounts are null where they could not be valued, and the scope differs by cause: a missing price nulls only the amounts it actually affects, so an amount whose contributions are all zero still reads \"0.00\", while a credit line that could not be read at all — or a facility whose on-chain read failed — nulls every amount for that facility and the organization totals with it. Expect mixed null and non-null amounts in one response.","properties":{"principalUsd":{"type":"string","nullable":true,"description":"Outstanding principal across all facilities. Null when a NON-ZERO principal could not be priced. A zero needs no price, so this reads \"0.00\" — not null — when every facility is fully repaid, even in an asset with no price available."},"accruedInterestUsd":{"type":"string","nullable":true,"description":"Interest accrued but not yet repaid, across all facilities. Null when a NON-ZERO accrued interest could not be priced; reads \"0.00\" when nothing is accrued, regardless of price availability."},"depositUsd":{"type":"string","nullable":true,"description":"Total deposited across all facilities. Null when a NON-ZERO deposit could not be priced. Nullability is independent of the other amounts: a facility with an unpriced deposit and no outstanding principal returns depositUsd null alongside principalUsd \"0.00\"."},"totalDebtUsd":{"type":"string","nullable":true,"description":"principalUsd + accruedInterestUsd. Null if either of those is null."},"principal":{"type":"string","nullable":true,"deprecated":true,"description":"DEPRECATED — use principalUsd, which holds the same value. Scheduled for removal. Note this field is now nullable and its value is USD, not token units."},"accruedInterest":{"type":"string","nullable":true,"deprecated":true,"description":"DEPRECATED — use accruedInterestUsd, which holds the same value. Scheduled for removal."},"deposit":{"type":"string","nullable":true,"deprecated":true,"description":"DEPRECATED — use depositUsd, which holds the same value. Scheduled for removal."},"totalDebt":{"type":"string","nullable":true,"deprecated":true,"description":"DEPRECATED — use totalDebtUsd, which holds the same value. Scheduled for removal."},"facilities":{"type":"array","description":"Per-facility breakdown. Each amount is null or populated on its own terms, exactly as at the organization level: a missing price nulls only the amounts it affects, while a failed read nulls every amount for that facility. Expect mixed null and non-null amounts within a single facility.","items":{"type":"object","properties":{"address":{"type":"string"},"networkId":{"type":"string"},"principalUsd":{"type":"string","nullable":true},"depositUsd":{"type":"string","nullable":true},"interestAccruedUsd":{"type":"string","nullable":true},"principal":{"type":"string","nullable":true,"deprecated":true,"description":"DEPRECATED — use principalUsd, which holds the same value. Scheduled for removal."},"deposit":{"type":"string","nullable":true,"deprecated":true,"description":"DEPRECATED — use depositUsd, which holds the same value. Scheduled for removal."},"interestAccrued":{"type":"string","nullable":true,"deprecated":true,"description":"DEPRECATED — use interestAccruedUsd, which holds the same value. Scheduled for removal."}}}}}},"meta":{"type":"object","properties":{"dataRange":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"}}},"entriesCount":{"type":"integer"},"loanStartDetected":{"type":"boolean"},"hasExternalCashflow":{"type":"boolean","description":"Whether the org has any external-business cashflow in range, in either source (drives whether external figures are shown)"},"externalSourcesAvailable":{"type":"array","items":{"type":"string","enum":["transfer","daily_cashflow"]},"description":"Which external sources hold data in range — the meaningful options for the external source selector"},"externalCashflowLabel":{"type":"string","nullable":true,"description":"Optional display label for the external cashflow series (e.g. 'Borrower Reported'). Null when no label has been set."}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v3/vault-curators":{"get":{"operationId":"listVaultCurators","summary":"List vault curators","tags":["Vault Curators"],"description":"List enabled vault curator organizations. Authentication is optional but affects results.","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"in":"query","name":"limit","required":false},{"schema":{"type":"integer","minimum":0,"default":0},"in":"query","name":"offset","required":false},{"schema":{"type":"array","style":"form","explode":false,"items":{"type":"string","enum":["v1","v2","v3"]}},"in":"query","name":"protocolVersion","required":false,"description":"Filter by protocol version(s). Comma-separated or repeated (e.g. `?protocolVersion=v1,v2` or `?protocolVersion=v1&protocolVersion=v2`). Omit to return all versions."},{"schema":{"type":"array","style":"form","explode":false,"items":{"type":"string","enum":["organization"]}},"in":"query","name":"expand","required":false,"description":"Comma-separated list of fields to expand. Valid values: \"organization\" (includes full organization object with links)."}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{"OAuth2":[]},{}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["vaultCurators","pagination"],"properties":{"vaultCurators":{"type":"array","items":{"type":"object","required":["organizationId","name","networkIds"],"properties":{"organizationId":{"type":"string","format":"uuid","description":"Vault curator organization ID","example":"550e8400-e29b-41d4-a716-446655440000"},"name":{"type":"string","description":"Organization name"},"networkIds":{"type":"array","items":{"type":"string","example":"eip155:1"},"description":"CAIP-2 network identifiers for blockchain networks this vault curator has vaults on"},"organization":{"nullable":true,"allOf":[{"$ref":"#/components/schemas/Organization"}],"description":"Full organization details with links. Only included when expand includes \"organization\"."}}}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}}}}},"/v3/vault-curators/{id}":{"get":{"operationId":"getVaultCurator","summary":"Get vault curator by ID","tags":["Vault Curators"],"description":"Get a single vault curator organization by ID. Authentication is optional but required to view private vault curators.","parameters":[{"schema":{"type":"array","style":"form","explode":false,"items":{"type":"string","enum":["organization"]}},"in":"query","name":"expand","required":false,"description":"Comma-separated list of fields to expand. Valid values: \"organization\" (includes full organization object with links)."},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true,"description":"Vault curator organization ID. Example: 550e8400-e29b-41d4-a716-446655440000"}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{"OAuth2":[]},{}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["organizationId","name","networkIds"],"properties":{"organizationId":{"type":"string","format":"uuid","description":"Vault curator organization ID","example":"550e8400-e29b-41d4-a716-446655440000"},"name":{"type":"string","description":"Organization name"},"networkIds":{"type":"array","items":{"type":"string","example":"eip155:1"},"description":"CAIP-2 network identifiers for blockchain networks this vault curator has vaults on"},"organization":{"nullable":true,"allOf":[{"$ref":"#/components/schemas/Organization"}],"description":"Full organization details with links. Only included when expand includes \"organization\"."}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v3/users/me/verified":{"get":{"operationId":"checkUserVerification","summary":"Check user verification status","tags":["Users"],"description":"Check if the authenticated user is verified (via KYC, legacy onboarding, KYB organization membership, or legacy KYB)","security":[{"BearerAuth":[]},{"OAuth2":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["verified"],"properties":{"verified":{"type":"boolean","description":"Whether the user is verified through KYC, legacy onboarding, or membership in a KYB-verified or legacy KYB organization"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v3/users/me/consent":{"post":{"operationId":"recordBiometricConsent","summary":"Record biometric consent","tags":["Users"],"description":"Record biometric consent for the authenticated user","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["biometricConsentGiven","biometricConsentVersion"],"properties":{"biometricConsentGiven":{"type":"boolean","description":"Whether the user has given biometric consent"},"biometricConsentVersion":{"type":"string","description":"Version of the biometric consent accepted"}}}}}},"security":[{"BearerAuth":[]},{"OAuth2":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["success","message","user"],"properties":{"success":{"type":"boolean"},"message":{"type":"string"},"user":{"type":"object","required":["id","email","createdAt","updatedAt"],"properties":{"id":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"},"email":{"type":"string"},"firstName":{"type":"string","nullable":true},"lastName":{"type":"string","nullable":true},"metadata":{"type":"object","nullable":true,"additionalProperties":true},"createdAt":{"type":"string","format":"date-time","example":"2025-01-15T10:30:00Z"},"updatedAt":{"type":"string","format":"date-time","example":"2025-01-15T10:30:00Z"}}}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v3/users/me/organizations":{"get":{"operationId":"listMyOrganizations","summary":"List user's organizations","tags":["Users"],"description":"List all organizations the authenticated user is a member of. Returns organizations, per-org functional access roles (\"borrower\", \"vault-curator\"), and a top-level union of all functional roles. Not all members receive functional roles; members without any will have an empty roles array for that org.","security":[{"BearerAuth":[]},{"OAuth2":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["organizations","organizationAccessById","roles"],"properties":{"organizations":{"type":"array","items":{"$ref":"#/components/schemas/Organization"}},"organizationAccessById":{"type":"object","additionalProperties":{"type":"object","required":["roles"],"properties":{"roles":{"type":"array","items":{"type":"string","enum":["borrower","vault-curator","vault-depositor-manager"]},"description":"Functional access roles for this organization. \"borrower\": member of a borrower org. \"vault-curator\": member of a vault curator org. \"vault-depositor-manager\": admin of a vault curator org. Not all members receive functional roles."}}},"description":"Map of organizationId to functional access roles."},"roles":{"type":"array","items":{"type":"string","enum":["borrower","vault-curator","vault-depositor-manager"]},"description":"Union of all functional roles the user has across all organizations."}},"example":{"organizations":[{"id":"550e8400-e29b-41d4-a716-446655440000","name":"Acme Corp","slug":"acme-corp","header":null,"description":null,"overview":null,"links":[{"id":"a10e8400-e29b-41d4-a716-446655440000","label":"#logo","linkText":null,"iconUrl":null,"url":"https://example.com/acme-logo.png"}]},{"id":"660e8400-e29b-41d4-a716-446655440001","name":"Beta Inc","slug":"beta-inc","header":null,"description":null,"overview":null,"links":[]}],"organizationAccessById":{"550e8400-e29b-41d4-a716-446655440000":{"roles":["borrower"]},"660e8400-e29b-41d4-a716-446655440001":{"roles":["vault-curator","vault-depositor-manager"]}},"roles":["borrower","vault-curator","vault-depositor-manager"]}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v3/users/me/organizations/kyb-eligible":{"get":{"operationId":"listKybEligibleOrganizations","summary":"List KYB-eligible organizations","tags":["Users"],"description":"List organizations where the authenticated user is an admin with KYB eligibility status. Returns simplified organization data: name, slug, and kybEligible flag.","security":[{"BearerAuth":[]},{"OAuth2":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["organizations"],"properties":{"organizations":{"type":"array","items":{"type":"object","required":["name","slug","kybEligible"],"properties":{"name":{"type":"string","maxLength":255},"slug":{"type":"string","maxLength":100},"kybEligible":{"type":"boolean","description":"Whether the organization is eligible for KYB verification (true if user is admin and org is NOT yet verified)"}}}}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v3/whitelist-requests":{"post":{"operationId":"createWhitelistRequest","summary":"Submit vault whitelist request","tags":["Whitelist Requests"],"description":"Submit a request to be whitelisted for a private vault (requires verified status)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"vaultId":{"type":"string","format":"uuid","description":"Vault ID. If provided, vaultAddress and networkId are derived from the vault. Example: 550e8400-e29b-41d4-a716-446655440000"},"vaultAddress":{"type":"string","maxLength":42,"pattern":"^0x[0-9a-fA-F]{40}$","description":"The Ethereum address of the vault (required if vaultId is not provided). Example: 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"networkId":{"type":"string","maxLength":50,"description":"The CAIP-2 network identifier, e.g. \"eip155:1\" (required if vaultId is not provided)"},"requestorAddress":{"type":"string","maxLength":42,"pattern":"^0x[0-9a-fA-F]{40}$","description":"Your Ethereum address to be whitelisted. Example: 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"}},"required":["requestorAddress"],"oneOf":[{"required":["vaultId"]},{"required":["vaultAddress","networkId"]}]}}}},"security":[{"BearerAuth":[]},{"OAuth2":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["id","vaultAddress","networkId","requestorEmail","requestorAddress","status","requestedAt","createdAt","updatedAt"],"properties":{"id":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"},"vaultAddress":{"type":"string","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"networkId":{"type":"string","example":"eip155:1"},"requestorUserId":{"type":"string","format":"uuid","nullable":true,"example":"550e8400-e29b-41d4-a716-446655440000"},"requestorEmail":{"type":"string"},"requestorAddress":{"type":"string","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"status":{"type":"string"},"requestedAt":{"type":"string","format":"date-time","example":"2025-01-15T10:30:00Z"},"approverUserId":{"type":"string","format":"uuid","nullable":true,"example":"550e8400-e29b-41d4-a716-446655440000"},"approverEmail":{"type":"string","nullable":true},"approverAddress":{"type":"string","nullable":true,"example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"processedAt":{"type":"string","format":"date-time","nullable":true,"example":"2025-01-15T10:30:00Z"},"createdAt":{"type":"string","format":"date-time","example":"2025-01-15T10:30:00Z"},"updatedAt":{"type":"string","format":"date-time","example":"2025-01-15T10:30:00Z"}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v3/whitelist-requests/me":{"get":{"operationId":"listMyWhitelistRequests","summary":"Get my whitelist requests","tags":["Whitelist Requests"],"description":"Get all whitelist requests submitted by the authenticated user","parameters":[{"schema":{"type":"string","enum":["pending","approved","rejected"]},"in":"query","name":"status","required":false,"description":"Filter by request status"},{"schema":{"type":"string","format":"uuid"},"in":"query","name":"vaultId","required":false,"description":"Filter by vault ID. Takes precedence over vaultAddress. Example: 550e8400-e29b-41d4-a716-446655440000"},{"schema":{"type":"string","maxLength":42,"pattern":"^0x[0-9a-fA-F]{40}$"},"in":"query","name":"vaultAddress","required":false,"description":"Filter by vault address. Example: 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"in":"query","name":"limit","required":false},{"schema":{"type":"integer","minimum":0,"default":0},"in":"query","name":"offset","required":false}],"security":[{"BearerAuth":[]},{"OAuth2":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["requests","pagination"],"properties":{"requests":{"type":"array","items":{"type":"object","required":["id","vaultAddress","networkId","requestorEmail","requestorAddress","status","requestedAt","createdAt","updatedAt"],"properties":{"id":{"type":"string","format":"uuid"},"vaultAddress":{"type":"string"},"networkId":{"type":"string"},"requestorUserId":{"type":"string","format":"uuid","nullable":true},"requestorEmail":{"type":"string"},"requestorAddress":{"type":"string"},"status":{"type":"string"},"requestedAt":{"type":"string","format":"date-time"},"approverUserId":{"type":"string","format":"uuid","nullable":true},"approverEmail":{"type":"string","nullable":true},"approverAddress":{"type":"string","nullable":true},"processedAt":{"type":"string","format":"date-time","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}}},"pagination":{"type":"object","required":["total","limit","offset"],"properties":{"total":{"type":"integer"},"limit":{"type":"integer"},"offset":{"type":"integer"}}}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v3/whitelist-requests/{requestId}":{"get":{"operationId":"getWhitelistRequest","summary":"Get whitelist request by ID","tags":["Whitelist Requests"],"description":"Get a specific whitelist request by ID (must be owned by you)","parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"requestId","required":true}],"security":[{"BearerAuth":[]},{"OAuth2":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["id","vaultAddress","networkId","requestorEmail","requestorAddress","status","requestedAt","createdAt","updatedAt"],"properties":{"id":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"},"vaultAddress":{"type":"string","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"networkId":{"type":"string","example":"eip155:1"},"requestorUserId":{"type":"string","format":"uuid","nullable":true,"example":"550e8400-e29b-41d4-a716-446655440000"},"requestorEmail":{"type":"string"},"requestorAddress":{"type":"string","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"status":{"type":"string"},"requestedAt":{"type":"string","format":"date-time","example":"2025-01-15T10:30:00Z"},"approverUserId":{"type":"string","format":"uuid","nullable":true,"example":"550e8400-e29b-41d4-a716-446655440000"},"approverEmail":{"type":"string","nullable":true},"approverAddress":{"type":"string","nullable":true,"example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"processedAt":{"type":"string","format":"date-time","nullable":true,"example":"2025-01-15T10:30:00Z"},"createdAt":{"type":"string","format":"date-time","example":"2025-01-15T10:30:00Z"},"updatedAt":{"type":"string","format":"date-time","example":"2025-01-15T10:30:00Z"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v3/whitelist-requests/vault/{vaultId}":{"get":{"operationId":"listVaultWhitelistRequests","summary":"Get whitelist requests for a vault","tags":["Whitelist Requests"],"description":"Get all whitelist requests for a specific vault by vault ID. Requires the caller to be a member of the vault's organization.","parameters":[{"schema":{"type":"string","enum":["pending","approved","rejected"]},"in":"query","name":"status","required":false},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"vaultId","required":true,"description":"Vault ID. Example: 550e8400-e29b-41d4-a716-446655440000"}],"security":[{"BearerAuth":[]},{"OAuth2":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["requests","total"],"properties":{"requests":{"type":"array","items":{"type":"object","required":["id","vaultAddress","networkId","requestorEmail","requestorAddress","status","requestedAt","createdAt","updatedAt"],"properties":{"id":{"type":"string","format":"uuid"},"vaultAddress":{"type":"string"},"networkId":{"type":"string"},"requestorUserId":{"type":"string","format":"uuid","nullable":true},"requestorEmail":{"type":"string"},"requestorAddress":{"type":"string"},"status":{"type":"string"},"requestedAt":{"type":"string","format":"date-time"},"approverUserId":{"type":"string","format":"uuid","nullable":true},"approverEmail":{"type":"string","nullable":true},"approverAddress":{"type":"string","nullable":true},"processedAt":{"type":"string","format":"date-time","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}}},"total":{"type":"integer"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v3/whitelist-requests/{requestId}/reject":{"post":{"operationId":"rejectWhitelistRequest","summary":"Reject a whitelist request","tags":["Whitelist Requests"],"description":"Reject a whitelist request. Requires the caller to be a curator in the vault's organization.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"approverAddress":{"type":"string","maxLength":42,"pattern":"^0x[0-9a-fA-F]{40}$","description":"Optional Ethereum address of the approver. Example: 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"requestId","required":true}],"security":[{"BearerAuth":[]},{"OAuth2":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["id","vaultAddress","networkId","requestorEmail","requestorAddress","status","requestedAt","createdAt","updatedAt"],"properties":{"id":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"},"vaultAddress":{"type":"string","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"networkId":{"type":"string","example":"eip155:1"},"requestorUserId":{"type":"string","format":"uuid","nullable":true,"example":"550e8400-e29b-41d4-a716-446655440000"},"requestorEmail":{"type":"string"},"requestorAddress":{"type":"string","example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"status":{"type":"string"},"requestedAt":{"type":"string","format":"date-time","example":"2025-01-15T10:30:00Z"},"approverUserId":{"type":"string","format":"uuid","nullable":true,"example":"550e8400-e29b-41d4-a716-446655440000"},"approverEmail":{"type":"string","nullable":true},"approverAddress":{"type":"string","nullable":true,"example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"processedAt":{"type":"string","format":"date-time","nullable":true,"example":"2025-01-15T10:30:00Z"},"createdAt":{"type":"string","format":"date-time","example":"2025-01-15T10:30:00Z"},"updatedAt":{"type":"string","format":"date-time","example":"2025-01-15T10:30:00Z"}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v3/vaults/{vaultId}/epochs":{"get":{"operationId":"listVaultEpochs","summary":"List vault epochs","tags":["Vault Epochs"],"description":"List deposit-window epochs for a vault. Requires viewer role for the vault's organization.","parameters":[{"schema":{"type":"string","enum":["upcoming","open","closed"]},"in":"query","name":"state","required":false},{"schema":{"type":"integer","minimum":1,"maximum":100},"in":"query","name":"limit","required":false},{"schema":{"type":"integer","minimum":0},"in":"query","name":"offset","required":false},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"vaultId","required":true}],"security":[{"BearerAuth":[]},{"OAuth2":[]}],"responses":{"401":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"operationId":"createVaultEpoch","summary":"Create a vault epoch","tags":["Vault Epochs"],"description":"Create a deposit-window epoch for a vault. Requires admin role for the vault's organization.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"epochNumber":{"type":"integer","minimum":0,"maximum":2147483647},"targetSize":{"type":"string","pattern":"^\\d{1,78}$","description":"Smallest-unit non-negative integer string (max 78 digits — numeric(78,0)); omit for uncapped"},"state":{"type":"string","enum":["upcoming","open","closed"]}},"required":["epochNumber"]}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"vaultId","required":true}],"security":[{"BearerAuth":[]},{"OAuth2":[]}],"responses":{"400":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v3/vaults/{vaultId}/epochs/{epochId}":{"get":{"operationId":"getVaultEpoch","summary":"Get a vault epoch","tags":["Vault Epochs"],"description":"Get a single vault epoch. Requires viewer role for the vault's organization.","parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"vaultId","required":true},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"epochId","required":true}],"security":[{"BearerAuth":[]},{"OAuth2":[]}],"responses":{"401":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"put":{"operationId":"updateVaultEpoch","summary":"Update a vault epoch","tags":["Vault Epochs"],"description":"Update a vault epoch. Requires admin role for the vault's organization.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"epochNumber":{"type":"integer","minimum":0,"maximum":2147483647},"targetSize":{"type":"string","nullable":true,"pattern":"^\\d{1,78}$"},"state":{"type":"string","enum":["upcoming","open","closed"],"description":"On a state transition, opensAt/closesAt are set automatically to the server clock (opens_at when transitioning to 'open', closes_at when transitioning to 'closed') — they cannot be set directly."}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"vaultId","required":true},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"epochId","required":true}],"security":[{"BearerAuth":[]},{"OAuth2":[]}],"responses":{"400":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"operationId":"deleteVaultEpoch","summary":"Delete a vault epoch","tags":["Vault Epochs"],"description":"Delete a vault epoch. Requires admin role for the vault's organization.","parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"vaultId","required":true},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"epochId","required":true}],"security":[{"BearerAuth":[]},{"OAuth2":[]}],"responses":{"401":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v3/vaults/{vaultId}/origination":{"get":{"operationId":"getVaultOrigination","summary":"Get the origination pipeline for a vault (whitelisted depositors only)","tags":["Vault Origination"],"description":"Pre-commitment deal flow for the vault, with derived stats, a stage board, and declines grouped by reason. Unlike the other depositor-app surfaces this is NOT anonymous: it returns 403 unless the caller is a whitelisted depositor of this vault, holds a role on the vault's curator org, or is a platform admin. Every figure is a projection about deals that are not signed — `basis` is always `pre_commitment_estimate` and `contractual` is always false. Money fields are smallest-unit integer strings; format them with `decimals`. Fields that could not be computed are named in `unavailable` and returned as null, never as 0.","parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"vaultId","required":true,"description":"Vault ID"}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{"OAuth2":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["vaultId","asOf","decimals","basis","contractual","stats","stageBoard","opportunities","declines","unavailable"],"properties":{"vaultId":{"type":"string","format":"uuid"},"asOf":{"type":"string","format":"date-time"},"decimals":{"type":"integer","nullable":true,"description":"Asset-token decimals for every smallest-unit field"},"basis":{"type":"string","enum":["pre_commitment_estimate"],"description":"Load-bearing qualifier — must be surfaced, not footnoted"},"contractual":{"type":"boolean","enum":[false],"description":"Always false: nothing here is a signed obligation"},"stats":{"type":"object","required":["pipelineTotal","probabilityWeighted","projectedYieldBps","fundingByHorizon","fundingByHorizonDate","acceptanceRate","projectedNetApyRange"],"properties":{"pipelineTotal":{"type":"string","description":"Σ expectedSize over in-flight deals, smallest units"},"probabilityWeighted":{"type":"string","description":"Σ floor(expectedSize × conversionBps / 10000) over in-flight deals, smallest units"},"projectedYieldBps":{"type":"integer","nullable":true,"description":"Size-weighted expected yield in bps; null when no in-flight deal has both a size and a yield"},"fundingByHorizon":{"type":"string","nullable":true,"description":"Σ expectedSize of in-flight deals targeted to fund on or before fundingByHorizonDate"},"fundingByHorizonDate":{"type":"string","nullable":true,"format":"date-time","description":"Latest target funding date across in-flight deals; null when none carries one"},"acceptanceRate":{"type":"number","nullable":true,"description":"funded / (funded + declined + withdrawn), 0–1; null when nothing has concluded"},"projectedNetApyRange":{"type":"object","nullable":true,"required":["low","high"],"description":"Scenario band: low = current net yield if nothing converts, high = yield with idle capital deployed at the pipeline's expected rate, net of the management fee. Null when any on-chain input is unavailable.","properties":{"low":{"type":"number"},"high":{"type":"number"}}}}},"stageBoard":{"type":"array","description":"Count and total size per stage, for all six states in canonical board order including empty ones","items":{"type":"object","required":["state","count","totalSize"],"properties":{"state":{"type":"string","enum":["diligence","term_sheet","committed","funded","declined","withdrawn"]},"count":{"type":"integer"},"totalSize":{"type":"string","description":"Smallest units"}}}},"opportunities":{"type":"array","description":"All pipeline rows in curator board order. Labels (J, K, L) are pseudonyms independent of the funded loan book's letters.","items":{"type":"object","required":["id","label","state","borrowerType","sortOrder","createdAt","updatedAt"],"properties":{"id":{"type":"string","format":"uuid"},"label":{"type":"string"},"state":{"type":"string","enum":["diligence","term_sheet","committed","funded","declined","withdrawn"]},"borrowerType":{"type":"string"},"expectedSize":{"type":"string","nullable":true},"expectedYieldBps":{"type":"integer","nullable":true},"conversionBps":{"type":"integer","nullable":true},"targetFundingBy":{"type":"string","nullable":true,"format":"date-time"},"targetFundingLabel":{"type":"string","nullable":true},"geo":{"type":"string","nullable":true},"sector":{"type":"string","nullable":true},"sortOrder":{"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}}},"declines":{"type":"array","description":"Declined and withdrawn deals grouped by reason, size desc. Rows without a reason are omitted.","items":{"type":"object","required":["outcomeReason","count","totalSize"],"properties":{"outcomeReason":{"type":"string"},"count":{"type":"integer"},"totalSize":{"type":"string","description":"Smallest units"}}}},"unavailable":{"type":"array","items":{"type":"string"},"description":"Fields that failed to compute (e.g. [\"projectedNetApyRange\"])"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v3/vaults/{vaultId}/origination/opportunities":{"get":{"operationId":"listOriginationOpportunities","summary":"List origination opportunities for a vault (curator: viewer)","tags":["Vault Origination"],"description":"All pipeline rows for the vault in curator board order (sortOrder, then label). Requires a viewer role on the vault's curator org.","parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"vaultId","required":true}],"security":[{"BearerAuth":[]},{"OAuth2":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["opportunities","total"],"properties":{"opportunities":{"type":"array","items":{"type":"object","required":["id","vaultAddress","networkId","state","borrowerType","label","sortOrder","createdAt","updatedAt"],"properties":{"id":{"type":"string","format":"uuid"},"vaultAddress":{"type":"string"},"networkId":{"type":"string"},"state":{"type":"string","enum":["diligence","term_sheet","committed","funded","declined","withdrawn"]},"borrowerType":{"type":"string"},"expectedSize":{"type":"string","nullable":true,"description":"Smallest-unit non-negative integer string"},"expectedYieldBps":{"type":"integer","nullable":true},"conversionBps":{"type":"integer","nullable":true},"outcomeReason":{"type":"string","nullable":true},"targetFundingBy":{"type":"string","nullable":true,"format":"date-time"},"targetFundingLabel":{"type":"string","nullable":true},"geo":{"type":"string","nullable":true},"sector":{"type":"string","nullable":true},"label":{"type":"string"},"sortOrder":{"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}}},"total":{"type":"integer"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"operationId":"createOriginationOpportunity","summary":"Create an origination opportunity (curator: admin)","tags":["Vault Origination"],"description":"Adds a pipeline row. `label` must be unique for the vault — a duplicate returns 400. Requires an admin role on the vault's curator org.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["borrowerType","label"],"properties":{"state":{"type":"string","enum":["diligence","term_sheet","committed","funded","declined","withdrawn"]},"borrowerType":{"type":"string","minLength":1,"maxLength":60,"description":"Counterparty descriptor, e.g. 'Card issuer'"},"expectedSize":{"type":"string","nullable":true,"pattern":"^\\d{1,78}$","description":"Smallest-unit non-negative integer string, max 78 digits (numeric(78,0)); omit when unscoped"},"expectedYieldBps":{"type":"integer","nullable":true,"minimum":0,"maximum":2147483647,"description":"Expected all-in yield in basis points (1250 = 12.50%)"},"conversionBps":{"type":"integer","nullable":true,"minimum":0,"maximum":10000,"description":"Close probability in basis points; null means unscored and contributes 0 to the probability-weighted total"},"outcomeReason":{"type":"string","nullable":true,"maxLength":60,"description":"Why a terminal deal ended, e.g. 'Pricing misalignment'"},"targetFundingBy":{"type":"string","nullable":true,"format":"date-time","description":"Machine-comparable target funding date, summed for the funding-by tile"},"targetFundingLabel":{"type":"string","nullable":true,"maxLength":40,"description":"Display window, e.g. 'Sep 8 – 15', 'Q4 2026'"},"geo":{"type":"string","nullable":true,"maxLength":8},"sector":{"type":"string","nullable":true,"maxLength":60},"label":{"type":"string","minLength":1,"maxLength":40,"description":"Curator pseudonym shown to depositors, e.g. 'J'. Unique per vault."},"sortOrder":{"type":"integer","minimum":-2147483648,"maximum":2147483647,"description":"Board ordering within a stage column"}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"vaultId","required":true}],"security":[{"BearerAuth":[]},{"OAuth2":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["id","vaultAddress","networkId","state","borrowerType","label","sortOrder","createdAt","updatedAt"],"properties":{"id":{"type":"string","format":"uuid"},"vaultAddress":{"type":"string"},"networkId":{"type":"string"},"state":{"type":"string","enum":["diligence","term_sheet","committed","funded","declined","withdrawn"]},"borrowerType":{"type":"string"},"expectedSize":{"type":"string","nullable":true,"description":"Smallest-unit non-negative integer string"},"expectedYieldBps":{"type":"integer","nullable":true},"conversionBps":{"type":"integer","nullable":true},"outcomeReason":{"type":"string","nullable":true},"targetFundingBy":{"type":"string","nullable":true,"format":"date-time"},"targetFundingLabel":{"type":"string","nullable":true},"geo":{"type":"string","nullable":true},"sector":{"type":"string","nullable":true},"label":{"type":"string"},"sortOrder":{"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v3/vaults/{vaultId}/origination/opportunities/{opportunityId}":{"get":{"operationId":"getOriginationOpportunity","summary":"Get a single origination opportunity (curator: viewer)","tags":["Vault Origination"],"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"vaultId","required":true},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"opportunityId","required":true}],"security":[{"BearerAuth":[]},{"OAuth2":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["id","vaultAddress","networkId","state","borrowerType","label","sortOrder","createdAt","updatedAt"],"properties":{"id":{"type":"string","format":"uuid"},"vaultAddress":{"type":"string"},"networkId":{"type":"string"},"state":{"type":"string","enum":["diligence","term_sheet","committed","funded","declined","withdrawn"]},"borrowerType":{"type":"string"},"expectedSize":{"type":"string","nullable":true,"description":"Smallest-unit non-negative integer string"},"expectedYieldBps":{"type":"integer","nullable":true},"conversionBps":{"type":"integer","nullable":true},"outcomeReason":{"type":"string","nullable":true},"targetFundingBy":{"type":"string","nullable":true,"format":"date-time"},"targetFundingLabel":{"type":"string","nullable":true},"geo":{"type":"string","nullable":true},"sector":{"type":"string","nullable":true},"label":{"type":"string"},"sortOrder":{"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"put":{"operationId":"updateOriginationOpportunity","summary":"Update an origination opportunity (curator: admin)","tags":["Vault Origination"],"description":"Partial update — only supplied fields change. An explicit null clears a nullable field. Requires an admin role on the vault's curator org.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"state":{"type":"string","enum":["diligence","term_sheet","committed","funded","declined","withdrawn"]},"borrowerType":{"type":"string","minLength":1,"maxLength":60,"description":"Counterparty descriptor, e.g. 'Card issuer'"},"expectedSize":{"type":"string","nullable":true,"pattern":"^\\d{1,78}$","description":"Smallest-unit non-negative integer string, max 78 digits (numeric(78,0)); omit when unscoped"},"expectedYieldBps":{"type":"integer","nullable":true,"minimum":0,"maximum":2147483647,"description":"Expected all-in yield in basis points (1250 = 12.50%)"},"conversionBps":{"type":"integer","nullable":true,"minimum":0,"maximum":10000,"description":"Close probability in basis points; null means unscored and contributes 0 to the probability-weighted total"},"outcomeReason":{"type":"string","nullable":true,"maxLength":60,"description":"Why a terminal deal ended, e.g. 'Pricing misalignment'"},"targetFundingBy":{"type":"string","nullable":true,"format":"date-time","description":"Machine-comparable target funding date, summed for the funding-by tile"},"targetFundingLabel":{"type":"string","nullable":true,"maxLength":40,"description":"Display window, e.g. 'Sep 8 – 15', 'Q4 2026'"},"geo":{"type":"string","nullable":true,"maxLength":8},"sector":{"type":"string","nullable":true,"maxLength":60},"label":{"type":"string","minLength":1,"maxLength":40,"description":"Curator pseudonym shown to depositors, e.g. 'J'. Unique per vault."},"sortOrder":{"type":"integer","minimum":-2147483648,"maximum":2147483647,"description":"Board ordering within a stage column"}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"vaultId","required":true},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"opportunityId","required":true}],"security":[{"BearerAuth":[]},{"OAuth2":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["id","vaultAddress","networkId","state","borrowerType","label","sortOrder","createdAt","updatedAt"],"properties":{"id":{"type":"string","format":"uuid"},"vaultAddress":{"type":"string"},"networkId":{"type":"string"},"state":{"type":"string","enum":["diligence","term_sheet","committed","funded","declined","withdrawn"]},"borrowerType":{"type":"string"},"expectedSize":{"type":"string","nullable":true,"description":"Smallest-unit non-negative integer string"},"expectedYieldBps":{"type":"integer","nullable":true},"conversionBps":{"type":"integer","nullable":true},"outcomeReason":{"type":"string","nullable":true},"targetFundingBy":{"type":"string","nullable":true,"format":"date-time"},"targetFundingLabel":{"type":"string","nullable":true},"geo":{"type":"string","nullable":true},"sector":{"type":"string","nullable":true},"label":{"type":"string"},"sortOrder":{"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"operationId":"deleteOriginationOpportunity","summary":"Delete an origination opportunity (curator: admin)","tags":["Vault Origination"],"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"vaultId","required":true},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"opportunityId","required":true}],"security":[{"BearerAuth":[]},{"OAuth2":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["success","message"],"properties":{"success":{"type":"boolean"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v3/users/me/wallets/challenge":{"post":{"operationId":"generateWalletChallenge","summary":"Generate wallet attestation challenge","tags":["Wallet Attestation"],"description":"Generate a challenge message for the given wallet address. The user must sign this message to prove ownership.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["address","namespace"],"properties":{"address":{"type":"string","maxLength":42,"pattern":"^0x[0-9a-fA-F]{40}$","description":"EVM wallet address to attest."},"namespace":{"type":"string","enum":["eip155"],"description":"Address namespace. Currently only \"eip155\" (EVM) is supported."}}}}}},"security":[{"BearerAuth":[]},{"OAuth2":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["message","nonce","expiresIn"],"properties":{"message":{"type":"string","description":"Challenge message to sign"},"nonce":{"type":"string","description":"Challenge nonce"},"expiresIn":{"type":"integer","description":"Nonce TTL in seconds"}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v3/users/me/wallets/attest":{"post":{"operationId":"verifyWalletAttestation","summary":"Verify wallet attestation","tags":["Wallet Attestation"],"description":"Submit the signed attestation message to prove wallet ownership and link the address to your account.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["address","namespace","signature","message"],"properties":{"address":{"type":"string","maxLength":42,"pattern":"^0x[0-9a-fA-F]{40}$","description":"EVM wallet address being attested."},"namespace":{"type":"string","enum":["eip155"],"description":"Network namespace the user is attesting under. The signature is NOT chain-bound — for EVM ('eip155'), the same attestation covers all eip155 chains."},"signature":{"type":"string","description":"The signed message signature from the wallet."},"message":{"type":"string","description":"The attestation message that was signed (returned from the challenge endpoint)."}}}}}},"security":[{"BearerAuth":[]},{"OAuth2":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["id","address","networkNamespace","verifiedAt","createdAt"],"properties":{"id":{"type":"string","format":"uuid"},"address":{"type":"string"},"networkNamespace":{"type":"string"},"verifiedAt":{"type":"string","format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"subscriptions":{"type":"array","items":{"type":"object","required":["type","enabled"],"properties":{"type":{"type":"string","enum":["wallet_transactional","weekly_portfolio"]},"enabled":{"type":"boolean"}}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v3/users/me/wallets":{"get":{"operationId":"listAttestedWallets","summary":"List the user's wallets (optionally including org multisigs)","tags":["Wallet Attestation"],"description":"List the user's attested EOAs. Pass `?include=multisigs` to also include org-owned multisigs the user has access to.","parameters":[{"schema":{"type":"string","enum":["multisigs"]},"in":"query","name":"include","required":false,"description":"Optional extras to include in the response. Currently only `multisigs` is supported."}],"security":[{"BearerAuth":[]},{"OAuth2":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["wallets"],"properties":{"wallets":{"type":"array","items":{"type":"object","required":["type","address","subscriptions"],"properties":{"type":{"type":"string","enum":["eoa","multisig","org_eoa"]},"id":{"type":"string"},"address":{"type":"string"},"networkNamespace":{"type":"string"},"verifiedAt":{"type":"string","format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"networkId":{"type":"string"},"organizationId":{"type":"string","format":"uuid"},"organizationName":{"type":"string"},"subscriptions":{"type":"array","items":{"type":"object","required":["type","enabled"],"properties":{"type":{"type":"string","enum":["wallet_transactional","weekly_portfolio"]},"enabled":{"type":"boolean"}}}}}}}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v3/users/me/email-subscriptions":{"put":{"operationId":"updateEmailSubscriptions","summary":"Update email subscription preferences for the authenticated user","tags":["Wallet Attestation"],"description":"Subscribe or unsubscribe in bulk. Each change is identified by (address, networkId, type); `enabled: true` inserts a row, `enabled: false` deletes one. All cells are user-editable; defaults at wallet-create / org-join time are managed server-side.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["changes"],"properties":{"changes":{"type":"array","items":{"type":"object","required":["address","networkId","type","enabled"],"properties":{"address":{"type":"string","maxLength":42,"pattern":"^0x[0-9a-fA-F]{40}$","description":"EVM address. The server normalizes to EIP-55 checksum form before lookup, so lowercase or mixed case are accepted."},"networkId":{"type":"string","maxLength":50},"type":{"type":"string","enum":["wallet_transactional","weekly_portfolio"]},"enabled":{"type":"boolean"}}}}}}}}},"security":[{"BearerAuth":[]},{"OAuth2":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["wallets"],"properties":{"wallets":{"type":"array","items":{"type":"object","required":["type","address","subscriptions"],"properties":{"type":{"type":"string","enum":["eoa","multisig","org_eoa"]},"id":{"type":"string"},"address":{"type":"string"},"networkNamespace":{"type":"string"},"verifiedAt":{"type":"string","format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"networkId":{"type":"string"},"organizationId":{"type":"string","format":"uuid"},"organizationName":{"type":"string"},"subscriptions":{"type":"array","items":{"type":"object","required":["type","enabled"],"properties":{"type":{"type":"string","enum":["wallet_transactional","weekly_portfolio"]},"enabled":{"type":"boolean"}}}}}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v3/organizations/{orgId}/multisigs":{"get":{"operationId":"listOrgMultisigs","summary":"List org multisig wallets","tags":["Organizations"],"description":"List Safe multisig wallets registered to an organization, with on-chain owner resolution and attestation status.","parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"orgId","required":true}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{"OAuth2":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["multisigs"],"properties":{"multisigs":{"type":"array","items":{"type":"object","required":["id","address","networkId","owners","createdAt"],"properties":{"id":{"type":"string","format":"uuid"},"address":{"type":"string"},"networkId":{"type":"string"},"name":{"type":"string","nullable":true},"owners":{"type":"array","items":{"type":"object","required":["address"],"properties":{"address":{"type":"string"},"attestation":{"nullable":true,"type":"object","required":["verifiedAt","userId"],"properties":{"verifiedAt":{"type":"string","format":"date-time"},"userId":{"type":"string"},"userEmail":{"type":"string","nullable":true},"userName":{"type":"string","nullable":true}}}}}},"createdAt":{"type":"string","format":"date-time"}}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v3/organizations/{orgId}/members":{"get":{"operationId":"listOrgMembers","summary":"List organization members","tags":["Organizations"],"description":"List the members of an organization, with their role. Restricted to organizations the authenticated user is a member of (minimum role: viewer).","parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"orgId","required":true}],"security":[{"BearerAuth":[]},{"OAuth2":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["members"],"properties":{"members":{"type":"array","items":{"type":"object","required":["userId","email","firstName","lastName","role","createdAt"],"properties":{"userId":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"},"email":{"type":"string"},"firstName":{"type":"string","nullable":true},"lastName":{"type":"string","nullable":true},"role":{"type":"string","enum":["admin","viewer"]},"createdAt":{"type":"string","format":"date-time","description":"When the membership was created (not when the user record was created)","example":"2025-01-15T10:30:00Z"}}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v3/turnkey/wallet":{"get":{"operationId":"getBorrowerWallet","summary":"Resolve the authenticated organization's borrower wallet","tags":["Turnkey"],"parameters":[{"schema":{"type":"string"},"in":"query","name":"organizationId","required":false,"description":"Required only for multi-org users; inferred otherwise"}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{"OAuth2":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"organizationId":{"type":"string"},"subOrgId":{"type":"string"},"walletAddress":{"type":["null","string"]},"status":{"type":"string"},"exportPolicy":{"type":"string"},"credentialId":{"type":["null","string"],"description":"Provisioned WebAuthn credential id to pin in allowCredentials when stamping passkey activities"},"credentialIds":{"type":"array","items":{"type":"string"},"description":"Every WebAuthn credential id for the caller's member user — pin allowCredentials to this full set so any of the member's devices can stamp. `credentialId` is credentialIds[0], kept for backward compatibility."},"walletId":{"type":["null","string"],"description":"Turnkey walletId; gates + feeds the passkey export stamp"},"topologyVersion":{"type":"number","description":"1 = single-borrower-identity (legacy); 2 = multi-line/multi-member (see GET /v3/turnkey/lines, /v3/turnkey/enrollments)"}}}}}}}}},"/v3/turnkey/lines":{"get":{"operationId":"listBorrowerLines","summary":"List the borrower sub-org's currently bound active lines","tags":["Turnkey"],"parameters":[{"schema":{"type":"string"},"in":"query","name":"organizationId","required":false,"description":"Required only for multi-org users; inferred otherwise"}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{"OAuth2":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"lines":{"type":"array","items":{"type":"object","properties":{"subOrgId":{"type":"string"},"walletAddress":{"type":"string"},"lineAddress":{"type":"string"},"chainId":{"type":"number"},"custodyMode":{"type":"string"}}}}}}}}}}}},"/v3/turnkey/enrollment":{"get":{"operationId":"getBorrowerEnrollment","summary":"Borrower passkey enrollment status (pending / approved / consumed / rejected / none)","tags":["Turnkey"],"parameters":[{"schema":{"type":"string"},"in":"query","name":"organizationId","required":false,"description":"Required only for multi-org users; inferred otherwise"}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{"OAuth2":[]}],"responses":{"200":{"description":"Default Response"}}},"post":{"operationId":"enrollBorrowerPasskey","summary":"Store the borrower's WebAuthn passkey attestation pending provisioning","tags":["Turnkey"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["authenticator"],"properties":{"authenticator":{"type":"object","description":"WebAuthn passkey attestation captured on the borrower device"},"organizationId":{"type":"string","description":"Required only for multi-org users; inferred otherwise"},"subjectRef":{"type":"string","description":"Topology v2 only: must equal the caller's own Clerk id if supplied (bound, not a default) — omit to use it automatically"},"subjectKind":{"type":"string","enum":["borrower_member"],"description":"'borrower_member' is the only accepted value for new enrollments; v1 'borrower' provisioning is retired and refused by the service"}}}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{"OAuth2":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"organizationId":{"type":"string"},"status":{"type":"string"},"credentialFingerprint":{"type":"string","description":"Fingerprint of the just-registered credential (matches the value shown in GET /v3/turnkey/enrollments)"}}}}}}}}},"/v3/turnkey/enrollment/devices":{"get":{"operationId":"listBorrowerOwnEnrollmentDevices","summary":"List the authenticated caller's OWN passkey enrollment rows (multi-device)","tags":["Turnkey"],"parameters":[{"schema":{"type":"string"},"in":"query","name":"organizationId","required":false,"description":"Required only for multi-org users; inferred otherwise"}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{"OAuth2":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"enrollments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"consumedAt":{"type":["null","string"]},"credentialFingerprint":{"type":"string"},"displayName":{"type":["null","string"],"description":"Borrower-supplied device nickname; null on legacy rows"},"transports":{"type":["null","array"],"items":{"type":"string"},"description":"WebAuthn transport enums (display hint only); null on legacy rows"},"revokeRequestedAt":{"type":["null","string"],"description":"Set when a borrower-filed removal request is open on this device; null otherwise"},"revokeRequestedByUserId":{"type":["null","string"],"description":"The requesting member's own Clerk id (always the caller's own id)"}}}}}}}}}}}},"/v3/turnkey/enrollments":{"get":{"operationId":"listBorrowerEnrollments","summary":"List every enrollment for the org (status only, never the raw attestation)","tags":["Turnkey"],"parameters":[{"schema":{"type":"string"},"in":"query","name":"organizationId","required":false,"description":"Required only for multi-org users; inferred otherwise"}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{"OAuth2":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"enrollments":{"type":"array","items":{"type":"object","properties":{"subjectKind":{"type":"string","enum":["borrower","borrower_member","cc_root"]},"subjectRef":{"type":"string"},"email":{"type":["null","string"]},"status":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"consumedAt":{"type":["null","string"]},"credentialFingerprint":{"type":"string"}}}}}}}}}}}},"/v3/turnkey/borrow":{"post":{"operationId":"borrowerBorrow","summary":"Borrow against the authenticated org's line to an allowlisted destination","tags":["Turnkey"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["lineId","amount","to"],"properties":{"lineId":{"type":"string","description":"Credit position id on the selected line (unrelated to lineAddress)"},"amount":{"type":"string","description":"Amount in smallest units (uint256 string)"},"to":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Destination address (must be on the allowlist)"},"organizationId":{"type":"string","description":"Required only for multi-org users; inferred otherwise"},"lineAddress":{"type":"string","description":"Which bound line to borrow against. Required for a topology v2 (multi-line) org; optional for v1 (defaults to the sole bound line)"},"networkId":{"type":"string","description":"CAIP-2 network id of lineAddress (e.g. eip155:8453). Required with lineAddress"}}}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{"OAuth2":[]}],"responses":{"202":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"transactionHash":{"type":"string"}}}}}}}}},"/v3/turnkey/repay":{"post":{"operationId":"borrowerRepay","summary":"Repay the authenticated org's line (depositAndRepay)","tags":["Turnkey"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["amount"],"properties":{"amount":{"type":"string","description":"Amount in smallest units (uint256 string)"},"organizationId":{"type":"string","description":"Required only for multi-org users; inferred otherwise"},"lineAddress":{"type":"string","description":"Which bound line to repay. Required for a topology v2 (multi-line) org; optional for v1 (defaults to the sole bound line)"},"networkId":{"type":"string","description":"CAIP-2 network id of lineAddress (e.g. eip155:8453). Required with lineAddress"}}}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{"OAuth2":[]}],"responses":{"202":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"transactionHash":{"type":"string"}}}}}}}}},"/v3/turnkey/revoke-consent":{"post":{"operationId":"borrowerRevokeConsent","summary":"Revoke the authenticated org's own open credit proposal (revokeConsent)","tags":["Turnkey"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["proposalId","lineAddress","networkId"],"properties":{"proposalId":{"type":"string","description":"The open proposal id (bytes32) to revoke"},"lineAddress":{"type":"string","description":"The line of credit address"},"networkId":{"type":"string","description":"CAIP-2 network id (e.g. eip155:11155111)"},"organizationId":{"type":"string","description":"Required only for multi-org users; inferred otherwise"}}}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{"OAuth2":[]}],"responses":{"202":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"transactionHash":{"type":"string"}}}}}}}}},"/v3/turnkey/accept":{"post":{"operationId":"borrowerAccept","summary":"Accept (addCredit): v1 session-key execute (202 transactionHash) or v2 passkey relay (202 activityId)","tags":["Turnkey"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["proposalId","lineAddress","networkId"],"properties":{"proposalId":{"type":"string","description":"The open proposal id (bytes32) to counter-sign"},"lineAddress":{"type":"string","description":"The line of credit address"},"networkId":{"type":"string","description":"CAIP-2 network id (e.g. eip155:11155111)"},"organizationId":{"type":"string","description":"Required only for multi-org users; inferred otherwise"},"signedRequest":{"type":"object","description":"Topology v2 ONLY: the borrower's passkey-stamped ETH_SEND_TRANSACTION (from the /prepare calldata). Omit for a v1 sub-org.","required":["url","body","stamp"],"properties":{"url":{"type":"string"},"body":{"type":"string"},"stamp":{"type":"object","required":["stampHeaderName","stampHeaderValue"],"properties":{"stampHeaderName":{"type":"string"},"stampHeaderValue":{"type":"string"}}}}}}}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{"OAuth2":[]}],"responses":{"202":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"transactionHash":{"type":"string","description":"v1 only"},"activityId":{"type":"string","description":"v2 only"},"status":{"type":"string","description":"v2 only"},"approvalsReceived":{"type":"number","description":"v2 only; distinct borrower-member votes only, excludes cc-root"},"approvalsRequired":{"type":"number","description":"v2 only"},"ccApproved":{"type":"boolean","description":"v2 only; whether cc-root has co-signed (reported separately from approvalsReceived)"},"send":{"type":"object","description":"v2 only; present only when this stamp itself completed the send (an m=1 org whose first stamp satisfies consensus immediately). Sponsored-send outcome for a COMPLETED ETH_SEND activity. state: pending = Turnkey has not resolved it yet (not a failure); sent = broadcast, txHash present; failed = the gas-station send failed (see revertSummary); unknown = could not be resolved.","properties":{"state":{"type":"string","enum":["pending","sent","failed","unknown"]},"sendTransactionStatusId":{"type":["null","string"],"description":"Opaque Turnkey id — NOT a transaction hash"},"txHash":{"type":["null","string"]},"txError":{"type":["null","string"]},"revertSummary":{"type":["null","string"]},"revertChain":{"type":"array","items":{"type":"object","properties":{"address":{"type":["null","string"]},"errorType":{"type":["null","string"]},"message":{"type":["null","string"]},"selector":{"type":["null","string"]}}}},"txStatus":{"type":["null","string"]},"checkedAt":{"type":"string"}}}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"number"},"reason":{"type":"string","description":"'CONSENSUS_ALREADY_PENDING' — an identical accept/refinance is already parked for consensus on this sub-org"},"activityId":{"type":"string","description":"The already-pending Turnkey activity id. Refetch GET /v3/turnkey/activities and approve THIS activity instead of re-submitting."}}}}}}}}},"/v3/turnkey/accept/prepare":{"post":{"operationId":"prepareBorrowerAccept","summary":"Topology v2 only: prepare accept (addCredit) calldata for the borrower to passkey-stamp","tags":["Turnkey"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["proposalId","lineAddress","networkId"],"properties":{"proposalId":{"type":"string","description":"The open proposal id (bytes32) to counter-sign"},"lineAddress":{"type":"string","description":"The line of credit address"},"networkId":{"type":"string","description":"CAIP-2 network id (e.g. eip155:11155111)"},"organizationId":{"type":"string","description":"Required only for multi-org users; inferred otherwise"}}}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{"OAuth2":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"lineAddress":{"type":"string"},"networkId":{"type":"string"},"to":{"type":"string"},"calldata":{"type":"string"},"approvalsRequired":{"type":"number"}}}}}}}}},"/v3/turnkey/refinance":{"post":{"operationId":"borrowerRefinance","summary":"Refinance: v1 session-key execute (202 transactionHash) or v2 passkey relay (202 activityId)","tags":["Turnkey"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["proposalId","lineAddress","networkId"],"properties":{"proposalId":{"type":"string","description":"The open proposal id (bytes32) to counter-sign"},"lineAddress":{"type":"string","description":"The line of credit address"},"networkId":{"type":"string","description":"CAIP-2 network id (e.g. eip155:11155111)"},"organizationId":{"type":"string","description":"Required only for multi-org users; inferred otherwise"},"signedRequest":{"type":"object","description":"Topology v2 ONLY: the borrower's passkey-stamped ETH_SEND_TRANSACTION (from the /prepare calldata). Omit for a v1 sub-org.","required":["url","body","stamp"],"properties":{"url":{"type":"string"},"body":{"type":"string"},"stamp":{"type":"object","required":["stampHeaderName","stampHeaderValue"],"properties":{"stampHeaderName":{"type":"string"},"stampHeaderValue":{"type":"string"}}}}}}}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{"OAuth2":[]}],"responses":{"202":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"transactionHash":{"type":"string","description":"v1 only"},"activityId":{"type":"string","description":"v2 only"},"status":{"type":"string","description":"v2 only"},"approvalsReceived":{"type":"number","description":"v2 only; distinct borrower-member votes only, excludes cc-root"},"approvalsRequired":{"type":"number","description":"v2 only"},"ccApproved":{"type":"boolean","description":"v2 only; whether cc-root has co-signed (reported separately from approvalsReceived)"},"send":{"type":"object","description":"v2 only; present only when this stamp itself completed the send (an m=1 org whose first stamp satisfies consensus immediately). Sponsored-send outcome for a COMPLETED ETH_SEND activity. state: pending = Turnkey has not resolved it yet (not a failure); sent = broadcast, txHash present; failed = the gas-station send failed (see revertSummary); unknown = could not be resolved.","properties":{"state":{"type":"string","enum":["pending","sent","failed","unknown"]},"sendTransactionStatusId":{"type":["null","string"],"description":"Opaque Turnkey id — NOT a transaction hash"},"txHash":{"type":["null","string"]},"txError":{"type":["null","string"]},"revertSummary":{"type":["null","string"]},"revertChain":{"type":"array","items":{"type":"object","properties":{"address":{"type":["null","string"]},"errorType":{"type":["null","string"]},"message":{"type":["null","string"]},"selector":{"type":["null","string"]}}}},"txStatus":{"type":["null","string"]},"checkedAt":{"type":"string"}}}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"number"},"reason":{"type":"string","description":"'CONSENSUS_ALREADY_PENDING' — an identical accept/refinance is already parked for consensus on this sub-org"},"activityId":{"type":"string","description":"The already-pending Turnkey activity id. Refetch GET /v3/turnkey/activities and approve THIS activity instead of re-submitting."}}}}}}}}},"/v3/turnkey/refinance/prepare":{"post":{"operationId":"prepareBorrowerRefinance","summary":"Topology v2 only: prepare refinance (refinanceCredit) calldata for the borrower to passkey-stamp","tags":["Turnkey"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["proposalId","lineAddress","networkId"],"properties":{"proposalId":{"type":"string","description":"The open proposal id (bytes32) to counter-sign"},"lineAddress":{"type":"string","description":"The line of credit address"},"networkId":{"type":"string","description":"CAIP-2 network id (e.g. eip155:11155111)"},"organizationId":{"type":"string","description":"Required only for multi-org users; inferred otherwise"}}}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{"OAuth2":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"lineAddress":{"type":"string"},"networkId":{"type":"string"},"to":{"type":"string"},"calldata":{"type":"string"},"approvalsRequired":{"type":"number"}}}}}}}}},"/v3/turnkey/enrollment/devices/{deviceId}/revoke-request":{"post":{"operationId":"requestBorrowerDeviceRevoke","summary":"File a removal request for one of the caller's own devices","tags":["Turnkey"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["proof"],"properties":{"proof":{"type":"object","required":["url","body","stamp"],"properties":{"url":{"type":"string","description":"Turnkey API URL the stamp authorizes (api.turnkey.com only)"},"body":{"type":"string","description":"The exact JSON body that was stamped"},"stamp":{"type":"object","required":["stampHeaderName","stampHeaderValue"],"properties":{"stampHeaderName":{"type":"string"},"stampHeaderValue":{"type":"string"}}},"organizationId":{"type":"string","description":"Required only for multi-org users; inferred otherwise"}}},"organizationId":{"type":"string","description":"Required only for multi-org users; inferred otherwise"}}}}}},"parameters":[{"schema":{"type":"string","minLength":1,"format":"uuid"},"in":"path","name":"deviceId","required":true}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{"OAuth2":[]}],"responses":{"200":{"description":"Default Response"}}},"delete":{"operationId":"withdrawBorrowerDeviceRevoke","summary":"Withdraw an open removal request for one of the caller's own devices","tags":["Turnkey"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organizationId":{"type":"string","description":"Required only for multi-org users; inferred otherwise"}}}}}},"parameters":[{"schema":{"type":"string","minLength":1,"format":"uuid"},"in":"path","name":"deviceId","required":true}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{"OAuth2":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v3/turnkey/activities":{"get":{"operationId":"listBorrowerActivities","summary":"List sub-org activities awaiting the borrower's passkey approval","tags":["Turnkey"],"parameters":[{"schema":{"type":"string"},"in":"query","name":"organizationId","required":false,"description":"Required only for multi-org users; inferred otherwise"}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{"OAuth2":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"activities":{"type":"array"},"proposals":{"type":"array","description":"Pending items the borrower must act on — ONLY accept-credit and accept-refinance proposals (kind accept | refinance), decoded with which party must still sign. Destination, export, role-change and CC-side policy activities are filtered out of this route (admin-panel material); `activities` is limited to the same set.","items":{"type":"object","properties":{"activityId":{"type":"string"},"status":{"type":"string"},"type":{"type":"string"},"kind":{"type":"string","enum":["add","remove","accept","refinance","role-change","send","export","other"]},"destination":{"type":["null","string"]},"metadata":{"type":["null","object"],"description":"Decoded send detail for accept/refinance/send kinds; null for policy edits","properties":{"functionName":{"type":["null","string"]},"contractAddress":{"type":["null","string"]},"amount":{"type":"string"},"token":{"type":"string"},"counterparty":{"type":"string"},"destination":{"type":"string"},"newBorrower":{"type":"string"},"proposalId":{"type":["null","string"],"description":"On-chain mutual-consent proposal id this accept/refinance counter-signs; null when no open proposal matched the calldata"}}},"awaiting":{"type":"string","enum":["credit-coop","borrower","unknown","cc-root"]},"progress":{"type":"object","description":"M-of-N borrower-member consensus progress (topology v2 only); absent for v1","properties":{"borrowerApprovals":{"type":"number"},"borrowerRequired":{"type":"number"},"ccApproved":{"type":"boolean"},"ccRequired":{"type":"boolean"},"awaiting":{"type":"string","enum":["borrower","credit-coop","none","unknown"],"description":"Which SIDE must act next — not a list of members; see awaitingMembers"},"awaitingMembers":{"type":"array","description":"ACTIVE borrower members who have not voted yet (\"can still sign\", not \"must sign\"); CC seats excluded. Always present (possibly empty) when progress is present.","items":{"type":"object","properties":{"subjectRef":{"type":["null","string"]},"providerUserId":{"type":"string"},"email":{"type":["null","string"]},"isCaller":{"type":"boolean"}}}}}},"expiresAt":{"type":["null","string"],"description":"ISO-8601 deadline after which Turnkey discards all votes on this activity (v2 only)"},"initiatorUserId":{"type":"string","description":"Turnkey userId of the activity's first voter (initiator proxy)"},"callerHasStamped":{"type":"boolean","description":"Whether the calling user has already voted on this activity"},"stampsCollected":{"type":"number","description":"Count of approval votes collected so far"},"requiredStamps":{"type":"number","description":"Consensus requirement (member approvals + cc-root if required) for this activity's kind"},"send":{"type":"object","description":"Sponsored-send outcome for a COMPLETED ETH_SEND activity. state: pending = Turnkey has not resolved it yet (not a failure); sent = broadcast, txHash present; failed = the gas-station send failed (see revertSummary); unknown = could not be resolved.","properties":{"state":{"type":"string","enum":["pending","sent","failed","unknown"]},"sendTransactionStatusId":{"type":["null","string"],"description":"Opaque Turnkey id — NOT a transaction hash"},"txHash":{"type":["null","string"]},"txError":{"type":["null","string"]},"revertSummary":{"type":["null","string"]},"revertChain":{"type":"array","items":{"type":"object","properties":{"address":{"type":["null","string"]},"errorType":{"type":["null","string"]},"message":{"type":["null","string"]},"selector":{"type":["null","string"]}}}},"txStatus":{"type":["null","string"]},"checkedAt":{"type":"string"}}}}}},"recentSends":{"type":"array","description":"COMPLETED ETH_SEND activities from the last 24h (20 most recent, kinds accept|refinance only), each with its resolved `send` outcome. Read-only history — NOT actionable; act on `proposals`.","items":{"type":"object","properties":{"activityId":{"type":"string"},"status":{"type":"string"},"type":{"type":"string"},"kind":{"type":"string","enum":["add","remove","accept","refinance","role-change","send","export","other"]},"destination":{"type":["null","string"]},"metadata":{"type":["null","object"],"description":"Decoded send detail for accept/refinance/send kinds; null for policy edits","properties":{"functionName":{"type":["null","string"]},"contractAddress":{"type":["null","string"]},"amount":{"type":"string"},"token":{"type":"string"},"counterparty":{"type":"string"},"destination":{"type":"string"},"newBorrower":{"type":"string"},"proposalId":{"type":["null","string"],"description":"On-chain mutual-consent proposal id this accept/refinance counter-signs; null when no open proposal matched the calldata"}}},"awaiting":{"type":"string","enum":["credit-coop","borrower","unknown","cc-root"]},"progress":{"type":"object","description":"M-of-N borrower-member consensus progress (topology v2 only); absent for v1","properties":{"borrowerApprovals":{"type":"number"},"borrowerRequired":{"type":"number"},"ccApproved":{"type":"boolean"},"ccRequired":{"type":"boolean"},"awaiting":{"type":"string","enum":["borrower","credit-coop","none","unknown"],"description":"Which SIDE must act next — not a list of members; see awaitingMembers"},"awaitingMembers":{"type":"array","description":"ACTIVE borrower members who have not voted yet (\"can still sign\", not \"must sign\"); CC seats excluded. Always present (possibly empty) when progress is present.","items":{"type":"object","properties":{"subjectRef":{"type":["null","string"]},"providerUserId":{"type":"string"},"email":{"type":["null","string"]},"isCaller":{"type":"boolean"}}}}}},"expiresAt":{"type":["null","string"],"description":"ISO-8601 deadline after which Turnkey discards all votes on this activity (v2 only)"},"initiatorUserId":{"type":"string","description":"Turnkey userId of the activity's first voter (initiator proxy)"},"callerHasStamped":{"type":"boolean","description":"Whether the calling user has already voted on this activity"},"stampsCollected":{"type":"number","description":"Count of approval votes collected so far"},"requiredStamps":{"type":"number","description":"Consensus requirement (member approvals + cc-root if required) for this activity's kind"},"send":{"type":"object","description":"Sponsored-send outcome for a COMPLETED ETH_SEND activity. state: pending = Turnkey has not resolved it yet (not a failure); sent = broadcast, txHash present; failed = the gas-station send failed (see revertSummary); unknown = could not be resolved.","properties":{"state":{"type":"string","enum":["pending","sent","failed","unknown"]},"sendTransactionStatusId":{"type":["null","string"],"description":"Opaque Turnkey id — NOT a transaction hash"},"txHash":{"type":["null","string"]},"txError":{"type":["null","string"]},"revertSummary":{"type":["null","string"]},"revertChain":{"type":"array","items":{"type":"object","properties":{"address":{"type":["null","string"]},"errorType":{"type":["null","string"]},"message":{"type":["null","string"]},"selector":{"type":["null","string"]}}}},"txStatus":{"type":["null","string"]},"checkedAt":{"type":"string"}}}}}}}}}}}}}},"/v3/turnkey/activities/{id}/approve":{"post":{"operationId":"approveBorrowerActivity","summary":"Relay a passkey-stamped activity approval to Turnkey","tags":["Turnkey"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["url","body","stamp"],"properties":{"url":{"type":"string","description":"Turnkey API URL the stamp authorizes (api.turnkey.com only)"},"body":{"type":"string","description":"The exact JSON body that was stamped"},"stamp":{"type":"object","required":["stampHeaderName","stampHeaderValue"],"properties":{"stampHeaderName":{"type":"string"},"stampHeaderValue":{"type":"string"}}},"organizationId":{"type":"string","description":"Required only for multi-org users; inferred otherwise"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{"OAuth2":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v3/turnkey/activities/{id}/reject":{"post":{"operationId":"rejectBorrowerActivity","summary":"Relay a passkey-stamped activity rejection to Turnkey","tags":["Turnkey"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["url","body","stamp"],"properties":{"url":{"type":"string","description":"Turnkey API URL the stamp authorizes (api.turnkey.com only)"},"body":{"type":"string","description":"The exact JSON body that was stamped"},"stamp":{"type":"object","required":["stampHeaderName","stampHeaderValue"],"properties":{"stampHeaderName":{"type":"string"},"stampHeaderValue":{"type":"string"}}},"organizationId":{"type":"string","description":"Required only for multi-org users; inferred otherwise"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{"OAuth2":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v3/turnkey/wallet/export":{"post":{"operationId":"exportBorrowerWallet","summary":"Relay a passkey-stamped wallet-export activity to Turnkey","tags":["Turnkey"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["url","body","stamp"],"properties":{"url":{"type":"string","description":"Turnkey API URL the stamp authorizes (api.turnkey.com only)"},"body":{"type":"string","description":"The exact JSON body that was stamped"},"stamp":{"type":"object","required":["stampHeaderName","stampHeaderValue"],"properties":{"stampHeaderName":{"type":"string"},"stampHeaderValue":{"type":"string"}}},"organizationId":{"type":"string","description":"Required only for multi-org users; inferred otherwise"}}}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{"OAuth2":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v3/turnkey/lines/apply":{"post":{"operationId":"applyBorrowerLineChangeSet","summary":"Relay passkey-stamped policy create/delete activities for a new line (parks for consensus)","tags":["Turnkey"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["signedRequests"],"properties":{"signedRequests":{"type":"array","minItems":1,"items":{"type":"object","required":["url","body","stamp"],"properties":{"url":{"type":"string"},"body":{"type":"string"},"stamp":{"type":"object","required":["stampHeaderName","stampHeaderValue"],"properties":{"stampHeaderName":{"type":"string"},"stampHeaderValue":{"type":"string"}}}}}},"organizationId":{"type":"string","description":"Required only for multi-org users; inferred otherwise"}}}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{"OAuth2":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v3/turnkey/destinations/prepare":{"post":{"operationId":"prepareBorrowerDestination","summary":"Prepare the policy to propose a new borrow destination (allowlist addition)","tags":["Turnkey"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["destination"],"properties":{"destination":{"type":"string","description":"New approved borrow destination (EVM address)"},"organizationId":{"type":"string","description":"Required only for multi-org users; inferred otherwise"}}}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{"OAuth2":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v3/turnkey/policies":{"get":{"operationId":"listBorrowerPolicies","summary":"List the policies in force on the borrower sub-org (+ approved destinations)","tags":["Turnkey"],"parameters":[{"schema":{"type":"string"},"in":"query","name":"organizationId","required":false,"description":"Required only for multi-org users; inferred otherwise"}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{"OAuth2":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"policies":{"type":"array","items":{"type":"object","properties":{"policyId":{"type":"string"},"policyName":{"type":"string"},"effect":{"type":"string","description":"EFFECT_ALLOW | EFFECT_DENY"},"condition":{"type":"string","description":"Raw Turnkey policy DSL; empty when the policy carries none"},"notes":{"type":"string","description":"Tagged metadata ('cc-borrower:' + JSON) when the backend authored the policy; otherwise empty"}}}},"approvedDestinations":{"type":"array","items":{"type":"string"},"description":"Borrow destinations parsed out of the borrow-routine ALLOW policies"}}}}}}}}},"/health":{"get":{"operationId":"getHealth","summary":"Check API health","tags":["Health"],"description":"Check API health and status","responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"ok"},"timestamp":{"type":"string","format":"date-time"},"uptime":{"type":"number","description":"Server uptime in seconds"},"version":{"type":"string","example":"abc1234"}}}}}}}}}},"servers":[{"url":"https://api.creditcoop.xyz"}],"tags":[{"name":"Platform","description":"General platform endpoints"},{"name":"Borrowers","description":"Borrower management"},{"name":"Credit Facilities","description":"Credit facility management"},{"name":"Servicings","description":"Per-borrower servicing relationship hubs. Only applicable to v3 of the protocol — earlier protocol versions do not expose servicings."},{"name":"Vault Curators","description":"Vault curator management"},{"name":"Vaults","description":"Vault management"},{"name":"Depositors","description":"Depositor portfolio and performance metrics"},{"name":"Whitelist Requests","description":"Vault whitelist request management"},{"name":"Vault Epochs","description":"Vault deposit-window epoch management (curator org's Manager tab)"},{"name":"Vault Origination","description":"Pre-commitment origination pipeline — curator CRUD plus a whitelisted-depositor read surface"},{"name":"Ledger","description":"Typed ledger endpoints: transfers, borrows, repays, cumulative cashflows"},{"name":"Benchmarks","description":"Benchmark vault APY rates computed from on-chain snapshots"},{"name":"Self Report","description":"Self-reported invoice and cashflow data endpoints"},{"name":"Users","description":"User profile and settings management"},{"name":"Wallet Attestation","description":"Wallet ownership verification via message signing"},{"name":"API Keys","description":"API key management"},{"name":"Organizations","description":"Organization management"},{"name":"Health","description":"Health check endpoints"}]}