Aloe Protocol
Search…
⌃K
🏦

Overview

>> market-making on margin for Uniswap V3
The information provided by Aloe Labs, Inc. (“we,” “us” or “our”) on docs.aloe.capital (the “Site”) is for general informational purposes only. All information on the Site is provided in good faith, however we make no representation or warranty of any kind, express or implied, regarding the accuracy, adequacy, validity, reliability, availability or completeness of any information on the Site.
Under no circumstance shall we have any liability to you for any loss or damage of any kind incurred as a result of the use of the site or reliance on any information provided on the site. Your use of the site and your reliance on any information on the site is solely at your own risk.
This page describes a preliminary version of Aloe II. Mechanisms may change before the full mainnet release.
Aloe II is a supercharged money market where borrowers can manage Uniswap V3 positions on margin, giving market makers superior access to capital and generating higher yields for lenders. The easy-to-use lending side (Earn) is targeted at passive investors, while the borrow side (Prime) is built for sophisticated actors and offers up to 20x leverage. This system allows market-makers to run more capital-efficient strategies.

Participants

Aloe II has two distinct users: passive investors and market makers.

Passive Investors

Passive investors provide assets to the lending markets in Aloe Prime. These users can be anyone interested in earning yield on their assets. Since Uniswap V3 has deep liquidity and lots of listed trading pairs, almost any asset can be used in an Aloe Lending Market.
Passive investors are not responsible for market making strategies. They are responsible, however, for assessing risks and monitoring the health of their chosen lending market and of the underlying Uniswap V3 pair.

Market Makers

Market makers are the sophisticated users that deploy capital from lending markets into their chosen trading pair, executing LP strategies for profit. If you are a prop shop, existing market maker, or MEV searcher, using Aloe Prime can amplify your returns while making it more capital efficient to hedge.
Market makers interact with Aloe Prime through margin accounts, which are special, user-owned contracts that have permission to borrow from the lending markets. These accounts present an interface to their owner, allowing them to control borrow amounts and Uniswap V3 position creation. When positions are closed, earned fees are collected in margin balances, which can ultimately be withdrawn by the market makers.

Components

Aloe Prime consists of two distinct components - lending markets and margin accounts.

Lending Markets

Lending markets make up the backbone of the system, and are where passive investors’ deposits are directed. Each lending market is isolated to a Uniswap V3 pair. For example, a ETH/USDC lending market would only support two assets for deposit and withdraw: ETH and USDC. Lending markets can be permissionlessly created and initialized for any Uniswap V3 pair.
Each lending market depends on the quality of the TWAP oracle from its associated Uniswap V3 pair. This means that pairs with less liquidity, or highly concentrated liquidity, are at risk of price manipulation attacks, and depositors should be wary of using them. However, this also means that stable, established pools are isolated from other risky pools, which gives users flexibility in their risk profile.

Margin Accounts

Margin accounts are what enable borrowers to access capital for market making. Each margin account is associated with the address of its owner, and can only be controlled by that address (except during liquidations).
Margin accounts are also associated with a specific Aloe Prime lending market, which in turn is tied to a Uniswap V3 pair. This means that, like lending markets, margin accounts only support two assets at a time.
Margin deposits act as the collateral for borrows issued from Aloe Prime lending markets. When a user wishes to create a Uniswap V3 position, a call to their margin account is made that borrows funds from the lending market and deposits them into Uniswap.
Since the position remains in the custody of the margin account and not its owner, the notional value of the Uniswap position can exceed that of the margin assets. The margin assets only need to cover for the losses accrued by the position (divergence loss + borrow interest), plus some additional padding for safety.

How it works

  1. 1.
    Isolated lending markets are created on Uniswap V3 pairs, taking trust assumptions from the quality of the TWAP oracle.
  2. 2.
    To market-make on margin, open a margin account and deposit margin made up of the assets in the pool.
    • The total value is what matters, not the specific composition. If you wish, you may only provide margin in one asset.
  3. 3.
    Open a leveraged Uniswap V3 concentrated liquidity position through the Aloe Margin account.
    • The margin account supports a passthrough interface - see contract docs for how to format your call, or use the Aloe Prime web app.
  4. 4.
    When you want to close the position and repay the loan, the divergence loss (also known as IL, or the difference in value between the Uniswap V3 position and the outstanding liabilities) is deducted from the margin account, along with the interest paid to lenders. You keep the earned trading fees and remaining margin.
  5. 5.
    If you fail to close your position in time, or the position accrues too much of a loss, you can get liquidated.
    • The liquidation threshold is determined by the amount of margin for a given position (aka leverage factor), the position bounds, and the volatility of the underlying assets.
    • If the IL suffered by your position gets too close to the value of your margin, anyone can liquidate your margin account and close your borrows.
    • Much like a regular borrow, closing your position will deduct IL from your margin account. Additionally, a small incentive will be paid to the liquidator responsible for repaying the borrows.

Desmos Simulation (single Uniswap Position)

Workflow Summary

Why does this matter?

You can find more context in the original blog post.

Improved Capital Efficiency for Hedging

Sophisticated market makers often hedge their LP positions with instruments like perpetual contracts and options. When the LP positions are created through Aloe Prime, they can be of the same notional value with less upfront capital, while the hedging cost remains the same. This allows for the strategy to grow in total size, or for the capital to be productively deployed elsewhere.

Trustless and Public Borrowing

All of the trust mechanics for Aloe Prime are encoded on-chain. The lending markets do not depend on any external entity for enforcement. Additionally, the composability of smart contracts will let the profits earned by market makers fit the interest rate mold that many existing decentralized lending users expect.