Tadpole Architecture
#
CToken, CErc20 and CEtherThe Tadpole cTokens, which are self-contained borrowing and lending contracts. CToken contains the core logic and CErc20 and CEther add public interfaces for Erc20 tokens and ether, respectively. Each CToken is assigned an interest rate and risk model (see InterestRateModel and Comptroller sections), and allows accounts to mint (supply capital), redeem (withdraw capital), borrow and repay a borrow. Each CToken is an ERC-20 compliant token where balances represent ownership of the market.
#
ComptrollerThe risk model contract, which validates permissible user actions and disallows actions if they do not fit certain risk parameters. For instance, the Comptroller enforces that each borrowing user must maintain a sufficient collateral balance across all cTokens.
#
TADThe Tadpole platform token. Holders of this token have the ability to govern the protocol via the governor contract. TAD is also used to pay the listing fees to add a new ERC-20 to the money markets.
#
JumpRateModelV3Contracts which define interest rate models. These models algorithmically determine interest rates based on the current utilization of a given market (that is, how much of the supplied assets are liquid versus borrowed).
#
Careful MathLibrary for safe math operations.
#
ErrorReporterLibrary for tracking error codes and failure conditions.
#
ExponentialLibrary for handling fixed-point decimal numbers.
#
SafeTokenLibrary for safely handling Erc20 interaction.
#
CollateralModelContracts which define collateral rate models. Currently collateral rates are defined manually by admin. Our goal is to make CollateralModel which can determine collateral rates algorithmically based on various variables like the token's liquidity, volatility, etc.
#
CTokenFactoryA contract factory to generate cToken. To add a new market into Tadpole, user send a request to Comptroller.createMarket() and it will call CTokenFactory to generate a new cToken smart contract into Ethereum network.
#
PriceOracleV1Simple price oracle before we move to a more complex oracle to support an open lending ecosystem.