Posted on

Compound III Docs Collateral & Borrowing

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.

Is Withdraw Paused

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.

Set Base Token Price Feed

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.

Set Asset Supply Cap

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.

  • See the interest rate data visualization notebook on Observable to visualize which interest rate model is currently applied to each market.
  • This function sets the rate at which base asset supplier accounts accrue rewards.
  • This function updates the borrow collateral factor for an asset in the protocol.
  • The Compound protocol contracts use a system of exponential math, Exponential.sol, in order to represent fractional quantities with sufficient precision.

Total Supply

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.

Investment Returns Calculator: Calculate Expected Returns

The deployment must have access to on-chain asset prices and governance messages passed from Ethereum Mainnet. Each time an immutable parameter is bookkeeping entry crossword clue set via governance proposal, a new Comet implementation must be 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.

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 (Low)

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.

  • Interest compounds only during blocks in which the cToken contract has one of the aforementioned methods invoked.
  • 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 updates the price feed contract address for a specific asset.

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.

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.

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.

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. 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.

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 how to estimate burden attributed to Albert Einstein, perfectly encapsulates the power of compound interest.

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.

Read on to discover how to maximize your returns. A return value charitable contributions and your taxes 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.

There is no underlying contract for ETH, so to do this with cETH, set underlyingDecimals to 18. The cToken Exchange Rate 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.