With the upcoming launch of our first Cellar, we wanted to give you an technical overview of the Aave stablecoin strategy that Sommelier will be deploying and highlight our value prop for Aave lenders: If you intend to lend stablecoins on Aave, you’re better off putting that liquidity into this Cellar. Let's dive in!
Sommelier Cellars provide the functionality to execute strategies more sophisticated and complex than was previously possible in DeFi. At a high level, a strategy is executed through the Sommelier protocol using two “entities”: a strategy provider and a cellar contract.
The strategy provider sends action-recommendations through Sommelier’s validator set to be executed on the cellar contract. The strategy provider has the freedom to leverage any type of off-chain computation to arrive at these strategy recommendations. The only constraint is that the recommended actions are within the parameters of what the cellar contract allows.
Cellar design is itself an art - too much functionality opens the door to security vulnerabilities (e.g. strategy providers misbehaving), and too little functionality limits the flexibility of the type of strategies that can be run on the cellar. We’ll cover the details of cellar design in a different blog post.
The goal of this blog post is two-fold:
One focus of this blog post is to describe baseline standards that the community should expect regarding new strategy / cellar proposals. We will discuss the various components that a prospective strategy provider should consider before making a governance proposal proposing a new strategy, and we demonstrate these considerations concretely using the Aave Stablecoin Cellar that is launching soon.
The first question a cellar proposal should answer is: why is this strategy worth running? While this is a holistic question, there are several ways to answer quantitatively. In particular, we can leverage historical data to assess the performance of the proposed cellar. We refer to this process - of using historical data to assess a strategy - as “backtesting.”
Some questions that we considered in devising the Aave cellar + strategy are the following:
What is the alpha of the strategy? I.e. is this strategy capturing an opportunity in the market? Does it optimize something that’s worth optimizing?
Does this strategy need to be run on a cellar, or would a simple smart contract alone suffice? I.e. how much opportunity is there to leverage off-chain computation to improve yield?
How does our cellar perform historically?
Does the strategy make sense for validators to run? I.e. over what timespan do profits outweigh gas fees?
Does it scale with TVL? What are the TVL limits of the strategy?
We will outline our process in answering each of these questions with respect to the Aave cellar.
Finally, we will show through our backtesting results that our Aave Stablecoin Cellar succeeds in selecting the optimal stablecoin lending position on Aave.
This is the first step of the backtesting process. In our case, answering this question involved data exploration of Aave stablecoin deposit APYs (via data provider by Flipside Crypto).
This plot highlights several interesting features about Aave deposit supply rates:
Supply rates can be highly volatile, even for stablecoins
There are periods of higher volatility and periods of lower volatility
It’s not obvious which stablecoin is best to lend. Instead of looking at current highest APY we should be computing something like an integral (or weighted-average) of the supply rate curves.
This suggests that there is opportunity for a strategy that outperforms the baseline of simply picking the stablecoin with the current highest APY.
In other words: can this strategy be captured by just a smart contract? There are several ways to determine which stablecoin will be best to lend:
Looking at a historical weighted average
Chasing volatility to capture the spikes in APY
More sophisticated time-series forecasting (e.g. machine learning based approaches)
The latter two approaches - particularly time-series forecasting - aren’t feasible to do on-chain.
This means our strategy does benefit from the flexibility that the Sommelier architecture provides.
The final strategy that we decided on uses time-series forecasting to make a decision on whether to enter a particular stablecoin lending position. Note that this approach is infeasible to run on a smart contract.
In general, any type of sophisticated machine learning techniques will need to be run off-chain. The Sommelier architecture provides the solution to leverage this complex, off-chain computation in a secure, decentralized way.
This is the crux of “backtesting”. To answer this question we implemented the following in Python:
An automated strategy which generates action recommendations (e.g. “Deposit DAI into a lending pool”)
A data pipeline to feed (both historical and live) Aave data (curated by Flipside) to the automated strategy
A Cellar simulator to take actions from the automated strategy and simulate Aave lending positions
The data pipeline and cellar simulator are fixed implementation costs. They tell us how the automated strategy would have performed based on historical data. The automated strategy, on the other hand, is an iterative process. We can use our simulators to refine the strategy to yield the best results on historical data.
The result of one backtest is given in the following table:
Let’s breakdown the table.
Each row represents an update generated from the automated strategy. We can observe that the `timestamp` increases in 12 hour increments - this is because we set up our strategy to be updated every 12 hours in backtesting. In live deployment the strategy will update every hour.
The `lending_token` column tells us which stablecoin the strategy is currently lending (at the timestamp).
The `latest_action` column tells us the action that was performed at that time, for example executing the *deposit* action in row 3.
The `lending_amount` tells us the value of the current lending position. Notice that the number increases after an `interest_accrued` event. This corresponds to interest being compounded on the current lending position.
On the other hand, `inactive_liquidity` is the amount of assets the Cellar is **holding** without lending. It goes to 0 after *deposit* is called. If the strategy executed *withdraw* then the entire lending amount would turn into inactive liquidity.
Since we’re manually simulating a compounding lending position, we need data on interest rates. This is the `supply_rate` column. It tells us the interest rate at the given `timestamp`. We’ll discuss `supply_rate_calc` in the next section.
The `interest_made` column gives us the cumulative interest made up until that timestamp.
The `_yield` column gives us the yield up until that point in the backtest. You may notice that `_yield` is negative when `interest_made` is positive. This is because we factor the cost of gas into our `_yield` calculation.
In the above table we are only showing results for the first two days of the backtest. The full table actually spans several months.
We mentioned above that our calculated yield incorporates gas fees. In the Sommelier architecture it’s important to keep in mind who pays gas fees for what transaction. Any function call that the strategy provider makes to the Cellar is passed through the validator set, therefore the validators pay the gas on these calls.
In the Aave Cellar, these are the `rebalance` calls: withdrawing from one stablecoin lending position and depositing into another.
This means that we need to choose our `rebalance` calls carefully. Too frequently and validators aren’t incentivized to run the strategy.
For our strategy, we use our time-series modeling to forecast interest rates, and only call `rebalance` if the difference in interest between the current lending position and prospective position is enough to repay the gas fees within a reasonable time period (the specific time period is a parameter of the strategy). This, of course, depends on Cellar TVL.
For any strategy, there is a TVL (Total Value Locked) limit where the strategy is no longer effective. In Aave, a large lending position actually affects the interest rates. In our `CellarSimulator` we account for the size of our position in our interest rate forecasting (and backtesting). This means that the strategy can automatically optimize for the best lending position given the Cellar TVL.
We can compare the historical performance of our strategy to a holding strategy for various stablecoins at various TVLs:
TVL remains fixed over the duration of the backtest, i.e. users don’t add or remove liquidity. The performance of our strategy tracks the best performing stablecoin at each TVL using only historical data
Some features of the strategy from the above plot:
The strategy doesn’t do anything (APY = 0%) when TVL is below a certain point. This is because the interest at these low TVLs doesn’t justify the gas
At low TVLs, historically FEI is the best performing stablecoin
At high TVLs only certain stablecoins are viable
Note that we need to account for the size of our position in backtesting performance and interest rate forecasting. This is the `supply_rate_calc` column in the above table. We take our position and recalculate Aave’s supply rate based on the effect of our simulated lending position.
This is also why the FEI curve decreases as TVL increases: the FEI Aave pool is relatively small and therefore large TVL’s neutralize the interest.
Strategists may choose to put a cap on TVL to maximize performance of the strategy.
In the above plot, we assumed Cellar TVL remained fixed throughout the duration of the backtest. In reality, users will be continuously adding/removing liquidity from the Cellar. We decided to simulate this flow of liquidity by assuming a linearly growing TVL and adding random noise.
TVL starts at $100k and grows linearly over the course of the backtest to the Final TVL on the x-axis. We also add Gaussian noise at each time-step to simulate randomness in add/remove liquidity events. Our strategy better adapts to growing TVL than a fixed strategy that only lends a single stablecoin.
Each point on each curve in the above plot corresponds to a single backtest. If we zoom in to a specific “Final TVL” value we produce the following plot:
Performance of our strategy vs. holding individual stablecoins in a Cellar that increases in TVL from $100k to $25MM over the course of 4 months. Our strategy obtains the highest yield by adapting to the changes in TVL.
We’re actively working on simulating different kinds of (non-linear) TVL growth curves to make our strategy even more robust.
Our backtesting results demonstrate that this Aave Stablecoin Cellar achieves nearly optimal performance in selecting the best stablecoin to lend on Aave. In particular, this Cellar accounts for volatility, position size, and gas costs while dynamically rebalancing to the best available position.
The value prop is straightforward: if you intend to lend stablecoins on Aave, you’re better off putting that liquidity into this Cellar.
In this post we’ve discussed some of the considerations a prospective strategist / cellar creator should think about when proposing a new strategy or Cellar. We described our generic backtesting framework and dove into specifics of how we approached the upcoming Aave Stablecoin Cellar.
One important point that we haven’t addressed is the programming overhead for performing strategy backtesting. In an ideal world, a strategist could run a strategy on Sommelier with minimal (if any) programming experience. Even with programming experience, building backtesting infrastructure is non-trivial. To lower this barrier, we are working on developing generic and flexible tools to support backtesting and deploying new Cellar strategies on Sommelier.
Is Speculation Killing Crypto’s Future?
Sommelier's Path Forward: Embracing Revenue Over Narrative
Sommelier January Update
Sommelier Upgrades Cellar Architecture to Enable the Most Powerful DeFi Strategies in the Market
Real Yield USD is Coming to Maximize Stablecoin Yield
Retrospective on 2022 and the Journey Ahead
FAQ - Patache Digital’s Steady Strategies
Patache Digital: Risk Management Discussion
Strategy Deep Dive: Patache Digital
Strategy Provider Spotlight: Patache Digital
User Guide: How to Participate in Strategies on Sommelier
Sommelier Ambassador Program
Strategy Tokens: What Are They and How Do They Work?
6 Core Principles of Sommelier
10/10/22 - Deep Dive on Cleargate Backtesting
Strategy Provider Spotlight: Seven Seas
Deep Dive on Trend and Momentum Strategies
Strategy Provider Spotlight: ClearGate
Supporting Strategy Providers on Sommelier
Sommelier Protocol Team Weekly Update #11
ELI-5 Explanation of the Data Science behind Sommelier’s First Aave Cellar
Sommelier Protocol Team Weekly Update #10
The Data Science Behind Sommelier’s First Aave Cellar
Sommelier Protocol Design Documents
Sommelier Protocol Team Weekly Update #9
Sommelier Protocol Team Weekly Update #8
Sommelier Protocol Team Weekly Update #7
Twitter Spaces With Sommelier: How to Launch a Cellar on Sommelier
Twitter Spaces With Sommelier: Protocol Upgrade and Community Update
Sommelier Protocol Team Weekly Update #4
Sommelier Protocol Team Weekly Update #6
Twitter Spaces With Sommelier: SOMM Airdrop Proposal Data Analysis
Twitter Spaces With Sommelier: Community Update on the First Cellars to Launch
Twitter Spaces With Sommelier: Exploring NFT Cellars
Sommelier Protocol Team Weekly Update #1
Sommelier Protocol Team Weekly Update #2
Sommelier Protocol Team Weekly Update #3
Three Things You Need to Know About Sommelier Governance This Week
Sommelier On the Road: PROOF OF…REPUTATION
Introducing Ukpai Ugochi - Working on The Sommelier Cellars Rebalancer
Sommelier Announces 23MM Series A Mainnet Round to launch Automated DeFi via the Cosmos
Twitter Spaces With Sommelier: Mainnet Launch & Gravity Bridge
Twitter Spaces With Sommelier: Introducing SOMM Tokenomics
Twitter Spaces With Sommelier: Mysten Labs AMA With Evan Cheng
Introducing SIPS and Sommelier’s Governance Structure
Twitter Spaces With Sommelier: End of Year AMA 2021
Twitter Spaces With Sommelier: Intro to SIPS & Lisbon Blockchain Week
Twitter Spaces With the Sommeliers: Mainnet Update and Governance Launch
Sommelier Partners With Mysten Labs to Make Sommelier and All Cosmos Blockchains the Fastest Protocols on the Planet
Twitter Spaces With the Sommeliers: Sushi AMA With Joseph Delong
Introducing the Sommelier Network Mainnet and Ethereum Gravity Bridge
The Top Five Features of the Sommelier Protocol
Call for Validators: The Two Step Process for 2021
Two New Features Launched to Test Liquidity Management on Uniswap v3
Uniswap v3 Remove Smart Contract Incident Post Mortem for Sommelier
Call for Validators: Road to Sommelier Mainnet
Sommelier Liquidity AMA With Yenwen and Nick From Perpetual Protocol
Sommelier Liquidity AMA With Tascha Pan From Alpha Finance
Sommelier Liquidity AMA With Loi Luu From Kyber Network
Sommelier Liquidity AMA With Alex From Peanut
Sommelier Liquidity AMA With JP From THORChain
Sommelier Liquidity AMA With Alan Chiu From OMGX Network
Sommelier Liquidity AMA With Ari From Gelato Network
Sommelier Liquidity AMA With Sunny Aggarwal From Osmosis
A Fine Sommelier Explanation of Bollinger Bands With Kevin Kennis
Sommelier Liquidity AMA With Mona El Isa From Enzyme
Sommelier Liquidity AMA With Haxor From Method Finance
Sommelier Liquidity AMA With Tor From Secret Network
Liquidity Provider Insights With Zaki Manian - Ep. 7 - DeFi Automation Space on Uniswap v3 and Where Sommelier’s Heading
Sommelier Liquidity AMA With Geralt From CyberFi
A Pairings Tutorial of Two Sided Liquidity Addition with Sommelier
Liquidity Provider Insights with Zaki Manian - Ep. 6 - Liquidity Providers Need to Gear Up for a Multi-Chain World
Three New Summer Features for Liquidity Providers
Sommelier Liquidity AMA with Tom C and Max W from Charm
Sommelier Liquidity AMA with Dereek69 & Shalaquiana from BIOPset
Sommelier This Week - June 3rd 2021: The Road to Mainnet
Sommelier Liquidity AMA with Federico Landini from DefiLab
Sommelier Liquidity AMA with Michael Egorov from Curve
Liquidity Provider Insights with Zaki Manian - Ep. 5 - A Bright Light at the End of a Long, Tough Weekend for Bitcoin
Sommelier This Week - May 27th 2021: What Aspiring Sommelier Validators Need to Know on Last Week’s Protocol and App Progress
Liquidity Provider Insights with Zaki Manian (Special Edition) - Ep. 4 - New Pairings Release
Sommelier R&D AMA With Yaniv Tal From the Graph
Sommelier Liquidity AMA with MacLane Wilkison from NuCypher
The Eight Steps to Become a Liquidity Provider with Pairings
Sommelier NFT Awards - May 18th, 2021
Pairings By Sommelier: The FAQ
Zaki Manian Breaks Down What Liquidity Providers Need to Know Under Uniswap v3
Sommelier This Week - May 6th 2021: How This Week’s Protocol and App Progress Weaves Together to Make a Product
Sommelier Liquidity AMA with Dan Thomson from InsurAce
Sommelier This Week - April 29th 2021: Weeks Away From a Taste of the Sommelier App Experience and How the Dev Team Stays on Track
Zaki Manian Breaks Down a Phase Change Liquidity Providers Need to Know About Automated Market Makers
Introducing Jehan Tremback: Sommelier Core Developer and Althea Co-Founder that pushes the Limits of the Blockchain Bridge with Gravity
Sommelier This Week - April 22nd 2021: An Inside Look at Progress on Coordinating Sommelier Components That Contribute to the Chain
Sommelier This Week - April 15th 2021: Providing a Best-in-Class Experience for Uniswap Liquidity Providers
Sommelier Announces $1M R&D Grant from The Graph Foundation
Introducing LP Rewards: This Week With Cellframe
Introducing Deborah Simpier: Althea CEO and Sommelier Co-Founder Who Brought the Gravity Bridge to Life in The Cosmos
Sommelier This Week - April 8th 2021: What Uniswap v3 Means For Sommelier Architecture and Validators
Introducing Sommelier LP Rewards Program
Sommelier This Week - April 1st 2021: Gravity Bridge and Private Testnets
Blockchain startup decides to acquire a California winery and host NFT wine parties
Introducing Justin Kilpatrick: The Blockchain Bridge Wizard Who Maintains Gravity
Five Ways UniswapV3 changes the world for Liquidity Providers on the AMM
Introducing Jack Zampolin: On Becoming A Sommelier in The Cosmos
Sommelier: Welcome To The New CoProcessor For Ethereum
© 2024 Somm by Bajanss OÜ –Maakri 36-50, Tallinn, Estonia 10145