project screenshot 1
project screenshot 2
project screenshot 3

nexus-dai

Locked stablecoins on rollup bridges face capital inefficiency. nexus-DAI enhances efficiency by earning DAI DSR returns on locked DAI. Similar solutions are applicable to other stablecoins like USDC and USDT in rollup bridges

nexus-dai

Created At

ETHGlobal Istanbul

Winner of

Spark - Best use of sDAI 1st Place

Project Description

Problem statement Rollups have had a tremendous growth story over the past 2 years, driven by the rollup-centric roadmap for Ethereum. This has resulted in a large supply of stablecoins getting locked in rollup bridges, which currently amounts to USD 4 Bn. The stablecoins are lying in the bridge contract and can be utilized to generate returns in a secure manner - Crypto-backed stablecoins - DAI DSR for DAI, FRAX/sFRAX contract Fiat stablecoins - Earn US treasury returns Nexus Network: Economic layer for rollups Nexus Network envisions to become the economic layer for rollups. We allow rollups to increase the capital efficiency of the idle assets lying in their bridge contracts, earning stable and consistent returns that can be used by the rollup for the growth of their ecosystem - Covering infrastructure costs for the rollup Public goods funding Ecosystem incentives, etc The assets that Nexus Network is working with are - ETH - Staking on Ethereum chain to earn staking returns Stablecoins - Using stable return contracts for crypto backed stablecoins, US treasury returns for fiat stablecoins The major features offered to rollups by the Nexus Network architecture - Pluggable infrastructure - Rollups can integrate with Nexus Network within a few minutes by calling nexus-dai contracts Customisable Saving Limit - Rollups decide the proportion of DAI in the bridge that is deposited in the DSR contract. The number can be changed in one smart contract call One stop management - Nexus Network does not put any additional responsibility on the rollup team Security-first approach The principles driving the nexus-dai infrastructure design are security, reliability, and decentralization. The aspects of nexus-dai tech stack making it secure are - Non-custodial solution - DAI moves directly from the bridge address to DAI DSR contract and back, never touching the nexus-dai contracts. Thus, the solution is completely non-custodial Ease of unplug - Rollups can unplug from nexus-dai by setting the Saving Limit to 0% How does nexus-dai work? nexus-dai provides a no-hassle product to rollups that they can plug into the rollup bridge and earn continuous revenue. The product has three major components - nexus-dai package for rollup bridges - Rollups include the nexus-dai package in their bridge contracts. This package enables a few functions - Enable transfer of DAI from the bridge to DSR contract Update returns earned by the rollup Allows rollup to claim the earned rewards nexus-dai contracts - nexus-dai contracts register the bridge and automate the flow of DAI such that the amount locked is always within the Saving Limit set by the rollup Off chain bots - These bots are required to communicate between the product components: nexus-dai contracts to rollup bridge contract Rollup registration To start working with nexus-dai, rollups perform a one-time registration. We have simplified the registration process allowing rollups to register through a few package imports and contract calls. These are the steps involved - Importing nexus-dai package in the bridge - Rollup imports nexus-dai package that enables the flow of DAI from the bridge contract to the DAI DSR contract.

Demo: We have imported the nexus-dai package to two rollup bridge contracts (Polygon zkEVM, and Mantle) and deployed on Goerli testnet Whitelisting of rollup admin contract - Rollup team communicates with nexus-dai to whitelist an admin address. This address can be an EOA or a multisig. The whitelisting process happens only after the rollup has imported the nexus-dai package to the bridge Demo: For the demo, we have kept the whitelisting process open so that anyone can whitelist their address as the admin address Registering the rollup on nexus-dai - Once the rollup admin address is whitelisted, it can perform a contract call on nexus-dai contracts to register the rollup. This call includes parameters on the saving limit (this determines the proportion of DAI on the rollup bridge that will be deposited to the DAI DSR contract)

Demo: Admin can put the address of any of the two rollup bridges deployed on Goerli in step 1. It then sets a saving limit and performs the contract call to register the rollup Continuous operations Once the rollup is registered and the saving limit is set, the DAI is moved to the DAI DSR contract where it can earn stable returns. The process works as follows - Rollups define the proportion of DAI on the rollup bridge to be deposited to DAI DSR nexus-dai continuously tracks the bridge balance and deposits DAI accordingly Demo: This is an automated process in the demo Changing Saving Limit Rollups can change the saving limit at any time through a contract call from the admin address. If the saving limit is increased, more DAI is deposited to the DAI DSR contract, or vice versa if the saving limit is reduced Demo: Rollups can change the saving limit using the “Admin View” on UI Unplug from nexus-dai The rollup can unplug from nexus-dai altogether by changing the saving limit to 0%. This will instantly remove all the DAI from DAI DSR contract and return them to the rollup bridge contract Demo: Rollups can change the saving limit using the “Admin View” on UI

How it's Made

To make the project work, following functionalities were developed during hackathon: Contracts: nexus-dai: This contract registers all the bridges that wants to integrate and also helps in managing the bridge functionalities like claiming of rewards and changing saving limits Code: https://github.com/Nexus-2023/nexus-dai/blob/main/contracts/contracts/Nexus.sol Deployed Contract: https://goerli.etherscan.io/address/0x4b3BF56a59E935C6296E84605e6676202348B98b sDAIbridge: this contract is imported by the bridge contracts. It enables them to transfer the %age balance set by them on nexus-dai contract Code: https://github.com/Nexus-2023/nexus-dai/blob/main/contracts/contracts/sDAIBridge.sol Deployed Contract: For testing the system out we deployed in on Mantle bridge. Same integration could be used for any contract containing DAI https://goerli.etherscan.io/address/0xe2B13b61ae85638f01E1BdFefAC02AEbB5b7E003 Mantle Contract Changes: https://github.com/Nexus-2023/nexus-dai/blob/main/contracts/contracts/testBridges/messaging/L1StandardBridge.sol Subgraph: Subgraph is used to query all the events emitted from the contracts and stores a summary of the system. It is used by automation bot to fetch the data Code: https://github.com/Nexus-2023/nexus-dai/tree/main/subgraph-dai Published URL: https://testnet.thegraph.com/explorer/subgraphs/UWbbufqcAnBPYtdnVQAX9nRCv2gFFRpLgEY8UidZ6dK?view=Playground&chain=sepolia Subgraph studio: https://thegraph.com/studio/subgraph/nexus-sdai/playground/

Automation bot: This is used to monitor the bridge contract and trigger the deposit and withdraw of DAI from bridge to sDAI contract whenever there is limit change. Code: https://github.com/Nexus-2023/nexus-dai/blob/main/automation_bot/main.py Frontend: This can be used to interact with the system and have an overview of the integration Code: https://github.com/Nexus-2023/nexus-dai/tree/main/frontend

background image mobile

Join the mailing list

Get the latest news and updates