oil_api/state/
auction_pool.rs

1use serde::{Deserialize, Serialize};
2use steel::*;
3
4use crate::state::auction_pool_pda;
5use super::OilAccount;
6
7/// Auction pool account for a specific well and epoch
8/// PDA: [AUCTION_POOL, well_id, epoch_id]
9/// Tracks pool contributions and rewards for a specific auction epoch
10#[repr(C)]
11#[derive(Clone, Copy, Debug, PartialEq, Pod, Zeroable, Serialize, Deserialize)]
12pub struct AuctionPool {
13    /// Well ID this pool is for (0-3)
14    pub well_id: u64,
15    
16    /// Epoch ID this pool is for (included in PDA, stored here for convenience)
17    pub epoch_id: u64,
18    
19    /// Total SOL contributed to this pool (in lamports)
20    pub total_contributions: u64,
21    
22    /// Buffer field (for future use)
23    pub buffer_a: u64,
24    
25    /// Buffer field (for future use)
26    pub buffer_b: u64,
27    
28    /// Buffer field (for future use)
29    pub buffer_c: u64,
30}
31
32impl AuctionPool {
33    pub fn pda(well_id: u64, epoch_id: u64) -> (Pubkey, u8) {
34        auction_pool_pda(well_id, epoch_id)
35    }
36}
37
38account!(OilAccount, AuctionPool);