Automatic Income Allocation
This document explains the technical mechanism used by the Rheofi Protocol to distribute protocol-generated income.
Rheofi generates income primarily from:
- The interest rate spread (borrow rate minus supply rate)
- A portion of liquidation incentives
This page covers:
- Income sources
- Distribution logic for Isolated Pools
- Near real-time (“streaming”) allocation
- How funds are routed to protocol destinations
Income Distribution Overview
Rheofi generates income from two primary sources:
1. Interest Rate Spread
The difference between:
- Borrow rate paid by borrowers
- Supply rate earned by suppliers
This spread accumulates as protocol reserves inside each market.
2. Liquidation Incentives
When a position is liquidated:
- A liquidation bonus is applied
- A portion of that bonus is allocated to the protocol
This portion is treated as protocol income.
Streaming Income Distribution Model
Rheofi aims to distribute accumulated reserves in a near-real-time manner using user-triggered transactions.
Instead of relying on off-chain scripts or manual governance actions:
- Distribution logic is embedded directly into protocol contracts
- User transactions naturally trigger income routing
- No external bots are required
The ProtocolShareReserve contract serves as the central accounting and distribution hub for protocol income.
Isolated Pools
Isolated Pool – Spread Income
For Isolated Pools:
- Spread income accumulation.
- Distribution occurs periodically after threshold conditions are met.
The mechanism is socialized and optimized for gas efficiency.
Isolated Pool – Liquidation Income
In Isolated Pools:
- Liquidations are handled directly by the rToken contracts.
- The protocol’s share of seized collateral is transferred immediately to the
ProtocolShareReserve. - No redemption retry logic is required.
This simplifies liquidation accounting within isolated environments.
ProtocolShareReserve Contract
All collected protocol income is managed by the ProtocolShareReserve contract.
This contract:
- Tracks income per pool
- Categorizes income by origin (spread or liquidation)
- Manages distribution to final destinations
On XRPL Sidechain, native asset wrapping (if required) must occur before funds are transferred into the reserve contract.
updateAssetsState Function
The updateAssetsState function is responsible for registering newly received income.
Parameters
-
address comptroller
The Comptroller associated with the pool generating income. -
address asset
The asset being transferred into the reserve. -
IncomeOrigin origin
Specifies whether the income originated from:spreadliquidation
Internal Logic
When executed, the function:
- Calculates the net transferred amount (current balance minus previous balance).
- Assigns the amount to the appropriate:
- Pool
- Asset
- Income category
- Updates the global accounting state for future distribution.
This design ensures accurate and auditable income tracking.
releaseFunds Function
The releaseFunds function distributes accumulated protocol income to designated destinations.
Key Characteristics
- Permissionless — can be called by anyone.
- Executes a two-step distribution process.
Step 1: Transfer Funds
Tokens are transferred from ProtocolShareReserve to configured destination addresses, such as:
- Rheofi Treasury
- Risk Fund
- Governance Allocation
Step 2: Update Receiver State
After transfer:
- The receiving contract’s
updateAssetsStatefunction is invoked. - Accounting records are updated accordingly.
Design Goals
The Rheofi automatic income allocation mechanism is designed to:
- Minimize manual governance intervention
- Reduce operational overhead
- Enable near-real-time income routing
- Maintain full on-chain transparency
- Support Isolated Pools
- Operate efficiently within the XRPL Sidechain environment
Summary
Rheofi’s automatic income allocation framework ensures that:
- Spread income and liquidation incentives are captured
- Funds are routed through a unified reserve contract
- Distribution is transparent and auditable
- The process remains decentralized and user-triggered
This architecture strengthens protocol sustainability while preserving efficiency and security.