-
Notifications
You must be signed in to change notification settings - Fork 602
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
Add query to track liquidity provider rewards #2992
Comments
IMO,a query that takes in First reason, we don't keep state on rewards by "timestamps", there wouldn't be a way to do this as of rn. Second reason, we track rewards for each "lock", not each account in the incentives module. An approach you might want to try out is using the query |
|
Would it be possible to store that within the contract, not the state machine? I'm not sure if storing an unused state(within state machine) is preferred |
We can't store the correct amount of rewards in our contract, because we don't know the correct amount of rewards to begin with. |
Because of the difference caused by the estimate reward and the actual reward? |
Yes, exactly. What information is stored? Are the total rewards distributed saved? |
@mattverse any update on this? |
I'm also looking for a similar query to get rewards distributed to an address by lock id and epoch. My use case is autocompounding rewards after a distribution. Afaik the only way to do this now with the available apis is to use the rewards estimate endpoint before the epoch ends, store this and hope it is accurate. |
Background
To protect against the Cream exploit we need a way to only compound those rewards that come from liquidity mining rewards and not those that might be donated by an attacker. We currently don’t know how to do this and I assume it will require an upgrade in Osmosis to add this query. We’re not sure what the best way to write such a query would be and it would be great if someone from Osmosis can help with this as we are not very familiar with the liquidity mining rewards logic.
https://mudit.blog/cream-hack-analysis/
Suggested Design
Add an RPC endpoint that returns the amount of liquidity pool rewards have been sent to an address since a given timestamp or block.
The text was updated successfully, but these errors were encountered: