-
Notifications
You must be signed in to change notification settings - Fork 618
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Applying the x/farm
logic to x/gamm
module
#31
Comments
Question: Why not just add SwapFees into the pool, rather than distributed as rewards? This way we don't need F1 or anything like that. Just need to keep track of LP tokens and total shares. This works as long as the token being distributed is part of the pool (which SwapFee tokens should be). The place where this is a problem is when the token to be distributed (such as OSM liquidity rewards) is different to what's in the pools. But I think for this, we don't need to have a continuous distribution. That can be done in an epochized way, where it iterates over all recipients, but only like once a day or week or something. I think this will remove a lot of this complexity |
Currently Balancer & Uniswap only calculate and distribute the fee upon withdrawal according to the portion of shares owned. The issue I see is that if I had 100 ATOM worth of fees to receive, and if someone deposits the same amount of liquidity right before I withdraw my swap fee gets cut in half even though I have been providing liquidity for longer. However, I guess since this isn’t seen as a major issue on the Ethereum AMMs this may not be as big of an issue as I am thinking. And like you’ve mentioned, the exit fee is paid in the share tokens which isn’t supported in the current implementation. However, since it seems like Balancer, even though has the exit fee but is fixed to a 0% value–so I’m okay with not prioritizing implementation for the exit fee. |
But they would be getting less share tokens. Because as fees accumulate in the pool, then the ratio between liquidity:shares is increasing. They'd have to add more liquidity to get the same amount shares tokens as you.
So it seems the simplest solution would be to fix this, right? |
Closing this due to switch to using |
I was hoping to apply the
x/farm
module to thex/gamm
module as well. Currently, thex/gamm
fee distribution mechanism accumulates the swap fees then gives the fee to the user upon claiming in proportion to the shares owned, so technically an LP who deposited later has some advantages if other users don’t claim their portion of the rewards as often. Therefore, I believe the F1 fee distribution mechanism is more reasonable so we should apply to thex/gamm
module as well. Also, since there is no way to distribute the exit fee and the F1 distribution module will allow this as well.However, this brings up another issue since each LP tokens have a different amount of fee reward accumulated, so unlocked LP tokens are technically not fungible with each other unless there is additional logic to stake the shares. Perhaps staking the share token upon minting by default could solve this. But the bigger issue that I see is that when the pool’s share tokens are staked to the pool, the lockup module isn’t able to be used. One option is to change the lockup module’s architecture, as going with the current implementation will force users to choose whether to receive the pool rewards or the Osmo farming rewards.
Pros:
Cons:
The text was updated successfully, but these errors were encountered: