APWine : Future yield tokenisation as a new DeFi building block

ETHCC 4 · July 2021 · 24:31

Gaspard Peduzzi introduces APWine’s tokenization and trading of unrealized yield. He explains how its core protocol and integrated AMM let liquidity providers and traders take positions on the future yield generated by DeFi protocols.

Speakers

Topics

From ETHCC 4, hosted by Ethereum France.

Transcript

very nice being here i hope you have a great conference i know if some of you were at a side event yesterday but that was really cool um so okay great um my name is guess what i'm a co-founder of ap wine league in the protocol in smart contract development um i'm a computer science student at epfl i mean i was and yeah i made a ethereum for many

years now i'm very excited to talk about api and um basically without waiting more um in the the current default ecosystem that we had the last years so a lot of evolution i mean we all saw that a lot i don't know was the tvl at the ls ecc but like the defy space was not really um even existing yet we still have today's crazy apis a lot of protocol launching every day but as it becomes more mature we have new types of types of protocol new types of waves of trends and what i wanted to talk about with ap1

uh at the beginning is the importance of a derivative in the financial traditional world um and yeah basically it's 50 billion is only quite like quite important for for the space but very small yet but in the traditional financial world the derivatives are like most of the volume and then and just they all yeah like the most used instruments in the in the attention of unsold and so um and so what i want to talk about is a future interest rate um basically uh in august of last year in a student's room with some friends next to epfl we were discussing about

what's the current state of the uk system uh we had this crazy summer and um with a very simple rational thinking we are discussing about the fact that 30 000 interest on and pools it's not maybe it's something maybe not sustainable and um we were seeing a lot of people talking on twitter on how should we short apis like a lot of information we're um disclosed and but is there we are no way of um pricing that in the market in any way basically as a farmer you would just move your phones from one platform to another and i guess the the choice here mostly about security and then crazy api and you need to

be just fast but they're all missing a whole um a whole level a whole stage of the market where you actually need to be able to speculate on what are the interest rates and and for what it represents in terms of liquidity uh and all so yeah boring definition but basically the traders needed to be able to to do that and without knowing the name at first then that's what we launched future on interest rates on ethereum and um as it represents something for the traders and this is usually something that exists in international financial world is being replicated on instagram in some ways we still need to address the community

and what it means also for liquidity provider is basically getting your paycheck in advance as well um we needed to find a way to connect the liquidity providers the farmer to the traders so that both can play around this interest rate and what it means is that we need to find a way for someone to be able to sell it's a like monthly yield and a heavy deposit or just the interest of units or pool and so on and so forth and and so i came up with the idea of um creating this derivative and um to connect the trader to the liquidity provider the idea was split splitting it using two types of token one being the principal representing the deposit

and when representing the future yield so future being a contract with a fixed date of expiration a fixed duration um and so yeah we started from here and so basically to take a simple example that would mean that um making a deposit of 100 on ave you would get 100 a die and then depositing those interest being token on ap wine they will be split into um you would have the principle token which would represent the the principle that would be unlocked so 100 die at the expiration of the future and the future yields again that would be able to redeem the yield that was generated um by this hundred

nine during that duration um we started on a year c20 very fungible because uh for needs um yeah so we started like that we launched like a first alpha version we were playing or on visit the test net and like the derivative random that um used and still today um on ethereum and like the second challenge was actually not the protocol itself but how do we create a market for that we choose rc20 but now we need to trade them and we need to find a way to make that easy and so when we launched very quickly a bit in testnet we use like zero exchange and but it was really painful because of several challenges that i'm going to

describe just after that but eventually as we continued to develop the interaction flow the protocol and um and the market itself in the project and we grew the team we were working on imm that is like a three asset balancer-based amm so we we started from the balancer implementation um and we wanted to create the market for those three assets i mean the principal token and the future guilt again against the underlying because it made sense to be able to trade all those dues assets and in some uh um similar project that we've seen recently sometimes as a very in a very interesting manner they they focus on one or the other and the other goal would be just to have a market for

everything and so we came with different challenges because now we have tokens you can easily trade them their interactions very simple you can redeem the yield with the future token and so on but then there are still different things that you need to take into account to have an efficient market that is that has a proper characteristic due to the nature of the token um no which are mainly those two points um like you would have yield bearing assets in the imm so eventually um that could result in something probably not lost if you just take a regular imm um the liquidity issue as i said we started with just another book um

but then eventually at like trading yield is already a smaller volume in term of dollar than the principle itself of course and then especially i don't know on the on on a pool with like just i don't know a stable pool with a low ap wise that kind of thing i mean we were starting that on test net at first and then we did a bit on mainnet but uh rapidly uh we were i mean you have different issues like due to gas cost and just the cost of interaction flow and especially with the period rollout because at each expiration you would have a new token so that would be a mess just to update everything and so we took different approach for

that um so for the rollout the idea was that once we choose to go on an imm approach we needed to have the regular interaction flow of any liquidity provider in pools um like you just deposit and you wait and you're an interest and you're happy with that and you're incentivized to do that um but that emotionally if you have to recreate a pool at each new period that was like not very efficient and would result in some user useless loss so what we did and are still building on some part is a mechanism that would recreate automatically so basically at the expiration of the

future yields again they would be burned reinvested then the weights of the imm would be changed to reflect the price that would be set three different parameters so we started an approach where it is set um with just the actual yield generated through the last period but that of course is like just a basis and would result in like impermanent important impermanent loss for some liquidity providers um so we needed a way for the liquidity providers to be able to have fair and efficient market making without too much action or something that would not be manipulable in a way so for that we mainly have we have two options so at first it's a mechanism that

you can opt out and we go to direction one they will have customization options like you would have at least a unicef v3 where you can choose parameters that fits your best interest and on the other side we work in a some kind of two-way auction mechanism that's uh for the pool token um that need to be correctly waited for to avoid manipulation so basically we have half of that at that point and uh we need to work more on the second aspect before releasing that version but that would be in a later stage um for the yield bearing asset um

we have an automatic weight shifting basically um to be able to anticipate the progressive collection of yield on the asset on the pool so basically um let's say that you you sell to make it simple you provide liquidity on the pool and the market price i don't know the the api at 50 and um on die for example and then eventually people are selling principled again at 0.66 because they wouldn't anticipate that with that amount they will be able to earn one day at the expiration of the future for this principle then if no one makes any trade or just

if the market goes on then the yield is actually being collected and there is constant arbitrage that could be realized there and that's actually extremely inefficient so that's why you have a constant weight adjustment there um and then and then yeah like the the other thing was that another book is actually quite relevant if you want to trade um you know future on interest rate and that's something that we will keep in a later version um we were like probably working with some kind of relayer like one inch and that kind of project um but the the imm in instagram implementation really allows people to provide liquidity earn fees like they would do on uni swap

being exposed at the asset that they want um and yeah and allow just constant liquidity in one issue that we had that we had with the other book as well is the the market making in general like the market the current user are not um educated enough to be able to to properize it correctly and it just flipped rates a lot and the imm is really efficient in that regard but again we do need that order book at the end to make it usable and and yeah the most efficient possible um yeah so then we iterated on

different steps on that we are very much finishing the audits internally as well for the protocol and the m and there are several direction that we want to take from here one being tokenizing other types of assets i i talked about interest being token but we're very much aiming to tokenize everything that generates yield so it could be a staking position even though usually there is the relative for that like with the lido but also lp tokens for other types of position of liquidity providing um and with other types of um liquidity provider we have other types of yield as well and

one thing that's really wanted to do since the beginning is being able not only to um sell your future yield at a fixed date of actual of period expiration but also uh vested rewards like you would have a sushi shop and that kind of thing like many protocols have um generates a lot of yield but it's vested for like months and even years so that would be very um useful for them and then more in general um we focus the development and being as low level as possible because um because we want to bring that new primitive and we think that's the

correct way of building a protocol that can be that we'll use as a protocol and that can be used in this legal um kind of finance and we are integrating a lot of pools of the protocol and it's very easy very modular and actually even though the governance will choose the assets for now we want to lean toward the more permissionless integration like in this op anyone would be able to add pools for different assets um with then keeper mechanism for a future allowed or different function called necessary um and then yeah then we started with futures because we

didn't even knew that it was features on interest rate we just thought about connecting traders to liquidity providers um but then eventually looking at the general finance kind of field um and even other protocols that are building new types of derivative and ethereum we want to do the same with future with options just growing on a horizontal scale scale as well there um and yeah so many things will be will be possible with tokenizing future not only getting your paycheck in advance but basically performing arbitrage between all these rates and the idea would be that users at a low level uh product would be built

on top like you would be able in in like a very simple interaction just investing die in some pools in some insurance pools and automatically getting your yield in advance and then you know that you can unlock that at another day so a very simple product that we want um to be built on top of ap wine at the same time very low level um to facilitate integration and um general place in the ecosystem yeah so it was true guys thank you very much and if you have any question i'll be quiet thanks for the talk have you thought

about using roll-ups for the amm using an order book based yeah so i mean when we launched the first alpha version um even polygon and all was not that much developed and eventually if you want to like you talk about the world i'm just mentioning side chains because um like that that would be an option like definitely for gas cost and and that we are definitely considering scaling solutions um but like the choice of the imm was not only for for gas cost um more in general and that's more a layer that you want to build on top of the imm like that would be the core a market

maker we'll we're definitely talking and considering different scaling solution but for that we'll mostly follow what the ecosystem does as always uh you mentioned in the beginning that you wanted to short a apy how would you do that with your protocol right now or is that even possible so you would not be able to do that right now um but basically if you want to short i mean it depends

in the way you want to do it um we'll probably integrate i mean we talk with different protocols that we're basically doing margin and on different assets at that point uh it would not be safe or correctly implementable but that's something that would be added on top of the basis of what over the exchange that we would have even though you you'll be able to trade the second elsewhere um probably with oracles and liquidators there but that's more a year on top of the basis of the actions that you're building she would have a a uh a yield token in a landing market so it's like

recursive i mean as we create this first derivative and as always in a very uh maybe a perverse way then we build more complicated things on top and margin would be one um now eventually indeed with the current implementation if you have die and you think uh 10 on that protocol is too much the only thing that in the market still priced at at 10 then the only thing that you would be able to do is depositing your tokens and selling your yield at this market price because you think it will go down um yeah and you yeah that's awesome thanks thank you very much for the speech

so um i saw a lot of projects like doing double pulls separating the principles and the health and in that case is really easy to understand what would be the potential impermanent loss that i can get for example for for from the pool of principle because if i like wait until the expiration should not be any permanent loss in deadpool so what is the impact here of the impermanent loss in a balancer uh pool with the three assets and uh what kind of weights they have yeah so the way it works is there are like initial rates basically set that we set currently here like

just constant and then eventually um they can shift in mainly two ways one being this mechanism of the the weight adjustment for the yield when other being um like there is a way of entering the pool is just one asset that is not like a swap in fake air thing that will update and that's only a mechanism to go in we don't have the function to get out to update that way so i would say i mean the improvement loss would be the same as any uh balancer-based amm with the weights that are currently set but the goal of having those shifts is

actually to avoid um predictable uh impermanence loss so i i do agree i and actually the choice was uh not that easy uh between splitting those two tokens or even putting them together um but yeah that's my answer i agree maybe a bit conscious but like yeah definitely we have the reuse balance of formula and the weight are shifted to avoid the impermanent loss due to the nature of the asset but then you would have any kind of normal improvement loss that you can have with an next import um something i find very interesting is like

dpi which is a index of different um of coins so would there ever be like a potential later where users could sell like baskets of yield so instead of buying like individual or even having to deposit on those protocols individually whether it's harvest or wiring or whatever to experience those yields coming to ap wine and kind of being like the global marketplace for yield and say maybe instead of just buying like one future yield die from one place is that could i buy like a basket of different dies from a different bunch of different locations right kind of like an index definitely like um at first like i was saying um

as we progress on the lower level as we can it separated pools for each asset but then you at the same way you have a urine that or like those kind of protocol that basically optimize spots rates of yield then you would be able to have the same with uh with um with basket of tutorial token and just bouncing from one to another um there are also other things that that we'll probably do like swaps um on a later stage but yeah baskets of yield is definitely something that that we would like to be implemented on top and like i was saying the goal would be able to just be exposed to one asset and eventually uh i don't know deposit it to insure

pool and uh just optimize the process the goal is to make the liquidity liquidity provider able to to to create strategies with its yield and so going through ap1 you would have a different experience than going to just spots rate of interest thank you very much [Applause] you