Automated Rebalancing — foundational to ILM Leverage

Rebalancing is the process of maintaining a desired leverage. If leverage increases for an ILM above the intended target ratio, debt is repaid to stay within the target leverage ratio. Conversely if leverage decreases below the intended target ratio, more debt is borrowed to stay within the target leverage ratio. ILMs keep leverage within a certain margin prior to rebalancing — these margins have the benefit of reducing swap fees and prevent excessive volatility decay.

In a nutshell, rebalancing is a core component of ILMs, helping them differentiate from the competition!

If you want to learn more about ILMs and Seamless in general, check out our blog.

Intro:

In crypto markets, those who come out on top have one major advantage amongst others: information. These individuals know how the markets work, and importantly, how the instruments which handle their investments work.

In this article let’s focus on the core mechanism which allows Seamless’s Integrated Lending Markets (ILMs) to work, so that you can understand what happens behind the scenes to the capital you’ve deposited. The mechanism in question is called “Rebalancing”.

New to ILMs? Learn more here in this article.

Rebalancing: What it is?

A primer to rebalancing is the concept of leverage. Leverage is the ratio between the exposure one has to an asset, and to the amount of asset they own. For example, if you are exposed to 3 ETH but have only deposited 1 ETH, then your leverage is 3:1 or 3x.

Leverage in the ILMs is achieved by borrowing against a collateralized asset. The flow in the 3x ETH — USDC ILM is the following:

  1. Deposit ETH as collateral into ILM strategy
  2. USDC is borrowed against collateralized ETH
  3. USDC is swapped into more ETH
  4. Repeat steps 1- 3 until desired leverage is achieved (3x in this case)

At the end of this “loop”, the position is exposed to two tokens: ETH and USDC. The ETH is collateral and held by the Seamless Lending Pool since it was collateralized. The USDC is debt which is owed to the LendingPool, since it was borrowed and swapped.

There are two distinct definitions for collateral and debt:

  1. Collateral / debt tokens. This ratio is simply the number of tokens collateralized and borrowed, respectively.
  2. Collateral / debt value. This is the ratio of collateralized/borrowed tokens multiplied by their price. Thus, even if the number of collateral/debt tokens stays the same, the collateral/debt value fluctuates due to the price of the tokens fluctuating.

As the price of ETH changes (when anchoring against USDC), the leverage ratio of the position changes accordingly. To illustrate this effect let’s look at a few examples.

ETH Price Increase, Rebalance Example

User deposits 1 ETH into the ETH/USDC 3x ILM (Assume 1 ETH equals 3,000 USDC)

6,000 USDC borrowed and swapped for 2 ETH

  • Total Collateral Tokens: 3 ETH
  • Total Debt Tokens: 6,000 USDC
  • Total Collateral Value: $9,000
  • Total Debt Value: $6,000

Leverage: Collateral / Equity = $9,000 / ($9,000 — $6,000) = 3x

Let’s now assume that the price of ETH increases to $4,000. Suddenly there is a change in leverage:

  • Total Collateral Tokens: 3 ETH
  • Total Debt Tokens: 6,000 USDC
  • Total Collateral Value: $12,000
  • Total Debt Value: $6,000

Leverage: Collateral / Equity = $12,000 / ($12,000 — $6,000) = 2x

Even though the token amounts have remained the same, the leverage has fluctuated as a consequence of the tokens’ price movements.

In order to maintain the desired 3x leverage, more USDC must be borrowed and swapped for ETH, since the value increase in the collateral now permits it. Increasing the debt will increase the collateral value and debt value by the same amount, since the borrowed value will be collateralized (assuming no DEX fees).

So to determine how much borrowing is needed in $USD, solve for A:

Leverage Ratio = Collateral Value +/- new borrow (A) / value of old debt

3 = ($12,000 + A ) / $6,000

A = $6,000

Since ETH is now priced at $4,000, $6,000 of borrows is equivalent to 1.5 ETH. After borrowing this amount, the new values become:

  • Total Collateral Tokens: 4.5 ETH
  • Total Debt Tokens: 12,000 USDC
  • Total Collateral Value: $18,000
  • Total Debt Value: $12,000

Leverage: Collateral / Equity = $18,000 / ($18,000 — $12,000) = 3x

ETH Price Decrease, Rebalance Example

Conversely, if the price of ETH decreased, the leverage would increase, and part of the debt would have to be repaid in order to maintain leverage. To do this ETH (collateral) would be swapped back for USDC (debt) and the USDC would be repaid.

From the same starting point, if ETH dropped to $2,500:

  • Total Collateral Tokens: 3 ETH
  • Total Debt Tokens: 6,000 USDC
  • Total Collateral Value: $7,500
  • Total Debt Value: $6,000

Leverage: Collateral / Equity = $7,500 / ($7,500 - $6,000) = 5x

The position is now over-leveraged. To return to 3x, an amount A must be taken from collateral and repaid on debt:

Leverage Ratio = Collateral Value - repayment (A) / value of old debt

3 = ($7,500 - A ) / $1,500

A = $3,000

Given that ETH is now at $2,500, $3,000 being repaid is equivalent to 1.2 ETH. Hence the final values after repaying are:

  • Total Collateral Tokens: 1.8 ETH
  • Total Debt Tokens: 3,000 USDC
  • Total Collateral Value: $4,500
  • Total Debt Value: $3,000

Leverage: Collateral / Equity = $4,500 / ($4,500 - $3,000) = 3x

These examples illustrate how rebalancing works. The action of borrowing more to increase leverage or repaying debt to decrease it is known as rebalancing — in the case of ILMs, rebalancing is done automatically, ensuring users always stay within their target leverage ratio without needing to worry about their health factors and repay borrowed debt manually.

Rebalancing: Why do it?

Fundamentally there are two reasons to rebalance:

  1. Maintain exposure
  2. Maintain loan health/health factor

Maintenance of exposure is fulfilling the promise of the instrument: to maintain a position with a specific exposure. In that regard rebalancing is paramount since it manages the effects of price changes. This feeds into the automation benefit of the ILMs — a user does not have to manually manage their exposure.

Maintenance of loan health is often understated. In the Seamless Lending pool, if a loan is not kept healthy, then the collateral which has been used to secure the loan will be liquidated, because it is assumed the borrower is unable to pay back the loan. As a consequence, the borrower is left with the borrowed tokens but no claim to the collateral. In the ILMs, this would leave the position opened with the borrowed tokens only. Rebalancing manages loan health by repaying debt when it is necessary. This further contributes to automation — users do not have to be concerned with managing loan health.

Rebalancing: Nuance

Cryptocurrencies are very volatile. Their price shifts multiple times per day — sometimes by large amounts — and each of these micro price changes affects the leverage of the ILM.

It is not always profitable to rebalance for very small price changes; losses to gas costs and DEX slippage and fees sometimes mean that rebalancing leads to a net loss for the ILM. Hence, rebalancing occurs within specific margins of leverage.

What that means practically is that a rebalance might occur if the target leverage is 3x but the actual leverage is 3.5x and not when the actual leverage is 3.0001x. In the case of the 1.5x ETH-USDC long strategy, the margins of leverage are chosen so that a change of +/- 15% in the leverage would result in a rebalance. This directly corresponds to the price changes which would be needed for a rebalance to occur — that is the price of ETH must fluctuate 15% in either direction for a rebalance to be triggered.

In periods where ETH is stable, no rebalances occur — the position is kept healthy until increase in debt or increase in collateral from rewards necessitates a rebalance.

Furthermore volatile markets lead to some positions experiencing volatility decay — this is a phenomenon where a position loses value over time due to rebalancing frequently. This is the case for ETFs in TradFi and can be the case for ILMs.

The margins are chosen so that the effects of volatility decay are minimized — rebalancing will occur on large market movements versus very small ones.

Seamless Protocol is the first decentralized, native lending and borrowing protocol on Base. Seamless lays the foundation for Modern DeFi, focusing on lower-collateral borrowing and a better user experience to inspire the masses.

Join the community and get plugged in via the following links:

🧑‍💻 Website: https://seamlessprotocol.com

📱 App: https://app.seamlessprotocol.com

🐦 Twitter/X: https://twitter.com/seamlessfi

🏰 Farcaster: https://warpcast.com/seamless

👾 Discord: https://discord.com/invite/Uye9jCVgUp

💬 Telegram: https://t.me/seamless_protocol