-
Notifications
You must be signed in to change notification settings - Fork 83
[WIP] Gauges and bribes #50
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
base: staking
Are you sure you want to change the base?
Conversation
@sunmoon11100 Could you explain the purpose of splitting the module? It's an additional complexity of having to think about access permissions, without any benefits in this case, as UPD. Just because those has been split in the Solidity version, doesn't mean it has to be in Move, we have much stricter scoping rules. It looks like |
sources/gov/voter.move
Outdated
let item = iterable_table::borrow(&votes.items, pool_id); | ||
let voted = iterable_table::borrow(item, ve_token_id); | ||
let pool_rewards = gauge::get_rewards(pool_id); | ||
gauge::withdraw_rewards(pool_id, pool_rewards * *voted / *total_voted ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Somewhere here there's a problem: we have only integers, so the sum of all
pool_rewards * *voted / * total_voted
over the all ve_nft
tokens in the pool voting table can be a bit less than pool_rewards
. We need to do something with that last bit of rewards, maybe give it to the last user.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remaining rewards are summed and distributed again next week, so it's not obligatory.
* Covered each functions with negative and positive scenarios. Added comments to code. * Changed amount of test coins near to real values. * Changed comment for deposit function
* fix: add more tests for getter functions * fix: remove debug dep * fix: resolve PR comments
5004f57
to
95f5ecf
Compare
use test_helpers::test_account::create_account; | ||
use test_pool_owner::test_lp::LP; | ||
|
||
#[test( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs much more tests, really as much tests as possible!
# Conflicts: # Move.toml # sources/swap/dao_storage.move # sources/swap/liquidity_pool.move # tests/dao_storage_tests.move # tests/liquidity_pool_tests.move # tests/router_tests.move
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It also won't compile with latest Aptos CLI, fix please.
pool_owner = @test_pool_owner, | ||
gov_admin = @gov_admin | ||
)] | ||
fun test_vote_for_liquidity_pool(coin_admin: signer, pool_owner: signer, gov_admin: signer) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still small amount of tests.
But get_amount_out() return something different value.
@sunmoon11100 Could you add a high-level explanation of how it should work on top of files? |
# Conflicts: # sources/swap/liquidity_pool.move # tests/liquidity_pool_tests.move
The purpose of gauge votes is to determine which pools receive emission allocations for each epoch. Each epoch ranges over a one week period Wed 5pm PST - Wed 5:59PM PST the following week.
If user vote for pools offering bribes, he will receive a portion of these bribes proportionate to his vote weight / global vote weights on that pool.
https://resources.curve.fi/reward-gauges/understanding-gauges
https://andrecronje.medium.com/bribing-vecrv-gauges-101-8f6e4506bb62
https://docs.maiadao.io/hermes-token/claiming-trading-fees-bribes
https://templecodex.link/eli5-vetokens-gauges-and-bribes/