@@ -47,7 +47,7 @@ use std::convert::TryFrom;
4747
4848use solana_program:: sysvar:: clock:: Clock ;
4949
50- use super :: optional_accounts:: { load_maps , AccountMaps , get_whitelist_token } ;
50+ use super :: optional_accounts:: { get_whitelist_token , load_maps , AccountMaps } ;
5151use crate :: controller:: spot_balance:: update_spot_market_cumulative_interest;
5252use crate :: controller:: token:: { receive, send_from_program_vault_with_signature_seeds} ;
5353use crate :: instructions:: constraints:: * ;
@@ -1327,7 +1327,7 @@ pub fn handle_deposit_to_program_vault<'c: 'info, 'info>(
13271327 constituent. last_oracle_slot = oracle_data_slot;
13281328 }
13291329 constituent. sync_token_balance ( ctx. accounts . constituent_token_account . amount ) ;
1330- let balance_before = constituent. get_full_balance ( & spot_market) ?;
1330+ let balance_before = constituent. get_full_token_amount ( & spot_market) ?;
13311331
13321332 controller:: token:: send_from_program_vault_with_signature_seeds (
13331333 & ctx. accounts . token_program ,
@@ -1367,7 +1367,7 @@ pub fn handle_deposit_to_program_vault<'c: 'info, 'info>(
13671367 "Spot market vault amount mismatch after deposit"
13681368 ) ?;
13691369
1370- let balance_after = constituent. get_full_balance ( & spot_market) ?;
1370+ let balance_after = constituent. get_full_token_amount ( & spot_market) ?;
13711371 let balance_diff_notional = if spot_market. decimals > 6 {
13721372 balance_after
13731373 . abs_diff ( balance_before)
@@ -1431,7 +1431,7 @@ pub fn handle_withdraw_from_program_vault<'c: 'info, 'info>(
14311431 constituent. last_oracle_slot = oracle_data_slot;
14321432 }
14331433 constituent. sync_token_balance ( ctx. accounts . constituent_token_account . amount ) ;
1434- let balance_before = constituent. get_full_balance ( & spot_market) ?;
1434+ let balance_before = constituent. get_full_token_amount ( & spot_market) ?;
14351435
14361436 // Can only borrow up to the max
14371437 let bl_token_balance = constituent. spot_balance . get_token_amount ( & spot_market) ?;
@@ -1487,7 +1487,7 @@ pub fn handle_withdraw_from_program_vault<'c: 'info, 'info>(
14871487 ) ?;
14881488
14891489 // Verify withdraw fully accounted for in BLPosition
1490- let balance_after = constituent. get_full_balance ( & spot_market) ?;
1490+ let balance_after = constituent. get_full_token_amount ( & spot_market) ?;
14911491
14921492 let balance_diff_notional = if spot_market. decimals > 6 {
14931493 balance_after
0 commit comments