An introduction to cPerps

Mitch | Contango
Contango
Published in
7 min readOct 2, 2023
An introduction to cPerps

Contango builds leverage positions through looping: they can be traded like regular perps, but with cheaper and less volatile rates.

cPerps takeaways

  1. cPerps (Contango Perps 🕺) are built through automated looping, aka recursive lending, via flash loans.
  2. Contango does not have LPs: cPerps are leveraging the +$20B liquidity of spot and variable money markets.
  3. The funding rate of ETH/USD, aka APY on Contango, is 2–3x cheaper and less volatile than dYdX.
  4. Unlike most perp AMMs, traders’ profits are not offset by LPs’ losses. Contango never takes the other side of cPerps trades.
  5. Contango builds across multiple chains, on top of DeFi giants, like Aave, Compound, Morpho, Spark.

cPerps are already live on Arbitrum with an Aave integration: https://app.contango.xyz/

Contango plans to integrate more money markets across different chains.

Mechanism

Forget everything you know about order books or AMMs for trading futures instruments.

Contango builds perps using spot and money markets.

The mechanism is simple: the protocol borrows whatever quote currency is needed to achieve the desired leverage, swaps it for the base currency and lends the base currency.

High level explanation of the steps carried out by Contango to open a long ETH/DAI
High level explanation of the steps carried out by Contango to open a long ETH/DAI

Contango pioneered this mechanism to build expirable instruments in 2021, using fixed-rate markets.

This is a high level overview: obviously in DeFi you cannot borrow to achieve leverage without lending first.

Looping manually

Contango achieves leverage by automating what is called looping or recursive lending. If that sounds familiar, that’s because you’ve probably done it yourself manually as described in the diagram below.

Steps carried out to open a manual looping strategy to long ETH/DAI
Steps carried out to open a manual looping strategy to long ETH/DAI

In a nutshell, looping involves lending or depositing some capital (e.g. ETH into a MakerDAO vault or on Aave), borrowing another currency (e.g. DAI) against it, swapping the borrowed amount for the original asset (ETH), and repeating the steps through several loops to gain more exposure to the initial asset. Another reason to loop is to farm rewards on the underlying lending protocol; this became popular with the liquidity mining craze of $COMP in 2020.

Nowadays pretty much everyone is levering up on Aave, Morpho, Spark. For instance, Morpho claims 64% of their volumes comes from users performing looping strategies (source).

Money markets and CDP protocols normally require you to be overcollateralized, meaning that you can only borrow less than the value of what you deposit. For instance, ETH on Aave has a maximum loan-to-value (LTV) ratio of 82.5% meaning that you can only borrow 82.5% of the $ value of the ETH you’ve deposited.

That’s why, after 12–15 loops normally you get diminishing returns on the effort you’re putting into looping: the exposure you get to the asset you’re lending increases by smaller and smaller amounts.

Indeed, manual looping is pretty expensive, especially on L1. That’s why automated strategies were developed through flash loans.

Looping through flash loans

As on Instadapp or Defisaver, a flash loan can be used to build a levered position. Leverage can be achieved instantly in one atomic transaction, as long as any borrowed amount is repaid within the same block (to learn more about looping see this article).

Let’s see how Contango builds a long ETH/DAI position when a traders post DAI as margin:

  1. Given the trader’s margin, some DAI are borrowed through a flash loan, up to whatever is allowed by the LTV ratio of ETH (see point 4).
  2. This loan, together with the trader’s margin, is swapped to ETH.
  3. ETH is lent on the money market.
  4. DAI is borrowed against ETH within the LTV limits.
  5. DAI is used to reimburse the initial flash loan.

The diagram below recaps these steps and provides a numerical example when a trader longs 1 ETH with 200 DAI as margin, and spot ETH = 1000 DAI.

Steps realized by Contango to open a long ETHDAI with DAI as margin
Steps realized by Contango to open a long ETHDAI with DAI as margin

Note that on Contango, differently from Instadapp and Defi Saver, traders can post both the base and the quote asset as margin. If the base is posted as margin, this doesn’t need to be swapped and the base is lent directly together with the remaining swapped base amount (point 3, above).

Another difference with Instadapp and Defi Saver is that multiple positions on the same pair and direction can be opened at the same time.

LTV and leverage

Leverage is determined by the loan-to-value ratio (meaning: how much you can borrow against your collateral) on the underlying money market.

Leverage is = 1/(1 — LTV ratio). If we take Aave’s parameters as a reference, we can see the amount of leverage that its standard LTV ratios can offer:

  • 82.5% LTV is equivalent to 5.7x leverage (e.g. for ETH/DAI or ETH/USDC pairs)
  • 90% LTV is equivalent to 10x leverage (e.g. for same-flavor pairs like stETH/ETH)
  • 93% LTV is equivalent to 14.3x leverage (e.g. for stable pairs, like USDC/DAI or EUR/USDC)

Just like with money markets where there is a distinction between max LTV ratios and liquidation thresholds, on Contango there’s a max leverage to open a position and a higher leverage threshold at which traders get liquidated.

Funding rates vs Contango APY

Conventions on perp exchanges indicate with funding rate the variable interest rate on the underlying debt. Funding rates are charged periodically, e.g. every 1 or 8 hours.

The variable funding rate of cPerps is determined by the difference between the cashflow on the lending and borrowing legs of a position, which you normally see referenced as borrow APY and supply APY on the money market. That’s why it’s also called APY on the Contango UI. It can be positive or negative:

  • if it’s positive, it means the trader is receiving money to keep his position opened.
  • if it’s negative, it means the trader is paying money to keep his position opened.

In other words, Contango’s APY is equivalent to a funding rate, but its sign is inverted compared to funding rates on other perp venues.

The APY on Contango is accrued as PnL and settled when closing the position. Note that the APY varies with leverage, e.g. it can be positive at 2x, and negative at 4x. This is due to the fact that more money is borrowed with a higher leverage, resulting in a higher borrowing cost while the lending profits remain the same.

Also note that because of this architecture, the APY is less volatile than other perp trading venues. Early research we carried out shows that cPerps built on Aave are 3x less volatile than Binance and 20x less than dYdX

Internal study on the volatility of funding rates on ETH/USD
Internal study on the volatility of funding rates on ETH/USD

Protocol fees

̶C̶o̶n̶t̶a̶n̶g̶o̶ ̶c̶h̶a̶r̶g̶e̶s̶ ̶0̶.̶1̶%̶ ̶o̶f̶ ̶t̶h̶e̶ ̶p̶o̶s̶i̶t̶i̶o̶n̶ ̶s̶i̶z̶e̶,̶ ̶e̶v̶e̶r̶y̶ ̶t̶i̶m̶e̶ ̶a̶ ̶p̶o̶s̶i̶t̶i̶o̶n̶ ̶i̶s̶ ̶o̶p̶e̶n̶e̶d̶,̶ ̶m̶o̶d̶i̶f̶i̶e̶d̶ ̶o̶r̶ ̶c̶l̶o̶s̶e̶d̶.̶ ̶F̶e̶e̶s̶ ̶a̶r̶e̶ ̶c̶o̶l̶l̶e̶c̶t̶e̶d̶ ̶i̶n̶ ̶t̶h̶e̶ ̶b̶a̶s̶e̶ ̶c̶u̶r̶r̶e̶n̶c̶y̶ ̶f̶o̶r̶ ̶l̶o̶n̶g̶s̶ ̶a̶n̶d̶ ̶i̶n̶ ̶t̶h̶e̶ ̶q̶u̶o̶t̶e̶ ̶c̶u̶r̶r̶e̶n̶c̶y̶ ̶f̶o̶r̶ ̶s̶h̶o̶r̶t̶s̶,̶ ̶a̶n̶d̶ ̶a̶c̶c̶r̶u̶e̶ ̶t̶o̶ ̶t̶h̶e̶ ̶C̶o̶n̶t̶a̶n̶g̶o̶ ̶t̶r̶e̶a̶s̶u̶r̶y̶.̶

Trading is free. No protocols fees are charged at the moment.

Adding automated orders like stop losses and take profits also incurs a 0̶.̶1̶% 0% fees, plus a reward to cover gas costs for keepers. This reward is now set to 2 times the gas cost, but can vary from 1 to 10 times.

The currency this rewards is charged with depends on the margin posted by the trader:

  • If the trader posts margin in the base, then it’s taken from the margin.
  • If the trader posts margin in the quote, then it’s taken from the margin by computing it via oracle prices.

See more details on the docs.

Who’s this for?

If you’re a trader, you’ll find yourself at home with cPerps, enjoying the deep liquidity of money markets as the underlying, and a professional trading interface on top.

If you’re a looper, you can easily open, modify, monitor and close your leveraged position, all through a professional trading interface. Automation is guaranteed via take profits, stop losses and limit orders.

If you’re a farmer, by simply trading on Contango, you can easily earn the same rewards that are offered by the underlying money markets.

Risks

When using cPerps, traders should bear in mind the following risks:

  • Multiple smart contract risk, i.e. Contango’s, plus any underlying markets (such as Aave). Contango cPerps contract have been fully audited by ABDK.
  • Market risk, i.e. sudden movements in price that can result in potential liquidations.
  • Interest rate risk, i.e. sudden movements in the rates that affect your funding and can result in potential liquidations.

About Contango

Contango lets you loop anything on-chain. You can create leverage (re)staking positions, arb rates differentials, farm points, or simply go long or short like a perp at low funding. Ape in like a degen with 1-click Strategies, or trade like a pro on the sleek Trade interface.

Website | Twitter | Discord | Docs | Blog

--

--