[LRFC] SNX Perps V2 hedging and Cash Collateralization on Optimism

|Author|GUNBOATs, Mastermojo83, Ksett|
|Status|Draft|

Simple Summary

Integrate Lyra with Synthetix Perps V2 and deploy a cash-collateralized version of the contracts on Optimism.

Abstract

Deploy a new version of the Lyra protocol to Optimism, using SNX V2 perpetual futures as the source of liquidity with which to delta hedge the AMM, and launch Newport markets on ETH, BTC, ARB & OP on Optimism. These contracts will support USDC as a quoteAsset, whilst using wETH, wBTC, and native tokens (e.g. UNI) as collateral against short call positions as well as routing the hedger to swap USDC to sUSD (or snxUSD in future versions).

Motivation

After the success of Lyra’s cash-collateralized Newport version on Arbitrum, this LEAP proposes to apply a similar mechanism and improve capital efficiency in Lyra’s Optimism deployment by removing the need for the AMM to lock one baseAsset (i.e. sETH) per call sold. To achieve this, the pool will instead hold a significant portion against the options in cash and all quoteAsset funds held by the pool will be available for delta hedging.

Notably, not being fully collateralized opens the pool to possible insolvency. To handle these black swan events, contract adjustments will be introduced which reduce long holder positions, allowing all long holders to get an equal share, and preventing the LP from being emptied fully.

This deployment will normalize the AMMs returns and lessen the protocol’s reliance on rebates and direct integration fees from Synthetix to provide competitive bid/ask spreads.

Specification

The Lyra protocol’s Optimism contracts will need to be modified to handle quoteAsset and baseAsset ERC20 tokens.

The SynthetixAdapter will be replaced by a SynthetixPerpAdapter contract. The SynthetixPerpAdapter will be responsible for handling swapping covered call collateral (baseAsset) collected at settlement and during liquidations into quoteAsset on Uniswap.

Incentives:

this LEAP redistributes the 90K OP that were allocated to Lyra’s Avalon Vaults for rewards epochs 3-6 to the newly launched Newport pools as follows:
ETH BTC ARB OP
Epoch 3: 13K 2K 2K 2k
Epoch 4: 13K 2K 2K 2K
Epoch 5: 13K 2K 2K 2K
Epoch 6: 13K 2K 2K 2K

Delta Hedging

The ShortPoolHedger will be replaced by a SNXFuturesPoolHedger contract. This will be responsible for opening and managing perpetual future positions against the SNX pool to delta-hedge the liquidity pool.

The hedger will be responsible for swapping USDC into sUSD prior to hedging the MMV with SNX Perps and trading sUSD that is not being used to hedge back into USDC. The hedger should also check the premium/discount function on SNX Perps prior to allowing trades, hedging, or liquidating after settlement, blocking short delta trades if the premium is too high and blocking long delta trades if the discount is too high. Trades and hedges should both be blocked if the premium/discount is over a certain % until the market has had a chance to normalize. Within the SNXFuturesPoolHedger target leverage can be specified, allowing for greater capital efficiency of the Liquidity Pool funds being used to hedge.

Liquidity Pool Changes

There will be an additional canHedge check added to the LiquidityPool contract, which will block the opening of trades when the hedging module (SNXFuturesPoolHedger) deems the position to increase risk beyond an acceptable threshold (i.e. the delta exposure increases beyond the available hedging liquidity on SNX).

Rationale

By integrating with multiple perpetual futures platforms, the resiliency of the protocol to an individual shock to one of them increases. Optimism has a vibrant defi community and by deploying the most capital-efficient version of the protocol, we can provide the most competitive and liquid markets to our integrators within the Optimism ecosystem Further, the use of USDC as quote collateral (and wrapped ETH/BTC + native collateral for DeFi tokens), will increase the pool liquidity available to Lyra for use within the protocol. Using a Curve integration to swap to sUSD in order to hedge will decrease our reliance on spot synthetic assets and minimize any scaling issues around sUSD supply. Furthermore, the sUSD 3-curve pools has $41m TVL which should handle hedging with ease.

Synthetix Perps V2 will significantly reduce perps trading fees to only 5-10 basis points while maintaining optimal performance and execution efficiency. These reduced fees will open up endless opportunities and growth within the Lyra ecosystem.

New off-chain oracles provided by Pyth Network allow perps fees to be reduced to 5-10bps—on par with centralized perps platforms. These oracles, pioneered by SNX, greatly improve the trader experience & minimize the risk of frontrunning attacks. They work as follows: off-chain oracles save prices off-chain and are provided to traders by keepers when a trade is initiated, with an 8-sec delay due to block times. The on-chain validation process includes staleness checks, key-threshold confirmation, and a final check against on-chain oracles. This has improved from spot trading fees which ranged from 30-100bps, reducing cost by 6-10x.

The price impact function of SNX Perps V2 incentivizes arbitrage traders with a price discount given to traders who return markets to neutral. Funding rate changes allow funding rates to drift upwards in the presence of continued imbalance, incentivizing arbitrage traders to step in.

Both functions will introduce arbitrage opportunities for traders to keep markets neutral over the long term. This innovative path to risk management will help increase scalability and capital efficiency while supporting a wider range of markets.

Synthetix recently released 22 new perpetual futures for the total of 23 markets as in writing of this LEAP. It has markets including but not limited to OP, DOGE, Gold, and more to come over the coming weeks. This will allow greater flexibility for Lyra to add additional markets. 22 New Synthetix Perps Markets are now live

Test Cases

A similar mechanism is deployed on Arbitrum

https://leaps.lyra.finance/leaps/leap-38

Configurable Values

Parameter Description Value
deltaThreshold Bypass the interaction delay if the required hedge is greater than this 30
targetLeverage Target leverage ratio 1.5
leverageBuffer Leverage tolerance before allowing collateral updates 0.4
minCancelDelay Seconds until a pending order can be canceled 120
baseLimit The maximum amount of base asset a single AMM can hold. If the baseLimit is exceeded, Short Calls collateralized with base assets will be blocked

Copyright Waiver

Copyright and related rights waived via CC0.

3 Likes

This is great! Any sort of update which can help save LPs fees is great. Using USDC as the quote asset seems like a great idea for UX and accessibility too. If snxUSD becomes popular and more liquid, we can always deploy a new version in the future.

2 Likes

Thanks for this proposal - I’m a big fan of upgrading the OP deployment to Newport.

Can you please update the proposal to make sure it conforms with the template?

3 Likes

Thanks Mike. Will get to this soon!

1 Like

Hey there - thanks for making the updates. You should be able to edit the original post now (have updated the configuration).

On the formatting:

  1. Need a “Specification” section to wrap around the delta hedging + liquidity pool changes sections.
  2. Need a link to the code + test cases since this is a code-based change.
1 Like

I updated the Specification section up above. We are waiting on information for #2.

2 Likes

@MasterMojo

Just a few points need to be added to the leap. A new parameter has been added to OptionMarket that limits the base a single AMM can hold. If the base limit is passed, Short Calls that are collateralized by base will be blocked beyond that amount. This restriction is due to some illiquid markets on optimism, which could result in issues when liquidating collateral if a short call ends up ITM. This parameter is called ‘baseLimit’.

The Adapter has been modified to use Uniswap as a venue to sell the base asset that has been used as collateral for short calls. The Adapter will also use SNX pricing, which is derived from Chainlink and Pyth prices.

This information is provided as a light update, and it is not expected that many more changes will be made after this.

3 Likes