Sharpe Earn Architecture
Last updated
Last updated
Smart Account: The Smart Account (DSProxy) is both created and owned solely by the user, with all management responsibilities resting solely in the user's hands. This ensures that you maintain complete ownership of the contract at all times. By utilizing a Smart Account, it becomes possible to combine multiple transactions for decentralized finance (defi) operations into a single transaction. This is not achievable when relying solely on an Ethereum account, also known as an Externally Owned Account (EOA).
Assembly: An Assembly is a set of Defi transactions that are grouped together and executed in one order. These transactions are designed to work together and can even share return values, which can then be used as inputs for subsequent transactions within the Assembly. Example: Let’s say the user want to create a leveraged WstETH position on AaveV3, then the user can make an assembly of all the transaction that is required to create this position in one transaction. Below is a list of Defi transactions required to be executed in sequence to create leveraged WstETH position on AaveV3 in one transaction (consider 3x leverage):
So Defi transactions are grouped together and they are executed in sequence via AssemblyExecutor contract. This is how a user can make an assembly of defi transactions and execute them in one transaction.
Defi transaction: This contract is designed to execute a particular defi transaction, such as Aave supply, DEX swap,etc. These Defi transactions are implemented as logic contracts that are invoked via a Smart Account and do not hold any state.
Sharpe Earn Registry contract: The Sharpe Earn Registry contract serves as a central registry for managing contract addresses within the Earn smart contract ecosystem. This contract is designed to provide flexibility and timelock mechanisms for managing contract changes, enhancing the security and reliability of the smart contract ecosystem.
Proxy Registry Contract:
The ProxyRegistry
contract is used in the Sharpe Earn smart contract ecosystem to manage and deploy proxy instances (specifically, Smart Account). These proxy instances can be associated with different users or owners, and the ProxyRegistry
contract keeps track of these associations.
Transaction No.
Defi transaction
1
Flash borrow 2x WETH from Aave v3
2
Wrap x ETH
3
Swap 3x WETH to WstETH
4
Activate AaveV3 E-mode
5
Supply the swapped WstETH on AaveV3
6
Borrow 2x WETH from AaveV3
7
Pay the 2x WETH flashloan borrowed