FlexiblePortfoliois a contract that serves as a portfolio of funds managed by the asset manager.
FlexiblePortfolioallows the asset manager to define allowed debt instruments that the portfolio will handle.
FlexiblePortfoliovaluation is handled by the
ValuationStrategy, which is a contract that holds information on all the loans the portfolio holds and can evaluate them properly. This requires the portfolio to call
onInstrumentFundedwhen a loan is funded and
onInstrumentUpdatedwhen a loan might change its status (e.g. is repaid or gets defaulted). Valuation strategies cannot be switched as they hold the state of the portfolio loans.
FlexiblePortfoliovalue is performed (
updateAndPayFee), a fee for the TrueFi DAO is calculated and immediately transferred to the TrueFi DAO Treasury address. The fee is deducted from the
FlexiblePortfoliovalue, so actions like borrow/withdraw/redeem cannot move the funds that are designated as fees. If the accrued fee cannot be repaid at the moment because of the lack of liquidity, additional information about the fee amount is stored in the contract and will be used to make the overdue payment the moment it will be possible. The same behavior is followed by the fee of the manager.
protocolAccruedFeevalue is equal to:
(current_timestamp - last_update_timestamp) / YEAR * protocol_fee_rate * portfolio_value
managerAccruedFeevalue is equal to:
(current_timestamp - last_update_timestamp) / YEAR * manager_fee_rate * portfolio_value
protocol_fee_rateis the rate taken from the Protocol Config contract the last time an update was made. The same goes for
manager_fee_rate, which is taken from Fee Strategy
deposit(assets: 100)is being called, the strategy
(true, fee: 10).This means that 10 would be transferred to the manager, and the shares would be minted to the Lender based on the remaining 90.
mint(shares: 100)is being called, the strategy
(true, fee: 10)
FlexiblePortfolioparameters are chosen by the portfolio manager, except for