HMM Mechanism
Dynamic Liquidity Concentration
In traditional orderbooks, capital naturally concentrates around the current price, driven by traders’ natural pursuit for efficiency and utilization. When it comes to DeFi, a similar liquidity depth distribution can be achieved through liquidity concentration. Liquidity is allocated within a specified price range that is most likely to be used by trades, so as to leverage limited capital size to achieve the maximum liquidity depth. Unlike the standard constant-product curve (x * y = k) used by common AMMs, which provides liquidity across the entire price spectrum from 0 to infinity, concentrated liquidity supplies capital within a specified range that is most likely to be used by trades. This can dramatically improve capital efficiency, leveraging limited capital size to achieve the maximum liquidity depth.
There are more than one method to achieve liquidity concentration, such as DLMM, which divides the price curve into different bins, and CLAMM, setting a large number of ticks on the price curve. The liquidity is then allocated into the bins or tick range near the central market price, which forms a non-linear relationship between price and liquidity. However, these approaches also have their drawbacks, like liquidity sometimes becomes rigid — when the price deviates from the expected central market price, effective liquidity quickly diminishes, resulting in increasing slippage.
To address this, we applied non-linear adjustments to the standard curve through an additional leverage factor, making the depth distribution of the price curve more aligned with the real market conditions, and also more flexible. By dynamically adjusting the leverage factor, we can flexibly balance where liquidity is concentrated, the proportion of assets in the pool, and the swap slippage.
Proactive pricing driven by oracles
As mentioned earlier, while concentrated liquidity achieved through CLAMM and DLMM can improve capital efficiency, the liquidity rigidity problem that comes with it does increase the risk of impermanent loss for LPs to a certain extent. To minimize the IL risk in HMM, we adopt oracles for the price feeding to liquidity usage.
Sui’s network characteristics naturally make it feasible and smooth for the high frequency oracle price feeding on Sui. This ensures that the oracle price feeds are highly responsive to the market price movement and closer to the real-time market fair price. From a trading perspective, applying liquidity with oracle-based prices can complement existing AMMs and orderbooks within the ecosystem, collectively optimizing the swap price and trading experience for Sui users.
For LPs of HMM, since the liquidity pool doesn’t rely on arbitragers for price adjustment, the impermanent loss will be minimized. In fact, impermanent loss can even be reversed into “impermanent profit” through the successful implementation of buying low and selling high. HMM will primarily use Pyth Network for the native price feeding, pulling data by a defined time interval (approximately every 0.25 seconds for now).
Inventory management strategy
From another perspective, HMM is also an inventory management strategy designed to maintain the simplicity of the classic constant product model, where the value of two assets in a pool always remains equal.
To maximize profits while sticking to the above characteristics, the protocol rebalances the pool through the liquidity replenishment. When the amount of one asset in the liquidity pool decreases, the HMM algorithm automatically adjusts the price of that asset, expecting to repurchase the missing inventory from the market. This liquidity adjustment happens with each transaction. For example, when the amount of asset A in a pool is less than asset B, HMM will reduce pool liquidity for buyers of A and increase pool liquidity for sellers of A to maintain balance. Essentially, it will add a temporary premium to asset A. This incentivizes traders to sell the lacking asset to the pool while preventing them from buying, ensuring the pool’s balance quickly returns to equilibrium status.
Last updated