oil_api/consts.rs
1use const_crypto::ed25519;
2use solana_program::{pubkey, pubkey::Pubkey};
3
4/// The authority allowed to initialize the program.
5pub const ADMIN_ADDRESS: Pubkey = pubkey!("DEvGq2WVuA3qkSCtwwuMYThY4onkJunEHSAxU5cieph8");
6
7/// The decimal precision of the OIL token.
8/// There are 100 billion indivisible units per OIL (called "grams").
9pub const TOKEN_DECIMALS: u8 = 11;
10
11/// One OIL token, denominated in indivisible units.
12pub const ONE_OIL: u64 = 10u64.pow(TOKEN_DECIMALS as u32);
13
14/// The duration of one minute, in seconds.
15pub const ONE_MINUTE: i64 = 60;
16
17/// The duration of one hour, in seconds.
18pub const ONE_HOUR: i64 = 60 * ONE_MINUTE;
19
20/// The duration of one day, in seconds.
21pub const ONE_DAY: i64 = 24 * ONE_HOUR;
22
23/// The number of seconds for when the winning square expires.
24pub const ONE_WEEK: i64 = 7 * ONE_DAY;
25
26/// The number of slots in one minute.
27/// Fogo has ~40ms slots, so 60 seconds = 1500 slots (60 / 0.04 = 1500)
28pub const ONE_MINUTE_SLOTS: u64 = 1500;
29
30/// The number of slots in one hour.
31pub const ONE_HOUR_SLOTS: u64 = 60 * ONE_MINUTE_SLOTS;
32
33/// The number of slots in 12 hours.
34pub const TWELVE_HOURS_SLOTS: u64 = 12 * ONE_HOUR_SLOTS;
35
36/// The number of slots in one day.
37pub const ONE_DAY_SLOTS: u64 = 24 * ONE_HOUR_SLOTS;
38
39/// The number of slots in one week.
40pub const ONE_WEEK_SLOTS: u64 = 7 * ONE_DAY_SLOTS;
41
42/// The number of slots for breather between rounds.
43/// On Fogo (~40ms slots): 350 slots = ~14 seconds, 500 slots = ~20 seconds
44/// This gives enough time for the entropy seed to be revealed and for the UI to show the animation.
45/// Original Solana value was 35 slots (~14 seconds), scaled for Fogo's 10x faster chain.
46pub const INTERMISSION_SLOTS: u64 = 350;
47
48/// The maximum token supply (21 million).
49/// Mirrors Bitcoin's 21M supply, representing a Solana-native store of value.
50pub const MAX_SUPPLY: u64 = ONE_OIL * 21_000_000;
51
52/// The seed of the automation account PDA.
53pub const AUTOMATION: &[u8] = b"automation";
54
55/// The seed of the board account PDA.
56pub const BOARD: &[u8] = b"board";
57
58/// The seed of the config account PDA.
59pub const CONFIG: &[u8] = b"config";
60
61/// The seed of the miner account PDA.
62pub const MINER: &[u8] = b"miner";
63
64/// The seed of the rig account PDA (auction-based mining).
65pub const RIG: &[u8] = b"rig";
66
67/// The seed of the referral account PDA.
68pub const REFERRAL: &[u8] = b"referral";
69
70/// The seed of the seeker account PDA.
71pub const SEEKER: &[u8] = b"seeker";
72
73/// The seed of the square account PDA.
74pub const SQUARE: &[u8] = b"square";
75
76/// The seed of the stake account PDA.
77pub const STAKE: &[u8] = b"stake";
78
79/// The seed of the round account PDA.
80pub const ROUND: &[u8] = b"round";
81
82/// The seed of the treasury account PDA.
83pub const TREASURY: &[u8] = b"treasury";
84
85/// The seed of the pool account PDA.
86pub const POOL: &[u8] = b"pool";
87
88/// The seed of the well account PDA.
89pub const WELL: &[u8] = b"well";
90
91/// The seed of the bid account PDA.
92pub const BID: &[u8] = b"bid";
93
94/// The seed of the auction account PDA.
95pub const AUCTION: &[u8] = b"auction";
96
97/// The seed of the square account PDA (auction state per well).
98pub const EPOCH: &[u8] = b"epoch";
99
100/// Program id for const pda derivations
101const PROGRAM_ID: [u8; 32] = unsafe { *(&crate::id() as *const Pubkey as *const [u8; 32]) };
102
103/// The address of the config account.
104pub const CONFIG_ADDRESS: Pubkey =
105 Pubkey::new_from_array(ed25519::derive_program_address(&[CONFIG], &PROGRAM_ID).0);
106
107/// The address of the mint account.
108pub const MINT_ADDRESS: Pubkey = pubkey!("oiLTuhTJc9qRDr2FcMiCUBJ3BCunNXP1LGJCG7svBSy");
109
110/// The address of the sol mint account.
111pub const SOL_MINT: Pubkey = pubkey!("So11111111111111111111111111111111111111112");
112
113/// The address to indicate OIL rewards are split between all miners.
114pub const SPLIT_ADDRESS: Pubkey = pubkey!("SpLiT11111111111111111111111111111111111112");
115
116/// The address of the treasury account.
117pub const TREASURY_ADDRESS: Pubkey =
118 Pubkey::new_from_array(ed25519::derive_program_address(&[TREASURY], &PROGRAM_ID).0);
119
120/// The address of the treasury account.
121pub const TREASURY_BUMP: u8 = ed25519::derive_program_address(&[TREASURY], &PROGRAM_ID).1;
122
123/// Denominator for fee calculations.
124pub const DENOMINATOR_BPS: u64 = 10_000;
125
126/// The fee paid to bots if they checkpoint a user.
127pub const CHECKPOINT_FEE: u64 = 10_000; // 0.00001 SOL
128
129/// The fixed emission per round for block-based mining.
130pub const EMISSION_PER_ROUND: u64 = 200;
131
132/// The minimum cooldown period (in seconds) between auction OIL claims to prevent spam.
133pub const CLAIM_AUCTION_OIL_COOLDOWN_SECONDS: i64 = 10;
134
135/// The floor price for auction wells (in lamports).
136/// Price decays linearly from init_price down to this floor over auction_duration_seconds.
137/// Once price reaches floor, it stays at floor until someone bids.
138pub const AUCTION_FLOOR_PRICE: u64 = 10_000_000; // 0.01 SOL (testnet)
139
140/// The fee paid to the admin for each transaction.
141pub const ADMIN_FEE: u64 = 100; // 1%
142
143/// The address to receive the admin fee.
144pub const ADMIN_FEE_COLLECTOR: Pubkey = pubkey!("FEEFFuugN2rj9fcgrdoSfMdPFkRCfkpKi4vCGGYPyEVV");
145
146/// The swap program used for buybacks.
147pub const SWAP_PROGRAM: Pubkey = pubkey!("vnt1u7PzorND5JjweFWmDawKe2hLWoTwHU6QKz6XX98");
148
149/// The address of the var account.
150pub const VAR_ADDRESS: Pubkey = pubkey!("DQGNTK6bcSMgDQ73b5Fdg6xUwVmvzxP18v4sVdFpEHXb");
151
152/// The address which can call the bury and wrap instructions.
153pub const BURY_AUTHORITY: Pubkey = pubkey!("BoT3qYmE6xePWPU96Kf2QeuJr1pDgQ3gLWbA6kSyjzV");