PriceRepository

Git Source

Inherits: IPriceRepository, ReentrancyGuard, RelayerAccessManager

Functions

setTokenPriceAt

Set the price of token denominated in denomination at the given timestamp

function setTokenPriceAt(address token, address denomination, uint256 timestamp, UD60x18 price) external virtual;

Parameters

NameTypeDescription
tokenaddressThe exchange token (ERC20 token)
denominationaddressThe Chainlink token denomination to quote against (ETH, BTC, or USD)
timestampuint256Reference timestamp (in seconds)
priceUD60x18The amount of token denominated in denomination (18 decimals)

_getTokenPriceAt

Returns the price of token denominated in denomination at a given timestamp, if zero, a price has not been recorded

function _getTokenPriceAt(address token, address denomination, uint256 timestamp)
    internal
    view
    returns (UD60x18 price);