ARC-5: Upgrade bLUNA-LUNA Pool to Handle bLUNA Rewards

References

Summary

Upgrade the bLUNA-LUNA stableswap pool so that bLUNA rewards can be claimed by LPs.

Abstract

Add new functionality in the bLUNA-LUNA stableswap pool that allows LPs to claim bLUNA rewards pro-rata to the size of their LP position.

Motivation

As mentioned in this forum discussion, “if you hold bLUNA in your wallet, you earn about 8%-10% APR in UST every year, which has to be manually claimed on the Anchor website. If you supply your bLUNA to the bLUNA-LUNA LP in Astroport, that UST is sitting around unclaimed.”.

This proposal aims to solve the problem of having bLUNA rewards stuck in the Astroport pool. The new pool implementation linked in the sections below allows bLUNA-LUNA Astroport LPs to claim bLUNA rewards pro-rata to the size of their LP position. It is also worth noting that bLUNA-LUNA lockdrop participants as well as LPs that stake their bLUNA-LUNA LP tokens in the Generator contract will also be able to claim bLUNA rewards.

Lastly, bLUNA rewards that already accrued in the Astroport pool will become claimable once the bLUNA-LUNA pool is upgraded. A caveat is that only LPs that are in the pool at the moment of the upgrade will become eligible to claim the already accrued bLUNA rewards. While this is not ideal, it is still a better option than letting currently accrued rewards stay stuck in the Astroport pool.

Specification

Proposed Code

The proposed code for the bLUNA-LUNA stableswap where LPs can claim bLUNA rewards can be found here. Moreover, a new version of the lockdrop contract that will allow bLUNA-LUNA lockdrop participants to claim bLUNA rewards can be found here.

Test Cases

Test cases for the new bLUNA-LUNA pool implementation can be found here. Test cases for the new lockdrop contract version can be found here.

Security Considerations

The main risk associated with upgrading bLUNA-LUNA is the significant amount of funds that are currently in the pool and that may be stuck or drained in the case where the new pool implementation has a major bug. For this reason, the new bLUNA-LUNA implementation has to be thoroughly audited.

Another major risk is associated with upgrading the lockdrop contract so that bLUNA-LUNA lockdrop participants can also claim bLUNA rewards. A large portion of the Astroport TVL is currently held by lockdrop participants and a bug in the lockdrop contract can leave all these funds stuck in the protocol.

Auditor Information and Report

Audits for this new bLUNA-LUNA stableswap pool as well as for the latest lockdrop contract version are scheduled for the second half of March 2022.

Licensing

GNU General Public License v3.0

15 Likes

This upgrade would be a massive value-add to liquidity providers. But I fully agree with the need for thorough auditing.

3 Likes

As an LP I would welcome this upgrade and be most grateful, assuming it is safe for the protocol and the pool. Huge thanks to our developers and those involved! Nic.

I think this will be a great update, usefull for every LP holder and Astroport too

Fully agree with this proposal as well! It rightfully returns the $UST rewards to $bLUNA holders. Having such a feature will also give the community 1 more reason to provide liquidity to Astroport, for the $bLUNA-$LUNA pair.

lets put the yield back into the people who are directly contributing to the pool , positive feedback loops are positive :slight_smile:

1 Like

Sounds like a solid idea that can help put that UST into circulation as well!

Am all for it though the mechanism for distributing the accrued rewards might need a rethink - possible for a whale to come in right bsfor contract upgrade to take on a large share of the pool to reap the rewards, then exit the pool?

Apart from that, this makes LPing more desirable after accrued rewards have been distributed

Unfortunately currently accrued fees have to be distributed at the moment of the upgrade. Besides that, everything should be smooth sailing :sailboat:

Agree with proposal, however, can this be tested on a small part of the pool even after the audits?

Also, are the associated risks worth it?

I think we need the protocol to take a screenshot of the pool holders at some random point between now and when the upgrade gets implemented, and then base the bluna reward distribution off of that screenshot (preferably sooner rather than later). Otherwise, some whale can just deposit a ton of bluna in the pool right before the upgrade to claim all of the UST reward, then withdraw their liquidity right after.

Is there any way to build that into this upgrade? Otherwise, retroactively distributing the bLuna rewards doesn’t even seem worth it. The bulk of the rewards would just go to bad actors swooping in at the last second.

Unfortunately it’s not possible to build that snapshot capability. The snapshot will only be taken at the moment of the upgrade

The proposed upgrade, if it goes seamlessly, will clearly be a huge benefit to both the protocol and the braoder LUNA ecosystem.

However, the tail risks of this kind of massive change to the LP protocol will also be massive. I believe any upgrade of this sort must happen in a very careful and staged manner, where the risk of any issues does not overflow into the other Astroport pools

  1. I think first a new and separate bLUNA-LUNA pool needs to be made where bLUNA rewards are claimable by the LPs. This pool needs to run for some period of time in production with real liquidity to make sure there are no issues

  2. Only after the test pool is deployed successfully, then liquidity can be migrated over.

1 Like

Migrating liquidity is burdensome and it would delay the operation a lot, it’s not just a smart contract change in that case.

I agree the risk is massive and that’s why I will try and advocate that the Astroport community is careful and prioritizes safety over shipping tons of features.

What is the latest update with this proposal?

1 Like

It’s being audited at the moment, it will need a second audit afterwards though. It’s a big upgrade that has to be reviewed thoroughly

1 Like

Great idea. 100% Safety/security first. can it not be converted into Astro in the mean-time and then used to increased the APY on the LP Pair? that would stop others front running before a snapshot is used.

It can’t be converted because the pool contract does not have the needed logic. It’s best to wait for all audits to finalize and then for the other proposals to execute first before this one.

2 Likes

thanks for your speedy response Stefan.

1 Like

Hi, When will this be implemented? Is there something bluna-luna lp holders will need to do to claim these rewards? thanks.