Get borrow rate
Get borrow rate

Compound · Reads onchain state

Reads what a Compound market charges borrowers at a given utilization, per second and as an APY. Comet's getBorrowRate evaluates the market's published curve at whatever utilization it is handed and returns the rate at 18 decimals; the action compounds it over a year on-chain into borrowApy. The market never exposes its rate at the current utilization, so wire the utilization read into this one to ask what it charges right now. Reach for it to gate a borrow on a maximum APY, to compare the cost of debt against the yield the borrowed asset will earn elsewhere, or to ask what a loop would cost at a utilization the market has not reached yet.