Skip to content

LiquidationAdapter

Inherits: Initializable, AccessControlledV8, ReentrancyGuardUpgradeable

Title: LiquidationAdapter

Manages whitelisted liquidators/settlers, routes liquidation calls to Institutional Vault vaults, receives seized collateral, and splits incentive between protocol and caller.

Deployed as a transparent proxy (upgradeable). Holds ACM for whitelist and config management.

uint256 public constant MANTISSA_ONE = 1e18

InstitutionalVaultController address (vaults are validated via controller).

address public vaultController

HF-based liquidators — can call liquidate() when LT shortfall > 0.

mapping(address => bool) public isWhitelistedLiquidator

Deadline-based settlers — can call liquidateOverdueVault() in SettlementDeadlineExceeded.

mapping(address => bool) public isWhitelistedSettler

Fraction of incentive portion to protocol (mantissa).

uint256 public protocolLiquidationShare

Max fraction of debt repayable per liquidation (mantissa). Global for all vaults.

uint256 public closeFactor

Accrued protocol share per collateral token. Swept to PSR via governance.

mapping(address => uint256) public protocolShareAccrued

Note: oz-upgrades-unsafe-allow: constructor

constructor();

Initializes the adapter proxy.

function initialize(
address vaultController_,
uint256 protocolLiquidationShare_,
uint256 closeFactor_,
address acm_
) external initializer;

Parameters

NameTypeDescription
vaultController_addressVaultController address.
protocolLiquidationShare_uint256Initial protocol share of incentive (mantissa).
closeFactor_uint256Initial close factor (mantissa).
acm_addressVenus AccessControlManager address.

Add or remove a liquidator from the whitelist.

Note: event: LiquidatorWhitelistUpdated

function setLiquidatorWhitelist(address liquidator, bool approved) external;

Parameters

NameTypeDescription
liquidatoraddressAddress to update.
approvedboolWhether to approve or remove.

Add or remove a settler from the whitelist.

Note: event: SettlerWhitelistUpdated

function setSettlerWhitelist(address settler, bool approved) external;

Parameters

NameTypeDescription
settleraddressAddress to update.
approvedboolWhether to approve or remove.

Set the protocol share of the liquidation incentive (mantissa).

Notes:

  • error: InvalidShare if share > 1e18.
  • event: ProtocolLiquidationShareUpdated
function setProtocolLiquidationShare(uint256 share) external;

Parameters

NameTypeDescription
shareuint256New share (0 <= share <= 1e18).

Set max fraction of debt repayable per liquidation.

Notes:

  • error: InvalidCloseFactor if zero or > 1e18.
  • event: CloseFactorUpdated
function setCloseFactor(uint256 newCF) external;

Parameters

NameTypeDescription
newCFuint256New close factor (0 < newCF <= 1e18).

Transfer accrued protocol share for the given collateral token to PSR.

Note: event: ProtocolShareSweptToReserve

function sweepProtocolShareToReserve(address collateral) external;

Parameters

NameTypeDescription
collateraladdressCollateral token address.

HF-based liquidation. Whitelisted liquidator only.

function liquidate(
address vault,
uint256 repayAmount
) external onlyWhitelistedLiquidator nonReentrant;

Parameters

NameTypeDescription
vaultaddressVault address to liquidate.
repayAmountuint256Amount of supply asset to repay.

Deadline-based liquidation. Whitelisted settler only.

function liquidateOverdueVault(
address vault,
uint256 repayAmount
) external onlyWhitelistedSettler nonReentrant;

Parameters

NameTypeDescription
vaultaddressVault address to liquidate.
repayAmountuint256Amount of supply asset to repay.

Disabled — renouncing ownership would permanently brick ACM-gated liquidation governance.

Note: error: OwnershipCannotBeRenounced Always reverts.

function renounceOwnership() public pure override;
event LiquidatorWhitelistUpdated(address indexed liquidator, bool approved);
event SettlerWhitelistUpdated(address indexed settler, bool approved);
event ProtocolLiquidationShareUpdated(uint256 oldShare, uint256 newShare);
event CloseFactorUpdated(uint256 oldCloseFactor, uint256 newCloseFactor);
event LiquidationCollateralSplit(uint256 totalSeized, uint256 protocolAmount, uint256 callerAmount);
event ProtocolShareSweptToReserve(address indexed collateral, uint256 amount);
error NotWhitelistedLiquidator();
error NotWhitelistedSettler();
error VaultNotRegistered();
error InvalidShare();
error InvalidCloseFactor();
error InvalidAddress();
error ZeroRepayAmount();
error OwnershipCannotBeRenounced();