Merge pull request #10 from blockworks-foundation/partial_bug0

increased deficit calculation number in partial liquidation
This commit is contained in:
dafyddd 2021-04-14 19:24:54 -04:00 committed by GitHub
commit 183b5f86e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 4 deletions

2
cli/Cargo.lock generated
View File

@ -1854,7 +1854,7 @@ dependencies = [
[[package]]
name = "mango"
version = "0.2.2"
version = "0.2.3"
dependencies = [
"arrayref",
"bincode",

2
program/Cargo.lock generated
View File

@ -458,7 +458,7 @@ dependencies = [
[[package]]
name = "mango"
version = "0.2.2"
version = "0.2.3"
dependencies = [
"arrayref",
"bincode",

View File

@ -1,6 +1,6 @@
[package]
name = "mango"
version = "0.2.2"
version = "0.2.3"
authors = ["blockworks"]
edition = "2018"

View File

@ -1889,7 +1889,7 @@ fn get_in_out_quantities(
out_token_index: usize,
liqor_max_in: u64
) -> MangoResult<(u64, u64)> {
let deficit_val = margin_account.get_partial_liq_deficit(&mango_group, &prices, open_orders_accs)?;
let deficit_val = margin_account.get_partial_liq_deficit(&mango_group, &prices, open_orders_accs)? + ONE_U64F64;
let out_avail: U64F64 = margin_account.deposits[out_token_index] * mango_group.indexes[out_token_index].deposit;
let out_avail_val = out_avail * prices[out_token_index];