#[repr(C)]pub struct Rig {
pub authority: Pubkey,
pub auction_rewards_oil: u64,
pub auction_rewards_sol: u64,
pub auction_pool_contributions: [u64; 4],
pub auction_pool_epochs: [u64; 4],
pub auction_rewards_factor: Numeric,
pub auction_refined_oil: u64,
pub last_claim_oil_at: i64,
pub last_claim_sol_at: i64,
pub lifetime_rewards_oil: u64,
pub lifetime_rewards_sol: u64,
pub last_synced_epoch_id: [u64; 4],
}Expand description
Rig account for auction-based mining Similar to Driller but focused on auction wells
Fields§
The authority of this rig account (owner’s wallet).
auction_rewards_oil: u64OIL rewards from auction wells (not yet claimed) Accumulated when ownership changes (pre-minted) or when claiming current ownership (minted on-demand)
auction_rewards_sol: u64SOL rewards from auction wells (not yet claimed) Includes: outbid refunds, pool refunds from abandoned pools
auction_pool_contributions: [u64; 4]Current pool contributions per well (in lamports) [well_0, well_1, well_2, well_3] 0 = not contributing to this well
auction_pool_epochs: [u64; 4]Epoch ID per well that user contributed to [epoch_0, epoch_1, epoch_2, epoch_3] 0 = not contributing to this well Used to determine if pool is still active (compare with Well.epoch_id)
auction_rewards_factor: NumericThe rewards factor last time auction rewards were updated on this rig account.
auction_refined_oil: u64The amount of OIL this rig has earned from auction claim fees (refined OIL).
last_claim_oil_at: i64The last time this rig claimed OIL rewards.
last_claim_sol_at: i64The last time this rig claimed SOL rewards.
lifetime_rewards_oil: u64The total amount of OIL this rig has mined across all auction wells (lifetime).
lifetime_rewards_sol: u64The total amount of SOL this rig has earned across all auction wells (lifetime). Includes: outbid refunds, pool refunds, etc.
last_synced_epoch_id: [u64; 4]Last epoch ID per well that this rig synced (similar to checkpoint_id in Driller) [epoch_0, epoch_1, epoch_2, epoch_3] 0 = not synced for this well Used to enforce sync_auction_state before set_bid/join_auction_pool (like checkpoint before deploy) Ensures each user syncs their own refunds before participating in auctions
Implementations§
Source§impl Rig
impl Rig
pub fn pda(&self) -> (Pubkey, u8)
pub fn update_auction_rewards(&mut self, treasury: &Treasury)
Sourcepub fn credit_pool_refund(&mut self, well_id: usize, refund_amount: u64)
pub fn credit_pool_refund(&mut self, well_id: usize, refund_amount: u64)
Credit a pool refund to this rig account Called when a pool the user contributed to is abandoned Updates rig state: credits refund amount and clears pool tracking fields
Trait Implementations§
Source§impl AccountValidation for Rig
impl AccountValidation for Rig
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 Rig
impl<'de> Deserialize<'de> for Rig
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 Rig
impl Discriminator for Rig
fn discriminator() -> u8
impl Copy for Rig
impl Pod for Rig
impl StructuralPartialEq for Rig
Auto Trait Implementations§
impl Freeze for Rig
impl RefUnwindSafe for Rig
impl Send for Rig
impl Sync for Rig
impl Unpin for Rig
impl UnwindSafe for Rig
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