LP Protocol Functions
PoolLiquidityManager Functions for LPs
Liquidity Management
Purpose: Add liquidity to the pool
Parameters:
amount
: Amount of liquidity to add
Note: Creates a pending request that will be processed in the next cycle
Purpose: Request to reduce liquidity from the pool
Parameters:
amount
: Amount of liquidity to reduce
Note: Creates a pending request that will be processed in the next cycle
Collateral Management
Purpose: Add additional collateral to an LP position
Parameters:
lp
: Address of the LP receiving the collateralamount
: Amount of collateral to add
Purpose: Withdraw excess collateral if above the minimum requirement
Parameters:
amount
: Amount of collateral to reduce
Note: Will fail if trying to withdraw below the required collateral ratio
Interest Claims
Purpose: Claim accrued interest earned by providing liquidity
Note: Can be called anytime interest has accrued to the LP
Emergency Functions
Purpose: Emergency exit when the pool is halted
Note: Can only be used when the pool is in a halted state
PoolCycleManager Functions for LPs
Rebalancing Operations
Purpose: Perform rebalancing at the end of a cycle
Parameters:
lp
: Address of the LP performing the rebalancerebalancePrice
: Price at which to execute the rebalance
Note: Must be called during the POOL_REBALANCING_ONCHAIN state
Purpose: Calculate how much an LP needs to deposit or will receive during rebalancing
Parameters:
lp
: Address of the LPrebalancePrice
: Price at which to calculate the rebalance
Returns:
rebalanceAmount
: Amount the LP needs to deposit or will receiveisDeposit
: True if LP needs to deposit, false if LP will receive funds
Purpose: Get the LP's current share of the asset tokens in the pool
Parameters:
lp
: Address of the LP
Returns: The LP's proportional share of the asset supply
Note: Based on the LP's current liquidity commitment relative to total liquidity
Purpose: Calculate the LP's projected asset share after the current cycle completes
Parameters:
lp
: Address of the LPexpectedRebalancePrice
: The price at which rebalancing is expected to occur
Returns: The LP's projected share of the asset supply after the cycle
Note: Takes into account pending requests that will be processed in the current cycle
Purpose: Get detailed information about an LP's position
Parameters:
lp
: Address of the LP
Returns: LP's liquidity commitment, collateral, and accrued interest
Cycle Management (Anyone can call these functions)
Protocol operators manage the cycle transitions in the protocol.
Purpose: Start the offchain rebalancing phase
Note: Can only be called when the pool is active and the market is open
Purpose: Start the onchain rebalancing phase after offchain rebalancing
Note: Can only be called when the pool is in offchain rebalancing and the market is closed
Purpose: Rebalance an LP that hasn't self-rebalanced before the window expires
Parameters:
lp
: Address of the LP to rebalance
Note: Anyone can call this after the rebalance window expires
Purpose: Force rebalance an LP when the halt threshold is reached
Parameters:
lp
: Address of the LP to force rebalance
Note: Can only be called when the halt threshold is reached
Last updated