🎯 On-chain & 💞 Open-source Perpetual Options in Harmony
Our goal is to make useful products and earn sustainable fees for Harmony’s DeFi ecosystem. Currently, onchain derivatives – such as options, futures, leverages – are the best market fit for a fast blockchain. They require very minimal dependencies: simply a token exchange such as Uniswap V3, and around $1M liquidity of even a single pair like ONE-USDT.
In our first launch, we will deploy a fully open source and fully onchain project similar to Arbitrium’s GMX or Optimism’s Panoptic. We avoid the complexity of off-chain matching of orderbooks such as dYdX or Vertex. Since Panoptic relies only on Uniswap V3’s pools for liquidity and pricing, we avoid the fragmentation of assets and the attacks of oracles. Ideally, to stay robust among all market conditions and to avoid any governance attacks, the smart contracts should require no configurable parameters to deploy or even become immutable against upgrades.
Then, with the simplicity of Uniswap’s pools and Robinhood’s fees, we can scale the product for the mass. Our user interface will skip the price charts or the order feeds. Instead, visualize how buying an option contract or a future contract will perform against different price points and time scales. Show the potential profit and loss given the maximum leverage!
Request for Crypto Fit
We are working on a market research titled “Open Source and Onchain Derivatives”, listing all derivatives projects that their code are shared and that their executions are smart contracts.
For derivatives, we focus on perpetual futures, leveraged collaterals, and expirationless options.
For code, we list their research papers, smart contracts, license expiration, forked projects, audit reports, protocol dependencies, configuration parameters, upgradable modules, administrative rights, frontend assets, deploy scripts, testnet dates, mainnet dates, security incidents, validator stakes, stats dashboards, and monitor tools.
For executions, we check for wallet custody, asset bridges, price oracles, order books, matching engines, transaction settlements, and liquidation bots.
Later, we will study the protocol risks of bad debts, the code quality of contract implementation, and some organic growth with minimal token incentives. Let’s also find ways to apply my expertise of formal verification, dependent types, and template specialization! See Runtime Verification’s verified contracts such as Ethereum staking deposit, Uniswap market making, or Gnosis Safe multisig.
Here are the most useful analysis “Options Series” and “Future Series” by Pablo Bartol (of 0xPBL) at Three Sigma:
An Overview of the DeFi Options Landscape (2023 Mar 22)
”Panoptic has a more linear payoff structure with delta limited between 0 and 1 and no vega risk [as the options price is not impacted by the volatility but by the number of trades done by the liquidity]. Options can be sold ITM/OTM/ATM, and long option premiums are equal to fees collected each time the asset price crosses the strike price.”Exploring Different Pricing Approaches and Tokenomics
”The [Implied Volatility] (IV) of Panoptic options, which is determined by the fees collected, volume, and liquidity, may not reflect the underlying asset’s market conditions, creating IV-based arbitrage opportunities… Since the prices are determined by fees earned on Uniswap pools, LPs may be incentivized to provide liquidity on Panoptic and Gammaswap, solving the liquidity issue.“Navigating Through Options Collateralization (2023 Apr 5)
”AMMs typically hedge their positions through delta hedging, which involves holding additional assets, option contracts, or using perpetual futures to offset their exposure. Additionally, volatility impacts an option's price (called gamma), which can be hedged by holding additional options contracts that offset each other... Lyra hedging through Synthetix shows that delta hedging can be inefficient, as it requires a high collateral ratio (at least 350%).”Economic Incentives for LPs (2023 Aug 3)
”When assessing trading volume, drawing definitive conclusions becomes challenging due to the influence of incentives that tend to distort the overall picture. Traders may strategically engage in long positions on one platform and simultaneously initiate short positions on another platform - between centralized and decentralized exchanges - targeting the same strike and maturity. In such cases, the profitability of the trade itself may be nonexistent, but the attractiveness lies in the token incentives, which add a layer of complexity to evaluating trading volume dynamics.”Exploring the DeFi Perpetual Futures Landscape (2023 Jul 26)
Displacement of Increasing Purchasing Power. Aave and Compound gained popularity during the previous bull run as a means to leverage assets for increased exposure. However, the current onchain market dynamics have introduced an abundance of onchain perpetual protocols, a trend not widespread during the last bull market. Perpetual protocols, despite higher trading costs, offer users significantly more leverage in competition with lending protocols. As perpetual protocols expand the breadth of assets they cover, there is a diminishing incentive for users to borrow using lending protocols. While there may be an opportunity to capture demand for altcoins not listed on perpetual exchanges, we anticipate that most of this volume will be seized by perpetual protocols integrated with Uniswap Hooks. To remain competitive, lending protocols must substantially increase their available LTV.
Infeasibility of Shorting. Lending protocols face difficulties entering the shorting market because they are limited to shorting assets that can be borrowed. The slow addition of new markets by lending protocols, focusing on the most liquid assets, makes it infeasible for them to capture a significant portion of this market. Establishing a shorting market would necessitate the rapid inclusion of new assets available for borrowing to address short demand not satisfied by perpetual trading protocols.
This causes undercollateralized lending protocols to primarily focus on trading major assets, putting them in an unfavorable competition with onchain perpetual protocols for leveraged trading.
Messari’s A Lending Renaissance
Perpetual & Expirationless Contracts
From Panoptic, Expirationless Options (XPOs) – Will They Replace Perps In Crypto? and The Case Against Perpetual Futures write “A long perp position is replicated by purchasing a call XPO and selling a put XPO at the same strike price. This two-legged perpetual option position has a delta of one and gamma of zero, just like a long perp.”
Futures: Linear payoff, Static delta (∆ = ±1), No gamma (Γ = 0).
Options: Non-linear payoff, Dynamic delta (-1 ≤ ∆ ≤ 1), Dynamic gamma (-1 ≤ Γ ≤ 1).
Panoptic's competitive audit with Code4rena concluded on April 22, and we extend our gratitude to the Wardens for their efforts in enhancing protocol security, sharing in a prize pool of $120,000. Meanwhile, we are undergoing a further audit with Trail of Bits in preparation for Panoptic’s mainnet launch.
No One-Wick Liquidation Risk. “A large price movement in the underlying asset price generally will not liquidate a long Expirationless Options (XPO) position in Panoptic. Traders can purchase put or call XPOs to take a bullish or bearish stance, but unlike perps, XPOs remain protected from one-off price wick liquidations. This is because long XPOs accumulate losses gradually as the underlying AMM pool volatility is realized over time. Unlike perps, long XPOs are not significantly affected by sudden price swings.”
Ease of use: The prices of perpetual futures follow the spot price of the underlying asset — as simple as that. The pricing of options can be quite complicated though. This is because countless variables such as delta, gamma and theta come into play, as well as the Black-Scholes-Merton (BSM) model. This might be a bit overwhelming at first, making perpetual futures more beginner-friendly.
Risk: Options limit your risk on one side — depending on whether or not you are the seller or buyer. Regardless, you’ll always be exposed to one side of the trade. Perpetual futures are also risky. For example, they are able to wipe out your entire collateral. Refer to our Perpetual Futures / Perpetual Swap Contracts guide for more on the topic of “liquidation''. Compared to options though, perpetual futures don’t cap your profit, meaning your long and short profits can grow indefinitely.
Flexibility: When you’re trading options, you have until the expiry date to choose whether you’d want to exercise your buy/sell right or not. The expiry date of options can be a downside. The closer options are to their expiry date, the lower their value becomes. And when the expiry sets in, options become completely worthless. This is not the case with perpetual futures. You can hold your perp positions as long as you want to, including all your profits and losses, as long as you have the collateral to back them up.
Drift’s Perpetual Futures vs. Options
Lyra Protocol writes “Options are a versatile instrument, but they can also become complicated. It is important to understand all elements of options risk (the greeks) while managing macro market risk, which affects the price of the asset. When trading options in either direction, it is also important to factor in how volatile a market is and when this volatility will occur.”
Options Innovation: One area of innovation we are excited about is options protocols integrating perpetuals platforms in order to delta hedge and improve capital efficiency. This was previously impossible on Ethereum layer 1, so faster chains and layer 2s open up the design space to innovate and compete with centralized option exchanges like Deribit. Secondly, a broader range of structured products touching both the real world and DeFi native assets. Given the accessibility of DeFi options there is the opportunity and potential liquidity for hundreds of smaller more niche strategies opening up billions in TVL to these protocols. – Messari’s 2022 Crypto Year Ahead
(Bio) Professor as Founder
Guillaume Lambert (a biophysics professor at Cornell) pins on the Ideals of DeFi protocols as follow. (I am adding: “economics: radical & sustainable”!)
chains: all of ‘em
pricing: oracle-free
governance: minimized
protocol token: utilitarian
code: immutable & unupgradable
market making: automated
markets: permissionless
positions: semifungible
capital efficiency > 1
intents: onchain
Lambert’s early posts cover the motivation and the founding story of Panoptic:
Uniswap V3 LP Tokens as Perpetual Put and Call Options (2021 Jun 23)
”Range Orders and Single-tick Liquidity: … a mind-blowing 4000-fold theoretical improvement in capital efficiency. Even if we only consider the 0.3% collected per visit, this translates into a 150% annual [Return On Investment] ROI.”Synthetic Options and Short Calls in Uniswap V3 (2021 Jul 5)
”two delta-neutral trades using Uniswap v3 Options which should help minimize the directional bias… the Put-Call Parity Equation: (C-P )= (S-K): the combined value of the short put and the long call will track the difference between the spot price and the strike price.”Understanding the Value of Uniswap v3 Liquidity Positions (2021 Jul 14)
”Impermanent loss doesn’t worry me at all because I understand that this “missed opportunity” is a feature of covered call positions… LP positions actually decreases the volatility of portfolio returns.”A Guide for Choosing Optimal Uniswap V3 LP Positions, Part 1 (2021 Aug 4)
”a very narrowly defined LP position may “evade” impermanent loss if it is removed after less than a day. On the other hand, holding a very wide LP position for a short amount of time may dilute the liquidity too much and collect a very small amount of fees.”How to Create Perpetual Options in Uniswap v3 (2021 Aug 24)
”Option writers can deploy short options positions between any two assets, for any ‘effective’ expiration time, at any delta, and without the need to deploy an intermediary protocol.”A Guide for Choosing Optimal Uniswap V3 LP Positions, Part 2 (2021 Sep 15)
”LP returns for narrowly defined LP positions accumulate fees proportionally to the square root of the time the position is held. This means that a LP position will see diminishing returns over time, and it may be best to exit positions early than keep them on for an extended period of time.”Pricing Uniswap v3 LP Positions: Towards a New Options Paradigm? (2021 Nov)
”Being on the short side of options trading is an inherently profitable endeavor (since implied volatility is often higher than the realized volatility)”On-chain Volatility and Uniswap v3 (2021 Nov 21)
”the daily volumes and tick liquidity of any Uniswap v3 pool, and invert the condition derived in my previous to compute the implied volatility (IV) of a pool… a direct way of computing the IV of an asset.”Calculating the Expected Value of the Impermanent Loss in Uniswap (2021 Oct 1)
”the impermanent loss for Uniswap v3 is always worse than for Uniswap v2… since the amount of collected fees is proportional to the volatility of the assets, using strategies that lower the impermanent loss may decrease potential returns.”How to deploy delta-neutral liquidity in Uniswap — or why Euler Finance is a game changer for liquidity providers (2022 Jan 12)
”Providing liquidity without downside risk… shorting an asset can be used to control portfolio risk and, in the context of Uniswap LPing, it can be used to create delta-neutral or even bearish LP positions.”Gamma transforms: How to hedge squeeth using Uni V3 (2022 Feb 23)
”Power perpetuals S^n with any exponent n larger than zero could similarly be hedged by computing the second derivative of S^n. Delta is the slope of the payoff curve, and Gamma is the slope of the slope of the payoff curve.”Designing a constant volatility AMM (2022 Apr 4)
”Trading assets in a constant volatility AMM should feel like a delicate balancing act between slippage & fees... the fee taken on each trade depends on the reserve amount, the traded amount, and the time since the last transaction.”Panoptic Options Trading Strategies Series: Part I — The Basics (2023 Apr 15) by cofounder Jesper Kristensen
”Panoptic LPs, buyers, and sellers join the system, we put liquidity back into Uniswap, increasing their volume and pool depths to improve their swapping ecosystem: Panoptic is designed to be a win-win.”[Project Whitepaper] Panoptic: the perpetual, oracle-free options protocol (2022 Apr 27 – 2023 Jun 19)
”i) Panoptic options (Panoptions) instrument based on Uni v3 LP positions; ii) an options premium model that accurately reflects the risk/reward of an option; iii) the Panoptic ecosystem and strategies for minting options; iv) how the protocol help its users mitigate risks; v) Panoptic’s key design principles, applications and network effects.”
Lambert also produces great visual charts. Here are all of his videos on Panoptic:
DeFi Derivatives Summit | Opening Remarks | Guillaume Lambert - Panoptic (2024 Apr 8)
Quantum Trades: Panoptic's Fusion of Physics and Finance with Guillaume Lambert (2024 Mar 26)
Your Protocol's Token Will Go to Zero. Here's How to Fix It | Guillaume Lambert - Panoptic (2024 Mar 1)
Ava Labs Systems Seminar: Oracle Free Options Trading with CEO of Panoptic Guillaume Lambert (2023 Nov 28)
How Panoptic is Taking DeFi Options To The Next Level w/ Guillaume Lambert - Flywheel #68 (2023 Sep 6)
LPs are Selling Free Options - Mindmeld Live feat. Panoptic (2023 Jun 28)
AD Derivs. Podcast (Ep. 39) - Guillaume Lambert, Co-founder @Panoptic (2023 May 23)
Introducing Panoptic: DeFi Options Trading Platform – First Look (2023 May 12)
[KB7 DeFi Guild] Market Structure & Design with Guillaume Lambert (2022 Oct 1)
Panoptic: the perpetual, oracle-free options protocol - Defi Toronto (2022 Aug 25)
Riding the Unicorn Uniswap v3 as a Perpetual Option Primitive Guillaume Lambert (2022 Feb 16)
Usury, aka predatory lending, is charging an excessive rate of interest on a loan. Historically, usury was defined as charging any interest on a loan and was condemned by major religions & prominent philosophers (Moses, Buddha, Muhammad, Aristotle...). In 1867, Russell Sage was convicted of violating New York usury laws for charging an 8% annual interest rate on a late loan to a stockbroker. – Panoptic’s The 'Father of Options': How Illicit Moneylending via Put-Call Parity Made a Millionaire
Robinhood vs dYdX on Design
Robinhood brings derivatives to retail investors with its TikTok campagins, YouTube videos, and many tutorials including what is a derivative, what are futures, placing an options trade, what’s a swap, and investing with margin.
Could on-chain crypto options work if they could provide a Robinhood-like experience with efficient pricing
Every 6 hours, the Lyra pool hedger calculates total delta exposure and hedges via Synthetix.
the performance of the Ribbon ETH covered call vault. After consistently delivering 30-40 bps of weekly yield for nearly a year, vault depositors were caught out by ETH’s recent price surge, wiping out most of the vault’s earnings to date.
Lyra’s UI is remarkably similar to Robinhood; allowing users to see Greeks, the spread, implied volatility, payoff scenarios
– Delphi Digital’s Lyra: A Next Generation Options AMM
Today, exchanges have high margin requirements, and firms cannot cross-margin, i.e., use margin posted at one broker or venue to collateralize a position elsewhere. This forces firms to fully fund nearly all their trading activity and subjects trade settlement to many block confirmations (at-minimum). Full funding is especially taxing in highly volatile environments when on-chain congestion is most significant.
As a result of these inefficiencies, the perpetual swap has become the dominant source of short-dated funding. Crypto perps: “Came for incremental capital efficiency, stayed for the 20x leverage.” Dependence on the perp market as the backbone of market funding is very sub-optimal: cascading liquidations in March 2020 resulted in over $1.6B notional liquidations on BitMEX alone, much of which should be preventable in a more capital-efficient market.
Deri lets traders take both long and short position on the everlasting options. The AMM changes the option pricing based on its net position. When it is in the equilibrium state, the option mark price equals the theoretical price. Whenever there is a trade, it pushes the mark price toward the trading direction (i.e. a buying trade pushes the price up while a selling pushes it down). The price change due to the trade is proportional to the trade size. Additionally, LPs on Deri are also counterparties to perps, power-perps, and gamma swap. – Paradigm’s Arjun Balaji on Crypto Market Structure 3.0
Panoptic’s Progress & Summit
Panoptic has hosted DeFi Derivatives Summit at ETH Denver 2024, and now running Beta Launch: Epoch 6 with Panoptic Incentive Points (Pips) Program.
Read their detailed walk-through (with the key file PanopticPool.sol), partnership with Three Sigma (who also researched on Tradable Perp DEX for its audit report), and finally their Agent-Based Simulation Framework, Neferpitou (“to simulate diverse market conditions and various agent behaviors”).
/// @The window to calculate the TWAP used for solvency checks
/// Currently calculated by dividing this value into 20 periods, averaging them together, then taking the median.
/// May be configurable on a pool-by-pool basis in the future, but hardcoded for now
uint32 internal constant TWAP_WINDOW = 600;
/// @notice Compute the TWAP price from the last 600s = 10mins.
/// @return twapTick The TWAP price in ticks.
function getUniV3TWAP() internal view returns (int24 twapTick) {
Panoptic's options differ from traditional options in that they do not have an expiry date and are priced based on the fees they would have collected if left in the Uniswap V3 liquidity pool, rather than paying a premium upfront. The option will accrue a small amount of premium each time the asset price moves within the option position's range. This range is determined by a strike price (k) and a range factor (r), with the option position's range spanning from k/r to k*r. The premium increases at each block as long as the asset's price is inside of the range of the option.
The pricing of Panoptic options depends on three key factors: the time the position is held, the trading volume of the specific pool, and the liquidity distribution inside the Uniswap pool. However, the trading volume and the liquidity distribution can lead to volatility mispricing. When liquidity is high and trading volume is low, the effective implied volatility will be undervalued, whereas when the volume is high and liquidity is low, [implied volatility] IV will be overvalued. Hence, sellers will be incentivized to sell options (i.e. deposit more liquidity into Uniswap) when IV is high and buyers will benefit from buying options (i.e. removing liquidity from Uniswap) when IV is low.
Selling back positions to the AMM exposes traders to asset price fluctuations, volatility, and time decay. Additionally, options are non-linear products, making hedging difficult for LPs.
Furthermore, DeFi options require collateralization, reducing capital efficiency. Undercollateralized options require dependencies on liquidation mechanisms, liquidators, and oracles. Another challenge is the high cost of on-chain pricing that forces most protocols to rely on off-chain systems.
– Three Sigma’s Exploring Different Pricing Approaches and Tokenomics on Panoptic
Panoptic 101: An Introduction to the DeFi Options Protocol writes “The mechanisms deployed by Panoptic naturally solve many of the issues that other DeFi option facilitators have struggled with. Pricing options correctly and efficiently has been challenging for many on-chain [Central Limit Order Book] CLOBs and option AMMs, while [DeFi option vaults] DOVs suffer from misaligned incentives between off-chain market makers and vault depositors.”
Binance Research’s Navigating DeFi Derivatives writes that “under the streamia mechanism, perpetual options pricing is path-dependent and relies on the spot price of the underlying asset. By simulating over many spot price paths, they find that the price of a perpetual option converges to the Black-Scholes price of its vanilla option counterpart. This eliminates the need for manipulable external oracles, professional market makers, order books, and computationally expensive Black-Scholes pricing.”
Vertex, Mux, Hyperliquid
Deep dive into all Delphi Digital’s 150+ research reports on derivatives. Follow 0xperp’s “DeFi Derivatives” follower list.
Aaron Li at Harmony reviews on Vertex: “Primarily method: off-chain sequencer (10-30ms latency): 1. clients submits (limit and market); 2. sequencer records open orders on its internal (offchain, distributed) orderbook and match if possible; and, 3. sequencer submits matched order to smart contract for finalization.”
Vertex Protocol handled nearly 75% of all Arbitrum perp DEX volume last week and even surpassed dYdX’s daily volumes yesterday with $1.5 billion traded, the largest out of any protocol. While impressive, its sustainability is still questionable as its total open interest sits at $14 million (for reference, dYdX’s total OI is $313 million), signaling that most trades target rewards by wash trading.
Vertex is on its second week of Arbitrum STIP grant, with 3 million ARB available. Any trade on Vertex that pays a taker fee will earn ARB incentives up to a 75% maximum of the total taker fee paid, in addition to the existing VRTX rewards also disbursed to traders. Additionally, depositors can earn ARB incentives on top of existing VRTX rewards for Elixir Fusion pools – allowing users to LP order book pairs on Vertex.
Mux and Vertex, while still maintaining relatively healthy retention rates of 58.94% and 71.36% respectively, show that a larger portion of their user base is not returning. This lower retention could be due to various factors, but considering the lack of open interest, and only 275 daily active addresses, Vertex’s volumes indicate users employ mercenarial tactics, moving from chain to chain to collect rewards. Interestingly, 18% of Arbitrum perp DEX users engage with Mux first, and 17% with Vertex, indicating that these platforms are less significant entry points into the Arbitrum ecosystem. Perp DEXs, especially amidst incentives programs, see inflated volume, and market this to attract new users and sticky volume. However, outside of dYdX and GMX [its technical overview], they have proven unsustainable.
– Delphi Digital on Vertex's Upcoming Token Liquidity Bootstrapping Auction (LBA)
In between order books and AMMs, there are two protocols—Drift and Vertex—that implement a hybrid approach to liquidity provisioning and pricing. By combining the models, they aim to bring the best of both worlds, allowing users to have granular control over their trades while using the AMM as a backup to ensure continuous liquidity.
Vertex uses a price/time priority algorithm, so orders will be executed based on the best price regardless of whether it's the AMM or a market maker making the price. The AMM essentially quotes bids and asks as it places discrete price levels to approximate xy=k on the order book.
Vertex will use either the order book or the AMM to quote the users. At the moment, market makers quote tighter levels for the most part, but it's conceivable that the AMM quotes tighter markets if it scales significantly.
– Three Sigma’s Exploring the DeFi Perpetual Futures Landscape on Vertex
Synthetix is developing an ecosystem around Base Protocol & its Andromeda:
“As a result, Synthetify never had more than a couple synthetic assets in its debt pool, and never attracted enough liquidity to make those tokens tradable for regular users. While many viewed Synthetify’s struggles as a case of poor execution of a sound concept, astute observers recognized it as a more telling sign. It served as clear evidence that the debt pool model was fundamentally unscalable, foreshadowing similar challenges that would eventually hinder the growth of its progenitor, Synthetix.”
”Oracle Based. Synthetic Liquidity. Avantis, Gains Network, Deri, Synthetix (Kwenta, Polynomial), Tigris Trade, and Vela. The liquidity of the vaults can be provided with: Volatile asset. For example, Kwenta & others are built on top of Synthetix, where SNX stakers are the counterparty.”
Whereas, Infinity Pools is “reserving liquidity, equivalency to synthetic ITM call option, conversion between ITM / OTM option, exponential loan maturity”.