Skip to content

Commit

Permalink
Lower MIN_RESERVE (#88)
Browse files Browse the repository at this point in the history
* modify MIN_RESERVE

* Lower MIN_RESERVE
  • Loading branch information
MagicGordon authored Jul 5, 2022
1 parent ec4b762 commit 1aae875
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 7 deletions.
2 changes: 1 addition & 1 deletion ref-exchange/release_notes.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Release Notes

### Version 1.5.2
1. Lower MIN_RESERVE to 1*10**16;
1. Lower MIN_RESERVE to 1*10**15;

### Version 1.5.1
1. Import rated stable pool;
Expand Down
2 changes: 1 addition & 1 deletion ref-exchange/src/stable_swap/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ mod math;
pub const MIN_DECIMAL: u8 = 1;
pub const MAX_DECIMAL: u8 = 24;
pub const TARGET_DECIMAL: u8 = 18;
pub const MIN_RESERVE: u128 = 10_000_000_000_000_000;
pub const MIN_RESERVE: u128 = 1_000_000_000_000_000;

#[derive(BorshSerialize, BorshDeserialize)]
pub struct StableSwapPool {
Expand Down
23 changes: 18 additions & 5 deletions ref-exchange/tests/test_errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ fn sim_stable_e69 () {
let token1 = test_token(&root, dai(), vec![ex.account_id()]);
let token2 = test_token(&root, usdt(), vec![ex.account_id()]);
whitelist_token(&owner, &ex, vec![token1.valid_account_id(), token2.valid_account_id()]);
deposit_token(&root, &ex, vec![&token1, &token2], vec![101*ONE_DAI, 101*ONE_USDT]);
deposit_token(&root, &ex, vec![&token1, &token2], vec![101*ONE_DAI, 1001*ONE_USDT]);

call!(
owner,
Expand Down Expand Up @@ -479,15 +479,28 @@ fn sim_stable_e69 () {
deposit = 1
)
.assert_success();

call!(
root,
ex.swap(
vec![SwapAction {
pool_id: 0,
token_in: usdt(),
amount_in: Some(U128(99*ONE_USDT)),
token_out: dai(),
min_amount_out: U128(1)
}],
None
),
deposit = 1
).assert_success();
let outcome = call!(
root,
ex.swap(
vec![SwapAction {
pool_id: 0,
token_in: dai(),
amount_in: Some(U128(99*ONE_DAI)),
token_out: usdt(),
token_in: usdt(),
amount_in: Some(U128(99*ONE_USDT)),
token_out: dai(),
min_amount_out: U128(1)
}],
None
Expand Down
1 change: 1 addition & 0 deletions ref-exchange/tests/test_fuzz_amm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ fn generate_fuzzy_seed() -> Vec<u64>{
}

#[test]
#[ignore]
fn test_fuzzy_amm(){

let seeds = generate_fuzzy_seed();
Expand Down
1 change: 1 addition & 0 deletions ref-exchange/tests/test_fuzzy_stable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ fn generate_fuzzy_seed() -> Vec<u64>{
}

#[test]
#[ignore]
fn test_fuzzy_stable() {
let seeds = generate_fuzzy_seed();

Expand Down
Binary file modified releases/ref_exchange_release.wasm
Binary file not shown.

0 comments on commit 1aae875

Please sign in to comment.