Leverage 2.0 — Credit Account as a DeFi primitive.
Hi everyone!
We are back with another technical-conceptual piece. But before we dig in, just a quick update on what’s going on. The governance launch has been split into a few phases to allow various communities to participate (hint: stick around in Discord). We have upgraded and frozen the contracts as audits #2 and #3 are on their way. Overall, things are looking exciting as we head into mid-autumn… It’s GEARing up for launch!
You can complain about bad puns and suggest better ones in Discord.
And while there hasn’t been much information released yet, feedback from the community has been astonishing! Over 60 testers helped with the closed beta, so we quickly went back to improve the UX. The doors shall soon be open for more testers to experience how it is to have generalized leverage on any* DeFi protocol. If you missed the last article, catch up:
Table of contents for this article:
- Leverage 2.0: WHAT Gearbox can enable (composable strategies)
- Credit Account: HOW Gearbox enables it (technical overview)
- Credit Account: HOW you can interact with it (user perspective)
Make sure to not miss anything! Grab a cup of 🍵 and LFG.
One of the questions we got a lot was:
“Is Gearbox like a yield farming protocol or a trading platform?”
— “No” and “Yes” at the same time. It enables those, but it’s much more than that. You see, Gearbox is not a trading protocol. It is not a trading strategy or a yield-farming optimizer. Gearbox is a protocol that gives you generalized leverage which you can then use for those and other various things.
The optionality Gearbox provides is very broad, and that is because it is built like a primitive/protocol for developers — and not like a final product.
This is why we call this leverage generalized (definition: widespread or widely applicable). You can use the increased leveraged position on existing protocols as you are used to already:
- margin trade on Uniswap (so yes, trading);
- leverage farm on Yearn (so yes, farming);
- use DAO holdings to get leverage for various operations on-chain (new);
- open leveraged CDPs (new),
- make composable strategies (new), and so on!
Enter Leverage 2.0
Gearbox doesn’t define what you can do, it only caps the boundaries of what you can’t do. Think of it this way: robo advisors, yield strategies, other trading protocols, or anything* else — can be integrated with Gearbox — to then do the same things they do but with x4+ efficiency. You can have your LP strategy be done with 4x the capital size, and your Uniswap trade with 4x the size as well! As such, Gearbox increases the capital efficiency of possibly any protocol as users can deploy larger amounts.
- Leverage as a Service: Other protocols can ask to be allowed* by Gearbox governance. This way, they get an existing user base with larger capital size and efficiency — bootstrap their protocol liquidity and usage. See it like adding a new payment partner to a credit card network: they immediately get visibility of all existing and new users.
- No funding rates: Because Gearbox doesn’t have internal trading books or its own liquidity for swaps, everything is executed on third-party allowed protocols*. As such, Gearbox Protocol doesn’t need to maintain a ratio between long & short positions, so there are no funding rates that users need to pay. Borrowers only pay lending rates for what they borrow. Next to that, this design makes the architecture more composable and as such more aligned with the builder ethos of integrations rather than forking.
- Composable strategies… see below!
*Gearbox Protocol governance will decide the collateral assets, the liquidation thresholds, and the list of allowed assets & contracts (protocols) — to keep the liquidity provider funds over-collateralized and the protocol overall — secured.
Before we dive into the technicalities, let’s look into…
What Gearbox enables: Composable Strategies
When you put ETH as collateral and borrow x4 more, you can sell all that ETH to stables. This effectively opens a short on ETH. Those stables you then can put into Yearn for farming, and it’s essentially an x5 leverage farming compared to your notional size of ETH. Now your short is farming! And then Yearn LP tokens you can… the possibilities are there to explore 👀
Another way to utilize Gearbox is to do leveraged arbitrage. For example, with flash loans, you can arbitrage positions with a large size and make a profit on the difference. But what if it takes a week or two for a peg to settle? You can use Gearbox to take this conviction-trade and while you are at it, make use of the other side of the position to also trade or farm.
There are many composable strategies which even other DeFi teams can build in order to increase their usage and volumes. Jump in Discord to suggest, collaborate on these mini-projects, and make DeFi more capital efficient!
How is this possible? Enter a Credit Account.
A Credit Account is your access to the leveraged world — an isolated smart contract which contains both the user funds and the borrowed funds. This is where your leverage is. Every user has their own Credit Account(s).
Credit Accounts from a technical perspective — see the tech paper.
A Credit Account is an isolated smart contract which holds both the user funds and the borrowed funds. This is where your leverage is. After you open an account, all the operations go through this account and the assets stay on it as well. You can see a Credit Account as your automated DeFi wallet where you not only keep positions, but can also potentially program it the way you want.
Funds on Credit Accounts are used as collateral for debt, and users can operate these funds by sending financial orders to their Credit Accounts.
Every Credit Account has a liquidation threshold. If your position is about to get underwater, you will be liquidated by third-party liquidators, so it’s an open and transparent procedure. This is the simple but beautiful thing which allows Gearbox Protocol to give leverage in a decentralized way without caring if the actor on the other side is a cat or a bot.
Speaking broadly, leverage can be granted to anything or anyone as long as Gearbox as a protocol can calculate the health factor.
“A Credit Account of Gearbox Protocol could act as prime brokerage allowing developers and users to automate and program their DeFi positions to increase their capital efficiency“ — some have said.
Allowed list policy
Operations available to Credit Account users are restricted by two policies:
- Allowed contracts list. Users can interact through Credit Accounts only with contracts from this list to mitigate risks that funds will be sent to vulnerable smart contracts.
- Allowed tokens list. This allows managing risks of swapping funds to highly-volatile assets whose price could drastically fall after a swap and before a liquidation would take place. Or even fake ERC20s.
Both policies are managed by governance and can grow to enable more assets and protocol. These policies ensure (IF the protocol works as intended and IF third-party liquidators do their job) that the liquidity providers are not taking directional bets — their positions must remain over-collateralized.
Low Overhead on Gas
The gas consumption depends a lot on the architecture and the security checks in place. While the latter can never be compromised and is essential, the gas-efficient architecture is something that is unique to Gearbox.
See the difference:
- The usual architecture: a joint liquidity pool, which is a smart contract with virtual balances maintained for every user. While the contract stores all of that data, any one operation has to update the entire list every time, which is gas-inefficient. If you were to allow trades via such an architecture, the operations would be very expensive gas-wise.
- Gearbox architecture: There is no joint pool through which you trade because every user has their own Credit Account where the assets are kept. As such, only THAT contract (Credit Account) interacts with Uniswap, Sushiswap, Yearn, and so on. Therefore, the gas overhead is minimal. There is more to say about security, in the next articles.
User Perspective on a Credit Account
A Credit Account is your improved wallet, one can say. You can still sign transactions with your Metamask. However, instead of trading with your 25 ETH — you can now trade with 125 ETH.
Everything you are used to, but with higher efficiency. You, as a user, commit all the operations through your Credit Account with the increased notional size that you got from Gearbox as a loan. Imagine it as your credit card, or your smart contract wallet through which you trade, farm, and do everything you are used to already doing.
BUILD TOGETHER, SER?
Hopefully, you are now also on the same page with the core features of Gearbox. We call Credit Accounts a primitive, due to how much composability they allow! We invite everyone to build it together.
As there is no gatekeeping, every protocol porting to Gearbox (on either the LP side or allowed contract list) can increase their user base liquidity and capital efficiency. Let’s build it together and grow DeFi!
How can I get involved and contribute?
There are a lot of things to get involved in, ranging from being a third-party liquidator to helping onboard collaterals, to research on risk scoring and building integrations, and so on. The community has just started forming, so we welcome everyone to jump into Discord. Other
- Website: https://gearbox.fi/
- dApp: https://app.gearbox.fi/
- User Docs: https://docs.gearbox.finance/
- Developer Docs: https://dev.gearbox.fi/
- Github: https://github.com/Gearbox-protocol
- Twitter: https://twitter.com/GearboxProtocol
- Snapshot page: https://snapshot.org/#/gearbox.eth