# APWine 🛠 Your first Future Yield strategy - Ulysse Ramage

- Channel: [ETHGlobal](https://streameth.org/ethglobal)
- Date: 2022-10-09
- Duration: 25:49
- Topics: Science & Technology
- Watch: https://streameth.org/watch/yt-0t9PL4TIFPQ
- YouTube: https://www.youtube.com/watch?v=0t9PL4TIFPQ

## Description

Welcome Ulysse Ramage from APWine for a workshop titled "Your first Future Yield strategy".

ETHOnline is our biggest event of the year! Collaborate with thousands of developers and creatives from around the world and win over $300k+ in prizes! We're bringing in 30+ of the biggest teams in web3 to give you access like never before. Learn from ecosystem leaders and build your biggest ideas as the merge nears reality. The future of Ethereum is being written right now, and it's time to make your mark.

---------------------------------------------------
Follow us: https://twitter.com/ETHGlobal​
Check us out: https://ethglobal.co​m
Email us at: hello@ethglobal.com

## Transcript

[Applause] [Music] welcome everyone um good morning good evening good afternoon depending on where you're calling from um we have euless here from ap wine doing a workshop on your first future yield strategy if you have any questions they can go into the zoom chat and ulis will be more than happy to answer them and with that being said i will pass the mic off to our speaker all right thank you very much anna um hi everyone nice to see so many people here um my name is julius i'm one of the co-founders of ap wine finance where um you know to get the gist of it we're a platform a d5 platform for tokenizing future yield and getting your interests in d5 in advance so let's see you know together um how this works we're going to be introducing ap wine first and then we're going to be building you know what's a strategy together uh about how to get your interest in advance over an entire three month six month one year all right so ap1 is building derivatives on yield this is how we introduce ourselves the the reason this is a quick introduction about the protocol itself uh the reason we did this in the first place was because in the d5 summer of 2020 if some of you have witnessed it there was extremely volatile yield with a lot of risk and so a big exposure to volatility on this uh on all these apys annual percentage yield so we just came up with the idea what if it was possible to get your interest ahead of time and at a fixed trades and this is how we came up with the idea the idea of yield tokenization is a primitive that we've introduced in d5 that allows you to buy sell and hedge your future yield now how does it work very simply you get your interest bearing assets or whatever uh if you're using wiring you can use you know wi-fi stake wi-fi uh interest bearing assets such as a die on ave ausdc and so on so this is a token that generates yield over time you deposit that on ap1 and you get two different tokens and this is the yield tokenization you get one principal token which is the initial value of your deposit and then your future yield token which is worth zero at the beginning but is going to contain all the yield generated by your deposit so at the beginning of the period you know three months six months whatever it's worth zero dollars and at the end of the period it's worth exactly whatever was generated so once you get these two tokens uh you can already imagine how to build strategies on top of that and to get your salary in advance your yield in advance you effectively effectively need to to sell your future yield token on our exchange so min pt and fyt with ibt and then burn you can withdraw at any time you're never really locked on ap1 um now i'm not going to go through the ap1 amm too much in detail but uh it's basically you know we've we've built this in-house uh kind of like unisop balancer and so on it allows you to trade your pt ibt and fyt together um so you can either buy pt at a discount for example this is basically a fixed rate but not advance rates and if you buy fyt you get more exposed to the volatility if you sell fyt you get less exposure so you get your yield in advance and at a fixed rate so there's a lot of some of them have already mentioned but the pt trading buy pt at a discount wait till the expiry of the period and get your yield at a fixed rate um another one another fun one is the yield section so basically sell your yield in advance and then reinvest it to sell it uh you know as long as it's profitable you can do this kind of loop there are other strategies that i'm not going to go through today but we're going to be building our own little strategy uh fixed rates selling future yield so leverage the yield tokenization of ap one ap1 amm to secure fixed rates on your yield now in order to kind of follow along you're going to need node.js and yarn so there's probably we can share the slides on on the discord after that so you can kind of follow along if if you want to after that um but you're going to need the repository that i'm going to github.com slash euler dev ap one dash workshop so let's do this first step now i'm gonna clone this and we're gonna be navigating through it opening it in a visual studio all right and i hope this is visible enough the the size and everything um so let's let's go to oops sorry this is not the right folder if you want workshop and then code all right so here we are um first thing you want to do is install the the dependencies of you know the node modules so just yarn simple you just install everything this is the setup of the repository and then you're going to want to go to the red readme to kind of get an overview of what this is and you're going to want to copy this environment file to a local dot amp file the private key that i've shown here is just an example private key so you know it's linked to a random account to test out and the alchemy api key is um i think it was abused before because it's a public repository so i think it's disabled now but we're gonna go you know i'm just gonna for the sake of this workshop go through another key okay now that everything is set up you can just start your node so we're gonna be running a local ethereum node so this is very simple just yarn start and there you have it and next you want to open another terminal and just go you know yarn step one yarn step two uh to follow along uh this workshop just like that so yarn step one and boom you get the first step which are all gonna be in the scripts and then step one step two step three step four and step five um okay let me see yeah app is inactive so let me just uh quickly sorry about that let me just quickly go through alchemy and get the new api key all right we're gonna be um sorry one second um we're going to be getting another api key because this one is not working all right um all right thank you for waiting here we are just copy paste this um and then we're good to go we can just go through the step one again [Music] all right um just give me a minute to fix this i'm not sure what's going on okay you are in step one let's go okay we're good to go thanks now um as i've said before the uh the first step that we're going to be going through and let me just put back to the parameter here the first step is going to be the sdk creation so for this you're going to want to import the ap1 sdk and it's going to be just a very simple sdk is equal to new ap1 sdk and here you want to pass your provider your signer and your network uh by the way we're going to be you know using typescript for this workshop it's it's pretty simple to use so you can just follow along here and you can see here that we're initializing the sdk with our provider signer and network on mainnet and if you run the command like i've just did you can see that it shows okay where we've initialized the sdk now the second step is you know the world is now open to you the world of apy and so you can just start getting all the information about the products that we have about the futures and so the assets that are available on the platform so if you want to get a list of all the assets on ap1 you can just go through uh future votes is equal to sdk dot fetch all future vaults and this is what we'll be doing here so step two now we go to the other file and then we just do futures is equal to fetch future aggregate from address this fetch a little bit more details a little bit more complete and i just want to take this opportunity to point out that we are using an old block number for this workshop you know so that it's kind of reliable every time i do it so where you can find here that um so which block is it reset quark so this is the block number that we will be using so this is a little bit in the past all right so now let's run the step two and we're gonna see what assets are available on the platform and how we can use it so it's fetching all the 10 future volts that were available at the time now we have almost 30 future volts on both polygon mainnet and coming to arbitron very soon right so it's fetching takes a little bit of time to fetch everything by the way we're running a fork here so this is our local node that we've kind of pinpoint to a specific block number and this allows us to do a local fork of maintenance so now this is done we can see that we have xsdt from stakedown we have state eath from lido and so on so this is all again in the past which is why you see past dates dates but these expire you know in three months and so on so now for the step three now that we have all the assets and all the addresses of the futures what we want to do is get the basic apr for a specific asset and for this workshop we will be using the state eth strategy um so let's let's do this we're going to get the spot price on the amm to do this you just need to run sdk dot fetch spot price and then you specify the vault that you just fetched and then the from address and the two address the from and the two are actually two tokens that you want to swap between on on our amm so here what we want to do is uh you know for example from underlying which is going to be eth to pt which is going to be locked if for the entire period and this is how you can get the fixed rate on ap1 so let's do yarn step between all right now it's computing the apr and by the way all the data that we fetched before is cached so it allows you to be a little bit faster in the future runs and so now we compute the pt apr the pt apr for state eth so for e basically is 35 at the time uh you know where i created the workshop so it's it's really nice and there was a lot of opportunities at the time and there still are in the platform i encourage you to go check it out for yourself 35 is very good again this is a fixed trade so now is this efficient um can we be more efficient with this uh so lower our liquidity uh needed to get a better or same result and in fact yes and we're going to go through how to do this in this today's strategy so today's strategy is not just buying pt with underlying but really going through the fyt routes so tokenizing our ste into pt and fyt and then selling the fyt4pt to maximize our fixed rates and to do this we we just want to go through a few steps so imagine you have your eath at as a beginning as an underlying asset you want to first deposit online the finance so get your state eth and then deposit on if you want to get the pt plus fyt um so this is what we will be doing we're going to be tokenizing this step and to do this we're going to check how we do it so first step is going to be depositing onto a lightly finance so we start with some wrap eath um and we just uh deposit our amount to tokenize which is you know 1080 onto lido and to do this i've just set up a very simple utility method uh if you check it it just sends if to the sd address this is how you deposit on lidu once we have our state eath so at this at this stage we can then uh tokenize our our ste by depositing it on ap1 and to do this you just want to sdk.futurevolt and you just call the deposit method on the sdk so here we are you can also select to automatically approve uh you know automatically run a approval transaction so this just prevents you from writing two lines instead of once it's kind of a utility method that we've put in the in the sdk so let's run this and see how it goes so again two very simple steps deposit on lido and deposit an ap1 and if we do this we deposit 10 ether lido and then we deposit all everything that we have on a p1 again and we get 9.93 pt and 9.93 frt and before we call me a scammer and why did you get less pt and fort than you've put eve this is just a regular function of the of the protocol basically since the pert has already started you're you're getting an fyt that already has some value so if you withdraw your 9.93 pt and 9.93 fyt you're going to get your your 10 state if back exactly but since the fyt has some value of course it needs to be accounted for nice so now what we want to do as the last step is swap all of our fyt so the 9.93 to our pt and again when you buy pt with anything even underlying rfit or whatever you basically get a fixed trade so here we're going to be maximizing our fixed rates this is the fifth step um so to swap on the on the sdk it's very simple sdk dot swap in you pass the amm object so which is going to be the address of the amm and then you pass very simple strings from fyt to bt and the amount and what this is going to do is automatically route through the pt so the fyt swapped to pt and then pt to eth um you know of course if you want to swap from f40 to ether this routing is is kind of similar to what you have on power swap or you know one inch or any kind of dex aggregator where you can do the automatic writing but we have this on ap1 so now let's see what is the result and how we can you know analyze it see what's the what's the purpose of doing all this if you go to this fifth step you can see here that we're just getting the amm address of our state e future so the future that we used before to tokenize we're now getting the associated amm address and then we just swap in fyt to bt and the result that we get is 10.36 pt which in a sense is a 36 percent uh you know rate uh is sorry a three point six percent rate um this is because you just did you know a a profit over u10 initial if so you're getting point 36 0.36 profit this is a fixed rate again um and if you look at the annualized you know apr uh you're getting 34.38 which is very close to what we had in the previous step now what is the purpose of doing all this this is all to say that ap1 is very efficient but this specific strategy is even more efficient in the way that it supports much better capital efficiency so you can have trades that are up to ten times as big as the previous step that we did before so you know something like 100k will very likely uh go through on ap wine you can try as much as one million dollars you know going through the strategy to get a fixed rate on a bigger capital um right and the this is a basically how you get a fixed rate in the in the most efficient way on ap wine now it is your turn uh of course uh hackers to to kind of hack around the protocol see how it can be integrated with other platforms as well or just you know other fixed-rate protocols you never know um so yeah it's your turn uh creative strategies get rewarded we have a few prizes up for grabs wherever whether it be arbitrage leveraged yield or trading box we're very happy to see what you come up with and as a last uh thank you uh for listening to this workshop i just want to mention also that we are hiring so if after the the workshop uh and the hackathon you've enjoyed working with ap wine you know working with our team asking questions if you're interested in joining the future of fixed rates and you know yield we are hiring so please reach out if you have any questions or if you want to get in touch the email is here contact at ap1.phi the telegram is at appoint finance please again reach out join the group and we can chat together thank you very much for listening to this workshop i'll pass it back to anna and thank you again for for listening happy hacking awesome i think you actually have a question um in the zoom chat yes yes please do please do um so what is the correlation between the apy of pt to eth oh sorry what's that um what is the correlation between the apy of pt to eth what is the correlation between the apy of pt to eve so i'm not sure i understand fully the question but okay you have an api on eth on lido finance so you know right now it's it's shown for example around five percent last i checked um so this five percent is what you're getting on a variable rate right on ap wine of course this is the beginning of the platform and this is why there are many opportunities but in the long term the apy on ap1 is going to very closely match that of light of finance you know it's just logical now the relationship to this apy shown on light of finance and the apy shown on ap wine as the pt fixed rate is that you're getting this one not as a variable rate but as a fixed trade you're simply buying pt with your eth in order to fix your rates this is basically how how it works and logically you're going to have a discount so if you're getting five percent on live finance you're going to get something like 4.5 on ap1 as a fixed trend so there's always going to be some kind of discount i i hope this made things a little bit clearer but you know please uh please um ask away if if there's any other point to clear up thank you yeah it looks like cleared up thanks for the answer um and then uck asks what are the competitive advantages of ap wine over since finance yeah sure um you know we're uh i feel like i'm doing this question over and over every time i speak but uh i i think it it would be nice to for you to join the group uh kind of learn more about ap wine we have a docs at docs.api.phi uh basically we made our own amm uh in-house we launched the v1 one year ago um and yeah i feel like there's an entire you know competitive space in the fixed rate and advanced yield platforms so there will be a lot to discuss on these aspects but please reach out uh you know to kind of get your own opinion on how ap1 is different you know from element sense uh you know pendle there's so many to talk about but it it's very good thanks for the question um can you customize strategies and interact with router or wrapper contracts yes of course you can you can do whatever you like you can even uh you know go through the contracts yourself uh the sdk is basically a wrapper for the contracts but if you're you know if you feel like a techie enough for this hackathon you can just dive into the solidity and build your own very very custom strategies this is more made the sdk is more made for off-chain computation but if you want to make an on-chain strategy you better go with solidity directly and you can also do new integrations with other protocols in that way um again every time you know i kind of reply please you know if there's anything unclear please let me know i'm just going to go through the next question so denny uh is asking if 1pt is equal to 1 eth and danny i think you got it right uh you understood the protocol very well so at the beginning of the period the 1 8 is not going to be equal to 1 pt this is because there's going to be a time discount so let's say if you have one dollar right now and one dollar in one year of course it's not worth the same amount in terms of value because you have more potential investing that one dollar right now into something else now at the end of the period one pt is always equal to one eighth and this is how the protocol works so if you just take this very simple fact you can buy pt at a discount at the beginning of the period because it's cheaper and then wait till the end of the period till one pt is equal to exactly one eighth and this is how you can secure the fixed rate this is the entire idea behind it thanks for the question awesome i think that's all the questions we have now if anyone has any more questions uh you have a couple seconds to send the zoom chat or you can even come off live um on uh or sorry ask your questions live um but otherwise um [Music] i guess that's everything well thank you thank you so much elis for taking the time to do this workshop for the eath online hackathon um and to the hackers uh as yula said if you have any questions they can be reached out over email their telegram or even in the eve online event discord in the sponsor ap wine discord channel and they are going to be available all month so super excited to see what everyone's going to be building and once again thank you for everyone for joining and um that being said i hope everyone has a great rest of your day awesome awesome thank you so much for joining everyone uh yeah uh thank you anna for inviting me and um please you know reach out for any ideas uh help on anything uh we're here uh you know we're here for you thank you so much happy hacking bye everyone you
