diff --git a/bot/src/stake_pool_v0.rs b/bot/src/stake_pool_v0.rs index 2f920d6e..c3d7974a 100644 --- a/bot/src/stake_pool_v0.rs +++ b/bot/src/stake_pool_v0.rs @@ -1,5 +1,6 @@ use solana_sdk::instruction::Instruction; use solana_sdk::system_instruction; +use std::env; use { crate::{ generic_stake_pool::*, @@ -727,11 +728,16 @@ where } else { deactivating_total += amount_to_remove; - let mut instructions: Vec = vec![system_instruction::transfer( - &authorized_staker.pubkey(), - &transient_stake_address, - DELEGATION_RENT, - )]; + let mut instructions: Vec = vec![]; + + // Testnet now requires that stake accounts have a rent-exempt minimum + if env::var("ADD_RENT_EXEMPT_MINIMUM").is_ok() { + instructions.push(system_instruction::transfer( + &authorized_staker.pubkey(), + &transient_stake_address, + DELEGATION_RENT, + )); + } instructions.append(&mut stake_instruction::split_with_seed( &stake_address,