Save Wrapper
The Save Wrapper bundles utility functions together to simplify multiple interactions with mStable's smart contract calls into one single call. Contract is immutable.
Name | Contract | Address |
Save Wrapper |
Functions
saveAndStake()
function saveAndStake (address _mAsset, address _save, address _vault, uint256 _amount) external
Simply saves an mAsset and then into the vault
Parameter | Type | Description |
---|---|---|
| address | mAsset address |
| address | Save address |
| address | Boosted Savings Vault address |
| uint256 | Units of mAsset to deposit to savings |
saveAndStake()
function saveAndStake (address _mAsset, address _save, address _vault, uint256 _amount, address _referrer) external
Simply saves an mAsset and then into the vault
Parameter | Type | Description |
---|---|---|
| address | mAsset address |
| address | Save address |
| address | Boosted Savings Vault address |
| uint256 | Units of mAsset to deposit to savings |
| address | Referrer address for this deposit. |
saveViaMint()
function saveViaMint (address _mAsset, address _bAsset, address _save, address _vault, uint256 _amount, uint256 _minOut, bool _stake) external
Mints an mAsset and then deposits to Save/Savings Vault
Parameter | Type | Description |
---|---|---|
| address | mAsset address |
| address | bAsset address |
| address | Save address |
| address | Boosted Savings Vault address |
| uint256 | Amount of bAsset to mint with |
| uint256 | Min amount of mAsset to get back |
| bool | Add the imAsset to the Boosted Savings Vault? |
saveViaMint()
function saveViaMint (address _mAsset, address _bAsset, address _save, address _vault, uint256 _amount, uint256 _minOut, bool _stake, address _referrer) external
Mints an mAsset and then deposits to Save/Savings Vault
Parameter | Type | Description |
---|---|---|
| address | mAsset address |
| address | bAsset address |
| address | Save address |
| address | Boosted Savings Vault address |
| uint256 | Amount of bAsset to mint with |
| uint256 | Min amount of mAsset to get back |
| bool | Add the imAsset to the Boosted Savings Vault |
| address | Referrer address for this deposit. |
saveViaSwap()
function saveViaSwap (address _mAsset, address _save, address _vault, address _feeder, address _fAsset, uint256 _fAssetQuantity, uint256 _minOutputQuantity, bool _stake) external
Swaps fAsset for mAsset and then deposits to Save/Savings Vault
Parameter | Type | Description |
---|---|---|
| address | mAsset address |
| address | Save address |
| address | Boosted Savings Vault address |
| address | Feeder Pool address |
| address | fAsset address |
| uint256 | Quantity of fAsset sent |
| uint256 | Min amount of mAsset to be swapped and deposited |
| bool | Deposit the imAsset in the Savings Vault? |
saveViaSwap()
function saveViaSwap (address _mAsset, address _save, address _vault, address _feeder, address _fAsset, uint256 _fAssetQuantity, uint256 _minOutputQuantity, bool _stake, address _referrer) external
Swaps fAsset for mAsset and then deposits to Save/Savings Vault
Parameter | Type | Description |
---|---|---|
| address | mAsset address |
| address | Save address |
| address | Boosted Savings Vault address |
| address | Feeder Pool address |
| address | fAsset address |
| uint256 | Quantity of fAsset sent |
| uint256 | Min amount of mAsset to be swapped and deposited |
| bool | Deposit the imAsset in the Savings Vault? |
| address | Referrer address for this deposit. |
saveViaUniswapETH()
function saveViaUniswapETH (address _mAsset, address _save, address _vault, address _uniswap, uint256 _amountOutMin, address[] _path, uint256 _minOutMStable, bool _stake) external
Buys a bAsset on Uniswap with ETH, then mints imAsset via mAsset, optionally staking in the Boosted Savings Vault
Parameter | Type | Description |
---|---|---|
| address | mAsset address |
| address | Save address |
| address | Boosted vault address |
| address | Uniswap router address |
| uint256 | Min uniswap output in bAsset units |
| address[] | Sell path on Uniswap (e.g. [WETH, DAI]) |
| uint256 | Min amount of mAsset to receive |
| bool | Add the imAsset to the Savings Vault? |
saveViaUniswapETH()
function saveViaUniswapETH (address _mAsset, address _save, address _vault, address _uniswap, uint256 _amountOutMin, address[] _path, uint256 _minOutMStable, bool _stake, address _referrer) external
Buys a bAsset on Uniswap with ETH, then mints imAsset via mAsset,optionally staking in the Boosted Savings Vault
Parameter | Type | Description |
---|---|---|
| address | mAsset address |
| address | Save address |
| address | Boosted vault address |
| address | Uniswap router address |
| uint256 | Min uniswap output in bAsset units |
| address[] | Sell path on Uniswap (e.g. [WETH, DAI]) |
| uint256 | Min amount of mAsset to receive |
| bool | Add the imAsset to the Savings Vault? |
| address | Referrer address for this deposit. |
estimate_saveViaUniswapETH()
function estimate_saveViaUniswapETH (address _mAsset, address _uniswap, uint256 _ethAmount, address[] _path) external returns (uint256 out)
Gets estimated mAsset output from a WETH > bAsset > mAsset trade
Parameter | Type | Description |
---|---|---|
| address | mAsset address |
| address | Uniswap router address |
| uint256 | ETH amount to sell |
| address[] | Sell path on Uniswap (e.g. [WETH, DAI]) |
Last updated