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

Update MIN_VALID_EXCHANGE_RATE #1980

Merged
merged 2 commits into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pallets/loans/src/interest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,10 @@ impl<T: Config> Pallet<T> {
Ok(Ratio::from_rational(borrows, total))
}

/// The exchange rate should be greater than 0.02 and less than 1
/// The exchange rate should be greater than 0.015 and less than 1
pub(crate) fn ensure_valid_exchange_rate(exchange_rate: Rate) -> DispatchResult {
ensure!(
exchange_rate >= Rate::from_inner(MIN_EXCHANGE_RATE)
exchange_rate >= Rate::from_inner(MIN_VALID_EXCHANGE_RATE)
&& exchange_rate < Rate::from_inner(MAX_EXCHANGE_RATE),
Error::<T>::InvalidExchangeRate
);
Expand Down
1 change: 1 addition & 0 deletions pallets/loans/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ pub const MIN_INTEREST_CALCULATING_INTERVAL: u64 = 100; // 100 seconds

pub const MAX_EXCHANGE_RATE: u128 = 1_000_000_000_000_000_000; // 1
pub const MIN_EXCHANGE_RATE: u128 = 20_000_000_000_000_000; // 0.02
pub const MIN_VALID_EXCHANGE_RATE: u128 = 15_000_000_000_000_000; // 0.015

type AccountIdOf<T> = <T as frame_system::Config>::AccountId;
type AssetIdOf<T> =
Expand Down
2 changes: 1 addition & 1 deletion runtime/heiko/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("heiko"),
impl_name: create_runtime_str!("heiko"),
authoring_version: 1,
spec_version: 209,
spec_version: 210,
impl_version: 33,
apis: RUNTIME_API_VERSIONS,
transaction_version: 17,
Expand Down
2 changes: 1 addition & 1 deletion runtime/kerria/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("kerria"),
impl_name: create_runtime_str!("kerria"),
authoring_version: 1,
spec_version: 209,
spec_version: 210,
impl_version: 33,
apis: RUNTIME_API_VERSIONS,
transaction_version: 17,
Expand Down
2 changes: 1 addition & 1 deletion runtime/parallel/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("parallel"),
impl_name: create_runtime_str!("parallel"),
authoring_version: 1,
spec_version: 209,
spec_version: 210,
impl_version: 33,
apis: RUNTIME_API_VERSIONS,
transaction_version: 17,
Expand Down
2 changes: 1 addition & 1 deletion runtime/vanilla/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("vanilla"),
impl_name: create_runtime_str!("vanilla"),
authoring_version: 1,
spec_version: 209,
spec_version: 210,
impl_version: 33,
apis: RUNTIME_API_VERSIONS,
transaction_version: 17,
Expand Down
2 changes: 1 addition & 1 deletion scripts/collator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ VOLUME="chains"
NODE_KEY="$1"
KEYSTORE_PATH="$2"
NODE_NAME="$3"
DOCKER_IMAGE="parallelfinance/parallel:v2.0.9"
DOCKER_IMAGE="parallelfinance/parallel:v2.1.0"
BASE_PATH="/data"

if [ $# -lt 3 ]; then
Expand Down
Loading