//! On-chain events (`sol_log_data` via Steel `event!` / `.log()`).
//!
//! ## Event contract
//!
//! | Event | Trigger | Observer |
//! |---|---|---|
//! | `Deposited` | `Deposit` ix | Indexer credits user's off-chain USDC balance |
//! | `Paid` | `AdminPayout` ix | Bot confirms payout in DB |
//! | `Initialized` | `Initialize` ix | One-time setup confirmation |
//!
//! Settlement outcome (UP/DOWN) is derived off-chain by the bot via Pyth Hermes.

use steel::*;

/// Emitted by `Initialize`.
#[repr(C)]
#[derive(Clone, Copy, Debug, PartialEq, Pod, Zeroable)]
pub struct Initialized {
    pub admin: Pubkey,
}

/// Emitted by `Deposit`. Indexer credits `user`'s off-chain balance by `amount` µUSDC.
#[repr(C)]
#[derive(Clone, Copy, Debug, PartialEq, Pod, Zeroable)]
pub struct Deposited {
    pub user: Pubkey,
    pub amount: u64,
}

/// Emitted by `AdminPayout`. Bot confirms the payout was delivered.
#[repr(C)]
#[derive(Clone, Copy, Debug, PartialEq, Pod, Zeroable)]
pub struct Paid {
    pub recipient: Pubkey,
    pub amount: u64,
    pub series_id: u16,
    pub _pad: [u8; 6],
    pub period: u64,
}

event!(Initialized);
event!(Deposited);
event!(Paid);
