Skip to main content
Reference · Risk Fund & Shortfall

RiskFund.

Manages the protocol's risk reserves — a backstop for covering bad debt across isolated pools. Receives a configurable share of protocol income from PSR, consolidates it into a base asset, and funds shortfall auctions when called.

Overview

The Risk Fund receives a configurable share of protocol income via the ProtocolShareReserve. These funds are consolidated by swapping various tokens into a base asset (typically a stablecoin) using approved DEX routes. When a shortfall auction is triggered, the Risk Fund transfers the required assets to the Shortfall contract to compensate the auction winner.

This mechanism ensures the protocol maintains a financial buffer against insolvency events across all isolated pools.

Key functions

swapPoolsAssets

Swaps accumulated pool assets in the Risk Fund into the base convertible token using configured swap routes.

function swapPoolsAssets(
address[] calldata markets,
uint256[] calldata amountsOutMin,
address[][] calldata paths
) external returns (uint256);

transferReserveForAuction

Transfers Risk Fund assets to the Shortfall contract to fund an active bad-debt auction.

function transferReserveForAuction(
address comptroller,
uint256 amount
) external returns (uint256);

setConvertibleBaseAsset

Sets the target base asset that pool assets are swapped into.

function setConvertibleBaseAsset(address _convertibleBaseAsset) external;

getPoolsBaseAssetReserves

Returns the current base-asset reserves allocated for a specific pool.

function getPoolsBaseAssetReserves(address comptroller) external view returns (uint256);
Access control

Swap operations and configuration changes are restricted to governance through the AccessControlManager.