Skip to main content

kvault_interface/state/
vault_reward_info.rs

1use bytemuck::{Pod, Zeroable};
2
3/// Reward distribution state for a vault.
4///
5/// Tracks the per-second reward rate, last issuance timestamp, and the
6/// pool of rewards that has been topped up but not yet distributed to
7/// the vault's available liquidity.
8#[derive(Debug, Clone, Copy, Pod, Zeroable)]
9#[repr(C)]
10pub struct VaultRewardInfo {
11    /// Rewards distributed per second (in underlying token units).
12    pub reward_per_second: u64,
13    /// Unix timestamp of the last reward issuance.
14    pub last_issuance_ts: u64,
15    /// Rewards topped up but not yet moved to [`VaultState::token_available`](super::VaultState::token_available).
16    pub rewards_available: u64,
17    /// Cumulative rewards distributed (analytics only — does not affect accounting).
18    pub cumulative_rewards_distributed_analytics: u64,
19
20    /// Reserved for future use.
21    pub padding: [u64; 8],
22}
23
24const _: () = assert!(core::mem::size_of::<VaultRewardInfo>() == 96);