Technical Architecture

Sharpe Earn


Sharpe Earn is designed to facilitate the bundling of various DeFi transactions in a no-code environment. Additionally, Sharpe Earn enables users to automate their DeFi positions, further streamlining their DeFi management experience.


1. Wallet Contract

The Wallet Contract is a key component of the Sharpe Earn architecture, providing users with a personalized, secure, and versatile solution for managing their DeFi transactions. Users have full control and ownership over the Wallet Contract, ensuring that they retain exclusive management rights at all times.

The Wallet Contract allows for the consolidation of multiple DeFi transactions into a single, unified transaction, which is not possible when using an Ethereum account (Externally Owned Account, or EOA) alone.

Wallet Contract Flow:

  1. Creation: The user initiates the Wallet Contract creation process by calling the Wallet Registry.

  2. Deployment: A new Wallet Contract is deployed on the blockchain. The contract owner is set to the address of the user who initiated the creation (msg.sender). This information is then stored in the Wallet Registry Contract.

  3. DeFi Transactions: All subsequent DeFi transactions are executed via the Wallet Contract. This process requires two inputs: the address of the Assembly Contract and the call data specifying the target DeFi contract's function to execute.

With Sharpe Earn's innovative architecture, users can efficiently manage their DeFi transactions and positions while maintaining full control and ownership of their contracts. This makes it an ideal solution for individuals and organizations looking to streamline their DeFi operations.

2. Assembly

An Assembly is a collection of DeFi transactions that are grouped and executed sequentially in a specific order. These transactions are designed to work in tandem, with the ability to share return values that can be utilized as inputs for subsequent transactions within the Assembly.


Consider a user who wants to create a 3x leveraged wrapped staked Ether (WstETH) position on Aave v3. They can create an Assembly that encompasses all required transactions to achieve this position in a single, unified transaction. The following DeFi transactions must be executed in sequence to create a 3x leveraged WstETH position on Aave v3:

  1. Flash borrow 2x WETH from Aave v3

  2. Wrap x ETH

  3. Swap 3x WETH to WstETH

  4. Activate Aave v3 E-mode

  5. Supply the swapped WstETH on Aave v3

  6. Borrow 2x WETH from Aave v3

  7. Repay the 2x WETH flash loan

These DeFi transactions are grouped and executed sequentially via the AssemblyExecutor contract, allowing the user to efficiently create an Assembly of DeFi transactions and execute them in a single transaction.

By utilizing Assemblies in Sharpe Strategies, users can optimize their DeFi management experience and effectively streamline complex DeFi operations. This approach allows for increased efficiency and flexibility.

3. Sharpe Automation

Sharpe Automation is an innovative and powerful feature that brings enhanced efficiency and responsiveness to the DeFi management experience. By leveraging the power of smart contracts, Sharpe Automation allows users to execute Assemblies automatically based on specific pre-defined conditions. This can be thought of as a customizable if-this-then-that mechanism for DeFi transactions.

Automation consists of two main components:

  1. Array of Alerts: These are the pre-defined conditions that must be satisfied for the Automation to trigger. Alerts are monitored through Alert Contracts, which check whether the conditions have been met.

  2. Assembly: A sequence of DeFi transactions that is executed when all specified alert conditions are satisfied.

Chainlink bots play a crucial role in executing automation by continuously monitoring the alert conditions and triggering the associated Assembly when the conditions are met.

Consider a user with a leveraged position on Aave v3 who wants to mitigate the risk of liquidation by automatically repaying borrowed assets when their position's health factor reaches a certain threshold.

To achieve this, the user can create a Sharpe Automation with the following components:

  1. Alert: Utilizing an Alert Contract, the user defines a condition that monitors the health factor of their Aave v3 position. The condition might state that if the health factor falls below a specific value (e.g., 1.5), the Automation (in this case - a partial liquidation) should be triggered.

  2. Assembly: The user creates an Assembly that consists of DeFi transactions required to repay the borrowed assets. These transactions might include swapping collateral for the borrowed asset, repaying the borrowed asset on Aave v3, and updating the user's position.

With the Sharpe Automation in place, the Chainlink bots will continuously monitor the user's Aave v3 position's health factor. If the health factor drops below the defined threshold, the bots will automatically execute the Assembly, repaying the borrowed assets and mitigating the risk of liquidation.

This approach is akin to a safety net, where the Automation acts as a safeguard against potentially unfavorable market conditions, enabling users to maintain their DeFi positions without constant manual intervention.

By incorporating Sharpe Automation into the Sharpe Earn ecosystem, users can enjoy a highly flexible, efficient, and automated DeFi management experience that allows them to focus on their broader DeFi strategies and adapt more effectively to the rapidly evolving DeFi landscape and unlock move use-cases as more primitives are integrated.

4. Alert Contract

The Alert Contract is a pivotal component within the Sharpe Earn ecosystem, designed to monitor and verify if specific conditions have been fulfilled. Acting as a vigilant sentinel, Alert Contracts play a crucial role in enabling Sharpe Automation to function effectively and responsively, allowing users to automate their DeFi management experience based on pre-defined criteria.

Alert Contracts can be thought of as the eyes of the Sharpe Automation system, constantly monitoring DeFi contracts for any changes that may trigger a corresponding Assembly execution. (More details on Bot contracts and their technical architecture will be released soon as we get ready to launch Earn on the Mainnet.)

Consider a user who wants to take advantage of a pairs trading arbitrage opportunities between two decentralized exchanges. They could define an alert condition that monitors the price difference between the two DEXes for a specific trading pair.

  1. Tracks the prices of the trading pair on both DEXes.

  2. Compares the price difference against a pre-defined threshold that makes the arbitrage opportunity worthwhile (e.g., a price difference of 1% or more).

The role of the Alert Contract in the Sharpe Earn ecosystem can be compared to that of a thermostat in a climate control system. Just as a thermostat continuously monitors the room temperature and activates the heating or cooling system when the temperature deviates from the set point, the Alert Contract constantly checks the specified conditions on the blockchain. When the Alert Contract detects that the pre-defined conditions have been met, it triggers the associated Sharpe Automation, which executes the Assembly to perform the desired DeFi transactions.

5. DeFi Transaction Contract

The DeFi Transaction Contract is a vital component in the Sharpe Earn architecture, engineered to streamline and optimize the execution of individual DeFi transactions. By providing a modular and flexible solution, DeFi Transaction Contracts enable seamless integration with other elements of the Sharpe Earn ecosystem, ensuring a smooth and efficient UX for the end user.

Each DeFi Transaction Contract is specifically designed to execute a particular DeFi transaction, such as supplying assets to Aave or swapping tokens on a decentralized exchange. These contracts serve as individual building blocks, allowing users to mix and match them to create complex, multi-step transaction sequences known as Assemblies.

DeFi Transaction Contracts are implemented as logic contracts that are invoked via the Wallet Contract. They do not hold any state, which means they only execute the specified transaction without storing or managing any additional information. This design allows for the efficient execution of transactions while minimizing the risk of unintended consequences.

DeFi Transaction Contracts in the Sharpe Earn ecosystem can be thought of as individual building blocks, much like LEGO bricks in a building set. Each LEGO brick serves a specific purpose and can be connected in various ways to create an array of structures. Similarly, DeFi Transaction Contracts are designed to execute specific DeFi transactions and can be combined in different sequences to create customized Assemblies.

Imagine a user who wants to create an Assembly to achieve the following objectives:

  1. Supply assets to Aave v3

  2. Borrow a different asset from Aave v3

  3. Swap the borrowed asset for another token on a decentralized exchange

In this case, the user would use three separate DeFi Transaction Contracts, each responsible for a specific step of the Assembly. By connecting these contracts together, the user can form a cohesive sequence that achieves their desired outcome.

Integrating DeFi Transaction Contracts into the Sharpe Earn architecture allows users to enjoy a modular and adaptable DeFi management experience. They can create customized Assemblies that cater to their unique strategies and objectives.

Last updated