@@ -5100,6 +5100,27 @@ pub fn handle_add_amm_constituent_data<'info>(
51005100 Ok ( ( ) )
51015101}
51025102
5103+ pub fn handle_update_constituent_correlation_data < ' info > (
5104+ ctx : Context < UpdateConstituentCorrelation > ,
5105+ index1 : u16 ,
5106+ index2 : u16 ,
5107+ corr : i64 ,
5108+ ) -> Result < ( ) > {
5109+ let constituent_correlations = & mut ctx. accounts . constituent_correlations ;
5110+ constituent_correlations. set_correlation ( index1, index2, corr) ?;
5111+
5112+ msg ! (
5113+ "Updated correlation between constituent {} and {} to {}" ,
5114+ index1,
5115+ index2,
5116+ corr
5117+ ) ;
5118+
5119+ constituent_correlations. validate ( ) ?;
5120+
5121+ Ok ( ( ) )
5122+ }
5123+
51035124pub fn handle_begin_lp_swap < ' c : ' info , ' info > (
51045125 ctx : Context < ' _ , ' _ , ' c , ' info , LPTakerSwap < ' info > > ,
51055126 in_market_index : u16 ,
@@ -6459,6 +6480,24 @@ pub struct RemoveAmmConstituentMappingData<'info> {
64596480 pub state : Box < Account < ' info , State > > ,
64606481}
64616482
6483+ #[ derive( Accounts ) ]
6484+ pub struct UpdateConstituentCorrelation < ' info > {
6485+ #[ account(
6486+ mut ,
6487+ constraint = admin. key( ) == admin_hot_wallet:: id( ) || admin. key( ) == state. admin
6488+ ) ]
6489+ pub admin : Signer < ' info > ,
6490+ pub lp_pool : AccountLoader < ' info , LPPool > ,
6491+
6492+ #[ account(
6493+ mut ,
6494+ seeds = [ CONSTITUENT_CORRELATIONS_PDA_SEED . as_ref( ) , lp_pool. key( ) . as_ref( ) ] ,
6495+ bump = constituent_correlations. bump,
6496+ ) ]
6497+ pub constituent_correlations : Box < Account < ' info , ConstituentCorrelations > > ,
6498+ pub state : Box < Account < ' info , State > > ,
6499+ }
6500+
64626501#[ derive( Accounts ) ]
64636502#[ instruction(
64646503 in_market_index: u16 ,
0 commit comments