Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Airdrop claiming instructions, provided by Archblock
The airdrop comes in the form of an ERC4626 tokenized vault (00xfBc33285d9f58d34fE239bFA3732036d5c53a1665), with mints and deposits disabled. This contract has undergone an internal security review and an external audit by ChainSecurity.
Shares of the airdrop are proportional to token holders of the tfUSDC lending pool as of January 9, 2023, the original end date of the delt.ai loan. This includes lenders who farmed their tfUSDC holdings, as well as claimable tfUSDC rewards from the stkTRU contract.
In order to prevent locked funds in the contract, users will have until a deadline of January 21, 2024, to redeem your shares of the interest airdrop.
After this date, TrueTrading will recover the remainder of funds.
You may want to wait until gas prices are low before calling the redeem( )
function.
Check your balance of shares here:
In this example, the address 0x168151e53210Bbb08Fa6AfAC15E3da185e66069F
has a balance of 73,990.677577, which means it can claim 73,990.677577 USDC. There should be six digits after the decimal point.
Connect your wallet to Etherscan on this page by clicking the “Connect to Web3” button as indicated below
Click, “Contract” and “Write as Proxy”, then call the redeem() function (#9, 0xba087652):
For shares, enter your balance from #1 (but drop the decimal point and any commas): 73990677577
in the example.
For both receiver and owner, enter your wallet address from #1: 0x168151e53210Bbb08Fa6AfAC15E3da185e66069F
in the example
Review this transaction carefully, click Write, and then confirm via your wallet.
If you have any questions or need assistance, please contact support@archblock.com.
Please reach out to support@archblock.com if you have a smart contract with claimable airdrop balance, but no ability to call redeem()
. If you can prove ownership of the contract, they may be able to work out a way for you to receive your share.
Airdrop claiming instructions, provided by Archblock
The airdrop comes in the form of an ERC4626 tokenized vault (0x044e3e0a83453d6F673170953fdA6Ed725adB286), with mints and deposits disabled. This contract has undergone an internal security review and an external audit by ChainSecurity.
Shares of the airdrop are proportional to token holders of the tfUSDC lending pool as of January 9, 2023, the original end date of the delt.ai loan. This includes lenders who farmed their tfUSDC holdings, as well as claimable tfUSDC rewards from the stkTRU contract.
In order to prevent locked funds in the contract, you will have until a deadline of April 10, 2024, to redeem your shares of the interest airdrop.
After this date, TrueTrading will recover the remainder of funds.
You may want to wait until gas prices are low before calling the redeem( )
function.
Check your balance of shares here:
In this example, the address 0x168151e53210Bbb08Fa6AfAC15E3da185e66069F
has a balance of 73,990.677577
, which means it can claim 73,990.677577 USDC. There should be six digits after the decimal point.
Connect your wallet to Etherscan on this page by clicking the “Connect to Web3” button as indicated below:
Click, “Contract” and “Write as Proxy”, then call the redeem()
function (#9, 0xba087652):
For shares, enter your balance from #1 (but drop the decimal point and any commas): 73990677577 in the example.
For both receiver and owner, enter your wallet address from #1: 0x168151e53210Bbb08Fa6AfAC15E3da185e66069F in the example.
Review this transaction carefully, click Write, and then confirm via your wallet.
If you have any questions or need assistance, please contact support@archblock.com.
Please reach out to support@archblock.com if you have a smart contract with claimable airdrop balance, but no ability to call redeem()
. If you can prove ownership of the contract, they may be able to work out a way for you to receive your share.
Airdrop claiming instructions, provided by Archblock
The airdrop comes in the form of an ERC4626 tokenized vault (0x37C5867ef19DbE096dF8E125F33f895234E02875), with mints and deposits disabled. This contract has undergone an internal security review and an external audit by ChainSecurity.
Shares of the airdrop are proportional to token holders of the tfUSDC lending pool as of January 9, 2023, the original end date of the delt.ai loan. This includes lenders who farmed their tfUSDC holdings, as well as claimable tfUSDC rewards from the stkTRU contract.
In order to prevent locked funds in the contract, you will have until a deadline of July 8, 2023, to redeem your shares of the interest airdrop.
After this date, TrueTrading will recover the remainder of funds.
NOTE: You may want to wait until gas prices are low before calling the redeem()
function.
Check your balance of shares here:
In this screenshot example above, the address 0x168151
has a balance of 73,990.677577
, which means it can claim 73,990.677577 USDC. There should be six digits after the decimal point.
Connect your wallet to Etherscan on this page by clicking the “Connect to Web3” button as indicated below:
Click, “Contract” and “Write as Proxy”, then call the redeem() function (#9, 0xba087652):
For both receiver and owner, enter your wallet address from #1: 0x168151e53210Bbb08Fa6AfAC15E3da185e66069F
For shares, enter your balance found in step #1, but using 6 decimals
Following the example from #1, the shares would be 73990677577
Note: This number should contain no decimal point and no commas. There should be six digits after the decimal point from #1.
Review this transaction carefully, click Write, and then confirm via your wallet.
Please reach out to support@archblock.com if you have a smart contract with claimable airdrop balance, but no ability to call redeem(). If you can prove ownership of the contract, then Archblock may be able to work out a way for you to receive your share.
If you have any questions or need assistance, please contact support@archblock.com.
Airdrop claiming instructions, provided by Archblock
The airdrop comes in the form of an ERC4626 tokenized vault (0xaAab06b81dA17A11E4Ada38a9DBa1D090D95253a), with mints and deposits disabled. This contract has undergone an internal security review and an external audit by ChainSecurity.
Shares of the airdrop are proportional to token holders of the tfUSDC lending pool as of January 9, 2023, the original end date of the delt.ai loan. This includes lenders who farmed their tfUSDC holdings, as well as claimable tfUSDC rewards from the stkTRU contract.
In order to prevent locked funds in the contract, you will have until a deadline of July 9, 2024 to redeem your shares of the interest airdrop.
After this date, TrueTrading will recover the remainder of funds.
You may want to wait until gas prices are low before calling the redeem( )
function.
Check your balance of shares here:
In this example, the address 0x168151e53210Bbb08Fa6AfAC15E3da185e66069F
has a balance of 73,990.677577, which means it can claim 73,990.677577 USDC. There should be six digits after the decimal point.
For shares, enter your balance from #1 (but drop the decimal point and any commas): 73990677577
in the example.
For both receiver and owner, enter your wallet address from #1: 0x168151e53210Bbb08Fa6AfAC15E3da185e66069F
in the example.
Connect your wallet to Etherscan on this page by clicking the “Connect to Web3” button as indicated below:
Click, “Contract” and “Write as Proxy”, then call the redeem()
function (#9, 0xba087652
):
For shares, enter your balance from #1 (but drop the decimal point and any commas): 73990677577
.
For both receiver and owner, enter your wallet address from #1: 0x168151e53210Bbb08Fa6AfAC15E3da185e66069F
Review this transaction carefully, click Write, and then confirm via your wallet.
If you have any questions or need assistance, please contact support@archblock.com.
Please reach out to support@archblock.com if you have a smart contract with claimable airdrop balance, but no ability to call redeem()
. If you can prove ownership of the contract, they may be able to work out a way for you to receive your share.
Airdrop claiming instructions, provided by Archblock
The airdrop comes in the form of an ERC4626 tokenized vault (), with mints and deposits disabled. This contract has undergone an internal security review and an .
Shares of the airdrop are proportional to token holders of the tfUSDC lending pool as of January 9, 2023, the original end date of the delt.ai loan. This includes lenders who farmed their tfUSDC holdings, as well as claimable tfUSDC rewards from the stkTRU contract.
In order to prevent locked funds in the contract, you will have until a deadline of October 04, 2024 to redeem your shares of the interest airdrop.
After this date, TrueTrading will recover the remainder of funds.
NOTE: You may want to wait until gas prices are low before calling the redeem()
function.
Check your balance of shares :
In this example, the address 0x168151e53210Bbb08Fa6AfAC15E3da185e66069F has a balance of 73,990.677577, which means it can claim 73,990.677577 USDC. There should be six digits after the decimal point.
Click, “Contract” and “Write as Proxy”, then call the redeem()
function (#9, 0xba087652):
For shares, enter your balance from #1 (but drop the decimal point and any commas): e.g. 73990677577.
For both receiver and owner, enter your wallet address from #1: e.g. 0x168151e53210Bbb08Fa6AfAC15E3da185e66069F
Review this transaction carefully, click Write, and then confirm via your wallet.
Loan tokens are non-tradable ERC-20 tokens which represent the lender’s proportional representation in a loan that is issued from the Lending Pool.
Each loan issued from the Lending Pool will create a unique loan token used to track the present value of each loan. Loan tokens form an important building block of TrueFi, as they can operate independently from the TrueFi lending pools. Tokenized loans open up opportunities for calculating and tracking the value to the individual loans within the Lending Pool. TrueFi does not allow for the transfer of Loan tokens and will not create a secondary market for loan tokens. It is important to note that all Loan tokens are unique and can be tracked on the page of the TrueFi website.
Creating a Loan token requires a borrower’s wallet address, principal amount, term, and interest rate or APR associated with a loan. When a loan is , loan tokens are minted by funding the loan token contract with the principal amount. The minted loan tokens represent a share in the total amount payable at the end of the term which is the sum of principal and interest.
Loan tokens are minted at a discounted rate, meaning that loan tokens paid back in full will converge to a price of 1.000:
# of loan tokens minted = principal + interest owed at loan maturity
Once a loan is funded, the borrower can call a function which allows them to borrow the funds from the smart contract. At the end of the term, once the borrower pays back the loan, loan token holders can exchange their loan tokens for an equivalent number of stablecoins.
Example:
When a loan with principal = 1,000,000 USDC, term = 30 days, APR = 12% is approved, 1,009,863.013 ( = 1,000,000 + 1,000,000 x 12% x 30/365
) loan tokens are minted.
At maturity, if the borrower repays the entire loan amount along with interest, the lending pool can exchange 1 loan token for 1 USDC.
The theoretical present value of a loan token is calculated by assuming the loan is repaid in full by the end of the loan term.
The following formulas walk through how lending pools value loan tokens (where loan token `0xabc` represents a single loan, and `t` represents time since loan origination):
Value of all 0xabc loan tokens minted
= principal + (t / term ) x interest
Value of a single 0xabc loan token
= (Value of all 0xabc loan tokens) / (supply of 0xabc loan tokens)
Value of a single 0xabc loan token
= (principal + (t / term ) x interest)/(principal + interest)
Example:
When a loan with principal = 1,000,000 USDC, term = 30 days, APR = 12% is approved, 1,009,863.013 ( = 1,000,000 + 1,000,000 x 12% x 30/365
) loan tokens are minted.
The value of a single loan token at n
days (where n
is less than or equal to 30) is 1,009,863.013 USDC (=1,000,000 + (n/30) x 9,863.013)
).
In addition to earning yield from loan activity in DAO pools, lenders can also earn additional yield in the form of TRU rewards ("yield farming").
TrueFi DAO Pool lenders begin accruing TRU rewards as soon as their LP tokens have been staked.
Lenders can stake lending pool tokens in the liquidity gauge via the page, or via the function on the TrueMultiFarm
contract.
To find the current emissions rate for a farm, users can divide the totalAmount by duration. Visit the etherscan link to the smart contract, click on Contract, then click on Read as Proxy. You will find the two parameters totalAmount and duration. The duration is in seconds.
TRU distribution per day = (totalAmount/10^8) / (duration/(24*3600))
Farming on TrueFi lending pools involves no additional economic risk beyond risks involved as a lender. Users are inherently exposed to borrower default risk as a lender.
[Legacy] Lending pools governed by TRU stakers
For developer docs see
TrueFi DAO-managed lending pools (tfUSDC, tfUSDT, tfTUSD, tfBUSD) lend to institutional crypto borrowers that request loans from the protocol. Loans must be and meet risk / return criteria set by the protocol.
Users can lend to TrueFi DAO pools at .
Once a user is ready to lend, the user will need to complete two transactions:
1) approve()
: User must approve the lending pool smart contract to transfer up to a certain allowance of the asset. Read more .
2) lend()
: User lends funds to the lending pool. In return, the lender ("LP tokens").
The lender can optionally , which generate additional yield on top of underlying returns in the pool.
The TrueFi app helps to find lenders the best price when they lend to the pool.
Lenders can choose between (i) lending funds directly to the pool and minting LP tokens, or (ii) buying LP tokens on a secondary market (Uniswap).
In the example shown in the screenshot below, the UI shows that the user may be able to get a better price and incur lower gas costs by going directly to Uniswap to get tfUSDC.
Pool | Address |
---|
To vote on loan applications, you need stkTRU. To learn more about how to acquire stkTRU please view the section on . Once you have stkTRU you can visit the page and vote on the loan applications listed on the page.
The stkTRU balance with which you can vote on loan applications is equal to the stkTRU balance held by your wallet when the loan application was created. You will not be able to vote on loan applications with any stkTRU balance acquired after a loan application was created.
Stakers can either vote YES or NO with stkTRU on a loan application. Voting YES means you are predicting that the loan is not likely to default, and voting NO means you are predicting that the loan is likely to default. Stakers can vote with the entire stkTRU balance of their wallet, including the stkTRU balance delegated to their wallet address.
Voting on loan applications does not lock stkTRU, stakers can use their stkTRU balance to vote on multiple loan applications.
There is no specific time period for stkTRU holders to vote on loan applications. After a loan application is live on the TrueFi platform, stkTRU holders can start voting on the loan until the loan application is funded by the lending pool or cancelled by the borrower.
However, there is a minimum time period that must pass before a loan can be funded by the lending pool. This time period is called the minimum voting period which corresponds to the votingPeriod parameter set in the TrueLender smart contract.
Visit the etherscan link to the TrueLender (proxy) smart contract, click on Contract, then click on Read as Proxy. You will find the parameter votingPeriod in seconds.
stkTRU holders can modify or cancel their votes any number of times before the loan has been funded by the lending pool or cancelled by the borrower.
stkTRU holders vote YES or NO on whether to approve a loan request. A loan is approved if it satisfies two conditions.
Minimum # of votes (15 million as of Sept 2022)
Minimum ratio of YES-to-NO votes (at least 80% of votes YES, as of Sept 2022)
Only whitelisted borrowers can submit their loan applications to the TrueRatingAgencyV2
contract. Whitelisted addresses will return true when queried against allowedSubmitters
in the TrueRatingAgencyV2
contract.
Loans are approved or rejected based on conditions set in three smart contracts: TrueFi lending pool contract (tfUSDC
et al), TrueRatingAgencyV2
, and TrueLender2
.
stkTRU holders receive rewards in the form of TRU tokens for voting on loan requests. The rewards become claimable as soon as the loan is withdrawn by the borrower and the status of the loan becomes active. Rewards are distributed to voters based on their share of the total votes received:
TRU Reward for voting = (# TRU voted by user / # total TRU votes) * (Total TRU Reward)
, where
Total TRU Reward = (Loan interest * TRU distribution factor * rewardMultiplier)
where Loan interest = (loan APR * term in days * principal) /365
. Loan APR, term, and principal can be obtained from the respective loan token contract
TrueFi lending pools fund loans to borrowers who request loans from the protocol. Loans must be and meet risk / return criteria set by the protocol. Uncollateralized lending has a higher risk profile than other markets and thus should provide higher returns.
Lenders can lend stablecoins to TrueFi lending pools, which use predefined strategies to lend to creditworthy borrowers. See below for a brief demo:
TrueFi lending pools are controlled by TrueTrading, an affiliate company of TrustToken, Inc. The TrueFi lending pools only lend to a whitelist of trusted borrowers, and any excess capital that is not actively loaned out may be deployed in a DeFi protocol.
While borrowers are usually willing to pay higher rates for uncollateralized loans, these higher yields do not come without risks. Compared with collateralized lending, uncollateralized lending has two major risks:
Potentially increased risk of loss: Protocols that require collateral are protected by that collateral in case of default. While this allows such platforms to be less selective in approving loans, uncollateralized loans come with a much higher standard of trust that must be met by a borrower. In case of default on an uncollateralized loan, a delinquent borrower will have been assessed for creditworthiness before the loan was made and will face both reputational damage and legal action.
Potentially lower liquidity: While instant withdrawals are becoming a norm for new protocols, uncollateralized lending may not offer the same flexibility. Most borrowers for uncollateralized loans are interested in fixed-rate, fixed-term loans for predictable repayment. This means lenders who fund such loans need to be comfortable locking up their assets for the duration of the loan. TrueFi offers an alternative: the ability to withdraw their proportion of the pool tokens which would consist of stablecoins and loan tokens that you hold to maturity. You can redeem the loan tokens for the stablecoin at the end of loan terms.
TrueTrading is currently responsible for pursuing legal recourse if a borrower defaults and may be replaced by another non-profit entity in the future as TrueFi progressively decentralizes.
After , a lender receives lending pool tokens ("LP tokens"). Read further to find how users can track the value of their LP tokens and trade LP tokens.
Lending Pool tokens (or "LP tokens") are tradable ERC-20 tokens that represent a lender’s proportional representation in the pool.
In the beginning, when no loans have been disbursed by the TrueFi lending pool, lenders will receive one TrueFi Lending Pool Token (tfTUSD, tfUSDC, tfUSDT, or tfBUSD) for every stablecoin lent to the pool.
As the pool starts earning yields and disbursing loans, the value of the pool tokens may increase or decrease depending on returns within the pool. The value of the pool represents the present value of all its underlying tokens (stablecoins, loan tokens, and other tokens earned).
We can calculate LP token price by checking the poolValue()
and totalSupply()
read functions on the lending pool smart contract:
LP token price = poolValue() / totalSupply()
We can use this LP token price to find how many LP tokens a lender will receive in return for lending tokens to the pool.
Example:
Bob lends 2,000,000 USDC to the tfUSDC pool.
Given that tfUSDC =
46226887530770 and
42405680290948 at the time of lending, we calculate tfUSDC LP price = 1.0901.
Bob will thus receive 2,000,000 / 1.0901 = 1,834,675.99 tfUSDC LP tokens
Additionally, we can calculate the value of a lender's position at any point in time:
Lender's position value = (# of LP tokens held) * (LP token price)
Yes, LP tokens can be traded on secondary markets. There are existing markets on Uniswap v3 today.
LP token prices calculated by the lending pool assume that loans will be repaid successfully within the term, among other assumptions.
Other market participants may have use different assumptions in their calculation of LP token prices. There are several market factors that may govern the price of lending pool tokens and the TrueFi platform does not have any control over them.
Connect your wallet to Etherscan on by clicking the “Connect to Web3” button as indicated below:
If you have any questions or need assistance, please contact .
Please reach out to if you have a smart contract with claimable airdrop balance, but no ability to call redeem()
. If you can prove ownership of the contract, they may be able to work out a way for you to receive your share.
At any given time, a lender can check the # of accrued rewards and claim rewards by visiting .
Additionally, lenders can find the # of TRU rewards by checking on the TrueMultiFarm
contract below:
Name | Contract |
---|
Lenders can claim TRU rewards by calling on this contract.
Additionally, lenders can call to unstake LP tokens and claim rewards within the same transaction.
Name | Contract |
---|
Read more about TRU, TrueFi's governance token .
Contract | Address |
---|
rewardMultiplier
can be found from the contract
TRU distribution factor
is calculated as remaining
divided by amount
from the contract
Lenders who lend to the TrueFi lending pool receive ("LP tokens"), which represent their proportion of lent capital in the TrueFi lending pool.
No. Lenders can redeem LP tokens any time idle funds are available in the pool. Lenders pay an in order to withdraw instant liquidity from the pool. This fee is calculated dynamically, depending on what proportion of the pool is idle vs. lent to borrowers.
Additionally, , such as Uniswap.
There are no fees for lending funds into lending pools. To withdraw funds, lenders may pay an .
You can learn more about how TrueFi mitigates risk .
Lending pool token holders can farm TRU by staking their lending pool tokens (tfTUSD, tfUSDC, tfUSDT, or tfBUSD) on the page.
tfUSDC/USDC:
tfUSDT/USDT:
Yes, please see TrueFi's technical audits here.
TrueFi takes multiple measures to help protect lenders:
Staked TRU provides default protection for lenders and governs the loan approval process
Borrowers on TrueFi follow a thorough Know Your Business (“KYB”) workflow and credit review which incorporates both on-chain and off-chain data, such as company background, repayment history, operating & trading history, assets under management, and credit metrics.
TrueFi handles bad debt via a Secure Asset Fund for Users (“SAFU”) smart contract.
TrueFi lenders can also purchase smart contract cover through Nexus Mutual to hedge risks when lending on TrueFi. Coverage is paid out at the discretion of mutual members but has covered technical exploits in the past.
This is not investment advice. Please Do Your Own Research.
The SAFU is an overhaul of how TrueFi handles borrower defaults. The SAFU smart contract is responsible for all bad debt accrued by the protocol. The SAFU has been initially funded by TrustToken and the funds will help cover defaults.
In case of a loan default, TrueFi lending pools will transfer all bad debt assets to the SAFU in exchange for the full expected value of those assets. Then, the SAFU will slash staked TRU tokens, up to 10% of the defaulted amount. If the value of these slashed tokens is not enough to cover the default, the SAFU will use its funds to help repay the affected lending pool for lost funds.
In the event of a default, the following occurs:
Up to 10% of TRU is slashed from the staking pool and transferred to the SAFU to cover the defaulted amount, equal to the principal amount plus the full amount of expected interest (“Defaulted Amount”)
All the defaulted LoanTokens will be transferred from the lending pool to the SAFU
If the current SAFU funds are insufficient to cover the defaulted loan; the SAFU can sell TRU for the respective borrowed asset at its manager’s discretion
If the value of the SAFU funds can not satisfy the defaulted loan:
The difference between the defaulted loan and the SAFU is calculated (“Uncovered Amount”).
The SAFU will issue ERC-20 tokens representing a claim for the Uncovered Amount (“Deficiency Claim”).
Then, the affected lending pool will receive a Deficiency Claim for the Uncovered Amount, assuming its successful recovery.
The affected lending pool will have a first-priority claim on the funds recouped through arbitration for the Deficiency Claim amount.
If a debt is repaid:
The recouped funds will be used to purchase the asset that the Loan Token was originally denominated in, which will be transferred to the LoanToken contract.
The SAFU will burn the Loan Tokens for the underlying value of those tokens (“Recovered Amount”)
The SAFU is going to repurchase the issued Deficiency Claim tokens from the lending pool up to the Recovered Amount.
If there is a remainder of the recovered funds after repurchasing the lending pool’s Deficiency Claim, the SAFU keeps those funds.
If any portion of the original loan amount is not repaid after the completion of the legal recovery process; the lending pool’s remaining Deficiency Claim tokens are going to be burned thus reducing the LP token price.
The SAFU replaces what was called “Liquidator” in previous TrueFi versions. Therefore, it will have permission to slash TRU from the staked TRU pool.
The funds in the SAFU will be managed by an approved address, automating as much capital management as possible through DeFi. In the initial version, the funds' management will be somewhat centralized to maximize the capital efficiency when making exchanges between tokens. For example, the price impact of exchanging TRU on decentralized exchanges is much higher than the impact of OTC or centralized exchange opportunities.
Nevertheless, following the ethos of progressive decentralization, future unlocks will include updates to the SAFU which will further decentralize the management of the SAFU funds.
TrueMultiFarm |
LinearTrueDistributor |
TrueLender2 |
TrueRatingAgencyV2 |
tfTUSD |
tfUSDC |
tfUSDT |
tfBUSD |
Legacy tfTUSD |
Liquid Exit and other FAQs
You can exit the pool by selling your lending pool tokens to the TrueFi lending pools for the stablecoin if there is enough liquid asset in the pool to support the transaction. This feature is also called liquid exit.
Liquid exit addresses a key community request which is the ability to exit the TrueFi Lending Pool directly into the underlying stablecoin. Lending pool token holders can redeem their LP tokens for the stablecoin for an exit fee.
The exit fee is inversely proportional to the amount of available idle liquidity in the pool. For example, when there is a large amount of liquid assets in the pool, the fee is low. When there is a small amount of liquid asset in the pool, the fee is high. This fee is earned by the pool for the existing lending pool token holders.
The exit fee charged to you for an exit would be made available to you in the UI. If you feel that the fee charged is too high then you can wait till the pool is more liquid and try again later.
1) If there is no liquid asset in the lending pool and no liquid exit is deployed in Curve.
2) If the pool needs to liquidate its position in Curve and will incur a loss of more than 10 basis points.
Click here to view the relationship between Pool utilization and exit fees.
[Legacy] TrueFi DAO pools contracts
Below is a brief guide to TrueFi lending pool contracts.
For detailed questions, please reach out to the Discord #dev channel.
Contract Name | Address |
---|---|
TrueFiPool2: lenders provide and withdraw liquidity to the pool, and can get lending pool details, such as pool value, pool token price, etc. from this contract
TrueLender2: implements the lending strategy for the TrueFi pool, i.e. how loans are approved and funded
LoanFactory2: deploys LoanTokens, which represent details of each loan on-chain
TrueRatingAgencyV2: loan applications are rated and approved by TRU stakers
TrueMultiFarm: lenders can stake lending pool tokens to earn TRU rewards (read more here)
SAFU: handles bad debt in TrueFi lending pools (read more here)
The TrueFiPool2
contract is used by TrueFi DAO lending pools -- tfUSDC / tfUSDT / tfBUSD / tfTUSD. This contract enables accounts to pool tokens with the goal of earning yields on underlying tokens.
To calculate the price of the lending pool token ("LP token"), take poolValue()
divided by totalSupply()
.
To calculate yield for a pool, one must calculate the weighted average of rates across each active loan in the pool and idle funds held in the pool.
pool_apy = SUM(loan_1_amount
*loan_1_apy + ... + loan_n_amount*loan_n_value) / poolValue()
For an example of how this can be done via SQL, see this Dune query.
Read more about default handling in #safu-default-handling
Implements the lending strategy for the TrueFi pool, i.e. how loans are approved and funded.
Loan tokens are created by LoanFactory2.
Each LoanToken has the following parameters:
borrower()
: address of borrower
amount()
: principal amount of fixed term loan
term()
: loan term in seconds
apy()
: loan APR in basis points (i.e. 971 = 9.71%)
status()
: returns loan's status, which progresses through the following states:
0
--> Awaiting:
Waiting for funding to meet capital requirements
1
-->Funded:
Capital requirements met, borrower can withdraw
2
-->Withdrawn:
Borrower withdraws money, loan waiting to be repaid
3
-->Settled:
Loan has been paid back in full with interest
4
-->Defaulted:
Loan has not been paid back in full
5
-->Liquidated:
Loan has Defaulted and stakers have been Liquidated
canTransfer()
: returns LoanTokens are non-transferable except for whitelisted addresses
debt()
: returns amount
+ interest
. Note that this does not take into account whether the loan has been repaid.
isRepaid()
: returns boolean value, indicating whether a loan has been repaid in full.
profit()
: returns difference between debt()
and amount()
, the anticipated interest to be paid on the loan
Repaying loans to lending pools has two steps:
Borrower repays funds to loan token
reclaim()
function is called on loan token, which burns the loan token and pays out fees to stkTRU.
As described here, the TrueRatingAgencyV2
contract determines whether a loan request should be funded by TrueLender2
.
stkTRU holders can vote yes()
or no()
on each loan. The TrueLender2
contract then checks to see if each loan satisfies threshold conditions in order to be funded.
stkTRU voters receive rewards in the form of TRU tokens for voting on loan requests. claimable()
reward tokens are calculated as follows:
claimable() = (# TRU voted by user / # total TRU votes) * (Total TRU Reward)
, where
Total TRU Reward = (Loan interest * TRU distribution factor * rewardMultiplier)
where Loan interest = (loan APR * term in days * principal) /365
. Loan APR, term, and principal can be obtained from the respective loan token contract
rewardMultiplier
can be found from the TrueRatingAgencyV2 contract
TRU distribution factor
is calculated as remaining
divided by amount
from the RatingAgencyV2Distributor contract
As described here, lenders can stake LP tokens into the TrueMultiFarm contract to get TRU rewards.
Total TRU emissions per day can be calculated using totalAmount()
and duration()
found on the distributor contract:
TRU distribution per day = (totalAmount/10^8) / (duration/(24*3600))
To calculate farm rates for each token, use the formula below:
TRU rewards per farm per day = TRU distribution per day * getShare(IERC20 token) / shares()
as described below
Contract Name | Address |
---|---|
Method | Notes |
---|---|
Method | Notes |
---|---|
Method | Notes |
---|---|
Contract Name | Address |
---|---|
Method | Notes |
---|---|
Contract Name | Address |
---|---|
Method | Notes |
---|---|
Contract Name | Address |
---|---|
Contract Name | Address |
---|---|
Method | Notes |
---|---|
tfUSDC
tfUSDT
tfTUSD
tfBUSD
TrueFiPool2
Lends a certain amount of underlying tokens to the portfolio, and mints and transfers corresponding amount of ERC-20 lending pool ("LP") tokens to the lender.
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
liquidExitPenalty()
described below.
Returns pool value in underlying token.
This is the virtual price of the entire pool, including values for loan tokens and liquid underlying tokens held by the pool.
Note: this assumes defaulted loans are worth their full value.
Returns virtual value of liquid assets in the pool.
totalSupply()
Returns total number of pool LP tokens.
liquidRatio()
Ratio of liquid assets in the pool to the pool value, in basis points. For example, 4683 => 46.83%.
utilization()
Returns utilization in basis points. For example, 5316 => 53.16%.
Calculated as 1 - liquidRatio()
.
Calculates lender will pay to withdraw liquid funds from the pool. This returns a proportion to be applied if liquidExit()
is performed with the given amount of LP tokens.
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.
averageExitPenalty(uint256 from, uint256 to)
Internal function for calculating exit penalty.
Calls SAFU function to liquidate bad debt. Liquidates a defaulted Loan, withdraws a portion of TRU from staking pool then tries to cover the loan with own funds, to compensate lending pool. Loan must be in defaulted
state. If SAFU does not have enough funds, deficit is saved to be redeemed later.
reclaimDeficit(ILoanToken2 loan, uint256 amount)
After a defaulted loan's debt has been redeemed by the SAFU, the lending pool can reclaim call this function to redeem "deficiency claim" tokens for underlying tokens held in the SAFU.
TrueLender2
When called, sends funds from the pool to the loan token contract. Pool receives and holds loan tokens. Must be called by the loan borrower.
loanIsCredible(uint256 yesVotes, uint256 noVotes)
Checks whether loan receives sufficient votes via stkTRU rating to be funded. Checks whether loan receives minimum ratio of yes to no votes and hits threshold of minimum votes set by owner.
reclaim(ILoanToken2 loanToken, bytes calldata data)
Redeems LoanTokens held by the pool for underlying funds held in the loan token. Loan token must be settled before calling this function.
reclaimDeficit(ILoanToken2 loan, uint256 amount)
After a defaulted loan's debt has been redeemed by the SAFU, the lending pool can reclaim call this function to redeem "deficiency claim" tokens for underlying tokens held in the SAFU.
LoanFactory2
fund()
Transfers tokens to loan token contract from pool. Can be called only by lender contract. Sets status to Funded, start time, lender.
withdraw(address _beneficiary)
Borrower calls this function to withdraw funds to address provided. This sets the status of the loan to Withdrawn
.
repayInFull(address _sender)
Function for borrower to repay all of the remaining loan balance. Borrower should use this to ensure full repayment.
_repay(address _sender, uint256 _amount)
Internal function for loan repayment. If _amount
is sufficient, then this also settles the loan.
settle()
Moves loan to status = 'settled' if loan is fully repaid.
reclaim()
Function for borrower to reclaim any underlying currency stuck in the loan token contract. Only the borrower can call this function after the loan has been settled, defaulted, or liquidated.
TrueRatingAgencyV2
TrueMultiFarm
LinearTrueDistributor
stake(IERC20 token, uint256 amount)
Stake tokens to the farm. Upon staking, this will claim any claimable rewards.
unstake(IERC20 token, uint256 amount)
Remove staked tokens
claim(IERC20[] calldata tokens)
Claim TRU rewards
exit(IERC20[] calldata tokens)
Unstake amount and claim rewards
claimable(IERC20 token, address account)
Returns the claimable TRU reward for an account that is staking tokens.
shares()
Returns denominator for total farm rewards rate
getShare(IERC20 token)
Returns numerator for LP token's share of farm rewards