drift_rs/
drift_idl.rs

1#![allow(unused_imports)]
2#![doc = r""]
3#![doc = r" Auto-generated IDL types, manual edits do not persist (see `crates/drift-idl-gen`)"]
4#![doc = r""]
5use anchor_lang::{
6    prelude::{
7        account,
8        borsh::{self},
9        error_code, event, msg, AnchorDeserialize, AnchorSerialize, InitSpace,
10    },
11    Discriminator,
12};
13use serde::{Deserialize, Serialize};
14use solana_sdk::{instruction::AccountMeta, pubkey::Pubkey};
15pub const IDL_VERSION: &str = "2.118.0";
16use self::traits::ToAccountMetas;
17pub mod traits {
18    use solana_sdk::instruction::AccountMeta;
19    #[doc = r" This is distinct from the anchor_lang version of the trait"]
20    #[doc = r" reimplemented to ensure the types used are from `solana`` crates _not_ the anchor_lang vendored versions which may be lagging behind"]
21    pub trait ToAccountMetas {
22        fn to_account_metas(&self) -> Vec<AccountMeta>;
23    }
24}
25pub mod instructions {
26    #![doc = r" IDL instruction types"]
27    use super::{types::*, *};
28    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
29    pub struct InitializeUser {
30        pub sub_account_id: u16,
31        pub name: [u8; 32],
32    }
33    #[automatically_derived]
34    impl anchor_lang::Discriminator for InitializeUser {
35        const DISCRIMINATOR: &[u8] = &[111, 17, 185, 250, 60, 122, 38, 254];
36    }
37    #[automatically_derived]
38    impl anchor_lang::InstructionData for InitializeUser {}
39    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
40    pub struct InitializeUserStats {}
41    #[automatically_derived]
42    impl anchor_lang::Discriminator for InitializeUserStats {
43        const DISCRIMINATOR: &[u8] = &[254, 243, 72, 98, 251, 130, 168, 213];
44    }
45    #[automatically_derived]
46    impl anchor_lang::InstructionData for InitializeUserStats {}
47    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
48    pub struct InitializeSignedMsgUserOrders {
49        pub num_orders: u16,
50    }
51    #[automatically_derived]
52    impl anchor_lang::Discriminator for InitializeSignedMsgUserOrders {
53        const DISCRIMINATOR: &[u8] = &[164, 99, 156, 126, 156, 57, 99, 180];
54    }
55    #[automatically_derived]
56    impl anchor_lang::InstructionData for InitializeSignedMsgUserOrders {}
57    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
58    pub struct ResizeSignedMsgUserOrders {
59        pub num_orders: u16,
60    }
61    #[automatically_derived]
62    impl anchor_lang::Discriminator for ResizeSignedMsgUserOrders {
63        const DISCRIMINATOR: &[u8] = &[137, 10, 87, 150, 18, 115, 79, 168];
64    }
65    #[automatically_derived]
66    impl anchor_lang::InstructionData for ResizeSignedMsgUserOrders {}
67    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
68    pub struct InitializeSignedMsgWsDelegates {
69        pub delegates: Vec<Pubkey>,
70    }
71    #[automatically_derived]
72    impl anchor_lang::Discriminator for InitializeSignedMsgWsDelegates {
73        const DISCRIMINATOR: &[u8] = &[40, 132, 96, 219, 184, 193, 80, 8];
74    }
75    #[automatically_derived]
76    impl anchor_lang::InstructionData for InitializeSignedMsgWsDelegates {}
77    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
78    pub struct ChangeSignedMsgWsDelegateStatus {
79        pub delegate: Pubkey,
80        pub add: bool,
81    }
82    #[automatically_derived]
83    impl anchor_lang::Discriminator for ChangeSignedMsgWsDelegateStatus {
84        const DISCRIMINATOR: &[u8] = &[252, 202, 252, 219, 179, 27, 84, 138];
85    }
86    #[automatically_derived]
87    impl anchor_lang::InstructionData for ChangeSignedMsgWsDelegateStatus {}
88    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
89    pub struct InitializeFuelOverflow {}
90    #[automatically_derived]
91    impl anchor_lang::Discriminator for InitializeFuelOverflow {
92        const DISCRIMINATOR: &[u8] = &[88, 223, 132, 161, 208, 88, 142, 42];
93    }
94    #[automatically_derived]
95    impl anchor_lang::InstructionData for InitializeFuelOverflow {}
96    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
97    pub struct SweepFuel {}
98    #[automatically_derived]
99    impl anchor_lang::Discriminator for SweepFuel {
100        const DISCRIMINATOR: &[u8] = &[175, 107, 19, 56, 165, 241, 43, 69];
101    }
102    #[automatically_derived]
103    impl anchor_lang::InstructionData for SweepFuel {}
104    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
105    pub struct ResetFuelSeason {}
106    #[automatically_derived]
107    impl anchor_lang::Discriminator for ResetFuelSeason {
108        const DISCRIMINATOR: &[u8] = &[199, 122, 192, 255, 32, 99, 63, 200];
109    }
110    #[automatically_derived]
111    impl anchor_lang::InstructionData for ResetFuelSeason {}
112    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
113    pub struct InitializeReferrerName {
114        pub name: [u8; 32],
115    }
116    #[automatically_derived]
117    impl anchor_lang::Discriminator for InitializeReferrerName {
118        const DISCRIMINATOR: &[u8] = &[235, 126, 231, 10, 42, 164, 26, 61];
119    }
120    #[automatically_derived]
121    impl anchor_lang::InstructionData for InitializeReferrerName {}
122    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
123    pub struct Deposit {
124        pub market_index: u16,
125        pub amount: u64,
126        pub reduce_only: bool,
127    }
128    #[automatically_derived]
129    impl anchor_lang::Discriminator for Deposit {
130        const DISCRIMINATOR: &[u8] = &[242, 35, 198, 137, 82, 225, 242, 182];
131    }
132    #[automatically_derived]
133    impl anchor_lang::InstructionData for Deposit {}
134    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
135    pub struct Withdraw {
136        pub market_index: u16,
137        pub amount: u64,
138        pub reduce_only: bool,
139    }
140    #[automatically_derived]
141    impl anchor_lang::Discriminator for Withdraw {
142        const DISCRIMINATOR: &[u8] = &[183, 18, 70, 156, 148, 109, 161, 34];
143    }
144    #[automatically_derived]
145    impl anchor_lang::InstructionData for Withdraw {}
146    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
147    pub struct TransferDeposit {
148        pub market_index: u16,
149        pub amount: u64,
150    }
151    #[automatically_derived]
152    impl anchor_lang::Discriminator for TransferDeposit {
153        const DISCRIMINATOR: &[u8] = &[20, 20, 147, 223, 41, 63, 204, 111];
154    }
155    #[automatically_derived]
156    impl anchor_lang::InstructionData for TransferDeposit {}
157    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
158    pub struct TransferPools {
159        pub deposit_from_market_index: u16,
160        pub deposit_to_market_index: u16,
161        pub borrow_from_market_index: u16,
162        pub borrow_to_market_index: u16,
163        pub deposit_amount: Option<u64>,
164        pub borrow_amount: Option<u64>,
165    }
166    #[automatically_derived]
167    impl anchor_lang::Discriminator for TransferPools {
168        const DISCRIMINATOR: &[u8] = &[197, 103, 154, 25, 107, 90, 60, 94];
169    }
170    #[automatically_derived]
171    impl anchor_lang::InstructionData for TransferPools {}
172    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
173    pub struct TransferPerpPosition {
174        pub market_index: u16,
175        pub amount: Option<i64>,
176    }
177    #[automatically_derived]
178    impl anchor_lang::Discriminator for TransferPerpPosition {
179        const DISCRIMINATOR: &[u8] = &[23, 172, 188, 168, 134, 210, 3, 108];
180    }
181    #[automatically_derived]
182    impl anchor_lang::InstructionData for TransferPerpPosition {}
183    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
184    pub struct PlacePerpOrder {
185        pub params: OrderParams,
186    }
187    #[automatically_derived]
188    impl anchor_lang::Discriminator for PlacePerpOrder {
189        const DISCRIMINATOR: &[u8] = &[69, 161, 93, 202, 120, 126, 76, 185];
190    }
191    #[automatically_derived]
192    impl anchor_lang::InstructionData for PlacePerpOrder {}
193    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
194    pub struct CancelOrder {
195        pub order_id: Option<u32>,
196    }
197    #[automatically_derived]
198    impl anchor_lang::Discriminator for CancelOrder {
199        const DISCRIMINATOR: &[u8] = &[95, 129, 237, 240, 8, 49, 223, 132];
200    }
201    #[automatically_derived]
202    impl anchor_lang::InstructionData for CancelOrder {}
203    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
204    pub struct CancelOrderByUserId {
205        pub user_order_id: u8,
206    }
207    #[automatically_derived]
208    impl anchor_lang::Discriminator for CancelOrderByUserId {
209        const DISCRIMINATOR: &[u8] = &[107, 211, 250, 133, 18, 37, 57, 100];
210    }
211    #[automatically_derived]
212    impl anchor_lang::InstructionData for CancelOrderByUserId {}
213    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
214    pub struct CancelOrders {
215        pub market_type: Option<MarketType>,
216        pub market_index: Option<u16>,
217        pub direction: Option<PositionDirection>,
218    }
219    #[automatically_derived]
220    impl anchor_lang::Discriminator for CancelOrders {
221        const DISCRIMINATOR: &[u8] = &[238, 225, 95, 158, 227, 103, 8, 194];
222    }
223    #[automatically_derived]
224    impl anchor_lang::InstructionData for CancelOrders {}
225    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
226    pub struct CancelOrdersByIds {
227        pub order_ids: Vec<u32>,
228    }
229    #[automatically_derived]
230    impl anchor_lang::Discriminator for CancelOrdersByIds {
231        const DISCRIMINATOR: &[u8] = &[134, 19, 144, 165, 94, 240, 210, 94];
232    }
233    #[automatically_derived]
234    impl anchor_lang::InstructionData for CancelOrdersByIds {}
235    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
236    pub struct ModifyOrder {
237        pub order_id: Option<u32>,
238        pub modify_order_params: ModifyOrderParams,
239    }
240    #[automatically_derived]
241    impl anchor_lang::Discriminator for ModifyOrder {
242        const DISCRIMINATOR: &[u8] = &[47, 124, 117, 255, 201, 197, 130, 94];
243    }
244    #[automatically_derived]
245    impl anchor_lang::InstructionData for ModifyOrder {}
246    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
247    pub struct ModifyOrderByUserId {
248        pub user_order_id: u8,
249        pub modify_order_params: ModifyOrderParams,
250    }
251    #[automatically_derived]
252    impl anchor_lang::Discriminator for ModifyOrderByUserId {
253        const DISCRIMINATOR: &[u8] = &[158, 77, 4, 253, 252, 194, 161, 179];
254    }
255    #[automatically_derived]
256    impl anchor_lang::InstructionData for ModifyOrderByUserId {}
257    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
258    pub struct PlaceAndTakePerpOrder {
259        pub params: OrderParams,
260        pub success_condition: Option<u32>,
261    }
262    #[automatically_derived]
263    impl anchor_lang::Discriminator for PlaceAndTakePerpOrder {
264        const DISCRIMINATOR: &[u8] = &[213, 51, 1, 187, 108, 220, 230, 224];
265    }
266    #[automatically_derived]
267    impl anchor_lang::InstructionData for PlaceAndTakePerpOrder {}
268    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
269    pub struct PlaceAndMakePerpOrder {
270        pub params: OrderParams,
271        pub taker_order_id: u32,
272    }
273    #[automatically_derived]
274    impl anchor_lang::Discriminator for PlaceAndMakePerpOrder {
275        const DISCRIMINATOR: &[u8] = &[149, 117, 11, 237, 47, 95, 89, 237];
276    }
277    #[automatically_derived]
278    impl anchor_lang::InstructionData for PlaceAndMakePerpOrder {}
279    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
280    pub struct PlaceAndMakeSignedMsgPerpOrder {
281        pub params: OrderParams,
282        pub signed_msg_order_uuid: [u8; 8],
283    }
284    #[automatically_derived]
285    impl anchor_lang::Discriminator for PlaceAndMakeSignedMsgPerpOrder {
286        const DISCRIMINATOR: &[u8] = &[16, 26, 123, 131, 94, 29, 175, 98];
287    }
288    #[automatically_derived]
289    impl anchor_lang::InstructionData for PlaceAndMakeSignedMsgPerpOrder {}
290    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
291    pub struct PlaceSignedMsgTakerOrder {
292        pub signed_msg_order_params_message_bytes: Vec<u8>,
293        pub is_delegate_signer: bool,
294    }
295    #[automatically_derived]
296    impl anchor_lang::Discriminator for PlaceSignedMsgTakerOrder {
297        const DISCRIMINATOR: &[u8] = &[32, 79, 101, 139, 25, 6, 98, 15];
298    }
299    #[automatically_derived]
300    impl anchor_lang::InstructionData for PlaceSignedMsgTakerOrder {}
301    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
302    pub struct PlaceSpotOrder {
303        pub params: OrderParams,
304    }
305    #[automatically_derived]
306    impl anchor_lang::Discriminator for PlaceSpotOrder {
307        const DISCRIMINATOR: &[u8] = &[45, 79, 81, 160, 248, 90, 91, 220];
308    }
309    #[automatically_derived]
310    impl anchor_lang::InstructionData for PlaceSpotOrder {}
311    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
312    pub struct PlaceAndTakeSpotOrder {
313        pub params: OrderParams,
314        pub fulfillment_type: Option<SpotFulfillmentType>,
315        pub maker_order_id: Option<u32>,
316    }
317    #[automatically_derived]
318    impl anchor_lang::Discriminator for PlaceAndTakeSpotOrder {
319        const DISCRIMINATOR: &[u8] = &[191, 3, 138, 71, 114, 198, 202, 100];
320    }
321    #[automatically_derived]
322    impl anchor_lang::InstructionData for PlaceAndTakeSpotOrder {}
323    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
324    pub struct PlaceAndMakeSpotOrder {
325        pub params: OrderParams,
326        pub taker_order_id: u32,
327        pub fulfillment_type: Option<SpotFulfillmentType>,
328    }
329    #[automatically_derived]
330    impl anchor_lang::Discriminator for PlaceAndMakeSpotOrder {
331        const DISCRIMINATOR: &[u8] = &[149, 158, 85, 66, 239, 9, 243, 98];
332    }
333    #[automatically_derived]
334    impl anchor_lang::InstructionData for PlaceAndMakeSpotOrder {}
335    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
336    pub struct PlaceOrders {
337        pub params: Vec<OrderParams>,
338    }
339    #[automatically_derived]
340    impl anchor_lang::Discriminator for PlaceOrders {
341        const DISCRIMINATOR: &[u8] = &[60, 63, 50, 123, 12, 197, 60, 190];
342    }
343    #[automatically_derived]
344    impl anchor_lang::InstructionData for PlaceOrders {}
345    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
346    pub struct BeginSwap {
347        pub in_market_index: u16,
348        pub out_market_index: u16,
349        pub amount_in: u64,
350    }
351    #[automatically_derived]
352    impl anchor_lang::Discriminator for BeginSwap {
353        const DISCRIMINATOR: &[u8] = &[174, 109, 228, 1, 242, 105, 232, 105];
354    }
355    #[automatically_derived]
356    impl anchor_lang::InstructionData for BeginSwap {}
357    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
358    pub struct EndSwap {
359        pub in_market_index: u16,
360        pub out_market_index: u16,
361        pub limit_price: Option<u64>,
362        pub reduce_only: Option<SwapReduceOnly>,
363    }
364    #[automatically_derived]
365    impl anchor_lang::Discriminator for EndSwap {
366        const DISCRIMINATOR: &[u8] = &[177, 184, 27, 193, 34, 13, 210, 145];
367    }
368    #[automatically_derived]
369    impl anchor_lang::InstructionData for EndSwap {}
370    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
371    pub struct AddPerpLpShares {
372        pub n_shares: u64,
373        pub market_index: u16,
374    }
375    #[automatically_derived]
376    impl anchor_lang::Discriminator for AddPerpLpShares {
377        const DISCRIMINATOR: &[u8] = &[56, 209, 56, 197, 119, 254, 188, 117];
378    }
379    #[automatically_derived]
380    impl anchor_lang::InstructionData for AddPerpLpShares {}
381    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
382    pub struct RemovePerpLpShares {
383        pub shares_to_burn: u64,
384        pub market_index: u16,
385    }
386    #[automatically_derived]
387    impl anchor_lang::Discriminator for RemovePerpLpShares {
388        const DISCRIMINATOR: &[u8] = &[213, 89, 217, 18, 160, 55, 53, 141];
389    }
390    #[automatically_derived]
391    impl anchor_lang::InstructionData for RemovePerpLpShares {}
392    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
393    pub struct RemovePerpLpSharesInExpiringMarket {
394        pub shares_to_burn: u64,
395        pub market_index: u16,
396    }
397    #[automatically_derived]
398    impl anchor_lang::Discriminator for RemovePerpLpSharesInExpiringMarket {
399        const DISCRIMINATOR: &[u8] = &[83, 254, 253, 137, 59, 122, 68, 156];
400    }
401    #[automatically_derived]
402    impl anchor_lang::InstructionData for RemovePerpLpSharesInExpiringMarket {}
403    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
404    pub struct UpdateUserName {
405        pub sub_account_id: u16,
406        pub name: [u8; 32],
407    }
408    #[automatically_derived]
409    impl anchor_lang::Discriminator for UpdateUserName {
410        const DISCRIMINATOR: &[u8] = &[135, 25, 185, 56, 165, 53, 34, 136];
411    }
412    #[automatically_derived]
413    impl anchor_lang::InstructionData for UpdateUserName {}
414    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
415    pub struct UpdateUserCustomMarginRatio {
416        pub sub_account_id: u16,
417        pub margin_ratio: u32,
418    }
419    #[automatically_derived]
420    impl anchor_lang::Discriminator for UpdateUserCustomMarginRatio {
421        const DISCRIMINATOR: &[u8] = &[21, 221, 140, 187, 32, 129, 11, 123];
422    }
423    #[automatically_derived]
424    impl anchor_lang::InstructionData for UpdateUserCustomMarginRatio {}
425    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
426    pub struct UpdateUserMarginTradingEnabled {
427        pub sub_account_id: u16,
428        pub margin_trading_enabled: bool,
429    }
430    #[automatically_derived]
431    impl anchor_lang::Discriminator for UpdateUserMarginTradingEnabled {
432        const DISCRIMINATOR: &[u8] = &[194, 92, 204, 223, 246, 188, 31, 203];
433    }
434    #[automatically_derived]
435    impl anchor_lang::InstructionData for UpdateUserMarginTradingEnabled {}
436    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
437    pub struct UpdateUserPoolId {
438        pub sub_account_id: u16,
439        pub pool_id: u8,
440    }
441    #[automatically_derived]
442    impl anchor_lang::Discriminator for UpdateUserPoolId {
443        const DISCRIMINATOR: &[u8] = &[219, 86, 73, 106, 56, 218, 128, 109];
444    }
445    #[automatically_derived]
446    impl anchor_lang::InstructionData for UpdateUserPoolId {}
447    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
448    pub struct UpdateUserDelegate {
449        pub sub_account_id: u16,
450        pub delegate: Pubkey,
451    }
452    #[automatically_derived]
453    impl anchor_lang::Discriminator for UpdateUserDelegate {
454        const DISCRIMINATOR: &[u8] = &[139, 205, 141, 141, 113, 36, 94, 187];
455    }
456    #[automatically_derived]
457    impl anchor_lang::InstructionData for UpdateUserDelegate {}
458    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
459    pub struct UpdateUserReduceOnly {
460        pub sub_account_id: u16,
461        pub reduce_only: bool,
462    }
463    #[automatically_derived]
464    impl anchor_lang::Discriminator for UpdateUserReduceOnly {
465        const DISCRIMINATOR: &[u8] = &[199, 71, 42, 67, 144, 19, 86, 109];
466    }
467    #[automatically_derived]
468    impl anchor_lang::InstructionData for UpdateUserReduceOnly {}
469    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
470    pub struct UpdateUserAdvancedLp {
471        pub sub_account_id: u16,
472        pub advanced_lp: bool,
473    }
474    #[automatically_derived]
475    impl anchor_lang::Discriminator for UpdateUserAdvancedLp {
476        const DISCRIMINATOR: &[u8] = &[66, 80, 107, 186, 27, 242, 66, 95];
477    }
478    #[automatically_derived]
479    impl anchor_lang::InstructionData for UpdateUserAdvancedLp {}
480    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
481    pub struct UpdateUserProtectedMakerOrders {
482        pub sub_account_id: u16,
483        pub protected_maker_orders: bool,
484    }
485    #[automatically_derived]
486    impl anchor_lang::Discriminator for UpdateUserProtectedMakerOrders {
487        const DISCRIMINATOR: &[u8] = &[114, 39, 123, 198, 187, 25, 90, 219];
488    }
489    #[automatically_derived]
490    impl anchor_lang::InstructionData for UpdateUserProtectedMakerOrders {}
491    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
492    pub struct DeleteUser {}
493    #[automatically_derived]
494    impl anchor_lang::Discriminator for DeleteUser {
495        const DISCRIMINATOR: &[u8] = &[186, 85, 17, 249, 219, 231, 98, 251];
496    }
497    #[automatically_derived]
498    impl anchor_lang::InstructionData for DeleteUser {}
499    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
500    pub struct ForceDeleteUser {}
501    #[automatically_derived]
502    impl anchor_lang::Discriminator for ForceDeleteUser {
503        const DISCRIMINATOR: &[u8] = &[2, 241, 195, 172, 227, 24, 254, 158];
504    }
505    #[automatically_derived]
506    impl anchor_lang::InstructionData for ForceDeleteUser {}
507    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
508    pub struct DeleteSignedMsgUserOrders {}
509    #[automatically_derived]
510    impl anchor_lang::Discriminator for DeleteSignedMsgUserOrders {
511        const DISCRIMINATOR: &[u8] = &[221, 247, 128, 253, 212, 254, 46, 153];
512    }
513    #[automatically_derived]
514    impl anchor_lang::InstructionData for DeleteSignedMsgUserOrders {}
515    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
516    pub struct ReclaimRent {}
517    #[automatically_derived]
518    impl anchor_lang::Discriminator for ReclaimRent {
519        const DISCRIMINATOR: &[u8] = &[218, 200, 19, 197, 227, 89, 192, 22];
520    }
521    #[automatically_derived]
522    impl anchor_lang::InstructionData for ReclaimRent {}
523    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
524    pub struct EnableUserHighLeverageMode {
525        pub sub_account_id: u16,
526    }
527    #[automatically_derived]
528    impl anchor_lang::Discriminator for EnableUserHighLeverageMode {
529        const DISCRIMINATOR: &[u8] = &[231, 24, 230, 112, 201, 173, 73, 184];
530    }
531    #[automatically_derived]
532    impl anchor_lang::InstructionData for EnableUserHighLeverageMode {}
533    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
534    pub struct FillPerpOrder {
535        pub order_id: Option<u32>,
536        pub maker_order_id: Option<u32>,
537    }
538    #[automatically_derived]
539    impl anchor_lang::Discriminator for FillPerpOrder {
540        const DISCRIMINATOR: &[u8] = &[13, 188, 248, 103, 134, 217, 106, 240];
541    }
542    #[automatically_derived]
543    impl anchor_lang::InstructionData for FillPerpOrder {}
544    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
545    pub struct RevertFill {}
546    #[automatically_derived]
547    impl anchor_lang::Discriminator for RevertFill {
548        const DISCRIMINATOR: &[u8] = &[236, 238, 176, 69, 239, 10, 181, 193];
549    }
550    #[automatically_derived]
551    impl anchor_lang::InstructionData for RevertFill {}
552    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
553    pub struct FillSpotOrder {
554        pub order_id: Option<u32>,
555        pub fulfillment_type: Option<SpotFulfillmentType>,
556        pub maker_order_id: Option<u32>,
557    }
558    #[automatically_derived]
559    impl anchor_lang::Discriminator for FillSpotOrder {
560        const DISCRIMINATOR: &[u8] = &[212, 206, 130, 173, 21, 34, 199, 40];
561    }
562    #[automatically_derived]
563    impl anchor_lang::InstructionData for FillSpotOrder {}
564    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
565    pub struct TriggerOrder {
566        pub order_id: u32,
567    }
568    #[automatically_derived]
569    impl anchor_lang::Discriminator for TriggerOrder {
570        const DISCRIMINATOR: &[u8] = &[63, 112, 51, 233, 232, 47, 240, 199];
571    }
572    #[automatically_derived]
573    impl anchor_lang::InstructionData for TriggerOrder {}
574    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
575    pub struct ForceCancelOrders {}
576    #[automatically_derived]
577    impl anchor_lang::Discriminator for ForceCancelOrders {
578        const DISCRIMINATOR: &[u8] = &[64, 181, 196, 63, 222, 72, 64, 232];
579    }
580    #[automatically_derived]
581    impl anchor_lang::InstructionData for ForceCancelOrders {}
582    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
583    pub struct UpdateUserIdle {}
584    #[automatically_derived]
585    impl anchor_lang::Discriminator for UpdateUserIdle {
586        const DISCRIMINATOR: &[u8] = &[253, 133, 67, 22, 103, 161, 20, 100];
587    }
588    #[automatically_derived]
589    impl anchor_lang::InstructionData for UpdateUserIdle {}
590    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
591    pub struct LogUserBalances {}
592    #[automatically_derived]
593    impl anchor_lang::Discriminator for LogUserBalances {
594        const DISCRIMINATOR: &[u8] = &[162, 21, 35, 251, 32, 57, 161, 210];
595    }
596    #[automatically_derived]
597    impl anchor_lang::InstructionData for LogUserBalances {}
598    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
599    pub struct DisableUserHighLeverageMode {}
600    #[automatically_derived]
601    impl anchor_lang::Discriminator for DisableUserHighLeverageMode {
602        const DISCRIMINATOR: &[u8] = &[183, 155, 45, 0, 226, 85, 213, 69];
603    }
604    #[automatically_derived]
605    impl anchor_lang::InstructionData for DisableUserHighLeverageMode {}
606    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
607    pub struct UpdateUserFuelBonus {}
608    #[automatically_derived]
609    impl anchor_lang::Discriminator for UpdateUserFuelBonus {
610        const DISCRIMINATOR: &[u8] = &[88, 175, 201, 190, 222, 100, 143, 57];
611    }
612    #[automatically_derived]
613    impl anchor_lang::InstructionData for UpdateUserFuelBonus {}
614    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
615    pub struct UpdateUserStatsReferrerStatus {}
616    #[automatically_derived]
617    impl anchor_lang::Discriminator for UpdateUserStatsReferrerStatus {
618        const DISCRIMINATOR: &[u8] = &[174, 154, 72, 42, 191, 148, 145, 205];
619    }
620    #[automatically_derived]
621    impl anchor_lang::InstructionData for UpdateUserStatsReferrerStatus {}
622    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
623    pub struct UpdateUserOpenOrdersCount {}
624    #[automatically_derived]
625    impl anchor_lang::Discriminator for UpdateUserOpenOrdersCount {
626        const DISCRIMINATOR: &[u8] = &[104, 39, 65, 210, 250, 163, 100, 134];
627    }
628    #[automatically_derived]
629    impl anchor_lang::InstructionData for UpdateUserOpenOrdersCount {}
630    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
631    pub struct AdminDisableUpdatePerpBidAskTwap {
632        pub disable: bool,
633    }
634    #[automatically_derived]
635    impl anchor_lang::Discriminator for AdminDisableUpdatePerpBidAskTwap {
636        const DISCRIMINATOR: &[u8] = &[17, 164, 82, 45, 183, 86, 191, 199];
637    }
638    #[automatically_derived]
639    impl anchor_lang::InstructionData for AdminDisableUpdatePerpBidAskTwap {}
640    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
641    pub struct SettlePnl {
642        pub market_index: u16,
643    }
644    #[automatically_derived]
645    impl anchor_lang::Discriminator for SettlePnl {
646        const DISCRIMINATOR: &[u8] = &[43, 61, 234, 45, 15, 95, 152, 153];
647    }
648    #[automatically_derived]
649    impl anchor_lang::InstructionData for SettlePnl {}
650    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
651    pub struct SettleMultiplePnls {
652        pub market_indexes: Vec<u16>,
653        pub mode: SettlePnlMode,
654    }
655    #[automatically_derived]
656    impl anchor_lang::Discriminator for SettleMultiplePnls {
657        const DISCRIMINATOR: &[u8] = &[127, 66, 117, 57, 40, 50, 152, 127];
658    }
659    #[automatically_derived]
660    impl anchor_lang::InstructionData for SettleMultiplePnls {}
661    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
662    pub struct SettleFundingPayment {}
663    #[automatically_derived]
664    impl anchor_lang::Discriminator for SettleFundingPayment {
665        const DISCRIMINATOR: &[u8] = &[222, 90, 202, 94, 28, 45, 115, 183];
666    }
667    #[automatically_derived]
668    impl anchor_lang::InstructionData for SettleFundingPayment {}
669    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
670    pub struct SettleLp {
671        pub market_index: u16,
672    }
673    #[automatically_derived]
674    impl anchor_lang::Discriminator for SettleLp {
675        const DISCRIMINATOR: &[u8] = &[155, 231, 116, 113, 97, 229, 139, 141];
676    }
677    #[automatically_derived]
678    impl anchor_lang::InstructionData for SettleLp {}
679    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
680    pub struct SettleExpiredMarket {
681        pub market_index: u16,
682    }
683    #[automatically_derived]
684    impl anchor_lang::Discriminator for SettleExpiredMarket {
685        const DISCRIMINATOR: &[u8] = &[120, 89, 11, 25, 122, 77, 72, 193];
686    }
687    #[automatically_derived]
688    impl anchor_lang::InstructionData for SettleExpiredMarket {}
689    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
690    pub struct LiquidatePerp {
691        pub market_index: u16,
692        pub liquidator_max_base_asset_amount: u64,
693        pub limit_price: Option<u64>,
694    }
695    #[automatically_derived]
696    impl anchor_lang::Discriminator for LiquidatePerp {
697        const DISCRIMINATOR: &[u8] = &[75, 35, 119, 247, 191, 18, 139, 2];
698    }
699    #[automatically_derived]
700    impl anchor_lang::InstructionData for LiquidatePerp {}
701    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
702    pub struct LiquidatePerpWithFill {
703        pub market_index: u16,
704    }
705    #[automatically_derived]
706    impl anchor_lang::Discriminator for LiquidatePerpWithFill {
707        const DISCRIMINATOR: &[u8] = &[95, 111, 124, 105, 86, 169, 187, 34];
708    }
709    #[automatically_derived]
710    impl anchor_lang::InstructionData for LiquidatePerpWithFill {}
711    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
712    pub struct LiquidateSpot {
713        pub asset_market_index: u16,
714        pub liability_market_index: u16,
715        pub liquidator_max_liability_transfer: u128,
716        pub limit_price: Option<u64>,
717    }
718    #[automatically_derived]
719    impl anchor_lang::Discriminator for LiquidateSpot {
720        const DISCRIMINATOR: &[u8] = &[107, 0, 128, 41, 35, 229, 251, 18];
721    }
722    #[automatically_derived]
723    impl anchor_lang::InstructionData for LiquidateSpot {}
724    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
725    pub struct LiquidateSpotWithSwapBegin {
726        pub asset_market_index: u16,
727        pub liability_market_index: u16,
728        pub swap_amount: u64,
729    }
730    #[automatically_derived]
731    impl anchor_lang::Discriminator for LiquidateSpotWithSwapBegin {
732        const DISCRIMINATOR: &[u8] = &[12, 43, 176, 83, 156, 251, 117, 13];
733    }
734    #[automatically_derived]
735    impl anchor_lang::InstructionData for LiquidateSpotWithSwapBegin {}
736    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
737    pub struct LiquidateSpotWithSwapEnd {
738        pub asset_market_index: u16,
739        pub liability_market_index: u16,
740    }
741    #[automatically_derived]
742    impl anchor_lang::Discriminator for LiquidateSpotWithSwapEnd {
743        const DISCRIMINATOR: &[u8] = &[142, 88, 163, 160, 223, 75, 55, 225];
744    }
745    #[automatically_derived]
746    impl anchor_lang::InstructionData for LiquidateSpotWithSwapEnd {}
747    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
748    pub struct LiquidateBorrowForPerpPnl {
749        pub perp_market_index: u16,
750        pub spot_market_index: u16,
751        pub liquidator_max_liability_transfer: u128,
752        pub limit_price: Option<u64>,
753    }
754    #[automatically_derived]
755    impl anchor_lang::Discriminator for LiquidateBorrowForPerpPnl {
756        const DISCRIMINATOR: &[u8] = &[169, 17, 32, 90, 207, 148, 209, 27];
757    }
758    #[automatically_derived]
759    impl anchor_lang::InstructionData for LiquidateBorrowForPerpPnl {}
760    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
761    pub struct LiquidatePerpPnlForDeposit {
762        pub perp_market_index: u16,
763        pub spot_market_index: u16,
764        pub liquidator_max_pnl_transfer: u128,
765        pub limit_price: Option<u64>,
766    }
767    #[automatically_derived]
768    impl anchor_lang::Discriminator for LiquidatePerpPnlForDeposit {
769        const DISCRIMINATOR: &[u8] = &[237, 75, 198, 235, 233, 186, 75, 35];
770    }
771    #[automatically_derived]
772    impl anchor_lang::InstructionData for LiquidatePerpPnlForDeposit {}
773    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
774    pub struct SetUserStatusToBeingLiquidated {}
775    #[automatically_derived]
776    impl anchor_lang::Discriminator for SetUserStatusToBeingLiquidated {
777        const DISCRIMINATOR: &[u8] = &[106, 133, 160, 206, 193, 171, 192, 194];
778    }
779    #[automatically_derived]
780    impl anchor_lang::InstructionData for SetUserStatusToBeingLiquidated {}
781    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
782    pub struct ResolvePerpPnlDeficit {
783        pub spot_market_index: u16,
784        pub perp_market_index: u16,
785    }
786    #[automatically_derived]
787    impl anchor_lang::Discriminator for ResolvePerpPnlDeficit {
788        const DISCRIMINATOR: &[u8] = &[168, 204, 68, 150, 159, 126, 95, 148];
789    }
790    #[automatically_derived]
791    impl anchor_lang::InstructionData for ResolvePerpPnlDeficit {}
792    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
793    pub struct ResolvePerpBankruptcy {
794        pub quote_spot_market_index: u16,
795        pub market_index: u16,
796    }
797    #[automatically_derived]
798    impl anchor_lang::Discriminator for ResolvePerpBankruptcy {
799        const DISCRIMINATOR: &[u8] = &[224, 16, 176, 214, 162, 213, 183, 222];
800    }
801    #[automatically_derived]
802    impl anchor_lang::InstructionData for ResolvePerpBankruptcy {}
803    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
804    pub struct ResolveSpotBankruptcy {
805        pub market_index: u16,
806    }
807    #[automatically_derived]
808    impl anchor_lang::Discriminator for ResolveSpotBankruptcy {
809        const DISCRIMINATOR: &[u8] = &[124, 194, 240, 254, 198, 213, 52, 122];
810    }
811    #[automatically_derived]
812    impl anchor_lang::InstructionData for ResolveSpotBankruptcy {}
813    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
814    pub struct SettleRevenueToInsuranceFund {
815        pub spot_market_index: u16,
816    }
817    #[automatically_derived]
818    impl anchor_lang::Discriminator for SettleRevenueToInsuranceFund {
819        const DISCRIMINATOR: &[u8] = &[200, 120, 93, 136, 69, 38, 199, 159];
820    }
821    #[automatically_derived]
822    impl anchor_lang::InstructionData for SettleRevenueToInsuranceFund {}
823    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
824    pub struct UpdateFundingRate {
825        pub market_index: u16,
826    }
827    #[automatically_derived]
828    impl anchor_lang::Discriminator for UpdateFundingRate {
829        const DISCRIMINATOR: &[u8] = &[201, 178, 116, 212, 166, 144, 72, 238];
830    }
831    #[automatically_derived]
832    impl anchor_lang::InstructionData for UpdateFundingRate {}
833    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
834    pub struct UpdatePrelaunchOracle {}
835    #[automatically_derived]
836    impl anchor_lang::Discriminator for UpdatePrelaunchOracle {
837        const DISCRIMINATOR: &[u8] = &[220, 132, 27, 27, 233, 220, 61, 219];
838    }
839    #[automatically_derived]
840    impl anchor_lang::InstructionData for UpdatePrelaunchOracle {}
841    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
842    pub struct UpdatePerpBidAskTwap {}
843    #[automatically_derived]
844    impl anchor_lang::Discriminator for UpdatePerpBidAskTwap {
845        const DISCRIMINATOR: &[u8] = &[247, 23, 255, 65, 212, 90, 221, 194];
846    }
847    #[automatically_derived]
848    impl anchor_lang::InstructionData for UpdatePerpBidAskTwap {}
849    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
850    pub struct UpdateSpotMarketCumulativeInterest {}
851    #[automatically_derived]
852    impl anchor_lang::Discriminator for UpdateSpotMarketCumulativeInterest {
853        const DISCRIMINATOR: &[u8] = &[39, 166, 139, 243, 158, 165, 155, 225];
854    }
855    #[automatically_derived]
856    impl anchor_lang::InstructionData for UpdateSpotMarketCumulativeInterest {}
857    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
858    pub struct UpdateAmms {
859        pub market_indexes: [u16; 5],
860    }
861    #[automatically_derived]
862    impl anchor_lang::Discriminator for UpdateAmms {
863        const DISCRIMINATOR: &[u8] = &[201, 106, 217, 253, 4, 175, 228, 97];
864    }
865    #[automatically_derived]
866    impl anchor_lang::InstructionData for UpdateAmms {}
867    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
868    pub struct UpdateSpotMarketExpiry {
869        pub expiry_ts: i64,
870    }
871    #[automatically_derived]
872    impl anchor_lang::Discriminator for UpdateSpotMarketExpiry {
873        const DISCRIMINATOR: &[u8] = &[208, 11, 211, 159, 226, 24, 11, 247];
874    }
875    #[automatically_derived]
876    impl anchor_lang::InstructionData for UpdateSpotMarketExpiry {}
877    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
878    pub struct UpdateUserQuoteAssetInsuranceStake {}
879    #[automatically_derived]
880    impl anchor_lang::Discriminator for UpdateUserQuoteAssetInsuranceStake {
881        const DISCRIMINATOR: &[u8] = &[251, 101, 156, 7, 2, 63, 30, 23];
882    }
883    #[automatically_derived]
884    impl anchor_lang::InstructionData for UpdateUserQuoteAssetInsuranceStake {}
885    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
886    pub struct UpdateUserGovTokenInsuranceStake {}
887    #[automatically_derived]
888    impl anchor_lang::Discriminator for UpdateUserGovTokenInsuranceStake {
889        const DISCRIMINATOR: &[u8] = &[143, 99, 235, 187, 20, 159, 184, 84];
890    }
891    #[automatically_derived]
892    impl anchor_lang::InstructionData for UpdateUserGovTokenInsuranceStake {}
893    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
894    pub struct UpdateUserGovTokenInsuranceStakeDevnet {
895        pub gov_stake_amount: u64,
896    }
897    #[automatically_derived]
898    impl anchor_lang::Discriminator for UpdateUserGovTokenInsuranceStakeDevnet {
899        const DISCRIMINATOR: &[u8] = &[129, 185, 243, 183, 228, 111, 64, 175];
900    }
901    #[automatically_derived]
902    impl anchor_lang::InstructionData for UpdateUserGovTokenInsuranceStakeDevnet {}
903    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
904    pub struct InitializeInsuranceFundStake {
905        pub market_index: u16,
906    }
907    #[automatically_derived]
908    impl anchor_lang::Discriminator for InitializeInsuranceFundStake {
909        const DISCRIMINATOR: &[u8] = &[187, 179, 243, 70, 248, 90, 92, 147];
910    }
911    #[automatically_derived]
912    impl anchor_lang::InstructionData for InitializeInsuranceFundStake {}
913    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
914    pub struct AddInsuranceFundStake {
915        pub market_index: u16,
916        pub amount: u64,
917    }
918    #[automatically_derived]
919    impl anchor_lang::Discriminator for AddInsuranceFundStake {
920        const DISCRIMINATOR: &[u8] = &[251, 144, 115, 11, 222, 47, 62, 236];
921    }
922    #[automatically_derived]
923    impl anchor_lang::InstructionData for AddInsuranceFundStake {}
924    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
925    pub struct RequestRemoveInsuranceFundStake {
926        pub market_index: u16,
927        pub amount: u64,
928    }
929    #[automatically_derived]
930    impl anchor_lang::Discriminator for RequestRemoveInsuranceFundStake {
931        const DISCRIMINATOR: &[u8] = &[142, 70, 204, 92, 73, 106, 180, 52];
932    }
933    #[automatically_derived]
934    impl anchor_lang::InstructionData for RequestRemoveInsuranceFundStake {}
935    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
936    pub struct CancelRequestRemoveInsuranceFundStake {
937        pub market_index: u16,
938    }
939    #[automatically_derived]
940    impl anchor_lang::Discriminator for CancelRequestRemoveInsuranceFundStake {
941        const DISCRIMINATOR: &[u8] = &[97, 235, 78, 62, 212, 42, 241, 127];
942    }
943    #[automatically_derived]
944    impl anchor_lang::InstructionData for CancelRequestRemoveInsuranceFundStake {}
945    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
946    pub struct RemoveInsuranceFundStake {
947        pub market_index: u16,
948    }
949    #[automatically_derived]
950    impl anchor_lang::Discriminator for RemoveInsuranceFundStake {
951        const DISCRIMINATOR: &[u8] = &[128, 166, 142, 9, 254, 187, 143, 174];
952    }
953    #[automatically_derived]
954    impl anchor_lang::InstructionData for RemoveInsuranceFundStake {}
955    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
956    pub struct TransferProtocolIfShares {
957        pub market_index: u16,
958        pub shares: u128,
959    }
960    #[automatically_derived]
961    impl anchor_lang::Discriminator for TransferProtocolIfShares {
962        const DISCRIMINATOR: &[u8] = &[94, 93, 226, 240, 195, 201, 184, 109];
963    }
964    #[automatically_derived]
965    impl anchor_lang::InstructionData for TransferProtocolIfShares {}
966    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
967    pub struct UpdatePythPullOracle {
968        pub feed_id: [u8; 32],
969        pub params: Vec<u8>,
970    }
971    #[automatically_derived]
972    impl anchor_lang::Discriminator for UpdatePythPullOracle {
973        const DISCRIMINATOR: &[u8] = &[230, 191, 189, 94, 108, 59, 74, 197];
974    }
975    #[automatically_derived]
976    impl anchor_lang::InstructionData for UpdatePythPullOracle {}
977    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
978    pub struct PostPythPullOracleUpdateAtomic {
979        pub feed_id: [u8; 32],
980        pub params: Vec<u8>,
981    }
982    #[automatically_derived]
983    impl anchor_lang::Discriminator for PostPythPullOracleUpdateAtomic {
984        const DISCRIMINATOR: &[u8] = &[116, 122, 137, 158, 224, 195, 173, 119];
985    }
986    #[automatically_derived]
987    impl anchor_lang::InstructionData for PostPythPullOracleUpdateAtomic {}
988    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
989    pub struct PostMultiPythPullOracleUpdatesAtomic {
990        pub params: Vec<u8>,
991    }
992    #[automatically_derived]
993    impl anchor_lang::Discriminator for PostMultiPythPullOracleUpdatesAtomic {
994        const DISCRIMINATOR: &[u8] = &[243, 79, 204, 228, 227, 208, 100, 244];
995    }
996    #[automatically_derived]
997    impl anchor_lang::InstructionData for PostMultiPythPullOracleUpdatesAtomic {}
998    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
999    pub struct PauseSpotMarketDepositWithdraw {}
1000    #[automatically_derived]
1001    impl anchor_lang::Discriminator for PauseSpotMarketDepositWithdraw {
1002        const DISCRIMINATOR: &[u8] = &[183, 119, 59, 170, 137, 35, 242, 86];
1003    }
1004    #[automatically_derived]
1005    impl anchor_lang::InstructionData for PauseSpotMarketDepositWithdraw {}
1006    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1007    pub struct Initialize {}
1008    #[automatically_derived]
1009    impl anchor_lang::Discriminator for Initialize {
1010        const DISCRIMINATOR: &[u8] = &[175, 175, 109, 31, 13, 152, 155, 237];
1011    }
1012    #[automatically_derived]
1013    impl anchor_lang::InstructionData for Initialize {}
1014    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1015    pub struct InitializeSpotMarket {
1016        pub optimal_utilization: u32,
1017        pub optimal_borrow_rate: u32,
1018        pub max_borrow_rate: u32,
1019        pub oracle_source: OracleSource,
1020        pub initial_asset_weight: u32,
1021        pub maintenance_asset_weight: u32,
1022        pub initial_liability_weight: u32,
1023        pub maintenance_liability_weight: u32,
1024        pub imf_factor: u32,
1025        pub liquidator_fee: u32,
1026        pub if_liquidation_fee: u32,
1027        pub active_status: bool,
1028        pub asset_tier: AssetTier,
1029        pub scale_initial_asset_weight_start: u64,
1030        pub withdraw_guard_threshold: u64,
1031        pub order_tick_size: u64,
1032        pub order_step_size: u64,
1033        pub if_total_factor: u32,
1034        pub name: [u8; 32],
1035    }
1036    #[automatically_derived]
1037    impl anchor_lang::Discriminator for InitializeSpotMarket {
1038        const DISCRIMINATOR: &[u8] = &[234, 196, 128, 44, 94, 15, 48, 201];
1039    }
1040    #[automatically_derived]
1041    impl anchor_lang::InstructionData for InitializeSpotMarket {}
1042    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1043    pub struct DeleteInitializedSpotMarket {
1044        pub market_index: u16,
1045    }
1046    #[automatically_derived]
1047    impl anchor_lang::Discriminator for DeleteInitializedSpotMarket {
1048        const DISCRIMINATOR: &[u8] = &[31, 140, 67, 191, 189, 20, 101, 221];
1049    }
1050    #[automatically_derived]
1051    impl anchor_lang::InstructionData for DeleteInitializedSpotMarket {}
1052    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1053    pub struct InitializeSerumFulfillmentConfig {
1054        pub market_index: u16,
1055    }
1056    #[automatically_derived]
1057    impl anchor_lang::Discriminator for InitializeSerumFulfillmentConfig {
1058        const DISCRIMINATOR: &[u8] = &[193, 211, 132, 172, 70, 171, 7, 94];
1059    }
1060    #[automatically_derived]
1061    impl anchor_lang::InstructionData for InitializeSerumFulfillmentConfig {}
1062    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1063    pub struct UpdateSerumFulfillmentConfigStatus {
1064        pub status: SpotFulfillmentConfigStatus,
1065    }
1066    #[automatically_derived]
1067    impl anchor_lang::Discriminator for UpdateSerumFulfillmentConfigStatus {
1068        const DISCRIMINATOR: &[u8] = &[171, 109, 240, 251, 95, 1, 149, 89];
1069    }
1070    #[automatically_derived]
1071    impl anchor_lang::InstructionData for UpdateSerumFulfillmentConfigStatus {}
1072    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1073    pub struct InitializeOpenbookV2FulfillmentConfig {
1074        pub market_index: u16,
1075    }
1076    #[automatically_derived]
1077    impl anchor_lang::Discriminator for InitializeOpenbookV2FulfillmentConfig {
1078        const DISCRIMINATOR: &[u8] = &[7, 221, 103, 153, 107, 57, 27, 197];
1079    }
1080    #[automatically_derived]
1081    impl anchor_lang::InstructionData for InitializeOpenbookV2FulfillmentConfig {}
1082    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1083    pub struct OpenbookV2FulfillmentConfigStatus {
1084        pub status: SpotFulfillmentConfigStatus,
1085    }
1086    #[automatically_derived]
1087    impl anchor_lang::Discriminator for OpenbookV2FulfillmentConfigStatus {
1088        const DISCRIMINATOR: &[u8] = &[25, 173, 19, 189, 4, 211, 64, 238];
1089    }
1090    #[automatically_derived]
1091    impl anchor_lang::InstructionData for OpenbookV2FulfillmentConfigStatus {}
1092    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1093    pub struct InitializePhoenixFulfillmentConfig {
1094        pub market_index: u16,
1095    }
1096    #[automatically_derived]
1097    impl anchor_lang::Discriminator for InitializePhoenixFulfillmentConfig {
1098        const DISCRIMINATOR: &[u8] = &[135, 132, 110, 107, 185, 160, 169, 154];
1099    }
1100    #[automatically_derived]
1101    impl anchor_lang::InstructionData for InitializePhoenixFulfillmentConfig {}
1102    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1103    pub struct PhoenixFulfillmentConfigStatus {
1104        pub status: SpotFulfillmentConfigStatus,
1105    }
1106    #[automatically_derived]
1107    impl anchor_lang::Discriminator for PhoenixFulfillmentConfigStatus {
1108        const DISCRIMINATOR: &[u8] = &[96, 31, 113, 32, 12, 203, 7, 154];
1109    }
1110    #[automatically_derived]
1111    impl anchor_lang::InstructionData for PhoenixFulfillmentConfigStatus {}
1112    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1113    pub struct UpdateSerumVault {}
1114    #[automatically_derived]
1115    impl anchor_lang::Discriminator for UpdateSerumVault {
1116        const DISCRIMINATOR: &[u8] = &[219, 8, 246, 96, 169, 121, 91, 110];
1117    }
1118    #[automatically_derived]
1119    impl anchor_lang::InstructionData for UpdateSerumVault {}
1120    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1121    pub struct InitializePerpMarket {
1122        pub market_index: u16,
1123        pub amm_base_asset_reserve: u128,
1124        pub amm_quote_asset_reserve: u128,
1125        pub amm_periodicity: i64,
1126        pub amm_peg_multiplier: u128,
1127        pub oracle_source: OracleSource,
1128        pub contract_tier: ContractTier,
1129        pub margin_ratio_initial: u32,
1130        pub margin_ratio_maintenance: u32,
1131        pub liquidator_fee: u32,
1132        pub if_liquidation_fee: u32,
1133        pub imf_factor: u32,
1134        pub active_status: bool,
1135        pub base_spread: u32,
1136        pub max_spread: u32,
1137        pub max_open_interest: u128,
1138        pub max_revenue_withdraw_per_period: u64,
1139        pub quote_max_insurance: u64,
1140        pub order_step_size: u64,
1141        pub order_tick_size: u64,
1142        pub min_order_size: u64,
1143        pub concentration_coef_scale: u128,
1144        pub curve_update_intensity: u8,
1145        pub amm_jit_intensity: u8,
1146        pub name: [u8; 32],
1147    }
1148    #[automatically_derived]
1149    impl anchor_lang::Discriminator for InitializePerpMarket {
1150        const DISCRIMINATOR: &[u8] = &[132, 9, 229, 118, 117, 118, 117, 62];
1151    }
1152    #[automatically_derived]
1153    impl anchor_lang::InstructionData for InitializePerpMarket {}
1154    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1155    pub struct InitializePredictionMarket {}
1156    #[automatically_derived]
1157    impl anchor_lang::Discriminator for InitializePredictionMarket {
1158        const DISCRIMINATOR: &[u8] = &[248, 70, 198, 224, 224, 105, 125, 195];
1159    }
1160    #[automatically_derived]
1161    impl anchor_lang::InstructionData for InitializePredictionMarket {}
1162    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1163    pub struct DeleteInitializedPerpMarket {
1164        pub market_index: u16,
1165    }
1166    #[automatically_derived]
1167    impl anchor_lang::Discriminator for DeleteInitializedPerpMarket {
1168        const DISCRIMINATOR: &[u8] = &[91, 154, 24, 87, 106, 59, 190, 66];
1169    }
1170    #[automatically_derived]
1171    impl anchor_lang::InstructionData for DeleteInitializedPerpMarket {}
1172    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1173    pub struct MoveAmmPrice {
1174        pub base_asset_reserve: u128,
1175        pub quote_asset_reserve: u128,
1176        pub sqrt_k: u128,
1177    }
1178    #[automatically_derived]
1179    impl anchor_lang::Discriminator for MoveAmmPrice {
1180        const DISCRIMINATOR: &[u8] = &[235, 109, 2, 82, 219, 118, 6, 159];
1181    }
1182    #[automatically_derived]
1183    impl anchor_lang::InstructionData for MoveAmmPrice {}
1184    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1185    pub struct RecenterPerpMarketAmm {
1186        pub peg_multiplier: u128,
1187        pub sqrt_k: u128,
1188    }
1189    #[automatically_derived]
1190    impl anchor_lang::Discriminator for RecenterPerpMarketAmm {
1191        const DISCRIMINATOR: &[u8] = &[24, 87, 10, 115, 165, 190, 80, 139];
1192    }
1193    #[automatically_derived]
1194    impl anchor_lang::InstructionData for RecenterPerpMarketAmm {}
1195    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1196    pub struct UpdatePerpMarketAmmSummaryStats {
1197        pub params: UpdatePerpMarketSummaryStatsParams,
1198    }
1199    #[automatically_derived]
1200    impl anchor_lang::Discriminator for UpdatePerpMarketAmmSummaryStats {
1201        const DISCRIMINATOR: &[u8] = &[122, 101, 249, 238, 209, 9, 241, 245];
1202    }
1203    #[automatically_derived]
1204    impl anchor_lang::InstructionData for UpdatePerpMarketAmmSummaryStats {}
1205    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1206    pub struct UpdatePerpMarketExpiry {
1207        pub expiry_ts: i64,
1208    }
1209    #[automatically_derived]
1210    impl anchor_lang::Discriminator for UpdatePerpMarketExpiry {
1211        const DISCRIMINATOR: &[u8] = &[44, 221, 227, 151, 131, 140, 22, 110];
1212    }
1213    #[automatically_derived]
1214    impl anchor_lang::InstructionData for UpdatePerpMarketExpiry {}
1215    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1216    pub struct SettleExpiredMarketPoolsToRevenuePool {}
1217    #[automatically_derived]
1218    impl anchor_lang::Discriminator for SettleExpiredMarketPoolsToRevenuePool {
1219        const DISCRIMINATOR: &[u8] = &[55, 19, 238, 169, 227, 90, 200, 184];
1220    }
1221    #[automatically_derived]
1222    impl anchor_lang::InstructionData for SettleExpiredMarketPoolsToRevenuePool {}
1223    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1224    pub struct DepositIntoPerpMarketFeePool {
1225        pub amount: u64,
1226    }
1227    #[automatically_derived]
1228    impl anchor_lang::Discriminator for DepositIntoPerpMarketFeePool {
1229        const DISCRIMINATOR: &[u8] = &[34, 58, 57, 68, 97, 80, 244, 6];
1230    }
1231    #[automatically_derived]
1232    impl anchor_lang::InstructionData for DepositIntoPerpMarketFeePool {}
1233    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1234    pub struct DepositIntoSpotMarketVault {
1235        pub amount: u64,
1236    }
1237    #[automatically_derived]
1238    impl anchor_lang::Discriminator for DepositIntoSpotMarketVault {
1239        const DISCRIMINATOR: &[u8] = &[48, 252, 119, 73, 255, 205, 174, 247];
1240    }
1241    #[automatically_derived]
1242    impl anchor_lang::InstructionData for DepositIntoSpotMarketVault {}
1243    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1244    pub struct DepositIntoSpotMarketRevenuePool {
1245        pub amount: u64,
1246    }
1247    #[automatically_derived]
1248    impl anchor_lang::Discriminator for DepositIntoSpotMarketRevenuePool {
1249        const DISCRIMINATOR: &[u8] = &[92, 40, 151, 42, 122, 254, 139, 246];
1250    }
1251    #[automatically_derived]
1252    impl anchor_lang::InstructionData for DepositIntoSpotMarketRevenuePool {}
1253    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1254    pub struct RepegAmmCurve {
1255        pub new_peg_candidate: u128,
1256    }
1257    #[automatically_derived]
1258    impl anchor_lang::Discriminator for RepegAmmCurve {
1259        const DISCRIMINATOR: &[u8] = &[3, 36, 102, 89, 180, 128, 120, 213];
1260    }
1261    #[automatically_derived]
1262    impl anchor_lang::InstructionData for RepegAmmCurve {}
1263    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1264    pub struct UpdatePerpMarketAmmOracleTwap {}
1265    #[automatically_derived]
1266    impl anchor_lang::Discriminator for UpdatePerpMarketAmmOracleTwap {
1267        const DISCRIMINATOR: &[u8] = &[241, 74, 114, 123, 206, 153, 24, 202];
1268    }
1269    #[automatically_derived]
1270    impl anchor_lang::InstructionData for UpdatePerpMarketAmmOracleTwap {}
1271    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1272    pub struct ResetPerpMarketAmmOracleTwap {}
1273    #[automatically_derived]
1274    impl anchor_lang::Discriminator for ResetPerpMarketAmmOracleTwap {
1275        const DISCRIMINATOR: &[u8] = &[127, 10, 55, 164, 123, 226, 47, 24];
1276    }
1277    #[automatically_derived]
1278    impl anchor_lang::InstructionData for ResetPerpMarketAmmOracleTwap {}
1279    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1280    pub struct UpdateK {
1281        pub sqrt_k: u128,
1282    }
1283    #[automatically_derived]
1284    impl anchor_lang::Discriminator for UpdateK {
1285        const DISCRIMINATOR: &[u8] = &[72, 98, 9, 139, 129, 229, 172, 56];
1286    }
1287    #[automatically_derived]
1288    impl anchor_lang::InstructionData for UpdateK {}
1289    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1290    pub struct UpdatePerpMarketMarginRatio {
1291        pub margin_ratio_initial: u32,
1292        pub margin_ratio_maintenance: u32,
1293    }
1294    #[automatically_derived]
1295    impl anchor_lang::Discriminator for UpdatePerpMarketMarginRatio {
1296        const DISCRIMINATOR: &[u8] = &[130, 173, 107, 45, 119, 105, 26, 113];
1297    }
1298    #[automatically_derived]
1299    impl anchor_lang::InstructionData for UpdatePerpMarketMarginRatio {}
1300    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1301    pub struct UpdatePerpMarketHighLeverageMarginRatio {
1302        pub margin_ratio_initial: u16,
1303        pub margin_ratio_maintenance: u16,
1304    }
1305    #[automatically_derived]
1306    impl anchor_lang::Discriminator for UpdatePerpMarketHighLeverageMarginRatio {
1307        const DISCRIMINATOR: &[u8] = &[88, 112, 86, 49, 24, 116, 74, 157];
1308    }
1309    #[automatically_derived]
1310    impl anchor_lang::InstructionData for UpdatePerpMarketHighLeverageMarginRatio {}
1311    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1312    pub struct UpdatePerpMarketFundingPeriod {
1313        pub funding_period: i64,
1314    }
1315    #[automatically_derived]
1316    impl anchor_lang::Discriminator for UpdatePerpMarketFundingPeriod {
1317        const DISCRIMINATOR: &[u8] = &[171, 161, 69, 91, 129, 139, 161, 28];
1318    }
1319    #[automatically_derived]
1320    impl anchor_lang::InstructionData for UpdatePerpMarketFundingPeriod {}
1321    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1322    pub struct UpdatePerpMarketMaxImbalances {
1323        pub unrealized_max_imbalance: u64,
1324        pub max_revenue_withdraw_per_period: u64,
1325        pub quote_max_insurance: u64,
1326    }
1327    #[automatically_derived]
1328    impl anchor_lang::Discriminator for UpdatePerpMarketMaxImbalances {
1329        const DISCRIMINATOR: &[u8] = &[15, 206, 73, 133, 60, 8, 86, 89];
1330    }
1331    #[automatically_derived]
1332    impl anchor_lang::InstructionData for UpdatePerpMarketMaxImbalances {}
1333    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1334    pub struct UpdatePerpMarketLiquidationFee {
1335        pub liquidator_fee: u32,
1336        pub if_liquidation_fee: u32,
1337    }
1338    #[automatically_derived]
1339    impl anchor_lang::Discriminator for UpdatePerpMarketLiquidationFee {
1340        const DISCRIMINATOR: &[u8] = &[90, 137, 9, 145, 41, 8, 148, 117];
1341    }
1342    #[automatically_derived]
1343    impl anchor_lang::InstructionData for UpdatePerpMarketLiquidationFee {}
1344    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1345    pub struct UpdateInsuranceFundUnstakingPeriod {
1346        pub insurance_fund_unstaking_period: i64,
1347    }
1348    #[automatically_derived]
1349    impl anchor_lang::Discriminator for UpdateInsuranceFundUnstakingPeriod {
1350        const DISCRIMINATOR: &[u8] = &[44, 69, 43, 226, 204, 223, 202, 52];
1351    }
1352    #[automatically_derived]
1353    impl anchor_lang::InstructionData for UpdateInsuranceFundUnstakingPeriod {}
1354    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1355    pub struct UpdateSpotMarketPoolId {
1356        pub pool_id: u8,
1357    }
1358    #[automatically_derived]
1359    impl anchor_lang::Discriminator for UpdateSpotMarketPoolId {
1360        const DISCRIMINATOR: &[u8] = &[22, 213, 197, 160, 139, 193, 81, 149];
1361    }
1362    #[automatically_derived]
1363    impl anchor_lang::InstructionData for UpdateSpotMarketPoolId {}
1364    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1365    pub struct UpdateSpotMarketLiquidationFee {
1366        pub liquidator_fee: u32,
1367        pub if_liquidation_fee: u32,
1368    }
1369    #[automatically_derived]
1370    impl anchor_lang::Discriminator for UpdateSpotMarketLiquidationFee {
1371        const DISCRIMINATOR: &[u8] = &[11, 13, 255, 53, 56, 136, 104, 177];
1372    }
1373    #[automatically_derived]
1374    impl anchor_lang::InstructionData for UpdateSpotMarketLiquidationFee {}
1375    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1376    pub struct UpdateWithdrawGuardThreshold {
1377        pub withdraw_guard_threshold: u64,
1378    }
1379    #[automatically_derived]
1380    impl anchor_lang::Discriminator for UpdateWithdrawGuardThreshold {
1381        const DISCRIMINATOR: &[u8] = &[56, 18, 39, 61, 155, 211, 44, 133];
1382    }
1383    #[automatically_derived]
1384    impl anchor_lang::InstructionData for UpdateWithdrawGuardThreshold {}
1385    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1386    pub struct UpdateSpotMarketIfFactor {
1387        pub spot_market_index: u16,
1388        pub user_if_factor: u32,
1389        pub total_if_factor: u32,
1390    }
1391    #[automatically_derived]
1392    impl anchor_lang::Discriminator for UpdateSpotMarketIfFactor {
1393        const DISCRIMINATOR: &[u8] = &[147, 30, 224, 34, 18, 230, 105, 4];
1394    }
1395    #[automatically_derived]
1396    impl anchor_lang::InstructionData for UpdateSpotMarketIfFactor {}
1397    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1398    pub struct UpdateSpotMarketRevenueSettlePeriod {
1399        pub revenue_settle_period: i64,
1400    }
1401    #[automatically_derived]
1402    impl anchor_lang::Discriminator for UpdateSpotMarketRevenueSettlePeriod {
1403        const DISCRIMINATOR: &[u8] = &[81, 92, 126, 41, 250, 225, 156, 219];
1404    }
1405    #[automatically_derived]
1406    impl anchor_lang::InstructionData for UpdateSpotMarketRevenueSettlePeriod {}
1407    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1408    pub struct UpdateSpotMarketStatus {
1409        pub status: MarketStatus,
1410    }
1411    #[automatically_derived]
1412    impl anchor_lang::Discriminator for UpdateSpotMarketStatus {
1413        const DISCRIMINATOR: &[u8] = &[78, 94, 16, 188, 193, 110, 231, 31];
1414    }
1415    #[automatically_derived]
1416    impl anchor_lang::InstructionData for UpdateSpotMarketStatus {}
1417    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1418    pub struct UpdateSpotMarketPausedOperations {
1419        pub paused_operations: u8,
1420    }
1421    #[automatically_derived]
1422    impl anchor_lang::Discriminator for UpdateSpotMarketPausedOperations {
1423        const DISCRIMINATOR: &[u8] = &[100, 61, 153, 81, 180, 12, 6, 248];
1424    }
1425    #[automatically_derived]
1426    impl anchor_lang::InstructionData for UpdateSpotMarketPausedOperations {}
1427    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1428    pub struct UpdateSpotMarketAssetTier {
1429        pub asset_tier: AssetTier,
1430    }
1431    #[automatically_derived]
1432    impl anchor_lang::Discriminator for UpdateSpotMarketAssetTier {
1433        const DISCRIMINATOR: &[u8] = &[253, 209, 231, 14, 242, 208, 243, 130];
1434    }
1435    #[automatically_derived]
1436    impl anchor_lang::InstructionData for UpdateSpotMarketAssetTier {}
1437    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1438    pub struct UpdateSpotMarketMarginWeights {
1439        pub initial_asset_weight: u32,
1440        pub maintenance_asset_weight: u32,
1441        pub initial_liability_weight: u32,
1442        pub maintenance_liability_weight: u32,
1443        pub imf_factor: u32,
1444    }
1445    #[automatically_derived]
1446    impl anchor_lang::Discriminator for UpdateSpotMarketMarginWeights {
1447        const DISCRIMINATOR: &[u8] = &[109, 33, 87, 195, 255, 36, 6, 81];
1448    }
1449    #[automatically_derived]
1450    impl anchor_lang::InstructionData for UpdateSpotMarketMarginWeights {}
1451    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1452    pub struct UpdateSpotMarketBorrowRate {
1453        pub optimal_utilization: u32,
1454        pub optimal_borrow_rate: u32,
1455        pub max_borrow_rate: u32,
1456        pub min_borrow_rate: Option<u8>,
1457    }
1458    #[automatically_derived]
1459    impl anchor_lang::Discriminator for UpdateSpotMarketBorrowRate {
1460        const DISCRIMINATOR: &[u8] = &[71, 239, 236, 153, 210, 62, 254, 76];
1461    }
1462    #[automatically_derived]
1463    impl anchor_lang::InstructionData for UpdateSpotMarketBorrowRate {}
1464    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1465    pub struct UpdateSpotMarketMaxTokenDeposits {
1466        pub max_token_deposits: u64,
1467    }
1468    #[automatically_derived]
1469    impl anchor_lang::Discriminator for UpdateSpotMarketMaxTokenDeposits {
1470        const DISCRIMINATOR: &[u8] = &[56, 191, 79, 18, 26, 121, 80, 208];
1471    }
1472    #[automatically_derived]
1473    impl anchor_lang::InstructionData for UpdateSpotMarketMaxTokenDeposits {}
1474    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1475    pub struct UpdateSpotMarketMaxTokenBorrows {
1476        pub max_token_borrows_fraction: u16,
1477    }
1478    #[automatically_derived]
1479    impl anchor_lang::Discriminator for UpdateSpotMarketMaxTokenBorrows {
1480        const DISCRIMINATOR: &[u8] = &[57, 102, 204, 212, 253, 95, 13, 199];
1481    }
1482    #[automatically_derived]
1483    impl anchor_lang::InstructionData for UpdateSpotMarketMaxTokenBorrows {}
1484    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1485    pub struct UpdateSpotMarketScaleInitialAssetWeightStart {
1486        pub scale_initial_asset_weight_start: u64,
1487    }
1488    #[automatically_derived]
1489    impl anchor_lang::Discriminator for UpdateSpotMarketScaleInitialAssetWeightStart {
1490        const DISCRIMINATOR: &[u8] = &[217, 204, 204, 118, 204, 130, 225, 147];
1491    }
1492    #[automatically_derived]
1493    impl anchor_lang::InstructionData for UpdateSpotMarketScaleInitialAssetWeightStart {}
1494    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1495    pub struct UpdateSpotMarketOracle {
1496        pub oracle: Pubkey,
1497        pub oracle_source: OracleSource,
1498        pub skip_invariant_check: bool,
1499    }
1500    #[automatically_derived]
1501    impl anchor_lang::Discriminator for UpdateSpotMarketOracle {
1502        const DISCRIMINATOR: &[u8] = &[114, 184, 102, 37, 246, 186, 180, 99];
1503    }
1504    #[automatically_derived]
1505    impl anchor_lang::InstructionData for UpdateSpotMarketOracle {}
1506    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1507    pub struct UpdateSpotMarketStepSizeAndTickSize {
1508        pub step_size: u64,
1509        pub tick_size: u64,
1510    }
1511    #[automatically_derived]
1512    impl anchor_lang::Discriminator for UpdateSpotMarketStepSizeAndTickSize {
1513        const DISCRIMINATOR: &[u8] = &[238, 153, 137, 80, 206, 59, 250, 61];
1514    }
1515    #[automatically_derived]
1516    impl anchor_lang::InstructionData for UpdateSpotMarketStepSizeAndTickSize {}
1517    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1518    pub struct UpdateSpotMarketMinOrderSize {
1519        pub order_size: u64,
1520    }
1521    #[automatically_derived]
1522    impl anchor_lang::Discriminator for UpdateSpotMarketMinOrderSize {
1523        const DISCRIMINATOR: &[u8] = &[93, 128, 11, 119, 26, 20, 181, 50];
1524    }
1525    #[automatically_derived]
1526    impl anchor_lang::InstructionData for UpdateSpotMarketMinOrderSize {}
1527    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1528    pub struct UpdateSpotMarketOrdersEnabled {
1529        pub orders_enabled: bool,
1530    }
1531    #[automatically_derived]
1532    impl anchor_lang::Discriminator for UpdateSpotMarketOrdersEnabled {
1533        const DISCRIMINATOR: &[u8] = &[190, 79, 206, 15, 26, 229, 229, 43];
1534    }
1535    #[automatically_derived]
1536    impl anchor_lang::InstructionData for UpdateSpotMarketOrdersEnabled {}
1537    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1538    pub struct UpdateSpotMarketIfPausedOperations {
1539        pub paused_operations: u8,
1540    }
1541    #[automatically_derived]
1542    impl anchor_lang::Discriminator for UpdateSpotMarketIfPausedOperations {
1543        const DISCRIMINATOR: &[u8] = &[101, 215, 79, 74, 59, 41, 79, 12];
1544    }
1545    #[automatically_derived]
1546    impl anchor_lang::InstructionData for UpdateSpotMarketIfPausedOperations {}
1547    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1548    pub struct UpdateSpotMarketName {
1549        pub name: [u8; 32],
1550    }
1551    #[automatically_derived]
1552    impl anchor_lang::Discriminator for UpdateSpotMarketName {
1553        const DISCRIMINATOR: &[u8] = &[17, 208, 1, 1, 162, 211, 188, 224];
1554    }
1555    #[automatically_derived]
1556    impl anchor_lang::InstructionData for UpdateSpotMarketName {}
1557    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1558    pub struct UpdatePerpMarketStatus {
1559        pub status: MarketStatus,
1560    }
1561    #[automatically_derived]
1562    impl anchor_lang::Discriminator for UpdatePerpMarketStatus {
1563        const DISCRIMINATOR: &[u8] = &[71, 201, 175, 122, 255, 207, 196, 207];
1564    }
1565    #[automatically_derived]
1566    impl anchor_lang::InstructionData for UpdatePerpMarketStatus {}
1567    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1568    pub struct UpdatePerpMarketPausedOperations {
1569        pub paused_operations: u8,
1570    }
1571    #[automatically_derived]
1572    impl anchor_lang::Discriminator for UpdatePerpMarketPausedOperations {
1573        const DISCRIMINATOR: &[u8] = &[53, 16, 136, 132, 30, 220, 121, 85];
1574    }
1575    #[automatically_derived]
1576    impl anchor_lang::InstructionData for UpdatePerpMarketPausedOperations {}
1577    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1578    pub struct UpdatePerpMarketContractTier {
1579        pub contract_tier: ContractTier,
1580    }
1581    #[automatically_derived]
1582    impl anchor_lang::Discriminator for UpdatePerpMarketContractTier {
1583        const DISCRIMINATOR: &[u8] = &[236, 128, 15, 95, 203, 214, 68, 117];
1584    }
1585    #[automatically_derived]
1586    impl anchor_lang::InstructionData for UpdatePerpMarketContractTier {}
1587    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1588    pub struct UpdatePerpMarketImfFactor {
1589        pub imf_factor: u32,
1590        pub unrealized_pnl_imf_factor: u32,
1591    }
1592    #[automatically_derived]
1593    impl anchor_lang::Discriminator for UpdatePerpMarketImfFactor {
1594        const DISCRIMINATOR: &[u8] = &[207, 194, 56, 132, 35, 67, 71, 244];
1595    }
1596    #[automatically_derived]
1597    impl anchor_lang::InstructionData for UpdatePerpMarketImfFactor {}
1598    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1599    pub struct UpdatePerpMarketUnrealizedAssetWeight {
1600        pub unrealized_initial_asset_weight: u32,
1601        pub unrealized_maintenance_asset_weight: u32,
1602    }
1603    #[automatically_derived]
1604    impl anchor_lang::Discriminator for UpdatePerpMarketUnrealizedAssetWeight {
1605        const DISCRIMINATOR: &[u8] = &[135, 132, 205, 165, 109, 150, 166, 106];
1606    }
1607    #[automatically_derived]
1608    impl anchor_lang::InstructionData for UpdatePerpMarketUnrealizedAssetWeight {}
1609    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1610    pub struct UpdatePerpMarketConcentrationCoef {
1611        pub concentration_scale: u128,
1612    }
1613    #[automatically_derived]
1614    impl anchor_lang::Discriminator for UpdatePerpMarketConcentrationCoef {
1615        const DISCRIMINATOR: &[u8] = &[24, 78, 232, 126, 169, 176, 230, 16];
1616    }
1617    #[automatically_derived]
1618    impl anchor_lang::InstructionData for UpdatePerpMarketConcentrationCoef {}
1619    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1620    pub struct UpdatePerpMarketCurveUpdateIntensity {
1621        pub curve_update_intensity: u8,
1622    }
1623    #[automatically_derived]
1624    impl anchor_lang::Discriminator for UpdatePerpMarketCurveUpdateIntensity {
1625        const DISCRIMINATOR: &[u8] = &[50, 131, 6, 156, 226, 231, 189, 72];
1626    }
1627    #[automatically_derived]
1628    impl anchor_lang::InstructionData for UpdatePerpMarketCurveUpdateIntensity {}
1629    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1630    pub struct UpdatePerpMarketTargetBaseAssetAmountPerLp {
1631        pub target_base_asset_amount_per_lp: i32,
1632    }
1633    #[automatically_derived]
1634    impl anchor_lang::Discriminator for UpdatePerpMarketTargetBaseAssetAmountPerLp {
1635        const DISCRIMINATOR: &[u8] = &[62, 87, 68, 115, 29, 150, 150, 165];
1636    }
1637    #[automatically_derived]
1638    impl anchor_lang::InstructionData for UpdatePerpMarketTargetBaseAssetAmountPerLp {}
1639    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1640    pub struct UpdatePerpMarketPerLpBase {
1641        pub per_lp_base: i8,
1642    }
1643    #[automatically_derived]
1644    impl anchor_lang::Discriminator for UpdatePerpMarketPerLpBase {
1645        const DISCRIMINATOR: &[u8] = &[103, 152, 103, 102, 89, 144, 193, 71];
1646    }
1647    #[automatically_derived]
1648    impl anchor_lang::InstructionData for UpdatePerpMarketPerLpBase {}
1649    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1650    pub struct UpdateLpCooldownTime {
1651        pub lp_cooldown_time: u64,
1652    }
1653    #[automatically_derived]
1654    impl anchor_lang::Discriminator for UpdateLpCooldownTime {
1655        const DISCRIMINATOR: &[u8] = &[198, 133, 88, 41, 241, 119, 61, 14];
1656    }
1657    #[automatically_derived]
1658    impl anchor_lang::InstructionData for UpdateLpCooldownTime {}
1659    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1660    pub struct UpdatePerpFeeStructure {
1661        pub fee_structure: FeeStructure,
1662    }
1663    #[automatically_derived]
1664    impl anchor_lang::Discriminator for UpdatePerpFeeStructure {
1665        const DISCRIMINATOR: &[u8] = &[23, 178, 111, 203, 73, 22, 140, 75];
1666    }
1667    #[automatically_derived]
1668    impl anchor_lang::InstructionData for UpdatePerpFeeStructure {}
1669    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1670    pub struct UpdateSpotFeeStructure {
1671        pub fee_structure: FeeStructure,
1672    }
1673    #[automatically_derived]
1674    impl anchor_lang::Discriminator for UpdateSpotFeeStructure {
1675        const DISCRIMINATOR: &[u8] = &[97, 216, 105, 131, 113, 246, 142, 141];
1676    }
1677    #[automatically_derived]
1678    impl anchor_lang::InstructionData for UpdateSpotFeeStructure {}
1679    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1680    pub struct UpdateInitialPctToLiquidate {
1681        pub initial_pct_to_liquidate: u16,
1682    }
1683    #[automatically_derived]
1684    impl anchor_lang::Discriminator for UpdateInitialPctToLiquidate {
1685        const DISCRIMINATOR: &[u8] = &[210, 133, 225, 128, 194, 50, 13, 109];
1686    }
1687    #[automatically_derived]
1688    impl anchor_lang::InstructionData for UpdateInitialPctToLiquidate {}
1689    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1690    pub struct UpdateLiquidationDuration {
1691        pub liquidation_duration: u8,
1692    }
1693    #[automatically_derived]
1694    impl anchor_lang::Discriminator for UpdateLiquidationDuration {
1695        const DISCRIMINATOR: &[u8] = &[28, 154, 20, 249, 102, 192, 73, 71];
1696    }
1697    #[automatically_derived]
1698    impl anchor_lang::InstructionData for UpdateLiquidationDuration {}
1699    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1700    pub struct UpdateLiquidationMarginBufferRatio {
1701        pub liquidation_margin_buffer_ratio: u32,
1702    }
1703    #[automatically_derived]
1704    impl anchor_lang::Discriminator for UpdateLiquidationMarginBufferRatio {
1705        const DISCRIMINATOR: &[u8] = &[132, 224, 243, 160, 154, 82, 97, 215];
1706    }
1707    #[automatically_derived]
1708    impl anchor_lang::InstructionData for UpdateLiquidationMarginBufferRatio {}
1709    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1710    pub struct UpdateOracleGuardRails {
1711        pub oracle_guard_rails: OracleGuardRails,
1712    }
1713    #[automatically_derived]
1714    impl anchor_lang::Discriminator for UpdateOracleGuardRails {
1715        const DISCRIMINATOR: &[u8] = &[131, 112, 10, 59, 32, 54, 40, 164];
1716    }
1717    #[automatically_derived]
1718    impl anchor_lang::InstructionData for UpdateOracleGuardRails {}
1719    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1720    pub struct UpdateStateSettlementDuration {
1721        pub settlement_duration: u16,
1722    }
1723    #[automatically_derived]
1724    impl anchor_lang::Discriminator for UpdateStateSettlementDuration {
1725        const DISCRIMINATOR: &[u8] = &[97, 68, 199, 235, 131, 80, 61, 173];
1726    }
1727    #[automatically_derived]
1728    impl anchor_lang::InstructionData for UpdateStateSettlementDuration {}
1729    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1730    pub struct UpdateStateMaxNumberOfSubAccounts {
1731        pub max_number_of_sub_accounts: u16,
1732    }
1733    #[automatically_derived]
1734    impl anchor_lang::Discriminator for UpdateStateMaxNumberOfSubAccounts {
1735        const DISCRIMINATOR: &[u8] = &[155, 123, 214, 2, 221, 166, 204, 85];
1736    }
1737    #[automatically_derived]
1738    impl anchor_lang::InstructionData for UpdateStateMaxNumberOfSubAccounts {}
1739    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1740    pub struct UpdateStateMaxInitializeUserFee {
1741        pub max_initialize_user_fee: u16,
1742    }
1743    #[automatically_derived]
1744    impl anchor_lang::Discriminator for UpdateStateMaxInitializeUserFee {
1745        const DISCRIMINATOR: &[u8] = &[237, 225, 25, 237, 193, 45, 77, 97];
1746    }
1747    #[automatically_derived]
1748    impl anchor_lang::InstructionData for UpdateStateMaxInitializeUserFee {}
1749    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1750    pub struct UpdatePerpMarketOracle {
1751        pub oracle: Pubkey,
1752        pub oracle_source: OracleSource,
1753        pub skip_invariant_check: bool,
1754    }
1755    #[automatically_derived]
1756    impl anchor_lang::Discriminator for UpdatePerpMarketOracle {
1757        const DISCRIMINATOR: &[u8] = &[182, 113, 111, 160, 67, 174, 89, 191];
1758    }
1759    #[automatically_derived]
1760    impl anchor_lang::InstructionData for UpdatePerpMarketOracle {}
1761    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1762    pub struct UpdatePerpMarketBaseSpread {
1763        pub base_spread: u32,
1764    }
1765    #[automatically_derived]
1766    impl anchor_lang::Discriminator for UpdatePerpMarketBaseSpread {
1767        const DISCRIMINATOR: &[u8] = &[71, 95, 84, 168, 9, 157, 198, 65];
1768    }
1769    #[automatically_derived]
1770    impl anchor_lang::InstructionData for UpdatePerpMarketBaseSpread {}
1771    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1772    pub struct UpdateAmmJitIntensity {
1773        pub amm_jit_intensity: u8,
1774    }
1775    #[automatically_derived]
1776    impl anchor_lang::Discriminator for UpdateAmmJitIntensity {
1777        const DISCRIMINATOR: &[u8] = &[181, 191, 53, 109, 166, 249, 55, 142];
1778    }
1779    #[automatically_derived]
1780    impl anchor_lang::InstructionData for UpdateAmmJitIntensity {}
1781    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1782    pub struct UpdatePerpMarketMaxSpread {
1783        pub max_spread: u32,
1784    }
1785    #[automatically_derived]
1786    impl anchor_lang::Discriminator for UpdatePerpMarketMaxSpread {
1787        const DISCRIMINATOR: &[u8] = &[80, 252, 122, 62, 40, 218, 91, 100];
1788    }
1789    #[automatically_derived]
1790    impl anchor_lang::InstructionData for UpdatePerpMarketMaxSpread {}
1791    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1792    pub struct UpdatePerpMarketStepSizeAndTickSize {
1793        pub step_size: u64,
1794        pub tick_size: u64,
1795    }
1796    #[automatically_derived]
1797    impl anchor_lang::Discriminator for UpdatePerpMarketStepSizeAndTickSize {
1798        const DISCRIMINATOR: &[u8] = &[231, 255, 97, 25, 146, 139, 174, 4];
1799    }
1800    #[automatically_derived]
1801    impl anchor_lang::InstructionData for UpdatePerpMarketStepSizeAndTickSize {}
1802    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1803    pub struct UpdatePerpMarketName {
1804        pub name: [u8; 32],
1805    }
1806    #[automatically_derived]
1807    impl anchor_lang::Discriminator for UpdatePerpMarketName {
1808        const DISCRIMINATOR: &[u8] = &[211, 31, 21, 210, 64, 108, 66, 201];
1809    }
1810    #[automatically_derived]
1811    impl anchor_lang::InstructionData for UpdatePerpMarketName {}
1812    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1813    pub struct UpdatePerpMarketMinOrderSize {
1814        pub order_size: u64,
1815    }
1816    #[automatically_derived]
1817    impl anchor_lang::Discriminator for UpdatePerpMarketMinOrderSize {
1818        const DISCRIMINATOR: &[u8] = &[226, 74, 5, 89, 108, 223, 46, 141];
1819    }
1820    #[automatically_derived]
1821    impl anchor_lang::InstructionData for UpdatePerpMarketMinOrderSize {}
1822    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1823    pub struct UpdatePerpMarketMaxSlippageRatio {
1824        pub max_slippage_ratio: u16,
1825    }
1826    #[automatically_derived]
1827    impl anchor_lang::Discriminator for UpdatePerpMarketMaxSlippageRatio {
1828        const DISCRIMINATOR: &[u8] = &[235, 37, 40, 196, 70, 146, 54, 201];
1829    }
1830    #[automatically_derived]
1831    impl anchor_lang::InstructionData for UpdatePerpMarketMaxSlippageRatio {}
1832    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1833    pub struct UpdatePerpMarketMaxFillReserveFraction {
1834        pub max_fill_reserve_fraction: u16,
1835    }
1836    #[automatically_derived]
1837    impl anchor_lang::Discriminator for UpdatePerpMarketMaxFillReserveFraction {
1838        const DISCRIMINATOR: &[u8] = &[19, 172, 114, 154, 42, 135, 161, 133];
1839    }
1840    #[automatically_derived]
1841    impl anchor_lang::InstructionData for UpdatePerpMarketMaxFillReserveFraction {}
1842    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1843    pub struct UpdatePerpMarketMaxOpenInterest {
1844        pub max_open_interest: u128,
1845    }
1846    #[automatically_derived]
1847    impl anchor_lang::Discriminator for UpdatePerpMarketMaxOpenInterest {
1848        const DISCRIMINATOR: &[u8] = &[194, 79, 149, 224, 246, 102, 186, 140];
1849    }
1850    #[automatically_derived]
1851    impl anchor_lang::InstructionData for UpdatePerpMarketMaxOpenInterest {}
1852    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1853    pub struct UpdatePerpMarketNumberOfUsers {
1854        pub number_of_users: Option<u32>,
1855        pub number_of_users_with_base: Option<u32>,
1856    }
1857    #[automatically_derived]
1858    impl anchor_lang::Discriminator for UpdatePerpMarketNumberOfUsers {
1859        const DISCRIMINATOR: &[u8] = &[35, 62, 144, 177, 180, 62, 215, 196];
1860    }
1861    #[automatically_derived]
1862    impl anchor_lang::InstructionData for UpdatePerpMarketNumberOfUsers {}
1863    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1864    pub struct UpdatePerpMarketFeeAdjustment {
1865        pub fee_adjustment: i16,
1866    }
1867    #[automatically_derived]
1868    impl anchor_lang::Discriminator for UpdatePerpMarketFeeAdjustment {
1869        const DISCRIMINATOR: &[u8] = &[194, 174, 87, 102, 43, 148, 32, 112];
1870    }
1871    #[automatically_derived]
1872    impl anchor_lang::InstructionData for UpdatePerpMarketFeeAdjustment {}
1873    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1874    pub struct UpdateSpotMarketFeeAdjustment {
1875        pub fee_adjustment: i16,
1876    }
1877    #[automatically_derived]
1878    impl anchor_lang::Discriminator for UpdateSpotMarketFeeAdjustment {
1879        const DISCRIMINATOR: &[u8] = &[148, 182, 3, 126, 157, 114, 220, 99];
1880    }
1881    #[automatically_derived]
1882    impl anchor_lang::InstructionData for UpdateSpotMarketFeeAdjustment {}
1883    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1884    pub struct UpdatePerpMarketFuel {
1885        pub fuel_boost_taker: Option<u8>,
1886        pub fuel_boost_maker: Option<u8>,
1887        pub fuel_boost_position: Option<u8>,
1888    }
1889    #[automatically_derived]
1890    impl anchor_lang::Discriminator for UpdatePerpMarketFuel {
1891        const DISCRIMINATOR: &[u8] = &[252, 141, 110, 101, 27, 99, 182, 21];
1892    }
1893    #[automatically_derived]
1894    impl anchor_lang::InstructionData for UpdatePerpMarketFuel {}
1895    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1896    pub struct UpdateSpotMarketFuel {
1897        pub fuel_boost_deposits: Option<u8>,
1898        pub fuel_boost_borrows: Option<u8>,
1899        pub fuel_boost_taker: Option<u8>,
1900        pub fuel_boost_maker: Option<u8>,
1901        pub fuel_boost_insurance: Option<u8>,
1902    }
1903    #[automatically_derived]
1904    impl anchor_lang::Discriminator for UpdateSpotMarketFuel {
1905        const DISCRIMINATOR: &[u8] = &[226, 253, 76, 71, 17, 2, 171, 169];
1906    }
1907    #[automatically_derived]
1908    impl anchor_lang::InstructionData for UpdateSpotMarketFuel {}
1909    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1910    pub struct InitUserFuel {
1911        pub fuel_boost_deposits: Option<i32>,
1912        pub fuel_boost_borrows: Option<u32>,
1913        pub fuel_boost_taker: Option<u32>,
1914        pub fuel_boost_maker: Option<u32>,
1915        pub fuel_boost_insurance: Option<u32>,
1916    }
1917    #[automatically_derived]
1918    impl anchor_lang::Discriminator for InitUserFuel {
1919        const DISCRIMINATOR: &[u8] = &[132, 191, 228, 141, 201, 138, 60, 48];
1920    }
1921    #[automatically_derived]
1922    impl anchor_lang::InstructionData for InitUserFuel {}
1923    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1924    pub struct UpdateAdmin {
1925        pub admin: Pubkey,
1926    }
1927    #[automatically_derived]
1928    impl anchor_lang::Discriminator for UpdateAdmin {
1929        const DISCRIMINATOR: &[u8] = &[161, 176, 40, 213, 60, 184, 179, 228];
1930    }
1931    #[automatically_derived]
1932    impl anchor_lang::InstructionData for UpdateAdmin {}
1933    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1934    pub struct UpdateWhitelistMint {
1935        pub whitelist_mint: Pubkey,
1936    }
1937    #[automatically_derived]
1938    impl anchor_lang::Discriminator for UpdateWhitelistMint {
1939        const DISCRIMINATOR: &[u8] = &[161, 15, 162, 19, 148, 120, 144, 151];
1940    }
1941    #[automatically_derived]
1942    impl anchor_lang::InstructionData for UpdateWhitelistMint {}
1943    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1944    pub struct UpdateDiscountMint {
1945        pub discount_mint: Pubkey,
1946    }
1947    #[automatically_derived]
1948    impl anchor_lang::Discriminator for UpdateDiscountMint {
1949        const DISCRIMINATOR: &[u8] = &[32, 252, 122, 211, 66, 31, 47, 241];
1950    }
1951    #[automatically_derived]
1952    impl anchor_lang::InstructionData for UpdateDiscountMint {}
1953    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1954    pub struct UpdateExchangeStatus {
1955        pub exchange_status: u8,
1956    }
1957    #[automatically_derived]
1958    impl anchor_lang::Discriminator for UpdateExchangeStatus {
1959        const DISCRIMINATOR: &[u8] = &[83, 160, 252, 250, 129, 116, 49, 223];
1960    }
1961    #[automatically_derived]
1962    impl anchor_lang::InstructionData for UpdateExchangeStatus {}
1963    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1964    pub struct UpdatePerpAuctionDuration {
1965        pub min_perp_auction_duration: u8,
1966    }
1967    #[automatically_derived]
1968    impl anchor_lang::Discriminator for UpdatePerpAuctionDuration {
1969        const DISCRIMINATOR: &[u8] = &[126, 110, 52, 174, 30, 206, 215, 90];
1970    }
1971    #[automatically_derived]
1972    impl anchor_lang::InstructionData for UpdatePerpAuctionDuration {}
1973    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1974    pub struct UpdateSpotAuctionDuration {
1975        pub default_spot_auction_duration: u8,
1976    }
1977    #[automatically_derived]
1978    impl anchor_lang::Discriminator for UpdateSpotAuctionDuration {
1979        const DISCRIMINATOR: &[u8] = &[182, 178, 203, 72, 187, 143, 157, 107];
1980    }
1981    #[automatically_derived]
1982    impl anchor_lang::InstructionData for UpdateSpotAuctionDuration {}
1983    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1984    pub struct InitializeProtocolIfSharesTransferConfig {}
1985    #[automatically_derived]
1986    impl anchor_lang::Discriminator for InitializeProtocolIfSharesTransferConfig {
1987        const DISCRIMINATOR: &[u8] = &[89, 131, 239, 200, 178, 141, 106, 194];
1988    }
1989    #[automatically_derived]
1990    impl anchor_lang::InstructionData for InitializeProtocolIfSharesTransferConfig {}
1991    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1992    pub struct UpdateProtocolIfSharesTransferConfig {
1993        pub whitelisted_signers: Option<[Pubkey; 4]>,
1994        pub max_transfer_per_epoch: Option<u128>,
1995    }
1996    #[automatically_derived]
1997    impl anchor_lang::Discriminator for UpdateProtocolIfSharesTransferConfig {
1998        const DISCRIMINATOR: &[u8] = &[34, 135, 47, 91, 220, 24, 212, 53];
1999    }
2000    #[automatically_derived]
2001    impl anchor_lang::InstructionData for UpdateProtocolIfSharesTransferConfig {}
2002    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
2003    pub struct InitializePrelaunchOracle {
2004        pub params: PrelaunchOracleParams,
2005    }
2006    #[automatically_derived]
2007    impl anchor_lang::Discriminator for InitializePrelaunchOracle {
2008        const DISCRIMINATOR: &[u8] = &[169, 178, 84, 25, 175, 62, 29, 247];
2009    }
2010    #[automatically_derived]
2011    impl anchor_lang::InstructionData for InitializePrelaunchOracle {}
2012    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
2013    pub struct UpdatePrelaunchOracleParams {
2014        pub params: PrelaunchOracleParams,
2015    }
2016    #[automatically_derived]
2017    impl anchor_lang::Discriminator for UpdatePrelaunchOracleParams {
2018        const DISCRIMINATOR: &[u8] = &[98, 205, 147, 243, 18, 75, 83, 207];
2019    }
2020    #[automatically_derived]
2021    impl anchor_lang::InstructionData for UpdatePrelaunchOracleParams {}
2022    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
2023    pub struct DeletePrelaunchOracle {
2024        pub perp_market_index: u16,
2025    }
2026    #[automatically_derived]
2027    impl anchor_lang::Discriminator for DeletePrelaunchOracle {
2028        const DISCRIMINATOR: &[u8] = &[59, 169, 100, 49, 69, 17, 173, 253];
2029    }
2030    #[automatically_derived]
2031    impl anchor_lang::InstructionData for DeletePrelaunchOracle {}
2032    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
2033    pub struct InitializePythPullOracle {
2034        pub feed_id: [u8; 32],
2035    }
2036    #[automatically_derived]
2037    impl anchor_lang::Discriminator for InitializePythPullOracle {
2038        const DISCRIMINATOR: &[u8] = &[249, 140, 253, 243, 248, 74, 240, 238];
2039    }
2040    #[automatically_derived]
2041    impl anchor_lang::InstructionData for InitializePythPullOracle {}
2042    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
2043    pub struct InitializePythLazerOracle {
2044        pub feed_id: u32,
2045    }
2046    #[automatically_derived]
2047    impl anchor_lang::Discriminator for InitializePythLazerOracle {
2048        const DISCRIMINATOR: &[u8] = &[140, 107, 33, 214, 235, 219, 103, 20];
2049    }
2050    #[automatically_derived]
2051    impl anchor_lang::InstructionData for InitializePythLazerOracle {}
2052    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
2053    pub struct PostPythLazerOracleUpdate {
2054        pub pyth_message: Vec<u8>,
2055    }
2056    #[automatically_derived]
2057    impl anchor_lang::Discriminator for PostPythLazerOracleUpdate {
2058        const DISCRIMINATOR: &[u8] = &[218, 237, 170, 245, 39, 143, 166, 33];
2059    }
2060    #[automatically_derived]
2061    impl anchor_lang::InstructionData for PostPythLazerOracleUpdate {}
2062    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
2063    pub struct InitializeHighLeverageModeConfig {
2064        pub max_users: u32,
2065    }
2066    #[automatically_derived]
2067    impl anchor_lang::Discriminator for InitializeHighLeverageModeConfig {
2068        const DISCRIMINATOR: &[u8] = &[213, 167, 93, 246, 208, 130, 90, 248];
2069    }
2070    #[automatically_derived]
2071    impl anchor_lang::InstructionData for InitializeHighLeverageModeConfig {}
2072    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
2073    pub struct UpdateHighLeverageModeConfig {
2074        pub max_users: u32,
2075        pub reduce_only: bool,
2076    }
2077    #[automatically_derived]
2078    impl anchor_lang::Discriminator for UpdateHighLeverageModeConfig {
2079        const DISCRIMINATOR: &[u8] = &[64, 122, 212, 93, 141, 217, 202, 55];
2080    }
2081    #[automatically_derived]
2082    impl anchor_lang::InstructionData for UpdateHighLeverageModeConfig {}
2083    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
2084    pub struct InitializeProtectedMakerModeConfig {
2085        pub max_users: u32,
2086    }
2087    #[automatically_derived]
2088    impl anchor_lang::Discriminator for InitializeProtectedMakerModeConfig {
2089        const DISCRIMINATOR: &[u8] = &[67, 103, 220, 67, 88, 32, 252, 8];
2090    }
2091    #[automatically_derived]
2092    impl anchor_lang::InstructionData for InitializeProtectedMakerModeConfig {}
2093    #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
2094    pub struct UpdateProtectedMakerModeConfig {
2095        pub max_users: u32,
2096        pub reduce_only: bool,
2097        pub current_users: Option<u32>,
2098    }
2099    #[automatically_derived]
2100    impl anchor_lang::Discriminator for UpdateProtectedMakerModeConfig {
2101        const DISCRIMINATOR: &[u8] = &[86, 166, 235, 253, 67, 202, 223, 17];
2102    }
2103    #[automatically_derived]
2104    impl anchor_lang::InstructionData for UpdateProtectedMakerModeConfig {}
2105}
2106pub mod types {
2107    #![doc = r" IDL types"]
2108    use super::*;
2109    use std::ops::Mul;
2110    #[doc = ""]
2111    #[doc = " backwards compatible u128 deserializing data from rust <=1.76.0 when u/i128 was 8-byte aligned"]
2112    #[doc = " https://solana.stackexchange.com/questions/7720/using-u128-without-sacrificing-alignment-8"]
2113    #[derive(
2114        Default,
2115        PartialEq,
2116        AnchorSerialize,
2117        AnchorDeserialize,
2118        Serialize,
2119        Deserialize,
2120        Copy,
2121        Clone,
2122        bytemuck :: Zeroable,
2123        bytemuck :: Pod,
2124        Debug,
2125    )]
2126    #[repr(C)]
2127    pub struct u128(pub [u8; 16]);
2128    impl u128 {
2129        #[doc = " convert self into the std `u128` type"]
2130        pub fn as_u128(&self) -> std::primitive::u128 {
2131            std::primitive::u128::from_le_bytes(self.0)
2132        }
2133    }
2134    impl From<std::primitive::u128> for self::u128 {
2135        fn from(value: std::primitive::u128) -> Self {
2136            Self(value.to_le_bytes())
2137        }
2138    }
2139    #[doc = " backwards compatible i128 deserializing data from rust <=1.76.0 when u/i128 was 8-byte aligned"]
2140    #[doc = " https://solana.stackexchange.com/questions/7720/using-u128-without-sacrificing-alignment-8"]
2141    #[derive(
2142        Default,
2143        PartialEq,
2144        AnchorSerialize,
2145        AnchorDeserialize,
2146        Serialize,
2147        Deserialize,
2148        Copy,
2149        Clone,
2150        bytemuck :: Zeroable,
2151        bytemuck :: Pod,
2152        Debug,
2153    )]
2154    #[repr(C)]
2155    pub struct i128(pub [u8; 16]);
2156    impl i128 {
2157        #[doc = " convert self into the std `i128` type"]
2158        pub fn as_i128(&self) -> core::primitive::i128 {
2159            core::primitive::i128::from_le_bytes(self.0)
2160        }
2161    }
2162    impl From<core::primitive::i128> for i128 {
2163        fn from(value: core::primitive::i128) -> Self {
2164            Self(value.to_le_bytes())
2165        }
2166    }
2167    #[repr(transparent)]
2168    #[derive(AnchorDeserialize, AnchorSerialize, Copy, Clone, PartialEq, Debug)]
2169    pub struct Signature(pub [u8; 64]);
2170    impl Default for Signature {
2171        fn default() -> Self {
2172            Self([0_u8; 64])
2173        }
2174    }
2175    impl serde::Serialize for Signature {
2176        fn serialize<S: serde::Serializer>(
2177            &self,
2178            serializer: S,
2179        ) -> std::result::Result<S::Ok, S::Error> {
2180            serializer.serialize_bytes(&self.0)
2181        }
2182    }
2183    impl<'de> serde::Deserialize<'de> for Signature {
2184        fn deserialize<D: serde::Deserializer<'de>>(d: D) -> std::result::Result<Self, D::Error> {
2185            let s = <&[u8]>::deserialize(d)?;
2186            s.try_into()
2187                .map(Signature)
2188                .map_err(serde::de::Error::custom)
2189        }
2190    }
2191    impl anchor_lang::Space for Signature {
2192        const INIT_SPACE: usize = 8 * 64;
2193    }
2194    #[doc = " wrapper around fixed array types used for padding with `Default` implementation"]
2195    #[repr(transparent)]
2196    #[derive(AnchorDeserialize, AnchorSerialize, Copy, Clone, PartialEq)]
2197    pub struct Padding<const N: usize>([u8; N]);
2198    impl<const N: usize> Default for Padding<N> {
2199        fn default() -> Self {
2200            Self([0u8; N])
2201        }
2202    }
2203    impl<const N: usize> std::fmt::Debug for Padding<N> {
2204        fn fmt(&self, _f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2205            Ok(())
2206        }
2207    }
2208    impl<const N: usize> anchor_lang::Space for Padding<N> {
2209        const INIT_SPACE: usize = 8 * N;
2210    }
2211    #[repr(C)]
2212    #[derive(
2213        AnchorSerialize,
2214        AnchorDeserialize,
2215        InitSpace,
2216        Serialize,
2217        Deserialize,
2218        Copy,
2219        Clone,
2220        Default,
2221        Debug,
2222        PartialEq,
2223    )]
2224    pub struct UpdatePerpMarketSummaryStatsParams {
2225        pub quote_asset_amount_with_unsettled_lp: Option<i64>,
2226        pub net_unsettled_funding_pnl: Option<i64>,
2227        pub update_amm_summary_stats: Option<bool>,
2228        pub exclude_total_liq_fee: Option<bool>,
2229    }
2230    #[repr(C)]
2231    #[derive(
2232        AnchorSerialize,
2233        AnchorDeserialize,
2234        InitSpace,
2235        Serialize,
2236        Deserialize,
2237        Copy,
2238        Clone,
2239        Default,
2240        Debug,
2241        PartialEq,
2242    )]
2243    pub struct LiquidatePerpRecord {
2244        pub market_index: u16,
2245        pub oracle_price: i64,
2246        pub base_asset_amount: i64,
2247        pub quote_asset_amount: i64,
2248        pub lp_shares: u64,
2249        pub fill_record_id: u64,
2250        pub user_order_id: u32,
2251        pub liquidator_order_id: u32,
2252        pub liquidator_fee: u64,
2253        pub if_fee: u64,
2254    }
2255    #[repr(C)]
2256    #[derive(
2257        AnchorSerialize,
2258        AnchorDeserialize,
2259        InitSpace,
2260        Serialize,
2261        Deserialize,
2262        Copy,
2263        Clone,
2264        Default,
2265        Debug,
2266        PartialEq,
2267    )]
2268    pub struct LiquidateSpotRecord {
2269        pub asset_market_index: u16,
2270        pub asset_price: i64,
2271        pub asset_transfer: u128,
2272        pub liability_market_index: u16,
2273        pub liability_price: i64,
2274        pub liability_transfer: u128,
2275        pub if_fee: u64,
2276    }
2277    #[repr(C)]
2278    #[derive(
2279        AnchorSerialize,
2280        AnchorDeserialize,
2281        InitSpace,
2282        Serialize,
2283        Deserialize,
2284        Copy,
2285        Clone,
2286        Default,
2287        Debug,
2288        PartialEq,
2289    )]
2290    pub struct LiquidateBorrowForPerpPnlRecord {
2291        pub perp_market_index: u16,
2292        pub market_oracle_price: i64,
2293        pub pnl_transfer: u128,
2294        pub liability_market_index: u16,
2295        pub liability_price: i64,
2296        pub liability_transfer: u128,
2297    }
2298    #[repr(C)]
2299    #[derive(
2300        AnchorSerialize,
2301        AnchorDeserialize,
2302        InitSpace,
2303        Serialize,
2304        Deserialize,
2305        Copy,
2306        Clone,
2307        Default,
2308        Debug,
2309        PartialEq,
2310    )]
2311    pub struct LiquidatePerpPnlForDepositRecord {
2312        pub perp_market_index: u16,
2313        pub market_oracle_price: i64,
2314        pub pnl_transfer: u128,
2315        pub asset_market_index: u16,
2316        pub asset_price: i64,
2317        pub asset_transfer: u128,
2318    }
2319    #[repr(C)]
2320    #[derive(
2321        AnchorSerialize,
2322        AnchorDeserialize,
2323        InitSpace,
2324        Serialize,
2325        Deserialize,
2326        Copy,
2327        Clone,
2328        Default,
2329        Debug,
2330        PartialEq,
2331    )]
2332    pub struct PerpBankruptcyRecord {
2333        pub market_index: u16,
2334        pub pnl: i128,
2335        pub if_payment: u128,
2336        pub clawback_user: Option<Pubkey>,
2337        pub clawback_user_payment: Option<u128>,
2338        pub cumulative_funding_rate_delta: i128,
2339    }
2340    #[repr(C)]
2341    #[derive(
2342        AnchorSerialize,
2343        AnchorDeserialize,
2344        InitSpace,
2345        Serialize,
2346        Deserialize,
2347        Copy,
2348        Clone,
2349        Default,
2350        Debug,
2351        PartialEq,
2352    )]
2353    pub struct SpotBankruptcyRecord {
2354        pub market_index: u16,
2355        pub borrow_amount: u128,
2356        pub if_payment: u128,
2357        pub cumulative_deposit_interest_delta: u128,
2358    }
2359    #[repr(C)]
2360    #[derive(
2361        AnchorSerialize,
2362        AnchorDeserialize,
2363        InitSpace,
2364        Serialize,
2365        Deserialize,
2366        Copy,
2367        Clone,
2368        Default,
2369        Debug,
2370        PartialEq,
2371    )]
2372    pub struct MarketIdentifier {
2373        pub market_type: MarketType,
2374        pub market_index: u16,
2375    }
2376    #[repr(C)]
2377    #[derive(
2378        AnchorSerialize,
2379        AnchorDeserialize,
2380        InitSpace,
2381        Serialize,
2382        Deserialize,
2383        Copy,
2384        Clone,
2385        Default,
2386        Debug,
2387        PartialEq,
2388    )]
2389    pub struct HistoricalOracleData {
2390        pub last_oracle_price: i64,
2391        pub last_oracle_conf: u64,
2392        pub last_oracle_delay: i64,
2393        pub last_oracle_price_twap: i64,
2394        pub last_oracle_price_twap5min: i64,
2395        pub last_oracle_price_twap_ts: i64,
2396    }
2397    #[repr(C)]
2398    #[derive(
2399        AnchorSerialize,
2400        AnchorDeserialize,
2401        InitSpace,
2402        Serialize,
2403        Deserialize,
2404        Copy,
2405        Clone,
2406        Default,
2407        Debug,
2408        PartialEq,
2409    )]
2410    pub struct HistoricalIndexData {
2411        pub last_index_bid_price: u64,
2412        pub last_index_ask_price: u64,
2413        pub last_index_price_twap: u64,
2414        pub last_index_price_twap5min: u64,
2415        pub last_index_price_twap_ts: i64,
2416    }
2417    #[repr(C)]
2418    #[derive(
2419        AnchorSerialize,
2420        AnchorDeserialize,
2421        InitSpace,
2422        Serialize,
2423        Deserialize,
2424        Copy,
2425        Clone,
2426        Default,
2427        Debug,
2428        PartialEq,
2429    )]
2430    pub struct PrelaunchOracleParams {
2431        pub perp_market_index: u16,
2432        pub price: Option<i64>,
2433        pub max_price: Option<i64>,
2434    }
2435    #[repr(C)]
2436    #[derive(
2437        AnchorSerialize,
2438        AnchorDeserialize,
2439        InitSpace,
2440        Serialize,
2441        Deserialize,
2442        Copy,
2443        Clone,
2444        Default,
2445        Debug,
2446        PartialEq,
2447    )]
2448    pub struct OrderParams {
2449        pub order_type: OrderType,
2450        pub market_type: MarketType,
2451        pub direction: PositionDirection,
2452        pub user_order_id: u8,
2453        pub base_asset_amount: u64,
2454        pub price: u64,
2455        pub market_index: u16,
2456        pub reduce_only: bool,
2457        pub post_only: PostOnlyParam,
2458        pub immediate_or_cancel: bool,
2459        pub max_ts: Option<i64>,
2460        pub trigger_price: Option<u64>,
2461        pub trigger_condition: OrderTriggerCondition,
2462        pub oracle_price_offset: Option<i32>,
2463        pub auction_duration: Option<u8>,
2464        pub auction_start_price: Option<i64>,
2465        pub auction_end_price: Option<i64>,
2466    }
2467    #[repr(C)]
2468    #[derive(
2469        AnchorSerialize,
2470        AnchorDeserialize,
2471        InitSpace,
2472        Serialize,
2473        Deserialize,
2474        Copy,
2475        Clone,
2476        Default,
2477        Debug,
2478        PartialEq,
2479    )]
2480    pub struct SignedMsgOrderParamsMessage {
2481        pub signed_msg_order_params: OrderParams,
2482        pub sub_account_id: u16,
2483        pub slot: u64,
2484        pub uuid: [u8; 8],
2485        pub take_profit_order_params: Option<SignedMsgTriggerOrderParams>,
2486        pub stop_loss_order_params: Option<SignedMsgTriggerOrderParams>,
2487    }
2488    #[repr(C)]
2489    #[derive(
2490        AnchorSerialize,
2491        AnchorDeserialize,
2492        InitSpace,
2493        Serialize,
2494        Deserialize,
2495        Copy,
2496        Clone,
2497        Default,
2498        Debug,
2499        PartialEq,
2500    )]
2501    pub struct SignedMsgOrderParamsDelegateMessage {
2502        pub signed_msg_order_params: OrderParams,
2503        pub taker_pubkey: Pubkey,
2504        pub slot: u64,
2505        pub uuid: [u8; 8],
2506        pub take_profit_order_params: Option<SignedMsgTriggerOrderParams>,
2507        pub stop_loss_order_params: Option<SignedMsgTriggerOrderParams>,
2508    }
2509    #[repr(C)]
2510    #[derive(
2511        AnchorSerialize,
2512        AnchorDeserialize,
2513        InitSpace,
2514        Serialize,
2515        Deserialize,
2516        Copy,
2517        Clone,
2518        Default,
2519        Debug,
2520        PartialEq,
2521    )]
2522    pub struct SignedMsgTriggerOrderParams {
2523        pub trigger_price: u64,
2524        pub base_asset_amount: u64,
2525    }
2526    #[repr(C)]
2527    #[derive(
2528        AnchorSerialize,
2529        AnchorDeserialize,
2530        InitSpace,
2531        Serialize,
2532        Deserialize,
2533        Copy,
2534        Clone,
2535        Default,
2536        Debug,
2537        PartialEq,
2538    )]
2539    pub struct ModifyOrderParams {
2540        pub direction: Option<PositionDirection>,
2541        pub base_asset_amount: Option<u64>,
2542        pub price: Option<u64>,
2543        pub reduce_only: Option<bool>,
2544        pub post_only: Option<PostOnlyParam>,
2545        pub immediate_or_cancel: Option<bool>,
2546        pub max_ts: Option<i64>,
2547        pub trigger_price: Option<u64>,
2548        pub trigger_condition: Option<OrderTriggerCondition>,
2549        pub oracle_price_offset: Option<i32>,
2550        pub auction_duration: Option<u8>,
2551        pub auction_start_price: Option<i64>,
2552        pub auction_end_price: Option<i64>,
2553        pub policy: Option<u8>,
2554    }
2555    #[repr(C)]
2556    #[derive(
2557        AnchorSerialize,
2558        AnchorDeserialize,
2559        InitSpace,
2560        Serialize,
2561        Deserialize,
2562        Copy,
2563        Clone,
2564        Default,
2565        Debug,
2566        PartialEq,
2567    )]
2568    pub struct InsuranceClaim {
2569        pub revenue_withdraw_since_last_settle: i64,
2570        pub max_revenue_withdraw_per_period: u64,
2571        pub quote_max_insurance: u64,
2572        pub quote_settled_insurance: u64,
2573        pub last_revenue_withdraw_ts: i64,
2574    }
2575    #[repr(C)]
2576    #[derive(
2577        AnchorSerialize,
2578        AnchorDeserialize,
2579        InitSpace,
2580        Serialize,
2581        Deserialize,
2582        Copy,
2583        Clone,
2584        Default,
2585        Debug,
2586        PartialEq,
2587    )]
2588    pub struct PoolBalance {
2589        pub scaled_balance: u128,
2590        pub market_index: u16,
2591        pub padding: [u8; 6],
2592    }
2593    #[repr(C)]
2594    #[derive(
2595        AnchorSerialize,
2596        AnchorDeserialize,
2597        InitSpace,
2598        Serialize,
2599        Deserialize,
2600        Copy,
2601        Clone,
2602        Default,
2603        Debug,
2604        PartialEq,
2605    )]
2606    pub struct AMM {
2607        pub oracle: Pubkey,
2608        pub historical_oracle_data: HistoricalOracleData,
2609        pub base_asset_amount_per_lp: i128,
2610        pub quote_asset_amount_per_lp: i128,
2611        pub fee_pool: PoolBalance,
2612        pub base_asset_reserve: u128,
2613        pub quote_asset_reserve: u128,
2614        pub concentration_coef: u128,
2615        pub min_base_asset_reserve: u128,
2616        pub max_base_asset_reserve: u128,
2617        pub sqrt_k: u128,
2618        pub peg_multiplier: u128,
2619        pub terminal_quote_asset_reserve: u128,
2620        pub base_asset_amount_long: i128,
2621        pub base_asset_amount_short: i128,
2622        pub base_asset_amount_with_amm: i128,
2623        pub base_asset_amount_with_unsettled_lp: i128,
2624        pub max_open_interest: u128,
2625        pub quote_asset_amount: i128,
2626        pub quote_entry_amount_long: i128,
2627        pub quote_entry_amount_short: i128,
2628        pub quote_break_even_amount_long: i128,
2629        pub quote_break_even_amount_short: i128,
2630        pub user_lp_shares: u128,
2631        pub last_funding_rate: i64,
2632        pub last_funding_rate_long: i64,
2633        pub last_funding_rate_short: i64,
2634        pub last24h_avg_funding_rate: i64,
2635        pub total_fee: i128,
2636        pub total_mm_fee: i128,
2637        pub total_exchange_fee: u128,
2638        pub total_fee_minus_distributions: i128,
2639        pub total_fee_withdrawn: u128,
2640        pub total_liquidation_fee: u128,
2641        pub cumulative_funding_rate_long: i128,
2642        pub cumulative_funding_rate_short: i128,
2643        pub total_social_loss: u128,
2644        pub ask_base_asset_reserve: u128,
2645        pub ask_quote_asset_reserve: u128,
2646        pub bid_base_asset_reserve: u128,
2647        pub bid_quote_asset_reserve: u128,
2648        pub last_oracle_normalised_price: i64,
2649        pub last_oracle_reserve_price_spread_pct: i64,
2650        pub last_bid_price_twap: u64,
2651        pub last_ask_price_twap: u64,
2652        pub last_mark_price_twap: u64,
2653        pub last_mark_price_twap5min: u64,
2654        pub last_update_slot: u64,
2655        pub last_oracle_conf_pct: u64,
2656        pub net_revenue_since_last_funding: i64,
2657        pub last_funding_rate_ts: i64,
2658        pub funding_period: i64,
2659        pub order_step_size: u64,
2660        pub order_tick_size: u64,
2661        pub min_order_size: u64,
2662        pub max_position_size: u64,
2663        pub volume24h: u64,
2664        pub long_intensity_volume: u64,
2665        pub short_intensity_volume: u64,
2666        pub last_trade_ts: i64,
2667        pub mark_std: u64,
2668        pub oracle_std: u64,
2669        pub last_mark_price_twap_ts: i64,
2670        pub base_spread: u32,
2671        pub max_spread: u32,
2672        pub long_spread: u32,
2673        pub short_spread: u32,
2674        pub long_intensity_count: u32,
2675        pub short_intensity_count: u32,
2676        pub max_fill_reserve_fraction: u16,
2677        pub max_slippage_ratio: u16,
2678        pub curve_update_intensity: u8,
2679        pub amm_jit_intensity: u8,
2680        pub oracle_source: OracleSource,
2681        pub last_oracle_valid: bool,
2682        pub target_base_asset_amount_per_lp: i32,
2683        pub per_lp_base: i8,
2684        pub padding1: u8,
2685        pub padding2: u16,
2686        pub total_fee_earned_per_lp: u64,
2687        pub net_unsettled_funding_pnl: i64,
2688        pub quote_asset_amount_with_unsettled_lp: i64,
2689        pub reference_price_offset: i32,
2690        pub padding: [u8; 12],
2691    }
2692    #[repr(C)]
2693    #[derive(
2694        AnchorSerialize,
2695        AnchorDeserialize,
2696        InitSpace,
2697        Serialize,
2698        Deserialize,
2699        Copy,
2700        Clone,
2701        Default,
2702        Debug,
2703        PartialEq,
2704    )]
2705    pub struct SignedMsgOrderId {
2706        pub uuid: [u8; 8],
2707        pub max_slot: u64,
2708        pub order_id: u32,
2709        pub padding: u32,
2710    }
2711    #[repr(C)]
2712    #[derive(
2713        AnchorSerialize,
2714        AnchorDeserialize,
2715        InitSpace,
2716        Serialize,
2717        Deserialize,
2718        Copy,
2719        Clone,
2720        Default,
2721        Debug,
2722        PartialEq,
2723    )]
2724    pub struct SignedMsgUserOrdersFixed {
2725        pub user_pubkey: Pubkey,
2726        pub padding: u32,
2727        pub len: u32,
2728    }
2729    #[repr(C)]
2730    #[derive(
2731        AnchorSerialize,
2732        AnchorDeserialize,
2733        InitSpace,
2734        Serialize,
2735        Deserialize,
2736        Copy,
2737        Clone,
2738        Default,
2739        Debug,
2740        PartialEq,
2741    )]
2742    pub struct InsuranceFund {
2743        pub vault: Pubkey,
2744        pub total_shares: u128,
2745        pub user_shares: u128,
2746        pub shares_base: u128,
2747        pub unstaking_period: i64,
2748        pub last_revenue_settle_ts: i64,
2749        pub revenue_settle_period: i64,
2750        pub total_factor: u32,
2751        pub user_factor: u32,
2752    }
2753    #[repr(C)]
2754    #[derive(
2755        AnchorSerialize,
2756        AnchorDeserialize,
2757        InitSpace,
2758        Serialize,
2759        Deserialize,
2760        Copy,
2761        Clone,
2762        Default,
2763        Debug,
2764        PartialEq,
2765    )]
2766    pub struct OracleGuardRails {
2767        pub price_divergence: PriceDivergenceGuardRails,
2768        pub validity: ValidityGuardRails,
2769    }
2770    #[repr(C)]
2771    #[derive(
2772        AnchorSerialize,
2773        AnchorDeserialize,
2774        InitSpace,
2775        Serialize,
2776        Deserialize,
2777        Copy,
2778        Clone,
2779        Default,
2780        Debug,
2781        PartialEq,
2782    )]
2783    pub struct PriceDivergenceGuardRails {
2784        pub mark_oracle_percent_divergence: u64,
2785        pub oracle_twap5min_percent_divergence: u64,
2786    }
2787    #[repr(C)]
2788    #[derive(
2789        AnchorSerialize,
2790        AnchorDeserialize,
2791        InitSpace,
2792        Serialize,
2793        Deserialize,
2794        Copy,
2795        Clone,
2796        Default,
2797        Debug,
2798        PartialEq,
2799    )]
2800    pub struct ValidityGuardRails {
2801        pub slots_before_stale_for_amm: i64,
2802        pub slots_before_stale_for_margin: i64,
2803        pub confidence_interval_max_size: u64,
2804        pub too_volatile_ratio: i64,
2805    }
2806    #[repr(C)]
2807    #[derive(
2808        AnchorSerialize,
2809        AnchorDeserialize,
2810        InitSpace,
2811        Serialize,
2812        Deserialize,
2813        Copy,
2814        Clone,
2815        Default,
2816        Debug,
2817        PartialEq,
2818    )]
2819    pub struct FeeStructure {
2820        pub fee_tiers: [FeeTier; 10],
2821        pub filler_reward_structure: OrderFillerRewardStructure,
2822        pub referrer_reward_epoch_upper_bound: u64,
2823        pub flat_filler_fee: u64,
2824    }
2825    #[repr(C)]
2826    #[derive(
2827        AnchorSerialize,
2828        AnchorDeserialize,
2829        InitSpace,
2830        Serialize,
2831        Deserialize,
2832        Copy,
2833        Clone,
2834        Default,
2835        Debug,
2836        PartialEq,
2837    )]
2838    pub struct FeeTier {
2839        pub fee_numerator: u32,
2840        pub fee_denominator: u32,
2841        pub maker_rebate_numerator: u32,
2842        pub maker_rebate_denominator: u32,
2843        pub referrer_reward_numerator: u32,
2844        pub referrer_reward_denominator: u32,
2845        pub referee_fee_numerator: u32,
2846        pub referee_fee_denominator: u32,
2847    }
2848    #[repr(C)]
2849    #[derive(
2850        AnchorSerialize,
2851        AnchorDeserialize,
2852        InitSpace,
2853        Serialize,
2854        Deserialize,
2855        Copy,
2856        Clone,
2857        Default,
2858        Debug,
2859        PartialEq,
2860    )]
2861    pub struct OrderFillerRewardStructure {
2862        pub reward_numerator: u32,
2863        pub reward_denominator: u32,
2864        pub time_based_reward_lower_bound: u128,
2865    }
2866    #[repr(C)]
2867    #[derive(
2868        AnchorSerialize,
2869        AnchorDeserialize,
2870        InitSpace,
2871        Serialize,
2872        Deserialize,
2873        Copy,
2874        Clone,
2875        Default,
2876        Debug,
2877        PartialEq,
2878    )]
2879    pub struct UserFees {
2880        pub total_fee_paid: u64,
2881        pub total_fee_rebate: u64,
2882        pub total_token_discount: u64,
2883        pub total_referee_discount: u64,
2884        pub total_referrer_reward: u64,
2885        pub current_epoch_referrer_reward: u64,
2886    }
2887    #[repr(C)]
2888    #[derive(
2889        AnchorSerialize,
2890        AnchorDeserialize,
2891        InitSpace,
2892        Serialize,
2893        Deserialize,
2894        Copy,
2895        Clone,
2896        Default,
2897        Debug,
2898        PartialEq,
2899    )]
2900    pub struct SpotPosition {
2901        pub scaled_balance: u64,
2902        pub open_bids: i64,
2903        pub open_asks: i64,
2904        pub cumulative_deposits: i64,
2905        pub market_index: u16,
2906        pub balance_type: SpotBalanceType,
2907        pub open_orders: u8,
2908        pub padding: [u8; 4],
2909    }
2910    #[repr(C)]
2911    #[derive(
2912        AnchorSerialize,
2913        AnchorDeserialize,
2914        InitSpace,
2915        Serialize,
2916        Deserialize,
2917        Copy,
2918        Clone,
2919        Default,
2920        Debug,
2921        PartialEq,
2922    )]
2923    pub struct PerpPosition {
2924        pub last_cumulative_funding_rate: i64,
2925        pub base_asset_amount: i64,
2926        pub quote_asset_amount: i64,
2927        pub quote_break_even_amount: i64,
2928        pub quote_entry_amount: i64,
2929        pub open_bids: i64,
2930        pub open_asks: i64,
2931        pub settled_pnl: i64,
2932        pub lp_shares: u64,
2933        pub last_base_asset_amount_per_lp: i64,
2934        pub last_quote_asset_amount_per_lp: i64,
2935        pub remainder_base_asset_amount: i32,
2936        pub market_index: u16,
2937        pub open_orders: u8,
2938        pub per_lp_base: i8,
2939    }
2940    #[repr(C)]
2941    #[derive(
2942        AnchorSerialize,
2943        AnchorDeserialize,
2944        InitSpace,
2945        Serialize,
2946        Deserialize,
2947        Copy,
2948        Clone,
2949        Default,
2950        Debug,
2951        PartialEq,
2952    )]
2953    pub struct Order {
2954        pub slot: u64,
2955        pub price: u64,
2956        pub base_asset_amount: u64,
2957        pub base_asset_amount_filled: u64,
2958        pub quote_asset_amount_filled: u64,
2959        pub trigger_price: u64,
2960        pub auction_start_price: i64,
2961        pub auction_end_price: i64,
2962        pub max_ts: i64,
2963        pub oracle_price_offset: i32,
2964        pub order_id: u32,
2965        pub market_index: u16,
2966        pub status: OrderStatus,
2967        pub order_type: OrderType,
2968        pub market_type: MarketType,
2969        pub user_order_id: u8,
2970        pub existing_position_direction: PositionDirection,
2971        pub direction: PositionDirection,
2972        pub reduce_only: bool,
2973        pub post_only: bool,
2974        pub immediate_or_cancel: bool,
2975        pub trigger_condition: OrderTriggerCondition,
2976        pub auction_duration: u8,
2977        pub posted_slot_tail: u8,
2978        pub bit_flags: u8,
2979        pub padding: [u8; 1],
2980    }
2981    #[derive(
2982        AnchorSerialize,
2983        AnchorDeserialize,
2984        InitSpace,
2985        Serialize,
2986        Deserialize,
2987        Copy,
2988        Clone,
2989        Default,
2990        Debug,
2991        PartialEq,
2992    )]
2993    pub enum SwapDirection {
2994        #[default]
2995        Add,
2996        Remove,
2997    }
2998    #[derive(
2999        AnchorSerialize,
3000        AnchorDeserialize,
3001        InitSpace,
3002        Serialize,
3003        Deserialize,
3004        Copy,
3005        Clone,
3006        Default,
3007        Debug,
3008        PartialEq,
3009    )]
3010    pub enum ModifyOrderId {
3011        #[default]
3012        UserOrderId,
3013        OrderId,
3014    }
3015    #[derive(
3016        AnchorSerialize,
3017        AnchorDeserialize,
3018        InitSpace,
3019        Serialize,
3020        Deserialize,
3021        Copy,
3022        Clone,
3023        Default,
3024        Debug,
3025        PartialEq,
3026    )]
3027    pub enum PositionDirection {
3028        #[default]
3029        Long,
3030        Short,
3031    }
3032    #[derive(
3033        AnchorSerialize,
3034        AnchorDeserialize,
3035        InitSpace,
3036        Serialize,
3037        Deserialize,
3038        Copy,
3039        Clone,
3040        Default,
3041        Debug,
3042        PartialEq,
3043    )]
3044    pub enum SpotFulfillmentType {
3045        #[default]
3046        SerumV3,
3047        Match,
3048        PhoenixV1,
3049        OpenbookV2,
3050    }
3051    #[derive(
3052        AnchorSerialize,
3053        AnchorDeserialize,
3054        InitSpace,
3055        Serialize,
3056        Deserialize,
3057        Copy,
3058        Clone,
3059        Default,
3060        Debug,
3061        PartialEq,
3062    )]
3063    pub enum SwapReduceOnly {
3064        #[default]
3065        In,
3066        Out,
3067    }
3068    #[derive(
3069        AnchorSerialize,
3070        AnchorDeserialize,
3071        InitSpace,
3072        Serialize,
3073        Deserialize,
3074        Copy,
3075        Clone,
3076        Default,
3077        Debug,
3078        PartialEq,
3079    )]
3080    pub enum TwapPeriod {
3081        #[default]
3082        FundingPeriod,
3083        FiveMin,
3084    }
3085    #[derive(
3086        AnchorSerialize,
3087        AnchorDeserialize,
3088        InitSpace,
3089        Serialize,
3090        Deserialize,
3091        Copy,
3092        Clone,
3093        Default,
3094        Debug,
3095        PartialEq,
3096    )]
3097    pub enum LiquidationMultiplierType {
3098        #[default]
3099        Discount,
3100        Premium,
3101    }
3102    #[derive(
3103        AnchorSerialize,
3104        AnchorDeserialize,
3105        InitSpace,
3106        Serialize,
3107        Deserialize,
3108        Copy,
3109        Clone,
3110        Default,
3111        Debug,
3112        PartialEq,
3113    )]
3114    pub enum MarginRequirementType {
3115        #[default]
3116        Initial,
3117        Fill,
3118        Maintenance,
3119    }
3120    #[derive(
3121        AnchorSerialize,
3122        AnchorDeserialize,
3123        InitSpace,
3124        Serialize,
3125        Deserialize,
3126        Copy,
3127        Clone,
3128        Default,
3129        Debug,
3130        PartialEq,
3131    )]
3132    pub enum OracleValidity {
3133        #[default]
3134        NonPositive,
3135        TooVolatile,
3136        TooUncertain,
3137        StaleForMargin,
3138        InsufficientDataPoints,
3139        StaleForAMM,
3140        Valid,
3141    }
3142    #[derive(
3143        AnchorSerialize,
3144        AnchorDeserialize,
3145        InitSpace,
3146        Serialize,
3147        Deserialize,
3148        Copy,
3149        Clone,
3150        Default,
3151        Debug,
3152        PartialEq,
3153    )]
3154    pub enum DriftAction {
3155        #[default]
3156        UpdateFunding,
3157        SettlePnl,
3158        TriggerOrder,
3159        FillOrderMatch,
3160        FillOrderAmm,
3161        Liquidate,
3162        MarginCalc,
3163        UpdateTwap,
3164        UpdateAMMCurve,
3165        OracleOrderPrice,
3166    }
3167    #[derive(
3168        AnchorSerialize,
3169        AnchorDeserialize,
3170        InitSpace,
3171        Serialize,
3172        Deserialize,
3173        Copy,
3174        Clone,
3175        Default,
3176        Debug,
3177        PartialEq,
3178    )]
3179    pub enum PositionUpdateType {
3180        #[default]
3181        Open,
3182        Increase,
3183        Reduce,
3184        Close,
3185        Flip,
3186    }
3187    #[derive(
3188        AnchorSerialize,
3189        AnchorDeserialize,
3190        InitSpace,
3191        Serialize,
3192        Deserialize,
3193        Copy,
3194        Clone,
3195        Default,
3196        Debug,
3197        PartialEq,
3198    )]
3199    pub enum DepositExplanation {
3200        #[default]
3201        None,
3202        Transfer,
3203        Borrow,
3204        RepayBorrow,
3205    }
3206    #[derive(
3207        AnchorSerialize,
3208        AnchorDeserialize,
3209        InitSpace,
3210        Serialize,
3211        Deserialize,
3212        Copy,
3213        Clone,
3214        Default,
3215        Debug,
3216        PartialEq,
3217    )]
3218    pub enum DepositDirection {
3219        #[default]
3220        Deposit,
3221        Withdraw,
3222    }
3223    #[derive(
3224        AnchorSerialize,
3225        AnchorDeserialize,
3226        InitSpace,
3227        Serialize,
3228        Deserialize,
3229        Copy,
3230        Clone,
3231        Default,
3232        Debug,
3233        PartialEq,
3234    )]
3235    pub enum OrderAction {
3236        #[default]
3237        Place,
3238        Cancel,
3239        Fill,
3240        Trigger,
3241        Expire,
3242    }
3243    #[derive(
3244        AnchorSerialize,
3245        AnchorDeserialize,
3246        InitSpace,
3247        Serialize,
3248        Deserialize,
3249        Copy,
3250        Clone,
3251        Default,
3252        Debug,
3253        PartialEq,
3254    )]
3255    pub enum OrderActionExplanation {
3256        #[default]
3257        None,
3258        InsufficientFreeCollateral,
3259        OraclePriceBreachedLimitPrice,
3260        MarketOrderFilledToLimitPrice,
3261        OrderExpired,
3262        Liquidation,
3263        OrderFilledWithAMM,
3264        OrderFilledWithAMMJit,
3265        OrderFilledWithMatch,
3266        OrderFilledWithMatchJit,
3267        MarketExpired,
3268        RiskingIncreasingOrder,
3269        ReduceOnlyOrderIncreasedPosition,
3270        OrderFillWithSerum,
3271        NoBorrowLiquidity,
3272        OrderFillWithPhoenix,
3273        OrderFilledWithAMMJitLPSplit,
3274        OrderFilledWithLPJit,
3275        DeriskLp,
3276        OrderFilledWithOpenbookV2,
3277        TransferPerpPosition,
3278    }
3279    #[derive(
3280        AnchorSerialize,
3281        AnchorDeserialize,
3282        InitSpace,
3283        Serialize,
3284        Deserialize,
3285        Copy,
3286        Clone,
3287        Default,
3288        Debug,
3289        PartialEq,
3290    )]
3291    pub enum LPAction {
3292        #[default]
3293        AddLiquidity,
3294        RemoveLiquidity,
3295        SettleLiquidity,
3296        RemoveLiquidityDerisk,
3297    }
3298    #[derive(
3299        AnchorSerialize,
3300        AnchorDeserialize,
3301        InitSpace,
3302        Serialize,
3303        Deserialize,
3304        Copy,
3305        Clone,
3306        Default,
3307        Debug,
3308        PartialEq,
3309    )]
3310    pub enum LiquidationType {
3311        #[default]
3312        LiquidatePerp,
3313        LiquidateSpot,
3314        LiquidateBorrowForPerpPnl,
3315        LiquidatePerpPnlForDeposit,
3316        PerpBankruptcy,
3317        SpotBankruptcy,
3318    }
3319    #[derive(
3320        AnchorSerialize,
3321        AnchorDeserialize,
3322        InitSpace,
3323        Serialize,
3324        Deserialize,
3325        Copy,
3326        Clone,
3327        Default,
3328        Debug,
3329        PartialEq,
3330    )]
3331    pub enum SettlePnlExplanation {
3332        #[default]
3333        None,
3334        ExpiredPosition,
3335    }
3336    #[derive(
3337        AnchorSerialize,
3338        AnchorDeserialize,
3339        InitSpace,
3340        Serialize,
3341        Deserialize,
3342        Copy,
3343        Clone,
3344        Default,
3345        Debug,
3346        PartialEq,
3347    )]
3348    pub enum StakeAction {
3349        #[default]
3350        Stake,
3351        UnstakeRequest,
3352        UnstakeCancelRequest,
3353        Unstake,
3354        UnstakeTransfer,
3355        StakeTransfer,
3356    }
3357    #[derive(
3358        AnchorSerialize,
3359        AnchorDeserialize,
3360        InitSpace,
3361        Serialize,
3362        Deserialize,
3363        Copy,
3364        Clone,
3365        Default,
3366        Debug,
3367        PartialEq,
3368    )]
3369    pub enum FillMode {
3370        #[default]
3371        Fill,
3372        PlaceAndMake,
3373        PlaceAndTake,
3374        Liquidation,
3375    }
3376    #[derive(
3377        AnchorSerialize,
3378        AnchorDeserialize,
3379        InitSpace,
3380        Serialize,
3381        Deserialize,
3382        Copy,
3383        Clone,
3384        Default,
3385        Debug,
3386        PartialEq,
3387    )]
3388    pub enum PerpFulfillmentMethod {
3389        #[default]
3390        AMM,
3391        Match,
3392    }
3393    #[derive(
3394        AnchorSerialize,
3395        AnchorDeserialize,
3396        InitSpace,
3397        Serialize,
3398        Deserialize,
3399        Copy,
3400        Clone,
3401        Default,
3402        Debug,
3403        PartialEq,
3404    )]
3405    pub enum SpotFulfillmentMethod {
3406        #[default]
3407        ExternalMarket,
3408        Match,
3409    }
3410    #[derive(
3411        AnchorSerialize,
3412        AnchorDeserialize,
3413        InitSpace,
3414        Serialize,
3415        Deserialize,
3416        Copy,
3417        Clone,
3418        Debug,
3419        PartialEq,
3420    )]
3421    pub enum MarginCalculationMode {
3422        Standard {
3423            track_open_orders_fraction: bool,
3424        },
3425        Liquidation {
3426            market_to_track_margin_requirement: Option<MarketIdentifier>,
3427        },
3428    }
3429    #[derive(
3430        AnchorSerialize,
3431        AnchorDeserialize,
3432        InitSpace,
3433        Serialize,
3434        Deserialize,
3435        Copy,
3436        Clone,
3437        Default,
3438        Debug,
3439        PartialEq,
3440    )]
3441    pub enum OracleSource {
3442        #[default]
3443        Pyth,
3444        Switchboard,
3445        QuoteAsset,
3446        Pyth1K,
3447        Pyth1M,
3448        PythStableCoin,
3449        Prelaunch,
3450        PythPull,
3451        Pyth1KPull,
3452        Pyth1MPull,
3453        PythStableCoinPull,
3454        SwitchboardOnDemand,
3455        PythLazer,
3456        PythLazer1K,
3457        PythLazer1M,
3458        PythLazerStableCoin,
3459    }
3460    #[derive(
3461        AnchorSerialize,
3462        AnchorDeserialize,
3463        InitSpace,
3464        Serialize,
3465        Deserialize,
3466        Copy,
3467        Clone,
3468        Default,
3469        Debug,
3470        PartialEq,
3471    )]
3472    pub enum PostOnlyParam {
3473        #[default]
3474        None,
3475        MustPostOnly,
3476        TryPostOnly,
3477        Slide,
3478    }
3479    #[derive(
3480        AnchorSerialize,
3481        AnchorDeserialize,
3482        InitSpace,
3483        Serialize,
3484        Deserialize,
3485        Copy,
3486        Clone,
3487        Default,
3488        Debug,
3489        PartialEq,
3490    )]
3491    pub enum ModifyOrderPolicy {
3492        #[default]
3493        MustModify,
3494        ExcludePreviousFill,
3495    }
3496    #[derive(
3497        AnchorSerialize,
3498        AnchorDeserialize,
3499        InitSpace,
3500        Serialize,
3501        Deserialize,
3502        Copy,
3503        Clone,
3504        Default,
3505        Debug,
3506        PartialEq,
3507    )]
3508    pub enum PlaceAndTakeOrderSuccessCondition {
3509        #[default]
3510        PartialFill,
3511        FullFill,
3512    }
3513    #[derive(
3514        AnchorSerialize,
3515        AnchorDeserialize,
3516        InitSpace,
3517        Serialize,
3518        Deserialize,
3519        Copy,
3520        Clone,
3521        Default,
3522        Debug,
3523        PartialEq,
3524    )]
3525    pub enum PerpOperation {
3526        #[default]
3527        UpdateFunding,
3528        AmmFill,
3529        Fill,
3530        SettlePnl,
3531        SettlePnlWithPosition,
3532        Liquidation,
3533        AmmImmediateFill,
3534    }
3535    #[derive(
3536        AnchorSerialize,
3537        AnchorDeserialize,
3538        InitSpace,
3539        Serialize,
3540        Deserialize,
3541        Copy,
3542        Clone,
3543        Default,
3544        Debug,
3545        PartialEq,
3546    )]
3547    pub enum SpotOperation {
3548        #[default]
3549        UpdateCumulativeInterest,
3550        Fill,
3551        Deposit,
3552        Withdraw,
3553        Liquidation,
3554    }
3555    #[derive(
3556        AnchorSerialize,
3557        AnchorDeserialize,
3558        InitSpace,
3559        Serialize,
3560        Deserialize,
3561        Copy,
3562        Clone,
3563        Default,
3564        Debug,
3565        PartialEq,
3566    )]
3567    pub enum InsuranceFundOperation {
3568        #[default]
3569        Init,
3570        Add,
3571        RequestRemove,
3572        Remove,
3573    }
3574    #[derive(
3575        AnchorSerialize,
3576        AnchorDeserialize,
3577        InitSpace,
3578        Serialize,
3579        Deserialize,
3580        Copy,
3581        Clone,
3582        Default,
3583        Debug,
3584        PartialEq,
3585    )]
3586    pub enum MarketStatus {
3587        #[default]
3588        Initialized,
3589        Active,
3590        FundingPaused,
3591        AmmPaused,
3592        FillPaused,
3593        WithdrawPaused,
3594        ReduceOnly,
3595        Settlement,
3596        Delisted,
3597    }
3598    #[derive(
3599        AnchorSerialize,
3600        AnchorDeserialize,
3601        InitSpace,
3602        Serialize,
3603        Deserialize,
3604        Copy,
3605        Clone,
3606        Default,
3607        Debug,
3608        PartialEq,
3609    )]
3610    pub enum ContractType {
3611        #[default]
3612        Perpetual,
3613        Future,
3614        Prediction,
3615    }
3616    #[derive(
3617        AnchorSerialize,
3618        AnchorDeserialize,
3619        InitSpace,
3620        Serialize,
3621        Deserialize,
3622        Copy,
3623        Clone,
3624        Default,
3625        Debug,
3626        PartialEq,
3627    )]
3628    pub enum ContractTier {
3629        #[default]
3630        A,
3631        B,
3632        C,
3633        Speculative,
3634        HighlySpeculative,
3635        Isolated,
3636    }
3637    #[derive(
3638        AnchorSerialize,
3639        AnchorDeserialize,
3640        InitSpace,
3641        Serialize,
3642        Deserialize,
3643        Copy,
3644        Clone,
3645        Default,
3646        Debug,
3647        PartialEq,
3648    )]
3649    pub enum AMMLiquiditySplit {
3650        #[default]
3651        ProtocolOwned,
3652        LPOwned,
3653        Shared,
3654    }
3655    #[derive(
3656        AnchorSerialize,
3657        AnchorDeserialize,
3658        InitSpace,
3659        Serialize,
3660        Deserialize,
3661        Copy,
3662        Clone,
3663        Default,
3664        Debug,
3665        PartialEq,
3666    )]
3667    pub enum AMMAvailability {
3668        #[default]
3669        Immediate,
3670        AfterMinDuration,
3671        Unavailable,
3672    }
3673    #[derive(
3674        AnchorSerialize,
3675        AnchorDeserialize,
3676        InitSpace,
3677        Serialize,
3678        Deserialize,
3679        Copy,
3680        Clone,
3681        Default,
3682        Debug,
3683        PartialEq,
3684    )]
3685    pub enum SettlePnlMode {
3686        #[default]
3687        MustSettle,
3688        TrySettle,
3689    }
3690    #[derive(
3691        AnchorSerialize,
3692        AnchorDeserialize,
3693        InitSpace,
3694        Serialize,
3695        Deserialize,
3696        Copy,
3697        Clone,
3698        Default,
3699        Debug,
3700        PartialEq,
3701    )]
3702    pub enum SpotBalanceType {
3703        #[default]
3704        Deposit,
3705        Borrow,
3706    }
3707    #[derive(
3708        AnchorSerialize,
3709        AnchorDeserialize,
3710        InitSpace,
3711        Serialize,
3712        Deserialize,
3713        Copy,
3714        Clone,
3715        Default,
3716        Debug,
3717        PartialEq,
3718    )]
3719    pub enum SpotFulfillmentConfigStatus {
3720        #[default]
3721        Enabled,
3722        Disabled,
3723    }
3724    #[derive(
3725        AnchorSerialize,
3726        AnchorDeserialize,
3727        InitSpace,
3728        Serialize,
3729        Deserialize,
3730        Copy,
3731        Clone,
3732        Default,
3733        Debug,
3734        PartialEq,
3735    )]
3736    pub enum AssetTier {
3737        #[default]
3738        Collateral,
3739        Protected,
3740        Cross,
3741        Isolated,
3742        Unlisted,
3743    }
3744    #[derive(
3745        AnchorSerialize,
3746        AnchorDeserialize,
3747        InitSpace,
3748        Serialize,
3749        Deserialize,
3750        Copy,
3751        Clone,
3752        Default,
3753        Debug,
3754        PartialEq,
3755    )]
3756    pub enum ExchangeStatus {
3757        #[default]
3758        DepositPaused,
3759        WithdrawPaused,
3760        AmmPaused,
3761        FillPaused,
3762        LiqPaused,
3763        FundingPaused,
3764        SettlePnlPaused,
3765        AmmImmediateFillPaused,
3766    }
3767    #[derive(
3768        AnchorSerialize,
3769        AnchorDeserialize,
3770        InitSpace,
3771        Serialize,
3772        Deserialize,
3773        Copy,
3774        Clone,
3775        Default,
3776        Debug,
3777        PartialEq,
3778    )]
3779    pub enum UserStatus {
3780        #[default]
3781        BeingLiquidated,
3782        Bankrupt,
3783        ReduceOnly,
3784        AdvancedLp,
3785        ProtectedMakerOrders,
3786    }
3787    #[derive(
3788        AnchorSerialize,
3789        AnchorDeserialize,
3790        InitSpace,
3791        Serialize,
3792        Deserialize,
3793        Copy,
3794        Clone,
3795        Default,
3796        Debug,
3797        PartialEq,
3798    )]
3799    pub enum AssetType {
3800        #[default]
3801        Base,
3802        Quote,
3803    }
3804    #[derive(
3805        AnchorSerialize,
3806        AnchorDeserialize,
3807        InitSpace,
3808        Serialize,
3809        Deserialize,
3810        Copy,
3811        Clone,
3812        Default,
3813        Debug,
3814        PartialEq,
3815    )]
3816    pub enum OrderStatus {
3817        #[default]
3818        Init,
3819        Open,
3820        Filled,
3821        Canceled,
3822    }
3823    #[derive(
3824        AnchorSerialize,
3825        AnchorDeserialize,
3826        InitSpace,
3827        Serialize,
3828        Deserialize,
3829        Copy,
3830        Clone,
3831        Default,
3832        Debug,
3833        PartialEq,
3834    )]
3835    pub enum OrderType {
3836        #[default]
3837        Market,
3838        Limit,
3839        TriggerMarket,
3840        TriggerLimit,
3841        Oracle,
3842    }
3843    #[derive(
3844        AnchorSerialize,
3845        AnchorDeserialize,
3846        InitSpace,
3847        Serialize,
3848        Deserialize,
3849        Copy,
3850        Clone,
3851        Default,
3852        Debug,
3853        PartialEq,
3854    )]
3855    pub enum OrderTriggerCondition {
3856        #[default]
3857        Above,
3858        Below,
3859        TriggeredAbove,
3860        TriggeredBelow,
3861    }
3862    #[derive(
3863        AnchorSerialize,
3864        AnchorDeserialize,
3865        InitSpace,
3866        Serialize,
3867        Deserialize,
3868        Copy,
3869        Clone,
3870        Default,
3871        Debug,
3872        PartialEq,
3873    )]
3874    pub enum MarketType {
3875        #[default]
3876        Spot,
3877        Perp,
3878    }
3879    #[derive(
3880        AnchorSerialize,
3881        AnchorDeserialize,
3882        InitSpace,
3883        Serialize,
3884        Deserialize,
3885        Copy,
3886        Clone,
3887        Default,
3888        Debug,
3889        PartialEq,
3890    )]
3891    pub enum OrderBitFlag {
3892        #[default]
3893        SignedMessage,
3894        OracleTriggerMarket,
3895        SafeTriggerOrder,
3896    }
3897    #[derive(
3898        AnchorSerialize,
3899        AnchorDeserialize,
3900        InitSpace,
3901        Serialize,
3902        Deserialize,
3903        Copy,
3904        Clone,
3905        Default,
3906        Debug,
3907        PartialEq,
3908    )]
3909    pub enum ReferrerStatus {
3910        #[default]
3911        IsReferrer,
3912        IsReferred,
3913    }
3914    #[derive(
3915        AnchorSerialize,
3916        AnchorDeserialize,
3917        InitSpace,
3918        Serialize,
3919        Deserialize,
3920        Copy,
3921        Clone,
3922        Default,
3923        Debug,
3924        PartialEq,
3925    )]
3926    pub enum MarginMode {
3927        #[default]
3928        Default,
3929        HighLeverage,
3930    }
3931    #[derive(
3932        AnchorSerialize,
3933        AnchorDeserialize,
3934        InitSpace,
3935        Serialize,
3936        Deserialize,
3937        Copy,
3938        Clone,
3939        Default,
3940        Debug,
3941        PartialEq,
3942    )]
3943    pub enum FuelOverflowStatus {
3944        #[default]
3945        Exists,
3946    }
3947    #[derive(
3948        AnchorSerialize,
3949        AnchorDeserialize,
3950        InitSpace,
3951        Serialize,
3952        Deserialize,
3953        Copy,
3954        Clone,
3955        Default,
3956        Debug,
3957        PartialEq,
3958    )]
3959    pub enum SignatureVerificationError {
3960        #[default]
3961        InvalidEd25519InstructionProgramId,
3962        InvalidEd25519InstructionDataLength,
3963        InvalidSignatureIndex,
3964        InvalidSignatureOffset,
3965        InvalidPublicKeyOffset,
3966        InvalidMessageOffset,
3967        InvalidMessageDataSize,
3968        InvalidInstructionIndex,
3969        MessageOffsetOverflow,
3970        InvalidMessageHex,
3971        InvalidMessageData,
3972        LoadInstructionAtFailed,
3973    }
3974}
3975pub mod accounts {
3976    #![doc = r" IDL Account types"]
3977    use super::{types::*, *};
3978    #[repr(C)]
3979    #[derive(
3980        AnchorSerialize,
3981        AnchorDeserialize,
3982        InitSpace,
3983        Serialize,
3984        Deserialize,
3985        Copy,
3986        Clone,
3987        Default,
3988        Debug,
3989        PartialEq,
3990    )]
3991    pub struct OpenbookV2FulfillmentConfig {
3992        pub pubkey: Pubkey,
3993        pub openbook_v2_program_id: Pubkey,
3994        pub openbook_v2_market: Pubkey,
3995        pub openbook_v2_market_authority: Pubkey,
3996        pub openbook_v2_event_heap: Pubkey,
3997        pub openbook_v2_bids: Pubkey,
3998        pub openbook_v2_asks: Pubkey,
3999        pub openbook_v2_base_vault: Pubkey,
4000        pub openbook_v2_quote_vault: Pubkey,
4001        pub market_index: u16,
4002        pub fulfillment_type: SpotFulfillmentType,
4003        pub status: SpotFulfillmentConfigStatus,
4004        #[serde(skip)]
4005        pub padding: Padding<4>,
4006    }
4007    #[automatically_derived]
4008    impl anchor_lang::Discriminator for OpenbookV2FulfillmentConfig {
4009        const DISCRIMINATOR: &[u8] = &[3, 43, 58, 106, 131, 132, 199, 171];
4010    }
4011    #[automatically_derived]
4012    unsafe impl anchor_lang::__private::bytemuck::Pod for OpenbookV2FulfillmentConfig {}
4013    #[automatically_derived]
4014    unsafe impl anchor_lang::__private::bytemuck::Zeroable for OpenbookV2FulfillmentConfig {}
4015    #[automatically_derived]
4016    impl anchor_lang::ZeroCopy for OpenbookV2FulfillmentConfig {}
4017    #[automatically_derived]
4018    impl anchor_lang::AccountSerialize for OpenbookV2FulfillmentConfig {
4019        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
4020            if writer.write_all(Self::DISCRIMINATOR).is_err() {
4021                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
4022            }
4023            if AnchorSerialize::serialize(self, writer).is_err() {
4024                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
4025            }
4026            Ok(())
4027        }
4028    }
4029    #[automatically_derived]
4030    impl anchor_lang::AccountDeserialize for OpenbookV2FulfillmentConfig {
4031        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
4032            let given_disc = &buf[..8];
4033            if Self::DISCRIMINATOR != given_disc {
4034                return Err(anchor_lang::error!(
4035                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
4036                ));
4037            }
4038            Self::try_deserialize_unchecked(buf)
4039        }
4040        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
4041            let mut data: &[u8] = &buf[8..];
4042            AnchorDeserialize::deserialize(&mut data)
4043                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
4044        }
4045    }
4046    #[repr(C)]
4047    #[derive(
4048        AnchorSerialize,
4049        AnchorDeserialize,
4050        InitSpace,
4051        Serialize,
4052        Deserialize,
4053        Copy,
4054        Clone,
4055        Default,
4056        Debug,
4057        PartialEq,
4058    )]
4059    pub struct PhoenixV1FulfillmentConfig {
4060        pub pubkey: Pubkey,
4061        pub phoenix_program_id: Pubkey,
4062        pub phoenix_log_authority: Pubkey,
4063        pub phoenix_market: Pubkey,
4064        pub phoenix_base_vault: Pubkey,
4065        pub phoenix_quote_vault: Pubkey,
4066        pub market_index: u16,
4067        pub fulfillment_type: SpotFulfillmentType,
4068        pub status: SpotFulfillmentConfigStatus,
4069        #[serde(skip)]
4070        pub padding: Padding<4>,
4071    }
4072    #[automatically_derived]
4073    impl anchor_lang::Discriminator for PhoenixV1FulfillmentConfig {
4074        const DISCRIMINATOR: &[u8] = &[233, 45, 62, 40, 35, 129, 48, 72];
4075    }
4076    #[automatically_derived]
4077    unsafe impl anchor_lang::__private::bytemuck::Pod for PhoenixV1FulfillmentConfig {}
4078    #[automatically_derived]
4079    unsafe impl anchor_lang::__private::bytemuck::Zeroable for PhoenixV1FulfillmentConfig {}
4080    #[automatically_derived]
4081    impl anchor_lang::ZeroCopy for PhoenixV1FulfillmentConfig {}
4082    #[automatically_derived]
4083    impl anchor_lang::AccountSerialize for PhoenixV1FulfillmentConfig {
4084        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
4085            if writer.write_all(Self::DISCRIMINATOR).is_err() {
4086                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
4087            }
4088            if AnchorSerialize::serialize(self, writer).is_err() {
4089                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
4090            }
4091            Ok(())
4092        }
4093    }
4094    #[automatically_derived]
4095    impl anchor_lang::AccountDeserialize for PhoenixV1FulfillmentConfig {
4096        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
4097            let given_disc = &buf[..8];
4098            if Self::DISCRIMINATOR != given_disc {
4099                return Err(anchor_lang::error!(
4100                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
4101                ));
4102            }
4103            Self::try_deserialize_unchecked(buf)
4104        }
4105        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
4106            let mut data: &[u8] = &buf[8..];
4107            AnchorDeserialize::deserialize(&mut data)
4108                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
4109        }
4110    }
4111    #[repr(C)]
4112    #[derive(
4113        AnchorSerialize,
4114        AnchorDeserialize,
4115        InitSpace,
4116        Serialize,
4117        Deserialize,
4118        Copy,
4119        Clone,
4120        Default,
4121        Debug,
4122        PartialEq,
4123    )]
4124    pub struct SerumV3FulfillmentConfig {
4125        pub pubkey: Pubkey,
4126        pub serum_program_id: Pubkey,
4127        pub serum_market: Pubkey,
4128        pub serum_request_queue: Pubkey,
4129        pub serum_event_queue: Pubkey,
4130        pub serum_bids: Pubkey,
4131        pub serum_asks: Pubkey,
4132        pub serum_base_vault: Pubkey,
4133        pub serum_quote_vault: Pubkey,
4134        pub serum_open_orders: Pubkey,
4135        pub serum_signer_nonce: u64,
4136        pub market_index: u16,
4137        pub fulfillment_type: SpotFulfillmentType,
4138        pub status: SpotFulfillmentConfigStatus,
4139        #[serde(skip)]
4140        pub padding: Padding<4>,
4141    }
4142    #[automatically_derived]
4143    impl anchor_lang::Discriminator for SerumV3FulfillmentConfig {
4144        const DISCRIMINATOR: &[u8] = &[65, 160, 197, 112, 239, 168, 103, 185];
4145    }
4146    #[automatically_derived]
4147    unsafe impl anchor_lang::__private::bytemuck::Pod for SerumV3FulfillmentConfig {}
4148    #[automatically_derived]
4149    unsafe impl anchor_lang::__private::bytemuck::Zeroable for SerumV3FulfillmentConfig {}
4150    #[automatically_derived]
4151    impl anchor_lang::ZeroCopy for SerumV3FulfillmentConfig {}
4152    #[automatically_derived]
4153    impl anchor_lang::AccountSerialize for SerumV3FulfillmentConfig {
4154        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
4155            if writer.write_all(Self::DISCRIMINATOR).is_err() {
4156                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
4157            }
4158            if AnchorSerialize::serialize(self, writer).is_err() {
4159                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
4160            }
4161            Ok(())
4162        }
4163    }
4164    #[automatically_derived]
4165    impl anchor_lang::AccountDeserialize for SerumV3FulfillmentConfig {
4166        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
4167            let given_disc = &buf[..8];
4168            if Self::DISCRIMINATOR != given_disc {
4169                return Err(anchor_lang::error!(
4170                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
4171                ));
4172            }
4173            Self::try_deserialize_unchecked(buf)
4174        }
4175        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
4176            let mut data: &[u8] = &buf[8..];
4177            AnchorDeserialize::deserialize(&mut data)
4178                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
4179        }
4180    }
4181    #[repr(C)]
4182    #[derive(
4183        AnchorSerialize,
4184        AnchorDeserialize,
4185        InitSpace,
4186        Serialize,
4187        Deserialize,
4188        Copy,
4189        Clone,
4190        Default,
4191        Debug,
4192        PartialEq,
4193    )]
4194    pub struct HighLeverageModeConfig {
4195        pub max_users: u32,
4196        pub current_users: u32,
4197        pub reduce_only: u8,
4198        #[serde(skip)]
4199        pub padding: Padding<31>,
4200    }
4201    #[automatically_derived]
4202    impl anchor_lang::Discriminator for HighLeverageModeConfig {
4203        const DISCRIMINATOR: &[u8] = &[3, 196, 90, 189, 193, 64, 228, 234];
4204    }
4205    #[automatically_derived]
4206    unsafe impl anchor_lang::__private::bytemuck::Pod for HighLeverageModeConfig {}
4207    #[automatically_derived]
4208    unsafe impl anchor_lang::__private::bytemuck::Zeroable for HighLeverageModeConfig {}
4209    #[automatically_derived]
4210    impl anchor_lang::ZeroCopy for HighLeverageModeConfig {}
4211    #[automatically_derived]
4212    impl anchor_lang::AccountSerialize for HighLeverageModeConfig {
4213        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
4214            if writer.write_all(Self::DISCRIMINATOR).is_err() {
4215                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
4216            }
4217            if AnchorSerialize::serialize(self, writer).is_err() {
4218                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
4219            }
4220            Ok(())
4221        }
4222    }
4223    #[automatically_derived]
4224    impl anchor_lang::AccountDeserialize for HighLeverageModeConfig {
4225        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
4226            let given_disc = &buf[..8];
4227            if Self::DISCRIMINATOR != given_disc {
4228                return Err(anchor_lang::error!(
4229                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
4230                ));
4231            }
4232            Self::try_deserialize_unchecked(buf)
4233        }
4234        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
4235            let mut data: &[u8] = &buf[8..];
4236            AnchorDeserialize::deserialize(&mut data)
4237                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
4238        }
4239    }
4240    #[repr(C)]
4241    #[derive(
4242        AnchorSerialize,
4243        AnchorDeserialize,
4244        InitSpace,
4245        Serialize,
4246        Deserialize,
4247        Copy,
4248        Clone,
4249        Default,
4250        Debug,
4251        PartialEq,
4252    )]
4253    pub struct InsuranceFundStake {
4254        pub authority: Pubkey,
4255        pub if_shares: u128,
4256        pub last_withdraw_request_shares: u128,
4257        pub if_base: u128,
4258        pub last_valid_ts: i64,
4259        pub last_withdraw_request_value: u64,
4260        pub last_withdraw_request_ts: i64,
4261        pub cost_basis: i64,
4262        pub market_index: u16,
4263        #[serde(skip)]
4264        pub padding: Padding<14>,
4265    }
4266    #[automatically_derived]
4267    impl anchor_lang::Discriminator for InsuranceFundStake {
4268        const DISCRIMINATOR: &[u8] = &[110, 202, 14, 42, 95, 73, 90, 95];
4269    }
4270    #[automatically_derived]
4271    unsafe impl anchor_lang::__private::bytemuck::Pod for InsuranceFundStake {}
4272    #[automatically_derived]
4273    unsafe impl anchor_lang::__private::bytemuck::Zeroable for InsuranceFundStake {}
4274    #[automatically_derived]
4275    impl anchor_lang::ZeroCopy for InsuranceFundStake {}
4276    #[automatically_derived]
4277    impl anchor_lang::AccountSerialize for InsuranceFundStake {
4278        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
4279            if writer.write_all(Self::DISCRIMINATOR).is_err() {
4280                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
4281            }
4282            if AnchorSerialize::serialize(self, writer).is_err() {
4283                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
4284            }
4285            Ok(())
4286        }
4287    }
4288    #[automatically_derived]
4289    impl anchor_lang::AccountDeserialize for InsuranceFundStake {
4290        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
4291            let given_disc = &buf[..8];
4292            if Self::DISCRIMINATOR != given_disc {
4293                return Err(anchor_lang::error!(
4294                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
4295                ));
4296            }
4297            Self::try_deserialize_unchecked(buf)
4298        }
4299        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
4300            let mut data: &[u8] = &buf[8..];
4301            AnchorDeserialize::deserialize(&mut data)
4302                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
4303        }
4304    }
4305    #[repr(C)]
4306    #[derive(
4307        AnchorSerialize,
4308        AnchorDeserialize,
4309        InitSpace,
4310        Serialize,
4311        Deserialize,
4312        Copy,
4313        Clone,
4314        Default,
4315        Debug,
4316        PartialEq,
4317    )]
4318    pub struct ProtocolIfSharesTransferConfig {
4319        pub whitelisted_signers: [Pubkey; 4],
4320        pub max_transfer_per_epoch: u128,
4321        pub current_epoch_transfer: u128,
4322        pub next_epoch_ts: i64,
4323        #[serde(skip)]
4324        pub padding: Padding<8>,
4325    }
4326    #[automatically_derived]
4327    impl anchor_lang::Discriminator for ProtocolIfSharesTransferConfig {
4328        const DISCRIMINATOR: &[u8] = &[188, 1, 213, 98, 23, 148, 30, 1];
4329    }
4330    #[automatically_derived]
4331    unsafe impl anchor_lang::__private::bytemuck::Pod for ProtocolIfSharesTransferConfig {}
4332    #[automatically_derived]
4333    unsafe impl anchor_lang::__private::bytemuck::Zeroable for ProtocolIfSharesTransferConfig {}
4334    #[automatically_derived]
4335    impl anchor_lang::ZeroCopy for ProtocolIfSharesTransferConfig {}
4336    #[automatically_derived]
4337    impl anchor_lang::AccountSerialize for ProtocolIfSharesTransferConfig {
4338        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
4339            if writer.write_all(Self::DISCRIMINATOR).is_err() {
4340                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
4341            }
4342            if AnchorSerialize::serialize(self, writer).is_err() {
4343                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
4344            }
4345            Ok(())
4346        }
4347    }
4348    #[automatically_derived]
4349    impl anchor_lang::AccountDeserialize for ProtocolIfSharesTransferConfig {
4350        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
4351            let given_disc = &buf[..8];
4352            if Self::DISCRIMINATOR != given_disc {
4353                return Err(anchor_lang::error!(
4354                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
4355                ));
4356            }
4357            Self::try_deserialize_unchecked(buf)
4358        }
4359        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
4360            let mut data: &[u8] = &buf[8..];
4361            AnchorDeserialize::deserialize(&mut data)
4362                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
4363        }
4364    }
4365    #[repr(C)]
4366    #[derive(
4367        AnchorSerialize,
4368        AnchorDeserialize,
4369        InitSpace,
4370        Serialize,
4371        Deserialize,
4372        Copy,
4373        Clone,
4374        Default,
4375        Debug,
4376        PartialEq,
4377    )]
4378    pub struct PrelaunchOracle {
4379        pub price: i64,
4380        pub max_price: i64,
4381        pub confidence: u64,
4382        pub last_update_slot: u64,
4383        pub amm_last_update_slot: u64,
4384        pub perp_market_index: u16,
4385        #[serde(skip)]
4386        pub padding: Padding<70>,
4387    }
4388    #[automatically_derived]
4389    impl anchor_lang::Discriminator for PrelaunchOracle {
4390        const DISCRIMINATOR: &[u8] = &[92, 14, 139, 234, 72, 244, 68, 26];
4391    }
4392    #[automatically_derived]
4393    unsafe impl anchor_lang::__private::bytemuck::Pod for PrelaunchOracle {}
4394    #[automatically_derived]
4395    unsafe impl anchor_lang::__private::bytemuck::Zeroable for PrelaunchOracle {}
4396    #[automatically_derived]
4397    impl anchor_lang::ZeroCopy for PrelaunchOracle {}
4398    #[automatically_derived]
4399    impl anchor_lang::AccountSerialize for PrelaunchOracle {
4400        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
4401            if writer.write_all(Self::DISCRIMINATOR).is_err() {
4402                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
4403            }
4404            if AnchorSerialize::serialize(self, writer).is_err() {
4405                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
4406            }
4407            Ok(())
4408        }
4409    }
4410    #[automatically_derived]
4411    impl anchor_lang::AccountDeserialize for PrelaunchOracle {
4412        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
4413            let given_disc = &buf[..8];
4414            if Self::DISCRIMINATOR != given_disc {
4415                return Err(anchor_lang::error!(
4416                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
4417                ));
4418            }
4419            Self::try_deserialize_unchecked(buf)
4420        }
4421        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
4422            let mut data: &[u8] = &buf[8..];
4423            AnchorDeserialize::deserialize(&mut data)
4424                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
4425        }
4426    }
4427    #[repr(C)]
4428    #[derive(
4429        AnchorSerialize,
4430        AnchorDeserialize,
4431        InitSpace,
4432        Serialize,
4433        Deserialize,
4434        Copy,
4435        Clone,
4436        Default,
4437        Debug,
4438        PartialEq,
4439    )]
4440    pub struct PerpMarket {
4441        pub pubkey: Pubkey,
4442        pub amm: AMM,
4443        pub pnl_pool: PoolBalance,
4444        pub name: [u8; 32],
4445        pub insurance_claim: InsuranceClaim,
4446        pub unrealized_pnl_max_imbalance: u64,
4447        pub expiry_ts: i64,
4448        pub expiry_price: i64,
4449        pub next_fill_record_id: u64,
4450        pub next_funding_rate_record_id: u64,
4451        pub next_curve_record_id: u64,
4452        pub imf_factor: u32,
4453        pub unrealized_pnl_imf_factor: u32,
4454        pub liquidator_fee: u32,
4455        pub if_liquidation_fee: u32,
4456        pub margin_ratio_initial: u32,
4457        pub margin_ratio_maintenance: u32,
4458        pub unrealized_pnl_initial_asset_weight: u32,
4459        pub unrealized_pnl_maintenance_asset_weight: u32,
4460        pub number_of_users_with_base: u32,
4461        pub number_of_users: u32,
4462        pub market_index: u16,
4463        pub status: MarketStatus,
4464        pub contract_type: ContractType,
4465        pub contract_tier: ContractTier,
4466        pub paused_operations: u8,
4467        pub quote_spot_market_index: u16,
4468        pub fee_adjustment: i16,
4469        pub fuel_boost_position: u8,
4470        pub fuel_boost_taker: u8,
4471        pub fuel_boost_maker: u8,
4472        pub pool_id: u8,
4473        pub high_leverage_margin_ratio_initial: u16,
4474        pub high_leverage_margin_ratio_maintenance: u16,
4475        pub protected_maker_limit_price_divisor: u8,
4476        pub protected_maker_dynamic_divisor: u8,
4477        #[serde(skip)]
4478        pub padding: Padding<36>,
4479    }
4480    #[automatically_derived]
4481    impl anchor_lang::Discriminator for PerpMarket {
4482        const DISCRIMINATOR: &[u8] = &[10, 223, 12, 44, 107, 245, 55, 247];
4483    }
4484    #[automatically_derived]
4485    unsafe impl anchor_lang::__private::bytemuck::Pod for PerpMarket {}
4486    #[automatically_derived]
4487    unsafe impl anchor_lang::__private::bytemuck::Zeroable for PerpMarket {}
4488    #[automatically_derived]
4489    impl anchor_lang::ZeroCopy for PerpMarket {}
4490    #[automatically_derived]
4491    impl anchor_lang::AccountSerialize for PerpMarket {
4492        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
4493            if writer.write_all(Self::DISCRIMINATOR).is_err() {
4494                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
4495            }
4496            if AnchorSerialize::serialize(self, writer).is_err() {
4497                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
4498            }
4499            Ok(())
4500        }
4501    }
4502    #[automatically_derived]
4503    impl anchor_lang::AccountDeserialize for PerpMarket {
4504        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
4505            let given_disc = &buf[..8];
4506            if Self::DISCRIMINATOR != given_disc {
4507                return Err(anchor_lang::error!(
4508                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
4509                ));
4510            }
4511            Self::try_deserialize_unchecked(buf)
4512        }
4513        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
4514            let mut data: &[u8] = &buf[8..];
4515            AnchorDeserialize::deserialize(&mut data)
4516                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
4517        }
4518    }
4519    #[repr(C)]
4520    #[derive(
4521        AnchorSerialize,
4522        AnchorDeserialize,
4523        InitSpace,
4524        Serialize,
4525        Deserialize,
4526        Copy,
4527        Clone,
4528        Default,
4529        Debug,
4530        PartialEq,
4531    )]
4532    pub struct ProtectedMakerModeConfig {
4533        pub max_users: u32,
4534        pub current_users: u32,
4535        pub reduce_only: u8,
4536        #[serde(skip)]
4537        pub padding: Padding<31>,
4538    }
4539    #[automatically_derived]
4540    impl anchor_lang::Discriminator for ProtectedMakerModeConfig {
4541        const DISCRIMINATOR: &[u8] = &[47, 86, 90, 9, 224, 255, 10, 69];
4542    }
4543    #[automatically_derived]
4544    unsafe impl anchor_lang::__private::bytemuck::Pod for ProtectedMakerModeConfig {}
4545    #[automatically_derived]
4546    unsafe impl anchor_lang::__private::bytemuck::Zeroable for ProtectedMakerModeConfig {}
4547    #[automatically_derived]
4548    impl anchor_lang::ZeroCopy for ProtectedMakerModeConfig {}
4549    #[automatically_derived]
4550    impl anchor_lang::AccountSerialize for ProtectedMakerModeConfig {
4551        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
4552            if writer.write_all(Self::DISCRIMINATOR).is_err() {
4553                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
4554            }
4555            if AnchorSerialize::serialize(self, writer).is_err() {
4556                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
4557            }
4558            Ok(())
4559        }
4560    }
4561    #[automatically_derived]
4562    impl anchor_lang::AccountDeserialize for ProtectedMakerModeConfig {
4563        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
4564            let given_disc = &buf[..8];
4565            if Self::DISCRIMINATOR != given_disc {
4566                return Err(anchor_lang::error!(
4567                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
4568                ));
4569            }
4570            Self::try_deserialize_unchecked(buf)
4571        }
4572        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
4573            let mut data: &[u8] = &buf[8..];
4574            AnchorDeserialize::deserialize(&mut data)
4575                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
4576        }
4577    }
4578    #[repr(C)]
4579    #[derive(
4580        AnchorSerialize,
4581        AnchorDeserialize,
4582        InitSpace,
4583        Serialize,
4584        Deserialize,
4585        Copy,
4586        Clone,
4587        Default,
4588        Debug,
4589        PartialEq,
4590    )]
4591    pub struct PythLazerOracle {
4592        pub price: i64,
4593        pub publish_time: u64,
4594        pub posted_slot: u64,
4595        pub exponent: i32,
4596        #[serde(skip)]
4597        pub padding: Padding<4>,
4598        pub conf: u64,
4599    }
4600    #[automatically_derived]
4601    impl anchor_lang::Discriminator for PythLazerOracle {
4602        const DISCRIMINATOR: &[u8] = &[159, 7, 161, 249, 34, 81, 121, 133];
4603    }
4604    #[automatically_derived]
4605    unsafe impl anchor_lang::__private::bytemuck::Pod for PythLazerOracle {}
4606    #[automatically_derived]
4607    unsafe impl anchor_lang::__private::bytemuck::Zeroable for PythLazerOracle {}
4608    #[automatically_derived]
4609    impl anchor_lang::ZeroCopy for PythLazerOracle {}
4610    #[automatically_derived]
4611    impl anchor_lang::AccountSerialize for PythLazerOracle {
4612        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
4613            if writer.write_all(Self::DISCRIMINATOR).is_err() {
4614                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
4615            }
4616            if AnchorSerialize::serialize(self, writer).is_err() {
4617                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
4618            }
4619            Ok(())
4620        }
4621    }
4622    #[automatically_derived]
4623    impl anchor_lang::AccountDeserialize for PythLazerOracle {
4624        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
4625            let given_disc = &buf[..8];
4626            if Self::DISCRIMINATOR != given_disc {
4627                return Err(anchor_lang::error!(
4628                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
4629                ));
4630            }
4631            Self::try_deserialize_unchecked(buf)
4632        }
4633        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
4634            let mut data: &[u8] = &buf[8..];
4635            AnchorDeserialize::deserialize(&mut data)
4636                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
4637        }
4638    }
4639    #[repr(C)]
4640    #[derive(
4641        AnchorSerialize, AnchorDeserialize, Serialize, Deserialize, Clone, Default, Debug, PartialEq,
4642    )]
4643    pub struct SignedMsgUserOrders {
4644        pub authority_pubkey: Pubkey,
4645        pub padding: u32,
4646        pub signed_msg_order_data: Vec<SignedMsgOrderId>,
4647    }
4648    #[automatically_derived]
4649    impl anchor_lang::Discriminator for SignedMsgUserOrders {
4650        const DISCRIMINATOR: &[u8] = &[70, 6, 50, 248, 222, 1, 143, 49];
4651    }
4652    #[automatically_derived]
4653    impl anchor_lang::AccountSerialize for SignedMsgUserOrders {
4654        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
4655            if writer.write_all(Self::DISCRIMINATOR).is_err() {
4656                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
4657            }
4658            if AnchorSerialize::serialize(self, writer).is_err() {
4659                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
4660            }
4661            Ok(())
4662        }
4663    }
4664    #[automatically_derived]
4665    impl anchor_lang::AccountDeserialize for SignedMsgUserOrders {
4666        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
4667            let given_disc = &buf[..8];
4668            if Self::DISCRIMINATOR != given_disc {
4669                return Err(anchor_lang::error!(
4670                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
4671                ));
4672            }
4673            Self::try_deserialize_unchecked(buf)
4674        }
4675        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
4676            let mut data: &[u8] = &buf[8..];
4677            AnchorDeserialize::deserialize(&mut data)
4678                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
4679        }
4680    }
4681    #[repr(C)]
4682    #[derive(
4683        AnchorSerialize, AnchorDeserialize, Serialize, Deserialize, Clone, Default, Debug, PartialEq,
4684    )]
4685    pub struct SignedMsgWsDelegates {
4686        pub delegates: Vec<Pubkey>,
4687    }
4688    #[automatically_derived]
4689    impl anchor_lang::Discriminator for SignedMsgWsDelegates {
4690        const DISCRIMINATOR: &[u8] = &[190, 115, 111, 44, 216, 252, 108, 85];
4691    }
4692    #[automatically_derived]
4693    impl anchor_lang::AccountSerialize for SignedMsgWsDelegates {
4694        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
4695            if writer.write_all(Self::DISCRIMINATOR).is_err() {
4696                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
4697            }
4698            if AnchorSerialize::serialize(self, writer).is_err() {
4699                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
4700            }
4701            Ok(())
4702        }
4703    }
4704    #[automatically_derived]
4705    impl anchor_lang::AccountDeserialize for SignedMsgWsDelegates {
4706        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
4707            let given_disc = &buf[..8];
4708            if Self::DISCRIMINATOR != given_disc {
4709                return Err(anchor_lang::error!(
4710                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
4711                ));
4712            }
4713            Self::try_deserialize_unchecked(buf)
4714        }
4715        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
4716            let mut data: &[u8] = &buf[8..];
4717            AnchorDeserialize::deserialize(&mut data)
4718                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
4719        }
4720    }
4721    #[repr(C)]
4722    #[derive(
4723        AnchorSerialize,
4724        AnchorDeserialize,
4725        InitSpace,
4726        Serialize,
4727        Deserialize,
4728        Copy,
4729        Clone,
4730        Default,
4731        Debug,
4732        PartialEq,
4733    )]
4734    pub struct SpotMarket {
4735        pub pubkey: Pubkey,
4736        pub oracle: Pubkey,
4737        pub mint: Pubkey,
4738        pub vault: Pubkey,
4739        pub name: [u8; 32],
4740        pub historical_oracle_data: HistoricalOracleData,
4741        pub historical_index_data: HistoricalIndexData,
4742        pub revenue_pool: PoolBalance,
4743        pub spot_fee_pool: PoolBalance,
4744        pub insurance_fund: InsuranceFund,
4745        pub total_spot_fee: u128,
4746        pub deposit_balance: u128,
4747        pub borrow_balance: u128,
4748        pub cumulative_deposit_interest: u128,
4749        pub cumulative_borrow_interest: u128,
4750        pub total_social_loss: u128,
4751        pub total_quote_social_loss: u128,
4752        pub withdraw_guard_threshold: u64,
4753        pub max_token_deposits: u64,
4754        pub deposit_token_twap: u64,
4755        pub borrow_token_twap: u64,
4756        pub utilization_twap: u64,
4757        pub last_interest_ts: u64,
4758        pub last_twap_ts: u64,
4759        pub expiry_ts: i64,
4760        pub order_step_size: u64,
4761        pub order_tick_size: u64,
4762        pub min_order_size: u64,
4763        pub max_position_size: u64,
4764        pub next_fill_record_id: u64,
4765        pub next_deposit_record_id: u64,
4766        pub initial_asset_weight: u32,
4767        pub maintenance_asset_weight: u32,
4768        pub initial_liability_weight: u32,
4769        pub maintenance_liability_weight: u32,
4770        pub imf_factor: u32,
4771        pub liquidator_fee: u32,
4772        pub if_liquidation_fee: u32,
4773        pub optimal_utilization: u32,
4774        pub optimal_borrow_rate: u32,
4775        pub max_borrow_rate: u32,
4776        pub decimals: u32,
4777        pub market_index: u16,
4778        pub orders_enabled: bool,
4779        pub oracle_source: OracleSource,
4780        pub status: MarketStatus,
4781        pub asset_tier: AssetTier,
4782        pub paused_operations: u8,
4783        pub if_paused_operations: u8,
4784        pub fee_adjustment: i16,
4785        pub max_token_borrows_fraction: u16,
4786        pub flash_loan_amount: u64,
4787        pub flash_loan_initial_token_amount: u64,
4788        pub total_swap_fee: u64,
4789        pub scale_initial_asset_weight_start: u64,
4790        pub min_borrow_rate: u8,
4791        pub fuel_boost_deposits: u8,
4792        pub fuel_boost_borrows: u8,
4793        pub fuel_boost_taker: u8,
4794        pub fuel_boost_maker: u8,
4795        pub fuel_boost_insurance: u8,
4796        pub token_program: u8,
4797        pub pool_id: u8,
4798        #[serde(skip)]
4799        pub padding: Padding<40>,
4800    }
4801    #[automatically_derived]
4802    impl anchor_lang::Discriminator for SpotMarket {
4803        const DISCRIMINATOR: &[u8] = &[100, 177, 8, 107, 168, 65, 65, 39];
4804    }
4805    #[automatically_derived]
4806    unsafe impl anchor_lang::__private::bytemuck::Pod for SpotMarket {}
4807    #[automatically_derived]
4808    unsafe impl anchor_lang::__private::bytemuck::Zeroable for SpotMarket {}
4809    #[automatically_derived]
4810    impl anchor_lang::ZeroCopy for SpotMarket {}
4811    #[automatically_derived]
4812    impl anchor_lang::AccountSerialize for SpotMarket {
4813        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
4814            if writer.write_all(Self::DISCRIMINATOR).is_err() {
4815                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
4816            }
4817            if AnchorSerialize::serialize(self, writer).is_err() {
4818                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
4819            }
4820            Ok(())
4821        }
4822    }
4823    #[automatically_derived]
4824    impl anchor_lang::AccountDeserialize for SpotMarket {
4825        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
4826            let given_disc = &buf[..8];
4827            if Self::DISCRIMINATOR != given_disc {
4828                return Err(anchor_lang::error!(
4829                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
4830                ));
4831            }
4832            Self::try_deserialize_unchecked(buf)
4833        }
4834        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
4835            let mut data: &[u8] = &buf[8..];
4836            AnchorDeserialize::deserialize(&mut data)
4837                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
4838        }
4839    }
4840    #[repr(C)]
4841    #[derive(
4842        AnchorSerialize,
4843        AnchorDeserialize,
4844        InitSpace,
4845        Serialize,
4846        Deserialize,
4847        Copy,
4848        Clone,
4849        Default,
4850        Debug,
4851        PartialEq,
4852    )]
4853    pub struct State {
4854        pub admin: Pubkey,
4855        pub whitelist_mint: Pubkey,
4856        pub discount_mint: Pubkey,
4857        pub signer: Pubkey,
4858        pub srm_vault: Pubkey,
4859        pub perp_fee_structure: FeeStructure,
4860        pub spot_fee_structure: FeeStructure,
4861        pub oracle_guard_rails: OracleGuardRails,
4862        pub number_of_authorities: u64,
4863        pub number_of_sub_accounts: u64,
4864        pub lp_cooldown_time: u64,
4865        pub liquidation_margin_buffer_ratio: u32,
4866        pub settlement_duration: u16,
4867        pub number_of_markets: u16,
4868        pub number_of_spot_markets: u16,
4869        pub signer_nonce: u8,
4870        pub min_perp_auction_duration: u8,
4871        pub default_market_order_time_in_force: u8,
4872        pub default_spot_auction_duration: u8,
4873        pub exchange_status: u8,
4874        pub liquidation_duration: u8,
4875        pub initial_pct_to_liquidate: u16,
4876        pub max_number_of_sub_accounts: u16,
4877        pub max_initialize_user_fee: u16,
4878        #[serde(skip)]
4879        pub padding: Padding<10>,
4880    }
4881    #[automatically_derived]
4882    impl anchor_lang::Discriminator for State {
4883        const DISCRIMINATOR: &[u8] = &[216, 146, 107, 94, 104, 75, 182, 177];
4884    }
4885    #[automatically_derived]
4886    unsafe impl anchor_lang::__private::bytemuck::Pod for State {}
4887    #[automatically_derived]
4888    unsafe impl anchor_lang::__private::bytemuck::Zeroable for State {}
4889    #[automatically_derived]
4890    impl anchor_lang::ZeroCopy for State {}
4891    #[automatically_derived]
4892    impl anchor_lang::AccountSerialize for State {
4893        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
4894            if writer.write_all(Self::DISCRIMINATOR).is_err() {
4895                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
4896            }
4897            if AnchorSerialize::serialize(self, writer).is_err() {
4898                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
4899            }
4900            Ok(())
4901        }
4902    }
4903    #[automatically_derived]
4904    impl anchor_lang::AccountDeserialize for State {
4905        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
4906            let given_disc = &buf[..8];
4907            if Self::DISCRIMINATOR != given_disc {
4908                return Err(anchor_lang::error!(
4909                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
4910                ));
4911            }
4912            Self::try_deserialize_unchecked(buf)
4913        }
4914        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
4915            let mut data: &[u8] = &buf[8..];
4916            AnchorDeserialize::deserialize(&mut data)
4917                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
4918        }
4919    }
4920    #[repr(C)]
4921    #[derive(
4922        AnchorSerialize,
4923        AnchorDeserialize,
4924        InitSpace,
4925        Serialize,
4926        Deserialize,
4927        Copy,
4928        Clone,
4929        Default,
4930        Debug,
4931        PartialEq,
4932    )]
4933    pub struct User {
4934        pub authority: Pubkey,
4935        pub delegate: Pubkey,
4936        pub name: [u8; 32],
4937        pub spot_positions: [SpotPosition; 8],
4938        pub perp_positions: [PerpPosition; 8],
4939        pub orders: [Order; 32],
4940        pub last_add_perp_lp_shares_ts: i64,
4941        pub total_deposits: u64,
4942        pub total_withdraws: u64,
4943        pub total_social_loss: u64,
4944        pub settled_perp_pnl: i64,
4945        pub cumulative_spot_fees: i64,
4946        pub cumulative_perp_funding: i64,
4947        pub liquidation_margin_freed: u64,
4948        pub last_active_slot: u64,
4949        pub next_order_id: u32,
4950        pub max_margin_ratio: u32,
4951        pub next_liquidation_id: u16,
4952        pub sub_account_id: u16,
4953        pub status: u8,
4954        pub is_margin_trading_enabled: bool,
4955        pub idle: bool,
4956        pub open_orders: u8,
4957        pub has_open_order: bool,
4958        pub open_auctions: u8,
4959        pub has_open_auction: bool,
4960        pub margin_mode: MarginMode,
4961        pub pool_id: u8,
4962        pub padding1: [u8; 3],
4963        pub last_fuel_bonus_update_ts: u32,
4964        #[serde(skip)]
4965        pub padding: Padding<12>,
4966    }
4967    #[automatically_derived]
4968    impl anchor_lang::Discriminator for User {
4969        const DISCRIMINATOR: &[u8] = &[159, 117, 95, 227, 239, 151, 58, 236];
4970    }
4971    #[automatically_derived]
4972    unsafe impl anchor_lang::__private::bytemuck::Pod for User {}
4973    #[automatically_derived]
4974    unsafe impl anchor_lang::__private::bytemuck::Zeroable for User {}
4975    #[automatically_derived]
4976    impl anchor_lang::ZeroCopy for User {}
4977    #[automatically_derived]
4978    impl anchor_lang::AccountSerialize for User {
4979        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
4980            if writer.write_all(Self::DISCRIMINATOR).is_err() {
4981                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
4982            }
4983            if AnchorSerialize::serialize(self, writer).is_err() {
4984                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
4985            }
4986            Ok(())
4987        }
4988    }
4989    #[automatically_derived]
4990    impl anchor_lang::AccountDeserialize for User {
4991        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
4992            let given_disc = &buf[..8];
4993            if Self::DISCRIMINATOR != given_disc {
4994                return Err(anchor_lang::error!(
4995                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
4996                ));
4997            }
4998            Self::try_deserialize_unchecked(buf)
4999        }
5000        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
5001            let mut data: &[u8] = &buf[8..];
5002            AnchorDeserialize::deserialize(&mut data)
5003                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
5004        }
5005    }
5006    #[repr(C)]
5007    #[derive(
5008        AnchorSerialize,
5009        AnchorDeserialize,
5010        InitSpace,
5011        Serialize,
5012        Deserialize,
5013        Copy,
5014        Clone,
5015        Default,
5016        Debug,
5017        PartialEq,
5018    )]
5019    pub struct UserStats {
5020        pub authority: Pubkey,
5021        pub referrer: Pubkey,
5022        pub fees: UserFees,
5023        pub next_epoch_ts: i64,
5024        pub maker_volume30d: u64,
5025        pub taker_volume30d: u64,
5026        pub filler_volume30d: u64,
5027        pub last_maker_volume30d_ts: i64,
5028        pub last_taker_volume30d_ts: i64,
5029        pub last_filler_volume30d_ts: i64,
5030        pub if_staked_quote_asset_amount: u64,
5031        pub number_of_sub_accounts: u16,
5032        pub number_of_sub_accounts_created: u16,
5033        pub referrer_status: u8,
5034        pub disable_update_perp_bid_ask_twap: bool,
5035        pub padding1: [u8; 1],
5036        pub fuel_overflow_status: u8,
5037        pub fuel_insurance: u32,
5038        pub fuel_deposits: u32,
5039        pub fuel_borrows: u32,
5040        pub fuel_positions: u32,
5041        pub fuel_taker: u32,
5042        pub fuel_maker: u32,
5043        pub if_staked_gov_token_amount: u64,
5044        pub last_fuel_if_bonus_update_ts: u32,
5045        #[serde(skip)]
5046        pub padding: Padding<12>,
5047    }
5048    #[automatically_derived]
5049    impl anchor_lang::Discriminator for UserStats {
5050        const DISCRIMINATOR: &[u8] = &[176, 223, 136, 27, 122, 79, 32, 227];
5051    }
5052    #[automatically_derived]
5053    unsafe impl anchor_lang::__private::bytemuck::Pod for UserStats {}
5054    #[automatically_derived]
5055    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UserStats {}
5056    #[automatically_derived]
5057    impl anchor_lang::ZeroCopy for UserStats {}
5058    #[automatically_derived]
5059    impl anchor_lang::AccountSerialize for UserStats {
5060        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
5061            if writer.write_all(Self::DISCRIMINATOR).is_err() {
5062                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
5063            }
5064            if AnchorSerialize::serialize(self, writer).is_err() {
5065                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
5066            }
5067            Ok(())
5068        }
5069    }
5070    #[automatically_derived]
5071    impl anchor_lang::AccountDeserialize for UserStats {
5072        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
5073            let given_disc = &buf[..8];
5074            if Self::DISCRIMINATOR != given_disc {
5075                return Err(anchor_lang::error!(
5076                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
5077                ));
5078            }
5079            Self::try_deserialize_unchecked(buf)
5080        }
5081        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
5082            let mut data: &[u8] = &buf[8..];
5083            AnchorDeserialize::deserialize(&mut data)
5084                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
5085        }
5086    }
5087    #[repr(C)]
5088    #[derive(
5089        AnchorSerialize,
5090        AnchorDeserialize,
5091        InitSpace,
5092        Serialize,
5093        Deserialize,
5094        Copy,
5095        Clone,
5096        Default,
5097        Debug,
5098        PartialEq,
5099    )]
5100    pub struct ReferrerName {
5101        pub authority: Pubkey,
5102        pub user: Pubkey,
5103        pub user_stats: Pubkey,
5104        pub name: [u8; 32],
5105    }
5106    #[automatically_derived]
5107    impl anchor_lang::Discriminator for ReferrerName {
5108        const DISCRIMINATOR: &[u8] = &[105, 133, 170, 110, 52, 42, 28, 182];
5109    }
5110    #[automatically_derived]
5111    unsafe impl anchor_lang::__private::bytemuck::Pod for ReferrerName {}
5112    #[automatically_derived]
5113    unsafe impl anchor_lang::__private::bytemuck::Zeroable for ReferrerName {}
5114    #[automatically_derived]
5115    impl anchor_lang::ZeroCopy for ReferrerName {}
5116    #[automatically_derived]
5117    impl anchor_lang::AccountSerialize for ReferrerName {
5118        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
5119            if writer.write_all(Self::DISCRIMINATOR).is_err() {
5120                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
5121            }
5122            if AnchorSerialize::serialize(self, writer).is_err() {
5123                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
5124            }
5125            Ok(())
5126        }
5127    }
5128    #[automatically_derived]
5129    impl anchor_lang::AccountDeserialize for ReferrerName {
5130        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
5131            let given_disc = &buf[..8];
5132            if Self::DISCRIMINATOR != given_disc {
5133                return Err(anchor_lang::error!(
5134                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
5135                ));
5136            }
5137            Self::try_deserialize_unchecked(buf)
5138        }
5139        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
5140            let mut data: &[u8] = &buf[8..];
5141            AnchorDeserialize::deserialize(&mut data)
5142                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
5143        }
5144    }
5145    #[repr(C)]
5146    #[derive(
5147        AnchorSerialize,
5148        AnchorDeserialize,
5149        InitSpace,
5150        Serialize,
5151        Deserialize,
5152        Copy,
5153        Clone,
5154        Default,
5155        Debug,
5156        PartialEq,
5157    )]
5158    pub struct FuelOverflow {
5159        pub authority: Pubkey,
5160        pub fuel_insurance: u128,
5161        pub fuel_deposits: u128,
5162        pub fuel_borrows: u128,
5163        pub fuel_positions: u128,
5164        pub fuel_taker: u128,
5165        pub fuel_maker: u128,
5166        pub last_fuel_sweep_ts: u32,
5167        pub last_reset_ts: u32,
5168        #[serde(skip)]
5169        pub padding: Padding<6>,
5170    }
5171    #[automatically_derived]
5172    impl anchor_lang::Discriminator for FuelOverflow {
5173        const DISCRIMINATOR: &[u8] = &[182, 64, 231, 177, 226, 142, 69, 58];
5174    }
5175    #[automatically_derived]
5176    unsafe impl anchor_lang::__private::bytemuck::Pod for FuelOverflow {}
5177    #[automatically_derived]
5178    unsafe impl anchor_lang::__private::bytemuck::Zeroable for FuelOverflow {}
5179    #[automatically_derived]
5180    impl anchor_lang::ZeroCopy for FuelOverflow {}
5181    #[automatically_derived]
5182    impl anchor_lang::AccountSerialize for FuelOverflow {
5183        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
5184            if writer.write_all(Self::DISCRIMINATOR).is_err() {
5185                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
5186            }
5187            if AnchorSerialize::serialize(self, writer).is_err() {
5188                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
5189            }
5190            Ok(())
5191        }
5192    }
5193    #[automatically_derived]
5194    impl anchor_lang::AccountDeserialize for FuelOverflow {
5195        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
5196            let given_disc = &buf[..8];
5197            if Self::DISCRIMINATOR != given_disc {
5198                return Err(anchor_lang::error!(
5199                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
5200                ));
5201            }
5202            Self::try_deserialize_unchecked(buf)
5203        }
5204        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
5205            let mut data: &[u8] = &buf[8..];
5206            AnchorDeserialize::deserialize(&mut data)
5207                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
5208        }
5209    }
5210    #[repr(C)]
5211    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
5212    pub struct InitializeUser {
5213        pub user: Pubkey,
5214        pub user_stats: Pubkey,
5215        pub state: Pubkey,
5216        pub authority: Pubkey,
5217        pub payer: Pubkey,
5218        pub rent: Pubkey,
5219        pub system_program: Pubkey,
5220    }
5221    #[automatically_derived]
5222    impl anchor_lang::Discriminator for InitializeUser {
5223        const DISCRIMINATOR: &[u8] = &[203, 62, 186, 181, 109, 250, 240, 193];
5224    }
5225    #[automatically_derived]
5226    unsafe impl anchor_lang::__private::bytemuck::Pod for InitializeUser {}
5227    #[automatically_derived]
5228    unsafe impl anchor_lang::__private::bytemuck::Zeroable for InitializeUser {}
5229    #[automatically_derived]
5230    impl anchor_lang::ZeroCopy for InitializeUser {}
5231    #[automatically_derived]
5232    impl anchor_lang::InstructionData for InitializeUser {}
5233    #[automatically_derived]
5234    impl ToAccountMetas for InitializeUser {
5235        fn to_account_metas(&self) -> Vec<AccountMeta> {
5236            vec![
5237                AccountMeta {
5238                    pubkey: self.user,
5239                    is_signer: false,
5240                    is_writable: true,
5241                },
5242                AccountMeta {
5243                    pubkey: self.user_stats,
5244                    is_signer: false,
5245                    is_writable: true,
5246                },
5247                AccountMeta {
5248                    pubkey: self.state,
5249                    is_signer: false,
5250                    is_writable: true,
5251                },
5252                AccountMeta {
5253                    pubkey: self.authority,
5254                    is_signer: true,
5255                    is_writable: false,
5256                },
5257                AccountMeta {
5258                    pubkey: self.payer,
5259                    is_signer: true,
5260                    is_writable: true,
5261                },
5262                AccountMeta {
5263                    pubkey: self.rent,
5264                    is_signer: false,
5265                    is_writable: false,
5266                },
5267                AccountMeta {
5268                    pubkey: self.system_program,
5269                    is_signer: false,
5270                    is_writable: false,
5271                },
5272            ]
5273        }
5274    }
5275    #[automatically_derived]
5276    impl anchor_lang::AccountSerialize for InitializeUser {
5277        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
5278            if writer.write_all(Self::DISCRIMINATOR).is_err() {
5279                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
5280            }
5281            if AnchorSerialize::serialize(self, writer).is_err() {
5282                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
5283            }
5284            Ok(())
5285        }
5286    }
5287    #[automatically_derived]
5288    impl anchor_lang::AccountDeserialize for InitializeUser {
5289        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
5290            let given_disc = &buf[..8];
5291            if Self::DISCRIMINATOR != given_disc {
5292                return Err(anchor_lang::error!(
5293                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
5294                ));
5295            }
5296            Self::try_deserialize_unchecked(buf)
5297        }
5298        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
5299            let mut data: &[u8] = &buf[8..];
5300            AnchorDeserialize::deserialize(&mut data)
5301                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
5302        }
5303    }
5304    #[repr(C)]
5305    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
5306    pub struct InitializeUserStats {
5307        pub user_stats: Pubkey,
5308        pub state: Pubkey,
5309        pub authority: Pubkey,
5310        pub payer: Pubkey,
5311        pub rent: Pubkey,
5312        pub system_program: Pubkey,
5313    }
5314    #[automatically_derived]
5315    impl anchor_lang::Discriminator for InitializeUserStats {
5316        const DISCRIMINATOR: &[u8] = &[193, 37, 127, 56, 10, 44, 65, 13];
5317    }
5318    #[automatically_derived]
5319    unsafe impl anchor_lang::__private::bytemuck::Pod for InitializeUserStats {}
5320    #[automatically_derived]
5321    unsafe impl anchor_lang::__private::bytemuck::Zeroable for InitializeUserStats {}
5322    #[automatically_derived]
5323    impl anchor_lang::ZeroCopy for InitializeUserStats {}
5324    #[automatically_derived]
5325    impl anchor_lang::InstructionData for InitializeUserStats {}
5326    #[automatically_derived]
5327    impl ToAccountMetas for InitializeUserStats {
5328        fn to_account_metas(&self) -> Vec<AccountMeta> {
5329            vec![
5330                AccountMeta {
5331                    pubkey: self.user_stats,
5332                    is_signer: false,
5333                    is_writable: true,
5334                },
5335                AccountMeta {
5336                    pubkey: self.state,
5337                    is_signer: false,
5338                    is_writable: true,
5339                },
5340                AccountMeta {
5341                    pubkey: self.authority,
5342                    is_signer: true,
5343                    is_writable: false,
5344                },
5345                AccountMeta {
5346                    pubkey: self.payer,
5347                    is_signer: true,
5348                    is_writable: true,
5349                },
5350                AccountMeta {
5351                    pubkey: self.rent,
5352                    is_signer: false,
5353                    is_writable: false,
5354                },
5355                AccountMeta {
5356                    pubkey: self.system_program,
5357                    is_signer: false,
5358                    is_writable: false,
5359                },
5360            ]
5361        }
5362    }
5363    #[automatically_derived]
5364    impl anchor_lang::AccountSerialize for InitializeUserStats {
5365        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
5366            if writer.write_all(Self::DISCRIMINATOR).is_err() {
5367                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
5368            }
5369            if AnchorSerialize::serialize(self, writer).is_err() {
5370                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
5371            }
5372            Ok(())
5373        }
5374    }
5375    #[automatically_derived]
5376    impl anchor_lang::AccountDeserialize for InitializeUserStats {
5377        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
5378            let given_disc = &buf[..8];
5379            if Self::DISCRIMINATOR != given_disc {
5380                return Err(anchor_lang::error!(
5381                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
5382                ));
5383            }
5384            Self::try_deserialize_unchecked(buf)
5385        }
5386        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
5387            let mut data: &[u8] = &buf[8..];
5388            AnchorDeserialize::deserialize(&mut data)
5389                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
5390        }
5391    }
5392    #[repr(C)]
5393    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
5394    pub struct InitializeSignedMsgUserOrders {
5395        pub signed_msg_user_orders: Pubkey,
5396        pub authority: Pubkey,
5397        pub payer: Pubkey,
5398        pub rent: Pubkey,
5399        pub system_program: Pubkey,
5400    }
5401    #[automatically_derived]
5402    impl anchor_lang::Discriminator for InitializeSignedMsgUserOrders {
5403        const DISCRIMINATOR: &[u8] = &[49, 255, 141, 186, 72, 235, 186, 237];
5404    }
5405    #[automatically_derived]
5406    unsafe impl anchor_lang::__private::bytemuck::Pod for InitializeSignedMsgUserOrders {}
5407    #[automatically_derived]
5408    unsafe impl anchor_lang::__private::bytemuck::Zeroable for InitializeSignedMsgUserOrders {}
5409    #[automatically_derived]
5410    impl anchor_lang::ZeroCopy for InitializeSignedMsgUserOrders {}
5411    #[automatically_derived]
5412    impl anchor_lang::InstructionData for InitializeSignedMsgUserOrders {}
5413    #[automatically_derived]
5414    impl ToAccountMetas for InitializeSignedMsgUserOrders {
5415        fn to_account_metas(&self) -> Vec<AccountMeta> {
5416            vec![
5417                AccountMeta {
5418                    pubkey: self.signed_msg_user_orders,
5419                    is_signer: false,
5420                    is_writable: true,
5421                },
5422                AccountMeta {
5423                    pubkey: self.authority,
5424                    is_signer: false,
5425                    is_writable: false,
5426                },
5427                AccountMeta {
5428                    pubkey: self.payer,
5429                    is_signer: true,
5430                    is_writable: true,
5431                },
5432                AccountMeta {
5433                    pubkey: self.rent,
5434                    is_signer: false,
5435                    is_writable: false,
5436                },
5437                AccountMeta {
5438                    pubkey: self.system_program,
5439                    is_signer: false,
5440                    is_writable: false,
5441                },
5442            ]
5443        }
5444    }
5445    #[automatically_derived]
5446    impl anchor_lang::AccountSerialize for InitializeSignedMsgUserOrders {
5447        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
5448            if writer.write_all(Self::DISCRIMINATOR).is_err() {
5449                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
5450            }
5451            if AnchorSerialize::serialize(self, writer).is_err() {
5452                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
5453            }
5454            Ok(())
5455        }
5456    }
5457    #[automatically_derived]
5458    impl anchor_lang::AccountDeserialize for InitializeSignedMsgUserOrders {
5459        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
5460            let given_disc = &buf[..8];
5461            if Self::DISCRIMINATOR != given_disc {
5462                return Err(anchor_lang::error!(
5463                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
5464                ));
5465            }
5466            Self::try_deserialize_unchecked(buf)
5467        }
5468        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
5469            let mut data: &[u8] = &buf[8..];
5470            AnchorDeserialize::deserialize(&mut data)
5471                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
5472        }
5473    }
5474    #[repr(C)]
5475    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
5476    pub struct ResizeSignedMsgUserOrders {
5477        pub signed_msg_user_orders: Pubkey,
5478        pub authority: Pubkey,
5479        pub user: Pubkey,
5480        pub payer: Pubkey,
5481        pub system_program: Pubkey,
5482    }
5483    #[automatically_derived]
5484    impl anchor_lang::Discriminator for ResizeSignedMsgUserOrders {
5485        const DISCRIMINATOR: &[u8] = &[125, 177, 239, 3, 35, 33, 152, 87];
5486    }
5487    #[automatically_derived]
5488    unsafe impl anchor_lang::__private::bytemuck::Pod for ResizeSignedMsgUserOrders {}
5489    #[automatically_derived]
5490    unsafe impl anchor_lang::__private::bytemuck::Zeroable for ResizeSignedMsgUserOrders {}
5491    #[automatically_derived]
5492    impl anchor_lang::ZeroCopy for ResizeSignedMsgUserOrders {}
5493    #[automatically_derived]
5494    impl anchor_lang::InstructionData for ResizeSignedMsgUserOrders {}
5495    #[automatically_derived]
5496    impl ToAccountMetas for ResizeSignedMsgUserOrders {
5497        fn to_account_metas(&self) -> Vec<AccountMeta> {
5498            vec![
5499                AccountMeta {
5500                    pubkey: self.signed_msg_user_orders,
5501                    is_signer: false,
5502                    is_writable: true,
5503                },
5504                AccountMeta {
5505                    pubkey: self.authority,
5506                    is_signer: false,
5507                    is_writable: false,
5508                },
5509                AccountMeta {
5510                    pubkey: self.user,
5511                    is_signer: false,
5512                    is_writable: false,
5513                },
5514                AccountMeta {
5515                    pubkey: self.payer,
5516                    is_signer: true,
5517                    is_writable: true,
5518                },
5519                AccountMeta {
5520                    pubkey: self.system_program,
5521                    is_signer: false,
5522                    is_writable: false,
5523                },
5524            ]
5525        }
5526    }
5527    #[automatically_derived]
5528    impl anchor_lang::AccountSerialize for ResizeSignedMsgUserOrders {
5529        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
5530            if writer.write_all(Self::DISCRIMINATOR).is_err() {
5531                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
5532            }
5533            if AnchorSerialize::serialize(self, writer).is_err() {
5534                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
5535            }
5536            Ok(())
5537        }
5538    }
5539    #[automatically_derived]
5540    impl anchor_lang::AccountDeserialize for ResizeSignedMsgUserOrders {
5541        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
5542            let given_disc = &buf[..8];
5543            if Self::DISCRIMINATOR != given_disc {
5544                return Err(anchor_lang::error!(
5545                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
5546                ));
5547            }
5548            Self::try_deserialize_unchecked(buf)
5549        }
5550        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
5551            let mut data: &[u8] = &buf[8..];
5552            AnchorDeserialize::deserialize(&mut data)
5553                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
5554        }
5555    }
5556    #[repr(C)]
5557    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
5558    pub struct InitializeSignedMsgWsDelegates {
5559        pub signed_msg_ws_delegates: Pubkey,
5560        pub authority: Pubkey,
5561        pub rent: Pubkey,
5562        pub system_program: Pubkey,
5563    }
5564    #[automatically_derived]
5565    impl anchor_lang::Discriminator for InitializeSignedMsgWsDelegates {
5566        const DISCRIMINATOR: &[u8] = &[171, 35, 226, 71, 228, 189, 130, 139];
5567    }
5568    #[automatically_derived]
5569    unsafe impl anchor_lang::__private::bytemuck::Pod for InitializeSignedMsgWsDelegates {}
5570    #[automatically_derived]
5571    unsafe impl anchor_lang::__private::bytemuck::Zeroable for InitializeSignedMsgWsDelegates {}
5572    #[automatically_derived]
5573    impl anchor_lang::ZeroCopy for InitializeSignedMsgWsDelegates {}
5574    #[automatically_derived]
5575    impl anchor_lang::InstructionData for InitializeSignedMsgWsDelegates {}
5576    #[automatically_derived]
5577    impl ToAccountMetas for InitializeSignedMsgWsDelegates {
5578        fn to_account_metas(&self) -> Vec<AccountMeta> {
5579            vec![
5580                AccountMeta {
5581                    pubkey: self.signed_msg_ws_delegates,
5582                    is_signer: false,
5583                    is_writable: true,
5584                },
5585                AccountMeta {
5586                    pubkey: self.authority,
5587                    is_signer: true,
5588                    is_writable: true,
5589                },
5590                AccountMeta {
5591                    pubkey: self.rent,
5592                    is_signer: false,
5593                    is_writable: false,
5594                },
5595                AccountMeta {
5596                    pubkey: self.system_program,
5597                    is_signer: false,
5598                    is_writable: false,
5599                },
5600            ]
5601        }
5602    }
5603    #[automatically_derived]
5604    impl anchor_lang::AccountSerialize for InitializeSignedMsgWsDelegates {
5605        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
5606            if writer.write_all(Self::DISCRIMINATOR).is_err() {
5607                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
5608            }
5609            if AnchorSerialize::serialize(self, writer).is_err() {
5610                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
5611            }
5612            Ok(())
5613        }
5614    }
5615    #[automatically_derived]
5616    impl anchor_lang::AccountDeserialize for InitializeSignedMsgWsDelegates {
5617        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
5618            let given_disc = &buf[..8];
5619            if Self::DISCRIMINATOR != given_disc {
5620                return Err(anchor_lang::error!(
5621                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
5622                ));
5623            }
5624            Self::try_deserialize_unchecked(buf)
5625        }
5626        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
5627            let mut data: &[u8] = &buf[8..];
5628            AnchorDeserialize::deserialize(&mut data)
5629                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
5630        }
5631    }
5632    #[repr(C)]
5633    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
5634    pub struct ChangeSignedMsgWsDelegateStatus {
5635        pub signed_msg_ws_delegates: Pubkey,
5636        pub authority: Pubkey,
5637        pub system_program: Pubkey,
5638    }
5639    #[automatically_derived]
5640    impl anchor_lang::Discriminator for ChangeSignedMsgWsDelegateStatus {
5641        const DISCRIMINATOR: &[u8] = &[115, 165, 130, 151, 247, 6, 159, 9];
5642    }
5643    #[automatically_derived]
5644    unsafe impl anchor_lang::__private::bytemuck::Pod for ChangeSignedMsgWsDelegateStatus {}
5645    #[automatically_derived]
5646    unsafe impl anchor_lang::__private::bytemuck::Zeroable for ChangeSignedMsgWsDelegateStatus {}
5647    #[automatically_derived]
5648    impl anchor_lang::ZeroCopy for ChangeSignedMsgWsDelegateStatus {}
5649    #[automatically_derived]
5650    impl anchor_lang::InstructionData for ChangeSignedMsgWsDelegateStatus {}
5651    #[automatically_derived]
5652    impl ToAccountMetas for ChangeSignedMsgWsDelegateStatus {
5653        fn to_account_metas(&self) -> Vec<AccountMeta> {
5654            vec![
5655                AccountMeta {
5656                    pubkey: self.signed_msg_ws_delegates,
5657                    is_signer: false,
5658                    is_writable: true,
5659                },
5660                AccountMeta {
5661                    pubkey: self.authority,
5662                    is_signer: true,
5663                    is_writable: true,
5664                },
5665                AccountMeta {
5666                    pubkey: self.system_program,
5667                    is_signer: false,
5668                    is_writable: false,
5669                },
5670            ]
5671        }
5672    }
5673    #[automatically_derived]
5674    impl anchor_lang::AccountSerialize for ChangeSignedMsgWsDelegateStatus {
5675        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
5676            if writer.write_all(Self::DISCRIMINATOR).is_err() {
5677                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
5678            }
5679            if AnchorSerialize::serialize(self, writer).is_err() {
5680                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
5681            }
5682            Ok(())
5683        }
5684    }
5685    #[automatically_derived]
5686    impl anchor_lang::AccountDeserialize for ChangeSignedMsgWsDelegateStatus {
5687        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
5688            let given_disc = &buf[..8];
5689            if Self::DISCRIMINATOR != given_disc {
5690                return Err(anchor_lang::error!(
5691                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
5692                ));
5693            }
5694            Self::try_deserialize_unchecked(buf)
5695        }
5696        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
5697            let mut data: &[u8] = &buf[8..];
5698            AnchorDeserialize::deserialize(&mut data)
5699                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
5700        }
5701    }
5702    #[repr(C)]
5703    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
5704    pub struct InitializeFuelOverflow {
5705        pub fuel_overflow: Pubkey,
5706        pub user_stats: Pubkey,
5707        pub authority: Pubkey,
5708        pub payer: Pubkey,
5709        pub rent: Pubkey,
5710        pub system_program: Pubkey,
5711    }
5712    #[automatically_derived]
5713    impl anchor_lang::Discriminator for InitializeFuelOverflow {
5714        const DISCRIMINATOR: &[u8] = &[87, 122, 96, 232, 83, 190, 67, 60];
5715    }
5716    #[automatically_derived]
5717    unsafe impl anchor_lang::__private::bytemuck::Pod for InitializeFuelOverflow {}
5718    #[automatically_derived]
5719    unsafe impl anchor_lang::__private::bytemuck::Zeroable for InitializeFuelOverflow {}
5720    #[automatically_derived]
5721    impl anchor_lang::ZeroCopy for InitializeFuelOverflow {}
5722    #[automatically_derived]
5723    impl anchor_lang::InstructionData for InitializeFuelOverflow {}
5724    #[automatically_derived]
5725    impl ToAccountMetas for InitializeFuelOverflow {
5726        fn to_account_metas(&self) -> Vec<AccountMeta> {
5727            vec![
5728                AccountMeta {
5729                    pubkey: self.fuel_overflow,
5730                    is_signer: false,
5731                    is_writable: true,
5732                },
5733                AccountMeta {
5734                    pubkey: self.user_stats,
5735                    is_signer: false,
5736                    is_writable: true,
5737                },
5738                AccountMeta {
5739                    pubkey: self.authority,
5740                    is_signer: false,
5741                    is_writable: false,
5742                },
5743                AccountMeta {
5744                    pubkey: self.payer,
5745                    is_signer: true,
5746                    is_writable: true,
5747                },
5748                AccountMeta {
5749                    pubkey: self.rent,
5750                    is_signer: false,
5751                    is_writable: false,
5752                },
5753                AccountMeta {
5754                    pubkey: self.system_program,
5755                    is_signer: false,
5756                    is_writable: false,
5757                },
5758            ]
5759        }
5760    }
5761    #[automatically_derived]
5762    impl anchor_lang::AccountSerialize for InitializeFuelOverflow {
5763        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
5764            if writer.write_all(Self::DISCRIMINATOR).is_err() {
5765                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
5766            }
5767            if AnchorSerialize::serialize(self, writer).is_err() {
5768                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
5769            }
5770            Ok(())
5771        }
5772    }
5773    #[automatically_derived]
5774    impl anchor_lang::AccountDeserialize for InitializeFuelOverflow {
5775        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
5776            let given_disc = &buf[..8];
5777            if Self::DISCRIMINATOR != given_disc {
5778                return Err(anchor_lang::error!(
5779                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
5780                ));
5781            }
5782            Self::try_deserialize_unchecked(buf)
5783        }
5784        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
5785            let mut data: &[u8] = &buf[8..];
5786            AnchorDeserialize::deserialize(&mut data)
5787                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
5788        }
5789    }
5790    #[repr(C)]
5791    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
5792    pub struct SweepFuel {
5793        pub fuel_overflow: Pubkey,
5794        pub user_stats: Pubkey,
5795        pub authority: Pubkey,
5796        pub signer: Pubkey,
5797    }
5798    #[automatically_derived]
5799    impl anchor_lang::Discriminator for SweepFuel {
5800        const DISCRIMINATOR: &[u8] = &[213, 69, 211, 253, 19, 221, 144, 63];
5801    }
5802    #[automatically_derived]
5803    unsafe impl anchor_lang::__private::bytemuck::Pod for SweepFuel {}
5804    #[automatically_derived]
5805    unsafe impl anchor_lang::__private::bytemuck::Zeroable for SweepFuel {}
5806    #[automatically_derived]
5807    impl anchor_lang::ZeroCopy for SweepFuel {}
5808    #[automatically_derived]
5809    impl anchor_lang::InstructionData for SweepFuel {}
5810    #[automatically_derived]
5811    impl ToAccountMetas for SweepFuel {
5812        fn to_account_metas(&self) -> Vec<AccountMeta> {
5813            vec![
5814                AccountMeta {
5815                    pubkey: self.fuel_overflow,
5816                    is_signer: false,
5817                    is_writable: true,
5818                },
5819                AccountMeta {
5820                    pubkey: self.user_stats,
5821                    is_signer: false,
5822                    is_writable: true,
5823                },
5824                AccountMeta {
5825                    pubkey: self.authority,
5826                    is_signer: false,
5827                    is_writable: false,
5828                },
5829                AccountMeta {
5830                    pubkey: self.signer,
5831                    is_signer: true,
5832                    is_writable: false,
5833                },
5834            ]
5835        }
5836    }
5837    #[automatically_derived]
5838    impl anchor_lang::AccountSerialize for SweepFuel {
5839        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
5840            if writer.write_all(Self::DISCRIMINATOR).is_err() {
5841                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
5842            }
5843            if AnchorSerialize::serialize(self, writer).is_err() {
5844                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
5845            }
5846            Ok(())
5847        }
5848    }
5849    #[automatically_derived]
5850    impl anchor_lang::AccountDeserialize for SweepFuel {
5851        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
5852            let given_disc = &buf[..8];
5853            if Self::DISCRIMINATOR != given_disc {
5854                return Err(anchor_lang::error!(
5855                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
5856                ));
5857            }
5858            Self::try_deserialize_unchecked(buf)
5859        }
5860        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
5861            let mut data: &[u8] = &buf[8..];
5862            AnchorDeserialize::deserialize(&mut data)
5863                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
5864        }
5865    }
5866    #[repr(C)]
5867    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
5868    pub struct ResetFuelSeason {
5869        pub user_stats: Pubkey,
5870        pub authority: Pubkey,
5871        pub state: Pubkey,
5872        pub admin: Pubkey,
5873    }
5874    #[automatically_derived]
5875    impl anchor_lang::Discriminator for ResetFuelSeason {
5876        const DISCRIMINATOR: &[u8] = &[1, 202, 193, 87, 106, 234, 121, 179];
5877    }
5878    #[automatically_derived]
5879    unsafe impl anchor_lang::__private::bytemuck::Pod for ResetFuelSeason {}
5880    #[automatically_derived]
5881    unsafe impl anchor_lang::__private::bytemuck::Zeroable for ResetFuelSeason {}
5882    #[automatically_derived]
5883    impl anchor_lang::ZeroCopy for ResetFuelSeason {}
5884    #[automatically_derived]
5885    impl anchor_lang::InstructionData for ResetFuelSeason {}
5886    #[automatically_derived]
5887    impl ToAccountMetas for ResetFuelSeason {
5888        fn to_account_metas(&self) -> Vec<AccountMeta> {
5889            vec![
5890                AccountMeta {
5891                    pubkey: self.user_stats,
5892                    is_signer: false,
5893                    is_writable: true,
5894                },
5895                AccountMeta {
5896                    pubkey: self.authority,
5897                    is_signer: false,
5898                    is_writable: false,
5899                },
5900                AccountMeta {
5901                    pubkey: self.state,
5902                    is_signer: false,
5903                    is_writable: false,
5904                },
5905                AccountMeta {
5906                    pubkey: self.admin,
5907                    is_signer: true,
5908                    is_writable: false,
5909                },
5910            ]
5911        }
5912    }
5913    #[automatically_derived]
5914    impl anchor_lang::AccountSerialize for ResetFuelSeason {
5915        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
5916            if writer.write_all(Self::DISCRIMINATOR).is_err() {
5917                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
5918            }
5919            if AnchorSerialize::serialize(self, writer).is_err() {
5920                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
5921            }
5922            Ok(())
5923        }
5924    }
5925    #[automatically_derived]
5926    impl anchor_lang::AccountDeserialize for ResetFuelSeason {
5927        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
5928            let given_disc = &buf[..8];
5929            if Self::DISCRIMINATOR != given_disc {
5930                return Err(anchor_lang::error!(
5931                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
5932                ));
5933            }
5934            Self::try_deserialize_unchecked(buf)
5935        }
5936        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
5937            let mut data: &[u8] = &buf[8..];
5938            AnchorDeserialize::deserialize(&mut data)
5939                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
5940        }
5941    }
5942    #[repr(C)]
5943    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
5944    pub struct InitializeReferrerName {
5945        pub referrer_name: Pubkey,
5946        pub user: Pubkey,
5947        pub user_stats: Pubkey,
5948        pub authority: Pubkey,
5949        pub payer: Pubkey,
5950        pub rent: Pubkey,
5951        pub system_program: Pubkey,
5952    }
5953    #[automatically_derived]
5954    impl anchor_lang::Discriminator for InitializeReferrerName {
5955        const DISCRIMINATOR: &[u8] = &[162, 6, 98, 89, 149, 201, 160, 208];
5956    }
5957    #[automatically_derived]
5958    unsafe impl anchor_lang::__private::bytemuck::Pod for InitializeReferrerName {}
5959    #[automatically_derived]
5960    unsafe impl anchor_lang::__private::bytemuck::Zeroable for InitializeReferrerName {}
5961    #[automatically_derived]
5962    impl anchor_lang::ZeroCopy for InitializeReferrerName {}
5963    #[automatically_derived]
5964    impl anchor_lang::InstructionData for InitializeReferrerName {}
5965    #[automatically_derived]
5966    impl ToAccountMetas for InitializeReferrerName {
5967        fn to_account_metas(&self) -> Vec<AccountMeta> {
5968            vec![
5969                AccountMeta {
5970                    pubkey: self.referrer_name,
5971                    is_signer: false,
5972                    is_writable: true,
5973                },
5974                AccountMeta {
5975                    pubkey: self.user,
5976                    is_signer: false,
5977                    is_writable: true,
5978                },
5979                AccountMeta {
5980                    pubkey: self.user_stats,
5981                    is_signer: false,
5982                    is_writable: true,
5983                },
5984                AccountMeta {
5985                    pubkey: self.authority,
5986                    is_signer: true,
5987                    is_writable: false,
5988                },
5989                AccountMeta {
5990                    pubkey: self.payer,
5991                    is_signer: true,
5992                    is_writable: true,
5993                },
5994                AccountMeta {
5995                    pubkey: self.rent,
5996                    is_signer: false,
5997                    is_writable: false,
5998                },
5999                AccountMeta {
6000                    pubkey: self.system_program,
6001                    is_signer: false,
6002                    is_writable: false,
6003                },
6004            ]
6005        }
6006    }
6007    #[automatically_derived]
6008    impl anchor_lang::AccountSerialize for InitializeReferrerName {
6009        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
6010            if writer.write_all(Self::DISCRIMINATOR).is_err() {
6011                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
6012            }
6013            if AnchorSerialize::serialize(self, writer).is_err() {
6014                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
6015            }
6016            Ok(())
6017        }
6018    }
6019    #[automatically_derived]
6020    impl anchor_lang::AccountDeserialize for InitializeReferrerName {
6021        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
6022            let given_disc = &buf[..8];
6023            if Self::DISCRIMINATOR != given_disc {
6024                return Err(anchor_lang::error!(
6025                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
6026                ));
6027            }
6028            Self::try_deserialize_unchecked(buf)
6029        }
6030        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
6031            let mut data: &[u8] = &buf[8..];
6032            AnchorDeserialize::deserialize(&mut data)
6033                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
6034        }
6035    }
6036    #[repr(C)]
6037    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
6038    pub struct Deposit {
6039        pub state: Pubkey,
6040        pub user: Pubkey,
6041        pub user_stats: Pubkey,
6042        pub authority: Pubkey,
6043        pub spot_market_vault: Pubkey,
6044        pub user_token_account: Pubkey,
6045        pub token_program: Pubkey,
6046    }
6047    #[automatically_derived]
6048    impl anchor_lang::Discriminator for Deposit {
6049        const DISCRIMINATOR: &[u8] = &[148, 146, 121, 66, 207, 173, 21, 227];
6050    }
6051    #[automatically_derived]
6052    unsafe impl anchor_lang::__private::bytemuck::Pod for Deposit {}
6053    #[automatically_derived]
6054    unsafe impl anchor_lang::__private::bytemuck::Zeroable for Deposit {}
6055    #[automatically_derived]
6056    impl anchor_lang::ZeroCopy for Deposit {}
6057    #[automatically_derived]
6058    impl anchor_lang::InstructionData for Deposit {}
6059    #[automatically_derived]
6060    impl ToAccountMetas for Deposit {
6061        fn to_account_metas(&self) -> Vec<AccountMeta> {
6062            vec![
6063                AccountMeta {
6064                    pubkey: self.state,
6065                    is_signer: false,
6066                    is_writable: false,
6067                },
6068                AccountMeta {
6069                    pubkey: self.user,
6070                    is_signer: false,
6071                    is_writable: true,
6072                },
6073                AccountMeta {
6074                    pubkey: self.user_stats,
6075                    is_signer: false,
6076                    is_writable: true,
6077                },
6078                AccountMeta {
6079                    pubkey: self.authority,
6080                    is_signer: true,
6081                    is_writable: false,
6082                },
6083                AccountMeta {
6084                    pubkey: self.spot_market_vault,
6085                    is_signer: false,
6086                    is_writable: true,
6087                },
6088                AccountMeta {
6089                    pubkey: self.user_token_account,
6090                    is_signer: false,
6091                    is_writable: true,
6092                },
6093                AccountMeta {
6094                    pubkey: self.token_program,
6095                    is_signer: false,
6096                    is_writable: false,
6097                },
6098            ]
6099        }
6100    }
6101    #[automatically_derived]
6102    impl anchor_lang::AccountSerialize for Deposit {
6103        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
6104            if writer.write_all(Self::DISCRIMINATOR).is_err() {
6105                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
6106            }
6107            if AnchorSerialize::serialize(self, writer).is_err() {
6108                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
6109            }
6110            Ok(())
6111        }
6112    }
6113    #[automatically_derived]
6114    impl anchor_lang::AccountDeserialize for Deposit {
6115        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
6116            let given_disc = &buf[..8];
6117            if Self::DISCRIMINATOR != given_disc {
6118                return Err(anchor_lang::error!(
6119                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
6120                ));
6121            }
6122            Self::try_deserialize_unchecked(buf)
6123        }
6124        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
6125            let mut data: &[u8] = &buf[8..];
6126            AnchorDeserialize::deserialize(&mut data)
6127                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
6128        }
6129    }
6130    #[repr(C)]
6131    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
6132    pub struct Withdraw {
6133        pub state: Pubkey,
6134        pub user: Pubkey,
6135        pub user_stats: Pubkey,
6136        pub authority: Pubkey,
6137        pub spot_market_vault: Pubkey,
6138        pub drift_signer: Pubkey,
6139        pub user_token_account: Pubkey,
6140        pub token_program: Pubkey,
6141    }
6142    #[automatically_derived]
6143    impl anchor_lang::Discriminator for Withdraw {
6144        const DISCRIMINATOR: &[u8] = &[250, 14, 222, 36, 223, 62, 75, 248];
6145    }
6146    #[automatically_derived]
6147    unsafe impl anchor_lang::__private::bytemuck::Pod for Withdraw {}
6148    #[automatically_derived]
6149    unsafe impl anchor_lang::__private::bytemuck::Zeroable for Withdraw {}
6150    #[automatically_derived]
6151    impl anchor_lang::ZeroCopy for Withdraw {}
6152    #[automatically_derived]
6153    impl anchor_lang::InstructionData for Withdraw {}
6154    #[automatically_derived]
6155    impl ToAccountMetas for Withdraw {
6156        fn to_account_metas(&self) -> Vec<AccountMeta> {
6157            vec![
6158                AccountMeta {
6159                    pubkey: self.state,
6160                    is_signer: false,
6161                    is_writable: false,
6162                },
6163                AccountMeta {
6164                    pubkey: self.user,
6165                    is_signer: false,
6166                    is_writable: true,
6167                },
6168                AccountMeta {
6169                    pubkey: self.user_stats,
6170                    is_signer: false,
6171                    is_writable: true,
6172                },
6173                AccountMeta {
6174                    pubkey: self.authority,
6175                    is_signer: true,
6176                    is_writable: false,
6177                },
6178                AccountMeta {
6179                    pubkey: self.spot_market_vault,
6180                    is_signer: false,
6181                    is_writable: true,
6182                },
6183                AccountMeta {
6184                    pubkey: self.drift_signer,
6185                    is_signer: false,
6186                    is_writable: false,
6187                },
6188                AccountMeta {
6189                    pubkey: self.user_token_account,
6190                    is_signer: false,
6191                    is_writable: true,
6192                },
6193                AccountMeta {
6194                    pubkey: self.token_program,
6195                    is_signer: false,
6196                    is_writable: false,
6197                },
6198            ]
6199        }
6200    }
6201    #[automatically_derived]
6202    impl anchor_lang::AccountSerialize for Withdraw {
6203        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
6204            if writer.write_all(Self::DISCRIMINATOR).is_err() {
6205                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
6206            }
6207            if AnchorSerialize::serialize(self, writer).is_err() {
6208                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
6209            }
6210            Ok(())
6211        }
6212    }
6213    #[automatically_derived]
6214    impl anchor_lang::AccountDeserialize for Withdraw {
6215        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
6216            let given_disc = &buf[..8];
6217            if Self::DISCRIMINATOR != given_disc {
6218                return Err(anchor_lang::error!(
6219                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
6220                ));
6221            }
6222            Self::try_deserialize_unchecked(buf)
6223        }
6224        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
6225            let mut data: &[u8] = &buf[8..];
6226            AnchorDeserialize::deserialize(&mut data)
6227                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
6228        }
6229    }
6230    #[repr(C)]
6231    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
6232    pub struct TransferDeposit {
6233        pub from_user: Pubkey,
6234        pub to_user: Pubkey,
6235        pub user_stats: Pubkey,
6236        pub authority: Pubkey,
6237        pub state: Pubkey,
6238        pub spot_market_vault: Pubkey,
6239    }
6240    #[automatically_derived]
6241    impl anchor_lang::Discriminator for TransferDeposit {
6242        const DISCRIMINATOR: &[u8] = &[71, 147, 10, 190, 58, 115, 100, 21];
6243    }
6244    #[automatically_derived]
6245    unsafe impl anchor_lang::__private::bytemuck::Pod for TransferDeposit {}
6246    #[automatically_derived]
6247    unsafe impl anchor_lang::__private::bytemuck::Zeroable for TransferDeposit {}
6248    #[automatically_derived]
6249    impl anchor_lang::ZeroCopy for TransferDeposit {}
6250    #[automatically_derived]
6251    impl anchor_lang::InstructionData for TransferDeposit {}
6252    #[automatically_derived]
6253    impl ToAccountMetas for TransferDeposit {
6254        fn to_account_metas(&self) -> Vec<AccountMeta> {
6255            vec![
6256                AccountMeta {
6257                    pubkey: self.from_user,
6258                    is_signer: false,
6259                    is_writable: true,
6260                },
6261                AccountMeta {
6262                    pubkey: self.to_user,
6263                    is_signer: false,
6264                    is_writable: true,
6265                },
6266                AccountMeta {
6267                    pubkey: self.user_stats,
6268                    is_signer: false,
6269                    is_writable: true,
6270                },
6271                AccountMeta {
6272                    pubkey: self.authority,
6273                    is_signer: true,
6274                    is_writable: false,
6275                },
6276                AccountMeta {
6277                    pubkey: self.state,
6278                    is_signer: false,
6279                    is_writable: false,
6280                },
6281                AccountMeta {
6282                    pubkey: self.spot_market_vault,
6283                    is_signer: false,
6284                    is_writable: false,
6285                },
6286            ]
6287        }
6288    }
6289    #[automatically_derived]
6290    impl anchor_lang::AccountSerialize for TransferDeposit {
6291        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
6292            if writer.write_all(Self::DISCRIMINATOR).is_err() {
6293                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
6294            }
6295            if AnchorSerialize::serialize(self, writer).is_err() {
6296                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
6297            }
6298            Ok(())
6299        }
6300    }
6301    #[automatically_derived]
6302    impl anchor_lang::AccountDeserialize for TransferDeposit {
6303        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
6304            let given_disc = &buf[..8];
6305            if Self::DISCRIMINATOR != given_disc {
6306                return Err(anchor_lang::error!(
6307                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
6308                ));
6309            }
6310            Self::try_deserialize_unchecked(buf)
6311        }
6312        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
6313            let mut data: &[u8] = &buf[8..];
6314            AnchorDeserialize::deserialize(&mut data)
6315                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
6316        }
6317    }
6318    #[repr(C)]
6319    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
6320    pub struct TransferPools {
6321        pub from_user: Pubkey,
6322        pub to_user: Pubkey,
6323        pub user_stats: Pubkey,
6324        pub authority: Pubkey,
6325        pub state: Pubkey,
6326        pub deposit_from_spot_market_vault: Pubkey,
6327        pub deposit_to_spot_market_vault: Pubkey,
6328        pub borrow_from_spot_market_vault: Pubkey,
6329        pub borrow_to_spot_market_vault: Pubkey,
6330        pub drift_signer: Pubkey,
6331    }
6332    #[automatically_derived]
6333    impl anchor_lang::Discriminator for TransferPools {
6334        const DISCRIMINATOR: &[u8] = &[95, 222, 82, 35, 146, 141, 77, 239];
6335    }
6336    #[automatically_derived]
6337    unsafe impl anchor_lang::__private::bytemuck::Pod for TransferPools {}
6338    #[automatically_derived]
6339    unsafe impl anchor_lang::__private::bytemuck::Zeroable for TransferPools {}
6340    #[automatically_derived]
6341    impl anchor_lang::ZeroCopy for TransferPools {}
6342    #[automatically_derived]
6343    impl anchor_lang::InstructionData for TransferPools {}
6344    #[automatically_derived]
6345    impl ToAccountMetas for TransferPools {
6346        fn to_account_metas(&self) -> Vec<AccountMeta> {
6347            vec![
6348                AccountMeta {
6349                    pubkey: self.from_user,
6350                    is_signer: false,
6351                    is_writable: true,
6352                },
6353                AccountMeta {
6354                    pubkey: self.to_user,
6355                    is_signer: false,
6356                    is_writable: true,
6357                },
6358                AccountMeta {
6359                    pubkey: self.user_stats,
6360                    is_signer: false,
6361                    is_writable: true,
6362                },
6363                AccountMeta {
6364                    pubkey: self.authority,
6365                    is_signer: true,
6366                    is_writable: false,
6367                },
6368                AccountMeta {
6369                    pubkey: self.state,
6370                    is_signer: false,
6371                    is_writable: false,
6372                },
6373                AccountMeta {
6374                    pubkey: self.deposit_from_spot_market_vault,
6375                    is_signer: false,
6376                    is_writable: true,
6377                },
6378                AccountMeta {
6379                    pubkey: self.deposit_to_spot_market_vault,
6380                    is_signer: false,
6381                    is_writable: true,
6382                },
6383                AccountMeta {
6384                    pubkey: self.borrow_from_spot_market_vault,
6385                    is_signer: false,
6386                    is_writable: true,
6387                },
6388                AccountMeta {
6389                    pubkey: self.borrow_to_spot_market_vault,
6390                    is_signer: false,
6391                    is_writable: true,
6392                },
6393                AccountMeta {
6394                    pubkey: self.drift_signer,
6395                    is_signer: false,
6396                    is_writable: false,
6397                },
6398            ]
6399        }
6400    }
6401    #[automatically_derived]
6402    impl anchor_lang::AccountSerialize for TransferPools {
6403        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
6404            if writer.write_all(Self::DISCRIMINATOR).is_err() {
6405                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
6406            }
6407            if AnchorSerialize::serialize(self, writer).is_err() {
6408                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
6409            }
6410            Ok(())
6411        }
6412    }
6413    #[automatically_derived]
6414    impl anchor_lang::AccountDeserialize for TransferPools {
6415        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
6416            let given_disc = &buf[..8];
6417            if Self::DISCRIMINATOR != given_disc {
6418                return Err(anchor_lang::error!(
6419                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
6420                ));
6421            }
6422            Self::try_deserialize_unchecked(buf)
6423        }
6424        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
6425            let mut data: &[u8] = &buf[8..];
6426            AnchorDeserialize::deserialize(&mut data)
6427                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
6428        }
6429    }
6430    #[repr(C)]
6431    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
6432    pub struct TransferPerpPosition {
6433        pub from_user: Pubkey,
6434        pub to_user: Pubkey,
6435        pub user_stats: Pubkey,
6436        pub authority: Pubkey,
6437        pub state: Pubkey,
6438    }
6439    #[automatically_derived]
6440    impl anchor_lang::Discriminator for TransferPerpPosition {
6441        const DISCRIMINATOR: &[u8] = &[73, 4, 221, 41, 202, 239, 84, 16];
6442    }
6443    #[automatically_derived]
6444    unsafe impl anchor_lang::__private::bytemuck::Pod for TransferPerpPosition {}
6445    #[automatically_derived]
6446    unsafe impl anchor_lang::__private::bytemuck::Zeroable for TransferPerpPosition {}
6447    #[automatically_derived]
6448    impl anchor_lang::ZeroCopy for TransferPerpPosition {}
6449    #[automatically_derived]
6450    impl anchor_lang::InstructionData for TransferPerpPosition {}
6451    #[automatically_derived]
6452    impl ToAccountMetas for TransferPerpPosition {
6453        fn to_account_metas(&self) -> Vec<AccountMeta> {
6454            vec![
6455                AccountMeta {
6456                    pubkey: self.from_user,
6457                    is_signer: false,
6458                    is_writable: true,
6459                },
6460                AccountMeta {
6461                    pubkey: self.to_user,
6462                    is_signer: false,
6463                    is_writable: true,
6464                },
6465                AccountMeta {
6466                    pubkey: self.user_stats,
6467                    is_signer: false,
6468                    is_writable: true,
6469                },
6470                AccountMeta {
6471                    pubkey: self.authority,
6472                    is_signer: true,
6473                    is_writable: false,
6474                },
6475                AccountMeta {
6476                    pubkey: self.state,
6477                    is_signer: false,
6478                    is_writable: false,
6479                },
6480            ]
6481        }
6482    }
6483    #[automatically_derived]
6484    impl anchor_lang::AccountSerialize for TransferPerpPosition {
6485        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
6486            if writer.write_all(Self::DISCRIMINATOR).is_err() {
6487                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
6488            }
6489            if AnchorSerialize::serialize(self, writer).is_err() {
6490                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
6491            }
6492            Ok(())
6493        }
6494    }
6495    #[automatically_derived]
6496    impl anchor_lang::AccountDeserialize for TransferPerpPosition {
6497        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
6498            let given_disc = &buf[..8];
6499            if Self::DISCRIMINATOR != given_disc {
6500                return Err(anchor_lang::error!(
6501                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
6502                ));
6503            }
6504            Self::try_deserialize_unchecked(buf)
6505        }
6506        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
6507            let mut data: &[u8] = &buf[8..];
6508            AnchorDeserialize::deserialize(&mut data)
6509                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
6510        }
6511    }
6512    #[repr(C)]
6513    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
6514    pub struct PlacePerpOrder {
6515        pub state: Pubkey,
6516        pub user: Pubkey,
6517        pub authority: Pubkey,
6518    }
6519    #[automatically_derived]
6520    impl anchor_lang::Discriminator for PlacePerpOrder {
6521        const DISCRIMINATOR: &[u8] = &[246, 108, 77, 100, 111, 83, 209, 236];
6522    }
6523    #[automatically_derived]
6524    unsafe impl anchor_lang::__private::bytemuck::Pod for PlacePerpOrder {}
6525    #[automatically_derived]
6526    unsafe impl anchor_lang::__private::bytemuck::Zeroable for PlacePerpOrder {}
6527    #[automatically_derived]
6528    impl anchor_lang::ZeroCopy for PlacePerpOrder {}
6529    #[automatically_derived]
6530    impl anchor_lang::InstructionData for PlacePerpOrder {}
6531    #[automatically_derived]
6532    impl ToAccountMetas for PlacePerpOrder {
6533        fn to_account_metas(&self) -> Vec<AccountMeta> {
6534            vec![
6535                AccountMeta {
6536                    pubkey: self.state,
6537                    is_signer: false,
6538                    is_writable: false,
6539                },
6540                AccountMeta {
6541                    pubkey: self.user,
6542                    is_signer: false,
6543                    is_writable: true,
6544                },
6545                AccountMeta {
6546                    pubkey: self.authority,
6547                    is_signer: true,
6548                    is_writable: false,
6549                },
6550            ]
6551        }
6552    }
6553    #[automatically_derived]
6554    impl anchor_lang::AccountSerialize for PlacePerpOrder {
6555        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
6556            if writer.write_all(Self::DISCRIMINATOR).is_err() {
6557                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
6558            }
6559            if AnchorSerialize::serialize(self, writer).is_err() {
6560                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
6561            }
6562            Ok(())
6563        }
6564    }
6565    #[automatically_derived]
6566    impl anchor_lang::AccountDeserialize for PlacePerpOrder {
6567        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
6568            let given_disc = &buf[..8];
6569            if Self::DISCRIMINATOR != given_disc {
6570                return Err(anchor_lang::error!(
6571                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
6572                ));
6573            }
6574            Self::try_deserialize_unchecked(buf)
6575        }
6576        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
6577            let mut data: &[u8] = &buf[8..];
6578            AnchorDeserialize::deserialize(&mut data)
6579                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
6580        }
6581    }
6582    #[repr(C)]
6583    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
6584    pub struct CancelOrder {
6585        pub state: Pubkey,
6586        pub user: Pubkey,
6587        pub authority: Pubkey,
6588    }
6589    #[automatically_derived]
6590    impl anchor_lang::Discriminator for CancelOrder {
6591        const DISCRIMINATOR: &[u8] = &[113, 49, 205, 244, 82, 104, 158, 85];
6592    }
6593    #[automatically_derived]
6594    unsafe impl anchor_lang::__private::bytemuck::Pod for CancelOrder {}
6595    #[automatically_derived]
6596    unsafe impl anchor_lang::__private::bytemuck::Zeroable for CancelOrder {}
6597    #[automatically_derived]
6598    impl anchor_lang::ZeroCopy for CancelOrder {}
6599    #[automatically_derived]
6600    impl anchor_lang::InstructionData for CancelOrder {}
6601    #[automatically_derived]
6602    impl ToAccountMetas for CancelOrder {
6603        fn to_account_metas(&self) -> Vec<AccountMeta> {
6604            vec![
6605                AccountMeta {
6606                    pubkey: self.state,
6607                    is_signer: false,
6608                    is_writable: false,
6609                },
6610                AccountMeta {
6611                    pubkey: self.user,
6612                    is_signer: false,
6613                    is_writable: true,
6614                },
6615                AccountMeta {
6616                    pubkey: self.authority,
6617                    is_signer: true,
6618                    is_writable: false,
6619                },
6620            ]
6621        }
6622    }
6623    #[automatically_derived]
6624    impl anchor_lang::AccountSerialize for CancelOrder {
6625        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
6626            if writer.write_all(Self::DISCRIMINATOR).is_err() {
6627                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
6628            }
6629            if AnchorSerialize::serialize(self, writer).is_err() {
6630                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
6631            }
6632            Ok(())
6633        }
6634    }
6635    #[automatically_derived]
6636    impl anchor_lang::AccountDeserialize for CancelOrder {
6637        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
6638            let given_disc = &buf[..8];
6639            if Self::DISCRIMINATOR != given_disc {
6640                return Err(anchor_lang::error!(
6641                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
6642                ));
6643            }
6644            Self::try_deserialize_unchecked(buf)
6645        }
6646        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
6647            let mut data: &[u8] = &buf[8..];
6648            AnchorDeserialize::deserialize(&mut data)
6649                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
6650        }
6651    }
6652    #[repr(C)]
6653    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
6654    pub struct CancelOrderByUserId {
6655        pub state: Pubkey,
6656        pub user: Pubkey,
6657        pub authority: Pubkey,
6658    }
6659    #[automatically_derived]
6660    impl anchor_lang::Discriminator for CancelOrderByUserId {
6661        const DISCRIMINATOR: &[u8] = &[242, 196, 53, 34, 121, 232, 149, 144];
6662    }
6663    #[automatically_derived]
6664    unsafe impl anchor_lang::__private::bytemuck::Pod for CancelOrderByUserId {}
6665    #[automatically_derived]
6666    unsafe impl anchor_lang::__private::bytemuck::Zeroable for CancelOrderByUserId {}
6667    #[automatically_derived]
6668    impl anchor_lang::ZeroCopy for CancelOrderByUserId {}
6669    #[automatically_derived]
6670    impl anchor_lang::InstructionData for CancelOrderByUserId {}
6671    #[automatically_derived]
6672    impl ToAccountMetas for CancelOrderByUserId {
6673        fn to_account_metas(&self) -> Vec<AccountMeta> {
6674            vec![
6675                AccountMeta {
6676                    pubkey: self.state,
6677                    is_signer: false,
6678                    is_writable: false,
6679                },
6680                AccountMeta {
6681                    pubkey: self.user,
6682                    is_signer: false,
6683                    is_writable: true,
6684                },
6685                AccountMeta {
6686                    pubkey: self.authority,
6687                    is_signer: true,
6688                    is_writable: false,
6689                },
6690            ]
6691        }
6692    }
6693    #[automatically_derived]
6694    impl anchor_lang::AccountSerialize for CancelOrderByUserId {
6695        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
6696            if writer.write_all(Self::DISCRIMINATOR).is_err() {
6697                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
6698            }
6699            if AnchorSerialize::serialize(self, writer).is_err() {
6700                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
6701            }
6702            Ok(())
6703        }
6704    }
6705    #[automatically_derived]
6706    impl anchor_lang::AccountDeserialize for CancelOrderByUserId {
6707        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
6708            let given_disc = &buf[..8];
6709            if Self::DISCRIMINATOR != given_disc {
6710                return Err(anchor_lang::error!(
6711                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
6712                ));
6713            }
6714            Self::try_deserialize_unchecked(buf)
6715        }
6716        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
6717            let mut data: &[u8] = &buf[8..];
6718            AnchorDeserialize::deserialize(&mut data)
6719                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
6720        }
6721    }
6722    #[repr(C)]
6723    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
6724    pub struct CancelOrders {
6725        pub state: Pubkey,
6726        pub user: Pubkey,
6727        pub authority: Pubkey,
6728    }
6729    #[automatically_derived]
6730    impl anchor_lang::Discriminator for CancelOrders {
6731        const DISCRIMINATOR: &[u8] = &[91, 217, 110, 30, 16, 2, 55, 83];
6732    }
6733    #[automatically_derived]
6734    unsafe impl anchor_lang::__private::bytemuck::Pod for CancelOrders {}
6735    #[automatically_derived]
6736    unsafe impl anchor_lang::__private::bytemuck::Zeroable for CancelOrders {}
6737    #[automatically_derived]
6738    impl anchor_lang::ZeroCopy for CancelOrders {}
6739    #[automatically_derived]
6740    impl anchor_lang::InstructionData for CancelOrders {}
6741    #[automatically_derived]
6742    impl ToAccountMetas for CancelOrders {
6743        fn to_account_metas(&self) -> Vec<AccountMeta> {
6744            vec![
6745                AccountMeta {
6746                    pubkey: self.state,
6747                    is_signer: false,
6748                    is_writable: false,
6749                },
6750                AccountMeta {
6751                    pubkey: self.user,
6752                    is_signer: false,
6753                    is_writable: true,
6754                },
6755                AccountMeta {
6756                    pubkey: self.authority,
6757                    is_signer: true,
6758                    is_writable: false,
6759                },
6760            ]
6761        }
6762    }
6763    #[automatically_derived]
6764    impl anchor_lang::AccountSerialize for CancelOrders {
6765        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
6766            if writer.write_all(Self::DISCRIMINATOR).is_err() {
6767                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
6768            }
6769            if AnchorSerialize::serialize(self, writer).is_err() {
6770                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
6771            }
6772            Ok(())
6773        }
6774    }
6775    #[automatically_derived]
6776    impl anchor_lang::AccountDeserialize for CancelOrders {
6777        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
6778            let given_disc = &buf[..8];
6779            if Self::DISCRIMINATOR != given_disc {
6780                return Err(anchor_lang::error!(
6781                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
6782                ));
6783            }
6784            Self::try_deserialize_unchecked(buf)
6785        }
6786        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
6787            let mut data: &[u8] = &buf[8..];
6788            AnchorDeserialize::deserialize(&mut data)
6789                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
6790        }
6791    }
6792    #[repr(C)]
6793    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
6794    pub struct CancelOrdersByIds {
6795        pub state: Pubkey,
6796        pub user: Pubkey,
6797        pub authority: Pubkey,
6798    }
6799    #[automatically_derived]
6800    impl anchor_lang::Discriminator for CancelOrdersByIds {
6801        const DISCRIMINATOR: &[u8] = &[111, 71, 138, 14, 8, 97, 11, 44];
6802    }
6803    #[automatically_derived]
6804    unsafe impl anchor_lang::__private::bytemuck::Pod for CancelOrdersByIds {}
6805    #[automatically_derived]
6806    unsafe impl anchor_lang::__private::bytemuck::Zeroable for CancelOrdersByIds {}
6807    #[automatically_derived]
6808    impl anchor_lang::ZeroCopy for CancelOrdersByIds {}
6809    #[automatically_derived]
6810    impl anchor_lang::InstructionData for CancelOrdersByIds {}
6811    #[automatically_derived]
6812    impl ToAccountMetas for CancelOrdersByIds {
6813        fn to_account_metas(&self) -> Vec<AccountMeta> {
6814            vec![
6815                AccountMeta {
6816                    pubkey: self.state,
6817                    is_signer: false,
6818                    is_writable: false,
6819                },
6820                AccountMeta {
6821                    pubkey: self.user,
6822                    is_signer: false,
6823                    is_writable: true,
6824                },
6825                AccountMeta {
6826                    pubkey: self.authority,
6827                    is_signer: true,
6828                    is_writable: false,
6829                },
6830            ]
6831        }
6832    }
6833    #[automatically_derived]
6834    impl anchor_lang::AccountSerialize for CancelOrdersByIds {
6835        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
6836            if writer.write_all(Self::DISCRIMINATOR).is_err() {
6837                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
6838            }
6839            if AnchorSerialize::serialize(self, writer).is_err() {
6840                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
6841            }
6842            Ok(())
6843        }
6844    }
6845    #[automatically_derived]
6846    impl anchor_lang::AccountDeserialize for CancelOrdersByIds {
6847        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
6848            let given_disc = &buf[..8];
6849            if Self::DISCRIMINATOR != given_disc {
6850                return Err(anchor_lang::error!(
6851                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
6852                ));
6853            }
6854            Self::try_deserialize_unchecked(buf)
6855        }
6856        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
6857            let mut data: &[u8] = &buf[8..];
6858            AnchorDeserialize::deserialize(&mut data)
6859                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
6860        }
6861    }
6862    #[repr(C)]
6863    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
6864    pub struct ModifyOrder {
6865        pub state: Pubkey,
6866        pub user: Pubkey,
6867        pub authority: Pubkey,
6868    }
6869    #[automatically_derived]
6870    impl anchor_lang::Discriminator for ModifyOrder {
6871        const DISCRIMINATOR: &[u8] = &[123, 5, 147, 45, 173, 23, 156, 131];
6872    }
6873    #[automatically_derived]
6874    unsafe impl anchor_lang::__private::bytemuck::Pod for ModifyOrder {}
6875    #[automatically_derived]
6876    unsafe impl anchor_lang::__private::bytemuck::Zeroable for ModifyOrder {}
6877    #[automatically_derived]
6878    impl anchor_lang::ZeroCopy for ModifyOrder {}
6879    #[automatically_derived]
6880    impl anchor_lang::InstructionData for ModifyOrder {}
6881    #[automatically_derived]
6882    impl ToAccountMetas for ModifyOrder {
6883        fn to_account_metas(&self) -> Vec<AccountMeta> {
6884            vec![
6885                AccountMeta {
6886                    pubkey: self.state,
6887                    is_signer: false,
6888                    is_writable: false,
6889                },
6890                AccountMeta {
6891                    pubkey: self.user,
6892                    is_signer: false,
6893                    is_writable: true,
6894                },
6895                AccountMeta {
6896                    pubkey: self.authority,
6897                    is_signer: true,
6898                    is_writable: false,
6899                },
6900            ]
6901        }
6902    }
6903    #[automatically_derived]
6904    impl anchor_lang::AccountSerialize for ModifyOrder {
6905        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
6906            if writer.write_all(Self::DISCRIMINATOR).is_err() {
6907                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
6908            }
6909            if AnchorSerialize::serialize(self, writer).is_err() {
6910                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
6911            }
6912            Ok(())
6913        }
6914    }
6915    #[automatically_derived]
6916    impl anchor_lang::AccountDeserialize for ModifyOrder {
6917        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
6918            let given_disc = &buf[..8];
6919            if Self::DISCRIMINATOR != given_disc {
6920                return Err(anchor_lang::error!(
6921                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
6922                ));
6923            }
6924            Self::try_deserialize_unchecked(buf)
6925        }
6926        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
6927            let mut data: &[u8] = &buf[8..];
6928            AnchorDeserialize::deserialize(&mut data)
6929                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
6930        }
6931    }
6932    #[repr(C)]
6933    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
6934    pub struct ModifyOrderByUserId {
6935        pub state: Pubkey,
6936        pub user: Pubkey,
6937        pub authority: Pubkey,
6938    }
6939    #[automatically_derived]
6940    impl anchor_lang::Discriminator for ModifyOrderByUserId {
6941        const DISCRIMINATOR: &[u8] = &[87, 55, 202, 75, 9, 179, 204, 73];
6942    }
6943    #[automatically_derived]
6944    unsafe impl anchor_lang::__private::bytemuck::Pod for ModifyOrderByUserId {}
6945    #[automatically_derived]
6946    unsafe impl anchor_lang::__private::bytemuck::Zeroable for ModifyOrderByUserId {}
6947    #[automatically_derived]
6948    impl anchor_lang::ZeroCopy for ModifyOrderByUserId {}
6949    #[automatically_derived]
6950    impl anchor_lang::InstructionData for ModifyOrderByUserId {}
6951    #[automatically_derived]
6952    impl ToAccountMetas for ModifyOrderByUserId {
6953        fn to_account_metas(&self) -> Vec<AccountMeta> {
6954            vec![
6955                AccountMeta {
6956                    pubkey: self.state,
6957                    is_signer: false,
6958                    is_writable: false,
6959                },
6960                AccountMeta {
6961                    pubkey: self.user,
6962                    is_signer: false,
6963                    is_writable: true,
6964                },
6965                AccountMeta {
6966                    pubkey: self.authority,
6967                    is_signer: true,
6968                    is_writable: false,
6969                },
6970            ]
6971        }
6972    }
6973    #[automatically_derived]
6974    impl anchor_lang::AccountSerialize for ModifyOrderByUserId {
6975        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
6976            if writer.write_all(Self::DISCRIMINATOR).is_err() {
6977                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
6978            }
6979            if AnchorSerialize::serialize(self, writer).is_err() {
6980                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
6981            }
6982            Ok(())
6983        }
6984    }
6985    #[automatically_derived]
6986    impl anchor_lang::AccountDeserialize for ModifyOrderByUserId {
6987        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
6988            let given_disc = &buf[..8];
6989            if Self::DISCRIMINATOR != given_disc {
6990                return Err(anchor_lang::error!(
6991                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
6992                ));
6993            }
6994            Self::try_deserialize_unchecked(buf)
6995        }
6996        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
6997            let mut data: &[u8] = &buf[8..];
6998            AnchorDeserialize::deserialize(&mut data)
6999                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
7000        }
7001    }
7002    #[repr(C)]
7003    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
7004    pub struct PlaceAndTakePerpOrder {
7005        pub state: Pubkey,
7006        pub user: Pubkey,
7007        pub user_stats: Pubkey,
7008        pub authority: Pubkey,
7009    }
7010    #[automatically_derived]
7011    impl anchor_lang::Discriminator for PlaceAndTakePerpOrder {
7012        const DISCRIMINATOR: &[u8] = &[106, 246, 39, 196, 36, 127, 12, 84];
7013    }
7014    #[automatically_derived]
7015    unsafe impl anchor_lang::__private::bytemuck::Pod for PlaceAndTakePerpOrder {}
7016    #[automatically_derived]
7017    unsafe impl anchor_lang::__private::bytemuck::Zeroable for PlaceAndTakePerpOrder {}
7018    #[automatically_derived]
7019    impl anchor_lang::ZeroCopy for PlaceAndTakePerpOrder {}
7020    #[automatically_derived]
7021    impl anchor_lang::InstructionData for PlaceAndTakePerpOrder {}
7022    #[automatically_derived]
7023    impl ToAccountMetas for PlaceAndTakePerpOrder {
7024        fn to_account_metas(&self) -> Vec<AccountMeta> {
7025            vec![
7026                AccountMeta {
7027                    pubkey: self.state,
7028                    is_signer: false,
7029                    is_writable: false,
7030                },
7031                AccountMeta {
7032                    pubkey: self.user,
7033                    is_signer: false,
7034                    is_writable: true,
7035                },
7036                AccountMeta {
7037                    pubkey: self.user_stats,
7038                    is_signer: false,
7039                    is_writable: true,
7040                },
7041                AccountMeta {
7042                    pubkey: self.authority,
7043                    is_signer: true,
7044                    is_writable: false,
7045                },
7046            ]
7047        }
7048    }
7049    #[automatically_derived]
7050    impl anchor_lang::AccountSerialize for PlaceAndTakePerpOrder {
7051        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
7052            if writer.write_all(Self::DISCRIMINATOR).is_err() {
7053                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
7054            }
7055            if AnchorSerialize::serialize(self, writer).is_err() {
7056                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
7057            }
7058            Ok(())
7059        }
7060    }
7061    #[automatically_derived]
7062    impl anchor_lang::AccountDeserialize for PlaceAndTakePerpOrder {
7063        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
7064            let given_disc = &buf[..8];
7065            if Self::DISCRIMINATOR != given_disc {
7066                return Err(anchor_lang::error!(
7067                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
7068                ));
7069            }
7070            Self::try_deserialize_unchecked(buf)
7071        }
7072        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
7073            let mut data: &[u8] = &buf[8..];
7074            AnchorDeserialize::deserialize(&mut data)
7075                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
7076        }
7077    }
7078    #[repr(C)]
7079    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
7080    pub struct PlaceAndMakePerpOrder {
7081        pub state: Pubkey,
7082        pub user: Pubkey,
7083        pub user_stats: Pubkey,
7084        pub taker: Pubkey,
7085        pub taker_stats: Pubkey,
7086        pub authority: Pubkey,
7087    }
7088    #[automatically_derived]
7089    impl anchor_lang::Discriminator for PlaceAndMakePerpOrder {
7090        const DISCRIMINATOR: &[u8] = &[139, 129, 243, 60, 209, 20, 25, 195];
7091    }
7092    #[automatically_derived]
7093    unsafe impl anchor_lang::__private::bytemuck::Pod for PlaceAndMakePerpOrder {}
7094    #[automatically_derived]
7095    unsafe impl anchor_lang::__private::bytemuck::Zeroable for PlaceAndMakePerpOrder {}
7096    #[automatically_derived]
7097    impl anchor_lang::ZeroCopy for PlaceAndMakePerpOrder {}
7098    #[automatically_derived]
7099    impl anchor_lang::InstructionData for PlaceAndMakePerpOrder {}
7100    #[automatically_derived]
7101    impl ToAccountMetas for PlaceAndMakePerpOrder {
7102        fn to_account_metas(&self) -> Vec<AccountMeta> {
7103            vec![
7104                AccountMeta {
7105                    pubkey: self.state,
7106                    is_signer: false,
7107                    is_writable: false,
7108                },
7109                AccountMeta {
7110                    pubkey: self.user,
7111                    is_signer: false,
7112                    is_writable: true,
7113                },
7114                AccountMeta {
7115                    pubkey: self.user_stats,
7116                    is_signer: false,
7117                    is_writable: true,
7118                },
7119                AccountMeta {
7120                    pubkey: self.taker,
7121                    is_signer: false,
7122                    is_writable: true,
7123                },
7124                AccountMeta {
7125                    pubkey: self.taker_stats,
7126                    is_signer: false,
7127                    is_writable: true,
7128                },
7129                AccountMeta {
7130                    pubkey: self.authority,
7131                    is_signer: true,
7132                    is_writable: false,
7133                },
7134            ]
7135        }
7136    }
7137    #[automatically_derived]
7138    impl anchor_lang::AccountSerialize for PlaceAndMakePerpOrder {
7139        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
7140            if writer.write_all(Self::DISCRIMINATOR).is_err() {
7141                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
7142            }
7143            if AnchorSerialize::serialize(self, writer).is_err() {
7144                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
7145            }
7146            Ok(())
7147        }
7148    }
7149    #[automatically_derived]
7150    impl anchor_lang::AccountDeserialize for PlaceAndMakePerpOrder {
7151        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
7152            let given_disc = &buf[..8];
7153            if Self::DISCRIMINATOR != given_disc {
7154                return Err(anchor_lang::error!(
7155                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
7156                ));
7157            }
7158            Self::try_deserialize_unchecked(buf)
7159        }
7160        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
7161            let mut data: &[u8] = &buf[8..];
7162            AnchorDeserialize::deserialize(&mut data)
7163                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
7164        }
7165    }
7166    #[repr(C)]
7167    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
7168    pub struct PlaceAndMakeSignedMsgPerpOrder {
7169        pub state: Pubkey,
7170        pub user: Pubkey,
7171        pub user_stats: Pubkey,
7172        pub taker: Pubkey,
7173        pub taker_stats: Pubkey,
7174        pub taker_signed_msg_user_orders: Pubkey,
7175        pub authority: Pubkey,
7176    }
7177    #[automatically_derived]
7178    impl anchor_lang::Discriminator for PlaceAndMakeSignedMsgPerpOrder {
7179        const DISCRIMINATOR: &[u8] = &[240, 219, 156, 22, 147, 139, 152, 165];
7180    }
7181    #[automatically_derived]
7182    unsafe impl anchor_lang::__private::bytemuck::Pod for PlaceAndMakeSignedMsgPerpOrder {}
7183    #[automatically_derived]
7184    unsafe impl anchor_lang::__private::bytemuck::Zeroable for PlaceAndMakeSignedMsgPerpOrder {}
7185    #[automatically_derived]
7186    impl anchor_lang::ZeroCopy for PlaceAndMakeSignedMsgPerpOrder {}
7187    #[automatically_derived]
7188    impl anchor_lang::InstructionData for PlaceAndMakeSignedMsgPerpOrder {}
7189    #[automatically_derived]
7190    impl ToAccountMetas for PlaceAndMakeSignedMsgPerpOrder {
7191        fn to_account_metas(&self) -> Vec<AccountMeta> {
7192            vec![
7193                AccountMeta {
7194                    pubkey: self.state,
7195                    is_signer: false,
7196                    is_writable: false,
7197                },
7198                AccountMeta {
7199                    pubkey: self.user,
7200                    is_signer: false,
7201                    is_writable: true,
7202                },
7203                AccountMeta {
7204                    pubkey: self.user_stats,
7205                    is_signer: false,
7206                    is_writable: true,
7207                },
7208                AccountMeta {
7209                    pubkey: self.taker,
7210                    is_signer: false,
7211                    is_writable: true,
7212                },
7213                AccountMeta {
7214                    pubkey: self.taker_stats,
7215                    is_signer: false,
7216                    is_writable: true,
7217                },
7218                AccountMeta {
7219                    pubkey: self.taker_signed_msg_user_orders,
7220                    is_signer: false,
7221                    is_writable: false,
7222                },
7223                AccountMeta {
7224                    pubkey: self.authority,
7225                    is_signer: true,
7226                    is_writable: false,
7227                },
7228            ]
7229        }
7230    }
7231    #[automatically_derived]
7232    impl anchor_lang::AccountSerialize for PlaceAndMakeSignedMsgPerpOrder {
7233        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
7234            if writer.write_all(Self::DISCRIMINATOR).is_err() {
7235                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
7236            }
7237            if AnchorSerialize::serialize(self, writer).is_err() {
7238                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
7239            }
7240            Ok(())
7241        }
7242    }
7243    #[automatically_derived]
7244    impl anchor_lang::AccountDeserialize for PlaceAndMakeSignedMsgPerpOrder {
7245        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
7246            let given_disc = &buf[..8];
7247            if Self::DISCRIMINATOR != given_disc {
7248                return Err(anchor_lang::error!(
7249                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
7250                ));
7251            }
7252            Self::try_deserialize_unchecked(buf)
7253        }
7254        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
7255            let mut data: &[u8] = &buf[8..];
7256            AnchorDeserialize::deserialize(&mut data)
7257                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
7258        }
7259    }
7260    #[repr(C)]
7261    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
7262    pub struct PlaceSignedMsgTakerOrder {
7263        pub state: Pubkey,
7264        pub user: Pubkey,
7265        pub user_stats: Pubkey,
7266        pub signed_msg_user_orders: Pubkey,
7267        pub authority: Pubkey,
7268        pub ix_sysvar: Pubkey,
7269    }
7270    #[automatically_derived]
7271    impl anchor_lang::Discriminator for PlaceSignedMsgTakerOrder {
7272        const DISCRIMINATOR: &[u8] = &[202, 134, 30, 82, 84, 234, 248, 40];
7273    }
7274    #[automatically_derived]
7275    unsafe impl anchor_lang::__private::bytemuck::Pod for PlaceSignedMsgTakerOrder {}
7276    #[automatically_derived]
7277    unsafe impl anchor_lang::__private::bytemuck::Zeroable for PlaceSignedMsgTakerOrder {}
7278    #[automatically_derived]
7279    impl anchor_lang::ZeroCopy for PlaceSignedMsgTakerOrder {}
7280    #[automatically_derived]
7281    impl anchor_lang::InstructionData for PlaceSignedMsgTakerOrder {}
7282    #[automatically_derived]
7283    impl ToAccountMetas for PlaceSignedMsgTakerOrder {
7284        fn to_account_metas(&self) -> Vec<AccountMeta> {
7285            vec![
7286                AccountMeta {
7287                    pubkey: self.state,
7288                    is_signer: false,
7289                    is_writable: false,
7290                },
7291                AccountMeta {
7292                    pubkey: self.user,
7293                    is_signer: false,
7294                    is_writable: true,
7295                },
7296                AccountMeta {
7297                    pubkey: self.user_stats,
7298                    is_signer: false,
7299                    is_writable: true,
7300                },
7301                AccountMeta {
7302                    pubkey: self.signed_msg_user_orders,
7303                    is_signer: false,
7304                    is_writable: true,
7305                },
7306                AccountMeta {
7307                    pubkey: self.authority,
7308                    is_signer: true,
7309                    is_writable: false,
7310                },
7311                AccountMeta {
7312                    pubkey: self.ix_sysvar,
7313                    is_signer: false,
7314                    is_writable: false,
7315                },
7316            ]
7317        }
7318    }
7319    #[automatically_derived]
7320    impl anchor_lang::AccountSerialize for PlaceSignedMsgTakerOrder {
7321        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
7322            if writer.write_all(Self::DISCRIMINATOR).is_err() {
7323                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
7324            }
7325            if AnchorSerialize::serialize(self, writer).is_err() {
7326                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
7327            }
7328            Ok(())
7329        }
7330    }
7331    #[automatically_derived]
7332    impl anchor_lang::AccountDeserialize for PlaceSignedMsgTakerOrder {
7333        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
7334            let given_disc = &buf[..8];
7335            if Self::DISCRIMINATOR != given_disc {
7336                return Err(anchor_lang::error!(
7337                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
7338                ));
7339            }
7340            Self::try_deserialize_unchecked(buf)
7341        }
7342        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
7343            let mut data: &[u8] = &buf[8..];
7344            AnchorDeserialize::deserialize(&mut data)
7345                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
7346        }
7347    }
7348    #[repr(C)]
7349    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
7350    pub struct PlaceSpotOrder {
7351        pub state: Pubkey,
7352        pub user: Pubkey,
7353        pub authority: Pubkey,
7354    }
7355    #[automatically_derived]
7356    impl anchor_lang::Discriminator for PlaceSpotOrder {
7357        const DISCRIMINATOR: &[u8] = &[174, 248, 135, 120, 62, 178, 165, 88];
7358    }
7359    #[automatically_derived]
7360    unsafe impl anchor_lang::__private::bytemuck::Pod for PlaceSpotOrder {}
7361    #[automatically_derived]
7362    unsafe impl anchor_lang::__private::bytemuck::Zeroable for PlaceSpotOrder {}
7363    #[automatically_derived]
7364    impl anchor_lang::ZeroCopy for PlaceSpotOrder {}
7365    #[automatically_derived]
7366    impl anchor_lang::InstructionData for PlaceSpotOrder {}
7367    #[automatically_derived]
7368    impl ToAccountMetas for PlaceSpotOrder {
7369        fn to_account_metas(&self) -> Vec<AccountMeta> {
7370            vec![
7371                AccountMeta {
7372                    pubkey: self.state,
7373                    is_signer: false,
7374                    is_writable: false,
7375                },
7376                AccountMeta {
7377                    pubkey: self.user,
7378                    is_signer: false,
7379                    is_writable: true,
7380                },
7381                AccountMeta {
7382                    pubkey: self.authority,
7383                    is_signer: true,
7384                    is_writable: false,
7385                },
7386            ]
7387        }
7388    }
7389    #[automatically_derived]
7390    impl anchor_lang::AccountSerialize for PlaceSpotOrder {
7391        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
7392            if writer.write_all(Self::DISCRIMINATOR).is_err() {
7393                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
7394            }
7395            if AnchorSerialize::serialize(self, writer).is_err() {
7396                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
7397            }
7398            Ok(())
7399        }
7400    }
7401    #[automatically_derived]
7402    impl anchor_lang::AccountDeserialize for PlaceSpotOrder {
7403        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
7404            let given_disc = &buf[..8];
7405            if Self::DISCRIMINATOR != given_disc {
7406                return Err(anchor_lang::error!(
7407                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
7408                ));
7409            }
7410            Self::try_deserialize_unchecked(buf)
7411        }
7412        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
7413            let mut data: &[u8] = &buf[8..];
7414            AnchorDeserialize::deserialize(&mut data)
7415                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
7416        }
7417    }
7418    #[repr(C)]
7419    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
7420    pub struct PlaceAndTakeSpotOrder {
7421        pub state: Pubkey,
7422        pub user: Pubkey,
7423        pub user_stats: Pubkey,
7424        pub authority: Pubkey,
7425    }
7426    #[automatically_derived]
7427    impl anchor_lang::Discriminator for PlaceAndTakeSpotOrder {
7428        const DISCRIMINATOR: &[u8] = &[114, 201, 131, 176, 15, 188, 94, 123];
7429    }
7430    #[automatically_derived]
7431    unsafe impl anchor_lang::__private::bytemuck::Pod for PlaceAndTakeSpotOrder {}
7432    #[automatically_derived]
7433    unsafe impl anchor_lang::__private::bytemuck::Zeroable for PlaceAndTakeSpotOrder {}
7434    #[automatically_derived]
7435    impl anchor_lang::ZeroCopy for PlaceAndTakeSpotOrder {}
7436    #[automatically_derived]
7437    impl anchor_lang::InstructionData for PlaceAndTakeSpotOrder {}
7438    #[automatically_derived]
7439    impl ToAccountMetas for PlaceAndTakeSpotOrder {
7440        fn to_account_metas(&self) -> Vec<AccountMeta> {
7441            vec![
7442                AccountMeta {
7443                    pubkey: self.state,
7444                    is_signer: false,
7445                    is_writable: false,
7446                },
7447                AccountMeta {
7448                    pubkey: self.user,
7449                    is_signer: false,
7450                    is_writable: true,
7451                },
7452                AccountMeta {
7453                    pubkey: self.user_stats,
7454                    is_signer: false,
7455                    is_writable: true,
7456                },
7457                AccountMeta {
7458                    pubkey: self.authority,
7459                    is_signer: true,
7460                    is_writable: false,
7461                },
7462            ]
7463        }
7464    }
7465    #[automatically_derived]
7466    impl anchor_lang::AccountSerialize for PlaceAndTakeSpotOrder {
7467        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
7468            if writer.write_all(Self::DISCRIMINATOR).is_err() {
7469                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
7470            }
7471            if AnchorSerialize::serialize(self, writer).is_err() {
7472                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
7473            }
7474            Ok(())
7475        }
7476    }
7477    #[automatically_derived]
7478    impl anchor_lang::AccountDeserialize for PlaceAndTakeSpotOrder {
7479        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
7480            let given_disc = &buf[..8];
7481            if Self::DISCRIMINATOR != given_disc {
7482                return Err(anchor_lang::error!(
7483                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
7484                ));
7485            }
7486            Self::try_deserialize_unchecked(buf)
7487        }
7488        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
7489            let mut data: &[u8] = &buf[8..];
7490            AnchorDeserialize::deserialize(&mut data)
7491                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
7492        }
7493    }
7494    #[repr(C)]
7495    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
7496    pub struct PlaceAndMakeSpotOrder {
7497        pub state: Pubkey,
7498        pub user: Pubkey,
7499        pub user_stats: Pubkey,
7500        pub taker: Pubkey,
7501        pub taker_stats: Pubkey,
7502        pub authority: Pubkey,
7503    }
7504    #[automatically_derived]
7505    impl anchor_lang::Discriminator for PlaceAndMakeSpotOrder {
7506        const DISCRIMINATOR: &[u8] = &[136, 102, 203, 251, 133, 233, 3, 195];
7507    }
7508    #[automatically_derived]
7509    unsafe impl anchor_lang::__private::bytemuck::Pod for PlaceAndMakeSpotOrder {}
7510    #[automatically_derived]
7511    unsafe impl anchor_lang::__private::bytemuck::Zeroable for PlaceAndMakeSpotOrder {}
7512    #[automatically_derived]
7513    impl anchor_lang::ZeroCopy for PlaceAndMakeSpotOrder {}
7514    #[automatically_derived]
7515    impl anchor_lang::InstructionData for PlaceAndMakeSpotOrder {}
7516    #[automatically_derived]
7517    impl ToAccountMetas for PlaceAndMakeSpotOrder {
7518        fn to_account_metas(&self) -> Vec<AccountMeta> {
7519            vec![
7520                AccountMeta {
7521                    pubkey: self.state,
7522                    is_signer: false,
7523                    is_writable: false,
7524                },
7525                AccountMeta {
7526                    pubkey: self.user,
7527                    is_signer: false,
7528                    is_writable: true,
7529                },
7530                AccountMeta {
7531                    pubkey: self.user_stats,
7532                    is_signer: false,
7533                    is_writable: true,
7534                },
7535                AccountMeta {
7536                    pubkey: self.taker,
7537                    is_signer: false,
7538                    is_writable: true,
7539                },
7540                AccountMeta {
7541                    pubkey: self.taker_stats,
7542                    is_signer: false,
7543                    is_writable: true,
7544                },
7545                AccountMeta {
7546                    pubkey: self.authority,
7547                    is_signer: true,
7548                    is_writable: false,
7549                },
7550            ]
7551        }
7552    }
7553    #[automatically_derived]
7554    impl anchor_lang::AccountSerialize for PlaceAndMakeSpotOrder {
7555        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
7556            if writer.write_all(Self::DISCRIMINATOR).is_err() {
7557                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
7558            }
7559            if AnchorSerialize::serialize(self, writer).is_err() {
7560                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
7561            }
7562            Ok(())
7563        }
7564    }
7565    #[automatically_derived]
7566    impl anchor_lang::AccountDeserialize for PlaceAndMakeSpotOrder {
7567        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
7568            let given_disc = &buf[..8];
7569            if Self::DISCRIMINATOR != given_disc {
7570                return Err(anchor_lang::error!(
7571                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
7572                ));
7573            }
7574            Self::try_deserialize_unchecked(buf)
7575        }
7576        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
7577            let mut data: &[u8] = &buf[8..];
7578            AnchorDeserialize::deserialize(&mut data)
7579                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
7580        }
7581    }
7582    #[repr(C)]
7583    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
7584    pub struct PlaceOrders {
7585        pub state: Pubkey,
7586        pub user: Pubkey,
7587        pub authority: Pubkey,
7588    }
7589    #[automatically_derived]
7590    impl anchor_lang::Discriminator for PlaceOrders {
7591        const DISCRIMINATOR: &[u8] = &[124, 246, 105, 210, 163, 120, 252, 61];
7592    }
7593    #[automatically_derived]
7594    unsafe impl anchor_lang::__private::bytemuck::Pod for PlaceOrders {}
7595    #[automatically_derived]
7596    unsafe impl anchor_lang::__private::bytemuck::Zeroable for PlaceOrders {}
7597    #[automatically_derived]
7598    impl anchor_lang::ZeroCopy for PlaceOrders {}
7599    #[automatically_derived]
7600    impl anchor_lang::InstructionData for PlaceOrders {}
7601    #[automatically_derived]
7602    impl ToAccountMetas for PlaceOrders {
7603        fn to_account_metas(&self) -> Vec<AccountMeta> {
7604            vec![
7605                AccountMeta {
7606                    pubkey: self.state,
7607                    is_signer: false,
7608                    is_writable: false,
7609                },
7610                AccountMeta {
7611                    pubkey: self.user,
7612                    is_signer: false,
7613                    is_writable: true,
7614                },
7615                AccountMeta {
7616                    pubkey: self.authority,
7617                    is_signer: true,
7618                    is_writable: false,
7619                },
7620            ]
7621        }
7622    }
7623    #[automatically_derived]
7624    impl anchor_lang::AccountSerialize for PlaceOrders {
7625        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
7626            if writer.write_all(Self::DISCRIMINATOR).is_err() {
7627                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
7628            }
7629            if AnchorSerialize::serialize(self, writer).is_err() {
7630                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
7631            }
7632            Ok(())
7633        }
7634    }
7635    #[automatically_derived]
7636    impl anchor_lang::AccountDeserialize for PlaceOrders {
7637        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
7638            let given_disc = &buf[..8];
7639            if Self::DISCRIMINATOR != given_disc {
7640                return Err(anchor_lang::error!(
7641                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
7642                ));
7643            }
7644            Self::try_deserialize_unchecked(buf)
7645        }
7646        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
7647            let mut data: &[u8] = &buf[8..];
7648            AnchorDeserialize::deserialize(&mut data)
7649                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
7650        }
7651    }
7652    #[repr(C)]
7653    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
7654    pub struct BeginSwap {
7655        pub state: Pubkey,
7656        pub user: Pubkey,
7657        pub user_stats: Pubkey,
7658        pub authority: Pubkey,
7659        pub out_spot_market_vault: Pubkey,
7660        pub in_spot_market_vault: Pubkey,
7661        pub out_token_account: Pubkey,
7662        pub in_token_account: Pubkey,
7663        pub token_program: Pubkey,
7664        pub drift_signer: Pubkey,
7665        pub instructions: Pubkey,
7666    }
7667    #[automatically_derived]
7668    impl anchor_lang::Discriminator for BeginSwap {
7669        const DISCRIMINATOR: &[u8] = &[219, 64, 214, 146, 204, 171, 39, 63];
7670    }
7671    #[automatically_derived]
7672    unsafe impl anchor_lang::__private::bytemuck::Pod for BeginSwap {}
7673    #[automatically_derived]
7674    unsafe impl anchor_lang::__private::bytemuck::Zeroable for BeginSwap {}
7675    #[automatically_derived]
7676    impl anchor_lang::ZeroCopy for BeginSwap {}
7677    #[automatically_derived]
7678    impl anchor_lang::InstructionData for BeginSwap {}
7679    #[automatically_derived]
7680    impl ToAccountMetas for BeginSwap {
7681        fn to_account_metas(&self) -> Vec<AccountMeta> {
7682            vec![
7683                AccountMeta {
7684                    pubkey: self.state,
7685                    is_signer: false,
7686                    is_writable: false,
7687                },
7688                AccountMeta {
7689                    pubkey: self.user,
7690                    is_signer: false,
7691                    is_writable: true,
7692                },
7693                AccountMeta {
7694                    pubkey: self.user_stats,
7695                    is_signer: false,
7696                    is_writable: true,
7697                },
7698                AccountMeta {
7699                    pubkey: self.authority,
7700                    is_signer: true,
7701                    is_writable: false,
7702                },
7703                AccountMeta {
7704                    pubkey: self.out_spot_market_vault,
7705                    is_signer: false,
7706                    is_writable: true,
7707                },
7708                AccountMeta {
7709                    pubkey: self.in_spot_market_vault,
7710                    is_signer: false,
7711                    is_writable: true,
7712                },
7713                AccountMeta {
7714                    pubkey: self.out_token_account,
7715                    is_signer: false,
7716                    is_writable: true,
7717                },
7718                AccountMeta {
7719                    pubkey: self.in_token_account,
7720                    is_signer: false,
7721                    is_writable: true,
7722                },
7723                AccountMeta {
7724                    pubkey: self.token_program,
7725                    is_signer: false,
7726                    is_writable: false,
7727                },
7728                AccountMeta {
7729                    pubkey: self.drift_signer,
7730                    is_signer: false,
7731                    is_writable: false,
7732                },
7733                AccountMeta {
7734                    pubkey: self.instructions,
7735                    is_signer: false,
7736                    is_writable: false,
7737                },
7738            ]
7739        }
7740    }
7741    #[automatically_derived]
7742    impl anchor_lang::AccountSerialize for BeginSwap {
7743        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
7744            if writer.write_all(Self::DISCRIMINATOR).is_err() {
7745                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
7746            }
7747            if AnchorSerialize::serialize(self, writer).is_err() {
7748                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
7749            }
7750            Ok(())
7751        }
7752    }
7753    #[automatically_derived]
7754    impl anchor_lang::AccountDeserialize for BeginSwap {
7755        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
7756            let given_disc = &buf[..8];
7757            if Self::DISCRIMINATOR != given_disc {
7758                return Err(anchor_lang::error!(
7759                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
7760                ));
7761            }
7762            Self::try_deserialize_unchecked(buf)
7763        }
7764        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
7765            let mut data: &[u8] = &buf[8..];
7766            AnchorDeserialize::deserialize(&mut data)
7767                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
7768        }
7769    }
7770    #[repr(C)]
7771    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
7772    pub struct EndSwap {
7773        pub state: Pubkey,
7774        pub user: Pubkey,
7775        pub user_stats: Pubkey,
7776        pub authority: Pubkey,
7777        pub out_spot_market_vault: Pubkey,
7778        pub in_spot_market_vault: Pubkey,
7779        pub out_token_account: Pubkey,
7780        pub in_token_account: Pubkey,
7781        pub token_program: Pubkey,
7782        pub drift_signer: Pubkey,
7783        pub instructions: Pubkey,
7784    }
7785    #[automatically_derived]
7786    impl anchor_lang::Discriminator for EndSwap {
7787        const DISCRIMINATOR: &[u8] = &[169, 78, 41, 75, 127, 169, 211, 205];
7788    }
7789    #[automatically_derived]
7790    unsafe impl anchor_lang::__private::bytemuck::Pod for EndSwap {}
7791    #[automatically_derived]
7792    unsafe impl anchor_lang::__private::bytemuck::Zeroable for EndSwap {}
7793    #[automatically_derived]
7794    impl anchor_lang::ZeroCopy for EndSwap {}
7795    #[automatically_derived]
7796    impl anchor_lang::InstructionData for EndSwap {}
7797    #[automatically_derived]
7798    impl ToAccountMetas for EndSwap {
7799        fn to_account_metas(&self) -> Vec<AccountMeta> {
7800            vec![
7801                AccountMeta {
7802                    pubkey: self.state,
7803                    is_signer: false,
7804                    is_writable: false,
7805                },
7806                AccountMeta {
7807                    pubkey: self.user,
7808                    is_signer: false,
7809                    is_writable: true,
7810                },
7811                AccountMeta {
7812                    pubkey: self.user_stats,
7813                    is_signer: false,
7814                    is_writable: true,
7815                },
7816                AccountMeta {
7817                    pubkey: self.authority,
7818                    is_signer: true,
7819                    is_writable: false,
7820                },
7821                AccountMeta {
7822                    pubkey: self.out_spot_market_vault,
7823                    is_signer: false,
7824                    is_writable: true,
7825                },
7826                AccountMeta {
7827                    pubkey: self.in_spot_market_vault,
7828                    is_signer: false,
7829                    is_writable: true,
7830                },
7831                AccountMeta {
7832                    pubkey: self.out_token_account,
7833                    is_signer: false,
7834                    is_writable: true,
7835                },
7836                AccountMeta {
7837                    pubkey: self.in_token_account,
7838                    is_signer: false,
7839                    is_writable: true,
7840                },
7841                AccountMeta {
7842                    pubkey: self.token_program,
7843                    is_signer: false,
7844                    is_writable: false,
7845                },
7846                AccountMeta {
7847                    pubkey: self.drift_signer,
7848                    is_signer: false,
7849                    is_writable: false,
7850                },
7851                AccountMeta {
7852                    pubkey: self.instructions,
7853                    is_signer: false,
7854                    is_writable: false,
7855                },
7856            ]
7857        }
7858    }
7859    #[automatically_derived]
7860    impl anchor_lang::AccountSerialize for EndSwap {
7861        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
7862            if writer.write_all(Self::DISCRIMINATOR).is_err() {
7863                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
7864            }
7865            if AnchorSerialize::serialize(self, writer).is_err() {
7866                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
7867            }
7868            Ok(())
7869        }
7870    }
7871    #[automatically_derived]
7872    impl anchor_lang::AccountDeserialize for EndSwap {
7873        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
7874            let given_disc = &buf[..8];
7875            if Self::DISCRIMINATOR != given_disc {
7876                return Err(anchor_lang::error!(
7877                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
7878                ));
7879            }
7880            Self::try_deserialize_unchecked(buf)
7881        }
7882        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
7883            let mut data: &[u8] = &buf[8..];
7884            AnchorDeserialize::deserialize(&mut data)
7885                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
7886        }
7887    }
7888    #[repr(C)]
7889    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
7890    pub struct AddPerpLpShares {
7891        pub state: Pubkey,
7892        pub user: Pubkey,
7893        pub authority: Pubkey,
7894    }
7895    #[automatically_derived]
7896    impl anchor_lang::Discriminator for AddPerpLpShares {
7897        const DISCRIMINATOR: &[u8] = &[136, 244, 213, 15, 170, 246, 138, 57];
7898    }
7899    #[automatically_derived]
7900    unsafe impl anchor_lang::__private::bytemuck::Pod for AddPerpLpShares {}
7901    #[automatically_derived]
7902    unsafe impl anchor_lang::__private::bytemuck::Zeroable for AddPerpLpShares {}
7903    #[automatically_derived]
7904    impl anchor_lang::ZeroCopy for AddPerpLpShares {}
7905    #[automatically_derived]
7906    impl anchor_lang::InstructionData for AddPerpLpShares {}
7907    #[automatically_derived]
7908    impl ToAccountMetas for AddPerpLpShares {
7909        fn to_account_metas(&self) -> Vec<AccountMeta> {
7910            vec![
7911                AccountMeta {
7912                    pubkey: self.state,
7913                    is_signer: false,
7914                    is_writable: false,
7915                },
7916                AccountMeta {
7917                    pubkey: self.user,
7918                    is_signer: false,
7919                    is_writable: true,
7920                },
7921                AccountMeta {
7922                    pubkey: self.authority,
7923                    is_signer: true,
7924                    is_writable: false,
7925                },
7926            ]
7927        }
7928    }
7929    #[automatically_derived]
7930    impl anchor_lang::AccountSerialize for AddPerpLpShares {
7931        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
7932            if writer.write_all(Self::DISCRIMINATOR).is_err() {
7933                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
7934            }
7935            if AnchorSerialize::serialize(self, writer).is_err() {
7936                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
7937            }
7938            Ok(())
7939        }
7940    }
7941    #[automatically_derived]
7942    impl anchor_lang::AccountDeserialize for AddPerpLpShares {
7943        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
7944            let given_disc = &buf[..8];
7945            if Self::DISCRIMINATOR != given_disc {
7946                return Err(anchor_lang::error!(
7947                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
7948                ));
7949            }
7950            Self::try_deserialize_unchecked(buf)
7951        }
7952        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
7953            let mut data: &[u8] = &buf[8..];
7954            AnchorDeserialize::deserialize(&mut data)
7955                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
7956        }
7957    }
7958    #[repr(C)]
7959    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
7960    pub struct RemovePerpLpShares {
7961        pub state: Pubkey,
7962        pub user: Pubkey,
7963        pub authority: Pubkey,
7964    }
7965    #[automatically_derived]
7966    impl anchor_lang::Discriminator for RemovePerpLpShares {
7967        const DISCRIMINATOR: &[u8] = &[28, 42, 13, 175, 57, 117, 166, 250];
7968    }
7969    #[automatically_derived]
7970    unsafe impl anchor_lang::__private::bytemuck::Pod for RemovePerpLpShares {}
7971    #[automatically_derived]
7972    unsafe impl anchor_lang::__private::bytemuck::Zeroable for RemovePerpLpShares {}
7973    #[automatically_derived]
7974    impl anchor_lang::ZeroCopy for RemovePerpLpShares {}
7975    #[automatically_derived]
7976    impl anchor_lang::InstructionData for RemovePerpLpShares {}
7977    #[automatically_derived]
7978    impl ToAccountMetas for RemovePerpLpShares {
7979        fn to_account_metas(&self) -> Vec<AccountMeta> {
7980            vec![
7981                AccountMeta {
7982                    pubkey: self.state,
7983                    is_signer: false,
7984                    is_writable: false,
7985                },
7986                AccountMeta {
7987                    pubkey: self.user,
7988                    is_signer: false,
7989                    is_writable: true,
7990                },
7991                AccountMeta {
7992                    pubkey: self.authority,
7993                    is_signer: true,
7994                    is_writable: false,
7995                },
7996            ]
7997        }
7998    }
7999    #[automatically_derived]
8000    impl anchor_lang::AccountSerialize for RemovePerpLpShares {
8001        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
8002            if writer.write_all(Self::DISCRIMINATOR).is_err() {
8003                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
8004            }
8005            if AnchorSerialize::serialize(self, writer).is_err() {
8006                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
8007            }
8008            Ok(())
8009        }
8010    }
8011    #[automatically_derived]
8012    impl anchor_lang::AccountDeserialize for RemovePerpLpShares {
8013        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
8014            let given_disc = &buf[..8];
8015            if Self::DISCRIMINATOR != given_disc {
8016                return Err(anchor_lang::error!(
8017                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
8018                ));
8019            }
8020            Self::try_deserialize_unchecked(buf)
8021        }
8022        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
8023            let mut data: &[u8] = &buf[8..];
8024            AnchorDeserialize::deserialize(&mut data)
8025                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
8026        }
8027    }
8028    #[repr(C)]
8029    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
8030    pub struct RemovePerpLpSharesInExpiringMarket {
8031        pub state: Pubkey,
8032        pub user: Pubkey,
8033    }
8034    #[automatically_derived]
8035    impl anchor_lang::Discriminator for RemovePerpLpSharesInExpiringMarket {
8036        const DISCRIMINATOR: &[u8] = &[117, 16, 76, 236, 145, 84, 112, 103];
8037    }
8038    #[automatically_derived]
8039    unsafe impl anchor_lang::__private::bytemuck::Pod for RemovePerpLpSharesInExpiringMarket {}
8040    #[automatically_derived]
8041    unsafe impl anchor_lang::__private::bytemuck::Zeroable for RemovePerpLpSharesInExpiringMarket {}
8042    #[automatically_derived]
8043    impl anchor_lang::ZeroCopy for RemovePerpLpSharesInExpiringMarket {}
8044    #[automatically_derived]
8045    impl anchor_lang::InstructionData for RemovePerpLpSharesInExpiringMarket {}
8046    #[automatically_derived]
8047    impl ToAccountMetas for RemovePerpLpSharesInExpiringMarket {
8048        fn to_account_metas(&self) -> Vec<AccountMeta> {
8049            vec![
8050                AccountMeta {
8051                    pubkey: self.state,
8052                    is_signer: false,
8053                    is_writable: false,
8054                },
8055                AccountMeta {
8056                    pubkey: self.user,
8057                    is_signer: false,
8058                    is_writable: true,
8059                },
8060            ]
8061        }
8062    }
8063    #[automatically_derived]
8064    impl anchor_lang::AccountSerialize for RemovePerpLpSharesInExpiringMarket {
8065        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
8066            if writer.write_all(Self::DISCRIMINATOR).is_err() {
8067                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
8068            }
8069            if AnchorSerialize::serialize(self, writer).is_err() {
8070                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
8071            }
8072            Ok(())
8073        }
8074    }
8075    #[automatically_derived]
8076    impl anchor_lang::AccountDeserialize for RemovePerpLpSharesInExpiringMarket {
8077        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
8078            let given_disc = &buf[..8];
8079            if Self::DISCRIMINATOR != given_disc {
8080                return Err(anchor_lang::error!(
8081                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
8082                ));
8083            }
8084            Self::try_deserialize_unchecked(buf)
8085        }
8086        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
8087            let mut data: &[u8] = &buf[8..];
8088            AnchorDeserialize::deserialize(&mut data)
8089                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
8090        }
8091    }
8092    #[repr(C)]
8093    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
8094    pub struct UpdateUserName {
8095        pub user: Pubkey,
8096        pub authority: Pubkey,
8097    }
8098    #[automatically_derived]
8099    impl anchor_lang::Discriminator for UpdateUserName {
8100        const DISCRIMINATOR: &[u8] = &[110, 237, 80, 83, 89, 231, 185, 154];
8101    }
8102    #[automatically_derived]
8103    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdateUserName {}
8104    #[automatically_derived]
8105    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdateUserName {}
8106    #[automatically_derived]
8107    impl anchor_lang::ZeroCopy for UpdateUserName {}
8108    #[automatically_derived]
8109    impl anchor_lang::InstructionData for UpdateUserName {}
8110    #[automatically_derived]
8111    impl ToAccountMetas for UpdateUserName {
8112        fn to_account_metas(&self) -> Vec<AccountMeta> {
8113            vec![
8114                AccountMeta {
8115                    pubkey: self.user,
8116                    is_signer: false,
8117                    is_writable: true,
8118                },
8119                AccountMeta {
8120                    pubkey: self.authority,
8121                    is_signer: true,
8122                    is_writable: false,
8123                },
8124            ]
8125        }
8126    }
8127    #[automatically_derived]
8128    impl anchor_lang::AccountSerialize for UpdateUserName {
8129        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
8130            if writer.write_all(Self::DISCRIMINATOR).is_err() {
8131                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
8132            }
8133            if AnchorSerialize::serialize(self, writer).is_err() {
8134                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
8135            }
8136            Ok(())
8137        }
8138    }
8139    #[automatically_derived]
8140    impl anchor_lang::AccountDeserialize for UpdateUserName {
8141        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
8142            let given_disc = &buf[..8];
8143            if Self::DISCRIMINATOR != given_disc {
8144                return Err(anchor_lang::error!(
8145                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
8146                ));
8147            }
8148            Self::try_deserialize_unchecked(buf)
8149        }
8150        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
8151            let mut data: &[u8] = &buf[8..];
8152            AnchorDeserialize::deserialize(&mut data)
8153                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
8154        }
8155    }
8156    #[repr(C)]
8157    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
8158    pub struct UpdateUserCustomMarginRatio {
8159        pub user: Pubkey,
8160        pub authority: Pubkey,
8161    }
8162    #[automatically_derived]
8163    impl anchor_lang::Discriminator for UpdateUserCustomMarginRatio {
8164        const DISCRIMINATOR: &[u8] = &[102, 94, 49, 231, 23, 142, 117, 224];
8165    }
8166    #[automatically_derived]
8167    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdateUserCustomMarginRatio {}
8168    #[automatically_derived]
8169    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdateUserCustomMarginRatio {}
8170    #[automatically_derived]
8171    impl anchor_lang::ZeroCopy for UpdateUserCustomMarginRatio {}
8172    #[automatically_derived]
8173    impl anchor_lang::InstructionData for UpdateUserCustomMarginRatio {}
8174    #[automatically_derived]
8175    impl ToAccountMetas for UpdateUserCustomMarginRatio {
8176        fn to_account_metas(&self) -> Vec<AccountMeta> {
8177            vec![
8178                AccountMeta {
8179                    pubkey: self.user,
8180                    is_signer: false,
8181                    is_writable: true,
8182                },
8183                AccountMeta {
8184                    pubkey: self.authority,
8185                    is_signer: true,
8186                    is_writable: false,
8187                },
8188            ]
8189        }
8190    }
8191    #[automatically_derived]
8192    impl anchor_lang::AccountSerialize for UpdateUserCustomMarginRatio {
8193        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
8194            if writer.write_all(Self::DISCRIMINATOR).is_err() {
8195                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
8196            }
8197            if AnchorSerialize::serialize(self, writer).is_err() {
8198                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
8199            }
8200            Ok(())
8201        }
8202    }
8203    #[automatically_derived]
8204    impl anchor_lang::AccountDeserialize for UpdateUserCustomMarginRatio {
8205        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
8206            let given_disc = &buf[..8];
8207            if Self::DISCRIMINATOR != given_disc {
8208                return Err(anchor_lang::error!(
8209                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
8210                ));
8211            }
8212            Self::try_deserialize_unchecked(buf)
8213        }
8214        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
8215            let mut data: &[u8] = &buf[8..];
8216            AnchorDeserialize::deserialize(&mut data)
8217                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
8218        }
8219    }
8220    #[repr(C)]
8221    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
8222    pub struct UpdateUserMarginTradingEnabled {
8223        pub user: Pubkey,
8224        pub authority: Pubkey,
8225    }
8226    #[automatically_derived]
8227    impl anchor_lang::Discriminator for UpdateUserMarginTradingEnabled {
8228        const DISCRIMINATOR: &[u8] = &[89, 5, 206, 157, 104, 243, 243, 104];
8229    }
8230    #[automatically_derived]
8231    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdateUserMarginTradingEnabled {}
8232    #[automatically_derived]
8233    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdateUserMarginTradingEnabled {}
8234    #[automatically_derived]
8235    impl anchor_lang::ZeroCopy for UpdateUserMarginTradingEnabled {}
8236    #[automatically_derived]
8237    impl anchor_lang::InstructionData for UpdateUserMarginTradingEnabled {}
8238    #[automatically_derived]
8239    impl ToAccountMetas for UpdateUserMarginTradingEnabled {
8240        fn to_account_metas(&self) -> Vec<AccountMeta> {
8241            vec![
8242                AccountMeta {
8243                    pubkey: self.user,
8244                    is_signer: false,
8245                    is_writable: true,
8246                },
8247                AccountMeta {
8248                    pubkey: self.authority,
8249                    is_signer: true,
8250                    is_writable: false,
8251                },
8252            ]
8253        }
8254    }
8255    #[automatically_derived]
8256    impl anchor_lang::AccountSerialize for UpdateUserMarginTradingEnabled {
8257        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
8258            if writer.write_all(Self::DISCRIMINATOR).is_err() {
8259                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
8260            }
8261            if AnchorSerialize::serialize(self, writer).is_err() {
8262                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
8263            }
8264            Ok(())
8265        }
8266    }
8267    #[automatically_derived]
8268    impl anchor_lang::AccountDeserialize for UpdateUserMarginTradingEnabled {
8269        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
8270            let given_disc = &buf[..8];
8271            if Self::DISCRIMINATOR != given_disc {
8272                return Err(anchor_lang::error!(
8273                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
8274                ));
8275            }
8276            Self::try_deserialize_unchecked(buf)
8277        }
8278        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
8279            let mut data: &[u8] = &buf[8..];
8280            AnchorDeserialize::deserialize(&mut data)
8281                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
8282        }
8283    }
8284    #[repr(C)]
8285    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
8286    pub struct UpdateUserPoolId {
8287        pub user: Pubkey,
8288        pub authority: Pubkey,
8289    }
8290    #[automatically_derived]
8291    impl anchor_lang::Discriminator for UpdateUserPoolId {
8292        const DISCRIMINATOR: &[u8] = &[215, 193, 254, 33, 60, 226, 249, 100];
8293    }
8294    #[automatically_derived]
8295    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdateUserPoolId {}
8296    #[automatically_derived]
8297    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdateUserPoolId {}
8298    #[automatically_derived]
8299    impl anchor_lang::ZeroCopy for UpdateUserPoolId {}
8300    #[automatically_derived]
8301    impl anchor_lang::InstructionData for UpdateUserPoolId {}
8302    #[automatically_derived]
8303    impl ToAccountMetas for UpdateUserPoolId {
8304        fn to_account_metas(&self) -> Vec<AccountMeta> {
8305            vec![
8306                AccountMeta {
8307                    pubkey: self.user,
8308                    is_signer: false,
8309                    is_writable: true,
8310                },
8311                AccountMeta {
8312                    pubkey: self.authority,
8313                    is_signer: true,
8314                    is_writable: false,
8315                },
8316            ]
8317        }
8318    }
8319    #[automatically_derived]
8320    impl anchor_lang::AccountSerialize for UpdateUserPoolId {
8321        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
8322            if writer.write_all(Self::DISCRIMINATOR).is_err() {
8323                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
8324            }
8325            if AnchorSerialize::serialize(self, writer).is_err() {
8326                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
8327            }
8328            Ok(())
8329        }
8330    }
8331    #[automatically_derived]
8332    impl anchor_lang::AccountDeserialize for UpdateUserPoolId {
8333        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
8334            let given_disc = &buf[..8];
8335            if Self::DISCRIMINATOR != given_disc {
8336                return Err(anchor_lang::error!(
8337                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
8338                ));
8339            }
8340            Self::try_deserialize_unchecked(buf)
8341        }
8342        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
8343            let mut data: &[u8] = &buf[8..];
8344            AnchorDeserialize::deserialize(&mut data)
8345                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
8346        }
8347    }
8348    #[repr(C)]
8349    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
8350    pub struct UpdateUserDelegate {
8351        pub user: Pubkey,
8352        pub authority: Pubkey,
8353    }
8354    #[automatically_derived]
8355    impl anchor_lang::Discriminator for UpdateUserDelegate {
8356        const DISCRIMINATOR: &[u8] = &[32, 244, 37, 163, 236, 179, 10, 208];
8357    }
8358    #[automatically_derived]
8359    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdateUserDelegate {}
8360    #[automatically_derived]
8361    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdateUserDelegate {}
8362    #[automatically_derived]
8363    impl anchor_lang::ZeroCopy for UpdateUserDelegate {}
8364    #[automatically_derived]
8365    impl anchor_lang::InstructionData for UpdateUserDelegate {}
8366    #[automatically_derived]
8367    impl ToAccountMetas for UpdateUserDelegate {
8368        fn to_account_metas(&self) -> Vec<AccountMeta> {
8369            vec![
8370                AccountMeta {
8371                    pubkey: self.user,
8372                    is_signer: false,
8373                    is_writable: true,
8374                },
8375                AccountMeta {
8376                    pubkey: self.authority,
8377                    is_signer: true,
8378                    is_writable: false,
8379                },
8380            ]
8381        }
8382    }
8383    #[automatically_derived]
8384    impl anchor_lang::AccountSerialize for UpdateUserDelegate {
8385        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
8386            if writer.write_all(Self::DISCRIMINATOR).is_err() {
8387                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
8388            }
8389            if AnchorSerialize::serialize(self, writer).is_err() {
8390                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
8391            }
8392            Ok(())
8393        }
8394    }
8395    #[automatically_derived]
8396    impl anchor_lang::AccountDeserialize for UpdateUserDelegate {
8397        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
8398            let given_disc = &buf[..8];
8399            if Self::DISCRIMINATOR != given_disc {
8400                return Err(anchor_lang::error!(
8401                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
8402                ));
8403            }
8404            Self::try_deserialize_unchecked(buf)
8405        }
8406        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
8407            let mut data: &[u8] = &buf[8..];
8408            AnchorDeserialize::deserialize(&mut data)
8409                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
8410        }
8411    }
8412    #[repr(C)]
8413    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
8414    pub struct UpdateUserReduceOnly {
8415        pub user: Pubkey,
8416        pub authority: Pubkey,
8417    }
8418    #[automatically_derived]
8419    impl anchor_lang::Discriminator for UpdateUserReduceOnly {
8420        const DISCRIMINATOR: &[u8] = &[213, 230, 138, 228, 171, 118, 20, 105];
8421    }
8422    #[automatically_derived]
8423    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdateUserReduceOnly {}
8424    #[automatically_derived]
8425    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdateUserReduceOnly {}
8426    #[automatically_derived]
8427    impl anchor_lang::ZeroCopy for UpdateUserReduceOnly {}
8428    #[automatically_derived]
8429    impl anchor_lang::InstructionData for UpdateUserReduceOnly {}
8430    #[automatically_derived]
8431    impl ToAccountMetas for UpdateUserReduceOnly {
8432        fn to_account_metas(&self) -> Vec<AccountMeta> {
8433            vec![
8434                AccountMeta {
8435                    pubkey: self.user,
8436                    is_signer: false,
8437                    is_writable: true,
8438                },
8439                AccountMeta {
8440                    pubkey: self.authority,
8441                    is_signer: true,
8442                    is_writable: false,
8443                },
8444            ]
8445        }
8446    }
8447    #[automatically_derived]
8448    impl anchor_lang::AccountSerialize for UpdateUserReduceOnly {
8449        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
8450            if writer.write_all(Self::DISCRIMINATOR).is_err() {
8451                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
8452            }
8453            if AnchorSerialize::serialize(self, writer).is_err() {
8454                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
8455            }
8456            Ok(())
8457        }
8458    }
8459    #[automatically_derived]
8460    impl anchor_lang::AccountDeserialize for UpdateUserReduceOnly {
8461        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
8462            let given_disc = &buf[..8];
8463            if Self::DISCRIMINATOR != given_disc {
8464                return Err(anchor_lang::error!(
8465                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
8466                ));
8467            }
8468            Self::try_deserialize_unchecked(buf)
8469        }
8470        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
8471            let mut data: &[u8] = &buf[8..];
8472            AnchorDeserialize::deserialize(&mut data)
8473                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
8474        }
8475    }
8476    #[repr(C)]
8477    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
8478    pub struct UpdateUserAdvancedLp {
8479        pub user: Pubkey,
8480        pub authority: Pubkey,
8481    }
8482    #[automatically_derived]
8483    impl anchor_lang::Discriminator for UpdateUserAdvancedLp {
8484        const DISCRIMINATOR: &[u8] = &[227, 146, 68, 197, 45, 160, 163, 72];
8485    }
8486    #[automatically_derived]
8487    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdateUserAdvancedLp {}
8488    #[automatically_derived]
8489    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdateUserAdvancedLp {}
8490    #[automatically_derived]
8491    impl anchor_lang::ZeroCopy for UpdateUserAdvancedLp {}
8492    #[automatically_derived]
8493    impl anchor_lang::InstructionData for UpdateUserAdvancedLp {}
8494    #[automatically_derived]
8495    impl ToAccountMetas for UpdateUserAdvancedLp {
8496        fn to_account_metas(&self) -> Vec<AccountMeta> {
8497            vec![
8498                AccountMeta {
8499                    pubkey: self.user,
8500                    is_signer: false,
8501                    is_writable: true,
8502                },
8503                AccountMeta {
8504                    pubkey: self.authority,
8505                    is_signer: true,
8506                    is_writable: false,
8507                },
8508            ]
8509        }
8510    }
8511    #[automatically_derived]
8512    impl anchor_lang::AccountSerialize for UpdateUserAdvancedLp {
8513        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
8514            if writer.write_all(Self::DISCRIMINATOR).is_err() {
8515                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
8516            }
8517            if AnchorSerialize::serialize(self, writer).is_err() {
8518                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
8519            }
8520            Ok(())
8521        }
8522    }
8523    #[automatically_derived]
8524    impl anchor_lang::AccountDeserialize for UpdateUserAdvancedLp {
8525        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
8526            let given_disc = &buf[..8];
8527            if Self::DISCRIMINATOR != given_disc {
8528                return Err(anchor_lang::error!(
8529                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
8530                ));
8531            }
8532            Self::try_deserialize_unchecked(buf)
8533        }
8534        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
8535            let mut data: &[u8] = &buf[8..];
8536            AnchorDeserialize::deserialize(&mut data)
8537                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
8538        }
8539    }
8540    #[repr(C)]
8541    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
8542    pub struct UpdateUserProtectedMakerOrders {
8543        pub state: Pubkey,
8544        pub user: Pubkey,
8545        pub authority: Pubkey,
8546        pub protected_maker_mode_config: Pubkey,
8547    }
8548    #[automatically_derived]
8549    impl anchor_lang::Discriminator for UpdateUserProtectedMakerOrders {
8550        const DISCRIMINATOR: &[u8] = &[220, 255, 63, 84, 125, 9, 84, 92];
8551    }
8552    #[automatically_derived]
8553    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdateUserProtectedMakerOrders {}
8554    #[automatically_derived]
8555    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdateUserProtectedMakerOrders {}
8556    #[automatically_derived]
8557    impl anchor_lang::ZeroCopy for UpdateUserProtectedMakerOrders {}
8558    #[automatically_derived]
8559    impl anchor_lang::InstructionData for UpdateUserProtectedMakerOrders {}
8560    #[automatically_derived]
8561    impl ToAccountMetas for UpdateUserProtectedMakerOrders {
8562        fn to_account_metas(&self) -> Vec<AccountMeta> {
8563            vec![
8564                AccountMeta {
8565                    pubkey: self.state,
8566                    is_signer: false,
8567                    is_writable: false,
8568                },
8569                AccountMeta {
8570                    pubkey: self.user,
8571                    is_signer: false,
8572                    is_writable: true,
8573                },
8574                AccountMeta {
8575                    pubkey: self.authority,
8576                    is_signer: true,
8577                    is_writable: false,
8578                },
8579                AccountMeta {
8580                    pubkey: self.protected_maker_mode_config,
8581                    is_signer: false,
8582                    is_writable: true,
8583                },
8584            ]
8585        }
8586    }
8587    #[automatically_derived]
8588    impl anchor_lang::AccountSerialize for UpdateUserProtectedMakerOrders {
8589        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
8590            if writer.write_all(Self::DISCRIMINATOR).is_err() {
8591                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
8592            }
8593            if AnchorSerialize::serialize(self, writer).is_err() {
8594                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
8595            }
8596            Ok(())
8597        }
8598    }
8599    #[automatically_derived]
8600    impl anchor_lang::AccountDeserialize for UpdateUserProtectedMakerOrders {
8601        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
8602            let given_disc = &buf[..8];
8603            if Self::DISCRIMINATOR != given_disc {
8604                return Err(anchor_lang::error!(
8605                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
8606                ));
8607            }
8608            Self::try_deserialize_unchecked(buf)
8609        }
8610        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
8611            let mut data: &[u8] = &buf[8..];
8612            AnchorDeserialize::deserialize(&mut data)
8613                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
8614        }
8615    }
8616    #[repr(C)]
8617    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
8618    pub struct DeleteUser {
8619        pub user: Pubkey,
8620        pub user_stats: Pubkey,
8621        pub state: Pubkey,
8622        pub authority: Pubkey,
8623    }
8624    #[automatically_derived]
8625    impl anchor_lang::Discriminator for DeleteUser {
8626        const DISCRIMINATOR: &[u8] = &[138, 7, 216, 138, 241, 248, 199, 228];
8627    }
8628    #[automatically_derived]
8629    unsafe impl anchor_lang::__private::bytemuck::Pod for DeleteUser {}
8630    #[automatically_derived]
8631    unsafe impl anchor_lang::__private::bytemuck::Zeroable for DeleteUser {}
8632    #[automatically_derived]
8633    impl anchor_lang::ZeroCopy for DeleteUser {}
8634    #[automatically_derived]
8635    impl anchor_lang::InstructionData for DeleteUser {}
8636    #[automatically_derived]
8637    impl ToAccountMetas for DeleteUser {
8638        fn to_account_metas(&self) -> Vec<AccountMeta> {
8639            vec![
8640                AccountMeta {
8641                    pubkey: self.user,
8642                    is_signer: false,
8643                    is_writable: true,
8644                },
8645                AccountMeta {
8646                    pubkey: self.user_stats,
8647                    is_signer: false,
8648                    is_writable: true,
8649                },
8650                AccountMeta {
8651                    pubkey: self.state,
8652                    is_signer: false,
8653                    is_writable: true,
8654                },
8655                AccountMeta {
8656                    pubkey: self.authority,
8657                    is_signer: true,
8658                    is_writable: true,
8659                },
8660            ]
8661        }
8662    }
8663    #[automatically_derived]
8664    impl anchor_lang::AccountSerialize for DeleteUser {
8665        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
8666            if writer.write_all(Self::DISCRIMINATOR).is_err() {
8667                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
8668            }
8669            if AnchorSerialize::serialize(self, writer).is_err() {
8670                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
8671            }
8672            Ok(())
8673        }
8674    }
8675    #[automatically_derived]
8676    impl anchor_lang::AccountDeserialize for DeleteUser {
8677        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
8678            let given_disc = &buf[..8];
8679            if Self::DISCRIMINATOR != given_disc {
8680                return Err(anchor_lang::error!(
8681                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
8682                ));
8683            }
8684            Self::try_deserialize_unchecked(buf)
8685        }
8686        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
8687            let mut data: &[u8] = &buf[8..];
8688            AnchorDeserialize::deserialize(&mut data)
8689                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
8690        }
8691    }
8692    #[repr(C)]
8693    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
8694    pub struct ForceDeleteUser {
8695        pub user: Pubkey,
8696        pub user_stats: Pubkey,
8697        pub state: Pubkey,
8698        pub authority: Pubkey,
8699        pub keeper: Pubkey,
8700        pub drift_signer: Pubkey,
8701    }
8702    #[automatically_derived]
8703    impl anchor_lang::Discriminator for ForceDeleteUser {
8704        const DISCRIMINATOR: &[u8] = &[224, 206, 23, 192, 99, 164, 175, 251];
8705    }
8706    #[automatically_derived]
8707    unsafe impl anchor_lang::__private::bytemuck::Pod for ForceDeleteUser {}
8708    #[automatically_derived]
8709    unsafe impl anchor_lang::__private::bytemuck::Zeroable for ForceDeleteUser {}
8710    #[automatically_derived]
8711    impl anchor_lang::ZeroCopy for ForceDeleteUser {}
8712    #[automatically_derived]
8713    impl anchor_lang::InstructionData for ForceDeleteUser {}
8714    #[automatically_derived]
8715    impl ToAccountMetas for ForceDeleteUser {
8716        fn to_account_metas(&self) -> Vec<AccountMeta> {
8717            vec![
8718                AccountMeta {
8719                    pubkey: self.user,
8720                    is_signer: false,
8721                    is_writable: true,
8722                },
8723                AccountMeta {
8724                    pubkey: self.user_stats,
8725                    is_signer: false,
8726                    is_writable: true,
8727                },
8728                AccountMeta {
8729                    pubkey: self.state,
8730                    is_signer: false,
8731                    is_writable: true,
8732                },
8733                AccountMeta {
8734                    pubkey: self.authority,
8735                    is_signer: false,
8736                    is_writable: true,
8737                },
8738                AccountMeta {
8739                    pubkey: self.keeper,
8740                    is_signer: true,
8741                    is_writable: true,
8742                },
8743                AccountMeta {
8744                    pubkey: self.drift_signer,
8745                    is_signer: false,
8746                    is_writable: false,
8747                },
8748            ]
8749        }
8750    }
8751    #[automatically_derived]
8752    impl anchor_lang::AccountSerialize for ForceDeleteUser {
8753        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
8754            if writer.write_all(Self::DISCRIMINATOR).is_err() {
8755                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
8756            }
8757            if AnchorSerialize::serialize(self, writer).is_err() {
8758                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
8759            }
8760            Ok(())
8761        }
8762    }
8763    #[automatically_derived]
8764    impl anchor_lang::AccountDeserialize for ForceDeleteUser {
8765        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
8766            let given_disc = &buf[..8];
8767            if Self::DISCRIMINATOR != given_disc {
8768                return Err(anchor_lang::error!(
8769                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
8770                ));
8771            }
8772            Self::try_deserialize_unchecked(buf)
8773        }
8774        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
8775            let mut data: &[u8] = &buf[8..];
8776            AnchorDeserialize::deserialize(&mut data)
8777                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
8778        }
8779    }
8780    #[repr(C)]
8781    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
8782    pub struct DeleteSignedMsgUserOrders {
8783        pub signed_msg_user_orders: Pubkey,
8784        pub state: Pubkey,
8785        pub authority: Pubkey,
8786    }
8787    #[automatically_derived]
8788    impl anchor_lang::Discriminator for DeleteSignedMsgUserOrders {
8789        const DISCRIMINATOR: &[u8] = &[134, 162, 251, 123, 234, 231, 227, 119];
8790    }
8791    #[automatically_derived]
8792    unsafe impl anchor_lang::__private::bytemuck::Pod for DeleteSignedMsgUserOrders {}
8793    #[automatically_derived]
8794    unsafe impl anchor_lang::__private::bytemuck::Zeroable for DeleteSignedMsgUserOrders {}
8795    #[automatically_derived]
8796    impl anchor_lang::ZeroCopy for DeleteSignedMsgUserOrders {}
8797    #[automatically_derived]
8798    impl anchor_lang::InstructionData for DeleteSignedMsgUserOrders {}
8799    #[automatically_derived]
8800    impl ToAccountMetas for DeleteSignedMsgUserOrders {
8801        fn to_account_metas(&self) -> Vec<AccountMeta> {
8802            vec![
8803                AccountMeta {
8804                    pubkey: self.signed_msg_user_orders,
8805                    is_signer: false,
8806                    is_writable: true,
8807                },
8808                AccountMeta {
8809                    pubkey: self.state,
8810                    is_signer: false,
8811                    is_writable: true,
8812                },
8813                AccountMeta {
8814                    pubkey: self.authority,
8815                    is_signer: true,
8816                    is_writable: false,
8817                },
8818            ]
8819        }
8820    }
8821    #[automatically_derived]
8822    impl anchor_lang::AccountSerialize for DeleteSignedMsgUserOrders {
8823        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
8824            if writer.write_all(Self::DISCRIMINATOR).is_err() {
8825                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
8826            }
8827            if AnchorSerialize::serialize(self, writer).is_err() {
8828                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
8829            }
8830            Ok(())
8831        }
8832    }
8833    #[automatically_derived]
8834    impl anchor_lang::AccountDeserialize for DeleteSignedMsgUserOrders {
8835        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
8836            let given_disc = &buf[..8];
8837            if Self::DISCRIMINATOR != given_disc {
8838                return Err(anchor_lang::error!(
8839                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
8840                ));
8841            }
8842            Self::try_deserialize_unchecked(buf)
8843        }
8844        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
8845            let mut data: &[u8] = &buf[8..];
8846            AnchorDeserialize::deserialize(&mut data)
8847                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
8848        }
8849    }
8850    #[repr(C)]
8851    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
8852    pub struct ReclaimRent {
8853        pub user: Pubkey,
8854        pub user_stats: Pubkey,
8855        pub state: Pubkey,
8856        pub authority: Pubkey,
8857        pub rent: Pubkey,
8858    }
8859    #[automatically_derived]
8860    impl anchor_lang::Discriminator for ReclaimRent {
8861        const DISCRIMINATOR: &[u8] = &[245, 126, 60, 211, 102, 85, 171, 126];
8862    }
8863    #[automatically_derived]
8864    unsafe impl anchor_lang::__private::bytemuck::Pod for ReclaimRent {}
8865    #[automatically_derived]
8866    unsafe impl anchor_lang::__private::bytemuck::Zeroable for ReclaimRent {}
8867    #[automatically_derived]
8868    impl anchor_lang::ZeroCopy for ReclaimRent {}
8869    #[automatically_derived]
8870    impl anchor_lang::InstructionData for ReclaimRent {}
8871    #[automatically_derived]
8872    impl ToAccountMetas for ReclaimRent {
8873        fn to_account_metas(&self) -> Vec<AccountMeta> {
8874            vec![
8875                AccountMeta {
8876                    pubkey: self.user,
8877                    is_signer: false,
8878                    is_writable: true,
8879                },
8880                AccountMeta {
8881                    pubkey: self.user_stats,
8882                    is_signer: false,
8883                    is_writable: true,
8884                },
8885                AccountMeta {
8886                    pubkey: self.state,
8887                    is_signer: false,
8888                    is_writable: false,
8889                },
8890                AccountMeta {
8891                    pubkey: self.authority,
8892                    is_signer: true,
8893                    is_writable: false,
8894                },
8895                AccountMeta {
8896                    pubkey: self.rent,
8897                    is_signer: false,
8898                    is_writable: false,
8899                },
8900            ]
8901        }
8902    }
8903    #[automatically_derived]
8904    impl anchor_lang::AccountSerialize for ReclaimRent {
8905        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
8906            if writer.write_all(Self::DISCRIMINATOR).is_err() {
8907                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
8908            }
8909            if AnchorSerialize::serialize(self, writer).is_err() {
8910                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
8911            }
8912            Ok(())
8913        }
8914    }
8915    #[automatically_derived]
8916    impl anchor_lang::AccountDeserialize for ReclaimRent {
8917        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
8918            let given_disc = &buf[..8];
8919            if Self::DISCRIMINATOR != given_disc {
8920                return Err(anchor_lang::error!(
8921                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
8922                ));
8923            }
8924            Self::try_deserialize_unchecked(buf)
8925        }
8926        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
8927            let mut data: &[u8] = &buf[8..];
8928            AnchorDeserialize::deserialize(&mut data)
8929                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
8930        }
8931    }
8932    #[repr(C)]
8933    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
8934    pub struct EnableUserHighLeverageMode {
8935        pub state: Pubkey,
8936        pub user: Pubkey,
8937        pub authority: Pubkey,
8938        pub high_leverage_mode_config: Pubkey,
8939    }
8940    #[automatically_derived]
8941    impl anchor_lang::Discriminator for EnableUserHighLeverageMode {
8942        const DISCRIMINATOR: &[u8] = &[87, 74, 202, 252, 83, 254, 102, 158];
8943    }
8944    #[automatically_derived]
8945    unsafe impl anchor_lang::__private::bytemuck::Pod for EnableUserHighLeverageMode {}
8946    #[automatically_derived]
8947    unsafe impl anchor_lang::__private::bytemuck::Zeroable for EnableUserHighLeverageMode {}
8948    #[automatically_derived]
8949    impl anchor_lang::ZeroCopy for EnableUserHighLeverageMode {}
8950    #[automatically_derived]
8951    impl anchor_lang::InstructionData for EnableUserHighLeverageMode {}
8952    #[automatically_derived]
8953    impl ToAccountMetas for EnableUserHighLeverageMode {
8954        fn to_account_metas(&self) -> Vec<AccountMeta> {
8955            vec![
8956                AccountMeta {
8957                    pubkey: self.state,
8958                    is_signer: false,
8959                    is_writable: false,
8960                },
8961                AccountMeta {
8962                    pubkey: self.user,
8963                    is_signer: false,
8964                    is_writable: true,
8965                },
8966                AccountMeta {
8967                    pubkey: self.authority,
8968                    is_signer: true,
8969                    is_writable: false,
8970                },
8971                AccountMeta {
8972                    pubkey: self.high_leverage_mode_config,
8973                    is_signer: false,
8974                    is_writable: true,
8975                },
8976            ]
8977        }
8978    }
8979    #[automatically_derived]
8980    impl anchor_lang::AccountSerialize for EnableUserHighLeverageMode {
8981        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
8982            if writer.write_all(Self::DISCRIMINATOR).is_err() {
8983                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
8984            }
8985            if AnchorSerialize::serialize(self, writer).is_err() {
8986                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
8987            }
8988            Ok(())
8989        }
8990    }
8991    #[automatically_derived]
8992    impl anchor_lang::AccountDeserialize for EnableUserHighLeverageMode {
8993        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
8994            let given_disc = &buf[..8];
8995            if Self::DISCRIMINATOR != given_disc {
8996                return Err(anchor_lang::error!(
8997                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
8998                ));
8999            }
9000            Self::try_deserialize_unchecked(buf)
9001        }
9002        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
9003            let mut data: &[u8] = &buf[8..];
9004            AnchorDeserialize::deserialize(&mut data)
9005                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
9006        }
9007    }
9008    #[repr(C)]
9009    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
9010    pub struct FillPerpOrder {
9011        pub state: Pubkey,
9012        pub authority: Pubkey,
9013        pub filler: Pubkey,
9014        pub filler_stats: Pubkey,
9015        pub user: Pubkey,
9016        pub user_stats: Pubkey,
9017    }
9018    #[automatically_derived]
9019    impl anchor_lang::Discriminator for FillPerpOrder {
9020        const DISCRIMINATOR: &[u8] = &[196, 125, 144, 95, 242, 149, 179, 234];
9021    }
9022    #[automatically_derived]
9023    unsafe impl anchor_lang::__private::bytemuck::Pod for FillPerpOrder {}
9024    #[automatically_derived]
9025    unsafe impl anchor_lang::__private::bytemuck::Zeroable for FillPerpOrder {}
9026    #[automatically_derived]
9027    impl anchor_lang::ZeroCopy for FillPerpOrder {}
9028    #[automatically_derived]
9029    impl anchor_lang::InstructionData for FillPerpOrder {}
9030    #[automatically_derived]
9031    impl ToAccountMetas for FillPerpOrder {
9032        fn to_account_metas(&self) -> Vec<AccountMeta> {
9033            vec![
9034                AccountMeta {
9035                    pubkey: self.state,
9036                    is_signer: false,
9037                    is_writable: false,
9038                },
9039                AccountMeta {
9040                    pubkey: self.authority,
9041                    is_signer: true,
9042                    is_writable: false,
9043                },
9044                AccountMeta {
9045                    pubkey: self.filler,
9046                    is_signer: false,
9047                    is_writable: true,
9048                },
9049                AccountMeta {
9050                    pubkey: self.filler_stats,
9051                    is_signer: false,
9052                    is_writable: true,
9053                },
9054                AccountMeta {
9055                    pubkey: self.user,
9056                    is_signer: false,
9057                    is_writable: true,
9058                },
9059                AccountMeta {
9060                    pubkey: self.user_stats,
9061                    is_signer: false,
9062                    is_writable: true,
9063                },
9064            ]
9065        }
9066    }
9067    #[automatically_derived]
9068    impl anchor_lang::AccountSerialize for FillPerpOrder {
9069        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
9070            if writer.write_all(Self::DISCRIMINATOR).is_err() {
9071                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
9072            }
9073            if AnchorSerialize::serialize(self, writer).is_err() {
9074                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
9075            }
9076            Ok(())
9077        }
9078    }
9079    #[automatically_derived]
9080    impl anchor_lang::AccountDeserialize for FillPerpOrder {
9081        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
9082            let given_disc = &buf[..8];
9083            if Self::DISCRIMINATOR != given_disc {
9084                return Err(anchor_lang::error!(
9085                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
9086                ));
9087            }
9088            Self::try_deserialize_unchecked(buf)
9089        }
9090        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
9091            let mut data: &[u8] = &buf[8..];
9092            AnchorDeserialize::deserialize(&mut data)
9093                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
9094        }
9095    }
9096    #[repr(C)]
9097    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
9098    pub struct RevertFill {
9099        pub state: Pubkey,
9100        pub authority: Pubkey,
9101        pub filler: Pubkey,
9102        pub filler_stats: Pubkey,
9103    }
9104    #[automatically_derived]
9105    impl anchor_lang::Discriminator for RevertFill {
9106        const DISCRIMINATOR: &[u8] = &[119, 31, 174, 155, 246, 22, 28, 126];
9107    }
9108    #[automatically_derived]
9109    unsafe impl anchor_lang::__private::bytemuck::Pod for RevertFill {}
9110    #[automatically_derived]
9111    unsafe impl anchor_lang::__private::bytemuck::Zeroable for RevertFill {}
9112    #[automatically_derived]
9113    impl anchor_lang::ZeroCopy for RevertFill {}
9114    #[automatically_derived]
9115    impl anchor_lang::InstructionData for RevertFill {}
9116    #[automatically_derived]
9117    impl ToAccountMetas for RevertFill {
9118        fn to_account_metas(&self) -> Vec<AccountMeta> {
9119            vec![
9120                AccountMeta {
9121                    pubkey: self.state,
9122                    is_signer: false,
9123                    is_writable: false,
9124                },
9125                AccountMeta {
9126                    pubkey: self.authority,
9127                    is_signer: true,
9128                    is_writable: false,
9129                },
9130                AccountMeta {
9131                    pubkey: self.filler,
9132                    is_signer: false,
9133                    is_writable: true,
9134                },
9135                AccountMeta {
9136                    pubkey: self.filler_stats,
9137                    is_signer: false,
9138                    is_writable: true,
9139                },
9140            ]
9141        }
9142    }
9143    #[automatically_derived]
9144    impl anchor_lang::AccountSerialize for RevertFill {
9145        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
9146            if writer.write_all(Self::DISCRIMINATOR).is_err() {
9147                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
9148            }
9149            if AnchorSerialize::serialize(self, writer).is_err() {
9150                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
9151            }
9152            Ok(())
9153        }
9154    }
9155    #[automatically_derived]
9156    impl anchor_lang::AccountDeserialize for RevertFill {
9157        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
9158            let given_disc = &buf[..8];
9159            if Self::DISCRIMINATOR != given_disc {
9160                return Err(anchor_lang::error!(
9161                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
9162                ));
9163            }
9164            Self::try_deserialize_unchecked(buf)
9165        }
9166        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
9167            let mut data: &[u8] = &buf[8..];
9168            AnchorDeserialize::deserialize(&mut data)
9169                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
9170        }
9171    }
9172    #[repr(C)]
9173    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
9174    pub struct FillSpotOrder {
9175        pub state: Pubkey,
9176        pub authority: Pubkey,
9177        pub filler: Pubkey,
9178        pub filler_stats: Pubkey,
9179        pub user: Pubkey,
9180        pub user_stats: Pubkey,
9181    }
9182    #[automatically_derived]
9183    impl anchor_lang::Discriminator for FillSpotOrder {
9184        const DISCRIMINATOR: &[u8] = &[105, 64, 114, 55, 230, 90, 153, 28];
9185    }
9186    #[automatically_derived]
9187    unsafe impl anchor_lang::__private::bytemuck::Pod for FillSpotOrder {}
9188    #[automatically_derived]
9189    unsafe impl anchor_lang::__private::bytemuck::Zeroable for FillSpotOrder {}
9190    #[automatically_derived]
9191    impl anchor_lang::ZeroCopy for FillSpotOrder {}
9192    #[automatically_derived]
9193    impl anchor_lang::InstructionData for FillSpotOrder {}
9194    #[automatically_derived]
9195    impl ToAccountMetas for FillSpotOrder {
9196        fn to_account_metas(&self) -> Vec<AccountMeta> {
9197            vec![
9198                AccountMeta {
9199                    pubkey: self.state,
9200                    is_signer: false,
9201                    is_writable: false,
9202                },
9203                AccountMeta {
9204                    pubkey: self.authority,
9205                    is_signer: true,
9206                    is_writable: false,
9207                },
9208                AccountMeta {
9209                    pubkey: self.filler,
9210                    is_signer: false,
9211                    is_writable: true,
9212                },
9213                AccountMeta {
9214                    pubkey: self.filler_stats,
9215                    is_signer: false,
9216                    is_writable: true,
9217                },
9218                AccountMeta {
9219                    pubkey: self.user,
9220                    is_signer: false,
9221                    is_writable: true,
9222                },
9223                AccountMeta {
9224                    pubkey: self.user_stats,
9225                    is_signer: false,
9226                    is_writable: true,
9227                },
9228            ]
9229        }
9230    }
9231    #[automatically_derived]
9232    impl anchor_lang::AccountSerialize for FillSpotOrder {
9233        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
9234            if writer.write_all(Self::DISCRIMINATOR).is_err() {
9235                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
9236            }
9237            if AnchorSerialize::serialize(self, writer).is_err() {
9238                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
9239            }
9240            Ok(())
9241        }
9242    }
9243    #[automatically_derived]
9244    impl anchor_lang::AccountDeserialize for FillSpotOrder {
9245        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
9246            let given_disc = &buf[..8];
9247            if Self::DISCRIMINATOR != given_disc {
9248                return Err(anchor_lang::error!(
9249                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
9250                ));
9251            }
9252            Self::try_deserialize_unchecked(buf)
9253        }
9254        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
9255            let mut data: &[u8] = &buf[8..];
9256            AnchorDeserialize::deserialize(&mut data)
9257                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
9258        }
9259    }
9260    #[repr(C)]
9261    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
9262    pub struct TriggerOrder {
9263        pub state: Pubkey,
9264        pub authority: Pubkey,
9265        pub filler: Pubkey,
9266        pub user: Pubkey,
9267    }
9268    #[automatically_derived]
9269    impl anchor_lang::Discriminator for TriggerOrder {
9270        const DISCRIMINATOR: &[u8] = &[236, 61, 42, 190, 152, 12, 106, 116];
9271    }
9272    #[automatically_derived]
9273    unsafe impl anchor_lang::__private::bytemuck::Pod for TriggerOrder {}
9274    #[automatically_derived]
9275    unsafe impl anchor_lang::__private::bytemuck::Zeroable for TriggerOrder {}
9276    #[automatically_derived]
9277    impl anchor_lang::ZeroCopy for TriggerOrder {}
9278    #[automatically_derived]
9279    impl anchor_lang::InstructionData for TriggerOrder {}
9280    #[automatically_derived]
9281    impl ToAccountMetas for TriggerOrder {
9282        fn to_account_metas(&self) -> Vec<AccountMeta> {
9283            vec![
9284                AccountMeta {
9285                    pubkey: self.state,
9286                    is_signer: false,
9287                    is_writable: false,
9288                },
9289                AccountMeta {
9290                    pubkey: self.authority,
9291                    is_signer: true,
9292                    is_writable: false,
9293                },
9294                AccountMeta {
9295                    pubkey: self.filler,
9296                    is_signer: false,
9297                    is_writable: true,
9298                },
9299                AccountMeta {
9300                    pubkey: self.user,
9301                    is_signer: false,
9302                    is_writable: true,
9303                },
9304            ]
9305        }
9306    }
9307    #[automatically_derived]
9308    impl anchor_lang::AccountSerialize for TriggerOrder {
9309        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
9310            if writer.write_all(Self::DISCRIMINATOR).is_err() {
9311                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
9312            }
9313            if AnchorSerialize::serialize(self, writer).is_err() {
9314                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
9315            }
9316            Ok(())
9317        }
9318    }
9319    #[automatically_derived]
9320    impl anchor_lang::AccountDeserialize for TriggerOrder {
9321        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
9322            let given_disc = &buf[..8];
9323            if Self::DISCRIMINATOR != given_disc {
9324                return Err(anchor_lang::error!(
9325                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
9326                ));
9327            }
9328            Self::try_deserialize_unchecked(buf)
9329        }
9330        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
9331            let mut data: &[u8] = &buf[8..];
9332            AnchorDeserialize::deserialize(&mut data)
9333                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
9334        }
9335    }
9336    #[repr(C)]
9337    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
9338    pub struct ForceCancelOrders {
9339        pub state: Pubkey,
9340        pub authority: Pubkey,
9341        pub filler: Pubkey,
9342        pub user: Pubkey,
9343    }
9344    #[automatically_derived]
9345    impl anchor_lang::Discriminator for ForceCancelOrders {
9346        const DISCRIMINATOR: &[u8] = &[108, 153, 180, 51, 37, 158, 99, 93];
9347    }
9348    #[automatically_derived]
9349    unsafe impl anchor_lang::__private::bytemuck::Pod for ForceCancelOrders {}
9350    #[automatically_derived]
9351    unsafe impl anchor_lang::__private::bytemuck::Zeroable for ForceCancelOrders {}
9352    #[automatically_derived]
9353    impl anchor_lang::ZeroCopy for ForceCancelOrders {}
9354    #[automatically_derived]
9355    impl anchor_lang::InstructionData for ForceCancelOrders {}
9356    #[automatically_derived]
9357    impl ToAccountMetas for ForceCancelOrders {
9358        fn to_account_metas(&self) -> Vec<AccountMeta> {
9359            vec![
9360                AccountMeta {
9361                    pubkey: self.state,
9362                    is_signer: false,
9363                    is_writable: false,
9364                },
9365                AccountMeta {
9366                    pubkey: self.authority,
9367                    is_signer: true,
9368                    is_writable: false,
9369                },
9370                AccountMeta {
9371                    pubkey: self.filler,
9372                    is_signer: false,
9373                    is_writable: true,
9374                },
9375                AccountMeta {
9376                    pubkey: self.user,
9377                    is_signer: false,
9378                    is_writable: true,
9379                },
9380            ]
9381        }
9382    }
9383    #[automatically_derived]
9384    impl anchor_lang::AccountSerialize for ForceCancelOrders {
9385        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
9386            if writer.write_all(Self::DISCRIMINATOR).is_err() {
9387                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
9388            }
9389            if AnchorSerialize::serialize(self, writer).is_err() {
9390                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
9391            }
9392            Ok(())
9393        }
9394    }
9395    #[automatically_derived]
9396    impl anchor_lang::AccountDeserialize for ForceCancelOrders {
9397        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
9398            let given_disc = &buf[..8];
9399            if Self::DISCRIMINATOR != given_disc {
9400                return Err(anchor_lang::error!(
9401                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
9402                ));
9403            }
9404            Self::try_deserialize_unchecked(buf)
9405        }
9406        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
9407            let mut data: &[u8] = &buf[8..];
9408            AnchorDeserialize::deserialize(&mut data)
9409                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
9410        }
9411    }
9412    #[repr(C)]
9413    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
9414    pub struct UpdateUserIdle {
9415        pub state: Pubkey,
9416        pub authority: Pubkey,
9417        pub filler: Pubkey,
9418        pub user: Pubkey,
9419    }
9420    #[automatically_derived]
9421    impl anchor_lang::Discriminator for UpdateUserIdle {
9422        const DISCRIMINATOR: &[u8] = &[229, 30, 7, 22, 26, 184, 224, 191];
9423    }
9424    #[automatically_derived]
9425    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdateUserIdle {}
9426    #[automatically_derived]
9427    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdateUserIdle {}
9428    #[automatically_derived]
9429    impl anchor_lang::ZeroCopy for UpdateUserIdle {}
9430    #[automatically_derived]
9431    impl anchor_lang::InstructionData for UpdateUserIdle {}
9432    #[automatically_derived]
9433    impl ToAccountMetas for UpdateUserIdle {
9434        fn to_account_metas(&self) -> Vec<AccountMeta> {
9435            vec![
9436                AccountMeta {
9437                    pubkey: self.state,
9438                    is_signer: false,
9439                    is_writable: false,
9440                },
9441                AccountMeta {
9442                    pubkey: self.authority,
9443                    is_signer: true,
9444                    is_writable: false,
9445                },
9446                AccountMeta {
9447                    pubkey: self.filler,
9448                    is_signer: false,
9449                    is_writable: true,
9450                },
9451                AccountMeta {
9452                    pubkey: self.user,
9453                    is_signer: false,
9454                    is_writable: true,
9455                },
9456            ]
9457        }
9458    }
9459    #[automatically_derived]
9460    impl anchor_lang::AccountSerialize for UpdateUserIdle {
9461        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
9462            if writer.write_all(Self::DISCRIMINATOR).is_err() {
9463                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
9464            }
9465            if AnchorSerialize::serialize(self, writer).is_err() {
9466                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
9467            }
9468            Ok(())
9469        }
9470    }
9471    #[automatically_derived]
9472    impl anchor_lang::AccountDeserialize for UpdateUserIdle {
9473        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
9474            let given_disc = &buf[..8];
9475            if Self::DISCRIMINATOR != given_disc {
9476                return Err(anchor_lang::error!(
9477                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
9478                ));
9479            }
9480            Self::try_deserialize_unchecked(buf)
9481        }
9482        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
9483            let mut data: &[u8] = &buf[8..];
9484            AnchorDeserialize::deserialize(&mut data)
9485                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
9486        }
9487    }
9488    #[repr(C)]
9489    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
9490    pub struct LogUserBalances {
9491        pub state: Pubkey,
9492        pub authority: Pubkey,
9493        pub user: Pubkey,
9494    }
9495    #[automatically_derived]
9496    impl anchor_lang::Discriminator for LogUserBalances {
9497        const DISCRIMINATOR: &[u8] = &[121, 191, 93, 132, 153, 217, 15, 171];
9498    }
9499    #[automatically_derived]
9500    unsafe impl anchor_lang::__private::bytemuck::Pod for LogUserBalances {}
9501    #[automatically_derived]
9502    unsafe impl anchor_lang::__private::bytemuck::Zeroable for LogUserBalances {}
9503    #[automatically_derived]
9504    impl anchor_lang::ZeroCopy for LogUserBalances {}
9505    #[automatically_derived]
9506    impl anchor_lang::InstructionData for LogUserBalances {}
9507    #[automatically_derived]
9508    impl ToAccountMetas for LogUserBalances {
9509        fn to_account_metas(&self) -> Vec<AccountMeta> {
9510            vec![
9511                AccountMeta {
9512                    pubkey: self.state,
9513                    is_signer: false,
9514                    is_writable: false,
9515                },
9516                AccountMeta {
9517                    pubkey: self.authority,
9518                    is_signer: true,
9519                    is_writable: false,
9520                },
9521                AccountMeta {
9522                    pubkey: self.user,
9523                    is_signer: false,
9524                    is_writable: true,
9525                },
9526            ]
9527        }
9528    }
9529    #[automatically_derived]
9530    impl anchor_lang::AccountSerialize for LogUserBalances {
9531        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
9532            if writer.write_all(Self::DISCRIMINATOR).is_err() {
9533                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
9534            }
9535            if AnchorSerialize::serialize(self, writer).is_err() {
9536                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
9537            }
9538            Ok(())
9539        }
9540    }
9541    #[automatically_derived]
9542    impl anchor_lang::AccountDeserialize for LogUserBalances {
9543        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
9544            let given_disc = &buf[..8];
9545            if Self::DISCRIMINATOR != given_disc {
9546                return Err(anchor_lang::error!(
9547                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
9548                ));
9549            }
9550            Self::try_deserialize_unchecked(buf)
9551        }
9552        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
9553            let mut data: &[u8] = &buf[8..];
9554            AnchorDeserialize::deserialize(&mut data)
9555                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
9556        }
9557    }
9558    #[repr(C)]
9559    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
9560    pub struct DisableUserHighLeverageMode {
9561        pub state: Pubkey,
9562        pub authority: Pubkey,
9563        pub user: Pubkey,
9564        pub high_leverage_mode_config: Pubkey,
9565    }
9566    #[automatically_derived]
9567    impl anchor_lang::Discriminator for DisableUserHighLeverageMode {
9568        const DISCRIMINATOR: &[u8] = &[126, 242, 88, 155, 81, 152, 143, 68];
9569    }
9570    #[automatically_derived]
9571    unsafe impl anchor_lang::__private::bytemuck::Pod for DisableUserHighLeverageMode {}
9572    #[automatically_derived]
9573    unsafe impl anchor_lang::__private::bytemuck::Zeroable for DisableUserHighLeverageMode {}
9574    #[automatically_derived]
9575    impl anchor_lang::ZeroCopy for DisableUserHighLeverageMode {}
9576    #[automatically_derived]
9577    impl anchor_lang::InstructionData for DisableUserHighLeverageMode {}
9578    #[automatically_derived]
9579    impl ToAccountMetas for DisableUserHighLeverageMode {
9580        fn to_account_metas(&self) -> Vec<AccountMeta> {
9581            vec![
9582                AccountMeta {
9583                    pubkey: self.state,
9584                    is_signer: false,
9585                    is_writable: false,
9586                },
9587                AccountMeta {
9588                    pubkey: self.authority,
9589                    is_signer: true,
9590                    is_writable: false,
9591                },
9592                AccountMeta {
9593                    pubkey: self.user,
9594                    is_signer: false,
9595                    is_writable: true,
9596                },
9597                AccountMeta {
9598                    pubkey: self.high_leverage_mode_config,
9599                    is_signer: false,
9600                    is_writable: true,
9601                },
9602            ]
9603        }
9604    }
9605    #[automatically_derived]
9606    impl anchor_lang::AccountSerialize for DisableUserHighLeverageMode {
9607        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
9608            if writer.write_all(Self::DISCRIMINATOR).is_err() {
9609                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
9610            }
9611            if AnchorSerialize::serialize(self, writer).is_err() {
9612                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
9613            }
9614            Ok(())
9615        }
9616    }
9617    #[automatically_derived]
9618    impl anchor_lang::AccountDeserialize for DisableUserHighLeverageMode {
9619        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
9620            let given_disc = &buf[..8];
9621            if Self::DISCRIMINATOR != given_disc {
9622                return Err(anchor_lang::error!(
9623                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
9624                ));
9625            }
9626            Self::try_deserialize_unchecked(buf)
9627        }
9628        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
9629            let mut data: &[u8] = &buf[8..];
9630            AnchorDeserialize::deserialize(&mut data)
9631                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
9632        }
9633    }
9634    #[repr(C)]
9635    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
9636    pub struct UpdateUserFuelBonus {
9637        pub state: Pubkey,
9638        pub authority: Pubkey,
9639        pub user: Pubkey,
9640        pub user_stats: Pubkey,
9641    }
9642    #[automatically_derived]
9643    impl anchor_lang::Discriminator for UpdateUserFuelBonus {
9644        const DISCRIMINATOR: &[u8] = &[179, 14, 130, 214, 107, 254, 33, 235];
9645    }
9646    #[automatically_derived]
9647    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdateUserFuelBonus {}
9648    #[automatically_derived]
9649    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdateUserFuelBonus {}
9650    #[automatically_derived]
9651    impl anchor_lang::ZeroCopy for UpdateUserFuelBonus {}
9652    #[automatically_derived]
9653    impl anchor_lang::InstructionData for UpdateUserFuelBonus {}
9654    #[automatically_derived]
9655    impl ToAccountMetas for UpdateUserFuelBonus {
9656        fn to_account_metas(&self) -> Vec<AccountMeta> {
9657            vec![
9658                AccountMeta {
9659                    pubkey: self.state,
9660                    is_signer: false,
9661                    is_writable: false,
9662                },
9663                AccountMeta {
9664                    pubkey: self.authority,
9665                    is_signer: true,
9666                    is_writable: false,
9667                },
9668                AccountMeta {
9669                    pubkey: self.user,
9670                    is_signer: false,
9671                    is_writable: true,
9672                },
9673                AccountMeta {
9674                    pubkey: self.user_stats,
9675                    is_signer: false,
9676                    is_writable: true,
9677                },
9678            ]
9679        }
9680    }
9681    #[automatically_derived]
9682    impl anchor_lang::AccountSerialize for UpdateUserFuelBonus {
9683        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
9684            if writer.write_all(Self::DISCRIMINATOR).is_err() {
9685                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
9686            }
9687            if AnchorSerialize::serialize(self, writer).is_err() {
9688                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
9689            }
9690            Ok(())
9691        }
9692    }
9693    #[automatically_derived]
9694    impl anchor_lang::AccountDeserialize for UpdateUserFuelBonus {
9695        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
9696            let given_disc = &buf[..8];
9697            if Self::DISCRIMINATOR != given_disc {
9698                return Err(anchor_lang::error!(
9699                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
9700                ));
9701            }
9702            Self::try_deserialize_unchecked(buf)
9703        }
9704        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
9705            let mut data: &[u8] = &buf[8..];
9706            AnchorDeserialize::deserialize(&mut data)
9707                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
9708        }
9709    }
9710    #[repr(C)]
9711    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
9712    pub struct UpdateUserStatsReferrerStatus {
9713        pub state: Pubkey,
9714        pub authority: Pubkey,
9715        pub user_stats: Pubkey,
9716    }
9717    #[automatically_derived]
9718    impl anchor_lang::Discriminator for UpdateUserStatsReferrerStatus {
9719        const DISCRIMINATOR: &[u8] = &[88, 125, 77, 90, 13, 11, 141, 158];
9720    }
9721    #[automatically_derived]
9722    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdateUserStatsReferrerStatus {}
9723    #[automatically_derived]
9724    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdateUserStatsReferrerStatus {}
9725    #[automatically_derived]
9726    impl anchor_lang::ZeroCopy for UpdateUserStatsReferrerStatus {}
9727    #[automatically_derived]
9728    impl anchor_lang::InstructionData for UpdateUserStatsReferrerStatus {}
9729    #[automatically_derived]
9730    impl ToAccountMetas for UpdateUserStatsReferrerStatus {
9731        fn to_account_metas(&self) -> Vec<AccountMeta> {
9732            vec![
9733                AccountMeta {
9734                    pubkey: self.state,
9735                    is_signer: false,
9736                    is_writable: false,
9737                },
9738                AccountMeta {
9739                    pubkey: self.authority,
9740                    is_signer: true,
9741                    is_writable: false,
9742                },
9743                AccountMeta {
9744                    pubkey: self.user_stats,
9745                    is_signer: false,
9746                    is_writable: true,
9747                },
9748            ]
9749        }
9750    }
9751    #[automatically_derived]
9752    impl anchor_lang::AccountSerialize for UpdateUserStatsReferrerStatus {
9753        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
9754            if writer.write_all(Self::DISCRIMINATOR).is_err() {
9755                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
9756            }
9757            if AnchorSerialize::serialize(self, writer).is_err() {
9758                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
9759            }
9760            Ok(())
9761        }
9762    }
9763    #[automatically_derived]
9764    impl anchor_lang::AccountDeserialize for UpdateUserStatsReferrerStatus {
9765        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
9766            let given_disc = &buf[..8];
9767            if Self::DISCRIMINATOR != given_disc {
9768                return Err(anchor_lang::error!(
9769                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
9770                ));
9771            }
9772            Self::try_deserialize_unchecked(buf)
9773        }
9774        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
9775            let mut data: &[u8] = &buf[8..];
9776            AnchorDeserialize::deserialize(&mut data)
9777                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
9778        }
9779    }
9780    #[repr(C)]
9781    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
9782    pub struct UpdateUserOpenOrdersCount {
9783        pub state: Pubkey,
9784        pub authority: Pubkey,
9785        pub filler: Pubkey,
9786        pub user: Pubkey,
9787    }
9788    #[automatically_derived]
9789    impl anchor_lang::Discriminator for UpdateUserOpenOrdersCount {
9790        const DISCRIMINATOR: &[u8] = &[21, 201, 16, 50, 34, 238, 126, 254];
9791    }
9792    #[automatically_derived]
9793    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdateUserOpenOrdersCount {}
9794    #[automatically_derived]
9795    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdateUserOpenOrdersCount {}
9796    #[automatically_derived]
9797    impl anchor_lang::ZeroCopy for UpdateUserOpenOrdersCount {}
9798    #[automatically_derived]
9799    impl anchor_lang::InstructionData for UpdateUserOpenOrdersCount {}
9800    #[automatically_derived]
9801    impl ToAccountMetas for UpdateUserOpenOrdersCount {
9802        fn to_account_metas(&self) -> Vec<AccountMeta> {
9803            vec![
9804                AccountMeta {
9805                    pubkey: self.state,
9806                    is_signer: false,
9807                    is_writable: false,
9808                },
9809                AccountMeta {
9810                    pubkey: self.authority,
9811                    is_signer: true,
9812                    is_writable: false,
9813                },
9814                AccountMeta {
9815                    pubkey: self.filler,
9816                    is_signer: false,
9817                    is_writable: true,
9818                },
9819                AccountMeta {
9820                    pubkey: self.user,
9821                    is_signer: false,
9822                    is_writable: true,
9823                },
9824            ]
9825        }
9826    }
9827    #[automatically_derived]
9828    impl anchor_lang::AccountSerialize for UpdateUserOpenOrdersCount {
9829        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
9830            if writer.write_all(Self::DISCRIMINATOR).is_err() {
9831                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
9832            }
9833            if AnchorSerialize::serialize(self, writer).is_err() {
9834                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
9835            }
9836            Ok(())
9837        }
9838    }
9839    #[automatically_derived]
9840    impl anchor_lang::AccountDeserialize for UpdateUserOpenOrdersCount {
9841        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
9842            let given_disc = &buf[..8];
9843            if Self::DISCRIMINATOR != given_disc {
9844                return Err(anchor_lang::error!(
9845                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
9846                ));
9847            }
9848            Self::try_deserialize_unchecked(buf)
9849        }
9850        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
9851            let mut data: &[u8] = &buf[8..];
9852            AnchorDeserialize::deserialize(&mut data)
9853                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
9854        }
9855    }
9856    #[repr(C)]
9857    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
9858    pub struct AdminDisableUpdatePerpBidAskTwap {
9859        pub admin: Pubkey,
9860        pub state: Pubkey,
9861        pub user_stats: Pubkey,
9862    }
9863    #[automatically_derived]
9864    impl anchor_lang::Discriminator for AdminDisableUpdatePerpBidAskTwap {
9865        const DISCRIMINATOR: &[u8] = &[253, 223, 202, 93, 246, 209, 209, 26];
9866    }
9867    #[automatically_derived]
9868    unsafe impl anchor_lang::__private::bytemuck::Pod for AdminDisableUpdatePerpBidAskTwap {}
9869    #[automatically_derived]
9870    unsafe impl anchor_lang::__private::bytemuck::Zeroable for AdminDisableUpdatePerpBidAskTwap {}
9871    #[automatically_derived]
9872    impl anchor_lang::ZeroCopy for AdminDisableUpdatePerpBidAskTwap {}
9873    #[automatically_derived]
9874    impl anchor_lang::InstructionData for AdminDisableUpdatePerpBidAskTwap {}
9875    #[automatically_derived]
9876    impl ToAccountMetas for AdminDisableUpdatePerpBidAskTwap {
9877        fn to_account_metas(&self) -> Vec<AccountMeta> {
9878            vec![
9879                AccountMeta {
9880                    pubkey: self.admin,
9881                    is_signer: true,
9882                    is_writable: false,
9883                },
9884                AccountMeta {
9885                    pubkey: self.state,
9886                    is_signer: false,
9887                    is_writable: false,
9888                },
9889                AccountMeta {
9890                    pubkey: self.user_stats,
9891                    is_signer: false,
9892                    is_writable: true,
9893                },
9894            ]
9895        }
9896    }
9897    #[automatically_derived]
9898    impl anchor_lang::AccountSerialize for AdminDisableUpdatePerpBidAskTwap {
9899        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
9900            if writer.write_all(Self::DISCRIMINATOR).is_err() {
9901                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
9902            }
9903            if AnchorSerialize::serialize(self, writer).is_err() {
9904                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
9905            }
9906            Ok(())
9907        }
9908    }
9909    #[automatically_derived]
9910    impl anchor_lang::AccountDeserialize for AdminDisableUpdatePerpBidAskTwap {
9911        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
9912            let given_disc = &buf[..8];
9913            if Self::DISCRIMINATOR != given_disc {
9914                return Err(anchor_lang::error!(
9915                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
9916                ));
9917            }
9918            Self::try_deserialize_unchecked(buf)
9919        }
9920        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
9921            let mut data: &[u8] = &buf[8..];
9922            AnchorDeserialize::deserialize(&mut data)
9923                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
9924        }
9925    }
9926    #[repr(C)]
9927    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
9928    pub struct SettlePnl {
9929        pub state: Pubkey,
9930        pub user: Pubkey,
9931        pub authority: Pubkey,
9932        pub spot_market_vault: Pubkey,
9933    }
9934    #[automatically_derived]
9935    impl anchor_lang::Discriminator for SettlePnl {
9936        const DISCRIMINATOR: &[u8] = &[216, 232, 154, 114, 103, 217, 85, 46];
9937    }
9938    #[automatically_derived]
9939    unsafe impl anchor_lang::__private::bytemuck::Pod for SettlePnl {}
9940    #[automatically_derived]
9941    unsafe impl anchor_lang::__private::bytemuck::Zeroable for SettlePnl {}
9942    #[automatically_derived]
9943    impl anchor_lang::ZeroCopy for SettlePnl {}
9944    #[automatically_derived]
9945    impl anchor_lang::InstructionData for SettlePnl {}
9946    #[automatically_derived]
9947    impl ToAccountMetas for SettlePnl {
9948        fn to_account_metas(&self) -> Vec<AccountMeta> {
9949            vec![
9950                AccountMeta {
9951                    pubkey: self.state,
9952                    is_signer: false,
9953                    is_writable: false,
9954                },
9955                AccountMeta {
9956                    pubkey: self.user,
9957                    is_signer: false,
9958                    is_writable: true,
9959                },
9960                AccountMeta {
9961                    pubkey: self.authority,
9962                    is_signer: true,
9963                    is_writable: false,
9964                },
9965                AccountMeta {
9966                    pubkey: self.spot_market_vault,
9967                    is_signer: false,
9968                    is_writable: false,
9969                },
9970            ]
9971        }
9972    }
9973    #[automatically_derived]
9974    impl anchor_lang::AccountSerialize for SettlePnl {
9975        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
9976            if writer.write_all(Self::DISCRIMINATOR).is_err() {
9977                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
9978            }
9979            if AnchorSerialize::serialize(self, writer).is_err() {
9980                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
9981            }
9982            Ok(())
9983        }
9984    }
9985    #[automatically_derived]
9986    impl anchor_lang::AccountDeserialize for SettlePnl {
9987        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
9988            let given_disc = &buf[..8];
9989            if Self::DISCRIMINATOR != given_disc {
9990                return Err(anchor_lang::error!(
9991                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
9992                ));
9993            }
9994            Self::try_deserialize_unchecked(buf)
9995        }
9996        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
9997            let mut data: &[u8] = &buf[8..];
9998            AnchorDeserialize::deserialize(&mut data)
9999                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
10000        }
10001    }
10002    #[repr(C)]
10003    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
10004    pub struct SettleMultiplePnls {
10005        pub state: Pubkey,
10006        pub user: Pubkey,
10007        pub authority: Pubkey,
10008        pub spot_market_vault: Pubkey,
10009    }
10010    #[automatically_derived]
10011    impl anchor_lang::Discriminator for SettleMultiplePnls {
10012        const DISCRIMINATOR: &[u8] = &[6, 98, 112, 180, 76, 44, 249, 23];
10013    }
10014    #[automatically_derived]
10015    unsafe impl anchor_lang::__private::bytemuck::Pod for SettleMultiplePnls {}
10016    #[automatically_derived]
10017    unsafe impl anchor_lang::__private::bytemuck::Zeroable for SettleMultiplePnls {}
10018    #[automatically_derived]
10019    impl anchor_lang::ZeroCopy for SettleMultiplePnls {}
10020    #[automatically_derived]
10021    impl anchor_lang::InstructionData for SettleMultiplePnls {}
10022    #[automatically_derived]
10023    impl ToAccountMetas for SettleMultiplePnls {
10024        fn to_account_metas(&self) -> Vec<AccountMeta> {
10025            vec![
10026                AccountMeta {
10027                    pubkey: self.state,
10028                    is_signer: false,
10029                    is_writable: false,
10030                },
10031                AccountMeta {
10032                    pubkey: self.user,
10033                    is_signer: false,
10034                    is_writable: true,
10035                },
10036                AccountMeta {
10037                    pubkey: self.authority,
10038                    is_signer: true,
10039                    is_writable: false,
10040                },
10041                AccountMeta {
10042                    pubkey: self.spot_market_vault,
10043                    is_signer: false,
10044                    is_writable: false,
10045                },
10046            ]
10047        }
10048    }
10049    #[automatically_derived]
10050    impl anchor_lang::AccountSerialize for SettleMultiplePnls {
10051        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
10052            if writer.write_all(Self::DISCRIMINATOR).is_err() {
10053                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
10054            }
10055            if AnchorSerialize::serialize(self, writer).is_err() {
10056                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
10057            }
10058            Ok(())
10059        }
10060    }
10061    #[automatically_derived]
10062    impl anchor_lang::AccountDeserialize for SettleMultiplePnls {
10063        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
10064            let given_disc = &buf[..8];
10065            if Self::DISCRIMINATOR != given_disc {
10066                return Err(anchor_lang::error!(
10067                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
10068                ));
10069            }
10070            Self::try_deserialize_unchecked(buf)
10071        }
10072        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
10073            let mut data: &[u8] = &buf[8..];
10074            AnchorDeserialize::deserialize(&mut data)
10075                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
10076        }
10077    }
10078    #[repr(C)]
10079    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
10080    pub struct SettleFundingPayment {
10081        pub state: Pubkey,
10082        pub user: Pubkey,
10083    }
10084    #[automatically_derived]
10085    impl anchor_lang::Discriminator for SettleFundingPayment {
10086        const DISCRIMINATOR: &[u8] = &[138, 197, 211, 110, 76, 124, 91, 34];
10087    }
10088    #[automatically_derived]
10089    unsafe impl anchor_lang::__private::bytemuck::Pod for SettleFundingPayment {}
10090    #[automatically_derived]
10091    unsafe impl anchor_lang::__private::bytemuck::Zeroable for SettleFundingPayment {}
10092    #[automatically_derived]
10093    impl anchor_lang::ZeroCopy for SettleFundingPayment {}
10094    #[automatically_derived]
10095    impl anchor_lang::InstructionData for SettleFundingPayment {}
10096    #[automatically_derived]
10097    impl ToAccountMetas for SettleFundingPayment {
10098        fn to_account_metas(&self) -> Vec<AccountMeta> {
10099            vec![
10100                AccountMeta {
10101                    pubkey: self.state,
10102                    is_signer: false,
10103                    is_writable: false,
10104                },
10105                AccountMeta {
10106                    pubkey: self.user,
10107                    is_signer: false,
10108                    is_writable: true,
10109                },
10110            ]
10111        }
10112    }
10113    #[automatically_derived]
10114    impl anchor_lang::AccountSerialize for SettleFundingPayment {
10115        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
10116            if writer.write_all(Self::DISCRIMINATOR).is_err() {
10117                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
10118            }
10119            if AnchorSerialize::serialize(self, writer).is_err() {
10120                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
10121            }
10122            Ok(())
10123        }
10124    }
10125    #[automatically_derived]
10126    impl anchor_lang::AccountDeserialize for SettleFundingPayment {
10127        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
10128            let given_disc = &buf[..8];
10129            if Self::DISCRIMINATOR != given_disc {
10130                return Err(anchor_lang::error!(
10131                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
10132                ));
10133            }
10134            Self::try_deserialize_unchecked(buf)
10135        }
10136        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
10137            let mut data: &[u8] = &buf[8..];
10138            AnchorDeserialize::deserialize(&mut data)
10139                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
10140        }
10141    }
10142    #[repr(C)]
10143    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
10144    pub struct SettleLp {
10145        pub state: Pubkey,
10146        pub user: Pubkey,
10147    }
10148    #[automatically_derived]
10149    impl anchor_lang::Discriminator for SettleLp {
10150        const DISCRIMINATOR: &[u8] = &[204, 189, 123, 14, 253, 251, 199, 239];
10151    }
10152    #[automatically_derived]
10153    unsafe impl anchor_lang::__private::bytemuck::Pod for SettleLp {}
10154    #[automatically_derived]
10155    unsafe impl anchor_lang::__private::bytemuck::Zeroable for SettleLp {}
10156    #[automatically_derived]
10157    impl anchor_lang::ZeroCopy for SettleLp {}
10158    #[automatically_derived]
10159    impl anchor_lang::InstructionData for SettleLp {}
10160    #[automatically_derived]
10161    impl ToAccountMetas for SettleLp {
10162        fn to_account_metas(&self) -> Vec<AccountMeta> {
10163            vec![
10164                AccountMeta {
10165                    pubkey: self.state,
10166                    is_signer: false,
10167                    is_writable: false,
10168                },
10169                AccountMeta {
10170                    pubkey: self.user,
10171                    is_signer: false,
10172                    is_writable: true,
10173                },
10174            ]
10175        }
10176    }
10177    #[automatically_derived]
10178    impl anchor_lang::AccountSerialize for SettleLp {
10179        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
10180            if writer.write_all(Self::DISCRIMINATOR).is_err() {
10181                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
10182            }
10183            if AnchorSerialize::serialize(self, writer).is_err() {
10184                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
10185            }
10186            Ok(())
10187        }
10188    }
10189    #[automatically_derived]
10190    impl anchor_lang::AccountDeserialize for SettleLp {
10191        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
10192            let given_disc = &buf[..8];
10193            if Self::DISCRIMINATOR != given_disc {
10194                return Err(anchor_lang::error!(
10195                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
10196                ));
10197            }
10198            Self::try_deserialize_unchecked(buf)
10199        }
10200        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
10201            let mut data: &[u8] = &buf[8..];
10202            AnchorDeserialize::deserialize(&mut data)
10203                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
10204        }
10205    }
10206    #[repr(C)]
10207    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
10208    pub struct SettleExpiredMarket {
10209        pub admin: Pubkey,
10210        pub state: Pubkey,
10211        pub perp_market: Pubkey,
10212    }
10213    #[automatically_derived]
10214    impl anchor_lang::Discriminator for SettleExpiredMarket {
10215        const DISCRIMINATOR: &[u8] = &[208, 148, 90, 99, 162, 85, 158, 236];
10216    }
10217    #[automatically_derived]
10218    unsafe impl anchor_lang::__private::bytemuck::Pod for SettleExpiredMarket {}
10219    #[automatically_derived]
10220    unsafe impl anchor_lang::__private::bytemuck::Zeroable for SettleExpiredMarket {}
10221    #[automatically_derived]
10222    impl anchor_lang::ZeroCopy for SettleExpiredMarket {}
10223    #[automatically_derived]
10224    impl anchor_lang::InstructionData for SettleExpiredMarket {}
10225    #[automatically_derived]
10226    impl ToAccountMetas for SettleExpiredMarket {
10227        fn to_account_metas(&self) -> Vec<AccountMeta> {
10228            vec![
10229                AccountMeta {
10230                    pubkey: self.admin,
10231                    is_signer: true,
10232                    is_writable: false,
10233                },
10234                AccountMeta {
10235                    pubkey: self.state,
10236                    is_signer: false,
10237                    is_writable: false,
10238                },
10239                AccountMeta {
10240                    pubkey: self.perp_market,
10241                    is_signer: false,
10242                    is_writable: true,
10243                },
10244            ]
10245        }
10246    }
10247    #[automatically_derived]
10248    impl anchor_lang::AccountSerialize for SettleExpiredMarket {
10249        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
10250            if writer.write_all(Self::DISCRIMINATOR).is_err() {
10251                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
10252            }
10253            if AnchorSerialize::serialize(self, writer).is_err() {
10254                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
10255            }
10256            Ok(())
10257        }
10258    }
10259    #[automatically_derived]
10260    impl anchor_lang::AccountDeserialize for SettleExpiredMarket {
10261        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
10262            let given_disc = &buf[..8];
10263            if Self::DISCRIMINATOR != given_disc {
10264                return Err(anchor_lang::error!(
10265                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
10266                ));
10267            }
10268            Self::try_deserialize_unchecked(buf)
10269        }
10270        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
10271            let mut data: &[u8] = &buf[8..];
10272            AnchorDeserialize::deserialize(&mut data)
10273                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
10274        }
10275    }
10276    #[repr(C)]
10277    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
10278    pub struct LiquidatePerp {
10279        pub state: Pubkey,
10280        pub authority: Pubkey,
10281        pub liquidator: Pubkey,
10282        pub liquidator_stats: Pubkey,
10283        pub user: Pubkey,
10284        pub user_stats: Pubkey,
10285    }
10286    #[automatically_derived]
10287    impl anchor_lang::Discriminator for LiquidatePerp {
10288        const DISCRIMINATOR: &[u8] = &[167, 66, 155, 127, 112, 246, 147, 196];
10289    }
10290    #[automatically_derived]
10291    unsafe impl anchor_lang::__private::bytemuck::Pod for LiquidatePerp {}
10292    #[automatically_derived]
10293    unsafe impl anchor_lang::__private::bytemuck::Zeroable for LiquidatePerp {}
10294    #[automatically_derived]
10295    impl anchor_lang::ZeroCopy for LiquidatePerp {}
10296    #[automatically_derived]
10297    impl anchor_lang::InstructionData for LiquidatePerp {}
10298    #[automatically_derived]
10299    impl ToAccountMetas for LiquidatePerp {
10300        fn to_account_metas(&self) -> Vec<AccountMeta> {
10301            vec![
10302                AccountMeta {
10303                    pubkey: self.state,
10304                    is_signer: false,
10305                    is_writable: false,
10306                },
10307                AccountMeta {
10308                    pubkey: self.authority,
10309                    is_signer: true,
10310                    is_writable: false,
10311                },
10312                AccountMeta {
10313                    pubkey: self.liquidator,
10314                    is_signer: false,
10315                    is_writable: true,
10316                },
10317                AccountMeta {
10318                    pubkey: self.liquidator_stats,
10319                    is_signer: false,
10320                    is_writable: true,
10321                },
10322                AccountMeta {
10323                    pubkey: self.user,
10324                    is_signer: false,
10325                    is_writable: true,
10326                },
10327                AccountMeta {
10328                    pubkey: self.user_stats,
10329                    is_signer: false,
10330                    is_writable: true,
10331                },
10332            ]
10333        }
10334    }
10335    #[automatically_derived]
10336    impl anchor_lang::AccountSerialize for LiquidatePerp {
10337        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
10338            if writer.write_all(Self::DISCRIMINATOR).is_err() {
10339                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
10340            }
10341            if AnchorSerialize::serialize(self, writer).is_err() {
10342                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
10343            }
10344            Ok(())
10345        }
10346    }
10347    #[automatically_derived]
10348    impl anchor_lang::AccountDeserialize for LiquidatePerp {
10349        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
10350            let given_disc = &buf[..8];
10351            if Self::DISCRIMINATOR != given_disc {
10352                return Err(anchor_lang::error!(
10353                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
10354                ));
10355            }
10356            Self::try_deserialize_unchecked(buf)
10357        }
10358        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
10359            let mut data: &[u8] = &buf[8..];
10360            AnchorDeserialize::deserialize(&mut data)
10361                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
10362        }
10363    }
10364    #[repr(C)]
10365    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
10366    pub struct LiquidatePerpWithFill {
10367        pub state: Pubkey,
10368        pub authority: Pubkey,
10369        pub liquidator: Pubkey,
10370        pub liquidator_stats: Pubkey,
10371        pub user: Pubkey,
10372        pub user_stats: Pubkey,
10373    }
10374    #[automatically_derived]
10375    impl anchor_lang::Discriminator for LiquidatePerpWithFill {
10376        const DISCRIMINATOR: &[u8] = &[236, 199, 136, 156, 22, 138, 41, 225];
10377    }
10378    #[automatically_derived]
10379    unsafe impl anchor_lang::__private::bytemuck::Pod for LiquidatePerpWithFill {}
10380    #[automatically_derived]
10381    unsafe impl anchor_lang::__private::bytemuck::Zeroable for LiquidatePerpWithFill {}
10382    #[automatically_derived]
10383    impl anchor_lang::ZeroCopy for LiquidatePerpWithFill {}
10384    #[automatically_derived]
10385    impl anchor_lang::InstructionData for LiquidatePerpWithFill {}
10386    #[automatically_derived]
10387    impl ToAccountMetas for LiquidatePerpWithFill {
10388        fn to_account_metas(&self) -> Vec<AccountMeta> {
10389            vec![
10390                AccountMeta {
10391                    pubkey: self.state,
10392                    is_signer: false,
10393                    is_writable: false,
10394                },
10395                AccountMeta {
10396                    pubkey: self.authority,
10397                    is_signer: true,
10398                    is_writable: false,
10399                },
10400                AccountMeta {
10401                    pubkey: self.liquidator,
10402                    is_signer: false,
10403                    is_writable: true,
10404                },
10405                AccountMeta {
10406                    pubkey: self.liquidator_stats,
10407                    is_signer: false,
10408                    is_writable: true,
10409                },
10410                AccountMeta {
10411                    pubkey: self.user,
10412                    is_signer: false,
10413                    is_writable: true,
10414                },
10415                AccountMeta {
10416                    pubkey: self.user_stats,
10417                    is_signer: false,
10418                    is_writable: true,
10419                },
10420            ]
10421        }
10422    }
10423    #[automatically_derived]
10424    impl anchor_lang::AccountSerialize for LiquidatePerpWithFill {
10425        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
10426            if writer.write_all(Self::DISCRIMINATOR).is_err() {
10427                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
10428            }
10429            if AnchorSerialize::serialize(self, writer).is_err() {
10430                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
10431            }
10432            Ok(())
10433        }
10434    }
10435    #[automatically_derived]
10436    impl anchor_lang::AccountDeserialize for LiquidatePerpWithFill {
10437        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
10438            let given_disc = &buf[..8];
10439            if Self::DISCRIMINATOR != given_disc {
10440                return Err(anchor_lang::error!(
10441                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
10442                ));
10443            }
10444            Self::try_deserialize_unchecked(buf)
10445        }
10446        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
10447            let mut data: &[u8] = &buf[8..];
10448            AnchorDeserialize::deserialize(&mut data)
10449                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
10450        }
10451    }
10452    #[repr(C)]
10453    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
10454    pub struct LiquidateSpot {
10455        pub state: Pubkey,
10456        pub authority: Pubkey,
10457        pub liquidator: Pubkey,
10458        pub liquidator_stats: Pubkey,
10459        pub user: Pubkey,
10460        pub user_stats: Pubkey,
10461    }
10462    #[automatically_derived]
10463    impl anchor_lang::Discriminator for LiquidateSpot {
10464        const DISCRIMINATOR: &[u8] = &[89, 79, 84, 154, 215, 7, 211, 253];
10465    }
10466    #[automatically_derived]
10467    unsafe impl anchor_lang::__private::bytemuck::Pod for LiquidateSpot {}
10468    #[automatically_derived]
10469    unsafe impl anchor_lang::__private::bytemuck::Zeroable for LiquidateSpot {}
10470    #[automatically_derived]
10471    impl anchor_lang::ZeroCopy for LiquidateSpot {}
10472    #[automatically_derived]
10473    impl anchor_lang::InstructionData for LiquidateSpot {}
10474    #[automatically_derived]
10475    impl ToAccountMetas for LiquidateSpot {
10476        fn to_account_metas(&self) -> Vec<AccountMeta> {
10477            vec![
10478                AccountMeta {
10479                    pubkey: self.state,
10480                    is_signer: false,
10481                    is_writable: false,
10482                },
10483                AccountMeta {
10484                    pubkey: self.authority,
10485                    is_signer: true,
10486                    is_writable: false,
10487                },
10488                AccountMeta {
10489                    pubkey: self.liquidator,
10490                    is_signer: false,
10491                    is_writable: true,
10492                },
10493                AccountMeta {
10494                    pubkey: self.liquidator_stats,
10495                    is_signer: false,
10496                    is_writable: true,
10497                },
10498                AccountMeta {
10499                    pubkey: self.user,
10500                    is_signer: false,
10501                    is_writable: true,
10502                },
10503                AccountMeta {
10504                    pubkey: self.user_stats,
10505                    is_signer: false,
10506                    is_writable: true,
10507                },
10508            ]
10509        }
10510    }
10511    #[automatically_derived]
10512    impl anchor_lang::AccountSerialize for LiquidateSpot {
10513        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
10514            if writer.write_all(Self::DISCRIMINATOR).is_err() {
10515                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
10516            }
10517            if AnchorSerialize::serialize(self, writer).is_err() {
10518                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
10519            }
10520            Ok(())
10521        }
10522    }
10523    #[automatically_derived]
10524    impl anchor_lang::AccountDeserialize for LiquidateSpot {
10525        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
10526            let given_disc = &buf[..8];
10527            if Self::DISCRIMINATOR != given_disc {
10528                return Err(anchor_lang::error!(
10529                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
10530                ));
10531            }
10532            Self::try_deserialize_unchecked(buf)
10533        }
10534        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
10535            let mut data: &[u8] = &buf[8..];
10536            AnchorDeserialize::deserialize(&mut data)
10537                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
10538        }
10539    }
10540    #[repr(C)]
10541    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
10542    pub struct LiquidateSpotWithSwapBegin {
10543        pub state: Pubkey,
10544        pub authority: Pubkey,
10545        pub liquidator: Pubkey,
10546        pub liquidator_stats: Pubkey,
10547        pub user: Pubkey,
10548        pub user_stats: Pubkey,
10549        pub liability_spot_market_vault: Pubkey,
10550        pub asset_spot_market_vault: Pubkey,
10551        pub liability_token_account: Pubkey,
10552        pub asset_token_account: Pubkey,
10553        pub token_program: Pubkey,
10554        pub drift_signer: Pubkey,
10555        pub instructions: Pubkey,
10556    }
10557    #[automatically_derived]
10558    impl anchor_lang::Discriminator for LiquidateSpotWithSwapBegin {
10559        const DISCRIMINATOR: &[u8] = &[58, 245, 239, 110, 253, 194, 212, 67];
10560    }
10561    #[automatically_derived]
10562    unsafe impl anchor_lang::__private::bytemuck::Pod for LiquidateSpotWithSwapBegin {}
10563    #[automatically_derived]
10564    unsafe impl anchor_lang::__private::bytemuck::Zeroable for LiquidateSpotWithSwapBegin {}
10565    #[automatically_derived]
10566    impl anchor_lang::ZeroCopy for LiquidateSpotWithSwapBegin {}
10567    #[automatically_derived]
10568    impl anchor_lang::InstructionData for LiquidateSpotWithSwapBegin {}
10569    #[automatically_derived]
10570    impl ToAccountMetas for LiquidateSpotWithSwapBegin {
10571        fn to_account_metas(&self) -> Vec<AccountMeta> {
10572            vec![
10573                AccountMeta {
10574                    pubkey: self.state,
10575                    is_signer: false,
10576                    is_writable: false,
10577                },
10578                AccountMeta {
10579                    pubkey: self.authority,
10580                    is_signer: true,
10581                    is_writable: false,
10582                },
10583                AccountMeta {
10584                    pubkey: self.liquidator,
10585                    is_signer: false,
10586                    is_writable: true,
10587                },
10588                AccountMeta {
10589                    pubkey: self.liquidator_stats,
10590                    is_signer: false,
10591                    is_writable: true,
10592                },
10593                AccountMeta {
10594                    pubkey: self.user,
10595                    is_signer: false,
10596                    is_writable: true,
10597                },
10598                AccountMeta {
10599                    pubkey: self.user_stats,
10600                    is_signer: false,
10601                    is_writable: true,
10602                },
10603                AccountMeta {
10604                    pubkey: self.liability_spot_market_vault,
10605                    is_signer: false,
10606                    is_writable: true,
10607                },
10608                AccountMeta {
10609                    pubkey: self.asset_spot_market_vault,
10610                    is_signer: false,
10611                    is_writable: true,
10612                },
10613                AccountMeta {
10614                    pubkey: self.liability_token_account,
10615                    is_signer: false,
10616                    is_writable: true,
10617                },
10618                AccountMeta {
10619                    pubkey: self.asset_token_account,
10620                    is_signer: false,
10621                    is_writable: true,
10622                },
10623                AccountMeta {
10624                    pubkey: self.token_program,
10625                    is_signer: false,
10626                    is_writable: false,
10627                },
10628                AccountMeta {
10629                    pubkey: self.drift_signer,
10630                    is_signer: false,
10631                    is_writable: false,
10632                },
10633                AccountMeta {
10634                    pubkey: self.instructions,
10635                    is_signer: false,
10636                    is_writable: false,
10637                },
10638            ]
10639        }
10640    }
10641    #[automatically_derived]
10642    impl anchor_lang::AccountSerialize for LiquidateSpotWithSwapBegin {
10643        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
10644            if writer.write_all(Self::DISCRIMINATOR).is_err() {
10645                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
10646            }
10647            if AnchorSerialize::serialize(self, writer).is_err() {
10648                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
10649            }
10650            Ok(())
10651        }
10652    }
10653    #[automatically_derived]
10654    impl anchor_lang::AccountDeserialize for LiquidateSpotWithSwapBegin {
10655        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
10656            let given_disc = &buf[..8];
10657            if Self::DISCRIMINATOR != given_disc {
10658                return Err(anchor_lang::error!(
10659                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
10660                ));
10661            }
10662            Self::try_deserialize_unchecked(buf)
10663        }
10664        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
10665            let mut data: &[u8] = &buf[8..];
10666            AnchorDeserialize::deserialize(&mut data)
10667                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
10668        }
10669    }
10670    #[repr(C)]
10671    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
10672    pub struct LiquidateSpotWithSwapEnd {
10673        pub state: Pubkey,
10674        pub authority: Pubkey,
10675        pub liquidator: Pubkey,
10676        pub liquidator_stats: Pubkey,
10677        pub user: Pubkey,
10678        pub user_stats: Pubkey,
10679        pub liability_spot_market_vault: Pubkey,
10680        pub asset_spot_market_vault: Pubkey,
10681        pub liability_token_account: Pubkey,
10682        pub asset_token_account: Pubkey,
10683        pub token_program: Pubkey,
10684        pub drift_signer: Pubkey,
10685        pub instructions: Pubkey,
10686    }
10687    #[automatically_derived]
10688    impl anchor_lang::Discriminator for LiquidateSpotWithSwapEnd {
10689        const DISCRIMINATOR: &[u8] = &[157, 1, 82, 217, 233, 241, 137, 175];
10690    }
10691    #[automatically_derived]
10692    unsafe impl anchor_lang::__private::bytemuck::Pod for LiquidateSpotWithSwapEnd {}
10693    #[automatically_derived]
10694    unsafe impl anchor_lang::__private::bytemuck::Zeroable for LiquidateSpotWithSwapEnd {}
10695    #[automatically_derived]
10696    impl anchor_lang::ZeroCopy for LiquidateSpotWithSwapEnd {}
10697    #[automatically_derived]
10698    impl anchor_lang::InstructionData for LiquidateSpotWithSwapEnd {}
10699    #[automatically_derived]
10700    impl ToAccountMetas for LiquidateSpotWithSwapEnd {
10701        fn to_account_metas(&self) -> Vec<AccountMeta> {
10702            vec![
10703                AccountMeta {
10704                    pubkey: self.state,
10705                    is_signer: false,
10706                    is_writable: false,
10707                },
10708                AccountMeta {
10709                    pubkey: self.authority,
10710                    is_signer: true,
10711                    is_writable: false,
10712                },
10713                AccountMeta {
10714                    pubkey: self.liquidator,
10715                    is_signer: false,
10716                    is_writable: true,
10717                },
10718                AccountMeta {
10719                    pubkey: self.liquidator_stats,
10720                    is_signer: false,
10721                    is_writable: true,
10722                },
10723                AccountMeta {
10724                    pubkey: self.user,
10725                    is_signer: false,
10726                    is_writable: true,
10727                },
10728                AccountMeta {
10729                    pubkey: self.user_stats,
10730                    is_signer: false,
10731                    is_writable: true,
10732                },
10733                AccountMeta {
10734                    pubkey: self.liability_spot_market_vault,
10735                    is_signer: false,
10736                    is_writable: true,
10737                },
10738                AccountMeta {
10739                    pubkey: self.asset_spot_market_vault,
10740                    is_signer: false,
10741                    is_writable: true,
10742                },
10743                AccountMeta {
10744                    pubkey: self.liability_token_account,
10745                    is_signer: false,
10746                    is_writable: true,
10747                },
10748                AccountMeta {
10749                    pubkey: self.asset_token_account,
10750                    is_signer: false,
10751                    is_writable: true,
10752                },
10753                AccountMeta {
10754                    pubkey: self.token_program,
10755                    is_signer: false,
10756                    is_writable: false,
10757                },
10758                AccountMeta {
10759                    pubkey: self.drift_signer,
10760                    is_signer: false,
10761                    is_writable: false,
10762                },
10763                AccountMeta {
10764                    pubkey: self.instructions,
10765                    is_signer: false,
10766                    is_writable: false,
10767                },
10768            ]
10769        }
10770    }
10771    #[automatically_derived]
10772    impl anchor_lang::AccountSerialize for LiquidateSpotWithSwapEnd {
10773        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
10774            if writer.write_all(Self::DISCRIMINATOR).is_err() {
10775                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
10776            }
10777            if AnchorSerialize::serialize(self, writer).is_err() {
10778                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
10779            }
10780            Ok(())
10781        }
10782    }
10783    #[automatically_derived]
10784    impl anchor_lang::AccountDeserialize for LiquidateSpotWithSwapEnd {
10785        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
10786            let given_disc = &buf[..8];
10787            if Self::DISCRIMINATOR != given_disc {
10788                return Err(anchor_lang::error!(
10789                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
10790                ));
10791            }
10792            Self::try_deserialize_unchecked(buf)
10793        }
10794        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
10795            let mut data: &[u8] = &buf[8..];
10796            AnchorDeserialize::deserialize(&mut data)
10797                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
10798        }
10799    }
10800    #[repr(C)]
10801    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
10802    pub struct LiquidateBorrowForPerpPnl {
10803        pub state: Pubkey,
10804        pub authority: Pubkey,
10805        pub liquidator: Pubkey,
10806        pub liquidator_stats: Pubkey,
10807        pub user: Pubkey,
10808        pub user_stats: Pubkey,
10809    }
10810    #[automatically_derived]
10811    impl anchor_lang::Discriminator for LiquidateBorrowForPerpPnl {
10812        const DISCRIMINATOR: &[u8] = &[188, 143, 170, 71, 28, 50, 50, 50];
10813    }
10814    #[automatically_derived]
10815    unsafe impl anchor_lang::__private::bytemuck::Pod for LiquidateBorrowForPerpPnl {}
10816    #[automatically_derived]
10817    unsafe impl anchor_lang::__private::bytemuck::Zeroable for LiquidateBorrowForPerpPnl {}
10818    #[automatically_derived]
10819    impl anchor_lang::ZeroCopy for LiquidateBorrowForPerpPnl {}
10820    #[automatically_derived]
10821    impl anchor_lang::InstructionData for LiquidateBorrowForPerpPnl {}
10822    #[automatically_derived]
10823    impl ToAccountMetas for LiquidateBorrowForPerpPnl {
10824        fn to_account_metas(&self) -> Vec<AccountMeta> {
10825            vec![
10826                AccountMeta {
10827                    pubkey: self.state,
10828                    is_signer: false,
10829                    is_writable: false,
10830                },
10831                AccountMeta {
10832                    pubkey: self.authority,
10833                    is_signer: true,
10834                    is_writable: false,
10835                },
10836                AccountMeta {
10837                    pubkey: self.liquidator,
10838                    is_signer: false,
10839                    is_writable: true,
10840                },
10841                AccountMeta {
10842                    pubkey: self.liquidator_stats,
10843                    is_signer: false,
10844                    is_writable: true,
10845                },
10846                AccountMeta {
10847                    pubkey: self.user,
10848                    is_signer: false,
10849                    is_writable: true,
10850                },
10851                AccountMeta {
10852                    pubkey: self.user_stats,
10853                    is_signer: false,
10854                    is_writable: true,
10855                },
10856            ]
10857        }
10858    }
10859    #[automatically_derived]
10860    impl anchor_lang::AccountSerialize for LiquidateBorrowForPerpPnl {
10861        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
10862            if writer.write_all(Self::DISCRIMINATOR).is_err() {
10863                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
10864            }
10865            if AnchorSerialize::serialize(self, writer).is_err() {
10866                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
10867            }
10868            Ok(())
10869        }
10870    }
10871    #[automatically_derived]
10872    impl anchor_lang::AccountDeserialize for LiquidateBorrowForPerpPnl {
10873        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
10874            let given_disc = &buf[..8];
10875            if Self::DISCRIMINATOR != given_disc {
10876                return Err(anchor_lang::error!(
10877                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
10878                ));
10879            }
10880            Self::try_deserialize_unchecked(buf)
10881        }
10882        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
10883            let mut data: &[u8] = &buf[8..];
10884            AnchorDeserialize::deserialize(&mut data)
10885                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
10886        }
10887    }
10888    #[repr(C)]
10889    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
10890    pub struct LiquidatePerpPnlForDeposit {
10891        pub state: Pubkey,
10892        pub authority: Pubkey,
10893        pub liquidator: Pubkey,
10894        pub liquidator_stats: Pubkey,
10895        pub user: Pubkey,
10896        pub user_stats: Pubkey,
10897    }
10898    #[automatically_derived]
10899    impl anchor_lang::Discriminator for LiquidatePerpPnlForDeposit {
10900        const DISCRIMINATOR: &[u8] = &[66, 46, 37, 140, 100, 242, 118, 224];
10901    }
10902    #[automatically_derived]
10903    unsafe impl anchor_lang::__private::bytemuck::Pod for LiquidatePerpPnlForDeposit {}
10904    #[automatically_derived]
10905    unsafe impl anchor_lang::__private::bytemuck::Zeroable for LiquidatePerpPnlForDeposit {}
10906    #[automatically_derived]
10907    impl anchor_lang::ZeroCopy for LiquidatePerpPnlForDeposit {}
10908    #[automatically_derived]
10909    impl anchor_lang::InstructionData for LiquidatePerpPnlForDeposit {}
10910    #[automatically_derived]
10911    impl ToAccountMetas for LiquidatePerpPnlForDeposit {
10912        fn to_account_metas(&self) -> Vec<AccountMeta> {
10913            vec![
10914                AccountMeta {
10915                    pubkey: self.state,
10916                    is_signer: false,
10917                    is_writable: false,
10918                },
10919                AccountMeta {
10920                    pubkey: self.authority,
10921                    is_signer: true,
10922                    is_writable: false,
10923                },
10924                AccountMeta {
10925                    pubkey: self.liquidator,
10926                    is_signer: false,
10927                    is_writable: true,
10928                },
10929                AccountMeta {
10930                    pubkey: self.liquidator_stats,
10931                    is_signer: false,
10932                    is_writable: true,
10933                },
10934                AccountMeta {
10935                    pubkey: self.user,
10936                    is_signer: false,
10937                    is_writable: true,
10938                },
10939                AccountMeta {
10940                    pubkey: self.user_stats,
10941                    is_signer: false,
10942                    is_writable: true,
10943                },
10944            ]
10945        }
10946    }
10947    #[automatically_derived]
10948    impl anchor_lang::AccountSerialize for LiquidatePerpPnlForDeposit {
10949        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
10950            if writer.write_all(Self::DISCRIMINATOR).is_err() {
10951                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
10952            }
10953            if AnchorSerialize::serialize(self, writer).is_err() {
10954                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
10955            }
10956            Ok(())
10957        }
10958    }
10959    #[automatically_derived]
10960    impl anchor_lang::AccountDeserialize for LiquidatePerpPnlForDeposit {
10961        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
10962            let given_disc = &buf[..8];
10963            if Self::DISCRIMINATOR != given_disc {
10964                return Err(anchor_lang::error!(
10965                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
10966                ));
10967            }
10968            Self::try_deserialize_unchecked(buf)
10969        }
10970        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
10971            let mut data: &[u8] = &buf[8..];
10972            AnchorDeserialize::deserialize(&mut data)
10973                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
10974        }
10975    }
10976    #[repr(C)]
10977    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
10978    pub struct SetUserStatusToBeingLiquidated {
10979        pub state: Pubkey,
10980        pub user: Pubkey,
10981        pub authority: Pubkey,
10982    }
10983    #[automatically_derived]
10984    impl anchor_lang::Discriminator for SetUserStatusToBeingLiquidated {
10985        const DISCRIMINATOR: &[u8] = &[150, 171, 70, 240, 192, 22, 158, 128];
10986    }
10987    #[automatically_derived]
10988    unsafe impl anchor_lang::__private::bytemuck::Pod for SetUserStatusToBeingLiquidated {}
10989    #[automatically_derived]
10990    unsafe impl anchor_lang::__private::bytemuck::Zeroable for SetUserStatusToBeingLiquidated {}
10991    #[automatically_derived]
10992    impl anchor_lang::ZeroCopy for SetUserStatusToBeingLiquidated {}
10993    #[automatically_derived]
10994    impl anchor_lang::InstructionData for SetUserStatusToBeingLiquidated {}
10995    #[automatically_derived]
10996    impl ToAccountMetas for SetUserStatusToBeingLiquidated {
10997        fn to_account_metas(&self) -> Vec<AccountMeta> {
10998            vec![
10999                AccountMeta {
11000                    pubkey: self.state,
11001                    is_signer: false,
11002                    is_writable: false,
11003                },
11004                AccountMeta {
11005                    pubkey: self.user,
11006                    is_signer: false,
11007                    is_writable: true,
11008                },
11009                AccountMeta {
11010                    pubkey: self.authority,
11011                    is_signer: true,
11012                    is_writable: false,
11013                },
11014            ]
11015        }
11016    }
11017    #[automatically_derived]
11018    impl anchor_lang::AccountSerialize for SetUserStatusToBeingLiquidated {
11019        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
11020            if writer.write_all(Self::DISCRIMINATOR).is_err() {
11021                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
11022            }
11023            if AnchorSerialize::serialize(self, writer).is_err() {
11024                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
11025            }
11026            Ok(())
11027        }
11028    }
11029    #[automatically_derived]
11030    impl anchor_lang::AccountDeserialize for SetUserStatusToBeingLiquidated {
11031        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
11032            let given_disc = &buf[..8];
11033            if Self::DISCRIMINATOR != given_disc {
11034                return Err(anchor_lang::error!(
11035                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
11036                ));
11037            }
11038            Self::try_deserialize_unchecked(buf)
11039        }
11040        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
11041            let mut data: &[u8] = &buf[8..];
11042            AnchorDeserialize::deserialize(&mut data)
11043                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
11044        }
11045    }
11046    #[repr(C)]
11047    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
11048    pub struct ResolvePerpPnlDeficit {
11049        pub state: Pubkey,
11050        pub authority: Pubkey,
11051        pub spot_market_vault: Pubkey,
11052        pub insurance_fund_vault: Pubkey,
11053        pub drift_signer: Pubkey,
11054        pub token_program: Pubkey,
11055    }
11056    #[automatically_derived]
11057    impl anchor_lang::Discriminator for ResolvePerpPnlDeficit {
11058        const DISCRIMINATOR: &[u8] = &[11, 51, 56, 223, 39, 129, 129, 31];
11059    }
11060    #[automatically_derived]
11061    unsafe impl anchor_lang::__private::bytemuck::Pod for ResolvePerpPnlDeficit {}
11062    #[automatically_derived]
11063    unsafe impl anchor_lang::__private::bytemuck::Zeroable for ResolvePerpPnlDeficit {}
11064    #[automatically_derived]
11065    impl anchor_lang::ZeroCopy for ResolvePerpPnlDeficit {}
11066    #[automatically_derived]
11067    impl anchor_lang::InstructionData for ResolvePerpPnlDeficit {}
11068    #[automatically_derived]
11069    impl ToAccountMetas for ResolvePerpPnlDeficit {
11070        fn to_account_metas(&self) -> Vec<AccountMeta> {
11071            vec![
11072                AccountMeta {
11073                    pubkey: self.state,
11074                    is_signer: false,
11075                    is_writable: false,
11076                },
11077                AccountMeta {
11078                    pubkey: self.authority,
11079                    is_signer: true,
11080                    is_writable: false,
11081                },
11082                AccountMeta {
11083                    pubkey: self.spot_market_vault,
11084                    is_signer: false,
11085                    is_writable: true,
11086                },
11087                AccountMeta {
11088                    pubkey: self.insurance_fund_vault,
11089                    is_signer: false,
11090                    is_writable: true,
11091                },
11092                AccountMeta {
11093                    pubkey: self.drift_signer,
11094                    is_signer: false,
11095                    is_writable: false,
11096                },
11097                AccountMeta {
11098                    pubkey: self.token_program,
11099                    is_signer: false,
11100                    is_writable: false,
11101                },
11102            ]
11103        }
11104    }
11105    #[automatically_derived]
11106    impl anchor_lang::AccountSerialize for ResolvePerpPnlDeficit {
11107        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
11108            if writer.write_all(Self::DISCRIMINATOR).is_err() {
11109                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
11110            }
11111            if AnchorSerialize::serialize(self, writer).is_err() {
11112                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
11113            }
11114            Ok(())
11115        }
11116    }
11117    #[automatically_derived]
11118    impl anchor_lang::AccountDeserialize for ResolvePerpPnlDeficit {
11119        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
11120            let given_disc = &buf[..8];
11121            if Self::DISCRIMINATOR != given_disc {
11122                return Err(anchor_lang::error!(
11123                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
11124                ));
11125            }
11126            Self::try_deserialize_unchecked(buf)
11127        }
11128        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
11129            let mut data: &[u8] = &buf[8..];
11130            AnchorDeserialize::deserialize(&mut data)
11131                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
11132        }
11133    }
11134    #[repr(C)]
11135    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
11136    pub struct ResolvePerpBankruptcy {
11137        pub state: Pubkey,
11138        pub authority: Pubkey,
11139        pub liquidator: Pubkey,
11140        pub liquidator_stats: Pubkey,
11141        pub user: Pubkey,
11142        pub user_stats: Pubkey,
11143        pub spot_market_vault: Pubkey,
11144        pub insurance_fund_vault: Pubkey,
11145        pub drift_signer: Pubkey,
11146        pub token_program: Pubkey,
11147    }
11148    #[automatically_derived]
11149    impl anchor_lang::Discriminator for ResolvePerpBankruptcy {
11150        const DISCRIMINATOR: &[u8] = &[232, 117, 49, 236, 173, 89, 78, 52];
11151    }
11152    #[automatically_derived]
11153    unsafe impl anchor_lang::__private::bytemuck::Pod for ResolvePerpBankruptcy {}
11154    #[automatically_derived]
11155    unsafe impl anchor_lang::__private::bytemuck::Zeroable for ResolvePerpBankruptcy {}
11156    #[automatically_derived]
11157    impl anchor_lang::ZeroCopy for ResolvePerpBankruptcy {}
11158    #[automatically_derived]
11159    impl anchor_lang::InstructionData for ResolvePerpBankruptcy {}
11160    #[automatically_derived]
11161    impl ToAccountMetas for ResolvePerpBankruptcy {
11162        fn to_account_metas(&self) -> Vec<AccountMeta> {
11163            vec![
11164                AccountMeta {
11165                    pubkey: self.state,
11166                    is_signer: false,
11167                    is_writable: false,
11168                },
11169                AccountMeta {
11170                    pubkey: self.authority,
11171                    is_signer: true,
11172                    is_writable: false,
11173                },
11174                AccountMeta {
11175                    pubkey: self.liquidator,
11176                    is_signer: false,
11177                    is_writable: true,
11178                },
11179                AccountMeta {
11180                    pubkey: self.liquidator_stats,
11181                    is_signer: false,
11182                    is_writable: true,
11183                },
11184                AccountMeta {
11185                    pubkey: self.user,
11186                    is_signer: false,
11187                    is_writable: true,
11188                },
11189                AccountMeta {
11190                    pubkey: self.user_stats,
11191                    is_signer: false,
11192                    is_writable: true,
11193                },
11194                AccountMeta {
11195                    pubkey: self.spot_market_vault,
11196                    is_signer: false,
11197                    is_writable: true,
11198                },
11199                AccountMeta {
11200                    pubkey: self.insurance_fund_vault,
11201                    is_signer: false,
11202                    is_writable: true,
11203                },
11204                AccountMeta {
11205                    pubkey: self.drift_signer,
11206                    is_signer: false,
11207                    is_writable: false,
11208                },
11209                AccountMeta {
11210                    pubkey: self.token_program,
11211                    is_signer: false,
11212                    is_writable: false,
11213                },
11214            ]
11215        }
11216    }
11217    #[automatically_derived]
11218    impl anchor_lang::AccountSerialize for ResolvePerpBankruptcy {
11219        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
11220            if writer.write_all(Self::DISCRIMINATOR).is_err() {
11221                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
11222            }
11223            if AnchorSerialize::serialize(self, writer).is_err() {
11224                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
11225            }
11226            Ok(())
11227        }
11228    }
11229    #[automatically_derived]
11230    impl anchor_lang::AccountDeserialize for ResolvePerpBankruptcy {
11231        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
11232            let given_disc = &buf[..8];
11233            if Self::DISCRIMINATOR != given_disc {
11234                return Err(anchor_lang::error!(
11235                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
11236                ));
11237            }
11238            Self::try_deserialize_unchecked(buf)
11239        }
11240        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
11241            let mut data: &[u8] = &buf[8..];
11242            AnchorDeserialize::deserialize(&mut data)
11243                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
11244        }
11245    }
11246    #[repr(C)]
11247    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
11248    pub struct ResolveSpotBankruptcy {
11249        pub state: Pubkey,
11250        pub authority: Pubkey,
11251        pub liquidator: Pubkey,
11252        pub liquidator_stats: Pubkey,
11253        pub user: Pubkey,
11254        pub user_stats: Pubkey,
11255        pub spot_market_vault: Pubkey,
11256        pub insurance_fund_vault: Pubkey,
11257        pub drift_signer: Pubkey,
11258        pub token_program: Pubkey,
11259    }
11260    #[automatically_derived]
11261    impl anchor_lang::Discriminator for ResolveSpotBankruptcy {
11262        const DISCRIMINATOR: &[u8] = &[186, 115, 37, 134, 49, 132, 252, 139];
11263    }
11264    #[automatically_derived]
11265    unsafe impl anchor_lang::__private::bytemuck::Pod for ResolveSpotBankruptcy {}
11266    #[automatically_derived]
11267    unsafe impl anchor_lang::__private::bytemuck::Zeroable for ResolveSpotBankruptcy {}
11268    #[automatically_derived]
11269    impl anchor_lang::ZeroCopy for ResolveSpotBankruptcy {}
11270    #[automatically_derived]
11271    impl anchor_lang::InstructionData for ResolveSpotBankruptcy {}
11272    #[automatically_derived]
11273    impl ToAccountMetas for ResolveSpotBankruptcy {
11274        fn to_account_metas(&self) -> Vec<AccountMeta> {
11275            vec![
11276                AccountMeta {
11277                    pubkey: self.state,
11278                    is_signer: false,
11279                    is_writable: false,
11280                },
11281                AccountMeta {
11282                    pubkey: self.authority,
11283                    is_signer: true,
11284                    is_writable: false,
11285                },
11286                AccountMeta {
11287                    pubkey: self.liquidator,
11288                    is_signer: false,
11289                    is_writable: true,
11290                },
11291                AccountMeta {
11292                    pubkey: self.liquidator_stats,
11293                    is_signer: false,
11294                    is_writable: true,
11295                },
11296                AccountMeta {
11297                    pubkey: self.user,
11298                    is_signer: false,
11299                    is_writable: true,
11300                },
11301                AccountMeta {
11302                    pubkey: self.user_stats,
11303                    is_signer: false,
11304                    is_writable: true,
11305                },
11306                AccountMeta {
11307                    pubkey: self.spot_market_vault,
11308                    is_signer: false,
11309                    is_writable: true,
11310                },
11311                AccountMeta {
11312                    pubkey: self.insurance_fund_vault,
11313                    is_signer: false,
11314                    is_writable: true,
11315                },
11316                AccountMeta {
11317                    pubkey: self.drift_signer,
11318                    is_signer: false,
11319                    is_writable: false,
11320                },
11321                AccountMeta {
11322                    pubkey: self.token_program,
11323                    is_signer: false,
11324                    is_writable: false,
11325                },
11326            ]
11327        }
11328    }
11329    #[automatically_derived]
11330    impl anchor_lang::AccountSerialize for ResolveSpotBankruptcy {
11331        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
11332            if writer.write_all(Self::DISCRIMINATOR).is_err() {
11333                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
11334            }
11335            if AnchorSerialize::serialize(self, writer).is_err() {
11336                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
11337            }
11338            Ok(())
11339        }
11340    }
11341    #[automatically_derived]
11342    impl anchor_lang::AccountDeserialize for ResolveSpotBankruptcy {
11343        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
11344            let given_disc = &buf[..8];
11345            if Self::DISCRIMINATOR != given_disc {
11346                return Err(anchor_lang::error!(
11347                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
11348                ));
11349            }
11350            Self::try_deserialize_unchecked(buf)
11351        }
11352        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
11353            let mut data: &[u8] = &buf[8..];
11354            AnchorDeserialize::deserialize(&mut data)
11355                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
11356        }
11357    }
11358    #[repr(C)]
11359    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
11360    pub struct SettleRevenueToInsuranceFund {
11361        pub state: Pubkey,
11362        pub spot_market: Pubkey,
11363        pub spot_market_vault: Pubkey,
11364        pub drift_signer: Pubkey,
11365        pub insurance_fund_vault: Pubkey,
11366        pub token_program: Pubkey,
11367    }
11368    #[automatically_derived]
11369    impl anchor_lang::Discriminator for SettleRevenueToInsuranceFund {
11370        const DISCRIMINATOR: &[u8] = &[49, 54, 211, 157, 180, 157, 182, 14];
11371    }
11372    #[automatically_derived]
11373    unsafe impl anchor_lang::__private::bytemuck::Pod for SettleRevenueToInsuranceFund {}
11374    #[automatically_derived]
11375    unsafe impl anchor_lang::__private::bytemuck::Zeroable for SettleRevenueToInsuranceFund {}
11376    #[automatically_derived]
11377    impl anchor_lang::ZeroCopy for SettleRevenueToInsuranceFund {}
11378    #[automatically_derived]
11379    impl anchor_lang::InstructionData for SettleRevenueToInsuranceFund {}
11380    #[automatically_derived]
11381    impl ToAccountMetas for SettleRevenueToInsuranceFund {
11382        fn to_account_metas(&self) -> Vec<AccountMeta> {
11383            vec![
11384                AccountMeta {
11385                    pubkey: self.state,
11386                    is_signer: false,
11387                    is_writable: false,
11388                },
11389                AccountMeta {
11390                    pubkey: self.spot_market,
11391                    is_signer: false,
11392                    is_writable: true,
11393                },
11394                AccountMeta {
11395                    pubkey: self.spot_market_vault,
11396                    is_signer: false,
11397                    is_writable: true,
11398                },
11399                AccountMeta {
11400                    pubkey: self.drift_signer,
11401                    is_signer: false,
11402                    is_writable: false,
11403                },
11404                AccountMeta {
11405                    pubkey: self.insurance_fund_vault,
11406                    is_signer: false,
11407                    is_writable: true,
11408                },
11409                AccountMeta {
11410                    pubkey: self.token_program,
11411                    is_signer: false,
11412                    is_writable: false,
11413                },
11414            ]
11415        }
11416    }
11417    #[automatically_derived]
11418    impl anchor_lang::AccountSerialize for SettleRevenueToInsuranceFund {
11419        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
11420            if writer.write_all(Self::DISCRIMINATOR).is_err() {
11421                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
11422            }
11423            if AnchorSerialize::serialize(self, writer).is_err() {
11424                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
11425            }
11426            Ok(())
11427        }
11428    }
11429    #[automatically_derived]
11430    impl anchor_lang::AccountDeserialize for SettleRevenueToInsuranceFund {
11431        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
11432            let given_disc = &buf[..8];
11433            if Self::DISCRIMINATOR != given_disc {
11434                return Err(anchor_lang::error!(
11435                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
11436                ));
11437            }
11438            Self::try_deserialize_unchecked(buf)
11439        }
11440        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
11441            let mut data: &[u8] = &buf[8..];
11442            AnchorDeserialize::deserialize(&mut data)
11443                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
11444        }
11445    }
11446    #[repr(C)]
11447    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
11448    pub struct UpdateFundingRate {
11449        pub state: Pubkey,
11450        pub perp_market: Pubkey,
11451        pub oracle: Pubkey,
11452    }
11453    #[automatically_derived]
11454    impl anchor_lang::Discriminator for UpdateFundingRate {
11455        const DISCRIMINATOR: &[u8] = &[147, 129, 170, 235, 221, 137, 139, 160];
11456    }
11457    #[automatically_derived]
11458    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdateFundingRate {}
11459    #[automatically_derived]
11460    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdateFundingRate {}
11461    #[automatically_derived]
11462    impl anchor_lang::ZeroCopy for UpdateFundingRate {}
11463    #[automatically_derived]
11464    impl anchor_lang::InstructionData for UpdateFundingRate {}
11465    #[automatically_derived]
11466    impl ToAccountMetas for UpdateFundingRate {
11467        fn to_account_metas(&self) -> Vec<AccountMeta> {
11468            vec![
11469                AccountMeta {
11470                    pubkey: self.state,
11471                    is_signer: false,
11472                    is_writable: false,
11473                },
11474                AccountMeta {
11475                    pubkey: self.perp_market,
11476                    is_signer: false,
11477                    is_writable: true,
11478                },
11479                AccountMeta {
11480                    pubkey: self.oracle,
11481                    is_signer: false,
11482                    is_writable: false,
11483                },
11484            ]
11485        }
11486    }
11487    #[automatically_derived]
11488    impl anchor_lang::AccountSerialize for UpdateFundingRate {
11489        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
11490            if writer.write_all(Self::DISCRIMINATOR).is_err() {
11491                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
11492            }
11493            if AnchorSerialize::serialize(self, writer).is_err() {
11494                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
11495            }
11496            Ok(())
11497        }
11498    }
11499    #[automatically_derived]
11500    impl anchor_lang::AccountDeserialize for UpdateFundingRate {
11501        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
11502            let given_disc = &buf[..8];
11503            if Self::DISCRIMINATOR != given_disc {
11504                return Err(anchor_lang::error!(
11505                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
11506                ));
11507            }
11508            Self::try_deserialize_unchecked(buf)
11509        }
11510        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
11511            let mut data: &[u8] = &buf[8..];
11512            AnchorDeserialize::deserialize(&mut data)
11513                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
11514        }
11515    }
11516    #[repr(C)]
11517    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
11518    pub struct UpdatePrelaunchOracle {
11519        pub state: Pubkey,
11520        pub perp_market: Pubkey,
11521        pub oracle: Pubkey,
11522    }
11523    #[automatically_derived]
11524    impl anchor_lang::Discriminator for UpdatePrelaunchOracle {
11525        const DISCRIMINATOR: &[u8] = &[246, 29, 3, 127, 200, 172, 45, 171];
11526    }
11527    #[automatically_derived]
11528    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdatePrelaunchOracle {}
11529    #[automatically_derived]
11530    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdatePrelaunchOracle {}
11531    #[automatically_derived]
11532    impl anchor_lang::ZeroCopy for UpdatePrelaunchOracle {}
11533    #[automatically_derived]
11534    impl anchor_lang::InstructionData for UpdatePrelaunchOracle {}
11535    #[automatically_derived]
11536    impl ToAccountMetas for UpdatePrelaunchOracle {
11537        fn to_account_metas(&self) -> Vec<AccountMeta> {
11538            vec![
11539                AccountMeta {
11540                    pubkey: self.state,
11541                    is_signer: false,
11542                    is_writable: false,
11543                },
11544                AccountMeta {
11545                    pubkey: self.perp_market,
11546                    is_signer: false,
11547                    is_writable: false,
11548                },
11549                AccountMeta {
11550                    pubkey: self.oracle,
11551                    is_signer: false,
11552                    is_writable: true,
11553                },
11554            ]
11555        }
11556    }
11557    #[automatically_derived]
11558    impl anchor_lang::AccountSerialize for UpdatePrelaunchOracle {
11559        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
11560            if writer.write_all(Self::DISCRIMINATOR).is_err() {
11561                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
11562            }
11563            if AnchorSerialize::serialize(self, writer).is_err() {
11564                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
11565            }
11566            Ok(())
11567        }
11568    }
11569    #[automatically_derived]
11570    impl anchor_lang::AccountDeserialize for UpdatePrelaunchOracle {
11571        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
11572            let given_disc = &buf[..8];
11573            if Self::DISCRIMINATOR != given_disc {
11574                return Err(anchor_lang::error!(
11575                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
11576                ));
11577            }
11578            Self::try_deserialize_unchecked(buf)
11579        }
11580        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
11581            let mut data: &[u8] = &buf[8..];
11582            AnchorDeserialize::deserialize(&mut data)
11583                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
11584        }
11585    }
11586    #[repr(C)]
11587    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
11588    pub struct UpdatePerpBidAskTwap {
11589        pub state: Pubkey,
11590        pub perp_market: Pubkey,
11591        pub oracle: Pubkey,
11592        pub keeper_stats: Pubkey,
11593        pub authority: Pubkey,
11594    }
11595    #[automatically_derived]
11596    impl anchor_lang::Discriminator for UpdatePerpBidAskTwap {
11597        const DISCRIMINATOR: &[u8] = &[75, 78, 22, 179, 238, 41, 216, 90];
11598    }
11599    #[automatically_derived]
11600    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdatePerpBidAskTwap {}
11601    #[automatically_derived]
11602    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdatePerpBidAskTwap {}
11603    #[automatically_derived]
11604    impl anchor_lang::ZeroCopy for UpdatePerpBidAskTwap {}
11605    #[automatically_derived]
11606    impl anchor_lang::InstructionData for UpdatePerpBidAskTwap {}
11607    #[automatically_derived]
11608    impl ToAccountMetas for UpdatePerpBidAskTwap {
11609        fn to_account_metas(&self) -> Vec<AccountMeta> {
11610            vec![
11611                AccountMeta {
11612                    pubkey: self.state,
11613                    is_signer: false,
11614                    is_writable: false,
11615                },
11616                AccountMeta {
11617                    pubkey: self.perp_market,
11618                    is_signer: false,
11619                    is_writable: true,
11620                },
11621                AccountMeta {
11622                    pubkey: self.oracle,
11623                    is_signer: false,
11624                    is_writable: false,
11625                },
11626                AccountMeta {
11627                    pubkey: self.keeper_stats,
11628                    is_signer: false,
11629                    is_writable: false,
11630                },
11631                AccountMeta {
11632                    pubkey: self.authority,
11633                    is_signer: true,
11634                    is_writable: false,
11635                },
11636            ]
11637        }
11638    }
11639    #[automatically_derived]
11640    impl anchor_lang::AccountSerialize for UpdatePerpBidAskTwap {
11641        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
11642            if writer.write_all(Self::DISCRIMINATOR).is_err() {
11643                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
11644            }
11645            if AnchorSerialize::serialize(self, writer).is_err() {
11646                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
11647            }
11648            Ok(())
11649        }
11650    }
11651    #[automatically_derived]
11652    impl anchor_lang::AccountDeserialize for UpdatePerpBidAskTwap {
11653        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
11654            let given_disc = &buf[..8];
11655            if Self::DISCRIMINATOR != given_disc {
11656                return Err(anchor_lang::error!(
11657                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
11658                ));
11659            }
11660            Self::try_deserialize_unchecked(buf)
11661        }
11662        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
11663            let mut data: &[u8] = &buf[8..];
11664            AnchorDeserialize::deserialize(&mut data)
11665                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
11666        }
11667    }
11668    #[repr(C)]
11669    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
11670    pub struct UpdateSpotMarketCumulativeInterest {
11671        pub state: Pubkey,
11672        pub spot_market: Pubkey,
11673        pub oracle: Pubkey,
11674        pub spot_market_vault: Pubkey,
11675    }
11676    #[automatically_derived]
11677    impl anchor_lang::Discriminator for UpdateSpotMarketCumulativeInterest {
11678        const DISCRIMINATOR: &[u8] = &[103, 124, 233, 228, 65, 182, 52, 216];
11679    }
11680    #[automatically_derived]
11681    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdateSpotMarketCumulativeInterest {}
11682    #[automatically_derived]
11683    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdateSpotMarketCumulativeInterest {}
11684    #[automatically_derived]
11685    impl anchor_lang::ZeroCopy for UpdateSpotMarketCumulativeInterest {}
11686    #[automatically_derived]
11687    impl anchor_lang::InstructionData for UpdateSpotMarketCumulativeInterest {}
11688    #[automatically_derived]
11689    impl ToAccountMetas for UpdateSpotMarketCumulativeInterest {
11690        fn to_account_metas(&self) -> Vec<AccountMeta> {
11691            vec![
11692                AccountMeta {
11693                    pubkey: self.state,
11694                    is_signer: false,
11695                    is_writable: false,
11696                },
11697                AccountMeta {
11698                    pubkey: self.spot_market,
11699                    is_signer: false,
11700                    is_writable: true,
11701                },
11702                AccountMeta {
11703                    pubkey: self.oracle,
11704                    is_signer: false,
11705                    is_writable: false,
11706                },
11707                AccountMeta {
11708                    pubkey: self.spot_market_vault,
11709                    is_signer: false,
11710                    is_writable: false,
11711                },
11712            ]
11713        }
11714    }
11715    #[automatically_derived]
11716    impl anchor_lang::AccountSerialize for UpdateSpotMarketCumulativeInterest {
11717        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
11718            if writer.write_all(Self::DISCRIMINATOR).is_err() {
11719                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
11720            }
11721            if AnchorSerialize::serialize(self, writer).is_err() {
11722                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
11723            }
11724            Ok(())
11725        }
11726    }
11727    #[automatically_derived]
11728    impl anchor_lang::AccountDeserialize for UpdateSpotMarketCumulativeInterest {
11729        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
11730            let given_disc = &buf[..8];
11731            if Self::DISCRIMINATOR != given_disc {
11732                return Err(anchor_lang::error!(
11733                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
11734                ));
11735            }
11736            Self::try_deserialize_unchecked(buf)
11737        }
11738        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
11739            let mut data: &[u8] = &buf[8..];
11740            AnchorDeserialize::deserialize(&mut data)
11741                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
11742        }
11743    }
11744    #[repr(C)]
11745    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
11746    pub struct UpdateAmms {
11747        pub state: Pubkey,
11748        pub authority: Pubkey,
11749    }
11750    #[automatically_derived]
11751    impl anchor_lang::Discriminator for UpdateAmms {
11752        const DISCRIMINATOR: &[u8] = &[199, 237, 7, 202, 212, 96, 167, 243];
11753    }
11754    #[automatically_derived]
11755    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdateAmms {}
11756    #[automatically_derived]
11757    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdateAmms {}
11758    #[automatically_derived]
11759    impl anchor_lang::ZeroCopy for UpdateAmms {}
11760    #[automatically_derived]
11761    impl anchor_lang::InstructionData for UpdateAmms {}
11762    #[automatically_derived]
11763    impl ToAccountMetas for UpdateAmms {
11764        fn to_account_metas(&self) -> Vec<AccountMeta> {
11765            vec![
11766                AccountMeta {
11767                    pubkey: self.state,
11768                    is_signer: false,
11769                    is_writable: false,
11770                },
11771                AccountMeta {
11772                    pubkey: self.authority,
11773                    is_signer: true,
11774                    is_writable: false,
11775                },
11776            ]
11777        }
11778    }
11779    #[automatically_derived]
11780    impl anchor_lang::AccountSerialize for UpdateAmms {
11781        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
11782            if writer.write_all(Self::DISCRIMINATOR).is_err() {
11783                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
11784            }
11785            if AnchorSerialize::serialize(self, writer).is_err() {
11786                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
11787            }
11788            Ok(())
11789        }
11790    }
11791    #[automatically_derived]
11792    impl anchor_lang::AccountDeserialize for UpdateAmms {
11793        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
11794            let given_disc = &buf[..8];
11795            if Self::DISCRIMINATOR != given_disc {
11796                return Err(anchor_lang::error!(
11797                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
11798                ));
11799            }
11800            Self::try_deserialize_unchecked(buf)
11801        }
11802        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
11803            let mut data: &[u8] = &buf[8..];
11804            AnchorDeserialize::deserialize(&mut data)
11805                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
11806        }
11807    }
11808    #[repr(C)]
11809    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
11810    pub struct UpdateSpotMarketExpiry {
11811        pub admin: Pubkey,
11812        pub state: Pubkey,
11813        pub spot_market: Pubkey,
11814    }
11815    #[automatically_derived]
11816    impl anchor_lang::Discriminator for UpdateSpotMarketExpiry {
11817        const DISCRIMINATOR: &[u8] = &[124, 96, 183, 195, 2, 49, 222, 97];
11818    }
11819    #[automatically_derived]
11820    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdateSpotMarketExpiry {}
11821    #[automatically_derived]
11822    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdateSpotMarketExpiry {}
11823    #[automatically_derived]
11824    impl anchor_lang::ZeroCopy for UpdateSpotMarketExpiry {}
11825    #[automatically_derived]
11826    impl anchor_lang::InstructionData for UpdateSpotMarketExpiry {}
11827    #[automatically_derived]
11828    impl ToAccountMetas for UpdateSpotMarketExpiry {
11829        fn to_account_metas(&self) -> Vec<AccountMeta> {
11830            vec![
11831                AccountMeta {
11832                    pubkey: self.admin,
11833                    is_signer: true,
11834                    is_writable: false,
11835                },
11836                AccountMeta {
11837                    pubkey: self.state,
11838                    is_signer: false,
11839                    is_writable: false,
11840                },
11841                AccountMeta {
11842                    pubkey: self.spot_market,
11843                    is_signer: false,
11844                    is_writable: true,
11845                },
11846            ]
11847        }
11848    }
11849    #[automatically_derived]
11850    impl anchor_lang::AccountSerialize for UpdateSpotMarketExpiry {
11851        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
11852            if writer.write_all(Self::DISCRIMINATOR).is_err() {
11853                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
11854            }
11855            if AnchorSerialize::serialize(self, writer).is_err() {
11856                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
11857            }
11858            Ok(())
11859        }
11860    }
11861    #[automatically_derived]
11862    impl anchor_lang::AccountDeserialize for UpdateSpotMarketExpiry {
11863        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
11864            let given_disc = &buf[..8];
11865            if Self::DISCRIMINATOR != given_disc {
11866                return Err(anchor_lang::error!(
11867                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
11868                ));
11869            }
11870            Self::try_deserialize_unchecked(buf)
11871        }
11872        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
11873            let mut data: &[u8] = &buf[8..];
11874            AnchorDeserialize::deserialize(&mut data)
11875                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
11876        }
11877    }
11878    #[repr(C)]
11879    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
11880    pub struct UpdateUserQuoteAssetInsuranceStake {
11881        pub state: Pubkey,
11882        pub spot_market: Pubkey,
11883        pub insurance_fund_stake: Pubkey,
11884        pub user_stats: Pubkey,
11885        pub signer: Pubkey,
11886        pub insurance_fund_vault: Pubkey,
11887    }
11888    #[automatically_derived]
11889    impl anchor_lang::Discriminator for UpdateUserQuoteAssetInsuranceStake {
11890        const DISCRIMINATOR: &[u8] = &[78, 21, 169, 183, 105, 218, 162, 67];
11891    }
11892    #[automatically_derived]
11893    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdateUserQuoteAssetInsuranceStake {}
11894    #[automatically_derived]
11895    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdateUserQuoteAssetInsuranceStake {}
11896    #[automatically_derived]
11897    impl anchor_lang::ZeroCopy for UpdateUserQuoteAssetInsuranceStake {}
11898    #[automatically_derived]
11899    impl anchor_lang::InstructionData for UpdateUserQuoteAssetInsuranceStake {}
11900    #[automatically_derived]
11901    impl ToAccountMetas for UpdateUserQuoteAssetInsuranceStake {
11902        fn to_account_metas(&self) -> Vec<AccountMeta> {
11903            vec![
11904                AccountMeta {
11905                    pubkey: self.state,
11906                    is_signer: false,
11907                    is_writable: false,
11908                },
11909                AccountMeta {
11910                    pubkey: self.spot_market,
11911                    is_signer: false,
11912                    is_writable: true,
11913                },
11914                AccountMeta {
11915                    pubkey: self.insurance_fund_stake,
11916                    is_signer: false,
11917                    is_writable: true,
11918                },
11919                AccountMeta {
11920                    pubkey: self.user_stats,
11921                    is_signer: false,
11922                    is_writable: true,
11923                },
11924                AccountMeta {
11925                    pubkey: self.signer,
11926                    is_signer: true,
11927                    is_writable: false,
11928                },
11929                AccountMeta {
11930                    pubkey: self.insurance_fund_vault,
11931                    is_signer: false,
11932                    is_writable: true,
11933                },
11934            ]
11935        }
11936    }
11937    #[automatically_derived]
11938    impl anchor_lang::AccountSerialize for UpdateUserQuoteAssetInsuranceStake {
11939        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
11940            if writer.write_all(Self::DISCRIMINATOR).is_err() {
11941                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
11942            }
11943            if AnchorSerialize::serialize(self, writer).is_err() {
11944                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
11945            }
11946            Ok(())
11947        }
11948    }
11949    #[automatically_derived]
11950    impl anchor_lang::AccountDeserialize for UpdateUserQuoteAssetInsuranceStake {
11951        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
11952            let given_disc = &buf[..8];
11953            if Self::DISCRIMINATOR != given_disc {
11954                return Err(anchor_lang::error!(
11955                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
11956                ));
11957            }
11958            Self::try_deserialize_unchecked(buf)
11959        }
11960        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
11961            let mut data: &[u8] = &buf[8..];
11962            AnchorDeserialize::deserialize(&mut data)
11963                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
11964        }
11965    }
11966    #[repr(C)]
11967    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
11968    pub struct UpdateUserGovTokenInsuranceStake {
11969        pub state: Pubkey,
11970        pub spot_market: Pubkey,
11971        pub insurance_fund_stake: Pubkey,
11972        pub user_stats: Pubkey,
11973        pub signer: Pubkey,
11974        pub insurance_fund_vault: Pubkey,
11975    }
11976    #[automatically_derived]
11977    impl anchor_lang::Discriminator for UpdateUserGovTokenInsuranceStake {
11978        const DISCRIMINATOR: &[u8] = &[43, 203, 49, 187, 213, 150, 189, 95];
11979    }
11980    #[automatically_derived]
11981    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdateUserGovTokenInsuranceStake {}
11982    #[automatically_derived]
11983    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdateUserGovTokenInsuranceStake {}
11984    #[automatically_derived]
11985    impl anchor_lang::ZeroCopy for UpdateUserGovTokenInsuranceStake {}
11986    #[automatically_derived]
11987    impl anchor_lang::InstructionData for UpdateUserGovTokenInsuranceStake {}
11988    #[automatically_derived]
11989    impl ToAccountMetas for UpdateUserGovTokenInsuranceStake {
11990        fn to_account_metas(&self) -> Vec<AccountMeta> {
11991            vec![
11992                AccountMeta {
11993                    pubkey: self.state,
11994                    is_signer: false,
11995                    is_writable: false,
11996                },
11997                AccountMeta {
11998                    pubkey: self.spot_market,
11999                    is_signer: false,
12000                    is_writable: true,
12001                },
12002                AccountMeta {
12003                    pubkey: self.insurance_fund_stake,
12004                    is_signer: false,
12005                    is_writable: true,
12006                },
12007                AccountMeta {
12008                    pubkey: self.user_stats,
12009                    is_signer: false,
12010                    is_writable: true,
12011                },
12012                AccountMeta {
12013                    pubkey: self.signer,
12014                    is_signer: true,
12015                    is_writable: false,
12016                },
12017                AccountMeta {
12018                    pubkey: self.insurance_fund_vault,
12019                    is_signer: false,
12020                    is_writable: true,
12021                },
12022            ]
12023        }
12024    }
12025    #[automatically_derived]
12026    impl anchor_lang::AccountSerialize for UpdateUserGovTokenInsuranceStake {
12027        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
12028            if writer.write_all(Self::DISCRIMINATOR).is_err() {
12029                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
12030            }
12031            if AnchorSerialize::serialize(self, writer).is_err() {
12032                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
12033            }
12034            Ok(())
12035        }
12036    }
12037    #[automatically_derived]
12038    impl anchor_lang::AccountDeserialize for UpdateUserGovTokenInsuranceStake {
12039        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
12040            let given_disc = &buf[..8];
12041            if Self::DISCRIMINATOR != given_disc {
12042                return Err(anchor_lang::error!(
12043                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
12044                ));
12045            }
12046            Self::try_deserialize_unchecked(buf)
12047        }
12048        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
12049            let mut data: &[u8] = &buf[8..];
12050            AnchorDeserialize::deserialize(&mut data)
12051                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
12052        }
12053    }
12054    #[repr(C)]
12055    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
12056    pub struct UpdateUserGovTokenInsuranceStakeDevnet {
12057        pub user_stats: Pubkey,
12058        pub signer: Pubkey,
12059    }
12060    #[automatically_derived]
12061    impl anchor_lang::Discriminator for UpdateUserGovTokenInsuranceStakeDevnet {
12062        const DISCRIMINATOR: &[u8] = &[7, 243, 156, 21, 134, 61, 166, 81];
12063    }
12064    #[automatically_derived]
12065    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdateUserGovTokenInsuranceStakeDevnet {}
12066    #[automatically_derived]
12067    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdateUserGovTokenInsuranceStakeDevnet {}
12068    #[automatically_derived]
12069    impl anchor_lang::ZeroCopy for UpdateUserGovTokenInsuranceStakeDevnet {}
12070    #[automatically_derived]
12071    impl anchor_lang::InstructionData for UpdateUserGovTokenInsuranceStakeDevnet {}
12072    #[automatically_derived]
12073    impl ToAccountMetas for UpdateUserGovTokenInsuranceStakeDevnet {
12074        fn to_account_metas(&self) -> Vec<AccountMeta> {
12075            vec![
12076                AccountMeta {
12077                    pubkey: self.user_stats,
12078                    is_signer: false,
12079                    is_writable: true,
12080                },
12081                AccountMeta {
12082                    pubkey: self.signer,
12083                    is_signer: true,
12084                    is_writable: false,
12085                },
12086            ]
12087        }
12088    }
12089    #[automatically_derived]
12090    impl anchor_lang::AccountSerialize for UpdateUserGovTokenInsuranceStakeDevnet {
12091        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
12092            if writer.write_all(Self::DISCRIMINATOR).is_err() {
12093                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
12094            }
12095            if AnchorSerialize::serialize(self, writer).is_err() {
12096                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
12097            }
12098            Ok(())
12099        }
12100    }
12101    #[automatically_derived]
12102    impl anchor_lang::AccountDeserialize for UpdateUserGovTokenInsuranceStakeDevnet {
12103        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
12104            let given_disc = &buf[..8];
12105            if Self::DISCRIMINATOR != given_disc {
12106                return Err(anchor_lang::error!(
12107                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
12108                ));
12109            }
12110            Self::try_deserialize_unchecked(buf)
12111        }
12112        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
12113            let mut data: &[u8] = &buf[8..];
12114            AnchorDeserialize::deserialize(&mut data)
12115                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
12116        }
12117    }
12118    #[repr(C)]
12119    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
12120    pub struct InitializeInsuranceFundStake {
12121        pub spot_market: Pubkey,
12122        pub insurance_fund_stake: Pubkey,
12123        pub user_stats: Pubkey,
12124        pub state: Pubkey,
12125        pub authority: Pubkey,
12126        pub payer: Pubkey,
12127        pub rent: Pubkey,
12128        pub system_program: Pubkey,
12129    }
12130    #[automatically_derived]
12131    impl anchor_lang::Discriminator for InitializeInsuranceFundStake {
12132        const DISCRIMINATOR: &[u8] = &[99, 171, 38, 232, 118, 110, 9, 182];
12133    }
12134    #[automatically_derived]
12135    unsafe impl anchor_lang::__private::bytemuck::Pod for InitializeInsuranceFundStake {}
12136    #[automatically_derived]
12137    unsafe impl anchor_lang::__private::bytemuck::Zeroable for InitializeInsuranceFundStake {}
12138    #[automatically_derived]
12139    impl anchor_lang::ZeroCopy for InitializeInsuranceFundStake {}
12140    #[automatically_derived]
12141    impl anchor_lang::InstructionData for InitializeInsuranceFundStake {}
12142    #[automatically_derived]
12143    impl ToAccountMetas for InitializeInsuranceFundStake {
12144        fn to_account_metas(&self) -> Vec<AccountMeta> {
12145            vec![
12146                AccountMeta {
12147                    pubkey: self.spot_market,
12148                    is_signer: false,
12149                    is_writable: false,
12150                },
12151                AccountMeta {
12152                    pubkey: self.insurance_fund_stake,
12153                    is_signer: false,
12154                    is_writable: true,
12155                },
12156                AccountMeta {
12157                    pubkey: self.user_stats,
12158                    is_signer: false,
12159                    is_writable: true,
12160                },
12161                AccountMeta {
12162                    pubkey: self.state,
12163                    is_signer: false,
12164                    is_writable: false,
12165                },
12166                AccountMeta {
12167                    pubkey: self.authority,
12168                    is_signer: true,
12169                    is_writable: false,
12170                },
12171                AccountMeta {
12172                    pubkey: self.payer,
12173                    is_signer: true,
12174                    is_writable: true,
12175                },
12176                AccountMeta {
12177                    pubkey: self.rent,
12178                    is_signer: false,
12179                    is_writable: false,
12180                },
12181                AccountMeta {
12182                    pubkey: self.system_program,
12183                    is_signer: false,
12184                    is_writable: false,
12185                },
12186            ]
12187        }
12188    }
12189    #[automatically_derived]
12190    impl anchor_lang::AccountSerialize for InitializeInsuranceFundStake {
12191        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
12192            if writer.write_all(Self::DISCRIMINATOR).is_err() {
12193                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
12194            }
12195            if AnchorSerialize::serialize(self, writer).is_err() {
12196                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
12197            }
12198            Ok(())
12199        }
12200    }
12201    #[automatically_derived]
12202    impl anchor_lang::AccountDeserialize for InitializeInsuranceFundStake {
12203        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
12204            let given_disc = &buf[..8];
12205            if Self::DISCRIMINATOR != given_disc {
12206                return Err(anchor_lang::error!(
12207                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
12208                ));
12209            }
12210            Self::try_deserialize_unchecked(buf)
12211        }
12212        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
12213            let mut data: &[u8] = &buf[8..];
12214            AnchorDeserialize::deserialize(&mut data)
12215                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
12216        }
12217    }
12218    #[repr(C)]
12219    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
12220    pub struct AddInsuranceFundStake {
12221        pub state: Pubkey,
12222        pub spot_market: Pubkey,
12223        pub insurance_fund_stake: Pubkey,
12224        pub user_stats: Pubkey,
12225        pub authority: Pubkey,
12226        pub spot_market_vault: Pubkey,
12227        pub insurance_fund_vault: Pubkey,
12228        pub drift_signer: Pubkey,
12229        pub user_token_account: Pubkey,
12230        pub token_program: Pubkey,
12231    }
12232    #[automatically_derived]
12233    impl anchor_lang::Discriminator for AddInsuranceFundStake {
12234        const DISCRIMINATOR: &[u8] = &[0, 49, 78, 210, 146, 42, 143, 8];
12235    }
12236    #[automatically_derived]
12237    unsafe impl anchor_lang::__private::bytemuck::Pod for AddInsuranceFundStake {}
12238    #[automatically_derived]
12239    unsafe impl anchor_lang::__private::bytemuck::Zeroable for AddInsuranceFundStake {}
12240    #[automatically_derived]
12241    impl anchor_lang::ZeroCopy for AddInsuranceFundStake {}
12242    #[automatically_derived]
12243    impl anchor_lang::InstructionData for AddInsuranceFundStake {}
12244    #[automatically_derived]
12245    impl ToAccountMetas for AddInsuranceFundStake {
12246        fn to_account_metas(&self) -> Vec<AccountMeta> {
12247            vec![
12248                AccountMeta {
12249                    pubkey: self.state,
12250                    is_signer: false,
12251                    is_writable: false,
12252                },
12253                AccountMeta {
12254                    pubkey: self.spot_market,
12255                    is_signer: false,
12256                    is_writable: true,
12257                },
12258                AccountMeta {
12259                    pubkey: self.insurance_fund_stake,
12260                    is_signer: false,
12261                    is_writable: true,
12262                },
12263                AccountMeta {
12264                    pubkey: self.user_stats,
12265                    is_signer: false,
12266                    is_writable: true,
12267                },
12268                AccountMeta {
12269                    pubkey: self.authority,
12270                    is_signer: true,
12271                    is_writable: false,
12272                },
12273                AccountMeta {
12274                    pubkey: self.spot_market_vault,
12275                    is_signer: false,
12276                    is_writable: true,
12277                },
12278                AccountMeta {
12279                    pubkey: self.insurance_fund_vault,
12280                    is_signer: false,
12281                    is_writable: true,
12282                },
12283                AccountMeta {
12284                    pubkey: self.drift_signer,
12285                    is_signer: false,
12286                    is_writable: false,
12287                },
12288                AccountMeta {
12289                    pubkey: self.user_token_account,
12290                    is_signer: false,
12291                    is_writable: true,
12292                },
12293                AccountMeta {
12294                    pubkey: self.token_program,
12295                    is_signer: false,
12296                    is_writable: false,
12297                },
12298            ]
12299        }
12300    }
12301    #[automatically_derived]
12302    impl anchor_lang::AccountSerialize for AddInsuranceFundStake {
12303        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
12304            if writer.write_all(Self::DISCRIMINATOR).is_err() {
12305                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
12306            }
12307            if AnchorSerialize::serialize(self, writer).is_err() {
12308                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
12309            }
12310            Ok(())
12311        }
12312    }
12313    #[automatically_derived]
12314    impl anchor_lang::AccountDeserialize for AddInsuranceFundStake {
12315        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
12316            let given_disc = &buf[..8];
12317            if Self::DISCRIMINATOR != given_disc {
12318                return Err(anchor_lang::error!(
12319                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
12320                ));
12321            }
12322            Self::try_deserialize_unchecked(buf)
12323        }
12324        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
12325            let mut data: &[u8] = &buf[8..];
12326            AnchorDeserialize::deserialize(&mut data)
12327                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
12328        }
12329    }
12330    #[repr(C)]
12331    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
12332    pub struct RequestRemoveInsuranceFundStake {
12333        pub spot_market: Pubkey,
12334        pub insurance_fund_stake: Pubkey,
12335        pub user_stats: Pubkey,
12336        pub authority: Pubkey,
12337        pub insurance_fund_vault: Pubkey,
12338    }
12339    #[automatically_derived]
12340    impl anchor_lang::Discriminator for RequestRemoveInsuranceFundStake {
12341        const DISCRIMINATOR: &[u8] = &[19, 15, 248, 88, 171, 187, 152, 24];
12342    }
12343    #[automatically_derived]
12344    unsafe impl anchor_lang::__private::bytemuck::Pod for RequestRemoveInsuranceFundStake {}
12345    #[automatically_derived]
12346    unsafe impl anchor_lang::__private::bytemuck::Zeroable for RequestRemoveInsuranceFundStake {}
12347    #[automatically_derived]
12348    impl anchor_lang::ZeroCopy for RequestRemoveInsuranceFundStake {}
12349    #[automatically_derived]
12350    impl anchor_lang::InstructionData for RequestRemoveInsuranceFundStake {}
12351    #[automatically_derived]
12352    impl ToAccountMetas for RequestRemoveInsuranceFundStake {
12353        fn to_account_metas(&self) -> Vec<AccountMeta> {
12354            vec![
12355                AccountMeta {
12356                    pubkey: self.spot_market,
12357                    is_signer: false,
12358                    is_writable: true,
12359                },
12360                AccountMeta {
12361                    pubkey: self.insurance_fund_stake,
12362                    is_signer: false,
12363                    is_writable: true,
12364                },
12365                AccountMeta {
12366                    pubkey: self.user_stats,
12367                    is_signer: false,
12368                    is_writable: true,
12369                },
12370                AccountMeta {
12371                    pubkey: self.authority,
12372                    is_signer: true,
12373                    is_writable: false,
12374                },
12375                AccountMeta {
12376                    pubkey: self.insurance_fund_vault,
12377                    is_signer: false,
12378                    is_writable: true,
12379                },
12380            ]
12381        }
12382    }
12383    #[automatically_derived]
12384    impl anchor_lang::AccountSerialize for RequestRemoveInsuranceFundStake {
12385        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
12386            if writer.write_all(Self::DISCRIMINATOR).is_err() {
12387                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
12388            }
12389            if AnchorSerialize::serialize(self, writer).is_err() {
12390                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
12391            }
12392            Ok(())
12393        }
12394    }
12395    #[automatically_derived]
12396    impl anchor_lang::AccountDeserialize for RequestRemoveInsuranceFundStake {
12397        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
12398            let given_disc = &buf[..8];
12399            if Self::DISCRIMINATOR != given_disc {
12400                return Err(anchor_lang::error!(
12401                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
12402                ));
12403            }
12404            Self::try_deserialize_unchecked(buf)
12405        }
12406        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
12407            let mut data: &[u8] = &buf[8..];
12408            AnchorDeserialize::deserialize(&mut data)
12409                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
12410        }
12411    }
12412    #[repr(C)]
12413    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
12414    pub struct CancelRequestRemoveInsuranceFundStake {
12415        pub spot_market: Pubkey,
12416        pub insurance_fund_stake: Pubkey,
12417        pub user_stats: Pubkey,
12418        pub authority: Pubkey,
12419        pub insurance_fund_vault: Pubkey,
12420    }
12421    #[automatically_derived]
12422    impl anchor_lang::Discriminator for CancelRequestRemoveInsuranceFundStake {
12423        const DISCRIMINATOR: &[u8] = &[143, 95, 196, 57, 1, 17, 40, 153];
12424    }
12425    #[automatically_derived]
12426    unsafe impl anchor_lang::__private::bytemuck::Pod for CancelRequestRemoveInsuranceFundStake {}
12427    #[automatically_derived]
12428    unsafe impl anchor_lang::__private::bytemuck::Zeroable for CancelRequestRemoveInsuranceFundStake {}
12429    #[automatically_derived]
12430    impl anchor_lang::ZeroCopy for CancelRequestRemoveInsuranceFundStake {}
12431    #[automatically_derived]
12432    impl anchor_lang::InstructionData for CancelRequestRemoveInsuranceFundStake {}
12433    #[automatically_derived]
12434    impl ToAccountMetas for CancelRequestRemoveInsuranceFundStake {
12435        fn to_account_metas(&self) -> Vec<AccountMeta> {
12436            vec![
12437                AccountMeta {
12438                    pubkey: self.spot_market,
12439                    is_signer: false,
12440                    is_writable: true,
12441                },
12442                AccountMeta {
12443                    pubkey: self.insurance_fund_stake,
12444                    is_signer: false,
12445                    is_writable: true,
12446                },
12447                AccountMeta {
12448                    pubkey: self.user_stats,
12449                    is_signer: false,
12450                    is_writable: true,
12451                },
12452                AccountMeta {
12453                    pubkey: self.authority,
12454                    is_signer: true,
12455                    is_writable: false,
12456                },
12457                AccountMeta {
12458                    pubkey: self.insurance_fund_vault,
12459                    is_signer: false,
12460                    is_writable: true,
12461                },
12462            ]
12463        }
12464    }
12465    #[automatically_derived]
12466    impl anchor_lang::AccountSerialize for CancelRequestRemoveInsuranceFundStake {
12467        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
12468            if writer.write_all(Self::DISCRIMINATOR).is_err() {
12469                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
12470            }
12471            if AnchorSerialize::serialize(self, writer).is_err() {
12472                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
12473            }
12474            Ok(())
12475        }
12476    }
12477    #[automatically_derived]
12478    impl anchor_lang::AccountDeserialize for CancelRequestRemoveInsuranceFundStake {
12479        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
12480            let given_disc = &buf[..8];
12481            if Self::DISCRIMINATOR != given_disc {
12482                return Err(anchor_lang::error!(
12483                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
12484                ));
12485            }
12486            Self::try_deserialize_unchecked(buf)
12487        }
12488        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
12489            let mut data: &[u8] = &buf[8..];
12490            AnchorDeserialize::deserialize(&mut data)
12491                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
12492        }
12493    }
12494    #[repr(C)]
12495    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
12496    pub struct RemoveInsuranceFundStake {
12497        pub state: Pubkey,
12498        pub spot_market: Pubkey,
12499        pub insurance_fund_stake: Pubkey,
12500        pub user_stats: Pubkey,
12501        pub authority: Pubkey,
12502        pub insurance_fund_vault: Pubkey,
12503        pub drift_signer: Pubkey,
12504        pub user_token_account: Pubkey,
12505        pub token_program: Pubkey,
12506    }
12507    #[automatically_derived]
12508    impl anchor_lang::Discriminator for RemoveInsuranceFundStake {
12509        const DISCRIMINATOR: &[u8] = &[64, 21, 182, 166, 31, 13, 139, 114];
12510    }
12511    #[automatically_derived]
12512    unsafe impl anchor_lang::__private::bytemuck::Pod for RemoveInsuranceFundStake {}
12513    #[automatically_derived]
12514    unsafe impl anchor_lang::__private::bytemuck::Zeroable for RemoveInsuranceFundStake {}
12515    #[automatically_derived]
12516    impl anchor_lang::ZeroCopy for RemoveInsuranceFundStake {}
12517    #[automatically_derived]
12518    impl anchor_lang::InstructionData for RemoveInsuranceFundStake {}
12519    #[automatically_derived]
12520    impl ToAccountMetas for RemoveInsuranceFundStake {
12521        fn to_account_metas(&self) -> Vec<AccountMeta> {
12522            vec![
12523                AccountMeta {
12524                    pubkey: self.state,
12525                    is_signer: false,
12526                    is_writable: false,
12527                },
12528                AccountMeta {
12529                    pubkey: self.spot_market,
12530                    is_signer: false,
12531                    is_writable: true,
12532                },
12533                AccountMeta {
12534                    pubkey: self.insurance_fund_stake,
12535                    is_signer: false,
12536                    is_writable: true,
12537                },
12538                AccountMeta {
12539                    pubkey: self.user_stats,
12540                    is_signer: false,
12541                    is_writable: true,
12542                },
12543                AccountMeta {
12544                    pubkey: self.authority,
12545                    is_signer: true,
12546                    is_writable: false,
12547                },
12548                AccountMeta {
12549                    pubkey: self.insurance_fund_vault,
12550                    is_signer: false,
12551                    is_writable: true,
12552                },
12553                AccountMeta {
12554                    pubkey: self.drift_signer,
12555                    is_signer: false,
12556                    is_writable: false,
12557                },
12558                AccountMeta {
12559                    pubkey: self.user_token_account,
12560                    is_signer: false,
12561                    is_writable: true,
12562                },
12563                AccountMeta {
12564                    pubkey: self.token_program,
12565                    is_signer: false,
12566                    is_writable: false,
12567                },
12568            ]
12569        }
12570    }
12571    #[automatically_derived]
12572    impl anchor_lang::AccountSerialize for RemoveInsuranceFundStake {
12573        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
12574            if writer.write_all(Self::DISCRIMINATOR).is_err() {
12575                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
12576            }
12577            if AnchorSerialize::serialize(self, writer).is_err() {
12578                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
12579            }
12580            Ok(())
12581        }
12582    }
12583    #[automatically_derived]
12584    impl anchor_lang::AccountDeserialize for RemoveInsuranceFundStake {
12585        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
12586            let given_disc = &buf[..8];
12587            if Self::DISCRIMINATOR != given_disc {
12588                return Err(anchor_lang::error!(
12589                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
12590                ));
12591            }
12592            Self::try_deserialize_unchecked(buf)
12593        }
12594        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
12595            let mut data: &[u8] = &buf[8..];
12596            AnchorDeserialize::deserialize(&mut data)
12597                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
12598        }
12599    }
12600    #[repr(C)]
12601    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
12602    pub struct TransferProtocolIfShares {
12603        pub signer: Pubkey,
12604        pub transfer_config: Pubkey,
12605        pub state: Pubkey,
12606        pub spot_market: Pubkey,
12607        pub insurance_fund_stake: Pubkey,
12608        pub user_stats: Pubkey,
12609        pub authority: Pubkey,
12610        pub insurance_fund_vault: Pubkey,
12611    }
12612    #[automatically_derived]
12613    impl anchor_lang::Discriminator for TransferProtocolIfShares {
12614        const DISCRIMINATOR: &[u8] = &[113, 16, 209, 191, 115, 24, 39, 146];
12615    }
12616    #[automatically_derived]
12617    unsafe impl anchor_lang::__private::bytemuck::Pod for TransferProtocolIfShares {}
12618    #[automatically_derived]
12619    unsafe impl anchor_lang::__private::bytemuck::Zeroable for TransferProtocolIfShares {}
12620    #[automatically_derived]
12621    impl anchor_lang::ZeroCopy for TransferProtocolIfShares {}
12622    #[automatically_derived]
12623    impl anchor_lang::InstructionData for TransferProtocolIfShares {}
12624    #[automatically_derived]
12625    impl ToAccountMetas for TransferProtocolIfShares {
12626        fn to_account_metas(&self) -> Vec<AccountMeta> {
12627            vec![
12628                AccountMeta {
12629                    pubkey: self.signer,
12630                    is_signer: true,
12631                    is_writable: false,
12632                },
12633                AccountMeta {
12634                    pubkey: self.transfer_config,
12635                    is_signer: false,
12636                    is_writable: true,
12637                },
12638                AccountMeta {
12639                    pubkey: self.state,
12640                    is_signer: false,
12641                    is_writable: false,
12642                },
12643                AccountMeta {
12644                    pubkey: self.spot_market,
12645                    is_signer: false,
12646                    is_writable: true,
12647                },
12648                AccountMeta {
12649                    pubkey: self.insurance_fund_stake,
12650                    is_signer: false,
12651                    is_writable: true,
12652                },
12653                AccountMeta {
12654                    pubkey: self.user_stats,
12655                    is_signer: false,
12656                    is_writable: true,
12657                },
12658                AccountMeta {
12659                    pubkey: self.authority,
12660                    is_signer: true,
12661                    is_writable: false,
12662                },
12663                AccountMeta {
12664                    pubkey: self.insurance_fund_vault,
12665                    is_signer: false,
12666                    is_writable: false,
12667                },
12668            ]
12669        }
12670    }
12671    #[automatically_derived]
12672    impl anchor_lang::AccountSerialize for TransferProtocolIfShares {
12673        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
12674            if writer.write_all(Self::DISCRIMINATOR).is_err() {
12675                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
12676            }
12677            if AnchorSerialize::serialize(self, writer).is_err() {
12678                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
12679            }
12680            Ok(())
12681        }
12682    }
12683    #[automatically_derived]
12684    impl anchor_lang::AccountDeserialize for TransferProtocolIfShares {
12685        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
12686            let given_disc = &buf[..8];
12687            if Self::DISCRIMINATOR != given_disc {
12688                return Err(anchor_lang::error!(
12689                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
12690                ));
12691            }
12692            Self::try_deserialize_unchecked(buf)
12693        }
12694        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
12695            let mut data: &[u8] = &buf[8..];
12696            AnchorDeserialize::deserialize(&mut data)
12697                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
12698        }
12699    }
12700    #[repr(C)]
12701    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
12702    pub struct UpdatePythPullOracle {
12703        pub keeper: Pubkey,
12704        pub pyth_solana_receiver: Pubkey,
12705        pub encoded_vaa: Pubkey,
12706        pub price_feed: Pubkey,
12707    }
12708    #[automatically_derived]
12709    impl anchor_lang::Discriminator for UpdatePythPullOracle {
12710        const DISCRIMINATOR: &[u8] = &[163, 16, 49, 37, 171, 99, 61, 60];
12711    }
12712    #[automatically_derived]
12713    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdatePythPullOracle {}
12714    #[automatically_derived]
12715    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdatePythPullOracle {}
12716    #[automatically_derived]
12717    impl anchor_lang::ZeroCopy for UpdatePythPullOracle {}
12718    #[automatically_derived]
12719    impl anchor_lang::InstructionData for UpdatePythPullOracle {}
12720    #[automatically_derived]
12721    impl ToAccountMetas for UpdatePythPullOracle {
12722        fn to_account_metas(&self) -> Vec<AccountMeta> {
12723            vec![
12724                AccountMeta {
12725                    pubkey: self.keeper,
12726                    is_signer: true,
12727                    is_writable: true,
12728                },
12729                AccountMeta {
12730                    pubkey: self.pyth_solana_receiver,
12731                    is_signer: false,
12732                    is_writable: false,
12733                },
12734                AccountMeta {
12735                    pubkey: self.encoded_vaa,
12736                    is_signer: false,
12737                    is_writable: false,
12738                },
12739                AccountMeta {
12740                    pubkey: self.price_feed,
12741                    is_signer: false,
12742                    is_writable: true,
12743                },
12744            ]
12745        }
12746    }
12747    #[automatically_derived]
12748    impl anchor_lang::AccountSerialize for UpdatePythPullOracle {
12749        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
12750            if writer.write_all(Self::DISCRIMINATOR).is_err() {
12751                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
12752            }
12753            if AnchorSerialize::serialize(self, writer).is_err() {
12754                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
12755            }
12756            Ok(())
12757        }
12758    }
12759    #[automatically_derived]
12760    impl anchor_lang::AccountDeserialize for UpdatePythPullOracle {
12761        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
12762            let given_disc = &buf[..8];
12763            if Self::DISCRIMINATOR != given_disc {
12764                return Err(anchor_lang::error!(
12765                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
12766                ));
12767            }
12768            Self::try_deserialize_unchecked(buf)
12769        }
12770        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
12771            let mut data: &[u8] = &buf[8..];
12772            AnchorDeserialize::deserialize(&mut data)
12773                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
12774        }
12775    }
12776    #[repr(C)]
12777    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
12778    pub struct PostPythPullOracleUpdateAtomic {
12779        pub keeper: Pubkey,
12780        pub pyth_solana_receiver: Pubkey,
12781        pub guardian_set: Pubkey,
12782        pub price_feed: Pubkey,
12783    }
12784    #[automatically_derived]
12785    impl anchor_lang::Discriminator for PostPythPullOracleUpdateAtomic {
12786        const DISCRIMINATOR: &[u8] = &[14, 125, 28, 5, 52, 143, 144, 18];
12787    }
12788    #[automatically_derived]
12789    unsafe impl anchor_lang::__private::bytemuck::Pod for PostPythPullOracleUpdateAtomic {}
12790    #[automatically_derived]
12791    unsafe impl anchor_lang::__private::bytemuck::Zeroable for PostPythPullOracleUpdateAtomic {}
12792    #[automatically_derived]
12793    impl anchor_lang::ZeroCopy for PostPythPullOracleUpdateAtomic {}
12794    #[automatically_derived]
12795    impl anchor_lang::InstructionData for PostPythPullOracleUpdateAtomic {}
12796    #[automatically_derived]
12797    impl ToAccountMetas for PostPythPullOracleUpdateAtomic {
12798        fn to_account_metas(&self) -> Vec<AccountMeta> {
12799            vec![
12800                AccountMeta {
12801                    pubkey: self.keeper,
12802                    is_signer: true,
12803                    is_writable: true,
12804                },
12805                AccountMeta {
12806                    pubkey: self.pyth_solana_receiver,
12807                    is_signer: false,
12808                    is_writable: false,
12809                },
12810                AccountMeta {
12811                    pubkey: self.guardian_set,
12812                    is_signer: false,
12813                    is_writable: false,
12814                },
12815                AccountMeta {
12816                    pubkey: self.price_feed,
12817                    is_signer: false,
12818                    is_writable: true,
12819                },
12820            ]
12821        }
12822    }
12823    #[automatically_derived]
12824    impl anchor_lang::AccountSerialize for PostPythPullOracleUpdateAtomic {
12825        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
12826            if writer.write_all(Self::DISCRIMINATOR).is_err() {
12827                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
12828            }
12829            if AnchorSerialize::serialize(self, writer).is_err() {
12830                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
12831            }
12832            Ok(())
12833        }
12834    }
12835    #[automatically_derived]
12836    impl anchor_lang::AccountDeserialize for PostPythPullOracleUpdateAtomic {
12837        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
12838            let given_disc = &buf[..8];
12839            if Self::DISCRIMINATOR != given_disc {
12840                return Err(anchor_lang::error!(
12841                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
12842                ));
12843            }
12844            Self::try_deserialize_unchecked(buf)
12845        }
12846        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
12847            let mut data: &[u8] = &buf[8..];
12848            AnchorDeserialize::deserialize(&mut data)
12849                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
12850        }
12851    }
12852    #[repr(C)]
12853    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
12854    pub struct PostMultiPythPullOracleUpdatesAtomic {
12855        pub keeper: Pubkey,
12856        pub pyth_solana_receiver: Pubkey,
12857        pub guardian_set: Pubkey,
12858    }
12859    #[automatically_derived]
12860    impl anchor_lang::Discriminator for PostMultiPythPullOracleUpdatesAtomic {
12861        const DISCRIMINATOR: &[u8] = &[110, 234, 167, 14, 68, 55, 110, 122];
12862    }
12863    #[automatically_derived]
12864    unsafe impl anchor_lang::__private::bytemuck::Pod for PostMultiPythPullOracleUpdatesAtomic {}
12865    #[automatically_derived]
12866    unsafe impl anchor_lang::__private::bytemuck::Zeroable for PostMultiPythPullOracleUpdatesAtomic {}
12867    #[automatically_derived]
12868    impl anchor_lang::ZeroCopy for PostMultiPythPullOracleUpdatesAtomic {}
12869    #[automatically_derived]
12870    impl anchor_lang::InstructionData for PostMultiPythPullOracleUpdatesAtomic {}
12871    #[automatically_derived]
12872    impl ToAccountMetas for PostMultiPythPullOracleUpdatesAtomic {
12873        fn to_account_metas(&self) -> Vec<AccountMeta> {
12874            vec![
12875                AccountMeta {
12876                    pubkey: self.keeper,
12877                    is_signer: true,
12878                    is_writable: true,
12879                },
12880                AccountMeta {
12881                    pubkey: self.pyth_solana_receiver,
12882                    is_signer: false,
12883                    is_writable: false,
12884                },
12885                AccountMeta {
12886                    pubkey: self.guardian_set,
12887                    is_signer: false,
12888                    is_writable: false,
12889                },
12890            ]
12891        }
12892    }
12893    #[automatically_derived]
12894    impl anchor_lang::AccountSerialize for PostMultiPythPullOracleUpdatesAtomic {
12895        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
12896            if writer.write_all(Self::DISCRIMINATOR).is_err() {
12897                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
12898            }
12899            if AnchorSerialize::serialize(self, writer).is_err() {
12900                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
12901            }
12902            Ok(())
12903        }
12904    }
12905    #[automatically_derived]
12906    impl anchor_lang::AccountDeserialize for PostMultiPythPullOracleUpdatesAtomic {
12907        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
12908            let given_disc = &buf[..8];
12909            if Self::DISCRIMINATOR != given_disc {
12910                return Err(anchor_lang::error!(
12911                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
12912                ));
12913            }
12914            Self::try_deserialize_unchecked(buf)
12915        }
12916        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
12917            let mut data: &[u8] = &buf[8..];
12918            AnchorDeserialize::deserialize(&mut data)
12919                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
12920        }
12921    }
12922    #[repr(C)]
12923    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
12924    pub struct PauseSpotMarketDepositWithdraw {
12925        pub state: Pubkey,
12926        pub keeper: Pubkey,
12927        pub spot_market: Pubkey,
12928        pub spot_market_vault: Pubkey,
12929    }
12930    #[automatically_derived]
12931    impl anchor_lang::Discriminator for PauseSpotMarketDepositWithdraw {
12932        const DISCRIMINATOR: &[u8] = &[229, 56, 238, 247, 130, 249, 245, 152];
12933    }
12934    #[automatically_derived]
12935    unsafe impl anchor_lang::__private::bytemuck::Pod for PauseSpotMarketDepositWithdraw {}
12936    #[automatically_derived]
12937    unsafe impl anchor_lang::__private::bytemuck::Zeroable for PauseSpotMarketDepositWithdraw {}
12938    #[automatically_derived]
12939    impl anchor_lang::ZeroCopy for PauseSpotMarketDepositWithdraw {}
12940    #[automatically_derived]
12941    impl anchor_lang::InstructionData for PauseSpotMarketDepositWithdraw {}
12942    #[automatically_derived]
12943    impl ToAccountMetas for PauseSpotMarketDepositWithdraw {
12944        fn to_account_metas(&self) -> Vec<AccountMeta> {
12945            vec![
12946                AccountMeta {
12947                    pubkey: self.state,
12948                    is_signer: false,
12949                    is_writable: false,
12950                },
12951                AccountMeta {
12952                    pubkey: self.keeper,
12953                    is_signer: true,
12954                    is_writable: false,
12955                },
12956                AccountMeta {
12957                    pubkey: self.spot_market,
12958                    is_signer: false,
12959                    is_writable: true,
12960                },
12961                AccountMeta {
12962                    pubkey: self.spot_market_vault,
12963                    is_signer: false,
12964                    is_writable: false,
12965                },
12966            ]
12967        }
12968    }
12969    #[automatically_derived]
12970    impl anchor_lang::AccountSerialize for PauseSpotMarketDepositWithdraw {
12971        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
12972            if writer.write_all(Self::DISCRIMINATOR).is_err() {
12973                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
12974            }
12975            if AnchorSerialize::serialize(self, writer).is_err() {
12976                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
12977            }
12978            Ok(())
12979        }
12980    }
12981    #[automatically_derived]
12982    impl anchor_lang::AccountDeserialize for PauseSpotMarketDepositWithdraw {
12983        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
12984            let given_disc = &buf[..8];
12985            if Self::DISCRIMINATOR != given_disc {
12986                return Err(anchor_lang::error!(
12987                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
12988                ));
12989            }
12990            Self::try_deserialize_unchecked(buf)
12991        }
12992        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
12993            let mut data: &[u8] = &buf[8..];
12994            AnchorDeserialize::deserialize(&mut data)
12995                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
12996        }
12997    }
12998    #[repr(C)]
12999    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
13000    pub struct Initialize {
13001        pub admin: Pubkey,
13002        pub state: Pubkey,
13003        pub quote_asset_mint: Pubkey,
13004        pub drift_signer: Pubkey,
13005        pub rent: Pubkey,
13006        pub system_program: Pubkey,
13007        pub token_program: Pubkey,
13008    }
13009    #[automatically_derived]
13010    impl anchor_lang::Discriminator for Initialize {
13011        const DISCRIMINATOR: &[u8] = &[131, 246, 167, 36, 232, 249, 207, 142];
13012    }
13013    #[automatically_derived]
13014    unsafe impl anchor_lang::__private::bytemuck::Pod for Initialize {}
13015    #[automatically_derived]
13016    unsafe impl anchor_lang::__private::bytemuck::Zeroable for Initialize {}
13017    #[automatically_derived]
13018    impl anchor_lang::ZeroCopy for Initialize {}
13019    #[automatically_derived]
13020    impl anchor_lang::InstructionData for Initialize {}
13021    #[automatically_derived]
13022    impl ToAccountMetas for Initialize {
13023        fn to_account_metas(&self) -> Vec<AccountMeta> {
13024            vec![
13025                AccountMeta {
13026                    pubkey: self.admin,
13027                    is_signer: true,
13028                    is_writable: true,
13029                },
13030                AccountMeta {
13031                    pubkey: self.state,
13032                    is_signer: false,
13033                    is_writable: true,
13034                },
13035                AccountMeta {
13036                    pubkey: self.quote_asset_mint,
13037                    is_signer: false,
13038                    is_writable: false,
13039                },
13040                AccountMeta {
13041                    pubkey: self.drift_signer,
13042                    is_signer: false,
13043                    is_writable: false,
13044                },
13045                AccountMeta {
13046                    pubkey: self.rent,
13047                    is_signer: false,
13048                    is_writable: false,
13049                },
13050                AccountMeta {
13051                    pubkey: self.system_program,
13052                    is_signer: false,
13053                    is_writable: false,
13054                },
13055                AccountMeta {
13056                    pubkey: self.token_program,
13057                    is_signer: false,
13058                    is_writable: false,
13059                },
13060            ]
13061        }
13062    }
13063    #[automatically_derived]
13064    impl anchor_lang::AccountSerialize for Initialize {
13065        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
13066            if writer.write_all(Self::DISCRIMINATOR).is_err() {
13067                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
13068            }
13069            if AnchorSerialize::serialize(self, writer).is_err() {
13070                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
13071            }
13072            Ok(())
13073        }
13074    }
13075    #[automatically_derived]
13076    impl anchor_lang::AccountDeserialize for Initialize {
13077        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
13078            let given_disc = &buf[..8];
13079            if Self::DISCRIMINATOR != given_disc {
13080                return Err(anchor_lang::error!(
13081                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
13082                ));
13083            }
13084            Self::try_deserialize_unchecked(buf)
13085        }
13086        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
13087            let mut data: &[u8] = &buf[8..];
13088            AnchorDeserialize::deserialize(&mut data)
13089                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
13090        }
13091    }
13092    #[repr(C)]
13093    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
13094    pub struct InitializeSpotMarket {
13095        pub spot_market: Pubkey,
13096        pub spot_market_mint: Pubkey,
13097        pub spot_market_vault: Pubkey,
13098        pub insurance_fund_vault: Pubkey,
13099        pub drift_signer: Pubkey,
13100        pub state: Pubkey,
13101        pub oracle: Pubkey,
13102        pub admin: Pubkey,
13103        pub rent: Pubkey,
13104        pub system_program: Pubkey,
13105        pub token_program: Pubkey,
13106    }
13107    #[automatically_derived]
13108    impl anchor_lang::Discriminator for InitializeSpotMarket {
13109        const DISCRIMINATOR: &[u8] = &[71, 64, 197, 212, 23, 44, 156, 75];
13110    }
13111    #[automatically_derived]
13112    unsafe impl anchor_lang::__private::bytemuck::Pod for InitializeSpotMarket {}
13113    #[automatically_derived]
13114    unsafe impl anchor_lang::__private::bytemuck::Zeroable for InitializeSpotMarket {}
13115    #[automatically_derived]
13116    impl anchor_lang::ZeroCopy for InitializeSpotMarket {}
13117    #[automatically_derived]
13118    impl anchor_lang::InstructionData for InitializeSpotMarket {}
13119    #[automatically_derived]
13120    impl ToAccountMetas for InitializeSpotMarket {
13121        fn to_account_metas(&self) -> Vec<AccountMeta> {
13122            vec![
13123                AccountMeta {
13124                    pubkey: self.spot_market,
13125                    is_signer: false,
13126                    is_writable: true,
13127                },
13128                AccountMeta {
13129                    pubkey: self.spot_market_mint,
13130                    is_signer: false,
13131                    is_writable: false,
13132                },
13133                AccountMeta {
13134                    pubkey: self.spot_market_vault,
13135                    is_signer: false,
13136                    is_writable: true,
13137                },
13138                AccountMeta {
13139                    pubkey: self.insurance_fund_vault,
13140                    is_signer: false,
13141                    is_writable: true,
13142                },
13143                AccountMeta {
13144                    pubkey: self.drift_signer,
13145                    is_signer: false,
13146                    is_writable: false,
13147                },
13148                AccountMeta {
13149                    pubkey: self.state,
13150                    is_signer: false,
13151                    is_writable: true,
13152                },
13153                AccountMeta {
13154                    pubkey: self.oracle,
13155                    is_signer: false,
13156                    is_writable: false,
13157                },
13158                AccountMeta {
13159                    pubkey: self.admin,
13160                    is_signer: true,
13161                    is_writable: true,
13162                },
13163                AccountMeta {
13164                    pubkey: self.rent,
13165                    is_signer: false,
13166                    is_writable: false,
13167                },
13168                AccountMeta {
13169                    pubkey: self.system_program,
13170                    is_signer: false,
13171                    is_writable: false,
13172                },
13173                AccountMeta {
13174                    pubkey: self.token_program,
13175                    is_signer: false,
13176                    is_writable: false,
13177                },
13178            ]
13179        }
13180    }
13181    #[automatically_derived]
13182    impl anchor_lang::AccountSerialize for InitializeSpotMarket {
13183        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
13184            if writer.write_all(Self::DISCRIMINATOR).is_err() {
13185                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
13186            }
13187            if AnchorSerialize::serialize(self, writer).is_err() {
13188                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
13189            }
13190            Ok(())
13191        }
13192    }
13193    #[automatically_derived]
13194    impl anchor_lang::AccountDeserialize for InitializeSpotMarket {
13195        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
13196            let given_disc = &buf[..8];
13197            if Self::DISCRIMINATOR != given_disc {
13198                return Err(anchor_lang::error!(
13199                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
13200                ));
13201            }
13202            Self::try_deserialize_unchecked(buf)
13203        }
13204        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
13205            let mut data: &[u8] = &buf[8..];
13206            AnchorDeserialize::deserialize(&mut data)
13207                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
13208        }
13209    }
13210    #[repr(C)]
13211    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
13212    pub struct DeleteInitializedSpotMarket {
13213        pub admin: Pubkey,
13214        pub state: Pubkey,
13215        pub spot_market: Pubkey,
13216        pub spot_market_vault: Pubkey,
13217        pub insurance_fund_vault: Pubkey,
13218        pub drift_signer: Pubkey,
13219        pub token_program: Pubkey,
13220    }
13221    #[automatically_derived]
13222    impl anchor_lang::Discriminator for DeleteInitializedSpotMarket {
13223        const DISCRIMINATOR: &[u8] = &[239, 247, 78, 81, 92, 141, 135, 107];
13224    }
13225    #[automatically_derived]
13226    unsafe impl anchor_lang::__private::bytemuck::Pod for DeleteInitializedSpotMarket {}
13227    #[automatically_derived]
13228    unsafe impl anchor_lang::__private::bytemuck::Zeroable for DeleteInitializedSpotMarket {}
13229    #[automatically_derived]
13230    impl anchor_lang::ZeroCopy for DeleteInitializedSpotMarket {}
13231    #[automatically_derived]
13232    impl anchor_lang::InstructionData for DeleteInitializedSpotMarket {}
13233    #[automatically_derived]
13234    impl ToAccountMetas for DeleteInitializedSpotMarket {
13235        fn to_account_metas(&self) -> Vec<AccountMeta> {
13236            vec![
13237                AccountMeta {
13238                    pubkey: self.admin,
13239                    is_signer: true,
13240                    is_writable: true,
13241                },
13242                AccountMeta {
13243                    pubkey: self.state,
13244                    is_signer: false,
13245                    is_writable: true,
13246                },
13247                AccountMeta {
13248                    pubkey: self.spot_market,
13249                    is_signer: false,
13250                    is_writable: true,
13251                },
13252                AccountMeta {
13253                    pubkey: self.spot_market_vault,
13254                    is_signer: false,
13255                    is_writable: true,
13256                },
13257                AccountMeta {
13258                    pubkey: self.insurance_fund_vault,
13259                    is_signer: false,
13260                    is_writable: true,
13261                },
13262                AccountMeta {
13263                    pubkey: self.drift_signer,
13264                    is_signer: false,
13265                    is_writable: false,
13266                },
13267                AccountMeta {
13268                    pubkey: self.token_program,
13269                    is_signer: false,
13270                    is_writable: false,
13271                },
13272            ]
13273        }
13274    }
13275    #[automatically_derived]
13276    impl anchor_lang::AccountSerialize for DeleteInitializedSpotMarket {
13277        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
13278            if writer.write_all(Self::DISCRIMINATOR).is_err() {
13279                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
13280            }
13281            if AnchorSerialize::serialize(self, writer).is_err() {
13282                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
13283            }
13284            Ok(())
13285        }
13286    }
13287    #[automatically_derived]
13288    impl anchor_lang::AccountDeserialize for DeleteInitializedSpotMarket {
13289        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
13290            let given_disc = &buf[..8];
13291            if Self::DISCRIMINATOR != given_disc {
13292                return Err(anchor_lang::error!(
13293                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
13294                ));
13295            }
13296            Self::try_deserialize_unchecked(buf)
13297        }
13298        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
13299            let mut data: &[u8] = &buf[8..];
13300            AnchorDeserialize::deserialize(&mut data)
13301                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
13302        }
13303    }
13304    #[repr(C)]
13305    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
13306    pub struct InitializeSerumFulfillmentConfig {
13307        pub base_spot_market: Pubkey,
13308        pub quote_spot_market: Pubkey,
13309        pub state: Pubkey,
13310        pub serum_program: Pubkey,
13311        pub serum_market: Pubkey,
13312        pub serum_open_orders: Pubkey,
13313        pub drift_signer: Pubkey,
13314        pub serum_fulfillment_config: Pubkey,
13315        pub admin: Pubkey,
13316        pub rent: Pubkey,
13317        pub system_program: Pubkey,
13318    }
13319    #[automatically_derived]
13320    impl anchor_lang::Discriminator for InitializeSerumFulfillmentConfig {
13321        const DISCRIMINATOR: &[u8] = &[19, 53, 42, 248, 46, 49, 92, 179];
13322    }
13323    #[automatically_derived]
13324    unsafe impl anchor_lang::__private::bytemuck::Pod for InitializeSerumFulfillmentConfig {}
13325    #[automatically_derived]
13326    unsafe impl anchor_lang::__private::bytemuck::Zeroable for InitializeSerumFulfillmentConfig {}
13327    #[automatically_derived]
13328    impl anchor_lang::ZeroCopy for InitializeSerumFulfillmentConfig {}
13329    #[automatically_derived]
13330    impl anchor_lang::InstructionData for InitializeSerumFulfillmentConfig {}
13331    #[automatically_derived]
13332    impl ToAccountMetas for InitializeSerumFulfillmentConfig {
13333        fn to_account_metas(&self) -> Vec<AccountMeta> {
13334            vec![
13335                AccountMeta {
13336                    pubkey: self.base_spot_market,
13337                    is_signer: false,
13338                    is_writable: false,
13339                },
13340                AccountMeta {
13341                    pubkey: self.quote_spot_market,
13342                    is_signer: false,
13343                    is_writable: false,
13344                },
13345                AccountMeta {
13346                    pubkey: self.state,
13347                    is_signer: false,
13348                    is_writable: true,
13349                },
13350                AccountMeta {
13351                    pubkey: self.serum_program,
13352                    is_signer: false,
13353                    is_writable: false,
13354                },
13355                AccountMeta {
13356                    pubkey: self.serum_market,
13357                    is_signer: false,
13358                    is_writable: false,
13359                },
13360                AccountMeta {
13361                    pubkey: self.serum_open_orders,
13362                    is_signer: false,
13363                    is_writable: true,
13364                },
13365                AccountMeta {
13366                    pubkey: self.drift_signer,
13367                    is_signer: false,
13368                    is_writable: false,
13369                },
13370                AccountMeta {
13371                    pubkey: self.serum_fulfillment_config,
13372                    is_signer: false,
13373                    is_writable: true,
13374                },
13375                AccountMeta {
13376                    pubkey: self.admin,
13377                    is_signer: true,
13378                    is_writable: true,
13379                },
13380                AccountMeta {
13381                    pubkey: self.rent,
13382                    is_signer: false,
13383                    is_writable: false,
13384                },
13385                AccountMeta {
13386                    pubkey: self.system_program,
13387                    is_signer: false,
13388                    is_writable: false,
13389                },
13390            ]
13391        }
13392    }
13393    #[automatically_derived]
13394    impl anchor_lang::AccountSerialize for InitializeSerumFulfillmentConfig {
13395        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
13396            if writer.write_all(Self::DISCRIMINATOR).is_err() {
13397                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
13398            }
13399            if AnchorSerialize::serialize(self, writer).is_err() {
13400                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
13401            }
13402            Ok(())
13403        }
13404    }
13405    #[automatically_derived]
13406    impl anchor_lang::AccountDeserialize for InitializeSerumFulfillmentConfig {
13407        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
13408            let given_disc = &buf[..8];
13409            if Self::DISCRIMINATOR != given_disc {
13410                return Err(anchor_lang::error!(
13411                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
13412                ));
13413            }
13414            Self::try_deserialize_unchecked(buf)
13415        }
13416        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
13417            let mut data: &[u8] = &buf[8..];
13418            AnchorDeserialize::deserialize(&mut data)
13419                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
13420        }
13421    }
13422    #[repr(C)]
13423    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
13424    pub struct UpdateSerumFulfillmentConfigStatus {
13425        pub state: Pubkey,
13426        pub serum_fulfillment_config: Pubkey,
13427        pub admin: Pubkey,
13428    }
13429    #[automatically_derived]
13430    impl anchor_lang::Discriminator for UpdateSerumFulfillmentConfigStatus {
13431        const DISCRIMINATOR: &[u8] = &[132, 84, 50, 193, 9, 204, 122, 230];
13432    }
13433    #[automatically_derived]
13434    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdateSerumFulfillmentConfigStatus {}
13435    #[automatically_derived]
13436    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdateSerumFulfillmentConfigStatus {}
13437    #[automatically_derived]
13438    impl anchor_lang::ZeroCopy for UpdateSerumFulfillmentConfigStatus {}
13439    #[automatically_derived]
13440    impl anchor_lang::InstructionData for UpdateSerumFulfillmentConfigStatus {}
13441    #[automatically_derived]
13442    impl ToAccountMetas for UpdateSerumFulfillmentConfigStatus {
13443        fn to_account_metas(&self) -> Vec<AccountMeta> {
13444            vec![
13445                AccountMeta {
13446                    pubkey: self.state,
13447                    is_signer: false,
13448                    is_writable: false,
13449                },
13450                AccountMeta {
13451                    pubkey: self.serum_fulfillment_config,
13452                    is_signer: false,
13453                    is_writable: true,
13454                },
13455                AccountMeta {
13456                    pubkey: self.admin,
13457                    is_signer: true,
13458                    is_writable: true,
13459                },
13460            ]
13461        }
13462    }
13463    #[automatically_derived]
13464    impl anchor_lang::AccountSerialize for UpdateSerumFulfillmentConfigStatus {
13465        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
13466            if writer.write_all(Self::DISCRIMINATOR).is_err() {
13467                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
13468            }
13469            if AnchorSerialize::serialize(self, writer).is_err() {
13470                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
13471            }
13472            Ok(())
13473        }
13474    }
13475    #[automatically_derived]
13476    impl anchor_lang::AccountDeserialize for UpdateSerumFulfillmentConfigStatus {
13477        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
13478            let given_disc = &buf[..8];
13479            if Self::DISCRIMINATOR != given_disc {
13480                return Err(anchor_lang::error!(
13481                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
13482                ));
13483            }
13484            Self::try_deserialize_unchecked(buf)
13485        }
13486        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
13487            let mut data: &[u8] = &buf[8..];
13488            AnchorDeserialize::deserialize(&mut data)
13489                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
13490        }
13491    }
13492    #[repr(C)]
13493    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
13494    pub struct InitializeOpenbookV2FulfillmentConfig {
13495        pub base_spot_market: Pubkey,
13496        pub quote_spot_market: Pubkey,
13497        pub state: Pubkey,
13498        pub openbook_v2_program: Pubkey,
13499        pub openbook_v2_market: Pubkey,
13500        pub drift_signer: Pubkey,
13501        pub openbook_v2_fulfillment_config: Pubkey,
13502        pub admin: Pubkey,
13503        pub rent: Pubkey,
13504        pub system_program: Pubkey,
13505    }
13506    #[automatically_derived]
13507    impl anchor_lang::Discriminator for InitializeOpenbookV2FulfillmentConfig {
13508        const DISCRIMINATOR: &[u8] = &[22, 199, 68, 220, 120, 204, 78, 80];
13509    }
13510    #[automatically_derived]
13511    unsafe impl anchor_lang::__private::bytemuck::Pod for InitializeOpenbookV2FulfillmentConfig {}
13512    #[automatically_derived]
13513    unsafe impl anchor_lang::__private::bytemuck::Zeroable for InitializeOpenbookV2FulfillmentConfig {}
13514    #[automatically_derived]
13515    impl anchor_lang::ZeroCopy for InitializeOpenbookV2FulfillmentConfig {}
13516    #[automatically_derived]
13517    impl anchor_lang::InstructionData for InitializeOpenbookV2FulfillmentConfig {}
13518    #[automatically_derived]
13519    impl ToAccountMetas for InitializeOpenbookV2FulfillmentConfig {
13520        fn to_account_metas(&self) -> Vec<AccountMeta> {
13521            vec![
13522                AccountMeta {
13523                    pubkey: self.base_spot_market,
13524                    is_signer: false,
13525                    is_writable: false,
13526                },
13527                AccountMeta {
13528                    pubkey: self.quote_spot_market,
13529                    is_signer: false,
13530                    is_writable: false,
13531                },
13532                AccountMeta {
13533                    pubkey: self.state,
13534                    is_signer: false,
13535                    is_writable: true,
13536                },
13537                AccountMeta {
13538                    pubkey: self.openbook_v2_program,
13539                    is_signer: false,
13540                    is_writable: false,
13541                },
13542                AccountMeta {
13543                    pubkey: self.openbook_v2_market,
13544                    is_signer: false,
13545                    is_writable: false,
13546                },
13547                AccountMeta {
13548                    pubkey: self.drift_signer,
13549                    is_signer: false,
13550                    is_writable: false,
13551                },
13552                AccountMeta {
13553                    pubkey: self.openbook_v2_fulfillment_config,
13554                    is_signer: false,
13555                    is_writable: true,
13556                },
13557                AccountMeta {
13558                    pubkey: self.admin,
13559                    is_signer: true,
13560                    is_writable: true,
13561                },
13562                AccountMeta {
13563                    pubkey: self.rent,
13564                    is_signer: false,
13565                    is_writable: false,
13566                },
13567                AccountMeta {
13568                    pubkey: self.system_program,
13569                    is_signer: false,
13570                    is_writable: false,
13571                },
13572            ]
13573        }
13574    }
13575    #[automatically_derived]
13576    impl anchor_lang::AccountSerialize for InitializeOpenbookV2FulfillmentConfig {
13577        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
13578            if writer.write_all(Self::DISCRIMINATOR).is_err() {
13579                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
13580            }
13581            if AnchorSerialize::serialize(self, writer).is_err() {
13582                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
13583            }
13584            Ok(())
13585        }
13586    }
13587    #[automatically_derived]
13588    impl anchor_lang::AccountDeserialize for InitializeOpenbookV2FulfillmentConfig {
13589        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
13590            let given_disc = &buf[..8];
13591            if Self::DISCRIMINATOR != given_disc {
13592                return Err(anchor_lang::error!(
13593                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
13594                ));
13595            }
13596            Self::try_deserialize_unchecked(buf)
13597        }
13598        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
13599            let mut data: &[u8] = &buf[8..];
13600            AnchorDeserialize::deserialize(&mut data)
13601                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
13602        }
13603    }
13604    #[repr(C)]
13605    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
13606    pub struct OpenbookV2FulfillmentConfigStatus {
13607        pub state: Pubkey,
13608        pub openbook_v2_fulfillment_config: Pubkey,
13609        pub admin: Pubkey,
13610    }
13611    #[automatically_derived]
13612    impl anchor_lang::Discriminator for OpenbookV2FulfillmentConfigStatus {
13613        const DISCRIMINATOR: &[u8] = &[165, 142, 230, 255, 126, 234, 45, 16];
13614    }
13615    #[automatically_derived]
13616    unsafe impl anchor_lang::__private::bytemuck::Pod for OpenbookV2FulfillmentConfigStatus {}
13617    #[automatically_derived]
13618    unsafe impl anchor_lang::__private::bytemuck::Zeroable for OpenbookV2FulfillmentConfigStatus {}
13619    #[automatically_derived]
13620    impl anchor_lang::ZeroCopy for OpenbookV2FulfillmentConfigStatus {}
13621    #[automatically_derived]
13622    impl anchor_lang::InstructionData for OpenbookV2FulfillmentConfigStatus {}
13623    #[automatically_derived]
13624    impl ToAccountMetas for OpenbookV2FulfillmentConfigStatus {
13625        fn to_account_metas(&self) -> Vec<AccountMeta> {
13626            vec![
13627                AccountMeta {
13628                    pubkey: self.state,
13629                    is_signer: false,
13630                    is_writable: false,
13631                },
13632                AccountMeta {
13633                    pubkey: self.openbook_v2_fulfillment_config,
13634                    is_signer: false,
13635                    is_writable: true,
13636                },
13637                AccountMeta {
13638                    pubkey: self.admin,
13639                    is_signer: true,
13640                    is_writable: true,
13641                },
13642            ]
13643        }
13644    }
13645    #[automatically_derived]
13646    impl anchor_lang::AccountSerialize for OpenbookV2FulfillmentConfigStatus {
13647        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
13648            if writer.write_all(Self::DISCRIMINATOR).is_err() {
13649                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
13650            }
13651            if AnchorSerialize::serialize(self, writer).is_err() {
13652                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
13653            }
13654            Ok(())
13655        }
13656    }
13657    #[automatically_derived]
13658    impl anchor_lang::AccountDeserialize for OpenbookV2FulfillmentConfigStatus {
13659        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
13660            let given_disc = &buf[..8];
13661            if Self::DISCRIMINATOR != given_disc {
13662                return Err(anchor_lang::error!(
13663                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
13664                ));
13665            }
13666            Self::try_deserialize_unchecked(buf)
13667        }
13668        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
13669            let mut data: &[u8] = &buf[8..];
13670            AnchorDeserialize::deserialize(&mut data)
13671                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
13672        }
13673    }
13674    #[repr(C)]
13675    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
13676    pub struct InitializePhoenixFulfillmentConfig {
13677        pub base_spot_market: Pubkey,
13678        pub quote_spot_market: Pubkey,
13679        pub state: Pubkey,
13680        pub phoenix_program: Pubkey,
13681        pub phoenix_market: Pubkey,
13682        pub drift_signer: Pubkey,
13683        pub phoenix_fulfillment_config: Pubkey,
13684        pub admin: Pubkey,
13685        pub rent: Pubkey,
13686        pub system_program: Pubkey,
13687    }
13688    #[automatically_derived]
13689    impl anchor_lang::Discriminator for InitializePhoenixFulfillmentConfig {
13690        const DISCRIMINATOR: &[u8] = &[62, 152, 127, 242, 21, 146, 146, 126];
13691    }
13692    #[automatically_derived]
13693    unsafe impl anchor_lang::__private::bytemuck::Pod for InitializePhoenixFulfillmentConfig {}
13694    #[automatically_derived]
13695    unsafe impl anchor_lang::__private::bytemuck::Zeroable for InitializePhoenixFulfillmentConfig {}
13696    #[automatically_derived]
13697    impl anchor_lang::ZeroCopy for InitializePhoenixFulfillmentConfig {}
13698    #[automatically_derived]
13699    impl anchor_lang::InstructionData for InitializePhoenixFulfillmentConfig {}
13700    #[automatically_derived]
13701    impl ToAccountMetas for InitializePhoenixFulfillmentConfig {
13702        fn to_account_metas(&self) -> Vec<AccountMeta> {
13703            vec![
13704                AccountMeta {
13705                    pubkey: self.base_spot_market,
13706                    is_signer: false,
13707                    is_writable: false,
13708                },
13709                AccountMeta {
13710                    pubkey: self.quote_spot_market,
13711                    is_signer: false,
13712                    is_writable: false,
13713                },
13714                AccountMeta {
13715                    pubkey: self.state,
13716                    is_signer: false,
13717                    is_writable: true,
13718                },
13719                AccountMeta {
13720                    pubkey: self.phoenix_program,
13721                    is_signer: false,
13722                    is_writable: false,
13723                },
13724                AccountMeta {
13725                    pubkey: self.phoenix_market,
13726                    is_signer: false,
13727                    is_writable: false,
13728                },
13729                AccountMeta {
13730                    pubkey: self.drift_signer,
13731                    is_signer: false,
13732                    is_writable: false,
13733                },
13734                AccountMeta {
13735                    pubkey: self.phoenix_fulfillment_config,
13736                    is_signer: false,
13737                    is_writable: true,
13738                },
13739                AccountMeta {
13740                    pubkey: self.admin,
13741                    is_signer: true,
13742                    is_writable: true,
13743                },
13744                AccountMeta {
13745                    pubkey: self.rent,
13746                    is_signer: false,
13747                    is_writable: false,
13748                },
13749                AccountMeta {
13750                    pubkey: self.system_program,
13751                    is_signer: false,
13752                    is_writable: false,
13753                },
13754            ]
13755        }
13756    }
13757    #[automatically_derived]
13758    impl anchor_lang::AccountSerialize for InitializePhoenixFulfillmentConfig {
13759        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
13760            if writer.write_all(Self::DISCRIMINATOR).is_err() {
13761                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
13762            }
13763            if AnchorSerialize::serialize(self, writer).is_err() {
13764                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
13765            }
13766            Ok(())
13767        }
13768    }
13769    #[automatically_derived]
13770    impl anchor_lang::AccountDeserialize for InitializePhoenixFulfillmentConfig {
13771        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
13772            let given_disc = &buf[..8];
13773            if Self::DISCRIMINATOR != given_disc {
13774                return Err(anchor_lang::error!(
13775                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
13776                ));
13777            }
13778            Self::try_deserialize_unchecked(buf)
13779        }
13780        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
13781            let mut data: &[u8] = &buf[8..];
13782            AnchorDeserialize::deserialize(&mut data)
13783                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
13784        }
13785    }
13786    #[repr(C)]
13787    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
13788    pub struct PhoenixFulfillmentConfigStatus {
13789        pub state: Pubkey,
13790        pub phoenix_fulfillment_config: Pubkey,
13791        pub admin: Pubkey,
13792    }
13793    #[automatically_derived]
13794    impl anchor_lang::Discriminator for PhoenixFulfillmentConfigStatus {
13795        const DISCRIMINATOR: &[u8] = &[220, 133, 48, 129, 233, 8, 182, 172];
13796    }
13797    #[automatically_derived]
13798    unsafe impl anchor_lang::__private::bytemuck::Pod for PhoenixFulfillmentConfigStatus {}
13799    #[automatically_derived]
13800    unsafe impl anchor_lang::__private::bytemuck::Zeroable for PhoenixFulfillmentConfigStatus {}
13801    #[automatically_derived]
13802    impl anchor_lang::ZeroCopy for PhoenixFulfillmentConfigStatus {}
13803    #[automatically_derived]
13804    impl anchor_lang::InstructionData for PhoenixFulfillmentConfigStatus {}
13805    #[automatically_derived]
13806    impl ToAccountMetas for PhoenixFulfillmentConfigStatus {
13807        fn to_account_metas(&self) -> Vec<AccountMeta> {
13808            vec![
13809                AccountMeta {
13810                    pubkey: self.state,
13811                    is_signer: false,
13812                    is_writable: false,
13813                },
13814                AccountMeta {
13815                    pubkey: self.phoenix_fulfillment_config,
13816                    is_signer: false,
13817                    is_writable: true,
13818                },
13819                AccountMeta {
13820                    pubkey: self.admin,
13821                    is_signer: true,
13822                    is_writable: true,
13823                },
13824            ]
13825        }
13826    }
13827    #[automatically_derived]
13828    impl anchor_lang::AccountSerialize for PhoenixFulfillmentConfigStatus {
13829        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
13830            if writer.write_all(Self::DISCRIMINATOR).is_err() {
13831                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
13832            }
13833            if AnchorSerialize::serialize(self, writer).is_err() {
13834                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
13835            }
13836            Ok(())
13837        }
13838    }
13839    #[automatically_derived]
13840    impl anchor_lang::AccountDeserialize for PhoenixFulfillmentConfigStatus {
13841        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
13842            let given_disc = &buf[..8];
13843            if Self::DISCRIMINATOR != given_disc {
13844                return Err(anchor_lang::error!(
13845                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
13846                ));
13847            }
13848            Self::try_deserialize_unchecked(buf)
13849        }
13850        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
13851            let mut data: &[u8] = &buf[8..];
13852            AnchorDeserialize::deserialize(&mut data)
13853                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
13854        }
13855    }
13856    #[repr(C)]
13857    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
13858    pub struct UpdateSerumVault {
13859        pub state: Pubkey,
13860        pub admin: Pubkey,
13861        pub srm_vault: Pubkey,
13862    }
13863    #[automatically_derived]
13864    impl anchor_lang::Discriminator for UpdateSerumVault {
13865        const DISCRIMINATOR: &[u8] = &[156, 242, 103, 240, 181, 141, 22, 33];
13866    }
13867    #[automatically_derived]
13868    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdateSerumVault {}
13869    #[automatically_derived]
13870    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdateSerumVault {}
13871    #[automatically_derived]
13872    impl anchor_lang::ZeroCopy for UpdateSerumVault {}
13873    #[automatically_derived]
13874    impl anchor_lang::InstructionData for UpdateSerumVault {}
13875    #[automatically_derived]
13876    impl ToAccountMetas for UpdateSerumVault {
13877        fn to_account_metas(&self) -> Vec<AccountMeta> {
13878            vec![
13879                AccountMeta {
13880                    pubkey: self.state,
13881                    is_signer: false,
13882                    is_writable: true,
13883                },
13884                AccountMeta {
13885                    pubkey: self.admin,
13886                    is_signer: true,
13887                    is_writable: true,
13888                },
13889                AccountMeta {
13890                    pubkey: self.srm_vault,
13891                    is_signer: false,
13892                    is_writable: false,
13893                },
13894            ]
13895        }
13896    }
13897    #[automatically_derived]
13898    impl anchor_lang::AccountSerialize for UpdateSerumVault {
13899        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
13900            if writer.write_all(Self::DISCRIMINATOR).is_err() {
13901                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
13902            }
13903            if AnchorSerialize::serialize(self, writer).is_err() {
13904                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
13905            }
13906            Ok(())
13907        }
13908    }
13909    #[automatically_derived]
13910    impl anchor_lang::AccountDeserialize for UpdateSerumVault {
13911        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
13912            let given_disc = &buf[..8];
13913            if Self::DISCRIMINATOR != given_disc {
13914                return Err(anchor_lang::error!(
13915                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
13916                ));
13917            }
13918            Self::try_deserialize_unchecked(buf)
13919        }
13920        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
13921            let mut data: &[u8] = &buf[8..];
13922            AnchorDeserialize::deserialize(&mut data)
13923                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
13924        }
13925    }
13926    #[repr(C)]
13927    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
13928    pub struct InitializePerpMarket {
13929        pub admin: Pubkey,
13930        pub state: Pubkey,
13931        pub perp_market: Pubkey,
13932        pub oracle: Pubkey,
13933        pub rent: Pubkey,
13934        pub system_program: Pubkey,
13935    }
13936    #[automatically_derived]
13937    impl anchor_lang::Discriminator for InitializePerpMarket {
13938        const DISCRIMINATOR: &[u8] = &[25, 16, 69, 186, 57, 158, 209, 76];
13939    }
13940    #[automatically_derived]
13941    unsafe impl anchor_lang::__private::bytemuck::Pod for InitializePerpMarket {}
13942    #[automatically_derived]
13943    unsafe impl anchor_lang::__private::bytemuck::Zeroable for InitializePerpMarket {}
13944    #[automatically_derived]
13945    impl anchor_lang::ZeroCopy for InitializePerpMarket {}
13946    #[automatically_derived]
13947    impl anchor_lang::InstructionData for InitializePerpMarket {}
13948    #[automatically_derived]
13949    impl ToAccountMetas for InitializePerpMarket {
13950        fn to_account_metas(&self) -> Vec<AccountMeta> {
13951            vec![
13952                AccountMeta {
13953                    pubkey: self.admin,
13954                    is_signer: true,
13955                    is_writable: true,
13956                },
13957                AccountMeta {
13958                    pubkey: self.state,
13959                    is_signer: false,
13960                    is_writable: true,
13961                },
13962                AccountMeta {
13963                    pubkey: self.perp_market,
13964                    is_signer: false,
13965                    is_writable: true,
13966                },
13967                AccountMeta {
13968                    pubkey: self.oracle,
13969                    is_signer: false,
13970                    is_writable: false,
13971                },
13972                AccountMeta {
13973                    pubkey: self.rent,
13974                    is_signer: false,
13975                    is_writable: false,
13976                },
13977                AccountMeta {
13978                    pubkey: self.system_program,
13979                    is_signer: false,
13980                    is_writable: false,
13981                },
13982            ]
13983        }
13984    }
13985    #[automatically_derived]
13986    impl anchor_lang::AccountSerialize for InitializePerpMarket {
13987        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
13988            if writer.write_all(Self::DISCRIMINATOR).is_err() {
13989                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
13990            }
13991            if AnchorSerialize::serialize(self, writer).is_err() {
13992                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
13993            }
13994            Ok(())
13995        }
13996    }
13997    #[automatically_derived]
13998    impl anchor_lang::AccountDeserialize for InitializePerpMarket {
13999        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
14000            let given_disc = &buf[..8];
14001            if Self::DISCRIMINATOR != given_disc {
14002                return Err(anchor_lang::error!(
14003                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
14004                ));
14005            }
14006            Self::try_deserialize_unchecked(buf)
14007        }
14008        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
14009            let mut data: &[u8] = &buf[8..];
14010            AnchorDeserialize::deserialize(&mut data)
14011                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
14012        }
14013    }
14014    #[repr(C)]
14015    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
14016    pub struct InitializePredictionMarket {
14017        pub admin: Pubkey,
14018        pub state: Pubkey,
14019        pub perp_market: Pubkey,
14020    }
14021    #[automatically_derived]
14022    impl anchor_lang::Discriminator for InitializePredictionMarket {
14023        const DISCRIMINATOR: &[u8] = &[20, 122, 255, 2, 124, 75, 145, 6];
14024    }
14025    #[automatically_derived]
14026    unsafe impl anchor_lang::__private::bytemuck::Pod for InitializePredictionMarket {}
14027    #[automatically_derived]
14028    unsafe impl anchor_lang::__private::bytemuck::Zeroable for InitializePredictionMarket {}
14029    #[automatically_derived]
14030    impl anchor_lang::ZeroCopy for InitializePredictionMarket {}
14031    #[automatically_derived]
14032    impl anchor_lang::InstructionData for InitializePredictionMarket {}
14033    #[automatically_derived]
14034    impl ToAccountMetas for InitializePredictionMarket {
14035        fn to_account_metas(&self) -> Vec<AccountMeta> {
14036            vec![
14037                AccountMeta {
14038                    pubkey: self.admin,
14039                    is_signer: true,
14040                    is_writable: false,
14041                },
14042                AccountMeta {
14043                    pubkey: self.state,
14044                    is_signer: false,
14045                    is_writable: false,
14046                },
14047                AccountMeta {
14048                    pubkey: self.perp_market,
14049                    is_signer: false,
14050                    is_writable: true,
14051                },
14052            ]
14053        }
14054    }
14055    #[automatically_derived]
14056    impl anchor_lang::AccountSerialize for InitializePredictionMarket {
14057        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
14058            if writer.write_all(Self::DISCRIMINATOR).is_err() {
14059                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
14060            }
14061            if AnchorSerialize::serialize(self, writer).is_err() {
14062                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
14063            }
14064            Ok(())
14065        }
14066    }
14067    #[automatically_derived]
14068    impl anchor_lang::AccountDeserialize for InitializePredictionMarket {
14069        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
14070            let given_disc = &buf[..8];
14071            if Self::DISCRIMINATOR != given_disc {
14072                return Err(anchor_lang::error!(
14073                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
14074                ));
14075            }
14076            Self::try_deserialize_unchecked(buf)
14077        }
14078        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
14079            let mut data: &[u8] = &buf[8..];
14080            AnchorDeserialize::deserialize(&mut data)
14081                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
14082        }
14083    }
14084    #[repr(C)]
14085    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
14086    pub struct DeleteInitializedPerpMarket {
14087        pub admin: Pubkey,
14088        pub state: Pubkey,
14089        pub perp_market: Pubkey,
14090    }
14091    #[automatically_derived]
14092    impl anchor_lang::Discriminator for DeleteInitializedPerpMarket {
14093        const DISCRIMINATOR: &[u8] = &[40, 7, 193, 147, 191, 12, 100, 252];
14094    }
14095    #[automatically_derived]
14096    unsafe impl anchor_lang::__private::bytemuck::Pod for DeleteInitializedPerpMarket {}
14097    #[automatically_derived]
14098    unsafe impl anchor_lang::__private::bytemuck::Zeroable for DeleteInitializedPerpMarket {}
14099    #[automatically_derived]
14100    impl anchor_lang::ZeroCopy for DeleteInitializedPerpMarket {}
14101    #[automatically_derived]
14102    impl anchor_lang::InstructionData for DeleteInitializedPerpMarket {}
14103    #[automatically_derived]
14104    impl ToAccountMetas for DeleteInitializedPerpMarket {
14105        fn to_account_metas(&self) -> Vec<AccountMeta> {
14106            vec![
14107                AccountMeta {
14108                    pubkey: self.admin,
14109                    is_signer: true,
14110                    is_writable: true,
14111                },
14112                AccountMeta {
14113                    pubkey: self.state,
14114                    is_signer: false,
14115                    is_writable: true,
14116                },
14117                AccountMeta {
14118                    pubkey: self.perp_market,
14119                    is_signer: false,
14120                    is_writable: true,
14121                },
14122            ]
14123        }
14124    }
14125    #[automatically_derived]
14126    impl anchor_lang::AccountSerialize for DeleteInitializedPerpMarket {
14127        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
14128            if writer.write_all(Self::DISCRIMINATOR).is_err() {
14129                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
14130            }
14131            if AnchorSerialize::serialize(self, writer).is_err() {
14132                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
14133            }
14134            Ok(())
14135        }
14136    }
14137    #[automatically_derived]
14138    impl anchor_lang::AccountDeserialize for DeleteInitializedPerpMarket {
14139        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
14140            let given_disc = &buf[..8];
14141            if Self::DISCRIMINATOR != given_disc {
14142                return Err(anchor_lang::error!(
14143                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
14144                ));
14145            }
14146            Self::try_deserialize_unchecked(buf)
14147        }
14148        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
14149            let mut data: &[u8] = &buf[8..];
14150            AnchorDeserialize::deserialize(&mut data)
14151                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
14152        }
14153    }
14154    #[repr(C)]
14155    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
14156    pub struct MoveAmmPrice {
14157        pub admin: Pubkey,
14158        pub state: Pubkey,
14159        pub perp_market: Pubkey,
14160    }
14161    #[automatically_derived]
14162    impl anchor_lang::Discriminator for MoveAmmPrice {
14163        const DISCRIMINATOR: &[u8] = &[236, 153, 176, 246, 97, 108, 58, 10];
14164    }
14165    #[automatically_derived]
14166    unsafe impl anchor_lang::__private::bytemuck::Pod for MoveAmmPrice {}
14167    #[automatically_derived]
14168    unsafe impl anchor_lang::__private::bytemuck::Zeroable for MoveAmmPrice {}
14169    #[automatically_derived]
14170    impl anchor_lang::ZeroCopy for MoveAmmPrice {}
14171    #[automatically_derived]
14172    impl anchor_lang::InstructionData for MoveAmmPrice {}
14173    #[automatically_derived]
14174    impl ToAccountMetas for MoveAmmPrice {
14175        fn to_account_metas(&self) -> Vec<AccountMeta> {
14176            vec![
14177                AccountMeta {
14178                    pubkey: self.admin,
14179                    is_signer: true,
14180                    is_writable: false,
14181                },
14182                AccountMeta {
14183                    pubkey: self.state,
14184                    is_signer: false,
14185                    is_writable: false,
14186                },
14187                AccountMeta {
14188                    pubkey: self.perp_market,
14189                    is_signer: false,
14190                    is_writable: true,
14191                },
14192            ]
14193        }
14194    }
14195    #[automatically_derived]
14196    impl anchor_lang::AccountSerialize for MoveAmmPrice {
14197        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
14198            if writer.write_all(Self::DISCRIMINATOR).is_err() {
14199                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
14200            }
14201            if AnchorSerialize::serialize(self, writer).is_err() {
14202                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
14203            }
14204            Ok(())
14205        }
14206    }
14207    #[automatically_derived]
14208    impl anchor_lang::AccountDeserialize for MoveAmmPrice {
14209        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
14210            let given_disc = &buf[..8];
14211            if Self::DISCRIMINATOR != given_disc {
14212                return Err(anchor_lang::error!(
14213                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
14214                ));
14215            }
14216            Self::try_deserialize_unchecked(buf)
14217        }
14218        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
14219            let mut data: &[u8] = &buf[8..];
14220            AnchorDeserialize::deserialize(&mut data)
14221                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
14222        }
14223    }
14224    #[repr(C)]
14225    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
14226    pub struct RecenterPerpMarketAmm {
14227        pub admin: Pubkey,
14228        pub state: Pubkey,
14229        pub perp_market: Pubkey,
14230    }
14231    #[automatically_derived]
14232    impl anchor_lang::Discriminator for RecenterPerpMarketAmm {
14233        const DISCRIMINATOR: &[u8] = &[152, 45, 182, 137, 52, 102, 161, 100];
14234    }
14235    #[automatically_derived]
14236    unsafe impl anchor_lang::__private::bytemuck::Pod for RecenterPerpMarketAmm {}
14237    #[automatically_derived]
14238    unsafe impl anchor_lang::__private::bytemuck::Zeroable for RecenterPerpMarketAmm {}
14239    #[automatically_derived]
14240    impl anchor_lang::ZeroCopy for RecenterPerpMarketAmm {}
14241    #[automatically_derived]
14242    impl anchor_lang::InstructionData for RecenterPerpMarketAmm {}
14243    #[automatically_derived]
14244    impl ToAccountMetas for RecenterPerpMarketAmm {
14245        fn to_account_metas(&self) -> Vec<AccountMeta> {
14246            vec![
14247                AccountMeta {
14248                    pubkey: self.admin,
14249                    is_signer: true,
14250                    is_writable: false,
14251                },
14252                AccountMeta {
14253                    pubkey: self.state,
14254                    is_signer: false,
14255                    is_writable: false,
14256                },
14257                AccountMeta {
14258                    pubkey: self.perp_market,
14259                    is_signer: false,
14260                    is_writable: true,
14261                },
14262            ]
14263        }
14264    }
14265    #[automatically_derived]
14266    impl anchor_lang::AccountSerialize for RecenterPerpMarketAmm {
14267        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
14268            if writer.write_all(Self::DISCRIMINATOR).is_err() {
14269                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
14270            }
14271            if AnchorSerialize::serialize(self, writer).is_err() {
14272                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
14273            }
14274            Ok(())
14275        }
14276    }
14277    #[automatically_derived]
14278    impl anchor_lang::AccountDeserialize for RecenterPerpMarketAmm {
14279        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
14280            let given_disc = &buf[..8];
14281            if Self::DISCRIMINATOR != given_disc {
14282                return Err(anchor_lang::error!(
14283                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
14284                ));
14285            }
14286            Self::try_deserialize_unchecked(buf)
14287        }
14288        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
14289            let mut data: &[u8] = &buf[8..];
14290            AnchorDeserialize::deserialize(&mut data)
14291                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
14292        }
14293    }
14294    #[repr(C)]
14295    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
14296    pub struct UpdatePerpMarketAmmSummaryStats {
14297        pub admin: Pubkey,
14298        pub state: Pubkey,
14299        pub perp_market: Pubkey,
14300        pub spot_market: Pubkey,
14301        pub oracle: Pubkey,
14302    }
14303    #[automatically_derived]
14304    impl anchor_lang::Discriminator for UpdatePerpMarketAmmSummaryStats {
14305        const DISCRIMINATOR: &[u8] = &[99, 157, 213, 53, 50, 43, 173, 112];
14306    }
14307    #[automatically_derived]
14308    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdatePerpMarketAmmSummaryStats {}
14309    #[automatically_derived]
14310    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdatePerpMarketAmmSummaryStats {}
14311    #[automatically_derived]
14312    impl anchor_lang::ZeroCopy for UpdatePerpMarketAmmSummaryStats {}
14313    #[automatically_derived]
14314    impl anchor_lang::InstructionData for UpdatePerpMarketAmmSummaryStats {}
14315    #[automatically_derived]
14316    impl ToAccountMetas for UpdatePerpMarketAmmSummaryStats {
14317        fn to_account_metas(&self) -> Vec<AccountMeta> {
14318            vec![
14319                AccountMeta {
14320                    pubkey: self.admin,
14321                    is_signer: true,
14322                    is_writable: false,
14323                },
14324                AccountMeta {
14325                    pubkey: self.state,
14326                    is_signer: false,
14327                    is_writable: false,
14328                },
14329                AccountMeta {
14330                    pubkey: self.perp_market,
14331                    is_signer: false,
14332                    is_writable: true,
14333                },
14334                AccountMeta {
14335                    pubkey: self.spot_market,
14336                    is_signer: false,
14337                    is_writable: false,
14338                },
14339                AccountMeta {
14340                    pubkey: self.oracle,
14341                    is_signer: false,
14342                    is_writable: false,
14343                },
14344            ]
14345        }
14346    }
14347    #[automatically_derived]
14348    impl anchor_lang::AccountSerialize for UpdatePerpMarketAmmSummaryStats {
14349        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
14350            if writer.write_all(Self::DISCRIMINATOR).is_err() {
14351                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
14352            }
14353            if AnchorSerialize::serialize(self, writer).is_err() {
14354                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
14355            }
14356            Ok(())
14357        }
14358    }
14359    #[automatically_derived]
14360    impl anchor_lang::AccountDeserialize for UpdatePerpMarketAmmSummaryStats {
14361        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
14362            let given_disc = &buf[..8];
14363            if Self::DISCRIMINATOR != given_disc {
14364                return Err(anchor_lang::error!(
14365                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
14366                ));
14367            }
14368            Self::try_deserialize_unchecked(buf)
14369        }
14370        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
14371            let mut data: &[u8] = &buf[8..];
14372            AnchorDeserialize::deserialize(&mut data)
14373                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
14374        }
14375    }
14376    #[repr(C)]
14377    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
14378    pub struct UpdatePerpMarketExpiry {
14379        pub admin: Pubkey,
14380        pub state: Pubkey,
14381        pub perp_market: Pubkey,
14382    }
14383    #[automatically_derived]
14384    impl anchor_lang::Discriminator for UpdatePerpMarketExpiry {
14385        const DISCRIMINATOR: &[u8] = &[0, 190, 50, 234, 33, 65, 89, 123];
14386    }
14387    #[automatically_derived]
14388    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdatePerpMarketExpiry {}
14389    #[automatically_derived]
14390    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdatePerpMarketExpiry {}
14391    #[automatically_derived]
14392    impl anchor_lang::ZeroCopy for UpdatePerpMarketExpiry {}
14393    #[automatically_derived]
14394    impl anchor_lang::InstructionData for UpdatePerpMarketExpiry {}
14395    #[automatically_derived]
14396    impl ToAccountMetas for UpdatePerpMarketExpiry {
14397        fn to_account_metas(&self) -> Vec<AccountMeta> {
14398            vec![
14399                AccountMeta {
14400                    pubkey: self.admin,
14401                    is_signer: true,
14402                    is_writable: false,
14403                },
14404                AccountMeta {
14405                    pubkey: self.state,
14406                    is_signer: false,
14407                    is_writable: false,
14408                },
14409                AccountMeta {
14410                    pubkey: self.perp_market,
14411                    is_signer: false,
14412                    is_writable: true,
14413                },
14414            ]
14415        }
14416    }
14417    #[automatically_derived]
14418    impl anchor_lang::AccountSerialize for UpdatePerpMarketExpiry {
14419        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
14420            if writer.write_all(Self::DISCRIMINATOR).is_err() {
14421                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
14422            }
14423            if AnchorSerialize::serialize(self, writer).is_err() {
14424                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
14425            }
14426            Ok(())
14427        }
14428    }
14429    #[automatically_derived]
14430    impl anchor_lang::AccountDeserialize for UpdatePerpMarketExpiry {
14431        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
14432            let given_disc = &buf[..8];
14433            if Self::DISCRIMINATOR != given_disc {
14434                return Err(anchor_lang::error!(
14435                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
14436                ));
14437            }
14438            Self::try_deserialize_unchecked(buf)
14439        }
14440        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
14441            let mut data: &[u8] = &buf[8..];
14442            AnchorDeserialize::deserialize(&mut data)
14443                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
14444        }
14445    }
14446    #[repr(C)]
14447    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
14448    pub struct SettleExpiredMarketPoolsToRevenuePool {
14449        pub state: Pubkey,
14450        pub admin: Pubkey,
14451        pub spot_market: Pubkey,
14452        pub perp_market: Pubkey,
14453    }
14454    #[automatically_derived]
14455    impl anchor_lang::Discriminator for SettleExpiredMarketPoolsToRevenuePool {
14456        const DISCRIMINATOR: &[u8] = &[94, 227, 127, 9, 147, 38, 93, 45];
14457    }
14458    #[automatically_derived]
14459    unsafe impl anchor_lang::__private::bytemuck::Pod for SettleExpiredMarketPoolsToRevenuePool {}
14460    #[automatically_derived]
14461    unsafe impl anchor_lang::__private::bytemuck::Zeroable for SettleExpiredMarketPoolsToRevenuePool {}
14462    #[automatically_derived]
14463    impl anchor_lang::ZeroCopy for SettleExpiredMarketPoolsToRevenuePool {}
14464    #[automatically_derived]
14465    impl anchor_lang::InstructionData for SettleExpiredMarketPoolsToRevenuePool {}
14466    #[automatically_derived]
14467    impl ToAccountMetas for SettleExpiredMarketPoolsToRevenuePool {
14468        fn to_account_metas(&self) -> Vec<AccountMeta> {
14469            vec![
14470                AccountMeta {
14471                    pubkey: self.state,
14472                    is_signer: false,
14473                    is_writable: false,
14474                },
14475                AccountMeta {
14476                    pubkey: self.admin,
14477                    is_signer: true,
14478                    is_writable: false,
14479                },
14480                AccountMeta {
14481                    pubkey: self.spot_market,
14482                    is_signer: false,
14483                    is_writable: true,
14484                },
14485                AccountMeta {
14486                    pubkey: self.perp_market,
14487                    is_signer: false,
14488                    is_writable: true,
14489                },
14490            ]
14491        }
14492    }
14493    #[automatically_derived]
14494    impl anchor_lang::AccountSerialize for SettleExpiredMarketPoolsToRevenuePool {
14495        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
14496            if writer.write_all(Self::DISCRIMINATOR).is_err() {
14497                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
14498            }
14499            if AnchorSerialize::serialize(self, writer).is_err() {
14500                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
14501            }
14502            Ok(())
14503        }
14504    }
14505    #[automatically_derived]
14506    impl anchor_lang::AccountDeserialize for SettleExpiredMarketPoolsToRevenuePool {
14507        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
14508            let given_disc = &buf[..8];
14509            if Self::DISCRIMINATOR != given_disc {
14510                return Err(anchor_lang::error!(
14511                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
14512                ));
14513            }
14514            Self::try_deserialize_unchecked(buf)
14515        }
14516        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
14517            let mut data: &[u8] = &buf[8..];
14518            AnchorDeserialize::deserialize(&mut data)
14519                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
14520        }
14521    }
14522    #[repr(C)]
14523    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
14524    pub struct DepositIntoPerpMarketFeePool {
14525        pub state: Pubkey,
14526        pub perp_market: Pubkey,
14527        pub admin: Pubkey,
14528        pub source_vault: Pubkey,
14529        pub drift_signer: Pubkey,
14530        pub quote_spot_market: Pubkey,
14531        pub spot_market_vault: Pubkey,
14532        pub token_program: Pubkey,
14533    }
14534    #[automatically_derived]
14535    impl anchor_lang::Discriminator for DepositIntoPerpMarketFeePool {
14536        const DISCRIMINATOR: &[u8] = &[135, 163, 183, 80, 184, 65, 88, 104];
14537    }
14538    #[automatically_derived]
14539    unsafe impl anchor_lang::__private::bytemuck::Pod for DepositIntoPerpMarketFeePool {}
14540    #[automatically_derived]
14541    unsafe impl anchor_lang::__private::bytemuck::Zeroable for DepositIntoPerpMarketFeePool {}
14542    #[automatically_derived]
14543    impl anchor_lang::ZeroCopy for DepositIntoPerpMarketFeePool {}
14544    #[automatically_derived]
14545    impl anchor_lang::InstructionData for DepositIntoPerpMarketFeePool {}
14546    #[automatically_derived]
14547    impl ToAccountMetas for DepositIntoPerpMarketFeePool {
14548        fn to_account_metas(&self) -> Vec<AccountMeta> {
14549            vec![
14550                AccountMeta {
14551                    pubkey: self.state,
14552                    is_signer: false,
14553                    is_writable: true,
14554                },
14555                AccountMeta {
14556                    pubkey: self.perp_market,
14557                    is_signer: false,
14558                    is_writable: true,
14559                },
14560                AccountMeta {
14561                    pubkey: self.admin,
14562                    is_signer: true,
14563                    is_writable: false,
14564                },
14565                AccountMeta {
14566                    pubkey: self.source_vault,
14567                    is_signer: false,
14568                    is_writable: true,
14569                },
14570                AccountMeta {
14571                    pubkey: self.drift_signer,
14572                    is_signer: false,
14573                    is_writable: false,
14574                },
14575                AccountMeta {
14576                    pubkey: self.quote_spot_market,
14577                    is_signer: false,
14578                    is_writable: true,
14579                },
14580                AccountMeta {
14581                    pubkey: self.spot_market_vault,
14582                    is_signer: false,
14583                    is_writable: true,
14584                },
14585                AccountMeta {
14586                    pubkey: self.token_program,
14587                    is_signer: false,
14588                    is_writable: false,
14589                },
14590            ]
14591        }
14592    }
14593    #[automatically_derived]
14594    impl anchor_lang::AccountSerialize for DepositIntoPerpMarketFeePool {
14595        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
14596            if writer.write_all(Self::DISCRIMINATOR).is_err() {
14597                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
14598            }
14599            if AnchorSerialize::serialize(self, writer).is_err() {
14600                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
14601            }
14602            Ok(())
14603        }
14604    }
14605    #[automatically_derived]
14606    impl anchor_lang::AccountDeserialize for DepositIntoPerpMarketFeePool {
14607        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
14608            let given_disc = &buf[..8];
14609            if Self::DISCRIMINATOR != given_disc {
14610                return Err(anchor_lang::error!(
14611                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
14612                ));
14613            }
14614            Self::try_deserialize_unchecked(buf)
14615        }
14616        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
14617            let mut data: &[u8] = &buf[8..];
14618            AnchorDeserialize::deserialize(&mut data)
14619                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
14620        }
14621    }
14622    #[repr(C)]
14623    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
14624    pub struct DepositIntoSpotMarketVault {
14625        pub state: Pubkey,
14626        pub spot_market: Pubkey,
14627        pub admin: Pubkey,
14628        pub source_vault: Pubkey,
14629        pub spot_market_vault: Pubkey,
14630        pub token_program: Pubkey,
14631    }
14632    #[automatically_derived]
14633    impl anchor_lang::Discriminator for DepositIntoSpotMarketVault {
14634        const DISCRIMINATOR: &[u8] = &[56, 123, 23, 107, 140, 39, 66, 245];
14635    }
14636    #[automatically_derived]
14637    unsafe impl anchor_lang::__private::bytemuck::Pod for DepositIntoSpotMarketVault {}
14638    #[automatically_derived]
14639    unsafe impl anchor_lang::__private::bytemuck::Zeroable for DepositIntoSpotMarketVault {}
14640    #[automatically_derived]
14641    impl anchor_lang::ZeroCopy for DepositIntoSpotMarketVault {}
14642    #[automatically_derived]
14643    impl anchor_lang::InstructionData for DepositIntoSpotMarketVault {}
14644    #[automatically_derived]
14645    impl ToAccountMetas for DepositIntoSpotMarketVault {
14646        fn to_account_metas(&self) -> Vec<AccountMeta> {
14647            vec![
14648                AccountMeta {
14649                    pubkey: self.state,
14650                    is_signer: false,
14651                    is_writable: false,
14652                },
14653                AccountMeta {
14654                    pubkey: self.spot_market,
14655                    is_signer: false,
14656                    is_writable: true,
14657                },
14658                AccountMeta {
14659                    pubkey: self.admin,
14660                    is_signer: true,
14661                    is_writable: false,
14662                },
14663                AccountMeta {
14664                    pubkey: self.source_vault,
14665                    is_signer: false,
14666                    is_writable: true,
14667                },
14668                AccountMeta {
14669                    pubkey: self.spot_market_vault,
14670                    is_signer: false,
14671                    is_writable: true,
14672                },
14673                AccountMeta {
14674                    pubkey: self.token_program,
14675                    is_signer: false,
14676                    is_writable: false,
14677                },
14678            ]
14679        }
14680    }
14681    #[automatically_derived]
14682    impl anchor_lang::AccountSerialize for DepositIntoSpotMarketVault {
14683        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
14684            if writer.write_all(Self::DISCRIMINATOR).is_err() {
14685                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
14686            }
14687            if AnchorSerialize::serialize(self, writer).is_err() {
14688                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
14689            }
14690            Ok(())
14691        }
14692    }
14693    #[automatically_derived]
14694    impl anchor_lang::AccountDeserialize for DepositIntoSpotMarketVault {
14695        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
14696            let given_disc = &buf[..8];
14697            if Self::DISCRIMINATOR != given_disc {
14698                return Err(anchor_lang::error!(
14699                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
14700                ));
14701            }
14702            Self::try_deserialize_unchecked(buf)
14703        }
14704        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
14705            let mut data: &[u8] = &buf[8..];
14706            AnchorDeserialize::deserialize(&mut data)
14707                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
14708        }
14709    }
14710    #[repr(C)]
14711    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
14712    pub struct DepositIntoSpotMarketRevenuePool {
14713        pub state: Pubkey,
14714        pub spot_market: Pubkey,
14715        pub authority: Pubkey,
14716        pub spot_market_vault: Pubkey,
14717        pub user_token_account: Pubkey,
14718        pub token_program: Pubkey,
14719    }
14720    #[automatically_derived]
14721    impl anchor_lang::Discriminator for DepositIntoSpotMarketRevenuePool {
14722        const DISCRIMINATOR: &[u8] = &[120, 221, 129, 235, 106, 205, 195, 210];
14723    }
14724    #[automatically_derived]
14725    unsafe impl anchor_lang::__private::bytemuck::Pod for DepositIntoSpotMarketRevenuePool {}
14726    #[automatically_derived]
14727    unsafe impl anchor_lang::__private::bytemuck::Zeroable for DepositIntoSpotMarketRevenuePool {}
14728    #[automatically_derived]
14729    impl anchor_lang::ZeroCopy for DepositIntoSpotMarketRevenuePool {}
14730    #[automatically_derived]
14731    impl anchor_lang::InstructionData for DepositIntoSpotMarketRevenuePool {}
14732    #[automatically_derived]
14733    impl ToAccountMetas for DepositIntoSpotMarketRevenuePool {
14734        fn to_account_metas(&self) -> Vec<AccountMeta> {
14735            vec![
14736                AccountMeta {
14737                    pubkey: self.state,
14738                    is_signer: false,
14739                    is_writable: false,
14740                },
14741                AccountMeta {
14742                    pubkey: self.spot_market,
14743                    is_signer: false,
14744                    is_writable: true,
14745                },
14746                AccountMeta {
14747                    pubkey: self.authority,
14748                    is_signer: true,
14749                    is_writable: true,
14750                },
14751                AccountMeta {
14752                    pubkey: self.spot_market_vault,
14753                    is_signer: false,
14754                    is_writable: true,
14755                },
14756                AccountMeta {
14757                    pubkey: self.user_token_account,
14758                    is_signer: false,
14759                    is_writable: true,
14760                },
14761                AccountMeta {
14762                    pubkey: self.token_program,
14763                    is_signer: false,
14764                    is_writable: false,
14765                },
14766            ]
14767        }
14768    }
14769    #[automatically_derived]
14770    impl anchor_lang::AccountSerialize for DepositIntoSpotMarketRevenuePool {
14771        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
14772            if writer.write_all(Self::DISCRIMINATOR).is_err() {
14773                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
14774            }
14775            if AnchorSerialize::serialize(self, writer).is_err() {
14776                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
14777            }
14778            Ok(())
14779        }
14780    }
14781    #[automatically_derived]
14782    impl anchor_lang::AccountDeserialize for DepositIntoSpotMarketRevenuePool {
14783        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
14784            let given_disc = &buf[..8];
14785            if Self::DISCRIMINATOR != given_disc {
14786                return Err(anchor_lang::error!(
14787                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
14788                ));
14789            }
14790            Self::try_deserialize_unchecked(buf)
14791        }
14792        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
14793            let mut data: &[u8] = &buf[8..];
14794            AnchorDeserialize::deserialize(&mut data)
14795                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
14796        }
14797    }
14798    #[repr(C)]
14799    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
14800    pub struct RepegAmmCurve {
14801        pub state: Pubkey,
14802        pub perp_market: Pubkey,
14803        pub oracle: Pubkey,
14804        pub admin: Pubkey,
14805    }
14806    #[automatically_derived]
14807    impl anchor_lang::Discriminator for RepegAmmCurve {
14808        const DISCRIMINATOR: &[u8] = &[183, 96, 186, 13, 27, 52, 226, 194];
14809    }
14810    #[automatically_derived]
14811    unsafe impl anchor_lang::__private::bytemuck::Pod for RepegAmmCurve {}
14812    #[automatically_derived]
14813    unsafe impl anchor_lang::__private::bytemuck::Zeroable for RepegAmmCurve {}
14814    #[automatically_derived]
14815    impl anchor_lang::ZeroCopy for RepegAmmCurve {}
14816    #[automatically_derived]
14817    impl anchor_lang::InstructionData for RepegAmmCurve {}
14818    #[automatically_derived]
14819    impl ToAccountMetas for RepegAmmCurve {
14820        fn to_account_metas(&self) -> Vec<AccountMeta> {
14821            vec![
14822                AccountMeta {
14823                    pubkey: self.state,
14824                    is_signer: false,
14825                    is_writable: false,
14826                },
14827                AccountMeta {
14828                    pubkey: self.perp_market,
14829                    is_signer: false,
14830                    is_writable: true,
14831                },
14832                AccountMeta {
14833                    pubkey: self.oracle,
14834                    is_signer: false,
14835                    is_writable: false,
14836                },
14837                AccountMeta {
14838                    pubkey: self.admin,
14839                    is_signer: true,
14840                    is_writable: false,
14841                },
14842            ]
14843        }
14844    }
14845    #[automatically_derived]
14846    impl anchor_lang::AccountSerialize for RepegAmmCurve {
14847        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
14848            if writer.write_all(Self::DISCRIMINATOR).is_err() {
14849                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
14850            }
14851            if AnchorSerialize::serialize(self, writer).is_err() {
14852                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
14853            }
14854            Ok(())
14855        }
14856    }
14857    #[automatically_derived]
14858    impl anchor_lang::AccountDeserialize for RepegAmmCurve {
14859        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
14860            let given_disc = &buf[..8];
14861            if Self::DISCRIMINATOR != given_disc {
14862                return Err(anchor_lang::error!(
14863                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
14864                ));
14865            }
14866            Self::try_deserialize_unchecked(buf)
14867        }
14868        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
14869            let mut data: &[u8] = &buf[8..];
14870            AnchorDeserialize::deserialize(&mut data)
14871                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
14872        }
14873    }
14874    #[repr(C)]
14875    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
14876    pub struct UpdatePerpMarketAmmOracleTwap {
14877        pub state: Pubkey,
14878        pub perp_market: Pubkey,
14879        pub oracle: Pubkey,
14880        pub admin: Pubkey,
14881    }
14882    #[automatically_derived]
14883    impl anchor_lang::Discriminator for UpdatePerpMarketAmmOracleTwap {
14884        const DISCRIMINATOR: &[u8] = &[4, 62, 151, 214, 85, 102, 165, 154];
14885    }
14886    #[automatically_derived]
14887    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdatePerpMarketAmmOracleTwap {}
14888    #[automatically_derived]
14889    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdatePerpMarketAmmOracleTwap {}
14890    #[automatically_derived]
14891    impl anchor_lang::ZeroCopy for UpdatePerpMarketAmmOracleTwap {}
14892    #[automatically_derived]
14893    impl anchor_lang::InstructionData for UpdatePerpMarketAmmOracleTwap {}
14894    #[automatically_derived]
14895    impl ToAccountMetas for UpdatePerpMarketAmmOracleTwap {
14896        fn to_account_metas(&self) -> Vec<AccountMeta> {
14897            vec![
14898                AccountMeta {
14899                    pubkey: self.state,
14900                    is_signer: false,
14901                    is_writable: false,
14902                },
14903                AccountMeta {
14904                    pubkey: self.perp_market,
14905                    is_signer: false,
14906                    is_writable: true,
14907                },
14908                AccountMeta {
14909                    pubkey: self.oracle,
14910                    is_signer: false,
14911                    is_writable: false,
14912                },
14913                AccountMeta {
14914                    pubkey: self.admin,
14915                    is_signer: true,
14916                    is_writable: false,
14917                },
14918            ]
14919        }
14920    }
14921    #[automatically_derived]
14922    impl anchor_lang::AccountSerialize for UpdatePerpMarketAmmOracleTwap {
14923        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
14924            if writer.write_all(Self::DISCRIMINATOR).is_err() {
14925                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
14926            }
14927            if AnchorSerialize::serialize(self, writer).is_err() {
14928                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
14929            }
14930            Ok(())
14931        }
14932    }
14933    #[automatically_derived]
14934    impl anchor_lang::AccountDeserialize for UpdatePerpMarketAmmOracleTwap {
14935        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
14936            let given_disc = &buf[..8];
14937            if Self::DISCRIMINATOR != given_disc {
14938                return Err(anchor_lang::error!(
14939                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
14940                ));
14941            }
14942            Self::try_deserialize_unchecked(buf)
14943        }
14944        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
14945            let mut data: &[u8] = &buf[8..];
14946            AnchorDeserialize::deserialize(&mut data)
14947                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
14948        }
14949    }
14950    #[repr(C)]
14951    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
14952    pub struct ResetPerpMarketAmmOracleTwap {
14953        pub state: Pubkey,
14954        pub perp_market: Pubkey,
14955        pub oracle: Pubkey,
14956        pub admin: Pubkey,
14957    }
14958    #[automatically_derived]
14959    impl anchor_lang::Discriminator for ResetPerpMarketAmmOracleTwap {
14960        const DISCRIMINATOR: &[u8] = &[31, 97, 152, 72, 18, 20, 35, 195];
14961    }
14962    #[automatically_derived]
14963    unsafe impl anchor_lang::__private::bytemuck::Pod for ResetPerpMarketAmmOracleTwap {}
14964    #[automatically_derived]
14965    unsafe impl anchor_lang::__private::bytemuck::Zeroable for ResetPerpMarketAmmOracleTwap {}
14966    #[automatically_derived]
14967    impl anchor_lang::ZeroCopy for ResetPerpMarketAmmOracleTwap {}
14968    #[automatically_derived]
14969    impl anchor_lang::InstructionData for ResetPerpMarketAmmOracleTwap {}
14970    #[automatically_derived]
14971    impl ToAccountMetas for ResetPerpMarketAmmOracleTwap {
14972        fn to_account_metas(&self) -> Vec<AccountMeta> {
14973            vec![
14974                AccountMeta {
14975                    pubkey: self.state,
14976                    is_signer: false,
14977                    is_writable: false,
14978                },
14979                AccountMeta {
14980                    pubkey: self.perp_market,
14981                    is_signer: false,
14982                    is_writable: true,
14983                },
14984                AccountMeta {
14985                    pubkey: self.oracle,
14986                    is_signer: false,
14987                    is_writable: false,
14988                },
14989                AccountMeta {
14990                    pubkey: self.admin,
14991                    is_signer: true,
14992                    is_writable: false,
14993                },
14994            ]
14995        }
14996    }
14997    #[automatically_derived]
14998    impl anchor_lang::AccountSerialize for ResetPerpMarketAmmOracleTwap {
14999        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
15000            if writer.write_all(Self::DISCRIMINATOR).is_err() {
15001                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
15002            }
15003            if AnchorSerialize::serialize(self, writer).is_err() {
15004                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
15005            }
15006            Ok(())
15007        }
15008    }
15009    #[automatically_derived]
15010    impl anchor_lang::AccountDeserialize for ResetPerpMarketAmmOracleTwap {
15011        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
15012            let given_disc = &buf[..8];
15013            if Self::DISCRIMINATOR != given_disc {
15014                return Err(anchor_lang::error!(
15015                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
15016                ));
15017            }
15018            Self::try_deserialize_unchecked(buf)
15019        }
15020        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
15021            let mut data: &[u8] = &buf[8..];
15022            AnchorDeserialize::deserialize(&mut data)
15023                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
15024        }
15025    }
15026    #[repr(C)]
15027    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
15028    pub struct UpdateK {
15029        pub admin: Pubkey,
15030        pub state: Pubkey,
15031        pub perp_market: Pubkey,
15032        pub oracle: Pubkey,
15033    }
15034    #[automatically_derived]
15035    impl anchor_lang::Discriminator for UpdateK {
15036        const DISCRIMINATOR: &[u8] = &[173, 8, 27, 196, 81, 191, 36, 109];
15037    }
15038    #[automatically_derived]
15039    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdateK {}
15040    #[automatically_derived]
15041    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdateK {}
15042    #[automatically_derived]
15043    impl anchor_lang::ZeroCopy for UpdateK {}
15044    #[automatically_derived]
15045    impl anchor_lang::InstructionData for UpdateK {}
15046    #[automatically_derived]
15047    impl ToAccountMetas for UpdateK {
15048        fn to_account_metas(&self) -> Vec<AccountMeta> {
15049            vec![
15050                AccountMeta {
15051                    pubkey: self.admin,
15052                    is_signer: true,
15053                    is_writable: false,
15054                },
15055                AccountMeta {
15056                    pubkey: self.state,
15057                    is_signer: false,
15058                    is_writable: false,
15059                },
15060                AccountMeta {
15061                    pubkey: self.perp_market,
15062                    is_signer: false,
15063                    is_writable: true,
15064                },
15065                AccountMeta {
15066                    pubkey: self.oracle,
15067                    is_signer: false,
15068                    is_writable: false,
15069                },
15070            ]
15071        }
15072    }
15073    #[automatically_derived]
15074    impl anchor_lang::AccountSerialize for UpdateK {
15075        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
15076            if writer.write_all(Self::DISCRIMINATOR).is_err() {
15077                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
15078            }
15079            if AnchorSerialize::serialize(self, writer).is_err() {
15080                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
15081            }
15082            Ok(())
15083        }
15084    }
15085    #[automatically_derived]
15086    impl anchor_lang::AccountDeserialize for UpdateK {
15087        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
15088            let given_disc = &buf[..8];
15089            if Self::DISCRIMINATOR != given_disc {
15090                return Err(anchor_lang::error!(
15091                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
15092                ));
15093            }
15094            Self::try_deserialize_unchecked(buf)
15095        }
15096        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
15097            let mut data: &[u8] = &buf[8..];
15098            AnchorDeserialize::deserialize(&mut data)
15099                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
15100        }
15101    }
15102    #[repr(C)]
15103    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
15104    pub struct UpdatePerpMarketMarginRatio {
15105        pub admin: Pubkey,
15106        pub state: Pubkey,
15107        pub perp_market: Pubkey,
15108    }
15109    #[automatically_derived]
15110    impl anchor_lang::Discriminator for UpdatePerpMarketMarginRatio {
15111        const DISCRIMINATOR: &[u8] = &[221, 168, 98, 81, 42, 207, 199, 104];
15112    }
15113    #[automatically_derived]
15114    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdatePerpMarketMarginRatio {}
15115    #[automatically_derived]
15116    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdatePerpMarketMarginRatio {}
15117    #[automatically_derived]
15118    impl anchor_lang::ZeroCopy for UpdatePerpMarketMarginRatio {}
15119    #[automatically_derived]
15120    impl anchor_lang::InstructionData for UpdatePerpMarketMarginRatio {}
15121    #[automatically_derived]
15122    impl ToAccountMetas for UpdatePerpMarketMarginRatio {
15123        fn to_account_metas(&self) -> Vec<AccountMeta> {
15124            vec![
15125                AccountMeta {
15126                    pubkey: self.admin,
15127                    is_signer: true,
15128                    is_writable: false,
15129                },
15130                AccountMeta {
15131                    pubkey: self.state,
15132                    is_signer: false,
15133                    is_writable: false,
15134                },
15135                AccountMeta {
15136                    pubkey: self.perp_market,
15137                    is_signer: false,
15138                    is_writable: true,
15139                },
15140            ]
15141        }
15142    }
15143    #[automatically_derived]
15144    impl anchor_lang::AccountSerialize for UpdatePerpMarketMarginRatio {
15145        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
15146            if writer.write_all(Self::DISCRIMINATOR).is_err() {
15147                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
15148            }
15149            if AnchorSerialize::serialize(self, writer).is_err() {
15150                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
15151            }
15152            Ok(())
15153        }
15154    }
15155    #[automatically_derived]
15156    impl anchor_lang::AccountDeserialize for UpdatePerpMarketMarginRatio {
15157        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
15158            let given_disc = &buf[..8];
15159            if Self::DISCRIMINATOR != given_disc {
15160                return Err(anchor_lang::error!(
15161                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
15162                ));
15163            }
15164            Self::try_deserialize_unchecked(buf)
15165        }
15166        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
15167            let mut data: &[u8] = &buf[8..];
15168            AnchorDeserialize::deserialize(&mut data)
15169                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
15170        }
15171    }
15172    #[repr(C)]
15173    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
15174    pub struct UpdatePerpMarketHighLeverageMarginRatio {
15175        pub admin: Pubkey,
15176        pub state: Pubkey,
15177        pub perp_market: Pubkey,
15178    }
15179    #[automatically_derived]
15180    impl anchor_lang::Discriminator for UpdatePerpMarketHighLeverageMarginRatio {
15181        const DISCRIMINATOR: &[u8] = &[94, 44, 114, 224, 250, 149, 47, 90];
15182    }
15183    #[automatically_derived]
15184    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdatePerpMarketHighLeverageMarginRatio {}
15185    #[automatically_derived]
15186    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdatePerpMarketHighLeverageMarginRatio {}
15187    #[automatically_derived]
15188    impl anchor_lang::ZeroCopy for UpdatePerpMarketHighLeverageMarginRatio {}
15189    #[automatically_derived]
15190    impl anchor_lang::InstructionData for UpdatePerpMarketHighLeverageMarginRatio {}
15191    #[automatically_derived]
15192    impl ToAccountMetas for UpdatePerpMarketHighLeverageMarginRatio {
15193        fn to_account_metas(&self) -> Vec<AccountMeta> {
15194            vec![
15195                AccountMeta {
15196                    pubkey: self.admin,
15197                    is_signer: true,
15198                    is_writable: false,
15199                },
15200                AccountMeta {
15201                    pubkey: self.state,
15202                    is_signer: false,
15203                    is_writable: false,
15204                },
15205                AccountMeta {
15206                    pubkey: self.perp_market,
15207                    is_signer: false,
15208                    is_writable: true,
15209                },
15210            ]
15211        }
15212    }
15213    #[automatically_derived]
15214    impl anchor_lang::AccountSerialize for UpdatePerpMarketHighLeverageMarginRatio {
15215        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
15216            if writer.write_all(Self::DISCRIMINATOR).is_err() {
15217                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
15218            }
15219            if AnchorSerialize::serialize(self, writer).is_err() {
15220                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
15221            }
15222            Ok(())
15223        }
15224    }
15225    #[automatically_derived]
15226    impl anchor_lang::AccountDeserialize for UpdatePerpMarketHighLeverageMarginRatio {
15227        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
15228            let given_disc = &buf[..8];
15229            if Self::DISCRIMINATOR != given_disc {
15230                return Err(anchor_lang::error!(
15231                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
15232                ));
15233            }
15234            Self::try_deserialize_unchecked(buf)
15235        }
15236        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
15237            let mut data: &[u8] = &buf[8..];
15238            AnchorDeserialize::deserialize(&mut data)
15239                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
15240        }
15241    }
15242    #[repr(C)]
15243    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
15244    pub struct UpdatePerpMarketFundingPeriod {
15245        pub admin: Pubkey,
15246        pub state: Pubkey,
15247        pub perp_market: Pubkey,
15248    }
15249    #[automatically_derived]
15250    impl anchor_lang::Discriminator for UpdatePerpMarketFundingPeriod {
15251        const DISCRIMINATOR: &[u8] = &[143, 196, 48, 65, 237, 226, 95, 77];
15252    }
15253    #[automatically_derived]
15254    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdatePerpMarketFundingPeriod {}
15255    #[automatically_derived]
15256    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdatePerpMarketFundingPeriod {}
15257    #[automatically_derived]
15258    impl anchor_lang::ZeroCopy for UpdatePerpMarketFundingPeriod {}
15259    #[automatically_derived]
15260    impl anchor_lang::InstructionData for UpdatePerpMarketFundingPeriod {}
15261    #[automatically_derived]
15262    impl ToAccountMetas for UpdatePerpMarketFundingPeriod {
15263        fn to_account_metas(&self) -> Vec<AccountMeta> {
15264            vec![
15265                AccountMeta {
15266                    pubkey: self.admin,
15267                    is_signer: true,
15268                    is_writable: false,
15269                },
15270                AccountMeta {
15271                    pubkey: self.state,
15272                    is_signer: false,
15273                    is_writable: false,
15274                },
15275                AccountMeta {
15276                    pubkey: self.perp_market,
15277                    is_signer: false,
15278                    is_writable: true,
15279                },
15280            ]
15281        }
15282    }
15283    #[automatically_derived]
15284    impl anchor_lang::AccountSerialize for UpdatePerpMarketFundingPeriod {
15285        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
15286            if writer.write_all(Self::DISCRIMINATOR).is_err() {
15287                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
15288            }
15289            if AnchorSerialize::serialize(self, writer).is_err() {
15290                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
15291            }
15292            Ok(())
15293        }
15294    }
15295    #[automatically_derived]
15296    impl anchor_lang::AccountDeserialize for UpdatePerpMarketFundingPeriod {
15297        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
15298            let given_disc = &buf[..8];
15299            if Self::DISCRIMINATOR != given_disc {
15300                return Err(anchor_lang::error!(
15301                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
15302                ));
15303            }
15304            Self::try_deserialize_unchecked(buf)
15305        }
15306        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
15307            let mut data: &[u8] = &buf[8..];
15308            AnchorDeserialize::deserialize(&mut data)
15309                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
15310        }
15311    }
15312    #[repr(C)]
15313    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
15314    pub struct UpdatePerpMarketMaxImbalances {
15315        pub admin: Pubkey,
15316        pub state: Pubkey,
15317        pub perp_market: Pubkey,
15318    }
15319    #[automatically_derived]
15320    impl anchor_lang::Discriminator for UpdatePerpMarketMaxImbalances {
15321        const DISCRIMINATOR: &[u8] = &[166, 19, 134, 181, 163, 163, 221, 128];
15322    }
15323    #[automatically_derived]
15324    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdatePerpMarketMaxImbalances {}
15325    #[automatically_derived]
15326    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdatePerpMarketMaxImbalances {}
15327    #[automatically_derived]
15328    impl anchor_lang::ZeroCopy for UpdatePerpMarketMaxImbalances {}
15329    #[automatically_derived]
15330    impl anchor_lang::InstructionData for UpdatePerpMarketMaxImbalances {}
15331    #[automatically_derived]
15332    impl ToAccountMetas for UpdatePerpMarketMaxImbalances {
15333        fn to_account_metas(&self) -> Vec<AccountMeta> {
15334            vec![
15335                AccountMeta {
15336                    pubkey: self.admin,
15337                    is_signer: true,
15338                    is_writable: false,
15339                },
15340                AccountMeta {
15341                    pubkey: self.state,
15342                    is_signer: false,
15343                    is_writable: false,
15344                },
15345                AccountMeta {
15346                    pubkey: self.perp_market,
15347                    is_signer: false,
15348                    is_writable: true,
15349                },
15350            ]
15351        }
15352    }
15353    #[automatically_derived]
15354    impl anchor_lang::AccountSerialize for UpdatePerpMarketMaxImbalances {
15355        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
15356            if writer.write_all(Self::DISCRIMINATOR).is_err() {
15357                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
15358            }
15359            if AnchorSerialize::serialize(self, writer).is_err() {
15360                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
15361            }
15362            Ok(())
15363        }
15364    }
15365    #[automatically_derived]
15366    impl anchor_lang::AccountDeserialize for UpdatePerpMarketMaxImbalances {
15367        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
15368            let given_disc = &buf[..8];
15369            if Self::DISCRIMINATOR != given_disc {
15370                return Err(anchor_lang::error!(
15371                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
15372                ));
15373            }
15374            Self::try_deserialize_unchecked(buf)
15375        }
15376        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
15377            let mut data: &[u8] = &buf[8..];
15378            AnchorDeserialize::deserialize(&mut data)
15379                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
15380        }
15381    }
15382    #[repr(C)]
15383    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
15384    pub struct UpdatePerpMarketLiquidationFee {
15385        pub admin: Pubkey,
15386        pub state: Pubkey,
15387        pub perp_market: Pubkey,
15388    }
15389    #[automatically_derived]
15390    impl anchor_lang::Discriminator for UpdatePerpMarketLiquidationFee {
15391        const DISCRIMINATOR: &[u8] = &[12, 91, 76, 183, 11, 62, 192, 215];
15392    }
15393    #[automatically_derived]
15394    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdatePerpMarketLiquidationFee {}
15395    #[automatically_derived]
15396    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdatePerpMarketLiquidationFee {}
15397    #[automatically_derived]
15398    impl anchor_lang::ZeroCopy for UpdatePerpMarketLiquidationFee {}
15399    #[automatically_derived]
15400    impl anchor_lang::InstructionData for UpdatePerpMarketLiquidationFee {}
15401    #[automatically_derived]
15402    impl ToAccountMetas for UpdatePerpMarketLiquidationFee {
15403        fn to_account_metas(&self) -> Vec<AccountMeta> {
15404            vec![
15405                AccountMeta {
15406                    pubkey: self.admin,
15407                    is_signer: true,
15408                    is_writable: false,
15409                },
15410                AccountMeta {
15411                    pubkey: self.state,
15412                    is_signer: false,
15413                    is_writable: false,
15414                },
15415                AccountMeta {
15416                    pubkey: self.perp_market,
15417                    is_signer: false,
15418                    is_writable: true,
15419                },
15420            ]
15421        }
15422    }
15423    #[automatically_derived]
15424    impl anchor_lang::AccountSerialize for UpdatePerpMarketLiquidationFee {
15425        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
15426            if writer.write_all(Self::DISCRIMINATOR).is_err() {
15427                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
15428            }
15429            if AnchorSerialize::serialize(self, writer).is_err() {
15430                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
15431            }
15432            Ok(())
15433        }
15434    }
15435    #[automatically_derived]
15436    impl anchor_lang::AccountDeserialize for UpdatePerpMarketLiquidationFee {
15437        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
15438            let given_disc = &buf[..8];
15439            if Self::DISCRIMINATOR != given_disc {
15440                return Err(anchor_lang::error!(
15441                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
15442                ));
15443            }
15444            Self::try_deserialize_unchecked(buf)
15445        }
15446        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
15447            let mut data: &[u8] = &buf[8..];
15448            AnchorDeserialize::deserialize(&mut data)
15449                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
15450        }
15451    }
15452    #[repr(C)]
15453    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
15454    pub struct UpdateInsuranceFundUnstakingPeriod {
15455        pub admin: Pubkey,
15456        pub state: Pubkey,
15457        pub spot_market: Pubkey,
15458    }
15459    #[automatically_derived]
15460    impl anchor_lang::Discriminator for UpdateInsuranceFundUnstakingPeriod {
15461        const DISCRIMINATOR: &[u8] = &[221, 191, 114, 7, 101, 250, 31, 201];
15462    }
15463    #[automatically_derived]
15464    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdateInsuranceFundUnstakingPeriod {}
15465    #[automatically_derived]
15466    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdateInsuranceFundUnstakingPeriod {}
15467    #[automatically_derived]
15468    impl anchor_lang::ZeroCopy for UpdateInsuranceFundUnstakingPeriod {}
15469    #[automatically_derived]
15470    impl anchor_lang::InstructionData for UpdateInsuranceFundUnstakingPeriod {}
15471    #[automatically_derived]
15472    impl ToAccountMetas for UpdateInsuranceFundUnstakingPeriod {
15473        fn to_account_metas(&self) -> Vec<AccountMeta> {
15474            vec![
15475                AccountMeta {
15476                    pubkey: self.admin,
15477                    is_signer: true,
15478                    is_writable: false,
15479                },
15480                AccountMeta {
15481                    pubkey: self.state,
15482                    is_signer: false,
15483                    is_writable: false,
15484                },
15485                AccountMeta {
15486                    pubkey: self.spot_market,
15487                    is_signer: false,
15488                    is_writable: true,
15489                },
15490            ]
15491        }
15492    }
15493    #[automatically_derived]
15494    impl anchor_lang::AccountSerialize for UpdateInsuranceFundUnstakingPeriod {
15495        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
15496            if writer.write_all(Self::DISCRIMINATOR).is_err() {
15497                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
15498            }
15499            if AnchorSerialize::serialize(self, writer).is_err() {
15500                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
15501            }
15502            Ok(())
15503        }
15504    }
15505    #[automatically_derived]
15506    impl anchor_lang::AccountDeserialize for UpdateInsuranceFundUnstakingPeriod {
15507        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
15508            let given_disc = &buf[..8];
15509            if Self::DISCRIMINATOR != given_disc {
15510                return Err(anchor_lang::error!(
15511                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
15512                ));
15513            }
15514            Self::try_deserialize_unchecked(buf)
15515        }
15516        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
15517            let mut data: &[u8] = &buf[8..];
15518            AnchorDeserialize::deserialize(&mut data)
15519                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
15520        }
15521    }
15522    #[repr(C)]
15523    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
15524    pub struct UpdateSpotMarketPoolId {
15525        pub admin: Pubkey,
15526        pub state: Pubkey,
15527        pub spot_market: Pubkey,
15528    }
15529    #[automatically_derived]
15530    impl anchor_lang::Discriminator for UpdateSpotMarketPoolId {
15531        const DISCRIMINATOR: &[u8] = &[221, 222, 116, 19, 147, 70, 109, 228];
15532    }
15533    #[automatically_derived]
15534    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdateSpotMarketPoolId {}
15535    #[automatically_derived]
15536    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdateSpotMarketPoolId {}
15537    #[automatically_derived]
15538    impl anchor_lang::ZeroCopy for UpdateSpotMarketPoolId {}
15539    #[automatically_derived]
15540    impl anchor_lang::InstructionData for UpdateSpotMarketPoolId {}
15541    #[automatically_derived]
15542    impl ToAccountMetas for UpdateSpotMarketPoolId {
15543        fn to_account_metas(&self) -> Vec<AccountMeta> {
15544            vec![
15545                AccountMeta {
15546                    pubkey: self.admin,
15547                    is_signer: true,
15548                    is_writable: false,
15549                },
15550                AccountMeta {
15551                    pubkey: self.state,
15552                    is_signer: false,
15553                    is_writable: false,
15554                },
15555                AccountMeta {
15556                    pubkey: self.spot_market,
15557                    is_signer: false,
15558                    is_writable: true,
15559                },
15560            ]
15561        }
15562    }
15563    #[automatically_derived]
15564    impl anchor_lang::AccountSerialize for UpdateSpotMarketPoolId {
15565        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
15566            if writer.write_all(Self::DISCRIMINATOR).is_err() {
15567                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
15568            }
15569            if AnchorSerialize::serialize(self, writer).is_err() {
15570                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
15571            }
15572            Ok(())
15573        }
15574    }
15575    #[automatically_derived]
15576    impl anchor_lang::AccountDeserialize for UpdateSpotMarketPoolId {
15577        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
15578            let given_disc = &buf[..8];
15579            if Self::DISCRIMINATOR != given_disc {
15580                return Err(anchor_lang::error!(
15581                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
15582                ));
15583            }
15584            Self::try_deserialize_unchecked(buf)
15585        }
15586        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
15587            let mut data: &[u8] = &buf[8..];
15588            AnchorDeserialize::deserialize(&mut data)
15589                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
15590        }
15591    }
15592    #[repr(C)]
15593    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
15594    pub struct UpdateSpotMarketLiquidationFee {
15595        pub admin: Pubkey,
15596        pub state: Pubkey,
15597        pub spot_market: Pubkey,
15598    }
15599    #[automatically_derived]
15600    impl anchor_lang::Discriminator for UpdateSpotMarketLiquidationFee {
15601        const DISCRIMINATOR: &[u8] = &[233, 115, 0, 78, 143, 75, 33, 75];
15602    }
15603    #[automatically_derived]
15604    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdateSpotMarketLiquidationFee {}
15605    #[automatically_derived]
15606    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdateSpotMarketLiquidationFee {}
15607    #[automatically_derived]
15608    impl anchor_lang::ZeroCopy for UpdateSpotMarketLiquidationFee {}
15609    #[automatically_derived]
15610    impl anchor_lang::InstructionData for UpdateSpotMarketLiquidationFee {}
15611    #[automatically_derived]
15612    impl ToAccountMetas for UpdateSpotMarketLiquidationFee {
15613        fn to_account_metas(&self) -> Vec<AccountMeta> {
15614            vec![
15615                AccountMeta {
15616                    pubkey: self.admin,
15617                    is_signer: true,
15618                    is_writable: false,
15619                },
15620                AccountMeta {
15621                    pubkey: self.state,
15622                    is_signer: false,
15623                    is_writable: false,
15624                },
15625                AccountMeta {
15626                    pubkey: self.spot_market,
15627                    is_signer: false,
15628                    is_writable: true,
15629                },
15630            ]
15631        }
15632    }
15633    #[automatically_derived]
15634    impl anchor_lang::AccountSerialize for UpdateSpotMarketLiquidationFee {
15635        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
15636            if writer.write_all(Self::DISCRIMINATOR).is_err() {
15637                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
15638            }
15639            if AnchorSerialize::serialize(self, writer).is_err() {
15640                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
15641            }
15642            Ok(())
15643        }
15644    }
15645    #[automatically_derived]
15646    impl anchor_lang::AccountDeserialize for UpdateSpotMarketLiquidationFee {
15647        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
15648            let given_disc = &buf[..8];
15649            if Self::DISCRIMINATOR != given_disc {
15650                return Err(anchor_lang::error!(
15651                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
15652                ));
15653            }
15654            Self::try_deserialize_unchecked(buf)
15655        }
15656        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
15657            let mut data: &[u8] = &buf[8..];
15658            AnchorDeserialize::deserialize(&mut data)
15659                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
15660        }
15661    }
15662    #[repr(C)]
15663    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
15664    pub struct UpdateWithdrawGuardThreshold {
15665        pub admin: Pubkey,
15666        pub state: Pubkey,
15667        pub spot_market: Pubkey,
15668    }
15669    #[automatically_derived]
15670    impl anchor_lang::Discriminator for UpdateWithdrawGuardThreshold {
15671        const DISCRIMINATOR: &[u8] = &[164, 77, 57, 122, 175, 179, 81, 84];
15672    }
15673    #[automatically_derived]
15674    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdateWithdrawGuardThreshold {}
15675    #[automatically_derived]
15676    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdateWithdrawGuardThreshold {}
15677    #[automatically_derived]
15678    impl anchor_lang::ZeroCopy for UpdateWithdrawGuardThreshold {}
15679    #[automatically_derived]
15680    impl anchor_lang::InstructionData for UpdateWithdrawGuardThreshold {}
15681    #[automatically_derived]
15682    impl ToAccountMetas for UpdateWithdrawGuardThreshold {
15683        fn to_account_metas(&self) -> Vec<AccountMeta> {
15684            vec![
15685                AccountMeta {
15686                    pubkey: self.admin,
15687                    is_signer: true,
15688                    is_writable: false,
15689                },
15690                AccountMeta {
15691                    pubkey: self.state,
15692                    is_signer: false,
15693                    is_writable: false,
15694                },
15695                AccountMeta {
15696                    pubkey: self.spot_market,
15697                    is_signer: false,
15698                    is_writable: true,
15699                },
15700            ]
15701        }
15702    }
15703    #[automatically_derived]
15704    impl anchor_lang::AccountSerialize for UpdateWithdrawGuardThreshold {
15705        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
15706            if writer.write_all(Self::DISCRIMINATOR).is_err() {
15707                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
15708            }
15709            if AnchorSerialize::serialize(self, writer).is_err() {
15710                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
15711            }
15712            Ok(())
15713        }
15714    }
15715    #[automatically_derived]
15716    impl anchor_lang::AccountDeserialize for UpdateWithdrawGuardThreshold {
15717        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
15718            let given_disc = &buf[..8];
15719            if Self::DISCRIMINATOR != given_disc {
15720                return Err(anchor_lang::error!(
15721                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
15722                ));
15723            }
15724            Self::try_deserialize_unchecked(buf)
15725        }
15726        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
15727            let mut data: &[u8] = &buf[8..];
15728            AnchorDeserialize::deserialize(&mut data)
15729                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
15730        }
15731    }
15732    #[repr(C)]
15733    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
15734    pub struct UpdateSpotMarketIfFactor {
15735        pub admin: Pubkey,
15736        pub state: Pubkey,
15737        pub spot_market: Pubkey,
15738    }
15739    #[automatically_derived]
15740    impl anchor_lang::Discriminator for UpdateSpotMarketIfFactor {
15741        const DISCRIMINATOR: &[u8] = &[235, 61, 57, 159, 24, 10, 159, 53];
15742    }
15743    #[automatically_derived]
15744    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdateSpotMarketIfFactor {}
15745    #[automatically_derived]
15746    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdateSpotMarketIfFactor {}
15747    #[automatically_derived]
15748    impl anchor_lang::ZeroCopy for UpdateSpotMarketIfFactor {}
15749    #[automatically_derived]
15750    impl anchor_lang::InstructionData for UpdateSpotMarketIfFactor {}
15751    #[automatically_derived]
15752    impl ToAccountMetas for UpdateSpotMarketIfFactor {
15753        fn to_account_metas(&self) -> Vec<AccountMeta> {
15754            vec![
15755                AccountMeta {
15756                    pubkey: self.admin,
15757                    is_signer: true,
15758                    is_writable: false,
15759                },
15760                AccountMeta {
15761                    pubkey: self.state,
15762                    is_signer: false,
15763                    is_writable: false,
15764                },
15765                AccountMeta {
15766                    pubkey: self.spot_market,
15767                    is_signer: false,
15768                    is_writable: true,
15769                },
15770            ]
15771        }
15772    }
15773    #[automatically_derived]
15774    impl anchor_lang::AccountSerialize for UpdateSpotMarketIfFactor {
15775        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
15776            if writer.write_all(Self::DISCRIMINATOR).is_err() {
15777                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
15778            }
15779            if AnchorSerialize::serialize(self, writer).is_err() {
15780                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
15781            }
15782            Ok(())
15783        }
15784    }
15785    #[automatically_derived]
15786    impl anchor_lang::AccountDeserialize for UpdateSpotMarketIfFactor {
15787        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
15788            let given_disc = &buf[..8];
15789            if Self::DISCRIMINATOR != given_disc {
15790                return Err(anchor_lang::error!(
15791                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
15792                ));
15793            }
15794            Self::try_deserialize_unchecked(buf)
15795        }
15796        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
15797            let mut data: &[u8] = &buf[8..];
15798            AnchorDeserialize::deserialize(&mut data)
15799                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
15800        }
15801    }
15802    #[repr(C)]
15803    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
15804    pub struct UpdateSpotMarketRevenueSettlePeriod {
15805        pub admin: Pubkey,
15806        pub state: Pubkey,
15807        pub spot_market: Pubkey,
15808    }
15809    #[automatically_derived]
15810    impl anchor_lang::Discriminator for UpdateSpotMarketRevenueSettlePeriod {
15811        const DISCRIMINATOR: &[u8] = &[251, 114, 78, 11, 27, 117, 179, 21];
15812    }
15813    #[automatically_derived]
15814    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdateSpotMarketRevenueSettlePeriod {}
15815    #[automatically_derived]
15816    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdateSpotMarketRevenueSettlePeriod {}
15817    #[automatically_derived]
15818    impl anchor_lang::ZeroCopy for UpdateSpotMarketRevenueSettlePeriod {}
15819    #[automatically_derived]
15820    impl anchor_lang::InstructionData for UpdateSpotMarketRevenueSettlePeriod {}
15821    #[automatically_derived]
15822    impl ToAccountMetas for UpdateSpotMarketRevenueSettlePeriod {
15823        fn to_account_metas(&self) -> Vec<AccountMeta> {
15824            vec![
15825                AccountMeta {
15826                    pubkey: self.admin,
15827                    is_signer: true,
15828                    is_writable: false,
15829                },
15830                AccountMeta {
15831                    pubkey: self.state,
15832                    is_signer: false,
15833                    is_writable: false,
15834                },
15835                AccountMeta {
15836                    pubkey: self.spot_market,
15837                    is_signer: false,
15838                    is_writable: true,
15839                },
15840            ]
15841        }
15842    }
15843    #[automatically_derived]
15844    impl anchor_lang::AccountSerialize for UpdateSpotMarketRevenueSettlePeriod {
15845        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
15846            if writer.write_all(Self::DISCRIMINATOR).is_err() {
15847                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
15848            }
15849            if AnchorSerialize::serialize(self, writer).is_err() {
15850                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
15851            }
15852            Ok(())
15853        }
15854    }
15855    #[automatically_derived]
15856    impl anchor_lang::AccountDeserialize for UpdateSpotMarketRevenueSettlePeriod {
15857        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
15858            let given_disc = &buf[..8];
15859            if Self::DISCRIMINATOR != given_disc {
15860                return Err(anchor_lang::error!(
15861                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
15862                ));
15863            }
15864            Self::try_deserialize_unchecked(buf)
15865        }
15866        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
15867            let mut data: &[u8] = &buf[8..];
15868            AnchorDeserialize::deserialize(&mut data)
15869                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
15870        }
15871    }
15872    #[repr(C)]
15873    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
15874    pub struct UpdateSpotMarketStatus {
15875        pub admin: Pubkey,
15876        pub state: Pubkey,
15877        pub spot_market: Pubkey,
15878    }
15879    #[automatically_derived]
15880    impl anchor_lang::Discriminator for UpdateSpotMarketStatus {
15881        const DISCRIMINATOR: &[u8] = &[39, 227, 245, 172, 81, 243, 74, 239];
15882    }
15883    #[automatically_derived]
15884    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdateSpotMarketStatus {}
15885    #[automatically_derived]
15886    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdateSpotMarketStatus {}
15887    #[automatically_derived]
15888    impl anchor_lang::ZeroCopy for UpdateSpotMarketStatus {}
15889    #[automatically_derived]
15890    impl anchor_lang::InstructionData for UpdateSpotMarketStatus {}
15891    #[automatically_derived]
15892    impl ToAccountMetas for UpdateSpotMarketStatus {
15893        fn to_account_metas(&self) -> Vec<AccountMeta> {
15894            vec![
15895                AccountMeta {
15896                    pubkey: self.admin,
15897                    is_signer: true,
15898                    is_writable: false,
15899                },
15900                AccountMeta {
15901                    pubkey: self.state,
15902                    is_signer: false,
15903                    is_writable: false,
15904                },
15905                AccountMeta {
15906                    pubkey: self.spot_market,
15907                    is_signer: false,
15908                    is_writable: true,
15909                },
15910            ]
15911        }
15912    }
15913    #[automatically_derived]
15914    impl anchor_lang::AccountSerialize for UpdateSpotMarketStatus {
15915        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
15916            if writer.write_all(Self::DISCRIMINATOR).is_err() {
15917                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
15918            }
15919            if AnchorSerialize::serialize(self, writer).is_err() {
15920                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
15921            }
15922            Ok(())
15923        }
15924    }
15925    #[automatically_derived]
15926    impl anchor_lang::AccountDeserialize for UpdateSpotMarketStatus {
15927        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
15928            let given_disc = &buf[..8];
15929            if Self::DISCRIMINATOR != given_disc {
15930                return Err(anchor_lang::error!(
15931                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
15932                ));
15933            }
15934            Self::try_deserialize_unchecked(buf)
15935        }
15936        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
15937            let mut data: &[u8] = &buf[8..];
15938            AnchorDeserialize::deserialize(&mut data)
15939                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
15940        }
15941    }
15942    #[repr(C)]
15943    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
15944    pub struct UpdateSpotMarketPausedOperations {
15945        pub admin: Pubkey,
15946        pub state: Pubkey,
15947        pub spot_market: Pubkey,
15948    }
15949    #[automatically_derived]
15950    impl anchor_lang::Discriminator for UpdateSpotMarketPausedOperations {
15951        const DISCRIMINATOR: &[u8] = &[177, 42, 203, 86, 124, 85, 32, 39];
15952    }
15953    #[automatically_derived]
15954    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdateSpotMarketPausedOperations {}
15955    #[automatically_derived]
15956    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdateSpotMarketPausedOperations {}
15957    #[automatically_derived]
15958    impl anchor_lang::ZeroCopy for UpdateSpotMarketPausedOperations {}
15959    #[automatically_derived]
15960    impl anchor_lang::InstructionData for UpdateSpotMarketPausedOperations {}
15961    #[automatically_derived]
15962    impl ToAccountMetas for UpdateSpotMarketPausedOperations {
15963        fn to_account_metas(&self) -> Vec<AccountMeta> {
15964            vec![
15965                AccountMeta {
15966                    pubkey: self.admin,
15967                    is_signer: true,
15968                    is_writable: false,
15969                },
15970                AccountMeta {
15971                    pubkey: self.state,
15972                    is_signer: false,
15973                    is_writable: false,
15974                },
15975                AccountMeta {
15976                    pubkey: self.spot_market,
15977                    is_signer: false,
15978                    is_writable: true,
15979                },
15980            ]
15981        }
15982    }
15983    #[automatically_derived]
15984    impl anchor_lang::AccountSerialize for UpdateSpotMarketPausedOperations {
15985        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
15986            if writer.write_all(Self::DISCRIMINATOR).is_err() {
15987                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
15988            }
15989            if AnchorSerialize::serialize(self, writer).is_err() {
15990                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
15991            }
15992            Ok(())
15993        }
15994    }
15995    #[automatically_derived]
15996    impl anchor_lang::AccountDeserialize for UpdateSpotMarketPausedOperations {
15997        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
15998            let given_disc = &buf[..8];
15999            if Self::DISCRIMINATOR != given_disc {
16000                return Err(anchor_lang::error!(
16001                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
16002                ));
16003            }
16004            Self::try_deserialize_unchecked(buf)
16005        }
16006        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
16007            let mut data: &[u8] = &buf[8..];
16008            AnchorDeserialize::deserialize(&mut data)
16009                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
16010        }
16011    }
16012    #[repr(C)]
16013    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
16014    pub struct UpdateSpotMarketAssetTier {
16015        pub admin: Pubkey,
16016        pub state: Pubkey,
16017        pub spot_market: Pubkey,
16018    }
16019    #[automatically_derived]
16020    impl anchor_lang::Discriminator for UpdateSpotMarketAssetTier {
16021        const DISCRIMINATOR: &[u8] = &[216, 218, 15, 206, 208, 164, 24, 163];
16022    }
16023    #[automatically_derived]
16024    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdateSpotMarketAssetTier {}
16025    #[automatically_derived]
16026    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdateSpotMarketAssetTier {}
16027    #[automatically_derived]
16028    impl anchor_lang::ZeroCopy for UpdateSpotMarketAssetTier {}
16029    #[automatically_derived]
16030    impl anchor_lang::InstructionData for UpdateSpotMarketAssetTier {}
16031    #[automatically_derived]
16032    impl ToAccountMetas for UpdateSpotMarketAssetTier {
16033        fn to_account_metas(&self) -> Vec<AccountMeta> {
16034            vec![
16035                AccountMeta {
16036                    pubkey: self.admin,
16037                    is_signer: true,
16038                    is_writable: false,
16039                },
16040                AccountMeta {
16041                    pubkey: self.state,
16042                    is_signer: false,
16043                    is_writable: false,
16044                },
16045                AccountMeta {
16046                    pubkey: self.spot_market,
16047                    is_signer: false,
16048                    is_writable: true,
16049                },
16050            ]
16051        }
16052    }
16053    #[automatically_derived]
16054    impl anchor_lang::AccountSerialize for UpdateSpotMarketAssetTier {
16055        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
16056            if writer.write_all(Self::DISCRIMINATOR).is_err() {
16057                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
16058            }
16059            if AnchorSerialize::serialize(self, writer).is_err() {
16060                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
16061            }
16062            Ok(())
16063        }
16064    }
16065    #[automatically_derived]
16066    impl anchor_lang::AccountDeserialize for UpdateSpotMarketAssetTier {
16067        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
16068            let given_disc = &buf[..8];
16069            if Self::DISCRIMINATOR != given_disc {
16070                return Err(anchor_lang::error!(
16071                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
16072                ));
16073            }
16074            Self::try_deserialize_unchecked(buf)
16075        }
16076        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
16077            let mut data: &[u8] = &buf[8..];
16078            AnchorDeserialize::deserialize(&mut data)
16079                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
16080        }
16081    }
16082    #[repr(C)]
16083    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
16084    pub struct UpdateSpotMarketMarginWeights {
16085        pub admin: Pubkey,
16086        pub state: Pubkey,
16087        pub spot_market: Pubkey,
16088    }
16089    #[automatically_derived]
16090    impl anchor_lang::Discriminator for UpdateSpotMarketMarginWeights {
16091        const DISCRIMINATOR: &[u8] = &[32, 75, 107, 180, 16, 197, 1, 38];
16092    }
16093    #[automatically_derived]
16094    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdateSpotMarketMarginWeights {}
16095    #[automatically_derived]
16096    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdateSpotMarketMarginWeights {}
16097    #[automatically_derived]
16098    impl anchor_lang::ZeroCopy for UpdateSpotMarketMarginWeights {}
16099    #[automatically_derived]
16100    impl anchor_lang::InstructionData for UpdateSpotMarketMarginWeights {}
16101    #[automatically_derived]
16102    impl ToAccountMetas for UpdateSpotMarketMarginWeights {
16103        fn to_account_metas(&self) -> Vec<AccountMeta> {
16104            vec![
16105                AccountMeta {
16106                    pubkey: self.admin,
16107                    is_signer: true,
16108                    is_writable: false,
16109                },
16110                AccountMeta {
16111                    pubkey: self.state,
16112                    is_signer: false,
16113                    is_writable: false,
16114                },
16115                AccountMeta {
16116                    pubkey: self.spot_market,
16117                    is_signer: false,
16118                    is_writable: true,
16119                },
16120            ]
16121        }
16122    }
16123    #[automatically_derived]
16124    impl anchor_lang::AccountSerialize for UpdateSpotMarketMarginWeights {
16125        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
16126            if writer.write_all(Self::DISCRIMINATOR).is_err() {
16127                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
16128            }
16129            if AnchorSerialize::serialize(self, writer).is_err() {
16130                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
16131            }
16132            Ok(())
16133        }
16134    }
16135    #[automatically_derived]
16136    impl anchor_lang::AccountDeserialize for UpdateSpotMarketMarginWeights {
16137        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
16138            let given_disc = &buf[..8];
16139            if Self::DISCRIMINATOR != given_disc {
16140                return Err(anchor_lang::error!(
16141                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
16142                ));
16143            }
16144            Self::try_deserialize_unchecked(buf)
16145        }
16146        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
16147            let mut data: &[u8] = &buf[8..];
16148            AnchorDeserialize::deserialize(&mut data)
16149                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
16150        }
16151    }
16152    #[repr(C)]
16153    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
16154    pub struct UpdateSpotMarketBorrowRate {
16155        pub admin: Pubkey,
16156        pub state: Pubkey,
16157        pub spot_market: Pubkey,
16158    }
16159    #[automatically_derived]
16160    impl anchor_lang::Discriminator for UpdateSpotMarketBorrowRate {
16161        const DISCRIMINATOR: &[u8] = &[216, 47, 114, 248, 0, 78, 173, 186];
16162    }
16163    #[automatically_derived]
16164    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdateSpotMarketBorrowRate {}
16165    #[automatically_derived]
16166    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdateSpotMarketBorrowRate {}
16167    #[automatically_derived]
16168    impl anchor_lang::ZeroCopy for UpdateSpotMarketBorrowRate {}
16169    #[automatically_derived]
16170    impl anchor_lang::InstructionData for UpdateSpotMarketBorrowRate {}
16171    #[automatically_derived]
16172    impl ToAccountMetas for UpdateSpotMarketBorrowRate {
16173        fn to_account_metas(&self) -> Vec<AccountMeta> {
16174            vec![
16175                AccountMeta {
16176                    pubkey: self.admin,
16177                    is_signer: true,
16178                    is_writable: false,
16179                },
16180                AccountMeta {
16181                    pubkey: self.state,
16182                    is_signer: false,
16183                    is_writable: false,
16184                },
16185                AccountMeta {
16186                    pubkey: self.spot_market,
16187                    is_signer: false,
16188                    is_writable: true,
16189                },
16190            ]
16191        }
16192    }
16193    #[automatically_derived]
16194    impl anchor_lang::AccountSerialize for UpdateSpotMarketBorrowRate {
16195        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
16196            if writer.write_all(Self::DISCRIMINATOR).is_err() {
16197                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
16198            }
16199            if AnchorSerialize::serialize(self, writer).is_err() {
16200                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
16201            }
16202            Ok(())
16203        }
16204    }
16205    #[automatically_derived]
16206    impl anchor_lang::AccountDeserialize for UpdateSpotMarketBorrowRate {
16207        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
16208            let given_disc = &buf[..8];
16209            if Self::DISCRIMINATOR != given_disc {
16210                return Err(anchor_lang::error!(
16211                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
16212                ));
16213            }
16214            Self::try_deserialize_unchecked(buf)
16215        }
16216        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
16217            let mut data: &[u8] = &buf[8..];
16218            AnchorDeserialize::deserialize(&mut data)
16219                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
16220        }
16221    }
16222    #[repr(C)]
16223    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
16224    pub struct UpdateSpotMarketMaxTokenDeposits {
16225        pub admin: Pubkey,
16226        pub state: Pubkey,
16227        pub spot_market: Pubkey,
16228    }
16229    #[automatically_derived]
16230    impl anchor_lang::Discriminator for UpdateSpotMarketMaxTokenDeposits {
16231        const DISCRIMINATOR: &[u8] = &[89, 241, 13, 153, 229, 206, 230, 40];
16232    }
16233    #[automatically_derived]
16234    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdateSpotMarketMaxTokenDeposits {}
16235    #[automatically_derived]
16236    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdateSpotMarketMaxTokenDeposits {}
16237    #[automatically_derived]
16238    impl anchor_lang::ZeroCopy for UpdateSpotMarketMaxTokenDeposits {}
16239    #[automatically_derived]
16240    impl anchor_lang::InstructionData for UpdateSpotMarketMaxTokenDeposits {}
16241    #[automatically_derived]
16242    impl ToAccountMetas for UpdateSpotMarketMaxTokenDeposits {
16243        fn to_account_metas(&self) -> Vec<AccountMeta> {
16244            vec![
16245                AccountMeta {
16246                    pubkey: self.admin,
16247                    is_signer: true,
16248                    is_writable: false,
16249                },
16250                AccountMeta {
16251                    pubkey: self.state,
16252                    is_signer: false,
16253                    is_writable: false,
16254                },
16255                AccountMeta {
16256                    pubkey: self.spot_market,
16257                    is_signer: false,
16258                    is_writable: true,
16259                },
16260            ]
16261        }
16262    }
16263    #[automatically_derived]
16264    impl anchor_lang::AccountSerialize for UpdateSpotMarketMaxTokenDeposits {
16265        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
16266            if writer.write_all(Self::DISCRIMINATOR).is_err() {
16267                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
16268            }
16269            if AnchorSerialize::serialize(self, writer).is_err() {
16270                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
16271            }
16272            Ok(())
16273        }
16274    }
16275    #[automatically_derived]
16276    impl anchor_lang::AccountDeserialize for UpdateSpotMarketMaxTokenDeposits {
16277        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
16278            let given_disc = &buf[..8];
16279            if Self::DISCRIMINATOR != given_disc {
16280                return Err(anchor_lang::error!(
16281                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
16282                ));
16283            }
16284            Self::try_deserialize_unchecked(buf)
16285        }
16286        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
16287            let mut data: &[u8] = &buf[8..];
16288            AnchorDeserialize::deserialize(&mut data)
16289                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
16290        }
16291    }
16292    #[repr(C)]
16293    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
16294    pub struct UpdateSpotMarketMaxTokenBorrows {
16295        pub admin: Pubkey,
16296        pub state: Pubkey,
16297        pub spot_market: Pubkey,
16298    }
16299    #[automatically_derived]
16300    impl anchor_lang::Discriminator for UpdateSpotMarketMaxTokenBorrows {
16301        const DISCRIMINATOR: &[u8] = &[76, 222, 78, 65, 19, 17, 10, 26];
16302    }
16303    #[automatically_derived]
16304    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdateSpotMarketMaxTokenBorrows {}
16305    #[automatically_derived]
16306    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdateSpotMarketMaxTokenBorrows {}
16307    #[automatically_derived]
16308    impl anchor_lang::ZeroCopy for UpdateSpotMarketMaxTokenBorrows {}
16309    #[automatically_derived]
16310    impl anchor_lang::InstructionData for UpdateSpotMarketMaxTokenBorrows {}
16311    #[automatically_derived]
16312    impl ToAccountMetas for UpdateSpotMarketMaxTokenBorrows {
16313        fn to_account_metas(&self) -> Vec<AccountMeta> {
16314            vec![
16315                AccountMeta {
16316                    pubkey: self.admin,
16317                    is_signer: true,
16318                    is_writable: false,
16319                },
16320                AccountMeta {
16321                    pubkey: self.state,
16322                    is_signer: false,
16323                    is_writable: false,
16324                },
16325                AccountMeta {
16326                    pubkey: self.spot_market,
16327                    is_signer: false,
16328                    is_writable: true,
16329                },
16330            ]
16331        }
16332    }
16333    #[automatically_derived]
16334    impl anchor_lang::AccountSerialize for UpdateSpotMarketMaxTokenBorrows {
16335        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
16336            if writer.write_all(Self::DISCRIMINATOR).is_err() {
16337                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
16338            }
16339            if AnchorSerialize::serialize(self, writer).is_err() {
16340                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
16341            }
16342            Ok(())
16343        }
16344    }
16345    #[automatically_derived]
16346    impl anchor_lang::AccountDeserialize for UpdateSpotMarketMaxTokenBorrows {
16347        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
16348            let given_disc = &buf[..8];
16349            if Self::DISCRIMINATOR != given_disc {
16350                return Err(anchor_lang::error!(
16351                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
16352                ));
16353            }
16354            Self::try_deserialize_unchecked(buf)
16355        }
16356        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
16357            let mut data: &[u8] = &buf[8..];
16358            AnchorDeserialize::deserialize(&mut data)
16359                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
16360        }
16361    }
16362    #[repr(C)]
16363    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
16364    pub struct UpdateSpotMarketScaleInitialAssetWeightStart {
16365        pub admin: Pubkey,
16366        pub state: Pubkey,
16367        pub spot_market: Pubkey,
16368    }
16369    #[automatically_derived]
16370    impl anchor_lang::Discriminator for UpdateSpotMarketScaleInitialAssetWeightStart {
16371        const DISCRIMINATOR: &[u8] = &[154, 211, 71, 7, 119, 171, 98, 72];
16372    }
16373    #[automatically_derived]
16374    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdateSpotMarketScaleInitialAssetWeightStart {}
16375    #[automatically_derived]
16376    unsafe impl anchor_lang::__private::bytemuck::Zeroable
16377        for UpdateSpotMarketScaleInitialAssetWeightStart
16378    {
16379    }
16380    #[automatically_derived]
16381    impl anchor_lang::ZeroCopy for UpdateSpotMarketScaleInitialAssetWeightStart {}
16382    #[automatically_derived]
16383    impl anchor_lang::InstructionData for UpdateSpotMarketScaleInitialAssetWeightStart {}
16384    #[automatically_derived]
16385    impl ToAccountMetas for UpdateSpotMarketScaleInitialAssetWeightStart {
16386        fn to_account_metas(&self) -> Vec<AccountMeta> {
16387            vec![
16388                AccountMeta {
16389                    pubkey: self.admin,
16390                    is_signer: true,
16391                    is_writable: false,
16392                },
16393                AccountMeta {
16394                    pubkey: self.state,
16395                    is_signer: false,
16396                    is_writable: false,
16397                },
16398                AccountMeta {
16399                    pubkey: self.spot_market,
16400                    is_signer: false,
16401                    is_writable: true,
16402                },
16403            ]
16404        }
16405    }
16406    #[automatically_derived]
16407    impl anchor_lang::AccountSerialize for UpdateSpotMarketScaleInitialAssetWeightStart {
16408        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
16409            if writer.write_all(Self::DISCRIMINATOR).is_err() {
16410                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
16411            }
16412            if AnchorSerialize::serialize(self, writer).is_err() {
16413                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
16414            }
16415            Ok(())
16416        }
16417    }
16418    #[automatically_derived]
16419    impl anchor_lang::AccountDeserialize for UpdateSpotMarketScaleInitialAssetWeightStart {
16420        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
16421            let given_disc = &buf[..8];
16422            if Self::DISCRIMINATOR != given_disc {
16423                return Err(anchor_lang::error!(
16424                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
16425                ));
16426            }
16427            Self::try_deserialize_unchecked(buf)
16428        }
16429        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
16430            let mut data: &[u8] = &buf[8..];
16431            AnchorDeserialize::deserialize(&mut data)
16432                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
16433        }
16434    }
16435    #[repr(C)]
16436    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
16437    pub struct UpdateSpotMarketOracle {
16438        pub admin: Pubkey,
16439        pub state: Pubkey,
16440        pub spot_market: Pubkey,
16441        pub oracle: Pubkey,
16442        pub old_oracle: Pubkey,
16443    }
16444    #[automatically_derived]
16445    impl anchor_lang::Discriminator for UpdateSpotMarketOracle {
16446        const DISCRIMINATOR: &[u8] = &[36, 174, 101, 206, 244, 70, 211, 189];
16447    }
16448    #[automatically_derived]
16449    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdateSpotMarketOracle {}
16450    #[automatically_derived]
16451    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdateSpotMarketOracle {}
16452    #[automatically_derived]
16453    impl anchor_lang::ZeroCopy for UpdateSpotMarketOracle {}
16454    #[automatically_derived]
16455    impl anchor_lang::InstructionData for UpdateSpotMarketOracle {}
16456    #[automatically_derived]
16457    impl ToAccountMetas for UpdateSpotMarketOracle {
16458        fn to_account_metas(&self) -> Vec<AccountMeta> {
16459            vec![
16460                AccountMeta {
16461                    pubkey: self.admin,
16462                    is_signer: true,
16463                    is_writable: false,
16464                },
16465                AccountMeta {
16466                    pubkey: self.state,
16467                    is_signer: false,
16468                    is_writable: false,
16469                },
16470                AccountMeta {
16471                    pubkey: self.spot_market,
16472                    is_signer: false,
16473                    is_writable: true,
16474                },
16475                AccountMeta {
16476                    pubkey: self.oracle,
16477                    is_signer: false,
16478                    is_writable: false,
16479                },
16480                AccountMeta {
16481                    pubkey: self.old_oracle,
16482                    is_signer: false,
16483                    is_writable: false,
16484                },
16485            ]
16486        }
16487    }
16488    #[automatically_derived]
16489    impl anchor_lang::AccountSerialize for UpdateSpotMarketOracle {
16490        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
16491            if writer.write_all(Self::DISCRIMINATOR).is_err() {
16492                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
16493            }
16494            if AnchorSerialize::serialize(self, writer).is_err() {
16495                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
16496            }
16497            Ok(())
16498        }
16499    }
16500    #[automatically_derived]
16501    impl anchor_lang::AccountDeserialize for UpdateSpotMarketOracle {
16502        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
16503            let given_disc = &buf[..8];
16504            if Self::DISCRIMINATOR != given_disc {
16505                return Err(anchor_lang::error!(
16506                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
16507                ));
16508            }
16509            Self::try_deserialize_unchecked(buf)
16510        }
16511        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
16512            let mut data: &[u8] = &buf[8..];
16513            AnchorDeserialize::deserialize(&mut data)
16514                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
16515        }
16516    }
16517    #[repr(C)]
16518    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
16519    pub struct UpdateSpotMarketStepSizeAndTickSize {
16520        pub admin: Pubkey,
16521        pub state: Pubkey,
16522        pub spot_market: Pubkey,
16523    }
16524    #[automatically_derived]
16525    impl anchor_lang::Discriminator for UpdateSpotMarketStepSizeAndTickSize {
16526        const DISCRIMINATOR: &[u8] = &[129, 204, 160, 151, 133, 198, 153, 119];
16527    }
16528    #[automatically_derived]
16529    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdateSpotMarketStepSizeAndTickSize {}
16530    #[automatically_derived]
16531    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdateSpotMarketStepSizeAndTickSize {}
16532    #[automatically_derived]
16533    impl anchor_lang::ZeroCopy for UpdateSpotMarketStepSizeAndTickSize {}
16534    #[automatically_derived]
16535    impl anchor_lang::InstructionData for UpdateSpotMarketStepSizeAndTickSize {}
16536    #[automatically_derived]
16537    impl ToAccountMetas for UpdateSpotMarketStepSizeAndTickSize {
16538        fn to_account_metas(&self) -> Vec<AccountMeta> {
16539            vec![
16540                AccountMeta {
16541                    pubkey: self.admin,
16542                    is_signer: true,
16543                    is_writable: false,
16544                },
16545                AccountMeta {
16546                    pubkey: self.state,
16547                    is_signer: false,
16548                    is_writable: false,
16549                },
16550                AccountMeta {
16551                    pubkey: self.spot_market,
16552                    is_signer: false,
16553                    is_writable: true,
16554                },
16555            ]
16556        }
16557    }
16558    #[automatically_derived]
16559    impl anchor_lang::AccountSerialize for UpdateSpotMarketStepSizeAndTickSize {
16560        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
16561            if writer.write_all(Self::DISCRIMINATOR).is_err() {
16562                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
16563            }
16564            if AnchorSerialize::serialize(self, writer).is_err() {
16565                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
16566            }
16567            Ok(())
16568        }
16569    }
16570    #[automatically_derived]
16571    impl anchor_lang::AccountDeserialize for UpdateSpotMarketStepSizeAndTickSize {
16572        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
16573            let given_disc = &buf[..8];
16574            if Self::DISCRIMINATOR != given_disc {
16575                return Err(anchor_lang::error!(
16576                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
16577                ));
16578            }
16579            Self::try_deserialize_unchecked(buf)
16580        }
16581        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
16582            let mut data: &[u8] = &buf[8..];
16583            AnchorDeserialize::deserialize(&mut data)
16584                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
16585        }
16586    }
16587    #[repr(C)]
16588    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
16589    pub struct UpdateSpotMarketMinOrderSize {
16590        pub admin: Pubkey,
16591        pub state: Pubkey,
16592        pub spot_market: Pubkey,
16593    }
16594    #[automatically_derived]
16595    impl anchor_lang::Discriminator for UpdateSpotMarketMinOrderSize {
16596        const DISCRIMINATOR: &[u8] = &[7, 136, 27, 144, 153, 150, 80, 125];
16597    }
16598    #[automatically_derived]
16599    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdateSpotMarketMinOrderSize {}
16600    #[automatically_derived]
16601    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdateSpotMarketMinOrderSize {}
16602    #[automatically_derived]
16603    impl anchor_lang::ZeroCopy for UpdateSpotMarketMinOrderSize {}
16604    #[automatically_derived]
16605    impl anchor_lang::InstructionData for UpdateSpotMarketMinOrderSize {}
16606    #[automatically_derived]
16607    impl ToAccountMetas for UpdateSpotMarketMinOrderSize {
16608        fn to_account_metas(&self) -> Vec<AccountMeta> {
16609            vec![
16610                AccountMeta {
16611                    pubkey: self.admin,
16612                    is_signer: true,
16613                    is_writable: false,
16614                },
16615                AccountMeta {
16616                    pubkey: self.state,
16617                    is_signer: false,
16618                    is_writable: false,
16619                },
16620                AccountMeta {
16621                    pubkey: self.spot_market,
16622                    is_signer: false,
16623                    is_writable: true,
16624                },
16625            ]
16626        }
16627    }
16628    #[automatically_derived]
16629    impl anchor_lang::AccountSerialize for UpdateSpotMarketMinOrderSize {
16630        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
16631            if writer.write_all(Self::DISCRIMINATOR).is_err() {
16632                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
16633            }
16634            if AnchorSerialize::serialize(self, writer).is_err() {
16635                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
16636            }
16637            Ok(())
16638        }
16639    }
16640    #[automatically_derived]
16641    impl anchor_lang::AccountDeserialize for UpdateSpotMarketMinOrderSize {
16642        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
16643            let given_disc = &buf[..8];
16644            if Self::DISCRIMINATOR != given_disc {
16645                return Err(anchor_lang::error!(
16646                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
16647                ));
16648            }
16649            Self::try_deserialize_unchecked(buf)
16650        }
16651        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
16652            let mut data: &[u8] = &buf[8..];
16653            AnchorDeserialize::deserialize(&mut data)
16654                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
16655        }
16656    }
16657    #[repr(C)]
16658    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
16659    pub struct UpdateSpotMarketOrdersEnabled {
16660        pub admin: Pubkey,
16661        pub state: Pubkey,
16662        pub spot_market: Pubkey,
16663    }
16664    #[automatically_derived]
16665    impl anchor_lang::Discriminator for UpdateSpotMarketOrdersEnabled {
16666        const DISCRIMINATOR: &[u8] = &[19, 211, 29, 85, 150, 174, 176, 255];
16667    }
16668    #[automatically_derived]
16669    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdateSpotMarketOrdersEnabled {}
16670    #[automatically_derived]
16671    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdateSpotMarketOrdersEnabled {}
16672    #[automatically_derived]
16673    impl anchor_lang::ZeroCopy for UpdateSpotMarketOrdersEnabled {}
16674    #[automatically_derived]
16675    impl anchor_lang::InstructionData for UpdateSpotMarketOrdersEnabled {}
16676    #[automatically_derived]
16677    impl ToAccountMetas for UpdateSpotMarketOrdersEnabled {
16678        fn to_account_metas(&self) -> Vec<AccountMeta> {
16679            vec![
16680                AccountMeta {
16681                    pubkey: self.admin,
16682                    is_signer: true,
16683                    is_writable: false,
16684                },
16685                AccountMeta {
16686                    pubkey: self.state,
16687                    is_signer: false,
16688                    is_writable: false,
16689                },
16690                AccountMeta {
16691                    pubkey: self.spot_market,
16692                    is_signer: false,
16693                    is_writable: true,
16694                },
16695            ]
16696        }
16697    }
16698    #[automatically_derived]
16699    impl anchor_lang::AccountSerialize for UpdateSpotMarketOrdersEnabled {
16700        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
16701            if writer.write_all(Self::DISCRIMINATOR).is_err() {
16702                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
16703            }
16704            if AnchorSerialize::serialize(self, writer).is_err() {
16705                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
16706            }
16707            Ok(())
16708        }
16709    }
16710    #[automatically_derived]
16711    impl anchor_lang::AccountDeserialize for UpdateSpotMarketOrdersEnabled {
16712        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
16713            let given_disc = &buf[..8];
16714            if Self::DISCRIMINATOR != given_disc {
16715                return Err(anchor_lang::error!(
16716                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
16717                ));
16718            }
16719            Self::try_deserialize_unchecked(buf)
16720        }
16721        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
16722            let mut data: &[u8] = &buf[8..];
16723            AnchorDeserialize::deserialize(&mut data)
16724                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
16725        }
16726    }
16727    #[repr(C)]
16728    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
16729    pub struct UpdateSpotMarketIfPausedOperations {
16730        pub admin: Pubkey,
16731        pub state: Pubkey,
16732        pub spot_market: Pubkey,
16733    }
16734    #[automatically_derived]
16735    impl anchor_lang::Discriminator for UpdateSpotMarketIfPausedOperations {
16736        const DISCRIMINATOR: &[u8] = &[198, 225, 237, 109, 145, 233, 119, 66];
16737    }
16738    #[automatically_derived]
16739    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdateSpotMarketIfPausedOperations {}
16740    #[automatically_derived]
16741    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdateSpotMarketIfPausedOperations {}
16742    #[automatically_derived]
16743    impl anchor_lang::ZeroCopy for UpdateSpotMarketIfPausedOperations {}
16744    #[automatically_derived]
16745    impl anchor_lang::InstructionData for UpdateSpotMarketIfPausedOperations {}
16746    #[automatically_derived]
16747    impl ToAccountMetas for UpdateSpotMarketIfPausedOperations {
16748        fn to_account_metas(&self) -> Vec<AccountMeta> {
16749            vec![
16750                AccountMeta {
16751                    pubkey: self.admin,
16752                    is_signer: true,
16753                    is_writable: false,
16754                },
16755                AccountMeta {
16756                    pubkey: self.state,
16757                    is_signer: false,
16758                    is_writable: false,
16759                },
16760                AccountMeta {
16761                    pubkey: self.spot_market,
16762                    is_signer: false,
16763                    is_writable: true,
16764                },
16765            ]
16766        }
16767    }
16768    #[automatically_derived]
16769    impl anchor_lang::AccountSerialize for UpdateSpotMarketIfPausedOperations {
16770        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
16771            if writer.write_all(Self::DISCRIMINATOR).is_err() {
16772                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
16773            }
16774            if AnchorSerialize::serialize(self, writer).is_err() {
16775                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
16776            }
16777            Ok(())
16778        }
16779    }
16780    #[automatically_derived]
16781    impl anchor_lang::AccountDeserialize for UpdateSpotMarketIfPausedOperations {
16782        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
16783            let given_disc = &buf[..8];
16784            if Self::DISCRIMINATOR != given_disc {
16785                return Err(anchor_lang::error!(
16786                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
16787                ));
16788            }
16789            Self::try_deserialize_unchecked(buf)
16790        }
16791        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
16792            let mut data: &[u8] = &buf[8..];
16793            AnchorDeserialize::deserialize(&mut data)
16794                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
16795        }
16796    }
16797    #[repr(C)]
16798    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
16799    pub struct UpdateSpotMarketName {
16800        pub admin: Pubkey,
16801        pub state: Pubkey,
16802        pub spot_market: Pubkey,
16803    }
16804    #[automatically_derived]
16805    impl anchor_lang::Discriminator for UpdateSpotMarketName {
16806        const DISCRIMINATOR: &[u8] = &[132, 15, 105, 156, 160, 4, 62, 223];
16807    }
16808    #[automatically_derived]
16809    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdateSpotMarketName {}
16810    #[automatically_derived]
16811    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdateSpotMarketName {}
16812    #[automatically_derived]
16813    impl anchor_lang::ZeroCopy for UpdateSpotMarketName {}
16814    #[automatically_derived]
16815    impl anchor_lang::InstructionData for UpdateSpotMarketName {}
16816    #[automatically_derived]
16817    impl ToAccountMetas for UpdateSpotMarketName {
16818        fn to_account_metas(&self) -> Vec<AccountMeta> {
16819            vec![
16820                AccountMeta {
16821                    pubkey: self.admin,
16822                    is_signer: true,
16823                    is_writable: false,
16824                },
16825                AccountMeta {
16826                    pubkey: self.state,
16827                    is_signer: false,
16828                    is_writable: false,
16829                },
16830                AccountMeta {
16831                    pubkey: self.spot_market,
16832                    is_signer: false,
16833                    is_writable: true,
16834                },
16835            ]
16836        }
16837    }
16838    #[automatically_derived]
16839    impl anchor_lang::AccountSerialize for UpdateSpotMarketName {
16840        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
16841            if writer.write_all(Self::DISCRIMINATOR).is_err() {
16842                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
16843            }
16844            if AnchorSerialize::serialize(self, writer).is_err() {
16845                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
16846            }
16847            Ok(())
16848        }
16849    }
16850    #[automatically_derived]
16851    impl anchor_lang::AccountDeserialize for UpdateSpotMarketName {
16852        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
16853            let given_disc = &buf[..8];
16854            if Self::DISCRIMINATOR != given_disc {
16855                return Err(anchor_lang::error!(
16856                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
16857                ));
16858            }
16859            Self::try_deserialize_unchecked(buf)
16860        }
16861        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
16862            let mut data: &[u8] = &buf[8..];
16863            AnchorDeserialize::deserialize(&mut data)
16864                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
16865        }
16866    }
16867    #[repr(C)]
16868    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
16869    pub struct UpdatePerpMarketStatus {
16870        pub admin: Pubkey,
16871        pub state: Pubkey,
16872        pub perp_market: Pubkey,
16873    }
16874    #[automatically_derived]
16875    impl anchor_lang::Discriminator for UpdatePerpMarketStatus {
16876        const DISCRIMINATOR: &[u8] = &[224, 52, 220, 78, 238, 167, 101, 138];
16877    }
16878    #[automatically_derived]
16879    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdatePerpMarketStatus {}
16880    #[automatically_derived]
16881    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdatePerpMarketStatus {}
16882    #[automatically_derived]
16883    impl anchor_lang::ZeroCopy for UpdatePerpMarketStatus {}
16884    #[automatically_derived]
16885    impl anchor_lang::InstructionData for UpdatePerpMarketStatus {}
16886    #[automatically_derived]
16887    impl ToAccountMetas for UpdatePerpMarketStatus {
16888        fn to_account_metas(&self) -> Vec<AccountMeta> {
16889            vec![
16890                AccountMeta {
16891                    pubkey: self.admin,
16892                    is_signer: true,
16893                    is_writable: false,
16894                },
16895                AccountMeta {
16896                    pubkey: self.state,
16897                    is_signer: false,
16898                    is_writable: false,
16899                },
16900                AccountMeta {
16901                    pubkey: self.perp_market,
16902                    is_signer: false,
16903                    is_writable: true,
16904                },
16905            ]
16906        }
16907    }
16908    #[automatically_derived]
16909    impl anchor_lang::AccountSerialize for UpdatePerpMarketStatus {
16910        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
16911            if writer.write_all(Self::DISCRIMINATOR).is_err() {
16912                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
16913            }
16914            if AnchorSerialize::serialize(self, writer).is_err() {
16915                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
16916            }
16917            Ok(())
16918        }
16919    }
16920    #[automatically_derived]
16921    impl anchor_lang::AccountDeserialize for UpdatePerpMarketStatus {
16922        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
16923            let given_disc = &buf[..8];
16924            if Self::DISCRIMINATOR != given_disc {
16925                return Err(anchor_lang::error!(
16926                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
16927                ));
16928            }
16929            Self::try_deserialize_unchecked(buf)
16930        }
16931        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
16932            let mut data: &[u8] = &buf[8..];
16933            AnchorDeserialize::deserialize(&mut data)
16934                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
16935        }
16936    }
16937    #[repr(C)]
16938    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
16939    pub struct UpdatePerpMarketPausedOperations {
16940        pub admin: Pubkey,
16941        pub state: Pubkey,
16942        pub perp_market: Pubkey,
16943    }
16944    #[automatically_derived]
16945    impl anchor_lang::Discriminator for UpdatePerpMarketPausedOperations {
16946        const DISCRIMINATOR: &[u8] = &[51, 168, 150, 68, 102, 63, 155, 3];
16947    }
16948    #[automatically_derived]
16949    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdatePerpMarketPausedOperations {}
16950    #[automatically_derived]
16951    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdatePerpMarketPausedOperations {}
16952    #[automatically_derived]
16953    impl anchor_lang::ZeroCopy for UpdatePerpMarketPausedOperations {}
16954    #[automatically_derived]
16955    impl anchor_lang::InstructionData for UpdatePerpMarketPausedOperations {}
16956    #[automatically_derived]
16957    impl ToAccountMetas for UpdatePerpMarketPausedOperations {
16958        fn to_account_metas(&self) -> Vec<AccountMeta> {
16959            vec![
16960                AccountMeta {
16961                    pubkey: self.admin,
16962                    is_signer: true,
16963                    is_writable: false,
16964                },
16965                AccountMeta {
16966                    pubkey: self.state,
16967                    is_signer: false,
16968                    is_writable: false,
16969                },
16970                AccountMeta {
16971                    pubkey: self.perp_market,
16972                    is_signer: false,
16973                    is_writable: true,
16974                },
16975            ]
16976        }
16977    }
16978    #[automatically_derived]
16979    impl anchor_lang::AccountSerialize for UpdatePerpMarketPausedOperations {
16980        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
16981            if writer.write_all(Self::DISCRIMINATOR).is_err() {
16982                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
16983            }
16984            if AnchorSerialize::serialize(self, writer).is_err() {
16985                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
16986            }
16987            Ok(())
16988        }
16989    }
16990    #[automatically_derived]
16991    impl anchor_lang::AccountDeserialize for UpdatePerpMarketPausedOperations {
16992        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
16993            let given_disc = &buf[..8];
16994            if Self::DISCRIMINATOR != given_disc {
16995                return Err(anchor_lang::error!(
16996                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
16997                ));
16998            }
16999            Self::try_deserialize_unchecked(buf)
17000        }
17001        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
17002            let mut data: &[u8] = &buf[8..];
17003            AnchorDeserialize::deserialize(&mut data)
17004                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
17005        }
17006    }
17007    #[repr(C)]
17008    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
17009    pub struct UpdatePerpMarketContractTier {
17010        pub admin: Pubkey,
17011        pub state: Pubkey,
17012        pub perp_market: Pubkey,
17013    }
17014    #[automatically_derived]
17015    impl anchor_lang::Discriminator for UpdatePerpMarketContractTier {
17016        const DISCRIMINATOR: &[u8] = &[222, 107, 185, 64, 127, 171, 165, 198];
17017    }
17018    #[automatically_derived]
17019    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdatePerpMarketContractTier {}
17020    #[automatically_derived]
17021    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdatePerpMarketContractTier {}
17022    #[automatically_derived]
17023    impl anchor_lang::ZeroCopy for UpdatePerpMarketContractTier {}
17024    #[automatically_derived]
17025    impl anchor_lang::InstructionData for UpdatePerpMarketContractTier {}
17026    #[automatically_derived]
17027    impl ToAccountMetas for UpdatePerpMarketContractTier {
17028        fn to_account_metas(&self) -> Vec<AccountMeta> {
17029            vec![
17030                AccountMeta {
17031                    pubkey: self.admin,
17032                    is_signer: true,
17033                    is_writable: false,
17034                },
17035                AccountMeta {
17036                    pubkey: self.state,
17037                    is_signer: false,
17038                    is_writable: false,
17039                },
17040                AccountMeta {
17041                    pubkey: self.perp_market,
17042                    is_signer: false,
17043                    is_writable: true,
17044                },
17045            ]
17046        }
17047    }
17048    #[automatically_derived]
17049    impl anchor_lang::AccountSerialize for UpdatePerpMarketContractTier {
17050        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
17051            if writer.write_all(Self::DISCRIMINATOR).is_err() {
17052                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
17053            }
17054            if AnchorSerialize::serialize(self, writer).is_err() {
17055                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
17056            }
17057            Ok(())
17058        }
17059    }
17060    #[automatically_derived]
17061    impl anchor_lang::AccountDeserialize for UpdatePerpMarketContractTier {
17062        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
17063            let given_disc = &buf[..8];
17064            if Self::DISCRIMINATOR != given_disc {
17065                return Err(anchor_lang::error!(
17066                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
17067                ));
17068            }
17069            Self::try_deserialize_unchecked(buf)
17070        }
17071        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
17072            let mut data: &[u8] = &buf[8..];
17073            AnchorDeserialize::deserialize(&mut data)
17074                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
17075        }
17076    }
17077    #[repr(C)]
17078    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
17079    pub struct UpdatePerpMarketImfFactor {
17080        pub admin: Pubkey,
17081        pub state: Pubkey,
17082        pub perp_market: Pubkey,
17083    }
17084    #[automatically_derived]
17085    impl anchor_lang::Discriminator for UpdatePerpMarketImfFactor {
17086        const DISCRIMINATOR: &[u8] = &[225, 32, 202, 238, 175, 168, 66, 111];
17087    }
17088    #[automatically_derived]
17089    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdatePerpMarketImfFactor {}
17090    #[automatically_derived]
17091    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdatePerpMarketImfFactor {}
17092    #[automatically_derived]
17093    impl anchor_lang::ZeroCopy for UpdatePerpMarketImfFactor {}
17094    #[automatically_derived]
17095    impl anchor_lang::InstructionData for UpdatePerpMarketImfFactor {}
17096    #[automatically_derived]
17097    impl ToAccountMetas for UpdatePerpMarketImfFactor {
17098        fn to_account_metas(&self) -> Vec<AccountMeta> {
17099            vec![
17100                AccountMeta {
17101                    pubkey: self.admin,
17102                    is_signer: true,
17103                    is_writable: false,
17104                },
17105                AccountMeta {
17106                    pubkey: self.state,
17107                    is_signer: false,
17108                    is_writable: false,
17109                },
17110                AccountMeta {
17111                    pubkey: self.perp_market,
17112                    is_signer: false,
17113                    is_writable: true,
17114                },
17115            ]
17116        }
17117    }
17118    #[automatically_derived]
17119    impl anchor_lang::AccountSerialize for UpdatePerpMarketImfFactor {
17120        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
17121            if writer.write_all(Self::DISCRIMINATOR).is_err() {
17122                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
17123            }
17124            if AnchorSerialize::serialize(self, writer).is_err() {
17125                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
17126            }
17127            Ok(())
17128        }
17129    }
17130    #[automatically_derived]
17131    impl anchor_lang::AccountDeserialize for UpdatePerpMarketImfFactor {
17132        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
17133            let given_disc = &buf[..8];
17134            if Self::DISCRIMINATOR != given_disc {
17135                return Err(anchor_lang::error!(
17136                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
17137                ));
17138            }
17139            Self::try_deserialize_unchecked(buf)
17140        }
17141        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
17142            let mut data: &[u8] = &buf[8..];
17143            AnchorDeserialize::deserialize(&mut data)
17144                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
17145        }
17146    }
17147    #[repr(C)]
17148    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
17149    pub struct UpdatePerpMarketUnrealizedAssetWeight {
17150        pub admin: Pubkey,
17151        pub state: Pubkey,
17152        pub perp_market: Pubkey,
17153    }
17154    #[automatically_derived]
17155    impl anchor_lang::Discriminator for UpdatePerpMarketUnrealizedAssetWeight {
17156        const DISCRIMINATOR: &[u8] = &[96, 83, 120, 200, 98, 169, 198, 236];
17157    }
17158    #[automatically_derived]
17159    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdatePerpMarketUnrealizedAssetWeight {}
17160    #[automatically_derived]
17161    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdatePerpMarketUnrealizedAssetWeight {}
17162    #[automatically_derived]
17163    impl anchor_lang::ZeroCopy for UpdatePerpMarketUnrealizedAssetWeight {}
17164    #[automatically_derived]
17165    impl anchor_lang::InstructionData for UpdatePerpMarketUnrealizedAssetWeight {}
17166    #[automatically_derived]
17167    impl ToAccountMetas for UpdatePerpMarketUnrealizedAssetWeight {
17168        fn to_account_metas(&self) -> Vec<AccountMeta> {
17169            vec![
17170                AccountMeta {
17171                    pubkey: self.admin,
17172                    is_signer: true,
17173                    is_writable: false,
17174                },
17175                AccountMeta {
17176                    pubkey: self.state,
17177                    is_signer: false,
17178                    is_writable: false,
17179                },
17180                AccountMeta {
17181                    pubkey: self.perp_market,
17182                    is_signer: false,
17183                    is_writable: true,
17184                },
17185            ]
17186        }
17187    }
17188    #[automatically_derived]
17189    impl anchor_lang::AccountSerialize for UpdatePerpMarketUnrealizedAssetWeight {
17190        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
17191            if writer.write_all(Self::DISCRIMINATOR).is_err() {
17192                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
17193            }
17194            if AnchorSerialize::serialize(self, writer).is_err() {
17195                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
17196            }
17197            Ok(())
17198        }
17199    }
17200    #[automatically_derived]
17201    impl anchor_lang::AccountDeserialize for UpdatePerpMarketUnrealizedAssetWeight {
17202        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
17203            let given_disc = &buf[..8];
17204            if Self::DISCRIMINATOR != given_disc {
17205                return Err(anchor_lang::error!(
17206                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
17207                ));
17208            }
17209            Self::try_deserialize_unchecked(buf)
17210        }
17211        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
17212            let mut data: &[u8] = &buf[8..];
17213            AnchorDeserialize::deserialize(&mut data)
17214                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
17215        }
17216    }
17217    #[repr(C)]
17218    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
17219    pub struct UpdatePerpMarketConcentrationCoef {
17220        pub admin: Pubkey,
17221        pub state: Pubkey,
17222        pub perp_market: Pubkey,
17223    }
17224    #[automatically_derived]
17225    impl anchor_lang::Discriminator for UpdatePerpMarketConcentrationCoef {
17226        const DISCRIMINATOR: &[u8] = &[216, 212, 111, 9, 250, 64, 121, 75];
17227    }
17228    #[automatically_derived]
17229    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdatePerpMarketConcentrationCoef {}
17230    #[automatically_derived]
17231    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdatePerpMarketConcentrationCoef {}
17232    #[automatically_derived]
17233    impl anchor_lang::ZeroCopy for UpdatePerpMarketConcentrationCoef {}
17234    #[automatically_derived]
17235    impl anchor_lang::InstructionData for UpdatePerpMarketConcentrationCoef {}
17236    #[automatically_derived]
17237    impl ToAccountMetas for UpdatePerpMarketConcentrationCoef {
17238        fn to_account_metas(&self) -> Vec<AccountMeta> {
17239            vec![
17240                AccountMeta {
17241                    pubkey: self.admin,
17242                    is_signer: true,
17243                    is_writable: false,
17244                },
17245                AccountMeta {
17246                    pubkey: self.state,
17247                    is_signer: false,
17248                    is_writable: false,
17249                },
17250                AccountMeta {
17251                    pubkey: self.perp_market,
17252                    is_signer: false,
17253                    is_writable: true,
17254                },
17255            ]
17256        }
17257    }
17258    #[automatically_derived]
17259    impl anchor_lang::AccountSerialize for UpdatePerpMarketConcentrationCoef {
17260        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
17261            if writer.write_all(Self::DISCRIMINATOR).is_err() {
17262                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
17263            }
17264            if AnchorSerialize::serialize(self, writer).is_err() {
17265                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
17266            }
17267            Ok(())
17268        }
17269    }
17270    #[automatically_derived]
17271    impl anchor_lang::AccountDeserialize for UpdatePerpMarketConcentrationCoef {
17272        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
17273            let given_disc = &buf[..8];
17274            if Self::DISCRIMINATOR != given_disc {
17275                return Err(anchor_lang::error!(
17276                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
17277                ));
17278            }
17279            Self::try_deserialize_unchecked(buf)
17280        }
17281        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
17282            let mut data: &[u8] = &buf[8..];
17283            AnchorDeserialize::deserialize(&mut data)
17284                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
17285        }
17286    }
17287    #[repr(C)]
17288    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
17289    pub struct UpdatePerpMarketCurveUpdateIntensity {
17290        pub admin: Pubkey,
17291        pub state: Pubkey,
17292        pub perp_market: Pubkey,
17293    }
17294    #[automatically_derived]
17295    impl anchor_lang::Discriminator for UpdatePerpMarketCurveUpdateIntensity {
17296        const DISCRIMINATOR: &[u8] = &[174, 119, 97, 13, 217, 130, 136, 102];
17297    }
17298    #[automatically_derived]
17299    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdatePerpMarketCurveUpdateIntensity {}
17300    #[automatically_derived]
17301    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdatePerpMarketCurveUpdateIntensity {}
17302    #[automatically_derived]
17303    impl anchor_lang::ZeroCopy for UpdatePerpMarketCurveUpdateIntensity {}
17304    #[automatically_derived]
17305    impl anchor_lang::InstructionData for UpdatePerpMarketCurveUpdateIntensity {}
17306    #[automatically_derived]
17307    impl ToAccountMetas for UpdatePerpMarketCurveUpdateIntensity {
17308        fn to_account_metas(&self) -> Vec<AccountMeta> {
17309            vec![
17310                AccountMeta {
17311                    pubkey: self.admin,
17312                    is_signer: true,
17313                    is_writable: false,
17314                },
17315                AccountMeta {
17316                    pubkey: self.state,
17317                    is_signer: false,
17318                    is_writable: false,
17319                },
17320                AccountMeta {
17321                    pubkey: self.perp_market,
17322                    is_signer: false,
17323                    is_writable: true,
17324                },
17325            ]
17326        }
17327    }
17328    #[automatically_derived]
17329    impl anchor_lang::AccountSerialize for UpdatePerpMarketCurveUpdateIntensity {
17330        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
17331            if writer.write_all(Self::DISCRIMINATOR).is_err() {
17332                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
17333            }
17334            if AnchorSerialize::serialize(self, writer).is_err() {
17335                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
17336            }
17337            Ok(())
17338        }
17339    }
17340    #[automatically_derived]
17341    impl anchor_lang::AccountDeserialize for UpdatePerpMarketCurveUpdateIntensity {
17342        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
17343            let given_disc = &buf[..8];
17344            if Self::DISCRIMINATOR != given_disc {
17345                return Err(anchor_lang::error!(
17346                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
17347                ));
17348            }
17349            Self::try_deserialize_unchecked(buf)
17350        }
17351        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
17352            let mut data: &[u8] = &buf[8..];
17353            AnchorDeserialize::deserialize(&mut data)
17354                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
17355        }
17356    }
17357    #[repr(C)]
17358    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
17359    pub struct UpdatePerpMarketTargetBaseAssetAmountPerLp {
17360        pub admin: Pubkey,
17361        pub state: Pubkey,
17362        pub perp_market: Pubkey,
17363    }
17364    #[automatically_derived]
17365    impl anchor_lang::Discriminator for UpdatePerpMarketTargetBaseAssetAmountPerLp {
17366        const DISCRIMINATOR: &[u8] = &[140, 252, 191, 7, 247, 96, 68, 225];
17367    }
17368    #[automatically_derived]
17369    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdatePerpMarketTargetBaseAssetAmountPerLp {}
17370    #[automatically_derived]
17371    unsafe impl anchor_lang::__private::bytemuck::Zeroable
17372        for UpdatePerpMarketTargetBaseAssetAmountPerLp
17373    {
17374    }
17375    #[automatically_derived]
17376    impl anchor_lang::ZeroCopy for UpdatePerpMarketTargetBaseAssetAmountPerLp {}
17377    #[automatically_derived]
17378    impl anchor_lang::InstructionData for UpdatePerpMarketTargetBaseAssetAmountPerLp {}
17379    #[automatically_derived]
17380    impl ToAccountMetas for UpdatePerpMarketTargetBaseAssetAmountPerLp {
17381        fn to_account_metas(&self) -> Vec<AccountMeta> {
17382            vec![
17383                AccountMeta {
17384                    pubkey: self.admin,
17385                    is_signer: true,
17386                    is_writable: false,
17387                },
17388                AccountMeta {
17389                    pubkey: self.state,
17390                    is_signer: false,
17391                    is_writable: false,
17392                },
17393                AccountMeta {
17394                    pubkey: self.perp_market,
17395                    is_signer: false,
17396                    is_writable: true,
17397                },
17398            ]
17399        }
17400    }
17401    #[automatically_derived]
17402    impl anchor_lang::AccountSerialize for UpdatePerpMarketTargetBaseAssetAmountPerLp {
17403        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
17404            if writer.write_all(Self::DISCRIMINATOR).is_err() {
17405                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
17406            }
17407            if AnchorSerialize::serialize(self, writer).is_err() {
17408                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
17409            }
17410            Ok(())
17411        }
17412    }
17413    #[automatically_derived]
17414    impl anchor_lang::AccountDeserialize for UpdatePerpMarketTargetBaseAssetAmountPerLp {
17415        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
17416            let given_disc = &buf[..8];
17417            if Self::DISCRIMINATOR != given_disc {
17418                return Err(anchor_lang::error!(
17419                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
17420                ));
17421            }
17422            Self::try_deserialize_unchecked(buf)
17423        }
17424        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
17425            let mut data: &[u8] = &buf[8..];
17426            AnchorDeserialize::deserialize(&mut data)
17427                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
17428        }
17429    }
17430    #[repr(C)]
17431    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
17432    pub struct UpdatePerpMarketPerLpBase {
17433        pub admin: Pubkey,
17434        pub state: Pubkey,
17435        pub perp_market: Pubkey,
17436    }
17437    #[automatically_derived]
17438    impl anchor_lang::Discriminator for UpdatePerpMarketPerLpBase {
17439        const DISCRIMINATOR: &[u8] = &[223, 224, 23, 54, 113, 122, 152, 77];
17440    }
17441    #[automatically_derived]
17442    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdatePerpMarketPerLpBase {}
17443    #[automatically_derived]
17444    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdatePerpMarketPerLpBase {}
17445    #[automatically_derived]
17446    impl anchor_lang::ZeroCopy for UpdatePerpMarketPerLpBase {}
17447    #[automatically_derived]
17448    impl anchor_lang::InstructionData for UpdatePerpMarketPerLpBase {}
17449    #[automatically_derived]
17450    impl ToAccountMetas for UpdatePerpMarketPerLpBase {
17451        fn to_account_metas(&self) -> Vec<AccountMeta> {
17452            vec![
17453                AccountMeta {
17454                    pubkey: self.admin,
17455                    is_signer: true,
17456                    is_writable: false,
17457                },
17458                AccountMeta {
17459                    pubkey: self.state,
17460                    is_signer: false,
17461                    is_writable: false,
17462                },
17463                AccountMeta {
17464                    pubkey: self.perp_market,
17465                    is_signer: false,
17466                    is_writable: true,
17467                },
17468            ]
17469        }
17470    }
17471    #[automatically_derived]
17472    impl anchor_lang::AccountSerialize for UpdatePerpMarketPerLpBase {
17473        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
17474            if writer.write_all(Self::DISCRIMINATOR).is_err() {
17475                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
17476            }
17477            if AnchorSerialize::serialize(self, writer).is_err() {
17478                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
17479            }
17480            Ok(())
17481        }
17482    }
17483    #[automatically_derived]
17484    impl anchor_lang::AccountDeserialize for UpdatePerpMarketPerLpBase {
17485        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
17486            let given_disc = &buf[..8];
17487            if Self::DISCRIMINATOR != given_disc {
17488                return Err(anchor_lang::error!(
17489                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
17490                ));
17491            }
17492            Self::try_deserialize_unchecked(buf)
17493        }
17494        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
17495            let mut data: &[u8] = &buf[8..];
17496            AnchorDeserialize::deserialize(&mut data)
17497                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
17498        }
17499    }
17500    #[repr(C)]
17501    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
17502    pub struct UpdateLpCooldownTime {
17503        pub admin: Pubkey,
17504        pub state: Pubkey,
17505    }
17506    #[automatically_derived]
17507    impl anchor_lang::Discriminator for UpdateLpCooldownTime {
17508        const DISCRIMINATOR: &[u8] = &[176, 192, 230, 203, 208, 6, 140, 65];
17509    }
17510    #[automatically_derived]
17511    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdateLpCooldownTime {}
17512    #[automatically_derived]
17513    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdateLpCooldownTime {}
17514    #[automatically_derived]
17515    impl anchor_lang::ZeroCopy for UpdateLpCooldownTime {}
17516    #[automatically_derived]
17517    impl anchor_lang::InstructionData for UpdateLpCooldownTime {}
17518    #[automatically_derived]
17519    impl ToAccountMetas for UpdateLpCooldownTime {
17520        fn to_account_metas(&self) -> Vec<AccountMeta> {
17521            vec![
17522                AccountMeta {
17523                    pubkey: self.admin,
17524                    is_signer: true,
17525                    is_writable: false,
17526                },
17527                AccountMeta {
17528                    pubkey: self.state,
17529                    is_signer: false,
17530                    is_writable: true,
17531                },
17532            ]
17533        }
17534    }
17535    #[automatically_derived]
17536    impl anchor_lang::AccountSerialize for UpdateLpCooldownTime {
17537        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
17538            if writer.write_all(Self::DISCRIMINATOR).is_err() {
17539                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
17540            }
17541            if AnchorSerialize::serialize(self, writer).is_err() {
17542                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
17543            }
17544            Ok(())
17545        }
17546    }
17547    #[automatically_derived]
17548    impl anchor_lang::AccountDeserialize for UpdateLpCooldownTime {
17549        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
17550            let given_disc = &buf[..8];
17551            if Self::DISCRIMINATOR != given_disc {
17552                return Err(anchor_lang::error!(
17553                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
17554                ));
17555            }
17556            Self::try_deserialize_unchecked(buf)
17557        }
17558        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
17559            let mut data: &[u8] = &buf[8..];
17560            AnchorDeserialize::deserialize(&mut data)
17561                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
17562        }
17563    }
17564    #[repr(C)]
17565    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
17566    pub struct UpdatePerpFeeStructure {
17567        pub admin: Pubkey,
17568        pub state: Pubkey,
17569    }
17570    #[automatically_derived]
17571    impl anchor_lang::Discriminator for UpdatePerpFeeStructure {
17572        const DISCRIMINATOR: &[u8] = &[200, 56, 109, 180, 172, 159, 143, 220];
17573    }
17574    #[automatically_derived]
17575    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdatePerpFeeStructure {}
17576    #[automatically_derived]
17577    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdatePerpFeeStructure {}
17578    #[automatically_derived]
17579    impl anchor_lang::ZeroCopy for UpdatePerpFeeStructure {}
17580    #[automatically_derived]
17581    impl anchor_lang::InstructionData for UpdatePerpFeeStructure {}
17582    #[automatically_derived]
17583    impl ToAccountMetas for UpdatePerpFeeStructure {
17584        fn to_account_metas(&self) -> Vec<AccountMeta> {
17585            vec![
17586                AccountMeta {
17587                    pubkey: self.admin,
17588                    is_signer: true,
17589                    is_writable: false,
17590                },
17591                AccountMeta {
17592                    pubkey: self.state,
17593                    is_signer: false,
17594                    is_writable: true,
17595                },
17596            ]
17597        }
17598    }
17599    #[automatically_derived]
17600    impl anchor_lang::AccountSerialize for UpdatePerpFeeStructure {
17601        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
17602            if writer.write_all(Self::DISCRIMINATOR).is_err() {
17603                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
17604            }
17605            if AnchorSerialize::serialize(self, writer).is_err() {
17606                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
17607            }
17608            Ok(())
17609        }
17610    }
17611    #[automatically_derived]
17612    impl anchor_lang::AccountDeserialize for UpdatePerpFeeStructure {
17613        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
17614            let given_disc = &buf[..8];
17615            if Self::DISCRIMINATOR != given_disc {
17616                return Err(anchor_lang::error!(
17617                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
17618                ));
17619            }
17620            Self::try_deserialize_unchecked(buf)
17621        }
17622        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
17623            let mut data: &[u8] = &buf[8..];
17624            AnchorDeserialize::deserialize(&mut data)
17625                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
17626        }
17627    }
17628    #[repr(C)]
17629    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
17630    pub struct UpdateSpotFeeStructure {
17631        pub admin: Pubkey,
17632        pub state: Pubkey,
17633    }
17634    #[automatically_derived]
17635    impl anchor_lang::Discriminator for UpdateSpotFeeStructure {
17636        const DISCRIMINATOR: &[u8] = &[24, 12, 37, 124, 132, 63, 160, 6];
17637    }
17638    #[automatically_derived]
17639    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdateSpotFeeStructure {}
17640    #[automatically_derived]
17641    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdateSpotFeeStructure {}
17642    #[automatically_derived]
17643    impl anchor_lang::ZeroCopy for UpdateSpotFeeStructure {}
17644    #[automatically_derived]
17645    impl anchor_lang::InstructionData for UpdateSpotFeeStructure {}
17646    #[automatically_derived]
17647    impl ToAccountMetas for UpdateSpotFeeStructure {
17648        fn to_account_metas(&self) -> Vec<AccountMeta> {
17649            vec![
17650                AccountMeta {
17651                    pubkey: self.admin,
17652                    is_signer: true,
17653                    is_writable: false,
17654                },
17655                AccountMeta {
17656                    pubkey: self.state,
17657                    is_signer: false,
17658                    is_writable: true,
17659                },
17660            ]
17661        }
17662    }
17663    #[automatically_derived]
17664    impl anchor_lang::AccountSerialize for UpdateSpotFeeStructure {
17665        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
17666            if writer.write_all(Self::DISCRIMINATOR).is_err() {
17667                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
17668            }
17669            if AnchorSerialize::serialize(self, writer).is_err() {
17670                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
17671            }
17672            Ok(())
17673        }
17674    }
17675    #[automatically_derived]
17676    impl anchor_lang::AccountDeserialize for UpdateSpotFeeStructure {
17677        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
17678            let given_disc = &buf[..8];
17679            if Self::DISCRIMINATOR != given_disc {
17680                return Err(anchor_lang::error!(
17681                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
17682                ));
17683            }
17684            Self::try_deserialize_unchecked(buf)
17685        }
17686        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
17687            let mut data: &[u8] = &buf[8..];
17688            AnchorDeserialize::deserialize(&mut data)
17689                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
17690        }
17691    }
17692    #[repr(C)]
17693    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
17694    pub struct UpdateInitialPctToLiquidate {
17695        pub admin: Pubkey,
17696        pub state: Pubkey,
17697    }
17698    #[automatically_derived]
17699    impl anchor_lang::Discriminator for UpdateInitialPctToLiquidate {
17700        const DISCRIMINATOR: &[u8] = &[245, 97, 64, 31, 129, 51, 40, 245];
17701    }
17702    #[automatically_derived]
17703    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdateInitialPctToLiquidate {}
17704    #[automatically_derived]
17705    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdateInitialPctToLiquidate {}
17706    #[automatically_derived]
17707    impl anchor_lang::ZeroCopy for UpdateInitialPctToLiquidate {}
17708    #[automatically_derived]
17709    impl anchor_lang::InstructionData for UpdateInitialPctToLiquidate {}
17710    #[automatically_derived]
17711    impl ToAccountMetas for UpdateInitialPctToLiquidate {
17712        fn to_account_metas(&self) -> Vec<AccountMeta> {
17713            vec![
17714                AccountMeta {
17715                    pubkey: self.admin,
17716                    is_signer: true,
17717                    is_writable: false,
17718                },
17719                AccountMeta {
17720                    pubkey: self.state,
17721                    is_signer: false,
17722                    is_writable: true,
17723                },
17724            ]
17725        }
17726    }
17727    #[automatically_derived]
17728    impl anchor_lang::AccountSerialize for UpdateInitialPctToLiquidate {
17729        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
17730            if writer.write_all(Self::DISCRIMINATOR).is_err() {
17731                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
17732            }
17733            if AnchorSerialize::serialize(self, writer).is_err() {
17734                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
17735            }
17736            Ok(())
17737        }
17738    }
17739    #[automatically_derived]
17740    impl anchor_lang::AccountDeserialize for UpdateInitialPctToLiquidate {
17741        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
17742            let given_disc = &buf[..8];
17743            if Self::DISCRIMINATOR != given_disc {
17744                return Err(anchor_lang::error!(
17745                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
17746                ));
17747            }
17748            Self::try_deserialize_unchecked(buf)
17749        }
17750        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
17751            let mut data: &[u8] = &buf[8..];
17752            AnchorDeserialize::deserialize(&mut data)
17753                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
17754        }
17755    }
17756    #[repr(C)]
17757    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
17758    pub struct UpdateLiquidationDuration {
17759        pub admin: Pubkey,
17760        pub state: Pubkey,
17761    }
17762    #[automatically_derived]
17763    impl anchor_lang::Discriminator for UpdateLiquidationDuration {
17764        const DISCRIMINATOR: &[u8] = &[195, 45, 228, 75, 98, 127, 63, 63];
17765    }
17766    #[automatically_derived]
17767    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdateLiquidationDuration {}
17768    #[automatically_derived]
17769    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdateLiquidationDuration {}
17770    #[automatically_derived]
17771    impl anchor_lang::ZeroCopy for UpdateLiquidationDuration {}
17772    #[automatically_derived]
17773    impl anchor_lang::InstructionData for UpdateLiquidationDuration {}
17774    #[automatically_derived]
17775    impl ToAccountMetas for UpdateLiquidationDuration {
17776        fn to_account_metas(&self) -> Vec<AccountMeta> {
17777            vec![
17778                AccountMeta {
17779                    pubkey: self.admin,
17780                    is_signer: true,
17781                    is_writable: false,
17782                },
17783                AccountMeta {
17784                    pubkey: self.state,
17785                    is_signer: false,
17786                    is_writable: true,
17787                },
17788            ]
17789        }
17790    }
17791    #[automatically_derived]
17792    impl anchor_lang::AccountSerialize for UpdateLiquidationDuration {
17793        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
17794            if writer.write_all(Self::DISCRIMINATOR).is_err() {
17795                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
17796            }
17797            if AnchorSerialize::serialize(self, writer).is_err() {
17798                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
17799            }
17800            Ok(())
17801        }
17802    }
17803    #[automatically_derived]
17804    impl anchor_lang::AccountDeserialize for UpdateLiquidationDuration {
17805        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
17806            let given_disc = &buf[..8];
17807            if Self::DISCRIMINATOR != given_disc {
17808                return Err(anchor_lang::error!(
17809                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
17810                ));
17811            }
17812            Self::try_deserialize_unchecked(buf)
17813        }
17814        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
17815            let mut data: &[u8] = &buf[8..];
17816            AnchorDeserialize::deserialize(&mut data)
17817                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
17818        }
17819    }
17820    #[repr(C)]
17821    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
17822    pub struct UpdateLiquidationMarginBufferRatio {
17823        pub admin: Pubkey,
17824        pub state: Pubkey,
17825    }
17826    #[automatically_derived]
17827    impl anchor_lang::Discriminator for UpdateLiquidationMarginBufferRatio {
17828        const DISCRIMINATOR: &[u8] = &[5, 215, 155, 184, 19, 125, 142, 66];
17829    }
17830    #[automatically_derived]
17831    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdateLiquidationMarginBufferRatio {}
17832    #[automatically_derived]
17833    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdateLiquidationMarginBufferRatio {}
17834    #[automatically_derived]
17835    impl anchor_lang::ZeroCopy for UpdateLiquidationMarginBufferRatio {}
17836    #[automatically_derived]
17837    impl anchor_lang::InstructionData for UpdateLiquidationMarginBufferRatio {}
17838    #[automatically_derived]
17839    impl ToAccountMetas for UpdateLiquidationMarginBufferRatio {
17840        fn to_account_metas(&self) -> Vec<AccountMeta> {
17841            vec![
17842                AccountMeta {
17843                    pubkey: self.admin,
17844                    is_signer: true,
17845                    is_writable: false,
17846                },
17847                AccountMeta {
17848                    pubkey: self.state,
17849                    is_signer: false,
17850                    is_writable: true,
17851                },
17852            ]
17853        }
17854    }
17855    #[automatically_derived]
17856    impl anchor_lang::AccountSerialize for UpdateLiquidationMarginBufferRatio {
17857        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
17858            if writer.write_all(Self::DISCRIMINATOR).is_err() {
17859                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
17860            }
17861            if AnchorSerialize::serialize(self, writer).is_err() {
17862                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
17863            }
17864            Ok(())
17865        }
17866    }
17867    #[automatically_derived]
17868    impl anchor_lang::AccountDeserialize for UpdateLiquidationMarginBufferRatio {
17869        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
17870            let given_disc = &buf[..8];
17871            if Self::DISCRIMINATOR != given_disc {
17872                return Err(anchor_lang::error!(
17873                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
17874                ));
17875            }
17876            Self::try_deserialize_unchecked(buf)
17877        }
17878        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
17879            let mut data: &[u8] = &buf[8..];
17880            AnchorDeserialize::deserialize(&mut data)
17881                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
17882        }
17883    }
17884    #[repr(C)]
17885    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
17886    pub struct UpdateOracleGuardRails {
17887        pub admin: Pubkey,
17888        pub state: Pubkey,
17889    }
17890    #[automatically_derived]
17891    impl anchor_lang::Discriminator for UpdateOracleGuardRails {
17892        const DISCRIMINATOR: &[u8] = &[141, 30, 9, 240, 136, 75, 69, 245];
17893    }
17894    #[automatically_derived]
17895    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdateOracleGuardRails {}
17896    #[automatically_derived]
17897    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdateOracleGuardRails {}
17898    #[automatically_derived]
17899    impl anchor_lang::ZeroCopy for UpdateOracleGuardRails {}
17900    #[automatically_derived]
17901    impl anchor_lang::InstructionData for UpdateOracleGuardRails {}
17902    #[automatically_derived]
17903    impl ToAccountMetas for UpdateOracleGuardRails {
17904        fn to_account_metas(&self) -> Vec<AccountMeta> {
17905            vec![
17906                AccountMeta {
17907                    pubkey: self.admin,
17908                    is_signer: true,
17909                    is_writable: false,
17910                },
17911                AccountMeta {
17912                    pubkey: self.state,
17913                    is_signer: false,
17914                    is_writable: true,
17915                },
17916            ]
17917        }
17918    }
17919    #[automatically_derived]
17920    impl anchor_lang::AccountSerialize for UpdateOracleGuardRails {
17921        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
17922            if writer.write_all(Self::DISCRIMINATOR).is_err() {
17923                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
17924            }
17925            if AnchorSerialize::serialize(self, writer).is_err() {
17926                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
17927            }
17928            Ok(())
17929        }
17930    }
17931    #[automatically_derived]
17932    impl anchor_lang::AccountDeserialize for UpdateOracleGuardRails {
17933        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
17934            let given_disc = &buf[..8];
17935            if Self::DISCRIMINATOR != given_disc {
17936                return Err(anchor_lang::error!(
17937                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
17938                ));
17939            }
17940            Self::try_deserialize_unchecked(buf)
17941        }
17942        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
17943            let mut data: &[u8] = &buf[8..];
17944            AnchorDeserialize::deserialize(&mut data)
17945                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
17946        }
17947    }
17948    #[repr(C)]
17949    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
17950    pub struct UpdateStateSettlementDuration {
17951        pub admin: Pubkey,
17952        pub state: Pubkey,
17953    }
17954    #[automatically_derived]
17955    impl anchor_lang::Discriminator for UpdateStateSettlementDuration {
17956        const DISCRIMINATOR: &[u8] = &[117, 8, 77, 34, 122, 119, 61, 165];
17957    }
17958    #[automatically_derived]
17959    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdateStateSettlementDuration {}
17960    #[automatically_derived]
17961    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdateStateSettlementDuration {}
17962    #[automatically_derived]
17963    impl anchor_lang::ZeroCopy for UpdateStateSettlementDuration {}
17964    #[automatically_derived]
17965    impl anchor_lang::InstructionData for UpdateStateSettlementDuration {}
17966    #[automatically_derived]
17967    impl ToAccountMetas for UpdateStateSettlementDuration {
17968        fn to_account_metas(&self) -> Vec<AccountMeta> {
17969            vec![
17970                AccountMeta {
17971                    pubkey: self.admin,
17972                    is_signer: true,
17973                    is_writable: false,
17974                },
17975                AccountMeta {
17976                    pubkey: self.state,
17977                    is_signer: false,
17978                    is_writable: true,
17979                },
17980            ]
17981        }
17982    }
17983    #[automatically_derived]
17984    impl anchor_lang::AccountSerialize for UpdateStateSettlementDuration {
17985        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
17986            if writer.write_all(Self::DISCRIMINATOR).is_err() {
17987                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
17988            }
17989            if AnchorSerialize::serialize(self, writer).is_err() {
17990                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
17991            }
17992            Ok(())
17993        }
17994    }
17995    #[automatically_derived]
17996    impl anchor_lang::AccountDeserialize for UpdateStateSettlementDuration {
17997        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
17998            let given_disc = &buf[..8];
17999            if Self::DISCRIMINATOR != given_disc {
18000                return Err(anchor_lang::error!(
18001                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
18002                ));
18003            }
18004            Self::try_deserialize_unchecked(buf)
18005        }
18006        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
18007            let mut data: &[u8] = &buf[8..];
18008            AnchorDeserialize::deserialize(&mut data)
18009                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
18010        }
18011    }
18012    #[repr(C)]
18013    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
18014    pub struct UpdateStateMaxNumberOfSubAccounts {
18015        pub admin: Pubkey,
18016        pub state: Pubkey,
18017    }
18018    #[automatically_derived]
18019    impl anchor_lang::Discriminator for UpdateStateMaxNumberOfSubAccounts {
18020        const DISCRIMINATOR: &[u8] = &[105, 137, 80, 95, 51, 50, 190, 95];
18021    }
18022    #[automatically_derived]
18023    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdateStateMaxNumberOfSubAccounts {}
18024    #[automatically_derived]
18025    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdateStateMaxNumberOfSubAccounts {}
18026    #[automatically_derived]
18027    impl anchor_lang::ZeroCopy for UpdateStateMaxNumberOfSubAccounts {}
18028    #[automatically_derived]
18029    impl anchor_lang::InstructionData for UpdateStateMaxNumberOfSubAccounts {}
18030    #[automatically_derived]
18031    impl ToAccountMetas for UpdateStateMaxNumberOfSubAccounts {
18032        fn to_account_metas(&self) -> Vec<AccountMeta> {
18033            vec![
18034                AccountMeta {
18035                    pubkey: self.admin,
18036                    is_signer: true,
18037                    is_writable: false,
18038                },
18039                AccountMeta {
18040                    pubkey: self.state,
18041                    is_signer: false,
18042                    is_writable: true,
18043                },
18044            ]
18045        }
18046    }
18047    #[automatically_derived]
18048    impl anchor_lang::AccountSerialize for UpdateStateMaxNumberOfSubAccounts {
18049        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
18050            if writer.write_all(Self::DISCRIMINATOR).is_err() {
18051                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
18052            }
18053            if AnchorSerialize::serialize(self, writer).is_err() {
18054                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
18055            }
18056            Ok(())
18057        }
18058    }
18059    #[automatically_derived]
18060    impl anchor_lang::AccountDeserialize for UpdateStateMaxNumberOfSubAccounts {
18061        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
18062            let given_disc = &buf[..8];
18063            if Self::DISCRIMINATOR != given_disc {
18064                return Err(anchor_lang::error!(
18065                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
18066                ));
18067            }
18068            Self::try_deserialize_unchecked(buf)
18069        }
18070        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
18071            let mut data: &[u8] = &buf[8..];
18072            AnchorDeserialize::deserialize(&mut data)
18073                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
18074        }
18075    }
18076    #[repr(C)]
18077    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
18078    pub struct UpdateStateMaxInitializeUserFee {
18079        pub admin: Pubkey,
18080        pub state: Pubkey,
18081    }
18082    #[automatically_derived]
18083    impl anchor_lang::Discriminator for UpdateStateMaxInitializeUserFee {
18084        const DISCRIMINATOR: &[u8] = &[183, 72, 183, 217, 46, 152, 38, 41];
18085    }
18086    #[automatically_derived]
18087    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdateStateMaxInitializeUserFee {}
18088    #[automatically_derived]
18089    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdateStateMaxInitializeUserFee {}
18090    #[automatically_derived]
18091    impl anchor_lang::ZeroCopy for UpdateStateMaxInitializeUserFee {}
18092    #[automatically_derived]
18093    impl anchor_lang::InstructionData for UpdateStateMaxInitializeUserFee {}
18094    #[automatically_derived]
18095    impl ToAccountMetas for UpdateStateMaxInitializeUserFee {
18096        fn to_account_metas(&self) -> Vec<AccountMeta> {
18097            vec![
18098                AccountMeta {
18099                    pubkey: self.admin,
18100                    is_signer: true,
18101                    is_writable: false,
18102                },
18103                AccountMeta {
18104                    pubkey: self.state,
18105                    is_signer: false,
18106                    is_writable: true,
18107                },
18108            ]
18109        }
18110    }
18111    #[automatically_derived]
18112    impl anchor_lang::AccountSerialize for UpdateStateMaxInitializeUserFee {
18113        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
18114            if writer.write_all(Self::DISCRIMINATOR).is_err() {
18115                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
18116            }
18117            if AnchorSerialize::serialize(self, writer).is_err() {
18118                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
18119            }
18120            Ok(())
18121        }
18122    }
18123    #[automatically_derived]
18124    impl anchor_lang::AccountDeserialize for UpdateStateMaxInitializeUserFee {
18125        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
18126            let given_disc = &buf[..8];
18127            if Self::DISCRIMINATOR != given_disc {
18128                return Err(anchor_lang::error!(
18129                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
18130                ));
18131            }
18132            Self::try_deserialize_unchecked(buf)
18133        }
18134        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
18135            let mut data: &[u8] = &buf[8..];
18136            AnchorDeserialize::deserialize(&mut data)
18137                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
18138        }
18139    }
18140    #[repr(C)]
18141    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
18142    pub struct UpdatePerpMarketOracle {
18143        pub admin: Pubkey,
18144        pub state: Pubkey,
18145        pub perp_market: Pubkey,
18146        pub oracle: Pubkey,
18147        pub old_oracle: Pubkey,
18148    }
18149    #[automatically_derived]
18150    impl anchor_lang::Discriminator for UpdatePerpMarketOracle {
18151        const DISCRIMINATOR: &[u8] = &[145, 236, 122, 74, 26, 16, 123, 173];
18152    }
18153    #[automatically_derived]
18154    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdatePerpMarketOracle {}
18155    #[automatically_derived]
18156    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdatePerpMarketOracle {}
18157    #[automatically_derived]
18158    impl anchor_lang::ZeroCopy for UpdatePerpMarketOracle {}
18159    #[automatically_derived]
18160    impl anchor_lang::InstructionData for UpdatePerpMarketOracle {}
18161    #[automatically_derived]
18162    impl ToAccountMetas for UpdatePerpMarketOracle {
18163        fn to_account_metas(&self) -> Vec<AccountMeta> {
18164            vec![
18165                AccountMeta {
18166                    pubkey: self.admin,
18167                    is_signer: true,
18168                    is_writable: false,
18169                },
18170                AccountMeta {
18171                    pubkey: self.state,
18172                    is_signer: false,
18173                    is_writable: false,
18174                },
18175                AccountMeta {
18176                    pubkey: self.perp_market,
18177                    is_signer: false,
18178                    is_writable: true,
18179                },
18180                AccountMeta {
18181                    pubkey: self.oracle,
18182                    is_signer: false,
18183                    is_writable: false,
18184                },
18185                AccountMeta {
18186                    pubkey: self.old_oracle,
18187                    is_signer: false,
18188                    is_writable: false,
18189                },
18190            ]
18191        }
18192    }
18193    #[automatically_derived]
18194    impl anchor_lang::AccountSerialize for UpdatePerpMarketOracle {
18195        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
18196            if writer.write_all(Self::DISCRIMINATOR).is_err() {
18197                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
18198            }
18199            if AnchorSerialize::serialize(self, writer).is_err() {
18200                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
18201            }
18202            Ok(())
18203        }
18204    }
18205    #[automatically_derived]
18206    impl anchor_lang::AccountDeserialize for UpdatePerpMarketOracle {
18207        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
18208            let given_disc = &buf[..8];
18209            if Self::DISCRIMINATOR != given_disc {
18210                return Err(anchor_lang::error!(
18211                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
18212                ));
18213            }
18214            Self::try_deserialize_unchecked(buf)
18215        }
18216        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
18217            let mut data: &[u8] = &buf[8..];
18218            AnchorDeserialize::deserialize(&mut data)
18219                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
18220        }
18221    }
18222    #[repr(C)]
18223    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
18224    pub struct UpdatePerpMarketBaseSpread {
18225        pub admin: Pubkey,
18226        pub state: Pubkey,
18227        pub perp_market: Pubkey,
18228    }
18229    #[automatically_derived]
18230    impl anchor_lang::Discriminator for UpdatePerpMarketBaseSpread {
18231        const DISCRIMINATOR: &[u8] = &[103, 167, 141, 61, 192, 229, 25, 38];
18232    }
18233    #[automatically_derived]
18234    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdatePerpMarketBaseSpread {}
18235    #[automatically_derived]
18236    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdatePerpMarketBaseSpread {}
18237    #[automatically_derived]
18238    impl anchor_lang::ZeroCopy for UpdatePerpMarketBaseSpread {}
18239    #[automatically_derived]
18240    impl anchor_lang::InstructionData for UpdatePerpMarketBaseSpread {}
18241    #[automatically_derived]
18242    impl ToAccountMetas for UpdatePerpMarketBaseSpread {
18243        fn to_account_metas(&self) -> Vec<AccountMeta> {
18244            vec![
18245                AccountMeta {
18246                    pubkey: self.admin,
18247                    is_signer: true,
18248                    is_writable: false,
18249                },
18250                AccountMeta {
18251                    pubkey: self.state,
18252                    is_signer: false,
18253                    is_writable: false,
18254                },
18255                AccountMeta {
18256                    pubkey: self.perp_market,
18257                    is_signer: false,
18258                    is_writable: true,
18259                },
18260            ]
18261        }
18262    }
18263    #[automatically_derived]
18264    impl anchor_lang::AccountSerialize for UpdatePerpMarketBaseSpread {
18265        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
18266            if writer.write_all(Self::DISCRIMINATOR).is_err() {
18267                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
18268            }
18269            if AnchorSerialize::serialize(self, writer).is_err() {
18270                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
18271            }
18272            Ok(())
18273        }
18274    }
18275    #[automatically_derived]
18276    impl anchor_lang::AccountDeserialize for UpdatePerpMarketBaseSpread {
18277        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
18278            let given_disc = &buf[..8];
18279            if Self::DISCRIMINATOR != given_disc {
18280                return Err(anchor_lang::error!(
18281                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
18282                ));
18283            }
18284            Self::try_deserialize_unchecked(buf)
18285        }
18286        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
18287            let mut data: &[u8] = &buf[8..];
18288            AnchorDeserialize::deserialize(&mut data)
18289                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
18290        }
18291    }
18292    #[repr(C)]
18293    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
18294    pub struct UpdateAmmJitIntensity {
18295        pub admin: Pubkey,
18296        pub state: Pubkey,
18297        pub perp_market: Pubkey,
18298    }
18299    #[automatically_derived]
18300    impl anchor_lang::Discriminator for UpdateAmmJitIntensity {
18301        const DISCRIMINATOR: &[u8] = &[53, 216, 81, 248, 60, 1, 222, 134];
18302    }
18303    #[automatically_derived]
18304    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdateAmmJitIntensity {}
18305    #[automatically_derived]
18306    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdateAmmJitIntensity {}
18307    #[automatically_derived]
18308    impl anchor_lang::ZeroCopy for UpdateAmmJitIntensity {}
18309    #[automatically_derived]
18310    impl anchor_lang::InstructionData for UpdateAmmJitIntensity {}
18311    #[automatically_derived]
18312    impl ToAccountMetas for UpdateAmmJitIntensity {
18313        fn to_account_metas(&self) -> Vec<AccountMeta> {
18314            vec![
18315                AccountMeta {
18316                    pubkey: self.admin,
18317                    is_signer: true,
18318                    is_writable: false,
18319                },
18320                AccountMeta {
18321                    pubkey: self.state,
18322                    is_signer: false,
18323                    is_writable: false,
18324                },
18325                AccountMeta {
18326                    pubkey: self.perp_market,
18327                    is_signer: false,
18328                    is_writable: true,
18329                },
18330            ]
18331        }
18332    }
18333    #[automatically_derived]
18334    impl anchor_lang::AccountSerialize for UpdateAmmJitIntensity {
18335        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
18336            if writer.write_all(Self::DISCRIMINATOR).is_err() {
18337                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
18338            }
18339            if AnchorSerialize::serialize(self, writer).is_err() {
18340                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
18341            }
18342            Ok(())
18343        }
18344    }
18345    #[automatically_derived]
18346    impl anchor_lang::AccountDeserialize for UpdateAmmJitIntensity {
18347        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
18348            let given_disc = &buf[..8];
18349            if Self::DISCRIMINATOR != given_disc {
18350                return Err(anchor_lang::error!(
18351                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
18352                ));
18353            }
18354            Self::try_deserialize_unchecked(buf)
18355        }
18356        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
18357            let mut data: &[u8] = &buf[8..];
18358            AnchorDeserialize::deserialize(&mut data)
18359                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
18360        }
18361    }
18362    #[repr(C)]
18363    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
18364    pub struct UpdatePerpMarketMaxSpread {
18365        pub admin: Pubkey,
18366        pub state: Pubkey,
18367        pub perp_market: Pubkey,
18368    }
18369    #[automatically_derived]
18370    impl anchor_lang::Discriminator for UpdatePerpMarketMaxSpread {
18371        const DISCRIMINATOR: &[u8] = &[6, 132, 169, 40, 124, 227, 156, 212];
18372    }
18373    #[automatically_derived]
18374    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdatePerpMarketMaxSpread {}
18375    #[automatically_derived]
18376    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdatePerpMarketMaxSpread {}
18377    #[automatically_derived]
18378    impl anchor_lang::ZeroCopy for UpdatePerpMarketMaxSpread {}
18379    #[automatically_derived]
18380    impl anchor_lang::InstructionData for UpdatePerpMarketMaxSpread {}
18381    #[automatically_derived]
18382    impl ToAccountMetas for UpdatePerpMarketMaxSpread {
18383        fn to_account_metas(&self) -> Vec<AccountMeta> {
18384            vec![
18385                AccountMeta {
18386                    pubkey: self.admin,
18387                    is_signer: true,
18388                    is_writable: false,
18389                },
18390                AccountMeta {
18391                    pubkey: self.state,
18392                    is_signer: false,
18393                    is_writable: false,
18394                },
18395                AccountMeta {
18396                    pubkey: self.perp_market,
18397                    is_signer: false,
18398                    is_writable: true,
18399                },
18400            ]
18401        }
18402    }
18403    #[automatically_derived]
18404    impl anchor_lang::AccountSerialize for UpdatePerpMarketMaxSpread {
18405        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
18406            if writer.write_all(Self::DISCRIMINATOR).is_err() {
18407                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
18408            }
18409            if AnchorSerialize::serialize(self, writer).is_err() {
18410                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
18411            }
18412            Ok(())
18413        }
18414    }
18415    #[automatically_derived]
18416    impl anchor_lang::AccountDeserialize for UpdatePerpMarketMaxSpread {
18417        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
18418            let given_disc = &buf[..8];
18419            if Self::DISCRIMINATOR != given_disc {
18420                return Err(anchor_lang::error!(
18421                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
18422                ));
18423            }
18424            Self::try_deserialize_unchecked(buf)
18425        }
18426        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
18427            let mut data: &[u8] = &buf[8..];
18428            AnchorDeserialize::deserialize(&mut data)
18429                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
18430        }
18431    }
18432    #[repr(C)]
18433    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
18434    pub struct UpdatePerpMarketStepSizeAndTickSize {
18435        pub admin: Pubkey,
18436        pub state: Pubkey,
18437        pub perp_market: Pubkey,
18438    }
18439    #[automatically_derived]
18440    impl anchor_lang::Discriminator for UpdatePerpMarketStepSizeAndTickSize {
18441        const DISCRIMINATOR: &[u8] = &[97, 22, 195, 229, 181, 121, 32, 14];
18442    }
18443    #[automatically_derived]
18444    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdatePerpMarketStepSizeAndTickSize {}
18445    #[automatically_derived]
18446    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdatePerpMarketStepSizeAndTickSize {}
18447    #[automatically_derived]
18448    impl anchor_lang::ZeroCopy for UpdatePerpMarketStepSizeAndTickSize {}
18449    #[automatically_derived]
18450    impl anchor_lang::InstructionData for UpdatePerpMarketStepSizeAndTickSize {}
18451    #[automatically_derived]
18452    impl ToAccountMetas for UpdatePerpMarketStepSizeAndTickSize {
18453        fn to_account_metas(&self) -> Vec<AccountMeta> {
18454            vec![
18455                AccountMeta {
18456                    pubkey: self.admin,
18457                    is_signer: true,
18458                    is_writable: false,
18459                },
18460                AccountMeta {
18461                    pubkey: self.state,
18462                    is_signer: false,
18463                    is_writable: false,
18464                },
18465                AccountMeta {
18466                    pubkey: self.perp_market,
18467                    is_signer: false,
18468                    is_writable: true,
18469                },
18470            ]
18471        }
18472    }
18473    #[automatically_derived]
18474    impl anchor_lang::AccountSerialize for UpdatePerpMarketStepSizeAndTickSize {
18475        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
18476            if writer.write_all(Self::DISCRIMINATOR).is_err() {
18477                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
18478            }
18479            if AnchorSerialize::serialize(self, writer).is_err() {
18480                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
18481            }
18482            Ok(())
18483        }
18484    }
18485    #[automatically_derived]
18486    impl anchor_lang::AccountDeserialize for UpdatePerpMarketStepSizeAndTickSize {
18487        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
18488            let given_disc = &buf[..8];
18489            if Self::DISCRIMINATOR != given_disc {
18490                return Err(anchor_lang::error!(
18491                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
18492                ));
18493            }
18494            Self::try_deserialize_unchecked(buf)
18495        }
18496        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
18497            let mut data: &[u8] = &buf[8..];
18498            AnchorDeserialize::deserialize(&mut data)
18499                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
18500        }
18501    }
18502    #[repr(C)]
18503    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
18504    pub struct UpdatePerpMarketName {
18505        pub admin: Pubkey,
18506        pub state: Pubkey,
18507        pub perp_market: Pubkey,
18508    }
18509    #[automatically_derived]
18510    impl anchor_lang::Discriminator for UpdatePerpMarketName {
18511        const DISCRIMINATOR: &[u8] = &[120, 12, 150, 158, 194, 231, 152, 183];
18512    }
18513    #[automatically_derived]
18514    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdatePerpMarketName {}
18515    #[automatically_derived]
18516    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdatePerpMarketName {}
18517    #[automatically_derived]
18518    impl anchor_lang::ZeroCopy for UpdatePerpMarketName {}
18519    #[automatically_derived]
18520    impl anchor_lang::InstructionData for UpdatePerpMarketName {}
18521    #[automatically_derived]
18522    impl ToAccountMetas for UpdatePerpMarketName {
18523        fn to_account_metas(&self) -> Vec<AccountMeta> {
18524            vec![
18525                AccountMeta {
18526                    pubkey: self.admin,
18527                    is_signer: true,
18528                    is_writable: false,
18529                },
18530                AccountMeta {
18531                    pubkey: self.state,
18532                    is_signer: false,
18533                    is_writable: false,
18534                },
18535                AccountMeta {
18536                    pubkey: self.perp_market,
18537                    is_signer: false,
18538                    is_writable: true,
18539                },
18540            ]
18541        }
18542    }
18543    #[automatically_derived]
18544    impl anchor_lang::AccountSerialize for UpdatePerpMarketName {
18545        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
18546            if writer.write_all(Self::DISCRIMINATOR).is_err() {
18547                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
18548            }
18549            if AnchorSerialize::serialize(self, writer).is_err() {
18550                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
18551            }
18552            Ok(())
18553        }
18554    }
18555    #[automatically_derived]
18556    impl anchor_lang::AccountDeserialize for UpdatePerpMarketName {
18557        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
18558            let given_disc = &buf[..8];
18559            if Self::DISCRIMINATOR != given_disc {
18560                return Err(anchor_lang::error!(
18561                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
18562                ));
18563            }
18564            Self::try_deserialize_unchecked(buf)
18565        }
18566        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
18567            let mut data: &[u8] = &buf[8..];
18568            AnchorDeserialize::deserialize(&mut data)
18569                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
18570        }
18571    }
18572    #[repr(C)]
18573    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
18574    pub struct UpdatePerpMarketMinOrderSize {
18575        pub admin: Pubkey,
18576        pub state: Pubkey,
18577        pub perp_market: Pubkey,
18578    }
18579    #[automatically_derived]
18580    impl anchor_lang::Discriminator for UpdatePerpMarketMinOrderSize {
18581        const DISCRIMINATOR: &[u8] = &[148, 182, 143, 25, 247, 254, 104, 102];
18582    }
18583    #[automatically_derived]
18584    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdatePerpMarketMinOrderSize {}
18585    #[automatically_derived]
18586    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdatePerpMarketMinOrderSize {}
18587    #[automatically_derived]
18588    impl anchor_lang::ZeroCopy for UpdatePerpMarketMinOrderSize {}
18589    #[automatically_derived]
18590    impl anchor_lang::InstructionData for UpdatePerpMarketMinOrderSize {}
18591    #[automatically_derived]
18592    impl ToAccountMetas for UpdatePerpMarketMinOrderSize {
18593        fn to_account_metas(&self) -> Vec<AccountMeta> {
18594            vec![
18595                AccountMeta {
18596                    pubkey: self.admin,
18597                    is_signer: true,
18598                    is_writable: false,
18599                },
18600                AccountMeta {
18601                    pubkey: self.state,
18602                    is_signer: false,
18603                    is_writable: false,
18604                },
18605                AccountMeta {
18606                    pubkey: self.perp_market,
18607                    is_signer: false,
18608                    is_writable: true,
18609                },
18610            ]
18611        }
18612    }
18613    #[automatically_derived]
18614    impl anchor_lang::AccountSerialize for UpdatePerpMarketMinOrderSize {
18615        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
18616            if writer.write_all(Self::DISCRIMINATOR).is_err() {
18617                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
18618            }
18619            if AnchorSerialize::serialize(self, writer).is_err() {
18620                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
18621            }
18622            Ok(())
18623        }
18624    }
18625    #[automatically_derived]
18626    impl anchor_lang::AccountDeserialize for UpdatePerpMarketMinOrderSize {
18627        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
18628            let given_disc = &buf[..8];
18629            if Self::DISCRIMINATOR != given_disc {
18630                return Err(anchor_lang::error!(
18631                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
18632                ));
18633            }
18634            Self::try_deserialize_unchecked(buf)
18635        }
18636        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
18637            let mut data: &[u8] = &buf[8..];
18638            AnchorDeserialize::deserialize(&mut data)
18639                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
18640        }
18641    }
18642    #[repr(C)]
18643    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
18644    pub struct UpdatePerpMarketMaxSlippageRatio {
18645        pub admin: Pubkey,
18646        pub state: Pubkey,
18647        pub perp_market: Pubkey,
18648    }
18649    #[automatically_derived]
18650    impl anchor_lang::Discriminator for UpdatePerpMarketMaxSlippageRatio {
18651        const DISCRIMINATOR: &[u8] = &[56, 192, 174, 214, 217, 227, 164, 25];
18652    }
18653    #[automatically_derived]
18654    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdatePerpMarketMaxSlippageRatio {}
18655    #[automatically_derived]
18656    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdatePerpMarketMaxSlippageRatio {}
18657    #[automatically_derived]
18658    impl anchor_lang::ZeroCopy for UpdatePerpMarketMaxSlippageRatio {}
18659    #[automatically_derived]
18660    impl anchor_lang::InstructionData for UpdatePerpMarketMaxSlippageRatio {}
18661    #[automatically_derived]
18662    impl ToAccountMetas for UpdatePerpMarketMaxSlippageRatio {
18663        fn to_account_metas(&self) -> Vec<AccountMeta> {
18664            vec![
18665                AccountMeta {
18666                    pubkey: self.admin,
18667                    is_signer: true,
18668                    is_writable: false,
18669                },
18670                AccountMeta {
18671                    pubkey: self.state,
18672                    is_signer: false,
18673                    is_writable: false,
18674                },
18675                AccountMeta {
18676                    pubkey: self.perp_market,
18677                    is_signer: false,
18678                    is_writable: true,
18679                },
18680            ]
18681        }
18682    }
18683    #[automatically_derived]
18684    impl anchor_lang::AccountSerialize for UpdatePerpMarketMaxSlippageRatio {
18685        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
18686            if writer.write_all(Self::DISCRIMINATOR).is_err() {
18687                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
18688            }
18689            if AnchorSerialize::serialize(self, writer).is_err() {
18690                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
18691            }
18692            Ok(())
18693        }
18694    }
18695    #[automatically_derived]
18696    impl anchor_lang::AccountDeserialize for UpdatePerpMarketMaxSlippageRatio {
18697        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
18698            let given_disc = &buf[..8];
18699            if Self::DISCRIMINATOR != given_disc {
18700                return Err(anchor_lang::error!(
18701                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
18702                ));
18703            }
18704            Self::try_deserialize_unchecked(buf)
18705        }
18706        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
18707            let mut data: &[u8] = &buf[8..];
18708            AnchorDeserialize::deserialize(&mut data)
18709                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
18710        }
18711    }
18712    #[repr(C)]
18713    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
18714    pub struct UpdatePerpMarketMaxFillReserveFraction {
18715        pub admin: Pubkey,
18716        pub state: Pubkey,
18717        pub perp_market: Pubkey,
18718    }
18719    #[automatically_derived]
18720    impl anchor_lang::Discriminator for UpdatePerpMarketMaxFillReserveFraction {
18721        const DISCRIMINATOR: &[u8] = &[158, 50, 175, 240, 17, 123, 186, 41];
18722    }
18723    #[automatically_derived]
18724    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdatePerpMarketMaxFillReserveFraction {}
18725    #[automatically_derived]
18726    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdatePerpMarketMaxFillReserveFraction {}
18727    #[automatically_derived]
18728    impl anchor_lang::ZeroCopy for UpdatePerpMarketMaxFillReserveFraction {}
18729    #[automatically_derived]
18730    impl anchor_lang::InstructionData for UpdatePerpMarketMaxFillReserveFraction {}
18731    #[automatically_derived]
18732    impl ToAccountMetas for UpdatePerpMarketMaxFillReserveFraction {
18733        fn to_account_metas(&self) -> Vec<AccountMeta> {
18734            vec![
18735                AccountMeta {
18736                    pubkey: self.admin,
18737                    is_signer: true,
18738                    is_writable: false,
18739                },
18740                AccountMeta {
18741                    pubkey: self.state,
18742                    is_signer: false,
18743                    is_writable: false,
18744                },
18745                AccountMeta {
18746                    pubkey: self.perp_market,
18747                    is_signer: false,
18748                    is_writable: true,
18749                },
18750            ]
18751        }
18752    }
18753    #[automatically_derived]
18754    impl anchor_lang::AccountSerialize for UpdatePerpMarketMaxFillReserveFraction {
18755        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
18756            if writer.write_all(Self::DISCRIMINATOR).is_err() {
18757                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
18758            }
18759            if AnchorSerialize::serialize(self, writer).is_err() {
18760                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
18761            }
18762            Ok(())
18763        }
18764    }
18765    #[automatically_derived]
18766    impl anchor_lang::AccountDeserialize for UpdatePerpMarketMaxFillReserveFraction {
18767        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
18768            let given_disc = &buf[..8];
18769            if Self::DISCRIMINATOR != given_disc {
18770                return Err(anchor_lang::error!(
18771                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
18772                ));
18773            }
18774            Self::try_deserialize_unchecked(buf)
18775        }
18776        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
18777            let mut data: &[u8] = &buf[8..];
18778            AnchorDeserialize::deserialize(&mut data)
18779                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
18780        }
18781    }
18782    #[repr(C)]
18783    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
18784    pub struct UpdatePerpMarketMaxOpenInterest {
18785        pub admin: Pubkey,
18786        pub state: Pubkey,
18787        pub perp_market: Pubkey,
18788    }
18789    #[automatically_derived]
18790    impl anchor_lang::Discriminator for UpdatePerpMarketMaxOpenInterest {
18791        const DISCRIMINATOR: &[u8] = &[211, 243, 37, 54, 206, 192, 240, 221];
18792    }
18793    #[automatically_derived]
18794    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdatePerpMarketMaxOpenInterest {}
18795    #[automatically_derived]
18796    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdatePerpMarketMaxOpenInterest {}
18797    #[automatically_derived]
18798    impl anchor_lang::ZeroCopy for UpdatePerpMarketMaxOpenInterest {}
18799    #[automatically_derived]
18800    impl anchor_lang::InstructionData for UpdatePerpMarketMaxOpenInterest {}
18801    #[automatically_derived]
18802    impl ToAccountMetas for UpdatePerpMarketMaxOpenInterest {
18803        fn to_account_metas(&self) -> Vec<AccountMeta> {
18804            vec![
18805                AccountMeta {
18806                    pubkey: self.admin,
18807                    is_signer: true,
18808                    is_writable: false,
18809                },
18810                AccountMeta {
18811                    pubkey: self.state,
18812                    is_signer: false,
18813                    is_writable: false,
18814                },
18815                AccountMeta {
18816                    pubkey: self.perp_market,
18817                    is_signer: false,
18818                    is_writable: true,
18819                },
18820            ]
18821        }
18822    }
18823    #[automatically_derived]
18824    impl anchor_lang::AccountSerialize for UpdatePerpMarketMaxOpenInterest {
18825        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
18826            if writer.write_all(Self::DISCRIMINATOR).is_err() {
18827                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
18828            }
18829            if AnchorSerialize::serialize(self, writer).is_err() {
18830                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
18831            }
18832            Ok(())
18833        }
18834    }
18835    #[automatically_derived]
18836    impl anchor_lang::AccountDeserialize for UpdatePerpMarketMaxOpenInterest {
18837        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
18838            let given_disc = &buf[..8];
18839            if Self::DISCRIMINATOR != given_disc {
18840                return Err(anchor_lang::error!(
18841                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
18842                ));
18843            }
18844            Self::try_deserialize_unchecked(buf)
18845        }
18846        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
18847            let mut data: &[u8] = &buf[8..];
18848            AnchorDeserialize::deserialize(&mut data)
18849                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
18850        }
18851    }
18852    #[repr(C)]
18853    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
18854    pub struct UpdatePerpMarketNumberOfUsers {
18855        pub admin: Pubkey,
18856        pub state: Pubkey,
18857        pub perp_market: Pubkey,
18858    }
18859    #[automatically_derived]
18860    impl anchor_lang::Discriminator for UpdatePerpMarketNumberOfUsers {
18861        const DISCRIMINATOR: &[u8] = &[221, 66, 246, 127, 23, 14, 214, 137];
18862    }
18863    #[automatically_derived]
18864    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdatePerpMarketNumberOfUsers {}
18865    #[automatically_derived]
18866    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdatePerpMarketNumberOfUsers {}
18867    #[automatically_derived]
18868    impl anchor_lang::ZeroCopy for UpdatePerpMarketNumberOfUsers {}
18869    #[automatically_derived]
18870    impl anchor_lang::InstructionData for UpdatePerpMarketNumberOfUsers {}
18871    #[automatically_derived]
18872    impl ToAccountMetas for UpdatePerpMarketNumberOfUsers {
18873        fn to_account_metas(&self) -> Vec<AccountMeta> {
18874            vec![
18875                AccountMeta {
18876                    pubkey: self.admin,
18877                    is_signer: true,
18878                    is_writable: false,
18879                },
18880                AccountMeta {
18881                    pubkey: self.state,
18882                    is_signer: false,
18883                    is_writable: false,
18884                },
18885                AccountMeta {
18886                    pubkey: self.perp_market,
18887                    is_signer: false,
18888                    is_writable: true,
18889                },
18890            ]
18891        }
18892    }
18893    #[automatically_derived]
18894    impl anchor_lang::AccountSerialize for UpdatePerpMarketNumberOfUsers {
18895        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
18896            if writer.write_all(Self::DISCRIMINATOR).is_err() {
18897                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
18898            }
18899            if AnchorSerialize::serialize(self, writer).is_err() {
18900                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
18901            }
18902            Ok(())
18903        }
18904    }
18905    #[automatically_derived]
18906    impl anchor_lang::AccountDeserialize for UpdatePerpMarketNumberOfUsers {
18907        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
18908            let given_disc = &buf[..8];
18909            if Self::DISCRIMINATOR != given_disc {
18910                return Err(anchor_lang::error!(
18911                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
18912                ));
18913            }
18914            Self::try_deserialize_unchecked(buf)
18915        }
18916        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
18917            let mut data: &[u8] = &buf[8..];
18918            AnchorDeserialize::deserialize(&mut data)
18919                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
18920        }
18921    }
18922    #[repr(C)]
18923    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
18924    pub struct UpdatePerpMarketFeeAdjustment {
18925        pub admin: Pubkey,
18926        pub state: Pubkey,
18927        pub perp_market: Pubkey,
18928    }
18929    #[automatically_derived]
18930    impl anchor_lang::Discriminator for UpdatePerpMarketFeeAdjustment {
18931        const DISCRIMINATOR: &[u8] = &[110, 120, 82, 31, 217, 115, 121, 11];
18932    }
18933    #[automatically_derived]
18934    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdatePerpMarketFeeAdjustment {}
18935    #[automatically_derived]
18936    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdatePerpMarketFeeAdjustment {}
18937    #[automatically_derived]
18938    impl anchor_lang::ZeroCopy for UpdatePerpMarketFeeAdjustment {}
18939    #[automatically_derived]
18940    impl anchor_lang::InstructionData for UpdatePerpMarketFeeAdjustment {}
18941    #[automatically_derived]
18942    impl ToAccountMetas for UpdatePerpMarketFeeAdjustment {
18943        fn to_account_metas(&self) -> Vec<AccountMeta> {
18944            vec![
18945                AccountMeta {
18946                    pubkey: self.admin,
18947                    is_signer: true,
18948                    is_writable: false,
18949                },
18950                AccountMeta {
18951                    pubkey: self.state,
18952                    is_signer: false,
18953                    is_writable: false,
18954                },
18955                AccountMeta {
18956                    pubkey: self.perp_market,
18957                    is_signer: false,
18958                    is_writable: true,
18959                },
18960            ]
18961        }
18962    }
18963    #[automatically_derived]
18964    impl anchor_lang::AccountSerialize for UpdatePerpMarketFeeAdjustment {
18965        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
18966            if writer.write_all(Self::DISCRIMINATOR).is_err() {
18967                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
18968            }
18969            if AnchorSerialize::serialize(self, writer).is_err() {
18970                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
18971            }
18972            Ok(())
18973        }
18974    }
18975    #[automatically_derived]
18976    impl anchor_lang::AccountDeserialize for UpdatePerpMarketFeeAdjustment {
18977        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
18978            let given_disc = &buf[..8];
18979            if Self::DISCRIMINATOR != given_disc {
18980                return Err(anchor_lang::error!(
18981                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
18982                ));
18983            }
18984            Self::try_deserialize_unchecked(buf)
18985        }
18986        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
18987            let mut data: &[u8] = &buf[8..];
18988            AnchorDeserialize::deserialize(&mut data)
18989                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
18990        }
18991    }
18992    #[repr(C)]
18993    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
18994    pub struct UpdateSpotMarketFeeAdjustment {
18995        pub admin: Pubkey,
18996        pub state: Pubkey,
18997        pub spot_market: Pubkey,
18998    }
18999    #[automatically_derived]
19000    impl anchor_lang::Discriminator for UpdateSpotMarketFeeAdjustment {
19001        const DISCRIMINATOR: &[u8] = &[124, 184, 119, 171, 139, 199, 27, 40];
19002    }
19003    #[automatically_derived]
19004    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdateSpotMarketFeeAdjustment {}
19005    #[automatically_derived]
19006    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdateSpotMarketFeeAdjustment {}
19007    #[automatically_derived]
19008    impl anchor_lang::ZeroCopy for UpdateSpotMarketFeeAdjustment {}
19009    #[automatically_derived]
19010    impl anchor_lang::InstructionData for UpdateSpotMarketFeeAdjustment {}
19011    #[automatically_derived]
19012    impl ToAccountMetas for UpdateSpotMarketFeeAdjustment {
19013        fn to_account_metas(&self) -> Vec<AccountMeta> {
19014            vec![
19015                AccountMeta {
19016                    pubkey: self.admin,
19017                    is_signer: true,
19018                    is_writable: false,
19019                },
19020                AccountMeta {
19021                    pubkey: self.state,
19022                    is_signer: false,
19023                    is_writable: false,
19024                },
19025                AccountMeta {
19026                    pubkey: self.spot_market,
19027                    is_signer: false,
19028                    is_writable: true,
19029                },
19030            ]
19031        }
19032    }
19033    #[automatically_derived]
19034    impl anchor_lang::AccountSerialize for UpdateSpotMarketFeeAdjustment {
19035        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
19036            if writer.write_all(Self::DISCRIMINATOR).is_err() {
19037                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
19038            }
19039            if AnchorSerialize::serialize(self, writer).is_err() {
19040                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
19041            }
19042            Ok(())
19043        }
19044    }
19045    #[automatically_derived]
19046    impl anchor_lang::AccountDeserialize for UpdateSpotMarketFeeAdjustment {
19047        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
19048            let given_disc = &buf[..8];
19049            if Self::DISCRIMINATOR != given_disc {
19050                return Err(anchor_lang::error!(
19051                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
19052                ));
19053            }
19054            Self::try_deserialize_unchecked(buf)
19055        }
19056        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
19057            let mut data: &[u8] = &buf[8..];
19058            AnchorDeserialize::deserialize(&mut data)
19059                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
19060        }
19061    }
19062    #[repr(C)]
19063    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
19064    pub struct UpdatePerpMarketFuel {
19065        pub admin: Pubkey,
19066        pub state: Pubkey,
19067        pub perp_market: Pubkey,
19068    }
19069    #[automatically_derived]
19070    impl anchor_lang::Discriminator for UpdatePerpMarketFuel {
19071        const DISCRIMINATOR: &[u8] = &[128, 34, 207, 128, 207, 145, 65, 46];
19072    }
19073    #[automatically_derived]
19074    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdatePerpMarketFuel {}
19075    #[automatically_derived]
19076    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdatePerpMarketFuel {}
19077    #[automatically_derived]
19078    impl anchor_lang::ZeroCopy for UpdatePerpMarketFuel {}
19079    #[automatically_derived]
19080    impl anchor_lang::InstructionData for UpdatePerpMarketFuel {}
19081    #[automatically_derived]
19082    impl ToAccountMetas for UpdatePerpMarketFuel {
19083        fn to_account_metas(&self) -> Vec<AccountMeta> {
19084            vec![
19085                AccountMeta {
19086                    pubkey: self.admin,
19087                    is_signer: true,
19088                    is_writable: false,
19089                },
19090                AccountMeta {
19091                    pubkey: self.state,
19092                    is_signer: false,
19093                    is_writable: false,
19094                },
19095                AccountMeta {
19096                    pubkey: self.perp_market,
19097                    is_signer: false,
19098                    is_writable: true,
19099                },
19100            ]
19101        }
19102    }
19103    #[automatically_derived]
19104    impl anchor_lang::AccountSerialize for UpdatePerpMarketFuel {
19105        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
19106            if writer.write_all(Self::DISCRIMINATOR).is_err() {
19107                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
19108            }
19109            if AnchorSerialize::serialize(self, writer).is_err() {
19110                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
19111            }
19112            Ok(())
19113        }
19114    }
19115    #[automatically_derived]
19116    impl anchor_lang::AccountDeserialize for UpdatePerpMarketFuel {
19117        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
19118            let given_disc = &buf[..8];
19119            if Self::DISCRIMINATOR != given_disc {
19120                return Err(anchor_lang::error!(
19121                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
19122                ));
19123            }
19124            Self::try_deserialize_unchecked(buf)
19125        }
19126        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
19127            let mut data: &[u8] = &buf[8..];
19128            AnchorDeserialize::deserialize(&mut data)
19129                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
19130        }
19131    }
19132    #[repr(C)]
19133    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
19134    pub struct UpdateSpotMarketFuel {
19135        pub admin: Pubkey,
19136        pub state: Pubkey,
19137        pub spot_market: Pubkey,
19138    }
19139    #[automatically_derived]
19140    impl anchor_lang::Discriminator for UpdateSpotMarketFuel {
19141        const DISCRIMINATOR: &[u8] = &[169, 6, 208, 85, 23, 115, 22, 75];
19142    }
19143    #[automatically_derived]
19144    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdateSpotMarketFuel {}
19145    #[automatically_derived]
19146    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdateSpotMarketFuel {}
19147    #[automatically_derived]
19148    impl anchor_lang::ZeroCopy for UpdateSpotMarketFuel {}
19149    #[automatically_derived]
19150    impl anchor_lang::InstructionData for UpdateSpotMarketFuel {}
19151    #[automatically_derived]
19152    impl ToAccountMetas for UpdateSpotMarketFuel {
19153        fn to_account_metas(&self) -> Vec<AccountMeta> {
19154            vec![
19155                AccountMeta {
19156                    pubkey: self.admin,
19157                    is_signer: true,
19158                    is_writable: false,
19159                },
19160                AccountMeta {
19161                    pubkey: self.state,
19162                    is_signer: false,
19163                    is_writable: false,
19164                },
19165                AccountMeta {
19166                    pubkey: self.spot_market,
19167                    is_signer: false,
19168                    is_writable: true,
19169                },
19170            ]
19171        }
19172    }
19173    #[automatically_derived]
19174    impl anchor_lang::AccountSerialize for UpdateSpotMarketFuel {
19175        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
19176            if writer.write_all(Self::DISCRIMINATOR).is_err() {
19177                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
19178            }
19179            if AnchorSerialize::serialize(self, writer).is_err() {
19180                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
19181            }
19182            Ok(())
19183        }
19184    }
19185    #[automatically_derived]
19186    impl anchor_lang::AccountDeserialize for UpdateSpotMarketFuel {
19187        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
19188            let given_disc = &buf[..8];
19189            if Self::DISCRIMINATOR != given_disc {
19190                return Err(anchor_lang::error!(
19191                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
19192                ));
19193            }
19194            Self::try_deserialize_unchecked(buf)
19195        }
19196        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
19197            let mut data: &[u8] = &buf[8..];
19198            AnchorDeserialize::deserialize(&mut data)
19199                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
19200        }
19201    }
19202    #[repr(C)]
19203    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
19204    pub struct InitUserFuel {
19205        pub admin: Pubkey,
19206        pub state: Pubkey,
19207        pub user: Pubkey,
19208        pub user_stats: Pubkey,
19209    }
19210    #[automatically_derived]
19211    impl anchor_lang::Discriminator for InitUserFuel {
19212        const DISCRIMINATOR: &[u8] = &[78, 54, 127, 169, 245, 179, 149, 35];
19213    }
19214    #[automatically_derived]
19215    unsafe impl anchor_lang::__private::bytemuck::Pod for InitUserFuel {}
19216    #[automatically_derived]
19217    unsafe impl anchor_lang::__private::bytemuck::Zeroable for InitUserFuel {}
19218    #[automatically_derived]
19219    impl anchor_lang::ZeroCopy for InitUserFuel {}
19220    #[automatically_derived]
19221    impl anchor_lang::InstructionData for InitUserFuel {}
19222    #[automatically_derived]
19223    impl ToAccountMetas for InitUserFuel {
19224        fn to_account_metas(&self) -> Vec<AccountMeta> {
19225            vec![
19226                AccountMeta {
19227                    pubkey: self.admin,
19228                    is_signer: true,
19229                    is_writable: false,
19230                },
19231                AccountMeta {
19232                    pubkey: self.state,
19233                    is_signer: false,
19234                    is_writable: false,
19235                },
19236                AccountMeta {
19237                    pubkey: self.user,
19238                    is_signer: false,
19239                    is_writable: true,
19240                },
19241                AccountMeta {
19242                    pubkey: self.user_stats,
19243                    is_signer: false,
19244                    is_writable: true,
19245                },
19246            ]
19247        }
19248    }
19249    #[automatically_derived]
19250    impl anchor_lang::AccountSerialize for InitUserFuel {
19251        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
19252            if writer.write_all(Self::DISCRIMINATOR).is_err() {
19253                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
19254            }
19255            if AnchorSerialize::serialize(self, writer).is_err() {
19256                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
19257            }
19258            Ok(())
19259        }
19260    }
19261    #[automatically_derived]
19262    impl anchor_lang::AccountDeserialize for InitUserFuel {
19263        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
19264            let given_disc = &buf[..8];
19265            if Self::DISCRIMINATOR != given_disc {
19266                return Err(anchor_lang::error!(
19267                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
19268                ));
19269            }
19270            Self::try_deserialize_unchecked(buf)
19271        }
19272        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
19273            let mut data: &[u8] = &buf[8..];
19274            AnchorDeserialize::deserialize(&mut data)
19275                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
19276        }
19277    }
19278    #[repr(C)]
19279    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
19280    pub struct UpdateAdmin {
19281        pub admin: Pubkey,
19282        pub state: Pubkey,
19283    }
19284    #[automatically_derived]
19285    impl anchor_lang::Discriminator for UpdateAdmin {
19286        const DISCRIMINATOR: &[u8] = &[226, 255, 184, 234, 67, 191, 5, 182];
19287    }
19288    #[automatically_derived]
19289    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdateAdmin {}
19290    #[automatically_derived]
19291    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdateAdmin {}
19292    #[automatically_derived]
19293    impl anchor_lang::ZeroCopy for UpdateAdmin {}
19294    #[automatically_derived]
19295    impl anchor_lang::InstructionData for UpdateAdmin {}
19296    #[automatically_derived]
19297    impl ToAccountMetas for UpdateAdmin {
19298        fn to_account_metas(&self) -> Vec<AccountMeta> {
19299            vec![
19300                AccountMeta {
19301                    pubkey: self.admin,
19302                    is_signer: true,
19303                    is_writable: false,
19304                },
19305                AccountMeta {
19306                    pubkey: self.state,
19307                    is_signer: false,
19308                    is_writable: true,
19309                },
19310            ]
19311        }
19312    }
19313    #[automatically_derived]
19314    impl anchor_lang::AccountSerialize for UpdateAdmin {
19315        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
19316            if writer.write_all(Self::DISCRIMINATOR).is_err() {
19317                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
19318            }
19319            if AnchorSerialize::serialize(self, writer).is_err() {
19320                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
19321            }
19322            Ok(())
19323        }
19324    }
19325    #[automatically_derived]
19326    impl anchor_lang::AccountDeserialize for UpdateAdmin {
19327        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
19328            let given_disc = &buf[..8];
19329            if Self::DISCRIMINATOR != given_disc {
19330                return Err(anchor_lang::error!(
19331                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
19332                ));
19333            }
19334            Self::try_deserialize_unchecked(buf)
19335        }
19336        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
19337            let mut data: &[u8] = &buf[8..];
19338            AnchorDeserialize::deserialize(&mut data)
19339                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
19340        }
19341    }
19342    #[repr(C)]
19343    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
19344    pub struct UpdateWhitelistMint {
19345        pub admin: Pubkey,
19346        pub state: Pubkey,
19347    }
19348    #[automatically_derived]
19349    impl anchor_lang::Discriminator for UpdateWhitelistMint {
19350        const DISCRIMINATOR: &[u8] = &[227, 158, 63, 228, 73, 69, 23, 54];
19351    }
19352    #[automatically_derived]
19353    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdateWhitelistMint {}
19354    #[automatically_derived]
19355    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdateWhitelistMint {}
19356    #[automatically_derived]
19357    impl anchor_lang::ZeroCopy for UpdateWhitelistMint {}
19358    #[automatically_derived]
19359    impl anchor_lang::InstructionData for UpdateWhitelistMint {}
19360    #[automatically_derived]
19361    impl ToAccountMetas for UpdateWhitelistMint {
19362        fn to_account_metas(&self) -> Vec<AccountMeta> {
19363            vec![
19364                AccountMeta {
19365                    pubkey: self.admin,
19366                    is_signer: true,
19367                    is_writable: false,
19368                },
19369                AccountMeta {
19370                    pubkey: self.state,
19371                    is_signer: false,
19372                    is_writable: true,
19373                },
19374            ]
19375        }
19376    }
19377    #[automatically_derived]
19378    impl anchor_lang::AccountSerialize for UpdateWhitelistMint {
19379        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
19380            if writer.write_all(Self::DISCRIMINATOR).is_err() {
19381                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
19382            }
19383            if AnchorSerialize::serialize(self, writer).is_err() {
19384                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
19385            }
19386            Ok(())
19387        }
19388    }
19389    #[automatically_derived]
19390    impl anchor_lang::AccountDeserialize for UpdateWhitelistMint {
19391        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
19392            let given_disc = &buf[..8];
19393            if Self::DISCRIMINATOR != given_disc {
19394                return Err(anchor_lang::error!(
19395                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
19396                ));
19397            }
19398            Self::try_deserialize_unchecked(buf)
19399        }
19400        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
19401            let mut data: &[u8] = &buf[8..];
19402            AnchorDeserialize::deserialize(&mut data)
19403                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
19404        }
19405    }
19406    #[repr(C)]
19407    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
19408    pub struct UpdateDiscountMint {
19409        pub admin: Pubkey,
19410        pub state: Pubkey,
19411    }
19412    #[automatically_derived]
19413    impl anchor_lang::Discriminator for UpdateDiscountMint {
19414        const DISCRIMINATOR: &[u8] = &[26, 238, 24, 203, 91, 255, 142, 129];
19415    }
19416    #[automatically_derived]
19417    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdateDiscountMint {}
19418    #[automatically_derived]
19419    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdateDiscountMint {}
19420    #[automatically_derived]
19421    impl anchor_lang::ZeroCopy for UpdateDiscountMint {}
19422    #[automatically_derived]
19423    impl anchor_lang::InstructionData for UpdateDiscountMint {}
19424    #[automatically_derived]
19425    impl ToAccountMetas for UpdateDiscountMint {
19426        fn to_account_metas(&self) -> Vec<AccountMeta> {
19427            vec![
19428                AccountMeta {
19429                    pubkey: self.admin,
19430                    is_signer: true,
19431                    is_writable: false,
19432                },
19433                AccountMeta {
19434                    pubkey: self.state,
19435                    is_signer: false,
19436                    is_writable: true,
19437                },
19438            ]
19439        }
19440    }
19441    #[automatically_derived]
19442    impl anchor_lang::AccountSerialize for UpdateDiscountMint {
19443        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
19444            if writer.write_all(Self::DISCRIMINATOR).is_err() {
19445                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
19446            }
19447            if AnchorSerialize::serialize(self, writer).is_err() {
19448                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
19449            }
19450            Ok(())
19451        }
19452    }
19453    #[automatically_derived]
19454    impl anchor_lang::AccountDeserialize for UpdateDiscountMint {
19455        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
19456            let given_disc = &buf[..8];
19457            if Self::DISCRIMINATOR != given_disc {
19458                return Err(anchor_lang::error!(
19459                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
19460                ));
19461            }
19462            Self::try_deserialize_unchecked(buf)
19463        }
19464        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
19465            let mut data: &[u8] = &buf[8..];
19466            AnchorDeserialize::deserialize(&mut data)
19467                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
19468        }
19469    }
19470    #[repr(C)]
19471    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
19472    pub struct UpdateExchangeStatus {
19473        pub admin: Pubkey,
19474        pub state: Pubkey,
19475    }
19476    #[automatically_derived]
19477    impl anchor_lang::Discriminator for UpdateExchangeStatus {
19478        const DISCRIMINATOR: &[u8] = &[54, 251, 5, 25, 149, 14, 206, 156];
19479    }
19480    #[automatically_derived]
19481    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdateExchangeStatus {}
19482    #[automatically_derived]
19483    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdateExchangeStatus {}
19484    #[automatically_derived]
19485    impl anchor_lang::ZeroCopy for UpdateExchangeStatus {}
19486    #[automatically_derived]
19487    impl anchor_lang::InstructionData for UpdateExchangeStatus {}
19488    #[automatically_derived]
19489    impl ToAccountMetas for UpdateExchangeStatus {
19490        fn to_account_metas(&self) -> Vec<AccountMeta> {
19491            vec![
19492                AccountMeta {
19493                    pubkey: self.admin,
19494                    is_signer: true,
19495                    is_writable: false,
19496                },
19497                AccountMeta {
19498                    pubkey: self.state,
19499                    is_signer: false,
19500                    is_writable: true,
19501                },
19502            ]
19503        }
19504    }
19505    #[automatically_derived]
19506    impl anchor_lang::AccountSerialize for UpdateExchangeStatus {
19507        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
19508            if writer.write_all(Self::DISCRIMINATOR).is_err() {
19509                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
19510            }
19511            if AnchorSerialize::serialize(self, writer).is_err() {
19512                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
19513            }
19514            Ok(())
19515        }
19516    }
19517    #[automatically_derived]
19518    impl anchor_lang::AccountDeserialize for UpdateExchangeStatus {
19519        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
19520            let given_disc = &buf[..8];
19521            if Self::DISCRIMINATOR != given_disc {
19522                return Err(anchor_lang::error!(
19523                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
19524                ));
19525            }
19526            Self::try_deserialize_unchecked(buf)
19527        }
19528        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
19529            let mut data: &[u8] = &buf[8..];
19530            AnchorDeserialize::deserialize(&mut data)
19531                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
19532        }
19533    }
19534    #[repr(C)]
19535    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
19536    pub struct UpdatePerpAuctionDuration {
19537        pub admin: Pubkey,
19538        pub state: Pubkey,
19539    }
19540    #[automatically_derived]
19541    impl anchor_lang::Discriminator for UpdatePerpAuctionDuration {
19542        const DISCRIMINATOR: &[u8] = &[220, 51, 72, 247, 206, 206, 238, 110];
19543    }
19544    #[automatically_derived]
19545    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdatePerpAuctionDuration {}
19546    #[automatically_derived]
19547    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdatePerpAuctionDuration {}
19548    #[automatically_derived]
19549    impl anchor_lang::ZeroCopy for UpdatePerpAuctionDuration {}
19550    #[automatically_derived]
19551    impl anchor_lang::InstructionData for UpdatePerpAuctionDuration {}
19552    #[automatically_derived]
19553    impl ToAccountMetas for UpdatePerpAuctionDuration {
19554        fn to_account_metas(&self) -> Vec<AccountMeta> {
19555            vec![
19556                AccountMeta {
19557                    pubkey: self.admin,
19558                    is_signer: true,
19559                    is_writable: false,
19560                },
19561                AccountMeta {
19562                    pubkey: self.state,
19563                    is_signer: false,
19564                    is_writable: true,
19565                },
19566            ]
19567        }
19568    }
19569    #[automatically_derived]
19570    impl anchor_lang::AccountSerialize for UpdatePerpAuctionDuration {
19571        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
19572            if writer.write_all(Self::DISCRIMINATOR).is_err() {
19573                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
19574            }
19575            if AnchorSerialize::serialize(self, writer).is_err() {
19576                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
19577            }
19578            Ok(())
19579        }
19580    }
19581    #[automatically_derived]
19582    impl anchor_lang::AccountDeserialize for UpdatePerpAuctionDuration {
19583        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
19584            let given_disc = &buf[..8];
19585            if Self::DISCRIMINATOR != given_disc {
19586                return Err(anchor_lang::error!(
19587                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
19588                ));
19589            }
19590            Self::try_deserialize_unchecked(buf)
19591        }
19592        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
19593            let mut data: &[u8] = &buf[8..];
19594            AnchorDeserialize::deserialize(&mut data)
19595                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
19596        }
19597    }
19598    #[repr(C)]
19599    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
19600    pub struct UpdateSpotAuctionDuration {
19601        pub admin: Pubkey,
19602        pub state: Pubkey,
19603    }
19604    #[automatically_derived]
19605    impl anchor_lang::Discriminator for UpdateSpotAuctionDuration {
19606        const DISCRIMINATOR: &[u8] = &[227, 57, 154, 80, 55, 26, 182, 148];
19607    }
19608    #[automatically_derived]
19609    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdateSpotAuctionDuration {}
19610    #[automatically_derived]
19611    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdateSpotAuctionDuration {}
19612    #[automatically_derived]
19613    impl anchor_lang::ZeroCopy for UpdateSpotAuctionDuration {}
19614    #[automatically_derived]
19615    impl anchor_lang::InstructionData for UpdateSpotAuctionDuration {}
19616    #[automatically_derived]
19617    impl ToAccountMetas for UpdateSpotAuctionDuration {
19618        fn to_account_metas(&self) -> Vec<AccountMeta> {
19619            vec![
19620                AccountMeta {
19621                    pubkey: self.admin,
19622                    is_signer: true,
19623                    is_writable: false,
19624                },
19625                AccountMeta {
19626                    pubkey: self.state,
19627                    is_signer: false,
19628                    is_writable: true,
19629                },
19630            ]
19631        }
19632    }
19633    #[automatically_derived]
19634    impl anchor_lang::AccountSerialize for UpdateSpotAuctionDuration {
19635        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
19636            if writer.write_all(Self::DISCRIMINATOR).is_err() {
19637                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
19638            }
19639            if AnchorSerialize::serialize(self, writer).is_err() {
19640                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
19641            }
19642            Ok(())
19643        }
19644    }
19645    #[automatically_derived]
19646    impl anchor_lang::AccountDeserialize for UpdateSpotAuctionDuration {
19647        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
19648            let given_disc = &buf[..8];
19649            if Self::DISCRIMINATOR != given_disc {
19650                return Err(anchor_lang::error!(
19651                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
19652                ));
19653            }
19654            Self::try_deserialize_unchecked(buf)
19655        }
19656        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
19657            let mut data: &[u8] = &buf[8..];
19658            AnchorDeserialize::deserialize(&mut data)
19659                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
19660        }
19661    }
19662    #[repr(C)]
19663    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
19664    pub struct InitializeProtocolIfSharesTransferConfig {
19665        pub admin: Pubkey,
19666        pub protocol_if_shares_transfer_config: Pubkey,
19667        pub state: Pubkey,
19668        pub rent: Pubkey,
19669        pub system_program: Pubkey,
19670    }
19671    #[automatically_derived]
19672    impl anchor_lang::Discriminator for InitializeProtocolIfSharesTransferConfig {
19673        const DISCRIMINATOR: &[u8] = &[204, 47, 201, 74, 217, 201, 130, 232];
19674    }
19675    #[automatically_derived]
19676    unsafe impl anchor_lang::__private::bytemuck::Pod for InitializeProtocolIfSharesTransferConfig {}
19677    #[automatically_derived]
19678    unsafe impl anchor_lang::__private::bytemuck::Zeroable
19679        for InitializeProtocolIfSharesTransferConfig
19680    {
19681    }
19682    #[automatically_derived]
19683    impl anchor_lang::ZeroCopy for InitializeProtocolIfSharesTransferConfig {}
19684    #[automatically_derived]
19685    impl anchor_lang::InstructionData for InitializeProtocolIfSharesTransferConfig {}
19686    #[automatically_derived]
19687    impl ToAccountMetas for InitializeProtocolIfSharesTransferConfig {
19688        fn to_account_metas(&self) -> Vec<AccountMeta> {
19689            vec![
19690                AccountMeta {
19691                    pubkey: self.admin,
19692                    is_signer: true,
19693                    is_writable: true,
19694                },
19695                AccountMeta {
19696                    pubkey: self.protocol_if_shares_transfer_config,
19697                    is_signer: false,
19698                    is_writable: true,
19699                },
19700                AccountMeta {
19701                    pubkey: self.state,
19702                    is_signer: false,
19703                    is_writable: false,
19704                },
19705                AccountMeta {
19706                    pubkey: self.rent,
19707                    is_signer: false,
19708                    is_writable: false,
19709                },
19710                AccountMeta {
19711                    pubkey: self.system_program,
19712                    is_signer: false,
19713                    is_writable: false,
19714                },
19715            ]
19716        }
19717    }
19718    #[automatically_derived]
19719    impl anchor_lang::AccountSerialize for InitializeProtocolIfSharesTransferConfig {
19720        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
19721            if writer.write_all(Self::DISCRIMINATOR).is_err() {
19722                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
19723            }
19724            if AnchorSerialize::serialize(self, writer).is_err() {
19725                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
19726            }
19727            Ok(())
19728        }
19729    }
19730    #[automatically_derived]
19731    impl anchor_lang::AccountDeserialize for InitializeProtocolIfSharesTransferConfig {
19732        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
19733            let given_disc = &buf[..8];
19734            if Self::DISCRIMINATOR != given_disc {
19735                return Err(anchor_lang::error!(
19736                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
19737                ));
19738            }
19739            Self::try_deserialize_unchecked(buf)
19740        }
19741        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
19742            let mut data: &[u8] = &buf[8..];
19743            AnchorDeserialize::deserialize(&mut data)
19744                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
19745        }
19746    }
19747    #[repr(C)]
19748    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
19749    pub struct UpdateProtocolIfSharesTransferConfig {
19750        pub admin: Pubkey,
19751        pub protocol_if_shares_transfer_config: Pubkey,
19752        pub state: Pubkey,
19753    }
19754    #[automatically_derived]
19755    impl anchor_lang::Discriminator for UpdateProtocolIfSharesTransferConfig {
19756        const DISCRIMINATOR: &[u8] = &[244, 48, 134, 239, 41, 44, 96, 131];
19757    }
19758    #[automatically_derived]
19759    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdateProtocolIfSharesTransferConfig {}
19760    #[automatically_derived]
19761    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdateProtocolIfSharesTransferConfig {}
19762    #[automatically_derived]
19763    impl anchor_lang::ZeroCopy for UpdateProtocolIfSharesTransferConfig {}
19764    #[automatically_derived]
19765    impl anchor_lang::InstructionData for UpdateProtocolIfSharesTransferConfig {}
19766    #[automatically_derived]
19767    impl ToAccountMetas for UpdateProtocolIfSharesTransferConfig {
19768        fn to_account_metas(&self) -> Vec<AccountMeta> {
19769            vec![
19770                AccountMeta {
19771                    pubkey: self.admin,
19772                    is_signer: true,
19773                    is_writable: true,
19774                },
19775                AccountMeta {
19776                    pubkey: self.protocol_if_shares_transfer_config,
19777                    is_signer: false,
19778                    is_writable: true,
19779                },
19780                AccountMeta {
19781                    pubkey: self.state,
19782                    is_signer: false,
19783                    is_writable: false,
19784                },
19785            ]
19786        }
19787    }
19788    #[automatically_derived]
19789    impl anchor_lang::AccountSerialize for UpdateProtocolIfSharesTransferConfig {
19790        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
19791            if writer.write_all(Self::DISCRIMINATOR).is_err() {
19792                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
19793            }
19794            if AnchorSerialize::serialize(self, writer).is_err() {
19795                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
19796            }
19797            Ok(())
19798        }
19799    }
19800    #[automatically_derived]
19801    impl anchor_lang::AccountDeserialize for UpdateProtocolIfSharesTransferConfig {
19802        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
19803            let given_disc = &buf[..8];
19804            if Self::DISCRIMINATOR != given_disc {
19805                return Err(anchor_lang::error!(
19806                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
19807                ));
19808            }
19809            Self::try_deserialize_unchecked(buf)
19810        }
19811        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
19812            let mut data: &[u8] = &buf[8..];
19813            AnchorDeserialize::deserialize(&mut data)
19814                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
19815        }
19816    }
19817    #[repr(C)]
19818    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
19819    pub struct InitializePrelaunchOracle {
19820        pub admin: Pubkey,
19821        pub prelaunch_oracle: Pubkey,
19822        pub state: Pubkey,
19823        pub rent: Pubkey,
19824        pub system_program: Pubkey,
19825    }
19826    #[automatically_derived]
19827    impl anchor_lang::Discriminator for InitializePrelaunchOracle {
19828        const DISCRIMINATOR: &[u8] = &[130, 152, 19, 253, 63, 72, 246, 220];
19829    }
19830    #[automatically_derived]
19831    unsafe impl anchor_lang::__private::bytemuck::Pod for InitializePrelaunchOracle {}
19832    #[automatically_derived]
19833    unsafe impl anchor_lang::__private::bytemuck::Zeroable for InitializePrelaunchOracle {}
19834    #[automatically_derived]
19835    impl anchor_lang::ZeroCopy for InitializePrelaunchOracle {}
19836    #[automatically_derived]
19837    impl anchor_lang::InstructionData for InitializePrelaunchOracle {}
19838    #[automatically_derived]
19839    impl ToAccountMetas for InitializePrelaunchOracle {
19840        fn to_account_metas(&self) -> Vec<AccountMeta> {
19841            vec![
19842                AccountMeta {
19843                    pubkey: self.admin,
19844                    is_signer: true,
19845                    is_writable: true,
19846                },
19847                AccountMeta {
19848                    pubkey: self.prelaunch_oracle,
19849                    is_signer: false,
19850                    is_writable: true,
19851                },
19852                AccountMeta {
19853                    pubkey: self.state,
19854                    is_signer: false,
19855                    is_writable: false,
19856                },
19857                AccountMeta {
19858                    pubkey: self.rent,
19859                    is_signer: false,
19860                    is_writable: false,
19861                },
19862                AccountMeta {
19863                    pubkey: self.system_program,
19864                    is_signer: false,
19865                    is_writable: false,
19866                },
19867            ]
19868        }
19869    }
19870    #[automatically_derived]
19871    impl anchor_lang::AccountSerialize for InitializePrelaunchOracle {
19872        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
19873            if writer.write_all(Self::DISCRIMINATOR).is_err() {
19874                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
19875            }
19876            if AnchorSerialize::serialize(self, writer).is_err() {
19877                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
19878            }
19879            Ok(())
19880        }
19881    }
19882    #[automatically_derived]
19883    impl anchor_lang::AccountDeserialize for InitializePrelaunchOracle {
19884        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
19885            let given_disc = &buf[..8];
19886            if Self::DISCRIMINATOR != given_disc {
19887                return Err(anchor_lang::error!(
19888                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
19889                ));
19890            }
19891            Self::try_deserialize_unchecked(buf)
19892        }
19893        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
19894            let mut data: &[u8] = &buf[8..];
19895            AnchorDeserialize::deserialize(&mut data)
19896                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
19897        }
19898    }
19899    #[repr(C)]
19900    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
19901    pub struct UpdatePrelaunchOracleParams {
19902        pub admin: Pubkey,
19903        pub prelaunch_oracle: Pubkey,
19904        pub perp_market: Pubkey,
19905        pub state: Pubkey,
19906    }
19907    #[automatically_derived]
19908    impl anchor_lang::Discriminator for UpdatePrelaunchOracleParams {
19909        const DISCRIMINATOR: &[u8] = &[197, 77, 11, 137, 115, 92, 181, 124];
19910    }
19911    #[automatically_derived]
19912    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdatePrelaunchOracleParams {}
19913    #[automatically_derived]
19914    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdatePrelaunchOracleParams {}
19915    #[automatically_derived]
19916    impl anchor_lang::ZeroCopy for UpdatePrelaunchOracleParams {}
19917    #[automatically_derived]
19918    impl anchor_lang::InstructionData for UpdatePrelaunchOracleParams {}
19919    #[automatically_derived]
19920    impl ToAccountMetas for UpdatePrelaunchOracleParams {
19921        fn to_account_metas(&self) -> Vec<AccountMeta> {
19922            vec![
19923                AccountMeta {
19924                    pubkey: self.admin,
19925                    is_signer: true,
19926                    is_writable: true,
19927                },
19928                AccountMeta {
19929                    pubkey: self.prelaunch_oracle,
19930                    is_signer: false,
19931                    is_writable: true,
19932                },
19933                AccountMeta {
19934                    pubkey: self.perp_market,
19935                    is_signer: false,
19936                    is_writable: true,
19937                },
19938                AccountMeta {
19939                    pubkey: self.state,
19940                    is_signer: false,
19941                    is_writable: false,
19942                },
19943            ]
19944        }
19945    }
19946    #[automatically_derived]
19947    impl anchor_lang::AccountSerialize for UpdatePrelaunchOracleParams {
19948        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
19949            if writer.write_all(Self::DISCRIMINATOR).is_err() {
19950                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
19951            }
19952            if AnchorSerialize::serialize(self, writer).is_err() {
19953                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
19954            }
19955            Ok(())
19956        }
19957    }
19958    #[automatically_derived]
19959    impl anchor_lang::AccountDeserialize for UpdatePrelaunchOracleParams {
19960        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
19961            let given_disc = &buf[..8];
19962            if Self::DISCRIMINATOR != given_disc {
19963                return Err(anchor_lang::error!(
19964                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
19965                ));
19966            }
19967            Self::try_deserialize_unchecked(buf)
19968        }
19969        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
19970            let mut data: &[u8] = &buf[8..];
19971            AnchorDeserialize::deserialize(&mut data)
19972                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
19973        }
19974    }
19975    #[repr(C)]
19976    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
19977    pub struct DeletePrelaunchOracle {
19978        pub admin: Pubkey,
19979        pub prelaunch_oracle: Pubkey,
19980        pub perp_market: Pubkey,
19981        pub state: Pubkey,
19982    }
19983    #[automatically_derived]
19984    impl anchor_lang::Discriminator for DeletePrelaunchOracle {
19985        const DISCRIMINATOR: &[u8] = &[124, 0, 150, 210, 115, 171, 215, 202];
19986    }
19987    #[automatically_derived]
19988    unsafe impl anchor_lang::__private::bytemuck::Pod for DeletePrelaunchOracle {}
19989    #[automatically_derived]
19990    unsafe impl anchor_lang::__private::bytemuck::Zeroable for DeletePrelaunchOracle {}
19991    #[automatically_derived]
19992    impl anchor_lang::ZeroCopy for DeletePrelaunchOracle {}
19993    #[automatically_derived]
19994    impl anchor_lang::InstructionData for DeletePrelaunchOracle {}
19995    #[automatically_derived]
19996    impl ToAccountMetas for DeletePrelaunchOracle {
19997        fn to_account_metas(&self) -> Vec<AccountMeta> {
19998            vec![
19999                AccountMeta {
20000                    pubkey: self.admin,
20001                    is_signer: true,
20002                    is_writable: true,
20003                },
20004                AccountMeta {
20005                    pubkey: self.prelaunch_oracle,
20006                    is_signer: false,
20007                    is_writable: true,
20008                },
20009                AccountMeta {
20010                    pubkey: self.perp_market,
20011                    is_signer: false,
20012                    is_writable: false,
20013                },
20014                AccountMeta {
20015                    pubkey: self.state,
20016                    is_signer: false,
20017                    is_writable: false,
20018                },
20019            ]
20020        }
20021    }
20022    #[automatically_derived]
20023    impl anchor_lang::AccountSerialize for DeletePrelaunchOracle {
20024        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
20025            if writer.write_all(Self::DISCRIMINATOR).is_err() {
20026                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
20027            }
20028            if AnchorSerialize::serialize(self, writer).is_err() {
20029                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
20030            }
20031            Ok(())
20032        }
20033    }
20034    #[automatically_derived]
20035    impl anchor_lang::AccountDeserialize for DeletePrelaunchOracle {
20036        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
20037            let given_disc = &buf[..8];
20038            if Self::DISCRIMINATOR != given_disc {
20039                return Err(anchor_lang::error!(
20040                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
20041                ));
20042            }
20043            Self::try_deserialize_unchecked(buf)
20044        }
20045        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
20046            let mut data: &[u8] = &buf[8..];
20047            AnchorDeserialize::deserialize(&mut data)
20048                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
20049        }
20050    }
20051    #[repr(C)]
20052    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
20053    pub struct InitializePythPullOracle {
20054        pub admin: Pubkey,
20055        pub pyth_solana_receiver: Pubkey,
20056        pub price_feed: Pubkey,
20057        pub system_program: Pubkey,
20058        pub state: Pubkey,
20059    }
20060    #[automatically_derived]
20061    impl anchor_lang::Discriminator for InitializePythPullOracle {
20062        const DISCRIMINATOR: &[u8] = &[11, 151, 145, 80, 21, 164, 2, 147];
20063    }
20064    #[automatically_derived]
20065    unsafe impl anchor_lang::__private::bytemuck::Pod for InitializePythPullOracle {}
20066    #[automatically_derived]
20067    unsafe impl anchor_lang::__private::bytemuck::Zeroable for InitializePythPullOracle {}
20068    #[automatically_derived]
20069    impl anchor_lang::ZeroCopy for InitializePythPullOracle {}
20070    #[automatically_derived]
20071    impl anchor_lang::InstructionData for InitializePythPullOracle {}
20072    #[automatically_derived]
20073    impl ToAccountMetas for InitializePythPullOracle {
20074        fn to_account_metas(&self) -> Vec<AccountMeta> {
20075            vec![
20076                AccountMeta {
20077                    pubkey: self.admin,
20078                    is_signer: true,
20079                    is_writable: true,
20080                },
20081                AccountMeta {
20082                    pubkey: self.pyth_solana_receiver,
20083                    is_signer: false,
20084                    is_writable: false,
20085                },
20086                AccountMeta {
20087                    pubkey: self.price_feed,
20088                    is_signer: false,
20089                    is_writable: true,
20090                },
20091                AccountMeta {
20092                    pubkey: self.system_program,
20093                    is_signer: false,
20094                    is_writable: false,
20095                },
20096                AccountMeta {
20097                    pubkey: self.state,
20098                    is_signer: false,
20099                    is_writable: false,
20100                },
20101            ]
20102        }
20103    }
20104    #[automatically_derived]
20105    impl anchor_lang::AccountSerialize for InitializePythPullOracle {
20106        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
20107            if writer.write_all(Self::DISCRIMINATOR).is_err() {
20108                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
20109            }
20110            if AnchorSerialize::serialize(self, writer).is_err() {
20111                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
20112            }
20113            Ok(())
20114        }
20115    }
20116    #[automatically_derived]
20117    impl anchor_lang::AccountDeserialize for InitializePythPullOracle {
20118        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
20119            let given_disc = &buf[..8];
20120            if Self::DISCRIMINATOR != given_disc {
20121                return Err(anchor_lang::error!(
20122                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
20123                ));
20124            }
20125            Self::try_deserialize_unchecked(buf)
20126        }
20127        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
20128            let mut data: &[u8] = &buf[8..];
20129            AnchorDeserialize::deserialize(&mut data)
20130                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
20131        }
20132    }
20133    #[repr(C)]
20134    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
20135    pub struct InitializePythLazerOracle {
20136        pub admin: Pubkey,
20137        pub lazer_oracle: Pubkey,
20138        pub state: Pubkey,
20139        pub rent: Pubkey,
20140        pub system_program: Pubkey,
20141    }
20142    #[automatically_derived]
20143    impl anchor_lang::Discriminator for InitializePythLazerOracle {
20144        const DISCRIMINATOR: &[u8] = &[89, 72, 144, 241, 94, 171, 28, 143];
20145    }
20146    #[automatically_derived]
20147    unsafe impl anchor_lang::__private::bytemuck::Pod for InitializePythLazerOracle {}
20148    #[automatically_derived]
20149    unsafe impl anchor_lang::__private::bytemuck::Zeroable for InitializePythLazerOracle {}
20150    #[automatically_derived]
20151    impl anchor_lang::ZeroCopy for InitializePythLazerOracle {}
20152    #[automatically_derived]
20153    impl anchor_lang::InstructionData for InitializePythLazerOracle {}
20154    #[automatically_derived]
20155    impl ToAccountMetas for InitializePythLazerOracle {
20156        fn to_account_metas(&self) -> Vec<AccountMeta> {
20157            vec![
20158                AccountMeta {
20159                    pubkey: self.admin,
20160                    is_signer: true,
20161                    is_writable: true,
20162                },
20163                AccountMeta {
20164                    pubkey: self.lazer_oracle,
20165                    is_signer: false,
20166                    is_writable: true,
20167                },
20168                AccountMeta {
20169                    pubkey: self.state,
20170                    is_signer: false,
20171                    is_writable: false,
20172                },
20173                AccountMeta {
20174                    pubkey: self.rent,
20175                    is_signer: false,
20176                    is_writable: false,
20177                },
20178                AccountMeta {
20179                    pubkey: self.system_program,
20180                    is_signer: false,
20181                    is_writable: false,
20182                },
20183            ]
20184        }
20185    }
20186    #[automatically_derived]
20187    impl anchor_lang::AccountSerialize for InitializePythLazerOracle {
20188        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
20189            if writer.write_all(Self::DISCRIMINATOR).is_err() {
20190                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
20191            }
20192            if AnchorSerialize::serialize(self, writer).is_err() {
20193                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
20194            }
20195            Ok(())
20196        }
20197    }
20198    #[automatically_derived]
20199    impl anchor_lang::AccountDeserialize for InitializePythLazerOracle {
20200        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
20201            let given_disc = &buf[..8];
20202            if Self::DISCRIMINATOR != given_disc {
20203                return Err(anchor_lang::error!(
20204                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
20205                ));
20206            }
20207            Self::try_deserialize_unchecked(buf)
20208        }
20209        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
20210            let mut data: &[u8] = &buf[8..];
20211            AnchorDeserialize::deserialize(&mut data)
20212                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
20213        }
20214    }
20215    #[repr(C)]
20216    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
20217    pub struct PostPythLazerOracleUpdate {
20218        pub keeper: Pubkey,
20219        pub pyth_lazer_storage: Pubkey,
20220        pub ix_sysvar: Pubkey,
20221    }
20222    #[automatically_derived]
20223    impl anchor_lang::Discriminator for PostPythLazerOracleUpdate {
20224        const DISCRIMINATOR: &[u8] = &[168, 250, 82, 74, 96, 140, 128, 207];
20225    }
20226    #[automatically_derived]
20227    unsafe impl anchor_lang::__private::bytemuck::Pod for PostPythLazerOracleUpdate {}
20228    #[automatically_derived]
20229    unsafe impl anchor_lang::__private::bytemuck::Zeroable for PostPythLazerOracleUpdate {}
20230    #[automatically_derived]
20231    impl anchor_lang::ZeroCopy for PostPythLazerOracleUpdate {}
20232    #[automatically_derived]
20233    impl anchor_lang::InstructionData for PostPythLazerOracleUpdate {}
20234    #[automatically_derived]
20235    impl ToAccountMetas for PostPythLazerOracleUpdate {
20236        fn to_account_metas(&self) -> Vec<AccountMeta> {
20237            vec![
20238                AccountMeta {
20239                    pubkey: self.keeper,
20240                    is_signer: true,
20241                    is_writable: true,
20242                },
20243                AccountMeta {
20244                    pubkey: self.pyth_lazer_storage,
20245                    is_signer: false,
20246                    is_writable: false,
20247                },
20248                AccountMeta {
20249                    pubkey: self.ix_sysvar,
20250                    is_signer: false,
20251                    is_writable: false,
20252                },
20253            ]
20254        }
20255    }
20256    #[automatically_derived]
20257    impl anchor_lang::AccountSerialize for PostPythLazerOracleUpdate {
20258        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
20259            if writer.write_all(Self::DISCRIMINATOR).is_err() {
20260                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
20261            }
20262            if AnchorSerialize::serialize(self, writer).is_err() {
20263                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
20264            }
20265            Ok(())
20266        }
20267    }
20268    #[automatically_derived]
20269    impl anchor_lang::AccountDeserialize for PostPythLazerOracleUpdate {
20270        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
20271            let given_disc = &buf[..8];
20272            if Self::DISCRIMINATOR != given_disc {
20273                return Err(anchor_lang::error!(
20274                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
20275                ));
20276            }
20277            Self::try_deserialize_unchecked(buf)
20278        }
20279        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
20280            let mut data: &[u8] = &buf[8..];
20281            AnchorDeserialize::deserialize(&mut data)
20282                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
20283        }
20284    }
20285    #[repr(C)]
20286    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
20287    pub struct InitializeHighLeverageModeConfig {
20288        pub admin: Pubkey,
20289        pub high_leverage_mode_config: Pubkey,
20290        pub state: Pubkey,
20291        pub rent: Pubkey,
20292        pub system_program: Pubkey,
20293    }
20294    #[automatically_derived]
20295    impl anchor_lang::Discriminator for InitializeHighLeverageModeConfig {
20296        const DISCRIMINATOR: &[u8] = &[125, 235, 77, 45, 130, 90, 134, 48];
20297    }
20298    #[automatically_derived]
20299    unsafe impl anchor_lang::__private::bytemuck::Pod for InitializeHighLeverageModeConfig {}
20300    #[automatically_derived]
20301    unsafe impl anchor_lang::__private::bytemuck::Zeroable for InitializeHighLeverageModeConfig {}
20302    #[automatically_derived]
20303    impl anchor_lang::ZeroCopy for InitializeHighLeverageModeConfig {}
20304    #[automatically_derived]
20305    impl anchor_lang::InstructionData for InitializeHighLeverageModeConfig {}
20306    #[automatically_derived]
20307    impl ToAccountMetas for InitializeHighLeverageModeConfig {
20308        fn to_account_metas(&self) -> Vec<AccountMeta> {
20309            vec![
20310                AccountMeta {
20311                    pubkey: self.admin,
20312                    is_signer: true,
20313                    is_writable: true,
20314                },
20315                AccountMeta {
20316                    pubkey: self.high_leverage_mode_config,
20317                    is_signer: false,
20318                    is_writable: true,
20319                },
20320                AccountMeta {
20321                    pubkey: self.state,
20322                    is_signer: false,
20323                    is_writable: false,
20324                },
20325                AccountMeta {
20326                    pubkey: self.rent,
20327                    is_signer: false,
20328                    is_writable: false,
20329                },
20330                AccountMeta {
20331                    pubkey: self.system_program,
20332                    is_signer: false,
20333                    is_writable: false,
20334                },
20335            ]
20336        }
20337    }
20338    #[automatically_derived]
20339    impl anchor_lang::AccountSerialize for InitializeHighLeverageModeConfig {
20340        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
20341            if writer.write_all(Self::DISCRIMINATOR).is_err() {
20342                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
20343            }
20344            if AnchorSerialize::serialize(self, writer).is_err() {
20345                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
20346            }
20347            Ok(())
20348        }
20349    }
20350    #[automatically_derived]
20351    impl anchor_lang::AccountDeserialize for InitializeHighLeverageModeConfig {
20352        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
20353            let given_disc = &buf[..8];
20354            if Self::DISCRIMINATOR != given_disc {
20355                return Err(anchor_lang::error!(
20356                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
20357                ));
20358            }
20359            Self::try_deserialize_unchecked(buf)
20360        }
20361        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
20362            let mut data: &[u8] = &buf[8..];
20363            AnchorDeserialize::deserialize(&mut data)
20364                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
20365        }
20366    }
20367    #[repr(C)]
20368    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
20369    pub struct UpdateHighLeverageModeConfig {
20370        pub admin: Pubkey,
20371        pub high_leverage_mode_config: Pubkey,
20372        pub state: Pubkey,
20373    }
20374    #[automatically_derived]
20375    impl anchor_lang::Discriminator for UpdateHighLeverageModeConfig {
20376        const DISCRIMINATOR: &[u8] = &[254, 192, 159, 254, 254, 74, 141, 70];
20377    }
20378    #[automatically_derived]
20379    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdateHighLeverageModeConfig {}
20380    #[automatically_derived]
20381    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdateHighLeverageModeConfig {}
20382    #[automatically_derived]
20383    impl anchor_lang::ZeroCopy for UpdateHighLeverageModeConfig {}
20384    #[automatically_derived]
20385    impl anchor_lang::InstructionData for UpdateHighLeverageModeConfig {}
20386    #[automatically_derived]
20387    impl ToAccountMetas for UpdateHighLeverageModeConfig {
20388        fn to_account_metas(&self) -> Vec<AccountMeta> {
20389            vec![
20390                AccountMeta {
20391                    pubkey: self.admin,
20392                    is_signer: true,
20393                    is_writable: true,
20394                },
20395                AccountMeta {
20396                    pubkey: self.high_leverage_mode_config,
20397                    is_signer: false,
20398                    is_writable: true,
20399                },
20400                AccountMeta {
20401                    pubkey: self.state,
20402                    is_signer: false,
20403                    is_writable: false,
20404                },
20405            ]
20406        }
20407    }
20408    #[automatically_derived]
20409    impl anchor_lang::AccountSerialize for UpdateHighLeverageModeConfig {
20410        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
20411            if writer.write_all(Self::DISCRIMINATOR).is_err() {
20412                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
20413            }
20414            if AnchorSerialize::serialize(self, writer).is_err() {
20415                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
20416            }
20417            Ok(())
20418        }
20419    }
20420    #[automatically_derived]
20421    impl anchor_lang::AccountDeserialize for UpdateHighLeverageModeConfig {
20422        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
20423            let given_disc = &buf[..8];
20424            if Self::DISCRIMINATOR != given_disc {
20425                return Err(anchor_lang::error!(
20426                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
20427                ));
20428            }
20429            Self::try_deserialize_unchecked(buf)
20430        }
20431        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
20432            let mut data: &[u8] = &buf[8..];
20433            AnchorDeserialize::deserialize(&mut data)
20434                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
20435        }
20436    }
20437    #[repr(C)]
20438    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
20439    pub struct InitializeProtectedMakerModeConfig {
20440        pub admin: Pubkey,
20441        pub protected_maker_mode_config: Pubkey,
20442        pub state: Pubkey,
20443        pub rent: Pubkey,
20444        pub system_program: Pubkey,
20445    }
20446    #[automatically_derived]
20447    impl anchor_lang::Discriminator for InitializeProtectedMakerModeConfig {
20448        const DISCRIMINATOR: &[u8] = &[71, 150, 108, 182, 19, 30, 72, 149];
20449    }
20450    #[automatically_derived]
20451    unsafe impl anchor_lang::__private::bytemuck::Pod for InitializeProtectedMakerModeConfig {}
20452    #[automatically_derived]
20453    unsafe impl anchor_lang::__private::bytemuck::Zeroable for InitializeProtectedMakerModeConfig {}
20454    #[automatically_derived]
20455    impl anchor_lang::ZeroCopy for InitializeProtectedMakerModeConfig {}
20456    #[automatically_derived]
20457    impl anchor_lang::InstructionData for InitializeProtectedMakerModeConfig {}
20458    #[automatically_derived]
20459    impl ToAccountMetas for InitializeProtectedMakerModeConfig {
20460        fn to_account_metas(&self) -> Vec<AccountMeta> {
20461            vec![
20462                AccountMeta {
20463                    pubkey: self.admin,
20464                    is_signer: true,
20465                    is_writable: true,
20466                },
20467                AccountMeta {
20468                    pubkey: self.protected_maker_mode_config,
20469                    is_signer: false,
20470                    is_writable: true,
20471                },
20472                AccountMeta {
20473                    pubkey: self.state,
20474                    is_signer: false,
20475                    is_writable: false,
20476                },
20477                AccountMeta {
20478                    pubkey: self.rent,
20479                    is_signer: false,
20480                    is_writable: false,
20481                },
20482                AccountMeta {
20483                    pubkey: self.system_program,
20484                    is_signer: false,
20485                    is_writable: false,
20486                },
20487            ]
20488        }
20489    }
20490    #[automatically_derived]
20491    impl anchor_lang::AccountSerialize for InitializeProtectedMakerModeConfig {
20492        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
20493            if writer.write_all(Self::DISCRIMINATOR).is_err() {
20494                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
20495            }
20496            if AnchorSerialize::serialize(self, writer).is_err() {
20497                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
20498            }
20499            Ok(())
20500        }
20501    }
20502    #[automatically_derived]
20503    impl anchor_lang::AccountDeserialize for InitializeProtectedMakerModeConfig {
20504        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
20505            let given_disc = &buf[..8];
20506            if Self::DISCRIMINATOR != given_disc {
20507                return Err(anchor_lang::error!(
20508                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
20509                ));
20510            }
20511            Self::try_deserialize_unchecked(buf)
20512        }
20513        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
20514            let mut data: &[u8] = &buf[8..];
20515            AnchorDeserialize::deserialize(&mut data)
20516                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
20517        }
20518    }
20519    #[repr(C)]
20520    #[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
20521    pub struct UpdateProtectedMakerModeConfig {
20522        pub admin: Pubkey,
20523        pub protected_maker_mode_config: Pubkey,
20524        pub state: Pubkey,
20525    }
20526    #[automatically_derived]
20527    impl anchor_lang::Discriminator for UpdateProtectedMakerModeConfig {
20528        const DISCRIMINATOR: &[u8] = &[189, 135, 186, 140, 137, 238, 182, 65];
20529    }
20530    #[automatically_derived]
20531    unsafe impl anchor_lang::__private::bytemuck::Pod for UpdateProtectedMakerModeConfig {}
20532    #[automatically_derived]
20533    unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdateProtectedMakerModeConfig {}
20534    #[automatically_derived]
20535    impl anchor_lang::ZeroCopy for UpdateProtectedMakerModeConfig {}
20536    #[automatically_derived]
20537    impl anchor_lang::InstructionData for UpdateProtectedMakerModeConfig {}
20538    #[automatically_derived]
20539    impl ToAccountMetas for UpdateProtectedMakerModeConfig {
20540        fn to_account_metas(&self) -> Vec<AccountMeta> {
20541            vec![
20542                AccountMeta {
20543                    pubkey: self.admin,
20544                    is_signer: true,
20545                    is_writable: true,
20546                },
20547                AccountMeta {
20548                    pubkey: self.protected_maker_mode_config,
20549                    is_signer: false,
20550                    is_writable: true,
20551                },
20552                AccountMeta {
20553                    pubkey: self.state,
20554                    is_signer: false,
20555                    is_writable: false,
20556                },
20557            ]
20558        }
20559    }
20560    #[automatically_derived]
20561    impl anchor_lang::AccountSerialize for UpdateProtectedMakerModeConfig {
20562        fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
20563            if writer.write_all(Self::DISCRIMINATOR).is_err() {
20564                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
20565            }
20566            if AnchorSerialize::serialize(self, writer).is_err() {
20567                return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
20568            }
20569            Ok(())
20570        }
20571    }
20572    #[automatically_derived]
20573    impl anchor_lang::AccountDeserialize for UpdateProtectedMakerModeConfig {
20574        fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
20575            let given_disc = &buf[..8];
20576            if Self::DISCRIMINATOR != given_disc {
20577                return Err(anchor_lang::error!(
20578                    anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
20579                ));
20580            }
20581            Self::try_deserialize_unchecked(buf)
20582        }
20583        fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
20584            let mut data: &[u8] = &buf[8..];
20585            AnchorDeserialize::deserialize(&mut data)
20586                .map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
20587        }
20588    }
20589}
20590pub mod errors {
20591    #![doc = r" IDL error types"]
20592    use super::{types::*, *};
20593    #[derive(PartialEq)]
20594    #[error_code]
20595    pub enum ErrorCode {
20596        #[msg("Invalid Spot Market Authority")]
20597        InvalidSpotMarketAuthority,
20598        #[msg("Clearing house not insurance fund authority")]
20599        InvalidInsuranceFundAuthority,
20600        #[msg("Insufficient deposit")]
20601        InsufficientDeposit,
20602        #[msg("Insufficient collateral")]
20603        InsufficientCollateral,
20604        #[msg("Sufficient collateral")]
20605        SufficientCollateral,
20606        #[msg("Max number of positions taken")]
20607        MaxNumberOfPositions,
20608        #[msg("Admin Controls Prices Disabled")]
20609        AdminControlsPricesDisabled,
20610        #[msg("Market Delisted")]
20611        MarketDelisted,
20612        #[msg("Market Index Already Initialized")]
20613        MarketIndexAlreadyInitialized,
20614        #[msg("User Account And User Positions Account Mismatch")]
20615        UserAccountAndUserPositionsAccountMismatch,
20616        #[msg("User Has No Position In Market")]
20617        UserHasNoPositionInMarket,
20618        #[msg("Invalid Initial Peg")]
20619        InvalidInitialPeg,
20620        #[msg("AMM repeg already configured with amt given")]
20621        InvalidRepegRedundant,
20622        #[msg("AMM repeg incorrect repeg direction")]
20623        InvalidRepegDirection,
20624        #[msg("AMM repeg out of bounds pnl")]
20625        InvalidRepegProfitability,
20626        #[msg("Slippage Outside Limit Price")]
20627        SlippageOutsideLimit,
20628        #[msg("Order Size Too Small")]
20629        OrderSizeTooSmall,
20630        #[msg("Price change too large when updating K")]
20631        InvalidUpdateK,
20632        #[msg("Admin tried to withdraw amount larger than fees collected")]
20633        AdminWithdrawTooLarge,
20634        #[msg("Math Error")]
20635        MathError,
20636        #[msg("Conversion to u128/u64 failed with an overflow or underflow")]
20637        BnConversionError,
20638        #[msg("Clock unavailable")]
20639        ClockUnavailable,
20640        #[msg("Unable To Load Oracles")]
20641        UnableToLoadOracle,
20642        #[msg("Price Bands Breached")]
20643        PriceBandsBreached,
20644        #[msg("Exchange is paused")]
20645        ExchangePaused,
20646        #[msg("Invalid whitelist token")]
20647        InvalidWhitelistToken,
20648        #[msg("Whitelist token not found")]
20649        WhitelistTokenNotFound,
20650        #[msg("Invalid discount token")]
20651        InvalidDiscountToken,
20652        #[msg("Discount token not found")]
20653        DiscountTokenNotFound,
20654        #[msg("Referrer not found")]
20655        ReferrerNotFound,
20656        #[msg("ReferrerNotFound")]
20657        ReferrerStatsNotFound,
20658        #[msg("ReferrerMustBeWritable")]
20659        ReferrerMustBeWritable,
20660        #[msg("ReferrerMustBeWritable")]
20661        ReferrerStatsMustBeWritable,
20662        #[msg("ReferrerAndReferrerStatsAuthorityUnequal")]
20663        ReferrerAndReferrerStatsAuthorityUnequal,
20664        #[msg("InvalidReferrer")]
20665        InvalidReferrer,
20666        #[msg("InvalidOracle")]
20667        InvalidOracle,
20668        #[msg("OracleNotFound")]
20669        OracleNotFound,
20670        #[msg("Liquidations Blocked By Oracle")]
20671        LiquidationsBlockedByOracle,
20672        #[msg("Can not deposit more than max deposit")]
20673        MaxDeposit,
20674        #[msg("Can not delete user that still has collateral")]
20675        CantDeleteUserWithCollateral,
20676        #[msg("AMM funding out of bounds pnl")]
20677        InvalidFundingProfitability,
20678        #[msg("Casting Failure")]
20679        CastingFailure,
20680        #[msg("InvalidOrder")]
20681        InvalidOrder,
20682        #[msg("InvalidOrderMaxTs")]
20683        InvalidOrderMaxTs,
20684        #[msg("InvalidOrderMarketType")]
20685        InvalidOrderMarketType,
20686        #[msg("InvalidOrderForInitialMarginReq")]
20687        InvalidOrderForInitialMarginReq,
20688        #[msg("InvalidOrderNotRiskReducing")]
20689        InvalidOrderNotRiskReducing,
20690        #[msg("InvalidOrderSizeTooSmall")]
20691        InvalidOrderSizeTooSmall,
20692        #[msg("InvalidOrderNotStepSizeMultiple")]
20693        InvalidOrderNotStepSizeMultiple,
20694        #[msg("InvalidOrderBaseQuoteAsset")]
20695        InvalidOrderBaseQuoteAsset,
20696        #[msg("InvalidOrderIOC")]
20697        InvalidOrderIOC,
20698        #[msg("InvalidOrderPostOnly")]
20699        InvalidOrderPostOnly,
20700        #[msg("InvalidOrderIOCPostOnly")]
20701        InvalidOrderIOCPostOnly,
20702        #[msg("InvalidOrderTrigger")]
20703        InvalidOrderTrigger,
20704        #[msg("InvalidOrderAuction")]
20705        InvalidOrderAuction,
20706        #[msg("InvalidOrderOracleOffset")]
20707        InvalidOrderOracleOffset,
20708        #[msg("InvalidOrderMinOrderSize")]
20709        InvalidOrderMinOrderSize,
20710        #[msg("Failed to Place Post-Only Limit Order")]
20711        PlacePostOnlyLimitFailure,
20712        #[msg("User has no order")]
20713        UserHasNoOrder,
20714        #[msg("Order Amount Too Small")]
20715        OrderAmountTooSmall,
20716        #[msg("Max number of orders taken")]
20717        MaxNumberOfOrders,
20718        #[msg("Order does not exist")]
20719        OrderDoesNotExist,
20720        #[msg("Order not open")]
20721        OrderNotOpen,
20722        #[msg("FillOrderDidNotUpdateState")]
20723        FillOrderDidNotUpdateState,
20724        #[msg("Reduce only order increased risk")]
20725        ReduceOnlyOrderIncreasedRisk,
20726        #[msg("Unable to load AccountLoader")]
20727        UnableToLoadAccountLoader,
20728        #[msg("Trade Size Too Large")]
20729        TradeSizeTooLarge,
20730        #[msg("User cant refer themselves")]
20731        UserCantReferThemselves,
20732        #[msg("Did not receive expected referrer")]
20733        DidNotReceiveExpectedReferrer,
20734        #[msg("Could not deserialize referrer")]
20735        CouldNotDeserializeReferrer,
20736        #[msg("Could not deserialize referrer stats")]
20737        CouldNotDeserializeReferrerStats,
20738        #[msg("User Order Id Already In Use")]
20739        UserOrderIdAlreadyInUse,
20740        #[msg("No positions liquidatable")]
20741        NoPositionsLiquidatable,
20742        #[msg("Invalid Margin Ratio")]
20743        InvalidMarginRatio,
20744        #[msg("Cant Cancel Post Only Order")]
20745        CantCancelPostOnlyOrder,
20746        #[msg("InvalidOracleOffset")]
20747        InvalidOracleOffset,
20748        #[msg("CantExpireOrders")]
20749        CantExpireOrders,
20750        #[msg("CouldNotLoadMarketData")]
20751        CouldNotLoadMarketData,
20752        #[msg("PerpMarketNotFound")]
20753        PerpMarketNotFound,
20754        #[msg("InvalidMarketAccount")]
20755        InvalidMarketAccount,
20756        #[msg("UnableToLoadMarketAccount")]
20757        UnableToLoadPerpMarketAccount,
20758        #[msg("MarketWrongMutability")]
20759        MarketWrongMutability,
20760        #[msg("UnableToCastUnixTime")]
20761        UnableToCastUnixTime,
20762        #[msg("CouldNotFindSpotPosition")]
20763        CouldNotFindSpotPosition,
20764        #[msg("NoSpotPositionAvailable")]
20765        NoSpotPositionAvailable,
20766        #[msg("InvalidSpotMarketInitialization")]
20767        InvalidSpotMarketInitialization,
20768        #[msg("CouldNotLoadSpotMarketData")]
20769        CouldNotLoadSpotMarketData,
20770        #[msg("SpotMarketNotFound")]
20771        SpotMarketNotFound,
20772        #[msg("InvalidSpotMarketAccount")]
20773        InvalidSpotMarketAccount,
20774        #[msg("UnableToLoadSpotMarketAccount")]
20775        UnableToLoadSpotMarketAccount,
20776        #[msg("SpotMarketWrongMutability")]
20777        SpotMarketWrongMutability,
20778        #[msg("SpotInterestNotUpToDate")]
20779        SpotMarketInterestNotUpToDate,
20780        #[msg("SpotMarketInsufficientDeposits")]
20781        SpotMarketInsufficientDeposits,
20782        #[msg("UserMustSettleTheirOwnPositiveUnsettledPNL")]
20783        UserMustSettleTheirOwnPositiveUnsettledPNL,
20784        #[msg("CantUpdatePoolBalanceType")]
20785        CantUpdatePoolBalanceType,
20786        #[msg("InsufficientCollateralForSettlingPNL")]
20787        InsufficientCollateralForSettlingPNL,
20788        #[msg("AMMNotUpdatedInSameSlot")]
20789        AMMNotUpdatedInSameSlot,
20790        #[msg("AuctionNotComplete")]
20791        AuctionNotComplete,
20792        #[msg("MakerNotFound")]
20793        MakerNotFound,
20794        #[msg("MakerNotFound")]
20795        MakerStatsNotFound,
20796        #[msg("MakerMustBeWritable")]
20797        MakerMustBeWritable,
20798        #[msg("MakerMustBeWritable")]
20799        MakerStatsMustBeWritable,
20800        #[msg("MakerOrderNotFound")]
20801        MakerOrderNotFound,
20802        #[msg("CouldNotDeserializeMaker")]
20803        CouldNotDeserializeMaker,
20804        #[msg("CouldNotDeserializeMaker")]
20805        CouldNotDeserializeMakerStats,
20806        #[msg("AuctionPriceDoesNotSatisfyMaker")]
20807        AuctionPriceDoesNotSatisfyMaker,
20808        #[msg("MakerCantFulfillOwnOrder")]
20809        MakerCantFulfillOwnOrder,
20810        #[msg("MakerOrderMustBePostOnly")]
20811        MakerOrderMustBePostOnly,
20812        #[msg("CantMatchTwoPostOnlys")]
20813        CantMatchTwoPostOnlys,
20814        #[msg("OrderBreachesOraclePriceLimits")]
20815        OrderBreachesOraclePriceLimits,
20816        #[msg("OrderMustBeTriggeredFirst")]
20817        OrderMustBeTriggeredFirst,
20818        #[msg("OrderNotTriggerable")]
20819        OrderNotTriggerable,
20820        #[msg("OrderDidNotSatisfyTriggerCondition")]
20821        OrderDidNotSatisfyTriggerCondition,
20822        #[msg("PositionAlreadyBeingLiquidated")]
20823        PositionAlreadyBeingLiquidated,
20824        #[msg("PositionDoesntHaveOpenPositionOrOrders")]
20825        PositionDoesntHaveOpenPositionOrOrders,
20826        #[msg("AllOrdersAreAlreadyLiquidations")]
20827        AllOrdersAreAlreadyLiquidations,
20828        #[msg("CantCancelLiquidationOrder")]
20829        CantCancelLiquidationOrder,
20830        #[msg("UserIsBeingLiquidated")]
20831        UserIsBeingLiquidated,
20832        #[msg("LiquidationsOngoing")]
20833        LiquidationsOngoing,
20834        #[msg("WrongSpotBalanceType")]
20835        WrongSpotBalanceType,
20836        #[msg("UserCantLiquidateThemself")]
20837        UserCantLiquidateThemself,
20838        #[msg("InvalidPerpPositionToLiquidate")]
20839        InvalidPerpPositionToLiquidate,
20840        #[msg("InvalidBaseAssetAmountForLiquidatePerp")]
20841        InvalidBaseAssetAmountForLiquidatePerp,
20842        #[msg("InvalidPositionLastFundingRate")]
20843        InvalidPositionLastFundingRate,
20844        #[msg("InvalidPositionDelta")]
20845        InvalidPositionDelta,
20846        #[msg("UserBankrupt")]
20847        UserBankrupt,
20848        #[msg("UserNotBankrupt")]
20849        UserNotBankrupt,
20850        #[msg("UserHasInvalidBorrow")]
20851        UserHasInvalidBorrow,
20852        #[msg("DailyWithdrawLimit")]
20853        DailyWithdrawLimit,
20854        #[msg("DefaultError")]
20855        DefaultError,
20856        #[msg("Insufficient LP tokens")]
20857        InsufficientLPTokens,
20858        #[msg("Cant LP with a market position")]
20859        CantLPWithPerpPosition,
20860        #[msg("Unable to burn LP tokens")]
20861        UnableToBurnLPTokens,
20862        #[msg("Trying to remove liqudity too fast after adding it")]
20863        TryingToRemoveLiquidityTooFast,
20864        #[msg("Invalid Spot Market Vault")]
20865        InvalidSpotMarketVault,
20866        #[msg("Invalid Spot Market State")]
20867        InvalidSpotMarketState,
20868        #[msg("InvalidSerumProgram")]
20869        InvalidSerumProgram,
20870        #[msg("InvalidSerumMarket")]
20871        InvalidSerumMarket,
20872        #[msg("InvalidSerumBids")]
20873        InvalidSerumBids,
20874        #[msg("InvalidSerumAsks")]
20875        InvalidSerumAsks,
20876        #[msg("InvalidSerumOpenOrders")]
20877        InvalidSerumOpenOrders,
20878        #[msg("FailedSerumCPI")]
20879        FailedSerumCPI,
20880        #[msg("FailedToFillOnExternalMarket")]
20881        FailedToFillOnExternalMarket,
20882        #[msg("InvalidFulfillmentConfig")]
20883        InvalidFulfillmentConfig,
20884        #[msg("InvalidFeeStructure")]
20885        InvalidFeeStructure,
20886        #[msg("Insufficient IF shares")]
20887        InsufficientIFShares,
20888        #[msg("the Market has paused this action")]
20889        MarketActionPaused,
20890        #[msg("the Market status doesnt allow placing orders")]
20891        MarketPlaceOrderPaused,
20892        #[msg("the Market status doesnt allow filling orders")]
20893        MarketFillOrderPaused,
20894        #[msg("the Market status doesnt allow withdraws")]
20895        MarketWithdrawPaused,
20896        #[msg("Action violates the Protected Asset Tier rules")]
20897        ProtectedAssetTierViolation,
20898        #[msg("Action violates the Isolated Asset Tier rules")]
20899        IsolatedAssetTierViolation,
20900        #[msg("User Cant Be Deleted")]
20901        UserCantBeDeleted,
20902        #[msg("Reduce Only Withdraw Increased Risk")]
20903        ReduceOnlyWithdrawIncreasedRisk,
20904        #[msg("Max Open Interest")]
20905        MaxOpenInterest,
20906        #[msg("Cant Resolve Perp Bankruptcy")]
20907        CantResolvePerpBankruptcy,
20908        #[msg("Liquidation Doesnt Satisfy Limit Price")]
20909        LiquidationDoesntSatisfyLimitPrice,
20910        #[msg("Margin Trading Disabled")]
20911        MarginTradingDisabled,
20912        #[msg("Invalid Market Status to Settle Perp Pnl")]
20913        InvalidMarketStatusToSettlePnl,
20914        #[msg("PerpMarketNotInSettlement")]
20915        PerpMarketNotInSettlement,
20916        #[msg("PerpMarketNotInReduceOnly")]
20917        PerpMarketNotInReduceOnly,
20918        #[msg("PerpMarketSettlementBufferNotReached")]
20919        PerpMarketSettlementBufferNotReached,
20920        #[msg("PerpMarketSettlementUserHasOpenOrders")]
20921        PerpMarketSettlementUserHasOpenOrders,
20922        #[msg("PerpMarketSettlementUserHasActiveLP")]
20923        PerpMarketSettlementUserHasActiveLP,
20924        #[msg("UnableToSettleExpiredUserPosition")]
20925        UnableToSettleExpiredUserPosition,
20926        #[msg("UnequalMarketIndexForSpotTransfer")]
20927        UnequalMarketIndexForSpotTransfer,
20928        #[msg("InvalidPerpPositionDetected")]
20929        InvalidPerpPositionDetected,
20930        #[msg("InvalidSpotPositionDetected")]
20931        InvalidSpotPositionDetected,
20932        #[msg("InvalidAmmDetected")]
20933        InvalidAmmDetected,
20934        #[msg("InvalidAmmForFillDetected")]
20935        InvalidAmmForFillDetected,
20936        #[msg("InvalidAmmLimitPriceOverride")]
20937        InvalidAmmLimitPriceOverride,
20938        #[msg("InvalidOrderFillPrice")]
20939        InvalidOrderFillPrice,
20940        #[msg("SpotMarketBalanceInvariantViolated")]
20941        SpotMarketBalanceInvariantViolated,
20942        #[msg("SpotMarketVaultInvariantViolated")]
20943        SpotMarketVaultInvariantViolated,
20944        #[msg("InvalidPDA")]
20945        InvalidPDA,
20946        #[msg("InvalidPDASigner")]
20947        InvalidPDASigner,
20948        #[msg("RevenueSettingsCannotSettleToIF")]
20949        RevenueSettingsCannotSettleToIF,
20950        #[msg("NoRevenueToSettleToIF")]
20951        NoRevenueToSettleToIF,
20952        #[msg("NoAmmPerpPnlDeficit")]
20953        NoAmmPerpPnlDeficit,
20954        #[msg("SufficientPerpPnlPool")]
20955        SufficientPerpPnlPool,
20956        #[msg("InsufficientPerpPnlPool")]
20957        InsufficientPerpPnlPool,
20958        #[msg("PerpPnlDeficitBelowThreshold")]
20959        PerpPnlDeficitBelowThreshold,
20960        #[msg("MaxRevenueWithdrawPerPeriodReached")]
20961        MaxRevenueWithdrawPerPeriodReached,
20962        #[msg("InvalidSpotPositionDetected")]
20963        MaxIFWithdrawReached,
20964        #[msg("NoIFWithdrawAvailable")]
20965        NoIFWithdrawAvailable,
20966        #[msg("InvalidIFUnstake")]
20967        InvalidIFUnstake,
20968        #[msg("InvalidIFUnstakeSize")]
20969        InvalidIFUnstakeSize,
20970        #[msg("InvalidIFUnstakeCancel")]
20971        InvalidIFUnstakeCancel,
20972        #[msg("InvalidIFForNewStakes")]
20973        InvalidIFForNewStakes,
20974        #[msg("InvalidIFRebase")]
20975        InvalidIFRebase,
20976        #[msg("InvalidInsuranceUnstakeSize")]
20977        InvalidInsuranceUnstakeSize,
20978        #[msg("InvalidOrderLimitPrice")]
20979        InvalidOrderLimitPrice,
20980        #[msg("InvalidIFDetected")]
20981        InvalidIFDetected,
20982        #[msg("InvalidAmmMaxSpreadDetected")]
20983        InvalidAmmMaxSpreadDetected,
20984        #[msg("InvalidConcentrationCoef")]
20985        InvalidConcentrationCoef,
20986        #[msg("InvalidSrmVault")]
20987        InvalidSrmVault,
20988        #[msg("InvalidVaultOwner")]
20989        InvalidVaultOwner,
20990        #[msg("InvalidMarketStatusForFills")]
20991        InvalidMarketStatusForFills,
20992        #[msg("IFWithdrawRequestInProgress")]
20993        IFWithdrawRequestInProgress,
20994        #[msg("NoIFWithdrawRequestInProgress")]
20995        NoIFWithdrawRequestInProgress,
20996        #[msg("IFWithdrawRequestTooSmall")]
20997        IFWithdrawRequestTooSmall,
20998        #[msg("IncorrectSpotMarketAccountPassed")]
20999        IncorrectSpotMarketAccountPassed,
21000        #[msg("BlockchainClockInconsistency")]
21001        BlockchainClockInconsistency,
21002        #[msg("InvalidIFSharesDetected")]
21003        InvalidIFSharesDetected,
21004        #[msg("NewLPSizeTooSmall")]
21005        NewLPSizeTooSmall,
21006        #[msg("MarketStatusInvalidForNewLP")]
21007        MarketStatusInvalidForNewLP,
21008        #[msg("InvalidMarkTwapUpdateDetected")]
21009        InvalidMarkTwapUpdateDetected,
21010        #[msg("MarketSettlementAttemptOnActiveMarket")]
21011        MarketSettlementAttemptOnActiveMarket,
21012        #[msg("MarketSettlementRequiresSettledLP")]
21013        MarketSettlementRequiresSettledLP,
21014        #[msg("MarketSettlementAttemptTooEarly")]
21015        MarketSettlementAttemptTooEarly,
21016        #[msg("MarketSettlementTargetPriceInvalid")]
21017        MarketSettlementTargetPriceInvalid,
21018        #[msg("UnsupportedSpotMarket")]
21019        UnsupportedSpotMarket,
21020        #[msg("SpotOrdersDisabled")]
21021        SpotOrdersDisabled,
21022        #[msg("Market Being Initialized")]
21023        MarketBeingInitialized,
21024        #[msg("Invalid Sub Account Id")]
21025        InvalidUserSubAccountId,
21026        #[msg("Invalid Trigger Order Condition")]
21027        InvalidTriggerOrderCondition,
21028        #[msg("Invalid Spot Position")]
21029        InvalidSpotPosition,
21030        #[msg("Cant transfer between same user account")]
21031        CantTransferBetweenSameUserAccount,
21032        #[msg("Invalid Perp Position")]
21033        InvalidPerpPosition,
21034        #[msg("Unable To Get Limit Price")]
21035        UnableToGetLimitPrice,
21036        #[msg("Invalid Liquidation")]
21037        InvalidLiquidation,
21038        #[msg("Spot Fulfillment Config Disabled")]
21039        SpotFulfillmentConfigDisabled,
21040        #[msg("Invalid Maker")]
21041        InvalidMaker,
21042        #[msg("Failed Unwrap")]
21043        FailedUnwrap,
21044        #[msg("Max Number Of Users")]
21045        MaxNumberOfUsers,
21046        #[msg("InvalidOracleForSettlePnl")]
21047        InvalidOracleForSettlePnl,
21048        #[msg("MarginOrdersOpen")]
21049        MarginOrdersOpen,
21050        #[msg("TierViolationLiquidatingPerpPnl")]
21051        TierViolationLiquidatingPerpPnl,
21052        #[msg("CouldNotLoadUserData")]
21053        CouldNotLoadUserData,
21054        #[msg("UserWrongMutability")]
21055        UserWrongMutability,
21056        #[msg("InvalidUserAccount")]
21057        InvalidUserAccount,
21058        #[msg("CouldNotLoadUserData")]
21059        CouldNotLoadUserStatsData,
21060        #[msg("UserWrongMutability")]
21061        UserStatsWrongMutability,
21062        #[msg("InvalidUserAccount")]
21063        InvalidUserStatsAccount,
21064        #[msg("UserNotFound")]
21065        UserNotFound,
21066        #[msg("UnableToLoadUserAccount")]
21067        UnableToLoadUserAccount,
21068        #[msg("UserStatsNotFound")]
21069        UserStatsNotFound,
21070        #[msg("UnableToLoadUserStatsAccount")]
21071        UnableToLoadUserStatsAccount,
21072        #[msg("User Not Inactive")]
21073        UserNotInactive,
21074        #[msg("RevertFill")]
21075        RevertFill,
21076        #[msg("Invalid MarketAccount for Deletion")]
21077        InvalidMarketAccountforDeletion,
21078        #[msg("Invalid Spot Fulfillment Params")]
21079        InvalidSpotFulfillmentParams,
21080        #[msg("Failed to Get Mint")]
21081        FailedToGetMint,
21082        #[msg("FailedPhoenixCPI")]
21083        FailedPhoenixCPI,
21084        #[msg("FailedToDeserializePhoenixMarket")]
21085        FailedToDeserializePhoenixMarket,
21086        #[msg("InvalidPricePrecision")]
21087        InvalidPricePrecision,
21088        #[msg("InvalidPhoenixProgram")]
21089        InvalidPhoenixProgram,
21090        #[msg("InvalidPhoenixMarket")]
21091        InvalidPhoenixMarket,
21092        #[msg("InvalidSwap")]
21093        InvalidSwap,
21094        #[msg("SwapLimitPriceBreached")]
21095        SwapLimitPriceBreached,
21096        #[msg("SpotMarketReduceOnly")]
21097        SpotMarketReduceOnly,
21098        #[msg("FundingWasNotUpdated")]
21099        FundingWasNotUpdated,
21100        #[msg("ImpossibleFill")]
21101        ImpossibleFill,
21102        #[msg("CantUpdatePerpBidAskTwap")]
21103        CantUpdatePerpBidAskTwap,
21104        #[msg("UserReduceOnly")]
21105        UserReduceOnly,
21106        #[msg("InvalidMarginCalculation")]
21107        InvalidMarginCalculation,
21108        #[msg("CantPayUserInitFee")]
21109        CantPayUserInitFee,
21110        #[msg("CantReclaimRent")]
21111        CantReclaimRent,
21112        #[msg("InsuranceFundOperationPaused")]
21113        InsuranceFundOperationPaused,
21114        #[msg("NoUnsettledPnl")]
21115        NoUnsettledPnl,
21116        #[msg("PnlPoolCantSettleUser")]
21117        PnlPoolCantSettleUser,
21118        #[msg("OracleInvalid")]
21119        OracleNonPositive,
21120        #[msg("OracleTooVolatile")]
21121        OracleTooVolatile,
21122        #[msg("OracleTooUncertain")]
21123        OracleTooUncertain,
21124        #[msg("OracleStaleForMargin")]
21125        OracleStaleForMargin,
21126        #[msg("OracleInsufficientDataPoints")]
21127        OracleInsufficientDataPoints,
21128        #[msg("OracleStaleForAMM")]
21129        OracleStaleForAMM,
21130        #[msg("Unable to parse pull oracle message")]
21131        UnableToParsePullOracleMessage,
21132        #[msg("Can not borow more than max borrows")]
21133        MaxBorrows,
21134        #[msg("Updates must be monotonically increasing")]
21135        OracleUpdatesNotMonotonic,
21136        #[msg("Trying to update price feed with the wrong feed id")]
21137        OraclePriceFeedMessageMismatch,
21138        #[msg("The message in the update must be a PriceFeedMessage")]
21139        OracleUnsupportedMessageType,
21140        #[msg("Could not deserialize the message in the update")]
21141        OracleDeserializeMessageFailed,
21142        #[msg("Wrong guardian set owner in update price atomic")]
21143        OracleWrongGuardianSetOwner,
21144        #[msg("Oracle post update atomic price feed account must be drift program")]
21145        OracleWrongWriteAuthority,
21146        #[msg("Oracle vaa owner must be wormhole program")]
21147        OracleWrongVaaOwner,
21148        #[msg("Multi updates must have 2 or fewer accounts passed in remaining accounts")]
21149        OracleTooManyPriceAccountUpdates,
21150        #[msg("Don't have the same remaining accounts number and pyth updates left")]
21151        OracleMismatchedVaaAndPriceUpdates,
21152        #[msg("Remaining account passed does not match oracle update derived pda")]
21153        OracleBadRemainingAccountPublicKey,
21154        #[msg("FailedOpenbookV2CPI")]
21155        FailedOpenbookV2CPI,
21156        #[msg("InvalidOpenbookV2Program")]
21157        InvalidOpenbookV2Program,
21158        #[msg("InvalidOpenbookV2Market")]
21159        InvalidOpenbookV2Market,
21160        #[msg("Non zero transfer fee")]
21161        NonZeroTransferFee,
21162        #[msg("Liquidation order failed to fill")]
21163        LiquidationOrderFailedToFill,
21164        #[msg("Invalid prediction market order")]
21165        InvalidPredictionMarketOrder,
21166        #[msg("Ed25519 Ix must be before place and make SignedMsg order ix")]
21167        InvalidVerificationIxIndex,
21168        #[msg("SignedMsg message verificaiton failed")]
21169        SigVerificationFailed,
21170        #[msg("Market index mismatched b/w taker and maker SignedMsg order params")]
21171        MismatchedSignedMsgOrderParamsMarketIndex,
21172        #[msg("Invalid SignedMsg order param")]
21173        InvalidSignedMsgOrderParam,
21174        #[msg("Place and take order success condition failed")]
21175        PlaceAndTakeOrderSuccessConditionFailed,
21176        #[msg("Invalid High Leverage Mode Config")]
21177        InvalidHighLeverageModeConfig,
21178        #[msg("Invalid RFQ User Account")]
21179        InvalidRFQUserAccount,
21180        #[msg("RFQUserAccount should be mutable")]
21181        RFQUserAccountWrongMutability,
21182        #[msg("RFQUserAccount has too many active RFQs")]
21183        RFQUserAccountFull,
21184        #[msg("RFQ order not filled as expected")]
21185        RFQOrderNotFilled,
21186        #[msg("RFQ orders must be jit makers")]
21187        InvalidRFQOrder,
21188        #[msg("RFQ matches must be valid")]
21189        InvalidRFQMatch,
21190        #[msg("Invalid SignedMsg user account")]
21191        InvalidSignedMsgUserAccount,
21192        #[msg("SignedMsg account wrong mutability")]
21193        SignedMsgUserAccountWrongMutability,
21194        #[msg("SignedMsgUserAccount has too many active orders")]
21195        SignedMsgUserOrdersAccountFull,
21196        #[msg("Order with SignedMsg uuid does not exist")]
21197        SignedMsgOrderDoesNotExist,
21198        #[msg("SignedMsg order id cannot be 0s")]
21199        InvalidSignedMsgOrderId,
21200        #[msg("Invalid pool id")]
21201        InvalidPoolId,
21202        #[msg("Invalid Protected Maker Mode Config")]
21203        InvalidProtectedMakerModeConfig,
21204        #[msg("Invalid pyth lazer storage owner")]
21205        InvalidPythLazerStorageOwner,
21206        #[msg("Verification of pyth lazer message failed")]
21207        UnverifiedPythLazerMessage,
21208        #[msg("Invalid pyth lazer message")]
21209        InvalidPythLazerMessage,
21210        #[msg("Pyth lazer message does not correspond to correct fed id")]
21211        PythLazerMessagePriceFeedMismatch,
21212        #[msg("InvalidLiquidateSpotWithSwap")]
21213        InvalidLiquidateSpotWithSwap,
21214        #[msg("User in SignedMsg message does not match user in ix context")]
21215        SignedMsgUserContextUserMismatch,
21216        #[msg("User fuel overflow threshold not met")]
21217        UserFuelOverflowThresholdNotMet,
21218        #[msg("FuelOverflow account not found")]
21219        FuelOverflowAccountNotFound,
21220        #[msg("Invalid Transfer Perp Position")]
21221        InvalidTransferPerpPosition,
21222        #[msg("Invalid SignedMsgUserOrders resize")]
21223        InvalidSignedMsgUserOrdersResize,
21224    }
21225}
21226pub mod events {
21227    #![doc = r" IDL event types"]
21228    use super::{types::*, *};
21229    #[event]
21230    pub struct NewUserRecord {
21231        pub ts: i64,
21232        pub user_authority: Pubkey,
21233        pub user: Pubkey,
21234        pub sub_account_id: u16,
21235        pub name: [u8; 32],
21236        pub referrer: Pubkey,
21237    }
21238    #[event]
21239    pub struct DepositRecord {
21240        pub ts: i64,
21241        pub user_authority: Pubkey,
21242        pub user: Pubkey,
21243        pub direction: DepositDirection,
21244        pub deposit_record_id: u64,
21245        pub amount: u64,
21246        pub market_index: u16,
21247        pub oracle_price: i64,
21248        pub market_deposit_balance: u128,
21249        pub market_withdraw_balance: u128,
21250        pub market_cumulative_deposit_interest: u128,
21251        pub market_cumulative_borrow_interest: u128,
21252        pub total_deposits_after: u64,
21253        pub total_withdraws_after: u64,
21254        pub explanation: DepositExplanation,
21255        pub transfer_user: Option<Pubkey>,
21256    }
21257    #[event]
21258    pub struct SpotInterestRecord {
21259        pub ts: i64,
21260        pub market_index: u16,
21261        pub deposit_balance: u128,
21262        pub cumulative_deposit_interest: u128,
21263        pub borrow_balance: u128,
21264        pub cumulative_borrow_interest: u128,
21265        pub optimal_utilization: u32,
21266        pub optimal_borrow_rate: u32,
21267        pub max_borrow_rate: u32,
21268    }
21269    #[event]
21270    pub struct FundingPaymentRecord {
21271        pub ts: i64,
21272        pub user_authority: Pubkey,
21273        pub user: Pubkey,
21274        pub market_index: u16,
21275        pub funding_payment: i64,
21276        pub base_asset_amount: i64,
21277        pub user_last_cumulative_funding: i64,
21278        pub amm_cumulative_funding_long: i128,
21279        pub amm_cumulative_funding_short: i128,
21280    }
21281    #[event]
21282    pub struct FundingRateRecord {
21283        pub ts: i64,
21284        pub record_id: u64,
21285        pub market_index: u16,
21286        pub funding_rate: i64,
21287        pub funding_rate_long: i128,
21288        pub funding_rate_short: i128,
21289        pub cumulative_funding_rate_long: i128,
21290        pub cumulative_funding_rate_short: i128,
21291        pub oracle_price_twap: i64,
21292        pub mark_price_twap: u64,
21293        pub period_revenue: i64,
21294        pub base_asset_amount_with_amm: i128,
21295        pub base_asset_amount_with_unsettled_lp: i128,
21296    }
21297    #[event]
21298    pub struct CurveRecord {
21299        pub ts: i64,
21300        pub record_id: u64,
21301        pub peg_multiplier_before: u128,
21302        pub base_asset_reserve_before: u128,
21303        pub quote_asset_reserve_before: u128,
21304        pub sqrt_k_before: u128,
21305        pub peg_multiplier_after: u128,
21306        pub base_asset_reserve_after: u128,
21307        pub quote_asset_reserve_after: u128,
21308        pub sqrt_k_after: u128,
21309        pub base_asset_amount_long: u128,
21310        pub base_asset_amount_short: u128,
21311        pub base_asset_amount_with_amm: i128,
21312        pub total_fee: i128,
21313        pub total_fee_minus_distributions: i128,
21314        pub adjustment_cost: i128,
21315        pub oracle_price: i64,
21316        pub fill_record: u128,
21317        pub number_of_users: u32,
21318        pub market_index: u16,
21319    }
21320    #[event]
21321    pub struct SignedMsgOrderRecord {
21322        pub user: Pubkey,
21323        pub hash: String,
21324        pub matching_order_params: OrderParams,
21325        pub user_order_id: u32,
21326        pub signed_msg_order_max_slot: u64,
21327        pub signed_msg_order_uuid: [u8; 8],
21328        pub ts: i64,
21329    }
21330    #[event]
21331    pub struct OrderRecord {
21332        pub ts: i64,
21333        pub user: Pubkey,
21334        pub order: Order,
21335    }
21336    #[event]
21337    pub struct OrderActionRecord {
21338        pub ts: i64,
21339        pub action: OrderAction,
21340        pub action_explanation: OrderActionExplanation,
21341        pub market_index: u16,
21342        pub market_type: MarketType,
21343        pub filler: Option<Pubkey>,
21344        pub filler_reward: Option<u64>,
21345        pub fill_record_id: Option<u64>,
21346        pub base_asset_amount_filled: Option<u64>,
21347        pub quote_asset_amount_filled: Option<u64>,
21348        pub taker_fee: Option<u64>,
21349        pub maker_fee: Option<i64>,
21350        pub referrer_reward: Option<u32>,
21351        pub quote_asset_amount_surplus: Option<i64>,
21352        pub spot_fulfillment_method_fee: Option<u64>,
21353        pub taker: Option<Pubkey>,
21354        pub taker_order_id: Option<u32>,
21355        pub taker_order_direction: Option<PositionDirection>,
21356        pub taker_order_base_asset_amount: Option<u64>,
21357        pub taker_order_cumulative_base_asset_amount_filled: Option<u64>,
21358        pub taker_order_cumulative_quote_asset_amount_filled: Option<u64>,
21359        pub maker: Option<Pubkey>,
21360        pub maker_order_id: Option<u32>,
21361        pub maker_order_direction: Option<PositionDirection>,
21362        pub maker_order_base_asset_amount: Option<u64>,
21363        pub maker_order_cumulative_base_asset_amount_filled: Option<u64>,
21364        pub maker_order_cumulative_quote_asset_amount_filled: Option<u64>,
21365        pub oracle_price: i64,
21366        pub bit_flags: u8,
21367    }
21368    #[event]
21369    pub struct LPRecord {
21370        pub ts: i64,
21371        pub user: Pubkey,
21372        pub action: LPAction,
21373        pub n_shares: u64,
21374        pub market_index: u16,
21375        pub delta_base_asset_amount: i64,
21376        pub delta_quote_asset_amount: i64,
21377        pub pnl: i64,
21378    }
21379    #[event]
21380    pub struct LiquidationRecord {
21381        pub ts: i64,
21382        pub liquidation_type: LiquidationType,
21383        pub user: Pubkey,
21384        pub liquidator: Pubkey,
21385        pub margin_requirement: u128,
21386        pub total_collateral: i128,
21387        pub margin_freed: u64,
21388        pub liquidation_id: u16,
21389        pub bankrupt: bool,
21390        pub canceled_order_ids: Vec<u32>,
21391        pub liquidate_perp: LiquidatePerpRecord,
21392        pub liquidate_spot: LiquidateSpotRecord,
21393        pub liquidate_borrow_for_perp_pnl: LiquidateBorrowForPerpPnlRecord,
21394        pub liquidate_perp_pnl_for_deposit: LiquidatePerpPnlForDepositRecord,
21395        pub perp_bankruptcy: PerpBankruptcyRecord,
21396        pub spot_bankruptcy: SpotBankruptcyRecord,
21397    }
21398    #[event]
21399    pub struct SettlePnlRecord {
21400        pub ts: i64,
21401        pub user: Pubkey,
21402        pub market_index: u16,
21403        pub pnl: i128,
21404        pub base_asset_amount: i64,
21405        pub quote_asset_amount_after: i64,
21406        pub quote_entry_amount: i64,
21407        pub settle_price: i64,
21408        pub explanation: SettlePnlExplanation,
21409    }
21410    #[event]
21411    pub struct InsuranceFundRecord {
21412        pub ts: i64,
21413        pub spot_market_index: u16,
21414        pub perp_market_index: u16,
21415        pub user_if_factor: u32,
21416        pub total_if_factor: u32,
21417        pub vault_amount_before: u64,
21418        pub insurance_vault_amount_before: u64,
21419        pub total_if_shares_before: u128,
21420        pub total_if_shares_after: u128,
21421        pub amount: i64,
21422    }
21423    #[event]
21424    pub struct InsuranceFundStakeRecord {
21425        pub ts: i64,
21426        pub user_authority: Pubkey,
21427        pub action: StakeAction,
21428        pub amount: u64,
21429        pub market_index: u16,
21430        pub insurance_vault_amount_before: u64,
21431        pub if_shares_before: u128,
21432        pub user_if_shares_before: u128,
21433        pub total_if_shares_before: u128,
21434        pub if_shares_after: u128,
21435        pub user_if_shares_after: u128,
21436        pub total_if_shares_after: u128,
21437    }
21438    #[event]
21439    pub struct SwapRecord {
21440        pub ts: i64,
21441        pub user: Pubkey,
21442        pub amount_out: u64,
21443        pub amount_in: u64,
21444        pub out_market_index: u16,
21445        pub in_market_index: u16,
21446        pub out_oracle_price: i64,
21447        pub in_oracle_price: i64,
21448        pub fee: u64,
21449    }
21450    #[event]
21451    pub struct SpotMarketVaultDepositRecord {
21452        pub ts: i64,
21453        pub market_index: u16,
21454        pub deposit_balance: u128,
21455        pub cumulative_deposit_interest_before: u128,
21456        pub cumulative_deposit_interest_after: u128,
21457        pub deposit_token_amount_before: u64,
21458        pub amount: u64,
21459    }
21460    #[event]
21461    pub struct DeleteUserRecord {
21462        pub ts: i64,
21463        pub user_authority: Pubkey,
21464        pub user: Pubkey,
21465        pub sub_account_id: u16,
21466        pub keeper: Option<Pubkey>,
21467    }
21468    #[event]
21469    pub struct FuelSweepRecord {
21470        pub ts: i64,
21471        pub authority: Pubkey,
21472        pub user_stats_fuel_insurance: u32,
21473        pub user_stats_fuel_deposits: u32,
21474        pub user_stats_fuel_borrows: u32,
21475        pub user_stats_fuel_positions: u32,
21476        pub user_stats_fuel_taker: u32,
21477        pub user_stats_fuel_maker: u32,
21478        pub fuel_overflow_fuel_insurance: u128,
21479        pub fuel_overflow_fuel_deposits: u128,
21480        pub fuel_overflow_fuel_borrows: u128,
21481        pub fuel_overflow_fuel_positions: u128,
21482        pub fuel_overflow_fuel_taker: u128,
21483        pub fuel_overflow_fuel_maker: u128,
21484    }
21485    #[event]
21486    pub struct FuelSeasonRecord {
21487        pub ts: i64,
21488        pub authority: Pubkey,
21489        pub fuel_insurance: u128,
21490        pub fuel_deposits: u128,
21491        pub fuel_borrows: u128,
21492        pub fuel_positions: u128,
21493        pub fuel_taker: u128,
21494        pub fuel_maker: u128,
21495        pub fuel_total: u128,
21496    }
21497}