Lending
ttoken
ttokenContains all the ways to interact with a tToken, which include minting, burning and even strategies. Let's take a look at what's under the hood here.
strategiesITTokenStrategyThe interface with the functions required to be implemented in a Dapp strategy contract. It contains the strategy torebalance(), allows users towithdraw()from a pool or give us thetotalUnderlyingSupply()of an underlying asset.compoundSo far, we only have one current strategy for ourttokenand that is related to the compounddecentralized applicationThe logic of this strategy is found in the
TTokenCompoundStrategy.solMore info on the compound strategy can be found here. Note that it implements the
ITTokenStrategyinterface
TTokencontains all the functions required to interact with attokenIt is
ERC20Upgradeable, which means we can upgrade the interface contract to add more functions down the lineIt can get/set strategies, fund/repay loans, burn tokens to redeem profit and get other metadata of the respective
ttoken.
LendingFacet.solcontains all the functions required to both create a lending pool (to allow DeFi developers to create their own markets) and to deposit into a pool. Depositing into a pool transfers the underlying asset to the pool and mints newttokensof the underlying asset into the lender's wallet
Last updated
Was this helpful?