openapi: 3.1.0 info: title: Exactly Protocol Auditor ERC-4626 Liquidations API description: 'Smart contract interface for the Auditor, the central risk management component of Exactly Protocol. Manages market listings, collateral factors, account liquidity checks, and liquidation eligibility. Provides methods to query all markets, compute account liquidity, calculate seizure amounts, and check liquidation conditions. Deployed on Ethereum, Optimism, and Base. ' version: 1.0.0 contact: name: Exactly Protocol url: https://docs.exact.ly license: name: MIT url: https://github.com/exactly/protocol/blob/main/LICENSE-MIT servers: - url: https://app.exact.ly description: Exactly Protocol App tags: - name: Liquidations description: Liquidation eligibility and seizure calculations paths: /auditor/calculateSeize: post: summary: Calculate assets to seize during liquidation description: 'Calculates the amount of collateral to seize from a borrower during liquidation, accounting for the liquidation incentive and lender fees. ' operationId: calculateSeize tags: - Liquidations requestBody: required: true content: application/json: schema: type: object required: - repayMarket - seizeMarket - borrower - actualRepayAssets properties: repayMarket: type: string description: Market where the debt is being repaid pattern: ^0x[a-fA-F0-9]{40}$ seizeMarket: type: string description: Market from which collateral is seized pattern: ^0x[a-fA-F0-9]{40}$ borrower: type: string description: Address of the borrower being liquidated pattern: ^0x[a-fA-F0-9]{40}$ actualRepayAssets: type: string description: Actual assets being repaid (in wei) responses: '200': description: Seizure amounts content: application/json: schema: type: object properties: lendersAssets: type: string description: Assets allocated to lenders as incentive (in wei) seizeAssets: type: string description: Total collateral assets to seize from borrower (in wei) /auditor/checkLiquidation: post: summary: Check liquidation eligibility and maximum repay description: 'Verifies that a liquidation is valid and computes the maximum assets the liquidator is allowed to repay given the dynamic close factor. ' operationId: checkLiquidation tags: - Liquidations requestBody: required: true content: application/json: schema: type: object required: - repayMarket - seizeMarket - borrower - maxLiquidatorAssets properties: repayMarket: type: string description: Market where the debt is being repaid pattern: ^0x[a-fA-F0-9]{40}$ seizeMarket: type: string description: Market from which collateral is seized pattern: ^0x[a-fA-F0-9]{40}$ borrower: type: string description: Address of the borrower being liquidated pattern: ^0x[a-fA-F0-9]{40}$ maxLiquidatorAssets: type: string description: Maximum assets the liquidator wants to repay (in wei) responses: '200': description: Maximum repayable assets content: application/json: schema: type: object properties: maxRepayAssets: type: string description: Maximum allowed repay amount after dynamic close factor (in wei) /market/liquidate: post: summary: Liquidate an undercollateralized borrower description: 'Liquidates a borrower''s variable rate debt when their health factor falls below the threshold. The liquidator repays up to maxAssets of debt and receives collateral from the seizeMarket. ' operationId: liquidate tags: - Liquidations requestBody: required: true content: application/json: schema: type: object required: - borrower - maxAssets - seizeMarket properties: borrower: type: string description: Address of the undercollateralized borrower pattern: ^0x[a-fA-F0-9]{40}$ maxAssets: type: string description: Maximum assets to repay (in wei) seizeMarket: type: string description: Market from which to seize collateral pattern: ^0x[a-fA-F0-9]{40}$ responses: '200': description: Assets repaid content: application/json: schema: type: object properties: repaidAssets: type: string description: Total assets repaid (in wei) /market/clearBadDebt: post: summary: Clear bad debt for a borrower description: 'Clears bad debt from a borrower''s account by using the earnings accumulator. Only callable when the borrower''s collateral has been fully seized. ' operationId: clearBadDebt tags: - Liquidations requestBody: required: true content: application/json: schema: type: object required: - borrower properties: borrower: type: string description: Address of the borrower with bad debt pattern: ^0x[a-fA-F0-9]{40}$ responses: '200': description: Bad debt cleared successfully externalDocs: description: Exactly Protocol Auditor Documentation url: https://docs.exact.ly/guides/protocol/auditor.md