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

Loading player…

Compound Grants 🛠 Compound III

ETHGlobalMon, Oct 9, 2023, 12:00 AM

Join Compoud Grants for a Compound III workshop! This workshop is part of ETHGlobal's flagship online event: ETHOnline 2023! ETHOnline 2023 has grown into one of the most exciting events on our calendar, anticipated by hackers all over the world. ETHOnline is a three week long online hackathon with over $200,000 USD in prizes as well as a series of curated summits, celebrating some of the most significant happenings & learnings from the past 12 months in web3. ----------------- Follow us: https://twitter.com/ETHGlobal​ Check us out: https://ethglobal.co​m Email us at: hello@ethglobal.com

Transcript

[Music] welcome to the compound grants workshop for eth online 2023 compound grants is excited to be a part of eth online this year we're excited to see everything that you all build in the hackathon let's get started I'm Adam I'm the developer relations lead at compound Labs I'm here to help out with ethereum related development projects that use the compound protocol you can find me on Twitter and Discord I'm mostly in the development channel of the compound Discord I can answer your technical questions there compound grants is sponsoring the hackathon this year and we're really excited to be at this event we're we're ready to see all the cool things that you're all building and ready to help out with compound related projects and if you want you can apply to compound grants we can tell you a bit more about that if you're interested and help you get your application accepted so in in this presentation I'm going to tell you about the hackathon bounties for this year and if you're not familiar with compound I'll tell you about the compound protocol I'll tell you about the key differences between the protocols V2 and V3 V3 is the latest version that has new deployments that came out this year and a little bit of last year as well I'll tell you about protocol governance and I'll also show you some developer resources so you can get started building right away all right compound grants has a poundy prize this year of $5,000 USD to the best integration of compound 3 the rules are that your project must interact with a smart contract or with Json RPC with any instance of the compound V3 protocol or be a supportive project that is specifically created for the compound community's use all right a little bit about compound I work at compound labs and we're the authors of the compound protocol it's a protocol made up of several smart contracts running on ethereum mainnet since 2018 and our mission is to create efficient algorithmic money markets what gets me excited to work in the defi space is that we author and continue to Steward decentralized free and open crypto tools for everyone with an internet connection including the banked the underbanked and the unbanked and if you think about it that's a huge amount of Market to serve globally anyone on Earth with a smartphone and an internet connection can use dii and can use compound so historically we've seen interest rates for suppliers to the protocol as high as 15% % apy on usdc as well as other supported assets and I love that what we're doing is different from trafi because defi systems like the compound protocol are transparent and they're voluntary with public ledgers where code is Law and with defi you instead get decentralization and transparency unlike centralized Banking and Financial systems that's what gets me excited to work in Defi and also in the ethereum space what is the compound protocol simply put it is crypto asset money markets and we refer to it as the compound protocol it runs on ethereum as well as several l2s that you can see here it's decentralized which I will explain a bit more shortly the main use case is that allows users to earn interest on their cryptocurrencies or permissionless borrow other cryptocurrencies so instead of an asset like ethereum or usdc sitting idle in your wallet you can supply it to the compound protocol and earn a varying interest rate users that Supply crypto collateral and borrow a different crypto asset against their collateral and the interest that suppliers earn is driven by the interest that borrowers pay those are the two basic uses of the protocol for everyone earn interest on your crypto or borrow other crypto assets the protocol can only support crypto assets that are tokenized on ethereum or other evm chains as ER c20s it allows suppliers to earn a variable interest rate on their assets an individual that uses an app like the ones listed on the compound homepage or their own code can use every feature of the protocol developers can build their own apps they use the protocol as interest earning infrastructure users or organizations can use interfaces to earn interest to borrow assets or participate in protocol governance so use cases that we've seen are crypto wallet applications they use the protocol to offer interest earning for their users and also any business that holds funds for a period of time they use the protocol to earn interest uh for that period to create some income instead of letting those assets sit idle so I'm going to give you a little bit of an example here let's say you use one of the many interface applications for the protocol you can supply assets to compound when a supplier supplies they get a fixed amount of C tokens which you can uh think about as a one one asset that is uh representing the underlying that you have in the protocol uh in V3 C tokens are only minted for the supplying the base asset they're not minted when you supply collateral uh they're 1 one and they rebase so uh when you supply you have this balance of C tokens your wallet and that balance will go up over time automatically and you can redeem those C tokens for your underlying asset at any time um I'll give more differences between compound V2 and V3 in a later slide uh those assets are stored in smart contracts that know individual controls there's an onchain government system that will be covered later C tokens are redeemable at any time users can supply for as little as one evm block and interest AC Cruise every evm block which is about 12 seconds nowadays on ethereum this enables on demand supplying and redeeming from the Protocol no need to wait for a lockup period you can earn interest for supplying to the protocol for even just one minute the other big use case is over collateralized borrowing of assets so user can supply a collateral asset before they borrow they can only borrow up to a certain amount of USD value of their collateral so the token value of their collateral is always worth more than their total borrow value re relative to USD so an example would be to supply a collateral like w Bitcoin or r ether or one of the many others and borrow a smaller value of D or usdc such that your account is over collateralized the limit of the borrow depends on the collateral asset there is a percentage called the collateral factor which is set for each individual collateral token type wrapped ether and wrapped Bitcoin have different collateral factors those factors are chosen by the community members and are selected based on perceived risk of the value fluctuation in order to borrow a user must Supply a supported collateral asset and they can then borrow in V3 there is only one asset that can be borrowed from each instance of comet So currently there are deployments of usdc and wrapped ether as the base asset so you can supply a collateral and borrow those two assets or you can earn interest on those two assets only those two assets so you can't earn interest on collateral and V3 uh but you can earn interest on the base asset if an account becomes under collateralized like when the USD value of the collateral goes down or too much borrower interest URS for that borrowing account the user's collateral can be liquidated and a liquidator will perform a liquidation by calling these two methods on the protocol they can call absorb and then buy collateral so what happens is the user's collateral is taken over by the protocol their borrow is repaid by by the protocol reserves and their collateral is sold off at a discount to a liquidator that can then swap it on a DEX for a profit so supplying only is safer than borrowing you can't get liquidated if you only Supply there's much less risk involved when a user only supplies and does not borrow Liquidators keep the protocol safe and collateralized they are incentivized to do so so borrowers that become under collateralized are subject to liquidation of their account at any time they will lose all of their collateral but they will get some of the base asset back after the liquidation process ends due to the autonomous nature of the protocol the liquidation system is much harsher than traditional Finance there's no negotiating there's no delinquent repayments allowed with the onchain code so the latest version of compound is compound 3 it is more gas efficient and capital efficient than compound V2 it streamlines the most popular use case of compound V2 which was to supply a volatile priced asset like R Bitcoin or ether and then to borrow a stable pric asset like usdc or die this version has additional safety for liquidations it has a higher threshold for the same collateral Factor so you can borrow more with the same collateral one asset can earn interest or be borrowed per deployment that's called the base asset and it makes opening positions in V3 have less stacked risk than V2 currently there are seven deployments of compound 3 there are deployments with usdc and weth as the base asset and that is on ethereum Main net and also on base there are deployments on other chains like polygon and arbitrum and there are many more to come soon this version of the protocol is able to be deployed on any evm chain the key differences between V2 and V3 are that V3 has less risk less gassiness and can be deployed anywhere that solidity is supported V2 you can borrow any supported asset but V3 you can only borrow the one single base asset per deployment of comet compound V2 and V3 coexist V2 is not going anywhere however there is a deprecation going on by the community at the moment you can follow along with that at the forums at www.c comp. XYZ basically what the community is doing is they're lowering the protocol rewards for v2 and also incentivizing users to move from V2 to V3 so here's key differences between compound V2 and compound V3 in compound V2 C tokens are minted to the suppliers of any asset and C tokens are about a 50 to1 ratio and the C tokens Can Be redeemed for more underlying as the block height increases in compound V3 C tokens are only minted for supplying the base asset and those tokens are one to one and they're rebasing so that balance automatically goes up in your wallet in compound V2 you can borrow any asset supported by the protocol but in compound V3 you can only borrow the base asset per deployment of comet and currently there are only two base asset deployments usdc and wrapped ether compound V2 was a single system with many assets it's only running on ethereum mainnet and compound 3 is a single asset Focus per deployment and it's running on several l2s as well as ethereum midet compound V2 is a single protocol deployment on ethereum and compound 3 be can be deployed on any evm chain uh in compound V2 Max borrowing and liquidation are at the same point so if you borrow the maximum amount Allowed by your collateral you'll get liquidated in the next block in compound 3 there's a separate Max borrow and liquidation point so there's a no new borrows period which makes it safer for borrowers to borrow the maximum amount and they won't always be liquidated immediately in compound V2 you can earn interest on any supported asset but in comp compound V3 you can only earn interest on one asset per deployment and that's the base asset in compound V2 there are some assets that are not valid collateral they can't be used as collateral to borrow other assets and in compound 3 there is no interest for uh suppliers of collateral collateral is only used as collateral in compound 3 so in compound V2 there's an integrated comp distribution into the comp troller contract in compound 3 there's an encapsulated rewards contract that can be used with any erc20 token it's outside of the protocol and is a little bit meter from a developer point of view compound V2 has one account controller and that's the one controller of that account in compound V3 there's account manager so you can approve uh a different manager for your address or you can revoke those permissions later and those permissions allow an account to uh transfer or borrow or withdraw on behalf of that account compound protocol is decentralized and it's governed by the comp token holders the comp token is a uh erc20 token that can be used to propose onchain protocol upgrades or to vote yes or no on those proposals and the community can make those proposals the contracts for governance are in the compound Finance GitHub organization under the compound dproc repository you can check them out there there's a governor contract as well as a comp token contract so the comp token is the voting and proposing token that allows onchain governance to function for the compound protocol the protocol has been decentralized since June of 2020 and the comp tokens have been distributed to users of the protocol in a slow drip and those users can take those tokens and vote on proposals or they can create their own onchain code proposals to upgrade protocol code or protocol asset configuration settings and with this token you can delegate your voting weight to your own address or you can delegate that voting weight to another address so say there is a a delegate that has more knowledge than you of the protocol uh many addresses can delegate to that one if they trust them to vote on their behalf or you can always vote on your own behalf if you delegate to your own address the governance process is a 7-Day process for ethereum and it's an eight-day process for all l2s so what happens is a Community member will make a proposal and there's a two-day review period where all of the other community members can check out that proposal make sure it does exactly what it says it does there are no bugs there are no issues and also the consequences of that proposal succeeding for um for apps that depend on the protocol or other protocols that use the compound pound protocol as infrastructure after 2 days of review there's a voting period where anybody with comp tokens delegated to their address can cast their vote on The Proposal whether they they can vote in favor or against the proposal after the 3-day voting period The Proposal either succeeds or is defeated uh needs to reach Quorum of 400,000 votes in order to proceed after a proposal succeeds it is in the time lock for 2 days where it is queed and then executed and after it's executed there's an additional day and execution for all l2s so what happens is the time lock will pass the message to the bridge for the L2 and then there'll be an additional one day time lock on the L2 before it's executed on the L2 so those are only for proposals that affect the comet deployments on other chains than ethereum the time lock phase is only 2 days on ethereum so if you're developer you can head over to docs. compound. finance to find Smart contract method documentation you can find contract addresses as well as SDK documentation explanations for how each of the contracts work and links to guides and security audits if you have a technical question or just want to join the community conversation you can go to compound off Finance Discord and join the Discord if you want to apply for a grant to work on something in the compound ecosystem you can go to questbook doapp if you want to see code examples for building on top of compound you can go to the compound DD developers GitHub organization or if you want to see the compound protocol smart contract code you can head over to the compound DF Finance organization on GitHub here's the workshop we're going to be working on today you can head over to GitHub and check out this repository you can always clone it it's open source and you can use this QR code with your phone if you want to check it out on your phone compound grants is an independently LED organization that funds projects that are working on the protocol you can head over to Quest book.

app if you want to apply for that program they have rolling applications they have funded many builders in the ecosystem and got them going building on compound if you have more questions about that you can come over to US during the hackathon and ask us and we're happy to help and connect you with the right people to get your project approved for a grant if you're not what you want to build in this hackathon we have an ideas blog post you can head over to this link if you want to check out that ideas post we have several ideas that can help you win this year's hackathon Bounty for eth Global New York and you can also see links to previous year's winners of hackthon prizes in the eth global hackathons so please check out this blog post next I'm going to walk through a developer workshop and show you how to build a Dap that you can use to uh interact with compound 3 on ethereum mainnet as well as base here we have a repository for the code in this Workshop uh you can clone this code and use it for your own project in the ethon line hackathon here we have code for a Dap that uh has a server which hosts a uh ethereum provider uh that hooks up to uh Json RPC through Alchemy and it connects to mainnet or base so you can use a forked version of mainnet or base to interact with the compound protocol via this user interface and I'm going to show you how to select the right network uh you can get Json RPC provider URLs from alchemy.com for free and when you run the server application locally it will Fork the the network that you choose and uh you pass your Json RPC URL as a environment variable to the start command for the npm server uh it is a JavaScript no. JS uh Express server and uh first you have to install node.js if you don't have that already and I'm going to clone this to my machine and I'm going to walk through the code and show you how to use it so I have a command here to clone to my machine go to my terminal going to paste in this command then I'm going to change my directory and then I'm going to use the npm install command which will install all the dependencies so I'm going to cat my package.json file so you can see that there are three dependencies in this project they are ether's Js expressjs and hard hat I'll walk through how those are used I'm going to open this in a text editor I like Sublime so the first file I'm going to look at is a uh server script so this runs on my local machine um you run this using the npm start command I have all of the relevant contract addresses in this file here called addresses.

JS so this references the compound protocol open this file here we uh reference each of the assets that are supported by each of networks that compound 3 is on so in this Workshop we're supporting main net and base so the assets that you can use compound 3 with on those networks are listed here as part of the server script we're going to uh Fork the live blockchain to a local version we have here where we can uh control more factors like the gas cost and we can uh send ourselves tokens for free so we can do that everything that we need to do for testing purposes so I'm going to show you where I got all of these uh addresses if you head over to docs. compound. finance you'll find the compound protocol documentation and there's explanations for every concept of the compound 3 protocol as well as method documentation for the smart contracts and we have addresses for the relevant smart contracts here including each of the assets that are supported by the deployments now of course you can switch the comment deployment by clicking on the tabs here and the addresses down here will change and you can uh find the ones you need so in this Workshop we're working with mainnet usdc and we and also base USD BC and base we as well so you can use the copy button to copy these contract addresses and you can paste them into your files here so we have four parameters for each of these asset objects and this is used in our server file down here we have uh seed local Dev account we have our test account that's going to be running on our local machine with uh 10,000 uh base token well on mainnet it's ether and also on base it's ether so we get 10,000 ether to test out things with on our local machine and we can also seed our local Dev account with erc20 tokens in addition to the gas token so we do that using uh this function I wrote here uses the hard hat impersonate account and it basically moves some tokens from a whale to our test wallet address so that we can use them in our dap user interface so each of the assets you see here we have the asset address itself the whale in this case for we there's some we sitting in the contract itself that was accidentally sent there so we can take some of that and send it to our Local Host account so this is the first address of my development nemonic and my development nemonic is listed in my hardhead config file so definitely do not use this on any network besides uh local host or the test network uh you don't want to use these on mainnet there are malicious actors that will Honeypot and steal tokens so definitely do not use this neonic on a live Network only in your development note it's fine uh so the first address of that neonic is here and this address will have 10,000 gas tokens and also thanks to our uh server script will send us a bunch of erc20 tokens so in this addresses file I also specified the amount so for rap Bitcoin here we're going to send ourselves five rap Bitcoin 5,000 usdc Etc and you can change these however you'd like and find whales on ether scan or block Explorer that you want to uh take some assets from for your testing purposes on your local machine so we run this server script uh we have our provider URL from hamy as a environment variable and the script will use that to boot up Jason RPC server on your machine we specify the network we want to use as an environment variable we want to run our dap and test against mainnet we could pass mainnet as a parameter or we can pass base as a parameter the server will the the script will start up an Express server and serve the files we have in the public folder here we have some HTML CSS and JavaScript that I'll go through in a few minutes and uh we're going to listen on Port 38 so you can visit this address in your web browser and see the user interface we create create ajacent RPC server using hard hat and it's going to use the configuration that's set in our hardh hat. config.js file and we're going to have either a mainnet fork or a base Fork so I delete that uh and we're going to seed our first address in our neonic with the rc20 token so this Loop here goes through each of the assets for the network that we selected so we got mainnet and base in our addresses file so based on whichever one we choose we seed each of those assets to our first address and then once that's done we'll see ready so I'm going to run this script I'm going to run it against mainnet we're going to do that by doing npm start mainnet and I already have my environment variables for my Json RPC API URL as um listed variables in my my configuration for my terminal so I don't have to write them out here like you see in the GitHub readme so I'm going to run this command and we're going to see that our interest rate dap is served at Local Host 30008 we have our ethereum node Fork running 8545 and we seated our development neonic account with rap ether rapid coin and usdc these are assets that we can use with the mainnet instances of compound 3 so now that we're ready we can play with this app okay here's what our app looks like in the browser we have the two deployments of compound 3 on ethereum mainnet we've got C usdc V3 as well as cwe V3 we can select them here in the select box we can supply or borrow the base asset and when we select an instance of compound 3 we can see the supply APR and the borrow APR So currently for ccv3 on Main net we have a 2.

98 supply APR and we have a 3.92 borrow APR we can supply collateral down here if we want to borrow so you need to supply collateral before you borrow so we can choose an asset to uh Supply here and we can also withdraw it and then down here here displays the balances we haven't interacted with compound 3 yet so our balance for every asset is zero and of course if we take a look at our metamask we have 10,000 ether that is test ether on our Local Host account we have five wrapped Bitcoin and five wrapped ether as well as 5,000 usdc thanks to our server script that seated our accounts so these are all test assets available on Local Host only so you can play with your fork blockchain here in test mode when we switch the comet deployment using the select box we have a different APR listed so this is for the cwe V3 deployment on ethereum mainnet have a 1.86 Supply APR and the collaterals that we can supply are coinbase ether as well as wrap Stak ether so these are the main net deployments of comment I'm going to show you how to set up uh your app so you can play with the base deployments next but before I do that I'm going to show you the frontend application code so here we have our uh HTML uh we have an ethereum enable button in case you have not uh enabled metamask to work on this web page you can click on this button and metamask will pop up requesting your permission to allow the page to use your wallet we have our select box here which gets filled with the instances of compound 3 we have those listed in our constants JS file so this is a Javascript file with just some references we have uh each of the asset addresses of the compound 3 instance we have the address of comment we have the name that shows up in the select box as well as a value we can reference in our JavaScript code later the chain ID so we can differentiate between base and Main net we also show asset address symbol and decimals so we can do math to supply and borrow the right amounts later so we fill in our instant select box which we can see here I've already enabled ethereum on the page so we don't see this button hidden and in our three little models we have on the page we have a way to supply uh show the supply APR and the borrow APR as well as a button and a text box for entering an amount to supply or withdraw and then down here can also Supply or withdraw collateral then we have our little asset interface that displays our balances within the comet protocol so we haven't done anything yet each of those balances are zero so at the bottom here we have a reference to ether's JS we have version five that we get from a Content delivery Network we have our constants JS file which has all of the references to uh the elements in HTML as well as our abis and some Json objects with the compound 3 instance information and then the important file is app.js that's where all of the logic happens for the functioning of this stab let's take a look at that here's our app.js file we have an event that fires only after the web page has finished loading that's when uh each of these functions run we have a selected account which is the first account in our metamask that we're using to interact with the page we don't have an a window.

ethereum object uh there will be an alert to the user saying install metamask to proceed using the page you can't use the DAP if you don't have a web3 wallet we're going to make a request to the ethereum object to get the accounts and once we're connected we're going to fire this event here and if we click the enable ethereum button which you'll see on the page if you're disconnected uh it'll also fire that event so first thing we do is get the chain ID so we can differentiate between main net on ethereum and also base they have different chain IDs uh we're going to get the first instance with the matching chain ID from our constants file so if we're connected to ethereum mainnet we're going to see uh usdc V3 and if we're connecting to base we're going to cdbc V3 as the first instance in our select box so we go through each of the common instances and uh set up our options we have in our select box we select our account thanks to metamask and ether's JS we allow our instant select box to be seen on the page it's hidden at first and the ethereum enable button is hidden if we're connected uh with our metamask wallet we set up an event handler for our instance select box so every time it changes it's going to rerender the user interface with the newly selected common instance so you can see a different APR and you also see different collaterals available to supply and borrow from the protocol of course you're not able to borrow collateral that's a key difference between compound V2 and V3 so the are just collaterals that you can supply and withdraw we have our render UI function here this uh basically sets up all of those elements on the page we saw uh we refer to our instance of comet uh by index that we have in our constants JS so there's four available that we can use in this St at the moment uh we assume that the first one listed in the array is the base asset so that's either usdc or wrapped ether each of the collaterals are all the other Assets in that array we set up our collateral select Box by adding option elements to that um select box HTML element and we add one for each of the collaterals so we can select it and uh Supply it using the little model here so we could select a collateral and then put in a number here and supply we get the aprs of the instance of comet that we're referring to we use this function uses ether's JS to create a contract for Comet we have some of the Comet methods referen we have our ABI here for getting all of that data from the comet contract going to get the utilization Supply rate and the borrow rate we're going to do some math to show a human readable percentage and we're going to return an array with the supply and borrow APR and we're going to set those numbers in our HTML elements here we're going to chop off any excess decimals because sometimes JavaScript math will leave us with a lot of decimals so to make it nice and neat for the user we'll do the two fix method and then we're going to set up event handlers for each of our buttons so when we click the base asset Supply button we're going to supply we're going to specify the number that the user put in the text box we do that for withdrawing as well as collaterals withdrawing supplying let's take a look at those Supply and withdraw functions so again we're setting up a ether's contract we're getting the signer for metamask uh we're finding out the specific data about the asset which which we have listed in here we need to know the symbol the decimals and the address we set up a contract for the specific erc20 asset we use the erc20 approve method to allow Comet to Move It from the end address to the comet contract we have the receipt use that we can log it later so we can debug if there's an issue and this transaction here supplies to Comet and we log the error in case there's an error withdraw method is pretty similar doesn't have a erc20 transfer because doesn't need it we withdraw we can send the assd right to the end user address when they're ready to withdraw all right so the last thing we do when we render the UI is we draw the balances so this is only for once a user has begun using Comet they will see different numbers here in the comet balances area of the dab so we use our get balances function we're going to make a contract for Comet and we're going to go through each of the assets that are available to use with Comet and we're going to use the user basic as well as the collateral balance of functions uh for our account that we have selected in metamask we're going to get the balance and we're going to take all of those requests wait for all of them to finish using promise.all and we're going to have an array of balances and we're going to uh add them to our result and return it to our render UI function or sorry our draw balances function which is here and then after we've gotten all the balances we can insert them into our HTML here in a label and it'll show the balance as well as the symbol of the asset so like we see here we have wrapped ether and zero the user has not yet used the protocol uh so that's how each of the balances is written to the page and that is all of the JavaScript in app.js let's try and use our app so the first thing I'm actually going to do is I'm not going to use it with ethereum mainnet I'm going to try and use it with Bas so in order to do that I'm going to kill my server script and instead of using npm start mainnet I'm going to change it to npm oh npm start base like that and you'll notice that the logs are a little bit different from earlier we're going to seat our account with USD BC CB e comp and wrapped ether so this are the assets that can be used with the base deployments of compound 3 so we have the same application running at the same address except when I refresh this page it's going to show me the base and instances okay it's not going to show them to me just yet because my metamask is not set up for the Local Host server so what I'm going to do is I'm going to go to metamask and I'm going to open my settings and I'm going to go to General I'm going to go to no General is not the right place I'm going to go to networks and I'm going to go down to Local Host 8545 and that's going to open a new metamask page for me I have the Local Host 8545 Network selected and it's going to try and get the chain ID and obviously there's an issue because chain ID one is for ethereum mainnet uh base uses a different train ID so if we go over to our server file oh no not our server we want to go to hard hatc config.js we can see that mainnet uses a chain ID of one and base uses [Music] 8453 so I'm going to copy that value this is the Local Host node configuration that we set up we have uh the chain ID based on the network we're connecting to we have our Dev neonic here which is what I have in my metamask for interacting yeah I'm going to take this chain ID I'm going to paste over with the the base one because that's the network we're forking now uh with our hard hat node that we're running locally we going to save that and it's saved successfully because it's connecting to my local host node I've running right now okay so when I go back to my dap when I refresh the page this will now say base great so we have cus DBC V3 base the current Supply APR for that version of usdc is 1.78% and the available class we have are wrapped ether and coinbase ether so if I go over to my metamask you can see I have 10,000 ethereum I have 100 wrapped ether I have 5,000 us DBC and five coinbase e and the place that I Define this is in my addresses file which my which is server side my server references the addresses up here at the top go over to addresses and we have base so we're going to seed our Local Host to account with each of these four assets so 5,000 USBC uh we have five CB e and 100 wrapped ether so that's what we see in our metamask wallet over here and if I want to Supply the base asset which is USD BC I'm going to try and Supply 100 when I click this button metamask is going to pop up and ask me for uh approval okay I got a non issue with my metamask because I did not reset it so this is a simple fix you go into metamask setting uh Advanced and you click activity oh sorry click clear activity tab data this will clear my non St so metamask does not get confused when it tries to submit a transaction to my local host blockchain so I'm going to try again I'm going to try and Supply G to try and Supply 100 USD BC well it's going to approve it first and once the approval transaction mines was takes just a second on my Local Host hard hat node Fork uh and then we can do the actual Supply method so we're going to supply and it's going to cost us this very small amount of ether in gas going to confirm and then you can see down here that my us DBC balance within the compound protocol is now a positive number 99.

99999 and here we have our uh transaction receipt that we logged to the console we did this within app.js here we have our receipt that we log to the console can check out the events that fire our uh token transfers as well as Supply events within comet and next I'm going to try and borrow so in order to borrow I need to supply a collateral I have 100 wrapped ether so I'm going to supply 10 of them to the protocol okay once they're supplied we can see that my balance is updated since I interacted with Comet it actually recalculated the amount of us DBC owed to me which is now more than 100 because interest acred in the time that uh it took me to supply my collateral so now that I have collateral supplied I can actually borrow USBC and I'm going to try and borrow a number that's greater than I have already supplied so I'm going to try and borrow 300 so I should have a USD BC balance of like -200 once I uh withdraw so actually this is the wrong text box I'm going to put it here and put 300 I'm going to withdraw and metamask is going to give me one transaction that I can do and yep now that it has M and mined instantly here's the uh receip we can see that I have a negative balance of USD BC and it's slightly less than or actually more than uh 200 negative2 200 USD BC so this is a little app you can use to supply collateral or Supply the base asset or borrow the base asset and play around with compound 3 you can set it up for uh base uh you could use either of the deployments on base or mainnet remember you need to change the chain ID within your uh meta metamask local settings like I did here and you can choose the instance or or you can choose the network that you're using by uh choosing a parameter here for your npm start command you can use Bas or main net and you can check out those configurations in the server JS file as well as the hard hat config you can build on top of this you can add more deployments of compound 3 which we we have in the documentation you can check out each of those addresses here and you can change uh this app to whichever uh addresses you need for whichever Networks you're working on uh each of the protocol contracts for compound 3 have explanations listed here in the documentation there's also more developer resources available including some code examples in the compound 3 developer FAQ this is a a GitHub repository with a bunch of tests as well as solidity code for interacting with compound 3 a little bit more uh deeply than I did in this demo we have examples for uh running uh proposals and upgrades to compound using scenarios migrations and workflows there's a guide here if you want to look at that you can create your own Liquidator for insolvent positions on compound 3 you can liquidate them or underwater positions you can liquidate underwater positions using this this guide you can also build a common extension that goes in the app. compound. finance extensions page you can have external apps there and this page also has a search box at the top you can search for uh any uh methods or relevant topics for comment here and you can go to those explanations and read about them remember if you want to apply for a grant you can go to Quest book.app and you can build on compound and get uh paid to do it using using the questbook program so again that's at questbook doapp you can find us in Discord and we'll explain how to apply for a grant here or you can head over to this page and try it out for yourself apply for a grant uh to build on compound compound and of course if you want to get involved with the compound Community you can always go to comp.

XYZ which is the forums so here's where the discussion happens for uh compound protocol development and upgrades Community talks about what they're going to do next with the product roadmap of the protocol also discuss uh development Grants New Markets governance process and we talked about time of developer calls and Discord everyone is welcome to attend there or state your opinions here or create new topics here and join the discussion at www.c comp. XYZ I hope this Workshop was helpful to get you started working on your hackathon project remember there's a $5,000 USD Bounty for the best project building on compound 3 or for the benefit of the compound community on behalf of compound pound grants thank you for coming to the hackathon this year thank you for watching my presentation best of luck to the hackers in the hackathon excited to see what you build remember you can always message Us in Discord we're happy to help you out with technical questions or explaining how Concepts work in compound 3 and we're also happy to review your project and let you know if it's eligible for the Bounty thanks again for watching and hope to hear you from you soon and best best of luck to the hackers in the eth online 2023 hackathon

Automatic transcript — names and jargon may be misspelled.