# Understanding Liquidity Provision and Impermanent Loss

How eckoDEX creates benefits for Liquidity Providers, while working to reduce Impermanent Loss

### Impermanent Loss

The biggest risk associated with providing liquidity in decentralized finance is the infamous Impermanent Loss (IL) phenomenon. Impermanent loss is a cost of opportunity. It represents the difference between the value of the liquidity that a user gets back from a pool and the hypothetical value they would have, had they not invested in the pool, just holding the corresponding tokens instead.

As pools are constantly rebalanced by arbitrageurs to maintain the market prices of assets (in a profit seeking environment), the proportion of each asset in the pool changes alongside their prices. IL represents the opportunity cost incurred by this rebalancing, which is greater the more volatile an asset is. Therefore, providing liquidity is not a risk-free investment, as your initial liquidity will realistically never come back intact due to the risk of Impermanent Loss (IL).

An example will help translate concepts into practice:

Note: eckoDAO does not claim to completely prevent all impermanent loss associated with trading.

The LP inserts liquidity for `$250,000 – [t₀]`

The pool has the following metrics: •

KDA/kFRAX pool

`($2,500,000 in KDA/ $2,500,000 in kFRAX)`

KDA is priced at $5 - resulting in a total of

`500,000 KDA ($2,500,000/$5)`

If over a year, KDA price would reach

`$5.5`

`500,000 KDA would be worth $2,750,000`

The LP liquidity of

`$250,000`

is worth 5% in respect to the overall liquidity

Let’s see what happens when the LP removes his initial position `$250,000 - [t₁]`

Profit seeking, arbitrageurs sell approximately

`$6,398`

worth of KDA in exchange for`$6,101 kFRAX`

This equals

`(n°) 1,163.44 KDA`

When removing their capital, the LP will receive back

`$262,202 - $131,101`

in KDA and`$131,101 in kFRAX`

- plus accrued feesThe Impermanent Loss on his initial capital amounts to $297.79

`[(pkFRAX [t1] * qkFRAX [t1] + pKDA [t1] * qKDA [t1]) – (pkFRAX [t1] * qkFRAX [t0]) + (pKDA [t1] * qKDA [t0])] * [LP’s share of the pool (%)]`

Where

`p= price`

and`q=quantity`

The LP is facing Impermanent Loss for approximately

`0,11% (IL / (pkFRAX [t1] * qkFRAX [t0]) + (pKDA [t1] * qKDA [t0]))`

Now that we have also accounted for Impermanent Loss, we know that the net LPs rewards are:

`$45,625 (fees collected) - $297.79 (Impermanent Loss) = $45,327.21 (LP’s IL ac- counting for fees ($))`

`APRₗₚ = 17.38%`

### Minimizing Impermanent Loss through the eckoDEX Liquidity Mining Program

The KDX Liquidity Mining Program is designed to generate lucrative pool boosters for early LPs that will non-linearly decrease with time, as the volume grows to the point where they are no longer needed.

The KDX liquidity mining program is set to last no-less than 4 years

The Liquidity Mining Program generates extra rewards on top of the 0.25% from all swapping fees. Rewards are magnified by a multiplier if withdrawn in form of KDX.

You can collect your boosted rewards whenever you want

KDX rewards are vested for 8 days. This short vesting period helps ensuring there is no trading pair manipulation and helps preserving market stability.

eckoDAO will have total freedom in assigning the multiplier to their preferred pools, ensuring that eckoDEX’s rewards will be applied according to the community’s interests.

The implications of this program are very clear

**Impermanent Loss coverage:**By distributing rewards to LPs in form of KDX in addition to the 0.25% of the overall DEX trading fees volume.**Deepening Pools Liquidity:**By incentivizing users’ participation in providing liquidity.**Keeping the KDX vesting schedule predictable and providing long term sustainability:**As the rewards emission schedule of eckoDEX is programmatic and self-adjustingaccording to market conditions.

**KDX rewards waste management:**An algorithmic multiplier that fine tunes rewards accordingly to market conditions. Rewards will never be too low or too high.**Benefiting the Staking APR:**By distributing rewards in the form of KDX. The buying pressure increases leading to a higher trading volume and therefore a higher APR for KDX Governance Miners.

### The First Self Adjusting Liquidity Mining Tool

A self-adjusting multiplier that reacts to market conditions in an agile way is a major development for the world of DeFi. For launch, the variables for this multiplier need to be considered, to start, the algorithm will asses the following:

`Pool’s Diluted Volume(Volume/TVL)`

: This is what directly determines a pool APR, and itcan be interpreted as a measure of how much the LPs are earning per dollar invested. In general, smaller volume in respect a constant amount of TVL requires higher boosted rewards – while a higher volume would require less additional rewards.

`Volatility of Asset:`

This is usually taken as a measure of its associated risk. However, for two highly correlated assets, we observe that the impermanent loss tends to float at lower levels in opposition to uncorrelated tokens. This leads us to consider the price rate volatility instead. Considering a pool consisting of two tokens A and B with prices a and b, respectively, we want our multiplier to increase accordingly to the volatility of the price rate a:b. Accounting for volatility in the KDX multiplier function is the core of our IL solution and KDX rewards waste management practice.

Also to be considered is `Elapsed Time Since Launch.`

As time goes by, the KDX token will progressively become a scarcer resource and thus becoming harder to get high-end multipliers. How- ever, time also makes the pool more sensible to scenarios with low diluted volume and high volatility.

#### KDX Multiplier Mathematics

When setting the liquidity mining parameters, we have to make sure that the multiplier behaves between a predefined numerical domain. For this exact reason, we opted to profit from a mathematical concept called Convex Combinations. In doing so, we explicitly consider an upper-bound $u$ and a lower-bound $l$, such that:

Such approach allows us to choose a function $p | p(x,y) ∈ [0,1]$ for every x,y that works in the desired boundary $l≤m(x,u)≤y$.

#### Entering Real-World Variables

Having defined the multiplier boundaries, we are left with the task of setting `p`

- and needing it to be $p(x,y) ∈ [0,1]$ - it is natural for us to lean on functions which are commonly used to express probabilities. Looking back at the section above and recalling some well-known ’activation’ functions, we consider an S-shaped Sigmoid function defined as:

This simple attack to the multiplier dynamics satisfies are need of plugging exogenous variables – again, the assets volatility `(vol)`

, pool diluted volume `(dv)`

and elapsed time - to the first algo-booster seen in DeFi. Thus, we consider:

#### Defining the Beta Variable

Our next task is therefore to set the Beta variable. In order to achieve at the same time a guaranteed minimal amount of curvature and the multiplier variability at mid-levels, we set the β within the interval `[0.3, 0.7].`

In the figure below we can see how decreasing values for β linearly increase the multiplier, and on the other hand how increasing values for Beta contribute to the concentration of growth from the multiplier. Using the same technique presented above, we consider:

The Sigmoid curve behavior perfectly reflects our desired outcome. On one hand, the central value of the KDX multiplier is reduced, which consequently will decrease the overall KDX emission. On the other hand, the variation of β guarantees the slope at the central value to increase, which shows that the system will still be keen to help in case of high volatility and/or low volumes. Having in mind our programmatic inflationary policy, we adapted the KDX system to last at least for 4 years. A period in order to maintain a desired but programmatic inflation rate. Thus, we set:

By testing the mathematical iterations conducted on the multiplier to see its reaction when facing real-world scenarios, we estimated 30,000.00 possible pools scenarios by applying the (modified) Monte Carlo Brownian motion leveraging real data and parameters. In the Monte Carlo simulation, we considered three different pools: KDA/BTC, KDA/ETH, and KDA/kFRAX. As we can see in the graphic below

Last updated