BulletLoans
is in the process of being sunset.
New TrueFi Capital Markets portfolios deployed after June 2022 use FixedInterestOnlyLoan
BulletLoans
is an ERC-721 contract. Each of the tokens represents a single loan.
All loan parameters can be read from LoanMetadata struct. BulletLoans
contract enables loan creation, facilitates loan repayment and allows managing the loan's state and parameters.
createLoan( IERC20 _underlyingToken, uint256 _principal, uint256 _totalDebt, uint256 _duration, address _recipient )
Manager can create loan by passing the principal to be lent, the total debt to repaid, duration of the loan, and the address of the recipient. Total debt to be repaid cannot be less than principal amount.
repay(uint256 instrumentId, uint256 amount)
Existing loan can be repaid partially or in full. If loan is paid in full, this function will mark the loan’s status to ‘Fully Repaid’. Note that a loan cannot be overpaid.
markLoanAsDefaulted(uint256 instrumentId)
Only the portfolio’s manager can mark a loan as defaulted.
markLoanAsResolved(uint256 instrumentId)
Only the portfolio’s manager can mark a loan as resolved. Intended to be used for situations after partial repayment where a loan workout has been agreed to.
updateLoanParameters( uint256 instrumentId, uint256 newTotalDebt, uint256 newRepaymentDate )
Manager can modify loan terms, changing maturity date or total debt to be repaid.
updateLoanParameters( uint256 instrumentId, uint256 newTotalDebt, uint256 newRepaymentDate, bytes memory borrowerSignature )
Manager can modify loan terms, changing maturity date or total debt to be repaid. In order to change the maturity date to an earlier date or increase the repayment value, the borrower must consent and provide a signature.
principal(uint256 instrumentId)
Returns principal amount of loan.
underlyingToken(uint256 instrumentId)
Returns underlying token (e.g. USDC, USDT) of the loan.
recipient(uint256 instrumentId)
Returns borrower’s address.
endDate(uint256 instrumentId)
Returns maturity date of the loan.
unpaidDebt(uint256 instrumentId)
Returns remaining amount to be paid, i.e. total debt less repaid amount.
getStatus(uint256 instrumentId)
Returns status of loan (Issued
, FullyRepaid
, Defaulted
, Resolved
).
Instruments are representations of loans and other financial instruments. The initial two instruments on TrueFi are:
BulletLoans (deprecated)
FixedInterestOnlyLoans
is an ERC-721 contract. Each minted NFT represents a loan that must be paid back to the NFT owner.
Each loan is parametrized by:
Underlying token with which funds are lent out and repaid (e.g. USDC)
Principal debt (minting price)
Period payment (interest paid at each installment)
Period length (a period when the borrower pays installments)
Period count (total number of installments)
End date (date of the last installment to be paid together with the principal, set when the loan is started)
Recipient’s address
Grace period (time by which borrower can be late in repayment of each installment)
A canBeRepaidAfterDefault flag that allows a loan to be repaid after a loan was marked as defaulted
A loan can have one of the possible statuses: Created
, Accepted
, Started
, Repaid
, Canceled
, or Defaulted
.
Upon minting the loan status is set to Created
. In this state, a borrower can accept a loan by calling acceptLoan(id)
and the loan status is changed to Accepted
.
The NFT owner can call start(id)
on loans whose status is Accepted
. When a loan is started the loan end date is calculated for the loan and the loan status is changed to Started
.
The NFT owner can mark loans as canceled whose status is Created
or Accepted
.
The NFT owner can mark loans as Defaulted
whose status is Started
and the current block time is after a current period endDate + grace
Period
time.
The NFT owner can update the loan's gracePeriod
at any time by calling updateInstrument(id)
. The NFT owner must call repay(id, amount)
to recalculate repaid periods and the current period end date.
The repaid amount must be equal to the period payment or period payment + principal for the last installment. The loan can be repaid after it was marked as defaulted only if the proper canBeRepaidAfterDefault
flag was set to true.