How to Use Gearbox Leveraged Lending? Credit Accounts and Exit Verification

 / 
2

Gearbox leveraged lending has one fundamental difference from what you are used to on Aave or Compound: the borrowed money never enters your wallet. It is locked inside a separate smart contract and can only interact with whitelisted DeFi protocols. Exiting is also not as simple as clicking "repay." It is a multi-step atomic transaction.

OKX Exchange
A leading global cryptocurrency platform,suitable for both beginners and experienced traders.
New user benefit: 20% off trading fees upon registration!!

This means two things: you cannot transfer borrowed USDC to an exchange and sell it, and liquidation does not happen in "your wallet." It is handled inside the credit account contract.

What Is Actually Inside a Credit Account

A credit account is an independent smart contract wallet. It holds both your collateral and the borrowed funds at the same time. This design is completely different from traditional lending protocols, where collateral sits in a shared pool and borrowed funds go into your personal wallet.

Why is it built this way? The core reason is programmable solvency checks. At the end of every transaction, Gearbox checks only one thing: whether the account's total weighted value is greater than its debt. If it is greater, the transaction passes. If it is smaller, the entire transaction rolls back. It does not care what swaps you made in between, what LP positions you added, or where you staked.

This mechanism makes it possible to execute a multi-step leveraged strategy as one atomic transaction: borrow USDC → swap to WETH → deposit into Lido → receive stETH, all in a single transaction. Only at the end does the protocol check whether the account is safe. You do not need to split this into five separate operations, and you do not need to worry that a price move during one intermediate step will temporarily make the account unsafe.

Borrowing rates are dynamic and depend on pool utilization. Debt consists of several parts: principal, interest that accumulates over time, quota interest if you use collateral that requires a quota, protocol fees, and transaction fees. When repaying, the protocol first deducts quota fees and interest, and only then touches the principal. So if you repay only part of the debt, the principal may not decrease at all.

Numbers to Check Before Using Leverage

When opening a position, you will see several key parameters. Their meaning is directly related to your liquidation risk.

Health Factor is the core metric. It is calculated as total weighted value divided by debt. Total weighted value is calculated by taking each collateral asset at its oracle price and then multiplying it by its liquidation threshold, or LT. For example, if WETH has an LT of 80%, then $100 worth of WETH only counts as $80 toward solvency. The health factor must always remain at or above 1.0. Below 1, the account becomes liquidatable.

Leverage is not something you pick freely. How much leverage you can take depends on the LT of your collateral and the combination of debt assets you want to borrow. Gearbox's official blog mentions that leveraged trading on BNB Chain can reach about 5x, and ynBNBx leveraged farming can reach about 7.7x. On mainnet, leveraged staking strategies with stETH have reached 10x. But "maximum" does not mean "right for you." If your health factor is only slightly above 1 right after opening, any adverse price move could trigger liquidation.

Liquidation Discount is the part you "lose" when liquidated. Liquidators buy your collateral at a discount. That discount is their profit and your actual cost when liquidation happens. This parameter is set by the protocol, not chosen by you.

Exiting: The Actual Process of Closing a Credit Account

Closing a credit account and repaying debt are two different things. A simple repayment, or decreaseDebt, only reduces the debt. The account still exists and the collateral remains inside. Closing the account, or closeCreditAccount, is the full process of repaying all debt, withdrawing remaining assets, and closing the account.

In practice, the closing process usually needs to be completed within a single transaction. Because your assets may be spread across multiple protocols, such as some LP tokens and some staked stETH, you first need to use multicall to swap them into the debt asset, such as USDC, then repay all debt at once, and finally withdraw the remaining USDC.

There is one common pitfall here: the leftover debt problem. Gearbox requires debt to be either zero or within the range of [minDebt, maxDebt]. If you repay most of the debt but leave a small "leftover" between 0 and minDebt, the transaction will be rejected. When closing an account, make sure the debt goes to exactly zero.

Another constraint is that you cannot increase and decrease debt in the same block. If you borrow a little more in the same multicall to add liquidity and also try to repay, the transaction will fail.

When Liquidation Happens and What Occurs During It

When the health factor falls below 1.0, or the account exceeds its configured expiration time, any third party can trigger liquidation. Gearbox V3 supports two liquidation methods.

Full liquidation closes the entire account. The liquidator pays off your debt and takes all of your collateral at a discount. Any remaining funds in the account, if any, are returned to you. If your collateral value is not enough to cover the debt, bad debt is created. It is first absorbed by DAO profits. If that is still not enough, the loss is borne by pool LPs.

Partial liquidation allows the account to continue existing after liquidation, provided the health factor recovers to at least 1.0 afterward. This method is usually used when collateral liquidity is too low to sell everything at once.

Liquidation is not "your money being confiscated." It is a transaction: the liquidator repays your debt and then takes part of your collateral as compensation. How much you get back depends on how much collateral value remains after subtracting the debt. Opening a position when the health factor is close to 1 means one normal market move is enough to make the account liquidatable.

Risk Checklist: What to Confirm Before Opening a Position

Oracle risk. Gearbox uses price sources such as Chainlink and Redstone, and applies a mechanism that takes the lower of the primary and fallback sources to prevent manipulation. But if an oracle reports a wrong price, it could trigger unnecessary liquidation or cause abnormal protocol behavior.

Asset depeg risk. If your collateral is a stablecoin or a liquid staking token, a depeg will directly affect the health factor. Gearbox's isolated mode means risk is limited to a single pool, but your position will still be affected.

MEV and sandwich attacks. Swaps when opening and exiting can both be sandwiched by MEV bots, especially when slippage is not set properly. Slippage on exit is usually larger than on entry because your transaction needs to swap collateral into the debt asset, which may involve less liquid assets.

Liquidator failure risk. Liquidation depends on third-party liquidators doing their job. If liquidators collectively fail during extreme market volatility, the protocol may incur bad debt and LPs will suffer. The borrower's position status depends on whether liquidation is eventually executed.

Frontend and protocol separation. Gearbox's frontend interface is operated by a company, while the on-chain protocol is governed by a DAO. The company can shut down its own interface, but that does not mean your position becomes unmanageable. You can still operate through other interfaces or by interacting directly with the contracts.

Before opening a position, at least confirm these things: what your initial health factor will be after opening and how much buffer it leaves, how correlated your collateral and debt assets are, whether the main assets you need for exit have enough liquidity, and whether the interface you are using clearly states which networks it supports.

OKX Exchange
A leading global cryptocurrency platform,suitable for both beginners and experienced traders.
New user benefit: 20% off trading fees upon registration!!

References