Risk Fund
The RiskFund contract manages the protocol's risk reserves, which serve as a backstop for covering bad debt in the Rheofi Protocol's isolated liquidity pools. It accumulates assets from the ProtocolShareReserve and makes them available for shortfall auctions.
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 that 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.