Skip to main content

oil_api/state/
pool.rs

1use serde::{Deserialize, Serialize};
2use steel::*;
3
4use super::OilAccount;
5
6/// Pool account holds all staking-related data and SOL rewards for stakers.
7#[repr(C)]
8#[derive(Clone, Copy, Debug, PartialEq, Pod, Zeroable, Serialize, Deserialize)]
9pub struct Pool {
10    /// The amount of SOL available for staking rewards (2% of round winnings).
11    pub balance: u64,
12
13    /// The cumulative SOL distributed to stakers, divided by the total stake score at the time of distribution.
14    pub stake_rewards_factor: Numeric,
15
16    /// The current total staked score (sum of all balance * multiplier).
17    pub total_staked_score: u64,
18
19    /// The current total amount of OIL staked (stakers earn SOL rewards, not OIL).
20    pub total_staked: u64,
21
22    /// Buffer field (for future use, e.g., OIL rewards).
23    pub buffer_a: Numeric,
24
25    /// Total amount of OIL burned from early withdrawal penalties (deflationary).
26    pub total_burned_penalties: u64,
27
28    /// Buffer field (for future use).
29    pub buffer_c: u64,
30}
31
32account!(OilAccount, Pool);
33