We contributed to Lido DAO, P2P.org, =nil; Foundation, DRPC, Neutron and invested into 150+ projects
Asad Rakhmani and Artem Kotelskiy
Sep 16, 2025Disclaimer: cyber•Fund is investor in FLUID.
In our previous article, we examined Fluid's architecture and explained how Fluid’s Liquidity Layer and Vault (lending/borrowing) subprotocols function. This second article will focus on Fluid's DEX subprotocol, exploring its mechanics and the concepts of Smart Debt & Smart Collateral.
We will also examine the repercussions of the Fluid’s innovative architecture, and how they position Fluid as the most efficient DEX+Lending protocol in the DeFi ecosystem today.
Before examining the architectural innovations and design advantages of Fluid, it’s important to understand the fundamental mechanics & concepts of the Fluid DEX.
DEX v1-v2 context. Currently, Fluid is running DEXv1, which utilizes liquidity from Vault via Smart Debt and Smart Collateral features. However, the liquidity price range & rebalancing are controlled by governance, which effectively means that Fluid DEXv1 runs a trading strategy for liquidity providers (LPs). This approach proved suboptimal, causing LPs to realize losses upon rebalancing, as well as experience high loss-versus-rebalancing. DEXv2 addresses these issues by allowing users to:
Select customized price ranges;
Use multiple LP positions as collateral (cross-collateralization).
These improvements not only resolve the controversy surrounding DEXv1, but also create an open playground for LPs to develop their diverse strategies, which involve hedging part of the LP exposure — more on this later.
Before diving into specific details, it's helpful to understand how Fluid DEX works at a high level. All Fluid DEX liquidity is stored in the Liquidity Layer (as with every other Fluid subprotocol). Users who supply or borrow assets via “Smart Collateral”, “Smart Debt” or “Smart Lending” automatically provide liquidity to the DEX.
Smart Liquidity. All liquidity on the DEX comes from lending/borrowing protocols, via the feature called "Smart" Liquidity. Smart Liquidity (Smart Debt, Collateral, Lending) is a pair of tokens, not a single one — in other words, users that provide Smart Liquidity expose themselves to rebalancing within the token pair, in exchange for trading fees.
For swaps, Fluid DEX can use (1) supplied Smart Collateral (collateral pool) or (2) borrowed Smart Debt (debt pool), or (3) supplied Smart Lending (collateral pool).
(1) Smart Collateral works much like regular liquidity in DEXs: the user supplies a pair, say USDC-ETH, in some proportions, and as the price changes over time, the token proportions in the pool change. Importantly, LPs additionally earn supply yield from the lending market.
(2) Smart Debt is where Fluid's innovation shines. Users can borrow say USDC-USDT debt and use the borrowed assets however they want (swap to other tokens, deposit to different dApps, or anything else really). Meanwhile, this debt is utilized to perform swaps on the DEX. Because the debt provides liquidity to the DEX and earns trading fees, it reduces the borrowing APR — sometimes even making it negative.
So liquidity from Smart Debt does not require any TVL. Moreover, the TVL actually decreases with Smart Debt, since the user borrowing the assets. This is a groundbreaking innovation in capital efficiency, and we will explain exactly how this works in detail later in the article.
(3) Smart Lending works very much like smart collateral: users supply a pair of tokens and earn yield from both lending APR and trading fee. The difference with Smart Collateral is that Smart Lending does not allow users to borrow against the assets.
DEXv2 details. Fluid DEX v2 consists of 4 distinct types, each defined by two key characteristics:
Note that all implementations of Fluid DEX use concentrated liquidity, but in the 1st and 2nd types, users cannot select the price range in which to deploy their capital.
3rd and 4th DEX types allows users to select price ranges, in both Smart Collateral and Smart Debt. Dynamic fees can be also turned on there: The price range is split into three zones around the current price. In the near zone, you pay the min fee — the lowest fee the pool will ever charge. As your swap pushes the price away, the fee ramps up by price impact ÷ division factor: “price impact” — how much your trade moves the price; “division factor” — a parameter that smooths out this increase. If the move is large, the fee reaches the max fee (the cap) and won’t go higher.
Remark. The first version of Fluid, DEXv1, can be seen as a combination of the 1st and 2nd types of DEXv2, as it had a predefined price range.
Swaps. The swap mechanics are similar to other AMMs:
(1) In the collateral pool, the input amount of Xin is being deposited to the Liquidity Layer, and the output amount of Yout is being withdrawn from the Liquidity Layer and sent to the trader.
(2) In debt pool it works similarly: Xin is being repaid and Yout is being borrowed. Essentially, the debt pool functions as an “inverse” AMM. While from the implementation point of view it looks similar, it has different economic meanings and will be discussed in-depth below in our article.
As stated above, Smart Liquidity is used by DEX in Fluid to perform swaps — let’s understand it in more detail.
How does liquidity get to the DEX?
From a high-level point of view, assets reach DEX liquidity through lending subprotocols like Vault, Lending, or Money Market, and are stored at the Liquidity Layer. For example, if a user deposits 1ETH and 4000USDC as Smart Collateral, it goes to (1) Money Market → (2) DEX → (3) Liquidity Layer. Assets are held at the Liquidity Layer. LP position calculations happen in the DEX smart contracts. Smart Collateral is tracked in the Money Market smart contracts.
Money Market. In DEXv2, liquidity enters the DEX through a new subprotocol: Fluid Money Market. It functions similarly to AAVE, with rehypothecation of supplied positions (they can be borrowed, in addition to being used as collateral), cross-collateral borrowing, and a health factor to monitor positions that may need liquidation.
This allows users to create multiple Smart Debt positions from a single collateral source, as assets in the money market aren't isolated like they are in Fluid Vault subprotocol.
APR accounting. Smart Liquidity's lending/borrowing APR is calculated as Xamount∗APRX+Yamount∗APRY. The amounts of X and Y fluctuate as the DEX pool proportion changes, reflecting the open market price.
The second factor affecting APR is trading fees. For Smart Collateral and Smart Lending, trading fees increase the supplying APR, while for borrowing, they reduce the borrowing APR (sometimes making it negative).
After understanding DEX and Fluid design, let us fully appreciate the unlocks it gives to users and LPs.
Combining Lending/Borrowing & the DEX. The major advantage of Fluid is its inherently capital-efficient design. Users can generate multiple income streams — from lending on Fluid Vault & LPing on Fluid DEX — by placing their assets in just one protocol.
Moreover, due to Fluid's modular architecture, in the future we will see new subprotocols (perps, options, custom strategies, etc.) on top of Fluid’s Liquidity Layer, built by Fluid or other projects, creating additional yield opportunities
Pegged assets pools superiority. The above effect is particularly pronounced for pegged assets. Traditionally, DEX pools with pegged assets have lower fees (0.05%) compared to volatile pairs (0.3% — 1%), making it difficult to attract LPs. However, in Fluid, LPs have stronger incentives to provide liquidity to stable pools because:
(1) Smart Collateral/Lending positions earn additional lending APR.
(2) For Smart Debt: i. Users generally don’t care if their debt is in USDC or USDT, which makes the risk of providing stablecoin liquidity through Smart Debt close to 0; ii. Trading fees reduce the borrowing APR considerably, making providing stablecoin liquidity through Smart Debt a very attractive value proposition.
Together, these features make Fluid DEX a superior option for pegged assets LPs.
From the data perspective, there is a lot of factors contributing to the distribution of USDC-USDT volume (see below), such as the DEX fee cut, gas-optimizations, incentives, etc. Without going into those details, based on the raw economics design alone, Fluid’s solution is the best on the market, and is positioned to dominate the pegged asset swaps and FX market in the future.
https://dune.com/dknugo/fluid-dex
Complex DeFi strategies. Sophisticated DeFi users traditionally have to use multiple protocols (Pendle, AAVE, Uniswap, etc) in order to boost their earnings & mitigate their risks.
In more detail, LPs earn fees by supplying token pairs to AMM pools, but are exposed to a pair of tokens instead of one, as well as potential impermanent loss if price changes. Without hedging, the risk profile of LPing on AMM is hard to manage. As such, LPs often hedge by short/long positions on one of the assets, with rebalances upon price movements. For example, LPing ETH/USDC & then also managing an appropriate ETH long position is a typical strategy that aims to “multiply ETH” — in other words, this strategy may lose in $ terms, but is designed to only increase ETH amount. An “opposite” USDC-denominated strategy can be designed by shorting ETH.
The groundbreaking innovation of Fluid DEXv2 allows for seamless managing of such complicated DeFi strategies, all on Fluid.
Risk Management. While Fluid offers multiple yield streams through a single deposit, proper risk management remains essential. Here's how risks are mitigated:
User-defined risk parameters: users maintain control by choosing which subprotocols to participate in (e.g., only depositing assets for the lending market without DEX exposure)
Protocol-level safeguards: each subprotocol has specific withdrawal and borrowing limits from the Liquidity Layer, protecting Fluid from black swan events.
Governance oversight: before any new subprotocol joins the Fluid ecosystem, it undergoes rigorous technical and economic audits overseen by governance.
This multi-layered approach to risk management ensures that capital efficiency doesn't come at the expense of security.
One of the most significant innovations of Fluid's architecture is seeding DEX liquidity through Smart Debt. It transforms debt into a productive asset, something Fluid pioneered. To fully appreciate this breakthrough, let's explore it further.
When a user borrows through Smart Debt, say a pair of USDC-USDT tokens, they can do whatever they want with these borrowed assets — swap them, deposit them into another protocol, etc. The DEX pool accounts for this as a pair of tokens according to the current proportion in the pool (e.g., 100 USDC / 200 USDT). Each token has its own borrowing APR rate (4% for USDC and 6% for USDT), so the debt accrues for USDC at 4% and for USDT at 6% in those amounts that are now accounted for in the DEX and will change in proportion during swaps. Importantly, trading fees are repaid to the borrower, reducing the overall net APR — bringing it down to as low as 2.5%.
Below is a clear comparison of two scenarios where a user borrows assets & accrues trading fees: one is through Smart Debt on Fluid, and the other is using a classical lending protocol (like AAVE) with subsequent deposits into an AMM (like Uniswap).
To sum up, Smart Debt is Fluid's most groundbreaking innovation because borrowers retain complete freedom to use their borrowed assets however they choose, all while accruing trading fees.
Smart Collateral similarly provides significant benefits for liquidity providers compared to traditional approaches. Below we compare providing liquidity via Smart Collateral to providing liquidity on a DEX and then subsequently depositing the LP position into a specific lending protocol (that must accept those LP positions).
DeFi has never seen DEX LP positions that are borrowable and hence can earn lending APR. Fluid is changing this, by making rehypothecation (using assets in multiple ways) as seamless and frictionless as possible.
Leverage. Smart Debt enables leverage users to earn DEX yield not only on their collateral position, but also on their leveraged debt position. A flow example could be: deposit Smart Collateral → borrow Smart Debt → Swap and deposit Smart Collateral. This gives exposure from collateral + debt + collateral, and can be repeated n times, earning yield on both collateral and debt sides.
This shows how Fluid offers superior efficiency from the leverage perspective.
Traditional lending protocols face a critical vulnerability during market stresses — the risk of liquidity crunch. Some protocols like Morpho avoid this problem by disallowing rehypothecation, but this reduces capital efficiency. Fluid elegantly solves it through its integrated architecture:
This demonstrates how Fluid's design creates a balanced ecosystem where DEX and the lending market complement each other. When one component faces stress, the other naturally helps alleviate it.
As a result, Fluid's DEX & Lending subprotocols function as a self-regulating cybernetic system, enhancing capital efficiency while maintaining robust safety mechanisms during market volatility.
We finish the article by covering a bit more details about Fluid DEX. While the design space of Fluid DEXv2 is vast and supports all types off AMM, upon the launch the initial AMM will follow the Uniswap V3 design. Here we briefly cover the key points, deferring for details to the original paper.
An AMM pool stores a pair of tokens X & Y, whose precise amounts follow the formula x⋅y=k, where x represents the amount of token X and y represents the amount of token Y in the pool. The price in this pool is defined as y/x, because it is equal to the derivative y’(x) — the marginal amount of Y tokens received for one X token.
Remark. The formula x⋅y=k can be easily deduced backwards from the differential equation y’(x)=−y/x:
Swaps. During every swap with an input amount Δx, the output amount Δy is such that the constant k is preserved:
Liquidity provisioning. Every time liquidity is added to / withdrawn from the pool, the constant k is increased/decreased, and the pool’s curve changes accordingly.
After Uniswap v3 introduced concentrated liquidity, it became a standard for DEXs. Excellent complete explanation can be found here; briefly, the concentration of liquidity is placing liquidity not on the whole AMM curve, but between the selected price ranges. As a result, the AMM curve becomes a piece-wise continuous function.
Virtual and Real reserves. An important concept to keep in mind to understand AMM formulas is real and virtual reserves.
Virtual reserves are the x & y coordinates of pool position on the hyperbola xy=k: they are used to calculate the swaps. Real reserves are the actual reserves stored in the DEX pool — see the left picture above, where pool position is concentrated between price points b & a, while the current price is c. The picture on the right demonstrates that there is a curve for real reserves as well, easily calculated and obtained by the translation — however that curve is less useful, since price & swaps cannot be calculated on that curve.
Ticks. Another important implementation detail is the concept of ticks. You can find an excellent explanation of ticks here; briefly, ticks are integer-indexed price levels that divide the continuous price curve into logarithmically-evenly spaced steps. Each tick corresponds to a specific price; liquidity can be provided between any two ticks, market making only while price remains between the two ticks. As trades move the price across ticks, the contract updates which positions are active and settles fees/liquidity accordingly, making it cost-effective to track everything onchain. Below we give an example of a liquidity pool concentrated between 7 ticks and its virtual piece-wise linear AMM curve; real reserves in this case are:
Note that even though we have 6 continuous pieces on the virtual curve, it doesn’t meat that there are 6 open positions: there could be a hundred of positions that all yield this curve — they just all need to be between the 7 ticks drawn above.
Liquidity providing. To provide liquidity, LP chooses the boundary ticks between which they want to concentrate their position (could be outside the current price), as well as the liquidity they want to provide (real reserves). This information is sufficient to calculate how the AMM virtual curve needs to change across those ticks.
Swaps. To calculate the swap, the pool simply uses the piece-wise linear virtual AMM curve it stores — in practice it is done by iterating over a while loop that goes over all ticks until the swap’s input is depleted:
Across this two-part series, we showed how Fluid’s Liquidity Layer unifies capital for every subprotocol, reviewed the Vault (lending/borrowing) subprotocol, and how Smart Collateral, Smart Debt, and Smart Lending route the capital through the lending protocols into Fluid DEX.
We also covered why this architecture matters in practice: multiple yield streams from one position, negative or reduced borrow APR via Smart Debt, superior economics for pegged pairs, and built-in protection against liquidity crunches thanks to the tight coupling between the DEX and lending subprotocols.
Fluid is executing on the most compelling DEX + Lending design in DeFi right now. It aligns incentives for LPs, traders, and borrowers and turns idle balance-sheet items into active producers of yield. The result is a cybernetic system that is vastly more capital-efficient by design, safer under stress, and more flexible for strategy builders.
Thank you to DMH for helpful discussions & feedback, and to the whole Fluid team for sharing the codebase of DEXv2 and pushing the space forward. We are genuinely excited by this pace of innovation, and we are eager to see the next wave of subprotocols built on top of Fluid!