Skip to main content

IPSMRouter

Functions

psm

function psm() external returns (contract IPegStabilityModule)

reference to the PegStabilityModule that this router interacts with

fei

function fei() external returns (contract IFei)

reference to the FEI contract used.

getMintAmountOut

function getMintAmountOut(
uint256 amountIn
) external returns (uint256 amountFeiOut)

calculate the amount of FEI out for a given amountIn of underlying

Parameters

NameTypeDescription
amountInuint256

getRedeemAmountOut

function getRedeemAmountOut(
uint256 amountFeiIn
) external returns (uint256 amountOut)

calculate the amount of underlying out for a given amountFeiIn of FEI

Parameters

NameTypeDescription
amountFeiInuint256

getMaxMintAmountOut

function getMaxMintAmountOut() external returns (uint256)

the maximum mint amount out

getMaxRedeemAmountOut

function getMaxRedeemAmountOut() external returns (uint256)

the maximum redeem amount out

mint

function mint(
address _to,
uint256 _minAmountOut,
uint256 ethAmountIn
) external returns (uint256)

Mints fei to the given address, with a minimum amount required

This wraps ETH and then calls into the PSM to mint the fei. We return the amount of fei minted.

Parameters

NameTypeDescription
_toaddressThe address to mint fei to
_minAmountOutuint256The minimum amount of fei to mint
ethAmountInuint256

redeem

function redeem(
address to,
uint256 amountFeiIn,
uint256 minAmountOut
) external returns (uint256 amountOut)

Redeems fei for ETH First pull user FEI into this contract Then call redeem on the PSM to turn the FEI into weth Withdraw all weth to eth in the router Send the eth to the specified recipient

Parameters

NameTypeDescription
toaddressthe address to receive the eth
amountFeiInuint256the amount of FEI to redeem
minAmountOutuint256the minimum amount of weth to receive