# Changelog All notable changes to this project will be documented in this file. ## [Unreleased] ### Added the IS formula. - [ ] Added a RD vault for opening a RD account/vault. - [ ] We can also add the functionality of auto_maturity of FDs using hooks. - [ ] After every few blocks, some balance is transferred to the TREASURY account. - L0 chain's inflation is transferred to the TREASURY account. - [ ] Just immediately after the pallet deployment, the `FDParams` are supposed to be set. This can be done during genesis build. ### Changed ### Fixed ## [0.1.4] - 2023-07-17 ### Added - [x] Add tests: - `open_fd_fail_when_zero_maturity_period` - `open_fd_fail_when_maturity_period_less_than_fd_epoch` - `open_fd_fail_when_maturity_period_more_than_max_maturity_period` - [x] Limit the max. value of `maturity_period` to be ∈ [`fd_epoch`, `MaxMaturityPeriod`]. This is to be done in `open_fd` extrinsic. The min. is `fd_epoch` & max. 5 years (set as `pallet::constant`). ### Changed - [x] Modify the FD interest calculation as per the banking formula using `FixedU128` type into consideration for ensuring decimal values. ```txt A = P * (1 + r/n)^(nt) A = the future value of the investment (i.e. principal amount), including interest P = the principal investment amount (the initial deposit) r = the annual interest rate (decimal) n = the number of times that interest is compounded per year t = the number of years the money is invested ``` - [x] Moved `reset_treasury` from extrinsic to helper function for testing purpose. ### Fixed ## [0.1.2] - 2023-07-11 ### Added - [x] Added input sanitization for `principal_amount` to fall within the range of minimum & maximum FD amount i.e. ∈ [`MinFDAmount`, `MaxFDAmount`] during `open_fd` extrinsic. - [x] Also added tests for the same. - [x] Added a power/logarithmic formula into a private function for Investment Score (IS). This is to be used in updating user's **IS** during `close_fd`. ```txt IS = 1000 * (1 - (1 / (1 + MA / DF))) ``` ### Changed - [x] Bettered the existing interest & penalty amount calculation with the help of `Permill` type for rates (interest, penalty). ### Fixed - Fixed the `penalty_amount` with 1% instead of 1. ```diff if penalty == Zero::zero() { -- penalty = One::one() ++ penalty = Permill::from_percent(1) * principal_amount; } ``` ## [0.1.1] - 2023-07-06 ### Added - [x] Added Tests for `unlock_for_membership` extrinsic. ### Fixed - [x] Removed redundant code from `src/lib.rs` file. ## [0.1.0] - 2023-07-06 ### Added - [x] Added facility to open/close a FD account/vault. - [x] Lock/Unlock tokens for gaining membership. - [x] Root can define the interest rate for the FD vaults. - [x] Tests added for all the extrinsics.