Skip to content

Commit 9d7a2b6

Browse files
committed
give permission for dlp taker bot to deposit withdraw from program vault to dlp
1 parent 6976e55 commit 9d7a2b6

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

programs/drift/src/instructions/lp_admin.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1277,7 +1277,10 @@ pub struct UpdateConstituentCorrelation<'info> {
12771277
)]
12781278
pub struct LPTakerSwap<'info> {
12791279
pub state: Box<Account<'info, State>>,
1280-
#[account(mut)]
1280+
#[account(
1281+
mut,
1282+
constraint = admin.key() == admin_hot_wallet::id() || admin.key() == lp_pool_swap_wallet::id()
1283+
)]
12811284
pub admin: Signer<'info>,
12821285
/// Signer token accounts
12831286
#[account(

programs/drift/src/instructions/lp_pool.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use anchor_lang::{prelude::*, Accounts, Key, Result};
22
use anchor_spl::token_interface::{Mint, TokenAccount, TokenInterface};
33

4+
use crate::ids::lp_pool_swap_wallet;
45
use crate::math::constants::{PERCENTAGE_PRECISION, PRICE_PRECISION_I64};
56
use crate::math::oracle::OracleValidity;
67
use crate::state::paused_operations::ConstituentLpOperation;
@@ -1600,7 +1601,7 @@ pub struct DepositProgramVault<'info> {
16001601
pub state: Box<Account<'info, State>>,
16011602
#[account(
16021603
mut,
1603-
constraint = admin.key() == admin_hot_wallet::id() || admin.key() == state.admin
1604+
constraint = admin.key() == admin_hot_wallet::id() || admin.key() == state.admin || admin.key() == lp_pool_swap_wallet::id()
16041605
)]
16051606
pub admin: Signer<'info>,
16061607
#[account(mut)]
@@ -1636,7 +1637,7 @@ pub struct WithdrawProgramVault<'info> {
16361637
pub state: Box<Account<'info, State>>,
16371638
#[account(
16381639
mut,
1639-
constraint = admin.key() == admin_hot_wallet::id() || admin.key() == state.admin
1640+
constraint = admin.key() == admin_hot_wallet::id() || admin.key() == state.admin || admin.key() == lp_pool_swap_wallet::id()
16401641
)]
16411642
pub admin: Signer<'info>,
16421643
/// CHECK: program signer

0 commit comments

Comments
 (0)