bucks-api 0.2.0

White label stablecoin launchpad
Documentation
use const_crypto::ed25519;
use solana_program::{pubkey, pubkey::Pubkey};

/// The authority allowed to initialize the program.
pub const ADMIN_ADDRESS: Pubkey = pubkey!("HBUh9g46wk2X89CvaNN15UmsznP59rh6od1h8JwYAopk");

/// The seed of the mint account PDA.
pub const MINT: &[u8] = b"mint";

/// The seed of the stable account PDA.
pub const STABLE: &[u8] = b"stable";

/// The seed of the vault account PDA.
pub const VAULT: &[u8] = b"vault";

/// The seed of the protocol account PDA.
pub const PROTOCOL: &[u8] = b"protocol";

/// The seed of the position account PDA.
pub const POSITION: &[u8] = b"position";

/// The address of the Bucks vault account.
pub const VAULT_ADDRESS: Pubkey = pubkey!("9znvhq6ae8nTsSW2VU49pQnq1or3Ne12q7ehRYXf8YTw");

/// The address of the USDC token.
pub const USDC_ADDRESS: Pubkey = pubkey!("EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v");

/// The number of decimals for the token.
pub const TOKEN_DECIMALS: u8 = 6;

/// The default platform fee in basis points (1000 = 10%).
pub const DEFAULT_PLATFORM_FEE_BPS: u16 = 1000;

/// Denominator for fee calculations (10000 = 100%).
pub const DENOMINATOR_BPS: u64 = 10_000;

/// Shares per USDC for share calculations (1000 shares per USDC).
pub const SHARES_PER_USDC: u64 = 1000;

/// Exchange rate precision (1e9).
pub const EXCHANGE_RATE_PRECISION: u64 = 1_000_000_000;

// =============================================================================
// Protocol IDs
// =============================================================================

/// Protocol ID for Kamino.
pub const PROTOCOL_KAMINO: u8 = 0;

/// Protocol ID for Perena.
pub const PROTOCOL_PERENA: u8 = 1;

// =============================================================================
// Kamino Lending Integration
// =============================================================================

pub const LENDING_MARKET_ADDRESS: Pubkey = pubkey!("DxXdAyU3kCjnyggvHmY5nAwg5cRbbmdyX3npfDMjjMek");

pub const LENDING_MARKET_AUTHORITY_ADDRESS: Pubkey =
    pubkey!("B9spsrMK6pJicYtukaZzDyzsUQLgc3jbx5gHVwdDxb6y");

pub const RESERVE_ADDRESS: Pubkey = pubkey!("Ga4rZytCpq1unD4DbEJ5bkHeUz9g3oh9AAFEi6vSauXp");

pub const RESERVE_LIQUIDITY_SUPPLY_ADDRESS: Pubkey =
    pubkey!("GENey8es3EgGiNTM8H8gzA3vf98haQF8LHiYFyErjgrv");

/// The address of the reserve's ctoken account.
pub const RESERVE_CTOKEN_ADDRESS: Pubkey = pubkey!("6WnymZBTAekuHf9DgsaDKJ397oEZ3qMApNMHg9qjqhgm");

/// The address of the reserve farm account.
pub const RESERVE_FARM_STATE_ADDRESS: Pubkey =
    pubkey!("EGDhupegCXLtonYDSY67c4dzw86S9eMxsntQ1yxWSoHv");

/// Address for price oracle.
pub const SCOPE_PRICES_ADDRESS: Pubkey = pubkey!("3t4JZcueEzTbVP6kLxXrL3VpWx45jDer4eqysweBchNH");

/// The mint address of the Kamino ctoken.
pub const CTOKEN_ADDRESS: Pubkey = pubkey!("32XLsweyeQwWgLKRVAzS72nxHGU1JmmNQQZ3C3q6fBjJ");

/// The address of the Kamino lending program.
pub const KLEND_PROGRAM_ID: Pubkey = pubkey!("KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD");

/// The address of the KFarms program.
pub const KFARMS_PROGRAM_ID: Pubkey = pubkey!("FarmsPZpWu9i7Kky8tPN37rs2TpmMrAZrC7S7vJa91Hr");

/// The address of the Kamino lending obligation account.
pub const OBLIGATION_ADDRESS: Pubkey = Pubkey::new_from_array(
    ed25519::derive_program_address(
        &[
            &2u8.to_le_bytes(),
            &0u8.to_le_bytes(),
            unsafe { &*(&VAULT_ADDRESS as *const Pubkey as *const [u8; 32]) },
            unsafe { &*(&LENDING_MARKET_ADDRESS as *const Pubkey as *const [u8; 32]) },
            unsafe { &*(&USDC_ADDRESS as *const Pubkey as *const [u8; 32]) },
            unsafe { &*(&USDC_ADDRESS as *const Pubkey as *const [u8; 32]) },
        ],
        unsafe { &*(&KLEND_PROGRAM_ID as *const Pubkey as *const [u8; 32]) },
    )
    .0,
);

/// The address of the reserve farm user state account.
pub const RESERVE_FARM_USER_STATE_ADDRESS: Pubkey = Pubkey::new_from_array(
    ed25519::derive_program_address(
        &[
            b"user",
            unsafe { &*(&RESERVE_FARM_STATE_ADDRESS as *const Pubkey as *const [u8; 32]) },
            unsafe { &*(&OBLIGATION_ADDRESS as *const Pubkey as *const [u8; 32]) },
        ],
        unsafe { &*(&KFARMS_PROGRAM_ID as *const Pubkey as *const [u8; 32]) },
    )
    .0,
);

// =============================================================================
// Perena Integration (bankineco)
// =============================================================================

/// The address of the Perena bankineco program.
pub const PERENA_PROGRAM_ID: Pubkey = pubkey!("save8RQVPMWNTzU18t3GBvBkN9hT7jsGjiCQ28FpD9H");

/// The address of the USD* mint (Perena receipt token / bank_mint).
pub const USD_STAR_MINT: Pubkey = pubkey!("star9agSpjiFe3M49B3RniVU4CMBBEK3Qnaqn3RGiFM");

/// The address of the Perena bank_state account (BankGenState).
pub const PERENA_BANK_STATE: Pubkey = pubkey!("sM6P4mh53CnG4faN4Fo3seY7wMSAiHdy8o6gKjwQF7A");

/// The address of the Perena vault_state account (VaultGenState).
pub const PERENA_VAULT_STATE: Pubkey = pubkey!("3bZ1qY6wfzyDH7QMPiRKLr6k8p1asdtyjvJyJsJBdv23");

/// The address of the Perena oracle_state account (OracleGenState).
pub const PERENA_ORACLE_STATE: Pubkey = pubkey!("CmKFP4YJg5QpAryUm9xk5QD611bccYMzZvpvQDJkMwt6");

/// The address of the Perena team_state account (TeamState).
pub const PERENA_TEAM_STATE: Pubkey = pubkey!("6tqLkhbqJSx4KG616VhNCvsaFqcDPok7wdbzU2DmEAub");

/// The address of the Perena USDC vault (yielding_vault_ata).
pub const PERENA_YIELDING_VAULT: Pubkey = pubkey!("HvG7HSrNHVAcjzgwt3UVtnY9srkrY7qnMG4zS1SnPQT2");

/// The address of the Perena fee team ATA.
pub const PERENA_FEE_TEAM_ATA: Pubkey = pubkey!("3msJbxNbSeosztbNEB1eFPitMFnP8ogCszegPUswipdL");

// =============================================================================
// Address Lookup Table
// =============================================================================

/// The address of the lookup table for multi-protocol transactions.
pub const LUT_ADDRESS: Pubkey = pubkey!("4JhHm4zoyoUZdyVqx2ogA2VstnebQVjWDNfNS7uXzd8Y");