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

Loading player…

Sperax 🛠 Intro to Sperax

ETHGlobalSun, Oct 9, 2022, 12:00 AM

Join Rui Maximo of Sperax for a workshop titled, "Intro to Sperax." This workshop is part of ETHNewYork 2022, a three-day in person hackathon that will feature hackers, mentors, enthusiasts, sponsors and speakers who are all gathering in New York June 24-26, 2022 to talk about the future of money, finance, the web, ownership, the way software works and the way power is distributed. We're excited about a new frontier. ---------------------------------------------------- Follow us: https://twitter.com/ETHGlobal​ Check us out: https://ethglobal.co​m Email us at: hello@ethglobal.com

Transcript

[Music] hello everyone we are excited for you to join and participate in the sparex hackathon at 8th nyc 2022. my name is ray i'm cto at sparex what is ferrax we're our global technology firm building modern day money with blockchain technology our mission is to build a blockchain enabled society that is equally inclusive we launched in 2020 and the sparx team consists of engineers mathematicians economists marketing specialists and designers we are looking to bridge the gap for both experienced and novice crypto users by offering a capital efficient and scalable stable coin which generates organic yield automatically well how do we generate that yield well first of all we are decentralized and uscis holders that you and i who hold usds tokens can earn up to 11 target yield now how does that yield get generated you ask well we have different strategies that we use you can use curve and other ones like ave as well the vehicle for getting that uh yield is through our stable coin which is the largest stable coin on arbitrary we are 100 collateralized using usdc and usdt we'll add more um stable coins as collateral like dye for example and we also have a governance token called spa which will be used for governance activities now we have two prizes and two competitions go on the first one is for 2500 and it is to you to generate the highest yield strategy so your objective should you choose to accept it is to build a strategy contract that leverages the strategy template that we offer you and it will provide the github address for it and that automates the yield generation now the criteria for winning is needs to be the most innovative strategy there is no risk to the principle that you put in and it generates uh 20 or greater in terms of return the second prize is 24 2500 as well and it is to generate the most innovative utility for usds you'll want to leverage third-party protocols build an integration solution and generate utility for usds which is a stable coin the criteria for winning is to create the most innovative utility used for usds and has the highest utility rate or projected utility rate now if you want to read more about our usds smart contracts you can find it through this github link we'll also have it in other locations and you can read through it and then use the actual address on arbitrary for the strategy smart contract we also offer the github link for which you can build sample contracts and we have a great video walkthrough by one of our top engineers david hi everyone this is david i'm here to introduce our action project for eastern yc the objective of this project is to build a smart contract that can deposit stable coins into existing strategic protocols such as curve of it etc etc this smart contract should be able to accumulate interest or rewards produced by these protocols over time here is a diagram of the basic smart smart contract architecture the blue strategy contract is a to be built objective it interacts with a strategic protocols curve or other etc to deposit or withdraw stable coins we also have a vault contract and this contract will be prepared by spreads and no need for the participants to write or even modify this contract so the vault contract acts kind of like the owner of all the stable coins that we are dealing with at first it holds us all the stable coins and through a function called allocate it allocates all the stable points to the strategy and this strategy can deposit these these stable coins into the strategic protocols on behalf of the belt over time the strategy contract gonna accumulate some interest or rewards generated by curve or other etcetera and about at that time will be able to retrieve this interest or reward via function call also at any time the valve is also able to retrieve the stablecoin that was deposited into the protocols function call that is uh the strategy will have to withdraw from the protocols after receiving the stroke function called frontbot so that's the basic idea of the project the strategy has to be able to interact with the protocols and the valve itself to support all these functionalities that we mentioned here so we have actually prepared an example or a template of the objective of the strategy contract i'm gonna briefly go through this contract here to help you have a better understanding of what is required the first thing you notice is this contract is initializable abstract strategy contract in this abstract abstract contract we predefined all the events stage variables modifier and some functionalities that we think it's necessary for what is required we can see this in the implementation or the example in the template smart contract but here what what is important is first this contract also um has this i i strategy interface on strategy interface pretty much similar uh to the abstract strategy it's also kind of the skeleton what is required but eye strike interface is a little bit more generalized and the vault actually interacts with a strategy using this interface but the the takeaway is that pretty much just similar with eye strategy being slightly more generalized and this is also an initializable contract which means we are expecting a upgradable proxy contract and yes it's a horrible contract as there are some other actions uh going back to the um example so here the first thing is the initializer which is a constructor of the process um so besides the second parameters the valve address which is going to be the vault you might interact with all the other inputs here are directly related to which strategy protocols you choose to interact with in case for example let's say we want to interact with curves on stringbook then the platform address will be the address of the pool that is all the stable coins or clouds is going to be sent to that platform to that pool so this is the destination for the storage location of all the capitals this reward talking address in case of curve is going to be crv token because if you have the liquidity or position in the pool you can claim some crp tokens from curve and this is this might not be the case for some other uh strategy protocols um which you have you have to deal with it in this strategy contract the last two arrays are the acid or collaterals or stable coins that this strategy contrast supports um it depends on how you design the protocols for example if you are talking about curves report this actually can be an array of three uh collaterals that is like you can deposit uh any of these three colors into the pole and it and also it does not have to be three for example it can can only be one it depends on how you design the protocols how you design this strategy the p token is the lp token or the receipt token which usually the protocol will send back to you after you have deposited something into the pool in most cases the ptoken should be the same for all the assets here assuming they are all going to the same platform address but there are some corner cases so we make it as array as well so it will be a one two one relationship between the pitoc content the assets we choose and to go is those two already have to be the same be of the stiffness um your support collateral is a view function to tell to return like if this strategy supports the clutter you are asking me to support by support i mean if this strategy can handle that clutter if the strategy is prepared to send the catalogues to the poll and retrieve the catalogs from the pool and this is actually used in the about contract we also prepared kind of like a approved function so you can throw all the necessary approved actions into this function here this is a deposit function which where you have to define how you deposit the clutters or stable coins into the protocol pools we also have our straw functions which so those two are pretty much similar there's some slight difference on who's triggering the withdrawal but they all talk to the internal withdrawal function the first one is can only be triggered by the vote which means the vote uh calls what withdrawal and uh it will trigger this withdrawal function to withdraw do then with the trigger triggered action to withdrawal clouds from the protocols to strategy and registering them to the volunteer we also have a restore 2 valve i don't want to get too complicated here but it's pretty much a similar thing just that this action can be triggered by the owner instead of about uh we have this two function called collect interest and cloud reward token which is which is going to be triggered by this part where the valve called harvest to retrieve the interest and reward from the stretch that is about going to call those two functions and what the function to do is it collect all the interest and rewards and send it to the bond and the reason we are separating the earning to interest and reward is kind of it's um for example for curve the interest is like the the fee you get by holding the lp token which is uh once you hold the lp token as long as there are some um user interactions on the curve for itself you earn a little bit of fees so that's what we're referring to for the reward token um in case of curve is going to be a certain ritual which you you have to actively plan and store so we separate those two kind of um sources of the income and it's not going to be it's more it's generalized to the curves case but maybe it's not the case for the protocol you choose so feel free to modify this part and here we have some new functions to the first one to check the balance that is to check how much collaterals that was holded by the strategy contract and not necessarily holding in australian contract but those who has been deposited into the protocol we counted as part of balance as well so basically like how much how much of balance is available for me to withdraw if i call this draw from from the box we also have the view function to check how much interest and or reward that has been commuted or is claimable at this moment and here is internal withdrawal function you have to define this uh set a abstract set token uh you can feel free to change this this is just to um as you can see there are some approved actions where we need to allow the platform or the pool to spend our assets or p tokens but feel free to modify this part a good pool coin index this is just to as we mentioned uh we have um you you don't have to support only one cloud where we can support multiple ones depends on which which protocol you choose to interact with this is just to for example if you choose three then every every asset or avocado should have its own index of zero to two and this is it about the template and we have lists down all the two actions here uh and we are expecting some flexibility in your design so yeah uh that's it and for i can briefly go through the vault as well um but it is pretty much has been demonstrated in this graph like allocate all this withdrawal that's all the major three actions that is required and one thing is there's there's there's indeed some configuration that needs to be happened before before you can do all the actions that is uh you have to register the strategy contract you have deployed in the valve itself by calling strategy but we have prepared the script to do that and feel free to play around with it so we have a spherical asterisk to the mount which as you can see here we register the strategy with the month contract and also the class and we also have also prepared a deployment contract to help you deploy the strategy contract and this is pretty much it about whatever we have prepared thank you

Automatic transcript — names and jargon may be misspelled.