File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed
Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -1279,7 +1279,7 @@ pub struct LPTakerSwap<'info> {
12791279 pub state : Box < Account < ' info , State > > ,
12801280 #[ account(
12811281 mut ,
1282- constraint = admin. key( ) == admin_hot_wallet:: id( ) || admin. key( ) == lp_pool_swap_wallet:: id( )
1282+ constraint = admin. key( ) == admin_hot_wallet:: id( ) || admin. key( ) == lp_pool_swap_wallet:: id( ) || admin . key ( ) == state . admin
12831283 ) ]
12841284 pub admin : Signer < ' info > ,
12851285 /// Signer token accounts
Original file line number Diff line number Diff line change @@ -978,13 +978,12 @@ impl Constituent {
978978
979979 pub fn get_max_transfer ( & self , spot_market : & SpotMarket ) -> DriftResult < u64 > {
980980 let token_amount = self . get_full_token_amount ( spot_market) ?;
981-
982- let max_transfer = if self . spot_balance . balance_type == SpotBalanceType :: Borrow {
981+ let max_transfer = if token_amount < 0 {
983982 self . max_borrow_token_amount
984- . saturating_sub ( token_amount as u64 )
983+ . saturating_sub ( token_amount. cast :: < u64 > ( ) ? )
985984 } else {
986985 self . max_borrow_token_amount
987- . saturating_add ( token_amount as u64 )
986+ . saturating_add ( token_amount. cast :: < u64 > ( ) ? )
988987 } ;
989988
990989 Ok ( max_transfer)
You can’t perform that action at this time.
0 commit comments