Litepaper
Abstract
Decentralized finance has emerged over the years as the prevailing use-case of smart contract technology by offering a more efficient and transparent environment for the development of financial applications. As Defi grew over time, developers took advantage of the composability offered to them by smart contracts, turning the decentralized stablecoin space into fertile ground for financial innovation. However, decentralized stablecoins need to attract liquidity at scale in order to become viable and in order for them to achieve this the DeFi space needs to develop the right mechanisms for attracting and maintaining liquidity. The presented protocol develops a yield-optimized liquidity foundation on top of decentralised exchanges in order to offer optimized yields to liquidity providers from the integration of swap activity and optimized lending market capital allocation that can be offered by the use of our ERC-4626 vaults. Each component of our base liquidity pools is connected to its respective vault generating optimized lending market yield in the backend. This symbiosis maximizes yield and paves the way for the creation of a liquidity layer for decentralized stablecoins.
Introduction
Asset lending constitutes a relatively low risk activity for decentralised finance (DeFi) users that are interested in putting their portfolio assets to productive use with a multitude of lending venues being available to facilitate decentralised lending activities. Platforms such as Aave, Compound, and Fraxlend allow their users to generate yield on their capital while keeping custody of their assets. Decentralised lending has facilitated a large part of DeFi's growth with the lending pool model becoming the dominant implementation in the space leading to the dominance of utilisation based interest rate models. Thus, in the presence of a surplus of available capital, interest rates on lending protocols decrease. The existence of multiple DeFi protocols leads to interest rate imbalances that come as a result of different utilisation rates in different lending markets.
Dynamo Finance aims to optimise lending yields by developing a decentralised solution that utilises the underlying capital in a multitude of lending venues in order to extract the highest possible interest rate out of each supported asset. Our ERC-4626 vaults react in real time to interest rate fluctuations across DeFi venues by rebalancing their allocations in a manner that maximises yield between different whitelisted lending platforms. Our vaults allows anyone to participate in this rebalancing process and encourage the decentralisation of the weight rebalancing process by incentivising the process with part of the yield that the respective vaults generate from a rebalancing proposal. Our infrastructure is designed in a manner that aims to maximise utilisation by the broader DeFi space allowing anyone to build on top of it.
Dynamo vaults can facilitate a wide array of use cases with the optimisation of liquidity provision in stable swap pools being just one example of its capabilities. The upcoming integration of our vaults with decentralised exchanges will act as a proof of concept by allowing liquidity providers to take advantage of our base pools in order to optimise their liquidity. This can accelerate the development of liquidity for decentralised stablecoins and other assets by allowing liquidity providers to generate an optimised lending yield out of their idle liquidity. We show explicitly in an example study how idle liquid can be unlocked to increase annual percentage yields (APY) for liquidity providers. This strategy will enable us to offer highly competitive APYs that even outperform current state-of-the-art liquidity pools like Curve Finance's 3pool.
Swap invariants for liquidity pools
The concept of an automated market maker (AMM) was first discussed by Vitalik Buterin, later generalized by Alan Lu, and finally proven viable for market making by the well-established Uniswap automated market maker. AMMs are based on invariants that describe how assets should be priced upon swap events within liquidity pools.
Uniswap's constant product invariant describes liquidity as uniformly distributed along the
reserve curve, where and are the respective reserves of two assets and , and is the invariant. Let us take this reserve curve as a basis for an example to show how a swapping event would look like. Imagine we have a liquidity pool that is composed of two assets each holding 100 coins (A and B). The invariant is calculated as follows
The reserve curve determines how much B a user gets for a certain amount of A
and for an example amount of 50 A
we calculate that the user obtains 33. B in exchange. Balancer introduced a multi-dimensional reserve curve that defines a cost function for the exchange of any pair of tokens held in a Balancer Pool (BP). The price reserve is defined as
where ranges over the tokens in the BP, is the balance of the tokens in the BP, and is the normalized weight of the tokens such that the sum of all weights equals unity. Each pair of tokens (in = and out = ) has a spot price (SP) defined entirely by their weights ( and ) and balances ( and )
Swap fees (x) are taken into account by adjusting the given definition slightly
Furthermore, a stablecoin reserve curve has been implemented to allow for swaps between assets that are pegged with each other. Most common examples are US Dollar tracked stablecoins (e.g., DAI, Tether, and USDC), and assets that track the price of Bitcoin (e.g., wBTC, renBTC, and sBTC). Spot prices are determined by the BP balances, the amplification parameter , and the amount of tokens that are being swapped. Ideally, it would make sense to simply allow for 1-to-1 swaps between assets, which would be a constant sum reserve curve. However, once an asset loses its peg and its value diverges, it would make sense to enforce trade rules for uncorrelated assets, which would be a constant product reserve curve as discussed above. Balancer therefore uses the amplification parameter to define to which degree the reserve curve approximates the constant product curve (), or the constant sum curve ().
where is the number of tokens, is the balance of token , and is the amplification parameter. In order to solve the equation from above, either for or , we need to define it in a form like . Then the invariant () is solved iteratively using the Newton-Raphson method. The idea is to start with an initial guess, approximate the function by its tangent line, and finally compute the intercept of this tangent line. This intercept will typically be a better approximation to the original function's root than the first guess, and the method is iterated until convergence is reached. If the tangent line to the curve at intercepts at then the slope is
The algorithm for swaps first solves equation against , then against given which is increased by the amount of coin that is traded in.
Dynamo Finance vaults
DeFi users want to productively invest their assets in various lending platforms such as Aave or Compound. All those platforms support lending markets for the largest stablecoins and various other highly liquid assets. Unfortunately, the nature of lending protocols makes the returns on lent assets inversely proportional to the availability of capital in the respective lending pools. Thus, in the presence of a surplus of available capital interest rates on lending protocols decrease. The existence of multiple DeFi protocols leads to interest rate imbalances that come as a result of different utilisation rates in different lending markets (see figure below for one example showing annual percentage yield (APY) fluctuations for DAI on Compound (CDAI) and Aave (ADAI)).
Yearn Finance was the first DeFi protocol to take advantage of such discrepancies by providing automatic capital migration to the protocol with the highest returns at the time.
In this paper, we describe the design of Dynamo Finance vaults, which tackle the problem of low organic stable swap yields by developing a modular liquidity management stack comprised of a yield aggregator and a liquidity network bootstrapped on top of decentralised exchanges. By integrating these two components, we develop an optimized stable swap offering that can provide sustainable yields at scale to attract and retain large amounts of stablecoin liquidity.
Our yield strategy aggregates lending markets such as Aave, Compound, and Fraxlend to extract the highest possible yield out of each supported asset by reacting in real-time to interest rate fluctuations. We achieve this by rebalancing our exposure between our whitelisted lending markets to capture the added value that can be generated through active capital management. Below we exemplify this setup for a base pool consisting of DAI/GHO/FRAX.
In the case of assets with protocol derived yield sources such as LUSD, Dynamo vaults can optimize returns by tapping into the associated yield flows and auto-compound the additional rewards they generate on behalf of our users. The ability to integrate our ERC-4626 vaults with any smart contract that lets us perform atomic transactions opens up the possibility of deploying liquidity to other partner protocols to generate the best possible returns beyond lending markets.
Our ERC-4626 vault represents the liquidity allocations by weights contributing liquidity into the underlying registered adapters by following a strategy in a manner that ensures an optimised return on the allocated capital. It is important that the weights within the vault can be adjusted in a permissionless manner. The advantage of this design is that there is no need for the existence of whitelisted accounts that are constantly aware of the current returns by opening the vault rebalancing process to every user of the protocol.
Additional lending protocols can easily be added to a vault in the future by deploying a suitable lending protocol adapter and we do not need to redeploy our vaults for that purpose. Each vault is therefore a pool of capital that represents a particular asset that is deposited into the vault by its users. The asset is allocated dynamically across the registered lending markets for the generation of yield.
Dynamo base pools
We use a boosted pool that includes multiple linear pools to create a boosted stable liquidity pool. The linear pools shift 90% of the linear pool liquidity into asset specific ERC-4626 vaults, which distribute the liquidity within the registered lending markets according to the active strategy. The remaining liquidity (10%) is earmarked for swaps within the boosted pool. A liquidity provider can thus provide one of the assets in the pool and receive the Dynamo liquidity pool token as a receipt. Below we exemplify this setup for a boosted 3pool consisting of DAI/GHO/FRAX (dUSD as receipt token), where the DAI vault is shown in detail for clarity.