A novel protocol-layer LP framework for Solana DEXs
Conditional liquidity (CL) is a protocol-layer LP framework built for Solana DEXs. It enables DEXs to express a JIT
reaction to toxic order flow.Through Conditional Liquidity, DEXs can offer more competitive quotes to the market, realize more trading volume,
collect more trading fees, and improve LP yield.Further, without conditional liquidity, DEXs can only tighten their quotes to attract more order flow, however
they are unable to express a preference for non-toxic order flow. With conditional liquidity, DEXs are able to
express a gradient of spreads to a range of different types of order flow.Any DEX, ranging from AMMs to semi-automated market makers and onchain CLOB makers, can adopt conditional
liquidity in order to express a preference for non-toxic order flow.Conditional Liquidity is a simple mechanism that relies on three main components.
Endorsements are signatures on swap transactions that reflect a claim of non-toxicity. Endorsements are provided by
Segmenters that segment order flow based on its toxicity.Segmenters can be the frontend applications that originate the order flow.Those applications have the ability to detect signals as to whether users are human or bots. They can further employ
battle-hardened Web2 technology like authentication, Cloudflare, CORS, and other tools to mitigate spam users. If an
application does a good job of human detection, they are able to generate high-quality endorsements.Segmenters can also be third party entities that have bespoke knowledge and skill at segmenting toxic order flow.
These can be third parties that block informed taker orders, if they themselves are informed or have unique access to oracle information.Segmenters, like frontend applications, are economically incentivized to perform endorsements efficiently as they are able
to optionally monetize how much tighter the market quotes to them due to the non-toxic nature of their order flow.
DFlow Swap API allows wallets to monetize order flow by capturing the relative tightening of the market to their specific
order flow in the form of a dynamic platform fee.Wallets earn purely off the non-toxicity of their order flow, rather than through transaction-by-transaction MEV extraction,
which is harmful to the trader. In this example, DFlow Swap API allows the wallet to capture N - M basis points in revenue
if they choose to, with the default setting that allows the price improvement to remain with the trader.
The Segmenter Registry is a list of all segmenters that give out endorsements. The
Segmenter Registry is used to
track the performance of segmenters, and serve as a central point program for DEXs to discover segmenters.Frontend applications will be the primary source of endorsements, as they are the most likely to be able to detect
their own human users.
Today, DEXs broadcast a single spread that swappers must pay when trading. The magnitude of the spread is proportional
to the tolerance of adverse selection risk. The tighter the spread, the more order flow the DEX is asking for, and
the more risk-tolerant the DEX is. The wider the spread, the more risk-averse at the expense of volume of order flow executed.Different types of order flow have different probabilities of adversely selecting the DEX. Order flow that is more likely
to adversely select the DEX is known as toxic order flow, and order flow that is less likely to adversely select the DEX
is known as non-toxic order flow. Conditional liquidity simply allows DEXs to charge a gradient of spreads for different
types of order flow through introducing third party actors, known as segmenters.
DEXs can get started with the Conditional Liquidity framework today by using the
Solana Conditional Liquidity crate.