Optimizing Asset Allocation in DeFi: Giza's Approach

Giza has developed a complete framework designed to take asset allocation in DeFi to new heights.

Nov 8, 2023

Case study

Case study

Case study

Introduction

In contrast to traditional finance (tradFi), where opacity often shrouds the internal workings of interest rate setting mechanisms and financial products, the world of decentralized finance (DeFi) operates on a different principle—transparency.

This complete disclosure of the rules of the game creates a unique opportunity to address a difficult challenge: asset optimization. By comprehensively understanding the underlying rules and functions, there arises the possibility of applying advanced strategies to maximize returns in this emerging financial landscape. In this context, Giza has developed a complete framework designed to take asset allocation in DeFi to new heights.

The Asset Allocation Problem

The core objective of any token distribution abstraction within DeFi protocols, be it vaults, aggregators, or other mechanisms, is to adeptly solve for the asset allocation problem. Given the context, the allocation process could maximize APY for lenders, increase the total borrowed in subsequent timeframes, or minimize risk. These architectures are built on a framework that ensures transparency into the operational formulas—such as interest rates and APY—enables the strategic re-allocation of assets among various pools or silos and provides clear parameters for each underlying entity. 

Until recently, the approach to distribution within these systems has been relatively rudimentary and lacked the capability for dynamic adjustment. With the integration of Zero-Knowledge computations, there is a shift towards employing sophisticated, real-time optimization algorithms that can solve the asset allocation equation in a multitude of DeFi contexts.

Giza's Framework: A Deep Dive

To comprehend the intricacies of this framework, let's dissect it into two primary elements: strategy proposed by Giza as the optimal solution to the asset allocation problem and the game simulator as a tool to quantify the performance of different asset allocation strategies.

Game Simulator

Currently, in the Defi world, there are no protocols that have the ability to discriminate or operate differentially across wallets. This fact makes it almost impossible to use techniques that allow measuring the performance of a new solution with respect to the existing one with certain accuracy (i.e A/B testing). For this reason, having a space for concurrent comparison of the performance of different strategies in an environment that simulates the operation of a lending protocol can help significantly in the decision making process.

From this concept, our game simulator emerges, featuring the following elements:

Silo : Taking this name from the Frax protocol, a Silo is defined as a decentralized and permissionless lending protocol that allows for the creation of risk-isolated markets.  Each silo has a parameterizable interest function, stores the state of the number of available and borrowed tokens, the type of accepted token, the maximum number of tokens allowed, and offers functions for rapid state updates. It can provide any information related to its current state.

Vaults: A vault, understood as an object in charge of performing allocations,  has information about all silos simultaneously, offers functionality such as knowing the total APY obtained after an allocation, the list of available silos, or the total liquidity available across all silos.

Optimizers: Each optimizer must decide, given an event in the protocol, what allocation within the constraints of the problem is optimal.

Events: What can a user do in the protocol? Examples of events can be; lend, borrow or create custom silos.

Taking all these elements into account, our game simulator defines the event space a user can take within a protocol (e.g., deposit, borrow, or create a new silo).  Next, N of these events are generated, and each optimizer determines the optimal allocation. The "game" stores both intermediate results after each optimization and the overall result.

Giza Asset Allocation Optimization

The optimizer proposed by Giza offers the following advantages:

  • Engineered with specific adaptations for working with stepwise functions (All the interest rate functions have this type of properties).

  • Finds the global maximum of the optimization function as it is a deterministic solution and not heuristic.

  • The protocol using this optimizer remains trust-minimized, as each new allocation is verified using zk proofs.

Giza optimizer vs Naive Optimizer

In order to test our framework for optimizing asset allocation, we need to compare it against a benchmark. A good way to do that is by using Naive Optimization as reference.

Below we detail the components implemented to simulate this game:

  • Underlying interest rate functions for each silo: These functions are simplified and do not take into account the time, only the utilization rate. For this example, we are going to use the linear rate function described in the Frax documentation.

  • Objective: to maximize lenders’ APY

  • Optimizers: In the simulator we compare two optimizers. The first optimizer, which we’ll refer to as “the Naive optimizer”  allocates all the tokens deposited by a new lender to the silo with the highest APY at that time. The second, the Giza optimizer, distributes these tokens among all the available silos.

The game follows these rules:

  • 10 silos are created, each having its unique interest rate function.

  • The events that the game allows are: depositing tokens or withdrawing tokens.

  • 15 events are generated during the course of the game ( 300 USDC lended, 100 USDC borrowed in Silo 3 etc.)

  • After each event both optimizers make decisions, the resulting APY obtained after that decision, as well as the total APY after the end of the game is saved.

The following first two graphs show the allocation made by each optimizer in response to each game event. The latter graph shows the cumulative % APY achieved  by the Giza strategy compared to the naive optimization strategy.

The results are striking: Giza’s optimizer, when compared to the conventional approach, delivered an average improvement of  17.2%. This significant enhancement highlights the framework's capacity for  automated, agile and high dimensional decision-making.

Future Perspectives

We are continuously working on improvements to the framework. In the next phase, we'll factor in the volatility of APY for each silo, allowing for more precise decisions in the medium term. This strategic approach is aimed at boosting efficiency and reducing costs linked to short-term asset allocation decisions.

Conclusion

Automated and transparent financial logic is one of the main features of decentralized exchange systems.However, the complexity of optimal strategic decision-making poses challenges, especially in environments with numerous  real-time events demanding monitoring. This highlights the imperative for automated strategies in DeFi lending protocols and environments alike where optimal asset allocation is paramount. The 17.2% average improvement over the naive optimization approach attests to the framework's effectiveness in navigating the complexities of DeFi ecosystems. 

At Giza, we are building a scalable end-to-end solution for easy integration of ML intelligence to decentralized applications. Besides working on building the tech stack, we are deeply interested in exploring the use-cases at the convergence of ML and Web3. We are interested in talking to anyone who is stimulated by this intersectional design space. Therefore, we welcome comments and insights as well as inquiries on potential research and development collaborations and/or protocol integrations. Please contact us at contact@gizatech.xyz or fill out our partner Typeform.

For Developers

Start creating AI Actions and bring intelligence to smart contracts.

For Protocols

Start integrating AI Actions without compromising your protocol security and standards.

For Developers

Start creating AI Actions and bring intelligence to smart contracts.

For Protocols

Start integrating AI Actions without compromising your protocol security and standards.

For Developers

Start creating AI Actions and bring intelligence to smart contracts.

For Protocols

Start integrating AI Actions without compromising your protocol security and standards.