# Table of Contents - [Contract Addresses | USD.AI](#contract-addresses-usd-ai) - [Technical Protocol Overview | USD.AI](#technical-protocol-overview-usd-ai) - [Audits | USD.AI](#audits-usd-ai) --- # Contract Addresses | USD.AI [](https://docs.usd.ai/technical-overview/contract-addresses#arbitrum) Arbitrum ------------------------------------------------------------------------------------ Contract Address USDai [0x0A1a1A107E45b7Ced86833863f482BC5f4ed82EF](https://arbiscan.io/address/0x0A1a1A107E45b7Ced86833863f482BC5f4ed82EF) sUSDai [0x0B2b2B2076d95dda7817e785989fE353fe955ef9](https://arbiscan.io/address/0x0B2b2B2076d95dda7817e785989fE353fe955ef9) USDai OAdapter [0xffA10065Ce1d1C42FABc46e06B84Ed8FfEb4baE5](https://arbiscan.io/address/0xffA10065Ce1d1C42FABc46e06B84Ed8FfEb4baE5) sUSDai OAdapter [0xffB20098FD7B8E84762eea4609F299D101427f24](https://arbiscan.io/address/0xffB20098FD7B8E84762eea4609F299D101427f24) USDai and sUSDai are available as LayerZero OFTs on other EVM chains at the same addresses as above. Last updated 5 months ago --- # Technical Protocol Overview | USD.AI ### [](https://docs.usd.ai/technical-overview/technical-protocol-overview#usdai) USDai USDai is an [$M](https://www.m0.org/) \-backed stablecoin. It is primarily used as the on and off ramp to Staked USDai (sUSDai), but may offer other incentives in the future. #### [](https://docs.usd.ai/technical-overview/technical-protocol-overview#minting) Minting Users can mint USDai by depositing a supported stablecoin (e.g. USDC, USDT), which is swapped internally for M. Copy /** * @notice Deposit * @param depositToken Deposit token * @param depositAmount Deposit amount * @param usdaiAmountMinimum Minimum USDai amount * @param recipient Recipient * @param data Data (for swap adapter) * @return USDai amount */ function deposit( address depositToken, uint256 depositAmount, uint256 usdaiAmountMinimum, address recipient, bytes calldata data ) external returns (uint256); ![](https://docs.usd.ai/~gitbook/image?url=https%3A%2F%2F81871421-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F1xUmTJppLJHObr52ucZQ%252Fuploads%252Fwu8QBPF12TJvg1JYTtP4%252FTechnical%2520Overview%2520Docs%252010.svg%3Falt%3Dmedia%26token%3Dc34e9845-5fca-4d71-b265-2c1e5c20a727&width=768&dpr=4&quality=100&sign=4414d390&sv=2) #### [](https://docs.usd.ai/technical-overview/technical-protocol-overview#burning) Burning Users can burn USDai and withdraw a supported stablecoin. Copy /** * @notice Withdraw * @param withdrawToken Withdraw token * @param usdaiAmount USD amount * @param withdrawAmountMinimum Withdraw amount minimum * @param recipient Recipient * @param data Data (for swap adapter) * @return Withdraw amount */ function withdraw( address withdrawToken, uint256 usdaiAmount, uint256 withdrawAmountMinimum, address recipient, bytes calldata data ) external returns (uint256); ![](https://docs.usd.ai/~gitbook/image?url=https%3A%2F%2F81871421-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F1xUmTJppLJHObr52ucZQ%252Fuploads%252FnxtS2wOA2wkiGxcscDqH%252FTechnical%2520Overview%2520Docs%25202.svg%3Falt%3Dmedia%26token%3D699c79fd-6968-43f1-b15d-4cf50db0ed62&width=768&dpr=4&quality=100&sign=d713f10c&sv=2) #### [](https://docs.usd.ai/technical-overview/technical-protocol-overview#swap-adapters) Swap Adapters Swap adapters are responsible for swapping in and out of M with supported currencies. Currently, the default swap adapter is the [`UniswapV3SwapAdapter`](https://github.com/metastreet-labs/metastreet-usdai-contracts/tree/main/src/swapAdapters/UniswapV3SwapAdapter.sol) . 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. ### [](https://docs.usd.ai/technical-overview/technical-protocol-overview#susdai) sUSDai Staked USDai (sUSDai) is a yield bearing ERC4626 (ERC7540 redeem) vault token that earns yield from USDai M emissions and [MetaStreet Pool loans](https://docs.metastreet.xyz/liquidity-layer/overview) . 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. #### [](https://docs.usd.ai/technical-overview/technical-protocol-overview#staking) Staking Users can stake USDai to receive sUSDai at the current deposit share price. Staking is a synchronous ERC4626 deposit operation. Copy function deposit(uint256 assets, address receiver) external returns (uint256 shares); function mint(uint256 shares, address receiver) external returns (uint256 assets); Overloads for `deposit()` and `mint()` are provided with slippage protections for EOAs. ![](https://docs.usd.ai/~gitbook/image?url=https%3A%2F%2F81871421-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F1xUmTJppLJHObr52ucZQ%252Fuploads%252FLRkYnOuwImXf3Fg0akkw%252FTechnical%2520Overview%2520Docs%25203.svg%3Falt%3Dmedia%26token%3Dca3098c7-7646-48af-9425-3a83f6efb7bc&width=768&dpr=4&quality=100&sign=e7fde721&sv=2) #### [](https://docs.usd.ai/technical-overview/technical-protocol-overview#unstaking) Unstaking 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). Copy function requestRedeem(uint256 shares, address controller, address owner) external returns (uint256 requestId); function redeem(uint256 shares, address receiver, address owner) external returns (uint256 assets); function withdraw(uint256 assets, address receiver, address owner) external returns (uint256 shares); ![](https://docs.usd.ai/~gitbook/image?url=https%3A%2F%2F81871421-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F1xUmTJppLJHObr52ucZQ%252Fuploads%252Fpwx3AzutZBGFZvDcwa4q%252FTechnical%2520Overview%2520Docs%25204.svg%3Falt%3Dmedia%26token%3Dd84d7448-9080-487e-a76c-d9a3a94703e7&width=768&dpr=4&quality=100&sign=d63edcf0&sv=2) ![](https://docs.usd.ai/~gitbook/image?url=https%3A%2F%2F81871421-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F1xUmTJppLJHObr52ucZQ%252Fuploads%252FcrYgZ7k4DPRx9JiVQmHN%252FTechnical%2520Overview%2520Docs%25205.svg%3Falt%3Dmedia%26token%3Db0b3991d-962d-45e7-92a6-e28ae107578a&width=768&dpr=4&quality=100&sign=1b8e777&sv=2) #### [](https://docs.usd.ai/technical-overview/technical-protocol-overview#position-managers) Position Managers The underlying asset held by the sUSDai vault is USDai, which is deployed and harvested for yield with position managers. The [`BasePositionManager`](https://github.com/metastreet-labs/metastreet-usdai-contracts/tree/main/src/positionManagers/BasePositionManager.sol) is responsible for harvesting M emissions for the M held in the USDai contract. The [`PoolPositionManager`](https://github.com/metastreet-labs/metastreet-usdai-contracts/tree/main/src/positionManagers/PoolPositionManager.sol) is responsible for depositing and withdrawing from MetaStreet pools. 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. #### [](https://docs.usd.ai/technical-overview/technical-protocol-overview#admin-fee) Admin Fee Admin fees are collected from loan repayments, as a fixed percentage of the total interest of the loan. Only successfully repaid loans contribute admin fees. In the case of a defaulted loan, the admin fee is used to offset liquidation losses. Admin fees are set to 10% for the time being. They can be managed through a governance process in the future to accrue fees to the protocol. Copy /** * @notice Harvest yield from base token * @param usdaiAmount USDai amount */ function harvestBaseYield( uint256 usdaiAmount ) external; ![](https://docs.usd.ai/~gitbook/image?url=https%3A%2F%2F81871421-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F1xUmTJppLJHObr52ucZQ%252Fuploads%252FMCrpDBHClhDTPC1BpiJH%252FTechnical%2520Overview%2520Docs%25206.svg%3Falt%3Dmedia%26token%3D82564142-6ca4-4650-8de1-9bf60d8b06e1&width=768&dpr=4&quality=100&sign=e39a585b&sv=2) Copy /** * @notice Deposit assets into a pool * @param pool Address of the pool * @param tick Pool tick * @param usdaiAmount Amount of USDai to deposit * @param poolCurrencyAmountMinimum Minimum amount of pool currency to deposit * @param minShares Minimum shares expected * @param data Data (for swap adapter) * @return shares Amount of shares received */ function poolDeposit( address pool, uint128 tick, uint256 usdaiAmount, uint256 poolCurrencyAmountMinimum, uint256 minShares, bytes calldata data ) external returns (uint256 shares); ![](https://docs.usd.ai/~gitbook/image?url=https%3A%2F%2F81871421-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F1xUmTJppLJHObr52ucZQ%252Fuploads%252F9jkFOyb5lIQlLRWSceJZ%252FTechnical%2520Overview%2520Docs%25207.svg%3Falt%3Dmedia%26token%3D1213ac6d-d237-4fde-8d4c-e298462bcdec&width=768&dpr=4&quality=100&sign=3af247c5&sv=2) Copy /** * @notice Withdraw assets from a pool after redemption * @param pool Address of the pool * @param tick Pool tick * @param redemptionId ID of the redemption * @param poolCurrencyAmountMaximum Maximum amount of pool currency to withdraw * @param usdaiAmountMinimum Minimum amount of USDai to withdraw * @param data Data (for swap adapter) * @return USDai amount */ function poolWithdraw( address pool, uint128 tick, uint128 redemptionId, uint256 poolCurrencyAmountMaximum, uint256 usdaiAmountMinimum, bytes calldata data ) external returns (uint256); ![](https://docs.usd.ai/~gitbook/image?url=https%3A%2F%2F81871421-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F1xUmTJppLJHObr52ucZQ%252Fuploads%252FI3Mhoipy42OaonmbbUQK%252FTechnical%2520Overview%2520Docs%25208.svg%3Falt%3Dmedia%26token%3Dc93d1e8f-132c-4ff9-9ed7-11055a829709&width=768&dpr=4&quality=100&sign=8b22f88&sv=2) #### [](https://docs.usd.ai/technical-overview/technical-protocol-overview#share-pricing) Share Pricing 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. 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. [`IPriceOracle`](https://github.com/metastreet-labs/metastreet-usdai-contracts/tree/main/src/interfaces/IPriceOracle.sol) provides this interface. The current implementation, [`ChainlinkPriceOracle`](https://github.com/metastreet-labs/metastreet-usdai-contracts/tree/main/src/oracles/ChainlinkPriceOracle.sol) , uses Chainlink to price the exchange rate of the lending pool currencies. Copy /** * @notice Check if token is supported * @param token Token * @return True if token is supported, false otherwise */ function supportedToken( address token ) external view returns (bool); /** * @notice Get price of token in terms of USDai * @param token Token */ function price( address token ) external view returns (uint256); #### [](https://docs.usd.ai/technical-overview/technical-protocol-overview#redemption-queue) Redemption Queue 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. Copy /** * @notice Service pending redemption requests * @param shares Shares to process * @return Amount processed */ function serviceRedemptions( uint256 shares ) external returns (uint256); ### [](https://docs.usd.ai/technical-overview/technical-protocol-overview#omnichain-support) Omnichain Support 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. Support for LayerZero is available with [`OAdapter`](https://github.com/metastreet-labs/metastreet-usdai-contracts/tree/main/src/omnichain/OAdapter.sol) , which implements the messaging endpoint, and the [`OToken`](https://github.com/metastreet-labs/metastreet-usdai-contracts/tree/main/src/omnichain/OToken.sol) , which implements an ERC20 of the bridged representation. Last updated 3 months ago --- # Audits | USD.AI [](https://docs.usd.ai/technical-overview/audits#usd.ai) USD.AI -------------------------------------------------------------------- Bug Bounty: [https://cantina.xyz/bounties/32e64f2e-5f01-4a0b-bbe3-76f32c17b99f](https://cantina.xyz/bounties/32e64f2e-5f01-4a0b-bbe3-76f32c17b99f) 298KB [ktl Audit Report (05-14-2025).pdf](https://81871421-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1xUmTJppLJHObr52ucZQ%2Fuploads%2FXCnvudUGFCQEq94cMun5%2Fktl%20Audit%20Report%20(05-14-2025).pdf?alt=media&token=7b74f2cd-309e-4e15-9619-ab5e89c9480d) PDF Download[Open](https://81871421-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1xUmTJppLJHObr52ucZQ%2Fuploads%2FXCnvudUGFCQEq94cMun5%2Fktl%20Audit%20Report%20(05-14-2025).pdf?alt=media&token=7b74f2cd-309e-4e15-9619-ab5e89c9480d) 660KB [Cantina Audit Report (05-12-2025).pdf](https://81871421-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1xUmTJppLJHObr52ucZQ%2Fuploads%2F6xpynhn1hsYrTujTnfiF%2FCantina%20Audit%20Report%20(05-12-2025).pdf?alt=media&token=1cf53fbe-3e45-4860-84bc-95d14f89862d) PDF Download[Open](https://81871421-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1xUmTJppLJHObr52ucZQ%2Fuploads%2F6xpynhn1hsYrTujTnfiF%2FCantina%20Audit%20Report%20(05-12-2025).pdf?alt=media&token=1cf53fbe-3e45-4860-84bc-95d14f89862d) [](https://docs.usd.ai/technical-overview/audits#metastreet) MetaStreet ---------------------------------------------------------------------------- Bug Bounty: [https://immunefi.com/bug-bounty/metastreet/information/](https://immunefi.com/bug-bounty/metastreet/information/) 525KB [Cantina Audit Report (04-30-2024).pdf](https://81871421-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1xUmTJppLJHObr52ucZQ%2Fuploads%2FKF3bJrCMvf8sDtICcSCk%2FCantina%20Audit%20Report%20(04-30-2024).pdf?alt=media&token=996faa47-6e24-4c89-bedf-9d94acfc0183) PDF Download[Open](https://81871421-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1xUmTJppLJHObr52ucZQ%2Fuploads%2FKF3bJrCMvf8sDtICcSCk%2FCantina%20Audit%20Report%20(04-30-2024).pdf?alt=media&token=996faa47-6e24-4c89-bedf-9d94acfc0183) 518KB [Cantina Audit Report (11-25-2023).pdf](https://81871421-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1xUmTJppLJHObr52ucZQ%2Fuploads%2FC1SYt1QaI4CCGnRAwSge%2FCantina%20Audit%20Report%20(11-25-2023).pdf?alt=media&token=7bce8ae3-b61f-4928-b750-2a2556290cc5) PDF Download[Open](https://81871421-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1xUmTJppLJHObr52ucZQ%2Fuploads%2FC1SYt1QaI4CCGnRAwSge%2FCantina%20Audit%20Report%20(11-25-2023).pdf?alt=media&token=7bce8ae3-b61f-4928-b750-2a2556290cc5) 518KB [Cantina Audit Report (10-03-2023).pdf](https://81871421-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1xUmTJppLJHObr52ucZQ%2Fuploads%2FwbAO7ySfXhBwhcKLdulI%2FCantina%20Audit%20Report%20(10-03-2023).pdf?alt=media&token=db084f0a-92de-43b8-86a3-6617a17b401f) PDF Download[Open](https://81871421-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1xUmTJppLJHObr52ucZQ%2Fuploads%2FwbAO7ySfXhBwhcKLdulI%2FCantina%20Audit%20Report%20(10-03-2023).pdf?alt=media&token=db084f0a-92de-43b8-86a3-6617a17b401f) 699KB [Cantina Audit Report (06-22-2023).pdf](https://81871421-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1xUmTJppLJHObr52ucZQ%2Fuploads%2FVs0JKkeVMqM9YtatrrDi%2FCantina%20Audit%20Report%20(06-22-2023).pdf?alt=media&token=929eebfc-69ef-4d3f-8011-4f35c76686e8) PDF Download[Open](https://81871421-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1xUmTJppLJHObr52ucZQ%2Fuploads%2FVs0JKkeVMqM9YtatrrDi%2FCantina%20Audit%20Report%20(06-22-2023).pdf?alt=media&token=929eebfc-69ef-4d3f-8011-4f35c76686e8) Last updated 4 months ago ---