Skip to main content

What is Gearbox Protocol?

Gearbox Protocol brings you onchain credit, allowing anyone to margin trade on Uniswap, leverage farm on Curve, leverage stake on Lido, and use 10X more capital on many DeFi protocols you love, as well as RWAs & NFTs. Making decentralized leverage a reality thanks to Credit Account abstraction. Gearbox Protocol uses Credit Account abstraction to bring together lending and prime brokerage in the same protocol. Lenders deposit assets to earn passive yield, while the composable leverage side users borrow these assets to create spot leverage positions, which can be used across DeFi.

Quickstart

Get started with Gearbox Protocol in minutes

Installation

Install the contracts via npm, Foundry, or Hardhat

Credit Accounts

Learn about Credit Account abstraction

API Reference

Explore the contract interfaces and methods

Core Features

Credit Account Abstraction

Credit Accounts are the foundation of Gearbox Protocol. They are isolated smart contract accounts that hold user collateral and borrowed funds, enabling composable leverage across multiple DeFi protocols while maintaining risk isolation.

Multicall Operations

Execute multiple operations in a single transaction with automatic collateral checking:
  • Open leveraged positions across DeFi
  • Manage debt and collateral
  • Interact with external protocols via adapters
  • Batch operations for gas efficiency

ERC-4626 Lending Pools

Gearbox V3 pools implement the ERC-4626 standard, providing:
  • Standardized deposit and withdrawal interfaces
  • Automatic yield accrual from interest and fees
  • EIP-2612 permit support for gasless approvals
  • Flexible liquidity provision

Flexible Liquidations

Two liquidation mechanisms protect lenders:
  • Full Liquidation: Liquidate entire positions when health factor drops
  • Partial Liquidation: Repay specific debt amounts for discounted collateral

Protocol Architecture

The protocol consists of several key components:
1

Pools (PoolV3)

ERC-4626 compliant lending pools where lenders deposit assets to earn yield. Pools manage liquidity, interest rates, and provide funds to credit managers.
2

Credit Manager (CreditManagerV3)

Core contract that manages credit accounts, handles collateral calculations, debt accounting, and liquidations. Each credit manager is connected to one pool.
3

Credit Facade (CreditFacadeV3)

User-facing interface for opening, closing, and managing credit accounts. Implements multicall functionality and safety checks.
4

Credit Accounts (CreditAccountV3)

Isolated smart contract wallets that hold user collateral and borrowed funds. Each user can have one credit account per credit manager.

Use Cases

Margin Trading

Trade with leverage on Uniswap and other DEXes

Leverage Farming

Farm with leveraged positions on Curve and Balancer

Leverage Staking

Stake with leverage on Lido and Rocketpool

Composable Strategies

Create complex multi-protocol strategies

Smart Contract Information

Package: @gearbox-protocol/core-v3Version: 1.0.1License: BUSL-1.1Solidity: ^0.8.17

Security & Audits

Gearbox Protocol has undergone multiple security audits. For detailed information about audits and security practices, visit the Gearbox dev portal.
The primary license for Gearbox Protocol Core V3 is the Business Source License 1.1 (BUSL-1.1). Files that are NOT licensed under the BUSL-1.1 have appropriate SPDX headers.

Resources

Next Steps

Start Building

Follow the quickstart guide to integrate Gearbox

Explore Contracts

Dive into the contract interfaces

Build docs developers (and LLMs) love