This function returns false if an account does not have sufficient liquidity to increase its borrow position. A withdraw transaction to borrow that results in the account’s borrow size being less than the baseBorrowMin will revert. Compound III implements a minimum borrow position size which can be found as baseBorrowMin in the protocol configuration. The withdraw method is used to withdraw collateral that is not currently supporting an open borrow. Before supplying an asset to Compound III, the caller must first execute the asset’s ERC-20 approve of the Comet contract.
This is an external contract that is not integral to Comet’s function. This is the factory contract capable of producing instances of the Comet implementation/logic contract, and invoked by the Configurator. This pattern allows significant gas savings for users of the protocol by ‘constantizing’ the parameters of the protocol. The configurator deploys implementations of the Comet logic contract according to its configuration. This is a proxy contract for the configurator, which is used to set and update parameters of a Comet proxy contract.
cUSDCv3 Implementation
It is for this reason that financial experts commonly suggest the risk management strategy of diversification. Real-life returns are rarely as predictable as these examples. It’s important to remember that these example calculations assume a fixed percentage yearly interest rate. This means total interest of $16,532.98 and a return on investment of 165%. We’ll assume you intend to leave the investment untouched for 20 years.
This function updates the price feed contract address for a specific asset. This factor is used to calculate the discount rate of collateral for sale as part of the account absorption process. This function sets the supply interest rate slope base in the approximate amount of seconds in one year. This function sets the borrow interest rate slope base in the approximate amount of seconds in one year. This function sets the official contract address of the protocol’s Comet extension delegate. This function returns a boolean indicating whether or not the protocol absorb functionality is presently paused.
Do not interact with this contract directly; instead use accrual accounting vs cash basis accounting the cUSDCv3 proxy address with the Comet Interface ABI. This is the implementation of the market logic contract, as deployed by the Comet Factory via the Configurator. The address is fixed and independent from future upgrades to the market. This is the main proxy contract for interacting with the first Compound III market.
- This function sets the borrow interest rate slope high bound in the approximate amount of seconds in one year.
- We’ll use a 20 year investment term at a 10% annual interest rate (just for simplicity).
- The network deployment artifacts with contract addresses are available in the Comet repository deployments/ folder.
- This function sets the rate at which base asset supplier accounts accrue rewards.
Set Supply Kink
- This function sets the supply interest rate slope low bound in the approximate amount of seconds in one year.
- The first is on behalf of the caller, the second is to a separate account, and the third is for a manager on behalf of an account.
- Collateral can only be added if the market is below its supplyCap, which limits the protocol’s risk exposure to collateral assets.
- The base asset can be borrowed using the withdraw function; the resulting borrow balance must meet the borrowing collateral factor requirements.
- COMP token-holders designate the Pause Guardian address, which is held by the Community Multi-Sig.
Looking back at our example from above, if we were to contribute an additional $100 per month into our investment, our balance after 20 years would hit the heights of $67,121, with interest of $33,121 on total deposits of $34,000. $10,000 invested at a fixed 5% yearly interest rate, compounded yearly, will grow to $26,532.98 after 20 years. We’ll say you have $10,000 in a savings account earning 5% interest per year, with annual compounding. This generates additional interest in the periods that follow, which accelerates your investment growth. There are also some excellent articles from renowned financial websites that list common types of investment for compound interest. The question about where to invest to benefit the most from compound interest has become a feature of our email inbox, with people considering mutual funds, ETFs, MMFs and high-yield savings accounts, and wanting to know the advantages and risks.
If you are investing your money, rather than saving it in fixed rate accounts, the reality is that returns on investments will vary year on year due to fluctuations in interest rates, market conditions, inflation, and other economic factors. This function returns true if the account passed to it has non-negative liquidity based on the borrow collateral factors. The supply function transfers an asset to the protocol and adds it to the account’s balance. Users can add collateral assets to their account using the supply function.
Update Liquidation Collateral Factor
This function sets the borrow interest rate utilization curve kink for the Compound III base asset. In addition to supplying, borrowing, and wrapping, the bulker contract can also transfer collateral within the protocol and claim rewards. Accounts can also earn interest by supplying the base asset to the protocol. Successful execution of one of these functions triggers the accrueInterest method, which causes interest to be added to the underlying balance of every supplier and borrower in the market. Global indices for supply and borrow are unsigned integers that increase over time to account for the interest accrued on each side. Each collateral asset increases the user’s borrowing capacity, based on the asset’s borrowCollateralFactor.
Add a New Asset
Once the protocol reaches this amount of reserves of base asset, liquidators cannot buy collateral from the protocol. This function sets the rate at which base asset supplier accounts accrue rewards. This function sets the supply interest rate utilization curve kink for the Compound III base asset.
Setting up an Ethereum Development Environment
We’ve covered what compound interest is, but how do you make the most of it? Unlike simple interest, which is calculated only on the principal, compound interest is calculated on both the principal and the accumulated interest. The concept of compound interest, or ‘interest on interest’, is that accumulated interest is added back onto your principal sum, with future interest being calculated on both the original principal and the already-accrued interest. Continue scrolling to learn how compound interest works – and how to make it work for you.👇 Our tool provides both monthly and yearly interest projections, helping you see how compound interest can increase the value of your money as you plan for the future.
Set Store Front Price Factor
Withdraw is also used to borrow the base asset from the protocol if the account has supplied sufficient collateral. If the base asset is supplied resulting in the account having a balance greater than zero, the base asset earns interest based on the current supply rate. Compound III is an EVM compatible protocol that enables supplying of crypto assets as collateral in order to borrow the base asset. An account balance greater than zero indicates the base asset is supplied and a balance less than zero indicates the base asset is borrowed. For instance, if the borrow collateral factor for WBTC is 85%, an account can borrow up to 85% of the USD value of its supplied WBTC in the base asset.
This function sets the minimum amount of base asset supplied to the protocol in order for accounts to accrue rewards. This function sets the rate at which invest in tax free municipal bonds for lower taxes and risk base asset borrower accounts accrue rewards. This function sets the official contract address of the price feed of the protocol base asset. Interest rates for each market update on any block in which the ratio of borrowed assets to supplied assets in the market has changed.
This function sets the official contract address of the Compound III protocol pause guardian. This function sets the official contract address of the Compound III protocol Governor for subsequent proposals. It can be viewed at v3-additional-grants.compound-community-licenses.eth when the browser network is set to Ethereum Mainnet.
Contributing to the Protocol
This function sets the official introduction to bonds payable contract address of the Comet factory. All instances of Compound III are controlled by the Timelock contract which is the same administrator of the Compound v2 protocol. Any calculations that involve checking account liquidity, have gas costs that increase with the number of entered markets. The gas usage of the protocol functions may fluctuate by market and user. Note that the supplyRatePerBlock value may change at any time.
If the WBTC liquidation factor is 0.9, the user will receive $90 of the base asset when a liquidator triggers an absorption of their account. This function updates the borrow collateral factor for an asset in the protocol. This function returns a boolean indicating whether or not the protocol’s selling of absorbed collateral functionality is presently paused. This function returns a boolean indicating whether or not the protocol supply functionality is presently paused. The more times the interest is compounded within the year, the higher the effective annual interest rate will be.
You can also see a full list of all deployed contract addresses here. The app.compound.finance interface is open-source, and maintained by the community. As a final note, many of the features in my compound interest calculator have come as a result of user feedback.
If the proposal is approved by the community, the proxy will point to the new implementation upon execution. Each time an immutable parameter is set via governance proposal, a new Comet implementation must be deployed by the Comet factory. Compound III is a decentralized protocol that is governed by holders and delegates of COMP. External calls, such as to underlying ERC-20 tokens, may use an arbitrary amount of gas.
A return value of false does not necessarily imply that the account is presently liquidatable (see isLiquidatable function). Account balances are stored internally in Comet as principal values (also signed integers). Supply transactions will revert if the total supply would be greater than this number as a result. The liquidation factor is a decimal value that is between 0 and 1 (inclusive) which determines the amount that is paid out to an underwater account upon liquidation. This function modifies an existing asset’s configuration parameters. The methods in CometExt.sol are able to be called via the same proxy as Comet.sol.