EthReserveStabilizer

Exchanges FEI for ETH from the reserves

Contract

EthReserveStabilizer.sol implements IReserveStabilizer, OracleRef

Description

A contract for exchanging FEI for ETH from reserves at some USD price relative to an oracle.

For example if ETH is $2500 and the usd exchange rate for FEI is $0.90 then ~2777 FEI can be exchanged for 1 ETH.

Receives ETH from the EthPCVDripper in batches

  • Burner🔥

Events

FeiExchange
Withdrawal
UsdPerFeiRateUpdate
FeiExchange

Exchange FEI for ETH from the PCV

type

param

description

address indexed

to

address of the exchanger

uint256

feiAmount

amount of FEI exchanged

uint256

amountOut

amount of ETH received

Withdrawal

Withdrawal of PCV

type

param

description

address indexed

_caller

the PCV controller calling this function

address indexed

_to

the recipient address of the PCV

uint256

_amount

amount withdrawn

UsdPerFeiRateUpdate

Update of the conversion rate between USD and FEI

type

param

description

uint256

basisPoints

amount of basis points in USD per FEI terms

Read-Only Functions

getAmountOut

function getAmountOut(uint256 amountFeiIn) external view returns (uint256);

Returns the amount of ETH received for a FEI exchange of size amountFeiIn

Multiplies the amountFeiIn by the inverted peg and the usdPerFeiBasisPoints / 10000

Can be inaccurate if outdated, need to call oracle().isOutdated() to check

usdPerFeiBasisPoints

function usdPerFeiBasisPoints() external view returns (uint256);

returns the usdPerFeiBasisPoints exchange rate between FEI and $1 worth of ETH denominated in basis points (1/10000)

Public State-Changing Functions

exchangeFei

function exchangeFei(uint256 feiAmount) external returns (uint256);

Burns feiAmount FEI from the caller then sends getAmountOut(feiAmount) of ETH to the caller and returns that value

emits FeiExchange

PCV Controller-Only ⚙️ State-Changing Functions

withdraw

function withdraw(address to, uint256 amount) external;

Withdraws amount ETH to address to from the EthReserveStabilizer

emits Withdrawal

Governor-Only⚖️ State-Changing Functions

function setUsdPerFeiRate(uint256 exchangeRateBasisPoints) external;

Sets the usdPerFeiBasisPoints to exchangeRateBasisPoints

emits UsdPerFeiRateUpdate

ABIs