#[repr(C)]pub struct Auction {
pub halving_period_seconds: u64,
pub last_halving_time: u64,
pub base_mining_rates: [u64; 4],
pub auction_duration_seconds: u64,
pub starting_prices: [u64; 4],
pub buffer_a: Numeric,
pub halving_count: u64,
pub buffer_c: u64,
pub buffer_d: u64,
}Expand description
Singleton auction configuration account
Fields§
§halving_period_seconds: u64Subsequent halving period in seconds (28 days = 2,419,200 seconds)
last_halving_time: u64Timestamp of the last halving event (Unix timestamp in seconds)
base_mining_rates: [u64; 4]Base mining rates per well (OIL per second, in atomic units)
auction_duration_seconds: u64Auction duration in seconds (1 hour = 3600)
starting_prices: [u64; 4]Starting prices per well (in lamports)
buffer_a: NumericBuffer field (for future use)
halving_count: u64Number of halvings that have occurred (0 = none, 1 = first 50% halving, 2+ = 25% halvings)
buffer_c: u64Buffer field (for future use)
buffer_d: u64Buffer field (for future use)
Implementations§
Source§impl Auction
impl Auction
Sourcepub const FIRST_HALVING_PERIOD_SECONDS: u64
pub const FIRST_HALVING_PERIOD_SECONDS: u64
First halving period in seconds (14 days = 1,209,600 seconds) This is a constant, not stored in the account
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
Sourcepub fn should_apply_halving(&self, current_time: u64) -> (u64, bool)
pub fn should_apply_halving(&self, current_time: u64) -> (u64, bool)
Check if halving should be applied based on current time Returns (halvings_to_apply, is_first_halving)
Schedule:
- First halving: 14 days after initialization (50% reduction)
- Subsequent halvings: Every 28 days after first halving (25% reduction each)
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