Gearbox Protocol V3: The Onchain Credit Layer

Gearbox Protocol V3: The Onchain Credit Layer

Here we are, exactly a year since the launch of Gearbox V2. A year since the introduction of leveraged staking, leveraged LPing, and more. A year since Gearbox TVL rose to $100M+ in 3 days and displayed the possibilities of capital efficient credit to the world. But that’s all for a year ago, what matters now is what we do today. And that’s why, on our quest to build something worthy of evolving onchain credit, we bring you Gearbox V3…

Gearbox V1 was a test in prod for Gearbox’s Credit Accounts, Gearbox V2 tested the first application of Onchain Credit... With Gearbox V3, the goal is to create a protocol that functions like a Credit Layer in DeFi, NFTs, RWA, and beyond. A credit protocol capable of creating multiple different credit products with focus on higher capital efficiency and cover segments that haven’t been tapped into yet.

This article is divided largely into 3 parts, as detailed below. Dig in!

  • Part 1: Credit narrative and why it is there
  • Part 2: Lending architectures and narrative wars
  • Part 3: V3 details and new protocol core
This article focuses on the protocol sided development of Gearbox and not the products coming with V3, not just yet. The V3 protocol will offer a codebase that will be used to develop multiple credit products. Details on products will follow post Istanbul.

Part 1: Setting up the stage

1.1 Is Leverage = Credit = Looping vs Perps?

Let’s come back a few steps and talk about Credit in DeFi, NFTs, RWA, and so on. What can be considered as credit? Credit is essentially about “more capital so you can do what you want”. For example, you want to get more exposure to ETH upside. There are multiple ways to do so:

  • Borrow-lend swapping-looping on lending protocols like Aave, which utilizes existing DEX liquidity for trades;
  • Using perpetuals on CEXes like Binance or OKX, which utilize their own orderbooks and liquidity;
  • Using perpetual DEXes like GMX or dYdX, which utilize their own orderbooks and liquidity that could be thin;
  • Using margin trading on Gearbox, which utilizes existing DEX liquidity for trades meaning PURE liquidity (ikyk);
  • Etc.

As such, to a user who simply wants to get “more exposure to a given asset”, these can essentially mean the same thing: credit, leverage, perpetuals, futures. For instance, there are multiple ways in the real world to get exposure to “Spanish Real Estate” as well. Physical buying, REITs, some other synthetic exposure, and so on. The outcome can be similar, but the path is very different.

And that path is what makes a difference in UX, User Experience. 

We have written a longer deep dive on the what and how of Onchain Credit. Highlighting the why and nature of credit, how we have seen it evolve over the years and why capital efficiency is the next natural step for Onchain Credit. You can read it below.

Building and expanding the Onchain Credit Layer - Gearbox
What factors exactly drive this demand for credit, though? How do you capture it, and grow it? How much can you even borrow and with what mechanism while maintaining the best possible standards to keep out bad debt?

1.2 Powered by Credit Account {abstraction}

Gearbox is approaching the topic of credit (leverage) from the ultimate User Experience angle, by giving everyone their own “Credit Account” via account abstraction. You can see it as having your own leveraged wallet. You simply get more capital and then go use it on the protocols you already love.

We have written on this more than 2 years ago, and it is becoming more relevant by the day. Account Abstraction, baby! No vaults, locking periods, someone holding you back, or anything of that nature. Gearbox is about full user freedom!

For Gearbox, anyone is a user: a person, a bot, a protocol, and so on. The goal of Gearbox Protocol is to be in-between of all participants as a Credit Layer. Not recreating liquidity like perps, but utilizing PURE spot liquidity in all the farming and trading actions.

Remember credit cards? You can go and pay with it wherever, thanks to the vast network they have. Same here: imagine going to any protocol and being able to ape with more capital thanks to Gearbox’ onchain credit. That’s what we have been building since ‘21, and now… We are closer to reality thanks to V3!


Part 2: Architecture Decisions and Narrative Wars 

As V2 was launched in 2022, we immediately embarked onto new collateral integrations and… stopped right there. Growing the credit primitive comes with incredibly sensitive security questions. Before getting into solutions, let’s look at the broader picture.

In the past year, a few protocols (Morpho, Ajna, Euler, etc.) have looked into how to turn lending into a less complex primitive. No governance, risk granularity, etc. Meanwhile, Aave demonstrates how hand-holding is beneficial to end users. And it’s true, users don’t want to actually bother with all these small things and just get a “good APY low risk” whatever that means…

Gearbox Protocol is both modular and composable. It doesn’t take a stance with regard to this narrative war. As a protocol, it needs to be as broad as possible. And hence, V3 is based on:

2.1 Modularity and Composability

V3s focus was to turn everything involved with the functioning of the protocol into modules, as we have been doing since 2021. This enables individual pieces to be used in multiple contexts and yet serve their purpose for Gearbox when used together. This enables significantly higher flexibility for future integrations:

  1. Improved Composability: being able to integrate and add adapters into new protocols and assets quicker, as well as utilizing more oracle sources rather than just Chainlink;
  2. Improved Risk Granularity: being able to add those interesting credit opportunities without increasing risks to the protocol, and being able to give lenders a choice with regard to risks.
💡: Being a lego means Gearbox doesn’t necessarily have to compete with other protocols or products, it can look more towards integrating them if the risk profile enables so.

You can reconnect modular pieces as much as you want, essentially shielding risk or increasing risk, and even deciding on assets and LTVs! This was possible with Gearbox V2 already, but we made it better.

  • You can imagine a separate risk pool where lenders opt-in to be indirectly exposed to fancier assets but still be passive and make more yields on top.
  • You can imagine another DAO treasury having “its own gearbox” where THEIR governance decides the AllowedList and their LTVs, essentially pricing their own risks.
  • You can imagine KYC “narctech” pools with restricted lists, similar to how Leverage Ninja list is, but on different TCR terms.
The goal of Gearbox is to turn Credit Accounts into a primitive for Onchain Credit. How and what you connect to it, can be completely customized. A truly composable and modular layer of credit.

2.2 Risk and Security

As always, onchain dark forests come with a variety of known and unknown risks. Gearbox so far has had $0 in bad debt, but you never know where a threat can be lurking. As such, the majority of the efforts go towards security every single hour.

First of all, V3 has been fully audited by both ChainSecurity and ABDK, and will be added to the audit repository prior to the deployment in a few days. But no number of audits is ever enough, so there are other parallel initiatives running:

  • Bug Bounty and Immunefi, to date having had a few decently sized payouts. So if you are a security researcher, keep in mind we are always happy to engage and pay out well if you help us!
  • We have made an enormous backend monitoring tool which looks into the health of collaterals, oracle deviations, and even models liquidations. Not just for Gearbox, but for all the assets and protocols we have integrated. If you want to have access and build it further with us, don’t hesitate to ask!

You can find it at https://risk.gearbox.foundation/.

Note: Out of every $1 that's spent from the treasury, 45 cents go towards bolstering security and improving risk management. This includes a whole V2.1 Gearbox version that was launched with just security in mind. You can read the complete details in this thread.

Part 3: Gearbox Protocol V3

💡
Gearbox V3 will be launched in 2 phases. The Alpha launch will happen Mid-November and the complete launch is scheduled for January, 2024.
  1. Collateral limits for new assets and L2 deployments
  2. Risk-Specific Lending Pools
  3. Diesel tokens becoming ERC4626
  4. Partial collateral withdrawals
  5. Gearbots onchain bots aka intent agents
  6. Quotas, Gauges, and lending rates
  7. Revenue sources and Minimum Viable Tokenomics for GEAR

3.1 Collateral limits

Remember the CRV vs lending protocols concerns of this year? We’ve seen through them (it was obvious to everyone) and had to improve the codebase in order to add new farms and chains. Because when you look into something as liquid as WBTC on rollups, even its liquidity is not infinite. As such, you need to have collateral limits in place even for the supposedly big assets. 

The limits are adjustable by governance, naturally. This method thus enables Gearbox to grow in multiple more ways:

  • Addition of medium- and long-tail assets: by capping the exposure, Gearbox’s leverage becomes more generalized with these assets becoming possible to add.
  • Deploying on L2s: As a corollary, L2 deployments also become possible. L2s and side chains suffer from lower liquidity, and as the multichain grows (or not) this might be a growing problem.
  • New cool protocols and asset classes (which usually have low liquidity and high risk, but also large yields) can also be added, capped at $1–2M limits. Negligible size for the current lending pools, yet can serve as a great way to keep leadership and give a boost to the newer DeFi entrants. Yay!

3.2 Risk-Specific Lending Pools (Alpha)

With Gearbox aiming to grow the list protocols and assets available to users, the DAO will start exploring options apart from the current bluechip integrations. Newer integrations, like Curve V2 pools, are slightly more volatile. This volatility means slightly higher risk, and as risk increases, so should the interest rates earned.

Alpha pools will deliver 2 important advantages:

  • Segment risks of new integrations: Those wishing to remain in the bluechip V3 pool will be able to do so and earn as they do without any additional risk. Meanwhile, lenders okay with some additional risk, minimal additional risks like Curve V2 pools, will be able to do that.
  • Generate higher APYs: That happens because the integrations here would allow Ninjas (leverage borrowers) to generate more APY. As a result, they would be prepared to pay higher borrow rates. Not just 3–5%, but likely 7% or even 10+%!
Leveraged Curve V2: Farm 5x of your funds 🤯
For the past two years, farmers have been making the usual bear market APYs. Inflation meanwhile has gaped our a**holes like that train…

The future deposits in alpha pools will be used to create credit for non-bluechip additions and integrations to the protocol. This differentiation is made possible with the modularity of V3.

NOTE: Bluechip pools will remain but will move to a new architecture as well. This is required to ensure that the pools are able to function in sync with the other upgraded and new modules. A simple “Migrate” option will be made available to move from current Pools to V3 Bluechip Pools.

3.3. Passive side Diesel tokens becoming ERC4626

ERC4626 Diesel tokens denote the share of a vault, lending pool in our case, of a depositor. Simpler, better for external integrations, cheaper.

There are many more lending segments with highly varying factors that can be sources of growth. With Gearbox now more modular than ever before, it is possible to dive into more differentiated pools. The below pools are examples of what all could be made possible and not an indication of imminent additions. All are subjected to DAO voting.


3.4. Partial withdrawals

We previously didn't have partial withdrawals enabled for extra security concerns, but we made this feature possible as it’s quite essential. For many farmers especially, once they earn rewards, they want to withdraw the proceeds without touching the underlying. Similar to how there are dividend ETFs v the double-down ones. Just different instruments, but the protocol should be able to service both.

As a result, we will have partial collateral withdrawal (and not just debt reduction like before) available in V3. It will be under some withdrawal period mode < 24 hours, so it should be quick enough for users! And with some extra security measures in place, just in case.


3.5. Gearbots UX: Intent Agents

Between all the upgrades, it’s also key to make sure that the UX keeps getting better. We did that last year with Multicall. Multicall used account abstraction to bunch transactions and interact between multiple contracts in 1 click. Complex farms in just 1 click, yes!

The next step in our quest for improved UX is bringing to life true automation onchain that enables you to have a CEX like experience while using leverage. How? - Meet our intent agents called Gearbots.

Gearbots are open source, immutable automation contracts that essentially allow CA owners to delegate certain aspects of active account management to a third party that functions in a predictable and neutral way. This could be done by using Gelato Network to trigger the implementation of logic in a smart contract. The logic itself is defined by the user and the smart contracts ensure that the logic functions in the range of the set parameters.

You can read the complete details regarding Gearbots in the article below.

Gearbox UX: Meet the Gearbots 🤖
Gearbox V2 was a milestone achievement for the DAO. Composable leverage in its true sense was finally brought to life with a massive…

For the onchain bot, the main source of functioning will be user “Intents”. Which work as declarative constraints and trigger when a constraint is met. Thus, Gearbots will have expansive capabilities but to point a few out:

  • Stop loss/take profit orders: A user can create an order that only executes after reaching a certain price point and submit it to a bot.
  • Automated HF maintenance like DeFi Saver: A user can register with a bot that would track their health factor and automatically convert part of the collateral into underlying if the HF falls below a certain threshold.
  • Automatic strategy management: Strategy bots would allow the user to automatically rebalance their funds between different assets and leverage levels, based on yield, risk and other factors. 

You can make your own bot, connect to someone else’s immutable bot deployed, or even have a bot that live-feeds commands into your Credit Account. All of that is possible! You can even build a UniBot that doesn’t need to own your private keys, partly solving key management. All the details are in the workshop video below, give it a view to understand better.


💡
Now let’s get to something more complex. Collateral limits must come with a few practical complexities which make it actually work onchain as well as introduce new revenue sources. In a cool way! The below complexity explained should be simplified by interfaces and products on top of Gearbox as a credit primitive. And those of you loving to dive into contracts & details - read below.

3.6. Quotas and Gauges: GEAR staking

Collateral limits are protocol-wide limits (or rather, Credit Managers). See them as “the protocol/pool is not exposed to CRV beyond $3X total value of CRV, anything beyond that number is ignored as collateral”. The benefit of this is clearly explained above in 3.1. The amount is determined by governance and functions as a more concrete value, likely changing not very frequently. What changes more frequently are some things underneath. 

Enter, quotas. A quota is reserved by every leverage user themselves, “how much of any X collateral asset on my Credit Account I want to go towards the total Health Factor”. Obviously, as much as possible. But anyway, see it as a technical implementation. It helps harmonize the distribution of limited collaterals between leverage users in a more democratic way, on the contract level more so.

As a leverage user, you essentially borrow a debt asset (say USDC) and specify what it goes into: a trade, a farm or whatever. As a result, the protocol is able to know how much extra to bill you depending on whether you are in a risky asset or not… It happens seamlessly!

Wait what, bill extra? - Yes ser. 

Enter, gauges. These are not like inflationary gauges in Curve, nono, quite the opposite. Gauges are basically a tool for “what extra APY rates on top of the usual utilization curve, for every asset separately, is being paid by a borrower every epoch” (an epoch is 7 days but could be longer). This is how the protocol bills extra for quotas, essentially. 

Gauges are the instruments with which it is decided how much for every quota is paid. GEAR stakers freeze their tokens (for security purposes against governance attacks) and then vote.

For example, lenders who hold GEAR will vote to make every borrower pay as much as possible. But every leverage user who holds GEAR - will want to move this number down. This creates a market for extra rates!

Basically, stakers decide these important economics. The unstaking period, from a security perspective, is 4 weeks right now. However, it can be made shorter. It’s there against governance attacks.

On epoch start, the voter’s existing votes are automatically rolled into the same buckets and assets where they were, unless the voter explicitly changes their votes.

Again, interfaces and products should obfuscate this complexity.

  • Collateral limits: define limits per every asset. Security-related.
  • Quotas & gauges: define limits per every user per asset (within collateral limits). Quotas is a term leverage users interact with, gauges decide how much per every quota is being paid. Again, these are just fancy terms, it’s not hard really. YIKES.

Why is this done, again? For Alpha pools to make sense, the lenders need to make more APYs than the base bluechip pool. This becomes possible as the borrowed funds for trading or more volatile additions generate higher returns. The APY on quotas is configured through a GEAR voting system and consists of two parts:

  • The Minimal Risk Premium(MRP) paid to the Lenders for the risk of being exposed to a particular asset. The APR cannot go below this value.
  • Everything above that (i.e., actual APR — MRP) can be considered a profit share between Borrowers and the Lenders.

As APYs from borrowers’ strategies and risk associated with certain assets change, the split would need to be changed too. This is necessary to make sure the risk of lenders and the efforts of borrowers both generate a mutually beneficial yield. This renders usual snapshot governance unusable and brings in gauges for GEAR voting.


3.7. Minimum Viable Tokenomics

The above ideas create an extra revenue source for lenders, but also for the protocol which all goes into DAO Treasury. It allows for economic incentives for Gearbox DAO to integrate new things, because newer integrations can be billed higher in fees.

Gearbox (GEAR) - Key metrics | Dashboard | Token Terminal
View Key metrics for Gearbox (GEAR) and compare against those of other blockchains and decentralized applications.

This ability for GEAR stakers to have a say in the revenue division is being called Minimum Viable Tokenomics because it is the simplest model that creates organic use cases for GEAR. The DAO can decide to pick a mechanism they believe is ideal for the stakers or holders and vote to implement it in later stages and any sharing in the process.

Grow the pie -> then decide how to eat it.

Like what you have read about V3? You'll love it when V3 based products roll out. Meanwhile, come join us if you would like to contribute or just vibe — just get involved on Discord or Telegram. Discuss, research, lead and share. Call contributors out on their bullshit and collaborate on making things better. But before we finish, enjoy this quote.

I saw a protocol in the chain and coded till I set it free - Mikaelangelo
Notion – The all-in-one workspace for your notes, tasks, wikis, and databases.
A new tool that blends your everyday work apps into one. It’s the all-in-one workspace for you and your team
JOIN DISCORD