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.
Solidity API
Section titled “Solidity API”State Variables
Section titled “State Variables”MANTISSA_ONE
Section titled “MANTISSA_ONE”uint256 public constant MANTISSA_ONE = 1e18vaultController
Section titled “vaultController”InstitutionalVaultController address (vaults are validated via controller).
address public vaultControllerisWhitelistedLiquidator
Section titled “isWhitelistedLiquidator”HF-based liquidators — can call liquidate() when LT shortfall > 0.
mapping(address => bool) public isWhitelistedLiquidatorisWhitelistedSettler
Section titled “isWhitelistedSettler”Deadline-based settlers — can call liquidateOverdueVault() in SettlementDeadlineExceeded.
mapping(address => bool) public isWhitelistedSettlerprotocolLiquidationShare
Section titled “protocolLiquidationShare”Fraction of incentive portion to protocol (mantissa).
uint256 public protocolLiquidationSharecloseFactor
Section titled “closeFactor”Max fraction of debt repayable per liquidation (mantissa). Global for all vaults.
uint256 public closeFactorprotocolShareAccrued
Section titled “protocolShareAccrued”Accrued protocol share per collateral token. Swept to PSR via governance.
mapping(address => uint256) public protocolShareAccruedFunctions
Section titled “Functions”constructor
Section titled “constructor”Note: oz-upgrades-unsafe-allow: constructor
constructor();initialize
Section titled “initialize”Initializes the adapter proxy.
function initialize( address vaultController_, uint256 protocolLiquidationShare_, uint256 closeFactor_, address acm_) external initializer;Parameters
| Name | Type | Description |
|---|---|---|
vaultController_ | address | VaultController address. |
protocolLiquidationShare_ | uint256 | Initial protocol share of incentive (mantissa). |
closeFactor_ | uint256 | Initial close factor (mantissa). |
acm_ | address | Venus AccessControlManager address. |
setLiquidatorWhitelist
Section titled “setLiquidatorWhitelist”Add or remove a liquidator from the whitelist.
Note: event: LiquidatorWhitelistUpdated
function setLiquidatorWhitelist(address liquidator, bool approved) external;Parameters
| Name | Type | Description |
|---|---|---|
liquidator | address | Address to update. |
approved | bool | Whether to approve or remove. |
setSettlerWhitelist
Section titled “setSettlerWhitelist”Add or remove a settler from the whitelist.
Note: event: SettlerWhitelistUpdated
function setSettlerWhitelist(address settler, bool approved) external;Parameters
| Name | Type | Description |
|---|---|---|
settler | address | Address to update. |
approved | bool | Whether to approve or remove. |
setProtocolLiquidationShare
Section titled “setProtocolLiquidationShare”Set the protocol share of the liquidation incentive (mantissa).
Notes:
- error: InvalidShare if share > 1e18.
- event: ProtocolLiquidationShareUpdated
function setProtocolLiquidationShare(uint256 share) external;Parameters
| Name | Type | Description |
|---|---|---|
share | uint256 | New share (0 <= share <= 1e18). |
setCloseFactor
Section titled “setCloseFactor”Set max fraction of debt repayable per liquidation.
Notes:
- error: InvalidCloseFactor if zero or > 1e18.
- event: CloseFactorUpdated
function setCloseFactor(uint256 newCF) external;Parameters
| Name | Type | Description |
|---|---|---|
newCF | uint256 | New close factor (0 < newCF <= 1e18). |
sweepProtocolShareToReserve
Section titled “sweepProtocolShareToReserve”Transfer accrued protocol share for the given collateral token to PSR.
Note: event: ProtocolShareSweptToReserve
function sweepProtocolShareToReserve(address collateral) external;Parameters
| Name | Type | Description |
|---|---|---|
collateral | address | Collateral token address. |
liquidate
Section titled “liquidate”HF-based liquidation. Whitelisted liquidator only.
function liquidate( address vault, uint256 repayAmount) external onlyWhitelistedLiquidator nonReentrant;Parameters
| Name | Type | Description |
|---|---|---|
vault | address | Vault address to liquidate. |
repayAmount | uint256 | Amount of supply asset to repay. |
liquidateOverdueVault
Section titled “liquidateOverdueVault”Deadline-based liquidation. Whitelisted settler only.
function liquidateOverdueVault( address vault, uint256 repayAmount) external onlyWhitelistedSettler nonReentrant;Parameters
| Name | Type | Description |
|---|---|---|
vault | address | Vault address to liquidate. |
repayAmount | uint256 | Amount of supply asset to repay. |
renounceOwnership
Section titled “renounceOwnership”Disabled — renouncing ownership would permanently brick ACM-gated liquidation governance.
Note: error: OwnershipCannotBeRenounced Always reverts.
function renounceOwnership() public pure override;Events
Section titled “Events”LiquidatorWhitelistUpdated
Section titled “LiquidatorWhitelistUpdated”event LiquidatorWhitelistUpdated(address indexed liquidator, bool approved);SettlerWhitelistUpdated
Section titled “SettlerWhitelistUpdated”event SettlerWhitelistUpdated(address indexed settler, bool approved);ProtocolLiquidationShareUpdated
Section titled “ProtocolLiquidationShareUpdated”event ProtocolLiquidationShareUpdated(uint256 oldShare, uint256 newShare);CloseFactorUpdated
Section titled “CloseFactorUpdated”event CloseFactorUpdated(uint256 oldCloseFactor, uint256 newCloseFactor);LiquidationCollateralSplit
Section titled “LiquidationCollateralSplit”event LiquidationCollateralSplit(uint256 totalSeized, uint256 protocolAmount, uint256 callerAmount);ProtocolShareSweptToReserve
Section titled “ProtocolShareSweptToReserve”event ProtocolShareSweptToReserve(address indexed collateral, uint256 amount);Errors
Section titled “Errors”NotWhitelistedLiquidator
Section titled “NotWhitelistedLiquidator”error NotWhitelistedLiquidator();NotWhitelistedSettler
Section titled “NotWhitelistedSettler”error NotWhitelistedSettler();VaultNotRegistered
Section titled “VaultNotRegistered”error VaultNotRegistered();InvalidShare
Section titled “InvalidShare”error InvalidShare();InvalidCloseFactor
Section titled “InvalidCloseFactor”error InvalidCloseFactor();InvalidAddress
Section titled “InvalidAddress”error InvalidAddress();ZeroRepayAmount
Section titled “ZeroRepayAmount”error ZeroRepayAmount();OwnershipCannotBeRenounced
Section titled “OwnershipCannotBeRenounced”error OwnershipCannotBeRenounced();