pub struct Market {
pub discriminator: [u8; 8],
pub market_id: u64,
pub num_outcomes: u8,
pub status: MarketStatus,
pub winning_outcome: u8,
pub has_winning_outcome: bool,
pub bump: u8,
pub oracle: Pubkey,
pub question_id: [u8; 32],
pub condition_id: [u8; 32],
}Expand description
Market account - represents a market
Layout:
- [0..8] discriminator (8 bytes)
- [8..16] market_id (8 bytes)
- [16] num_outcomes (1 byte)
- [17] status (1 byte)
- [18] winning_outcome (1 byte)
- [19] has_winning_outcome (1 byte)
- [20] bump (1 byte)
- [21..24] _padding (3 bytes)
- [24..56] oracle (32 bytes)
- [56..88] question_id (32 bytes)
- [88..120] condition_id (32 bytes)
Fields§
§discriminator: [u8; 8]Account discriminator
market_id: u64Unique market ID
num_outcomes: u8Number of possible outcomes (2-6)
status: MarketStatusCurrent market status
winning_outcome: u8Winning outcome index (255 if not resolved)
has_winning_outcome: boolWhether a winning outcome has been set
bump: u8PDA bump seed
oracle: PubkeyOracle pubkey that can settle this market
question_id: [u8; 32]Question ID (32 bytes)
condition_id: [u8; 32]Condition ID derived from oracle + question_id + num_outcomes
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Market
impl RefUnwindSafe for Market
impl Send for Market
impl Sync for Market
impl Unpin for Market
impl UnwindSafe for Market
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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