oil_api/state/config.rs
1use serde::{Deserialize, Serialize};
2use steel::*;
3
4use crate::state::config_pda;
5
6use super::OilAccount;
7
8#[repr(C)]
9#[derive(Clone, Copy, Debug, PartialEq, Pod, Zeroable, Serialize, Deserialize)]
10pub struct Config {
11 /// The address that can update the config.
12 pub admin: Pubkey,
13
14 /// The adress with authority to call wrap and barrel.
15 pub barrel_authority: Pubkey,
16
17 /// The address that receives admin fees.
18 pub fee_collector: Pubkey,
19
20 /// The program to be used for protocol swaps.
21 pub swap_program: Pubkey,
22
23 /// The address of the entropy var account.
24 pub var_address: Pubkey,
25
26 /// Amount to pay to fee collector (bps)
27 pub admin_fee: u64,
28
29 /// Current emission week (used for automatic weekly halving)
30 pub emission_week: u64,
31
32 /// Timestamp when the last emission week was updated (for automatic weekly progression)
33 pub last_emission_week_update: u64,
34
35 /// Timestamp for Token Generation Event (TGE). If current time < tge_timestamp, pre-mine is active.
36 /// Set to 0 to disable pre-mine.
37 pub tge_timestamp: i64,
38}
39
40impl Config {
41 pub fn pda() -> (Pubkey, u8) {
42 config_pda()
43 }
44}
45
46account!(OilAccount, Config);