@@ -36,7 +36,7 @@ use super::optional_accounts::get_token_interface;
3636
3737pub fn handle_initialize_lp_pool (
3838 ctx : Context < InitializeLpPool > ,
39- name : [ u8 ; 32 ] ,
39+ lp_pool_id : u8 ,
4040 min_mint_fee : i64 ,
4141 max_aum : u128 ,
4242 max_settle_quote_amount_per_market : u64 ,
@@ -59,7 +59,6 @@ pub fn handle_initialize_lp_pool(
5959 ) ?;
6060
6161 * lp_pool = LPPool {
62- name,
6362 pubkey : ctx. accounts . lp_pool . key ( ) ,
6463 mint : mint. key ( ) ,
6564 constituent_target_base : ctx. accounts . constituent_target_base . key ( ) ,
@@ -84,7 +83,8 @@ pub fn handle_initialize_lp_pool(
8483 xi : 2 ,
8584 target_oracle_delay_fee_bps_per_10_slots : 0 ,
8685 target_position_delay_fee_bps_per_10_slots : 0 ,
87- padding : [ 0u8 ; 15 ] ,
86+ lp_pool_id,
87+ padding : [ 0u8 ; 14 ] ,
8888 whitelist_mint,
8989 } ;
9090
@@ -598,11 +598,14 @@ pub fn handle_begin_lp_swap<'c: 'info, 'info>(
598598 // Check admin
599599 let admin = & ctx. accounts . admin ;
600600 #[ cfg( feature = "anchor-test" ) ]
601- validate ! (
602- admin. key( ) == admin_hot_wallet:: id( ) || admin. key( ) == state. admin,
603- ErrorCode :: Unauthorized ,
604- "Wrong signer for lp taker swap"
605- ) ?;
601+ {
602+ let state = & ctx. accounts . state ;
603+ validate ! (
604+ admin. key( ) == admin_hot_wallet:: id( ) || admin. key( ) == state. admin,
605+ ErrorCode :: Unauthorized ,
606+ "Wrong signer for lp taker swap"
607+ ) ?;
608+ }
606609 #[ cfg( not( feature = "anchor-test" ) ) ]
607610 validate ! (
608611 admin. key( ) == lp_pool_swap_wallet:: id( ) ,
@@ -1008,14 +1011,14 @@ pub fn handle_override_amm_cache_info<'c: 'info, 'info>(
10081011
10091012#[ derive( Accounts ) ]
10101013#[ instruction(
1011- name : [ u8 ; 32 ] ,
1014+ id : u8 ,
10121015) ]
10131016pub struct InitializeLpPool < ' info > {
10141017 #[ account( mut ) ]
10151018 pub admin : Signer < ' info > ,
10161019 #[ account(
10171020 init,
1018- seeds = [ b"lp_pool" , name . as_ref( ) ] ,
1021+ seeds = [ b"lp_pool" , id . to_le_bytes ( ) . as_ref( ) ] ,
10191022 space = LPPool :: SIZE ,
10201023 bump,
10211024 payer = admin
0 commit comments