Comptroller

Liquidation Incentive

The additional collateral given to liquidators as an incentive to perform liquidation of underwater accounts. A portion of this is given to the collateral pToken reserves as determined by the seize share. The seize share is assumed to be 0 if the pToken does not have a protocolSeizeShareMantissa constant. For example, if the liquidation incentive is 1.08, and the collateral's seize share is 1.028, liquidators receive an extra 5.2% of the borrower's collateral for every unit they close, and the remaining 2.8% is added to the pToken's reserves.

Comptroller

Copy

function liquidationIncentiveMantissa() view returns (uint)
  • RETURN: The liquidationIncentive, scaled by 1e18, is multiplied by the closed borrow amount from the liquidator to determine how much collateral can be seized.

Solidity

Copy

Comptroller troll = Comptroller(0xABCD...);
uint closeFactor = troll.liquidationIncentiveMantissa();

Web3 1.0

Copy

const troll = Comptroller.at(0xABCD...);
const closeFactor = await troll.methods.liquidationIncentiveMantissa().call();

Key Events

EventDescription

MarketEntered(pToken pToken, address account)

Emitted upon a successful Enter Market.

MarketExited(pToken pToken, address account)

Emitted upon a successful Exit Market.

Solidity

Market Metadata

The Comptroller contract has an array called getAllMarkets that contains the addresses of each pToken contract. Each address in the getAllMarkets array can be used to fetch a metadata struct in the Comptroller’s markets constant. See the ComptrollerPart1 contract for the Market struct definition.

Comptroller

Copy

pToken[] public getAllMarkets;

Solidity

Copy

Comptroller troll = Comptroller(0xABCD...);
pToken pTokens[] = troll.getAllMarkets();

Web3 1.2.6

Copy

const comptroller = new web3.eth.Contract(comptrollerAbi, comptrollerAddress);
const pTokens = await comptroller.methods.getAllMarkets().call();
const pToken = pTokens[0]; // address of a pToken

Last updated