Migrate POL from v2.1 to v3

Continuing the discussion from Proposal: Move v2.1 liquidity to v3:

Data Insights on v2.1 → v3 Migrations

Part 4: Migrating TKN In-Excess of IL-adjusted Staked Balance - Capped by Protocol-Owned Liquidity

Q: Can we migrate all protocol-owned liquidity that is not owed to v2 stakers - after considering position-specific IL - to assist with the v3 deficit?

TLDR - Since v2 positions are exposed to impermanent loss, the amount owing to v2 stakers is the current staked balance minus the IL-incurred on a position-wise basis (the IL-adjusted staked balance). Any TKN in the vault above this amount, if protocol-owned, could be migrated to v3 to assist with the deficit. Importantly, this method does not touch user funds.

Applicable Pools

  • Has some Protocol-Owned Liquidity (POL)
  • Has a current v3 pool
  • Would have a positive v2 vault balance post-migration

Setup

User Stakes and IL-adjusted stake balance

  1. Get current stakes on v2 (includes the rate - price - at which the TKN was deposited)
  2. Get the current rate (price of the TKN) and evaluate the IL-incurred per position (%)
  3. Multiply the IL by the user stake to get the IL-incurred and subtract from the user stake to get the IL-adjusted stake balance.

Protocol-Owned Liquidity

  1. Get the number of pool tokens owned by the protocol for each pool
  2. Get the total pool tokens owned by users
  3. Evaluate the POL% and multiply by the current vault balances (TKN and BNT)

POL Capped Migration

  1. For applicable pools, the amount to migrate is the the v2 vault balance minus the IL-adjusted stake balance to a maximum of the POL TKN amount

Data

Analysis Block: 15542900
Total Pools Analyzed: 348

V2 Pools with POL: 100
Total Value of v2 TKN POL: $11.1M

V2 Pools with User Stakes: 126
Applicable pools (as above): 51
Pools with Positive Migration Amount: 42
Total Value of Amount to Migrate Capped by POL: $8.9M
Associated POL BNT (could be burned): $10.3M (21.9M BNT)

Of the $8.9M in TKN to migrate, $3.7M of this is in LINK. Once migrated to v3, this will improve the v3 deficit by around 17%.


Figure 1. Proposed value of TKN to migrate per pool. The value of protocol-owned liquidity to be migrated is shown in block colors while the total value in excess of user stakes is shown outlined. Y-axis on log scale.


Figure 2. Current v3 surplus per pool (red).


Figure 3. Current v3 surplus per pool (red) overlaid with the v3 surplus post-migration (green). Y-axis truncated at (-1,1).


Figure 4. Current v3 surplus per pool (red) overlaid with the v3 surplus post-migration (green).

Conclusion

Alleviating the deficit on v3 is a top priority, however, identifying a fair and impactful way to do so is difficult. Migrating TKN POL liquidity without touching v2 user funds is a morally-sound method for addressing the v3 deficit. Additionally, a significant amount of associated POL BNT on v2 could be burned which assists with the protocol-wide deficit.

Data Set: 20220915 - v2_ILadjusted_migrations_POLcapped - Google Sheets

Note: While this value was calculated for every token on v2, it is applicable to only those with protocol-owned liquidity, a positive v2 vault balance post-IL migration and a current v3 pool.

6 Likes

If I follow everything correctly, I think you’re right in that this is the most fair and impactful way to address this situation. Plus burning 21 million BNT may quietly be the most impactful mechanic of this whole proposal, and in a big way. Thanks for putting all of this thought and effort together @NIX!

2 Likes

Thank you @NIX for the extensive analysis you provide here and in https://gov.bancor.network/t/proposal-move-v2-1-liquidity-to-v3/! It gives me hope that the team is indeed working on resolving the issue.

I am still a bit skeptical of forcing IL on v2 LPs, but this discussion has been going on forever and your proposed migration seems to be the best solution we have.

Are there any numbers of the possible effect of burning 21 million BNT?

Also, would we reenable v2 withdrawals after the IL-adjusted migration has happened?

2 Likes

I’m tired of seeing phrases like “fair” when it comes to resolving the deficit. there was nothing fair or moral about people in v2 liquidity mining to the point where it destroyed people in v3. theres nothing fair or moral about those who defended liquidity mining now trying to avoid any loss when people lost half of their savings. The fair and moral thing to do is just merge it all back in and get things back on track. People in v3 didn’t get 3 months of debate on the best way for ILP to be turned off.

1 Like

Great analysis and appreciate the work on this! I will need some time to look through the data but one question immediately came to mind:

Looking through the dataset and the v2.1 LINK pool will have a 18.8% deficit in aggregate based on the “v2_postMigration_IL_surplus_perc”. So in aggregate the LP providers in the pool should only lose 18.8% post-migration, after withdrawals are reopen? This covers both true impermanent loss and the re-balancing portion of deposits like the deficit in v3 is calculated?

1 Like

It looks like the conversation is coalescing around option 4 - when can this be put to vote?

1 Like

this is a strong proposal. very resourceful. it takes immediate advantage of available POL and helps to address some of the v3 deficits. would like to see more support for actioning what is recommended above and see this proposal put to vote this coming wknd. thank you.

For all pools, the process takes the following details -

  • for each position, calculate the value minus the specific position IL only
  • summarize the total value based on the above - this is the value that the pool should keep so that it can accomodate for all LP withdrawals minus their respective IL
  • take the amount that should be migrated and cap it by the protocol owned pool token value
  • migrate that result
  • edge case: if a pool has 0 LPs, migrate everything

It also requires a process to look into the protocol periodically and potentially migrate more, once LPs withdraw.

In order to make this work, a cool down should be added between the liquidity migration and the time direct v2.1 withdrawals are opened again - maybe something like 2 weeks?
And migrations from v2.1 to v3 will also need to be disabled.

Also, it requires updating the withdrawal logic before withdrawals are opened - something that I believe can be done during that cooldown.

Let me know what you think.

1 Like

Hi yudi,
Sounds very reasonable to me! Just two things I don’t understand:

  • we would look into the protocol periodically because of IL that occurs after the migration has been done, correct? So that the IL that v2.1 suffers can periodically be migrated to v3?
  • what would the benefit of a cool down for v2.1 withdraws be ?

Thanks

Hey,

  1. Yes - with time, parameters change - IL, how much the protocol has etc. Also in some pools LPs are going to remove all liquidity with time and the pool might still have some liquidity in it. So that can be used with time to reduce the deficit in v3 further.
  2. I forgot to add that migrations will need to be disabled completely before the change. That plus the cooldown is a way to prevent v2.1 LPs choosing whether to withdraw from v2.1 directly or migrate to v3 + withdraw based on what is the better deal at that moment, so LPs will need to choose beforehand.
    It also means that there should be some time after this plan is announced before the change, to give LPs some time to decide.

Are there any questions that are outstanding at this point? Can someone explain when this will be ready for a vote?

1 Like

The main discussion is here -

What needs to happen now to put this to a vote? It seems like this has sat here for a long time now. Does the original proposer need push it forward?

1 Like

So if the incurred IL is greater than the v2 vault balance, the IL is just forgotten and v2 users can withdraw their LP without any IL? I hope I’m misunderstanding something because this wouldn’t make any sense…

Hey Ethweb. Something was misunderstood. There is no way to withdraw without incurring IL.

So can you (or @NIX ) explain why e.g. the USDT v2 vault is just ignored in this proposal? The vault balance is 677k, the IL is -868k. To me, it would be logical to just migrate the 677k to v3.
But if instead no migration is planned on this vault, which to me sounds like the 677k will remain in v2 and can then be withdrawn (once withdrawals are enabled)?

anyone? @NIX @Here2DeFi

Important update regarding Proposal: Migrate V2.1 Surplus and Open Withdrawals

Data regarding the amount of POL being migrated from v2.1 to v3 and its expected effect on the deficit is still being generated. This information will be posted below once it is available.

New code is being implemented, and additional testing time is necessary. Ensuring the overall security of the protocol and the funds within it remains a top priority.

Phase 2: Permanently stop migrations to v3 is being delayed due to the above.

Further updates will be shared with the DAO/Community as soon as they are available.

2 Likes

Hi guys,
Here is an update on the status of the pools ready for migration.
As at block 16023933 there are 37 pools that will migrate protocol-owned liquidity (POL) from v2.1 to v3 in order to assist with the v3 deficit. At this time, the total value of the migration is approximately $5.8M. The status of each pool and the approximate migration amount is shown in the attached data:

Note that the values vary block to block as fees accumulate and impermanent loss is incurred based on the current rates.

This is a continuous process so periodically additional POL will be migrated.

Just a reminder that for a pool to be eligible it must have protocol owned pool tokens to migrate and have a v3 pool (i.e. a non-zero v3 staked balance).

The migration amount is capped by both; a) the amount of POL for that pool and, b) the current token balance minus the current obligation to v2 stakers. Where obligation refers to the sum of all user positions based on the calculation defined in the proposal: Migrate POL from v2.1 to v3 - #7 by dirtyfrenchman

3 Likes

:rotating_light: Important Update:

Phase 3: Move v2.1 POL Surplus of Proposal: Migrate V2.1 Surplus and Open Withdrawals has begun. Immediately following the migration of protocol owned liquidity from v2.1 to v3, Phase 4: Reopen v2.1 Withdrawals will begin.