This commit is contained in:
Hardhat Chad
2025-09-22 08:51:59 -07:00
parent 94493ec754
commit 7abeb212e5
2 changed files with 7 additions and 7 deletions

View File

@@ -47,7 +47,6 @@ pub fn process_instruction(
// Seeker
OreInstruction::ClaimSeeker => process_claim_seeker(accounts, data)?,
_ => return Err(ProgramError::InvalidInstructionData),
}

View File

@@ -148,16 +148,17 @@ pub fn process_reset(accounts: &[AccountInfo<'_>], _data: &[u8]) -> ProgramResul
// Update min deploy amount.
let capacity: u64 = 16 * 25;
let threshold = capacity / 4;
let mut availability = 0;
let threshold = (capacity * 3) / 4;
let mut occupancy = 0;
for i in 0..25 {
availability += 16 - square.count[i];
occupancy += square.count[i];
}
if availability == 0 {
if occupancy == capacity {
// If board is full, double the minimum deploy amount.
config.min_deploy_amount *= 2;
} else if availability > threshold {
config.min_deploy_amount = 1u64.max(config.min_deploy_amount * 2);
} else if occupancy < threshold {
// If board is less than 75% full, reduce minimum deploy amount linearly.
let availability = capacity.saturating_sub(occupancy);
let pct = (availability * 100) / capacity;
let chg = (pct.saturating_sub(25) * 100) / 75;
let dif = (config.min_deploy_amount * chg) / 100;