TrueFiPool2 contract
contracts-pre22/TrueFiPool2.sol at main · trusttoken/contracts-pre22
GitHub

Methods

function join(uint256 amount)

Lends a certain amount of underlying tokens to the portfolio, and mints and transfers corresponding amount of lending pool tokens to the lender.

function liquidExit(uint256 amount)

Withdraws liquidity from the lending pool. Lender transfers pool tokens to pool and receives underlying token, but with a small penalty for liquidity as calculated by function liquidExitPenalty().

function liquidExitPenalty(uint256 amount)

Returns proportion (1 - penalty) to be applied if liquidExit() is performed with the given amount.
For example, when a pool is at ~75% utilization a small withdrawal would return liquidExitPenalty = ~0.9980, meaning that the lender would pay an exit penalty of ~0.20% (20 bps) to withdraw from the pool.
For more detail on liquid exit and how the penalty is calculated, see here.
View Methods

function poolValue()

Returns pool value in underlying token. This is the virtual price of entire pool, including value of LoanTokens, UnderlyingTokens, and idle funds strategies. Note that this assumes defaulted loans are worth their full value.

function liquidValue()

Returns virtual value of liquid assets in the pool.

Calculating lending pool token prices

To calculate the price of the pool's token take poolValue() / totalSupply().
Export as PDF
Copy link
Outline
Methods