5. Effective Price Calculation
The Effective Price is the future spot price of a token in a liquidity pool after a transaction has occurred. It reflects the price of the traded token in terms of the anchor token, accounting for the change in token volumes and weights in the pool resulting from the transaction. This price is used to indicate the new market rate for subsequent trades once the pool has adjusted to the most recent transaction.
The Effective Price is NOT the current price or the price applied to the ongoing transaction. This price reflects the effect of the current transaction on the liquidity pool, showing how the pool's token volumes and weights have adjusted post-trade. Traders should not confuse the effective price with the rate they are paying during the swap; it is an indication of the price after the swap, used for understanding how the transaction will affect future trades.
5.1. Mathematical Foundations
The effective price is influenced by the token volume in the pool. Each transaction by Project Backers, where a TokenTraded is exchanged for a TokenAnchor, drives up the price of the TokenTraded. As a result, the effective price is highly sensitive to ongoing trading activity within the pool.
5.1.1 Standard Formula
EffectivePriceTradedβ=(VolumeTradedββTokenTradedOutputβVolumeAnchorβ+TokenAnchorInputββ)ΓWeightAnchorβWeightTradedββ
Where
EffectivePriceTradedβ : Effective price of TokenTradedβ in terms of TokenAnchorβ.
TokenTradedOutputβ : Amount of TokenTradedβ being received from the pool.
TokenAnchorInputβ : Amount of TokenAnchorβ being input into the pool.
VolumeTradedββ : Current volume of TokenTradedβ in the pool before the transaction.
VolumeAnchorββ : Current volume of TokenAnchorβ in the pool before the transaction.
WeightTradedββ : Current weight of TokenTradedβ in the pool.
WeightAnchorββ : Current weight of TokenAnchor in the pool.
This formula provides the real-time price at which TokenTradedβ can be bought or sold in terms of TokenAnchorβ immediately after the transaction.
After each transaction, the LBP system recalculates the effective price using the most recent data on token volumes and weights. This ensures that the price reflects the current market conditions, providing transparency and fairness in trading.
The effective price calculation assumes that the trade size ΞQ is small relative to the pool's total liquidity (V). As ΞQ approaches a significant fraction of the pool's liquidity, the ratio VΞQβ becomes larger, and the effective price can deviate substantially from the spot price, leading to a non-linear increase in slippage and a corresponding reduction in the effective price.
5.1.2 Alternative Formula
Alternatively, the effective price of TokenTradedβ can be calculated by considering the ratio v of TokenAnchorInputβ to VolumeAnchorβ. This highlights the exponential nature of the function, which is influenced by the ratio of weights w.
EffectivePriceTradedβ=wvΓ(1+n)1+wβ
Where
n : Ratio of TokenAnchorInputβ to VolumeAnchorβ = VolumeAnchorβTokenAnchorInputββ
w : Ratio of WeightAnchorβ to WeightTradedβ = WeightTradedβWeightAnchorββ
v : Ratio of VolumeAnchorβ to VolumeTradedβ = VolumeTradedβVolumeAnchorββ
Due to the exponential relationship between effective price and the ratio n, the range of possible maximum effective prices for a typical LBP can be illustrated as follows:

5.2. Slippage and Its Impact on Effective Price
In an LBP, slippage is influenced by several factors, including the size of the trade relative to the pool's liquidity, the current token weights, and the dynamic adjustment of these weights. Larger trades tend to cause more significant changes in the pool's balance, leading to higher slippage.
A positive slippage value indicates that the trader received less of the output token than expected (or paid more for the input token).
5.2.1 Standard Formula
Slippage can be calculated as the percentage difference between the SpotPrice (the price before the trade) and the EffectivePrice (the price after the trade):
Slippage=(SpotPriceEffectivePriceβSpotPriceβ)Γ100
5.2.2 Alternative Formula
Alternatively, slippage can be calculated by considering the ratio v of TokenAnchorInputβ to VolumeAnchorβ . This emphasizes the exponential nature of the function, which is influenced by the ratio of weights w. This also highlights that higher liquidity (larger VolumeAnchorβ) reduces the impact of individual trades on price, thereby minimizing slippage and contributing to the overall stability and fairness of the LBP.
Slippage=((1+n)(1+w)β1)Γ100
Where
n : Ratio of TokenAnchorInputβ to VolumeAnchorβ = VolumeAnchorβTokenAnchorInputββ
w : Ratio of WeightAnchorβ to WeightTradedβ = WeightTradedβWeightAnchorββ
Due to the exponential relationship between slippage and the ratio n, the range of possible maximum slippage can be expressed as follows:

Last updated