How to Trade ETH Perpetuals on dYdX
4 Aug 2020 · 15:26
DeFi Dad walks through the new ETH perpetual futures market on dYdX, a decentralized margin trading exchange on Ethereum, noting that as a US resident he cannot trade it himself. He explains how perpetuals differ from spot and margin trading, how the oracle, index and mid-market prices fit together, and how the eight-hour funding rate pays longs or shorts to pull prices into line. Examples include setting position size and leverage, earning the funding rate with an offsetting spot position, and a 1x short to hedge ETH. He warns that ETH collateral shrinks as the price falls, and closes on the risks: phishing sites, flash crashes, smart contract bugs, admin rights and stablecoin depegs.
Speakers
Topics
Transcript
[Music] hi everyone this is d5 dad and this is another bankless tutorial today i'm going to walk you through the new eth perpetual futures market that was just launched and quick warning i am not able to do any trading on this because i'm a us resident so if you are a us resident you won't be able to use this new market you can use the spot and margin trading markets on dydx but the uh bitcoin
usd and this new uh eth usd perpetuals markets are not available so i'm going to help you navigate how the platform works some of the important moving parts in it like the funding rate and then ultimately some ideas or strategies that i've thought about if i did have access to this and could trade on it before we get started some context to be aware of is just that dydx is really known as the top margin trading platform uh that is a dex built on ethereum and so they have three different products now the first one is a spot trading market that's where i'm actually exchanging uh
assets with uh other buyers and sellers so there's like an immediate delivery to me selling ether and then getting let's say die for that and there's no way for me to be more efficient with my capital other than uh the value that i already hold so if i have a hundred dollars of ether that's as much exposure as i can get however then they have a margin trading platform which allows me to use uh up to 5x the value of my funds i can borrow from others that are lending their assets on dydx so that i can gain more exposure and i pay an interest rate for the funds that i borrow to trade with and then
those that are lending it are earning the interest rate so that leads us to today perpetuals is the most efficient price exposure i can gain uh this has become a really popular product in the crypto industry it was really first made popular by bitmex what i like about the ability to trade against ether is that many people who have ether don't want to sell it for usdc or tether or die in order to trade it they want to grow their exposure to ether and to do that they can just deposit their ether here and then actually trade against the notional value or the in this case the
usd value of that ether so it saves a step it also saves you from a taxable event depending on what part of the world you live in like normally selling ether can trigger a taxable event so many of us would rather avoid that and just deposit ether and trade against that a perpetual's market is a futures market it's just a futures market without an expiry so it allows me to hold a position for much longer the way that this works is to do with these three puzzle pieces first i have the oracle price this dictates collateralization liquidations based on an on-chain oracle price which aggregates price data from multiple exchanges this actually refers to
the maker dow eth usd v1 oracle so all you need to know is that when it comes to liquidations uh and collateralization it's based off of uh an average of prices drawn across multiple exchanges versus depending on the little bubble that is this this one each perpetuals market on dydx then we have the index price which is how stop orders are triggered this is to really prevent flash crashes the index price is based off of uh price data from multiple exchanges and it's used to trigger stop orders to provide optimal performance the index
price is managed off chain to ensure minimal delay and slippage and stop order triggering those two work together to really protect me from flash crashes while the buy and sell orders that happen in this perpetual market dictate what's referred to as the mid-market price now again i'm looking at this the day before the exchange or the uh the market goes live so um this isn't accurate but uh when market makers and and buyers and sellers all step in we we should see this reflect uh what is the oracle in the index price the funding rate is the part of this it's really interesting to me this is really an incentive to drive uh buyers and sellers
to ensure that the the mid market price is actually reflecting the oracle in the index price so the eight hour funding rate is interest that gets paid either to longs or shorts if it's positive it tends to indicate that longs are more in control than shorts and that the price of uh the perpetuals market the mid market price is actually above what is the oracle and index price and so uh to incentivize getting that price down to where it should be according to all these other exchanges uh we have this funding rate and the funding rate uh again is effectively paying shorts if the
price that is happening here in this perpetual market is above uh the price found on other exchanges the opposite is true if the rate is negative it means that the price is below where it should actually be and so longs are then being incentivized or paid by the funding rate every eight hours to have a long position this is also an interesting opportunity because one could take advantage of the funding rate and they could open up a position uh here in this perpetuals market and then open up an equivalent size position but the opposite you know if you open up a long here open up a short in another spot trading market and then get paid by the funding rate so
right now the funding rate is positive i could open up a short position here and i could get paid by the funding rate if i open up an equivalent position but long on a spot trading market they essentially cancel each other out and i make this funding rate as income so if i want to open up a position on this eth perpetuals market i can deposit my ether here so again i'm trading against my ether this is an inverse linear perpetual market versus a linear perpetuals market which is what the bt the btc usd market is linear refers to me trading against the us dollar uh or usdc in this case
versus here i'm trading against ether which is uh uh trading against my stack of ether and one thing for me to be aware of is the fact that if i'm trading against my stack of ether as the price of ether is going down it's not just my position that's being affected it's my collateral as well my collateral is ether and so it's it's shrinking in value and so this is a market that i would argue is uh more difficult to manage your risk versus trading in the bitcoin usd market where at least i'm trading against a stack of stable coins so if i want to open a long or a short i've got market limit options available
let's pretend that the price is 385 right now i'm going to open up a position at 380 usd and then i want my position to be let's say a thousand dollars this is again the notional value uh so this is referring to how large is my position based in usd but keep in mind i'm able to use leverage according to how much collateral i have in usd so let's pretend that i have one ether and it's worth about four hundred dollars if i want to open up a position that's twice that big
just know that um because i don't have collateral in here and because i'm not a us i'm a u.s citizen that can't gain access to this this would actually show 2x so if you were to try this deposit ether and then check this out and if you look uh at the amount of your position you'll notice that the leverage is changing with that so if i were to amp this up then to 1200 usd it would show this at 3x if i were to amp this up then to let's say 1600 it would be 4x and so on and then you can see here position value is 4.16 in terms of ether and you can also see that the funding rate is
positive at this point so the funding rate indicates that the mid market price is above what the oracle price is and so this means that i as someone who holds a long position i'm going to be paying shorts and so i am going to be paying 0.01 percent uh as a rate it's just something that's going to be uh deducted from my position and it's something to be aware of again because if the rate is negative then the perpetual market here is is actually in need of more long positions and if it's positive it means that it's in need of more shorts
so anyways i go to open up a limit order worth 1600 usd uh at a price of 380 uh or lower on ether and when you go to place that limit order it's the way that their other markets work where when you click it it'll it'll just ask you to confirm it it's a signature so you don't have to actually pay any gas and that's really awesome so the gas comes into play when i deposit and then when i withdraw and those should be single transactions because they're ether so i don't have to give approval to move ether i can just send ether one more example of the power of these perpetual markets is
i could actually deposit ether and then i could open up a short position to hedge against the price falling so let's say that i want to open up let's do a market position let's pretend that i have a thousand usd of ether up above i could open up you know a position here and say i want to preserve the usd value of what i have an ether so i'm going to open up a short position and this just means that if the price of ether starts to fall i'm essentially gaining a dollar for every one dollar that i i lose in the value of my ether anyways this is something to do a little
more homework on it's a very common hedging strategy it's a 1x short and it's available if you're able to use this perpetuals eth market okay just a few risks i want to recap before we go first off bookmark this exchange make sure you have the url correct i'm always worried that someone's going to create duplicate domains in the future to try to trick people uh into connecting their wallets and depositing into what they think is dydx but it's actually a phishing scam so bookmark this uh and that way you don't have to type it in or potentially spell
the wrong name of the website another risk is flash crashes so the oracle price and the index price are meant to help mitigate that risk but there's still a risk of a flash crash because if everyone has stop losses it would create a domino effect of stop losses triggering one another and the market would continue to crash until enough buyers stepped in then there's smart contract risk when you use a platform like dydx it's powered by smart contracts so if there's a bug in the code that would put funds potentially at risk so i could buy protection by going to nexus mutual dot io and i could just look at what's the
value of ether i have here and that's the the amount of cover i would want to buy from nexus mutual just to ensure that if there wer was a smart contract bug i would be protected and i would get a payout next up is admin risk i am pretty confident that there are still admin rights that the dydx team has uh they're not fully decentralized into a dow as far as i know and if that's the case i just am accepting that there is some centralized risk here lastly uh this isn't true in this market the eth perpetuals market i'm only depositing ether and i'm trading against ether
but if i use the bitcoin perpetuals market i have to deposit usdc or tether and that is a stable coin and there's always a risk of a stable coin depending or having it fail and and not hold the one dollar peg all right that's all i've got for you today thanks so much for watching i'm sorry i'm not able to actually execute a trade to show you what that looks like but i can't do it because i'm based in the u.s if you're not in the u.s though i hope you get a chance to check this out it's a really powerful tool you will end up paying gas when you deposit or withdraw ether those are the two times that i'm aware of other than that you end up just signing metamask signatures when you place orders so it's pretty awesome
if you're willing to risk holding the value of your ether on dydx i would argue that it's a great way to save on gas money in the show notes i will link a referral code for bank list it gets you 10 off trading fees so if you use that and you've never used dydx before that should save you a little bit of money and let us know if you have any questions in the bankless discord group or you can comment on this youtube video or comment on twitter and we'll try to get your questions answered thanks so much for watching and see you next time [Music] you