Introduction

Please join the #development room in the Compound community Discord server; our team, and members of the community, look forward to helping you build an application on top of Compound. Your questions help us improve, so please don't hesitate to ask if you can't find what you are looking for here.

Networks

The Compound Protocol v2 is currently deployed on the following networks:

Collateral

In order to borrow from the protocol, accounts must provide enough collateral. One of the greatest motivating factors for Compound v2: Presidio was the ability to set different collateral requirements, depending on the asset being borrowed. With Presidio, the protocol no longer has a global collateral requirement and instead opens it up to individual asset communities to determine what is sufficient collateral in order to borrow their asset.

More details about how this works now and how it will evolve will be coming in the next few weeks as we prepare for mainnet launch.

Exponential Math

The Compound smart contracts use a system of exponential math in order to represent fractional quantities with sufficient precision. Throughout the documentation and code we make reference to mantissas, which are unsigned integers scaled up by a factor of 1e18 from their nominal value. By using mantissas within our contracts, we may perform basic mathematical operations like multiplication and division at a higher resolution than working with the unscaled quantities directly as integers. To gain a better understanding of how this works, see Exponential.sol.

Gas Costs

The gas usage of the protocol functions may fluctuate by market and user. External calls, such as to underlying ERC-20 tokens, may use an arbitrary amount of gas. Any calculations that involve checking account liquidity, have gas costs that increase with the number of entered markets. Thus, while it can be difficult to provide any guarantees about costs, we provide the table below for guidance:

FunctionTypical Gas Cost
Mint< 90K
Redeem, Transfer< 250K if borrowing, otherwise < 90K
Borrow< 300K
Repay Borrow< 90K
Liquidate Borrow< 400K

Glossary

TermDescription
Collateral FactorThe amount of an asset that may be borrowed for each unit of collateral provided. The collateral factor is defined per market.
Close FactorThe portion of a borrow in a single market that may be closed by a liquidator during a single liquidation. For example, if Joe borrows 100 ZRX and the close factor is 0.3, then a liquidator may close 30 ZRX. The close factor is globally defined across all markets.
Liquidation IncentiveThe additional collateral given to liquidators as an incentive to perform liquidation of underwater accounts. For example, if the liquidation incentive is 1.1, liquidators receive an extra 10% of the borrowers collateral for every unit they close. The liquidation incentive is globally defined across all markets.