project screenshot 1
project screenshot 2
project screenshot 3
project screenshot 4
project screenshot 5

Omni-sDAI

Making sDAI (from SparkDAO) multichain using UMA. Users can deposit DAI, USDC, ETH and get access to Maker's DAI savings rate via Spark on their host chains starting with Scroll.

Omni-sDAI

Created At

ETHOnline 2023

Winner of

trophy

🏊‍♂️ UMA - Best Use

trophy

🥉 Spark — Best use of sDAI 💸

trophy

🏊 Scroll — Pool Prize

Project Description

This project enables users to access MakerDAO's DSR on Scroll by making sDAI (from SparkDAO) multichain using UMA's optimistic oracle. It also enables users on Mainnet to deposit into the sDAI vault using a token of their choice without being restricted to Dai only.

sDAI is an ERC-4626 vault on mainnet that gives access to the Dai savings rate. This vault only accepts Dai as a deposit and is only available on Mainnet.

Using UMA's Optimistic Oracle and external relayers, we can access the vault from any chain if necessary deployments have been made. In this case, I have deployed it to Scroll, but it could be deployed to any chain with minor modifications.

Moreover, only Dai can be deposited in the sDai vault, restricting users who don't have Dai from participating. I built a sort of Multicall contract that enables users to deposit USDC, WETH etc and receive sDai.

How it's Made

Cross-chain communication and relaying are enabled through UMA's optimistic oracle system. Relayers Fill and Assert users' deposits and withdrawals using DataAssertion contracts. A user takes less than a minute to get their deposit/withdrawal request fulfilled as relayers do most of the work, and dispute mechanisms handle fraud cases.

Here's what a deposit flow would look like:

  1. User Deposit wrappedDai on Scroll into the ScrollSavingsDai contract.
  2. Relayer catches the deposit event and immediately fills the request by depositing Dai on mainnet and locking the received sDai into a pool.
  3. The Relayer asserts to the oracle that the request has been filled.
  4. On truthful resolution of the assertion, the oracle mints wrapped sDai on Scroll to the user.
  5. The relayer is reimbursed using the deposited wDai when it requests a reimbursement.

Here's what a withdrawal flow would look like:

  1. User deposit wrapped sDai in the ScrollSavingsDai contract and request a withdrawal to wrappedDai.
  2. Relayer catches the withdrawal request and asserts it to the oracle on mainnet.
  3. On resolution, the oracle withdraws Dai from the mainnet sDai vault and locks the Dai on mainnet.
  4. Upon catching this lock event, the relayer fills the withdrawal request by sending the user wDai equivalent to what was received from the vault on mainnet.
  5. Relayer asserts to the oracle that the request has been fulfilled.
  6. On truthful resolution, the reimbursement is available to the relayer.

Lastly, on Mainnet, users can deposit any token into the vault as the middleware (MultiCall.sol) contract takes the deposit in any token, swaps it to Dai via Uniswap-v3 router and deposits Dai into the sDai vault and sends the sDai to the user in one transaction.

For a more detailed explanation, please take a look at the README.md and the tests (DepositFlow.t.sol and WithdrawalFlow.t.sol).

background image mobile

Join the mailing list

Get the latest news and updates