This commit is contained in:
Hardhat Chad
2025-06-13 16:05:39 -07:00
parent 1d9b0ebd42
commit b24883d8ff
11 changed files with 59 additions and 5 deletions

View File

@@ -76,6 +76,7 @@ pub fn process_close(accounts: &[AccountInfo<'_>], _data: &[u8]) -> ProgramResul
authority: block.reward.lode_authority,
block_id: block.id,
rewards_type: RewardsType::Lode as u64,
ts: clock.unix_timestamp,
}
.log();
}

View File

@@ -137,6 +137,7 @@ pub fn process_mine(accounts: &[AccountInfo<'_>], data: &[u8]) -> ProgramResult
authority: miner.authority,
block_id: block.id,
rewards_type: RewardsType::Motherlode as u64,
ts: clock.unix_timestamp,
}
.log();
}
@@ -164,6 +165,7 @@ pub fn process_mine(accounts: &[AccountInfo<'_>], data: &[u8]) -> ProgramResult
authority: miner.authority,
block_id: block.id,
rewards_type: RewardsType::Nugget as u64,
ts: clock.unix_timestamp,
}
.log();
}

View File

@@ -223,6 +223,18 @@ pub fn process_open(accounts: &[AccountInfo<'_>], data: &[u8]) -> ProgramResult
&[BLOCK, &id.to_le_bytes()],
)?;
// Emit event.
OpenEvent {
id,
start_slot,
signer: *signer_info.key,
reward_config: block.reward,
liquidity_base: market.base.liquidity() as u64,
liquidity_quote: market.quote.liquidity() as u64,
ts: clock.unix_timestamp,
}
.log_return();
Ok(())
}