Technical Protocol Overview
Last updated
Last updated
USDai is an -backed stablecoin. It is primarily used as the on and off ramp to Staked USDai (sUSDai), but may offer other incentives in the future.
Users can mint USDai by depositing a supported stablecoin (e.g. USDC, USDT), which is swapped internally for M.
Users can burn USDai and withdraw a supported stablecoin.
Users can stake USDai to receive sUSDai at the current deposit share price. Staking is a synchronous ERC4626 deposit operation.
Overloads for deposit()
and mint()
are provided with slippage protections for EOAs.
Users can unstake sUSDai to receive USDai at the current redemption share price. Unstaking is an asynchronous ERC7540 redeem operation. Redemptions are subject to a timelock (e.g. 7 days).
The STRATEGY_ADMIN_ROLE
is required for harvesting yield and allocating the USDai asset to and from pools. Currently, these operations are scheduled offchain and executed by a multisig, but in the future will be an onchain strategy with governance-driven parameters.
The net asset value of sUSDai is the combined value of unallocated USDai and the value of its lending pool debt positions. Lending pool debt positions are not guaranteed, as loans may default, so their value can be estimated conservatively (in the case of default and liquidation), or optimistically (in the case of repayment). Loans are assumed to be overcollateralized, so a conservative estimate only includes the principal of loans, while an optimistic estimate includes the principal plus real-time accrued interest of loans. As loans are repaid, the interest is realized and compounded into the principal of newly originated loans.
The deposit share price is computed from the optimistic net asset value, while the redemption share price is computed from the conservative net asset value. In general, the deposit share price is greater than or equal to the redemption share price. If there are no active lending positions, they are equal.
Redemptions in sUSDai are managed with a FIFO queue, subject to a timelock (e.g. 7 days). In the future, the redemption queue will implement a built-in auction to bid on queue position.
Redemptions are serviced periodically by the STRATEGY_ADMIN_ROLE
, as lending positions may need to be unwound to provide sufficient USDai. This is currently scheduled offchain to optimize for latency and capital distribution across the lending pools. Once sufficient USDai is available, the strategy may call serviceRedemptions()
to process redemptions in the queue.
USDai and sUSDai support burn()
/mint()
-style omnichain token transfers. This interface requires the BRIDGE_ADMIN_ROLE
, which is granted to the token messaging contract.
Swap adapters are responsible for swapping in and out of M with supported currencies. Currently, the default swap adapter is the . Swap adapters accept optional data to help facilitate swapping. In the case of the UniswapV3SwapAdapter
, the optional data specifies a path for the swap router to swap tokens that do not have a direct swap market with M.
Staked USDai (sUSDai) is a yield bearing ERC4626 (ERC7540 redeem) vault token that earns yield from USDai M emissions and . USDai can be staked for sUSDai, and later redeemed back for USDai. Unlike USDai, sUSDai is not a stablecoin, but a free floating token, representing shares in an assortment of targeted lending positions and unallocated USDai.
The underlying asset held by the sUSDai vault is USDai, which is deployed and harvested for yield with position managers. The is responsible for harvesting M emissions for the M held in the USDai contract. The is responsible for depositing and withdrawing from MetaStreet pools.
Since the net asset value is denominated in USDai (backed by M), a price oracle is needed to convert the lending pool position value, denominated in the pool currency, back to USDai. provides this interface. The current implementation, , uses Chainlink to price the exchange rate of the lending pool currencies.
Support for LayerZero is available with , which implements the messaging endpoint, and the , which implements an ERC20 of the bridged representation.