New Ethereum talks, every Monday. The week's conference uploads by event, in your inbox.

Loading player…

Elliptical Eccentricity for Capital Efficiency | Josh Guha, Gyroscope | ETHTaipei 2024

ETHTaipeiWed, Oct 9, 2024, 12:00 AM

Elliptical Eccentricity for Capital Efficiency | Josh Guha, Gyroscope | ETHTaipei 2024

Transcript

all right hey guys welcome to Elliptical eccentricity for Capital efficiency my name is Josh I'm part of the core team at gyroscope and we've recently launched a stablecoin gyd and part of the stablecoin system we created this whole new automated Market maker called eclp the elliptical concentrated liquidity pool based on Analyse that's the topic for this presentation okay so in this talk I'll be going through a brief Refresher on the evolution of automated market makers amm where we'll explore the ecl's predecessors and their benefits and drawbacks then I'll present the eclp itself how it fits within the am the evolution of the amm design and how it provides unparallel benefits in specific use cases and I'll show you how to construct one from scratch and finally I'll discuss the use cases of the eclp where it really shines as a value adding novel innovation because of its flexibility okay so first a refresher on automated market makers I'll discuss three main amm designs the original XY equals K stable Swap and finally Uli swap V3 concentrated liquidity so though automated market makers have existed for some time the use of a constant function Market maker where trades occur along a trading curve and is subject to some invariant constraint first arose from a block blog post written by vitalic in 2017 where he discussed why this property called path Independence may be desirable for an amm the price quoted by the amm is dependent on the quantity of reserves of each asset only and not on the number or magnitude of any intermediate trades so this helps to prevent any bleeding off of reserves caused by malicious actors the P to pool model of the amm the automated Market maker means that prices are algorithmically determined by some variant function and reserves are maintained within the amm smart contract itself so this has the benefit of allowing constant and permissionless access liquidity and open and transparent determination of prices as opposed to the peer-to-peer model where finding the relevant liquidity to settle trades can be a little more Troublesome however liquidity providers lers who provide the reserves required for amm to trade can suffer losses if the relative price of the two assets diverges from that at which the lp provided liquidity to the amm pool so this is commonly known as impermanent loss when designing any amm a careful analysis of the incentives for liquidity provision is required in order to make sure free agents that is the LPS the liquidity providers are incentivized to provide liquidity and ensure that the amm is actually useful so impermanent loss is the loss to liquidity providers due to price variation relative to just holding that same set of assets it's caused by the amm not knowing what the external market price is and so when the external price changes the amm is stuck quoting the stale prices and must be re- equilibri to the market price by Arbiters but arbitragers are not selfless individuals they do this because they gain some profit and this profit is the liquidity provider's loss in the Zero Sum game of trading so this is actually a form of adverse selection since there is information is symmetry between the arbitres or Traders and the amm the Traders know the true market price of the trading pair but the amm doesn't so it's possible to mitigate this by allowing the amm to react to some external price Source but then this introduces other other sources of risk like Oracle risk which need to be added to the incentive design formulation okay so let's turn to the amm's pricing function and how it can affect capital efficiency and slippage so first we have Unis sw's constant product Market maker otherwise known as XY equal K where X and Y are the quantity of the reserves of each asset and K is the constant or invariance it was the first amm to bring vitalic ideas to production in November 2018 and also the first to enjoy significant volumes actually Unis swap V2 was so successful that trading volumes sometimes surpass centralized exchanges at the height of Def SU in 2020 and helped spark a whole new wave of defi Innovation the constant product Market maker was an instance of the more General constant function Market maker which prices trading pairs implicitly via a constant trading function which takes as input the reserves of the trading assets and constrains trading to a level curve according to an invariance as the first significant amm on ethereum Unis swap demonstrated that the ideas idea of cfmm worked relative to traditional order book Market making methods the amm was faster as it had liquidity available on demand and it doesn't have to wait for limit orders to be published and filled however the nature of the invariant curve x yals k means that the liquidity is reserved for trading across the entire price space from zero to Infinity so this is good for guaranteeing trade volume at all prices but thinly spreading liquidity over the entire range leads to increased slippage caused by each trade increasing impermanent loss and resulting in capital in low Capital efficiency so then the next design question is is it possible to focus liquidity into a range since many trading pairs fall within a given range particularly stable coin pairs so next up we have stable swap from 2019 curve came up with a solution by combining both the constant product and the constant sum market makers to create cre a hybrid Market maker so on the diagram you can see how the trading curve reflects the constant product trading curve at the extremes of the trading range but becomes closer to the constant sum like a linear line straight line uh in the middle so since price is the derivative or the gradient of this trading function at any given point the stable swap curve quotes a constant price of one which then exponentially increases or decreases as you move sufficiently away from one the stable swap function also has this amplification coefficient parameter a the lower it is the closer the trading curve is to a constant product and the higher it is the closer it is to a constant sum so this parameter allows curve pools to cater to the capital requirements of individual markets instead of the one siiz fits all approach of the constant product curve so this means that stable swap is an excellent solution for Price related trading pairs such as stable coins and state e eth where prices are expected to remain within a finite band around one since having a linear training curve and constant price around the price of one means that stable swap benefits from extremely low slippage trades within that flat range however it also provides liquidity for trades across the entire price range leading to capital inefficiency for the same reasons as a c as a constant product curve then in May 2021 Unis swap V3 was launched so it represented a a large advancement in amm design by introducing this concept of concentrated liquidity so this means that liquidity providers could specify over which price range they wanted to provide liquidity in effect gaining a multiplier on their provisions and leveraging their positions so this has the Dual benefits of both increased returns for liquidity providers and reduce slippage for Traders within a specified price range the downside is that when prices fall outside of this range uh there's zero trading activity and therefore no fees ACR to the liquidity providers however as mentioned earlier this may not be an issue for related trading pairs in uniso V3 liquidity providers can open multiple positions with differing multipliers across the trading range and thus they can combine these positions to Custom Tailor their liquidity provision profile to as they see fit uh they can also alter the profile dynamically in change in response to changes in Market circumstances the issue is that this active position management introduces complexity which the average defi user may not be able to or may not desire to handle and also since liquidity provider positions in unisa V3 are unique users are given an nft instead of an erc20 LP token so fees are not automatically fed back into the pool and therefore they don't compound automatically as with the previous amm designs so is it possible to combine the capital efficiency of Unis swap V3 with the minimal slippage within a giving trading range of stable swap can we provide liquidity within a range in other words concentrated liquidity while also maintaining the ease of use and minimal position management of stable swap can liquidity providers get higher fees and can Traders face lower slippage while also ensuring that fees are added back into the pool and are autoc compounded without any required intervention and the answer to all these questions is of course yes so enter gyroscopes elliptical concentrated liquidity pool the eclp okay so gyroscopes brand new elliptical concentrated liquidity pool represents a step forward in amm design and Innovation the trading curve is actually part of an ellipse that is constructed by by applying a series of linear Transformations on top of a circle First We Take a circle centered at the origin we stretch it rotate it and finally shift it the trading then occurs on the part of the ellipse which is monotonically decreasing the eclp provides pool Constructors a greater number of parameters to tinkle with and optimize the shape of the trading curve for optimized Capital efficiency in the specific Market use case so let's construct an EB trading curve ourselves and see how changing the parameters can optimize the curve for certain use cases okay so we start with a circle centered on the origin our classic x^2 + y^2 = radius squ the circle is then stretched into an ellipse by the factor Lambda and you can see the corresponding Matrix which represents the linear transformation then the ellipse is rotated anticlockwise by angle fi again the linear transformation is here in the corner and finally the ellipse is translated by some Vector AB so the origin is now at AB so as you can imagine the combination of all these parameters the stretch Vector Lambda the rotation angle fi and the translation Vector AB provides a t of flexibility with which to optimize the EB to particular use cases so for example stretching the ellipse or increasing its excentricity means that the final ellipse has a broader flatter area which results in lower slippage trades similar to the stable swap design rotating the ellipse can increase or decrease the peg price around which the slippage is minimized uh and Shifting the ellipse allows a Constructor to alter where it intersects the X and the y axxis or in other words to change the price range over which the E accepts trades so the eclp provides concentrated liquidity similar to unisa V3 by constraining trading to within a trading range Alpha to Beta the prices Alpha and beta are determined by the slope of the ellipse where it intersects the X and the Y AIS as you can see here the next interesting parameter of the ELP is the peg price which is the price where where the ellipse is at its flattest and it's also the price where there's least price impact note that the peg price doesn't have to be symmetrical about one unlike in stable swap because of our ability to translate the ellipse anywhere and rotate it so this is super helpful in use cases where perhaps you want most liquidity focused in the upper bounds of the trading range but you want to reserve some capital for lower probability cases nearer the lower bound mathematic the peg price is calculated as the tan of the rotation angle F to see this note how the peg price gradient line when extended uh makes angle five with the x-axis interestingly the peg price doesn't even have to lie within the trading range such as in this diagram in this case the price impact of a given trade increases as you move away from the peg price in other words the convexity of the trading curve increases as you move away from from the pck price and this can be useful where you want most liquidity focused at one end of the trading range so now you can understand what the key parameters are in our UI for the EBS we have Alpha Beta the price constraints the peg price and Lambda the stretch factor okay so let's discuss some of the benefits of the eclp first liquidity where you need it so unlike stable swap ecp's asymmetric price ranges allow it to unevenly distribute liquidity within its finite concentrated range so for example where prices are bound from above by one and From Below by 0.5 but are expected to trade mainly around one the eclp can unevenly distribute liquidity at the upper ends of its trading range using the curve of an ellipse allows highly customizable liquidity profiles in fact the E can be calibrated to approximate almost any trading curve that would be desirable uh another benefit low operational burdens on LPS unlike Unis swap V3 all liquidity provided to ecps are within a single given price range or a single tick so this means that liquidity providers don't have to actively manage their position between ticks making it easier to passively manage their position setting the shape of the trading curve on initiation transfers the burden of liquidity profile management to pool Constructors and away from liquidity providers in Unis swap V3 with extreme flexibility comes extreme responsibility and thus liquidity providers are required to set their own liquidity profile by combining V3 positions and this may be great for sophisticated market makers but for most defi users it's not really practical no need for active position management avoids this arms race between liquidity providers as they scramble to update and optimize their positions with New Market information uh this also reduces the barrier to entry for liquidity providers just join on our gyro UI and let the eclp do the rest so gyroscopes Epps marry the user experience and simplicity of stable swap amms with the benefits of concentrated liquidity of Unis swaps V3 The Best of Both Worlds okay rounding things off we'll talk about the EB's use cases so the EB is currently heavily featured in the gyroscope gyroscope ecosystem in the SEC markets for the gyd stable coin where trading is expected to occur between the price bounds set by the primary markets mint and redeem quotes liquidity can be concentrated around the peg level of one but some can be unevenly distributed at lower levels for Niche situations where the Redemption price is at a discount so unlike stable swap liquidity would not be provided by the ELP above the price of one where no trading is expected in secondary Market this is because arbitres are expected to mince at a price of one and sell in the secondary Market ensuring there's that upper bound at one also in our Reserve vaults concentrated liquidity means that increased swap fees caused by trading activity between the stable coin Reserve assets so this helps to bolster the reserve Health in the long run the reserve vaults are currently implemented in the gyro dnamic stability mechanism and one of the reserve assets is the lp token to our LUSD curve USD eclp actually the the gyd stablecoin and the eclp automated market makers have a rather symbiotic relationship gyd aims to be the central asset within a liquidity network of elps providing low slippage High Capital efficiency trades between multiple Assets in a network of amm such as un balancer and the eclp helps create an efficient secondary market for gyd utilizing concentrated liquidity and LP shares for other stable pairs can be used as yield bearing collateral and Reserve assets for gyd okay so in both Lio State eth and liqui LUSD trading occurs in a specific range bounded by the mints and the redeemed prices of the derived assets again there's no need for liquidity to be maintained outside this trading range so the EB can be calibrated to concentrate liquidity to fit the market conditions benefits over stable swap as mentioned before include not wasting liquidity provision in parts of the trading range that should never occur so for example above the minid price or below the Redemption price pool creators can set the pool parameters upon construction to optimize liquidity provision given current trading Market data and any other factors such as tokenomics which could affect the price and trading activity of the pair so another huge benefit of elps is our use of rate providers so what happens to an amm when one or more of the trading assets are yield bearing tokens so for example between Lido's wrapped staked eth and wrapped eth WRA state eth is designed to keep your balance fixed while your balance of the underlying State eth increases over time as discussed earlier we expect that the external market price changes driven in part by this yield uh the amm price becomes stale and is only brought back into equilibrium by arbitres however the arbitrager profit is the liquidity providers loss so to reflect the yield and the changes in prices liquidity providers in other concentrated liquidity pools will have to actively manage their position manually shifting their desire liquidity distribution in contrast elps use external rate providers which allow this yield to be endogenous to the price to the pricing model so in other words uh as you can see in the animation on the right the liquidity distribution of the elps with yield bearing assets shifts to the right over time as the yield naturally changes the relationship between the assets of the trading pair so this prevents the need for Arbitrage allowing the yield to end up with liquidity providers instead so this is great news liquidity providers can reh hypothecate their yield bearing assets and at liquid and at liquidity provision yield and other external incentives to gain some juicy cumulative yield in fact just this week we've teamed up with Ave to launch the brand new Ave reh hype pool which allow liquidity providers to provide Ave static a tokens and enjoy the yield from RV lending the yield from amm liquidity provision external third party incentives for liquidity provision and brand new gyroscope spin points and they're all available on our UI today at app. gy. Finance okay so in conclusion ecps elliptical concentrated liquidity pools combine the user experience and the autoc compounding of Curves stable swap pools with concentrated liquidity and asymmetrical liquidity distribution from Unis SWS V3 concentrated liquidity so with a ton of parameters to choose from ecls provide customizability for specific use cases and they're already being used today with stable coins and lsts and have over $25 million in total value locked in the future we plan to add updatable parameters to our Epps to allow for a more dynamic eclp the eclp is integrated with top order routers such as balancer 1 in and Ox the smart contracts are audited by Leading names in the industry as you can see here and the gyroscope team is supported by some big players in the D5 space okay so that's the end of my presentation I'll leave with this Slide summarizing the differences between some of the different amm I described and perhaps we can have some questions thank you does anyone have any questions hello good to see you and I have two questions uh the first question is about mathematical because of the curve you said will be oval and will is that the five be 45 degrees will the fire be 45 May yeah yeah yeah maybe or not I am asking you because if uh the five be 45 degrees it will be a well a circle uh it's the first question for for this uh this type uh you talk to me so and asking you the five is be possible in some some ways or some situations be 45 degrees Yeah Yeah so uh the f is is a variable so you can you can change it as you like if the ellipse was a circle then obviously the the FI wouldn't the angle of rotation wouldn't matter um but since it's an ellipse the angle of rotation allows you to change the the peeg price the flattest part of this ellipse if it's 45° then you get a PE price of one 1045 right um but you can still change it so that it could be more than one less than one however you like so it always be changeable uh well in in your contract yeah in your smart contract or something uh so right now it's static upon um pool construction but we're working on Dynamic ecps where these parameters can be changed and updated oh thanks and the second question is about the sandwich attack uh will sandwich I believe it is Will is still have some sandwich attack uh but uh the attack will get bigger uh benefit in this new type of Love pool or not right uh so we're currently building on top of balancer um and one of the um aspects of balance's Vault is that you have to specify a minimum maximum allowed slippage um so this prevent this like helps mitigate sandwich attacks because if the price is too far away from what you expect it to be then the transaction just won't go through okay that answer question thank you thank you all right thank you we have one more question over here um so with the update po uh eclp would there that be a pool manager some something like that uh what sorry uh a pool manager a pool manager yeah to update the parameters for the right yeah um yeah I assume so because uh once the parameters um become mutable then yeah we'll create probably create a user interface for for users to uh Tinker with their efps as they like um do you have any plans like how would this manager be chosen or it it could be a type of auction something like that as in who has per to change um yeah I'm not not too sure on the plans right now I mean it could be just the pool Constructor or it could be uh a certain permission which could be transferable um but yeah there's lots of options available there okay thank you nice thank you gyo thank you

Automatic transcript — names and jargon may be misspelled.