Liquidity Providing
Similar to those in xyk automated market makers (AMMs), external capital can be provided to enhance the liquidity of an IBC. Liquidity providers (LPs), entities that perform the act of providing liquidity, provide additional reserve assets to an IBC. The provided reserve assets are then utilized by the IBC to facilitate the minting and burning of ibAssets.
Providing liquidity on the IBC functions in a way such that the liquidity utilization value of the curve remains the same at 0.5 both before and after the liquidity add. The addition or removal of liquidity updates both the minted ibAsset supply and curve invariant values - however, the current spot price (as well as the liquidity utilization) remains unchanged.
The added liquidity triggers the current slope of IBCs to be updated - in a way that greater market depth is given to those to mints and burns of the same size. Minting a certain supply of ibAssets after an LP thus requires more reserve assets than prior to the LP. Similiarly, burning a specific number of ibAssets after an LP returns less reserve assets than before the LP, showing the exact opposite behavior of adding liquidity on a regular xyk AMM.
LP Positions
Providers of liquidity are given freshly created LP positions, which contain information about the user's share of provided liquidity and its related values. An LP position entails the following data:
LP Token Amount: represents the LP's pro-rata share of total curve reserves.
ibAsset Credit: represents the amount of ibAssets that are considered to be "owned" (but not yet available) by the LP.
Reward Index: used for computing the LP rewards of the position.
LP positions on IBCs have differing characteristics with the widely known LP tokens of xyk AMMs, the major differences being:
Only Reserve Assets Required: Only reserve assets are needed when adding liquidity.
Not a Token: LP positions are not tokenized but instead just recorded state values per LP.
Non-fungible: LP positions are not fungible LP positions due to the existence of ibAsset credit.
Non-transferrable: LP positions are not transferrable to a different account.
One Position Per Account: there can only exist one LP position per LP.
Opened / Closed in Full: positions cannot be modified and must be opened or closed in full.
Restricted Withdrawals: LPs may be required to post additional ibAssets to remove positions.
Non-compounding rewards: rewards distributed to LP positions do not auto-compound.
LP Token Amount
Rewritten using the liquidity utilization value, this becomes:
It can be seen that similar to LP tokens of a regular xyk AMM, the amount of withdrawable liquidity of a position is a simple pro-rata value of the curve's total reserves.
An LP's LP token amount is also used as the basis for distributing rewards to LPs. This distribution is made prorated to the LP token amount of the position.
ibAsset Credit
To retain the same liquidity utilization value pre and post LP, as reserve assets are added the ibAsset supply must also increase via minting. This amount increase is not made readily available to the LP but instead "virtually" minted (token supply increases without an actual mint), although the virtually minted amount is considered to be under the ownership of the LP and thus "credited" to its LP position. This credited amount is later made for use when removing liquidity.
Reward Index
The reward index of a position is used to track how much LP rewards the position has available for claim. Two reward indexes exist, one a global value and the other a user-specific value. The global index value is updated every time the rewards are distributed to all relevant users, tracking the amount of rewards distributed per LP token amount since protocol genesis.
During a reward claim, the accrued reward amount of an LP is calculated as:
After which the user-specific index updates to the current global index value.
Adding Liquidity
The addition of reserve liquidity first introduces an increase in the curve's reserves. This, combined with the need to retain the liquidity utilization as a constant value tells that the addition of liquidity must cause an increase in the minted ibAsset supply. This supply increase is not made available to the LP right away, but instead minted virtually. The virtually minted supply however is "credited" to the LP, later made available at the time of LP removal.
Since the LP's action does not incur a change in spot price, the supply increase gives out as:
The curve subsequently updates to:
Showing this in graph format looks like the below.
Where the red curve representing the IBC prior to the LP addition and the blue curve corresponding to the curve after adding liquidity. As seen on the graph, the increased market depth requires users to spend more reserve assets per ibAsset minted and retrieve less reserve assets per ibAsset burnt.
Removing Liquidity
Similar to when liquidity is added, the removal of liquidity should lead to the decrease in the minted ibAsset supply in order to preserve the utilization as a constant. This amount of supply decrease (named as the LP's ibAsset debt) is dependent on the curve's state at the time of liquidity removal, and thus its value may be different from the amount of ibAsset credit that the LP has.
If the ibAsset debt amount is greater than the LP's ibAsset credit, then the curve requires LPs to post additional ibAsset tokens to cover the difference. Once the tokens are received, the debt amount is burnt and removed from supply. The debt amount may also be lesser than the LP's credit. In this scenario the debt amount is burnt, and the remaining ibAsset credit is transferred to the LP.
After which the curve updates to:
Showing this in graph format looks like the below.
With the red curve showing the IBC prior to LP withdrawal and the blue curve being the IBC post-withdrawal. The new curve shows decreased market depth, with less reserve assets required to mint the same amount of ibAssets, and more reserve assets returned per ibAsset burnt.
LP Value
The value of a LP position changes as ibAssets are minted and burnt. Mints and burns increase and decrease the reserve balance, thus causing the differing value. In contrast to a LP position of a regular xyk AMM (e.g. Uniswap V2), LP positions of IBCs increase in value as price deviations occur.
A LP position's value can be said to be of the value of withdrawable reserves plus / minus any differences of the position's debt and credit:
Last updated