Vaultsact as collateral adapters by standardizing how other contracts of the system and users interact with those types of assets within the system, since these assets can come in the form of ERC721, ERC1155 or ERC20 tokens. FIAT classifies them via the
vaultTypeproperty which is an identifier describing the token standard used by the fixed income asset followed by a shorthand of the assets originating protocol.
Codex. After a successful deposit or withdrawal the users
balancesare updated within
Codex. A user is now able to use their deposited assets to collateralize a new $FIAT position via
Codexwill call back into the corresponding Vault to fetch the current
fairPriceto determine the new
LTV(loan-to-value) ratio of the position to ensure that the position is collateralized.
ModifyCollateralAndDebt. This will only succeed if the collateral-to-loan ratio of the Position is still safe after the transfer. Users will have to repay a portion or all of their outstanding debt to be able to do so. After the internal collateral transfer from their Position to their internal balance (
balances) they are able to call exit on the respective Vault.