program: remove delegate account withdrawal limit (#939)

This is necessary for new liquidator feature of rebalancing using limit orders:
We need to close the token and market slot so that it's available for new liquidation, but at the same time, it's possible that the min order quantity for a given market is still bigger than allowed max withdrawal.
This commit is contained in:
Serge Farny 2024-04-10 15:24:39 +02:00 committed by GitHub
parent 01d5237162
commit 75a07e986a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 0 additions and 9 deletions

View File

@ -13,8 +13,6 @@ use crate::logs::{
emit_stack, LoanOriginationFeeInstruction, TokenBalanceLog, WithdrawLoanLog, WithdrawLog,
};
const DELEGATE_WITHDRAW_MAX: i64 = 100_000; // $0.1
pub fn token_withdraw(ctx: Context<TokenWithdraw>, amount: u64, allow_borrow: bool) -> Result<()> {
require_msg!(amount > 0, "withdraw amount must be positive");
@ -143,13 +141,6 @@ pub fn token_withdraw(ctx: Context<TokenWithdraw>, amount: u64, allow_borrow: bo
!withdraw_result.position_is_active,
MangoError::DelegateWithdrawMustClosePosition
);
// Delegates can't withdraw too much
require_gte!(
DELEGATE_WITHDRAW_MAX,
amount_usd,
MangoError::DelegateWithdrawSmall
);
}
//