#[repr(C)]pub struct Auction {
pub halving_period_seconds: u64,
pub last_halving_time: u64,
pub base_mining_rates: [u64; 4],
pub min_pool_contribution: u64,
pub auction_duration_seconds: u64,
pub starting_prices: [u64; 4],
pub buffer_a: Numeric,
pub total_auction_oil_minted: u64,
pub halving_count: u64,
pub buffer_d: u64,
}Expand description
Singleton auction configuration account
Fields§
§halving_period_seconds: u64[REPURPOSED] Total OIL minted from auction-based mining (in atomic units) Used for supply-based halving: halvings occur at 1M, 2.5M, 5M, 10M, etc. OIL Originally: halving_period_seconds (no longer used for time-based halving)
last_halving_time: u64[REPURPOSED] Number of halvings that have been applied (starts at 0) Each halving reduces rates by 25% (multiply by 0.75) Originally: last_halving_time (no longer used for time-based halving)
base_mining_rates: [u64; 4]Base mining rates per well (OIL per second, in atomic units) Macaron’s rates: totaling 4.0 OIL/s
- Well 0 (Seep): 0.4 OIL/s = 40,000,000,000 atomic units/s
- Well 1 (Flow): 0.8 OIL/s = 80,000,000,000 atomic units/s
- Well 2 (Gusher): 1.2 OIL/s = 120,000,000,000 atomic units/s
- Well 3 (Blowout): 1.6 OIL/s = 160,000,000,000 atomic units/s Total: 4.0 OIL/s (matches Macaron’s rates) Creates meaningful trade-offs: higher rates = higher competition & prices
min_pool_contribution: u64Minimum contribution to join auction pool (0.01 SOL = 10,000,000 lamports)
auction_duration_seconds: u64Auction duration in seconds (1 hour = 3600)
starting_prices: [u64; 4]Starting prices per well (in lamports) Scaled to match mining rate differentiation for strategic choices:
- Well 0 (Seep): 0.1 SOL = 100,000,000 lamports (lowest price, accessible)
- Well 1 (Flow): 0.2 SOL = 200,000,000 lamports (2x Well 0)
- Well 2 (Gusher): 0.3 SOL = 300,000,000 lamports (3x Well 0)
- Well 3 (Blowout): 0.4 SOL = 400,000,000 lamports (4x Well 0)
buffer_a: NumericBuffer field (for future use)
total_auction_oil_minted: u64Total OIL minted from auction-based mining (in atomic units) Used for supply-based halving: halvings occur at 1M, 2.5M, 5M, 10M, etc. OIL Repurposed from buffer_b - maintains account layout compatibility
halving_count: u64Number of halvings that have been applied (starts at 0) Each halving reduces rates by 25% (multiply by 0.75) Repurposed from buffer_c - maintains account layout compatibility
buffer_d: u64Buffer field (for future use)
Implementations§
Source§impl Auction
impl Auction
pub fn pda() -> (Pubkey, u8)
Sourcepub fn next_halving_threshold(&self) -> u64
pub fn next_halving_threshold(&self) -> u64
Get the next halving threshold based on current halving count Halving thresholds: 1M, 2.5M, 5M, 10M, 20M, 40M, etc. (exponential) All thresholds are in atomic units (multiply OIL amounts by ONE_OIL) Formula: threshold = (1_000_000 * ONE_OIL) * multiplier for first 3, then doubles
Sourcepub fn should_apply_halving(&self) -> u64
pub fn should_apply_halving(&self) -> u64
Check if halving should be applied based on total OIL minted Returns number of halvings to apply (can be > 1 if multiple thresholds crossed)
Trait Implementations§
Source§impl AccountValidation for Auction
impl AccountValidation for Auction
fn assert<F>(&self, condition: F) -> Result<&Self, ProgramError>
fn assert_err<F>( &self, condition: F, err: ProgramError, ) -> Result<&Self, ProgramError>
fn assert_msg<F>(&self, condition: F, msg: &str) -> Result<&Self, ProgramError>
fn assert_mut<F>(&mut self, condition: F) -> Result<&mut Self, ProgramError>
fn assert_mut_err<F>( &mut self, condition: F, err: ProgramError, ) -> Result<&mut Self, ProgramError>
fn assert_mut_msg<F>( &mut self, condition: F, msg: &str, ) -> Result<&mut Self, ProgramError>
Source§impl<'de> Deserialize<'de> for Auction
impl<'de> Deserialize<'de> for Auction
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Discriminator for Auction
impl Discriminator for Auction
fn discriminator() -> u8
impl Copy for Auction
impl Pod for Auction
impl StructuralPartialEq for Auction
Auto Trait Implementations§
impl Freeze for Auction
impl RefUnwindSafe for Auction
impl Send for Auction
impl Sync for Auction
impl Unpin for Auction
impl UnwindSafe for Auction
Blanket Implementations§
Source§impl<T> AccountDeserialize for Twhere
T: Discriminator + Pod,
impl<T> AccountDeserialize for Twhere
T: Discriminator + Pod,
fn try_from_bytes(data: &[u8]) -> Result<&T, ProgramError>
fn try_from_bytes_mut(data: &mut [u8]) -> Result<&mut T, ProgramError>
Source§impl<T> AccountHeaderDeserialize for Twhere
T: Discriminator + Pod,
impl<T> AccountHeaderDeserialize for Twhere
T: Discriminator + Pod,
fn try_header_from_bytes(data: &[u8]) -> Result<(&T, &[u8]), ProgramError>
fn try_header_from_bytes_mut( data: &mut [u8], ) -> Result<(&mut T, &mut [u8]), ProgramError>
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
Source§type Bits = T
type Bits = T
Self must have the same layout as the specified Bits except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern.Source§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
bits
as &Self.Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more