#[repr(C)]pub struct Position {
pub authority: Pubkey,
pub series_id: u16,
pub _pad_series: [u8; 6],
pub period: u64,
pub stake: u64,
pub side: u8,
pub state: u8,
pub _pad: [u8; 6],
}Fields§
§series_id: u16§_pad_series: [u8; 6]§period: u64§stake: u64§side: u8Market::SIDE_UP or Market::SIDE_DOWN; matches [Market::outcome] after settle.
state: u8[STATE_PENDING] / [STATE_COMMITTED_PREOPEN] / [STATE_CLAIMED_WIN] / [STATE_FINALIZED_LOSS] / [STATE_COMMIT_REFUNDED].
_pad: [u8; 6]Implementations§
Source§impl Position
impl Position
Sourcepub const STATE_PENDING: u8 = 0
pub const STATE_PENDING: u8 = 0
Open (PlaceBet may add stake until settle).
Sourcepub const STATE_CLAIMED_WIN: u8 = 1
pub const STATE_CLAIMED_WIN: u8 = 1
Winner paid via ExecutorTreasury (distribute) (executor).
Sourcepub const STATE_FINALIZED_LOSS: u8 = 2
pub const STATE_FINALIZED_LOSS: u8 = 2
Loser bookkeeping: the next period’s BuyTickets or PlaceBet finalizes this after settlement.
Sourcepub const STATE_COMMITTED_PREOPEN: u8 = 3
pub const STATE_COMMITTED_PREOPEN: u8 = 3
Locked before open-anchor / early window: tickets debited; merged into STATE_PENDING + total_* during live window via PlaceBet (ticket_units == 0, user), first live PlaceBet with stake, or ExecutorTreasury EXECUTOR_KIND_MERGE_COMMITTED_POSITION (executor).
Sourcepub const STATE_COMMIT_REFUNDED: u8 = 4
pub const STATE_COMMIT_REFUNDED: u8 = 4
Reserved legacy state (no instruction writes this today); PlaceBet commit path may recycle stake == 0 accounts.
pub fn pda(series_id: u16, period: u64, authority: Pubkey) -> (Pubkey, u8)
Trait Implementations§
Source§impl AccountValidation for Position
impl AccountValidation for Position
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 Position
impl Discriminator for Position
fn discriminator() -> u8
impl Copy for Position
impl Pod for Position
impl StructuralPartialEq for Position
Auto Trait Implementations§
impl Freeze for Position
impl RefUnwindSafe for Position
impl Send for Position
impl Sync for Position
impl Unpin for Position
impl UnsafeUnpin for Position
impl UnwindSafe for Position
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