Delta Neutral on Defi
Table of Contents
- 1. Uniswap v2 LP Delta Neutral
- 2. GLP Delta Neutral
- 3. Funding Rate Delta Neutral
- 4. JLP Delta Neutral
1. Uniswap v2 LP Delta Neutral
1.1. Swap
"Swap" means exchanging one cryptocurrency (or token) for another. For example, if you have Ethereum (ETH) and want to convert it to a stablecoin like USDC, you would perform a "swap" on Uniswap. Uniswap is pimarily built for Ethereum tokens, it offers a straightforward interface to swap tokens, providing liquidity pools for each token pair.
1.2. Uniswap as a Decentralized Exchange (DEX)
1.2.1. Ethereum:
Ethereum itself is a decentralized blockchain. This means no single entity has control over it. Transactions are verified by a distributed network of nodes (computers) across the world. When you have 4 ETH in your wallet, it's recorded and stored on the Ethereum blockchain, which is public and immutable.
1.2.2. Wallets:
Your wallet (like MetaMask) doesn't store your ETH in the traditional sense. Instead, your wallet holds your private keys — secret information that grants you access to your funds. Only you, with your private key, can sign transactions (like sending ETH or interacting with Uniswap).
1.2.3. Uniswap Smart Contracts:
Uniswap doesn't store your ETH or control your funds directly. Instead, it operates using smart contracts on the Ethereum blockchain. These smart contracts are pieces of code that execute automatically when certain conditions are met (e.g., when you deposit ETH into a liquidity pool or swap tokens). The code behind Uniswap is open-source and publicly available, meaning anyone can inspect it. This transparency helps ensure there is no centralized control or hidden risks.
This means: When you interact with Uniswap, your funds never leave your wallet. Instead, you're interacting with a smart contract on Ethereum that holds your tokens temporarily. Uniswap's smart contract doesn't have access to your wallet or your private keys. You maintain full control over your assets. Your ETH is safe as long as you control your private key.
1.3. Liquidity Pool
A liquidity pool in cryptocurrency is a collection of crypto assets that are locked in a smart contract. These pools are used for decentralized trading, lending, and other financial services.
1.3.1. Impermanent Loss
Reference: Impermanent Loss Explained.
In a Automated-Market-Maker-based pool like Uniswap liquidity pool, here is an oversimplified example:
- I stake 1 ETH and 100 DAI in the respective pool on Uniswap
- In a week 1 ETH is equal to 200 DAI
- If I held my initial 1 ETH and 100 DAI, I would have gained 50% (100 DAI is the same, but my ETH is now worth 200 DAI)
- Being a participant in an AMM pool on Uniswap, my gain is less than the 50% I would have made if I simply held the assets
This difference between holding two assets and staking them in a pool is called impermanent loss. It is called that because the loss is not realized unless the stake is withdrawn. Compared to holding, if asset prices go up, your position will grow less, and if prices go down, you will lose more.
1.3.2. Automated Market Makers
Automated market maker protocols is mainly the reason we face impermanent loss at LPs such as Uniswap and SushiSwap, which makes our position behave non-linearly and are based on a very simple equation: \[ x \times y = k \] Here x is the number of tokens for asset A, y is the number of tokens for asset B, and their product is a constant k. And when there is no liquidity changes (no deposit and withdraw), as trades happens in the pool, k remains constant.
Let's consider an simple example in Uniswap ETH-DAI pool to illustrate the idea of impermanent loss:
- I stake 1 ETH and 100 DAI in the pool
- There’s a total of 10 ETH and 1,000 DAI in the pool after my staking — I have a 10% stake
- In a week 1 ETH trades for 200 DAI
- There are no trading fees in the pool
So, initially, we calculate k: \( k = 10 \times 1000 = 10000 \).
1.3.3. Example on AMM When Price Changes
Since ETH has doubled in price relative to DAI, arbitrageurs will have used the opportunity to buy cheap ETH from the pool until its price reaches 200 DAI a piece (the overall market price). Now let's try to calculate the new distribution of ETH and DAI, firstly, the initial rate \((r = 100)\), which means 1 ETH traded for 100 DAT at the start, and we use t to depict the time which r is calculated \((r_t)\). \[ r_t = \frac{y_t}{x_t} \] So in the AMM model, we can extract formulate to calculate the amount of each asset in the pool at any given ratio \(r_t\) at any given time t: \[ x_t = \sqrt{\frac{k}{r_t}} \] \[ y_t = \sqrt{k \times r_t} \] So for our starting position \(t_0\) \[ x_{t_0} = \sqrt{\frac{10000}{100}} = 10 \] \[ y_{t_0} = 10000 \times 100 = 10000 \] It works. We get the initial state of the assets in the pool — 10 ETH and 1,000 DAI. Now let's apply the same formulae for the end of our example \(t_1\), when 1 ETH trades for 200 DAI. Our new r is 200. Let's plug that into the equations: \[ x_{t_1} = \sqrt{\frac{10000}{200}} \approx 7.07 \] \[ y_{t_1} = \sqrt{10000 \times 200} \approx 1414.21 \] After the change in the price of ETH, the pool contains about 7 ETH and about 1,414 DAI. We can confirm that this is correct: \[ 7.07 \times 1414.21 \approx 10000 \] Since our stake in the pool is 10%, so after the price change of ETH, we are entitled to 0.707 ETH and 141.421 DAI, and our worth in USD is: \[ 0.707 \times 200 + 141.421 = 282.821 \] But if we simply held the assets (1 ETH and 100 DAI), we would now have $300 worth of assets.
So the impermanent loss if we decide to withdraw at \(t_1\) is: \[ \frac{(300 - 282.821)}{300} \approx 5.72\% \]
1.3.4. Example on Providing Liquidity on ETH/USDC Pool
When you provide liquidity to a pair like ETH/USDC on Uniswap, you're adding both ETH and USDC (balanced) to the pool. For example, if you're depositing 4 ETH and an equivalent amount of USDC (based on the current exchange rate), you're providing liquidity in the form of both assets. Uniswap will temporarily take your ETH and USDC (decrease balance on-chain) and deposit them into the liquidity pool, and in return, you'll receive LP tokens that represent your share of the liquidity pool. These LP tokens are like receipts that you own a proportional share of the pool.
When someone swaps USDC for ETH on Uniswap, they are interacting with the ETH/USDC liquidity pool you contributed to. However, you don't sign individual transactions when people buy ETH. The transaction happens through the Uniswap smart contract, and your LP tokens (which represent your share of the pool) will automatically increase in value based on the trading fees earned from the swap.
When withdraw: For example if you have a 10% share of the pool, so when you withdraw, you'll get 10% of the current ETH and 10% of the current USDC in the pool. If the pool has been used to buy ETH with USDC, you might receive more USDC when you withdraw and less ETH.
1.4. Delta Neutral
The goal of this Delta Neutral in Defi is to ensure that the changes in the value of crypto (e.g., ETH) don't cause you to lose money overall, thanks to the combination of transaction fees and the hedge provided by the short position. You're not trying to profit from the price movement itself but rather from stabilizing your exposure and continuously earning transaction fees from the LP.
1.4.1. A View to Understand Delta Neutral in Liquidity Pool of Defi
When we deposit coins into a liquidity pool (like ETH/USDC or GLP with BTC, ETH, USDC), we are effectively taking a "long" position on the assets in the pool. This is because you are providing liquidity by holding and contributing these assets, so you are exposed to their price fluctuations. If the prices of the assets in the pool rise, your liquidity share increases in value; if the prices fall, you could experience impermanent loss.
To maintain a delta-neutral position, you would short those same assets in another market (for example, through futures contracts or borrow then selling the assets) to offset the potential price movements. This way:
- If the price of ETH or BTC in the pool rises, you are protected by the profit from your long position in the pool.
- If the price of ETH or BTC in the pool falls, your short position helps protect you from the losses, as you can buy back the shorted asset at a lower price.
The Delta-Neutral strategy relies on this balance of longs (in the pool) and shorts (in the market) to stabilize the returns from LP and minimize the risks of small price movements.
While delta hedging can mitigate the asymmetric risks (impermanent loss), it also involves trading costs, potential borrowing fees, and the need for continuous rebalancing.
1.4.2. Delta-Neutral Strategy in Defi (Example on Uniswap ETH/USDC)
- Initial Setup: Deposit 4 ETH (10,000 USD) and 10,000 USDC into the Uniswap ETH/USDC liquidity pool at a price of 2500 USD per ETH. Receive LP tokens and earn transaction fees over time.
- Risk of Impermanent Loss: If ETH price drops (e.g., to 2000 USD), the pool adjusts to have less USDC and more ETH. This results in a decrease in the total value of your liquidity position due to impermanent loss. If one token appreciates or depreciates significantly, the pool will end up with more of the depreciated asset and less of the appreciated asset
- Hedging with Short Position: To hedge, short ETH by selling 1 ETH at 2500 USD when you deposit. When ETH price drops to 2000 USD, buy back the shorted ETH at 2000 USD, making a 500 USD profit per ETH.
- Delta-Neutral Outcome: The profit from the short position offsets the impermanent loss in the liquidity pool. And we continue to earn transaction fees from the Uniswap pool while maintaining a delta-neutral position by adjusting your short position.
1.4.3. Implementations of Uniswap v2 LP Delta Neutral
In practice, simply selling ETH isn't ideal for shorting because it requires borrowing ETH first (unless you're holding ETH already). One practical way is by using a lending protocol to short ETH while providing liquidity to a Uniswap ETH/USDC liquidity pool.
Here is an simple example using Aave to borrow-and-short ETH:
- Deposit Collateral (USDC): First, you need to deposit collateral. In this case, you can deposit USDC (10,000 USDC) into the lending protocol. Your 10,000 USDC deposit acts as collateral to borrow ETH.
- Borrow ETH: You borrow ETH against your USDC collateral. For example, let's say you borrow 4 ETH (worth 10,000 USD at a price of 2,500 USDC per ETH). Now, you owe 4 ETH to the lending protocol, and you are "short" on ETH. At this stage, you hold 4 ETH in your Uniswap LP, but you also owe 4 ETH (borrowed) to the lending platform. You will need to repay the ETH later with interest to Aave.
- Sell the Borrowed ETH: You sell the 4 ETH you borrowed for 10,000 USDC. This is your short position: You're betting that the price of ETH will decrease. You now have 10,000 USDC from selling the borrowed ETH.
Now, we have:
- In Uniswap LP: 4 ETH and 10,000 USDC, with exposure to ETH price changes.
- Borrowed ETH: 4 ETH, which you sold for 10,000 USDC, creating a short position on ETH.
If ETH price drops:
- The price of ETH falls to 2,000 USDC per ETH.
- The value of your 4 ETH in the Uniswap LP drops from 10,000 USDC to 8,000 USDC.
However, the value of your short position increases: You borrowed 4 ETH at 2,500 USDC per ETH (10,000 USDC), but now you can buy back the 4 ETH for 8,000 USDC (at the new price of 2,000 USDC per ETH). So, you make a profit of 2,000 USDC on your short position (since you sold at 2,500 USDC per ETH and can now buy back at 2,000 USDC per ETH).
At the time you are ready to close your position, you will repay the borrowed ETH to the lending platform. In our case, if ETH price has dropped:
- You will repay 4 ETH (which is now worth 8,000 USDC at the price of 2,000 USDC per ETH).
- You made a 2,000 USDC profit from the short, which offsets the loss in the LP.
1.5. Formulize
1.5.1. Assumptions
When we deposit two assets (e.g., ETH and USDC) into a Uniswap V2 liquidity pool, the constant product formula \(x \times y = k\) makes our position behave non-linearly. In effect, we end up with a net exposure to ETH that is similar to being long ETH, but with a impermanent loss:
- If ETH rises: Our gains are muted compared to pure holding ETH.
- If ETH falls: Our losses are amplified relative to pure holding ETH.
For the purposes of this derivation, we assume that the liquidity pool consists solely of the tokens provided by a single liquidity provider (i.e., our deposit). This simplification implies that the invariant \[ x \times y = k \] directly corresponds to our deposit amounts, and that all changes in the pool’s state are solely due to changes in the price \(p\). In a real-world scenario, a pool typically contains liquidity from many providers. However, since each provider's share of the pool adjusts proportionally, the impermanent loss formula remains valid for any given share of the pool.
1.5.2. Formulizing LP Delta in Uniswap V2
The delta (i.e., the sensitivity of our LP position to ETH's price) can derivate as follows:
- Current price \(p\):
\[ p = \frac{y}{x} \]
- Along with \((x y = k )\), we can get:
\[ x = \sqrt{\frac{k}{p}}, \quad y = \sqrt{k p} \]
- The total value of current LP position (in USDC) at price \(p\):
\[ V_{\text{LP}}(p) = p x + y = 2 \sqrt{k p} \]
- Thus, the delta can be expressed as:
\[ \boxed{\Delta = 2 \sqrt{k} \frac{1}{2} p^{-\frac{1}{2}} = \sqrt{\frac{k}{p}}} \]
1.5.3. Formulizing Impermanent Loss in Uniswap V2
- Assuming we initially deposit ETH at price \(p_0\). Then the amounts we deposit are:
\[ x_0 = \sqrt{\frac{k}{p_0}}, \quad y_0 = \sqrt{k \, p_0}. \]
- If we had simply held these tokens, their total value at a new price \(p\) would be:
\[ V_{\text{hold}}(p) = p \, x_0 + y_0 = p \sqrt{\frac{k}{p_0}} + \sqrt{k \, p_0}. \]
- Define the price ratio:
\[ r = \frac{p}{p_0} \quad \Rightarrow \quad p = r \, p_0. \]
- Then, the hold value becomes:
\[ V_{\text{hold}}(p) = r \, p_0 \sqrt{\frac{k}{p_0}} + \sqrt{k \, p_0} = \sqrt{k \, p_0} (r + 1). \]
- As derived before, the total value of current LP position (in USDC) at price \(p\) would be:
\[ V_{\text{LP}}(p) = 2 \sqrt{k \, p} = 2 \sqrt{k \, (r \, p_0)} = 2 \sqrt{k \, p_0} \sqrt{r}. \]
- Impermanent loss (IL) is defined as the relative difference between the value of the LP position and the value of simply holding the tokens:
\[ \text{IL}(r) = 1 - \frac{V_{\text{LP}}(p)}{V_{\text{hold}}(p)}. \]
- Substituting the expressions derived above:
\[ \frac{V_{\text{LP}}(p)}{V_{\text{hold}}(p)} = \frac{2 \sqrt{k \, p_0} \sqrt{r}}{\sqrt{k \, p_0}(r+1)} = \frac{2\sqrt{r}}{r+1}. \]
- Thus, the impermanent loss is:
\[ \boxed{\text{IL}(r) = 1 - \frac{2\sqrt{r}}{r+1}}. \]
1.5.4. Example on Dynamic Hedging Through Price Movements
Assuming in our example, 1 ETH = 2500 USDC, the liquidity pool simply maintains our single deposit: \(k = x \times y = 2500\).
- Initial Condition \((p = 2500)\):
\[ \Delta = \sqrt{\frac{2500}{2500}} = 1 \] This shows us that our LP position has an effective exposure of 1 ETH. To be delta neutral, we would hedge this by shorting 1 ETH in another market (e.g., by borrowing 1 ETH and sellnig it for USDC).
- Price Decline \((p = 2000)\):
The price ratio here is: \[ r = \frac{2000}{2500} = 0.8 \] and the corresponding impermanent loss is: \[ \text{IL}(0.8) = 1 - \frac{2\sqrt{0.8}}{0.8+1} \approx 0.006192 \] or about \(0.62\%\). \[ \Delta = \sqrt{\frac{2500}{2000}} \approx 1.118 \] Now, our LP position behaves as if we are long 1.118 ETH, which means our position is "over-exposed" to pure ETH holding. If ETH falls further, we will lose more than 1.1.
To maintain delta-neutral, we need to short an additional 0.118 ETH.
- Price Increase \((p = 3000)\):
If instead of dropping, the market price of ETH increases to 3000, we have: The price ratio is now: \[ r = \frac{3000}{2500} = 1.2, \] with an impermanent loss of: \[ \text{IL}(1.2) = 1 - \frac{2\sqrt{1.2}}{1.2+1} \approx 0.004141 \] or about \(0.41\%\). \[ \Delta = \sqrt{\frac{2500}{3000}} \approx 0.913 \] Our LP position now behaves as if we're long about 0.913 ETH, which means our position gains less per unit increase in ETH price.
To maintain delta-neutral, we need to buy back (or "long") \(1 - 0.913 = 0.087 \) ETH to reduce our short position.
2. GLP Delta Neutral
GMX is a multi-asset pool (BTC, ETH, USDC, etc.). GLP is the liquidity token for GMX V1, which consists of an index of assets used for swaps and leverage trading The strategy of delta-neutral in GLP is more complex due to the basket of assets.
2.1. Example: Delta-Neutral Hedging
For example, by holding GLP, you indirectly hold fractions of assets like ETH, BTC, and USDC. Since ETH and BTC are volatile, your overall portfolio has a directional exposure. To offset this long exposure, you'd short an equivalent amount of the volatile assets. For example, if your GLP position represents a certain fraction of ETH and BTC, you'd short that same fraction on another market (using borrowing or derivatives) to neutralize the price risk.
2.2. Delta
Open Interest
It's important to note that both the pool composition and market prices can change over time. GLP's value is derived by dividing the total worth of the index assets by the total GLP supply, reinforcing that the mechanism is based on net asset value calculations rather than an automated market-making curve like Uniswap. (NetPriceFluctuationofUnderlyingBasketAssets)
3. Funding Rate Delta Neutral
3.1. Funding Rate
The funding rate is the periodic fee exchanged between long and short positions in to maintain the balance between the long and short positions in the perpetual market. Determined by the difference between the mark price (derived from the futures market) and the index price (spot price). When the mark price is higher than the index price, the funding rate is positive, and long positions pay short positions; when it's lower, the rate is negative, and short positions pay long positions.
3.1.1. Mark Price
The mark price is typically computed as the midpoint between the best bid (the highest price buyers are willing to pay) and the best ask (the lowest price sellers are willing to accept). This mid-price is considered a fair estimate of the asset's value at that moment.
There usually low liquidity at the mark price because traders prioritize placing orders at the best available prices (bid and ask) for faster execution.
3.1.2. Example: Positive Funding
This situation usually happens when there is a strong bullish sentiment in the market, with more people taking long positions. When this happens, long traders are willing to pay short traders, incentivizing more short positions to enter the market. This helps keep the market from becoming too skewed and pushing the mark price too far above the spot price.
3.2. Example: Trade Perpetual Futures on Drift
Drift Protocol is the largest open-sourced perpetual futures exchange built on Solana.
3.2.1. Initial: Mark Price $2742.84 per ETH
- Case: Long Order
Scenario: Current mark price is 2742.84, and you set a limit price of 2750 to long 1 ETH.
You're telling Drift that you're willing to buy ETH (via the perpetual contract) at any price up to 2750. Since 2742.84 is well below your limit, your order will likely be filled immediately at or near the current mark price. Your PnL is calculated in USDC when you close the position.
- Case: Short Order
Scenario: Current mark price is 2742.84, and you want to short by placing an order with a limit price of 2740 to short 1 ETH.
Since 2742.84 is above your limit, your order will likely be filled immediately at your current limit price or above. Your PnL is calculated in USDC when you close the position.
3.2.2. Now: Mark Price Increase to $2800 per ETH
When the market is bullish and the mark price rises to $2800, the funding rate tends to be positive. This happens because more people are likely to be long on ETH, creating demand to pay shorts in the market.
- Case: Long Position
As a long position holder, you are required to pay funding fees to the short position holders. Since the funding rate is positive, you pay a certain amount of USDC to the short traders.
- Case: Short Position
As a short position holder, you receive the funding payment from the long traders. This incentivizes more traders to enter short positions and helps balance the market.
3.3. Delta Neutral
3.3.1. Delta
The Delta when we long or short futures position is pretty straightforward. Unlike options or other automated market like Uniswap, it is linear to the underlying.
3.3.2. Maintaining Delta Neutral
Delta-neutral positions involve balancing long and short positions of the same asset (e.g., ETH) in different markets (i.e, Drift, Bybit) to minimize exposure to price changes. Since both long and short will have a delta of 1, you might just long and short same amount of asset in different markets to neutralize price risk.
3.3.3. Monitoring Funding Rates
Delta-neutral strategy can be impacted by fluctuating funding rates across platforms.
Funding rates are crucial in these strategies as they reflect the cost (or benefit) of maintaining positions. These rates can be positive or negative depending on the platform and market sentiment.
On platforms like Drift and Bybit, funding rates might differ:
- If Drift's funding rate is negative and Bybit's funding rate is positive, you could potentially earn funding payments from Bybit (as a short position) while paying funding on Drift (as a long position).
- If Drift's funding rate is negative and Bybit's funding rate is negative, you could potentially pay funding payments on Bybit (as a short position) while paying funding on Drift (as a long position).
The key is to monitor funding rate changes regularly and adjust positions accordingly to avoid "double" funding payments or ensure you're collecting the maximum funding possible, while maintaining delta-neutral.
4. JLP Delta Neutral
4.1. Jupiter
Jupiter is a decentralized cryptocurrency exchange platform on the Solana blockchain.
4.1.1. Jupiter Swap (Aggregator)
Jupiter Swap started as (and largely still is) the leading swap aggregator on Solana, meaning it does not rely on a single liquidity pool belonging to Jupiter itself. Instead, Jupiter Swap connects to various AMMs and liquidity sources on Solana (e.g., Orca, Raydium, Serum, and many others).
Jupiter Swap itself is an aggregator, not a standalone AMM. It does not hold or manage a big, dedicated "Jupiter Swap Liquidity Pool" for spot trading. Instead, it helps you tap into the combined liquidity of many existing AMMs on Solana. Basically, the aggregator's routing engine calculates the best route (possibly splitting the trade across multiple AMMs) to get you the best price.
4.1.2. Jupiter Liquidity Pool
JLP is a token that represents ownership in a liquidity pool on the Jupiter Perpetual Exchange, the liquidity pool—funded by liquidity providers (LPs) who deposit assets like USDC and receive JLP tokens in return.
The value of JLP tokens is tied to the total value of the pool, calculated as the sum of each asset's quantity multiplied by its price, divided by the total number of JLP tokens.
4.1.3. Jupiter Perps (Perpetual)
Jupiter Perps is a LP-based perpetual exchange, it has the following properties:
Decentraized Design
In centralized exchanges, an order book matches a buyer with a seller. In DeFi, there’s no central entity to pair traders. Instead, the liquidity pool steps in to ensure every trade can happen, acting as the "other side" of every position.
Guaranteed Liquidity
The pool ensures traders can always open or close positions, as long as it has enough funds. Without this, trades might fail due to insufficient liquidity, which isn’t an issue in spot AMMs like Uniswap but is critical for leveraged perpetuals.
Simplifying Trading
By having the pool as the counterparty, the protocol avoids the complexity of finding another trader for every position. You deposit assets, traders trade against the pool, and it handles everything.
Risk and Reward Sharing:
JLP holders collectively bear the risk of traders' profits and losses. In return, you earn fees from trades and funding rates, making it a trade-off for providing liquidity.
So, when a trader opens a position—say, a long or short on BTC—the pool takes the opposite side. This is fundamentally different from Uniswap, where the pool just facilitates spot swaps and doesn’t take directional bets.
4.2. Idea: Delta-Neutral Strategy on JLP
The core idea is to hold a long position in JLP (a liquidity provider token whose value is tied to underlying assets like BTC, ETH, and SOL) and then offset its directional (delta) exposure by taking corresponding short positions in those underlying assets. By doing so, the portfolio’s value becomes largely insensitive to small price moves in BTC, ETH, or SOL.
The process involves leveraging the JLP position (by borrowing USDC) and using that liquidity to open the short positions.
4.2.1. Buy JLP tokens
Purchase JLP tokens, which represent a share in a liquidity pool containing assets like BTC, ETH, SOL, USDC, and USDT. When you buy JLP, you're providing liquidity to the pool and your investment's value becomes tied to the price movements of these underlying assets.
4.2.2. Calculate delta exposure on BTC, ETH and SOL
For JLP, the delta exposure comes from:
- Physical Holdings: The actual amount of BTC, ETH, SOL, etc., in the pool.
- Perpetual Market Exposure: The pool acts as the counterparty to traders in the perpetual futures market. This introduces additional exposure based on traders' net positions.
Let \(N\) be the number of JLP tokens held from 1. \(\text{Total JLP tokens}\) be the total supply, \(\text{quantity}_{asset}\) be the quantity of asset in the pool (including fees) and \(\text{oiDiff}\) be the current net open interst.
The delta for an asset is given by: \[ \Delta_{\text{asset}} = \frac{\text{quantity}_{\text{asset}} - \text{oiDiff}}{\text{Total JLP tokens}} \times N \]
\( \text{oiDiff}\) represents the net open interest (\(\text{longOI} - \text{shortOI}\)) in Jupiter Perp.
If \( \text{oiDiff} > 0 \) (traders net long):
The pool is net short via perpetuals, which reduces your long exposure or makes you net short if \( \text{oiDiff} > \text{underlyingAssetExposure} \).
If \( \text{oiDiff} < 0 \) (traders net short):
The pool is net long via perpetuals, which increases your long exposure.
4.2.3. Deposit JLP as Collateral on Lending Market to Borrow USDC (Kamino)
Kamino is a lending platform where you can deposit your JLP as collateral to borrow USDC (a stablecoin). This step allows you to access funds without selling your JLP, preserving your ability to earn yield
4.2.4. Deposit USDC to Trading Venue (CEX or Drift)
The borrowed USDC is transferred to a trading platform, like Drift, a decentralized perpetuals exchange on Solana.
4.2.5. Short BTC, ETH, SOL Delta to Fully Hedge
To hedge, the amount to short for each asset is equal to its delta exposure calculated in step 2.