volt_abi/
objects.rs

1use anchor_lang::prelude::*;
2
3#[account]
4#[derive(Default)]
5pub struct Whitelist {
6    pub admin: Pubkey,
7
8    /// The storage for information on reserves in the market
9    pub addresses: Vec<Pubkey>,
10}
11
12#[account]
13#[derive(Default)]
14/**
15 * User-specific PDA. Tracks information about their pending deposits.
16 *  NOTES:
17 *  1. There may only be one pending deposit (across all rounds) at any point in time
18 *  2. However, pending deposits will accumulate if made in same round.
19 *  3. Pending deposits from previous rounds may be claimed with the instruction "claim_pending"
20 */
21pub struct PendingDeposit {
22    // unnecessary variable. indicates whether account exists
23    pub initialized: bool,
24
25    // round number this pending deposit is for.
26    // #NOTE: round_number == 0 implies "no existing pending deposit"
27    pub round_number: u64,
28
29    // total amount that is or was pending to be deposited.
30    // this number is used to calculate the # of volt tokens user should expect to receive after calling claim_pending.
31    // this is incremented with new deposits, and decremented after calling claim_pending
32    pub num_underlying_deposited: u64,
33}
34
35impl PendingDeposit {
36    pub const LEN: usize = 17;
37}
38
39#[account]
40#[derive(Default)]
41/**
42 * User-specific PDA. Tracks information about their pending withdrawals.
43 *  NOTES:
44 *  1. There may only be one pending withdrawal (across all rounds) at any point in time
45 *  2. However, pending withdrawals will accumulate if made in same round.
46 *  3. Pending withdrawals from previous rounds may be claimed with the instruction "claim_pending_withdrawal"
47 */
48pub struct PendingWithdrawal {
49    // unnecessary variable. indicates whether account exists
50    pub initialized: bool,
51
52    // round number this pending withdrawal is for.
53    // #NOTE: round_number == 0 implies "no existing pending withdrawal"
54    pub round_number: u64,
55
56    // total amount that is or was pending to be deposited.
57    // this number is used to calculate the # of volt tokens user should expect to receive after calling claim_pending.
58    // this is incremented with new deposits, and decremented after calling claim_pending
59    pub num_volt_redeemed: u64,
60}
61
62impl PendingWithdrawal {
63    pub const LEN: usize = 17;
64}
65
66#[account]
67#[derive(Default)]
68pub struct UlOpenOrdersMetadata {
69    initialized: bool, // 1
70}
71
72impl UlOpenOrdersMetadata {
73    pub const LEN: usize = 1;
74}
75
76#[account]
77#[derive(Default, PartialEq, Debug)]
78pub struct EntropyRound {
79    pub instant_deposits_native: u64,
80    pub prev_entropy_account_deposits: u64,
81    pub initial_equity: f64,             //
82    pub new_equity_post_deposit: f64,    // 16
83    pub deposit_amt: f64,                // 24
84    pub withdraw_comp_from_deposit: u64, // 32
85    pub net_deposits: f64,               // 40
86    pub deposit_amt_native: u64,         // 48
87    pub withdraw_amt_native: u64,        // 56
88    pub total_volt_supply: u64,
89    pub oracle_price: f64,
90
91    pub acct_equity_start: f64,
92    pub acct_equity_before_next_rebalance: f64,
93    pub pnl_quote: f64,
94    pub performance_fees_quote: f64,
95
96    pub temp1: Pubkey,        // 368
97    pub temp2: Pubkey,        // 400
98    pub temp3: Pubkey,        // 432
99    pub extra_key_11: Pubkey, // 464
100    pub extra_key_12: Pubkey, // 496
101
102    pub unused_uint_four: u64, // 504
103    pub unused_uint_five: u64, // 512
104    pub unused_uint_six: u64,  // 520
105    pub unused_uint_12: u64,   // 568
106
107    pub unused_float1: f64, // 504
108    pub unused_float2: f64, // 512
109    pub unused_float3: f64, // 520
110    pub unused_float4: f64, // 568
111
112    pub unused_bool_one: bool,   // 569
113    pub unused_bool_two: bool,   // 570
114    pub unused_bool_three: bool, // 571
115    pub unused_bool_four: bool,
116}
117
118impl EntropyRound {
119    pub const LEN: usize = 348;
120}
121
122#[account]
123#[derive(Default)]
124/**
125 * Epoch-specific PDA. Stores all information specific to that epoch.
126 * New rounds are initialized in start_round.
127 * Modified in deposit, withdraw, claim_pending, claim_pending_withdrawal
128 */
129pub struct Round {
130    // numerical ranking of this round. round numbers start at 1, and are incremented
131    // following each successful call of start_round
132    pub number: u64,
133
134    // total # of underlying from pending deposits created during this round.
135    // NOTE: this has to be stored in the Round account in order to calculate correct
136    // proportion of vault tokens for each user in claim_pending
137    pub underlying_from_pending_deposits: u64,
138
139    // total # of volt tokens from pending withdrawals created during this round.
140    // NOTE: this has to be stored in the Round account in order to calculate correct
141    // proportion of underlying tokens for each user in claim_pending_withdrawal
142    pub volt_tokens_from_pending_withdrawals: u64,
143
144    pub underlying_pre_enter: u64,
145
146    pub underlying_post_settle: u64,
147
148    pub premium_farmed: u64,
149    // pub unused_space: [u64; 7],
150}
151
152impl Round {
153    pub const LEN: usize = 48;
154}
155
156#[account]
157#[derive(Default)]
158pub struct FriktionEpochInfo {
159    pub vault_token_price: f64,      // 8
160    pub pct_pnl: f64,                // 16
161    pub number: u64,                 // 24
162    pub underlying_pre_enter: u64,   // 32
163    pub underlying_post_settle: u64, // 40
164    pub volt_token_supply: u64,      // 48
165    pub pnl: i64,                    // 56
166
167    pub performance_fees: u64, // 64
168    pub withdrawal_fees: u64,  // 72
169
170    pub pending_deposits: u64, // 80
171
172    pub pending_withdrawals_volt_tokens: u64, // 88
173    pub pending_withdrawals: u64,             // 96
174    // in volt tokens
175    pub canceled_withdrawals: u64, // 104
176    pub canceled_deposits: u64,    // 112
177    pub total_withdrawals: u64,    // 120
178    pub total_deposits: u64,       // 128
179    pub instant_deposits: u64,     // 136
180    pub instant_withdrawals: u64,  // 144
181    // previously dao_deposits
182    pub unused_uint_1: u64,  // 152
183    pub minted_options: u64, // 160
184
185    pub enter_num_times_called: u64,        // 168
186    pub swap_premium_num_times_called: u64, // 176
187
188    pub option_key: Pubkey, // 208
189
190    pub extra_key_four: Pubkey, // 240
191    pub extra_key_5: Pubkey,    // 272
192    pub extra_key_6: Pubkey,    // 304
193    pub extra_key_7: Pubkey,    // 336
194    pub extra_key_8: Pubkey,    // 368
195    pub extra_key_9: Pubkey,    // 400
196    pub extra_key_10: Pubkey,   // 432
197    pub extra_key_11: Pubkey,   // 464
198    pub extra_key_12: Pubkey,   // 496
199
200    pub unused_uint_four: u64, // 504
201    pub unused_uint_five: u64, // 512
202    pub unused_uint_six: u64,  // 520
203    pub unused_uint_7: u64,    // 528
204    pub unused_uint_8: u64,    // 536
205    pub unused_uint_9: u64,    // 544
206    pub unused_uint_10: u64,   // 552
207    pub unused_uint_11: u64,   // 560
208    pub unused_uint_12: u64,   // 568
209
210    pub unused_bool_one: bool,   // 569
211    pub unused_bool_two: bool,   // 570
212    pub unused_bool_three: bool, // 571
213    pub unused_bool_four: bool,  // 572
214    pub unused_bool_five: bool,  // 573
215    pub unused_bool_six: bool,   // 574
216}
217
218impl FriktionEpochInfo {
219    pub const LEN: usize = 574;
220}
221
222#[account]
223#[derive(Default, Debug)]
224pub struct EntropyMetadata {
225    // generic across all entropy vaults
226    pub target_hedge_ratio: f64,
227
228    pub rebalancing_lenience: f64,
229
230    // basis volt stuff
231    pub required_basis_from_oracle: f64,
232
233    pub extra_key_3: Pubkey,  // 368
234    pub extra_key_4: Pubkey,  // 400
235    pub extra_key_5: Pubkey,  // 432
236    pub extra_key_6: Pubkey,  // 464
237    pub extra_key_7: Pubkey,  // 496
238    pub extra_key_8: Pubkey,  // 368
239    pub extra_key_9: Pubkey,  // 400
240    pub extra_key_10: Pubkey, // 432
241    pub extra_key_11: Pubkey, // 464
242    pub extra_key_12: Pubkey, // 496
243
244    pub unused_uint_four: u64, // 504
245    pub unused_uint_five: u64, // 512
246    pub unused_uint_six: u64,  // 520
247    pub unused_uint_12: u64,   // 568
248    pub unused_uint_123: u64,  // 504
249    pub unused_uint_456: u64,  // 512
250    pub unused_uint_789: u64,  // 520
251    pub unused_uint_102: u64,  // 568
252
253    pub unused_float1: f64,  // 504
254    pub unused_float2: f64,  // 512
255    pub unused_float3: f64,  // 520
256    pub unused_float4: f64,  // 568
257    pub unused_float5: f64,  // 504
258    pub unused_float6: f64,  // 512
259    pub unused_float7: f64,  // 520
260    pub unused_float8: f64,  // 568
261    pub unused_float9: f64,  // 504
262    pub unused_float10: f64, // 512
263    pub unused_float11: f64, // 520
264    pub unused_float12: f64, // 568
265
266    pub unused_bool_one: bool,   // 569
267    pub unused_bool_two: bool,   // 570
268    pub unused_bool_three: bool, // 571
269    pub unused_bool_four: bool,
270    pub unused_bool_five: bool,  // 569
271    pub unused_bool_six: bool,   // 570
272    pub unused_bool_seven: bool, // 571
273    pub unused_bool_eight: bool,
274    pub unused_bool_nine: bool, // 571
275    pub unused_bool_ten: bool,
276
277    pub vault_name: String,
278}
279
280impl EntropyMetadata {
281    pub const LEN: usize = 512 + 30;
282}
283
284#[account]
285#[derive(Default, Copy, Debug)]
286pub struct ExtraVoltData {
287    pub is_whitelisted: bool, // 1
288
289    pub whitelist: Pubkey, // 33
290
291    pub is_for_dao: bool, // 34
292
293    pub dao_program_id: Pubkey, // 66
294
295    // spl mint of deposit token
296    pub deposit_mint: Pubkey, // 98
297
298    // target leverage amount (as ratio) for the position (for each rebalance)
299    pub target_leverage: f64, // 106
300
301    // defines width of interval collateralization ratio at end of round must lie within
302    pub target_leverage_lenience: f64, // 114
303
304    // leverage threshold for calling exit_early instructoin
305    pub exit_early_ratio: f64, // 130
306
307    // is this trading on mango or entropy (or 01 :P)?
308    pub entropy_program_id: Pubkey, // 194
309
310    // group the protocol trades on
311    pub entropy_group: Pubkey, // 226 186
312
313    // account the program initializes to trade with
314    pub entropy_account: Pubkey, // 258 218
315
316    // pubkey of perp market to trade
317    pub power_perp_market: Pubkey, // 322
318
319    // true after settle_deposits was called successfully for current round
320    pub have_resolved_deposits: bool, // 355
321
322    // true after obtained target collateralization, ready to end round
323    pub done_rebalancing: bool, // 356
324
325    pub non_payer_authority: Pubkey, // 388
326    pub serum_program_id: Pubkey,    // 420
327    pub entropy_cache: Pubkey,       // 348 (actual)
328    /// pubkey of perp market to hedge
329    pub spot_perp_market: Pubkey, // 354 (380)
330    pub extra_key_7: Pubkey,         // 516  412
331    pub extra_key_8: Pubkey,         // 548 444
332    pub extra_key_9: Pubkey,         // 580
333    pub extra_key_10: Pubkey,        // 612
334    pub extra_key_11: Pubkey,        // 644
335    pub extra_key_12: Pubkey,
336    pub extra_key_13: Pubkey,
337    pub extra_key_14: Pubkey, // 636
338
339    pub net_withdrawals: u64,      // 644
340    pub max_quote_pos_change: u64, // 652
341    // defines width of dollar delta range hedge must lie within
342    pub target_hedge_lenience: f64, // 122
343    pub unused_uint_four: u64,      // 676
344    pub unused_uint_five: u64,      // 684
345    pub unused_uint_six: u64,       // 692
346    pub unused_uint_7: u64,         // 700
347    pub unused_uint_8: u64,         // 708
348    pub unused_uint_9: u64,         // 716
349    pub unused_uint_10: u64,        // 724
350    pub unused_uint_11: u64,        //
351    pub unused_uint_12: u64,        // 732
352
353    pub turn_off_deposits_and_withdrawals: bool, //
354    pub rebalance_is_ready: bool,                //
355    pub unused_bool1234: bool,                   //
356    pub done_rebalancing_power_perp: bool,       //
357    pub is_hedging_on: bool,                     //
358    pub have_taken_performance_fees: bool,       // 738
359}
360
361impl ExtraVoltData {
362    pub const LEN: usize = 738;
363}
364
365#[account]
366#[derive(Default, Copy, Debug)]
367pub struct VoltVault {
368    // permissioned instructions
369    pub admin_key: Pubkey, // 32
370
371    pub seed: Pubkey, // 64
372
373    ///////// time windows ///////////
374
375    // length of withdrawal window in seconds
376    pub transfer_window: u64, // 72
377
378    // time at which withdrawals began
379    pub start_transfer_time: u64, // 80
380
381    // minimum time at which withdrawals end
382    pub end_transfer_time: u64, // 88
383
384    ///////// rebalance pipeline state ///////////
385
386    // has vault been initialized?
387    pub initialized: bool, // 89
388
389    // has the current/previous options position been settled?
390    // settlement is defined as having all AUM of this volt stored in one asset (underlying)
391    pub curr_option_was_settled: bool, // 90
392
393    // do we have to swap premium to underlying before entering position?
394    pub must_swap_premium_to_underlying: bool, // 91
395
396    // has the next option to roll into been set?
397    pub next_option_was_set: bool, // 92
398
399    // has set_next_option been called successfully a single time yet?
400    pub first_ever_option_was_set: bool, // 93
401
402    // should deposit/withdraw still be validly callable?
403    pub instant_transfers_enabled: bool, // 94
404
405    // has rebalance prepare been called this cycle?
406    pub prepare_is_finished: bool, // 95
407
408    // are we out of options to sell in the rebalance enter stage of this cycle?
409    pub enter_is_finished: bool, // 96
410
411    // has the current round started?
412    pub round_has_started: bool, // 97
413
414    // round number of roll. increments post-settlement (maybe set next option)
415    pub round_number: u64, // 105
416
417    ////// Rewards Tracking //////
418
419    // total amount in vault when set next option was last called
420    pub total_underlying_pre_enter: u64, // 113
421
422    // total amount in vault immediately following full settlement
423    pub total_underlying_post_settle: u64, // 121
424
425    // total number of volt tokens in supply post settlement
426    // used for calculating share of pnl
427    pub total_volt_tokens_post_settle: u64, // 129
428
429    ///////// accounts to save here so others can read. additionally for account_validators.rs ///////////
430    pub vault_authority: Pubkey, // 161
431
432    // pools
433    pub deposit_pool: Pubkey, // 193
434
435    pub premium_pool: Pubkey, // 225
436
437    pub option_pool: Pubkey, // 257
438
439    pub writer_token_pool: Pubkey, // 289
440
441    // mints
442    pub vault_mint: Pubkey, // 321
443
444    pub underlying_asset_mint: Pubkey, // 353
445
446    pub quote_asset_mint: Pubkey, // 385
447
448    pub option_mint: Pubkey, // 417
449
450    pub writer_token_mint: Pubkey, // 449
451
452    pub option_market: Pubkey, // 481
453
454    ///////// vault strategy params ///////////
455
456    // integer describing the vault strategy
457    pub vault_type: u64, // 489
458
459    /// The amount of the **underlying asset** that derives a single option
460    pub underlying_amount_per_contract: u64, // 497
461
462    // strike * underlying per contract
463    pub quote_amount_per_contract: u64, // 505
464
465    /// The Unix timestamp at which the contracts in this market expire
466    pub expiration_unix_timestamp: i64, // 513
467
468    // exact expiry length the target option should have, except for the initial option
469    pub expiration_interval: u64, // 521
470
471    // option is assumed to be OTM. this limits how high the strike can be relative to current underlying price.
472    // i.e, new strike must be less than or equal to (underlying price * upper_bound_otm_strike_factor)
473    // NOTE: value should be given from client as (desired factor) * 10, so need to divide by 10 to get actual normalization
474    pub upper_bound_otm_strike_factor: u64, // 529
475
476    /// A flag to set and use to when running a memcmp query.
477    /// This will be set when Serum markets are closed and expiration is validated
478    pub have_taken_withdrawal_fees: bool, // 530
479
480    ///////// serum ///////////
481    pub serum_spot_market: Pubkey, // 562
482
483    // bump for program address of open orders account (serum)
484    pub open_orders_bump: u8, // 563
485
486    // bump for serum (unknown)
487    pub open_orders_init_bump: u8, // 564
488
489    // bump for open orders for underlying serum market
490    pub ul_open_orders_bump: u8, // 565
491
492    // open orders account for underlying spot market
493    pub ul_open_orders: Pubkey, // 597
494
495    // was the ul open orders acct already initialized?
496    pub ul_open_orders_initialized: bool, // 598
497
498    // bump for vault authority, used to generate signer seeds for CPI calls
499    pub bump_authority: u8, // 599
500
501    // order size in # contracts to sell options
502    pub serum_order_size_options: u64, // 607
503
504    // order size in # contracts to sell options
505    pub individual_capacity: u64, // 615
506
507    // type of order to submit (limit, postonly, IOC)
508    pub serum_order_type: u64, // 623
509
510    // unknown usage, set to 65535 works
511    pub serum_limit: u16, // 625
512
513    // specifies what serum should do if the order is matched w/ an order from the same account
514    pub serum_self_trade_behavior: u16, // 627
515
516    // order ID to use when sending a serum order. should be incremented following each succesful order
517    pub serum_client_order_id: u64, // 635
518    // pub whitelist: Pubkey,
519    // pub unused_space:
520    // pub unused_space: [u64; 30],
521    pub whitelist_token_mint: Pubkey, // 667
522
523    pub permissioned_market_premium_mint: Pubkey, // 699
524    pub permissioned_market_premium_pool: Pubkey, // 731
525    // pub extra_key_two:   ,
526    pub capacity: u64, // 739
527                       // pub unused_uint_two: u64,
528                       // pub extra_key_three: Pubkey,
529                       // pub extra_key_four: Pubkey,
530
531                       // pub unused_uint_one: u64,
532                       // pub unused_uint_two: u64,
533                       // pub unused_uint_three: u64,
534                       // pub unused_uint_four: u64,
535                       // pub unused_uint_five: u64,
536                       // pub unused_uint_six: u64,
537}
538
539impl VoltVault {
540    pub const LEN: usize = 739;
541}
542
543#[account]
544#[derive(Debug)]
545pub struct PrincipalProtectionVaultV1 {
546    pub initialized: bool,
547
548    pub vault_name: String,
549
550    // pub base: PrincipalProtectionCoreV1,
551    pub keys: PrincipalProtectionAccountsV1,
552
553    pub allocation_strategy: SecondLegAllocationStrategy,
554    pub lending_strategy: LendingStrategy,
555    // pub meta: PrincipalProtectionMetadataV1,
556    // pub padding1: [u8; 1024],
557    // pub padding2: [u8; 1024],
558    // pub padding3: [u8; 1024],
559    // pub padding4: [u8; 1024],
560    // pub padding5: [u8; 1024],
561    // pub padding6: [u8; 1024],
562    // pub padding7: [u8; 1024],
563}
564
565impl PrincipalProtectionVaultV1 {
566    // pub const LEN: usize = PrincipalProtectionCoreV1::LEN
567    pub const LEN: usize = 1 + 25  + PrincipalProtectionAccountsV1::LEN
568        // + PrincipalProtectionMetadataV1::LEN
569        // + PrincipalProtectionPadding::LEN
570        // 25 for vault name
571        + 1 + 8 + 1 + LendingParams::LEN + 8192;
572
573    pub fn get_underlying_deposit_queue(&self) -> Pubkey {
574        self.get_primary_lending_vault_keys()
575            .underlying_deposit_queue
576    }
577
578    pub fn get_underlying_withdraw_queue(&self) -> Pubkey {
579        self.get_primary_lending_vault_keys()
580            .underlying_withdraw_queue
581    }
582
583    pub fn get_primary_lending_vault_keys(&self) -> &PrimaryVaultKeys {
584        &self.keys.lending_keys.primary_vault
585    }
586
587    pub fn get_primary_lending_vault_pda(&self) -> Pubkey {
588        self.get_primary_lending_vault_keys().vault_pda
589    }
590
591    pub fn get_lending_shares_pool(&self) -> Pubkey {
592        self.keys.lending_shares_pool
593    }
594
595    pub fn get_deposit_into_lending_ata(&self) -> Pubkey {
596        self.keys.deposit_into_lending_ata
597    }
598
599    pub fn get_shares_mint(&self) -> Pubkey {
600        self.keys.lending_keys.primary_vault.shares_mint
601    }
602
603    pub fn get_option_token_pool(&self) -> Pubkey {
604        self.keys.options_keys.option_token_pool
605    }
606
607    pub fn get_deposit_tracking_pda(&self) -> Pubkey {
608        self.keys.lending_keys.primary_vault.deposit_tracking_pda
609    }
610
611    pub fn get_deposit_tracking_account(&self) -> Pubkey {
612        self.keys
613            .lending_keys
614            .primary_vault
615            .deposit_tracking_account
616    }
617
618    pub fn get_primary_lending_vault_pk(&self) -> Pubkey {
619        self.get_primary_lending_vault_keys().vault
620    }
621
622    pub fn get_primary_lending_vault_program_id(&self) -> Pubkey {
623        self.get_primary_lending_vault_keys().program_id
624    }
625}
626
627// #[derive(AnchorSerialize, AnchorDeserialize, Clone, Copy, Debug)]
628// pub struct PrincipalProtectionCoreV1 {
629
630//     // pub padding: [u8; 1024],
631// }
632
633// impl PrincipalProtectionCoreV1 {
634//     // pub const LEN: usize = 2 * 16 + 8;
635//     pub const LEN: usize = std::mem::size_of::<PrincipalProtectionCoreV1>();
636// }
637
638#[derive(AnchorSerialize, AnchorDeserialize, Clone, Copy, Debug)]
639pub struct PrincipalProtectionAccountsV1 {
640    pub lending_keys: LendingKeys,
641    pub options_keys: OptionsContractKeys,
642    pub lending_shares_pool: Pubkey,
643    pub deposit_into_lending_ata: Pubkey,
644    pub extra_key1: Pubkey,
645    pub extra_key2: Pubkey,
646    pub extra_key3: Pubkey,
647    pub extra_key4: Pubkey,
648    pub extra_key5: Pubkey,
649    pub extra_key6: Pubkey,
650    pub extra_key7: Pubkey,
651}
652
653impl PrincipalProtectionAccountsV1 {
654    // 25 is buffer
655    // pub const LEN: usize = (8 + 1 + 1 + 1 + 25 + 3) * 32;
656    pub const LEN: usize = std::mem::size_of::<PrincipalProtectionAccountsV1>();
657}
658
659// #[derive(AnchorSerialize, AnchorDeserialize, Clone, Copy, Debug)]
660// pub struct PrincipalProtectionMetadataV1 {
661//     pub padding: [u8; 1024],
662// }
663
664// impl PrincipalProtectionMetadataV1 {
665//     // pub const LEN: usize = 100;
666//     pub const LEN: usize = std::mem::size_of::<PrincipalProtectionMetadataV1>();
667// }
668
669#[derive(AnchorSerialize, AnchorDeserialize, Clone, Copy, Debug)]
670
671pub struct OptionsContractKeys {
672    pub program_id: Pubkey,
673    pub options_contract: Pubkey,
674    pub option_token_pool: Pubkey,
675
676    pub extra_key1: Pubkey,
677    pub extra_key2: Pubkey,
678    pub extra_key3: Pubkey,
679    pub extra_key4: Pubkey,
680}
681
682#[derive(AnchorSerialize, AnchorDeserialize, Clone, Copy, Debug, PartialEq)]
683pub enum SecondLegAllocationStrategy {
684    // apr in bps (e.g 1000 bps = 10%)
685    MinApr {
686        apr: u64,
687    },
688    // fraction of weekly pnl in bps (e.g 5000 bps = 1/2)
689    ProjectedPnlFraction {
690        fraction_bps: u64,
691    },
692    // fixed fraction of assets each week (in bps)
693    FixedFraction {
694        fraction_bps: u64,
695    },
696
697    ExtraStrategy1 {
698        uint1: u64,
699        uint2: u64,
700        uint3: u64,
701        uint4: u64,
702        u81: u8,
703        u82: u8,
704        u83: u8,
705        u84: u8,
706    },
707}
708
709#[derive(AnchorSerialize, AnchorDeserialize, Clone, Copy, Debug, Default, PartialEq)]
710
711pub struct LendingParams {
712    pub bool1: u8,
713    pub bool2: u8,
714    pub bool3: u8,
715    pub bool4: u8,
716    pub max_allowed_utilization_bps: u64,
717    pub unused_uint1: u64,
718    pub unused_uint2: u64,
719    pub unused_uint3: u64,
720    pub unused_uint4: u64,
721    pub unused_float1: f64,
722    pub unused_float2: f64,
723    pub unused_float3: f64,
724    pub unused_float4: f64,
725}
726
727impl LendingParams {
728    pub const LEN: usize = std::mem::size_of::<LendingParams>();
729}
730
731#[derive(AnchorSerialize, AnchorDeserialize, Clone, Copy, Debug, PartialEq)]
732
733pub enum LendingStrategy {
734    TulipOptimizer { params: LendingParams },
735}
736
737#[derive(AnchorSerialize, AnchorDeserialize, Clone, Copy, Debug, PartialEq)]
738pub struct PrimaryVaultKeys {
739    pub vault: Pubkey,
740    pub vault_pda: Pubkey,
741    // == vault_ul_account
742    pub underlying_deposit_queue: Pubkey,
743    pub underlying_withdraw_queue: Pubkey,
744
745    pub shares_mint: Pubkey,
746    pub underlying_mint: Pubkey,
747
748    pub deposit_tracking_account: Pubkey,
749    pub deposit_tracking_queue_account: Pubkey,
750    pub deposit_tracking_hold_account: Pubkey,
751    pub deposit_tracking_pda: Pubkey,
752
753    pub program_id: Pubkey,
754
755    pub extra_key_1: Pubkey,
756    pub extra_key_2: Pubkey,
757    pub extra_key_3: Pubkey,
758    pub extra_key_4: Pubkey,
759    pub extra_key_5: Pubkey,
760    pub extra_key_6: Pubkey,
761    // pub extra_key_7: Pubkey,
762    // pub extra_key_8: Pubkey,
763}
764
765#[derive(AnchorSerialize, AnchorDeserialize, Clone, Copy, Debug, PartialEq)]
766pub struct LendingKeys {
767    // TulipOptimizer {
768    pub primary_vault: PrimaryVaultKeys,
769    pub mango_vault: Pubkey,
770    pub solend_vault: Pubkey,
771    pub tulip_vault: Pubkey,
772}