Makers in Hubble vAMM

atvanguard
HubbleExchange
Published in
6 min readJan 27, 2022

Background and thoughts about vAMMs

Perpetual protocol pioneered the concept of Virtual AMMs or vAMMs. A vAMM is basically a uniswap like curve where virtualized liquidity can be used to trade perps as opposed to centralized limit order-books (CLOBs), which is currently a de-facto way of trading perps on CEXs and dydx.

We at Hubble are a big fan of the vAMM model for several reasons:

  • Allows the perps exchange to be decentralized from the get-go.
  • Enabling smart contracts to buy perps and hence opening the door for composability — for e.g. Lemma

Perpetual protocol v1 used UniV2 (xyk) invariant for their vAMM. The most compelling thing about this model is that it doesn’t require liquidity providers (henceforth referred to as Makers) at all. The protocol team can add virtual liquidity with the expectation that if/when the price returns to the original, the IL will be 0. While this model works really well to bootstrap the exchange, it has some limitations:

  • Since not all positions have a counterparty, most often there will be a skew b/w the long and short open interest. Consequently, the insurance fund has to step in to pay the funding skew.

In our case for Perpetual Protocol v1, the equilibrium state of the system turned out to be one where traders could easily earn funding just by holding longs in a bull market. Since launch, our v1 took in over 38m USDC in fees, 100% of which goes to the insurance fund. But the insurance fund balance is just a bit over 9m and that includes the initial seed (100k) and an emergency injection (1m+). The rest of the funds were mostly paid out as funding payments, and a small portion was paid out to cover bad debt during market crashes. ~ lkb from perp team

  • It becomes really hard to determine the right amount of liquidity (xy=k) because if the liquidity is too deep, it will take an immense trading volume to arb the price with the wider market in either direction. If the liquidity is thin, slippage is high. So, to have a sensible depth, the protocol needs to be adjusting k all the time in a centralized manner.
  • It becomes impossible to be able to use new concentrated liquidity AMMs like Uni V3 and Curve V2 because these AMMs are path-dependent i.e. IL is also a function of how a price reached where it is.

Hubble vAMM

At Hubble, we are using CurveCrypto Invariant for our vAMM. As described in Curve V2 whitepaper, it is way more efficient than xy=k invariant and concentrates liquidity given by the current “internal oracle” price. This creates 5−10x higher liquidity than xy=k. Implies tighter spreads => more trade volume => higher profits to LPs. Owing to its re-pegging mechanism, Hubble vAMM is path-dependent and needs Makers (LPs).

Makers

Conceptually, adding liquidity to our vAMM is akin to providing liquidity to any other AMMs like Uni/Curve V2. Makers provide virtual liquidity in the Hubble vAMM pool (optionally on leverage) i.e. they can add more virtual liquidity than their margin and earn fees on leveraged liquidity. For every position opened by a trader, there is a counter position opened for all makers and they share it in the ratio of their liquidity.

Let’s compare what providing liquidity to Hubble vs. Uniswap means. Let’s work with these assumptions:

  • Approximate Hubble vAMM like xyk for this illustration
  • Assume makers are not receiving a trade fee.
  • Start price of eth to be $2500
  • Maker starts with 50k capital and provides initial liquidity of 10ETH + 25K USD each in Uni and Hubble in each of Long and Short scenarios.

A. ETH jumps to $2600

At this point, according to xyk, the pool composition will be 9.8ETH and 25,495 USD.

Uniswap

  1. The LP is said to have sold 0.2ETH for $495. Their liquidity is now worth 9.8*2600 + 25,495 = $50,975
  2. Value of their assets had they not added liquidity would be 10*2.6k + 25k = 51k; so an IL of $25

Hubble

  1. The maker is said to have opened a short position of 0.2ETH at openNotional of $495 (avg open price = 495/0.2 = $2475). We refer to this position as an impermanent position because it changes with every trade and might even become near zero in the future.
  2. For short position, their PnL is given by openNotional minus notionalPosition = 495–0.2*2600 = -$25

B. ETH dumps to $2400

At this point, the pool composition will be 10.2ETH and 24,495 USD.

Uniswap

  1. The LP is said to have bought 0.2ETH for $505. Their liquidity is now worth 10.2*2400 + 24,495 = $48,975
  2. Value of their assets had they not added liquidity would be 10*2.4k + 25k = 49k; so an IL of $25

Hubble

  1. The maker is said to have an impermanent long position of 0.2ETH at openNotional of $505 (avg open price = 505/0.2 = $2525)
  2. For long position, their PnL is given by notionalPosition minus openNotional = 0.2*2400–505 = -$25

Funding payments, Leverage, Multi-collateral

Now, if your question is why you should add liquidity to Hubble instead of vanilla uni/curve v2 pools, the answer is:

  1. Leverage — Initially, Hubble will allow upto 5x leverage. So with a margin of $50k, you can upto $250k liquidity and earn trading fees on the leveraged amount. Of course, your potential IL is higher too, so use leverage only when you know what you are doing. Otherwise, you’ll be liquated and receive a HubbleHug for it. Note that, on 1x leverage, there is only a very slight chance that a maker can be liquated and it might happen when the makers have been consistently paying the funding fee.
  2. Funding payments — Since the makers are being traded against, most often makers will end up taking the unpopular position and hence be paid funding payments. Passive incoooome.

3. Exposure to your favorite coins — Because Hubble is a multi-collateral system, you can post margin in any of the supported collateral coins. So, if you are an AVAX bull, you can deposit AVAX to Hubble (and maintain your potential upside) and use that to be a Maker with 1–5x leverage in any of the markets.

So, when you add liquidity to Hubble your cost is the IL. Your gain is the trading fee + funding payments + liquidity mining rewards (if any). So if the gains > IL, it’s profitable to be a maker in Hubble. We want the makers to be able to express what markets they want to add liquidity to, so there’ll be different liquidity pools for each asset; not a common one. Moreover, if/when a maker removes their liquidity their impermanent position is converted to a permanent one, i.e. as if they opened this position as a taker.

Hedging

It’s possible to maintain a delta-neutral position while being a maker in Hubble. The strategy would look something like this:

  1. Deposit liquidity to Hubble with 1–5x leverage according to your risk appetite
  2. As traders continue to trade on the vAMM, you’ll start gaining an impermanent position.
  3. Query your impermanent position from the Hubble contracts and open an exact opposite trade on another perps venue. For e.g. if your impermanent maker position on Hubble is 0.2ETH short, then open a 0.2ETH long on FTX.

Social Plug

🌐 Website | 🐦 Twitter | 🗣 Discord| ️Telegram | App

--

--