Can we build a LP tokens marketplace ?

Infinity Protocol is building a suite of DeFi products for LP tokens in the form of Continuous Leverage, Impermanent loss hedging and a Volatility trading. Today, there are billions worth of tokens locked in various DeFi applications within liquidity pools and yield generating strategies. In many cases, these LP tokens remain unutilized even though they carry an intrinsic value. The current work will dive into how unlocking this locked value will be a fundamental component in elevating both efficiency and composability within DeFi, and why Osmosis/Mars is the optimal blockchain for this revolution to begin.

Primer on DeFi & LP tokens

Decentralized Finance (DeFi) attracted huge attention in 2023, exploding onto the cryptocurrency scene with its aim to disintermediate real-world centralized financial functions by utilizing smart contracts on blockchains or “programmable money”. DeFi has solidified its position as a mainstay in the crypto conversation with over $171Bn total value locked (TVL) according to DeFi Llama below. This meteoric rise over the past year has been largely attributable to several innovations, including (non-exhaustive list):

DEXs & Automated market makers (Osmosis/Astroport/Crescent) Permissionless borrow/lend markets (Mars/Membrane) On-Chain Derivatives (Injective/Levana) Yield Optimizers (Apollo/Quasar) Liquid staking pools (Stride/QuickSilver)

What is the total locked LP tokens in the Cosmos ecosystem DeFi applications will typically issue an LP token to depositors as a claim on their deposited assets. A common denominator within these innovative DeFi applications is that they require liquidity to be locked onto their platform for various reasons: DEXs / AMMs: In liquidity pools to facilitate trading Money markets: To secure deposits as collateral Derivative platforms: To post as collateral Yield Optimizers: Deposits are deployed in various strategies Staking Pools: Staked assets are delegated to validators etc. There staggering amounts of value locked within them, $40Bn locked on 3 major lending protocols and $26Bn locked on major Ethereum DEXs What are some of the key problems on liquidity provision in the Cosmos ecosystem ? Currently the LPs can not be delta neutral the token they receive in rewards and external incentives LPs can not hedge their Impermanent loss LPs can not lend their tokens for utilizing yields from derivative platforms

The first used case for the LP tokens would be to offer Quadratic Leverage with No Oracles; where arbitrageurs would create parity with centralized exchanges and the

Continuous Leverage Tokens (CLT) Base Implementation Here the liquidity providers are providing liquidity and get the interest for letting the CLT holders borrow the liquidity to get X^2 leverage for a bound Liquidity providers turn into lenders for the CLT token holders CLT holders are paying funding rate to hold it

Inspiration

Sunny and Dev told Sankha about the RMM idea to build leverage with no oracles and liquidation Sankha comes from Trad-fi where financial instruments payoff is convex, whereas LP payoff is concave Can a financial instrument with convexity, which has no oracles and no liquidation be built and CLT is an effort to built that

What it does

It is a constant X^2 leverage token The token is continuously rebalancing and paying funding rate to the liquidity providers The liquidity providers offer 2X leverage for a particular bound The bound is calculated at the backend

How we built it

We used Cosmwasm on Osmosis to built it

Challenges we ran into

How to integrate the money market for continuous leverage How to calculate the bound for the lps and CLT borrowers The IV calculation is based on the Concentrated liquidity providers from Prof Lambert

Accomplishments that we're proud of

Initial MVP for the product Broader plan for the product Duality from the interest rate model to the AMM incentivization

What we learned

What's next for CLT tokens

Front-end integration for the backend product Finish the whitepaper with possible money market abstraction Continuous Leverage Tokens (CLT) Base Implementation Here the liquidity providers are providing liquidity and get the interest for letting the CLT holders borrow the liquidity to get X^2 leverage for a bound Liquidity providers turn into lenders for the CLT token holders CLT holders are paying funding rate to hold it

Inspiration

Sunny and Dev told Sankha about the RMM idea to build leverage with no oracles and liquidation Sankha comes from Trad-fi where financial instruments payoff is convex, whereas LP payoff is concave Can a financial instrument with convexity, which has no oracles and no liquidation be built and CLT is an effort to built that

What it does

It is a constant X^2 leverage token The token is continuously rebalancing and paying funding rate to the liquidity providers The liquidity providers offer 2X leverage for a particular bound The bound is calculated at the backend

How we built it

We used Cosmwasm on Osmosis to built it

Challenges we ran into

How to integrate the money market for continuous leverage How to calculate the bound for the lps and CLT borrowers The IV calculation is based on the Concentrated liquidity providers from Prof Lambert

Accomplishments that we're proud of

Initial MVP for the product Broader plan for the product Duality from the interest rate model to the AMM incentivization

What we learned

What's next for Infinity

Front-end integration for the backend product Finish the whitepaper with possible money market abstraction Understanding the Basic Design Philosophy Basics CLT Tokens will be implemented as CW20 tokens with constant quadratic leverage. The leverage is constantly rebalancing, CLT Tokens can never be liquidated. CLT tokens are not traded, they are simply minted or burned. Why would I want a CLT Token? CLT Tokens are useful because they have the property of asymmetric upside. This means that relative to a 2x perpetual future, when prices go up, CLT tokens have higher returns than the future, and when prices go down, CLT tokens have less worse (better) returns than the future. How are CLT tokens created? CLT tokens are created with a novel mechanism of borrowing LP shares. CLT Tokens represent some collateral in the token that is being "longed" and some debt in LP shares, yet the position itself doesn't hold any LP shares. CLT tokens aren't bought and sold on secondary markets, instead they are minted and burned in exchange for the underlying tokens. What is the cost of owning a Continuous Leverage Token? CLT Tokens must continuously pay for borrowing liquidity. This is achieved by slowly decreasing the redemption value of a CLT token such that, if prices stay the same, a CLT token is worth more today than tomorrow. The borrowing rate is determined by some static parameters as well as how much of the supplied liquidity is being actively borrowed, based on the Jump Rate Model. CLT can not replicate infinite payoffs, once it is above some price, the leverage is no longer constantly rebalancing and is therefore below 2x leverage. This price is parameterized as the upper bound. CLT tokens are path independent and will regain constant leverage once prices go below the upper bound. Boosting returns with liquid staking derivatives CLT tokens provide an opportunity to boost returns by going long on staking tokens vs the underlying native asset. Major Used Case for this product Speculate If you think prices are going to change, CLT Tokens offer a way to get a simplified leverage experience while also having asymmetric upside with capped downside with no liquidation risk. Earn If you think prices are going to stay the same, provide liquidity to the RMM pool, to earn interest on your deposits. Users earn directly from the funding paid by CLT token holders Hedge Reduce your volatility exposure via gamma hedging. To hedge what is called "impermanent loss," traders can use CLT Tokens which have a non-linear payoff that is perfect for hedging exotic instruments.

How to make a marketplace for LP tokens with IL on both sides

Infinity protocol has two participants (LP token Providers and LP token Borrowers) which allow perpetual leverage trading on any token.

LP token holders provide liquidity in any pool to earn a higher yield than the vanilla LP position. This additional yield is from the fees paid by those borrowing liquidity which should better compensate LPs for the volatility risk they are assuming. LP token borrowers take leverage in the form of CLT tokens, or go long IL, or can construct any payoff (a perpetual straddle on any token) without liquidation risk from price movement.
Infinity protocol is not reliant on oracles and instead calculates the P&L of borrowed positions based on the liquidity invariant and the interest rate. LP token borrowers are trying to turn the LP's Impermanent Loss into their Impermanent Gain. What it means to Provide Liquidity in Infinity Protocol Infinity Protocol is a liquidity middle layer for various AMMs. We have integrations with Osmosis/Astroport/Injective and Mars with even more planned in the future. To enable our service, LP token providers must provide liquidity through the Infinity protocol platform. In the case of Osmosis OSMO/USDC pool, they will need to deposit either the underlying tokens OSMO & USDC representing their position in the pool. In return, the LP will receive a CW20 token that collects all of the fees from the underlying AMM plus additional borrow fees from traders in Infinity Protocol. Why Provide Liquidity in Infinity Protocol?

A rational LP will always look to provide liquidity in Infinity Protocol as opposed to the underlying AMM. This is because the LPs earn additional yield from those borrowing liquidity while incurring less volatility risk due to the pseudo delta hedging from the borrow fees. The only additional risk is the Smart Contract risk which Infinity Protocol has been audited for. DEX lp pnl = swap fees - impermanent loss Infinity Protocol lp pnl = swap fees - impermanent loss + borrow fees As shown above, the yield in infinity protocol will always be >= the underlying AMM. The only exception might be liquidity mining incentives but those can be applied to Infinity Protocol liquidity pools as well. Liquidity mining incentives do not factor into the borrower's PnL.

Borrowing Liquidity from the AMM: Infinity Protocol enables you to purchase option like exposure on any token. This is because the protocol is not reliant on an oracle. To open a leveraged position, one must provide liquidity in the underlying tokens. In a OSMO/WETH pool, the option purchaser can choose to provide collateral in OSMO or WETH. The LTV ratio can be as high as 95%. The lower the LTV the farther away a position is from liquidation, however, the position will be less capital efficient. PnL of a Borrower = borrower pnl = impermanent gains - the interest rate The interest rate is dynamic similar to Aave but not linear. It is exponential and takes into account fees. Different lending platforms like Mars and Membrane can be integrated to generalize the interest curves available to the borrower

Can you use LP tokens from lending facilities? Yes liquidity providers can bring liquidity share tokens from lending platforms to be lent and provide liquidity

Can there be AMM designs which would be needed to integrate starting with Osmosis ? Initially the protocol is designed for the current Osmosis design, it needs to be adapted for the concentrated liquidity model for the Osmosis

Can LP tokens be used to built a GMX style perp exchange using a membrane style CDP based stablecoin The phase 3 idea is to design a GLP pool, where 50% of the tokens are native USDC and 50% of the assets are LP tokens from DEX

All the code implementation are in a private repo https://github.com/sbneo2022/d_hackathon

Built With

Share this project:

Updates