streak-api 0.1.7

API for interacting with the STREAK directional markets protocol on Solana
Documentation
use steel::*;

#[repr(u32)]
#[derive(Debug, Error, Clone, Copy, PartialEq, Eq, IntoPrimitive)]
pub enum StreakError {
    #[error("Invalid instruction data")]
    InvalidInstruction = 0,
    #[error("Program already initialized")]
    AlreadyInitialized = 1,
    #[error("Signer is not authorized for this instruction")]
    Unauthorized = 2,
    #[error("Account does not match expected PDA")]
    BadPda = 3,
    #[error("Program not initialized — call Initialize first")]
    NotInitialized = 4,
    #[error("Arithmetic overflow")]
    Overflow = 5,
    #[error("Mint mismatch")]
    BadMint = 6,
    #[error("Treasury balance insufficient for payout")]
    InsufficientTreasury = 9,
    #[error("Deposit amount must be > 0")]
    ZeroAmount = 10,
    #[error("Price account owner is not the Pyth program")]
    PythBadOwner = 21,
    #[error("Could not parse Pyth price account")]
    PythInvalidAccount = 22,
    #[error("Pyth price is stale (exceeds PYTH_MAX_PRICE_AGE_SECS)")]
    OraclePriceStale = 23,
    #[error("Could not normalize oracle prices for comparison")]
    OracleNormalize = 24,
    #[error("Genesis price not set — call Initialize to seed the treasury price chain")]
    GenesisNotSet = 47,
}

error!(StreakError);