Vault
The Vault module handles the storage and management of ERC20 backing assets (i.e. USDC, USDT) and CAP tokens (cUSD). Each CAP VaultStorage stores and manages multiple backing assets for one CAP token, including bookkeeping information such as supply, borrow, and utilization of each asset.
The vault serves different purposes for different actors. It serves as a Price Stability Module for LPs to mint/burn/redeem CAP tokens. Simultaneously, the vault functions as a source of liquidity for Agents to borrow from the backing assets.
Main parameters:
PSM
The Vault contract is the main LP-facing contract to mint/burn/redeem CAP tokens for backing assets. The objective for the PSM is to ensure that 1. the price of cUSD and the distribution of backing assets remain stable and 2. loss is socialized in the case of a black swan event. Its functions for Mint/Burn, Fees and Redeem are akin to that of the Transmuter.
Mint/Burn
cUSD issued through the Vault can be minted at oracle value from any of the assets, and it can be burnt for any asset at the price of the asset with the largest deviation from the peg. The getPrice function will call the relevant Adapter (i.e. Chainlink) in the PriceOracle to fetch the prices. If prices are stale, i.e. they are not up-to-date with the current time, the mint/burn function should be disabled until the oracle is back in sync. Dynamic fees are used to rebalance the ratio of assets.
Dynamic Fees
Fees are dynamically adjusted in the Minter contract according to the exposure of assets in the system to incentivize optimal distribution. Specifically, for each asset, there is a predefined piecewise linear function with two slopes along with an optimal ratio to determine the mint/burn fees. As can be seen in the example diagram below, fees are 0 up until the optimal ratio is reached, and then increases along the first slope as the current ratio deviates from the target, increasing sharply along the second slope beyond the kink threshold.
Last updated