Liquidity Pools Architecture
Rheofi's Isolated Liquidity Pools extend the protocol beyond a single monolithic lending market by enabling the creation of independent pools, each with its own risk parameters and asset listings.
Design Goals
- Risk Isolation — Bad debt or an oracle failure in one pool does not affect other pools.
- Permissionless Listing — New assets can be supported in isolated pools.
- Customizable Parameters — Each pool has its own Comptroller with independently configured collateral factors, liquidation incentives, borrow caps, and supply caps.
PoolRegistry
The PoolRegistry contract is the on-chain registry and factory for isolated pools.
interface IPoolRegistry {
function createRegistryPool(
string calldata name,
address comptroller,
uint256 closeFactor,
uint256 liquidationIncentive,
uint256 minLiquidatableCollateral
) external returns (uint256 poolId);
function addMarket(AddMarketInput calldata input) external;
function getAllPools() external view returns (PoolData[] memory);
}
Each pool is deployed with its own Comptroller proxy, ensuring complete parameter independence. Markets (RToken instances) are added to a pool via addMarket().
Risk Isolation in Practice
When a user supplies or borrows within an isolated pool:
- Collateral and debt are tracked exclusively within that pool's Comptroller.
- Liquidations only occur against positions within the same pool.
- The pool's Risk Fund absorbs shortfall independently.
This architecture means that listing a volatile or experimental asset in an isolated pool carries no systemic risk to the broader protocol.
Pool Discovery
Users and integrators can enumerate all active pools and their markets by calling getAllPools() on the PoolRegistry. Each entry returns the pool metadata, Comptroller address, and list of RToken markets with their configurations.