Skip to content
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

Limit the daily balance that is taken into account when calculating yield #4

Merged
merged 4 commits into from
Mar 14, 2024

Conversation

ihoroleksiienko
Copy link
Contributor

@ihoroleksiienko ihoroleksiienko commented Mar 13, 2024

Description

A maximum daily balance limit has been added to restrict yield calculation. Maximum daily limit for yield calculation is defined by constant MAX_DAILY_BALANCE_LIMIT

Key Highlights

  1. The client's minimum balance min for day D is determined by comparing balances for days from D - N - 1 to D inclusive, where N is the interval for viewing balances specified in the contract.
  2. If min > MAX_DAILY_BALANCE_LIMIT than min = MAX_DAILY_BALANCE_LIMIT
  3. Daily yield dailyYield = minBalance * rate, where Rate is the daily yield rate.

Current configurations

  • MAX_DAILY_BALANCE_LIMIT - 200K BRLC
  • FEE_RATE - 0%

Test coverage

New functionality was fully covered with tests

@ihoroleksiienko ihoroleksiienko changed the title Balance cap Max Balance Daily Limit Mar 13, 2024
@igorsenych-cw igorsenych-cw changed the title Max Balance Daily Limit Limit the daily balance that is taken into account when calculating yield Mar 14, 2024
@igorsenych-cw igorsenych-cw merged commit 7683517 into main Mar 14, 2024
6 checks passed
@igorsenych-cw igorsenych-cw deleted the balance-cap branch March 14, 2024 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants