
Compound · Reads onchain state
Reads the price of an asset in a Compound market from the market's own feed. The action picks the base token's feed or the collateral asset's feed as appropriate and asks Comet for the price at its 8-decimal scale, so the number is exactly what the market uses to value collateral and debt. Reach for it to convert between token and dollar amounts inside the market's own accounting: sizing a collateral supply to a target capacity, or checking how far a position sits from its liquidation factor.
On other protocols · 8