Vault
The vault is the main contract of the protocol. The vault is responsible for minting/redeeming OUSD tokens, rebalancing funds between the various supported strategies, and liquidating rewards tokens.

Units

All OUSD amounts passed or returned by the Vault methods use 18 decimal places. For example, 1 OUSD is expressed as 1000000000000000000.
For other stable coins, the number of decimal places varies. DAI uses 18 decimal places while USDC and USDT use only 6.
The protocol was updated in November are currently underway to increase the resolution of rebasing calculations from 18 decimals to 27 decimals. The OUSD token itself will still retain 18 decimals of precision and user balances should not change.

Methods‌

mint()

function mint(address _asset, uint256 _amount, uint256 _minimumOusdAmount)
Mints OUSD in exchange for a deposit of a certain _amount of stablecoin specified by the _asset parameter. The caller receives a certain amount of OUSD depending on the exchange rate.
Parameter Name
Type
Description
_asset
address
Address of the supported stablecoin
_amount
uint256
Amount deposited, expressed in decimal units
_minimumOusdAmount
uint256
Minimum amount of OUSD the caller is willing to receive. The call to mint() reverts if the minimum is not met.

mintMultiple()

function mintMultiple(address[] _assets, uint256[] _amounts, uint256 _minimumOusdAmount)
Mints OUSD in exchange for a deposit of multiple stablecoins in a single call. Stablecoins are specified by the _assets array parameter and the amounts by the _amounts array parameter. The caller receives a certain amount of OUSD depending on the exchange rate.
Parameter Name
Type
Description
_assets
address[]
Addresses of the supported stablecoins
_amounts
uint256[]
Amounts deposited, expressed in decimal units
_minimumOusdAmount
uint256
Minimum amount of OUSD the caller is willing to receive. The call to mint() reverts if the minimum is not met.
On redemptions, it is the protocol and not the user that decides which stablecoin(s) are returned to the user. This decision of which coin(s) to return is based on the internal ratios of the assets that are being held in the vault.‌

redeem()

function redeem(uint256 _amount)
OUSD specified by the _amount parameter is redeemed in exchange for one or multiple supported stablecoins. Amount of stablecoins received depends on the exchange rate.
Parameter Name
Type
Description
_amount
uint256
amount of OUSD expressed in decimal units

redeemAll()‌

function redeemAll()
All OUSD in user's possession is redeemed in exchange for one or multiple supported stablecoins. Amount of stablecoins received depends on the exchange rate.

rebase()

function rebase()
Updates the balances for all users based on the value of the assets currently stored in the vault. Returns total value of the underlying assets and strategies represented by uint256 type.‌

allocate()

function allocate()
Moves the assets under management into their prescribed Stategies to maximize yield and diversify risk.‌

totalValue()

function totalValue()
Returns total value of underlying assets and strategies.
return name
Type
Description
value
uint256
total value of underlying assets and strategies.

checkBalance()

function checkBalance(address _asset)
Returns the balance of an asset specified by the_asset parameter held in Vault and all strategies represented by uint256 type.
Parameter Name
Type
Description
_asset
address
Address of the supported stablecoin

calculateRedeemOutputs()

function calculateRedeemOutputs(uint256 _amount)
Calculate the mix of stablecoins that a redeem function would return when redeeming certain amount of OUSD specified by the _amount parameter. Returns an array of stablecoin values.
To attribute the stablecoin values to the correct stablecoin currency this call should be used in conjunction with getAllAssets function that returns an array of stablecoin addresses.
The index of an array that is returned by the calculateRedeemOutputs corresponds to the stablecoin address with the same index in an array returned by the getAllAssets function.
Parameter Name
Type
Description
_amount
uint256
amount of OUSD expressed in decimal units
return name
Type
Description
outputs
uint256[]
array of the amount of the stablecoin assets redeem function would return

getAssetCount()

function getAssetCount()
Return the number of supported stablecoin assets represented by uint256 type.‌

getAllAssets()

function getAllAssets()
Return all assets addresses of supported stablecoin assets in order represented by uint256 type.‌

getStrategyCount()‌

function getStrategyCount()
Return the number of strategies active on the Vault represented by uint256 type.‌

getAPR()

function getAPR()
Return the total annual percentage yield (APR) of the Vault and all Strategies represented by uint256 type. Resulting number has 18 decimal places.‌

isSupportedAsset()

function isSupportedAsset(address _asset)
Return the boolean that is true if the asset specified by the _asset parameter is supported by the Vault.
Parameter Name
Type
Description
_asset
address
Address of the stablecoin

priceUSDMint()

function priceUSDMint(string symbol)‌‌
Returns the exchange rate price of a stable coin specified by the symbol parameters used when minting OUSD represented by uint256 type. Resulting number has 18 decimal places.
Parameter Name
Type
Description
symbol
string
Symbol of the stablecoin

priceUSDRedeem()

function priceUSDRedeem(string symbol)‌‌
Returns the exchange rate price of a stable coin specified by the symbol parameters used when redeeming OUSD represented by uint256 type. Resulting number has 18 decimal places.
Parameter Name
Type
Description
symbol
string
Symbol of the stablecoin

priceAssetUSDMint()‌

function priceAssetUSDMint(address _asset)‌‌
Returns the exchange rate price of a stable coin specified by the _asset parameters used when minting OUSD represented by uint256 type. Resulting number has 18 decimal places.
Parameter Name
Type
Description
_asset
address
Address of the stablecoin‌

priceAssetUSDRedeem()‌

function priceAssetUSDRedeem(address _asset)‌‌‌
Returns the exchange rate price of a stable coin specified by the _asset parameters used when redeeming OUSD represented by uint256 type. Resulting number has 18 decimal places.
Parameter Name
Type
Description
_asset
address
Address of the stablecoin
Last modified 21d ago