Fei Protocol
Search…
EthReserveStabilizer
Exchanges FEI for ETH from the reserves

Contract

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
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 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
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

1
function getAmountOut(uint256 amountFeiIn) external view returns (uint256);
Copied!
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

1
function usdPerFeiBasisPoints() external view returns (uint256);
Copied!
returns the usdPerFeiBasisPoints exchange rate between FEI and $1 worth of ETH denominated in basis points (1/10000)

Public State-Changing Functions

exchangeFei

1
function exchangeFei(uint256 feiAmount) external returns (uint256);
Copied!
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

1
function withdraw(address to, uint256 amount) external;
Copied!
Withdraws amount ETH to address to from the EthReserveStabilizer
emits Withdrawal

Governor-Only⚖️ State-Changing Functions

1
function setUsdPerFeiRate(uint256 exchangeRateBasisPoints) external;
Copied!
Sets the usdPerFeiBasisPoints to exchangeRateBasisPoints
emits UsdPerFeiRateUpdate

ABIs

ethreservestabilizer.json
5KB
Code
EthReserveStabilizer ABI
ireservestabilizer.json
2KB
Code
IReserveStabilizer ABI
Last modified 5mo ago