Poolshark: LP limit orders on Arbitrum
The directional liquidity AMM enabling on chain limit orders
Shoal Research Contributors: Cookieflyer1, TheAttentionscape
Intro
For those deeply involved in crypto, you know that "x * y = k" is the Constant Product Formula that changed the landscape of DeFi with the advent of the Automated Market Maker (AMM). Decentralized Exchanges (DEX) like Uniswap allow users to swap ERC-20s without a centralized counterparty. DEX volume in March 2023 was among the highest recorded since 2022, exceeding many larger exchanges in total volume for the month. AMMs have also been a recent hot topic given the buzz around Uniswap V3's business license expiring just a few days ago, giving protocols the chance to harness its previously restricted IP. However, more innovative projects like Poolshark aim to expand the AMM landscape by developing novel DeFi primitives. Poolshark is doing just this, with the introduction of their cover and price liquidity pools launching this month on Arbitrum.
Poolshark
Poolshark is a noncustodial automated market maker (AMM). Unlike most AMMs which are bidirectional in nature, Poolshark allows users to provide directional liquidity. Directional liquidity providers (traders) can choose to specify which direction to provide liquidity on an asset pair by either accumulating or releasing assets into the market. Maximizing Liquidity Provider (LP) transaction fees is achievable through Bidirectional pools as they gather fees for buying and selling the desired asset. Nonetheless, Bidirectional AMMs do have their shortcomings. Poolshark employs Price Liquidity and Cover Liquidity pools to address these issues, adding more tools for LPs to mirror trading strategies leveraged in traditional markets, such as limit orders, hedging, and dollar cost averaging (DCA).
Bidirectional vs. Directional Liquidity
Poolshark aims to solve one of the core issues, impermanent loss (IL), when providing liquidity. Characterizing impermanent loss involves considering the missed opportunity cost of potential value when LPing assets versus holding them outright. Impermanent loss is driven by deviations in price of the original supplied liquidity.
DeFi also allows for asset pairs with the potential for negative covariance, meaning pooled assets can trade in opposite directions away from each other, possibly exacerbating IL. Additionally, due to AMM mechanics, trading into one asset can cause the paired asset to lose value unless it has a stable peg or inherent value that attracts external arbitrageurs since pooled assets are priced in part by the liquidity on the platform. But don’t fret, the rainbow is on the other side of the storm.
With directional liquidity provisioning, Liquidity Provider's (LPs) liquidity will fill similarly to a limit order. Some core benefits of directional liquidity include choosing the trading direction, protection against unwanted price movements, and the ability to undercut the market price.
Undercutting the market involves setting the lower bound of the price range below the market price, offering a more competitive rate. This approach, coupled with order aggregation, enables faster selling compared to others in the market. As a typical liquidity provider (LP) on a bidirectional AMM, undercutting the market price is challenging due to its demand-driven nature. However, lower bound directional liquidity attracts volume to your position before other bidirectional LPs, ensuring a quicker trade execution. Undercutting is particularly attractive to market makers and swing traders. Since LPs cannot be entirely certain of full fulfillment until they retrieve their position, directional LPing guarantees that if the position is filled, it won't unfill since liquidity cannot trade back in the opposite direction. This situation would be most impactful for very large traders who find opportunities to incur fees that outperform the losses on lower pricing. Simply put, traders can provide liquidity at a cheaper price to make sure they are filled early and can remain filled prior to retrieving liquidity.
In addition, LPs do not have to manually close their range order from off-chain to lock in a position state, as is the case with mean-reversion AMMs (Uniswap, Curve, etc.)
The directional range-bound liquidity allows for range-specific orders. Let's take Alice, for example, who would like to accumulate ETH between $1500 and $1800. Alice provides liquidity in one direction with USDC and ETH. With Poolshark, Alice can specify to only allow for the intake of ETH in exchange for USDC at predetermined prices. In this case, Alice can still earn fees while providing liquidity. Thus dollar cost averaging into USDC (DCA) over time while ETH is between the $1500 - $1800 price point.
Bidirectional Liquidity: The pool takes in one or both assets and trades in both directions.
Directional Liquidity: The pool takes in one asset in the pair and trades in one direction
The figure below shows how most AMMs provide bidirectional liquidity.
The figure below shows directional range bound liquidity providing.
Cover Liquidity Pools
"Cover liquidity pools" have two distinct use cases, average into a position and hedging against impermanent loss by gradually unlocking liquidity as the price moves against the asset the LP provided. Cover liquidity pools are a unique type of pool that functions opposite to traditional AMM pool positions. Instead of increasing the amount held of the asset decreasing in price, the cover pool will increase the amount held of the asset by automatically creating miniature Dutch auctions to sell back assets actively.
Cover liquidity pools operate like an LP hedging tool for large trades to enter or exit in a specific range. Covering IL is as easy as providing cover liquidity in the same range as the original LP position (in Uniswap v3). For example, a user might have an ETH/ DAI LP position open on uniswap v3 with an upper bound limit of $5000 and a lower bound limit of $1000. With the price of ETH near the middle at $3000, an LP can set up a cover liquidity position as a hedge for the same range to limit IL.
Cover LPs unlock as the time-weighted average price (TWAP) moves in a particular direction. The Cover liquidity pool employs "TWAP oracles" (Time-Weighted Average Price oracles) to determine the optimal time for unlocking liquidity (i.e., the money invested by users) for trading with the other asset in the pool. In essence, the TWAP oracle monitors the investment's price over a set duration and leverages this data to determine the ideal time to unlock liquidity. TWAPs are commonly used in financial markets to reduce the price impact of large trades.To elaborate on the previous example, consider DAI and ETH. If the ETH/DAI price rises, the cover liquidity pool will release some ETH to be bought in reaction to changes in the range pool price (Δ). Conversely, if the ETH/DAI price drops, the cover liquidity pool will hold on to your funds until the price rebounds. While this may seem counterintuitive, it provides two distinct advantages:
Averaging into a Position
Hedging Impermanent Loss
Since LPs can use cover liquidity pools to average into a position or hedge against impermanent loss, they can maintain greater capital efficiency. The Gradual Dutch Auction (GDA) mechanism determines the price of the unlocked liquidity and ensures competitiveness with the current market rate. Moreover, the cover liquidity pool aims to protect LPs from losses if prices go down and help them book returns if the prices increase. LPs can trade their stable coins for another asset using the cover liquidity pool without worrying about price volatility, making it an excellent option.
Price Liquidity Pools
Note: Price Liquidity pools are now Limit Pools.
Traders want to be able to set a limit on the price they are willing to sell or buy your asset for, which is possible through traditional limit orders. However, with a bidirectional range AMM system, your range LP position can be reversed since it always allows for trades on both sides of the pair. In price liquidity positions, LPs specify the desired range for order fulfillment, preventing unfilled orders as prices shift. This approach is comparable to an on-chain limit order. A lower and upper price tick means, "I'm willing to sell my asset between this range with a minimum/maximum price."
Your liquidity will be accessed when the pool reaches that range, and trading will begin. In price pools, since you cannot reference the current price to see how much your position has been filled, you must track your claim on the liquidity pool using a Claim tick. Every time your price liquidity fully trades across a price tick (a function of the fee tier), the claim tick is moved to the new tick and serves as a new mark showing how much of your liquidity has been utilized between the lower or upper (depends on the direction) price tick and the current location of the claim tick. The "Claim Tick" is also used for gas efficiency since all the values required to claim a position are on a single tick.
In bidirectional range AMMs, liquidity providers typically either withdraw their position once it reaches the desired price as a pseudo-limit order or allow their liquidity to be traded within the range and accumulate fees, unlike traditional limit orders on centralized exchanges. However, price pools offer an innovative solution enabling one-way fills through the Claim Tick system.
Using Poolshark, liquidity providers can create price liquidity positions to benefit from price priority when undercutting the current price, meaning they can position to get filled at a certain price under the market price. Additionally, Claim Ticks only move in one direction, meaning trades are executed at predetermined prices and only execute in one direction. This helps LPs avoid unexpected losses due to price fluctuations. By creating price liquidity positions, LPs can have predetermined price-priority execution avoiding the risk that price movements impose on bidirectional liquidity positions. Overall, price liquidity pools create a more secure and predictable environment for decentralized trading and add limit orders to LPs toolboxes.
Range Liquidity Pools
Range Pools, which resemble the bidirectional liquidity of mean-reversion AMMs, allow liquidity providers (LPs) to range-bound their liquidity, increasing the available liquidity near the current market price and enhancing capital efficiency. Range Pools support the ERC-1155 standard in order to allow for fungible positions and shared auto compounding. This can result in increased trading fees accrued for stable pairs. However, the impact of price divergence is more significant for range-bound liquidity as opposed to full-range liquidity, and impermanent loss mitigation is achieved by LPing into Cover Pools.
Protocol Feedback
The Poolshark team is diligently advancing the field of AMMs, and we appreciate their engagement with us and their efforts in innovating in the DEX space. After discussing with the team and thoroughly examining the documentation, we identified several areas where we suggested improvements:
Refining Product Suite Narrative
Cover Pool Product Improvements
Inability to DCA
Price Pool Product Improvements
Refinement of "Undercutting the Market"
Refining Price Pools Use Case and Narrative
Refining Product Suite Narrative
Poolshark should adopt more accessible and memorable branding for its product suite, such as Tidepools. Tidepools would function as a toolkit for liquidity providers (LPs) to manage their positions efficiently. On the buyer side, users would encounter a traditional order book. Rather than focusing on the concept of capital efficiency, which can be challenging to understand, Poolshark can emphasize its ability (if implemented correctly) to create advanced and gradual dollar-cost averaging (DCA) strategies for LPs. Similarly, for exiting capital, Poolshark can emphasize gradually taking profit within a range rather than a swift exit at an exact price.
To ensure users understand the toolkit, simple language should clarify the offering. An unclear narrative can challenge a project's fundraising ability, obstructing investors' understanding of its potential impact and value proposition. Defining and communicating a clear vision is essential for attracting investments and ensuring project success. The following table offers a concise breakdown of this approach.
Cover Pool Product Improvements
Inability to DCA
Cover pools primarily address the Impermanent Loss associated with an LP position. The provided examples confirm this, and the excerpt below from the product documentation clarifies that a cover pool cannot be used to "buy the dip."
The term "Dollar Cost Averaging" (DCA) refers to purchasing assets over specific time intervals, which is advantageous since prices will likely fluctuate, and the average acquisition cost may be better than investing all at once. This approach focuses less on timing the market and more on the Time-Weighted Average Price (TWAP) over time.
Cover pools do not release liquidity at scheduled intervals. Instead, they release liquidity when the TWAP indicates sufficient evidence that the "true price" or "stable price over time" has reached a level where the LP provider would be concerned about Impermanent Loss. This occurs when the price of ETH has caused them to lose ownership and exposure to ETH in the Range Pool or V3 pool in which they are participating. Therefore, the cover pool does not offer a time-based DCA option, which should be made clear when discussing the benefits of the cover pool.
Price Pool Product Improvements
Refinement of “Undercutting the Market”
Poolshark shows undercutting the market as a benefit of using the Cover liquidity pools, which we cover in the Bidirectional vs. Directional Liquidity section.
Price“ Pools therefore allow users to undercut the current market price and receive priority for doing so. In offloading a large position before a large market move, it would be ideal to slightly undercut the market price.” - Price Pools
The example below describes someone willing to sell Below The Current Price, which is unusual. The only scenario in which you are ready to do this is if selling via a swap will cost too much due to fees and slippage.
If:
Fees Paid + Slippage >= Current Price - Lower Bound(of the range selected)+ Fees Earned
Then:
Providing a Price Pool LP to sell your position is profitable because you earn the fees instead of paying them and avoid incurring large slippage. The team verified that the below use case is unrealistic for ETH in particular and that a more accurate example would be something like Alice being willing to sell from 1993-2000 since ETH slippage is very low for even large trades. The primary gain is from Fees Earned and maybe a tiny amount of slippage (0.3% of 2000 in fees + some tiny amount of slippage from price impact).
The methodology given is that LPs might want to price their assets lower than market price to get filled quickly. Our assessment found this use case only realistic for large traders who see opportunities to incur fees that outperform the losses on lower pricing. Poolshark could identify these opportunities and suggest pricing liquidity accordingly for LPs.
Refining Price Pools Use Case and Narrative
Price pools need to provide a cleaner and clearer use case for most traders since traders want the ability to place limit orders. A straightforward narrative for price pools would allow users to set limit orders in either direction.
Limit orders for a buyer serve 2 functions:
Ensure that a market order doesn't lead to large amounts of slippage either along an AMM curve or through a CEX order book.
Allow the bidder to submit orders to "buy the dip," which enables the buyer to acquire the asset whenever the price target they have is available from the seller or liquidity providers.
Price pools to enter a position are about saving on fees (collecting them as an LP instead of paying them on a swap) and ensuring that your entry price is capped at the limit you desire.
From the seller's perspective, limit orders through price pools enable either "take profit targets" or exit a position at a minimum price to avoid losses due to slippage and fees. As a seller, you might be willing to provide a liquidity pool (LP) price pool position below the current market, as mentioned earlier, if the fees you earn and the slippage you avoid are worth more than the amount you lose by selling below the current market price on an Automated Market Maker (AMM) swap.
When creating a position that offers a better price for execution to any buyer on the swap, the system prioritizes the respective range. This enables the seller to exit their position as desired until the full amount of provided liquidity is exhausted and the entire position is sold.
The Poolshark team has since updated some of the language and feedback provided.
Fin
The Automated Market Maker model has transformed the DeFi landscape. While most AMMs offer bidirectional liquidity, Poolshark has introduced directional liquidity, which helps to address impermanent loss, one-way liquidity provision, and offers supplier-driven pricing. Through the range, cover, and price liquidity pool mechanisms, liquidity providers are able to express their directional view of the market properly. The introduction of these novel DeFi primitives has the potential to expand the AMM landscape and create a more secure and predictable environment for decentralized trading. Poolshark's soon launch of cover pool and price liquidity pools on Arbitrum positions the platform to push the boundaries of DeFi and expand decentralized trading tools for LPs and traders.
Sources
Not financial or tax advice. The purpose of this newsletter is purely educational and should not be considered as investment advice, a request to buy or sell any assets, or a suggestion to make any financial decisions. It is not a substitute for tax advice. Please consult with your accountant and conduct your own research.
Disclosure. All of my posts are my own, not the views of my employer.