Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

HousePoolWaterfallAccountingLib

Git Source

Constants

BPS

uint256 internal constant BPS = 10_000

SECONDS_PER_YEAR

uint256 internal constant SECONDS_PER_YEAR = 31_536_000

Functions

accrueSeniorYield

function accrueSeniorYield(
    uint256 seniorPrincipal,
    uint256 seniorRateBps,
    uint256 elapsed
) internal pure returns (uint256);

planReconcile

function planReconcile(
    uint256 seniorPrincipal,
    uint256 juniorPrincipal,
    uint256 distributableUsdc,
    uint256 seniorRateBps,
    uint256 elapsed
) internal pure returns (ReconcilePlan memory plan);

scaleSeniorOnWithdraw

function scaleSeniorOnWithdraw(
    WaterfallState memory state,
    uint256 withdrawAmountUsdc
) internal pure returns (WaterfallState memory nextState);

distributeRevenue

function distributeRevenue(
    WaterfallState memory state,
    uint256 revenueUsdc
) internal pure returns (WaterfallState memory nextState);

absorbLoss

function absorbLoss(
    WaterfallState memory state,
    uint256 lossUsdc
) internal pure returns (WaterfallState memory nextState);

Structs

WaterfallState

struct WaterfallState {
    uint256 seniorPrincipal;
    uint256 juniorPrincipal;
    uint256 unpaidSeniorYield;
    uint256 seniorHighWaterMark;
}

ReconcilePlan

struct ReconcilePlan {
    uint256 yieldAccrued;
    bool isRevenue;
    uint256 deltaUsdc;
}