Enhancing DeFi with Automation with Sam Friedman
Ethereum Denver·Mon, Oct 9, 2023, 12:00 AM
Speaker
Four progressively more sophisticated DeFi strategies unlocked by smart contract automation: Level 1: Dollar Cost Averaging with Cask Protocol Level 2: Concentrated Liquidity Provisioning with Blueberry Level 3: Automated Leveraged Yield Farming with RoboVault Level 4: Compute-intensive, adaptive investing strategies with ChainML, Space & Time, and RoboDex Architecture High level code examples Benefits https://twitter.com/proof_of_sam Sam Friedman Solutions Architect Chainlink / SporkDAO Most recent first: BUILD Product Lead at Chainlink Labs Solutions Architect at Chainlink Labs Degenerate APE 2020 to present Ethereum miner 2017-2019 Bitcoin since 2015 Business Intelligence and Data Warehousing Enterprise software consulting Background in software dev for Bloomberg LP (TradFi
Transcript
Good morning. That was loud. Morning, guys. My name is Sam Freriedman. I work for Chainlink Labs and I wear a number of hats, play a number of roles here.
I've been the subject matter expert for our automation Oracle and I'm the technical lead on Build, which is our incubator program. And I'm available online. I've got my contact information here. Today I'm talking about automation in DeFi and what use cases it enables. Uh new use cases, interesting use cases.
And I'm going to explain this through a number of examples of projects that we've worked with. So the first is the future is already here. It's just not evenly distributed. Meaning that people are already automating or systems are already automated and it's a trend. They're only getting more automated.
it's unlikely that you have an automated system and you're converting it to manual. And the reason is automated actions are more accurate. They're less errorprone and they generally cost less. Um and if you look at markets, you'll generally find that the more liquid a market is, the more um automation they'll exist. So even in equities when people place like big block trades and all that done the orders placed manually orders typically broken up into randomly smaller bites to at least hide information.
All right so chain link Labs provides a number of different oracles. Automation is just one. I'm happy to answer questions at the booth about all of these. Um typically I get a lot of questions about our market data or price feeds. Um that's just one.
So another one is uh VRF which is randomness onchain proof of reserve automation which we're talking about today and CCIP which is our crosschain interoperability protocol. Some of these use cases um okay so how does automation work? Um developers will write what we call a hybrid smart contract. And by hybrid it means it has two functions. One function executes offchain and a second function executes onchain.
So the off-chain function is a checker. It checks for a trigger condition which might be a lapse time. It might be a schedule. It might be change of state on the blockchain. And that condition is checked every single block.
It's simulated. There's no gas. It doesn't change state. If that function returns false, then nothing happens. it just checks again the next block.
But if the function returns true, then it calls the onchain function which is a perform action which changes state. And that perform action might be any number of things I'm about to explain like rebalance a vault, distribute rewards, etc. Those hybrid smart contracts are executed by a decentralized oracle network. So it's not one node that looks at the contract. It's a number of nodes.
Let's say between 16 and 31 nodes depending on how much value is secured. They all check the contract. They all check the checker function and the perform function. And if they come to consensus on the results, then they put the transaction on chain. If there's no consensus on the results, then it just checks again.
All right. Some of these use cases use chain link functions which is a beta oracle we released a couple days ago. Um we're happy to answer all kinds of questions about this at the booth or if we have time at the end. All right, first use case, recurring payments or programmable recurring payments. Imagine you have a token gated service.
It might be crypto software as a service. It might be an app as a service. It might be entitlements to a Discord group where you get alpha or you join a community. um you would like to be able to accept payments in crypto, you can do that with Cask protocol. They have a widget that you can install in a web browser, excuse me, in a in an app in a web app or a plugin to Discord and users can pay in crypto and get an NFT and as long as they're making their payments every month, which are automated either automatically withdrawn from their wallet or withdrawn from a vault where they've deposited funds, their NFT is active.
As soon as they stop paying, the NFT is burned and anyone who's either using Discord to grant access or another application just checks the NFT. Um, so a developer or a project implementing this has a nice dashboard where they can check the status and see things like how many subscriptions have sold, how many are active, what kind of revenue is coming in month over month or year-over-year. All right. Second use case is algorithmic trading. So has anyone here deposited in a or compound or any money market and taken a loan and got liquidated?
Yeah. Okay. So Robo Vault enables complex leverage yield farming or simp even simple uh leverage yield farming without the risk of liquidation and they do that with automation. So one example is and this is just a simple use case. They have a number of different strategies.
The user would deposit USDC into a vault and then automation would borrow some of that uh excuse me deposit some of that USDC in a or compound or some money market and borrow a volatile asset. Then it would take the remaining USDC that was not deposited in the vault with the borrowed volatile asset and put that in uh in a DEX as as a LP. And then it would take the LP position and put that in a yield aggregator and earn additional fees or auto compound. uh if the price of the volatile asset changes, there's a risk of liquidation and automation will automatically check to see if the risk is high and if it is, it'll rebalance and if the risk is low and it can potentially borrow more for more leverage, it'll do that. So automated leverage yield farming.
So an example, if you hold Avac, Avalanch's gas token, and there's a 15% draw down in the price of Avac, then you're losing 15%. But if you put it in a delta neutral strategy like I just described, then you're actually making money on fees the whole time because you have a long position and a short position that are balancing each other out. And if your automation system is not reliable, then you're going to have a bad time. Next use case, under collolateralized borrowing. So, Blueberry protocol enables users to borrow more than the value of the collateral they've deposited.
And the way they do that is they've scripted or whitelisted or pre-programmed a number of different actions that you can take with the borrowed assets. So if you deposit, let's say, ETH and you borrow USDC and put that USDC in in a curve pool to earn fees, you're going to get a very high loan to value or collateralization factor because the risk is very low. However, if you had deposited ETH and borrowed Sheba Eno or some very volatile asset, then your loan to value ratio is going to be much much lower. And they're able to do this because they have automation which um will automatically liquidate any position that becomes undercolateralized. And they're able to offer very aggressive strategies because they have automation that can do things like balance leverage positions or rebalance leverage positions as needed.
All right, next use case. I think I'm going too fast. Um, smart contracts categorically only have access to data available onchain unless you have a solution like space and time which makes relational data available to smart contracts. So space and time has a decentralized relational database that users can populate from any system they want. It might be a uh an enterprise system, a legacy system.
It might be performing their own calculations, calculating Greeks for derivatives. It might be calculating values on collection of sneakers or other real world assets. And a smart contract can make a query to pull that data on chain. And when does a contract make that query? It could be on any type of trigger condition I described earlier.
So it might be every 30 minutes, once a day, first Monday of the month, when some state condition changes onchain. Your smart contracts are now smarter. Next use case, adaptive strategies. So you may have fixed parameters or fixed values offchain, but you may also have maybe predictive analytics um that's constantly checking running models and looking for trends, anticipating movements in the market or detecting risk that may not be um available on chain directly by checking. or it may not be feasible to calculate and perform these calculations and models onchain because one they're too expensive or two there just isn't enough gas in the block to perform the calculation.
So you can have your models running 24/7 and have a smart contract request an update as needed. Right? These are just four or five different use cases for automation in DeFi. Um, there are countless others. I only talked about DeFi today, but you can do automation with gaming, like renting NFTts and automatically pulling your NFTs back after the the the rental is over.
Um, distributing rewards, vesting, locking and unlocking, rebalancing index or rebase tokens. Um, they're really endless use cases. So all of these projects have at least one thing in common which is they use automation. So smart contracts don't uh can basically wake themselves up based on the condition that a developer has programmed in the trigger conditions but they're also part of our incubator program called build. So that's another one of my roles.
Um if you're a a um a startup project, a young project or an established project and you need technical help with oracles or non-technical help like building um strategic marketing plans, co-arketing, um you're trying to raise capital, um you're trying to um build a community and you need help with ecosystem growth, then our build program may be right for you and we'd be more than happy to talk to you at the booth. I'm going to have a few time for questions as well. And uh my name is Sam Freriedman. Um I'm here I'm at the booth all day. I'm here for another few minutes.
I've got Mike Stone over there from Chainlink. Raise your hand. He can answer all kinds of questions about automation. And some of the projects that uh I talked about today are here in the audience too. So Space and Time is here and Shane ML is here.
Great to see you. Anyone else? Oh, hey. And Robbo is here. So, if you have questions about any of these strategies here um or use cases, then please um ask me or ask the person sitting next to you.
Um that's it for my presentation. I'm happy to answer questions. I'm happy to go back to the booth, too. All right. Thanks, everyone.
[Music]
Automatic transcript — names and jargon may be misspelled.