Introducing the Perpetual Protocol V2, Set Protocol Integration on Optimism

Andrew Wilkinson
Set Labs
Published in
5 min readFeb 7, 2022

--

We are excited to release our Perpetual Protocol V2 integration on Set Protocol! This follows our recent Optimism deployment and plans to enable innovative structured products on Layer 2 ecosystems.

In this article we will guide your understanding in:

  • Knowing what Perpetual Protocol is
  • Why we integrated with Perpetual Protocol and what it enables
  • How you can take advantage of the integration today
  • The first Perp-based featured product, live on TokenSets, showing casing a great use-case.

What is Perpetual Protocol

Perpetual Protocol is a decentralized exchange, live on Optimism, for decentralised perpetual contracts. Using perpetual contracts, users can open leveraged long or short trading positions for a variety of assets using USDC as collateral. By using optimism, trade execution is exceptionally fast and transaction fees are small finally making these DEXs viable alternatives.

Why we integrated with Perpetual Protocol and what it enables

Trading through perpetual contracts is undoubtedly one of the highest volume instruments used today to seek asymmetric returns on your investment through the delicate use of leverage and risk management. Layer 2 based decentralised exchanges that offer these products, including PERP, have been booming with activity as they alleviate one of the biggest pain points that traditionally affected on-chain leverage trading, trading fees, execution speeds and an effective liquidation engine to ensure protocol health.

Perpetual Protocol, since deploying on Optimism has seen an impressive uptick in utilisation, becoming the most used protocol on the network.

Today, with this new integration, asset managers can create Perpetual-based Sets to represent specific discretionary or strict methodologies and distribute them as fully composable, ERC-20 tokens. This means they can be, for example, traded, lent, borrowed, bridged and integrated any permitting DeFi protocol, unlocking a new frontier for Perpetual Protocol. One novel utility of this is that Perpetual-based Sets enable perpetual strategies to be executed on Optimism but distributed and held on all networks.

Finally, in line with our normal Set architecture, these perpetual-based Sets can include a streaming fee, creating a decentralised and lucrative revenue stream for the manager as TVL increases.

A dive into the integration

The integration is powered by a series of Set Protocol contracts that hold open positions with the Perpetual Protocol contracts and facilitate levering, delevering, issuing, and redemption. The PerpV2LeverageModule allows a SetToken to manage a Perp account as a positive external position that has a value equal to the net Perp account denominated in USDC. The external position unit uses lazy loading and is only updated during Perp account changes, such as trades/issuances/redemptions.

The SlippageIssuanceModule requires a transaction in order to replicate the Set. To ensure safety (preventing sandwich attacks) for users, we permit defining slippage thresholds to enforce USDC in/out expectations.

Other contracts released with this launch support the curation of new product strategies, exposing interfaces for keeper bots to rebalance Perpetual-based Sets based on methodology, and the aggregation of Perp account info for the Tokensets app to display.

More information on our individual modules can be found in our docs: docs.tokensets.com/developers/contracts/protocol/modules

How to create your first Perpetual-based Set

Right now, creating Perpetual-based Sets is available to asset managers and developers who are comfortable developing on Set Protocol infrastructure or experienced in Solidity based integrations. Eventually, we want to enable creating these new Sets natively through TokenSets, opening up the integration to everyone.

To get started, dive into our documentation below where you will gain an understanding of the architecture of Set strategies and importantly, how to create, configure, and maintain and perpetual-based Set.

Developer Resources

📕 Pre-requisite: Strategies Overview

📗 Creating a Perpetual Leverage Token

📘 Configuring a Perpetual Leverage Token

📙 Rebalancing a Perpetual Leverage Token

📦 Set.js Library

Any questions? Let us give you the best chance of success in what you are trying to achieve by joining our Discord community and reaching out.

The SOLUNAVAX Index

A first in the Set Protocol ecosystem for creating a cross-chain strategy and utilising the new, innovative Perpetual Protocol V2 integration.

To showcase our new integration, Set ecosystem partners Galleon DAO & Beverage Finance have collaborated together to create the first perpetual-based featured Set on Optimism around the widely popular thematic investment involving Solana (SOL), Terra (LUNA) & Avalanche (AVAX). We are excited to showcase this product as both a great product for the Optimism ecosystem and also a case study to energise the imagination of Asset Managers to what could be built.

Where is the SOLUNAVAX Index available?

You can buy the SOLUNAVAX Index on Optimism through:

You can learn more about the SOLUNAVAX Index by Galleon DAO & Beverage Finance and its specific methodology below.

For more information on Set Protocol, visit:

Twitter | Website | Discord

--

--

Andrew Wilkinson
Set Labs

Founder, software engineer, investor & evangelist.