Skip to main content

IPriceOracle

Git Source

Title: IPriceOracle

Author: Euler Labs (https://www.eulerlabs.com/)

Common PriceOracle interface.

Note: security-contact: security@euler.xyz

Functions

name

Get the name of the oracle.

function name() external view returns (string memory);

Returns

NameTypeDescription
<none>stringThe name of the oracle.

getQuote

One-sided price: How much quote token you would get for inAmount of base token, assuming no price spread.

function getQuote(uint256 inAmount, address base, address quote) external view returns (uint256 outAmount);

Parameters

NameTypeDescription
inAmountuint256The amount of base to convert.
baseaddressThe token that is being priced.
quoteaddressThe token that is the unit of account.

Returns

NameTypeDescription
outAmountuint256The amount of quote that is equivalent to inAmount of base.

getQuotes

Two-sided price: How much quote token you would get/spend for selling/buying inAmount of base token.

function getQuotes(uint256 inAmount, address base, address quote)
external
view
returns (uint256 bidOutAmount, uint256 askOutAmount);

Parameters

NameTypeDescription
inAmountuint256The amount of base to convert.
baseaddressThe token that is being priced.
quoteaddressThe token that is the unit of account.

Returns

NameTypeDescription
bidOutAmountuint256The amount of quote you would get for selling inAmount of base.
askOutAmountuint256The amount of quote you would spend for buying inAmount of base.