Skip to content

Commit a73f8e5

Browse files
authored
small proram tweaks (#2021)
1 parent c0d3fc4 commit a73f8e5

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

programs/drift/src/instructions/keeper.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3334,6 +3334,12 @@ pub fn handle_settle_perp_to_lp_pool<'c: 'info, 'info>(
33343334
let lp_pool_key = ctx.accounts.lp_pool.key();
33353335
let mut lp_pool = ctx.accounts.lp_pool.load_mut()?;
33363336

3337+
controller::spot_balance::update_spot_market_cumulative_interest(
3338+
&mut *quote_market,
3339+
None,
3340+
now,
3341+
)?;
3342+
33373343
let tvl_before = quote_market
33383344
.get_tvl()?
33393345
.safe_add(quote_constituent.vault_token_balance as u128)?;
@@ -3351,12 +3357,6 @@ pub fn handle_settle_perp_to_lp_pool<'c: 'info, 'info>(
33513357
None,
33523358
)?;
33533359

3354-
controller::spot_balance::update_spot_market_cumulative_interest(
3355-
&mut *quote_market,
3356-
None,
3357-
now,
3358-
)?;
3359-
33603360
for (_, perp_market_loader) in perp_market_map.0.iter() {
33613361
let mut perp_market = perp_market_loader.load_mut()?;
33623362
if lp_pool.lp_pool_id != perp_market.lp_pool_id {

programs/drift/src/instructions/user.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ use std::ops::DerefMut;
33

44
use anchor_lang::prelude::*;
55
use anchor_lang::Discriminator;
6+
use anchor_spl::associated_token::AssociatedToken;
67
use anchor_spl::{
78
token::Token,
89
token_2022::Token2022,
@@ -3681,6 +3682,7 @@ pub fn handle_begin_swap<'c: 'info, 'info>(
36813682
} else {
36823683
let mut whitelisted_programs = WHITELISTED_SWAP_PROGRAMS.to_vec();
36833684
if !delegate_is_signer {
3685+
whitelisted_programs.push(AssociatedToken::id());
36843686
whitelisted_programs.push(Token::id());
36853687
whitelisted_programs.push(Token2022::id());
36863688
whitelisted_programs.push(marinade_mainnet::ID);

0 commit comments

Comments
 (0)