bucks-api 0.2.0

White label stablecoin launchpad
Documentation
use serde::{Deserialize, Serialize};
use steel::*;

use super::BucksAccount;

/// ProtocolRegistry - Tracks a registered yield protocol.
/// Each protocol (Kamino, Perena, etc.) has its own registry account.
#[repr(C)]
#[derive(Clone, Copy, Debug, PartialEq, Pod, Zeroable, Serialize, Deserialize)]
pub struct ProtocolRegistry {
    /// Unique identifier for this protocol (0 = Kamino, 1 = Perena, etc.).
    pub protocol_id: u8,

    /// Padding for alignment.
    pub _padding1: [u8; 7],

    /// Human-readable name of the protocol.
    pub name: [u8; 32],

    /// Whether this protocol is active (0 = inactive, 1 = active).
    pub active: u8,

    /// Padding for alignment.
    pub _padding2: [u8; 7],

    /// The balance of receipt tokens (cTokens for Kamino, USD* for Perena).
    pub receipt_token_balance: u64,

    /// The current USDC value of the receipt tokens.
    pub usdc_value: u64,

    /// Exchange rate: USDC per receipt token, scaled by 1e9.
    pub exchange_rate: u64,

    /// Unix timestamp of last exchange rate update.
    pub last_rate_update: i64,
}

account!(BucksAccount, ProtocolRegistry);