-
Notifications
You must be signed in to change notification settings - Fork 567
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
multi currency incentive rewards #1396
Conversation
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.
Also need to add the migration for orml-rewards to karura runtime
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.
Need migration for orml-rewards
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.
plan to use HomaValidatorAllowance
to implement the multi-currency reward? But reward accumulation for HomaValidatorAllowance
is not periodic.
The definition for PoolId
is no longer appropriate. PooId
implies the reward currency id(native and stable or other allowance) and accumulation method (periodly by fixed amount ,or the multiple of the base amount and fixed rate, or transfer allowance non-periodicly)
Now, orml_rewards
supports to record multi-currency rewards amount with single PoolId
,
And the pool share of DexIncentives
is equal to DexSaving
for the same trading pair.
it's better to refactor PoolId
to DEX
, Loans
and others, and need new storage
map Vec<(reward_currency_id, reward_amount_per_period)>
to record periodic fixed amount reward, and define new enum to imply base amount source, add another storage
map PoolId => Vec<(reward_currency_id, fixed_rate, BaseAmountSourceEnum)>
to record the fixed rate and the base amount source. Aggregate these configurations when accumulating periodic multi rewards.
@xlc What do you think?
If need to do, more migrations are required, and I am afraid that testing and front-end modification cannot be completed before this Thursday’s runtime upgrade.
* stash: multi currency incentive rewards * update * add migration * refactor * update * fix tests * fix benchmarking * update incentives migration * add migration * update * fix clippy * migration limit * fix Co-authored-by: wangjj9219 <183318287@qq.com>
Stash