Skip to main content

ore_api/state/
board.rs

1use serde::{Deserialize, Serialize};
2use steel::*;
3
4use crate::state::{board_pda, OreAccount};
5
6/// BoardV4 is a singleton account tracking global game state.
7#[repr(C)]
8#[derive(Clone, Copy, Debug, PartialEq, Pod, Zeroable, Serialize, Deserialize)]
9pub struct Board {
10    /// The current round number.
11    pub round_id: u64,
12
13    /// The slot at which the current round starts mining.
14    pub start_slot: u64,
15
16    /// The slot at which the current round ends mining.
17    pub end_slot: u64,
18
19    /// The exponential moving average of production cost (lamports per whole ORE).
20    pub production_cost_ema: u64,
21}
22
23impl Board {
24    pub fn pda(&self) -> (Pubkey, u8) {
25        board_pda()
26    }
27}
28
29account!(OreAccount, Board);