File tree 1 file changed +15
-2
lines changed
1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -741,7 +741,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
741
741
. value_name ( "AMOUNT" )
742
742
. takes_value ( true )
743
743
. validator ( is_amount)
744
- . help ( "Amount of tokens to always leave in Wallet regardless of requested deposit AMOUNT \
744
+ . help ( "Amount of tokens to always leave in the wallet regardless of requested deposit AMOUNT \
745
745
[default: 0.01 for SOL, 0.0 for all other tokens]") ,
746
746
)
747
747
. arg (
@@ -789,6 +789,15 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
789
789
. default_value ( "0.0" )
790
790
. help ( "Do not withdraw if AMOUNT is less than this value" )
791
791
)
792
+ . arg (
793
+ Arg :: with_name ( "retain_ui_amount" )
794
+ . long ( "retain" )
795
+ . value_name ( "AMOUNT" )
796
+ . takes_value ( true )
797
+ . validator ( is_amount)
798
+ . default_value ( "0.0" )
799
+ . help ( "Amount of tokens to always leave in the pool regardless of requested withdrawal AMOUNT" ) ,
800
+ )
792
801
. arg (
793
802
Arg :: with_name ( "token" )
794
803
. value_name ( "TOKEN" )
@@ -1286,7 +1295,11 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
1286
1295
assert_eq ! ( maximum_amount, None ) ; // --maximum_amount is only supported by Rebalance
1287
1296
1288
1297
for pool in & pools {
1289
- let withdraw_pool_available_balance = supply_balance. get ( pool) . unwrap ( ) . 2 ;
1298
+ let withdraw_pool_available_balance = supply_balance
1299
+ . get ( pool)
1300
+ . unwrap ( )
1301
+ . 2
1302
+ . saturating_sub ( retain_amount) ;
1290
1303
1291
1304
let requested_amount = match requested_amount {
1292
1305
u64:: MAX => {
You can’t perform that action at this time.
0 commit comments