Leverage without liquidation

Thanks to Sam and Hameed for feedback.

TL;DR

1-click leverage pool where FRAX users can take a leveraged positions on a variety of tokens without the risk of liquidation.

Motivation

Most stablecoins offer a leveraged position on ETH or other tokens. In Maker this goes as follows: you deposit ETH, borrow DAI and use this DAI to buy more ETH. Now you have increased your ETH exposure, but you also risk liquidation. If the price of ETH falls you can get liquidated.

We want to offer leverage without liquidation risk, you can simply deposit your FRAX, choose to leverage long or short and you will have a non-liquidatable position. The pool will keep your leverage constant, this means you cannot run out of collateral and cannot get liquidated. You can easily exit your position and take out your FRAX plus/minus your gains/loses.

How does this work?

We have three pools filled with FRAX: the long pool, the short pool and the liquidity pool. Users in the long pool have a long position, users in the short pool have a short position and users in the liquidity pool have either a long or short position, depending on if we have more longs or more shorts.

We have an Oracle that gives the price of ETH at certain intervals. You can enter/exit any of the three pools. The price that you enter/exit will be the next oracle price, so you cannot gain an advantage if the price has moved since the last Oracle update, because you always have to wait for the next price.

At every interval we update the positions in the pools based on the price change since the last Oracle update. Suppose you are 100 FRAX long with leverage 2x and the ETH price moved up 1%, you have gained 2% leaving you with a total position of 102 FRAX. If the ETH price fell by 1%, you would have lost 2%, so you would have 98 FRAX left. After this calculation, your leverage is reset at your original leverage. If you are leveraging via Maker your leverage increases when you are losing and decreases when you are winning. We keep it constant, to lower your downside and increase your profits.

How do we keep longs and shorts aligned?

For every long position we need a short position and that is where the liquidity pool comes in. If we have more longs than shorts, the liquidity pool provides the missing short position and vice versa if we have more short positions than long positions. When even the liquidity pool has insufficient liquidity, the leverage of the largest pool is lowered slightly. We want to incentivize taking long positions when we have more shorts and short positions when we have more longs via a funding rate. This funding rate is an interest rate paid from the larger side to the smaller side. The liquidity pool is always on the receiving end of this, so is always earning the funding rate.

Are there trading fees?

To avoid Oracle manipulation we need to charge a small fee. This fee will accrue to the liquidity pool holders, because they are the ultimate counterparty of every trade. This also gives them an extra incentive to contribute to the pool.

Benefits for the FRAX protocol

  • FRAX is deposited as collateral, creating demand for FRAX.
  • A small percentage of the trading fees or funding rate can go to the protocol.
  • FRAX can take short positions on its volatile collateral, moving away from USDC as collateral and opening up the possibility to hold a significant amount of ETH or other tokens without price risk.

Request for feedback & discussion

  • Questions? Please ask!
  • Would you be interested in using the leverage pool or providing liquidity?
2 Likes

I think this is a clever mechanism worth investigating. As I understand it, this resembles a perpetual but with a third in-between pool which provides the missing liquidity. This allows the longs and shorts to avoid liquidation as the shrinking liquidity in the losing side is palliated by the middle pool. IMO, the most complex part is how to determine the funding rate, which must not be too expensive but should protect the intermediate pool from being rekt. Passive LP against active and experienced traders may be dangerous, as exemplified by Hegic in the context of options. I also wonder to what extent Frax finance can devote resources to a side project, which seems to be a new protocol on its own.

You are correct that incentives need to be high enough to bring in the liquidity providers. The liquidity providers take a similar risk as option writers. When the underlying price goes up, they are more short and when the underlying price goes down, they are more long.
The trading fees and the funding rate might not be enough to bring in enough liquidity, so we may need an extra liquidity fee that goes to the liquidity pool to pay for the risk they are taking depending on the ratio of the size of the liquidity pool and the other pools. This way the market can decide on the incentive to be in the liquidity pool.

I like this idea like we discussed before. I think that like @pre-vert said this seems like almost an entirely separate protocol which is kind of interesting. What I think would be a great idea is to have a grant to build this out with you+others that want to do this as a FRAX AMO or product. I guess technically it’s not an AMO because it does not have the same kind of expansion/contraction logic theme of the others.

This is definitely something that can be big so I think we should look into supporting this with a governance proposal.

Additionally, the other thing here is to see if this mechanism can be used one day to intake the actual assets into the protocol so that it can be branded as a way to mint FRAX with volatile collateral. This can be our CDP-like minting system if structured differently some day. But for now, it is a perp system mainly and is entirely based on using FRAX which I like.

Where is liquidation mechanism? it is the hardest part of all.
Without liquidation mechanism, bit of joke.
btw, Synthetix ($SNX) applies this long/short strategy, staking is very profitable rn.

This seems very similar to how Gambit protocol works - might be worth reading how they implemented Overview - Gambit

1 Like

At every interval your leverage is reset to its original value, this means that your exposure to the underlying goes down if you are losing. Unlike Maker or traditional futures where your exposure stays the same. So if you are long 3x ETH with 100 FRAX, your ETH exposure is 3x100=300 FRAX worth of ETH. If the ETH price goes down 10%, you lose 30 FRAX and will have 70 FRAX left with an exposure of 3x70=210 FRAX worth of ETH. With traditional leverage you would also have 70 FRAX left, but would have a higher 300*0.9=270 FRAX worth of ETH exposure.
You could say that you get partly liquidated at every downturn of the market, but this is reversed when market goes up again.

What will happen if Eth price goes down 35% ? who and how to manage this pool?

We can do two things, we can just cap the max change that is settled per period on say 10% and keep the max leverage at 5x. Then you will max lose 50% in one period. We could also do multiple settlements with rebalancing at the end of a period if the change is more than 10%,. In your example we will have 4 settlements, three times with -10% and once with -5%. If you have 100 FRAX and are long 3x and the price goes down 35%, you will have 100 * 0.7 * 0.7 * 0.7 * 0.85=29.16 FRAX left. With Maker or a traditional future you got REKT.

1 Like

personally i would not use this.

the worry of being unable to exit a trade due to silly high ETH prices which happens when there is a big price move.

but i guess i like the idea in general.

@sparkes25 Can you define a bit more what you mean about “not being able to exit” if there is a big ETH price move? I’m not sure how it’s possible to get “stuck” in this system. There is no liquidations. Your leverage just goes down to 0 worst case. You can always exit.

Is there a possibility that LPs could not exit? If leverage of one side goes to zero, this means that leverage on the other side is rocketing. I struggle to see how LPs can make up the difference.

You can always enter and exit, your long, short, or LP, so you do not have to worry about that. The reason is that we try to reset your leverage on your position to your preferred leverage after every interval. In the case that there is not demand for the opposite side, your leverage will be lower to match the opposite side. Important is that your leverage will never be higher than what you specified.
To make sure that both the longs and the shorts can have their preferred leverage the Liquidity pool steps in. The Liquidity pool will be the counterparty in case the demand for longs and shorts are not equal. If you deposit in the liquidity pool you can specify a maximum leverage, that maximum leverage will never be exceeded, so if you want to deposit in the Liquidity pool with 2x leverage you will never be more short than 2x and never be more long than 2x. In case the Liquidity pool has reached its limit the leverage of either the longs or shorts will be lowered compared to their preferred leverage.
A numerical example:
Alice: 100 FRAX 2x long.
Bob: 250 FRAX 1x short.
==> Alice gets her 2x long leverage, Bob can only be 0.8x short.
Now add Charlie: 100 FRAX in the Liquidity pool
==> Alice gets her 2x long leverage, Bob gets his 1x short and Charlie is 0.5x long.

Nice. Leverage without liquidation could be game changing. I’m still a bit worried about the situation of LPs if markets are not efficient and the price direction can be to some extent predicted. They would end up more than less frequently on the losing side of the market.
Also, a short white paper might be useful at this point.

I agree that we need to make sure that the LP’s get a good price on every trade. Therefore the trades are not against the current oracle price but against the future oracle price. This is like how you can trade on Synthetix, where you have to wait 6 minutes, for an possibly oracle update.
I was thinking about using the UniV3 TWAP as the oracle and your order will be executed against a TWAP that has not yet started at the time you send the trade. TWAP’s can get manipulated, but that is expensive, so a small trading fee will do to avoid that I think.

when ETH moves a lot eth fees rocket , the fees can go up 100x in an hour so a trade that cost $10 to enter could cost you $1k to exit.

so if your trade size is only a few $k then it would not be worth closing the trade due to the fees.

When the trade goes in the wrong direction for your position, its leverage is automatically lowered to avoid losing your whole deposit, so there would be less of a an need to quickly close your position. You can just wait for the fees to be lower and close the position.
We could also deploy on L2, where transaction costs are lower.

Do consider taking a look at how PHX.finance has build their DeFi leverage tokens.

there you go then, an issue was noted and a solution was found,

so lets deploy it on L2.

or i guess any other chain that has much lower fees i guess.

The leverage tokens from phoenix have a similar return curve as the leverage pools. They use external liquidity to rebalance every 6 hours. We plan on rebalancing more often, this give you a smoother result and also increases the returns in a trending market.