Liquidity Provider

Functions

  • setPriceBounds: Sets the AMM position's square-root upper and lower price bounds.

  • depositLiquidity: Sovereign LM function to deposit reserves into the pool.

  • withdrawLiquidity: Sovereign LM function to withdraw reserves from the pool.

  • Implementation of specific functions in the liquidity provider contract.

Security Model

  1. The liquidity provider contract has complete control over depositing, withdrawing, and managing user funds in the HOT. The HOT assumes that all deposited funds belong to a single liquidity provider controlled by the liquidityProvider address. Individual LPs should ensure that this contract is well-audited, and cannot maliciously drain user funds.

  2. As the Liquidity Provider is a critical role with complete control over user funds, it is set as an immutable address at the time of deployment.

  3. The Liquidity Provider is expected to have a safe rebalance function, which can manually rebalance the pool in case the reserve composition gets too skewed into one of the tokens.

  4. The Liquidity Provider can optionally have a short Timelock before calling the setPriceBounds function.

Trust Assumptions

Except for the common trust assumptions around deposits and withdrawals, the liquidity provider should ensure that:

  1. The price bounds are set appropriately so that the liquidity is concentrated to achieve the ideal balance between capital efficiency and the lowest possible inventory risk.

  2. Highly concentrated liquidity can increase the losses from AMM swaps, as described in the malicious signer attack vector.

  3. Liquidity Providers should implement a Timelock before calling thesetPriceBounds function in the HOT. Without proper Timelocks, malicious price-bound attacks could become possible.

  4. setPriceBounds is called with the proper checks so that attacks similar to the Deposit Sandwich Attack are not possible. Simply setting the _expectedSqrtSpotPriceLowerX96 and _expectedSqrtSpotPriceUpperX96 correctly while making the call should be enough to prevent the attack.

Last updated