Get collateral balance
Get collateral balance

Compound · Reads onchain state

Reads your collateral balance of an asset in a Compound market and the market's reserves of it. Comet returns the socket's supplied collateral in the asset's units and the protocol's own collateral reserves of the asset, which accumulate from liquidations. Reach for it to size a collateral withdrawal at what is actually held, or to multiply the balance by a price and a collateral factor to compute borrowing capacity before a borrow.

On other protocols · 2