#[repr(C)]pub struct Market {Show 21 fields
pub period: u64,
pub series_id: u16,
pub _pad_series: [u8; 6],
pub open_ts: i64,
pub close_ts: i64,
pub rules_hash: [u8; 32],
pub total_up: u64,
pub total_down: u64,
pub loser_pot: u64,
pub reward_pool: u64,
pub winning_total: u64,
pub pyth_price_feed: Pubkey,
pub open_ref_price: i64,
pub open_ref_publish_time: i64,
pub open_ref_expo: i32,
pub _pad_expo: [u8; 4],
pub outcome: u8,
pub status: u8,
pub _pad_pre_commit: [u8; 6],
pub committed_up: u64,
pub committed_down: u64,
}Fields§
§period: u64§series_id: u16§_pad_series: [u8; 6]§open_ts: i64Inclusive Unix second when betting may begin (after open anchor within grace window).
close_ts: i64Exclusive Unix second end of betting window (betting: open_ts ≤ now < close_ts).
rules_hash: [u8; 32]Commitment to resolution rules (e.g. hash of IPFS CID); UX / audits — does not affect oracle math.
total_up: u64§total_down: u64§loser_pot: u64Losing-side stake totals at settle (for pro-rata pot).
reward_pool: u64Subsidy from Treasury::daily_jackpot at settle (USDC base units).
winning_total: u64Winning-side stake total at settle.
pyth_price_feed: PubkeyLegacy Pyth price account pubkey (passed at InitMarket).
open_ref_price: i64Pyth aggregate (price) frozen by InitMarket near open_ts.
open_ref_publish_time: i64Matching Pyth publish_time (Unix seconds).
open_ref_expo: i32Pyth aggregate exponent for open_ref_price.
_pad_expo: [u8; 4]§outcome: u8§status: u8§_pad_pre_commit: [u8; 6]§committed_up: u64Stakes held in Position::STATE_COMMITTED_PREOPEN (USDC micros, mirrors total_up/down units); must be 0 before **[AdminInstantSettlement].
committed_down: u64Implementations§
Source§impl Market
impl Market
Sourcepub const SIDE_UP: u8 = 0
pub const SIDE_UP: u8 = 0
Same encoding as Position::side: resolved UP won.
Sourcepub const SIDE_DOWN: u8 = 1
pub const SIDE_DOWN: u8 = 1
Resolved DOWN won (includes oracle tie at normalized precision — strict-up wins only).
Sourcepub const OUTCOME_UNSET: u8 = 255
pub const OUTCOME_UNSET: u8 = 255
Before Market (ADMIN_INSTANT / FINALIZE); replaced at settle by Self::SIDE_UP or Self::SIDE_DOWN.
Sourcepub const STATUS_OPEN: u8 = 0
pub const STATUS_OPEN: u8 = 0
Accepting stakes via PlaceBet while STATUS_OPEN.
Sourcepub const STATUS_SETTLED: u8 = 1
pub const STATUS_SETTLED: u8 = 1
Resolved; executor ExecutorTreasury (distribute) for winners, or loss rollover on the next BuyTickets / PlaceBet.
Sourcepub const STATUS_VOIDED: u8 = 2
pub const STATUS_VOIDED: u8 = 2
Voided by AdminVoidMarket (e.g. BTC price move < 0.01%); positions refunded via AdminRefundVoidPosition.
Sourcepub const OUTCOME_VOID: u8 = 254
pub const OUTCOME_VOID: u8 = 254
Outcome written when a market is voided (distinct from OUTCOME_UNSET = 255 and settled outcomes).
pub fn pda(series_id: u16, period: u64) -> (Pubkey, u8)
pub fn init_open( series_id: u16, period: u64, open_ts: i64, close_ts: i64, pyth_price_feed: Pubkey, rules_hash: [u8; 32], ) -> Self
pub fn has_open_oracle_snapshot(&self) -> bool
Sourcepub fn merge_committed_preopen_into_pool(
&mut self,
pos: &mut Position,
) -> Result<(), StreakError>
pub fn merge_committed_preopen_into_pool( &mut self, pos: &mut Position, ) -> Result<(), StreakError>
Drain Position::STATE_COMMITTED_PREOPEN from committed_* into total_*, pos.state → STATE_PENDING ( PlaceBet live activation or ExecutorTreasury MERGE_COMMITTED ).
Trait Implementations§
Source§impl AccountValidation for Market
impl AccountValidation for Market
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 Market
impl Discriminator for Market
fn discriminator() -> u8
impl Copy for Market
impl Pod for Market
impl StructuralPartialEq for Market
Auto Trait Implementations§
impl Freeze for Market
impl RefUnwindSafe for Market
impl Send for Market
impl Sync for Market
impl Unpin for Market
impl UnsafeUnpin for Market
impl UnwindSafe for Market
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