Crate quarry_mine

Source
Expand description

Liquidity mining rewards distribution program.

The program consists of three types of accounts:

  • Rewarder, which controls token rewards distribution
  • Quarry, which receive rewards, and
  • Miner, which stake tokens into Quarrys to receive rewards.

This program is modeled after Synthetix’s StakingRewards.sol.

Modules§

account_validators
Validations for various accounts.
accounts
An Anchor generated module, providing a set of structs mirroring the structs deriving Accounts, where each field is a Pubkey. This is useful for specifying accounts for a client.
addresses
Contains addresses used for the Quarry program. These addresses are updated via program upgrades.
claim_rewards
claim_rewards_v2
create_miner
create_quarry
create_quarry_v2
instruction
An Anchor generated module containing the program’s set of instructions, where each method handler in the #[program] mod is associated with a struct defining the input arguments to the method. These should be used directly, when one wants to serialize Anchor instruction data, for example, when speciying instructions on a client.
new_rewarder
new_rewarder_v2
payroll
Calculates token distribution rates.
program
Module representing the program.
quarry
Quarry-related math and helpers.
quarry_mine
Program for quarry_mine.
rescue_tokens
Implementation of the crate::quarry_mine::rescue_tokens instruction.
rewarder
Rewarder utilities.

Macros§

gen_miner_signer_seeds
Generates the signer seeds for a crate::Miner.
gen_rewarder_signer_seeds
Generates the signer seeds for a crate::Rewarder.

Structs§

AcceptAuthority
Accounts for quarry_mine::accept_authority.
ClaimEvent
Emitted when reward tokens are claimed.
ClaimRewards
Accounts for crate::quarry_mine::claim_rewards.
ClaimRewardsV2
ClaimRewardsV2 accounts
CreateMiner
Accounts for quarry_mine::create_miner.
CreateQuarry
Accounts for quarry_mine::create_quarry.
CreateQuarryV2
Accounts for quarry_mine::create_quarry_v2.
ExtractFees
Accounts for quarry_mine::extract_fees.
Miner
An account that has staked tokens into a Quarry.
MinerCreateEvent
Triggered when a new miner is created.
MutableRewarderWithAuthority
Mutable Rewarder that requires the authority to be a signer.
MutableRewarderWithPauseAuthority
Accounts for quarry_mine::pause and quarry_mine::unpause.
NewRewarder
Accounts for quarry_mine::new_rewarder.
NewRewarderEvent
Emitted when a new Rewarder is created.
NewRewarderV2
Accounts for quarry_mine::new_rewarder_v2.
Quarry
A pool which distributes tokens to its Miners.
QuarryCreateEvent
Emitted when a new quarry is created.
QuarryRewardsUpdateEvent
Emitted when a quarry’s reward rate is updated.
ReadOnlyRewarderWithAuthority
Read-only Rewarder that requires the authority to be a signer.
RescueTokens
Accounts for the crate::quarry_mine::rescue_tokens instruction.
Rewarder
Controls token rewards distribution to all Quarrys. The Rewarder is also the quarry_mint_wrapper::Minter registered to the quarry_mint_wrapper::MintWrapper.
RewarderAnnualRewardsUpdateEvent
Emitted when the daily rewards rate is updated.
SetAnnualRewards
Accounts for quarry_mine::set_annual_rewards.
SetFamine
Accounts for quarry_mine::set_famine.
SetPauseAuthority

SetRewardsShare
Accounts for quarry_mine::set_rewards_share.
StakeEvent
Emitted when tokens are staked into a Quarry.
TransferAuthority
Accounts for quarry_mine::transfer_authority.
UpdateQuarryRewards
Accounts for quarry_mine::update_quarry_rewards.
UserClaim
Claim accounts
UserClaimV2
Claim accounts
UserStake
Staking accounts
WithdrawEvent
Emitted when tokens are withdrawn from a Quarry.

Enums§

ErrorCode
Error Codes

Constants§

DEFAULT_CLAIM_FEE_MILLIBPS
The fees of new Rewarders: 1,000 milliBPS = 1 BP or 0.01%. This may be changed by governance in the future via program upgrade.
MAX_ANNUAL_REWARDS_RATE
Maximum number of tokens that can be rewarded by a Rewarder per year.
MAX_BPS
The maximum number of basis points possible.

Statics§

ID
The static program ID
security_txt
Static string containing the security.txt file.

Functions§

check_id
Confirms that a given pubkey is equivalent to the program ID
entry
The Anchor codegen exposes a programming model where a user defines a set of methods inside of a #[program] module in a way similar to writing RPC request handlers. The macro then generates a bunch of code wrapping these user defined methods into something that can be executed on Solana.
entrypoint
Safety
handler
handler
handler
Creates a Miner for the given authority.
handler
handler
handler
handler
handler
Handler for the crate::quarry_mine::rescue_tokens instruction.
id
Returns the program ID