#[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 buffer_b: u64,
pub buffer_c: u64,
pub buffer_d: u64,
}Expand description
Singleton auction configuration account
Fields§
§halving_period_seconds: u64Halving period in seconds (28 days = 2,419,200 seconds) Halvings occur every 28 days, reducing mining rates by 50%
last_halving_time: u64Timestamp of the last halving event (Unix timestamp in seconds) Used to calculate when the next halving should occur
base_mining_rates: [u64; 4]Base mining rates per well (OIL per second, in atomic units) OIL’s rates: totaling 5.0 OIL/s (25% higher than Macaron’s 4.0 OIL/s)
- Well 0 (Seep): 0.5 OIL/s = 50,000,000,000 atomic units/s
- Well 1 (Flow): 1.0 OIL/s = 100,000,000,000 atomic units/s
- Well 2 (Gusher): 1.5 OIL/s = 150,000,000,000 atomic units/s
- Well 3 (Blowout): 2.0 OIL/s = 200,000,000,000 atomic units/s Total: 5.0 OIL/s (25% higher than Macaron’s 4.0 OIL/s) 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)
buffer_b: u64Buffer field (for future use)
buffer_c: u64Buffer field (for future use)
buffer_d: u64Buffer field (for future use)
Implementations§
Source§impl Auction
impl Auction
pub fn pda() -> (Pubkey, u8)
Sourcepub fn next_halving_time(&self) -> u64
pub fn next_halving_time(&self) -> u64
Get the timestamp when the next halving should occur Halvings occur every halving_period_seconds (28 days)
Sourcepub fn should_apply_halving(&self, current_time: u64) -> u64
pub fn should_apply_halving(&self, current_time: u64) -> u64
Check if halving should be applied based on current time Returns number of halvings to apply (can be > 1 if multiple periods passed) Each halving reduces rates by 50% (multiply by 0.5)
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