ExchangeRateFeeder

The ExchangeRateFeeder contract is responsible for calculating and determining the exchange rate between an Ethereum stablecoin and their aTerra counterpart.

Events

RateUpdated

Emitted when exchange rate is updated.

event RateUpdated(
    address indexed _operator,
    address indexed _token,
    uint256 _before,
    uint256 _after,
    uint256 _updateCount
);

State

Status

Represents the exchange rate updatability for a stablecoin.

enum Status {NEUTRAL, RUNNING, STOPPED}

Token

Represents information for an aTerra token.

struct Token {
    Status status;
    uint256 exchangeRate;
    uint256 period;
    uint256 weight;
    uint256 lastUpdatedAt;
}

Functions

exchangeRateOf

Gets the exchange rate for the specified aTerra token. Returns a simulated value (reflects yield accrued since last exchange rate update) if _simulate is set as true. Returns the last updated exchange rate value is _simulate is set as false.

function exchangeRateOf(
    address _token, 
    bool _simulate
) external view returns (uint256);

update

Updates the exchange rate for specified aTerra token.

function update(address _token) external;

Last updated