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 aPubkey
. 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§
- Accept
Authority - Accounts for quarry_mine::accept_authority.
- Claim
Event - Emitted when reward tokens are claimed.
- Claim
Rewards - Accounts for crate::quarry_mine::claim_rewards.
- Claim
Rewards V2 - ClaimRewardsV2 accounts
- Create
Miner - Accounts for quarry_mine::create_miner.
- Create
Quarry - Accounts for quarry_mine::create_quarry.
- Create
Quarry V2 - Accounts for quarry_mine::create_quarry_v2.
- Extract
Fees - Accounts for quarry_mine::extract_fees.
- Miner
- An account that has staked tokens into a Quarry.
- Miner
Create Event - Triggered when a new miner is created.
- Mutable
Rewarder With Authority - Mutable Rewarder that requires the authority to be a signer.
- Mutable
Rewarder With Pause Authority - Accounts for quarry_mine::pause and quarry_mine::unpause.
- NewRewarder
- Accounts for quarry_mine::new_rewarder.
- NewRewarder
Event - Emitted when a new Rewarder is created.
- NewRewarder
V2 - Accounts for quarry_mine::new_rewarder_v2.
- Quarry
- A pool which distributes tokens to its Miners.
- Quarry
Create Event - Emitted when a new quarry is created.
- Quarry
Rewards Update Event - Emitted when a quarry’s reward rate is updated.
- Read
Only Rewarder With Authority - Read-only Rewarder that requires the authority to be a signer.
- Rescue
Tokens - 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.
- Rewarder
Annual Rewards Update Event - Emitted when the daily rewards rate is updated.
- SetAnnual
Rewards - Accounts for quarry_mine::set_annual_rewards.
- SetFamine
- Accounts for quarry_mine::set_famine.
- SetPause
Authority
- SetRewards
Share - Accounts for quarry_mine::set_rewards_share.
- Stake
Event - Emitted when tokens are staked into a Quarry.
- Transfer
Authority - Accounts for quarry_mine::transfer_authority.
- Update
Quarry Rewards - Accounts for quarry_mine::update_quarry_rewards.
- User
Claim - Claim accounts
- User
Claim V2 - Claim accounts
- User
Stake - Staking accounts
- Withdraw
Event - Emitted when tokens are withdrawn from a Quarry.
Enums§
- Error
Code - 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