project screenshot 1
project screenshot 2
project screenshot 3

AztecLend

AztecLend allows for private lending operations to DeFi lending protocol, such as Spark and Compound from Aztec, a private zk-rollup.

AztecLend

Created At

ETHOnline 2023

Project Description

AztecLend allows private lending operations to DeFi lending protocol, such as Spark(Savings DAI) and Compound from Aztec, a private zk-rollup.

AztecLend contract on Aztec L2 acts like a strategy vault that receives deposits, bridges the token, and has the AztecLend contract on L1 execute a requested strategy.

Users can receive/redeem wrapped share tokens, such as sDAI, cUSDC, and aWETH, directly from Aztec bridge on L2 in a private(optional) manner.

How it's Made

This project is built on Aztec Sandbox, a local developer environment recently launched by Aztec, a private zk-rollup. We deployed AztecLend contracts with deposit functions that receive user funds, bridge them to our AztecLendPortal contract on L1 via L2 bridges and L1 token portal contracts, and let it carry out deposits to DeFi protocols on L1.

Within the same execution, the share token issued against the deposit is returned to L2 and directly sent back to the user who deposited. More specifically, the L2 bridge contract shields the wrapped share token, allowing the user to unshield it later. All of this is done in a private fashion because of the hybrid, customizable public and private state model that Aztec zk-rollup brought to the table.

Our contract implementations and tests are mostly based on the end-to-end uniswap-trade test example built by the Aztec team: https://github.com/AztecProtocol/aztec-packages/blob/master/yarn-project/end-to-end/src/uniswap_trade_on_l1_from_l2.test.ts. However, we managed to build react typescript frontend app on top of it by leveraging several Aztec packages, primarily aztec.js.

In general, handling several types of contracts/tokens across two different networks for building a frontend app was quite challenging, let alone it'd be even trickier when packages are pretty new and rapidly changing. That said, we didn't encounter any significant obstacle this time as well-functioning examples are available and aztec-packages are quite stable: the versions of all the Aztec packages are synced well.

background image mobile

Join the mailing list

Get the latest news and updates