Getting Started With dYdX — Borrowing

Everett Hu
dydxprotocol
Published in
7 min readAug 8, 2019

dYdX Layer 1 is winding down on November 1, 2021 at 18:00 UTC.

Users will still be able to withdraw at any time, but deposits, trades, and borrows will be disabled. Learn more in the blog post.

dYdX is a powerful open trading platform that currently supports three features:

  • Lending
  • Borrowing
  • Margin trading

In our first guide, we covered the basics of how to connect your wallet to dYdX and deposit funds to begin earning interest on your assets. In this guide, we will explore how to borrow assets on dYdX, and dive into two important concepts integral to the way dYdX works: global lending pools and collateralization.

Global lending pools

On dYdX, both lenders and borrowers interact with global lending pools. There is one global lending pool per supported asset, all managed by smart contracts. When you deposit an asset on dYdX, your asset gets deposited into its corresponding lending pool, where borrowers can then borrow the same asset. This model allows borrowers and lenders on dYdX to deposit and withdraw assets at any time.

As borrowers and lenders interact with the lending pools, the supply and demand for each asset change, affecting the utilization ratio (borrowed amount / supplied amount) of each asset. Interest rates on dYdX are floating and based on these utilization ratios. You will notice on dYdX there are two rates for each asset: the rate lenders earn for lending their assets (supply rate), and the rate borrowers pay for borrowing an asset (borrow rate). The borrow rate will always be higher than the supply rate, since lenders can only earn as much as borrowers pay and interest is spread over all lenders.

The exact formula dYdX uses to calculate these rates can be found in our help center. You can also find historical lending rates for dYdX here.

Collateralization

Collateralization is a concept you will encounter frequently throughout the product. Your collateralization ratio determines how much you can borrow and when you will get liquidated. To calculate collateralization, simply take the ratio of (collateral / debt). On dYdX, this ratio is calculated using each asset’s dollar value.

As an example, assume:

  • ETH = $100
  • USDC = $1

Let’s say a user on dYdX has the following account balances:

  • 2.5 ETH
  • -200 USDC

For this user, we can calculate collateral (positive balances) and debt (negative balances) like this:

  • Collateral: 2.5 ETH * $100 = $250
  • Debt: 200 USDC * $1 = $200

So, this user’s collateralization ratio would be 250 / 200 = 1.25 or 125%.

On dYdX, you can borrow assets until your collateralization ratio is 1.25 or 125%. Once you hit this ratio, dYdX will not allow you to borrow any more assets until you either deposit more collateral or repay some of your debts.

Now, let’s say one day the price of ETH falls to $90. This users collateralization ratio is now:

  • Collateral: 2.5 ETH * $90 = $225
  • Debt: 200 USDC * $1 = $200
  • 225 / 200 = 1.125 or 112.5%

On dYdX, whenever an account falls below a “liquidation threshold”, any existing borrows in the account are deemed too risky. In order to protect lenders, the account will be “liquidated”: collateral will be sold until all negative balances are 0. On dYdX, the liquidation threshold is 1.15 or 115% and in this case, the example user’s account has a collateralization ratio of 112.5%, just below the liquidation threshold. This account would be liquidated and have to pay a 5% liquidation fee, ultimately containing these balances after liquidation:

  • ~0.264 ETH
  • 0 USDC

Understanding collateralization and how it affects your account is integral to managing risk while borrowing and opening positions on dYdX. A strong grasp of these concepts will help guide any action you take on dYdX involving borrowing.

Understanding the borrow page

All borrows on dYdX can be easily managed from the borrow page. You can navigate to this page by clicking the “Borrow” link in the header:

Click “Borrow” in the header to access the borrow page

Under the “Outstanding Borrows” section, you will see a list of all your current borrows; any negative balance is considered a borrow. When performing cross trades, your balance can go negative, so negative balances resulting from cross trades will also be displayed here.

One column you will notice in the “Outstanding Borrows” section is the “Expiry” column. Direct borrows on dYdX do not have any expiration, so you are free to borrow an asset and repay the asset whenever you like as long as your collateralization stays above the liquidation threshold. However, if your balances go negative as a result of a cross trade, this is no longer considered a direct borrow, but a trade. We will cover expiration and cross trading in the next few parts of this series. For now, expiration should not be a problem as long as you do not cross trade. If you do, you may see an expiration pop up under the “Expiry” column.

All borrows will show up under “Outstanding Borrows”

Borrowing on dYdX

To borrow an asset, simply click the asset you would like to borrow under “Borrow Assets” on the borrow page. Once you have selected an asset, the input fields in the borrow modal are free for you to play with. When deciding how much you want to borrow, two of the most important pieces of information to keep an eye out for are “Interest Rate (APR)” and “Account Collateralization”.

Make sure you are aware of your APR and Account Collateralization when borrowing

“Account Collateralization” represents your collateralization ratio. Initially it will be ∞ as you have no debt. However, once you enter a borrow amount in the “Amount” field, you will see this field update with your new collateralization ratio. The collateralization ratio you would like to open your borrow at is up to you, however, remember dYdX will not allow you to borrow any lower than a 125% collateralization ratio and any accounts below 115% will be liquidated. Consider how both your collateral and debt might change in value when determining what collateralization ratio you would have after your borrow, especially if you are borrowing ETH or using ETH as collateral.

The amount you would like to borrow can be entered under the “Amount” field at the top of the modal. As you type in this field, you will see a few other fields on the screen change to reflect what your account and wallet will look like after the borrow is completed. You can see your preview your new account and wallet balances in the left sidebar and your new account collateralization in its corresponding modal field. Your wallet balances change after a borrow because when you borrow on dYdX, the borrowed asset gets withdrawn out of dYdX to your wallet.

dYdX will show you your new balances and collateralization if you were to complete the borrow

Directly above the “Account Collateralization” section, you will see a field labeled “Deposit”. This optional field allows you to deposit a different asset at the same time as borrowing, allowing you to conveniently increase your collateralization ratio without having to do multiple actions. In addition to convenience, if you type a borrow amount that would put you below dYdX’s 125% collateralization threshold, you will see the deposit field pre-fill with a required deposit amount to successfully perform your borrow and stay above 125% collateralization.

Borrowing 50 USDC would put this user below 125% collateralization, so a 0.1374 ETH deposit is required

Once you have filled out the borrow modal, click on the borrow button and once the transaction confirms, you are done! You should see your new borrow show up under “Outstanding Borrows”. You should also see the borrowed asset in your wallet and a corresponding negative balance under “Account Balances” to reflect the borrowed amount.

You can repay your borrows at any time by simply hovering over the row under “Outstanding Borrows” you would like to repay and clicking the “Repay” button. This will pop up a modal where you can repay part or all of your borrow.

Hover over your borrowed asset to see the “Repay” button

If you have any questions, click “Help” in the header and check out the help center or chat with a dYdX team member. You can also always reach out on the dYdX Telegram group.

Now that we have a solid understanding of collateralization and borrowing, we will take a closer look at trading in the upcoming parts of the series. Stay tuned!

--

--