IPSMRouter
Functions
psm
reference to the PegStabilityModule that this router interacts with
chi
reference to the CHI contract used.
getMintAmountOut
calculate the amount of CHI out for a given amountIn
of underlying
Parameters
Name | Type | Description |
---|---|---|
| uint256 |
getRedeemAmountOut
calculate the amount of underlying out for a given amountChiIn
of CHI
Parameters
Name | Type | Description |
---|---|---|
| uint256 |
getMaxMintAmountOut
the maximum mint amount out
getMaxRedeemAmountOut
the maximum redeem amount out
mint
Mints chi to the given address, with a minimum amount required
This wraps ETH and then calls into the PSM to mint the chi. We return the amount of chi minted.
Parameters
Name | Type | Description |
---|---|---|
| address | The address to mint chi to |
| uint256 | The minimum amount of chi to mint |
| uint256 |
redeem
Redeems chi for ETH First pull user CHI into this contract Then call redeem on the PSM to turn the CHI into weth Withdraw all weth to eth in the router Send the eth to the specified recipient
Parameters
Name | Type | Description |
---|---|---|
| address | the address to receive the eth |
| uint256 | the amount of CHI to redeem |
| uint256 | the minimum amount of weth to receive |
Last updated