Skip to main content

IPriceOracle

Each vault has the address of a price oracle installed. This address is immutable and cannot be changed, even by the vault governor. If updates to pricing sources are desired, this address should be a governed EulerRouter pricing component. All oracles must implement the IPriceOracle interface below:

interface IPriceOracle {
/// @return General description of this oracle implementation.
function name() external view returns (string memory);

/// @return outAmount The amount of `quote` that is equivalent to `inAmount` of `base`.
function getQuote(
uint256 inAmount,
address base,
address quote
) external view returns (uint256 outAmount);

/// @return bidOutAmount The amount of `quote` you would get for selling `inAmount` of `base`.
/// @return askOutAmount The amount of `quote` you would spend for buying `inAmount` of `base`.
function getQuotes(
uint256 inAmount,
address base,
address quote
) external view returns (uint256 bidOutAmount, uint256 askOutAmount);
}

This interface shapes oracle interactions in an important way: it forces the consumer to think in amounts rather than prices.

A subset of this interface (getQuote) has been standardized in ERC-7726.