Building an Ecosystem to Unify DeFi Liquidity / Gabija Tuinaite
Prague DeFi Summit 2023 · June 2023 · 18:48
Gabija Tuinaite presents Mangrove, a decentralized exchange designed to tackle the fragmentation and inefficiency of liquidity provision in DeFi. She explains its architecture, in which liquidity providers can post custom smart contracts as offers to run more intricate trading strategies, and compares market making on decentralized exchanges with centralized ones, pointing to gains in security and transparency.
Speakers
Topics
From Prague DeFi Summit 2023, hosted by Prague DeFi Summit 2023.
Transcript
hello everyone so my name is gabia and today I will talk a little bit about what Mangrove is and how Market making on Mangrove could help unify defy liquidity so to begin with Mangrove is essentially an order book based decks where liquidity providers are able to post smart contracts as offers so let's simplify this a little bit and I will start with a very basic example so imagine a fruit marketplace where apples and oranges are sold I come to this Marketplace and I promise to sell my 10 apples in exchange for 10 oranges
however while I wait for my buyer to arrive I can go to some Garden plant my apples and grow even more apples in the meantime when the buyer comes and takes my offer I have a choice and that at that moment I can choose either to fulfill this offer and deliver my promise or I can choose to withdraw if I choose to withdraw the um the ticker doesn't get his offer so let's start speaking in D5 terms here um essentially oranges are what maker
ones and what ticker is willing to provide in exchange for the apps the additional yield remember the apples that I planted in my garden and the choice is what we call Smart offer so exactly how smart offers work on Mangrove so maker comes to Mangrove and he posts an offer essentially all offers on Mangrove are just Promises of liquidity so liquidity is not locked therefore a maker is able to put this liquidity into work into some other D5 protocol a good example of that could be borrow land protocols such as Morpho or Ave
and generate yield while waiting for his offer to be taken let's say then the ticker comes and takes this offer so remember maker has a choice either he can choose to fulfill his offer or he can choose to withdraw the choice is what we call last look mechanism and I will explain this in more details a bit later on in my presentation but generally if the maker decides to fulfill his offer the liquidity is sourced from the D5 protocol delivered to the ticker and the order is executed here you might ask what happens if
makers all makers on Mangrove decide to withdraw so essentially when Maker's post offers on Mangrove they have to attach a small amount of native tokens depending on the blockchain of course you're operating on which we call Bounty and this bounty is used to compensate the tickers for the gas they spend while taking offers additionally on Mangrove markets we have what we call keeper Bots running who essentially check all offers that are posted on the markets and clean the book from offers that are bound to fill why offers might fail again I will explain in more details a bit later on
but to compare this logic with other regular dexes either amm or order book based Texas liquidity there is locked which means essentially that when makers post their offers on other indexes they have to provide and lock in the liquidity at the exact same moment as they post an offer and here the most obvious difference between other dexas and Mangrove is that liquidity is not locked hence why we use instead of tvl we use the term tvu which is total value unlocked and to finalize this part about how Mangrove works I would like to dig a
little bit deeper into smart offers and generally how transactions occur at mangrove so when diggers Take Offers there is a part of smart offer logic execution and it always starts with my mentioned last look mechanism which essentially checks whether it's actually beneficial to fulfill an offer the reason behind not fulfilling an offer could be the market conditions changed the price changed um and and now it's essentially not profitable to even execute an offer and if the last look detects that it's not profitable the trade is not executed
if it attacks the tax that it's profitable to execute an offer we move to the second part of the transaction logic which is liquidity sourcing so as I mentioned makers are able to employ their liquidity into some D5 protocols and this liquidity then is sourced by the smart offer logic if the sourcing is successful the trade is executed if the sourcing is not successful the trade is not executed of course the reasons behind unsuccessful execution might be that a maker implemented a router to Ave however between posting an offer and the offer
being taken he moved his liquidity from other to compound when the offer is matched the code doesn't see that or the code doesn't have a router to compound therefore the liquidity cannot be sourced from this protocol so there are some particularities and specific features that have to be embedded into the smart offers and this is exactly what I would like to talk about next what can you actually embed into your smart offers that you post on Mangrove so I've already mentioned last look mechanism which essentially gives a maker a choice to fulfill or to withdraw from the offer I won't go into too much details with all of these examples but if you have
some questions or would like to chat more about them happy to do so after the presentation so the example is as follows user aim wants to buy some it and he is matched with user B who is willing to sell it for 1000 usdc essentially what user B can embed into his offer logic is to check the price on uniswap as an example if the price is higher there user B can say no to user a and sell on uniswap if it's lower on uniswap either user B can decide to perform arbitration buy from uniswap or he can just sell it to user a
in both of these two cases doesn't matter what the price on uniswap is user B can win the second feature that I'd like to mention is what we call liquidity amplification so as I've mentioned before essentially all offers in Mangrove are just Promises of liquidity and here on the diagram you have quite a lot of details but the main idea here is that a maker has 1000 usdc he comes to Mangrove and he can offer or promise this 1000 usdc on 3 10 or n markets at the same time because offers
can have any logic embedded into them the logic of updating offers can be embedded as well which means essentially that if one of these offers is taken other offers can be updated instantly and one thing maybe to mention that this particular feature could be compared to the leverage features on other taxes the third feature that I'd like to talk about is multi-liquidity sourcing so as I've mentioned makers are able to embed any logic they like into their smart offers which essentially means that liquidity can be stored can be sourced
from literally anywhere within D5 ecosystem and here I will listed just some of the examples that include land borrow protocols such as other compound liquidity pools unit swap or balancer active liquidity management protocols tattoo beefy and yeah these are just you know some of the examples of the possibilities and lastly I'd like to I'd like to mention on chain price sensors so essentially makers are able to embed on-chain price sensors into their offers which essentially means
that they don't need any infrastructure to update their offers and they can execute offers and repost offers instantly with zero latency of course you have to know that your amount to the overall speed of the blockchain that you're operating on and now with all these features that I've mentioned they opened a very wide design space for very sophisticated strategies and here at Mangrove we figured what is a better way to Showcase this than introducing simple easy to understand yet super powerful strategy so let me introduce you to candle candle
is an automated Market making strategy that uses on-chain order flow to repost offers instantly with zero latency so essentially candle posts bids and asks within a predetermined price range so you can compare it to concentrated liquidity pools in some sense and if a bid is taken candle posts an ask on the other side of the book and vice versa essentially the main goal of the strategy is to buy low sell High therefore it makes profit from the spread and here it can be compared to let's say unib3 pools however the main advantage of candle is that on candle you can adjust your step size
meaning that the price grid can be adjusted according to volatility and it can be updated anytime and the strategy will be available to our users via contracts or SDK meaning that you could take the strategy it's open source you can create your own version of it you can adjust it based up onto your up to your preferences just deploy it and run it or there will also be a version available on mangroves web application now to finish this part about Mangrove in general I'd like to talk a little bit about division
so we envision Mangrove to be an ecosystem rather than the Dex alone because of mangrove's powerful features and I would say Innovative approach to trading in general there are many opportunities for potential products and Innovations and some of them here we just listed some of them I won't go through all of them but just to mention a good example could be liquidity bootstrapping mechanism using Market making strategies as well as creating markets for illiquid tokens such as carbon tokens or nfts even and at least in my personal preference the most interesting one is that any
programmable emm could be replicated on Mangrove meaning we could replicate univ3 Logic one-to-one on Mangrove but add liquidity routing to let's see morphle this would result in exactly the same yield as on univ3 pull plus the additional yield from lending your assets on Marvel and as I've said these are just you know a few examples of the possibilities now moving on to Market making part I will try to go over everything very quickly since we don't have much time left so here I'd like to compare how Market making differs between
centralized centralized exchanges decentralized exchanges and mangrove so um to summarize very very briefly on centralized exchanges market makers have to actively manage their strategies there is high infrastructure competition and of course you have uh the centralized management in general where the market making is available only to whitelisted players and you have centralized custody of assets which as I think we've seen in the past or I should say even past years could be a huge problem if an exchange decides to hold withdrawals with decentralized exchanges market
makers are able to passively manage their strategies with logic deployed on chain and updates pushed by off-chain Bots here they do so by screening mempools or engaging in different Arbitrage I think the most obvious or the biggest benefit that was introduced with the centralized exchanges is that Market making was democratized in some way meaning that anyone can deploy a strategy on chain which allows for broader participation now moving to the mangrove part so on Mangrove market makers are able to run passive strategy management with zero latency which means that they don't need any additional infrastructure to run
their strategies and the features that I've mentioned enable opportunities for complex and sophisticated strategies so you can achieve Capital efficiency via liquidity amplification you can achieve security via last look mechanism that I've mentioned or you can also embed passive risk management techniques into your smart offers such as buying options or other correlated assets to in general reduce risk exposure one thing may be worth mentioning here as well is that Mangrove can root liquidity from all dexes atomically and here essentially what that means that
means that market makers are able to provide liquidity on any decks at the same time therefore reduces liquidity fragmentation consolidates pools and improves the overall Market depth and to summarize everything that I've said so mangroves Innovative features allow or enable liquidity providers and market makers in general with greater flexibility for their strategies with capital efficiency while at the same time addresses liquidity fragmentation challenges within D5 ecosystem so thank you very much and yeah as I've
said if you have any questions or would like to chat more um I think we have we have time we have time for a question if there's one in the audience please very interesting protocol thank you very much with liquidity routing you you depend on where you write in your liquidity from there could be drastically higher gas costs that makes smaller swamps not feasible how do you deal with that yeah that's a very good question so I've mentioned so in general how it works on Mangrove maybe we should go back to it when makers post offers on Mangrove they can embed any logic they
like essentially and yes the liquidity routing can can sometimes cost a very high gas cost so what makers have to do they need to calculate approximately how much offer would would require you know how much gas would be required for an offer if the offer is successful takers pay gas fees on Mangrove if the offer is not successful the mentioned Bounty is used to compensate the taker so essentially yes if you have some sort of super complex and deep liquidity routing incorporated into your offers yes then it could be very high for the takers for the ticker to take care of you're
correct hey a great presentation I was just wondering uh what your Revenue model is and secondly were you guys here all day when my conversation about perhaps and degrading yeah sure we're here all day so really happy to chat about potential ideas or products uh yeah in terms of Revenue models so um we are only on the test net to begin with we're not live on the mainnet but uh generally speaking it will be fee based model as on other exchanges and yeah the fear we haven't decided on it yet to be on to be completely open and
honest but yeah it will be fee based model great cool thank you thank you so much for rushing through that and really technical [Applause] [Music]