#[repr(C)]pub struct Treasury {
pub daily_jackpot: u64,
pub weekly_jackpot: u64,
pub buyback: u64,
pub next_period: [u64; 64],
pub current_week: u64,
}Fields§
§daily_jackpot: u64Daily jackpot accruals (tickets + settlement subsidy); debited via ExecutorTreasury (JACKPOT_PAY, daily pool).
weekly_jackpot: u64Weekly jackpot accruals (tickets + hook split); debited via ExecutorTreasury (JACKPOT_PAY, weekly pool).
buyback: u64§next_period: [u64; 64]Monotonic bookkeeping floor (max of period + 1 pushed by MARKET_LINE_RELEASE and by settlement when winning_total == 0).
InitMarket / PlaceBet do not require period == next_period[..]: many rounds may be deployed and traded like a listing grid; this cursor is ops / indexing only.
current_week: u64Monotonically increasing week counter. Incremented by AdminNewWeek
at the start of each scoring week (admin-gated, not time-derived on-chain).
Each Ledger stores Ledger::week_number and compares it
against this value on every instruction that touches weekly stats; stale weekly counters
are zeroed lazily (no all-ledger sweep needed).
Implementations§
Source§impl Treasury
impl Treasury
pub fn pda() -> (Pubkey, u8)
pub fn series_index(series_id: u16) -> Result<usize, StreakError>
Sourcepub fn bump_next_period_floor(
&mut self,
series_id: u16,
settled_period: u64,
) -> Result<(), StreakError>
pub fn bump_next_period_floor( &mut self, series_id: u16, settled_period: u64, ) -> Result<(), StreakError>
Advance next_period[slot] to at least settled_period + 1 (no-op if already higher).
Trait Implementations§
Source§impl AccountValidation for Treasury
impl AccountValidation for Treasury
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 Discriminator for Treasury
impl Discriminator for Treasury
fn discriminator() -> u8
impl Copy for Treasury
impl Pod for Treasury
impl StructuralPartialEq for Treasury
Auto Trait Implementations§
impl Freeze for Treasury
impl RefUnwindSafe for Treasury
impl Send for Treasury
impl Sync for Treasury
impl Unpin for Treasury
impl UnsafeUnpin for Treasury
impl UnwindSafe for Treasury
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