⬅️ Contracts
the PSM router is an ungoverned, non custodial contract that allows user to seamlessly wrap and unwrap their WETH for trading against the PegStabilityModule.
Mainnet implementations
MintRedeemPausePSM
Methods
fei
function fei() view returns(address)
reference to the FEI contract used. Does not reference core to save on gas Router can be redeployed if FEI address changes
Returns
getMaxMintAmountOut
function getMaxMintAmountOut() view returns(uint256)
the maximum mint amount out
Returns
getMaxRedeemAmountOut
function getMaxRedeemAmountOut() view returns(uint256)
the maximum redeem amount out
Returns
getMintAmountOut
function getMintAmountOut(uint256) view returns(uint256)
view only pass through function to get amount of FEI out with given amount of ETH in
Params
Param |
Type |
Notes |
amountIn |
uint256 |
|
Returns
Param |
Type |
Notes |
amountFeiOut |
uint256 |
|
getRedeemAmountOut
function getRedeemAmountOut(uint256) view returns(uint256)
view only pass through function to get amount of ETH out with given amount of FEI in
Params
Param |
Type |
Notes |
amountFeiIn |
uint256 |
|
Returns
Param |
Type |
Notes |
amountTokenOut |
uint256 |
|
mint
function mint(address,uint256,uint256) payable 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.
Params
Param |
Type |
Notes |
to |
address |
The address to mint fei to |
minAmountOut |
uint256 |
The minimum amount of fei to mint |
ethAmountIn |
uint256 |
|
Returns
mint
function mint(address,uint256,uint256,uint256) payable returns(uint256)
Mints fei to the given address, with a minimum amount required and a deadline
This wraps ETH and then calls into the PSM to mint the fei. We return the amount of fei minted.
Params
Param |
Type |
Notes |
to |
address |
The address to mint fei to |
minAmountOut |
uint256 |
The minimum amount of fei to mint |
deadline |
uint256 |
The deadline for this order to be filled |
ethAmountIn |
uint256 |
|
Returns
psm
function psm() view returns(address)
reference to the PegStabilityModule that this router interacts with
Returns
redeem
function redeem(address,uint256,uint256) nonpayable returns(uint256)
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
Params
Param |
Type |
Notes |
to |
address |
the address to receive the eth |
amountFeiIn |
uint256 |
the amount of FEI to redeem |
minAmountOut |
uint256 |
the minimum amount of weth to receive |
Returns
redeem
function redeem(address,uint256,uint256,uint256) nonpayable returns(uint256)
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
Params
Param |
Type |
Notes |
to |
address |
the address to receive the eth |
amountFeiIn |
uint256 |
the amount of FEI to redeem |
minAmountOut |
uint256 |
the minimum amount of weth to receive |
deadline |
uint256 |
The deadline for this order to be filled |
Returns
⬅️ Contracts