@@ -67,6 +67,7 @@ use crate::state::fulfillment_params::openbook_v2::OpenbookV2FulfillmentParams;
6767use crate :: state:: fulfillment_params:: phoenix:: PhoenixFulfillmentParams ;
6868use crate :: state:: fulfillment_params:: serum:: SerumFulfillmentParams ;
6969use crate :: state:: high_leverage_mode_config:: HighLeverageModeConfig ;
70+ use crate :: state:: lp_pool:: { Constituent , LPPool } ;
7071use crate :: state:: margin_calculation:: MarginContext ;
7172use crate :: state:: oracle:: StrictOraclePrice ;
7273use crate :: state:: order_params:: {
@@ -4026,6 +4027,19 @@ pub fn handle_end_swap<'c: 'info, 'info>(
40264027 Ok ( ( ) )
40274028}
40284029
4030+ #[ access_control(
4031+ fill_not_paused( & ctx. accounts. state)
4032+ ) ]
4033+ pub fn handle_lp_pool_swap < ' c : ' info , ' info > (
4034+ ctx : Context < ' _ , ' _ , ' c , ' info , LPSwap < ' info > > ,
4035+ in_market_index : u16 ,
4036+ out_market_index : u16 ,
4037+ limit_price : Option < u64 > ,
4038+ reduce_only : Option < SwapReduceOnly > ,
4039+ ) -> Result < ( ) > {
4040+ Ok ( ( ) )
4041+ }
4042+
40294043#[ derive( Accounts ) ]
40304044#[ instruction(
40314045 sub_account_id: u16 ,
@@ -4688,3 +4702,23 @@ pub struct UpdateUserProtectedMakerMode<'info> {
46884702 #[ account( mut ) ]
46894703 pub protected_maker_mode_config : AccountLoader < ' info , ProtectedMakerModeConfig > ,
46904704}
4705+
4706+ #[ derive( Accounts ) ]
4707+ pub struct LPSwap < ' info > {
4708+ pub state : Box < Account < ' info , State > > ,
4709+ pub lp_pool : AccountLoader < ' info , LPPool > ,
4710+
4711+ #[ account( mut ) ]
4712+ pub in_token_account : Box < InterfaceAccount < ' info , TokenAccount > > ,
4713+ #[ account( mut ) ]
4714+ pub out_token_account : Box < InterfaceAccount < ' info , TokenAccount > > ,
4715+
4716+ #[ account( mut ) ]
4717+ pub in_constituent : AccountLoader < ' info , Constituent > ,
4718+ #[ account( mut ) ]
4719+ pub out_constituent : AccountLoader < ' info , Constituent > ,
4720+
4721+ pub authority : Signer < ' info > ,
4722+
4723+ pub token_program : Interface < ' info , TokenInterface > ,
4724+ }
0 commit comments