Pricing Layer

Price Feed

CapyFi uses a Price Oracle contract to value collateral and debt. The Comptroller queries the oracle on every liquidity check and liquidation.

Introduction

What the Price Oracle is

The Price Oracle is the per-network contract responsible for reporting the USD price of every underlying asset listed in the Comptroller. On-chain consumers (Comptroller liquidity calculations, liquidation checks) and off-chain consumers (analytics, integrations) read from the same oracle.

The oracle is administered separately from the Comptroller and may be replaced via the Comptroller's _setPriceOracle path. The current oracle for a given chain is the address listed below.

API

Oracle Interface

Public read surface

getUnderlyingPrice(cToken)

function getUnderlyingPrice(address cToken) view returns (uint256)

Returns the price of the underlying asset for the given caToken address. This is the only method consumers need to integrate against — internal sourcing, validation, and update mechanics are encapsulated by the oracle implementation.

For batched lookups across all listed markets, prefer CompoundLens's cTokenUnderlyingPriceAll which aggregates oracle reads in a single call.

SCALE

Price Scaling

Mantissa convention

Prices follow the Compound v2 scaling convention: the returned price is scaled by 1e(36 - underlyingDecimals). For example, USDC (6 decimals) prices come back at 1e30, while ETH (18 decimals) prices come back at 1e18.

This scaling lets the Comptroller multiply balance × price directly to obtain a USD value with 1e36 mantissa precision, regardless of the underlying's decimals.

WIRE

Comptroller Wiring

How the oracle is reached

The Comptroller stores the active oracle behind a single getter. Clients can therefore discover the oracle dynamically without hardcoding addresses:

function oracle() view returns (address)

Calling comptroller.oracle() returns the current Price Oracle for that deployment.

ADDR

Deployed Addresses

Per-network deployments

Ethereum (1):0xfbA2712d3bbcf32c6E0178a21955b61FE1FF424A
World Chain (480):0x9E60d50407520eD4b6d47906B6c74Bc5D99aD282