How to Use TokenSets as a DeFi Stop-Loss

4 May 2020 · 5:12

DeFi Dad walks through using TokenSets, the token-set based asset management protocol, as an alternative to a traditional stop-loss order. The video explains how a Robo Set like the ETH 20 Moving Average Crossover Yield Set automatically rebalances from ETH into a stablecoin once its trading criteria are met, and outlines the smart contract risk and price-timing tradeoffs involved in relying on it.

Speakers

Topics

Transcript

hi everyone this is d5 dad i wanted to explain a concept i posted about the other day called the d5 stop loss so the idea is that you can use a token set uh with a trading strategy that you want exposure to but because the let's say the price of ether is close to meeting the criteria for that token set to sell out of ether into in this case uh compound usdc you can ultimately treat it like a defy stop loss so just a little background if you're not familiar with what a stop loss is when you look at a at a traditional exchange like coinbase that's centralized or if you look at something like dydx which is

decentralized the concept of a stop loss is you can basically put in uh what is a price point where you would like to sell out of ether at that price point or below so in this case i have a stop loss set for one eath to sell if the price falls below 200 die just give me whatever the best price is at that point i'd rather get back in to die and then hopefully i can buy back ether at a lower price another way to do this using d5 tools would be gelato so in the future when this has been audited which it hasn't been and it's still in its alpha version so i would not recommend using this just yet unless you're playing around with really small amounts

of money that you're willing to lose uh you can set a condition of whatever the price is let's say of ether let's say it's 200 die or less i'm gonna then set an action to trade that ether into die so back to the original idea of using this token set i'm looking at the 20-day moving average crossover yield set the criteria for this is that two days have to have gone by since the last rebalance and then if the price of ether currently around 207 dollars goes below the 20-day moving average which is around 190 then let's go ahead and sell ether into compound usdc which is the

interest earning form of usdc in compound so you'll see this actually in action if you look at the chart what you want to pay attention to is look at these numbers here oh i'm sorry this this right here this is the current price allocation it shows basically whether this is made up of ether or compound usdc so you notice as i scroll along this the green line represents the set the purple line below is ether so the price of ether is fluctuating but the set is constant because we're currently in 100 compound usdc then we get to this dotted line where the criteria has been met for the token set to buy back ether so at this point

below you can see that now that big purple line shows up there so you can see now that we're in a hundred percent ether we've essentially bought back all of our ether with the compound usdc that we were holding on to in the set so the reverse situation is currently in place where what's going on right now is we're in ether so this set is mirroring the purple line the aqua and the purple line the aqualine being the set the purple line being ether they follow one another because we're in a hundred percent ether however if you are concerned about the price of ether falling and if you'd like to use a stop loss to

prevent yourself from losing more money in terms of dollar value you can put your money into this token set and it will ultimately sell out of ether whenever that price falls below 190. one thing you want to be aware of is the risk of this is that the price could fall it could rebalance into usdc then the price could rocket upwards so ideally it goes below the 20-day moving average and you get a chance to buy back ether at a higher price or i'm sorry at a lower price but a bad situation would be that the price goes upwards and now you're buying back ether at a higher price so you just need to be really cautious about

what it is that you're trying to accomplish here and whether or not the strategy makes sense to you so anyways um that's how a d5 stop loss would ultimately work um you know normally i would just set a stop loss again with dydx or if you use a centralized exchange you would use that and you'd say in this case the 20-day moving average here is around 190 and so i would be setting a stop loss myself manually but i think it's much easier just to put my ether into the token set the eth 20-day moving average crossover yield set so anyways i hope this is helpful let me know if you have any questions

and hopefully we'll be posting more videos like this with tips and tricks to use defy on the bankless youtube channel