Compound Docs Getting Started
There is no underlying contract for ETH, so to do this with cETH, set underlyingDecimals to 18. The cToken Exchange Rate irs extends 2020 form 1095 furnishing deadline and other relief is scaled by the difference in decimals between the cToken and the underlying asset. The Compound protocol contracts use a system of exponential math, ExponentialNoError.sol, in order to represent fractional quantities with sufficient precision. 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. Investing in exchange-traded funds (ETFs) is a smart way to build wealth over time.
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.
Configurator Implementation
- This function sets the official contract address of the Compound III protocol pause guardian.
- External calls, such as to underlying ERC-20 tokens, may use an arbitrary amount of gas.
- The methods in CometExt.sol are able to be called via the same proxy as Comet.sol.
- Consider Linking this to an article on the impact of Inflation on interest rate
This function allows governance to withdraw base token reserves from the protocol and send them to a specified address. 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.
Set Base Tracking Borrow Speed
Consider Linking this to an article on the impact of Inflation on interest rate The longer your money stays invested, the more powerful the compounding effect becomes. Over time, this effect can be dramatic, especially for long-term investments. That quote, often attributed to Albert Einstein, perfectly encapsulates the power of compound interest.
- This address has the power to pause supply, transfer, withdraw, absorb, and buy collateral operations within Compound III.
- This function sets the borrow interest rate slope base in the approximate amount of seconds in one year.
- Investing in dividend-paying stocks is a proven strategy for building wealth over time.
- Account balances are stored internally in Comet as principal values (also signed integers).
Read on to discover how to maximize your returns. 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 returns a boolean indicating whether or not the protocol transfer functionality is presently paused. This address has the power to pause supply, transfer, withdraw, absorb, and buy collateral operations within Compound III. 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.
Interpreting Exchange Rates
They detail the protocol deployment process, construction of new features, and code examples for implementing external apps that depend on Compound III as infrastructure. The following developer guides and code repositories serve as resources for community members building on Compound. It allows accounts to bulk multiple operations into a single transaction.
The configurator deploys implementations of the Comet logic contract according to its configuration. This is a proxy contract for the configurator, which is used the 7 most common types of errors in programming and how to avoid them to set and update parameters of a Comet proxy contract. To generate the proper Comet Interface ABI (CometInterface.sol), compile the Comet project using yarn compile. The v3 proxy is the only address to be used to interact with a Compound III instance.
This function updates the liquidation collateral factor for an asset in the protocol. 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.
Minimum Borrow Balance
This function sets the minimum amount of base token that is allowed to be borrowed. This function sets the fraction of the liquidation penalty that goes to buyers of collateral instead of the protocol. This function sets the supply interest rate slope high bound in the approximate amount of seconds in one year.
Is Withdraw Paused
The Timelock on Mainnet is the administrator of all community sanctioned instances of Compound III. If the proposal is approved by the community, the proxy will point to the new implementation upon execution. The governance system has control over each proxy, the Configurator implementation, the Comet factory, and the Comet implementation. For more information on the Governor and Timelock see the original governance section.
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. This function returns false if an account does not have sufficient liquidity to increase its borrow position.
Set Borrow Interest Rate Slope (High)
Governance allows the community to propose, vote, and implement changes through the administrative smart contract functions of the Compound III protocol. This is an extension of the market logic contract which supports some auxiliary/independent interfaces for the protocol. The initial deployment of Compound III is on Ethereum and the base asset is USDC. Interest compounds only during blocks in which the cToken contract has one of the aforementioned methods invoked.
Ethers.js v5.x
For documentation of the Compound v2 Protocol, see docs.compound.finance/v2. Historical interest rates can be retrieved from the MarketHistoryService API. To find the number of underlying tokens that can be redeemed for cTokens, multiply the number of cTokens by the above value oneCTokenInUnderlying. Please join the #development room in the Compound community Discord server; Compound Labs and members of the community look forward to helping you build an application on top of Compound.
Borrowing Assets from the Compound Protocol
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. No one interacts with the cEther contract for 3 Ethereum blocks. The Compound protocol has been reviewed & audited by OpenZeppelin and ChainSecurity.
Before supplying an asset to Compound III, the caller must first execute the asset’s ERC-20 approve of the Comet contract. This function sets the Comet contract’s ERC-20 allowance of an asset for a manager address. This function sets the maximum amount of an asset that can be supplied to the protocol.
The deployment must have access to on-chain asset prices and governance messages passed from Ethereum Mainnet. Each time an immutable parameter is set via governance proposal, a new Comet implementation must be accounting basics deployed by 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.
Prices and exchange rates are scaled by the decimals unique to each asset; cTokens are ERC-20 tokens with 8 decimals, while their underlying tokens vary, and have a public member named decimals. The Compound protocol is based on the Compound Whitepaper (2019); the codebase is open-source, and maintained by the community. Investing in dividend-paying stocks is a proven strategy for building wealth over time. This comprehensive calculator helps you track all your assets and liabilities in one place, Understanding compound interest is vital, but finding the right investments is crucial for maximizing your returns. Our free compound interest calculator makes it easy to visualize how your investments can grow over time.