ByzantiumScripts

Aggregated Perpetuals Basis

CONCEPT

The aggregated perpetuals basis compares the prices of perpetual swap contracts in crypto (or "perps" for short) with the price of the spot market.
The idea behind this is that it can help you analyse whether the derivatives market is being overly bullish or bearish .

When the indicator shows positive values (grey colouring by default) it means that perps are trading at higher prices than spot.
Generally speaking we say this is bearish or at least not an ideal scenario to long yourself because most of the time this means that derivatives market participants are too aggressive (overbought territory).
Vice versa when the indicator shows negative values (green colouring by default) it means that there's a spot premium which is considered bullish .
A spot driven market is a healthy market. There could also be a spot premium because market participants that are trading perps are aggressively shorting which puts them at risk of getting short squeezed (again, bullish ).


FEATURES

The indicator works for both BTC and ETH.


It's aggregated because it looks at the prices of multiple contracts and it's also volume weighted so that more important markets have a bigger impact .

There are three different types of premiums you can select: coin margin, dollar margin or the combined version.


In crypto there are two types of perpetual swap contracts. Contracts that work with coin margin and contracts that work with dollar margin, which is mostly USDT although FTX for example also accepts other collateral. Sometimes these contracts trade at slightly different prices and you'll notice that there's also a shift in bullishness and importance between these contracts from time to time.
However most of the time the values will be very similar for coin margin and dollar margin.

Markets used for the coin margin perps:
  • Binance
  • Bybit
  • Deribit

Markets used for dollar margin perps:
  • Binance
  • Bybit
  • FTX

The combined premium combines them all.

The spot indices used are:

By default it uses "close" as candle source which means it looks at the premium as if the candle were to close right now.
If you're looking at higher timeframes I suggest using "ohlc4" because there's a lot that happens within one daily candle for example so you might want to use an average candle price (ohlc4 = open+high+low+close/4)

There's a "clamp" feature which puts a cap on extreme values.
Sometimes during capitulation events there's a massive spot premium which dwarfs all the other values and that makes the indicator unreadable.


In such cases the clamp helps to make the indicator useful again.
As you can see I created support and resistance zones (which you can turn off) that max out at 0.4% for bitcoin because by looking at historical data it seems that the premium almost never moves outside of those thresholds (except for those few exceptions during liquidation cascades).


There's also an option to smooth out the values.



TRADING

As discussed earlier, a spot premium is generally speaking considered bullish and a derivatives premium is considered bearish .
It doesn't give buy an sell signals, but it helps you with establishing a bias and gauging general market sentiment.
This in turn can help you with deciding what side of the trade to take and it shows if the conditions are still favourable for you to take the trade you want, because a spot premium for example usually leads to negative funding which makes it interesting to go long.


Send me a private message if you want access so we can discuss it.
Cheers.
Invite-only script

Access to this script is restricted to users authorized by the author and usually requires payment. You can add it to your favorites, but you will only be able to use it after requesting permission and obtaining it from its author. Contact ByzantiumScripts for more information, or follow the author's instructions below.

TradingView does not suggest paying for a script and using it until you 100% trust its author and understand how the script works. In many cases you can find a good open-source alternative for free in our Public Library.

Author's instructions

Send me a private message for access so we can discuss it.

Want to use this script on a chart?

Warning: please read before requesting access.

Send me a private message for access to my invite only indicators.

More info here: https://byzantium.store/

Comments