File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ use std::{
18
18
} ;
19
19
20
20
/// Percentage of an obligation that can be repaid during each liquidation call
21
- pub const LIQUIDATION_CLOSE_FACTOR : u8 = 50 ;
21
+ pub const LIQUIDATION_CLOSE_FACTOR : u8 = 20 ;
22
22
23
23
/// Obligation borrow amount that is small enough to close out
24
24
pub const LIQUIDATION_CLOSE_AMOUNT : u64 = 2 ;
Original file line number Diff line number Diff line change @@ -31,10 +31,11 @@ async fn test_success() {
31
31
const SOL_DEPOSIT_AMOUNT_LAMPORTS : u64 = 100 * LAMPORTS_TO_SOL * INITIAL_COLLATERAL_RATIO ;
32
32
// 100 SOL * 80% LTV -> 80 SOL * 20 USDC -> 1600 USDC borrow
33
33
const USDC_BORROW_AMOUNT_FRACTIONAL : u64 = 1_600 * FRACTIONAL_TO_USDC ;
34
- // 1600 USDC * 50% -> 800 USDC liquidation
35
- const USDC_LIQUIDATION_AMOUNT_FRACTIONAL : u64 = USDC_BORROW_AMOUNT_FRACTIONAL / 2 ;
36
- // 800 USDC / 20 USDC per SOL -> 40 SOL + 10% bonus -> 44 SOL
37
- const SOL_LIQUIDATION_AMOUNT_LAMPORTS : u64 = 44 * LAMPORTS_TO_SOL * INITIAL_COLLATERAL_RATIO ;
34
+ // 1600 USDC * 20% -> 320 USDC liquidation
35
+ const USDC_LIQUIDATION_AMOUNT_FRACTIONAL : u64 = USDC_BORROW_AMOUNT_FRACTIONAL / 5 ;
36
+ // 320 USDC / 20 USDC per SOL -> 16 SOL + 10% bonus -> 17.6 SOL (88/5)
37
+ const SOL_LIQUIDATION_AMOUNT_LAMPORTS : u64 =
38
+ LAMPORTS_TO_SOL * INITIAL_COLLATERAL_RATIO * 88 / 5 ;
38
39
39
40
const SOL_RESERVE_COLLATERAL_LAMPORTS : u64 = 2 * SOL_DEPOSIT_AMOUNT_LAMPORTS ;
40
41
const USDC_RESERVE_LIQUIDITY_FRACTIONAL : u64 = 2 * USDC_BORROW_AMOUNT_FRACTIONAL ;
You can’t perform that action at this time.
0 commit comments